From 0872087ef56422541bd38d293f97613dfd10236f Mon Sep 17 00:00:00 2001 From: George Fu Date: Mon, 5 Feb 2024 13:19:09 -0500 Subject: [PATCH] feat: unified error dispatcher in protocols (#5756) * feat: error serde * chore: update codegen diff * chore: update smithy hash with small fix * chore: update codegen w/ as never --- .../src/protocols/Aws_restJson1.ts | 1566 +- .../src/protocols/Aws_restJson1.ts | 328 +- .../src/protocols/Aws_json1_1.ts | 1004 +- .../client-acm/src/protocols/Aws_json1_1.ts | 580 +- .../src/protocols/Aws_json1_1.ts | 3285 +--- .../client-amp/src/protocols/Aws_restJson1.ts | 1254 +- .../src/protocols/Aws_restJson1.ts | 1434 +- .../src/protocols/Aws_restJson1.ts | 1187 +- .../src/protocols/Aws_restJson1.ts | 877 +- .../src/protocols/Aws_restJson1.ts | 5392 +----- .../src/protocols/Aws_restJson1.ts | 79 +- .../src/protocols/Aws_restJson1.ts | 2662 +-- .../src/protocols/Aws_restJson1.ts | 2205 +-- .../src/protocols/Aws_restJson1.ts | 1545 +- .../src/protocols/Aws_restJson1.ts | 48 +- .../src/protocols/Aws_restJson1.ts | 1127 +- .../src/protocols/Aws_restJson1.ts | 1028 +- .../src/protocols/Aws_restJson1.ts | 827 +- .../src/protocols/Aws_json1_1.ts | 482 +- .../src/protocols/Aws_json1_1.ts | 1163 +- .../src/protocols/Aws_json1_1.ts | 1140 +- .../src/protocols/Aws_restJson1.ts | 202 +- .../src/protocols/Aws_json1_0.ts | 1370 +- .../src/protocols/Aws_json1_1.ts | 3736 +--- .../src/protocols/Aws_restJson1.ts | 3129 +--- .../src/protocols/Aws_restJson1.ts | 420 +- .../src/protocols/Aws_json1_1.ts | 2411 +-- .../src/protocols/Aws_restJson1.ts | 3043 +--- .../src/protocols/Aws_json1_1.ts | 202 +- .../src/protocols/Aws_query.ts | 2090 +-- .../client-b2bi/src/protocols/Aws_json1_0.ts | 1314 +- .../src/protocols/Aws_json1_0.ts | 977 +- .../src/protocols/Aws_restJson1.ts | 4828 +---- .../src/protocols/Aws_restJson1.ts | 403 +- .../src/protocols/Aws_restJson1.ts | 770 +- .../src/protocols/Aws_json1_1.ts | 418 +- .../src/protocols/Aws_restJson1.ts | 115 +- .../src/protocols/Aws_restJson1.ts | 1709 +- .../src/protocols/Aws_restJson1.ts | 69 +- .../src/protocols/Aws_restJson1.ts | 784 +- .../src/protocols/Aws_restJson1.ts | 1594 +- .../src/protocols/Aws_restJson1.ts | 503 +- .../src/protocols/Aws_json1_1.ts | 1022 +- .../src/protocols/Aws_restJson1.ts | 1657 +- .../src/protocols/Aws_restJson1.ts | 1683 +- .../src/protocols/Aws_restJson1.ts | 791 +- .../src/protocols/Aws_restJson1.ts | 2738 +-- .../src/protocols/Aws_restJson1.ts | 5731 +----- .../src/protocols/Aws_restJson1.ts | 11823 ++---------- .../src/protocols/Aws_restJson1.ts | 3206 +--- .../src/protocols/Aws_restJson1.ts | 885 +- .../src/protocols/Aws_json1_1.ts | 536 +- .../src/protocols/Aws_json1_0.ts | 414 +- .../src/protocols/Aws_restJson1.ts | 4386 +---- .../src/protocols/Aws_query.ts | 2644 +-- .../src/protocols/Aws_restJson1.ts | 205 +- .../src/protocols/Aws_restXml.ts | 7155 ++------ .../src/protocols/Aws_json1_1.ts | 589 +- .../src/protocols/Aws_json1_1.ts | 719 +- .../src/protocols/Aws_restJson1.ts | 67 +- .../src/protocols/Aws_query.ts | 1097 +- .../src/protocols/Aws_restJson1.ts | 11 +- .../src/protocols/Aws_json1_1.ts | 3390 +--- .../src/protocols/Aws_json1_1.ts | 1877 +- .../src/protocols/Aws_json1_1.ts | 3733 +--- .../src/protocols/Aws_query.ts | 1377 +- .../src/protocols/Aws_restJson1.ts | 2030 +-- .../src/protocols/Aws_json1_1.ts | 1510 +- .../src/protocols/Aws_restJson1.ts | 1716 +- .../src/protocols/Aws_json1_1.ts | 7088 ++------ .../src/protocols/Aws_json1_1.ts | 3091 +--- .../src/protocols/Aws_restJson1.ts | 534 +- .../src/protocols/Aws_restJson1.ts | 494 +- .../src/protocols/Aws_restJson1.ts | 883 +- .../src/protocols/Aws_json1_1.ts | 1495 +- .../src/protocols/Aws_json1_0.ts | 1150 +- .../src/protocols/Aws_restJson1.ts | 428 +- .../src/protocols/Aws_json1_1.ts | 658 +- .../src/protocols/Aws_json1_1.ts | 6890 ++----- .../src/protocols/Aws_json1_1.ts | 1052 +- .../src/protocols/Aws_restJson1.ts | 697 +- .../src/protocols/Aws_json1_1.ts | 4486 +---- .../src/protocols/Aws_json1_1.ts | 1082 +- .../src/protocols/Aws_json1_0.ts | 1303 +- .../src/protocols/Aws_json1_1.ts | 3413 +--- .../src/protocols/Aws_restJson1.ts | 11 +- .../src/protocols/Aws_restJson1.ts | 14248 +++------------ .../src/protocols/Aws_restJson1.ts | 963 +- .../src/protocols/Aws_restJson1.ts | 1543 +- .../src/protocols/Aws_restJson1.ts | 325 +- .../src/protocols/Aws_restJson1.ts | 645 +- .../src/protocols/Aws_json1_1.ts | 221 +- .../src/protocols/Aws_json1_1.ts | 1381 +- .../src/protocols/Aws_json1_0.ts | 239 +- .../src/protocols/Aws_restJson1.ts | 2134 +-- .../src/protocols/Aws_json1_1.ts | 731 +- .../src/protocols/Aws_json1_1.ts | 5166 +----- .../src/protocols/Aws_restJson1.ts | 1480 +- .../src/protocols/Aws_restJson1.ts | 1232 +- .../src/protocols/Aws_json1_1.ts | 1962 +- .../src/protocols/Aws_restJson1.ts | 5508 +----- .../client-dax/src/protocols/Aws_json1_1.ts | 969 +- .../src/protocols/Aws_restJson1.ts | 1103 +- .../src/protocols/Aws_json1_1.ts | 3691 +--- .../src/protocols/Aws_restJson1.ts | 1249 +- .../src/protocols/Aws_json1_1.ts | 2145 +-- .../src/protocols/Aws_json1_1.ts | 3669 +--- .../client-dlm/src/protocols/Aws_restJson1.ts | 252 +- .../src/protocols/Aws_restJson1.ts | 506 +- .../client-docdb/src/protocols/Aws_query.ts | 2102 +-- .../client-drs/src/protocols/Aws_restJson1.ts | 2728 +-- .../src/protocols/Aws_json1_0.ts | 125 +- .../src/protocols/Aws_json1_0.ts | 2199 +-- .../client-ebs/src/protocols/Aws_restJson1.ts | 238 +- .../src/protocols/Aws_json1_1.ts | 81 +- clients/client-ec2/src/protocols/Aws_ec2.ts | 13699 +------------- .../src/protocols/Aws_json1_1.ts | 1051 +- .../client-ecr/src/protocols/Aws_json1_1.ts | 2369 +-- .../client-ecs/src/protocols/Aws_json1_1.ts | 2423 +-- .../client-efs/src/protocols/Aws_restJson1.ts | 1354 +- .../src/protocols/Aws_restJson1.ts | 11 +- .../client-eks/src/protocols/Aws_restJson1.ts | 2508 +-- .../src/protocols/Aws_query.ts | 1451 +- .../src/protocols/Aws_restJson1.ts | 175 +- .../src/protocols/Aws_query.ts | 2039 +-- .../src/protocols/Aws_query.ts | 1056 +- .../src/protocols/Aws_restJson1.ts | 670 +- .../src/protocols/Aws_query.ts | 4459 +---- .../src/protocols/Aws_restJson1.ts | 1994 +-- .../src/protocols/Aws_restJson1.ts | 691 +- .../src/protocols/Aws_restJson1.ts | 496 +- .../client-emr/src/protocols/Aws_json1_1.ts | 1677 +- .../src/protocols/Aws_restJson1.ts | 1062 +- .../src/protocols/Aws_json1_1.ts | 2024 +-- .../src/protocols/Aws_restJson1.ts | 1817 +- .../src/protocols/Aws_restJson1.ts | 1391 +- .../src/protocols/Aws_restJson1.ts | 2756 +-- .../src/protocols/Aws_json1_1.ts | 412 +- .../client-fis/src/protocols/Aws_restJson1.ts | 712 +- .../client-fms/src/protocols/Aws_json1_1.ts | 1556 +- .../src/protocols/Aws_json1_1.ts | 2848 +-- .../src/protocols/Aws_json1_1.ts | 51 +- .../src/protocols/Aws_json1_1.ts | 3710 +--- .../src/protocols/Aws_json1_0.ts | 11 +- .../client-fsx/src/protocols/Aws_json1_1.ts | 2456 +-- .../src/protocols/Aws_json1_1.ts | 5676 +----- .../src/protocols/Aws_restJson1.ts | 1335 +- .../src/protocols/Aws_json1_1.ts | 2829 +-- .../client-glue/src/protocols/Aws_json1_1.ts | 11418 ++---------- .../src/protocols/Aws_restJson1.ts | 832 +- .../src/protocols/Aws_restJson1.ts | 2686 +-- .../src/protocols/Aws_restJson1.ts | 1162 +- .../src/protocols/Aws_restJson1.ts | 1153 +- .../src/protocols/Aws_restJson1.ts | 2711 +-- .../src/protocols/Aws_json1_1.ts | 378 +- .../src/protocols/Aws_json1_0.ts | 476 +- .../src/protocols/Aws_restJson1.ts | 768 +- clients/client-iam/src/protocols/Aws_query.ts | 7692 ++------ .../src/protocols/Aws_json1_1.ts | 768 +- .../src/protocols/Aws_restJson1.ts | 4328 +---- .../src/protocols/Aws_restJson1.ts | 11 +- .../src/protocols/Aws_json1_1.ts | 1662 +- .../src/protocols/Aws_restJson1.ts | 2314 +-- .../src/protocols/Aws_restJson1.ts | 540 +- .../src/protocols/Aws_restJson1.ts | 449 +- .../src/protocols/Aws_restJson1.ts | 539 +- .../src/protocols/Aws_restJson1.ts | 299 +- .../src/protocols/Aws_restJson1.ts | 433 +- .../src/protocols/Aws_restJson1.ts | 1097 +- .../src/protocols/Aws_restJson1.ts | 143 +- .../src/protocols/Aws_restJson1.ts | 817 +- .../src/protocols/Aws_restJson1.ts | 6295 ++----- .../client-iot/src/protocols/Aws_restJson1.ts | 14938 +++------------- .../src/protocols/Aws_restJson1.ts | 1416 +- .../src/protocols/Aws_restJson1.ts | 447 +- .../src/protocols/Aws_restJson1.ts | 273 +- .../src/protocols/Aws_json1_0.ts | 2821 +-- .../src/protocols/Aws_json1_1.ts | 204 +- .../src/protocols/Aws_restJson1.ts | 3460 +--- .../src/protocols/Aws_json1_1.ts | 1350 +- .../src/protocols/Aws_restJson1.ts | 2230 +-- .../src/protocols/Aws_restJson1.ts | 1230 +- .../client-ivs/src/protocols/Aws_restJson1.ts | 1543 +- .../src/protocols/Aws_restJson1.ts | 618 +- .../src/protocols/Aws_restJson1.ts | 2231 +-- .../src/protocols/Aws_restJson1.ts | 529 +- .../src/protocols/Aws_json1_0.ts | 346 +- .../src/protocols/Aws_json1_1.ts | 3746 +--- .../src/protocols/Aws_json1_0.ts | 552 +- .../src/protocols/Aws_json1_1.ts | 1352 +- .../src/protocols/Aws_json1_1.ts | 804 +- .../src/protocols/Aws_restJson1.ts | 253 +- .../src/protocols/Aws_restJson1.ts | 11 +- .../src/protocols/Aws_restJson1.ts | 60 +- .../src/protocols/Aws_restJson1.ts | 11 +- .../src/protocols/Aws_restJson1.ts | 1510 +- .../src/protocols/Aws_json1_1.ts | 1320 +- .../client-kms/src/protocols/Aws_json1_1.ts | 3186 +--- .../src/protocols/Aws_restJson1.ts | 2273 +-- .../src/protocols/Aws_restJson1.ts | 2925 +-- .../src/protocols/Aws_restJson1.ts | 255 +- .../src/protocols/Aws_restJson1.ts | 1761 +- .../src/protocols/Aws_restJson1.ts | 4039 +---- .../src/protocols/Aws_restJson1.ts | 222 +- .../src/protocols/Aws_restJson1.ts | 253 +- .../src/protocols/Aws_restJson1.ts | 113 +- .../src/protocols/Aws_restJson1.ts | 480 +- .../src/protocols/Aws_json1_1.ts | 2875 +-- .../src/protocols/Aws_json1_1.ts | 9440 ++-------- .../src/protocols/Aws_restJson1.ts | 2423 +-- .../src/protocols/Aws_json1_0.ts | 2624 +-- .../src/protocols/Aws_restJson1.ts | 1456 +- .../src/protocols/Aws_restJson1.ts | 1001 +- .../client-m2/src/protocols/Aws_restJson1.ts | 1541 +- .../src/protocols/Aws_json1_1.ts | 955 +- .../src/protocols/Aws_restJson1.ts | 4290 +---- .../src/protocols/Aws_restJson1.ts | 306 +- .../src/protocols/Aws_restJson1.ts | 1376 +- .../src/protocols/Aws_json1_0.ts | 94 +- .../src/protocols/Aws_restJson1.ts | 512 +- .../src/protocols/Aws_json1_1.ts | 39 +- .../src/protocols/Aws_restJson1.ts | 149 +- .../src/protocols/Aws_json1_1.ts | 11 +- .../src/protocols/Aws_json1_1.ts | 215 +- .../src/protocols/Aws_restJson1.ts | 2728 +-- .../src/protocols/Aws_restJson1.ts | 1443 +- .../src/protocols/Aws_restJson1.ts | 3498 +--- .../src/protocols/Aws_restJson1.ts | 684 +- .../src/protocols/Aws_restJson1.ts | 778 +- .../src/protocols/Aws_restJson1.ts | 1025 +- .../src/protocols/Aws_restJson1.ts | 153 +- .../src/protocols/Aws_json1_1.ts | 733 +- .../src/protocols/Aws_restJson1.ts | 995 +- .../src/protocols/Aws_restJson1.ts | 806 +- .../src/protocols/Aws_json1_1.ts | 2194 +-- .../client-mgn/src/protocols/Aws_restJson1.ts | 2588 +-- .../src/protocols/Aws_restJson1.ts | 989 +- .../src/protocols/Aws_json1_1.ts | 915 +- .../src/protocols/Aws_json1_1.ts | 137 +- .../src/protocols/Aws_restJson1.ts | 1089 +- .../src/protocols/Aws_restJson1.ts | 819 +- .../src/protocols/Aws_restJson1.ts | 355 +- .../client-mq/src/protocols/Aws_restJson1.ts | 882 +- .../client-mturk/src/protocols/Aws_json1_1.ts | 1270 +- .../src/protocols/Aws_restJson1.ts | 348 +- .../src/protocols/Aws_restJson1.ts | 1069 +- .../client-neptune/src/protocols/Aws_query.ts | 3622 +--- .../src/protocols/Aws_restJson1.ts | 3511 +--- .../src/protocols/Aws_json1_0.ts | 1523 +- .../src/protocols/Aws_restJson1.ts | 4688 +---- .../src/protocols/Aws_restJson1.ts | 478 +- .../src/protocols/Aws_restJson1.ts | 2299 +-- .../client-oam/src/protocols/Aws_restJson1.ts | 529 +- .../src/protocols/Aws_restJson1.ts | 4166 +---- .../src/protocols/Aws_restJson1.ts | 2571 +-- .../src/protocols/Aws_json1_0.ts | 1562 +- .../src/protocols/Aws_json1_1.ts | 2412 +-- .../src/protocols/Aws_json1_1.ts | 656 +- .../src/protocols/Aws_json1_1.ts | 3567 +--- .../src/protocols/Aws_restJson1.ts | 528 +- .../src/protocols/Aws_restJson1.ts | 1012 +- .../src/protocols/Aws_restJson1.ts | 1307 +- .../src/protocols/Aws_restJson1.ts | 420 +- .../src/protocols/Aws_json1_0.ts | 972 +- .../src/protocols/Aws_restJson1.ts | 1038 +- .../src/protocols/Aws_restJson1.ts | 141 +- .../src/protocols/Aws_restJson1.ts | 73 +- .../src/protocols/Aws_json1_1.ts | 3217 +--- .../client-pi/src/protocols/Aws_json1_1.ts | 419 +- .../src/protocols/Aws_restJson1.ts | 1536 +- .../src/protocols/Aws_json1_0.ts | 3776 +--- .../src/protocols/Aws_restJson1.ts | 285 +- .../src/protocols/Aws_restJson1.ts | 6940 +------ .../src/protocols/Aws_restJson1.ts | 350 +- .../src/protocols/Aws_restJson1.ts | 355 +- .../src/protocols/Aws_json1_1.ts | 174 +- .../src/protocols/Aws_restJson1.ts | 891 +- .../src/protocols/Aws_json1_0.ts | 4879 +---- .../src/protocols/Aws_restJson1.ts | 3043 +--- .../src/protocols/Aws_restJson1.ts | 1555 +- .../src/protocols/Aws_json1_0.ts | 11 +- .../src/protocols/Aws_restJson1.ts | 615 +- .../src/protocols/Aws_restJson1.ts | 11239 ++---------- .../client-ram/src/protocols/Aws_restJson1.ts | 1958 +- .../src/protocols/Aws_restJson1.ts | 338 +- .../src/protocols/Aws_restJson1.ts | 322 +- clients/client-rds/src/protocols/Aws_query.ts | 8914 ++------- .../src/protocols/Aws_json1_1.ts | 335 +- .../src/protocols/Aws_json1_1.ts | 2222 +-- .../src/protocols/Aws_query.ts | 7341 ++------ .../src/protocols/Aws_json1_1.ts | 4790 +---- .../src/protocols/Aws_restJson1.ts | 11 +- .../src/protocols/Aws_restJson1.ts | 417 +- .../src/protocols/Aws_restJson1.ts | 2961 +-- .../src/protocols/Aws_restJson1.ts | 875 +- .../src/protocols/Aws_json1_1.ts | 279 +- .../src/protocols/Aws_restJson1.ts | 786 +- .../src/protocols/Aws_restJson1.ts | 2207 +-- .../src/protocols/Aws_restJson1.ts | 950 +- .../src/protocols/Aws_json1_1.ts | 1262 +- .../src/protocols/Aws_restXml.ts | 4230 ++--- .../src/protocols/Aws_json1_0.ts | 155 +- .../src/protocols/Aws_restJson1.ts | 994 +- .../src/protocols/Aws_restJson1.ts | 1517 +- .../src/protocols/Aws_json1_1.ts | 3594 +--- .../client-rum/src/protocols/Aws_restJson1.ts | 705 +- .../src/protocols/Aws_restXml.ts | 2203 +-- .../client-s3/src/protocols/Aws_restXml.ts | 2217 +-- .../src/protocols/Aws_restJson1.ts | 183 +- .../src/protocols/Aws_restJson1.ts | 168 +- .../src/protocols/Aws_restJson1.ts | 67 +- .../src/protocols/Aws_restJson1.ts | 128 +- .../src/protocols/Aws_restJson1.ts | 817 +- .../src/protocols/Aws_restJson1.ts | 11 +- .../src/protocols/Aws_restJson1.ts | 106 +- .../src/protocols/Aws_json1_1.ts | 9001 +--------- .../src/protocols/Aws_restJson1.ts | 283 +- .../src/protocols/Aws_restJson1.ts | 439 +- .../src/protocols/Aws_restJson1.ts | 1434 +- .../src/protocols/Aws_json1_1.ts | 950 +- .../src/protocols/Aws_restJson1.ts | 3941 +--- .../src/protocols/Aws_restJson1.ts | 1549 +- .../src/protocols/Aws_restJson1.ts | 534 +- .../src/protocols/Aws_restJson1.ts | 844 +- .../src/protocols/Aws_json1_1.ts | 3129 +--- .../src/protocols/Aws_json1_1.ts | 962 +- .../src/protocols/Aws_json1_1.ts | 1017 +- clients/client-ses/src/protocols/Aws_query.ts | 2186 +-- .../src/protocols/Aws_restJson1.ts | 4399 +---- .../client-sfn/src/protocols/Aws_json1_0.ts | 1454 +- .../src/protocols/Aws_json1_1.ts | 1361 +- .../src/protocols/Aws_restJson1.ts | 780 +- .../src/protocols/Aws_restJson1.ts | 596 +- .../client-sms/src/protocols/Aws_json1_1.ts | 1724 +- .../src/protocols/Aws_restJson1.ts | 485 +- .../src/protocols/Aws_json1_1.ts | 871 +- clients/client-sns/src/protocols/Aws_query.ts | 2358 +-- .../client-sqs/src/protocols/Aws_json1_0.ts | 1306 +- .../src/protocols/Aws_json1_1.ts | 2036 +-- .../src/protocols/Aws_restJson1.ts | 1321 +- .../src/protocols/Aws_restJson1.ts | 601 +- .../client-ssm/src/protocols/Aws_json1_1.ts | 7474 ++------ .../src/protocols/Aws_json1_1.ts | 3565 +--- .../src/protocols/Aws_restJson1.ts | 191 +- .../client-sso/src/protocols/Aws_restJson1.ts | 122 +- .../src/protocols/Aws_json1_1.ts | 2941 +-- clients/client-sts/src/protocols/Aws_query.ts | 264 +- .../src/protocols/Aws_restJson1.ts | 57 +- .../src/protocols/Aws_restJson1.ts | 338 +- .../src/protocols/Aws_json1_1.ts | 521 +- .../client-swf/src/protocols/Aws_json1_0.ts | 1264 +- .../src/protocols/Aws_restJson1.ts | 755 +- .../src/protocols/Aws_json1_1.ts | 1404 +- .../src/protocols/Aws_json1_0.ts | 512 +- .../src/protocols/Aws_json1_0.ts | 835 +- .../client-tnb/src/protocols/Aws_restJson1.ts | 1327 +- .../src/protocols/Aws_restJson1.ts | 91 +- .../src/protocols/Aws_json1_1.ts | 1591 +- .../src/protocols/Aws_json1_1.ts | 3103 +--- .../src/protocols/Aws_json1_1.ts | 751 +- .../src/protocols/Aws_restJson1.ts | 371 +- .../src/protocols/Aws_json1_0.ts | 1102 +- .../src/protocols/Aws_json1_0.ts | 1446 +- .../src/protocols/Aws_restJson1.ts | 2271 +-- .../src/protocols/Aws_json1_1.ts | 4304 +---- .../client-waf/src/protocols/Aws_json1_1.ts | 4133 +---- .../client-wafv2/src/protocols/Aws_json1_1.ts | 2272 +-- .../src/protocols/Aws_restJson1.ts | 3858 +--- .../src/protocols/Aws_restJson1.ts | 1521 +- .../src/protocols/Aws_restJson1.ts | 2205 +-- .../src/protocols/Aws_restJson1.ts | 1363 +- .../src/protocols/Aws_json1_1.ts | 4553 +---- .../src/protocols/Aws_restJson1.ts | 45 +- .../src/protocols/Aws_restJson1.ts | 662 +- .../src/protocols/Aws_restJson1.ts | 3111 +--- .../src/protocols/Aws_json1_1.ts | 3421 +--- .../src/protocols/Aws_restJson1.ts | 1002 +- .../src/protocols/Aws_restJson1.ts | 48 +- .../src/protocols/Aws_ec2.ts | 567 +- .../src/protocols/Aws_json1_0.ts | 309 +- .../src/protocols/Aws_json1_1.ts | 368 +- .../src/protocols/Aws_query.ts | 749 +- .../src/protocols/Aws_restJson1.ts | 2057 +-- .../src/protocols/Aws_restXml.ts | 1377 +- scripts/generate-clients/config.js | 6 +- 385 files changed, 83018 insertions(+), 609382 deletions(-) diff --git a/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts b/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts index 4fea68d40ce2..911bb4df68b6 100644 --- a/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts +++ b/clients/client-accessanalyzer/src/protocols/Aws_restJson1.ts @@ -865,7 +865,7 @@ export const de_ApplyArchiveRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ApplyArchiveRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -874,44 +874,6 @@ export const de_ApplyArchiveRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ApplyArchiveRuleCommandError - */ -const de_ApplyArchiveRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelPolicyGenerationCommand */ @@ -920,7 +882,7 @@ export const de_CancelPolicyGenerationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelPolicyGenerationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -929,41 +891,6 @@ export const de_CancelPolicyGenerationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelPolicyGenerationCommandError - */ -const de_CancelPolicyGenerationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CheckAccessNotGrantedCommand */ @@ -972,7 +899,7 @@ export const de_CheckAccessNotGrantedCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CheckAccessNotGrantedCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -987,47 +914,6 @@ export const de_CheckAccessNotGrantedCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CheckAccessNotGrantedCommandError - */ -const de_CheckAccessNotGrantedCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.accessanalyzer#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.accessanalyzer#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CheckNoNewAccessCommand */ @@ -1036,7 +922,7 @@ export const de_CheckNoNewAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CheckNoNewAccessCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1051,47 +937,6 @@ export const de_CheckNoNewAccessCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CheckNoNewAccessCommandError - */ -const de_CheckNoNewAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.accessanalyzer#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.accessanalyzer#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAccessPreviewCommand */ @@ -1100,7 +945,7 @@ export const de_CreateAccessPreviewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAccessPreviewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1113,50 +958,6 @@ export const de_CreateAccessPreviewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAccessPreviewCommandError - */ -const de_CreateAccessPreviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.accessanalyzer#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.accessanalyzer#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAnalyzerCommand */ @@ -1165,7 +966,7 @@ export const de_CreateAnalyzerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAnalyzerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1179,55 +980,31 @@ export const de_CreateAnalyzerCommand = async ( }; /** - * deserializeAws_restJson1CreateAnalyzerCommandError + * deserializeAws_restJson1CreateArchiveRuleCommand */ -const de_CreateAnalyzerCommandError = async ( +export const de_CreateArchiveRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.accessanalyzer#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.accessanalyzer#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateArchiveRuleCommand + * deserializeAws_restJson1DeleteAnalyzerCommand */ -export const de_CreateArchiveRuleCommand = async ( +export const de_DeleteAnalyzerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateArchiveRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1237,113 +1014,14 @@ export const de_CreateArchiveRuleCommand = async ( }; /** - * deserializeAws_restJson1CreateArchiveRuleCommandError + * deserializeAws_restJson1DeleteArchiveRuleCommand */ -const de_CreateArchiveRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.accessanalyzer#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.accessanalyzer#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAnalyzerCommand - */ -export const de_DeleteAnalyzerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAnalyzerCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteAnalyzerCommandError - */ -const de_DeleteAnalyzerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteArchiveRuleCommand - */ -export const de_DeleteArchiveRuleCommand = async ( +export const de_DeleteArchiveRuleCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteArchiveRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1352,44 +1030,6 @@ export const de_DeleteArchiveRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteArchiveRuleCommandError - */ -const de_DeleteArchiveRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAccessPreviewCommand */ @@ -1398,7 +1038,7 @@ export const de_GetAccessPreviewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccessPreviewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1411,44 +1051,6 @@ export const de_GetAccessPreviewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAccessPreviewCommandError - */ -const de_GetAccessPreviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAnalyzedResourceCommand */ @@ -1457,7 +1059,7 @@ export const de_GetAnalyzedResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAnalyzedResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1470,44 +1072,6 @@ export const de_GetAnalyzedResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAnalyzedResourceCommandError - */ -const de_GetAnalyzedResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAnalyzerCommand */ @@ -1516,7 +1080,7 @@ export const de_GetAnalyzerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAnalyzerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1529,44 +1093,6 @@ export const de_GetAnalyzerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAnalyzerCommandError - */ -const de_GetAnalyzerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetArchiveRuleCommand */ @@ -1575,7 +1101,7 @@ export const de_GetArchiveRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetArchiveRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1588,543 +1114,97 @@ export const de_GetArchiveRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetArchiveRuleCommandError - */ -const de_GetArchiveRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetFindingCommand */ export const de_GetFindingCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFindingCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - finding: (_) => de_Finding(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFindingCommandError - */ -const de_GetFindingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFindingV2Command - */ -export const de_GetFindingV2Command = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFindingV2CommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - analyzedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - error: __expectString, - findingDetails: (_) => de_FindingDetailsList(_, context), - findingType: __expectString, - id: __expectString, - nextToken: __expectString, - resource: __expectString, - resourceOwnerAccount: __expectString, - resourceType: __expectString, - status: __expectString, - updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFindingV2CommandError - */ -const de_GetFindingV2CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetGeneratedPolicyCommand - */ -export const de_GetGeneratedPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGeneratedPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - generatedPolicyResult: (_) => de_GeneratedPolicyResult(_, context), - jobDetails: (_) => de_JobDetails(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetGeneratedPolicyCommandError - */ -const de_GetGeneratedPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAccessPreviewFindingsCommand - */ -export const de_ListAccessPreviewFindingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccessPreviewFindingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - findings: (_) => de_AccessPreviewFindingsList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAccessPreviewFindingsCommandError - */ -const de_ListAccessPreviewFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.accessanalyzer#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAccessPreviewsCommand - */ -export const de_ListAccessPreviewsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccessPreviewsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - accessPreviews: (_) => de_AccessPreviewsList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAccessPreviewsCommandError - */ -const de_ListAccessPreviewsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAnalyzedResourcesCommand - */ -export const de_ListAnalyzedResourcesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnalyzedResourcesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - analyzedResources: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAnalyzedResourcesCommandError - */ -const de_ListAnalyzedResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAnalyzersCommand - */ -export const de_ListAnalyzersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnalyzersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - analyzers: (_) => de_AnalyzersList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAnalyzersCommandError - */ -const de_ListAnalyzersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + finding: (_) => de_Finding(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListArchiveRulesCommand + * deserializeAws_restJson1GetFindingV2Command */ -export const de_ListArchiveRulesCommand = async ( +export const de_GetFindingV2Command = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListArchiveRulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - archiveRules: (_) => de_ArchiveRulesList(_, context), + analyzedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + error: __expectString, + findingDetails: (_) => de_FindingDetailsList(_, context), + findingType: __expectString, + id: __expectString, nextToken: __expectString, + resource: __expectString, + resourceOwnerAccount: __expectString, + resourceType: __expectString, + status: __expectString, + updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListArchiveRulesCommandError + * deserializeAws_restJson1GetGeneratedPolicyCommand */ -const de_ListArchiveRulesCommandError = async ( +export const de_GetGeneratedPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + generatedPolicyResult: (_) => de_GeneratedPolicyResult(_, context), + jobDetails: (_) => de_JobDetails(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListFindingsCommand + * deserializeAws_restJson1ListAccessPreviewFindingsCommand */ -export const de_ListFindingsCommand = async ( +export const de_ListAccessPreviewFindingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - findings: (_) => de_FindingsList(_, context), + findings: (_) => de_AccessPreviewFindingsList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -2132,59 +1212,43 @@ export const de_ListFindingsCommand = async ( }; /** - * deserializeAws_restJson1ListFindingsCommandError + * deserializeAws_restJson1ListAccessPreviewsCommand */ -const de_ListFindingsCommandError = async ( +export const de_ListAccessPreviewsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + accessPreviews: (_) => de_AccessPreviewsList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListFindingsV2Command + * deserializeAws_restJson1ListAnalyzedResourcesCommand */ -export const de_ListFindingsV2Command = async ( +export const de_ListAnalyzedResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFindingsV2CommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - findings: (_) => de_FindingsListV2(_, context), + analyzedResources: _json, nextToken: __expectString, }); Object.assign(contents, doc); @@ -2192,219 +1256,155 @@ export const de_ListFindingsV2Command = async ( }; /** - * deserializeAws_restJson1ListFindingsV2CommandError + * deserializeAws_restJson1ListAnalyzersCommand */ -const de_ListFindingsV2CommandError = async ( +export const de_ListAnalyzersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + analyzers: (_) => de_AnalyzersList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPolicyGenerationsCommand + * deserializeAws_restJson1ListArchiveRulesCommand */ -export const de_ListPolicyGenerationsCommand = async ( +export const de_ListArchiveRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPolicyGenerationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + archiveRules: (_) => de_ArchiveRulesList(_, context), nextToken: __expectString, - policyGenerations: (_) => de_PolicyGenerationList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPolicyGenerationsCommandError + * deserializeAws_restJson1ListFindingsCommand */ -const de_ListPolicyGenerationsCommandError = async ( +export const de_ListFindingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + findings: (_) => de_FindingsList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListFindingsV2Command */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListFindingsV2Command = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + findings: (_) => de_FindingsListV2(_, context), + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListPolicyGenerationsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListPolicyGenerationsCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + policyGenerations: (_) => de_PolicyGenerationList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartPolicyGenerationCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_StartPolicyGenerationCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartPolicyGenerationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - jobId: __expectString, + tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartPolicyGenerationCommandError + * deserializeAws_restJson1StartPolicyGenerationCommand */ -const de_StartPolicyGenerationCommandError = async ( +export const de_StartPolicyGenerationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.accessanalyzer#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.accessanalyzer#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + jobId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2415,7 +1415,7 @@ export const de_StartResourceScanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartResourceScanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2424,44 +1424,6 @@ export const de_StartResourceScanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartResourceScanCommandError - */ -const de_StartResourceScanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2470,7 +1432,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2479,44 +1441,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2525,7 +1449,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2534,44 +1458,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateArchiveRuleCommand */ @@ -2580,7 +1466,7 @@ export const de_UpdateArchiveRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateArchiveRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2589,44 +1475,6 @@ export const de_UpdateArchiveRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateArchiveRuleCommandError - */ -const de_UpdateArchiveRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFindingsCommand */ @@ -2635,7 +1483,7 @@ export const de_UpdateFindingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2644,44 +1492,6 @@ export const de_UpdateFindingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFindingsCommandError - */ -const de_UpdateFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.accessanalyzer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.accessanalyzer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.accessanalyzer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.accessanalyzer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.accessanalyzer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ValidatePolicyCommand */ @@ -2690,7 +1500,7 @@ export const de_ValidatePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ValidatePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2705,12 +1515,9 @@ export const de_ValidatePolicyCommand = async ( }; /** - * deserializeAws_restJson1ValidatePolicyCommandError + * deserialize_Aws_restJson1CommandError */ -const de_ValidatePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2723,19 +1530,34 @@ const de_ValidatePolicyCommandError = async ( case "InternalServerException": case "com.amazonaws.accessanalyzer#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.accessanalyzer#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.accessanalyzer#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.accessanalyzer#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.accessanalyzer#InvalidParameterException": + throw await de_InvalidParameterExceptionRes(parsedOutput, context); + case "UnprocessableEntityException": + case "com.amazonaws.accessanalyzer#UnprocessableEntityException": + throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.accessanalyzer#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.accessanalyzer#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-account/src/protocols/Aws_restJson1.ts b/clients/client-account/src/protocols/Aws_restJson1.ts index ff2aae69d81d..4fbb2ee33ee8 100644 --- a/clients/client-account/src/protocols/Aws_restJson1.ts +++ b/clients/client-account/src/protocols/Aws_restJson1.ts @@ -274,7 +274,7 @@ export const de_DeleteAlternateContactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAlternateContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -283,44 +283,6 @@ export const de_DeleteAlternateContactCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAlternateContactCommandError - */ -const de_DeleteAlternateContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.account#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.account#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.account#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.account#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.account#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisableRegionCommand */ @@ -329,7 +291,7 @@ export const de_DisableRegionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableRegionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -338,44 +300,6 @@ export const de_DisableRegionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisableRegionCommandError - */ -const de_DisableRegionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.account#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.account#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.account#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.account#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.account#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1EnableRegionCommand */ @@ -384,7 +308,7 @@ export const de_EnableRegionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableRegionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -393,44 +317,6 @@ export const de_EnableRegionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1EnableRegionCommandError - */ -const de_EnableRegionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.account#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.account#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.account#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.account#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.account#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAlternateContactCommand */ @@ -439,7 +325,7 @@ export const de_GetAlternateContactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAlternateContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -452,44 +338,6 @@ export const de_GetAlternateContactCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAlternateContactCommandError - */ -const de_GetAlternateContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.account#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.account#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.account#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.account#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.account#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetContactInformationCommand */ @@ -498,7 +346,7 @@ export const de_GetContactInformationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetContactInformationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -511,44 +359,6 @@ export const de_GetContactInformationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetContactInformationCommandError - */ -const de_GetContactInformationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.account#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.account#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.account#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.account#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.account#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRegionOptStatusCommand */ @@ -557,7 +367,7 @@ export const de_GetRegionOptStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRegionOptStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -571,41 +381,6 @@ export const de_GetRegionOptStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRegionOptStatusCommandError - */ -const de_GetRegionOptStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.account#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.account#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.account#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.account#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRegionsCommand */ @@ -614,7 +389,7 @@ export const de_ListRegionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRegionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -628,41 +403,6 @@ export const de_ListRegionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRegionsCommandError - */ -const de_ListRegionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.account#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.account#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.account#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.account#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutAlternateContactCommand */ @@ -671,7 +411,7 @@ export const de_PutAlternateContactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAlternateContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -680,41 +420,6 @@ export const de_PutAlternateContactCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutAlternateContactCommandError - */ -const de_PutAlternateContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.account#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.account#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.account#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.account#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutContactInformationCommand */ @@ -723,7 +428,7 @@ export const de_PutContactInformationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutContactInformationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -733,12 +438,9 @@ export const de_PutContactInformationCommand = async ( }; /** - * deserializeAws_restJson1PutContactInformationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_PutContactInformationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -751,19 +453,25 @@ const de_PutContactInformationCommandError = async ( case "InternalServerException": case "com.amazonaws.account#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.account#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.account#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.account#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.account#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-acm-pca/src/protocols/Aws_json1_1.ts b/clients/client-acm-pca/src/protocols/Aws_json1_1.ts index ccd832885f75..83d0e995bea1 100644 --- a/clients/client-acm-pca/src/protocols/Aws_json1_1.ts +++ b/clients/client-acm-pca/src/protocols/Aws_json1_1.ts @@ -463,7 +463,7 @@ export const de_CreateCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCertificateAuthorityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -475,41 +475,6 @@ export const de_CreateCertificateAuthorityCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCertificateAuthorityCommandError - */ -const de_CreateCertificateAuthorityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgsException": - case "com.amazonaws.acmpca#InvalidArgsException": - throw await de_InvalidArgsExceptionRes(parsedOutput, context); - case "InvalidPolicyException": - case "com.amazonaws.acmpca#InvalidPolicyException": - throw await de_InvalidPolicyExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.acmpca#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.acmpca#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateCertificateAuthorityAuditReportCommand */ @@ -518,7 +483,7 @@ export const de_CreateCertificateAuthorityAuditReportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCertificateAuthorityAuditReportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -530,47 +495,6 @@ export const de_CreateCertificateAuthorityAuditReportCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCertificateAuthorityAuditReportCommandError - */ -const de_CreateCertificateAuthorityAuditReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgsException": - case "com.amazonaws.acmpca#InvalidArgsException": - throw await de_InvalidArgsExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "RequestFailedException": - case "com.amazonaws.acmpca#RequestFailedException": - throw await de_RequestFailedExceptionRes(parsedOutput, context); - case "RequestInProgressException": - case "com.amazonaws.acmpca#RequestInProgressException": - throw await de_RequestInProgressExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePermissionCommand */ @@ -579,7 +503,7 @@ export const de_CreatePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePermissionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreatePermissionCommandOutput = { @@ -588,47 +512,6 @@ export const de_CreatePermissionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePermissionCommandError - */ -const de_CreatePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.acmpca#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PermissionAlreadyExistsException": - case "com.amazonaws.acmpca#PermissionAlreadyExistsException": - throw await de_PermissionAlreadyExistsExceptionRes(parsedOutput, context); - case "RequestFailedException": - case "com.amazonaws.acmpca#RequestFailedException": - throw await de_RequestFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteCertificateAuthorityCommand */ @@ -637,7 +520,7 @@ export const de_DeleteCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCertificateAuthorityCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteCertificateAuthorityCommandOutput = { @@ -646,41 +529,6 @@ export const de_DeleteCertificateAuthorityCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteCertificateAuthorityCommandError - */ -const de_DeleteCertificateAuthorityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.acmpca#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeletePermissionCommand */ @@ -689,7 +537,7 @@ export const de_DeletePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePermissionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeletePermissionCommandOutput = { @@ -698,41 +546,6 @@ export const de_DeletePermissionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeletePermissionCommandError - */ -const de_DeletePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "RequestFailedException": - case "com.amazonaws.acmpca#RequestFailedException": - throw await de_RequestFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeletePolicyCommand */ @@ -741,7 +554,7 @@ export const de_DeletePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeletePolicyCommandOutput = { @@ -750,47 +563,6 @@ export const de_DeletePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeletePolicyCommandError - */ -const de_DeletePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.acmpca#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "LockoutPreventedException": - case "com.amazonaws.acmpca#LockoutPreventedException": - throw await de_LockoutPreventedExceptionRes(parsedOutput, context); - case "RequestFailedException": - case "com.amazonaws.acmpca#RequestFailedException": - throw await de_RequestFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeCertificateAuthorityCommand */ @@ -799,7 +571,7 @@ export const de_DescribeCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCertificateAuthorityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -812,48 +584,39 @@ export const de_DescribeCertificateAuthorityCommand = async ( }; /** - * deserializeAws_json1_1DescribeCertificateAuthorityCommandError + * deserializeAws_json1_1DescribeCertificateAuthorityAuditReportCommand */ -const de_DescribeCertificateAuthorityCommandError = async ( +export const de_DescribeCertificateAuthorityAuditReportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeCertificateAuthorityAuditReportResponse(data, context); + const response: DescribeCertificateAuthorityAuditReportCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeCertificateAuthorityAuditReportCommand + * deserializeAws_json1_1GetCertificateCommand */ -export const de_DescribeCertificateAuthorityAuditReportCommand = async ( +export const de_GetCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeCertificateAuthorityAuditReportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeCertificateAuthorityAuditReportResponse(data, context); - const response: DescribeCertificateAuthorityAuditReportCommandOutput = { + contents = _json(data); + const response: GetCertificateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -861,104 +624,14 @@ export const de_DescribeCertificateAuthorityAuditReportCommand = async ( }; /** - * deserializeAws_json1_1DescribeCertificateAuthorityAuditReportCommandError + * deserializeAws_json1_1GetCertificateAuthorityCertificateCommand */ -const de_DescribeCertificateAuthorityAuditReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgsException": - case "com.amazonaws.acmpca#InvalidArgsException": - throw await de_InvalidArgsExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCertificateCommand - */ -export const de_GetCertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetCertificateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetCertificateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetCertificateCommandError - */ -const de_GetCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "RequestFailedException": - case "com.amazonaws.acmpca#RequestFailedException": - throw await de_RequestFailedExceptionRes(parsedOutput, context); - case "RequestInProgressException": - case "com.amazonaws.acmpca#RequestInProgressException": - throw await de_RequestInProgressExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCertificateAuthorityCertificateCommand - */ -export const de_GetCertificateAuthorityCertificateCommand = async ( +export const de_GetCertificateAuthorityCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCertificateAuthorityCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -970,38 +643,6 @@ export const de_GetCertificateAuthorityCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCertificateAuthorityCertificateCommandError - */ -const de_GetCertificateAuthorityCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetCertificateAuthorityCsrCommand */ @@ -1010,7 +651,7 @@ export const de_GetCertificateAuthorityCsrCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCertificateAuthorityCsrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1022,44 +663,6 @@ export const de_GetCertificateAuthorityCsrCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCertificateAuthorityCsrCommandError - */ -const de_GetCertificateAuthorityCsrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "RequestFailedException": - case "com.amazonaws.acmpca#RequestFailedException": - throw await de_RequestFailedExceptionRes(parsedOutput, context); - case "RequestInProgressException": - case "com.amazonaws.acmpca#RequestInProgressException": - throw await de_RequestInProgressExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetPolicyCommand */ @@ -1068,7 +671,7 @@ export const de_GetPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1080,41 +683,6 @@ export const de_GetPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetPolicyCommandError - */ -const de_GetPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "RequestFailedException": - case "com.amazonaws.acmpca#RequestFailedException": - throw await de_RequestFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ImportCertificateAuthorityCertificateCommand */ @@ -1123,7 +691,7 @@ export const de_ImportCertificateAuthorityCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportCertificateAuthorityCertificateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ImportCertificateAuthorityCertificateCommandOutput = { @@ -1132,56 +700,6 @@ export const de_ImportCertificateAuthorityCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1ImportCertificateAuthorityCertificateCommandError - */ -const de_ImportCertificateAuthorityCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateMismatchException": - case "com.amazonaws.acmpca#CertificateMismatchException": - throw await de_CertificateMismatchExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.acmpca#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.acmpca#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "MalformedCertificateException": - case "com.amazonaws.acmpca#MalformedCertificateException": - throw await de_MalformedCertificateExceptionRes(parsedOutput, context); - case "RequestFailedException": - case "com.amazonaws.acmpca#RequestFailedException": - throw await de_RequestFailedExceptionRes(parsedOutput, context); - case "RequestInProgressException": - case "com.amazonaws.acmpca#RequestInProgressException": - throw await de_RequestInProgressExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1IssueCertificateCommand */ @@ -1190,7 +708,7 @@ export const de_IssueCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_IssueCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1202,47 +720,6 @@ export const de_IssueCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1IssueCertificateCommandError - */ -const de_IssueCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgsException": - case "com.amazonaws.acmpca#InvalidArgsException": - throw await de_InvalidArgsExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.acmpca#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedCSRException": - case "com.amazonaws.acmpca#MalformedCSRException": - throw await de_MalformedCSRExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListCertificateAuthoritiesCommand */ @@ -1251,7 +728,7 @@ export const de_ListCertificateAuthoritiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListCertificateAuthoritiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1263,32 +740,6 @@ export const de_ListCertificateAuthoritiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListCertificateAuthoritiesCommandError - */ -const de_ListCertificateAuthoritiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.acmpca#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPermissionsCommand */ @@ -1297,167 +748,53 @@ export const de_ListPermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPermissionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_ListPermissionsResponse(data, context); - const response: ListPermissionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListPermissionsCommandError - */ -const de_ListPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.acmpca#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "RequestFailedException": - case "com.amazonaws.acmpca#RequestFailedException": - throw await de_RequestFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsCommand - */ -export const de_ListTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsCommandError - */ -const de_ListTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const response: ListPermissionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutPolicyCommand + * deserializeAws_json1_1ListTagsCommand */ -export const de_PutPolicyCommand = async ( +export const de_ListTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutPolicyCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: PutPolicyCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1PutPolicyCommandError + * deserializeAws_json1_1PutPolicyCommand */ -const de_PutPolicyCommandError = async ( +export const de_PutPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.acmpca#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidPolicyException": - case "com.amazonaws.acmpca#InvalidPolicyException": - throw await de_InvalidPolicyExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "LockoutPreventedException": - case "com.amazonaws.acmpca#LockoutPreventedException": - throw await de_LockoutPreventedExceptionRes(parsedOutput, context); - case "RequestFailedException": - case "com.amazonaws.acmpca#RequestFailedException": - throw await de_RequestFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: PutPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** @@ -1468,7 +805,7 @@ export const de_RestoreCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreCertificateAuthorityCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RestoreCertificateAuthorityCommandOutput = { @@ -1477,38 +814,6 @@ export const de_RestoreCertificateAuthorityCommand = async ( return response; }; -/** - * deserializeAws_json1_1RestoreCertificateAuthorityCommandError - */ -const de_RestoreCertificateAuthorityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RevokeCertificateCommand */ @@ -1517,7 +822,7 @@ export const de_RevokeCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RevokeCertificateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RevokeCertificateCommandOutput = { @@ -1526,56 +831,6 @@ export const de_RevokeCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1RevokeCertificateCommandError - */ -const de_RevokeCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.acmpca#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.acmpca#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.acmpca#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RequestAlreadyProcessedException": - case "com.amazonaws.acmpca#RequestAlreadyProcessedException": - throw await de_RequestAlreadyProcessedExceptionRes(parsedOutput, context); - case "RequestFailedException": - case "com.amazonaws.acmpca#RequestFailedException": - throw await de_RequestFailedExceptionRes(parsedOutput, context); - case "RequestInProgressException": - case "com.amazonaws.acmpca#RequestInProgressException": - throw await de_RequestInProgressExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagCertificateAuthorityCommand */ @@ -1584,7 +839,7 @@ export const de_TagCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagCertificateAuthorityCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: TagCertificateAuthorityCommandOutput = { @@ -1593,44 +848,6 @@ export const de_TagCertificateAuthorityCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagCertificateAuthorityCommandError - */ -const de_TagCertificateAuthorityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.acmpca#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.acmpca#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagCertificateAuthorityCommand */ @@ -1639,7 +856,7 @@ export const de_UntagCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagCertificateAuthorityCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UntagCertificateAuthorityCommandOutput = { @@ -1648,41 +865,6 @@ export const de_UntagCertificateAuthorityCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagCertificateAuthorityCommandError - */ -const de_UntagCertificateAuthorityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acmpca#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.acmpca#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acmpca#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateCertificateAuthorityCommand */ @@ -1691,7 +873,7 @@ export const de_UpdateCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateCertificateAuthorityCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateCertificateAuthorityCommandOutput = { @@ -1701,43 +883,79 @@ export const de_UpdateCertificateAuthorityCommand = async ( }; /** - * deserializeAws_json1_1UpdateCertificateAuthorityCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateCertificateAuthorityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.acmpca#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); case "InvalidArgsException": case "com.amazonaws.acmpca#InvalidArgsException": throw await de_InvalidArgsExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.acmpca#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); case "InvalidPolicyException": case "com.amazonaws.acmpca#InvalidPolicyException": throw await de_InvalidPolicyExceptionRes(parsedOutput, context); + case "InvalidTagException": + case "com.amazonaws.acmpca#InvalidTagException": + throw await de_InvalidTagExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.acmpca#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "InvalidArnException": + case "com.amazonaws.acmpca#InvalidArnException": + throw await de_InvalidArnExceptionRes(parsedOutput, context); case "InvalidStateException": case "com.amazonaws.acmpca#InvalidStateException": throw await de_InvalidStateExceptionRes(parsedOutput, context); + case "RequestFailedException": + case "com.amazonaws.acmpca#RequestFailedException": + throw await de_RequestFailedExceptionRes(parsedOutput, context); + case "RequestInProgressException": + case "com.amazonaws.acmpca#RequestInProgressException": + throw await de_RequestInProgressExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.acmpca#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "PermissionAlreadyExistsException": + case "com.amazonaws.acmpca#PermissionAlreadyExistsException": + throw await de_PermissionAlreadyExistsExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.acmpca#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "LockoutPreventedException": + case "com.amazonaws.acmpca#LockoutPreventedException": + throw await de_LockoutPreventedExceptionRes(parsedOutput, context); + case "CertificateMismatchException": + case "com.amazonaws.acmpca#CertificateMismatchException": + throw await de_CertificateMismatchExceptionRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.acmpca#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "MalformedCertificateException": + case "com.amazonaws.acmpca#MalformedCertificateException": + throw await de_MalformedCertificateExceptionRes(parsedOutput, context); + case "MalformedCSRException": + case "com.amazonaws.acmpca#MalformedCSRException": + throw await de_MalformedCSRExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.acmpca#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "RequestAlreadyProcessedException": + case "com.amazonaws.acmpca#RequestAlreadyProcessedException": + throw await de_RequestAlreadyProcessedExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.acmpca#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-acm/src/protocols/Aws_json1_1.ts b/clients/client-acm/src/protocols/Aws_json1_1.ts index 2eedebdb6ece..a060e0f3c080 100644 --- a/clients/client-acm/src/protocols/Aws_json1_1.ts +++ b/clients/client-acm/src/protocols/Aws_json1_1.ts @@ -308,7 +308,7 @@ export const de_AddTagsToCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsToCertificateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AddTagsToCertificateCommandOutput = { @@ -317,50 +317,6 @@ export const de_AddTagsToCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddTagsToCertificateCommandError - */ -const de_AddTagsToCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acm#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.acm#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.acm#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagPolicyException": - case "com.amazonaws.acm#TagPolicyException": - throw await de_TagPolicyExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.acm#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.acm#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteCertificateCommand */ @@ -369,7 +325,7 @@ export const de_DeleteCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCertificateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteCertificateCommandOutput = { @@ -378,47 +334,6 @@ export const de_DeleteCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteCertificateCommandError - */ -const de_DeleteCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.acm#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.acm#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.acm#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.acm#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.acm#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeCertificateCommand */ @@ -427,7 +342,7 @@ export const de_DescribeCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -439,35 +354,6 @@ export const de_DescribeCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeCertificateCommandError - */ -const de_DescribeCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acm#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ExportCertificateCommand */ @@ -476,7 +362,7 @@ export const de_ExportCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExportCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -488,38 +374,6 @@ export const de_ExportCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1ExportCertificateCommandError - */ -const de_ExportCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acm#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "RequestInProgressException": - case "com.amazonaws.acm#RequestInProgressException": - throw await de_RequestInProgressExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAccountConfigurationCommand */ @@ -528,7 +382,7 @@ export const de_GetAccountConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAccountConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -540,35 +394,6 @@ export const de_GetAccountConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAccountConfigurationCommandError - */ -const de_GetAccountConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.acm#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.acm#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetCertificateCommand */ @@ -577,7 +402,7 @@ export const de_GetCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -589,38 +414,6 @@ export const de_GetCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCertificateCommandError - */ -const de_GetCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acm#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "RequestInProgressException": - case "com.amazonaws.acm#RequestInProgressException": - throw await de_RequestInProgressExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ImportCertificateCommand */ @@ -629,7 +422,7 @@ export const de_ImportCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -641,50 +434,6 @@ export const de_ImportCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1ImportCertificateCommandError - */ -const de_ImportCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acm#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.acm#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.acm#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.acm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagPolicyException": - case "com.amazonaws.acm#TagPolicyException": - throw await de_TagPolicyExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.acm#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListCertificatesCommand */ @@ -693,7 +442,7 @@ export const de_ListCertificatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListCertificatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -705,35 +454,6 @@ export const de_ListCertificatesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListCertificatesCommandError - */ -const de_ListCertificatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgsException": - case "com.amazonaws.acm#InvalidArgsException": - throw await de_InvalidArgsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.acm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForCertificateCommand */ @@ -742,7 +462,7 @@ export const de_ListTagsForCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -754,35 +474,6 @@ export const de_ListTagsForCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForCertificateCommandError - */ -const de_ListTagsForCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acm#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutAccountConfigurationCommand */ @@ -791,7 +482,7 @@ export const de_PutAccountConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutAccountConfigurationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutAccountConfigurationCommandOutput = { @@ -800,41 +491,6 @@ export const de_PutAccountConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutAccountConfigurationCommandError - */ -const de_PutAccountConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.acm#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.acm#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.acm#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.acm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RemoveTagsFromCertificateCommand */ @@ -843,7 +499,7 @@ export const de_RemoveTagsFromCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveTagsFromCertificateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RemoveTagsFromCertificateCommandOutput = { @@ -852,47 +508,6 @@ export const de_RemoveTagsFromCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1RemoveTagsFromCertificateCommandError - */ -const de_RemoveTagsFromCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acm#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.acm#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.acm#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagPolicyException": - case "com.amazonaws.acm#TagPolicyException": - throw await de_TagPolicyExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.acm#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RenewCertificateCommand */ @@ -901,7 +516,7 @@ export const de_RenewCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RenewCertificateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RenewCertificateCommandOutput = { @@ -910,35 +525,6 @@ export const de_RenewCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1RenewCertificateCommandError - */ -const de_RenewCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acm#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RequestCertificateCommand */ @@ -947,7 +533,7 @@ export const de_RequestCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RequestCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -959,50 +545,6 @@ export const de_RequestCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1RequestCertificateCommandError - */ -const de_RequestCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acm#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidDomainValidationOptionsException": - case "com.amazonaws.acm#InvalidDomainValidationOptionsException": - throw await de_InvalidDomainValidationOptionsExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.acm#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.acm#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.acm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TagPolicyException": - case "com.amazonaws.acm#TagPolicyException": - throw await de_TagPolicyExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.acm#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ResendValidationEmailCommand */ @@ -1011,7 +553,7 @@ export const de_ResendValidationEmailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResendValidationEmailCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ResendValidationEmailCommandOutput = { @@ -1020,41 +562,6 @@ export const de_ResendValidationEmailCommand = async ( return response; }; -/** - * deserializeAws_json1_1ResendValidationEmailCommandError - */ -const de_ResendValidationEmailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.acm#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidDomainValidationOptionsException": - case "com.amazonaws.acm#InvalidDomainValidationOptionsException": - throw await de_InvalidDomainValidationOptionsExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acm#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.acm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateCertificateOptionsCommand */ @@ -1063,7 +570,7 @@ export const de_UpdateCertificateOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateCertificateOptionsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateCertificateOptionsCommandOutput = { @@ -1073,12 +580,9 @@ export const de_UpdateCertificateOptionsCommand = async ( }; /** - * deserializeAws_json1_1UpdateCertificateOptionsCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateCertificateOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1088,22 +592,58 @@ const de_UpdateCertificateOptionsCommandError = async ( case "InvalidArnException": case "com.amazonaws.acm#InvalidArnException": throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.acm#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.acm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.acm#InvalidParameterException": + throw await de_InvalidParameterExceptionRes(parsedOutput, context); + case "InvalidTagException": + case "com.amazonaws.acm#InvalidTagException": + throw await de_InvalidTagExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.acm#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "TagPolicyException": + case "com.amazonaws.acm#TagPolicyException": + throw await de_TagPolicyExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.acm#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.acm#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.acm#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.acm#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.acm#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); + case "RequestInProgressException": + case "com.amazonaws.acm#RequestInProgressException": + throw await de_RequestInProgressExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.acm#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "InvalidArgsException": + case "com.amazonaws.acm#InvalidArgsException": + throw await de_InvalidArgsExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.acm#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "InvalidDomainValidationOptionsException": + case "com.amazonaws.acm#InvalidDomainValidationOptionsException": + throw await de_InvalidDomainValidationOptionsExceptionRes(parsedOutput, context); + case "InvalidStateException": + case "com.amazonaws.acm#InvalidStateException": + throw await de_InvalidStateExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts b/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts index 9675e758ea42..8c84480ce13f 100644 --- a/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts +++ b/clients/client-alexa-for-business/src/protocols/Aws_json1_1.ts @@ -1597,7 +1597,7 @@ export const de_ApproveSkillCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ApproveSkillCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1609,38 +1609,6 @@ export const de_ApproveSkillCommand = async ( return response; }; -/** - * deserializeAws_json1_1ApproveSkillCommandError - */ -const de_ApproveSkillCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.alexaforbusiness#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateContactWithAddressBookCommand */ @@ -1649,7 +1617,7 @@ export const de_AssociateContactWithAddressBookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateContactWithAddressBookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1661,32 +1629,6 @@ export const de_AssociateContactWithAddressBookCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateContactWithAddressBookCommandError - */ -const de_AssociateContactWithAddressBookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.alexaforbusiness#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateDeviceWithNetworkProfileCommand */ @@ -1695,7 +1637,7 @@ export const de_AssociateDeviceWithNetworkProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateDeviceWithNetworkProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1707,38 +1649,6 @@ export const de_AssociateDeviceWithNetworkProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateDeviceWithNetworkProfileCommandError - */ -const de_AssociateDeviceWithNetworkProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "DeviceNotRegisteredException": - case "com.amazonaws.alexaforbusiness#DeviceNotRegisteredException": - throw await de_DeviceNotRegisteredExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateDeviceWithRoomCommand */ @@ -1747,7 +1657,7 @@ export const de_AssociateDeviceWithRoomCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateDeviceWithRoomCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1759,38 +1669,6 @@ export const de_AssociateDeviceWithRoomCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateDeviceWithRoomCommandError - */ -const de_AssociateDeviceWithRoomCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "DeviceNotRegisteredException": - case "com.amazonaws.alexaforbusiness#DeviceNotRegisteredException": - throw await de_DeviceNotRegisteredExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.alexaforbusiness#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateSkillGroupWithRoomCommand */ @@ -1799,7 +1677,7 @@ export const de_AssociateSkillGroupWithRoomCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateSkillGroupWithRoomCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1811,32 +1689,6 @@ export const de_AssociateSkillGroupWithRoomCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateSkillGroupWithRoomCommandError - */ -const de_AssociateSkillGroupWithRoomCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateSkillWithSkillGroupCommand */ @@ -1845,7 +1697,7 @@ export const de_AssociateSkillWithSkillGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateSkillWithSkillGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1857,38 +1709,6 @@ export const de_AssociateSkillWithSkillGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateSkillWithSkillGroupCommandError - */ -const de_AssociateSkillWithSkillGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "SkillNotLinkedException": - case "com.amazonaws.alexaforbusiness#SkillNotLinkedException": - throw await de_SkillNotLinkedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateSkillWithUsersCommand */ @@ -1897,7 +1717,7 @@ export const de_AssociateSkillWithUsersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateSkillWithUsersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1909,35 +1729,6 @@ export const de_AssociateSkillWithUsersCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateSkillWithUsersCommandError - */ -const de_AssociateSkillWithUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAddressBookCommand */ @@ -1946,7 +1737,7 @@ export const de_CreateAddressBookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAddressBookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1958,35 +1749,6 @@ export const de_CreateAddressBookCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAddressBookCommandError - */ -const de_CreateAddressBookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.alexaforbusiness#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.alexaforbusiness#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateBusinessReportScheduleCommand */ @@ -1995,7 +1757,7 @@ export const de_CreateBusinessReportScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBusinessReportScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2008,45 +1770,39 @@ export const de_CreateBusinessReportScheduleCommand = async ( }; /** - * deserializeAws_json1_1CreateBusinessReportScheduleCommandError + * deserializeAws_json1_1CreateConferenceProviderCommand */ -const de_CreateBusinessReportScheduleCommandError = async ( +export const de_CreateConferenceProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.alexaforbusiness#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateConferenceProviderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateConferenceProviderCommand + * deserializeAws_json1_1CreateContactCommand */ -export const de_CreateConferenceProviderCommand = async ( +export const de_CreateContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateConferenceProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateConferenceProviderCommandOutput = { + const response: CreateContactCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2054,801 +1810,19 @@ export const de_CreateConferenceProviderCommand = async ( }; /** - * deserializeAws_json1_1CreateConferenceProviderCommandError + * deserializeAws_json1_1CreateGatewayGroupCommand */ -const de_CreateConferenceProviderCommandError = async ( +export const de_CreateGatewayGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.alexaforbusiness#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateContactCommand - */ -export const de_CreateContactCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateContactCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateContactCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateContactCommandError - */ -const de_CreateContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.alexaforbusiness#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.alexaforbusiness#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateGatewayGroupCommand - */ -export const de_CreateGatewayGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateGatewayGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateGatewayGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateGatewayGroupCommandError - */ -const de_CreateGatewayGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.alexaforbusiness#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.alexaforbusiness#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateNetworkProfileCommand - */ -export const de_CreateNetworkProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateNetworkProfileCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateNetworkProfileCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateNetworkProfileCommandError - */ -const de_CreateNetworkProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.alexaforbusiness#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidCertificateAuthorityException": - case "com.amazonaws.alexaforbusiness#InvalidCertificateAuthorityException": - throw await de_InvalidCertificateAuthorityExceptionRes(parsedOutput, context); - case "InvalidServiceLinkedRoleStateException": - case "com.amazonaws.alexaforbusiness#InvalidServiceLinkedRoleStateException": - throw await de_InvalidServiceLinkedRoleStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.alexaforbusiness#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateProfileCommand - */ -export const de_CreateProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateProfileCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateProfileCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateProfileCommandError - */ -const de_CreateProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.alexaforbusiness#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.alexaforbusiness#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateRoomCommand - */ -export const de_CreateRoomCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateRoomCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateRoomCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateRoomCommandError - */ -const de_CreateRoomCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.alexaforbusiness#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.alexaforbusiness#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateSkillGroupCommand - */ -export const de_CreateSkillGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateSkillGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateSkillGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateSkillGroupCommandError - */ -const de_CreateSkillGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.alexaforbusiness#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.alexaforbusiness#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateUserCommand - */ -export const de_CreateUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateUserCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateUserCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateUserCommandError - */ -const de_CreateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.alexaforbusiness#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.alexaforbusiness#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteAddressBookCommand - */ -export const de_DeleteAddressBookCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteAddressBookCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteAddressBookCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteAddressBookCommandError - */ -const de_DeleteAddressBookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteBusinessReportScheduleCommand - */ -export const de_DeleteBusinessReportScheduleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteBusinessReportScheduleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteBusinessReportScheduleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteBusinessReportScheduleCommandError - */ -const de_DeleteBusinessReportScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteConferenceProviderCommand - */ -export const de_DeleteConferenceProviderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteConferenceProviderCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteConferenceProviderCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteConferenceProviderCommandError - */ -const de_DeleteConferenceProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteContactCommand - */ -export const de_DeleteContactCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteContactCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteContactCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteContactCommandError - */ -const de_DeleteContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDeviceCommand - */ -export const de_DeleteDeviceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDeviceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteDeviceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDeviceCommandError - */ -const de_DeleteDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidCertificateAuthorityException": - case "com.amazonaws.alexaforbusiness#InvalidCertificateAuthorityException": - throw await de_InvalidCertificateAuthorityExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDeviceUsageDataCommand - */ -export const de_DeleteDeviceUsageDataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDeviceUsageDataCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteDeviceUsageDataCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDeviceUsageDataCommandError - */ -const de_DeleteDeviceUsageDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeviceNotRegisteredException": - case "com.amazonaws.alexaforbusiness#DeviceNotRegisteredException": - throw await de_DeviceNotRegisteredExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.alexaforbusiness#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteGatewayGroupCommand - */ -export const de_DeleteGatewayGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteGatewayGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteGatewayGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteGatewayGroupCommandError - */ -const de_DeleteGatewayGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceAssociatedException": - case "com.amazonaws.alexaforbusiness#ResourceAssociatedException": - throw await de_ResourceAssociatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteNetworkProfileCommand - */ -export const de_DeleteNetworkProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteNetworkProfileCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteNetworkProfileCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteNetworkProfileCommandError - */ -const de_DeleteNetworkProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.alexaforbusiness#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteProfileCommand - */ -export const de_DeleteProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteProfileCommandOutput = { + const response: CreateGatewayGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2856,48 +1830,19 @@ export const de_DeleteProfileCommand = async ( }; /** - * deserializeAws_json1_1DeleteProfileCommandError - */ -const de_DeleteProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteRoomCommand + * deserializeAws_json1_1CreateNetworkProfileCommand */ -export const de_DeleteRoomCommand = async ( +export const de_CreateNetworkProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRoomCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRoomCommandOutput = { + const response: CreateNetworkProfileCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2905,48 +1850,39 @@ export const de_DeleteRoomCommand = async ( }; /** - * deserializeAws_json1_1DeleteRoomCommandError + * deserializeAws_json1_1CreateProfileCommand */ -const de_DeleteRoomCommandError = async ( +export const de_CreateProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateProfileCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRoomSkillParameterCommand + * deserializeAws_json1_1CreateRoomCommand */ -export const de_DeleteRoomSkillParameterCommand = async ( +export const de_CreateRoomCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRoomSkillParameterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRoomSkillParameterCommandOutput = { + const response: CreateRoomCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2954,45 +1890,39 @@ export const de_DeleteRoomSkillParameterCommand = async ( }; /** - * deserializeAws_json1_1DeleteRoomSkillParameterCommandError + * deserializeAws_json1_1CreateSkillGroupCommand */ -const de_DeleteRoomSkillParameterCommandError = async ( +export const de_CreateSkillGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateSkillGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteSkillAuthorizationCommand + * deserializeAws_json1_1CreateUserCommand */ -export const de_DeleteSkillAuthorizationCommand = async ( +export const de_CreateUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSkillAuthorizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteSkillAuthorizationCommandOutput = { + const response: CreateUserCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3000,48 +1930,39 @@ export const de_DeleteSkillAuthorizationCommand = async ( }; /** - * deserializeAws_json1_1DeleteSkillAuthorizationCommandError + * deserializeAws_json1_1DeleteAddressBookCommand */ -const de_DeleteSkillAuthorizationCommandError = async ( +export const de_DeleteAddressBookCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteAddressBookCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteSkillGroupCommand + * deserializeAws_json1_1DeleteBusinessReportScheduleCommand */ -export const de_DeleteSkillGroupCommand = async ( +export const de_DeleteBusinessReportScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSkillGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteSkillGroupCommandOutput = { + const response: DeleteBusinessReportScheduleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3049,48 +1970,39 @@ export const de_DeleteSkillGroupCommand = async ( }; /** - * deserializeAws_json1_1DeleteSkillGroupCommandError + * deserializeAws_json1_1DeleteConferenceProviderCommand */ -const de_DeleteSkillGroupCommandError = async ( +export const de_DeleteConferenceProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteConferenceProviderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteUserCommand + * deserializeAws_json1_1DeleteContactCommand */ -export const de_DeleteUserCommand = async ( +export const de_DeleteContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteUserCommandOutput = { + const response: DeleteContactCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3098,48 +2010,39 @@ export const de_DeleteUserCommand = async ( }; /** - * deserializeAws_json1_1DeleteUserCommandError + * deserializeAws_json1_1DeleteDeviceCommand */ -const de_DeleteUserCommandError = async ( +export const de_DeleteDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteDeviceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisassociateContactFromAddressBookCommand + * deserializeAws_json1_1DeleteDeviceUsageDataCommand */ -export const de_DisassociateContactFromAddressBookCommand = async ( +export const de_DeleteDeviceUsageDataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateContactFromAddressBookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateContactFromAddressBookCommandOutput = { + const response: DeleteDeviceUsageDataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3147,39 +2050,39 @@ export const de_DisassociateContactFromAddressBookCommand = async ( }; /** - * deserializeAws_json1_1DisassociateContactFromAddressBookCommandError + * deserializeAws_json1_1DeleteGatewayGroupCommand */ -const de_DisassociateContactFromAddressBookCommandError = async ( +export const de_DeleteGatewayGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteGatewayGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; }; /** - * deserializeAws_json1_1DisassociateDeviceFromRoomCommand + * deserializeAws_json1_1DeleteNetworkProfileCommand */ -export const de_DisassociateDeviceFromRoomCommand = async ( +export const de_DeleteNetworkProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateDeviceFromRoomCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateDeviceFromRoomCommandOutput = { + const response: DeleteNetworkProfileCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3187,48 +2090,39 @@ export const de_DisassociateDeviceFromRoomCommand = async ( }; /** - * deserializeAws_json1_1DisassociateDeviceFromRoomCommandError + * deserializeAws_json1_1DeleteProfileCommand */ -const de_DisassociateDeviceFromRoomCommandError = async ( +export const de_DeleteProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "DeviceNotRegisteredException": - case "com.amazonaws.alexaforbusiness#DeviceNotRegisteredException": - throw await de_DeviceNotRegisteredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteProfileCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisassociateSkillFromSkillGroupCommand + * deserializeAws_json1_1DeleteRoomCommand */ -export const de_DisassociateSkillFromSkillGroupCommand = async ( +export const de_DeleteRoomCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateSkillFromSkillGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateSkillFromSkillGroupCommandOutput = { + const response: DeleteRoomCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3236,48 +2130,39 @@ export const de_DisassociateSkillFromSkillGroupCommand = async ( }; /** - * deserializeAws_json1_1DisassociateSkillFromSkillGroupCommandError + * deserializeAws_json1_1DeleteRoomSkillParameterCommand */ -const de_DisassociateSkillFromSkillGroupCommandError = async ( +export const de_DeleteRoomSkillParameterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteRoomSkillParameterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisassociateSkillFromUsersCommand + * deserializeAws_json1_1DeleteSkillAuthorizationCommand */ -export const de_DisassociateSkillFromUsersCommand = async ( +export const de_DeleteSkillAuthorizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateSkillFromUsersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateSkillFromUsersCommandOutput = { + const response: DeleteSkillAuthorizationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3285,48 +2170,39 @@ export const de_DisassociateSkillFromUsersCommand = async ( }; /** - * deserializeAws_json1_1DisassociateSkillFromUsersCommandError + * deserializeAws_json1_1DeleteSkillGroupCommand */ -const de_DisassociateSkillFromUsersCommandError = async ( +export const de_DeleteSkillGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteSkillGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisassociateSkillGroupFromRoomCommand + * deserializeAws_json1_1DeleteUserCommand */ -export const de_DisassociateSkillGroupFromRoomCommand = async ( +export const de_DeleteUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateSkillGroupFromRoomCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateSkillGroupFromRoomCommandOutput = { + const response: DeleteUserCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3334,45 +2210,39 @@ export const de_DisassociateSkillGroupFromRoomCommand = async ( }; /** - * deserializeAws_json1_1DisassociateSkillGroupFromRoomCommandError + * deserializeAws_json1_1DisassociateContactFromAddressBookCommand */ -const de_DisassociateSkillGroupFromRoomCommandError = async ( +export const de_DisassociateContactFromAddressBookCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisassociateContactFromAddressBookCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ForgetSmartHomeAppliancesCommand + * deserializeAws_json1_1DisassociateDeviceFromRoomCommand */ -export const de_ForgetSmartHomeAppliancesCommand = async ( +export const de_DisassociateDeviceFromRoomCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ForgetSmartHomeAppliancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ForgetSmartHomeAppliancesCommandOutput = { + const response: DisassociateDeviceFromRoomCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3380,45 +2250,39 @@ export const de_ForgetSmartHomeAppliancesCommand = async ( }; /** - * deserializeAws_json1_1ForgetSmartHomeAppliancesCommandError + * deserializeAws_json1_1DisassociateSkillFromSkillGroupCommand */ -const de_ForgetSmartHomeAppliancesCommandError = async ( +export const de_DisassociateSkillFromSkillGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisassociateSkillFromSkillGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetAddressBookCommand + * deserializeAws_json1_1DisassociateSkillFromUsersCommand */ -export const de_GetAddressBookCommand = async ( +export const de_DisassociateSkillFromUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetAddressBookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetAddressBookCommandOutput = { + const response: DisassociateSkillFromUsersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3426,45 +2290,39 @@ export const de_GetAddressBookCommand = async ( }; /** - * deserializeAws_json1_1GetAddressBookCommandError + * deserializeAws_json1_1DisassociateSkillGroupFromRoomCommand */ -const de_GetAddressBookCommandError = async ( +export const de_DisassociateSkillGroupFromRoomCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisassociateSkillGroupFromRoomCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetConferencePreferenceCommand + * deserializeAws_json1_1ForgetSmartHomeAppliancesCommand */ -export const de_GetConferencePreferenceCommand = async ( +export const de_ForgetSmartHomeAppliancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetConferencePreferenceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetConferencePreferenceCommandOutput = { + const response: ForgetSmartHomeAppliancesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3472,45 +2330,39 @@ export const de_GetConferencePreferenceCommand = async ( }; /** - * deserializeAws_json1_1GetConferencePreferenceCommandError + * deserializeAws_json1_1GetAddressBookCommand */ -const de_GetConferencePreferenceCommandError = async ( +export const de_GetAddressBookCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetAddressBookCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetConferenceProviderCommand + * deserializeAws_json1_1GetConferencePreferenceCommand */ -export const de_GetConferenceProviderCommand = async ( +export const de_GetConferencePreferenceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetConferenceProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetConferenceProviderCommandOutput = { + const response: GetConferencePreferenceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3518,29 +2370,23 @@ export const de_GetConferenceProviderCommand = async ( }; /** - * deserializeAws_json1_1GetConferenceProviderCommandError + * deserializeAws_json1_1GetConferenceProviderCommand */ -const de_GetConferenceProviderCommandError = async ( +export const de_GetConferenceProviderCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetConferenceProviderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3551,7 +2397,7 @@ export const de_GetContactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetContactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3563,32 +2409,6 @@ export const de_GetContactCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetContactCommandError - */ -const de_GetContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetDeviceCommand */ @@ -3597,7 +2417,7 @@ export const de_GetDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDeviceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3609,32 +2429,6 @@ export const de_GetDeviceCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetDeviceCommandError - */ -const de_GetDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetGatewayCommand */ @@ -3643,7 +2437,7 @@ export const de_GetGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3655,32 +2449,6 @@ export const de_GetGatewayCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetGatewayCommandError - */ -const de_GetGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetGatewayGroupCommand */ @@ -3689,7 +2457,7 @@ export const de_GetGatewayGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetGatewayGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3701,32 +2469,6 @@ export const de_GetGatewayGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetGatewayGroupCommandError - */ -const de_GetGatewayGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetInvitationConfigurationCommand */ @@ -3735,7 +2477,7 @@ export const de_GetInvitationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetInvitationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3747,32 +2489,6 @@ export const de_GetInvitationConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetInvitationConfigurationCommandError - */ -const de_GetInvitationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetNetworkProfileCommand */ @@ -3781,7 +2497,7 @@ export const de_GetNetworkProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetNetworkProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3793,35 +2509,6 @@ export const de_GetNetworkProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetNetworkProfileCommandError - */ -const de_GetNetworkProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidSecretsManagerResourceException": - case "com.amazonaws.alexaforbusiness#InvalidSecretsManagerResourceException": - throw await de_InvalidSecretsManagerResourceExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetProfileCommand */ @@ -3830,7 +2517,7 @@ export const de_GetProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3842,32 +2529,6 @@ export const de_GetProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetProfileCommandError - */ -const de_GetProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetRoomCommand */ @@ -3876,7 +2537,7 @@ export const de_GetRoomCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRoomCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3888,32 +2549,6 @@ export const de_GetRoomCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetRoomCommandError - */ -const de_GetRoomCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetRoomSkillParameterCommand */ @@ -3922,7 +2557,7 @@ export const de_GetRoomSkillParameterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRoomSkillParameterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3931,33 +2566,7 @@ export const de_GetRoomSkillParameterCommand = async ( $metadata: deserializeMetadata(output), ...contents, }; - return response; -}; - -/** - * deserializeAws_json1_1GetRoomSkillParameterCommandError - */ -const de_GetRoomSkillParameterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** @@ -3968,7 +2577,7 @@ export const de_GetSkillGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSkillGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3980,32 +2589,6 @@ export const de_GetSkillGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetSkillGroupCommandError - */ -const de_GetSkillGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListBusinessReportSchedulesCommand */ @@ -4014,7 +2597,7 @@ export const de_ListBusinessReportSchedulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListBusinessReportSchedulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4026,26 +2609,6 @@ export const de_ListBusinessReportSchedulesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListBusinessReportSchedulesCommandError - */ -const de_ListBusinessReportSchedulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListConferenceProvidersCommand */ @@ -4054,7 +2617,7 @@ export const de_ListConferenceProvidersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListConferenceProvidersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4066,26 +2629,6 @@ export const de_ListConferenceProvidersCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListConferenceProvidersCommandError - */ -const de_ListConferenceProvidersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListDeviceEventsCommand */ @@ -4094,7 +2637,7 @@ export const de_ListDeviceEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListDeviceEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4106,32 +2649,6 @@ export const de_ListDeviceEventsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListDeviceEventsCommandError - */ -const de_ListDeviceEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListGatewayGroupsCommand */ @@ -4140,7 +2657,7 @@ export const de_ListGatewayGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListGatewayGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4152,26 +2669,6 @@ export const de_ListGatewayGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListGatewayGroupsCommandError - */ -const de_ListGatewayGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListGatewaysCommand */ @@ -4180,7 +2677,7 @@ export const de_ListGatewaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListGatewaysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4192,26 +2689,6 @@ export const de_ListGatewaysCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListGatewaysCommandError - */ -const de_ListGatewaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListSkillsCommand */ @@ -4220,7 +2697,7 @@ export const de_ListSkillsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSkillsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4232,26 +2709,6 @@ export const de_ListSkillsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSkillsCommandError - */ -const de_ListSkillsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListSkillsStoreCategoriesCommand */ @@ -4260,7 +2717,7 @@ export const de_ListSkillsStoreCategoriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSkillsStoreCategoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4272,26 +2729,6 @@ export const de_ListSkillsStoreCategoriesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSkillsStoreCategoriesCommandError - */ -const de_ListSkillsStoreCategoriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListSkillsStoreSkillsByCategoryCommand */ @@ -4300,7 +2737,7 @@ export const de_ListSkillsStoreSkillsByCategoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSkillsStoreSkillsByCategoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4312,26 +2749,6 @@ export const de_ListSkillsStoreSkillsByCategoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSkillsStoreSkillsByCategoryCommandError - */ -const de_ListSkillsStoreSkillsByCategoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListSmartHomeAppliancesCommand */ @@ -4340,7 +2757,7 @@ export const de_ListSmartHomeAppliancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSmartHomeAppliancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4352,32 +2769,6 @@ export const de_ListSmartHomeAppliancesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSmartHomeAppliancesCommandError - */ -const de_ListSmartHomeAppliancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsCommand */ @@ -4386,7 +2777,7 @@ export const de_ListTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4398,32 +2789,6 @@ export const de_ListTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsCommandError - */ -const de_ListTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutConferencePreferenceCommand */ @@ -4432,7 +2797,7 @@ export const de_PutConferencePreferenceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutConferencePreferenceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4444,32 +2809,6 @@ export const de_PutConferencePreferenceCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutConferencePreferenceCommandError - */ -const de_PutConferencePreferenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutInvitationConfigurationCommand */ @@ -4478,7 +2817,7 @@ export const de_PutInvitationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutInvitationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4490,35 +2829,6 @@ export const de_PutInvitationConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutInvitationConfigurationCommandError - */ -const de_PutInvitationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutRoomSkillParameterCommand */ @@ -4527,7 +2837,7 @@ export const de_PutRoomSkillParameterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutRoomSkillParameterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4539,32 +2849,6 @@ export const de_PutRoomSkillParameterCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutRoomSkillParameterCommandError - */ -const de_PutRoomSkillParameterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutSkillAuthorizationCommand */ @@ -4573,7 +2857,7 @@ export const de_PutSkillAuthorizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutSkillAuthorizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4585,35 +2869,6 @@ export const de_PutSkillAuthorizationCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutSkillAuthorizationCommandError - */ -const de_PutSkillAuthorizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.alexaforbusiness#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RegisterAVSDeviceCommand */ @@ -4622,7 +2877,7 @@ export const de_RegisterAVSDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterAVSDeviceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4634,41 +2889,6 @@ export const de_RegisterAVSDeviceCommand = async ( return response; }; -/** - * deserializeAws_json1_1RegisterAVSDeviceCommandError - */ -const de_RegisterAVSDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidDeviceException": - case "com.amazonaws.alexaforbusiness#InvalidDeviceException": - throw await de_InvalidDeviceExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.alexaforbusiness#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RejectSkillCommand */ @@ -4677,7 +2897,7 @@ export const de_RejectSkillCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RejectSkillCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4689,35 +2909,6 @@ export const de_RejectSkillCommand = async ( return response; }; -/** - * deserializeAws_json1_1RejectSkillCommandError - */ -const de_RejectSkillCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ResolveRoomCommand */ @@ -4726,7 +2917,7 @@ export const de_ResolveRoomCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResolveRoomCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4738,32 +2929,6 @@ export const de_ResolveRoomCommand = async ( return response; }; -/** - * deserializeAws_json1_1ResolveRoomCommandError - */ -const de_ResolveRoomCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RevokeInvitationCommand */ @@ -4772,7 +2937,7 @@ export const de_RevokeInvitationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RevokeInvitationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4784,35 +2949,6 @@ export const de_RevokeInvitationCommand = async ( return response; }; -/** - * deserializeAws_json1_1RevokeInvitationCommandError - */ -const de_RevokeInvitationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SearchAddressBooksCommand */ @@ -4821,7 +2957,7 @@ export const de_SearchAddressBooksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchAddressBooksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4833,26 +2969,6 @@ export const de_SearchAddressBooksCommand = async ( return response; }; -/** - * deserializeAws_json1_1SearchAddressBooksCommandError - */ -const de_SearchAddressBooksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1SearchContactsCommand */ @@ -4861,7 +2977,7 @@ export const de_SearchContactsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchContactsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4873,26 +2989,6 @@ export const de_SearchContactsCommand = async ( return response; }; -/** - * deserializeAws_json1_1SearchContactsCommandError - */ -const de_SearchContactsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1SearchDevicesCommand */ @@ -4901,7 +2997,7 @@ export const de_SearchDevicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchDevicesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4913,26 +3009,6 @@ export const de_SearchDevicesCommand = async ( return response; }; -/** - * deserializeAws_json1_1SearchDevicesCommandError - */ -const de_SearchDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1SearchNetworkProfilesCommand */ @@ -4941,7 +3017,7 @@ export const de_SearchNetworkProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchNetworkProfilesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4953,26 +3029,6 @@ export const de_SearchNetworkProfilesCommand = async ( return response; }; -/** - * deserializeAws_json1_1SearchNetworkProfilesCommandError - */ -const de_SearchNetworkProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1SearchProfilesCommand */ @@ -4981,7 +3037,7 @@ export const de_SearchProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchProfilesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4993,26 +3049,6 @@ export const de_SearchProfilesCommand = async ( return response; }; -/** - * deserializeAws_json1_1SearchProfilesCommandError - */ -const de_SearchProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1SearchRoomsCommand */ @@ -5021,7 +3057,7 @@ export const de_SearchRoomsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchRoomsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5033,26 +3069,6 @@ export const de_SearchRoomsCommand = async ( return response; }; -/** - * deserializeAws_json1_1SearchRoomsCommandError - */ -const de_SearchRoomsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1SearchSkillGroupsCommand */ @@ -5061,7 +3077,7 @@ export const de_SearchSkillGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchSkillGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5073,80 +3089,20 @@ export const de_SearchSkillGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1SearchSkillGroupsCommandError - */ -const de_SearchSkillGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1SearchUsersCommand */ -export const de_SearchUsersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SearchUsersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: SearchUsersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1SearchUsersCommandError - */ -const de_SearchUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1SendAnnouncementCommand - */ -export const de_SendAnnouncementCommand = async ( +export const de_SearchUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SendAnnouncementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: SendAnnouncementCommandOutput = { + const response: SearchUsersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5154,32 +3110,23 @@ export const de_SendAnnouncementCommand = async ( }; /** - * deserializeAws_json1_1SendAnnouncementCommandError + * deserializeAws_json1_1SendAnnouncementCommand */ -const de_SendAnnouncementCommandError = async ( +export const de_SendAnnouncementCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.alexaforbusiness#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.alexaforbusiness#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: SendAnnouncementCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -5190,7 +3137,7 @@ export const de_SendInvitationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendInvitationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5202,38 +3149,6 @@ export const de_SendInvitationCommand = async ( return response; }; -/** - * deserializeAws_json1_1SendInvitationCommandError - */ -const de_SendInvitationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidUserStatusException": - case "com.amazonaws.alexaforbusiness#InvalidUserStatusException": - throw await de_InvalidUserStatusExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartDeviceSyncCommand */ @@ -5242,7 +3157,7 @@ export const de_StartDeviceSyncCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartDeviceSyncCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5254,32 +3169,6 @@ export const de_StartDeviceSyncCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartDeviceSyncCommandError - */ -const de_StartDeviceSyncCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeviceNotRegisteredException": - case "com.amazonaws.alexaforbusiness#DeviceNotRegisteredException": - throw await de_DeviceNotRegisteredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartSmartHomeApplianceDiscoveryCommand */ @@ -5288,7 +3177,7 @@ export const de_StartSmartHomeApplianceDiscoveryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartSmartHomeApplianceDiscoveryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5300,32 +3189,6 @@ export const de_StartSmartHomeApplianceDiscoveryCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartSmartHomeApplianceDiscoveryCommandError - */ -const de_StartSmartHomeApplianceDiscoveryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -5334,7 +3197,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5346,32 +3209,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -5380,7 +3217,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5392,32 +3229,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateAddressBookCommand */ @@ -5426,7 +3237,7 @@ export const de_UpdateAddressBookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateAddressBookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5438,38 +3249,6 @@ export const de_UpdateAddressBookCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateAddressBookCommandError - */ -const de_UpdateAddressBookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NameInUseException": - case "com.amazonaws.alexaforbusiness#NameInUseException": - throw await de_NameInUseExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateBusinessReportScheduleCommand */ @@ -5478,107 +3257,32 @@ export const de_UpdateBusinessReportScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateBusinessReportScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); const response: UpdateBusinessReportScheduleCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateBusinessReportScheduleCommandError - */ -const de_UpdateBusinessReportScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateConferenceProviderCommand - */ -export const de_UpdateConferenceProviderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateConferenceProviderCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateConferenceProviderCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateConferenceProviderCommandError - */ -const de_UpdateConferenceProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateContactCommand + * deserializeAws_json1_1UpdateConferenceProviderCommand */ -export const de_UpdateContactCommand = async ( +export const de_UpdateConferenceProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateContactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateContactCommandOutput = { + const response: UpdateConferenceProviderCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5586,32 +3290,23 @@ export const de_UpdateContactCommand = async ( }; /** - * deserializeAws_json1_1UpdateContactCommandError + * deserializeAws_json1_1UpdateContactCommand */ -const de_UpdateContactCommandError = async ( +export const de_UpdateContactCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateContactCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -5622,7 +3317,7 @@ export const de_UpdateDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDeviceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5634,38 +3329,6 @@ export const de_UpdateDeviceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDeviceCommandError - */ -const de_UpdateDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "DeviceNotRegisteredException": - case "com.amazonaws.alexaforbusiness#DeviceNotRegisteredException": - throw await de_DeviceNotRegisteredExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateGatewayCommand */ @@ -5674,7 +3337,7 @@ export const de_UpdateGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5686,35 +3349,6 @@ export const de_UpdateGatewayCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateGatewayCommandError - */ -const de_UpdateGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NameInUseException": - case "com.amazonaws.alexaforbusiness#NameInUseException": - throw await de_NameInUseExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateGatewayGroupCommand */ @@ -5723,7 +3357,7 @@ export const de_UpdateGatewayGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateGatewayGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5735,35 +3369,6 @@ export const de_UpdateGatewayGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateGatewayGroupCommandError - */ -const de_UpdateGatewayGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NameInUseException": - case "com.amazonaws.alexaforbusiness#NameInUseException": - throw await de_NameInUseExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateNetworkProfileCommand */ @@ -5772,7 +3377,7 @@ export const de_UpdateNetworkProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateNetworkProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5784,44 +3389,6 @@ export const de_UpdateNetworkProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateNetworkProfileCommandError - */ -const de_UpdateNetworkProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidCertificateAuthorityException": - case "com.amazonaws.alexaforbusiness#InvalidCertificateAuthorityException": - throw await de_InvalidCertificateAuthorityExceptionRes(parsedOutput, context); - case "InvalidSecretsManagerResourceException": - case "com.amazonaws.alexaforbusiness#InvalidSecretsManagerResourceException": - throw await de_InvalidSecretsManagerResourceExceptionRes(parsedOutput, context); - case "NameInUseException": - case "com.amazonaws.alexaforbusiness#NameInUseException": - throw await de_NameInUseExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateProfileCommand */ @@ -5830,7 +3397,7 @@ export const de_UpdateProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5842,38 +3409,6 @@ export const de_UpdateProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateProfileCommandError - */ -const de_UpdateProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NameInUseException": - case "com.amazonaws.alexaforbusiness#NameInUseException": - throw await de_NameInUseExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateRoomCommand */ @@ -5882,7 +3417,7 @@ export const de_UpdateRoomCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRoomCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5894,35 +3429,6 @@ export const de_UpdateRoomCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateRoomCommandError - */ -const de_UpdateRoomCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NameInUseException": - case "com.amazonaws.alexaforbusiness#NameInUseException": - throw await de_NameInUseExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.alexaforbusiness#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSkillGroupCommand */ @@ -5931,7 +3437,7 @@ export const de_UpdateSkillGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSkillGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5944,12 +3450,9 @@ export const de_UpdateSkillGroupCommand = async ( }; /** - * deserializeAws_json1_1UpdateSkillGroupCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateSkillGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5959,19 +3462,55 @@ const de_UpdateSkillGroupCommandError = async ( case "ConcurrentModificationException": case "com.amazonaws.alexaforbusiness#ConcurrentModificationException": throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NameInUseException": - case "com.amazonaws.alexaforbusiness#NameInUseException": - throw await de_NameInUseExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.alexaforbusiness#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "NotFoundException": case "com.amazonaws.alexaforbusiness#NotFoundException": throw await de_NotFoundExceptionRes(parsedOutput, context); + case "DeviceNotRegisteredException": + case "com.amazonaws.alexaforbusiness#DeviceNotRegisteredException": + throw await de_DeviceNotRegisteredExceptionRes(parsedOutput, context); + case "SkillNotLinkedException": + case "com.amazonaws.alexaforbusiness#SkillNotLinkedException": + throw await de_SkillNotLinkedExceptionRes(parsedOutput, context); + case "AlreadyExistsException": + case "com.amazonaws.alexaforbusiness#AlreadyExistsException": + throw await de_AlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidCertificateAuthorityException": + case "com.amazonaws.alexaforbusiness#InvalidCertificateAuthorityException": + throw await de_InvalidCertificateAuthorityExceptionRes(parsedOutput, context); + case "InvalidServiceLinkedRoleStateException": + case "com.amazonaws.alexaforbusiness#InvalidServiceLinkedRoleStateException": + throw await de_InvalidServiceLinkedRoleStateExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.alexaforbusiness#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); + case "ResourceAssociatedException": + case "com.amazonaws.alexaforbusiness#ResourceAssociatedException": + throw await de_ResourceAssociatedExceptionRes(parsedOutput, context); + case "InvalidSecretsManagerResourceException": + case "com.amazonaws.alexaforbusiness#InvalidSecretsManagerResourceException": + throw await de_InvalidSecretsManagerResourceExceptionRes(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.alexaforbusiness#UnauthorizedException": + throw await de_UnauthorizedExceptionRes(parsedOutput, context); + case "InvalidDeviceException": + case "com.amazonaws.alexaforbusiness#InvalidDeviceException": + throw await de_InvalidDeviceExceptionRes(parsedOutput, context); + case "InvalidUserStatusException": + case "com.amazonaws.alexaforbusiness#InvalidUserStatusException": + throw await de_InvalidUserStatusExceptionRes(parsedOutput, context); + case "NameInUseException": + case "com.amazonaws.alexaforbusiness#NameInUseException": + throw await de_NameInUseExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-amp/src/protocols/Aws_restJson1.ts b/clients/client-amp/src/protocols/Aws_restJson1.ts index 717f608ad542..d5f280809736 100644 --- a/clients/client-amp/src/protocols/Aws_restJson1.ts +++ b/clients/client-amp/src/protocols/Aws_restJson1.ts @@ -672,7 +672,7 @@ export const de_CreateAlertManagerDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateAlertManagerDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -685,50 +685,6 @@ export const de_CreateAlertManagerDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAlertManagerDefinitionCommandError - */ -const de_CreateAlertManagerDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.amp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.amp#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLoggingConfigurationCommand */ @@ -737,7 +693,7 @@ export const de_CreateLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -750,41 +706,6 @@ export const de_CreateLoggingConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLoggingConfigurationCommandError - */ -const de_CreateLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRuleGroupsNamespaceCommand */ @@ -793,7 +714,7 @@ export const de_CreateRuleGroupsNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateRuleGroupsNamespaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -809,50 +730,6 @@ export const de_CreateRuleGroupsNamespaceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRuleGroupsNamespaceCommandError - */ -const de_CreateRuleGroupsNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.amp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.amp#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateScraperCommand */ @@ -861,7 +738,7 @@ export const de_CreateScraperCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateScraperCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -877,50 +754,6 @@ export const de_CreateScraperCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateScraperCommandError - */ -const de_CreateScraperCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.amp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.amp#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWorkspaceCommand */ @@ -929,7 +762,7 @@ export const de_CreateWorkspaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateWorkspaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -947,55 +780,31 @@ export const de_CreateWorkspaceCommand = async ( }; /** - * deserializeAws_restJson1CreateWorkspaceCommandError + * deserializeAws_restJson1DeleteAlertManagerDefinitionCommand */ -const de_CreateWorkspaceCommandError = async ( +export const de_DeleteAlertManagerDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.amp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.amp#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteAlertManagerDefinitionCommand + * deserializeAws_restJson1DeleteLoggingConfigurationCommand */ -export const de_DeleteAlertManagerDefinitionCommand = async ( +export const de_DeleteLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteAlertManagerDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1005,810 +814,218 @@ export const de_DeleteAlertManagerDefinitionCommand = async ( }; /** - * deserializeAws_restJson1DeleteAlertManagerDefinitionCommandError + * deserializeAws_restJson1DeleteRuleGroupsNamespaceCommand */ -const de_DeleteAlertManagerDefinitionCommandError = async ( +export const de_DeleteRuleGroupsNamespaceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.amp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteLoggingConfigurationCommand + * deserializeAws_restJson1DeleteScraperCommand */ -export const de_DeleteLoggingConfigurationCommand = async ( +export const de_DeleteScraperCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + scraperId: __expectString, + status: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteLoggingConfigurationCommandError + * deserializeAws_restJson1DeleteWorkspaceCommand */ -const de_DeleteLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.amp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRuleGroupsNamespaceCommand - */ -export const de_DeleteRuleGroupsNamespaceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteRuleGroupsNamespaceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRuleGroupsNamespaceCommandError - */ -const de_DeleteRuleGroupsNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.amp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteScraperCommand - */ -export const de_DeleteScraperCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteScraperCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - scraperId: __expectString, - status: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteScraperCommandError - */ -const de_DeleteScraperCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.amp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteWorkspaceCommand - */ -export const de_DeleteWorkspaceCommand = async ( +export const de_DeleteWorkspaceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteWorkspaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteWorkspaceCommandError - */ -const de_DeleteWorkspaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.amp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAlertManagerDefinitionCommand - */ -export const de_DescribeAlertManagerDefinitionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAlertManagerDefinitionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - alertManagerDefinition: (_) => de_AlertManagerDefinitionDescription(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAlertManagerDefinitionCommandError - */ -const de_DescribeAlertManagerDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeLoggingConfigurationCommand - */ -export const de_DescribeLoggingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeLoggingConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - loggingConfiguration: (_) => de_LoggingConfigurationMetadata(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeLoggingConfigurationCommandError - */ -const de_DescribeLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeRuleGroupsNamespaceCommand - */ -export const de_DescribeRuleGroupsNamespaceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRuleGroupsNamespaceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ruleGroupsNamespace: (_) => de_RuleGroupsNamespaceDescription(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeRuleGroupsNamespaceCommandError - */ -const de_DescribeRuleGroupsNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DescribeScraperCommand + * deserializeAws_restJson1DescribeAlertManagerDefinitionCommand */ -export const de_DescribeScraperCommand = async ( +export const de_DescribeAlertManagerDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeScraperCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - scraper: (_) => de_ScraperDescription(_, context), + alertManagerDefinition: (_) => de_AlertManagerDefinitionDescription(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeScraperCommandError - */ -const de_DescribeScraperCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeWorkspaceCommand + * deserializeAws_restJson1DescribeLoggingConfigurationCommand */ -export const de_DescribeWorkspaceCommand = async ( +export const de_DescribeLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeWorkspaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - workspace: (_) => de_WorkspaceDescription(_, context), + loggingConfiguration: (_) => de_LoggingConfigurationMetadata(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeWorkspaceCommandError - */ -const de_DescribeWorkspaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDefaultScraperConfigurationCommand + * deserializeAws_restJson1DescribeRuleGroupsNamespaceCommand */ -export const de_GetDefaultScraperConfigurationCommand = async ( +export const de_DescribeRuleGroupsNamespaceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDefaultScraperConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - configuration: context.base64Decoder, + ruleGroupsNamespace: (_) => de_RuleGroupsNamespaceDescription(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetDefaultScraperConfigurationCommandError - */ -const de_GetDefaultScraperConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListRuleGroupsNamespacesCommand + * deserializeAws_restJson1DescribeScraperCommand */ -export const de_ListRuleGroupsNamespacesCommand = async ( +export const de_DescribeScraperCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRuleGroupsNamespacesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - ruleGroupsNamespaces: (_) => de_RuleGroupsNamespaceSummaryList(_, context), + scraper: (_) => de_ScraperDescription(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRuleGroupsNamespacesCommandError - */ -const de_ListRuleGroupsNamespacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListScrapersCommand + * deserializeAws_restJson1DescribeWorkspaceCommand */ -export const de_ListScrapersCommand = async ( +export const de_DescribeWorkspaceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListScrapersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - scrapers: (_) => de_ScraperSummaryList(_, context), + workspace: (_) => de_WorkspaceDescription(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListScrapersCommandError - */ -const de_ListScrapersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1GetDefaultScraperConfigurationCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_GetDefaultScraperConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + configuration: context.base64Decoder, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListRuleGroupsNamespacesCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListRuleGroupsNamespacesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + ruleGroupsNamespaces: (_) => de_RuleGroupsNamespaceSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListWorkspacesCommand + * deserializeAws_restJson1ListScrapersCommand */ -export const de_ListWorkspacesCommand = async ( +export const de_ListScrapersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkspacesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1816,110 +1033,74 @@ export const de_ListWorkspacesCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - workspaces: (_) => de_WorkspaceSummaryList(_, context), + scrapers: (_) => de_ScraperSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListWorkspacesCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListWorkspacesCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutAlertManagerDefinitionCommand + * deserializeAws_restJson1ListWorkspacesCommand */ -export const de_PutAlertManagerDefinitionCommand = async ( +export const de_ListWorkspacesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_PutAlertManagerDefinitionCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - status: _json, + nextToken: __expectString, + workspaces: (_) => de_WorkspaceSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutAlertManagerDefinitionCommandError + * deserializeAws_restJson1PutAlertManagerDefinitionCommand */ -const de_PutAlertManagerDefinitionCommandError = async ( +export const de_PutAlertManagerDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.amp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.amp#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + status: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1930,7 +1111,7 @@ export const de_PutRuleGroupsNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_PutRuleGroupsNamespaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1946,50 +1127,6 @@ export const de_PutRuleGroupsNamespaceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutRuleGroupsNamespaceCommandError - */ -const de_PutRuleGroupsNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.amp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.amp#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1998,7 +1135,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2007,44 +1144,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2053,7 +1152,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2062,44 +1161,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amp#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLoggingConfigurationCommand */ @@ -2108,7 +1169,7 @@ export const de_UpdateLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2121,44 +1182,6 @@ export const de_UpdateLoggingConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLoggingConfigurationCommandError - */ -const de_UpdateLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.amp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.amp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.amp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.amp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWorkspaceAliasCommand */ @@ -2167,7 +1190,7 @@ export const de_UpdateWorkspaceAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateWorkspaceAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2177,12 +1200,9 @@ export const de_UpdateWorkspaceAliasCommand = async ( }; /** - * deserializeAws_restJson1UpdateWorkspaceAliasCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateWorkspaceAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2216,7 +1236,7 @@ const de_UpdateWorkspaceAliasCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-amplify/src/protocols/Aws_restJson1.ts b/clients/client-amplify/src/protocols/Aws_restJson1.ts index b1f7a1f68539..02e0c4fb9f29 100644 --- a/clients/client-amplify/src/protocols/Aws_restJson1.ts +++ b/clients/client-amplify/src/protocols/Aws_restJson1.ts @@ -944,7 +944,7 @@ export const de_CreateAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAppCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -957,44 +957,6 @@ export const de_CreateAppCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAppCommandError - */ -const de_CreateAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "DependentServiceFailureException": - case "com.amazonaws.amplify#DependentServiceFailureException": - throw await de_DependentServiceFailureExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBackendEnvironmentCommand */ @@ -1003,7 +965,7 @@ export const de_CreateBackendEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBackendEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1016,44 +978,6 @@ export const de_CreateBackendEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBackendEnvironmentCommandError - */ -const de_CreateBackendEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBranchCommand */ @@ -1062,7 +986,7 @@ export const de_CreateBranchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBranchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1075,47 +999,6 @@ export const de_CreateBranchCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBranchCommandError - */ -const de_CreateBranchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "DependentServiceFailureException": - case "com.amazonaws.amplify#DependentServiceFailureException": - throw await de_DependentServiceFailureExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDeploymentCommand */ @@ -1124,7 +1007,7 @@ export const de_CreateDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1139,41 +1022,6 @@ export const de_CreateDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDeploymentCommandError - */ -const de_CreateDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDomainAssociationCommand */ @@ -1182,7 +1030,7 @@ export const de_CreateDomainAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDomainAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1195,47 +1043,6 @@ export const de_CreateDomainAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDomainAssociationCommandError - */ -const de_CreateDomainAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "DependentServiceFailureException": - case "com.amazonaws.amplify#DependentServiceFailureException": - throw await de_DependentServiceFailureExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWebhookCommand */ @@ -1244,7 +1051,7 @@ export const de_CreateWebhookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWebhookCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1257,47 +1064,6 @@ export const de_CreateWebhookCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWebhookCommandError - */ -const de_CreateWebhookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "DependentServiceFailureException": - case "com.amazonaws.amplify#DependentServiceFailureException": - throw await de_DependentServiceFailureExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAppCommand */ @@ -1306,7 +1072,7 @@ export const de_DeleteAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAppCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1319,44 +1085,6 @@ export const de_DeleteAppCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAppCommandError - */ -const de_DeleteAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "DependentServiceFailureException": - case "com.amazonaws.amplify#DependentServiceFailureException": - throw await de_DependentServiceFailureExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBackendEnvironmentCommand */ @@ -1365,7 +1093,7 @@ export const de_DeleteBackendEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBackendEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1379,52 +1107,14 @@ export const de_DeleteBackendEnvironmentCommand = async ( }; /** - * deserializeAws_restJson1DeleteBackendEnvironmentCommandError + * deserializeAws_restJson1DeleteBranchCommand */ -const de_DeleteBackendEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "DependentServiceFailureException": - case "com.amazonaws.amplify#DependentServiceFailureException": - throw await de_DependentServiceFailureExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteBranchCommand - */ -export const de_DeleteBranchCommand = async ( +export const de_DeleteBranchCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBranchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1437,44 +1127,6 @@ export const de_DeleteBranchCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteBranchCommandError - */ -const de_DeleteBranchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "DependentServiceFailureException": - case "com.amazonaws.amplify#DependentServiceFailureException": - throw await de_DependentServiceFailureExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDomainAssociationCommand */ @@ -1483,7 +1135,7 @@ export const de_DeleteDomainAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDomainAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1496,44 +1148,6 @@ export const de_DeleteDomainAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDomainAssociationCommandError - */ -const de_DeleteDomainAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "DependentServiceFailureException": - case "com.amazonaws.amplify#DependentServiceFailureException": - throw await de_DependentServiceFailureExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteJobCommand */ @@ -1542,7 +1156,7 @@ export const de_DeleteJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1555,44 +1169,6 @@ export const de_DeleteJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteJobCommandError - */ -const de_DeleteJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteWebhookCommand */ @@ -1601,7 +1177,7 @@ export const de_DeleteWebhookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteWebhookCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1614,44 +1190,6 @@ export const de_DeleteWebhookCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteWebhookCommandError - */ -const de_DeleteWebhookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GenerateAccessLogsCommand */ @@ -1660,7 +1198,7 @@ export const de_GenerateAccessLogsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GenerateAccessLogsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1673,41 +1211,6 @@ export const de_GenerateAccessLogsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GenerateAccessLogsCommandError - */ -const de_GenerateAccessLogsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAppCommand */ @@ -1716,7 +1219,7 @@ export const de_GetAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAppCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1729,38 +1232,6 @@ export const de_GetAppCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAppCommandError - */ -const de_GetAppCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetArtifactUrlCommand */ @@ -1769,7 +1240,7 @@ export const de_GetArtifactUrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetArtifactUrlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1784,52 +1255,14 @@ export const de_GetArtifactUrlCommand = async ( }; /** - * deserializeAws_restJson1GetArtifactUrlCommandError + * deserializeAws_restJson1GetBackendEnvironmentCommand */ -const de_GetArtifactUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetBackendEnvironmentCommand - */ -export const de_GetBackendEnvironmentCommand = async ( +export const de_GetBackendEnvironmentCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBackendEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1842,41 +1275,6 @@ export const de_GetBackendEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBackendEnvironmentCommandError - */ -const de_GetBackendEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBranchCommand */ @@ -1885,7 +1283,7 @@ export const de_GetBranchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBranchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1898,41 +1296,6 @@ export const de_GetBranchCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBranchCommandError - */ -const de_GetBranchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDomainAssociationCommand */ @@ -1941,7 +1304,7 @@ export const de_GetDomainAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDomainAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1954,41 +1317,6 @@ export const de_GetDomainAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDomainAssociationCommandError - */ -const de_GetDomainAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetJobCommand */ @@ -1997,7 +1325,7 @@ export const de_GetJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2010,41 +1338,6 @@ export const de_GetJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetJobCommandError - */ -const de_GetJobCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetWebhookCommand */ @@ -2053,7 +1346,7 @@ export const de_GetWebhookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWebhookCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2066,44 +1359,6 @@ export const de_GetWebhookCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetWebhookCommandError - */ -const de_GetWebhookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAppsCommand */ @@ -2112,7 +1367,7 @@ export const de_ListAppsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2126,38 +1381,6 @@ export const de_ListAppsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAppsCommandError - */ -const de_ListAppsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListArtifactsCommand */ @@ -2166,7 +1389,7 @@ export const de_ListArtifactsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListArtifactsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2180,41 +1403,6 @@ export const de_ListArtifactsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListArtifactsCommandError - */ -const de_ListArtifactsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListBackendEnvironmentsCommand */ @@ -2223,7 +1411,7 @@ export const de_ListBackendEnvironmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBackendEnvironmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2237,38 +1425,6 @@ export const de_ListBackendEnvironmentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListBackendEnvironmentsCommandError - */ -const de_ListBackendEnvironmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListBranchesCommand */ @@ -2277,7 +1433,7 @@ export const de_ListBranchesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBranchesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2291,38 +1447,6 @@ export const de_ListBranchesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListBranchesCommandError - */ -const de_ListBranchesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDomainAssociationsCommand */ @@ -2331,7 +1455,7 @@ export const de_ListDomainAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDomainAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2345,38 +1469,6 @@ export const de_ListDomainAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDomainAssociationsCommandError - */ -const de_ListDomainAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListJobsCommand */ @@ -2385,7 +1477,7 @@ export const de_ListJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2399,41 +1491,6 @@ export const de_ListJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListJobsCommandError - */ -const de_ListJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -2442,7 +1499,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2455,38 +1512,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amplify#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWebhooksCommand */ @@ -2495,7 +1520,7 @@ export const de_ListWebhooksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWebhooksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2506,112 +1531,18 @@ export const de_ListWebhooksCommand = async ( webhooks: (_) => de_Webhooks(_, context), }); Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListWebhooksCommandError - */ -const de_ListWebhooksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartDeploymentCommand - */ -export const de_StartDeploymentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartDeploymentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - jobSummary: (_) => de_JobSummary(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartDeploymentCommandError - */ -const de_StartDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return contents; }; /** - * deserializeAws_restJson1StartJobCommand + * deserializeAws_restJson1StartDeploymentCommand */ -export const de_StartJobCommand = async ( +export const de_StartDeploymentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2625,41 +1556,24 @@ export const de_StartJobCommand = async ( }; /** - * deserializeAws_restJson1StartJobCommandError + * deserializeAws_restJson1StartJobCommand */ -const de_StartJobCommandError = async ( +export const de_StartJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + jobSummary: (_) => de_JobSummary(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2670,7 +1584,7 @@ export const de_StopJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2683,44 +1597,6 @@ export const de_StopJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopJobCommandError - */ -const de_StopJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.amplify#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2729,7 +1605,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2738,38 +1614,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amplify#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2778,7 +1622,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2787,38 +1631,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amplify#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAppCommand */ @@ -2827,7 +1639,7 @@ export const de_UpdateAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAppCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2840,41 +1652,6 @@ export const de_UpdateAppCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAppCommandError - */ -const de_UpdateAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBranchCommand */ @@ -2883,7 +1660,7 @@ export const de_UpdateBranchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBranchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2896,44 +1673,6 @@ export const de_UpdateBranchCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateBranchCommandError - */ -const de_UpdateBranchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "DependentServiceFailureException": - case "com.amazonaws.amplify#DependentServiceFailureException": - throw await de_DependentServiceFailureExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDomainAssociationCommand */ @@ -2942,7 +1681,7 @@ export const de_UpdateDomainAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDomainAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2955,44 +1694,6 @@ export const de_UpdateDomainAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDomainAssociationCommandError - */ -const de_UpdateDomainAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplify#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "DependentServiceFailureException": - case "com.amazonaws.amplify#DependentServiceFailureException": - throw await de_DependentServiceFailureExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.amplify#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplify#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWebhookCommand */ @@ -3001,7 +1702,7 @@ export const de_UpdateWebhookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateWebhookCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3015,12 +1716,9 @@ export const de_UpdateWebhookCommand = async ( }; /** - * deserializeAws_restJson1UpdateWebhookCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateWebhookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3036,19 +1734,25 @@ const de_UpdateWebhookCommandError = async ( case "InternalFailureException": case "com.amazonaws.amplify#InternalFailureException": throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplify#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.amplify#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "UnauthorizedException": case "com.amazonaws.amplify#UnauthorizedException": throw await de_UnauthorizedExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.amplify#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.amplify#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts b/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts index 841c33a7c9ca..24e5362face4 100644 --- a/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts +++ b/clients/client-amplifybackend/src/protocols/Aws_restJson1.ts @@ -852,7 +852,7 @@ export const de_CloneBackendCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CloneBackendCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -870,41 +870,6 @@ export const de_CloneBackendCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CloneBackendCommandError - */ -const de_CloneBackendCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBackendCommand */ @@ -913,7 +878,7 @@ export const de_CreateBackendCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBackendCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -931,41 +896,6 @@ export const de_CreateBackendCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBackendCommandError - */ -const de_CreateBackendCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBackendAPICommand */ @@ -974,7 +904,7 @@ export const de_CreateBackendAPICommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBackendAPICommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -992,41 +922,6 @@ export const de_CreateBackendAPICommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBackendAPICommandError - */ -const de_CreateBackendAPICommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBackendAuthCommand */ @@ -1035,7 +930,7 @@ export const de_CreateBackendAuthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBackendAuthCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1053,41 +948,6 @@ export const de_CreateBackendAuthCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBackendAuthCommandError - */ -const de_CreateBackendAuthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBackendConfigCommand */ @@ -1096,7 +956,7 @@ export const de_CreateBackendConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBackendConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1112,41 +972,6 @@ export const de_CreateBackendConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBackendConfigCommandError - */ -const de_CreateBackendConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBackendStorageCommand */ @@ -1155,7 +980,7 @@ export const de_CreateBackendStorageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBackendStorageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1171,41 +996,6 @@ export const de_CreateBackendStorageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBackendStorageCommandError - */ -const de_CreateBackendStorageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateTokenCommand */ @@ -1214,7 +1004,7 @@ export const de_CreateTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTokenCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1230,41 +1020,6 @@ export const de_CreateTokenCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTokenCommandError - */ -const de_CreateTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBackendCommand */ @@ -1273,7 +1028,7 @@ export const de_DeleteBackendCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBackendCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1291,41 +1046,6 @@ export const de_DeleteBackendCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteBackendCommandError - */ -const de_DeleteBackendCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBackendAPICommand */ @@ -1334,7 +1054,7 @@ export const de_DeleteBackendAPICommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBackendAPICommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1352,41 +1072,6 @@ export const de_DeleteBackendAPICommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteBackendAPICommandError - */ -const de_DeleteBackendAPICommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBackendAuthCommand */ @@ -1395,7 +1080,7 @@ export const de_DeleteBackendAuthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBackendAuthCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1413,41 +1098,6 @@ export const de_DeleteBackendAuthCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteBackendAuthCommandError - */ -const de_DeleteBackendAuthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBackendStorageCommand */ @@ -1456,7 +1106,7 @@ export const de_DeleteBackendStorageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBackendStorageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1472,41 +1122,6 @@ export const de_DeleteBackendStorageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteBackendStorageCommandError - */ -const de_DeleteBackendStorageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteTokenCommand */ @@ -1515,7 +1130,7 @@ export const de_DeleteTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTokenCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1528,41 +1143,6 @@ export const de_DeleteTokenCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteTokenCommandError - */ -const de_DeleteTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GenerateBackendAPIModelsCommand */ @@ -1571,7 +1151,7 @@ export const de_GenerateBackendAPIModelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GenerateBackendAPIModelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1589,41 +1169,6 @@ export const de_GenerateBackendAPIModelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GenerateBackendAPIModelsCommandError - */ -const de_GenerateBackendAPIModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBackendCommand */ @@ -1632,7 +1177,7 @@ export const de_GetBackendCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBackendCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1651,41 +1196,6 @@ export const de_GetBackendCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBackendCommandError - */ -const de_GetBackendCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBackendAPICommand */ @@ -1694,7 +1204,7 @@ export const de_GetBackendAPICommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBackendAPICommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1711,41 +1221,6 @@ export const de_GetBackendAPICommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBackendAPICommandError - */ -const de_GetBackendAPICommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBackendAPIModelsCommand */ @@ -1754,7 +1229,7 @@ export const de_GetBackendAPIModelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBackendAPIModelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1769,41 +1244,6 @@ export const de_GetBackendAPIModelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBackendAPIModelsCommandError - */ -const de_GetBackendAPIModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBackendAuthCommand */ @@ -1812,7 +1252,7 @@ export const de_GetBackendAuthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBackendAuthCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1829,41 +1269,6 @@ export const de_GetBackendAuthCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBackendAuthCommandError - */ -const de_GetBackendAuthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBackendJobCommand */ @@ -1872,7 +1277,7 @@ export const de_GetBackendJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBackendJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1892,41 +1297,6 @@ export const de_GetBackendJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBackendJobCommandError - */ -const de_GetBackendJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBackendStorageCommand */ @@ -1935,7 +1305,7 @@ export const de_GetBackendStorageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBackendStorageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1951,41 +1321,6 @@ export const de_GetBackendStorageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBackendStorageCommandError - */ -const de_GetBackendStorageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTokenCommand */ @@ -1994,7 +1329,7 @@ export const de_GetTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTokenCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2010,41 +1345,6 @@ export const de_GetTokenCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTokenCommandError - */ -const de_GetTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ImportBackendAuthCommand */ @@ -2053,7 +1353,7 @@ export const de_ImportBackendAuthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ImportBackendAuthCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2071,173 +1371,46 @@ export const de_ImportBackendAuthCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ImportBackendAuthCommandError - */ -const de_ImportBackendAuthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ImportBackendStorageCommand */ export const de_ImportBackendStorageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ImportBackendStorageCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AppId: [, __expectString, `appId`], - BackendEnvironmentName: [, __expectString, `backendEnvironmentName`], - JobId: [, __expectString, `jobId`], - Status: [, __expectString, `status`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ImportBackendStorageCommandError - */ -const de_ImportBackendStorageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListBackendJobsCommand - */ -export const de_ListBackendJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBackendJobsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Jobs: [, (_) => de_ListOfBackendJobRespObj(_, context), `jobs`], - NextToken: [, __expectString, `nextToken`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListBackendJobsCommandError - */ -const de_ListBackendJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AppId: [, __expectString, `appId`], + BackendEnvironmentName: [, __expectString, `backendEnvironmentName`], + JobId: [, __expectString, `jobId`], + Status: [, __expectString, `status`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListS3BucketsCommand + * deserializeAws_restJson1ListBackendJobsCommand */ -export const de_ListS3BucketsCommand = async ( +export const de_ListBackendJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListS3BucketsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Buckets: [, (_) => de_ListOfS3BucketInfo(_, context), `buckets`], + Jobs: [, (_) => de_ListOfBackendJobRespObj(_, context), `jobs`], NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); @@ -2245,38 +1418,25 @@ export const de_ListS3BucketsCommand = async ( }; /** - * deserializeAws_restJson1ListS3BucketsCommandError + * deserializeAws_restJson1ListS3BucketsCommand */ -const de_ListS3BucketsCommandError = async ( +export const de_ListS3BucketsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Buckets: [, (_) => de_ListOfS3BucketInfo(_, context), `buckets`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2287,7 +1447,7 @@ export const de_RemoveAllBackendsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveAllBackendsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2304,41 +1464,6 @@ export const de_RemoveAllBackendsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RemoveAllBackendsCommandError - */ -const de_RemoveAllBackendsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RemoveBackendConfigCommand */ @@ -2347,7 +1472,7 @@ export const de_RemoveBackendConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveBackendConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2360,41 +1485,6 @@ export const de_RemoveBackendConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RemoveBackendConfigCommandError - */ -const de_RemoveBackendConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBackendAPICommand */ @@ -2403,7 +1493,7 @@ export const de_UpdateBackendAPICommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBackendAPICommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2421,41 +1511,6 @@ export const de_UpdateBackendAPICommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateBackendAPICommandError - */ -const de_UpdateBackendAPICommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBackendAuthCommand */ @@ -2464,7 +1519,7 @@ export const de_UpdateBackendAuthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBackendAuthCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2482,41 +1537,6 @@ export const de_UpdateBackendAuthCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateBackendAuthCommandError - */ -const de_UpdateBackendAuthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBackendConfigCommand */ @@ -2525,7 +1545,7 @@ export const de_UpdateBackendConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBackendConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2541,41 +1561,6 @@ export const de_UpdateBackendConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateBackendConfigCommandError - */ -const de_UpdateBackendConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBackendJobCommand */ @@ -2584,7 +1569,7 @@ export const de_UpdateBackendJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBackendJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2604,41 +1589,6 @@ export const de_UpdateBackendJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateBackendJobCommandError - */ -const de_UpdateBackendJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.amplifybackend#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.amplifybackend#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.amplifybackend#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.amplifybackend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBackendStorageCommand */ @@ -2647,7 +1597,7 @@ export const de_UpdateBackendStorageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBackendStorageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2664,12 +1614,9 @@ export const de_UpdateBackendStorageCommand = async ( }; /** - * deserializeAws_restJson1UpdateBackendStorageCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateBackendStorageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2694,7 +1641,7 @@ const de_UpdateBackendStorageCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts b/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts index 3d433591d2fe..b099f22669f9 100644 --- a/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts +++ b/clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts @@ -705,7 +705,7 @@ export const de_CreateComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -715,41 +715,6 @@ export const de_CreateComponentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateComponentCommandError - */ -const de_CreateComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.amplifyuibuilder#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.amplifyuibuilder#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFormCommand */ @@ -758,7 +723,7 @@ export const de_CreateFormCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFormCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -768,41 +733,6 @@ export const de_CreateFormCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFormCommandError - */ -const de_CreateFormCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.amplifyuibuilder#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.amplifyuibuilder#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateThemeCommand */ @@ -811,7 +741,7 @@ export const de_CreateThemeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateThemeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -821,41 +751,6 @@ export const de_CreateThemeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateThemeCommandError - */ -const de_CreateThemeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.amplifyuibuilder#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.amplifyuibuilder#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteComponentCommand */ @@ -864,7 +759,7 @@ export const de_DeleteComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -873,38 +768,6 @@ export const de_DeleteComponentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteComponentCommandError - */ -const de_DeleteComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amplifyuibuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteFormCommand */ @@ -913,7 +776,7 @@ export const de_DeleteFormCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFormCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -922,38 +785,6 @@ export const de_DeleteFormCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteFormCommandError - */ -const de_DeleteFormCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amplifyuibuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteThemeCommand */ @@ -962,7 +793,7 @@ export const de_DeleteThemeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteThemeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -971,38 +802,6 @@ export const de_DeleteThemeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteThemeCommandError - */ -const de_DeleteThemeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amplifyuibuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExchangeCodeForTokenCommand */ @@ -1011,7 +810,7 @@ export const de_ExchangeCodeForTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExchangeCodeForTokenCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1026,32 +825,6 @@ export const de_ExchangeCodeForTokenCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExchangeCodeForTokenCommandError - */ -const de_ExchangeCodeForTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExportComponentsCommand */ @@ -1060,7 +833,7 @@ export const de_ExportComponentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExportComponentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1074,35 +847,6 @@ export const de_ExportComponentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExportComponentsCommandError - */ -const de_ExportComponentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExportFormsCommand */ @@ -1111,7 +855,7 @@ export const de_ExportFormsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExportFormsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1125,35 +869,6 @@ export const de_ExportFormsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExportFormsCommandError - */ -const de_ExportFormsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExportThemesCommand */ @@ -1162,7 +877,7 @@ export const de_ExportThemesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExportThemesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1176,35 +891,6 @@ export const de_ExportThemesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExportThemesCommandError - */ -const de_ExportThemesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCodegenJobCommand */ @@ -1213,7 +899,7 @@ export const de_GetCodegenJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCodegenJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1223,41 +909,6 @@ export const de_GetCodegenJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCodegenJobCommandError - */ -const de_GetCodegenJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amplifyuibuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amplifyuibuilder#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetComponentCommand */ @@ -1266,7 +917,7 @@ export const de_GetComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1276,38 +927,6 @@ export const de_GetComponentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetComponentCommandError - */ -const de_GetComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amplifyuibuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetFormCommand */ @@ -1316,7 +935,7 @@ export const de_GetFormCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFormCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1326,38 +945,6 @@ export const de_GetFormCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetFormCommandError - */ -const de_GetFormCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amplifyuibuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMetadataCommand */ @@ -1366,7 +953,7 @@ export const de_GetMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1379,155 +966,40 @@ export const de_GetMetadataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMetadataCommandError - */ -const de_GetMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplifyuibuilder#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetThemeCommand - */ -export const de_GetThemeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetThemeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.theme = de_Theme(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetThemeCommandError - */ -const de_GetThemeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.amplifyuibuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListCodegenJobsCommand - */ -export const de_ListCodegenJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCodegenJobsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - entities: (_) => de_CodegenJobSummaryList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListCodegenJobsCommandError - */ -const de_ListCodegenJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amplifyuibuilder#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +/** + * deserializeAws_restJson1GetThemeCommand + */ +export const de_GetThemeCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.theme = de_Theme(data, context); + return contents; }; /** - * deserializeAws_restJson1ListComponentsCommand + * deserializeAws_restJson1ListCodegenJobsCommand */ -export const de_ListComponentsCommand = async ( +export const de_ListCodegenJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListComponentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - entities: _json, + entities: (_) => de_CodegenJobSummaryList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -1535,32 +1007,25 @@ export const de_ListComponentsCommand = async ( }; /** - * deserializeAws_restJson1ListComponentsCommandError + * deserializeAws_restJson1ListComponentsCommand */ -const de_ListComponentsCommandError = async ( +export const de_ListComponentsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + entities: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1571,7 +1036,7 @@ export const de_ListFormsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFormsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1585,35 +1050,6 @@ export const de_ListFormsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFormsCommandError - */ -const de_ListFormsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListThemesCommand */ @@ -1622,7 +1058,7 @@ export const de_ListThemesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListThemesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1636,35 +1072,6 @@ export const de_ListThemesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListThemesCommandError - */ -const de_ListThemesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutMetadataFlagCommand */ @@ -1673,7 +1080,7 @@ export const de_PutMetadataFlagCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutMetadataFlagCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1682,35 +1089,6 @@ export const de_PutMetadataFlagCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutMetadataFlagCommandError - */ -const de_PutMetadataFlagCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.amplifyuibuilder#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RefreshTokenCommand */ @@ -1719,7 +1097,7 @@ export const de_RefreshTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RefreshTokenCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1733,32 +1111,6 @@ export const de_RefreshTokenCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RefreshTokenCommandError - */ -const de_RefreshTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartCodegenJobCommand */ @@ -1767,7 +1119,7 @@ export const de_StartCodegenJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartCodegenJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1777,38 +1129,6 @@ export const de_StartCodegenJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartCodegenJobCommandError - */ -const de_StartCodegenJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.amplifyuibuilder#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateComponentCommand */ @@ -1817,7 +1137,7 @@ export const de_UpdateComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1827,38 +1147,6 @@ export const de_UpdateComponentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateComponentCommandError - */ -const de_UpdateComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.amplifyuibuilder#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFormCommand */ @@ -1867,7 +1155,7 @@ export const de_UpdateFormCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFormCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1877,38 +1165,6 @@ export const de_UpdateFormCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFormCommandError - */ -const de_UpdateFormCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.amplifyuibuilder#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.amplifyuibuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.amplifyuibuilder#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateThemeCommand */ @@ -1917,7 +1173,7 @@ export const de_UpdateThemeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateThemeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1928,12 +1184,9 @@ export const de_UpdateThemeCommand = async ( }; /** - * deserializeAws_restJson1UpdateThemeCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateThemeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1949,13 +1202,25 @@ const de_UpdateThemeCommandError = async ( case "ResourceConflictException": case "com.amazonaws.amplifyuibuilder#ResourceConflictException": throw await de_ResourceConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.amplifyuibuilder#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.amplifyuibuilder#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.amplifyuibuilder#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.amplifyuibuilder#UnauthorizedException": + throw await de_UnauthorizedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-api-gateway/src/protocols/Aws_restJson1.ts b/clients/client-api-gateway/src/protocols/Aws_restJson1.ts index 406a4398a446..70ef85ab9fa1 100644 --- a/clients/client-api-gateway/src/protocols/Aws_restJson1.ts +++ b/clients/client-api-gateway/src/protocols/Aws_restJson1.ts @@ -2872,7 +2872,7 @@ export const de_CreateApiKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateApiKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2894,47 +2894,6 @@ export const de_CreateApiKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApiKeyCommandError - */ -const de_CreateApiKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAuthorizerCommand */ @@ -2943,7 +2902,7 @@ export const de_CreateAuthorizerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAuthorizerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2965,47 +2924,6 @@ export const de_CreateAuthorizerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAuthorizerCommandError - */ -const de_CreateAuthorizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBasePathMappingCommand */ @@ -3014,7 +2932,7 @@ export const de_CreateBasePathMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateBasePathMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3029,47 +2947,6 @@ export const de_CreateBasePathMappingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBasePathMappingCommandError - */ -const de_CreateBasePathMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDeploymentCommand */ @@ -3078,7 +2955,7 @@ export const de_CreateDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3094,50 +2971,6 @@ export const de_CreateDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDeploymentCommandError - */ -const de_CreateDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.apigateway#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDocumentationPartCommand */ @@ -3146,7 +2979,7 @@ export const de_CreateDocumentationPartCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDocumentationPartCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3161,47 +2994,6 @@ export const de_CreateDocumentationPartCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDocumentationPartCommandError - */ -const de_CreateDocumentationPartCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDocumentationVersionCommand */ @@ -3210,7 +3002,7 @@ export const de_CreateDocumentationVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDocumentationVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3225,47 +3017,6 @@ export const de_CreateDocumentationVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDocumentationVersionCommandError - */ -const de_CreateDocumentationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDomainNameCommand */ @@ -3274,7 +3025,7 @@ export const de_CreateDomainNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDomainNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3304,52 +3055,14 @@ export const de_CreateDomainNameCommand = async ( }; /** - * deserializeAws_restJson1CreateDomainNameCommandError + * deserializeAws_restJson1CreateModelCommand */ -const de_CreateDomainNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateModelCommand - */ -export const de_CreateModelCommand = async ( +export const de_CreateModelCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3366,47 +3079,6 @@ export const de_CreateModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateModelCommandError - */ -const de_CreateModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRequestValidatorCommand */ @@ -3415,7 +3087,7 @@ export const de_CreateRequestValidatorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateRequestValidatorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3431,47 +3103,6 @@ export const de_CreateRequestValidatorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRequestValidatorCommandError - */ -const de_CreateRequestValidatorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateResourceCommand */ @@ -3480,7 +3111,7 @@ export const de_CreateResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3497,47 +3128,6 @@ export const de_CreateResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateResourceCommandError - */ -const de_CreateResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRestApiCommand */ @@ -3546,7 +3136,7 @@ export const de_CreateRestApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateRestApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3572,44 +3162,6 @@ export const de_CreateRestApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRestApiCommandError - */ -const de_CreateRestApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateStageCommand */ @@ -3618,7 +3170,7 @@ export const de_CreateStageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateStageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3647,47 +3199,6 @@ export const de_CreateStageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateStageCommandError - */ -const de_CreateStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateUsagePlanCommand */ @@ -3696,7 +3207,7 @@ export const de_CreateUsagePlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateUsagePlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3716,47 +3227,6 @@ export const de_CreateUsagePlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateUsagePlanCommandError - */ -const de_CreateUsagePlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateUsagePlanKeyCommand */ @@ -3765,7 +3235,7 @@ export const de_CreateUsagePlanKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateUsagePlanKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3782,55 +3252,14 @@ export const de_CreateUsagePlanKeyCommand = async ( }; /** - * deserializeAws_restJson1CreateUsagePlanKeyCommandError + * deserializeAws_restJson1CreateVpcLinkCommand */ -const de_CreateUsagePlanKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateVpcLinkCommand - */ -export const de_CreateVpcLinkCommand = async ( +export const de_CreateVpcLinkCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateVpcLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3849,44 +3278,6 @@ export const de_CreateVpcLinkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateVpcLinkCommandError - */ -const de_CreateVpcLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteApiKeyCommand */ @@ -3895,7 +3286,7 @@ export const de_DeleteApiKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteApiKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3904,44 +3295,6 @@ export const de_DeleteApiKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteApiKeyCommandError - */ -const de_DeleteApiKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAuthorizerCommand */ @@ -3950,7 +3303,7 @@ export const de_DeleteAuthorizerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteAuthorizerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3959,44 +3312,6 @@ export const de_DeleteAuthorizerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAuthorizerCommandError - */ -const de_DeleteAuthorizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBasePathMappingCommand */ @@ -4005,7 +3320,7 @@ export const de_DeleteBasePathMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteBasePathMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4014,44 +3329,6 @@ export const de_DeleteBasePathMappingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteBasePathMappingCommandError - */ -const de_DeleteBasePathMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteClientCertificateCommand */ @@ -4060,7 +3337,7 @@ export const de_DeleteClientCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteClientCertificateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4070,52 +3347,31 @@ export const de_DeleteClientCertificateCommand = async ( }; /** - * deserializeAws_restJson1DeleteClientCertificateCommandError + * deserializeAws_restJson1DeleteDeploymentCommand */ -const de_DeleteClientCertificateCommandError = async ( +export const de_DeleteDeploymentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteDeploymentCommand + * deserializeAws_restJson1DeleteDocumentationPartCommand */ -export const de_DeleteDeploymentCommand = async ( +export const de_DeleteDocumentationPartCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4125,55 +3381,31 @@ export const de_DeleteDeploymentCommand = async ( }; /** - * deserializeAws_restJson1DeleteDeploymentCommandError + * deserializeAws_restJson1DeleteDocumentationVersionCommand */ -const de_DeleteDeploymentCommandError = async ( +export const de_DeleteDocumentationVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteDocumentationPartCommand + * deserializeAws_restJson1DeleteDomainNameCommand */ -export const de_DeleteDocumentationPartCommand = async ( +export const de_DeleteDomainNameCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteDocumentationPartCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4183,489 +3415,14 @@ export const de_DeleteDocumentationPartCommand = async ( }; /** - * deserializeAws_restJson1DeleteDocumentationPartCommandError + * deserializeAws_restJson1DeleteGatewayResponseCommand */ -const de_DeleteDocumentationPartCommandError = async ( +export const de_DeleteGatewayResponseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDocumentationVersionCommand - */ -export const de_DeleteDocumentationVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteDocumentationVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteDocumentationVersionCommandError - */ -const de_DeleteDocumentationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDomainNameCommand - */ -export const de_DeleteDomainNameCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteDomainNameCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteDomainNameCommandError - */ -const de_DeleteDomainNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteGatewayResponseCommand - */ -export const de_DeleteGatewayResponseCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteGatewayResponseCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteGatewayResponseCommandError - */ -const de_DeleteGatewayResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteIntegrationCommand - */ -export const de_DeleteIntegrationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteIntegrationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteIntegrationCommandError - */ -const de_DeleteIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteIntegrationResponseCommand - */ -export const de_DeleteIntegrationResponseCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteIntegrationResponseCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteIntegrationResponseCommandError - */ -const de_DeleteIntegrationResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteMethodCommand - */ -export const de_DeleteMethodCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteMethodCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteMethodCommandError - */ -const de_DeleteMethodCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteMethodResponseCommand - */ -export const de_DeleteMethodResponseCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteMethodResponseCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteMethodResponseCommandError - */ -const de_DeleteMethodResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteModelCommand - */ -export const de_DeleteModelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteModelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteModelCommandError - */ -const de_DeleteModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRequestValidatorCommand - */ -export const de_DeleteRequestValidatorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteRequestValidatorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4675,52 +3432,14 @@ export const de_DeleteRequestValidatorCommand = async ( }; /** - * deserializeAws_restJson1DeleteRequestValidatorCommandError - */ -const de_DeleteRequestValidatorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteResourceCommand + * deserializeAws_restJson1DeleteIntegrationCommand */ -export const de_DeleteResourceCommand = async ( +export const de_DeleteIntegrationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteResourceCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4730,52 +3449,31 @@ export const de_DeleteResourceCommand = async ( }; /** - * deserializeAws_restJson1DeleteResourceCommandError + * deserializeAws_restJson1DeleteIntegrationResponseCommand */ -const de_DeleteResourceCommandError = async ( +export const de_DeleteIntegrationResponseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteRestApiCommand + * deserializeAws_restJson1DeleteMethodCommand */ -export const de_DeleteRestApiCommand = async ( +export const de_DeleteMethodCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteRestApiCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4785,52 +3483,31 @@ export const de_DeleteRestApiCommand = async ( }; /** - * deserializeAws_restJson1DeleteRestApiCommandError + * deserializeAws_restJson1DeleteMethodResponseCommand */ -const de_DeleteRestApiCommandError = async ( +export const de_DeleteMethodResponseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteStageCommand + * deserializeAws_restJson1DeleteModelCommand */ -export const de_DeleteStageCommand = async ( +export const de_DeleteModelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteStageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4840,55 +3517,14 @@ export const de_DeleteStageCommand = async ( }; /** - * deserializeAws_restJson1DeleteStageCommandError - */ -const de_DeleteStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteUsagePlanCommand + * deserializeAws_restJson1DeleteRequestValidatorCommand */ -export const de_DeleteUsagePlanCommand = async ( +export const de_DeleteRequestValidatorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteUsagePlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4898,52 +3534,14 @@ export const de_DeleteUsagePlanCommand = async ( }; /** - * deserializeAws_restJson1DeleteUsagePlanCommandError - */ -const de_DeleteUsagePlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteUsagePlanKeyCommand + * deserializeAws_restJson1DeleteResourceCommand */ -export const de_DeleteUsagePlanKeyCommand = async ( +export const de_DeleteResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteUsagePlanKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4953,52 +3551,31 @@ export const de_DeleteUsagePlanKeyCommand = async ( }; /** - * deserializeAws_restJson1DeleteUsagePlanKeyCommandError + * deserializeAws_restJson1DeleteRestApiCommand */ -const de_DeleteUsagePlanKeyCommandError = async ( +export const de_DeleteRestApiCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteVpcLinkCommand + * deserializeAws_restJson1DeleteStageCommand */ -export const de_DeleteVpcLinkCommand = async ( +export const de_DeleteStageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteVpcLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5008,52 +3585,31 @@ export const de_DeleteVpcLinkCommand = async ( }; /** - * deserializeAws_restJson1DeleteVpcLinkCommandError + * deserializeAws_restJson1DeleteUsagePlanCommand */ -const de_DeleteVpcLinkCommandError = async ( +export const de_DeleteUsagePlanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1FlushStageAuthorizersCacheCommand + * deserializeAws_restJson1DeleteUsagePlanKeyCommand */ -export const de_FlushStageAuthorizersCacheCommand = async ( +export const de_DeleteUsagePlanKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_FlushStageAuthorizersCacheCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5063,55 +3619,31 @@ export const de_FlushStageAuthorizersCacheCommand = async ( }; /** - * deserializeAws_restJson1FlushStageAuthorizersCacheCommandError + * deserializeAws_restJson1DeleteVpcLinkCommand */ -const de_FlushStageAuthorizersCacheCommandError = async ( +export const de_DeleteVpcLinkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1FlushStageCacheCommand + * deserializeAws_restJson1FlushStageAuthorizersCacheCommand */ -export const de_FlushStageCacheCommand = async ( +export const de_FlushStageAuthorizersCacheCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_FlushStageCacheCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5121,44 +3653,20 @@ export const de_FlushStageCacheCommand = async ( }; /** - * deserializeAws_restJson1FlushStageCacheCommandError + * deserializeAws_restJson1FlushStageCacheCommand */ -const de_FlushStageCacheCommandError = async ( +export const de_FlushStageCacheCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -5169,7 +3677,7 @@ export const de_GenerateClientCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_GenerateClientCertificateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5187,44 +3695,6 @@ export const de_GenerateClientCertificateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GenerateClientCertificateCommandError - */ -const de_GenerateClientCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAccountCommand */ @@ -5233,7 +3703,7 @@ export const de_GetAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5249,104 +3719,34 @@ export const de_GetAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAccountCommandError - */ -const de_GetAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetApiKeyCommand */ export const de_GetApiKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApiKeyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - createdDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - customerId: __expectString, - description: __expectString, - enabled: __expectBoolean, - id: __expectString, - lastUpdatedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - name: __expectString, - stageKeys: _json, - tags: _json, - value: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetApiKeyCommandError - */ -const de_GetApiKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + createdDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + customerId: __expectString, + description: __expectString, + enabled: __expectBoolean, + id: __expectString, + lastUpdatedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + name: __expectString, + stageKeys: _json, + tags: _json, + value: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -5357,7 +3757,7 @@ export const de_GetApiKeysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApiKeysCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5372,41 +3772,6 @@ export const de_GetApiKeysCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetApiKeysCommandError - */ -const de_GetApiKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAuthorizerCommand */ @@ -5415,7 +3780,7 @@ export const de_GetAuthorizerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAuthorizerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5437,41 +3802,6 @@ export const de_GetAuthorizerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAuthorizerCommandError - */ -const de_GetAuthorizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAuthorizersCommand */ @@ -5480,7 +3810,7 @@ export const de_GetAuthorizersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAuthorizersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5494,41 +3824,6 @@ export const de_GetAuthorizersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAuthorizersCommandError - */ -const de_GetAuthorizersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBasePathMappingCommand */ @@ -5537,7 +3832,7 @@ export const de_GetBasePathMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBasePathMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5552,41 +3847,6 @@ export const de_GetBasePathMappingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBasePathMappingCommandError - */ -const de_GetBasePathMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBasePathMappingsCommand */ @@ -5595,7 +3855,7 @@ export const de_GetBasePathMappingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBasePathMappingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5609,41 +3869,6 @@ export const de_GetBasePathMappingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBasePathMappingsCommandError - */ -const de_GetBasePathMappingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetClientCertificateCommand */ @@ -5652,7 +3877,7 @@ export const de_GetClientCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetClientCertificateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5670,96 +3895,26 @@ export const de_GetClientCertificateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetClientCertificateCommandError - */ -const de_GetClientCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetClientCertificatesCommand */ export const de_GetClientCertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetClientCertificatesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - items: [, (_) => de_ListOfClientCertificate(_, context), `item`], - position: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetClientCertificatesCommandError - */ -const de_GetClientCertificatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: [, (_) => de_ListOfClientCertificate(_, context), `item`], + position: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -5770,7 +3925,7 @@ export const de_GetDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5786,44 +3941,6 @@ export const de_GetDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeploymentCommandError - */ -const de_GetDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.apigateway#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDeploymentsCommand */ @@ -5832,7 +3949,7 @@ export const de_GetDeploymentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeploymentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5846,44 +3963,6 @@ export const de_GetDeploymentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeploymentsCommandError - */ -const de_GetDeploymentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.apigateway#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDocumentationPartCommand */ @@ -5892,7 +3971,7 @@ export const de_GetDocumentationPartCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDocumentationPartCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5907,41 +3986,6 @@ export const de_GetDocumentationPartCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDocumentationPartCommandError - */ -const de_GetDocumentationPartCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDocumentationPartsCommand */ @@ -5950,7 +3994,7 @@ export const de_GetDocumentationPartsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDocumentationPartsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5964,41 +4008,6 @@ export const de_GetDocumentationPartsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDocumentationPartsCommandError - */ -const de_GetDocumentationPartsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDocumentationVersionCommand */ @@ -6007,7 +4016,7 @@ export const de_GetDocumentationVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDocumentationVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6022,38 +4031,6 @@ export const de_GetDocumentationVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDocumentationVersionCommandError - */ -const de_GetDocumentationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDocumentationVersionsCommand */ @@ -6062,7 +4039,7 @@ export const de_GetDocumentationVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDocumentationVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6076,41 +4053,6 @@ export const de_GetDocumentationVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDocumentationVersionsCommandError - */ -const de_GetDocumentationVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDomainNameCommand */ @@ -6119,7 +4061,7 @@ export const de_GetDomainNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDomainNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6129,58 +4071,23 @@ export const de_GetDomainNameCommand = async ( certificateArn: __expectString, certificateName: __expectString, certificateUploadDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - distributionDomainName: __expectString, - distributionHostedZoneId: __expectString, - domainName: __expectString, - domainNameStatus: __expectString, - domainNameStatusMessage: __expectString, - endpointConfiguration: _json, - mutualTlsAuthentication: _json, - ownershipVerificationCertificateArn: __expectString, - regionalCertificateArn: __expectString, - regionalCertificateName: __expectString, - regionalDomainName: __expectString, - regionalHostedZoneId: __expectString, - securityPolicy: __expectString, - tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDomainNameCommandError - */ -const de_GetDomainNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + distributionDomainName: __expectString, + distributionHostedZoneId: __expectString, + domainName: __expectString, + domainNameStatus: __expectString, + domainNameStatusMessage: __expectString, + endpointConfiguration: _json, + mutualTlsAuthentication: _json, + ownershipVerificationCertificateArn: __expectString, + regionalCertificateArn: __expectString, + regionalCertificateName: __expectString, + regionalDomainName: __expectString, + regionalHostedZoneId: __expectString, + securityPolicy: __expectString, + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -6191,7 +4098,7 @@ export const de_GetDomainNamesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDomainNamesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6205,41 +4112,6 @@ export const de_GetDomainNamesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDomainNamesCommandError - */ -const de_GetDomainNamesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetExportCommand */ @@ -6248,7 +4120,7 @@ export const de_GetExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetExportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6260,47 +4132,6 @@ export const de_GetExportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetExportCommandError - */ -const de_GetExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGatewayResponseCommand */ @@ -6309,7 +4140,7 @@ export const de_GetGatewayResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGatewayResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6326,41 +4157,6 @@ export const de_GetGatewayResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetGatewayResponseCommandError - */ -const de_GetGatewayResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGatewayResponsesCommand */ @@ -6369,7 +4165,7 @@ export const de_GetGatewayResponsesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGatewayResponsesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6383,41 +4179,6 @@ export const de_GetGatewayResponsesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetGatewayResponsesCommandError - */ -const de_GetGatewayResponsesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIntegrationCommand */ @@ -6426,7 +4187,7 @@ export const de_GetIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6453,41 +4214,6 @@ export const de_GetIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetIntegrationCommandError - */ -const de_GetIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIntegrationResponseCommand */ @@ -6496,7 +4222,7 @@ export const de_GetIntegrationResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIntegrationResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6513,41 +4239,6 @@ export const de_GetIntegrationResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetIntegrationResponseCommandError - */ -const de_GetIntegrationResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMethodCommand */ @@ -6556,7 +4247,7 @@ export const de_GetMethodCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMethodCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6565,50 +4256,18 @@ export const de_GetMethodCommand = async ( const doc = take(data, { apiKeyRequired: __expectBoolean, authorizationScopes: _json, - authorizationType: __expectString, - authorizerId: __expectString, - httpMethod: __expectString, - methodIntegration: _json, - methodResponses: _json, - operationName: __expectString, - requestModels: _json, - requestParameters: _json, - requestValidatorId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMethodCommandError - */ -const de_GetMethodCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + authorizationType: __expectString, + authorizerId: __expectString, + httpMethod: __expectString, + methodIntegration: _json, + methodResponses: _json, + operationName: __expectString, + requestModels: _json, + requestParameters: _json, + requestValidatorId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -6619,7 +4278,7 @@ export const de_GetMethodResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMethodResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6634,38 +4293,6 @@ export const de_GetMethodResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMethodResponseCommandError - */ -const de_GetMethodResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetModelCommand */ @@ -6674,7 +4301,7 @@ export const de_GetModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6691,41 +4318,6 @@ export const de_GetModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetModelCommandError - */ -const de_GetModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetModelsCommand */ @@ -6734,7 +4326,7 @@ export const de_GetModelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetModelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6748,41 +4340,6 @@ export const de_GetModelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetModelsCommandError - */ -const de_GetModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetModelTemplateCommand */ @@ -6791,7 +4348,7 @@ export const de_GetModelTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetModelTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6804,41 +4361,6 @@ export const de_GetModelTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetModelTemplateCommandError - */ -const de_GetModelTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRequestValidatorCommand */ @@ -6847,7 +4369,7 @@ export const de_GetRequestValidatorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRequestValidatorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6863,41 +4385,6 @@ export const de_GetRequestValidatorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRequestValidatorCommandError - */ -const de_GetRequestValidatorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRequestValidatorsCommand */ @@ -6906,7 +4393,7 @@ export const de_GetRequestValidatorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRequestValidatorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6916,157 +4403,55 @@ export const de_GetRequestValidatorsCommand = async ( items: [, _json, `item`], position: __expectString, }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRequestValidatorsCommandError - */ -const de_GetRequestValidatorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetResourceCommand - */ -export const de_GetResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - id: __expectString, - parentId: __expectString, - path: __expectString, - pathPart: __expectString, - resourceMethods: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetResourceCommandError - */ -const de_GetResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetResourcesCommand + * deserializeAws_restJson1GetResourceCommand */ -export const de_GetResourcesCommand = async ( +export const de_GetResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: [, _json, `item`], - position: __expectString, + id: __expectString, + parentId: __expectString, + path: __expectString, + pathPart: __expectString, + resourceMethods: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetResourcesCommandError + * deserializeAws_restJson1GetResourcesCommand */ -const de_GetResourcesCommandError = async ( +export const de_GetResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: [, _json, `item`], + position: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -7077,7 +4462,7 @@ export const de_GetRestApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRestApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7103,41 +4488,6 @@ export const de_GetRestApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRestApiCommandError - */ -const de_GetRestApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRestApisCommand */ @@ -7146,7 +4496,7 @@ export const de_GetRestApisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRestApisCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7160,41 +4510,6 @@ export const de_GetRestApisCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRestApisCommandError - */ -const de_GetRestApisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSdkCommand */ @@ -7203,7 +4518,7 @@ export const de_GetSdkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSdkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7215,44 +4530,6 @@ export const de_GetSdkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSdkCommandError - */ -const de_GetSdkCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSdkTypeCommand */ @@ -7261,7 +4538,7 @@ export const de_GetSdkTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSdkTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7277,41 +4554,6 @@ export const de_GetSdkTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSdkTypeCommandError - */ -const de_GetSdkTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSdkTypesCommand */ @@ -7320,7 +4562,7 @@ export const de_GetSdkTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSdkTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7333,41 +4575,6 @@ export const de_GetSdkTypesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSdkTypesCommandError - */ -const de_GetSdkTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetStageCommand */ @@ -7376,7 +4583,7 @@ export const de_GetStageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7400,50 +4607,9 @@ export const de_GetStageCommand = async ( tracingEnabled: __expectBoolean, variables: _json, webAclArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetStageCommandError - */ -const de_GetStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + Object.assign(contents, doc); + return contents; }; /** @@ -7454,7 +4620,7 @@ export const de_GetStagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7467,47 +4633,6 @@ export const de_GetStagesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetStagesCommandError - */ -const de_GetStagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTagsCommand */ @@ -7516,7 +4641,7 @@ export const de_GetTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7529,41 +4654,6 @@ export const de_GetTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTagsCommandError - */ -const de_GetTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetUsageCommand */ @@ -7572,7 +4662,7 @@ export const de_GetUsageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUsageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7589,41 +4679,6 @@ export const de_GetUsageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetUsageCommandError - */ -const de_GetUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetUsagePlanCommand */ @@ -7632,7 +4687,7 @@ export const de_GetUsagePlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUsagePlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7652,41 +4707,6 @@ export const de_GetUsagePlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetUsagePlanCommandError - */ -const de_GetUsagePlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetUsagePlanKeyCommand */ @@ -7695,7 +4715,7 @@ export const de_GetUsagePlanKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUsagePlanKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7711,41 +4731,6 @@ export const de_GetUsagePlanKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetUsagePlanKeyCommandError - */ -const de_GetUsagePlanKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetUsagePlanKeysCommand */ @@ -7754,7 +4739,7 @@ export const de_GetUsagePlanKeysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUsagePlanKeysCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7763,101 +4748,31 @@ export const de_GetUsagePlanKeysCommand = async ( const doc = take(data, { items: [, _json, `item`], position: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetUsagePlanKeysCommandError - */ -const de_GetUsagePlanKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetUsagePlansCommand - */ -export const de_GetUsagePlansCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUsagePlansCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - items: [, (_) => de_ListOfUsagePlan(_, context), `item`], - position: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetUsagePlansCommandError - */ -const de_GetUsagePlansCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetUsagePlansCommand + */ +export const de_GetUsagePlansCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: [, (_) => de_ListOfUsagePlan(_, context), `item`], + position: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -7868,7 +4783,7 @@ export const de_GetVpcLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVpcLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7887,41 +4802,6 @@ export const de_GetVpcLinkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetVpcLinkCommandError - */ -const de_GetVpcLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetVpcLinksCommand */ @@ -7930,7 +4810,7 @@ export const de_GetVpcLinksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVpcLinksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7944,41 +4824,6 @@ export const de_GetVpcLinksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetVpcLinksCommandError - */ -const de_GetVpcLinksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ImportApiKeysCommand */ @@ -7987,7 +4832,7 @@ export const de_ImportApiKeysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_ImportApiKeysCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8001,47 +4846,6 @@ export const de_ImportApiKeysCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ImportApiKeysCommandError - */ -const de_ImportApiKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ImportDocumentationPartsCommand */ @@ -8050,7 +4854,7 @@ export const de_ImportDocumentationPartsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ImportDocumentationPartsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8064,47 +4868,6 @@ export const de_ImportDocumentationPartsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ImportDocumentationPartsCommandError - */ -const de_ImportDocumentationPartsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ImportRestApiCommand */ @@ -8113,7 +4876,7 @@ export const de_ImportRestApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_ImportRestApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8139,111 +4902,29 @@ export const de_ImportRestApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ImportRestApiCommandError - */ -const de_ImportRestApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutGatewayResponseCommand */ export const de_PutGatewayResponseCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_PutGatewayResponseCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - defaultResponse: __expectBoolean, - responseParameters: _json, - responseTemplates: _json, - responseType: __expectString, - statusCode: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutGatewayResponseCommandError - */ -const de_PutGatewayResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + defaultResponse: __expectBoolean, + responseParameters: _json, + responseTemplates: _json, + responseType: __expectString, + statusCode: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -8254,7 +4935,7 @@ export const de_PutIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_PutIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8281,47 +4962,6 @@ export const de_PutIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutIntegrationCommandError - */ -const de_PutIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutIntegrationResponseCommand */ @@ -8330,7 +4970,7 @@ export const de_PutIntegrationResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_PutIntegrationResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8347,47 +4987,6 @@ export const de_PutIntegrationResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutIntegrationResponseCommandError - */ -const de_PutIntegrationResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutMethodCommand */ @@ -8396,7 +4995,7 @@ export const de_PutMethodCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_PutMethodCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8419,47 +5018,6 @@ export const de_PutMethodCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutMethodCommandError - */ -const de_PutMethodCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutMethodResponseCommand */ @@ -8468,7 +5026,7 @@ export const de_PutMethodResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_PutMethodResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8483,47 +5041,6 @@ export const de_PutMethodResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutMethodResponseCommandError - */ -const de_PutMethodResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutRestApiCommand */ @@ -8532,7 +5049,7 @@ export const de_PutRestApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutRestApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8558,103 +5075,21 @@ export const de_PutRestApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutRestApiCommandError - */ -const de_PutRestApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + */ +export const de_TagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -8665,7 +5100,7 @@ export const de_TestInvokeAuthorizerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TestInvokeAuthorizerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8684,41 +5119,6 @@ export const de_TestInvokeAuthorizerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TestInvokeAuthorizerCommandError - */ -const de_TestInvokeAuthorizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TestInvokeMethodCommand */ @@ -8727,7 +5127,7 @@ export const de_TestInvokeMethodCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TestInvokeMethodCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8745,41 +5145,6 @@ export const de_TestInvokeMethodCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TestInvokeMethodCommandError - */ -const de_TestInvokeMethodCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -8788,7 +5153,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8797,47 +5162,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAccountCommand */ @@ -8846,7 +5170,7 @@ export const de_UpdateAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8862,47 +5186,6 @@ export const de_UpdateAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAccountCommandError - */ -const de_UpdateAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateApiKeyCommand */ @@ -8911,7 +5194,7 @@ export const de_UpdateApiKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApiKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8934,179 +5217,56 @@ export const de_UpdateApiKeyCommand = async ( }; /** - * deserializeAws_restJson1UpdateApiKeyCommandError - */ -const de_UpdateApiKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateAuthorizerCommand - */ -export const de_UpdateAuthorizerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAuthorizerCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - authType: __expectString, - authorizerCredentials: __expectString, - authorizerResultTtlInSeconds: __expectInt32, - authorizerUri: __expectString, - id: __expectString, - identitySource: __expectString, - identityValidationExpression: __expectString, - name: __expectString, - providerARNs: _json, - type: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateAuthorizerCommandError - */ -const de_UpdateAuthorizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateBasePathMappingCommand + * deserializeAws_restJson1UpdateAuthorizerCommand */ -export const de_UpdateBasePathMappingCommand = async ( +export const de_UpdateAuthorizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBasePathMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - basePath: __expectString, - restApiId: __expectString, - stage: __expectString, + authType: __expectString, + authorizerCredentials: __expectString, + authorizerResultTtlInSeconds: __expectInt32, + authorizerUri: __expectString, + id: __expectString, + identitySource: __expectString, + identityValidationExpression: __expectString, + name: __expectString, + providerARNs: _json, + type: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateBasePathMappingCommandError + * deserializeAws_restJson1UpdateBasePathMappingCommand */ -const de_UpdateBasePathMappingCommandError = async ( +export const de_UpdateBasePathMappingCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + basePath: __expectString, + restApiId: __expectString, + stage: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -9117,7 +5277,7 @@ export const de_UpdateClientCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateClientCertificateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9135,47 +5295,6 @@ export const de_UpdateClientCertificateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateClientCertificateCommandError - */ -const de_UpdateClientCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDeploymentCommand */ @@ -9184,7 +5303,7 @@ export const de_UpdateDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9200,50 +5319,6 @@ export const de_UpdateDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDeploymentCommandError - */ -const de_UpdateDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.apigateway#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDocumentationPartCommand */ @@ -9252,7 +5327,7 @@ export const de_UpdateDocumentationPartCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDocumentationPartCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9267,47 +5342,6 @@ export const de_UpdateDocumentationPartCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDocumentationPartCommandError - */ -const de_UpdateDocumentationPartCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDocumentationVersionCommand */ @@ -9316,7 +5350,7 @@ export const de_UpdateDocumentationVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDocumentationVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9331,47 +5365,6 @@ export const de_UpdateDocumentationVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDocumentationVersionCommandError - */ -const de_UpdateDocumentationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDomainNameCommand */ @@ -9380,7 +5373,7 @@ export const de_UpdateDomainNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDomainNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9409,47 +5402,6 @@ export const de_UpdateDomainNameCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDomainNameCommandError - */ -const de_UpdateDomainNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateGatewayResponseCommand */ @@ -9458,7 +5410,7 @@ export const de_UpdateGatewayResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGatewayResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9475,47 +5427,6 @@ export const de_UpdateGatewayResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateGatewayResponseCommandError - */ -const de_UpdateGatewayResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateIntegrationCommand */ @@ -9524,7 +5435,7 @@ export const de_UpdateIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9551,47 +5462,6 @@ export const de_UpdateIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateIntegrationCommandError - */ -const de_UpdateIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateIntegrationResponseCommand */ @@ -9600,7 +5470,7 @@ export const de_UpdateIntegrationResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIntegrationResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9617,47 +5487,6 @@ export const de_UpdateIntegrationResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateIntegrationResponseCommandError - */ -const de_UpdateIntegrationResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMethodCommand */ @@ -9666,7 +5495,7 @@ export const de_UpdateMethodCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMethodCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9689,44 +5518,6 @@ export const de_UpdateMethodCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateMethodCommandError - */ -const de_UpdateMethodCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMethodResponseCommand */ @@ -9735,191 +5526,68 @@ export const de_UpdateMethodResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_UpdateMethodResponseCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - responseModels: _json, - responseParameters: _json, - statusCode: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateMethodResponseCommandError - */ -const de_UpdateMethodResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateModelCommand - */ -export const de_UpdateModelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - contentType: __expectString, - description: __expectString, - id: __expectString, - name: __expectString, - schema: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateModelCommandError - */ -const de_UpdateModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const doc = take(data, { + responseModels: _json, + responseParameters: _json, + statusCode: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateRequestValidatorCommand + * deserializeAws_restJson1UpdateModelCommand */ -export const de_UpdateRequestValidatorCommand = async ( +export const de_UpdateModelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRequestValidatorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + contentType: __expectString, + description: __expectString, id: __expectString, name: __expectString, - validateRequestBody: __expectBoolean, - validateRequestParameters: __expectBoolean, + schema: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateRequestValidatorCommandError + * deserializeAws_restJson1UpdateRequestValidatorCommand */ -const de_UpdateRequestValidatorCommandError = async ( +export const de_UpdateRequestValidatorCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + id: __expectString, + name: __expectString, + validateRequestBody: __expectBoolean, + validateRequestParameters: __expectBoolean, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -9930,7 +5598,7 @@ export const de_UpdateResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9947,44 +5615,6 @@ export const de_UpdateResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateResourceCommandError - */ -const de_UpdateResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRestApiCommand */ @@ -9993,7 +5623,7 @@ export const de_UpdateRestApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRestApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -10019,47 +5649,6 @@ export const de_UpdateRestApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRestApiCommandError - */ -const de_UpdateRestApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateStageCommand */ @@ -10068,7 +5657,7 @@ export const de_UpdateStageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateStageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -10097,47 +5686,6 @@ export const de_UpdateStageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateStageCommandError - */ -const de_UpdateStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateUsageCommand */ @@ -10146,7 +5694,7 @@ export const de_UpdateUsageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUsageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -10163,47 +5711,6 @@ export const de_UpdateUsageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateUsageCommandError - */ -const de_UpdateUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateUsagePlanCommand */ @@ -10212,7 +5719,7 @@ export const de_UpdateUsagePlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUsagePlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -10232,47 +5739,6 @@ export const de_UpdateUsagePlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateUsagePlanCommandError - */ -const de_UpdateUsagePlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigateway#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigateway#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigateway#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigateway#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.apigateway#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVpcLinkCommand */ @@ -10281,7 +5747,7 @@ export const de_UpdateVpcLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVpcLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -10301,12 +5767,9 @@ export const de_UpdateVpcLinkCommand = async ( }; /** - * deserializeAws_restJson1UpdateVpcLinkCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateVpcLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -10331,13 +5794,16 @@ const de_UpdateVpcLinkCommandError = async ( case "UnauthorizedException": case "com.amazonaws.apigateway#UnauthorizedException": throw await de_UnauthorizedExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.apigateway#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts b/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts index 4d55644dcdcb..35044010c2c6 100644 --- a/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts +++ b/clients/client-apigatewaymanagementapi/src/protocols/Aws_restJson1.ts @@ -93,7 +93,7 @@ export const de_DeleteConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -102,38 +102,6 @@ export const de_DeleteConnectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteConnectionCommandError - */ -const de_DeleteConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.apigatewaymanagementapi#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GoneException": - case "com.amazonaws.apigatewaymanagementapi#GoneException": - throw await de_GoneExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigatewaymanagementapi#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConnectionCommand */ @@ -142,7 +110,7 @@ export const de_GetConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -157,38 +125,6 @@ export const de_GetConnectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetConnectionCommandError - */ -const de_GetConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.apigatewaymanagementapi#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GoneException": - case "com.amazonaws.apigatewaymanagementapi#GoneException": - throw await de_GoneExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.apigatewaymanagementapi#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PostToConnectionCommand */ @@ -197,7 +133,7 @@ export const de_PostToConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PostToConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -207,12 +143,9 @@ export const de_PostToConnectionCommand = async ( }; /** - * deserializeAws_restJson1PostToConnectionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_PostToConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -237,7 +170,7 @@ const de_PostToConnectionCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts b/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts index aa3054af3df5..214dedcc81bf 100644 --- a/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts +++ b/clients/client-apigatewayv2/src/protocols/Aws_restJson1.ts @@ -1759,7 +1759,7 @@ export const de_CreateApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1787,41 +1787,6 @@ export const de_CreateApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApiCommandError - */ -const de_CreateApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateApiMappingCommand */ @@ -1830,7 +1795,7 @@ export const de_CreateApiMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateApiMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1846,41 +1811,6 @@ export const de_CreateApiMappingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApiMappingCommandError - */ -const de_CreateApiMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAuthorizerCommand */ @@ -1889,7 +1819,7 @@ export const de_CreateAuthorizerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAuthorizerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1912,41 +1842,6 @@ export const de_CreateAuthorizerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAuthorizerCommandError - */ -const de_CreateAuthorizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDeploymentCommand */ @@ -1955,7 +1850,7 @@ export const de_CreateDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1973,41 +1868,6 @@ export const de_CreateDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDeploymentCommandError - */ -const de_CreateDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDomainNameCommand */ @@ -2016,7 +1876,7 @@ export const de_CreateDomainNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDomainNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2033,44 +1893,6 @@ export const de_CreateDomainNameCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDomainNameCommandError - */ -const de_CreateDomainNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.apigatewayv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateIntegrationCommand */ @@ -2079,7 +1901,7 @@ export const de_CreateIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2111,41 +1933,6 @@ export const de_CreateIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateIntegrationCommandError - */ -const de_CreateIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateIntegrationResponseCommand */ @@ -2154,7 +1941,7 @@ export const de_CreateIntegrationResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateIntegrationResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2172,41 +1959,6 @@ export const de_CreateIntegrationResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateIntegrationResponseCommandError - */ -const de_CreateIntegrationResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateModelCommand */ @@ -2215,7 +1967,7 @@ export const de_CreateModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2233,49 +1985,14 @@ export const de_CreateModelCommand = async ( }; /** - * deserializeAws_restJson1CreateModelCommandError + * deserializeAws_restJson1CreateRouteCommand */ -const de_CreateModelCommandError = async ( +export const de_CreateRouteCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateRouteCommand - */ -export const de_CreateRouteCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateRouteCommandError(output, context); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2300,41 +2017,6 @@ export const de_CreateRouteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRouteCommandError - */ -const de_CreateRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRouteResponseCommand */ @@ -2343,7 +2025,7 @@ export const de_CreateRouteResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateRouteResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2360,41 +2042,6 @@ export const de_CreateRouteResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRouteResponseCommandError - */ -const de_CreateRouteResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateStageCommand */ @@ -2403,7 +2050,7 @@ export const de_CreateStageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateStageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2429,41 +2076,6 @@ export const de_CreateStageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateStageCommandError - */ -const de_CreateStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateVpcLinkCommand */ @@ -2472,7 +2084,7 @@ export const de_CreateVpcLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateVpcLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2493,35 +2105,6 @@ export const de_CreateVpcLinkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateVpcLinkCommandError - */ -const de_CreateVpcLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAccessLogSettingsCommand */ @@ -2530,7 +2113,7 @@ export const de_DeleteAccessLogSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAccessLogSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2539,35 +2122,6 @@ export const de_DeleteAccessLogSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAccessLogSettingsCommandError - */ -const de_DeleteAccessLogSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteApiCommand */ @@ -2576,7 +2130,7 @@ export const de_DeleteApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2585,35 +2139,6 @@ export const de_DeleteApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteApiCommandError - */ -const de_DeleteApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteApiMappingCommand */ @@ -2622,7 +2147,7 @@ export const de_DeleteApiMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteApiMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2632,46 +2157,31 @@ export const de_DeleteApiMappingCommand = async ( }; /** - * deserializeAws_restJson1DeleteApiMappingCommandError + * deserializeAws_restJson1DeleteAuthorizerCommand */ -const de_DeleteApiMappingCommandError = async ( +export const de_DeleteAuthorizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteAuthorizerCommand + * deserializeAws_restJson1DeleteCorsConfigurationCommand */ -export const de_DeleteAuthorizerCommand = async ( +export const de_DeleteCorsConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAuthorizerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2681,43 +2191,31 @@ export const de_DeleteAuthorizerCommand = async ( }; /** - * deserializeAws_restJson1DeleteAuthorizerCommandError + * deserializeAws_restJson1DeleteDeploymentCommand */ -const de_DeleteAuthorizerCommandError = async ( +export const de_DeleteDeploymentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteCorsConfigurationCommand + * deserializeAws_restJson1DeleteDomainNameCommand */ -export const de_DeleteCorsConfigurationCommand = async ( +export const de_DeleteDomainNameCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteCorsConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2726,127 +2224,6 @@ export const de_DeleteCorsConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteCorsConfigurationCommandError - */ -const de_DeleteCorsConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDeploymentCommand - */ -export const de_DeleteDeploymentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDeploymentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteDeploymentCommandError - */ -const de_DeleteDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDomainNameCommand - */ -export const de_DeleteDomainNameCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDomainNameCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteDomainNameCommandError - */ -const de_DeleteDomainNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteIntegrationCommand */ @@ -2855,7 +2232,7 @@ export const de_DeleteIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2864,35 +2241,6 @@ export const de_DeleteIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteIntegrationCommandError - */ -const de_DeleteIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteIntegrationResponseCommand */ @@ -2901,7 +2249,7 @@ export const de_DeleteIntegrationResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteIntegrationResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2910,35 +2258,6 @@ export const de_DeleteIntegrationResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteIntegrationResponseCommandError - */ -const de_DeleteIntegrationResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteModelCommand */ @@ -2947,7 +2266,7 @@ export const de_DeleteModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2956,35 +2275,6 @@ export const de_DeleteModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteModelCommandError - */ -const de_DeleteModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRouteCommand */ @@ -2993,7 +2283,7 @@ export const de_DeleteRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRouteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3002,35 +2292,6 @@ export const de_DeleteRouteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRouteCommandError - */ -const de_DeleteRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRouteRequestParameterCommand */ @@ -3039,7 +2300,7 @@ export const de_DeleteRouteRequestParameterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRouteRequestParameterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3048,35 +2309,6 @@ export const de_DeleteRouteRequestParameterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRouteRequestParameterCommandError - */ -const de_DeleteRouteRequestParameterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRouteResponseCommand */ @@ -3085,7 +2317,7 @@ export const de_DeleteRouteResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRouteResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3094,35 +2326,6 @@ export const de_DeleteRouteResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRouteResponseCommandError - */ -const de_DeleteRouteResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRouteSettingsCommand */ @@ -3131,7 +2334,7 @@ export const de_DeleteRouteSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRouteSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3140,35 +2343,6 @@ export const de_DeleteRouteSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRouteSettingsCommandError - */ -const de_DeleteRouteSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteStageCommand */ @@ -3177,7 +2351,7 @@ export const de_DeleteStageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteStageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3186,35 +2360,6 @@ export const de_DeleteStageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteStageCommandError - */ -const de_DeleteStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteVpcLinkCommand */ @@ -3223,7 +2368,7 @@ export const de_DeleteVpcLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteVpcLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3232,35 +2377,6 @@ export const de_DeleteVpcLinkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteVpcLinkCommandError - */ -const de_DeleteVpcLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExportApiCommand */ @@ -3269,7 +2385,7 @@ export const de_ExportApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExportApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3279,38 +2395,6 @@ export const de_ExportApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExportApiCommandError - */ -const de_ExportApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetApiCommand */ @@ -3319,7 +2403,7 @@ export const de_GetApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3347,32 +2431,6 @@ export const de_GetApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetApiCommandError - */ -const de_GetApiCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetApiMappingCommand */ @@ -3381,7 +2439,7 @@ export const de_GetApiMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApiMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3397,38 +2455,6 @@ export const de_GetApiMappingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetApiMappingCommandError - */ -const de_GetApiMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetApiMappingsCommand */ @@ -3437,7 +2463,7 @@ export const de_GetApiMappingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApiMappingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3445,96 +2471,32 @@ export const de_GetApiMappingsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { Items: [, (_) => de___listOfApiMapping(_, context), `items`], - NextToken: [, __expectString, `nextToken`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetApiMappingsCommandError - */ -const de_GetApiMappingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetApisCommand - */ -export const de_GetApisCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApisCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Items: [, (_) => de___listOfApi(_, context), `items`], - NextToken: [, __expectString, `nextToken`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetApisCommandError - */ -const de_GetApisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetApisCommand + */ +export const de_GetApisCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Items: [, (_) => de___listOfApi(_, context), `items`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3545,7 +2507,7 @@ export const de_GetAuthorizerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAuthorizerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3568,35 +2530,6 @@ export const de_GetAuthorizerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAuthorizerCommandError - */ -const de_GetAuthorizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAuthorizersCommand */ @@ -3605,7 +2538,7 @@ export const de_GetAuthorizersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAuthorizersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3619,38 +2552,6 @@ export const de_GetAuthorizersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAuthorizersCommandError - */ -const de_GetAuthorizersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDeploymentCommand */ @@ -3659,7 +2560,7 @@ export const de_GetDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3677,35 +2578,6 @@ export const de_GetDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeploymentCommandError - */ -const de_GetDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDeploymentsCommand */ @@ -3714,7 +2586,7 @@ export const de_GetDeploymentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeploymentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3728,38 +2600,6 @@ export const de_GetDeploymentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeploymentsCommandError - */ -const de_GetDeploymentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDomainNameCommand */ @@ -3768,7 +2608,7 @@ export const de_GetDomainNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDomainNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3785,35 +2625,6 @@ export const de_GetDomainNameCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDomainNameCommandError - */ -const de_GetDomainNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDomainNamesCommand */ @@ -3822,7 +2633,7 @@ export const de_GetDomainNamesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDomainNamesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3836,38 +2647,6 @@ export const de_GetDomainNamesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDomainNamesCommandError - */ -const de_GetDomainNamesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIntegrationCommand */ @@ -3876,7 +2655,7 @@ export const de_GetIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3908,35 +2687,6 @@ export const de_GetIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetIntegrationCommandError - */ -const de_GetIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIntegrationResponseCommand */ @@ -3944,52 +2694,23 @@ export const de_GetIntegrationResponseCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIntegrationResponseCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ContentHandlingStrategy: [, __expectString, `contentHandlingStrategy`], - IntegrationResponseId: [, __expectString, `integrationResponseId`], - IntegrationResponseKey: [, __expectString, `integrationResponseKey`], - ResponseParameters: [, _json, `responseParameters`], - ResponseTemplates: [, _json, `responseTemplates`], - TemplateSelectionExpression: [, __expectString, `templateSelectionExpression`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetIntegrationResponseCommandError - */ -const de_GetIntegrationResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ContentHandlingStrategy: [, __expectString, `contentHandlingStrategy`], + IntegrationResponseId: [, __expectString, `integrationResponseId`], + IntegrationResponseKey: [, __expectString, `integrationResponseKey`], + ResponseParameters: [, _json, `responseParameters`], + ResponseTemplates: [, _json, `responseTemplates`], + TemplateSelectionExpression: [, __expectString, `templateSelectionExpression`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4000,7 +2721,7 @@ export const de_GetIntegrationResponsesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIntegrationResponsesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4014,38 +2735,6 @@ export const de_GetIntegrationResponsesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetIntegrationResponsesCommandError - */ -const de_GetIntegrationResponsesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIntegrationsCommand */ @@ -4054,7 +2743,7 @@ export const de_GetIntegrationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIntegrationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4068,38 +2757,6 @@ export const de_GetIntegrationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetIntegrationsCommandError - */ -const de_GetIntegrationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetModelCommand */ @@ -4108,7 +2765,7 @@ export const de_GetModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4125,35 +2782,6 @@ export const de_GetModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetModelCommandError - */ -const de_GetModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetModelsCommand */ @@ -4162,7 +2790,7 @@ export const de_GetModelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetModelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4176,38 +2804,6 @@ export const de_GetModelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetModelsCommandError - */ -const de_GetModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetModelTemplateCommand */ @@ -4216,7 +2812,7 @@ export const de_GetModelTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetModelTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4229,35 +2825,6 @@ export const de_GetModelTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetModelTemplateCommandError - */ -const de_GetModelTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRouteCommand */ @@ -4266,7 +2833,7 @@ export const de_GetRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRouteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4291,35 +2858,6 @@ export const de_GetRouteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRouteCommandError - */ -const de_GetRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRouteResponseCommand */ @@ -4328,7 +2866,7 @@ export const de_GetRouteResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRouteResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4345,105 +2883,22 @@ export const de_GetRouteResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRouteResponseCommandError - */ -const de_GetRouteResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRouteResponsesCommand */ export const de_GetRouteResponsesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRouteResponsesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Items: [, (_) => de___listOfRouteResponse(_, context), `items`], - NextToken: [, __expectString, `nextToken`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRouteResponsesCommandError - */ -const de_GetRouteResponsesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRoutesCommand - */ -export const de_GetRoutesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRoutesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Items: [, (_) => de___listOfRoute(_, context), `items`], + Items: [, (_) => de___listOfRouteResponse(_, context), `items`], NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); @@ -4451,35 +2906,25 @@ export const de_GetRoutesCommand = async ( }; /** - * deserializeAws_restJson1GetRoutesCommandError + * deserializeAws_restJson1GetRoutesCommand */ -const de_GetRoutesCommandError = async ( +export const de_GetRoutesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Items: [, (_) => de___listOfRoute(_, context), `items`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4490,7 +2935,7 @@ export const de_GetStageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4516,35 +2961,6 @@ export const de_GetStageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetStageCommandError - */ -const de_GetStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetStagesCommand */ @@ -4553,7 +2969,7 @@ export const de_GetStagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4567,38 +2983,6 @@ export const de_GetStagesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetStagesCommandError - */ -const de_GetStagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTagsCommand */ @@ -4607,7 +2991,7 @@ export const de_GetTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4620,41 +3004,6 @@ export const de_GetTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTagsCommandError - */ -const de_GetTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetVpcLinkCommand */ @@ -4663,7 +3012,7 @@ export const de_GetVpcLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVpcLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4684,35 +3033,6 @@ export const de_GetVpcLinkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetVpcLinkCommandError - */ -const de_GetVpcLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetVpcLinksCommand */ @@ -4721,7 +3041,7 @@ export const de_GetVpcLinksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVpcLinksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4735,35 +3055,6 @@ export const de_GetVpcLinksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetVpcLinksCommandError - */ -const de_GetVpcLinksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ImportApiCommand */ @@ -4772,7 +3063,7 @@ export const de_ImportApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_ImportApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4800,41 +3091,6 @@ export const de_ImportApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ImportApiCommandError - */ -const de_ImportApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ReimportApiCommand */ @@ -4843,7 +3099,7 @@ export const de_ReimportApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_ReimportApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4854,56 +3110,21 @@ export const de_ReimportApiCommand = async ( ApiGatewayManaged: [, __expectBoolean, `apiGatewayManaged`], ApiId: [, __expectString, `apiId`], ApiKeySelectionExpression: [, __expectString, `apiKeySelectionExpression`], - CorsConfiguration: [, (_) => de_Cors(_, context), `corsConfiguration`], - CreatedDate: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `createdDate`], - Description: [, __expectString, `description`], - DisableExecuteApiEndpoint: [, __expectBoolean, `disableExecuteApiEndpoint`], - DisableSchemaValidation: [, __expectBoolean, `disableSchemaValidation`], - ImportInfo: [, _json, `importInfo`], - Name: [, __expectString, `name`], - ProtocolType: [, __expectString, `protocolType`], - RouteSelectionExpression: [, __expectString, `routeSelectionExpression`], - Tags: [, _json, `tags`], - Version: [, __expectString, `version`], - Warnings: [, _json, `warnings`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ReimportApiCommandError - */ -const de_ReimportApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + CorsConfiguration: [, (_) => de_Cors(_, context), `corsConfiguration`], + CreatedDate: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `createdDate`], + Description: [, __expectString, `description`], + DisableExecuteApiEndpoint: [, __expectBoolean, `disableExecuteApiEndpoint`], + DisableSchemaValidation: [, __expectBoolean, `disableSchemaValidation`], + ImportInfo: [, _json, `importInfo`], + Name: [, __expectString, `name`], + ProtocolType: [, __expectString, `protocolType`], + RouteSelectionExpression: [, __expectString, `routeSelectionExpression`], + Tags: [, _json, `tags`], + Version: [, __expectString, `version`], + Warnings: [, _json, `warnings`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4914,7 +3135,7 @@ export const de_ResetAuthorizersCacheCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_ResetAuthorizersCacheCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4923,35 +3144,6 @@ export const de_ResetAuthorizersCacheCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ResetAuthorizersCacheCommandError - */ -const de_ResetAuthorizersCacheCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -4960,7 +3152,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4969,41 +3161,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -5012,7 +3169,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5021,41 +3178,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateApiCommand */ @@ -5064,7 +3186,7 @@ export const de_UpdateApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5092,41 +3214,6 @@ export const de_UpdateApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateApiCommandError - */ -const de_UpdateApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateApiMappingCommand */ @@ -5135,7 +3222,7 @@ export const de_UpdateApiMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApiMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5151,41 +3238,6 @@ export const de_UpdateApiMappingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateApiMappingCommandError - */ -const de_UpdateApiMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAuthorizerCommand */ @@ -5194,7 +3246,7 @@ export const de_UpdateAuthorizerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAuthorizerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5216,101 +3268,31 @@ export const de_UpdateAuthorizerCommand = async ( Object.assign(contents, doc); return contents; }; - -/** - * deserializeAws_restJson1UpdateAuthorizerCommandError - */ -const de_UpdateAuthorizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateDeploymentCommand - */ -export const de_UpdateDeploymentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDeploymentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AutoDeployed: [, __expectBoolean, `autoDeployed`], - CreatedDate: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `createdDate`], - DeploymentId: [, __expectString, `deploymentId`], - DeploymentStatus: [, __expectString, `deploymentStatus`], - DeploymentStatusMessage: [, __expectString, `deploymentStatusMessage`], - Description: [, __expectString, `description`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateDeploymentCommandError - */ -const de_UpdateDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + +/** + * deserializeAws_restJson1UpdateDeploymentCommand + */ +export const de_UpdateDeploymentCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AutoDeployed: [, __expectBoolean, `autoDeployed`], + CreatedDate: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `createdDate`], + DeploymentId: [, __expectString, `deploymentId`], + DeploymentStatus: [, __expectString, `deploymentStatus`], + DeploymentStatusMessage: [, __expectString, `deploymentStatusMessage`], + Description: [, __expectString, `description`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -5321,7 +3303,7 @@ export const de_UpdateDomainNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDomainNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5338,41 +3320,6 @@ export const de_UpdateDomainNameCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDomainNameCommandError - */ -const de_UpdateDomainNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateIntegrationCommand */ @@ -5381,7 +3328,7 @@ export const de_UpdateIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5413,41 +3360,6 @@ export const de_UpdateIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateIntegrationCommandError - */ -const de_UpdateIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateIntegrationResponseCommand */ @@ -5456,7 +3368,7 @@ export const de_UpdateIntegrationResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIntegrationResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5474,41 +3386,6 @@ export const de_UpdateIntegrationResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateIntegrationResponseCommandError - */ -const de_UpdateIntegrationResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateModelCommand */ @@ -5517,7 +3394,7 @@ export const de_UpdateModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5534,41 +3411,6 @@ export const de_UpdateModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateModelCommandError - */ -const de_UpdateModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRouteCommand */ @@ -5577,7 +3419,7 @@ export const de_UpdateRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRouteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5602,41 +3444,6 @@ export const de_UpdateRouteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRouteCommandError - */ -const de_UpdateRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRouteResponseCommand */ @@ -5645,7 +3452,7 @@ export const de_UpdateRouteResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRouteResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5662,41 +3469,6 @@ export const de_UpdateRouteResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRouteResponseCommandError - */ -const de_UpdateRouteResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateStageCommand */ @@ -5705,7 +3477,7 @@ export const de_UpdateStageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateStageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5731,41 +3503,6 @@ export const de_UpdateStageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateStageCommandError - */ -const de_UpdateStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.apigatewayv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.apigatewayv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.apigatewayv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.apigatewayv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVpcLinkCommand */ @@ -5774,7 +3511,7 @@ export const de_UpdateVpcLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVpcLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5796,12 +3533,9 @@ export const de_UpdateVpcLinkCommand = async ( }; /** - * deserializeAws_restJson1UpdateVpcLinkCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateVpcLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5811,19 +3545,25 @@ const de_UpdateVpcLinkCommandError = async ( case "BadRequestException": case "com.amazonaws.apigatewayv2#BadRequestException": throw await de_BadRequestExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.apigatewayv2#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "NotFoundException": case "com.amazonaws.apigatewayv2#NotFoundException": throw await de_NotFoundExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.apigatewayv2#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.apigatewayv2#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-app-mesh/src/protocols/Aws_restJson1.ts b/clients/client-app-mesh/src/protocols/Aws_restJson1.ts index 7ec201025e98..158d96d1d973 100644 --- a/clients/client-app-mesh/src/protocols/Aws_restJson1.ts +++ b/clients/client-app-mesh/src/protocols/Aws_restJson1.ts @@ -1163,7 +1163,7 @@ export const de_CreateGatewayRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateGatewayRouteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1173,53 +1173,6 @@ export const de_CreateGatewayRouteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGatewayRouteCommandError - */ -const de_CreateGatewayRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appmesh#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appmesh#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMeshCommand */ @@ -1228,7 +1181,7 @@ export const de_CreateMeshCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMeshCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1238,53 +1191,6 @@ export const de_CreateMeshCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMeshCommandError - */ -const de_CreateMeshCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appmesh#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appmesh#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRouteCommand */ @@ -1293,7 +1199,7 @@ export const de_CreateRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRouteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1304,445 +1210,248 @@ export const de_CreateRouteCommand = async ( }; /** - * deserializeAws_restJson1CreateRouteCommandError + * deserializeAws_restJson1CreateVirtualGatewayCommand */ -const de_CreateRouteCommandError = async ( +export const de_CreateVirtualGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appmesh#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appmesh#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.virtualGateway = de_VirtualGatewayData(data, context); + return contents; }; /** - * deserializeAws_restJson1CreateVirtualGatewayCommand + * deserializeAws_restJson1CreateVirtualNodeCommand */ -export const de_CreateVirtualGatewayCommand = async ( +export const de_CreateVirtualNodeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateVirtualGatewayCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.virtualGateway = de_VirtualGatewayData(data, context); + contents.virtualNode = de_VirtualNodeData(data, context); return contents; }; /** - * deserializeAws_restJson1CreateVirtualGatewayCommandError + * deserializeAws_restJson1CreateVirtualRouterCommand */ -const de_CreateVirtualGatewayCommandError = async ( +export const de_CreateVirtualRouterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appmesh#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appmesh#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.virtualRouter = de_VirtualRouterData(data, context); + return contents; }; /** - * deserializeAws_restJson1CreateVirtualNodeCommand + * deserializeAws_restJson1CreateVirtualServiceCommand */ -export const de_CreateVirtualNodeCommand = async ( +export const de_CreateVirtualServiceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateVirtualNodeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.virtualNode = de_VirtualNodeData(data, context); + contents.virtualService = de_VirtualServiceData(data, context); return contents; }; /** - * deserializeAws_restJson1CreateVirtualNodeCommandError + * deserializeAws_restJson1DeleteGatewayRouteCommand */ -const de_CreateVirtualNodeCommandError = async ( +export const de_DeleteGatewayRouteCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appmesh#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appmesh#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.gatewayRoute = de_GatewayRouteData(data, context); + return contents; }; /** - * deserializeAws_restJson1CreateVirtualRouterCommand + * deserializeAws_restJson1DeleteMeshCommand */ -export const de_CreateVirtualRouterCommand = async ( +export const de_DeleteMeshCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateVirtualRouterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.virtualRouter = de_VirtualRouterData(data, context); + contents.mesh = de_MeshData(data, context); return contents; }; /** - * deserializeAws_restJson1CreateVirtualRouterCommandError + * deserializeAws_restJson1DeleteRouteCommand */ -const de_CreateVirtualRouterCommandError = async ( +export const de_DeleteRouteCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appmesh#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appmesh#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.route = de_RouteData(data, context); + return contents; }; /** - * deserializeAws_restJson1CreateVirtualServiceCommand + * deserializeAws_restJson1DeleteVirtualGatewayCommand */ -export const de_CreateVirtualServiceCommand = async ( +export const de_DeleteVirtualGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateVirtualServiceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.virtualService = de_VirtualServiceData(data, context); + contents.virtualGateway = de_VirtualGatewayData(data, context); return contents; }; /** - * deserializeAws_restJson1CreateVirtualServiceCommandError + * deserializeAws_restJson1DeleteVirtualNodeCommand */ -const de_CreateVirtualServiceCommandError = async ( +export const de_DeleteVirtualNodeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appmesh#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appmesh#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.virtualNode = de_VirtualNodeData(data, context); + return contents; }; /** - * deserializeAws_restJson1DeleteGatewayRouteCommand + * deserializeAws_restJson1DeleteVirtualRouterCommand */ -export const de_DeleteGatewayRouteCommand = async ( +export const de_DeleteVirtualRouterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGatewayRouteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.gatewayRoute = de_GatewayRouteData(data, context); + contents.virtualRouter = de_VirtualRouterData(data, context); return contents; }; /** - * deserializeAws_restJson1DeleteGatewayRouteCommandError + * deserializeAws_restJson1DeleteVirtualServiceCommand */ -const de_DeleteGatewayRouteCommandError = async ( +export const de_DeleteVirtualServiceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appmesh#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.virtualService = de_VirtualServiceData(data, context); + return contents; }; /** - * deserializeAws_restJson1DeleteMeshCommand + * deserializeAws_restJson1DescribeGatewayRouteCommand */ -export const de_DeleteMeshCommand = async ( +export const de_DescribeGatewayRouteCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMeshCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.mesh = de_MeshData(data, context); + contents.gatewayRoute = de_GatewayRouteData(data, context); return contents; }; /** - * deserializeAws_restJson1DeleteMeshCommandError + * deserializeAws_restJson1DescribeMeshCommand */ -const de_DeleteMeshCommandError = async ( +export const de_DescribeMeshCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appmesh#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.mesh = de_MeshData(data, context); + return contents; }; /** - * deserializeAws_restJson1DeleteRouteCommand + * deserializeAws_restJson1DescribeRouteCommand */ -export const de_DeleteRouteCommand = async ( +export const de_DescribeRouteCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRouteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1753,58 +1462,14 @@ export const de_DeleteRouteCommand = async ( }; /** - * deserializeAws_restJson1DeleteRouteCommandError - */ -const de_DeleteRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appmesh#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVirtualGatewayCommand + * deserializeAws_restJson1DescribeVirtualGatewayCommand */ -export const de_DeleteVirtualGatewayCommand = async ( +export const de_DescribeVirtualGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteVirtualGatewayCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1815,58 +1480,14 @@ export const de_DeleteVirtualGatewayCommand = async ( }; /** - * deserializeAws_restJson1DeleteVirtualGatewayCommandError - */ -const de_DeleteVirtualGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appmesh#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVirtualNodeCommand + * deserializeAws_restJson1DescribeVirtualNodeCommand */ -export const de_DeleteVirtualNodeCommand = async ( +export const de_DescribeVirtualNodeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteVirtualNodeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1877,58 +1498,14 @@ export const de_DeleteVirtualNodeCommand = async ( }; /** - * deserializeAws_restJson1DeleteVirtualNodeCommandError - */ -const de_DeleteVirtualNodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appmesh#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVirtualRouterCommand + * deserializeAws_restJson1DescribeVirtualRouterCommand */ -export const de_DeleteVirtualRouterCommand = async ( +export const de_DescribeVirtualRouterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteVirtualRouterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1939,1337 +1516,285 @@ export const de_DeleteVirtualRouterCommand = async ( }; /** - * deserializeAws_restJson1DeleteVirtualRouterCommandError - */ -const de_DeleteVirtualRouterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appmesh#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVirtualServiceCommand - */ -export const de_DeleteVirtualServiceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteVirtualServiceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.virtualService = de_VirtualServiceData(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVirtualServiceCommandError - */ -const de_DeleteVirtualServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appmesh#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeGatewayRouteCommand - */ -export const de_DescribeGatewayRouteCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeGatewayRouteCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.gatewayRoute = de_GatewayRouteData(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeGatewayRouteCommandError - */ -const de_DescribeGatewayRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeMeshCommand - */ -export const de_DescribeMeshCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeMeshCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.mesh = de_MeshData(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeMeshCommandError - */ -const de_DescribeMeshCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeRouteCommand - */ -export const de_DescribeRouteCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRouteCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.route = de_RouteData(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeRouteCommandError - */ -const de_DescribeRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeVirtualGatewayCommand - */ -export const de_DescribeVirtualGatewayCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeVirtualGatewayCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.virtualGateway = de_VirtualGatewayData(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeVirtualGatewayCommandError - */ -const de_DescribeVirtualGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeVirtualNodeCommand - */ -export const de_DescribeVirtualNodeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeVirtualNodeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.virtualNode = de_VirtualNodeData(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeVirtualNodeCommandError - */ -const de_DescribeVirtualNodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeVirtualRouterCommand - */ -export const de_DescribeVirtualRouterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeVirtualRouterCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.virtualRouter = de_VirtualRouterData(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeVirtualRouterCommandError - */ -const de_DescribeVirtualRouterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeVirtualServiceCommand - */ -export const de_DescribeVirtualServiceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeVirtualServiceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.virtualService = de_VirtualServiceData(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeVirtualServiceCommandError - */ -const de_DescribeVirtualServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListGatewayRoutesCommand - */ -export const de_ListGatewayRoutesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGatewayRoutesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - gatewayRoutes: (_) => de_GatewayRouteList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListGatewayRoutesCommandError - */ -const de_ListGatewayRoutesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListMeshesCommand - */ -export const de_ListMeshesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMeshesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - meshes: (_) => de_MeshList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListMeshesCommandError - */ -const de_ListMeshesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListRoutesCommand - */ -export const de_ListRoutesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRoutesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - routes: (_) => de_RouteList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListRoutesCommandError - */ -const de_ListRoutesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListVirtualGatewaysCommand - */ -export const de_ListVirtualGatewaysCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVirtualGatewaysCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - virtualGateways: (_) => de_VirtualGatewayList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListVirtualGatewaysCommandError - */ -const de_ListVirtualGatewaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListVirtualNodesCommand - */ -export const de_ListVirtualNodesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVirtualNodesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - virtualNodes: (_) => de_VirtualNodeList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListVirtualNodesCommandError - */ -const de_ListVirtualNodesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListVirtualRoutersCommand - */ -export const de_ListVirtualRoutersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVirtualRoutersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - virtualRouters: (_) => de_VirtualRouterList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListVirtualRoutersCommandError - */ -const de_ListVirtualRoutersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + * deserializeAws_restJson1DescribeVirtualServiceCommand + */ +export const de_DescribeVirtualServiceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.virtualService = de_VirtualServiceData(data, context); + return contents; }; /** - * deserializeAws_restJson1ListVirtualServicesCommand + * deserializeAws_restJson1ListGatewayRoutesCommand */ -export const de_ListVirtualServicesCommand = async ( +export const de_ListGatewayRoutesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVirtualServicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + gatewayRoutes: (_) => de_GatewayRouteList(_, context), nextToken: __expectString, - virtualServices: (_) => de_VirtualServiceList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListVirtualServicesCommandError + * deserializeAws_restJson1ListMeshesCommand */ -const de_ListVirtualServicesCommandError = async ( +export const de_ListMeshesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + meshes: (_) => de_MeshList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListRoutesCommand */ -export const de_TagResourceCommand = async ( +export const de_ListRoutesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + routes: (_) => de_RouteList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.appmesh#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1ListVirtualGatewaysCommand */ -export const de_UntagResourceCommand = async ( +export const de_ListVirtualGatewaysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + virtualGateways: (_) => de_VirtualGatewayList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1ListVirtualNodesCommand */ -const de_UntagResourceCommandError = async ( +export const de_ListVirtualNodesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + virtualNodes: (_) => de_VirtualNodeList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateGatewayRouteCommand + * deserializeAws_restJson1ListVirtualRoutersCommand */ -export const de_UpdateGatewayRouteCommand = async ( +export const de_ListVirtualRoutersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGatewayRouteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.gatewayRoute = de_GatewayRouteData(data, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + virtualRouters: (_) => de_VirtualRouterList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateGatewayRouteCommandError + * deserializeAws_restJson1ListVirtualServicesCommand */ -const de_UpdateGatewayRouteCommandError = async ( +export const de_ListVirtualServicesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appmesh#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appmesh#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + virtualServices: (_) => de_VirtualServiceList(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1TagResourceCommand + */ +export const de_TagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateMeshCommand + * deserializeAws_restJson1UntagResourceCommand */ -export const de_UpdateMeshCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMeshCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.mesh = de_MeshData(data, context); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1UpdateMeshCommandError + * deserializeAws_restJson1UpdateGatewayRouteCommand */ -const de_UpdateMeshCommandError = async ( +export const de_UpdateGatewayRouteCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appmesh#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.gatewayRoute = de_GatewayRouteData(data, context); + return contents; }; /** - * deserializeAws_restJson1UpdateRouteCommand + * deserializeAws_restJson1UpdateMeshCommand */ -export const de_UpdateRouteCommand = async ( +export const de_UpdateMeshCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRouteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.route = de_RouteData(data, context); + contents.mesh = de_MeshData(data, context); return contents; }; /** - * deserializeAws_restJson1UpdateRouteCommandError + * deserializeAws_restJson1UpdateRouteCommand */ -const de_UpdateRouteCommandError = async ( +export const de_UpdateRouteCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appmesh#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appmesh#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.route = de_RouteData(data, context); + return contents; }; /** @@ -3280,7 +1805,7 @@ export const de_UpdateVirtualGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVirtualGatewayCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3290,53 +1815,6 @@ export const de_UpdateVirtualGatewayCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateVirtualGatewayCommandError - */ -const de_UpdateVirtualGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appmesh#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appmesh#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVirtualNodeCommand */ @@ -3345,7 +1823,7 @@ export const de_UpdateVirtualNodeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVirtualNodeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3355,53 +1833,6 @@ export const de_UpdateVirtualNodeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateVirtualNodeCommandError - */ -const de_UpdateVirtualNodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appmesh#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appmesh#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVirtualRouterCommand */ @@ -3410,7 +1841,7 @@ export const de_UpdateVirtualRouterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVirtualRouterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3420,53 +1851,6 @@ export const de_UpdateVirtualRouterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateVirtualRouterCommandError - */ -const de_UpdateVirtualRouterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appmesh#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appmesh#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.appmesh#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.appmesh#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appmesh#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appmesh#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.appmesh#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.appmesh#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVirtualServiceCommand */ @@ -3475,7 +1859,7 @@ export const de_UpdateVirtualServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVirtualServiceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3486,12 +1870,9 @@ export const de_UpdateVirtualServiceCommand = async ( }; /** - * deserializeAws_restJson1UpdateVirtualServiceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateVirtualServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3522,13 +1903,19 @@ const de_UpdateVirtualServiceCommandError = async ( case "TooManyRequestsException": case "com.amazonaws.appmesh#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.appmesh#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.appmesh#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-appconfig/src/protocols/Aws_restJson1.ts b/clients/client-appconfig/src/protocols/Aws_restJson1.ts index faa715d9ed72..45a3649e85b0 100644 --- a/clients/client-appconfig/src/protocols/Aws_restJson1.ts +++ b/clients/client-appconfig/src/protocols/Aws_restJson1.ts @@ -1073,7 +1073,7 @@ export const de_CreateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1088,38 +1088,6 @@ export const de_CreateApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appconfig#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConfigurationProfileCommand */ @@ -1128,7 +1096,7 @@ export const de_CreateConfigurationProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateConfigurationProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1150,41 +1118,6 @@ export const de_CreateConfigurationProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConfigurationProfileCommandError - */ -const de_CreateConfigurationProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appconfig#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDeploymentStrategyCommand */ @@ -1193,7 +1126,7 @@ export const de_CreateDeploymentStrategyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDeploymentStrategyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1213,38 +1146,6 @@ export const de_CreateDeploymentStrategyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDeploymentStrategyCommandError - */ -const de_CreateDeploymentStrategyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appconfig#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateEnvironmentCommand */ @@ -1253,7 +1154,7 @@ export const de_CreateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1271,41 +1172,6 @@ export const de_CreateEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEnvironmentCommandError - */ -const de_CreateEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appconfig#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateExtensionCommand */ @@ -1314,7 +1180,7 @@ export const de_CreateExtensionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateExtensionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1333,41 +1199,6 @@ export const de_CreateExtensionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateExtensionCommandError - */ -const de_CreateExtensionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appconfig#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateExtensionAssociationCommand */ @@ -1376,7 +1207,7 @@ export const de_CreateExtensionAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateExtensionAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1394,41 +1225,6 @@ export const de_CreateExtensionAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateExtensionAssociationCommandError - */ -const de_CreateExtensionAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appconfig#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateHostedConfigurationVersionCommand */ @@ -1437,7 +1233,7 @@ export const de_CreateHostedConfigurationVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateHostedConfigurationVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1454,47 +1250,6 @@ export const de_CreateHostedConfigurationVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateHostedConfigurationVersionCommandError - */ -const de_CreateHostedConfigurationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.appconfig#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appconfig#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteApplicationCommand */ @@ -1503,7 +1258,7 @@ export const de_DeleteApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1512,38 +1267,6 @@ export const de_DeleteApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteApplicationCommandError - */ -const de_DeleteApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteConfigurationProfileCommand */ @@ -1552,7 +1275,7 @@ export const de_DeleteConfigurationProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteConfigurationProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1562,49 +1285,14 @@ export const de_DeleteConfigurationProfileCommand = async ( }; /** - * deserializeAws_restJson1DeleteConfigurationProfileCommandError + * deserializeAws_restJson1DeleteDeploymentStrategyCommand */ -const de_DeleteConfigurationProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDeploymentStrategyCommand - */ -export const de_DeleteDeploymentStrategyCommand = async ( +export const de_DeleteDeploymentStrategyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDeploymentStrategyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1613,38 +1301,6 @@ export const de_DeleteDeploymentStrategyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDeploymentStrategyCommandError - */ -const de_DeleteDeploymentStrategyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteEnvironmentCommand */ @@ -1653,7 +1309,7 @@ export const de_DeleteEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1662,41 +1318,6 @@ export const de_DeleteEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEnvironmentCommandError - */ -const de_DeleteEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteExtensionCommand */ @@ -1705,7 +1326,7 @@ export const de_DeleteExtensionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteExtensionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1714,38 +1335,6 @@ export const de_DeleteExtensionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteExtensionCommandError - */ -const de_DeleteExtensionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteExtensionAssociationCommand */ @@ -1754,7 +1343,7 @@ export const de_DeleteExtensionAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteExtensionAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1763,38 +1352,6 @@ export const de_DeleteExtensionAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteExtensionAssociationCommandError - */ -const de_DeleteExtensionAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteHostedConfigurationVersionCommand */ @@ -1803,7 +1360,7 @@ export const de_DeleteHostedConfigurationVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteHostedConfigurationVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1812,38 +1369,6 @@ export const de_DeleteHostedConfigurationVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteHostedConfigurationVersionCommandError - */ -const de_DeleteHostedConfigurationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetApplicationCommand */ @@ -1852,7 +1377,7 @@ export const de_GetApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1867,38 +1392,6 @@ export const de_GetApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetApplicationCommandError - */ -const de_GetApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConfigurationCommand */ @@ -1907,7 +1400,7 @@ export const de_GetConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1919,38 +1412,6 @@ export const de_GetConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetConfigurationCommandError - */ -const de_GetConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConfigurationProfileCommand */ @@ -1959,7 +1420,7 @@ export const de_GetConfigurationProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfigurationProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1982,46 +1443,14 @@ export const de_GetConfigurationProfileCommand = async ( }; /** - * deserializeAws_restJson1GetConfigurationProfileCommandError + * deserializeAws_restJson1GetDeploymentCommand */ -const de_GetConfigurationProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDeploymentCommand - */ -export const de_GetDeploymentCommand = async ( +export const de_GetDeploymentCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2055,38 +1484,6 @@ export const de_GetDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeploymentCommandError - */ -const de_GetDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDeploymentStrategyCommand */ @@ -2095,7 +1492,7 @@ export const de_GetDeploymentStrategyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeploymentStrategyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2115,38 +1512,6 @@ export const de_GetDeploymentStrategyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeploymentStrategyCommandError - */ -const de_GetDeploymentStrategyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEnvironmentCommand */ @@ -2155,7 +1520,7 @@ export const de_GetEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2173,38 +1538,6 @@ export const de_GetEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEnvironmentCommandError - */ -const de_GetEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetExtensionCommand */ @@ -2213,7 +1546,7 @@ export const de_GetExtensionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetExtensionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2232,38 +1565,6 @@ export const de_GetExtensionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetExtensionCommandError - */ -const de_GetExtensionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetExtensionAssociationCommand */ @@ -2272,7 +1573,7 @@ export const de_GetExtensionAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetExtensionAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2290,38 +1591,6 @@ export const de_GetExtensionAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetExtensionAssociationCommandError - */ -const de_GetExtensionAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetHostedConfigurationVersionCommand */ @@ -2330,7 +1599,7 @@ export const de_GetHostedConfigurationVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetHostedConfigurationVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2347,38 +1616,6 @@ export const de_GetHostedConfigurationVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetHostedConfigurationVersionCommandError - */ -const de_GetHostedConfigurationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationsCommand */ @@ -2387,7 +1624,7 @@ export const de_ListApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2401,35 +1638,6 @@ export const de_ListApplicationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationsCommandError - */ -const de_ListApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListConfigurationProfilesCommand */ @@ -2438,122 +1646,36 @@ export const de_ListConfigurationProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConfigurationProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Items: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListConfigurationProfilesCommandError - */ -const de_ListConfigurationProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDeploymentsCommand - */ -export const de_ListDeploymentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeploymentsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Items: (_) => de_DeploymentList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDeploymentsCommandError - */ -const de_ListDeploymentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Items: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListDeploymentStrategiesCommand + * deserializeAws_restJson1ListDeploymentsCommand */ -export const de_ListDeploymentStrategiesCommand = async ( +export const de_ListDeploymentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeploymentStrategiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Items: (_) => de_DeploymentStrategyList(_, context), + Items: (_) => de_DeploymentList(_, context), NextToken: __expectString, }); Object.assign(contents, doc); @@ -2561,32 +1683,25 @@ export const de_ListDeploymentStrategiesCommand = async ( }; /** - * deserializeAws_restJson1ListDeploymentStrategiesCommandError + * deserializeAws_restJson1ListDeploymentStrategiesCommand */ -const de_ListDeploymentStrategiesCommandError = async ( +export const de_ListDeploymentStrategiesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Items: (_) => de_DeploymentStrategyList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2597,7 +1712,7 @@ export const de_ListEnvironmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEnvironmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2611,38 +1726,6 @@ export const de_ListEnvironmentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEnvironmentsCommandError - */ -const de_ListEnvironmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListExtensionAssociationsCommand */ @@ -2651,7 +1734,7 @@ export const de_ListExtensionAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListExtensionAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2665,35 +1748,6 @@ export const de_ListExtensionAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListExtensionAssociationsCommandError - */ -const de_ListExtensionAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListExtensionsCommand */ @@ -2702,7 +1756,7 @@ export const de_ListExtensionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListExtensionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2716,35 +1770,6 @@ export const de_ListExtensionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListExtensionsCommandError - */ -const de_ListExtensionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListHostedConfigurationVersionsCommand */ @@ -2753,7 +1778,7 @@ export const de_ListHostedConfigurationVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListHostedConfigurationVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2767,38 +1792,6 @@ export const de_ListHostedConfigurationVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListHostedConfigurationVersionsCommandError - */ -const de_ListHostedConfigurationVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -2807,7 +1800,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2820,38 +1813,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartDeploymentCommand */ @@ -2860,7 +1821,7 @@ export const de_StartDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_StartDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2894,41 +1855,6 @@ export const de_StartDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartDeploymentCommandError - */ -const de_StartDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopDeploymentCommand */ @@ -2937,7 +1863,7 @@ export const de_StopDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StopDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2960,47 +1886,15 @@ export const de_StopDeploymentCommand = async ( FinalBakeTimeInMinutes: __expectInt32, GrowthFactor: __limitedParseFloat32, GrowthType: __expectString, - KmsKeyArn: __expectString, - KmsKeyIdentifier: __expectString, - PercentageComplete: __limitedParseFloat32, - StartedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - State: __expectString, - VersionLabel: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StopDeploymentCommandError - */ -const de_StopDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + KmsKeyArn: __expectString, + KmsKeyIdentifier: __expectString, + PercentageComplete: __limitedParseFloat32, + StartedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + State: __expectString, + VersionLabel: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3011,7 +1905,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3020,38 +1914,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -3060,7 +1922,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3069,38 +1931,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateApplicationCommand */ @@ -3109,7 +1939,7 @@ export const de_UpdateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3124,38 +1954,6 @@ export const de_UpdateApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateApplicationCommandError - */ -const de_UpdateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConfigurationProfileCommand */ @@ -3164,7 +1962,7 @@ export const de_UpdateConfigurationProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConfigurationProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3186,38 +1984,6 @@ export const de_UpdateConfigurationProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateConfigurationProfileCommandError - */ -const de_UpdateConfigurationProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDeploymentStrategyCommand */ @@ -3226,7 +1992,7 @@ export const de_UpdateDeploymentStrategyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDeploymentStrategyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3246,38 +2012,6 @@ export const de_UpdateDeploymentStrategyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDeploymentStrategyCommandError - */ -const de_UpdateDeploymentStrategyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEnvironmentCommand */ @@ -3286,7 +2020,7 @@ export const de_UpdateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3304,38 +2038,6 @@ export const de_UpdateEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEnvironmentCommandError - */ -const de_UpdateEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateExtensionCommand */ @@ -3344,7 +2046,7 @@ export const de_UpdateExtensionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateExtensionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3363,41 +2065,6 @@ export const de_UpdateExtensionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateExtensionCommandError - */ -const de_UpdateExtensionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateExtensionAssociationCommand */ @@ -3406,7 +2073,7 @@ export const de_UpdateExtensionAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateExtensionAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3424,38 +2091,6 @@ export const de_UpdateExtensionAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateExtensionAssociationCommandError - */ -const de_UpdateExtensionAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfig#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ValidateConfigurationCommand */ @@ -3464,7 +2099,7 @@ export const de_ValidateConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_ValidateConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3474,12 +2109,9 @@ export const de_ValidateConfigurationCommand = async ( }; /** - * deserializeAws_restJson1ValidateConfigurationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_ValidateConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3492,16 +2124,25 @@ const de_ValidateConfigurationCommandError = async ( case "InternalServerException": case "com.amazonaws.appconfig#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.appconfig#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.appconfig#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.appconfig#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "PayloadTooLargeException": + case "com.amazonaws.appconfig#PayloadTooLargeException": + throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts b/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts index 812ad86af027..490b04c5e993 100644 --- a/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts +++ b/clients/client-appconfigdata/src/protocols/Aws_restJson1.ts @@ -88,7 +88,7 @@ export const de_GetLatestConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLatestConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -102,41 +102,6 @@ export const de_GetLatestConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLatestConfigurationCommandError - */ -const de_GetLatestConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appconfigdata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appconfigdata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appconfigdata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appconfigdata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartConfigurationSessionCommand */ @@ -145,7 +110,7 @@ export const de_StartConfigurationSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_StartConfigurationSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -159,12 +124,9 @@ export const de_StartConfigurationSessionCommand = async ( }; /** - * deserializeAws_restJson1StartConfigurationSessionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_StartConfigurationSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -189,7 +151,7 @@ const de_StartConfigurationSessionCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-appfabric/src/protocols/Aws_restJson1.ts b/clients/client-appfabric/src/protocols/Aws_restJson1.ts index 2f939933c46e..4d62ca78fbf4 100644 --- a/clients/client-appfabric/src/protocols/Aws_restJson1.ts +++ b/clients/client-appfabric/src/protocols/Aws_restJson1.ts @@ -686,7 +686,7 @@ export const de_BatchGetUserAccessTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetUserAccessTasksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -699,44 +699,6 @@ export const de_BatchGetUserAccessTasksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetUserAccessTasksCommandError - */ -const de_BatchGetUserAccessTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ConnectAppAuthorizationCommand */ @@ -745,7 +707,7 @@ export const de_ConnectAppAuthorizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ConnectAppAuthorizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -758,44 +720,6 @@ export const de_ConnectAppAuthorizationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ConnectAppAuthorizationCommandError - */ -const de_ConnectAppAuthorizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAppAuthorizationCommand */ @@ -804,7 +728,7 @@ export const de_CreateAppAuthorizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAppAuthorizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -817,50 +741,6 @@ export const de_CreateAppAuthorizationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAppAuthorizationCommandError - */ -const de_CreateAppAuthorizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appfabric#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appfabric#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAppBundleCommand */ @@ -869,7 +749,7 @@ export const de_CreateAppBundleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAppBundleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -882,47 +762,6 @@ export const de_CreateAppBundleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAppBundleCommandError - */ -const de_CreateAppBundleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appfabric#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appfabric#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateIngestionCommand */ @@ -931,7 +770,7 @@ export const de_CreateIngestionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateIngestionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -944,47 +783,6 @@ export const de_CreateIngestionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateIngestionCommandError - */ -const de_CreateIngestionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appfabric#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appfabric#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateIngestionDestinationCommand */ @@ -993,7 +791,7 @@ export const de_CreateIngestionDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateIngestionDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1007,55 +805,31 @@ export const de_CreateIngestionDestinationCommand = async ( }; /** - * deserializeAws_restJson1CreateIngestionDestinationCommandError + * deserializeAws_restJson1DeleteAppAuthorizationCommand */ -const de_CreateIngestionDestinationCommandError = async ( +export const de_DeleteAppAuthorizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appfabric#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appfabric#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteAppAuthorizationCommand + * deserializeAws_restJson1DeleteAppBundleCommand */ -export const de_DeleteAppAuthorizationCommand = async ( +export const de_DeleteAppBundleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAppAuthorizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1065,107 +839,14 @@ export const de_DeleteAppAuthorizationCommand = async ( }; /** - * deserializeAws_restJson1DeleteAppAuthorizationCommandError + * deserializeAws_restJson1DeleteIngestionCommand */ -const de_DeleteAppAuthorizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAppBundleCommand - */ -export const de_DeleteAppBundleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAppBundleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteAppBundleCommandError - */ -const de_DeleteAppBundleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appfabric#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteIngestionCommand - */ -export const de_DeleteIngestionCommand = async ( +export const de_DeleteIngestionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteIngestionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1174,44 +855,6 @@ export const de_DeleteIngestionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteIngestionCommandError - */ -const de_DeleteIngestionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteIngestionDestinationCommand */ @@ -1220,7 +863,7 @@ export const de_DeleteIngestionDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteIngestionDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1229,44 +872,6 @@ export const de_DeleteIngestionDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteIngestionDestinationCommandError - */ -const de_DeleteIngestionDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAppAuthorizationCommand */ @@ -1275,7 +880,7 @@ export const de_GetAppAuthorizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAppAuthorizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1288,44 +893,6 @@ export const de_GetAppAuthorizationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAppAuthorizationCommandError - */ -const de_GetAppAuthorizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAppBundleCommand */ @@ -1334,7 +901,7 @@ export const de_GetAppBundleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAppBundleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1347,44 +914,6 @@ export const de_GetAppBundleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAppBundleCommandError - */ -const de_GetAppBundleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIngestionCommand */ @@ -1393,7 +922,7 @@ export const de_GetIngestionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIngestionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1406,44 +935,6 @@ export const de_GetIngestionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetIngestionCommandError - */ -const de_GetIngestionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIngestionDestinationCommand */ @@ -1452,7 +943,7 @@ export const de_GetIngestionDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIngestionDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1465,44 +956,6 @@ export const de_GetIngestionDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetIngestionDestinationCommandError - */ -const de_GetIngestionDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAppAuthorizationsCommand */ @@ -1511,7 +964,7 @@ export const de_ListAppAuthorizationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppAuthorizationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1525,44 +978,6 @@ export const de_ListAppAuthorizationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAppAuthorizationsCommandError - */ -const de_ListAppAuthorizationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAppBundlesCommand */ @@ -1571,7 +986,7 @@ export const de_ListAppBundlesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppBundlesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1585,41 +1000,6 @@ export const de_ListAppBundlesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAppBundlesCommandError - */ -const de_ListAppBundlesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIngestionDestinationsCommand */ @@ -1628,7 +1008,7 @@ export const de_ListIngestionDestinationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIngestionDestinationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1642,219 +1022,64 @@ export const de_ListIngestionDestinationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListIngestionDestinationsCommandError - */ -const de_ListIngestionDestinationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIngestionsCommand */ export const de_ListIngestionsCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIngestionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ingestions: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListIngestionsCommandError - */ -const de_ListIngestionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ingestions: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartIngestionCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_StartIngestionCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartIngestionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartIngestionCommandError + * deserializeAws_restJson1StartIngestionCommand */ -const de_StartIngestionCommandError = async ( +export const de_StartIngestionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appfabric#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -1865,7 +1090,7 @@ export const de_StartUserAccessTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_StartUserAccessTasksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1878,44 +1103,6 @@ export const de_StartUserAccessTasksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartUserAccessTasksCommandError - */ -const de_StartUserAccessTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopIngestionCommand */ @@ -1924,7 +1111,7 @@ export const de_StopIngestionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopIngestionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1933,47 +1120,6 @@ export const de_StopIngestionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopIngestionCommandError - */ -const de_StopIngestionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appfabric#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1982,7 +1128,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1991,44 +1137,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2037,7 +1145,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2046,44 +1154,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAppAuthorizationCommand */ @@ -2092,7 +1162,7 @@ export const de_UpdateAppAuthorizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAppAuthorizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2105,44 +1175,6 @@ export const de_UpdateAppAuthorizationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAppAuthorizationCommandError - */ -const de_UpdateAppAuthorizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appfabric#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appfabric#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appfabric#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appfabric#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appfabric#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateIngestionDestinationCommand */ @@ -2151,7 +1183,7 @@ export const de_UpdateIngestionDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIngestionDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2165,12 +1197,9 @@ export const de_UpdateIngestionDestinationCommand = async ( }; /** - * deserializeAws_restJson1UpdateIngestionDestinationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateIngestionDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2180,31 +1209,31 @@ const de_UpdateIngestionDestinationCommandError = async ( case "AccessDeniedException": case "com.amazonaws.appfabric#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appfabric#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.appfabric#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.appfabric#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appfabric#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.appfabric#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.appfabric#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.appfabric#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.appfabric#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-appflow/src/protocols/Aws_restJson1.ts b/clients/client-appflow/src/protocols/Aws_restJson1.ts index 31ec1234e02f..daf29eba1bc2 100644 --- a/clients/client-appflow/src/protocols/Aws_restJson1.ts +++ b/clients/client-appflow/src/protocols/Aws_restJson1.ts @@ -831,7 +831,7 @@ export const de_CancelFlowExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelFlowExecutionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -844,44 +844,6 @@ export const de_CancelFlowExecutionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelFlowExecutionsCommandError - */ -const de_CancelFlowExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appflow#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appflow#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConnectorProfileCommand */ @@ -890,7 +852,7 @@ export const de_CreateConnectorProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConnectorProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -903,44 +865,6 @@ export const de_CreateConnectorProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConnectorProfileCommandError - */ -const de_CreateConnectorProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.appflow#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ConnectorAuthenticationException": - case "com.amazonaws.appflow#ConnectorAuthenticationException": - throw await de_ConnectorAuthenticationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appflow#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFlowCommand */ @@ -949,7 +873,7 @@ export const de_CreateFlowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -963,53 +887,6 @@ export const de_CreateFlowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFlowCommandError - */ -const de_CreateFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appflow#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appflow#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ConnectorAuthenticationException": - case "com.amazonaws.appflow#ConnectorAuthenticationException": - throw await de_ConnectorAuthenticationExceptionRes(parsedOutput, context); - case "ConnectorServerException": - case "com.amazonaws.appflow#ConnectorServerException": - throw await de_ConnectorServerExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appflow#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteConnectorProfileCommand */ @@ -1018,7 +895,7 @@ export const de_DeleteConnectorProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConnectorProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1027,38 +904,6 @@ export const de_DeleteConnectorProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteConnectorProfileCommandError - */ -const de_DeleteConnectorProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.appflow#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteFlowCommand */ @@ -1067,7 +912,7 @@ export const de_DeleteFlowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1076,38 +921,6 @@ export const de_DeleteFlowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteFlowCommandError - */ -const de_DeleteFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.appflow#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeConnectorCommand */ @@ -1116,7 +929,7 @@ export const de_DescribeConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1129,38 +942,6 @@ export const de_DescribeConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeConnectorCommandError - */ -const de_DescribeConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeConnectorEntityCommand */ @@ -1169,7 +950,7 @@ export const de_DescribeConnectorEntityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeConnectorEntityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1183,59 +964,44 @@ export const de_DescribeConnectorEntityCommand = async ( }; /** - * deserializeAws_restJson1DescribeConnectorEntityCommandError + * deserializeAws_restJson1DescribeConnectorProfilesCommand */ -const de_DescribeConnectorEntityCommandError = async ( +export const de_DescribeConnectorProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConnectorAuthenticationException": - case "com.amazonaws.appflow#ConnectorAuthenticationException": - throw await de_ConnectorAuthenticationExceptionRes(parsedOutput, context); - case "ConnectorServerException": - case "com.amazonaws.appflow#ConnectorServerException": - throw await de_ConnectorServerExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + connectorProfileDetails: (_) => de_ConnectorProfileDetailList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeConnectorProfilesCommand + * deserializeAws_restJson1DescribeConnectorsCommand */ -export const de_DescribeConnectorProfilesCommand = async ( +export const de_DescribeConnectorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeConnectorProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - connectorProfileDetails: (_) => de_ConnectorProfileDetailList(_, context), + connectorConfigurations: (_) => de_ConnectorConfigurationsMap(_, context), + connectors: (_) => de_ConnectorList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -1243,95 +1009,14 @@ export const de_DescribeConnectorProfilesCommand = async ( }; /** - * deserializeAws_restJson1DescribeConnectorProfilesCommandError + * deserializeAws_restJson1DescribeFlowCommand */ -const de_DescribeConnectorProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeConnectorsCommand - */ -export const de_DescribeConnectorsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeConnectorsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - connectorConfigurations: (_) => de_ConnectorConfigurationsMap(_, context), - connectors: (_) => de_ConnectorList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeConnectorsCommandError - */ -const de_DescribeConnectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeFlowCommand - */ -export const de_DescribeFlowCommand = async ( +export const de_DescribeFlowCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1362,35 +1047,6 @@ export const de_DescribeFlowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeFlowCommandError - */ -const de_DescribeFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeFlowExecutionRecordsCommand */ @@ -1399,7 +1055,7 @@ export const de_DescribeFlowExecutionRecordsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFlowExecutionRecordsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1413,38 +1069,6 @@ export const de_DescribeFlowExecutionRecordsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeFlowExecutionRecordsCommandError - */ -const de_DescribeFlowExecutionRecordsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListConnectorEntitiesCommand */ @@ -1453,7 +1077,7 @@ export const de_ListConnectorEntitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConnectorEntitiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1467,44 +1091,6 @@ export const de_ListConnectorEntitiesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListConnectorEntitiesCommandError - */ -const de_ListConnectorEntitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConnectorAuthenticationException": - case "com.amazonaws.appflow#ConnectorAuthenticationException": - throw await de_ConnectorAuthenticationExceptionRes(parsedOutput, context); - case "ConnectorServerException": - case "com.amazonaws.appflow#ConnectorServerException": - throw await de_ConnectorServerExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListConnectorsCommand */ @@ -1513,7 +1099,7 @@ export const de_ListConnectorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConnectorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1527,35 +1113,6 @@ export const de_ListConnectorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListConnectorsCommandError - */ -const de_ListConnectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListFlowsCommand */ @@ -1564,7 +1121,7 @@ export const de_ListFlowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFlowsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1578,35 +1135,6 @@ export const de_ListFlowsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFlowsCommandError - */ -const de_ListFlowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1615,7 +1143,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1628,38 +1156,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RegisterConnectorCommand */ @@ -1668,7 +1164,7 @@ export const de_RegisterConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1681,181 +1177,39 @@ export const de_RegisterConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RegisterConnectorCommandError - */ -const de_RegisterConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appflow#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appflow#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ConnectorAuthenticationException": - case "com.amazonaws.appflow#ConnectorAuthenticationException": - throw await de_ConnectorAuthenticationExceptionRes(parsedOutput, context); - case "ConnectorServerException": - case "com.amazonaws.appflow#ConnectorServerException": - throw await de_ConnectorServerExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appflow#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appflow#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ResetConnectorMetadataCacheCommand */ -export const de_ResetConnectorMetadataCacheCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ResetConnectorMetadataCacheCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1ResetConnectorMetadataCacheCommandError - */ -const de_ResetConnectorMetadataCacheCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.appflow#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartFlowCommand - */ -export const de_StartFlowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartFlowCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - executionId: __expectString, - flowArn: __expectString, - flowStatus: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartFlowCommandError - */ -const de_StartFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.appflow#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appflow#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_ResetConnectorMetadataCacheCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1StopFlowCommand + * deserializeAws_restJson1StartFlowCommand */ -export const de_StopFlowCommand = async ( +export const de_StartFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + executionId: __expectString, flowArn: __expectString, flowStatus: __expectString, }); @@ -1864,38 +1218,25 @@ export const de_StopFlowCommand = async ( }; /** - * deserializeAws_restJson1StopFlowCommandError + * deserializeAws_restJson1StopFlowCommand */ -const de_StopFlowCommandError = async ( +export const de_StopFlowCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.appflow#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.appflow#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + flowArn: __expectString, + flowStatus: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1906,7 +1247,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1915,38 +1256,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UnregisterConnectorCommand */ @@ -1955,7 +1264,7 @@ export const de_UnregisterConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UnregisterConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1964,38 +1273,6 @@ export const de_UnregisterConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UnregisterConnectorCommandError - */ -const de_UnregisterConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.appflow#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2004,7 +1281,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2013,38 +1290,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConnectorProfileCommand */ @@ -2053,7 +1298,7 @@ export const de_UpdateConnectorProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConnectorProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2066,44 +1311,6 @@ export const de_UpdateConnectorProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateConnectorProfileCommandError - */ -const de_UpdateConnectorProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.appflow#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ConnectorAuthenticationException": - case "com.amazonaws.appflow#ConnectorAuthenticationException": - throw await de_ConnectorAuthenticationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConnectorRegistrationCommand */ @@ -2112,7 +1319,7 @@ export const de_UpdateConnectorRegistrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConnectorRegistrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2125,56 +1332,6 @@ export const de_UpdateConnectorRegistrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateConnectorRegistrationCommandError - */ -const de_UpdateConnectorRegistrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appflow#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appflow#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ConnectorAuthenticationException": - case "com.amazonaws.appflow#ConnectorAuthenticationException": - throw await de_ConnectorAuthenticationExceptionRes(parsedOutput, context); - case "ConnectorServerException": - case "com.amazonaws.appflow#ConnectorServerException": - throw await de_ConnectorServerExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.appflow#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appflow#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appflow#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.appflow#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFlowCommand */ @@ -2183,7 +1340,7 @@ export const de_UpdateFlowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2197,12 +1354,9 @@ export const de_UpdateFlowCommand = async ( }; /** - * deserializeAws_restJson1UpdateFlowCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2212,34 +1366,40 @@ const de_UpdateFlowCommandError = async ( case "AccessDeniedException": case "com.amazonaws.appflow#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.appflow#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ConnectorAuthenticationException": - case "com.amazonaws.appflow#ConnectorAuthenticationException": - throw await de_ConnectorAuthenticationExceptionRes(parsedOutput, context); - case "ConnectorServerException": - case "com.amazonaws.appflow#ConnectorServerException": - throw await de_ConnectorServerExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.appflow#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.appflow#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.appflow#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.appflow#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.appflow#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.appflow#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ConnectorAuthenticationException": + case "com.amazonaws.appflow#ConnectorAuthenticationException": + throw await de_ConnectorAuthenticationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.appflow#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ConnectorServerException": + case "com.amazonaws.appflow#ConnectorServerException": + throw await de_ConnectorServerExceptionRes(parsedOutput, context); + case "UnsupportedOperationException": + case "com.amazonaws.appflow#UnsupportedOperationException": + throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-appintegrations/src/protocols/Aws_restJson1.ts b/clients/client-appintegrations/src/protocols/Aws_restJson1.ts index 295623f47709..08c603feecfb 100644 --- a/clients/client-appintegrations/src/protocols/Aws_restJson1.ts +++ b/clients/client-appintegrations/src/protocols/Aws_restJson1.ts @@ -547,7 +547,7 @@ export const de_CreateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -561,50 +561,6 @@ export const de_CreateApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DuplicateResourceException": - case "com.amazonaws.appintegrations#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceQuotaExceededException": - case "com.amazonaws.appintegrations#ResourceQuotaExceededException": - throw await de_ResourceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.appintegrations#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDataIntegrationCommand */ @@ -613,7 +569,7 @@ export const de_CreateDataIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDataIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -636,47 +592,6 @@ export const de_CreateDataIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDataIntegrationCommandError - */ -const de_CreateDataIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DuplicateResourceException": - case "com.amazonaws.appintegrations#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceQuotaExceededException": - case "com.amazonaws.appintegrations#ResourceQuotaExceededException": - throw await de_ResourceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateEventIntegrationCommand */ @@ -685,7 +600,7 @@ export const de_CreateEventIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEventIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -698,47 +613,6 @@ export const de_CreateEventIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEventIntegrationCommandError - */ -const de_CreateEventIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DuplicateResourceException": - case "com.amazonaws.appintegrations#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceQuotaExceededException": - case "com.amazonaws.appintegrations#ResourceQuotaExceededException": - throw await de_ResourceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteApplicationCommand */ @@ -747,7 +621,7 @@ export const de_DeleteApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -756,44 +630,6 @@ export const de_DeleteApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteApplicationCommandError - */ -const de_DeleteApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appintegrations#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDataIntegrationCommand */ @@ -802,7 +638,7 @@ export const de_DeleteDataIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDataIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -811,44 +647,6 @@ export const de_DeleteDataIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDataIntegrationCommandError - */ -const de_DeleteDataIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appintegrations#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteEventIntegrationCommand */ @@ -857,7 +655,7 @@ export const de_DeleteEventIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEventIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -866,44 +664,6 @@ export const de_DeleteEventIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEventIntegrationCommandError - */ -const de_DeleteEventIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appintegrations#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetApplicationCommand */ @@ -912,7 +672,7 @@ export const de_GetApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -936,44 +696,6 @@ export const de_GetApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetApplicationCommandError - */ -const de_GetApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appintegrations#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDataIntegrationCommand */ @@ -982,7 +704,7 @@ export const de_GetDataIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1004,44 +726,6 @@ export const de_GetDataIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDataIntegrationCommandError - */ -const de_GetDataIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appintegrations#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEventIntegrationCommand */ @@ -1050,7 +734,7 @@ export const de_GetEventIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEventIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1068,44 +752,6 @@ export const de_GetEventIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEventIntegrationCommandError - */ -const de_GetEventIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appintegrations#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationAssociationsCommand */ @@ -1114,7 +760,7 @@ export const de_ListApplicationAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1128,44 +774,6 @@ export const de_ListApplicationAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationAssociationsCommandError - */ -const de_ListApplicationAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appintegrations#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationsCommand */ @@ -1174,7 +782,7 @@ export const de_ListApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1188,41 +796,6 @@ export const de_ListApplicationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationsCommandError - */ -const de_ListApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDataIntegrationAssociationsCommand */ @@ -1231,7 +804,7 @@ export const de_ListDataIntegrationAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataIntegrationAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1245,44 +818,6 @@ export const de_ListDataIntegrationAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDataIntegrationAssociationsCommandError - */ -const de_ListDataIntegrationAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appintegrations#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDataIntegrationsCommand */ @@ -1291,7 +826,7 @@ export const de_ListDataIntegrationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataIntegrationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1301,43 +836,8 @@ export const de_ListDataIntegrationsCommand = async ( DataIntegrations: _json, NextToken: __expectString, }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDataIntegrationsCommandError - */ -const de_ListDataIntegrationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Object.assign(contents, doc); + return contents; }; /** @@ -1348,7 +848,7 @@ export const de_ListEventIntegrationAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEventIntegrationAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1362,44 +862,6 @@ export const de_ListEventIntegrationAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEventIntegrationAssociationsCommandError - */ -const de_ListEventIntegrationAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appintegrations#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEventIntegrationsCommand */ @@ -1408,7 +870,7 @@ export const de_ListEventIntegrationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEventIntegrationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1422,41 +884,6 @@ export const de_ListEventIntegrationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEventIntegrationsCommandError - */ -const de_ListEventIntegrationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1465,7 +892,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1478,41 +905,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appintegrations#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1521,7 +913,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1530,41 +922,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appintegrations#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1573,7 +930,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1582,41 +939,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appintegrations#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateApplicationCommand */ @@ -1625,7 +947,7 @@ export const de_UpdateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1634,47 +956,6 @@ export const de_UpdateApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateApplicationCommandError - */ -const de_UpdateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appintegrations#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.appintegrations#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDataIntegrationCommand */ @@ -1683,7 +964,7 @@ export const de_UpdateDataIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDataIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1692,44 +973,6 @@ export const de_UpdateDataIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDataIntegrationCommandError - */ -const de_UpdateDataIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appintegrations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.appintegrations#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.appintegrations#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appintegrations#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.appintegrations#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEventIntegrationCommand */ @@ -1738,7 +981,7 @@ export const de_UpdateEventIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEventIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1748,12 +991,9 @@ export const de_UpdateEventIntegrationCommand = async ( }; /** - * deserializeAws_restJson1UpdateEventIntegrationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateEventIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1763,25 +1003,34 @@ const de_UpdateEventIntegrationCommandError = async ( case "AccessDeniedException": case "com.amazonaws.appintegrations#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "DuplicateResourceException": + case "com.amazonaws.appintegrations#DuplicateResourceException": + throw await de_DuplicateResourceExceptionRes(parsedOutput, context); case "InternalServiceError": case "com.amazonaws.appintegrations#InternalServiceError": throw await de_InternalServiceErrorRes(parsedOutput, context); case "InvalidRequestException": case "com.amazonaws.appintegrations#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appintegrations#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ResourceQuotaExceededException": + case "com.amazonaws.appintegrations#ResourceQuotaExceededException": + throw await de_ResourceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.appintegrations#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "UnsupportedOperationException": + case "com.amazonaws.appintegrations#UnsupportedOperationException": + throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.appintegrations#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts b/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts index 6e8f8971d31a..ceaf60f87798 100644 --- a/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-auto-scaling/src/protocols/Aws_json1_1.ts @@ -285,7 +285,7 @@ export const de_DeleteScalingPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteScalingPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -297,41 +297,6 @@ export const de_DeleteScalingPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteScalingPolicyCommandError - */ -const de_DeleteScalingPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentUpdateException": - case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": - throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.applicationautoscaling#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ObjectNotFoundException": - case "com.amazonaws.applicationautoscaling#ObjectNotFoundException": - throw await de_ObjectNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationautoscaling#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteScheduledActionCommand */ @@ -340,7 +305,7 @@ export const de_DeleteScheduledActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteScheduledActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -352,41 +317,6 @@ export const de_DeleteScheduledActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteScheduledActionCommandError - */ -const de_DeleteScheduledActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentUpdateException": - case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": - throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.applicationautoscaling#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ObjectNotFoundException": - case "com.amazonaws.applicationautoscaling#ObjectNotFoundException": - throw await de_ObjectNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationautoscaling#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeregisterScalableTargetCommand */ @@ -395,7 +325,7 @@ export const de_DeregisterScalableTargetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterScalableTargetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -407,41 +337,6 @@ export const de_DeregisterScalableTargetCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeregisterScalableTargetCommandError - */ -const de_DeregisterScalableTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentUpdateException": - case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": - throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.applicationautoscaling#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ObjectNotFoundException": - case "com.amazonaws.applicationautoscaling#ObjectNotFoundException": - throw await de_ObjectNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationautoscaling#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeScalableTargetsCommand */ @@ -450,7 +345,7 @@ export const de_DescribeScalableTargetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeScalableTargetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -462,41 +357,6 @@ export const de_DescribeScalableTargetsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeScalableTargetsCommandError - */ -const de_DescribeScalableTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentUpdateException": - case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": - throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.applicationautoscaling#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.applicationautoscaling#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationautoscaling#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeScalingActivitiesCommand */ @@ -505,7 +365,7 @@ export const de_DescribeScalingActivitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeScalingActivitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -517,41 +377,6 @@ export const de_DescribeScalingActivitiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeScalingActivitiesCommandError - */ -const de_DescribeScalingActivitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentUpdateException": - case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": - throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.applicationautoscaling#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.applicationautoscaling#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationautoscaling#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeScalingPoliciesCommand */ @@ -560,7 +385,7 @@ export const de_DescribeScalingPoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeScalingPoliciesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -572,44 +397,6 @@ export const de_DescribeScalingPoliciesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeScalingPoliciesCommandError - */ -const de_DescribeScalingPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentUpdateException": - case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": - throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context); - case "FailedResourceAccessException": - case "com.amazonaws.applicationautoscaling#FailedResourceAccessException": - throw await de_FailedResourceAccessExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.applicationautoscaling#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.applicationautoscaling#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationautoscaling#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeScheduledActionsCommand */ @@ -618,7 +405,7 @@ export const de_DescribeScheduledActionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeScheduledActionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -630,41 +417,6 @@ export const de_DescribeScheduledActionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeScheduledActionsCommandError - */ -const de_DescribeScheduledActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentUpdateException": - case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": - throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.applicationautoscaling#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.applicationautoscaling#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationautoscaling#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -673,7 +425,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -685,32 +437,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.applicationautoscaling#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutScalingPolicyCommand */ @@ -719,7 +445,7 @@ export const de_PutScalingPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutScalingPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -731,47 +457,6 @@ export const de_PutScalingPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutScalingPolicyCommandError - */ -const de_PutScalingPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentUpdateException": - case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": - throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context); - case "FailedResourceAccessException": - case "com.amazonaws.applicationautoscaling#FailedResourceAccessException": - throw await de_FailedResourceAccessExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.applicationautoscaling#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.applicationautoscaling#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ObjectNotFoundException": - case "com.amazonaws.applicationautoscaling#ObjectNotFoundException": - throw await de_ObjectNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationautoscaling#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutScheduledActionCommand */ @@ -780,7 +465,7 @@ export const de_PutScheduledActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutScheduledActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -792,44 +477,6 @@ export const de_PutScheduledActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutScheduledActionCommandError - */ -const de_PutScheduledActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentUpdateException": - case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": - throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.applicationautoscaling#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.applicationautoscaling#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ObjectNotFoundException": - case "com.amazonaws.applicationautoscaling#ObjectNotFoundException": - throw await de_ObjectNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationautoscaling#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RegisterScalableTargetCommand */ @@ -838,7 +485,7 @@ export const de_RegisterScalableTargetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterScalableTargetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -850,41 +497,6 @@ export const de_RegisterScalableTargetCommand = async ( return response; }; -/** - * deserializeAws_json1_1RegisterScalableTargetCommandError - */ -const de_RegisterScalableTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentUpdateException": - case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": - throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.applicationautoscaling#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.applicationautoscaling#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationautoscaling#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -893,7 +505,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -905,38 +517,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.applicationautoscaling#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.applicationautoscaling#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationautoscaling#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -945,7 +525,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -958,31 +538,49 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.applicationautoscaling#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ConcurrentUpdateException": + case "com.amazonaws.applicationautoscaling#ConcurrentUpdateException": + throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context); + case "InternalServiceException": + case "com.amazonaws.applicationautoscaling#InternalServiceException": + throw await de_InternalServiceExceptionRes(parsedOutput, context); + case "ObjectNotFoundException": + case "com.amazonaws.applicationautoscaling#ObjectNotFoundException": + throw await de_ObjectNotFoundExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.applicationautoscaling#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.applicationautoscaling#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "FailedResourceAccessException": + case "com.amazonaws.applicationautoscaling#FailedResourceAccessException": + throw await de_FailedResourceAccessExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.applicationautoscaling#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.applicationautoscaling#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.applicationautoscaling#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts b/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts index 21b06b5a6b7d..2ccbb022c298 100644 --- a/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-discovery-service/src/protocols/Aws_json1_1.ts @@ -539,7 +539,7 @@ export const de_AssociateConfigurationItemsToApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateConfigurationItemsToApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -551,44 +551,6 @@ export const de_AssociateConfigurationItemsToApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateConfigurationItemsToApplicationCommandError - */ -const de_AssociateConfigurationItemsToApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDeleteAgentsCommand */ @@ -597,7 +559,7 @@ export const de_BatchDeleteAgentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDeleteAgentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -609,41 +571,6 @@ export const de_BatchDeleteAgentsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDeleteAgentsCommandError - */ -const de_BatchDeleteAgentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDeleteImportDataCommand */ @@ -652,7 +579,7 @@ export const de_BatchDeleteImportDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDeleteImportDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -664,44 +591,6 @@ export const de_BatchDeleteImportDataCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDeleteImportDataCommandError - */ -const de_BatchDeleteImportDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateApplicationCommand */ @@ -710,7 +599,7 @@ export const de_CreateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -722,44 +611,6 @@ export const de_CreateApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTagsCommand */ @@ -768,7 +619,7 @@ export const de_CreateTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -780,47 +631,6 @@ export const de_CreateTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateTagsCommandError - */ -const de_CreateTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationdiscoveryservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationsCommand */ @@ -829,7 +639,7 @@ export const de_DeleteApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -841,44 +651,6 @@ export const de_DeleteApplicationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteApplicationsCommandError - */ -const de_DeleteApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteTagsCommand */ @@ -887,7 +659,7 @@ export const de_DeleteTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -899,47 +671,6 @@ export const de_DeleteTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteTagsCommandError - */ -const de_DeleteTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationdiscoveryservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAgentsCommand */ @@ -948,7 +679,7 @@ export const de_DescribeAgentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAgentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -961,52 +692,14 @@ export const de_DescribeAgentsCommand = async ( }; /** - * deserializeAws_json1_1DescribeAgentsCommandError + * deserializeAws_json1_1DescribeBatchDeleteConfigurationTaskCommand */ -const de_DescribeAgentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeBatchDeleteConfigurationTaskCommand - */ -export const de_DescribeBatchDeleteConfigurationTaskCommand = async ( +export const de_DescribeBatchDeleteConfigurationTaskCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBatchDeleteConfigurationTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1018,41 +711,6 @@ export const de_DescribeBatchDeleteConfigurationTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeBatchDeleteConfigurationTaskCommandError - */ -const de_DescribeBatchDeleteConfigurationTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeConfigurationsCommand */ @@ -1061,7 +719,7 @@ export const de_DescribeConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1073,44 +731,6 @@ export const de_DescribeConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeConfigurationsCommandError - */ -const de_DescribeConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeContinuousExportsCommand */ @@ -1119,7 +739,7 @@ export const de_DescribeContinuousExportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeContinuousExportsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1131,50 +751,6 @@ export const de_DescribeContinuousExportsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeContinuousExportsCommandError - */ -const de_DescribeContinuousExportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.applicationdiscoveryservice#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationdiscoveryservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeExportConfigurationsCommand */ @@ -1183,7 +759,7 @@ export const de_DescribeExportConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeExportConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1195,47 +771,6 @@ export const de_DescribeExportConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeExportConfigurationsCommandError - */ -const de_DescribeExportConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationdiscoveryservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeExportTasksCommand */ @@ -1244,7 +779,7 @@ export const de_DescribeExportTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeExportTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1256,44 +791,6 @@ export const de_DescribeExportTasksCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeExportTasksCommandError - */ -const de_DescribeExportTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeImportTasksCommand */ @@ -1302,7 +799,7 @@ export const de_DescribeImportTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeImportTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1314,44 +811,6 @@ export const de_DescribeImportTasksCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeImportTasksCommandError - */ -const de_DescribeImportTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTagsCommand */ @@ -1360,7 +819,7 @@ export const de_DescribeTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1372,47 +831,6 @@ export const de_DescribeTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTagsCommandError - */ -const de_DescribeTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationdiscoveryservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisassociateConfigurationItemsFromApplicationCommand */ @@ -1421,7 +839,7 @@ export const de_DisassociateConfigurationItemsFromApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateConfigurationItemsFromApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1433,44 +851,6 @@ export const de_DisassociateConfigurationItemsFromApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateConfigurationItemsFromApplicationCommandError - */ -const de_DisassociateConfigurationItemsFromApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ExportConfigurationsCommand */ @@ -1479,7 +859,7 @@ export const de_ExportConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExportConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1491,47 +871,6 @@ export const de_ExportConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ExportConfigurationsCommandError - */ -const de_ExportConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.applicationdiscoveryservice#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetDiscoverySummaryCommand */ @@ -1540,7 +879,7 @@ export const de_GetDiscoverySummaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDiscoverySummaryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1552,44 +891,6 @@ export const de_GetDiscoverySummaryCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetDiscoverySummaryCommandError - */ -const de_GetDiscoverySummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListConfigurationsCommand */ @@ -1598,7 +899,7 @@ export const de_ListConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1610,47 +911,6 @@ export const de_ListConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListConfigurationsCommandError - */ -const de_ListConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationdiscoveryservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListServerNeighborsCommand */ @@ -1659,7 +919,7 @@ export const de_ListServerNeighborsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListServerNeighborsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1671,44 +931,6 @@ export const de_ListServerNeighborsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListServerNeighborsCommandError - */ -const de_ListServerNeighborsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartBatchDeleteConfigurationTaskCommand */ @@ -1717,57 +939,16 @@ export const de_StartBatchDeleteConfigurationTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartBatchDeleteConfigurationTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); const response: StartBatchDeleteConfigurationTaskCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartBatchDeleteConfigurationTaskCommandError - */ -const de_StartBatchDeleteConfigurationTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.applicationdiscoveryservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.applicationdiscoveryservice#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1778,7 +959,7 @@ export const de_StartContinuousExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartContinuousExportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1790,53 +971,6 @@ export const de_StartContinuousExportCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartContinuousExportCommandError - */ -const de_StartContinuousExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "ConflictErrorException": - case "com.amazonaws.applicationdiscoveryservice#ConflictErrorException": - throw await de_ConflictErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.applicationdiscoveryservice#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.applicationdiscoveryservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartDataCollectionByAgentIdsCommand */ @@ -1845,7 +979,7 @@ export const de_StartDataCollectionByAgentIdsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartDataCollectionByAgentIdsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1857,44 +991,6 @@ export const de_StartDataCollectionByAgentIdsCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartDataCollectionByAgentIdsCommandError - */ -const de_StartDataCollectionByAgentIdsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartExportTaskCommand */ @@ -1903,7 +999,7 @@ export const de_StartExportTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartExportTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1915,47 +1011,6 @@ export const de_StartExportTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartExportTaskCommandError - */ -const de_StartExportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.applicationdiscoveryservice#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartImportTaskCommand */ @@ -1964,7 +1019,7 @@ export const de_StartImportTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartImportTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1976,47 +1031,6 @@ export const de_StartImportTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartImportTaskCommandError - */ -const de_StartImportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.applicationdiscoveryservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopContinuousExportCommand */ @@ -2025,7 +1039,7 @@ export const de_StopContinuousExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopContinuousExportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2037,53 +1051,6 @@ export const de_StopContinuousExportCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopContinuousExportCommandError - */ -const de_StopContinuousExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.applicationdiscoveryservice#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.applicationdiscoveryservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationdiscoveryservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopDataCollectionByAgentIdsCommand */ @@ -2092,7 +1059,7 @@ export const de_StopDataCollectionByAgentIdsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopDataCollectionByAgentIdsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2104,44 +1071,6 @@ export const de_StopDataCollectionByAgentIdsCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopDataCollectionByAgentIdsCommandError - */ -const de_StopDataCollectionByAgentIdsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationErrorException": - case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerInternalErrorException": - case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": - throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateApplicationCommand */ @@ -2150,7 +1079,7 @@ export const de_UpdateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2163,12 +1092,9 @@ export const de_UpdateApplicationCommand = async ( }; /** - * deserializeAws_json1_1UpdateApplicationCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2190,13 +1116,28 @@ const de_UpdateApplicationCommandError = async ( case "ServerInternalErrorException": case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException": throw await de_ServerInternalErrorExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.applicationdiscoveryservice#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "OperationNotPermittedException": + case "com.amazonaws.applicationdiscoveryservice#OperationNotPermittedException": + throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.applicationdiscoveryservice#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ConflictErrorException": + case "com.amazonaws.applicationdiscoveryservice#ConflictErrorException": + throw await de_ConflictErrorExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.applicationdiscoveryservice#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-application-insights/src/protocols/Aws_json1_1.ts b/clients/client-application-insights/src/protocols/Aws_json1_1.ts index 9df76112e05b..f0dbfe217a15 100644 --- a/clients/client-application-insights/src/protocols/Aws_json1_1.ts +++ b/clients/client-application-insights/src/protocols/Aws_json1_1.ts @@ -571,7 +571,7 @@ export const de_AddWorkloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddWorkloadCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -583,41 +583,6 @@ export const de_AddWorkloadCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddWorkloadCommandError - */ -const de_AddWorkloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.applicationinsights#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateApplicationCommand */ @@ -626,7 +591,7 @@ export const de_CreateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -638,47 +603,6 @@ export const de_CreateApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.applicationinsights#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.applicationinsights#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagsAlreadyExistException": - case "com.amazonaws.applicationinsights#TagsAlreadyExistException": - throw await de_TagsAlreadyExistExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateComponentCommand */ @@ -687,7 +611,7 @@ export const de_CreateComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateComponentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -699,41 +623,6 @@ export const de_CreateComponentCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateComponentCommandError - */ -const de_CreateComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.applicationinsights#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLogPatternCommand */ @@ -742,7 +631,7 @@ export const de_CreateLogPatternCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLogPatternCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -754,41 +643,6 @@ export const de_CreateLogPatternCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateLogPatternCommandError - */ -const de_CreateLogPatternCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.applicationinsights#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationCommand */ @@ -797,7 +651,7 @@ export const de_DeleteApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -809,41 +663,6 @@ export const de_DeleteApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteApplicationCommandError - */ -const de_DeleteApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.applicationinsights#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteComponentCommand */ @@ -852,7 +671,7 @@ export const de_DeleteComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteComponentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -864,38 +683,6 @@ export const de_DeleteComponentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteComponentCommandError - */ -const de_DeleteComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteLogPatternCommand */ @@ -904,7 +691,7 @@ export const de_DeleteLogPatternCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLogPatternCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -916,41 +703,6 @@ export const de_DeleteLogPatternCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteLogPatternCommandError - */ -const de_DeleteLogPatternCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.applicationinsights#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeApplicationCommand */ @@ -959,7 +711,7 @@ export const de_DescribeApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -971,38 +723,6 @@ export const de_DescribeApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeApplicationCommandError - */ -const de_DescribeApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeComponentCommand */ @@ -1011,7 +731,7 @@ export const de_DescribeComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeComponentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1023,38 +743,6 @@ export const de_DescribeComponentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeComponentCommandError - */ -const de_DescribeComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeComponentConfigurationCommand */ @@ -1063,7 +751,7 @@ export const de_DescribeComponentConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeComponentConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1075,38 +763,6 @@ export const de_DescribeComponentConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeComponentConfigurationCommandError - */ -const de_DescribeComponentConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeComponentConfigurationRecommendationCommand */ @@ -1115,7 +771,7 @@ export const de_DescribeComponentConfigurationRecommendationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeComponentConfigurationRecommendationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1127,38 +783,6 @@ export const de_DescribeComponentConfigurationRecommendationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeComponentConfigurationRecommendationCommandError - */ -const de_DescribeComponentConfigurationRecommendationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLogPatternCommand */ @@ -1167,7 +791,7 @@ export const de_DescribeLogPatternCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLogPatternCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1179,38 +803,6 @@ export const de_DescribeLogPatternCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLogPatternCommandError - */ -const de_DescribeLogPatternCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeObservationCommand */ @@ -1219,7 +811,7 @@ export const de_DescribeObservationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeObservationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1231,38 +823,6 @@ export const de_DescribeObservationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeObservationCommandError - */ -const de_DescribeObservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeProblemCommand */ @@ -1271,7 +831,7 @@ export const de_DescribeProblemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeProblemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1283,38 +843,6 @@ export const de_DescribeProblemCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeProblemCommandError - */ -const de_DescribeProblemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeProblemObservationsCommand */ @@ -1323,7 +851,7 @@ export const de_DescribeProblemObservationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeProblemObservationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1332,39 +860,7 @@ export const de_DescribeProblemObservationsCommand = async ( $metadata: deserializeMetadata(output), ...contents, }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeProblemObservationsCommandError - */ -const de_DescribeProblemObservationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** @@ -1375,7 +871,7 @@ export const de_DescribeWorkloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeWorkloadCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1387,38 +883,6 @@ export const de_DescribeWorkloadCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeWorkloadCommandError - */ -const de_DescribeWorkloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListApplicationsCommand */ @@ -1427,7 +891,7 @@ export const de_ListApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1439,35 +903,6 @@ export const de_ListApplicationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListApplicationsCommandError - */ -const de_ListApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListComponentsCommand */ @@ -1476,7 +911,7 @@ export const de_ListComponentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListComponentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1488,38 +923,6 @@ export const de_ListComponentsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListComponentsCommandError - */ -const de_ListComponentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListConfigurationHistoryCommand */ @@ -1528,7 +931,7 @@ export const de_ListConfigurationHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListConfigurationHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1540,38 +943,6 @@ export const de_ListConfigurationHistoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListConfigurationHistoryCommandError - */ -const de_ListConfigurationHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListLogPatternsCommand */ @@ -1580,7 +951,7 @@ export const de_ListLogPatternsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListLogPatternsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1592,38 +963,6 @@ export const de_ListLogPatternsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListLogPatternsCommandError - */ -const de_ListLogPatternsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListLogPatternSetsCommand */ @@ -1632,7 +971,7 @@ export const de_ListLogPatternSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListLogPatternSetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1644,38 +983,6 @@ export const de_ListLogPatternSetsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListLogPatternSetsCommandError - */ -const de_ListLogPatternSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListProblemsCommand */ @@ -1684,7 +991,7 @@ export const de_ListProblemsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListProblemsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1696,38 +1003,6 @@ export const de_ListProblemsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListProblemsCommandError - */ -const de_ListProblemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -1736,7 +1011,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1748,35 +1023,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListWorkloadsCommand */ @@ -1785,7 +1031,7 @@ export const de_ListWorkloadsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListWorkloadsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1797,38 +1043,6 @@ export const de_ListWorkloadsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListWorkloadsCommandError - */ -const de_ListWorkloadsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RemoveWorkloadCommand */ @@ -1837,7 +1051,7 @@ export const de_RemoveWorkloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveWorkloadCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1849,38 +1063,6 @@ export const de_RemoveWorkloadCommand = async ( return response; }; -/** - * deserializeAws_json1_1RemoveWorkloadCommandError - */ -const de_RemoveWorkloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -1889,7 +1071,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1901,38 +1083,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.applicationinsights#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -1941,7 +1091,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1953,35 +1103,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateApplicationCommand */ @@ -1990,7 +1111,7 @@ export const de_UpdateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2002,38 +1123,6 @@ export const de_UpdateApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateApplicationCommandError - */ -const de_UpdateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateComponentCommand */ @@ -2042,7 +1131,7 @@ export const de_UpdateComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateComponentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2054,41 +1143,6 @@ export const de_UpdateComponentCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateComponentCommandError - */ -const de_UpdateComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.applicationinsights#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateComponentConfigurationCommand */ @@ -2097,7 +1151,7 @@ export const de_UpdateComponentConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateComponentConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2109,41 +1163,6 @@ export const de_UpdateComponentConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateComponentConfigurationCommandError - */ -const de_UpdateComponentConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.applicationinsights#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateLogPatternCommand */ @@ -2152,7 +1171,7 @@ export const de_UpdateLogPatternCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLogPatternCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2164,41 +1183,6 @@ export const de_UpdateLogPatternCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateLogPatternCommandError - */ -const de_UpdateLogPatternCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.applicationinsights#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateProblemCommand */ @@ -2207,7 +1191,7 @@ export const de_UpdateProblemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateProblemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2219,38 +1203,6 @@ export const de_UpdateProblemCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateProblemCommandError - */ -const de_UpdateProblemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.applicationinsights#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.applicationinsights#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationinsights#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateWorkloadCommand */ @@ -2259,7 +1211,7 @@ export const de_UpdateWorkloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateWorkloadCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2272,12 +1224,9 @@ export const de_UpdateWorkloadCommand = async ( }; /** - * deserializeAws_json1_1UpdateWorkloadCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateWorkloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2287,19 +1236,34 @@ const de_UpdateWorkloadCommandError = async ( case "InternalServerException": case "com.amazonaws.applicationinsights#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.applicationinsights#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.applicationinsights#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.applicationinsights#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.applicationinsights#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "TagsAlreadyExistException": + case "com.amazonaws.applicationinsights#TagsAlreadyExistException": + throw await de_TagsAlreadyExistExceptionRes(parsedOutput, context); + case "BadRequestException": + case "com.amazonaws.applicationinsights#BadRequestException": + throw await de_BadRequestExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.applicationinsights#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts b/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts index 177edb6acee2..a22dc7e77fb9 100644 --- a/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts +++ b/clients/client-applicationcostprofiler/src/protocols/Aws_restJson1.ts @@ -191,7 +191,7 @@ export const de_DeleteReportDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteReportDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -204,41 +204,6 @@ export const de_DeleteReportDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteReportDefinitionCommandError - */ -const de_DeleteReportDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.applicationcostprofiler#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.applicationcostprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.applicationcostprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationcostprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetReportDefinitionCommand */ @@ -247,7 +212,7 @@ export const de_GetReportDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReportDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -266,41 +231,6 @@ export const de_GetReportDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetReportDefinitionCommandError - */ -const de_GetReportDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.applicationcostprofiler#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.applicationcostprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.applicationcostprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationcostprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ImportApplicationUsageCommand */ @@ -309,7 +239,7 @@ export const de_ImportApplicationUsageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ImportApplicationUsageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -322,41 +252,6 @@ export const de_ImportApplicationUsageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ImportApplicationUsageCommandError - */ -const de_ImportApplicationUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.applicationcostprofiler#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.applicationcostprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.applicationcostprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationcostprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListReportDefinitionsCommand */ @@ -365,7 +260,7 @@ export const de_ListReportDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReportDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -379,41 +274,6 @@ export const de_ListReportDefinitionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListReportDefinitionsCommandError - */ -const de_ListReportDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.applicationcostprofiler#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.applicationcostprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.applicationcostprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationcostprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutReportDefinitionCommand */ @@ -422,7 +282,7 @@ export const de_PutReportDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutReportDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -435,44 +295,6 @@ export const de_PutReportDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutReportDefinitionCommandError - */ -const de_PutReportDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.applicationcostprofiler#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.applicationcostprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.applicationcostprofiler#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.applicationcostprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.applicationcostprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateReportDefinitionCommand */ @@ -481,7 +303,7 @@ export const de_UpdateReportDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateReportDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -495,12 +317,9 @@ export const de_UpdateReportDefinitionCommand = async ( }; /** - * deserializeAws_restJson1UpdateReportDefinitionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateReportDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -519,13 +338,16 @@ const de_UpdateReportDefinitionCommandError = async ( case "ValidationException": case "com.amazonaws.applicationcostprofiler#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.applicationcostprofiler#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-apprunner/src/protocols/Aws_json1_0.ts b/clients/client-apprunner/src/protocols/Aws_json1_0.ts index e03a296fb853..c1a7b9442aa4 100644 --- a/clients/client-apprunner/src/protocols/Aws_json1_0.ts +++ b/clients/client-apprunner/src/protocols/Aws_json1_0.ts @@ -708,7 +708,7 @@ export const de_AssociateCustomDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateCustomDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -720,38 +720,6 @@ export const de_AssociateCustomDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_0AssociateCustomDomainCommandError - */ -const de_AssociateCustomDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.apprunner#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateAutoScalingConfigurationCommand */ @@ -760,7 +728,7 @@ export const de_CreateAutoScalingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAutoScalingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -772,38 +740,6 @@ export const de_CreateAutoScalingConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateAutoScalingConfigurationCommandError - */ -const de_CreateAutoScalingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.apprunner#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateConnectionCommand */ @@ -812,7 +748,7 @@ export const de_CreateConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -824,38 +760,6 @@ export const de_CreateConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateConnectionCommandError - */ -const de_CreateConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.apprunner#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateObservabilityConfigurationCommand */ @@ -864,7 +768,7 @@ export const de_CreateObservabilityConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateObservabilityConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -876,38 +780,6 @@ export const de_CreateObservabilityConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateObservabilityConfigurationCommandError - */ -const de_CreateObservabilityConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.apprunner#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateServiceCommand */ @@ -916,7 +788,7 @@ export const de_CreateServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -928,38 +800,6 @@ export const de_CreateServiceCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateServiceCommandError - */ -const de_CreateServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.apprunner#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateVpcConnectorCommand */ @@ -968,7 +808,7 @@ export const de_CreateVpcConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVpcConnectorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -980,38 +820,6 @@ export const de_CreateVpcConnectorCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateVpcConnectorCommandError - */ -const de_CreateVpcConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.apprunner#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateVpcIngressConnectionCommand */ @@ -1020,7 +828,7 @@ export const de_CreateVpcIngressConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVpcIngressConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1032,41 +840,6 @@ export const de_CreateVpcIngressConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateVpcIngressConnectionCommandError - */ -const de_CreateVpcIngressConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.apprunner#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.apprunner#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteAutoScalingConfigurationCommand */ @@ -1075,7 +848,7 @@ export const de_DeleteAutoScalingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAutoScalingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1088,51 +861,39 @@ export const de_DeleteAutoScalingConfigurationCommand = async ( }; /** - * deserializeAws_json1_0DeleteAutoScalingConfigurationCommandError + * deserializeAws_json1_0DeleteConnectionCommand */ -const de_DeleteAutoScalingConfigurationCommandError = async ( +export const de_DeleteConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteConnectionResponse(data, context); + const response: DeleteConnectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DeleteConnectionCommand + * deserializeAws_json1_0DeleteObservabilityConfigurationCommand */ -export const de_DeleteConnectionCommand = async ( +export const de_DeleteObservabilityConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteConnectionResponse(data, context); - const response: DeleteConnectionCommandOutput = { + contents = de_DeleteObservabilityConfigurationResponse(data, context); + const response: DeleteObservabilityConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1140,98 +901,14 @@ export const de_DeleteConnectionCommand = async ( }; /** - * deserializeAws_json1_0DeleteConnectionCommandError + * deserializeAws_json1_0DeleteServiceCommand */ -const de_DeleteConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteObservabilityConfigurationCommand - */ -export const de_DeleteObservabilityConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteObservabilityConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteObservabilityConfigurationResponse(data, context); - const response: DeleteObservabilityConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteObservabilityConfigurationCommandError - */ -const de_DeleteObservabilityConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteServiceCommand - */ -export const de_DeleteServiceCommand = async ( +export const de_DeleteServiceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1243,41 +920,6 @@ export const de_DeleteServiceCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteServiceCommandError - */ -const de_DeleteServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.apprunner#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteVpcConnectorCommand */ @@ -1286,7 +928,7 @@ export const de_DeleteVpcConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVpcConnectorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1298,38 +940,6 @@ export const de_DeleteVpcConnectorCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteVpcConnectorCommandError - */ -const de_DeleteVpcConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteVpcIngressConnectionCommand */ @@ -1338,7 +948,7 @@ export const de_DeleteVpcIngressConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVpcIngressConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1350,41 +960,6 @@ export const de_DeleteVpcIngressConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteVpcIngressConnectionCommandError - */ -const de_DeleteVpcIngressConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.apprunner#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeAutoScalingConfigurationCommand */ @@ -1393,7 +968,7 @@ export const de_DescribeAutoScalingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAutoScalingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1405,38 +980,6 @@ export const de_DescribeAutoScalingConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeAutoScalingConfigurationCommandError - */ -const de_DescribeAutoScalingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeCustomDomainsCommand */ @@ -1445,7 +988,7 @@ export const de_DescribeCustomDomainsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCustomDomainsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1457,38 +1000,6 @@ export const de_DescribeCustomDomainsCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeCustomDomainsCommandError - */ -const de_DescribeCustomDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeObservabilityConfigurationCommand */ @@ -1497,7 +1008,7 @@ export const de_DescribeObservabilityConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeObservabilityConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1509,38 +1020,6 @@ export const de_DescribeObservabilityConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeObservabilityConfigurationCommandError - */ -const de_DescribeObservabilityConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeServiceCommand */ @@ -1549,7 +1028,7 @@ export const de_DescribeServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1561,38 +1040,6 @@ export const de_DescribeServiceCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeServiceCommandError - */ -const de_DescribeServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeVpcConnectorCommand */ @@ -1601,7 +1048,7 @@ export const de_DescribeVpcConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpcConnectorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1609,163 +1056,24 @@ export const de_DescribeVpcConnectorCommand = async ( const response: DescribeVpcConnectorCommandOutput = { $metadata: deserializeMetadata(output), ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeVpcConnectorCommandError - */ -const de_DescribeVpcConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeVpcIngressConnectionCommand - */ -export const de_DescribeVpcIngressConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeVpcIngressConnectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeVpcIngressConnectionResponse(data, context); - const response: DescribeVpcIngressConnectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeVpcIngressConnectionCommandError - */ -const de_DescribeVpcIngressConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DisassociateCustomDomainCommand - */ -export const de_DisassociateCustomDomainCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisassociateCustomDomainCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DisassociateCustomDomainCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DisassociateCustomDomainCommandError - */ -const de_DisassociateCustomDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.apprunner#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }; + return response; }; /** - * deserializeAws_json1_0ListAutoScalingConfigurationsCommand + * deserializeAws_json1_0DescribeVpcIngressConnectionCommand */ -export const de_ListAutoScalingConfigurationsCommand = async ( +export const de_DescribeVpcIngressConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAutoScalingConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListAutoScalingConfigurationsResponse(data, context); - const response: ListAutoScalingConfigurationsCommandOutput = { + contents = de_DescribeVpcIngressConnectionResponse(data, context); + const response: DescribeVpcIngressConnectionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1773,48 +1081,39 @@ export const de_ListAutoScalingConfigurationsCommand = async ( }; /** - * deserializeAws_json1_0ListAutoScalingConfigurationsCommandError + * deserializeAws_json1_0DisassociateCustomDomainCommand */ -const de_ListAutoScalingConfigurationsCommandError = async ( +export const de_DisassociateCustomDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisassociateCustomDomainCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListConnectionsCommand + * deserializeAws_json1_0ListAutoScalingConfigurationsCommand */ -export const de_ListConnectionsCommand = async ( +export const de_ListAutoScalingConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListConnectionsResponse(data, context); - const response: ListConnectionsCommandOutput = { + contents = de_ListAutoScalingConfigurationsResponse(data, context); + const response: ListAutoScalingConfigurationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1822,32 +1121,23 @@ export const de_ListConnectionsCommand = async ( }; /** - * deserializeAws_json1_0ListConnectionsCommandError + * deserializeAws_json1_0ListConnectionsCommand */ -const de_ListConnectionsCommandError = async ( +export const de_ListConnectionsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListConnectionsResponse(data, context); + const response: ListConnectionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1858,7 +1148,7 @@ export const de_ListObservabilityConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListObservabilityConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1870,35 +1160,6 @@ export const de_ListObservabilityConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListObservabilityConfigurationsCommandError - */ -const de_ListObservabilityConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListOperationsCommand */ @@ -1907,7 +1168,7 @@ export const de_ListOperationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListOperationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1919,38 +1180,6 @@ export const de_ListOperationsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListOperationsCommandError - */ -const de_ListOperationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListServicesCommand */ @@ -1959,7 +1188,7 @@ export const de_ListServicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListServicesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1971,35 +1200,6 @@ export const de_ListServicesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListServicesCommandError - */ -const de_ListServicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListServicesForAutoScalingConfigurationCommand */ @@ -2008,7 +1208,7 @@ export const de_ListServicesForAutoScalingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListServicesForAutoScalingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2020,38 +1220,6 @@ export const de_ListServicesForAutoScalingConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListServicesForAutoScalingConfigurationCommandError - */ -const de_ListServicesForAutoScalingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListTagsForResourceCommand */ @@ -2060,7 +1228,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2072,41 +1240,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.apprunner#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListVpcConnectorsCommand */ @@ -2115,45 +1248,16 @@ export const de_ListVpcConnectorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListVpcConnectorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListVpcConnectorsResponse(data, context); - const response: ListVpcConnectorsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListVpcConnectorsCommandError - */ -const de_ListVpcConnectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + contents = de_ListVpcConnectorsResponse(data, context); + const response: ListVpcConnectorsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2164,7 +1268,7 @@ export const de_ListVpcIngressConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListVpcIngressConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2176,35 +1280,6 @@ export const de_ListVpcIngressConnectionsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListVpcIngressConnectionsCommandError - */ -const de_ListVpcIngressConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0PauseServiceCommand */ @@ -2213,7 +1288,7 @@ export const de_PauseServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PauseServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2225,41 +1300,6 @@ export const de_PauseServiceCommand = async ( return response; }; -/** - * deserializeAws_json1_0PauseServiceCommandError - */ -const de_PauseServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.apprunner#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ResumeServiceCommand */ @@ -2268,7 +1308,7 @@ export const de_ResumeServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResumeServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2280,41 +1320,6 @@ export const de_ResumeServiceCommand = async ( return response; }; -/** - * deserializeAws_json1_0ResumeServiceCommandError - */ -const de_ResumeServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.apprunner#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0StartDeploymentCommand */ @@ -2323,7 +1328,7 @@ export const de_StartDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartDeploymentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2335,38 +1340,6 @@ export const de_StartDeploymentCommand = async ( return response; }; -/** - * deserializeAws_json1_0StartDeploymentCommandError - */ -const de_StartDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TagResourceCommand */ @@ -2375,7 +1348,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2387,41 +1360,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.apprunner#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UntagResourceCommand */ @@ -2430,7 +1368,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2442,41 +1380,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.apprunner#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateDefaultAutoScalingConfigurationCommand */ @@ -2485,7 +1388,7 @@ export const de_UpdateDefaultAutoScalingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDefaultAutoScalingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2497,38 +1400,6 @@ export const de_UpdateDefaultAutoScalingConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateDefaultAutoScalingConfigurationCommandError - */ -const de_UpdateDefaultAutoScalingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateServiceCommand */ @@ -2537,7 +1408,7 @@ export const de_UpdateServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2549,41 +1420,6 @@ export const de_UpdateServiceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateServiceCommandError - */ -const de_UpdateServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.apprunner#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.apprunner#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.apprunner#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.apprunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateVpcIngressConnectionCommand */ @@ -2592,7 +1428,7 @@ export const de_UpdateVpcIngressConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateVpcIngressConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2605,12 +1441,9 @@ export const de_UpdateVpcIngressConnectionCommand = async ( }; /** - * deserializeAws_json1_0UpdateVpcIngressConnectionCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateVpcIngressConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2626,6 +1459,9 @@ const de_UpdateVpcIngressConnectionCommandError = async ( case "InvalidStateException": case "com.amazonaws.apprunner#InvalidStateException": throw await de_InvalidStateExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.apprunner#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.apprunner#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); @@ -2635,7 +1471,7 @@ const de_UpdateVpcIngressConnectionCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-appstream/src/protocols/Aws_json1_1.ts b/clients/client-appstream/src/protocols/Aws_json1_1.ts index 798749baa12c..225516336d6b 100644 --- a/clients/client-appstream/src/protocols/Aws_json1_1.ts +++ b/clients/client-appstream/src/protocols/Aws_json1_1.ts @@ -1348,7 +1348,7 @@ export const de_AssociateAppBlockBuilderAppBlockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateAppBlockBuilderAppBlockCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1360,44 +1360,6 @@ export const de_AssociateAppBlockBuilderAppBlockCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateAppBlockBuilderAppBlockCommandError - */ -const de_AssociateAppBlockBuilderAppBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateApplicationFleetCommand */ @@ -1406,7 +1368,7 @@ export const de_AssociateApplicationFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateApplicationFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1418,44 +1380,6 @@ export const de_AssociateApplicationFleetCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateApplicationFleetCommandError - */ -const de_AssociateApplicationFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateApplicationToEntitlementCommand */ @@ -1464,7 +1388,7 @@ export const de_AssociateApplicationToEntitlementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateApplicationToEntitlementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1476,41 +1400,6 @@ export const de_AssociateApplicationToEntitlementCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateApplicationToEntitlementCommandError - */ -const de_AssociateApplicationToEntitlementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntitlementNotFoundException": - case "com.amazonaws.appstream#EntitlementNotFoundException": - throw await de_EntitlementNotFoundExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateFleetCommand */ @@ -1519,7 +1408,7 @@ export const de_AssociateFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1531,47 +1420,6 @@ export const de_AssociateFleetCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateFleetCommandError - */ -const de_AssociateFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "IncompatibleImageException": - case "com.amazonaws.appstream#IncompatibleImageException": - throw await de_IncompatibleImageExceptionRes(parsedOutput, context); - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchAssociateUserStackCommand */ @@ -1580,7 +1428,7 @@ export const de_BatchAssociateUserStackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchAssociateUserStackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1592,35 +1440,6 @@ export const de_BatchAssociateUserStackCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchAssociateUserStackCommandError - */ -const de_BatchAssociateUserStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDisassociateUserStackCommand */ @@ -1629,7 +1448,7 @@ export const de_BatchDisassociateUserStackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDisassociateUserStackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1641,35 +1460,6 @@ export const de_BatchDisassociateUserStackCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDisassociateUserStackCommandError - */ -const de_BatchDisassociateUserStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CopyImageCommand */ @@ -1678,7 +1468,7 @@ export const de_CopyImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopyImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1691,60 +1481,39 @@ export const de_CopyImageCommand = async ( }; /** - * deserializeAws_json1_1CopyImageCommandError + * deserializeAws_json1_1CreateAppBlockCommand */ -const de_CopyImageCommandError = async ( +export const de_CreateAppBlockCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IncompatibleImageException": - case "com.amazonaws.appstream#IncompatibleImageException": - throw await de_IncompatibleImageExceptionRes(parsedOutput, context); - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.appstream#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotAvailableException": - case "com.amazonaws.appstream#ResourceNotAvailableException": - throw await de_ResourceNotAvailableExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateAppBlockResult(data, context); + const response: CreateAppBlockCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateAppBlockCommand + * deserializeAws_json1_1CreateAppBlockBuilderCommand */ -export const de_CreateAppBlockCommand = async ( +export const de_CreateAppBlockBuilderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateAppBlockCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateAppBlockResult(data, context); - const response: CreateAppBlockCommandOutput = { + contents = de_CreateAppBlockBuilderResult(data, context); + const response: CreateAppBlockBuilderCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1752,1716 +1521,19 @@ export const de_CreateAppBlockCommand = async ( }; /** - * deserializeAws_json1_1CreateAppBlockCommandError + * deserializeAws_json1_1CreateAppBlockBuilderStreamingURLCommand */ -const de_CreateAppBlockCommandError = async ( +export const de_CreateAppBlockBuilderStreamingURLCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.appstream#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateAppBlockBuilderCommand - */ -export const de_CreateAppBlockBuilderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateAppBlockBuilderCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateAppBlockBuilderResult(data, context); - const response: CreateAppBlockBuilderCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateAppBlockBuilderCommandError - */ -const de_CreateAppBlockBuilderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.appstream#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "RequestLimitExceededException": - case "com.amazonaws.appstream#RequestLimitExceededException": - throw await de_RequestLimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.appstream#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotAvailableException": - case "com.amazonaws.appstream#ResourceNotAvailableException": - throw await de_ResourceNotAvailableExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateAppBlockBuilderStreamingURLCommand - */ -export const de_CreateAppBlockBuilderStreamingURLCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateAppBlockBuilderStreamingURLCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateAppBlockBuilderStreamingURLResult(data, context); - const response: CreateAppBlockBuilderStreamingURLCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateAppBlockBuilderStreamingURLCommandError - */ -const de_CreateAppBlockBuilderStreamingURLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateApplicationCommand - */ -export const de_CreateApplicationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateApplicationResult(data, context); - const response: CreateApplicationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.appstream#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateDirectoryConfigCommand - */ -export const de_CreateDirectoryConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateDirectoryConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateDirectoryConfigResult(data, context); - const response: CreateDirectoryConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateDirectoryConfigCommandError - */ -const de_CreateDirectoryConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.appstream#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.appstream#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateEntitlementCommand - */ -export const de_CreateEntitlementCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateEntitlementCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateEntitlementResult(data, context); - const response: CreateEntitlementCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateEntitlementCommandError - */ -const de_CreateEntitlementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntitlementAlreadyExistsException": - case "com.amazonaws.appstream#EntitlementAlreadyExistsException": - throw await de_EntitlementAlreadyExistsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateFleetCommand - */ -export const de_CreateFleetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateFleetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateFleetResult(data, context); - const response: CreateFleetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateFleetCommandError - */ -const de_CreateFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "IncompatibleImageException": - case "com.amazonaws.appstream#IncompatibleImageException": - throw await de_IncompatibleImageExceptionRes(parsedOutput, context); - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.appstream#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "RequestLimitExceededException": - case "com.amazonaws.appstream#RequestLimitExceededException": - throw await de_RequestLimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.appstream#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotAvailableException": - case "com.amazonaws.appstream#ResourceNotAvailableException": - throw await de_ResourceNotAvailableExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateImageBuilderCommand - */ -export const de_CreateImageBuilderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateImageBuilderCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateImageBuilderResult(data, context); - const response: CreateImageBuilderCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateImageBuilderCommandError - */ -const de_CreateImageBuilderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "IncompatibleImageException": - case "com.amazonaws.appstream#IncompatibleImageException": - throw await de_IncompatibleImageExceptionRes(parsedOutput, context); - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.appstream#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "RequestLimitExceededException": - case "com.amazonaws.appstream#RequestLimitExceededException": - throw await de_RequestLimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.appstream#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotAvailableException": - case "com.amazonaws.appstream#ResourceNotAvailableException": - throw await de_ResourceNotAvailableExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateImageBuilderStreamingURLCommand - */ -export const de_CreateImageBuilderStreamingURLCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateImageBuilderStreamingURLCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateImageBuilderStreamingURLResult(data, context); - const response: CreateImageBuilderStreamingURLCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateImageBuilderStreamingURLCommandError - */ -const de_CreateImageBuilderStreamingURLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateStackCommand - */ -export const de_CreateStackCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateStackCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateStackResult(data, context); - const response: CreateStackCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateStackCommandError - */ -const de_CreateStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.appstream#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.appstream#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateStreamingURLCommand - */ -export const de_CreateStreamingURLCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateStreamingURLCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateStreamingURLResult(data, context); - const response: CreateStreamingURLCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateStreamingURLCommandError - */ -const de_CreateStreamingURLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotAvailableException": - case "com.amazonaws.appstream#ResourceNotAvailableException": - throw await de_ResourceNotAvailableExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateUpdatedImageCommand - */ -export const de_CreateUpdatedImageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateUpdatedImageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateUpdatedImageResult(data, context); - const response: CreateUpdatedImageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateUpdatedImageCommandError - */ -const de_CreateUpdatedImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "IncompatibleImageException": - case "com.amazonaws.appstream#IncompatibleImageException": - throw await de_IncompatibleImageExceptionRes(parsedOutput, context); - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.appstream#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateUsageReportSubscriptionCommand - */ -export const de_CreateUsageReportSubscriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateUsageReportSubscriptionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateUsageReportSubscriptionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateUsageReportSubscriptionCommandError - */ -const de_CreateUsageReportSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.appstream#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateUserCommand - */ -export const de_CreateUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateUserCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateUserCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateUserCommandError - */ -const de_CreateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.appstream#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteAppBlockCommand - */ -export const de_DeleteAppBlockCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteAppBlockCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteAppBlockCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteAppBlockCommandError - */ -const de_DeleteAppBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appstream#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteAppBlockBuilderCommand - */ -export const de_DeleteAppBlockBuilderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteAppBlockBuilderCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteAppBlockBuilderCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteAppBlockBuilderCommandError - */ -const de_DeleteAppBlockBuilderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appstream#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteApplicationCommand - */ -export const de_DeleteApplicationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteApplicationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteApplicationCommandError - */ -const de_DeleteApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appstream#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDirectoryConfigCommand - */ -export const de_DeleteDirectoryConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDirectoryConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteDirectoryConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDirectoryConfigCommandError - */ -const de_DeleteDirectoryConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUseException": - case "com.amazonaws.appstream#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteEntitlementCommand - */ -export const de_DeleteEntitlementCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteEntitlementCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteEntitlementCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteEntitlementCommandError - */ -const de_DeleteEntitlementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntitlementNotFoundException": - case "com.amazonaws.appstream#EntitlementNotFoundException": - throw await de_EntitlementNotFoundExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteFleetCommand - */ -export const de_DeleteFleetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteFleetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteFleetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteFleetCommandError - */ -const de_DeleteFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appstream#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteImageCommand - */ -export const de_DeleteImageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteImageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteImageResult(data, context); - const response: DeleteImageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteImageCommandError - */ -const de_DeleteImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appstream#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteImageBuilderCommand - */ -export const de_DeleteImageBuilderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteImageBuilderCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteImageBuilderResult(data, context); - const response: DeleteImageBuilderCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteImageBuilderCommandError - */ -const de_DeleteImageBuilderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteImagePermissionsCommand - */ -export const de_DeleteImagePermissionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteImagePermissionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteImagePermissionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteImagePermissionsCommandError - */ -const de_DeleteImagePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotAvailableException": - case "com.amazonaws.appstream#ResourceNotAvailableException": - throw await de_ResourceNotAvailableExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteStackCommand - */ -export const de_DeleteStackCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteStackCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteStackCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteStackCommandError - */ -const de_DeleteStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appstream#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteUsageReportSubscriptionCommand - */ -export const de_DeleteUsageReportSubscriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteUsageReportSubscriptionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteUsageReportSubscriptionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteUsageReportSubscriptionCommandError - */ -const de_DeleteUsageReportSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteUserCommand - */ -export const de_DeleteUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteUserCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteUserCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteUserCommandError - */ -const de_DeleteUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAppBlockBuilderAppBlockAssociationsCommand - */ -export const de_DescribeAppBlockBuilderAppBlockAssociationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAppBlockBuilderAppBlockAssociationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeAppBlockBuilderAppBlockAssociationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAppBlockBuilderAppBlockAssociationsCommandError - */ -const de_DescribeAppBlockBuilderAppBlockAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAppBlockBuildersCommand - */ -export const de_DescribeAppBlockBuildersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAppBlockBuildersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeAppBlockBuildersResult(data, context); - const response: DescribeAppBlockBuildersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAppBlockBuildersCommandError - */ -const de_DescribeAppBlockBuildersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAppBlocksCommand - */ -export const de_DescribeAppBlocksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAppBlocksCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeAppBlocksResult(data, context); - const response: DescribeAppBlocksCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAppBlocksCommandError - */ -const de_DescribeAppBlocksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeApplicationFleetAssociationsCommand - */ -export const de_DescribeApplicationFleetAssociationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeApplicationFleetAssociationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeApplicationFleetAssociationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeApplicationFleetAssociationsCommandError - */ -const de_DescribeApplicationFleetAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeApplicationsCommand - */ -export const de_DescribeApplicationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeApplicationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeApplicationsResult(data, context); - const response: DescribeApplicationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeApplicationsCommandError - */ -const de_DescribeApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDirectoryConfigsCommand - */ -export const de_DescribeDirectoryConfigsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDirectoryConfigsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDirectoryConfigsResult(data, context); - const response: DescribeDirectoryConfigsCommandOutput = { + contents = de_CreateAppBlockBuilderStreamingURLResult(data, context); + const response: CreateAppBlockBuilderStreamingURLCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3469,45 +1541,19 @@ export const de_DescribeDirectoryConfigsCommand = async ( }; /** - * deserializeAws_json1_1DescribeDirectoryConfigsCommandError - */ -const de_DescribeDirectoryConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeEntitlementsCommand + * deserializeAws_json1_1CreateApplicationCommand */ -export const de_DescribeEntitlementsCommand = async ( +export const de_CreateApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEntitlementsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEntitlementsResult(data, context); - const response: DescribeEntitlementsCommandOutput = { + contents = de_CreateApplicationResult(data, context); + const response: CreateApplicationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3515,51 +1561,19 @@ export const de_DescribeEntitlementsCommand = async ( }; /** - * deserializeAws_json1_1DescribeEntitlementsCommandError - */ -const de_DescribeEntitlementsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntitlementNotFoundException": - case "com.amazonaws.appstream#EntitlementNotFoundException": - throw await de_EntitlementNotFoundExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFleetsCommand + * deserializeAws_json1_1CreateDirectoryConfigCommand */ -export const de_DescribeFleetsCommand = async ( +export const de_CreateDirectoryConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeFleetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeFleetsResult(data, context); - const response: DescribeFleetsCommandOutput = { + contents = de_CreateDirectoryConfigResult(data, context); + const response: CreateDirectoryConfigCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3567,45 +1581,19 @@ export const de_DescribeFleetsCommand = async ( }; /** - * deserializeAws_json1_1DescribeFleetsCommandError - */ -const de_DescribeFleetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeImageBuildersCommand + * deserializeAws_json1_1CreateEntitlementCommand */ -export const de_DescribeImageBuildersCommand = async ( +export const de_CreateEntitlementCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeImageBuildersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeImageBuildersResult(data, context); - const response: DescribeImageBuildersCommandOutput = { + contents = de_CreateEntitlementResult(data, context); + const response: CreateEntitlementCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3613,45 +1601,19 @@ export const de_DescribeImageBuildersCommand = async ( }; /** - * deserializeAws_json1_1DescribeImageBuildersCommandError - */ -const de_DescribeImageBuildersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeImagePermissionsCommand + * deserializeAws_json1_1CreateFleetCommand */ -export const de_DescribeImagePermissionsCommand = async ( +export const de_CreateFleetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeImagePermissionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeImagePermissionsCommandOutput = { + contents = de_CreateFleetResult(data, context); + const response: CreateFleetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3659,45 +1621,39 @@ export const de_DescribeImagePermissionsCommand = async ( }; /** - * deserializeAws_json1_1DescribeImagePermissionsCommandError + * deserializeAws_json1_1CreateImageBuilderCommand */ -const de_DescribeImagePermissionsCommandError = async ( +export const de_CreateImageBuilderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateImageBuilderResult(data, context); + const response: CreateImageBuilderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeImagesCommand + * deserializeAws_json1_1CreateImageBuilderStreamingURLCommand */ -export const de_DescribeImagesCommand = async ( +export const de_CreateImageBuilderStreamingURLCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeImagesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeImagesResult(data, context); - const response: DescribeImagesCommandOutput = { + contents = de_CreateImageBuilderStreamingURLResult(data, context); + const response: CreateImageBuilderStreamingURLCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3705,48 +1661,39 @@ export const de_DescribeImagesCommand = async ( }; /** - * deserializeAws_json1_1DescribeImagesCommandError + * deserializeAws_json1_1CreateStackCommand */ -const de_DescribeImagesCommandError = async ( +export const de_CreateStackCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateStackResult(data, context); + const response: CreateStackCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeSessionsCommand + * deserializeAws_json1_1CreateStreamingURLCommand */ -export const de_DescribeSessionsCommand = async ( +export const de_CreateStreamingURLCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeSessionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeSessionsResult(data, context); - const response: DescribeSessionsCommandOutput = { + contents = de_CreateStreamingURLResult(data, context); + const response: CreateStreamingURLCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3754,45 +1701,39 @@ export const de_DescribeSessionsCommand = async ( }; /** - * deserializeAws_json1_1DescribeSessionsCommandError - */ -const de_DescribeSessionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + * deserializeAws_json1_1CreateUpdatedImageCommand + */ +export const de_CreateUpdatedImageCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateUpdatedImageResult(data, context); + const response: CreateUpdatedImageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeStacksCommand + * deserializeAws_json1_1CreateUsageReportSubscriptionCommand */ -export const de_DescribeStacksCommand = async ( +export const de_CreateUsageReportSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeStacksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeStacksResult(data, context); - const response: DescribeStacksCommandOutput = { + contents = _json(data); + const response: CreateUsageReportSubscriptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3800,45 +1741,39 @@ export const de_DescribeStacksCommand = async ( }; /** - * deserializeAws_json1_1DescribeStacksCommandError + * deserializeAws_json1_1CreateUserCommand */ -const de_DescribeStacksCommandError = async ( +export const de_CreateUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateUserCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeUsageReportSubscriptionsCommand + * deserializeAws_json1_1DeleteAppBlockCommand */ -export const de_DescribeUsageReportSubscriptionsCommand = async ( +export const de_DeleteAppBlockCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeUsageReportSubscriptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeUsageReportSubscriptionsResult(data, context); - const response: DescribeUsageReportSubscriptionsCommandOutput = { + contents = _json(data); + const response: DeleteAppBlockCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3846,48 +1781,39 @@ export const de_DescribeUsageReportSubscriptionsCommand = async ( }; /** - * deserializeAws_json1_1DescribeUsageReportSubscriptionsCommandError + * deserializeAws_json1_1DeleteAppBlockBuilderCommand */ -const de_DescribeUsageReportSubscriptionsCommandError = async ( +export const de_DeleteAppBlockBuilderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteAppBlockBuilderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeUsersCommand + * deserializeAws_json1_1DeleteApplicationCommand */ -export const de_DescribeUsersCommand = async ( +export const de_DeleteApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeUsersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeUsersResult(data, context); - const response: DescribeUsersCommandOutput = { + contents = _json(data); + const response: DeleteApplicationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3895,51 +1821,39 @@ export const de_DescribeUsersCommand = async ( }; /** - * deserializeAws_json1_1DescribeUsersCommandError + * deserializeAws_json1_1DeleteDirectoryConfigCommand */ -const de_DescribeUsersCommandError = async ( +export const de_DeleteDirectoryConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteDirectoryConfigCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeUserStackAssociationsCommand + * deserializeAws_json1_1DeleteEntitlementCommand */ -export const de_DescribeUserStackAssociationsCommand = async ( +export const de_DeleteEntitlementCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeUserStackAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeUserStackAssociationsCommandOutput = { + const response: DeleteEntitlementCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3947,48 +1861,39 @@ export const de_DescribeUserStackAssociationsCommand = async ( }; /** - * deserializeAws_json1_1DescribeUserStackAssociationsCommandError + * deserializeAws_json1_1DeleteFleetCommand */ -const de_DescribeUserStackAssociationsCommandError = async ( +export const de_DeleteFleetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteFleetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisableUserCommand + * deserializeAws_json1_1DeleteImageCommand */ -export const de_DisableUserCommand = async ( +export const de_DeleteImageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisableUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DisableUserCommandOutput = { + contents = de_DeleteImageResult(data, context); + const response: DeleteImageCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3996,45 +1901,39 @@ export const de_DisableUserCommand = async ( }; /** - * deserializeAws_json1_1DisableUserCommandError + * deserializeAws_json1_1DeleteImageBuilderCommand */ -const de_DisableUserCommandError = async ( +export const de_DeleteImageBuilderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteImageBuilderResult(data, context); + const response: DeleteImageBuilderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisassociateAppBlockBuilderAppBlockCommand + * deserializeAws_json1_1DeleteImagePermissionsCommand */ -export const de_DisassociateAppBlockBuilderAppBlockCommand = async ( +export const de_DeleteImagePermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateAppBlockBuilderAppBlockCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateAppBlockBuilderAppBlockCommandOutput = { + const response: DeleteImagePermissionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4042,54 +1941,39 @@ export const de_DisassociateAppBlockBuilderAppBlockCommand = async ( }; /** - * deserializeAws_json1_1DisassociateAppBlockBuilderAppBlockCommandError + * deserializeAws_json1_1DeleteStackCommand */ -const de_DisassociateAppBlockBuilderAppBlockCommandError = async ( +export const de_DeleteStackCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteStackCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisassociateApplicationFleetCommand + * deserializeAws_json1_1DeleteUsageReportSubscriptionCommand */ -export const de_DisassociateApplicationFleetCommand = async ( +export const de_DeleteUsageReportSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateApplicationFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateApplicationFleetCommandOutput = { + const response: DeleteUsageReportSubscriptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4097,51 +1981,39 @@ export const de_DisassociateApplicationFleetCommand = async ( }; /** - * deserializeAws_json1_1DisassociateApplicationFleetCommandError + * deserializeAws_json1_1DeleteUserCommand */ -const de_DisassociateApplicationFleetCommandError = async ( +export const de_DeleteUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteUserCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisassociateApplicationFromEntitlementCommand + * deserializeAws_json1_1DescribeAppBlockBuilderAppBlockAssociationsCommand */ -export const de_DisassociateApplicationFromEntitlementCommand = async ( +export const de_DescribeAppBlockBuilderAppBlockAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateApplicationFromEntitlementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateApplicationFromEntitlementCommandOutput = { + const response: DescribeAppBlockBuilderAppBlockAssociationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4149,51 +2021,39 @@ export const de_DisassociateApplicationFromEntitlementCommand = async ( }; /** - * deserializeAws_json1_1DisassociateApplicationFromEntitlementCommandError + * deserializeAws_json1_1DescribeAppBlockBuildersCommand */ -const de_DisassociateApplicationFromEntitlementCommandError = async ( +export const de_DescribeAppBlockBuildersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntitlementNotFoundException": - case "com.amazonaws.appstream#EntitlementNotFoundException": - throw await de_EntitlementNotFoundExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeAppBlockBuildersResult(data, context); + const response: DescribeAppBlockBuildersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisassociateFleetCommand + * deserializeAws_json1_1DescribeAppBlocksCommand */ -export const de_DisassociateFleetCommand = async ( +export const de_DescribeAppBlocksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DisassociateFleetCommandOutput = { + contents = de_DescribeAppBlocksResult(data, context); + const response: DescribeAppBlocksCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4201,54 +2061,39 @@ export const de_DisassociateFleetCommand = async ( }; /** - * deserializeAws_json1_1DisassociateFleetCommandError + * deserializeAws_json1_1DescribeApplicationFleetAssociationsCommand */ -const de_DisassociateFleetCommandError = async ( +export const de_DescribeApplicationFleetAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appstream#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeApplicationFleetAssociationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1EnableUserCommand + * deserializeAws_json1_1DescribeApplicationsCommand */ -export const de_EnableUserCommand = async ( +export const de_DescribeApplicationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_EnableUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: EnableUserCommandOutput = { + contents = de_DescribeApplicationsResult(data, context); + const response: DescribeApplicationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4256,48 +2101,39 @@ export const de_EnableUserCommand = async ( }; /** - * deserializeAws_json1_1EnableUserCommandError + * deserializeAws_json1_1DescribeDirectoryConfigsCommand */ -const de_EnableUserCommandError = async ( +export const de_DescribeDirectoryConfigsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDirectoryConfigsResult(data, context); + const response: DescribeDirectoryConfigsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ExpireSessionCommand + * deserializeAws_json1_1DescribeEntitlementsCommand */ -export const de_ExpireSessionCommand = async ( +export const de_DescribeEntitlementsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ExpireSessionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ExpireSessionCommandOutput = { + contents = de_DescribeEntitlementsResult(data, context); + const response: DescribeEntitlementsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4305,39 +2141,39 @@ export const de_ExpireSessionCommand = async ( }; /** - * deserializeAws_json1_1ExpireSessionCommandError + * deserializeAws_json1_1DescribeFleetsCommand */ -const de_ExpireSessionCommandError = async ( +export const de_DescribeFleetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeFleetsResult(data, context); + const response: DescribeFleetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; }; /** - * deserializeAws_json1_1ListAssociatedFleetsCommand + * deserializeAws_json1_1DescribeImageBuildersCommand */ -export const de_ListAssociatedFleetsCommand = async ( +export const de_DescribeImageBuildersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAssociatedFleetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListAssociatedFleetsCommandOutput = { + contents = de_DescribeImageBuildersResult(data, context); + const response: DescribeImageBuildersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4345,39 +2181,39 @@ export const de_ListAssociatedFleetsCommand = async ( }; /** - * deserializeAws_json1_1ListAssociatedFleetsCommandError + * deserializeAws_json1_1DescribeImagePermissionsCommand */ -const de_ListAssociatedFleetsCommandError = async ( +export const de_DescribeImagePermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeImagePermissionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; }; /** - * deserializeAws_json1_1ListAssociatedStacksCommand + * deserializeAws_json1_1DescribeImagesCommand */ -export const de_ListAssociatedStacksCommand = async ( +export const de_DescribeImagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAssociatedStacksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListAssociatedStacksCommandOutput = { + contents = de_DescribeImagesResult(data, context); + const response: DescribeImagesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4385,39 +2221,39 @@ export const de_ListAssociatedStacksCommand = async ( }; /** - * deserializeAws_json1_1ListAssociatedStacksCommandError + * deserializeAws_json1_1DescribeSessionsCommand */ -const de_ListAssociatedStacksCommandError = async ( +export const de_DescribeSessionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeSessionsResult(data, context); + const response: DescribeSessionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; }; /** - * deserializeAws_json1_1ListEntitledApplicationsCommand + * deserializeAws_json1_1DescribeStacksCommand */ -export const de_ListEntitledApplicationsCommand = async ( +export const de_DescribeStacksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListEntitledApplicationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListEntitledApplicationsCommandOutput = { + contents = de_DescribeStacksResult(data, context); + const response: DescribeStacksCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4425,51 +2261,39 @@ export const de_ListEntitledApplicationsCommand = async ( }; /** - * deserializeAws_json1_1ListEntitledApplicationsCommandError + * deserializeAws_json1_1DescribeUsageReportSubscriptionsCommand */ -const de_ListEntitledApplicationsCommandError = async ( +export const de_DescribeUsageReportSubscriptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntitlementNotFoundException": - case "com.amazonaws.appstream#EntitlementNotFoundException": - throw await de_EntitlementNotFoundExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeUsageReportSubscriptionsResult(data, context); + const response: DescribeUsageReportSubscriptionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1DescribeUsersCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_DescribeUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_DescribeUsersResult(data, context); + const response: DescribeUsersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4477,45 +2301,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1DescribeUserStackAssociationsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_DescribeUserStackAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeUserStackAssociationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartAppBlockBuilderCommand + * deserializeAws_json1_1DisableUserCommand */ -export const de_StartAppBlockBuilderCommand = async ( +export const de_DisableUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartAppBlockBuilderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StartAppBlockBuilderResult(data, context); - const response: StartAppBlockBuilderCommandOutput = { + contents = _json(data); + const response: DisableUserCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4523,63 +2341,39 @@ export const de_StartAppBlockBuilderCommand = async ( }; /** - * deserializeAws_json1_1StartAppBlockBuilderCommandError + * deserializeAws_json1_1DisassociateAppBlockBuilderAppBlockCommand */ -const de_StartAppBlockBuilderCommandError = async ( +export const de_DisassociateAppBlockBuilderAppBlockCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "RequestLimitExceededException": - case "com.amazonaws.appstream#RequestLimitExceededException": - throw await de_RequestLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotAvailableException": - case "com.amazonaws.appstream#ResourceNotAvailableException": - throw await de_ResourceNotAvailableExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisassociateAppBlockBuilderAppBlockCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartFleetCommand + * deserializeAws_json1_1DisassociateApplicationFleetCommand */ -export const de_StartFleetCommand = async ( +export const de_DisassociateApplicationFleetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartFleetCommandOutput = { + const response: DisassociateApplicationFleetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4587,66 +2381,39 @@ export const de_StartFleetCommand = async ( }; /** - * deserializeAws_json1_1StartFleetCommandError + * deserializeAws_json1_1DisassociateApplicationFromEntitlementCommand */ -const de_StartFleetCommandError = async ( +export const de_DisassociateApplicationFromEntitlementCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.appstream#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "RequestLimitExceededException": - case "com.amazonaws.appstream#RequestLimitExceededException": - throw await de_RequestLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotAvailableException": - case "com.amazonaws.appstream#ResourceNotAvailableException": - throw await de_ResourceNotAvailableExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisassociateApplicationFromEntitlementCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartImageBuilderCommand + * deserializeAws_json1_1DisassociateFleetCommand */ -export const de_StartImageBuilderCommand = async ( +export const de_DisassociateFleetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartImageBuilderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StartImageBuilderResult(data, context); - const response: StartImageBuilderCommandOutput = { + contents = _json(data); + const response: DisassociateFleetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4654,57 +2421,39 @@ export const de_StartImageBuilderCommand = async ( }; /** - * deserializeAws_json1_1StartImageBuilderCommandError + * deserializeAws_json1_1EnableUserCommand */ -const de_StartImageBuilderCommandError = async ( +export const de_EnableUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "IncompatibleImageException": - case "com.amazonaws.appstream#IncompatibleImageException": - throw await de_IncompatibleImageExceptionRes(parsedOutput, context); - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "ResourceNotAvailableException": - case "com.amazonaws.appstream#ResourceNotAvailableException": - throw await de_ResourceNotAvailableExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: EnableUserCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopAppBlockBuilderCommand + * deserializeAws_json1_1ExpireSessionCommand */ -export const de_StopAppBlockBuilderCommand = async ( +export const de_ExpireSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopAppBlockBuilderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StopAppBlockBuilderResult(data, context); - const response: StopAppBlockBuilderCommandOutput = { + contents = _json(data); + const response: ExpireSessionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4712,51 +2461,39 @@ export const de_StopAppBlockBuilderCommand = async ( }; /** - * deserializeAws_json1_1StopAppBlockBuilderCommandError + * deserializeAws_json1_1ListAssociatedFleetsCommand */ -const de_StopAppBlockBuilderCommandError = async ( +export const de_ListAssociatedFleetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListAssociatedFleetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopFleetCommand + * deserializeAws_json1_1ListAssociatedStacksCommand */ -export const de_StopFleetCommand = async ( +export const de_ListAssociatedStacksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopFleetCommandOutput = { + const response: ListAssociatedStacksCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4764,48 +2501,39 @@ export const de_StopFleetCommand = async ( }; /** - * deserializeAws_json1_1StopFleetCommandError + * deserializeAws_json1_1ListEntitledApplicationsCommand */ -const de_StopFleetCommandError = async ( +export const de_ListEntitledApplicationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListEntitledApplicationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopImageBuilderCommand + * deserializeAws_json1_1ListTagsForResourceCommand */ -export const de_StopImageBuilderCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopImageBuilderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StopImageBuilderResult(data, context); - const response: StopImageBuilderCommandOutput = { + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4813,51 +2541,39 @@ export const de_StopImageBuilderCommand = async ( }; /** - * deserializeAws_json1_1StopImageBuilderCommandError + * deserializeAws_json1_1StartAppBlockBuilderCommand */ -const de_StopImageBuilderCommandError = async ( +export const de_StartAppBlockBuilderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StartAppBlockBuilderResult(data, context); + const response: StartAppBlockBuilderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1StartFleetCommand */ -export const de_TagResourceCommand = async ( +export const de_StartFleetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: StartFleetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4865,51 +2581,39 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1StartImageBuilderCommand */ -const de_TagResourceCommandError = async ( +export const de_StartImageBuilderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StartImageBuilderResult(data, context); + const response: StartImageBuilderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UntagResourceCommand + * deserializeAws_json1_1StopAppBlockBuilderCommand */ -export const de_UntagResourceCommand = async ( +export const de_StopAppBlockBuilderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: UntagResourceCommandOutput = { + contents = de_StopAppBlockBuilderResult(data, context); + const response: StopAppBlockBuilderCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4917,45 +2621,39 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserializeAws_json1_1StopFleetCommand */ -const de_UntagResourceCommandError = async ( +export const de_StopFleetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StopFleetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateAppBlockBuilderCommand + * deserializeAws_json1_1StopImageBuilderCommand */ -export const de_UpdateAppBlockBuilderCommand = async ( +export const de_StopImageBuilderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateAppBlockBuilderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateAppBlockBuilderResult(data, context); - const response: UpdateAppBlockBuilderCommandOutput = { + contents = de_StopImageBuilderResult(data, context); + const response: StopImageBuilderCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4963,72 +2661,39 @@ export const de_UpdateAppBlockBuilderCommand = async ( }; /** - * deserializeAws_json1_1UpdateAppBlockBuilderCommandError + * deserializeAws_json1_1TagResourceCommand */ -const de_UpdateAppBlockBuilderCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.appstream#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "RequestLimitExceededException": - case "com.amazonaws.appstream#RequestLimitExceededException": - throw await de_RequestLimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appstream#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotAvailableException": - case "com.amazonaws.appstream#ResourceNotAvailableException": - throw await de_ResourceNotAvailableExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateApplicationCommand + * deserializeAws_json1_1UntagResourceCommand */ -export const de_UpdateApplicationCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateApplicationResult(data, context); - const response: UpdateApplicationCommandOutput = { + contents = _json(data); + const response: UntagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5036,51 +2701,39 @@ export const de_UpdateApplicationCommand = async ( }; /** - * deserializeAws_json1_1UpdateApplicationCommandError + * deserializeAws_json1_1UpdateAppBlockBuilderCommand */ -const de_UpdateApplicationCommandError = async ( +export const de_UpdateAppBlockBuilderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateAppBlockBuilderResult(data, context); + const response: UpdateAppBlockBuilderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateDirectoryConfigCommand + * deserializeAws_json1_1UpdateApplicationCommand */ -export const de_UpdateDirectoryConfigCommand = async ( +export const de_UpdateApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateDirectoryConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateDirectoryConfigResult(data, context); - const response: UpdateDirectoryConfigCommandOutput = { + contents = de_UpdateApplicationResult(data, context); + const response: UpdateApplicationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5088,41 +2741,23 @@ export const de_UpdateDirectoryConfigCommand = async ( }; /** - * deserializeAws_json1_1UpdateDirectoryConfigCommandError + * deserializeAws_json1_1UpdateDirectoryConfigCommand */ -const de_UpdateDirectoryConfigCommandError = async ( +export const de_UpdateDirectoryConfigCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.appstream#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appstream#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateDirectoryConfigResult(data, context); + const response: UpdateDirectoryConfigCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -5133,7 +2768,7 @@ export const de_UpdateEntitlementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateEntitlementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5145,41 +2780,6 @@ export const de_UpdateEntitlementCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateEntitlementCommandError - */ -const de_UpdateEntitlementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntitlementNotFoundException": - case "com.amazonaws.appstream#EntitlementNotFoundException": - throw await de_EntitlementNotFoundExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateFleetCommand */ @@ -5188,7 +2788,7 @@ export const de_UpdateFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5200,62 +2800,6 @@ export const de_UpdateFleetCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateFleetCommandError - */ -const de_UpdateFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appstream#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "IncompatibleImageException": - case "com.amazonaws.appstream#IncompatibleImageException": - throw await de_IncompatibleImageExceptionRes(parsedOutput, context); - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.appstream#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.appstream#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.appstream#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "RequestLimitExceededException": - case "com.amazonaws.appstream#RequestLimitExceededException": - throw await de_RequestLimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appstream#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotAvailableException": - case "com.amazonaws.appstream#ResourceNotAvailableException": - throw await de_ResourceNotAvailableExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateImagePermissionsCommand */ @@ -5264,7 +2808,7 @@ export const de_UpdateImagePermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateImagePermissionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5276,38 +2820,6 @@ export const de_UpdateImagePermissionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateImagePermissionsCommandError - */ -const de_UpdateImagePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.appstream#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotAvailableException": - case "com.amazonaws.appstream#ResourceNotAvailableException": - throw await de_ResourceNotAvailableExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.appstream#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateStackCommand */ @@ -5316,7 +2828,7 @@ export const de_UpdateStackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateStackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5329,12 +2841,9 @@ export const de_UpdateStackCommand = async ( }; /** - * deserializeAws_json1_1UpdateStackCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5344,37 +2853,52 @@ const de_UpdateStackCommandError = async ( case "ConcurrentModificationException": case "com.amazonaws.appstream#ConcurrentModificationException": throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "IncompatibleImageException": - case "com.amazonaws.appstream#IncompatibleImageException": - throw await de_IncompatibleImageExceptionRes(parsedOutput, context); - case "InvalidAccountStatusException": - case "com.amazonaws.appstream#InvalidAccountStatusException": - throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); case "InvalidParameterCombinationException": case "com.amazonaws.appstream#InvalidParameterCombinationException": throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.appstream#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); case "LimitExceededException": case "com.amazonaws.appstream#LimitExceededException": throw await de_LimitExceededExceptionRes(parsedOutput, context); case "OperationNotPermittedException": case "com.amazonaws.appstream#OperationNotPermittedException": throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.appstream#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.appstream#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "EntitlementNotFoundException": + case "com.amazonaws.appstream#EntitlementNotFoundException": + throw await de_EntitlementNotFoundExceptionRes(parsedOutput, context); + case "IncompatibleImageException": + case "com.amazonaws.appstream#IncompatibleImageException": + throw await de_IncompatibleImageExceptionRes(parsedOutput, context); + case "InvalidAccountStatusException": + case "com.amazonaws.appstream#InvalidAccountStatusException": + throw await de_InvalidAccountStatusExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.appstream#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "ResourceNotAvailableException": + case "com.amazonaws.appstream#ResourceNotAvailableException": + throw await de_ResourceNotAvailableExceptionRes(parsedOutput, context); + case "InvalidRoleException": + case "com.amazonaws.appstream#InvalidRoleException": + throw await de_InvalidRoleExceptionRes(parsedOutput, context); + case "RequestLimitExceededException": + case "com.amazonaws.appstream#RequestLimitExceededException": + throw await de_RequestLimitExceededExceptionRes(parsedOutput, context); + case "EntitlementAlreadyExistsException": + case "com.amazonaws.appstream#EntitlementAlreadyExistsException": + throw await de_EntitlementAlreadyExistsExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.appstream#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-appsync/src/protocols/Aws_restJson1.ts b/clients/client-appsync/src/protocols/Aws_restJson1.ts index 96363234ae0d..4537ec1a9bf8 100644 --- a/clients/client-appsync/src/protocols/Aws_restJson1.ts +++ b/clients/client-appsync/src/protocols/Aws_restJson1.ts @@ -1537,7 +1537,7 @@ export const de_AssociateApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1550,41 +1550,6 @@ export const de_AssociateApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateApiCommandError - */ -const de_AssociateApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateMergedGraphqlApiCommand */ @@ -1593,7 +1558,7 @@ export const de_AssociateMergedGraphqlApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateMergedGraphqlApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1606,47 +1571,6 @@ export const de_AssociateMergedGraphqlApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateMergedGraphqlApiCommandError - */ -const de_AssociateMergedGraphqlApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appsync#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateSourceGraphqlApiCommand */ @@ -1655,7 +1579,7 @@ export const de_AssociateSourceGraphqlApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateSourceGraphqlApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1668,47 +1592,6 @@ export const de_AssociateSourceGraphqlApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateSourceGraphqlApiCommandError - */ -const de_AssociateSourceGraphqlApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appsync#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateApiCacheCommand */ @@ -1717,7 +1600,7 @@ export const de_CreateApiCacheCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateApiCacheCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1730,44 +1613,6 @@ export const de_CreateApiCacheCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApiCacheCommandError - */ -const de_CreateApiCacheCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateApiKeyCommand */ @@ -1776,7 +1621,7 @@ export const de_CreateApiKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateApiKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1789,50 +1634,6 @@ export const de_CreateApiKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApiKeyCommandError - */ -const de_CreateApiKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApiKeyLimitExceededException": - case "com.amazonaws.appsync#ApiKeyLimitExceededException": - throw await de_ApiKeyLimitExceededExceptionRes(parsedOutput, context); - case "ApiKeyValidityOutOfBoundsException": - case "com.amazonaws.appsync#ApiKeyValidityOutOfBoundsException": - throw await de_ApiKeyValidityOutOfBoundsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appsync#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDataSourceCommand */ @@ -1841,7 +1642,7 @@ export const de_CreateDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1854,44 +1655,6 @@ export const de_CreateDataSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDataSourceCommandError - */ -const de_CreateDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDomainNameCommand */ @@ -1900,7 +1663,7 @@ export const de_CreateDomainNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDomainNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1913,38 +1676,6 @@ export const de_CreateDomainNameCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDomainNameCommandError - */ -const de_CreateDomainNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFunctionCommand */ @@ -1953,7 +1684,7 @@ export const de_CreateFunctionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFunctionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1967,49 +1698,14 @@ export const de_CreateFunctionCommand = async ( }; /** - * deserializeAws_restJson1CreateFunctionCommandError + * deserializeAws_restJson1CreateGraphqlApiCommand */ -const de_CreateFunctionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateGraphqlApiCommand - */ -export const de_CreateGraphqlApiCommand = async ( +export const de_CreateGraphqlApiCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateGraphqlApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2022,47 +1718,6 @@ export const de_CreateGraphqlApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGraphqlApiCommandError - */ -const de_CreateGraphqlApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApiLimitExceededException": - case "com.amazonaws.appsync#ApiLimitExceededException": - throw await de_ApiLimitExceededExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appsync#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateResolverCommand */ @@ -2071,7 +1726,7 @@ export const de_CreateResolverCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateResolverCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2084,44 +1739,6 @@ export const de_CreateResolverCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateResolverCommandError - */ -const de_CreateResolverCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateTypeCommand */ @@ -2130,7 +1747,7 @@ export const de_CreateTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2143,44 +1760,6 @@ export const de_CreateTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTypeCommandError - */ -const de_CreateTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteApiCacheCommand */ @@ -2189,7 +1768,7 @@ export const de_DeleteApiCacheCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteApiCacheCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2198,44 +1777,6 @@ export const de_DeleteApiCacheCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteApiCacheCommandError - */ -const de_DeleteApiCacheCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteApiKeyCommand */ @@ -2244,7 +1785,7 @@ export const de_DeleteApiKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteApiKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2254,49 +1795,31 @@ export const de_DeleteApiKeyCommand = async ( }; /** - * deserializeAws_restJson1DeleteApiKeyCommandError + * deserializeAws_restJson1DeleteDataSourceCommand */ -const de_DeleteApiKeyCommandError = async ( +export const de_DeleteDataSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteDataSourceCommand + * deserializeAws_restJson1DeleteDomainNameCommand */ -export const de_DeleteDataSourceCommand = async ( +export const de_DeleteDomainNameCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2306,52 +1829,31 @@ export const de_DeleteDataSourceCommand = async ( }; /** - * deserializeAws_restJson1DeleteDataSourceCommandError + * deserializeAws_restJson1DeleteFunctionCommand */ -const de_DeleteDataSourceCommandError = async ( +export const de_DeleteFunctionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteDomainNameCommand + * deserializeAws_restJson1DeleteGraphqlApiCommand */ -export const de_DeleteDomainNameCommand = async ( +export const de_DeleteGraphqlApiCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDomainNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2361,2379 +1863,815 @@ export const de_DeleteDomainNameCommand = async ( }; /** - * deserializeAws_restJson1DeleteDomainNameCommandError + * deserializeAws_restJson1DeleteResolverCommand */ -const de_DeleteDomainNameCommandError = async ( +export const de_DeleteResolverCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteFunctionCommand - */ -export const de_DeleteFunctionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFunctionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteFunctionCommandError - */ -const de_DeleteFunctionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteGraphqlApiCommand - */ -export const de_DeleteGraphqlApiCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGraphqlApiCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteGraphqlApiCommandError - */ -const de_DeleteGraphqlApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteResolverCommand - */ -export const de_DeleteResolverCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteResolverCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteResolverCommandError - */ -const de_DeleteResolverCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteTypeCommand - */ -export const de_DeleteTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTypeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteTypeCommandError - */ -const de_DeleteTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateApiCommand - */ -export const de_DisassociateApiCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateApiCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateApiCommandError - */ -const de_DisassociateApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateMergedGraphqlApiCommand - */ -export const de_DisassociateMergedGraphqlApiCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateMergedGraphqlApiCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - sourceApiAssociationStatus: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateMergedGraphqlApiCommandError - */ -const de_DisassociateMergedGraphqlApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateSourceGraphqlApiCommand - */ -export const de_DisassociateSourceGraphqlApiCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateSourceGraphqlApiCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - sourceApiAssociationStatus: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateSourceGraphqlApiCommandError - */ -const de_DisassociateSourceGraphqlApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1EvaluateCodeCommand - */ -export const de_EvaluateCodeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EvaluateCodeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - error: _json, - evaluationResult: __expectString, - logs: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1EvaluateCodeCommandError - */ -const de_EvaluateCodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1EvaluateMappingTemplateCommand - */ -export const de_EvaluateMappingTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EvaluateMappingTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - error: _json, - evaluationResult: __expectString, - logs: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1EvaluateMappingTemplateCommandError - */ -const de_EvaluateMappingTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1FlushApiCacheCommand - */ -export const de_FlushApiCacheCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_FlushApiCacheCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1FlushApiCacheCommandError - */ -const de_FlushApiCacheCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetApiAssociationCommand - */ -export const de_GetApiAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApiAssociationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - apiAssociation: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetApiAssociationCommandError - */ -const de_GetApiAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetApiCacheCommand - */ -export const de_GetApiCacheCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApiCacheCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - apiCache: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetApiCacheCommandError - */ -const de_GetApiCacheCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDataSourceCommand - */ -export const de_GetDataSourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataSourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - dataSource: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDataSourceCommandError - */ -const de_GetDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDataSourceIntrospectionCommand - */ -export const de_GetDataSourceIntrospectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataSourceIntrospectionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - introspectionId: __expectString, - introspectionResult: (_) => de_DataSourceIntrospectionResult(_, context), - introspectionStatus: __expectString, - introspectionStatusDetail: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDataSourceIntrospectionCommandError - */ -const de_GetDataSourceIntrospectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDomainNameCommand - */ -export const de_GetDomainNameCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDomainNameCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - domainNameConfig: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDomainNameCommandError - */ -const de_GetDomainNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFunctionCommand - */ -export const de_GetFunctionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFunctionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - functionConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFunctionCommandError - */ -const de_GetFunctionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetGraphqlApiCommand - */ -export const de_GetGraphqlApiCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGraphqlApiCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - graphqlApi: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetGraphqlApiCommandError - */ -const de_GetGraphqlApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetIntrospectionSchemaCommand - */ -export const de_GetIntrospectionSchemaCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIntrospectionSchemaCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: any = await collectBody(output.body, context); - contents.schema = data; - return contents; -}; - -/** - * deserializeAws_restJson1GetIntrospectionSchemaCommandError - */ -const de_GetIntrospectionSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GraphQLSchemaException": - case "com.amazonaws.appsync#GraphQLSchemaException": - throw await de_GraphQLSchemaExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetResolverCommand - */ -export const de_GetResolverCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResolverCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - resolver: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetResolverCommandError - */ -const de_GetResolverCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSchemaCreationStatusCommand - */ -export const de_GetSchemaCreationStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSchemaCreationStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - details: __expectString, - status: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1GetSchemaCreationStatusCommandError - */ -const de_GetSchemaCreationStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSourceApiAssociationCommand + * deserializeAws_restJson1DeleteTypeCommand */ -export const de_GetSourceApiAssociationCommand = async ( +export const de_DeleteTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSourceApiAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - sourceApiAssociation: (_) => de_SourceApiAssociation(_, context), - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1GetSourceApiAssociationCommandError - */ -const de_GetSourceApiAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetTypeCommand + * deserializeAws_restJson1DisassociateApiCommand */ -export const de_GetTypeCommand = async ( +export const de_DisassociateApiCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - type: _json, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1GetTypeCommandError - */ -const de_GetTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListApiKeysCommand + * deserializeAws_restJson1DisassociateMergedGraphqlApiCommand */ -export const de_ListApiKeysCommand = async ( +export const de_DisassociateMergedGraphqlApiCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApiKeysCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - apiKeys: _json, - nextToken: __expectString, + sourceApiAssociationStatus: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListApiKeysCommandError - */ -const de_ListApiKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDataSourcesCommand + * deserializeAws_restJson1DisassociateSourceGraphqlApiCommand */ -export const de_ListDataSourcesCommand = async ( +export const de_DisassociateSourceGraphqlApiCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataSourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - dataSources: _json, - nextToken: __expectString, + sourceApiAssociationStatus: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListDataSourcesCommandError - */ -const de_ListDataSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDomainNamesCommand + * deserializeAws_restJson1EvaluateCodeCommand */ -export const de_ListDomainNamesCommand = async ( +export const de_EvaluateCodeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDomainNamesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - domainNameConfigs: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDomainNamesCommandError - */ -const de_ListDomainNamesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + error: _json, + evaluationResult: __expectString, + logs: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListFunctionsCommand + * deserializeAws_restJson1EvaluateMappingTemplateCommand */ -export const de_ListFunctionsCommand = async ( +export const de_EvaluateMappingTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFunctionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - functions: _json, - nextToken: __expectString, + error: _json, + evaluationResult: __expectString, + logs: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListFunctionsCommandError + * deserializeAws_restJson1FlushApiCacheCommand */ -const de_ListFunctionsCommandError = async ( +export const de_FlushApiCacheCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListGraphqlApisCommand + * deserializeAws_restJson1GetApiAssociationCommand */ -export const de_ListGraphqlApisCommand = async ( +export const de_GetApiAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGraphqlApisCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - graphqlApis: _json, - nextToken: __expectString, + apiAssociation: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListGraphqlApisCommandError + * deserializeAws_restJson1GetApiCacheCommand */ -const de_ListGraphqlApisCommandError = async ( +export const de_GetApiCacheCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + apiCache: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListResolversCommand + * deserializeAws_restJson1GetDataSourceCommand */ -export const de_ListResolversCommand = async ( +export const de_GetDataSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResolversCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - resolvers: _json, + dataSource: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListResolversCommandError + * deserializeAws_restJson1GetDataSourceIntrospectionCommand */ -const de_ListResolversCommandError = async ( +export const de_GetDataSourceIntrospectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + introspectionId: __expectString, + introspectionResult: (_) => de_DataSourceIntrospectionResult(_, context), + introspectionStatus: __expectString, + introspectionStatusDetail: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListResolversByFunctionCommand + * deserializeAws_restJson1GetDomainNameCommand */ -export const de_ListResolversByFunctionCommand = async ( +export const de_GetDomainNameCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResolversByFunctionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - resolvers: _json, + domainNameConfig: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListResolversByFunctionCommandError + * deserializeAws_restJson1GetFunctionCommand */ -const de_ListResolversByFunctionCommandError = async ( +export const de_GetFunctionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + functionConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListSourceApiAssociationsCommand + * deserializeAws_restJson1GetGraphqlApiCommand */ -export const de_ListSourceApiAssociationsCommand = async ( +export const de_GetGraphqlApiCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSourceApiAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - sourceApiAssociationSummaries: _json, + graphqlApi: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSourceApiAssociationsCommandError + * deserializeAws_restJson1GetIntrospectionSchemaCommand */ -const de_ListSourceApiAssociationsCommandError = async ( +export const de_GetIntrospectionSchemaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: any = await collectBody(output.body, context); + contents.schema = data; + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1GetResolverCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_GetResolverCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + resolver: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetSchemaCreationStatusCommand + */ +export const de_GetSchemaCreationStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + details: __expectString, + status: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1GetSourceApiAssociationCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_GetSourceApiAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appsync#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + sourceApiAssociation: (_) => de_SourceApiAssociation(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTypesCommand + * deserializeAws_restJson1GetTypeCommand */ -export const de_ListTypesCommand = async ( +export const de_GetTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - types: _json, + type: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTypesCommandError + * deserializeAws_restJson1ListApiKeysCommand */ -const de_ListTypesCommandError = async ( +export const de_ListApiKeysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + apiKeys: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTypesByAssociationCommand + * deserializeAws_restJson1ListDataSourcesCommand */ -export const de_ListTypesByAssociationCommand = async ( +export const de_ListDataSourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTypesByAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + dataSources: _json, nextToken: __expectString, - types: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTypesByAssociationCommandError + * deserializeAws_restJson1ListDomainNamesCommand */ -const de_ListTypesByAssociationCommandError = async ( +export const de_ListDomainNamesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + domainNameConfigs: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartDataSourceIntrospectionCommand + * deserializeAws_restJson1ListFunctionsCommand */ -export const de_StartDataSourceIntrospectionCommand = async ( +export const de_ListFunctionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartDataSourceIntrospectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - introspectionId: __expectString, - introspectionStatus: __expectString, - introspectionStatusDetail: __expectString, + functions: _json, + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartDataSourceIntrospectionCommandError + * deserializeAws_restJson1ListGraphqlApisCommand */ -const de_StartDataSourceIntrospectionCommandError = async ( +export const de_ListGraphqlApisCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + graphqlApis: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartSchemaCreationCommand + * deserializeAws_restJson1ListResolversCommand */ -export const de_StartSchemaCreationCommand = async ( +export const de_ListResolversCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartSchemaCreationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - status: __expectString, + nextToken: __expectString, + resolvers: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartSchemaCreationCommandError + * deserializeAws_restJson1ListResolversByFunctionCommand */ -const de_StartSchemaCreationCommandError = async ( +export const de_ListResolversByFunctionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + resolvers: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartSchemaMergeCommand + * deserializeAws_restJson1ListSourceApiAssociationsCommand */ -export const de_StartSchemaMergeCommand = async ( +export const de_ListSourceApiAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartSchemaMergeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - sourceApiAssociationStatus: __expectString, + nextToken: __expectString, + sourceApiAssociationSummaries: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartSchemaMergeCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_StartSchemaMergeCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListTypesCommand */ -export const de_TagResourceCommand = async ( +export const de_ListTypesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + types: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1ListTypesByAssociationCommand */ -const de_TagResourceCommandError = async ( +export const de_ListTypesByAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appsync#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + types: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1StartDataSourceIntrospectionCommand */ -export const de_UntagResourceCommand = async ( +export const de_StartDataSourceIntrospectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + introspectionId: __expectString, + introspectionStatus: __expectString, + introspectionStatusDetail: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1StartSchemaCreationCommand */ -const de_UntagResourceCommandError = async ( +export const de_StartSchemaCreationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appsync#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateApiCacheCommand + * deserializeAws_restJson1StartSchemaMergeCommand */ -export const de_UpdateApiCacheCommand = async ( +export const de_StartSchemaMergeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApiCacheCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - apiCache: _json, + sourceApiAssociationStatus: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateApiCacheCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_UpdateApiCacheCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateApiKeyCommand + * deserializeAws_restJson1UntagResourceCommand */ -export const de_UpdateApiKeyCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApiKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - apiKey: _json, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1UpdateApiKeyCommandError + * deserializeAws_restJson1UpdateApiCacheCommand */ -const de_UpdateApiKeyCommandError = async ( +export const de_UpdateApiCacheCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApiKeyValidityOutOfBoundsException": - case "com.amazonaws.appsync#ApiKeyValidityOutOfBoundsException": - throw await de_ApiKeyValidityOutOfBoundsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.appsync#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + apiCache: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateDataSourceCommand + * deserializeAws_restJson1UpdateApiKeyCommand */ -export const de_UpdateDataSourceCommand = async ( +export const de_UpdateApiKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - dataSource: _json, + apiKey: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateDataSourceCommandError + * deserializeAws_restJson1UpdateDataSourceCommand */ -const de_UpdateDataSourceCommandError = async ( +export const de_UpdateDataSourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + dataSource: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4744,7 +2682,7 @@ export const de_UpdateDomainNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDomainNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4757,44 +2695,6 @@ export const de_UpdateDomainNameCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDomainNameCommandError - */ -const de_UpdateDomainNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFunctionCommand */ @@ -4803,7 +2703,7 @@ export const de_UpdateFunctionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFunctionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4816,41 +2716,6 @@ export const de_UpdateFunctionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFunctionCommandError - */ -const de_UpdateFunctionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateGraphqlApiCommand */ @@ -4859,7 +2724,7 @@ export const de_UpdateGraphqlApiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGraphqlApiCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4872,47 +2737,6 @@ export const de_UpdateGraphqlApiCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateGraphqlApiCommandError - */ -const de_UpdateGraphqlApiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.appsync#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateResolverCommand */ @@ -4921,7 +2745,7 @@ export const de_UpdateResolverCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateResolverCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4934,44 +2758,6 @@ export const de_UpdateResolverCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateResolverCommandError - */ -const de_UpdateResolverCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSourceApiAssociationCommand */ @@ -4980,7 +2766,7 @@ export const de_UpdateSourceApiAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSourceApiAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4993,44 +2779,6 @@ export const de_UpdateSourceApiAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSourceApiAssociationCommandError - */ -const de_UpdateSourceApiAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.appsync#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.appsync#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.appsync#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.appsync#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTypeCommand */ @@ -5039,7 +2787,7 @@ export const de_UpdateTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5053,40 +2801,55 @@ export const de_UpdateTypeCommand = async ( }; /** - * deserializeAws_restJson1UpdateTypeCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.appsync#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); case "BadRequestException": case "com.amazonaws.appsync#BadRequestException": throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.appsync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); case "InternalFailureException": case "com.amazonaws.appsync#InternalFailureException": throw await de_InternalFailureExceptionRes(parsedOutput, context); case "NotFoundException": case "com.amazonaws.appsync#NotFoundException": throw await de_NotFoundExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.appsync#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.appsync#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "UnauthorizedException": case "com.amazonaws.appsync#UnauthorizedException": throw await de_UnauthorizedExceptionRes(parsedOutput, context); + case "ApiKeyLimitExceededException": + case "com.amazonaws.appsync#ApiKeyLimitExceededException": + throw await de_ApiKeyLimitExceededExceptionRes(parsedOutput, context); + case "ApiKeyValidityOutOfBoundsException": + case "com.amazonaws.appsync#ApiKeyValidityOutOfBoundsException": + throw await de_ApiKeyValidityOutOfBoundsExceptionRes(parsedOutput, context); + case "ApiLimitExceededException": + case "com.amazonaws.appsync#ApiLimitExceededException": + throw await de_ApiLimitExceededExceptionRes(parsedOutput, context); + case "GraphQLSchemaException": + case "com.amazonaws.appsync#GraphQLSchemaException": + throw await de_GraphQLSchemaExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-arc-zonal-shift/src/protocols/Aws_restJson1.ts b/clients/client-arc-zonal-shift/src/protocols/Aws_restJson1.ts index c43314d1e891..67ed045f5c97 100644 --- a/clients/client-arc-zonal-shift/src/protocols/Aws_restJson1.ts +++ b/clients/client-arc-zonal-shift/src/protocols/Aws_restJson1.ts @@ -305,7 +305,7 @@ export const de_CancelZonalShiftCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelZonalShiftCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -324,47 +324,6 @@ export const de_CancelZonalShiftCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelZonalShiftCommandError - */ -const de_CancelZonalShiftCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.arczonalshift#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.arczonalshift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.arczonalshift#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.arczonalshift#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.arczonalshift#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.arczonalshift#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePracticeRunConfigurationCommand */ @@ -373,7 +332,7 @@ export const de_CreatePracticeRunConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreatePracticeRunConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -389,47 +348,6 @@ export const de_CreatePracticeRunConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePracticeRunConfigurationCommandError - */ -const de_CreatePracticeRunConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.arczonalshift#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.arczonalshift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.arczonalshift#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.arczonalshift#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.arczonalshift#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.arczonalshift#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePracticeRunConfigurationCommand */ @@ -438,7 +356,7 @@ export const de_DeletePracticeRunConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePracticeRunConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -453,47 +371,6 @@ export const de_DeletePracticeRunConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePracticeRunConfigurationCommandError - */ -const de_DeletePracticeRunConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.arczonalshift#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.arczonalshift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.arczonalshift#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.arczonalshift#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.arczonalshift#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.arczonalshift#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetManagedResourceCommand */ @@ -502,7 +379,7 @@ export const de_GetManagedResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetManagedResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -521,44 +398,6 @@ export const de_GetManagedResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetManagedResourceCommandError - */ -const de_GetManagedResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.arczonalshift#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.arczonalshift#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.arczonalshift#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.arczonalshift#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.arczonalshift#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAutoshiftsCommand */ @@ -567,7 +406,7 @@ export const de_ListAutoshiftsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAutoshiftsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -581,41 +420,6 @@ export const de_ListAutoshiftsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAutoshiftsCommandError - */ -const de_ListAutoshiftsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.arczonalshift#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.arczonalshift#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.arczonalshift#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.arczonalshift#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListManagedResourcesCommand */ @@ -624,7 +428,7 @@ export const de_ListManagedResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListManagedResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -638,41 +442,6 @@ export const de_ListManagedResourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListManagedResourcesCommandError - */ -const de_ListManagedResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.arczonalshift#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.arczonalshift#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.arczonalshift#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.arczonalshift#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListZonalShiftsCommand */ @@ -681,7 +450,7 @@ export const de_ListZonalShiftsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListZonalShiftsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -695,41 +464,6 @@ export const de_ListZonalShiftsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListZonalShiftsCommandError - */ -const de_ListZonalShiftsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.arczonalshift#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.arczonalshift#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.arczonalshift#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.arczonalshift#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartZonalShiftCommand */ @@ -738,7 +472,7 @@ export const de_StartZonalShiftCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_StartZonalShiftCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -757,47 +491,6 @@ export const de_StartZonalShiftCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartZonalShiftCommandError - */ -const de_StartZonalShiftCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.arczonalshift#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.arczonalshift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.arczonalshift#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.arczonalshift#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.arczonalshift#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.arczonalshift#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePracticeRunConfigurationCommand */ @@ -806,7 +499,7 @@ export const de_UpdatePracticeRunConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePracticeRunConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -822,47 +515,6 @@ export const de_UpdatePracticeRunConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePracticeRunConfigurationCommandError - */ -const de_UpdatePracticeRunConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.arczonalshift#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.arczonalshift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.arczonalshift#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.arczonalshift#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.arczonalshift#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.arczonalshift#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateZonalAutoshiftConfigurationCommand */ @@ -871,7 +523,7 @@ export const de_UpdateZonalAutoshiftConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateZonalAutoshiftConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -885,47 +537,6 @@ export const de_UpdateZonalAutoshiftConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateZonalAutoshiftConfigurationCommandError - */ -const de_UpdateZonalAutoshiftConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.arczonalshift#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.arczonalshift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.arczonalshift#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.arczonalshift#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.arczonalshift#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.arczonalshift#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateZonalShiftCommand */ @@ -934,7 +545,7 @@ export const de_UpdateZonalShiftCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateZonalShiftCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -954,12 +565,9 @@ export const de_UpdateZonalShiftCommand = async ( }; /** - * deserializeAws_restJson1UpdateZonalShiftCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateZonalShiftCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -990,7 +598,7 @@ const de_UpdateZonalShiftCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-athena/src/protocols/Aws_json1_1.ts b/clients/client-athena/src/protocols/Aws_json1_1.ts index 2bc683be3c18..b9bfd74a8740 100644 --- a/clients/client-athena/src/protocols/Aws_json1_1.ts +++ b/clients/client-athena/src/protocols/Aws_json1_1.ts @@ -1210,7 +1210,7 @@ export const de_BatchGetNamedQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetNamedQueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1222,35 +1222,6 @@ export const de_BatchGetNamedQueryCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetNamedQueryCommandError - */ -const de_BatchGetNamedQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetPreparedStatementCommand */ @@ -1259,7 +1230,7 @@ export const de_BatchGetPreparedStatementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetPreparedStatementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1271,35 +1242,6 @@ export const de_BatchGetPreparedStatementCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetPreparedStatementCommandError - */ -const de_BatchGetPreparedStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetQueryExecutionCommand */ @@ -1308,7 +1250,7 @@ export const de_BatchGetQueryExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetQueryExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1320,35 +1262,6 @@ export const de_BatchGetQueryExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetQueryExecutionCommandError - */ -const de_BatchGetQueryExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelCapacityReservationCommand */ @@ -1357,7 +1270,7 @@ export const de_CancelCapacityReservationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelCapacityReservationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1369,35 +1282,6 @@ export const de_CancelCapacityReservationCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelCapacityReservationCommandError - */ -const de_CancelCapacityReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateCapacityReservationCommand */ @@ -1406,7 +1290,7 @@ export const de_CreateCapacityReservationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCapacityReservationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1418,35 +1302,6 @@ export const de_CreateCapacityReservationCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCapacityReservationCommandError - */ -const de_CreateCapacityReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDataCatalogCommand */ @@ -1455,7 +1310,7 @@ export const de_CreateDataCatalogCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDataCatalogCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1467,35 +1322,6 @@ export const de_CreateDataCatalogCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDataCatalogCommandError - */ -const de_CreateDataCatalogCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateNamedQueryCommand */ @@ -1504,7 +1330,7 @@ export const de_CreateNamedQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateNamedQueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1516,35 +1342,6 @@ export const de_CreateNamedQueryCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateNamedQueryCommandError - */ -const de_CreateNamedQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateNotebookCommand */ @@ -1553,7 +1350,7 @@ export const de_CreateNotebookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateNotebookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1565,38 +1362,6 @@ export const de_CreateNotebookCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateNotebookCommandError - */ -const de_CreateNotebookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.athena#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePreparedStatementCommand */ @@ -1605,7 +1370,7 @@ export const de_CreatePreparedStatementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePreparedStatementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1618,48 +1383,39 @@ export const de_CreatePreparedStatementCommand = async ( }; /** - * deserializeAws_json1_1CreatePreparedStatementCommandError + * deserializeAws_json1_1CreatePresignedNotebookUrlCommand */ -const de_CreatePreparedStatementCommandError = async ( +export const de_CreatePresignedNotebookUrlCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreatePresignedNotebookUrlCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreatePresignedNotebookUrlCommand + * deserializeAws_json1_1CreateWorkGroupCommand */ -export const de_CreatePresignedNotebookUrlCommand = async ( +export const de_CreateWorkGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreatePresignedNotebookUrlCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreatePresignedNotebookUrlCommandOutput = { + const response: CreateWorkGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1667,95 +1423,14 @@ export const de_CreatePresignedNotebookUrlCommand = async ( }; /** - * deserializeAws_json1_1CreatePresignedNotebookUrlCommandError + * deserializeAws_json1_1DeleteCapacityReservationCommand */ -const de_CreatePresignedNotebookUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateWorkGroupCommand - */ -export const de_CreateWorkGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateWorkGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateWorkGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateWorkGroupCommandError - */ -const de_CreateWorkGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteCapacityReservationCommand - */ -export const de_DeleteCapacityReservationCommand = async ( +export const de_DeleteCapacityReservationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCapacityReservationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1767,35 +1442,6 @@ export const de_DeleteCapacityReservationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteCapacityReservationCommandError - */ -const de_DeleteCapacityReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteDataCatalogCommand */ @@ -1804,7 +1450,7 @@ export const de_DeleteDataCatalogCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDataCatalogCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1816,35 +1462,6 @@ export const de_DeleteDataCatalogCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteDataCatalogCommandError - */ -const de_DeleteDataCatalogCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteNamedQueryCommand */ @@ -1853,7 +1470,7 @@ export const de_DeleteNamedQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNamedQueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1865,35 +1482,6 @@ export const de_DeleteNamedQueryCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteNamedQueryCommandError - */ -const de_DeleteNamedQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteNotebookCommand */ @@ -1902,7 +1490,7 @@ export const de_DeleteNotebookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNotebookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1914,38 +1502,6 @@ export const de_DeleteNotebookCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteNotebookCommandError - */ -const de_DeleteNotebookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.athena#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeletePreparedStatementCommand */ @@ -1954,7 +1510,7 @@ export const de_DeletePreparedStatementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePreparedStatementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1966,38 +1522,6 @@ export const de_DeletePreparedStatementCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeletePreparedStatementCommandError - */ -const de_DeletePreparedStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteWorkGroupCommand */ @@ -2006,7 +1530,7 @@ export const de_DeleteWorkGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteWorkGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2019,48 +1543,39 @@ export const de_DeleteWorkGroupCommand = async ( }; /** - * deserializeAws_json1_1DeleteWorkGroupCommandError + * deserializeAws_json1_1ExportNotebookCommand */ -const de_DeleteWorkGroupCommandError = async ( +export const de_ExportNotebookCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ExportNotebookOutput(data, context); + const response: ExportNotebookCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ExportNotebookCommand + * deserializeAws_json1_1GetCalculationExecutionCommand */ -export const de_ExportNotebookCommand = async ( +export const de_GetCalculationExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ExportNotebookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ExportNotebookOutput(data, context); - const response: ExportNotebookCommandOutput = { + contents = de_GetCalculationExecutionResponse(data, context); + const response: GetCalculationExecutionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2068,98 +1583,14 @@ export const de_ExportNotebookCommand = async ( }; /** - * deserializeAws_json1_1ExportNotebookCommandError + * deserializeAws_json1_1GetCalculationExecutionCodeCommand */ -const de_ExportNotebookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.athena#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCalculationExecutionCommand - */ -export const de_GetCalculationExecutionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetCalculationExecutionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetCalculationExecutionResponse(data, context); - const response: GetCalculationExecutionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetCalculationExecutionCommandError - */ -const de_GetCalculationExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCalculationExecutionCodeCommand - */ -export const de_GetCalculationExecutionCodeCommand = async ( +export const de_GetCalculationExecutionCodeCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCalculationExecutionCodeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2171,38 +1602,6 @@ export const de_GetCalculationExecutionCodeCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCalculationExecutionCodeCommandError - */ -const de_GetCalculationExecutionCodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetCalculationExecutionStatusCommand */ @@ -2211,7 +1610,7 @@ export const de_GetCalculationExecutionStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCalculationExecutionStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2223,38 +1622,6 @@ export const de_GetCalculationExecutionStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCalculationExecutionStatusCommandError - */ -const de_GetCalculationExecutionStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetCapacityAssignmentConfigurationCommand */ @@ -2263,7 +1630,7 @@ export const de_GetCapacityAssignmentConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCapacityAssignmentConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2275,35 +1642,6 @@ export const de_GetCapacityAssignmentConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCapacityAssignmentConfigurationCommandError - */ -const de_GetCapacityAssignmentConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetCapacityReservationCommand */ @@ -2312,7 +1650,7 @@ export const de_GetCapacityReservationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCapacityReservationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2324,35 +1662,6 @@ export const de_GetCapacityReservationCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCapacityReservationCommandError - */ -const de_GetCapacityReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetDatabaseCommand */ @@ -2361,7 +1670,7 @@ export const de_GetDatabaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDatabaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2373,38 +1682,6 @@ export const de_GetDatabaseCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetDatabaseCommandError - */ -const de_GetDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MetadataException": - case "com.amazonaws.athena#MetadataException": - throw await de_MetadataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetDataCatalogCommand */ @@ -2413,7 +1690,7 @@ export const de_GetDataCatalogCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDataCatalogCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2426,48 +1703,39 @@ export const de_GetDataCatalogCommand = async ( }; /** - * deserializeAws_json1_1GetDataCatalogCommandError + * deserializeAws_json1_1GetNamedQueryCommand */ -const de_GetDataCatalogCommandError = async ( +export const de_GetNamedQueryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetNamedQueryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetNamedQueryCommand + * deserializeAws_json1_1GetNotebookMetadataCommand */ -export const de_GetNamedQueryCommand = async ( +export const de_GetNotebookMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetNamedQueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetNamedQueryCommandOutput = { + contents = de_GetNotebookMetadataOutput(data, context); + const response: GetNotebookMetadataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2475,95 +1743,14 @@ export const de_GetNamedQueryCommand = async ( }; /** - * deserializeAws_json1_1GetNamedQueryCommandError + * deserializeAws_json1_1GetPreparedStatementCommand */ -const de_GetNamedQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetNotebookMetadataCommand - */ -export const de_GetNotebookMetadataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetNotebookMetadataCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetNotebookMetadataOutput(data, context); - const response: GetNotebookMetadataCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetNotebookMetadataCommandError - */ -const de_GetNotebookMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.athena#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetPreparedStatementCommand - */ -export const de_GetPreparedStatementCommand = async ( +export const de_GetPreparedStatementCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPreparedStatementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2575,38 +1762,6 @@ export const de_GetPreparedStatementCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetPreparedStatementCommandError - */ -const de_GetPreparedStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetQueryExecutionCommand */ @@ -2615,7 +1770,7 @@ export const de_GetQueryExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetQueryExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2627,35 +1782,6 @@ export const de_GetQueryExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetQueryExecutionCommandError - */ -const de_GetQueryExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetQueryResultsCommand */ @@ -2664,7 +1790,7 @@ export const de_GetQueryResultsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetQueryResultsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2676,38 +1802,6 @@ export const de_GetQueryResultsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetQueryResultsCommandError - */ -const de_GetQueryResultsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.athena#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetQueryRuntimeStatisticsCommand */ @@ -2716,7 +1810,7 @@ export const de_GetQueryRuntimeStatisticsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetQueryRuntimeStatisticsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2728,35 +1822,6 @@ export const de_GetQueryRuntimeStatisticsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetQueryRuntimeStatisticsCommandError - */ -const de_GetQueryRuntimeStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetSessionCommand */ @@ -2765,7 +1830,7 @@ export const de_GetSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSessionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2777,38 +1842,6 @@ export const de_GetSessionCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetSessionCommandError - */ -const de_GetSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetSessionStatusCommand */ @@ -2817,7 +1850,7 @@ export const de_GetSessionStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSessionStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2829,38 +1862,6 @@ export const de_GetSessionStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetSessionStatusCommandError - */ -const de_GetSessionStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetTableMetadataCommand */ @@ -2869,7 +1870,7 @@ export const de_GetTableMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTableMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2882,46 +1883,14 @@ export const de_GetTableMetadataCommand = async ( }; /** - * deserializeAws_json1_1GetTableMetadataCommandError + * deserializeAws_json1_1GetWorkGroupCommand */ -const de_GetTableMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MetadataException": - case "com.amazonaws.athena#MetadataException": - throw await de_MetadataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetWorkGroupCommand - */ -export const de_GetWorkGroupCommand = async ( +export const de_GetWorkGroupCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetWorkGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2933,35 +1902,6 @@ export const de_GetWorkGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetWorkGroupCommandError - */ -const de_GetWorkGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ImportNotebookCommand */ @@ -2970,7 +1910,7 @@ export const de_ImportNotebookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportNotebookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2982,38 +1922,6 @@ export const de_ImportNotebookCommand = async ( return response; }; -/** - * deserializeAws_json1_1ImportNotebookCommandError - */ -const de_ImportNotebookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.athena#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListApplicationDPUSizesCommand */ @@ -3022,7 +1930,7 @@ export const de_ListApplicationDPUSizesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListApplicationDPUSizesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3034,38 +1942,6 @@ export const de_ListApplicationDPUSizesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListApplicationDPUSizesCommandError - */ -const de_ListApplicationDPUSizesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.athena#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListCalculationExecutionsCommand */ @@ -3074,7 +1950,7 @@ export const de_ListCalculationExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListCalculationExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3086,38 +1962,6 @@ export const de_ListCalculationExecutionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListCalculationExecutionsCommandError - */ -const de_ListCalculationExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListCapacityReservationsCommand */ @@ -3126,7 +1970,7 @@ export const de_ListCapacityReservationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListCapacityReservationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3138,35 +1982,6 @@ export const de_ListCapacityReservationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListCapacityReservationsCommandError - */ -const de_ListCapacityReservationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListDatabasesCommand */ @@ -3175,7 +1990,7 @@ export const de_ListDatabasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListDatabasesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3187,38 +2002,6 @@ export const de_ListDatabasesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListDatabasesCommandError - */ -const de_ListDatabasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MetadataException": - case "com.amazonaws.athena#MetadataException": - throw await de_MetadataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListDataCatalogsCommand */ @@ -3227,7 +2010,7 @@ export const de_ListDataCatalogsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListDataCatalogsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3239,35 +2022,6 @@ export const de_ListDataCatalogsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListDataCatalogsCommandError - */ -const de_ListDataCatalogsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListEngineVersionsCommand */ @@ -3276,7 +2030,7 @@ export const de_ListEngineVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListEngineVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3289,48 +2043,39 @@ export const de_ListEngineVersionsCommand = async ( }; /** - * deserializeAws_json1_1ListEngineVersionsCommandError + * deserializeAws_json1_1ListExecutorsCommand */ -const de_ListEngineVersionsCommandError = async ( +export const de_ListExecutorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListExecutorsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListExecutorsCommand + * deserializeAws_json1_1ListNamedQueriesCommand */ -export const de_ListExecutorsCommand = async ( +export const de_ListNamedQueriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListExecutorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListExecutorsCommandOutput = { + const response: ListNamedQueriesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3338,95 +2083,14 @@ export const de_ListExecutorsCommand = async ( }; /** - * deserializeAws_json1_1ListExecutorsCommandError + * deserializeAws_json1_1ListNotebookMetadataCommand */ -const de_ListExecutorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListNamedQueriesCommand - */ -export const de_ListNamedQueriesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListNamedQueriesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListNamedQueriesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListNamedQueriesCommandError - */ -const de_ListNamedQueriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListNotebookMetadataCommand - */ -export const de_ListNotebookMetadataCommand = async ( +export const de_ListNotebookMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListNotebookMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3438,38 +2102,6 @@ export const de_ListNotebookMetadataCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListNotebookMetadataCommandError - */ -const de_ListNotebookMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.athena#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListNotebookSessionsCommand */ @@ -3478,7 +2110,7 @@ export const de_ListNotebookSessionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListNotebookSessionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3490,38 +2122,6 @@ export const de_ListNotebookSessionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListNotebookSessionsCommandError - */ -const de_ListNotebookSessionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPreparedStatementsCommand */ @@ -3530,7 +2130,7 @@ export const de_ListPreparedStatementsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPreparedStatementsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3542,35 +2142,6 @@ export const de_ListPreparedStatementsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPreparedStatementsCommandError - */ -const de_ListPreparedStatementsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListQueryExecutionsCommand */ @@ -3579,7 +2150,7 @@ export const de_ListQueryExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListQueryExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3591,35 +2162,6 @@ export const de_ListQueryExecutionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListQueryExecutionsCommandError - */ -const de_ListQueryExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListSessionsCommand */ @@ -3628,7 +2170,7 @@ export const de_ListSessionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSessionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3640,38 +2182,6 @@ export const de_ListSessionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSessionsCommandError - */ -const de_ListSessionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTableMetadataCommand */ @@ -3680,7 +2190,7 @@ export const de_ListTableMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTableMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3692,38 +2202,6 @@ export const de_ListTableMetadataCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTableMetadataCommandError - */ -const de_ListTableMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MetadataException": - case "com.amazonaws.athena#MetadataException": - throw await de_MetadataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -3732,7 +2210,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3745,46 +2223,14 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1ListWorkGroupsCommand */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListWorkGroupsCommand - */ -export const de_ListWorkGroupsCommand = async ( +export const de_ListWorkGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListWorkGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3796,35 +2242,6 @@ export const de_ListWorkGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListWorkGroupsCommandError - */ -const de_ListWorkGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutCapacityAssignmentConfigurationCommand */ @@ -3833,7 +2250,7 @@ export const de_PutCapacityAssignmentConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutCapacityAssignmentConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3845,35 +2262,6 @@ export const de_PutCapacityAssignmentConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutCapacityAssignmentConfigurationCommandError - */ -const de_PutCapacityAssignmentConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartCalculationExecutionCommand */ @@ -3882,7 +2270,7 @@ export const de_StartCalculationExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartCalculationExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3894,38 +2282,6 @@ export const de_StartCalculationExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartCalculationExecutionCommandError - */ -const de_StartCalculationExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartQueryExecutionCommand */ @@ -3934,7 +2290,7 @@ export const de_StartQueryExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartQueryExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3946,38 +2302,6 @@ export const de_StartQueryExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartQueryExecutionCommandError - */ -const de_StartQueryExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.athena#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartSessionCommand */ @@ -3986,7 +2310,7 @@ export const de_StartSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartSessionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3998,44 +2322,6 @@ export const de_StartSessionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartSessionCommandError - */ -const de_StartSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "SessionAlreadyExistsException": - case "com.amazonaws.athena#SessionAlreadyExistsException": - throw await de_SessionAlreadyExistsExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.athena#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopCalculationExecutionCommand */ @@ -4044,7 +2330,7 @@ export const de_StopCalculationExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopCalculationExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4056,38 +2342,6 @@ export const de_StopCalculationExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopCalculationExecutionCommandError - */ -const de_StopCalculationExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopQueryExecutionCommand */ @@ -4096,113 +2350,32 @@ export const de_StopQueryExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopQueryExecutionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StopQueryExecutionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StopQueryExecutionCommandError - */ -const de_StopQueryExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: TagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + let contents: any = {}; + contents = _json(data); + const response: StopQueryExecutionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TerminateSessionCommand + * deserializeAws_json1_1TagResourceCommand */ -export const de_TerminateSessionCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TerminateSessionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TerminateSessionCommandOutput = { + const response: TagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4210,35 +2383,23 @@ export const de_TerminateSessionCommand = async ( }; /** - * deserializeAws_json1_1TerminateSessionCommandError + * deserializeAws_json1_1TerminateSessionCommand */ -const de_TerminateSessionCommandError = async ( +export const de_TerminateSessionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TerminateSessionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -4249,7 +2410,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4261,38 +2422,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateCapacityReservationCommand */ @@ -4301,7 +2430,7 @@ export const de_UpdateCapacityReservationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateCapacityReservationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4313,35 +2442,6 @@ export const de_UpdateCapacityReservationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateCapacityReservationCommandError - */ -const de_UpdateCapacityReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDataCatalogCommand */ @@ -4350,7 +2450,7 @@ export const de_UpdateDataCatalogCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDataCatalogCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4362,35 +2462,6 @@ export const de_UpdateDataCatalogCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDataCatalogCommandError - */ -const de_UpdateDataCatalogCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateNamedQueryCommand */ @@ -4399,7 +2470,7 @@ export const de_UpdateNamedQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateNamedQueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4411,35 +2482,6 @@ export const de_UpdateNamedQueryCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateNamedQueryCommandError - */ -const de_UpdateNamedQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateNotebookCommand */ @@ -4448,7 +2490,7 @@ export const de_UpdateNotebookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateNotebookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4460,38 +2502,6 @@ export const de_UpdateNotebookCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateNotebookCommandError - */ -const de_UpdateNotebookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.athena#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateNotebookMetadataCommand */ @@ -4500,7 +2510,7 @@ export const de_UpdateNotebookMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateNotebookMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4512,38 +2522,6 @@ export const de_UpdateNotebookMetadataCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateNotebookMetadataCommandError - */ -const de_UpdateNotebookMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.athena#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdatePreparedStatementCommand */ @@ -4552,7 +2530,7 @@ export const de_UpdatePreparedStatementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePreparedStatementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4564,38 +2542,6 @@ export const de_UpdatePreparedStatementCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdatePreparedStatementCommandError - */ -const de_UpdatePreparedStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.athena#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.athena#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.athena#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateWorkGroupCommand */ @@ -4604,7 +2550,7 @@ export const de_UpdateWorkGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateWorkGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4617,12 +2563,9 @@ export const de_UpdateWorkGroupCommand = async ( }; /** - * deserializeAws_json1_1UpdateWorkGroupCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateWorkGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4635,13 +2578,25 @@ const de_UpdateWorkGroupCommandError = async ( case "InvalidRequestException": case "com.amazonaws.athena#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.athena#TooManyRequestsException": + throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.athena#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "MetadataException": + case "com.amazonaws.athena#MetadataException": + throw await de_MetadataExceptionRes(parsedOutput, context); + case "SessionAlreadyExistsException": + case "com.amazonaws.athena#SessionAlreadyExistsException": + throw await de_SessionAlreadyExistsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-auditmanager/src/protocols/Aws_restJson1.ts b/clients/client-auditmanager/src/protocols/Aws_restJson1.ts index e40c72b2ebf9..485283138277 100644 --- a/clients/client-auditmanager/src/protocols/Aws_restJson1.ts +++ b/clients/client-auditmanager/src/protocols/Aws_restJson1.ts @@ -1564,7 +1564,7 @@ export const de_AssociateAssessmentReportEvidenceFolderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateAssessmentReportEvidenceFolderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1573,41 +1573,6 @@ export const de_AssociateAssessmentReportEvidenceFolderCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateAssessmentReportEvidenceFolderCommandError - */ -const de_AssociateAssessmentReportEvidenceFolderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchAssociateAssessmentReportEvidenceCommand */ @@ -1616,7 +1581,7 @@ export const de_BatchAssociateAssessmentReportEvidenceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchAssociateAssessmentReportEvidenceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1630,41 +1595,6 @@ export const de_BatchAssociateAssessmentReportEvidenceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchAssociateAssessmentReportEvidenceCommandError - */ -const de_BatchAssociateAssessmentReportEvidenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchCreateDelegationByAssessmentCommand */ @@ -1673,7 +1603,7 @@ export const de_BatchCreateDelegationByAssessmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchCreateDelegationByAssessmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1687,41 +1617,6 @@ export const de_BatchCreateDelegationByAssessmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchCreateDelegationByAssessmentCommandError - */ -const de_BatchCreateDelegationByAssessmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDeleteDelegationByAssessmentCommand */ @@ -1730,7 +1625,7 @@ export const de_BatchDeleteDelegationByAssessmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDeleteDelegationByAssessmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1743,41 +1638,6 @@ export const de_BatchDeleteDelegationByAssessmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDeleteDelegationByAssessmentCommandError - */ -const de_BatchDeleteDelegationByAssessmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDisassociateAssessmentReportEvidenceCommand */ @@ -1786,7 +1646,7 @@ export const de_BatchDisassociateAssessmentReportEvidenceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDisassociateAssessmentReportEvidenceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1800,41 +1660,6 @@ export const de_BatchDisassociateAssessmentReportEvidenceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDisassociateAssessmentReportEvidenceCommandError - */ -const de_BatchDisassociateAssessmentReportEvidenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchImportEvidenceToAssessmentControlCommand */ @@ -1843,7 +1668,7 @@ export const de_BatchImportEvidenceToAssessmentControlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchImportEvidenceToAssessmentControlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1856,44 +1681,6 @@ export const de_BatchImportEvidenceToAssessmentControlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchImportEvidenceToAssessmentControlCommandError - */ -const de_BatchImportEvidenceToAssessmentControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.auditmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAssessmentCommand */ @@ -1902,7 +1689,7 @@ export const de_CreateAssessmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAssessmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1916,1753 +1703,309 @@ export const de_CreateAssessmentCommand = async ( }; /** - * deserializeAws_restJson1CreateAssessmentCommandError + * deserializeAws_restJson1CreateAssessmentFrameworkCommand */ -const de_CreateAssessmentCommandError = async ( +export const de_CreateAssessmentFrameworkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.auditmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + framework: (_) => de_Framework(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateAssessmentFrameworkCommand + * deserializeAws_restJson1CreateAssessmentReportCommand */ -export const de_CreateAssessmentFrameworkCommand = async ( +export const de_CreateAssessmentReportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAssessmentFrameworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - framework: (_) => de_Framework(_, context), + assessmentReport: (_) => de_AssessmentReport(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateAssessmentFrameworkCommandError + * deserializeAws_restJson1CreateControlCommand */ -const de_CreateAssessmentFrameworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.auditmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateAssessmentReportCommand - */ -export const de_CreateAssessmentReportCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAssessmentReportCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - assessmentReport: (_) => de_AssessmentReport(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateAssessmentReportCommandError - */ -const de_CreateAssessmentReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateControlCommand - */ -export const de_CreateControlCommand = async ( +export const de_CreateControlCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateControlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - control: (_) => de_Control(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateControlCommandError - */ -const de_CreateControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.auditmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAssessmentCommand - */ -export const de_DeleteAssessmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAssessmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteAssessmentCommandError - */ -const de_DeleteAssessmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAssessmentFrameworkCommand - */ -export const de_DeleteAssessmentFrameworkCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAssessmentFrameworkCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteAssessmentFrameworkCommandError - */ -const de_DeleteAssessmentFrameworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAssessmentFrameworkShareCommand - */ -export const de_DeleteAssessmentFrameworkShareCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAssessmentFrameworkShareCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteAssessmentFrameworkShareCommandError - */ -const de_DeleteAssessmentFrameworkShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAssessmentReportCommand - */ -export const de_DeleteAssessmentReportCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAssessmentReportCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteAssessmentReportCommandError - */ -const de_DeleteAssessmentReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteControlCommand - */ -export const de_DeleteControlCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteControlCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteControlCommandError - */ -const de_DeleteControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeregisterAccountCommand - */ -export const de_DeregisterAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeregisterAccountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeregisterAccountCommandError - */ -const de_DeregisterAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeregisterOrganizationAdminAccountCommand - */ -export const de_DeregisterOrganizationAdminAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeregisterOrganizationAdminAccountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeregisterOrganizationAdminAccountCommandError - */ -const de_DeregisterOrganizationAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCommand - */ -export const de_DisassociateAssessmentReportEvidenceFolderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateAssessmentReportEvidenceFolderCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCommandError - */ -const de_DisassociateAssessmentReportEvidenceFolderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAccountStatusCommand - */ -export const de_GetAccountStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccountStatusCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAccountStatusCommandError - */ -const de_GetAccountStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAssessmentCommand - */ -export const de_GetAssessmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssessmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - assessment: (_) => de_Assessment(_, context), - userRole: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAssessmentCommandError - */ -const de_GetAssessmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAssessmentFrameworkCommand - */ -export const de_GetAssessmentFrameworkCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssessmentFrameworkCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - framework: (_) => de_Framework(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAssessmentFrameworkCommandError - */ -const de_GetAssessmentFrameworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAssessmentReportUrlCommand - */ -export const de_GetAssessmentReportUrlCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssessmentReportUrlCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - preSignedUrl: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAssessmentReportUrlCommandError - */ -const de_GetAssessmentReportUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetChangeLogsCommand - */ -export const de_GetChangeLogsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChangeLogsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - changeLogs: (_) => de_ChangeLogs(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetChangeLogsCommandError - */ -const de_GetChangeLogsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetControlCommand - */ -export const de_GetControlCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetControlCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - control: (_) => de_Control(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetControlCommandError - */ -const de_GetControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDelegationsCommand - */ -export const de_GetDelegationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDelegationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - delegations: (_) => de_DelegationMetadataList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDelegationsCommandError - */ -const de_GetDelegationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEvidenceCommand - */ -export const de_GetEvidenceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEvidenceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - evidence: (_) => de_Evidence(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEvidenceCommandError - */ -const de_GetEvidenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEvidenceByEvidenceFolderCommand - */ -export const de_GetEvidenceByEvidenceFolderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEvidenceByEvidenceFolderCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - evidence: (_) => de_EvidenceList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEvidenceByEvidenceFolderCommandError - */ -const de_GetEvidenceByEvidenceFolderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEvidenceFileUploadUrlCommand - */ -export const de_GetEvidenceFileUploadUrlCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEvidenceFileUploadUrlCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - evidenceFileName: __expectString, - uploadUrl: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEvidenceFileUploadUrlCommandError - */ -const de_GetEvidenceFileUploadUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.auditmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEvidenceFolderCommand - */ -export const de_GetEvidenceFolderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEvidenceFolderCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - evidenceFolder: (_) => de_AssessmentEvidenceFolder(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEvidenceFolderCommandError - */ -const de_GetEvidenceFolderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEvidenceFoldersByAssessmentCommand - */ -export const de_GetEvidenceFoldersByAssessmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEvidenceFoldersByAssessmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - evidenceFolders: (_) => de_AssessmentEvidenceFolders(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEvidenceFoldersByAssessmentCommandError - */ -const de_GetEvidenceFoldersByAssessmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEvidenceFoldersByAssessmentControlCommand - */ -export const de_GetEvidenceFoldersByAssessmentControlCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEvidenceFoldersByAssessmentControlCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - evidenceFolders: (_) => de_AssessmentEvidenceFolders(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEvidenceFoldersByAssessmentControlCommandError - */ -const de_GetEvidenceFoldersByAssessmentControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetInsightsCommand - */ -export const de_GetInsightsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInsightsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - insights: (_) => de_Insights(_, context), + control: (_) => de_Control(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetInsightsCommandError + * deserializeAws_restJson1DeleteAssessmentCommand */ -const de_GetInsightsCommandError = async ( +export const de_DeleteAssessmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetInsightsByAssessmentCommand + * deserializeAws_restJson1DeleteAssessmentFrameworkCommand */ -export const de_GetInsightsByAssessmentCommand = async ( +export const de_DeleteAssessmentFrameworkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInsightsByAssessmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - insights: (_) => de_InsightsByAssessment(_, context), - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1GetInsightsByAssessmentCommandError + * deserializeAws_restJson1DeleteAssessmentFrameworkShareCommand */ -const de_GetInsightsByAssessmentCommandError = async ( +export const de_DeleteAssessmentFrameworkShareCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetOrganizationAdminAccountCommand + * deserializeAws_restJson1DeleteAssessmentReportCommand */ -export const de_GetOrganizationAdminAccountCommand = async ( +export const de_DeleteAssessmentReportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOrganizationAdminAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - adminAccountId: __expectString, - organizationId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1GetOrganizationAdminAccountCommandError + * deserializeAws_restJson1DeleteControlCommand */ -const de_GetOrganizationAdminAccountCommandError = async ( +export const de_DeleteControlCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetServicesInScopeCommand + * deserializeAws_restJson1DeregisterAccountCommand */ -export const de_GetServicesInScopeCommand = async ( +export const de_DeregisterAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetServicesInScopeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - serviceMetadata: _json, + status: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetServicesInScopeCommandError + * deserializeAws_restJson1DeregisterOrganizationAdminAccountCommand */ -const de_GetServicesInScopeCommandError = async ( +export const de_DeregisterOrganizationAdminAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetSettingsCommand + * deserializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCommand */ -export const de_GetSettingsCommand = async ( +export const de_DisassociateAssessmentReportEvidenceFolderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - settings: _json, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1GetSettingsCommandError + * deserializeAws_restJson1GetAccountStatusCommand */ -const de_GetSettingsCommandError = async ( +export const de_GetAccountStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListAssessmentControlInsightsByControlDomainCommand + * deserializeAws_restJson1GetAssessmentCommand */ -export const de_ListAssessmentControlInsightsByControlDomainCommand = async ( +export const de_GetAssessmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssessmentControlInsightsByControlDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - controlInsightsByAssessment: (_) => de_ControlInsightsMetadataByAssessment(_, context), - nextToken: __expectString, + assessment: (_) => de_Assessment(_, context), + userRole: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAssessmentControlInsightsByControlDomainCommandError + * deserializeAws_restJson1GetAssessmentFrameworkCommand */ -const de_ListAssessmentControlInsightsByControlDomainCommandError = async ( +export const de_GetAssessmentFrameworkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + framework: (_) => de_Framework(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListAssessmentFrameworksCommand + * deserializeAws_restJson1GetAssessmentReportUrlCommand */ -export const de_ListAssessmentFrameworksCommand = async ( +export const de_GetAssessmentReportUrlCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssessmentFrameworksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - frameworkMetadataList: (_) => de_FrameworkMetadataList(_, context), - nextToken: __expectString, + preSignedUrl: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAssessmentFrameworksCommandError - */ -const de_ListAssessmentFrameworksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAssessmentFrameworkShareRequestsCommand + * deserializeAws_restJson1GetChangeLogsCommand */ -export const de_ListAssessmentFrameworkShareRequestsCommand = async ( +export const de_GetChangeLogsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssessmentFrameworkShareRequestsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - assessmentFrameworkShareRequests: (_) => de_AssessmentFrameworkShareRequestList(_, context), + changeLogs: (_) => de_ChangeLogs(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -3670,53 +2013,42 @@ export const de_ListAssessmentFrameworkShareRequestsCommand = async ( }; /** - * deserializeAws_restJson1ListAssessmentFrameworkShareRequestsCommandError + * deserializeAws_restJson1GetControlCommand */ -const de_ListAssessmentFrameworkShareRequestsCommandError = async ( +export const de_GetControlCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + control: (_) => de_Control(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListAssessmentReportsCommand + * deserializeAws_restJson1GetDelegationsCommand */ -export const de_ListAssessmentReportsCommand = async ( +export const de_GetDelegationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssessmentReportsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - assessmentReports: (_) => de_AssessmentReportsMetadata(_, context), + delegations: (_) => de_DelegationMetadataList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -3724,53 +2056,42 @@ export const de_ListAssessmentReportsCommand = async ( }; /** - * deserializeAws_restJson1ListAssessmentReportsCommandError + * deserializeAws_restJson1GetEvidenceCommand */ -const de_ListAssessmentReportsCommandError = async ( +export const de_GetEvidenceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + evidence: (_) => de_Evidence(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListAssessmentsCommand + * deserializeAws_restJson1GetEvidenceByEvidenceFolderCommand */ -export const de_ListAssessmentsCommand = async ( +export const de_GetEvidenceByEvidenceFolderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssessmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - assessmentMetadata: (_) => de_ListAssessmentMetadata(_, context), + evidence: (_) => de_EvidenceList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -3778,110 +2099,64 @@ export const de_ListAssessmentsCommand = async ( }; /** - * deserializeAws_restJson1ListAssessmentsCommandError - */ -const de_ListAssessmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListControlDomainInsightsCommand + * deserializeAws_restJson1GetEvidenceFileUploadUrlCommand */ -export const de_ListControlDomainInsightsCommand = async ( +export const de_GetEvidenceFileUploadUrlCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListControlDomainInsightsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - controlDomainInsights: (_) => de_ControlDomainInsightsList(_, context), - nextToken: __expectString, + evidenceFileName: __expectString, + uploadUrl: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListControlDomainInsightsCommandError + * deserializeAws_restJson1GetEvidenceFolderCommand */ -const de_ListControlDomainInsightsCommandError = async ( +export const de_GetEvidenceFolderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + evidenceFolder: (_) => de_AssessmentEvidenceFolder(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListControlDomainInsightsByAssessmentCommand + * deserializeAws_restJson1GetEvidenceFoldersByAssessmentCommand */ -export const de_ListControlDomainInsightsByAssessmentCommand = async ( +export const de_GetEvidenceFoldersByAssessmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListControlDomainInsightsByAssessmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - controlDomainInsights: (_) => de_ControlDomainInsightsList(_, context), + evidenceFolders: (_) => de_AssessmentEvidenceFolders(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -3889,692 +2164,534 @@ export const de_ListControlDomainInsightsByAssessmentCommand = async ( }; /** - * deserializeAws_restJson1ListControlDomainInsightsByAssessmentCommandError + * deserializeAws_restJson1GetEvidenceFoldersByAssessmentControlCommand */ -const de_ListControlDomainInsightsByAssessmentCommandError = async ( +export const de_GetEvidenceFoldersByAssessmentControlCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + evidenceFolders: (_) => de_AssessmentEvidenceFolders(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListControlInsightsByControlDomainCommand + * deserializeAws_restJson1GetInsightsCommand */ -export const de_ListControlInsightsByControlDomainCommand = async ( +export const de_GetInsightsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListControlInsightsByControlDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - controlInsightsMetadata: (_) => de_ControlInsightsMetadata(_, context), - nextToken: __expectString, + insights: (_) => de_Insights(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListControlInsightsByControlDomainCommandError - */ -const de_ListControlInsightsByControlDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListControlsCommand + * deserializeAws_restJson1GetInsightsByAssessmentCommand */ -export const de_ListControlsCommand = async ( +export const de_GetInsightsByAssessmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListControlsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - controlMetadataList: (_) => de_ControlMetadataList(_, context), - nextToken: __expectString, + insights: (_) => de_InsightsByAssessment(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListControlsCommandError + * deserializeAws_restJson1GetOrganizationAdminAccountCommand */ -const de_ListControlsCommandError = async ( +export const de_GetOrganizationAdminAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + adminAccountId: __expectString, + organizationId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListKeywordsForDataSourceCommand + * deserializeAws_restJson1GetServicesInScopeCommand */ -export const de_ListKeywordsForDataSourceCommand = async ( +export const de_GetServicesInScopeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKeywordsForDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - keywords: _json, - nextToken: __expectString, + serviceMetadata: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListKeywordsForDataSourceCommandError + * deserializeAws_restJson1GetSettingsCommand */ -const de_ListKeywordsForDataSourceCommandError = async ( +export const de_GetSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + settings: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListNotificationsCommand + * deserializeAws_restJson1ListAssessmentControlInsightsByControlDomainCommand */ -export const de_ListNotificationsCommand = async ( +export const de_ListAssessmentControlInsightsByControlDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNotificationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + controlInsightsByAssessment: (_) => de_ControlInsightsMetadataByAssessment(_, context), nextToken: __expectString, - notifications: (_) => de_Notifications(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListNotificationsCommandError + * deserializeAws_restJson1ListAssessmentFrameworksCommand */ -const de_ListNotificationsCommandError = async ( +export const de_ListAssessmentFrameworksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + frameworkMetadataList: (_) => de_FrameworkMetadataList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListAssessmentFrameworkShareRequestsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListAssessmentFrameworkShareRequestsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + assessmentFrameworkShareRequests: (_) => de_AssessmentFrameworkShareRequestList(_, context), + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListAssessmentReportsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListAssessmentReportsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + assessmentReports: (_) => de_AssessmentReportsMetadata(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RegisterAccountCommand + * deserializeAws_restJson1ListAssessmentsCommand */ -export const de_RegisterAccountCommand = async ( +export const de_ListAssessmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - status: __expectString, + assessmentMetadata: (_) => de_ListAssessmentMetadata(_, context), + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RegisterAccountCommandError + * deserializeAws_restJson1ListControlDomainInsightsCommand */ -const de_RegisterAccountCommandError = async ( +export const de_ListControlDomainInsightsCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.auditmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + controlDomainInsights: (_) => de_ControlDomainInsightsList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RegisterOrganizationAdminAccountCommand + * deserializeAws_restJson1ListControlDomainInsightsByAssessmentCommand */ -export const de_RegisterOrganizationAdminAccountCommand = async ( +export const de_ListControlDomainInsightsByAssessmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterOrganizationAdminAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - adminAccountId: __expectString, - organizationId: __expectString, + controlDomainInsights: (_) => de_ControlDomainInsightsList(_, context), + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RegisterOrganizationAdminAccountCommandError + * deserializeAws_restJson1ListControlInsightsByControlDomainCommand */ -const de_RegisterOrganizationAdminAccountCommandError = async ( +export const de_ListControlInsightsByControlDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + controlInsightsMetadata: (_) => de_ControlInsightsMetadata(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartAssessmentFrameworkShareCommand + * deserializeAws_restJson1ListControlsCommand */ -export const de_StartAssessmentFrameworkShareCommand = async ( +export const de_ListControlsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartAssessmentFrameworkShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - assessmentFrameworkShareRequest: (_) => de_AssessmentFrameworkShareRequest(_, context), + controlMetadataList: (_) => de_ControlMetadataList(_, context), + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartAssessmentFrameworkShareCommandError + * deserializeAws_restJson1ListKeywordsForDataSourceCommand */ -const de_StartAssessmentFrameworkShareCommandError = async ( +export const de_ListKeywordsForDataSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + keywords: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListNotificationsCommand */ -export const de_TagResourceCommand = async ( +export const de_ListNotificationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + notifications: (_) => de_Notifications(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1RegisterAccountCommand */ -export const de_UntagResourceCommand = async ( +export const de_RegisterAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + status: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1RegisterOrganizationAdminAccountCommand */ -const de_UntagResourceCommandError = async ( +export const de_RegisterOrganizationAdminAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + adminAccountId: __expectString, + organizationId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateAssessmentCommand + * deserializeAws_restJson1StartAssessmentFrameworkShareCommand */ -export const de_UpdateAssessmentCommand = async ( +export const de_StartAssessmentFrameworkShareCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAssessmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - assessment: (_) => de_Assessment(_, context), + assessmentFrameworkShareRequest: (_) => de_AssessmentFrameworkShareRequest(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateAssessmentCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_UpdateAssessmentCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UntagResourceCommand + */ +export const de_UntagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateAssessmentControlCommand + * deserializeAws_restJson1UpdateAssessmentCommand */ -export const de_UpdateAssessmentControlCommand = async ( +export const de_UpdateAssessmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAssessmentControlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - control: (_) => de_AssessmentControl(_, context), + assessment: (_) => de_Assessment(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateAssessmentControlCommandError + * deserializeAws_restJson1UpdateAssessmentControlCommand */ -const de_UpdateAssessmentControlCommandError = async ( +export const de_UpdateAssessmentControlCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + control: (_) => de_AssessmentControl(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4585,7 +2702,7 @@ export const de_UpdateAssessmentControlSetStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAssessmentControlSetStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4598,41 +2715,6 @@ export const de_UpdateAssessmentControlSetStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAssessmentControlSetStatusCommandError - */ -const de_UpdateAssessmentControlSetStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAssessmentFrameworkCommand */ @@ -4641,7 +2723,7 @@ export const de_UpdateAssessmentFrameworkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAssessmentFrameworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4654,41 +2736,6 @@ export const de_UpdateAssessmentFrameworkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAssessmentFrameworkCommandError - */ -const de_UpdateAssessmentFrameworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAssessmentFrameworkShareCommand */ @@ -4697,7 +2744,7 @@ export const de_UpdateAssessmentFrameworkShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAssessmentFrameworkShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4710,44 +2757,6 @@ export const de_UpdateAssessmentFrameworkShareCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAssessmentFrameworkShareCommandError - */ -const de_UpdateAssessmentFrameworkShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.auditmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAssessmentStatusCommand */ @@ -4756,7 +2765,7 @@ export const de_UpdateAssessmentStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAssessmentStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4769,44 +2778,6 @@ export const de_UpdateAssessmentStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAssessmentStatusCommandError - */ -const de_UpdateAssessmentStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.auditmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateControlCommand */ @@ -4815,7 +2786,7 @@ export const de_UpdateControlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateControlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4828,41 +2799,6 @@ export const de_UpdateControlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateControlCommandError - */ -const de_UpdateControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.auditmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSettingsCommand */ @@ -4871,7 +2807,7 @@ export const de_UpdateSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4884,38 +2820,6 @@ export const de_UpdateSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSettingsCommandError - */ -const de_UpdateSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.auditmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.auditmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.auditmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ValidateAssessmentReportIntegrityCommand */ @@ -4924,7 +2828,7 @@ export const de_ValidateAssessmentReportIntegrityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ValidateAssessmentReportIntegrityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4942,12 +2846,9 @@ export const de_ValidateAssessmentReportIntegrityCommand = async ( }; /** - * deserializeAws_restJson1ValidateAssessmentReportIntegrityCommandError + * deserialize_Aws_restJson1CommandError */ -const de_ValidateAssessmentReportIntegrityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4966,13 +2867,19 @@ const de_ValidateAssessmentReportIntegrityCommandError = async ( case "ValidationException": case "com.amazonaws.auditmanager#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.auditmanager#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.auditmanager#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts b/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts index cfb2f34a0684..c13081dc789f 100644 --- a/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts +++ b/clients/client-auto-scaling-plans/src/protocols/Aws_json1_1.ts @@ -156,7 +156,7 @@ export const de_CreateScalingPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateScalingPlanCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -168,41 +168,6 @@ export const de_CreateScalingPlanCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateScalingPlanCommandError - */ -const de_CreateScalingPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentUpdateException": - case "com.amazonaws.autoscalingplans#ConcurrentUpdateException": - throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.autoscalingplans#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.autoscalingplans#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.autoscalingplans#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteScalingPlanCommand */ @@ -211,7 +176,7 @@ export const de_DeleteScalingPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteScalingPlanCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -223,41 +188,6 @@ export const de_DeleteScalingPlanCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteScalingPlanCommandError - */ -const de_DeleteScalingPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentUpdateException": - case "com.amazonaws.autoscalingplans#ConcurrentUpdateException": - throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.autoscalingplans#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ObjectNotFoundException": - case "com.amazonaws.autoscalingplans#ObjectNotFoundException": - throw await de_ObjectNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.autoscalingplans#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeScalingPlanResourcesCommand */ @@ -266,7 +196,7 @@ export const de_DescribeScalingPlanResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeScalingPlanResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -278,41 +208,6 @@ export const de_DescribeScalingPlanResourcesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeScalingPlanResourcesCommandError - */ -const de_DescribeScalingPlanResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentUpdateException": - case "com.amazonaws.autoscalingplans#ConcurrentUpdateException": - throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.autoscalingplans#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.autoscalingplans#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.autoscalingplans#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeScalingPlansCommand */ @@ -321,7 +216,7 @@ export const de_DescribeScalingPlansCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeScalingPlansCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -333,41 +228,6 @@ export const de_DescribeScalingPlansCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeScalingPlansCommandError - */ -const de_DescribeScalingPlansCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentUpdateException": - case "com.amazonaws.autoscalingplans#ConcurrentUpdateException": - throw await de_ConcurrentUpdateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.autoscalingplans#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.autoscalingplans#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.autoscalingplans#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetScalingPlanResourceForecastDataCommand */ @@ -376,7 +236,7 @@ export const de_GetScalingPlanResourceForecastDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetScalingPlanResourceForecastDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -388,35 +248,6 @@ export const de_GetScalingPlanResourceForecastDataCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetScalingPlanResourceForecastDataCommandError - */ -const de_GetScalingPlanResourceForecastDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.autoscalingplans#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.autoscalingplans#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateScalingPlanCommand */ @@ -425,7 +256,7 @@ export const de_UpdateScalingPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateScalingPlanCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -438,12 +269,9 @@ export const de_UpdateScalingPlanCommand = async ( }; /** - * deserializeAws_json1_1UpdateScalingPlanCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateScalingPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -456,19 +284,25 @@ const de_UpdateScalingPlanCommandError = async ( case "InternalServiceException": case "com.amazonaws.autoscalingplans#InternalServiceException": throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ObjectNotFoundException": - case "com.amazonaws.autoscalingplans#ObjectNotFoundException": - throw await de_ObjectNotFoundExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.autoscalingplans#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.autoscalingplans#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ObjectNotFoundException": + case "com.amazonaws.autoscalingplans#ObjectNotFoundException": + throw await de_ObjectNotFoundExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.autoscalingplans#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-auto-scaling/src/protocols/Aws_query.ts b/clients/client-auto-scaling/src/protocols/Aws_query.ts index 6e8c1b43c5c9..681e3bed2609 100644 --- a/clients/client-auto-scaling/src/protocols/Aws_query.ts +++ b/clients/client-auto-scaling/src/protocols/Aws_query.ts @@ -1523,7 +1523,7 @@ export const de_AttachInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachInstancesCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AttachInstancesCommandOutput = { @@ -1532,35 +1532,6 @@ export const de_AttachInstancesCommand = async ( return response; }; -/** - * deserializeAws_queryAttachInstancesCommandError - */ -const de_AttachInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ServiceLinkedRoleFailure": - case "com.amazonaws.autoscaling#ServiceLinkedRoleFailure": - throw await de_ServiceLinkedRoleFailureRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAttachLoadBalancersCommand */ @@ -1569,7 +1540,7 @@ export const de_AttachLoadBalancersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachLoadBalancersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1581,35 +1552,6 @@ export const de_AttachLoadBalancersCommand = async ( return response; }; -/** - * deserializeAws_queryAttachLoadBalancersCommandError - */ -const de_AttachLoadBalancersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ServiceLinkedRoleFailure": - case "com.amazonaws.autoscaling#ServiceLinkedRoleFailure": - throw await de_ServiceLinkedRoleFailureRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAttachLoadBalancerTargetGroupsCommand */ @@ -1618,7 +1560,7 @@ export const de_AttachLoadBalancerTargetGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachLoadBalancerTargetGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1630,35 +1572,6 @@ export const de_AttachLoadBalancerTargetGroupsCommand = async ( return response; }; -/** - * deserializeAws_queryAttachLoadBalancerTargetGroupsCommandError - */ -const de_AttachLoadBalancerTargetGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ServiceLinkedRoleFailure": - case "com.amazonaws.autoscaling#ServiceLinkedRoleFailure": - throw await de_ServiceLinkedRoleFailureRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAttachTrafficSourcesCommand */ @@ -1667,7 +1580,7 @@ export const de_AttachTrafficSourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachTrafficSourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1679,35 +1592,6 @@ export const de_AttachTrafficSourcesCommand = async ( return response; }; -/** - * deserializeAws_queryAttachTrafficSourcesCommandError - */ -const de_AttachTrafficSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ServiceLinkedRoleFailure": - case "com.amazonaws.autoscaling#ServiceLinkedRoleFailure": - throw await de_ServiceLinkedRoleFailureRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryBatchDeleteScheduledActionCommand */ @@ -1716,7 +1600,7 @@ export const de_BatchDeleteScheduledActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDeleteScheduledActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1728,32 +1612,6 @@ export const de_BatchDeleteScheduledActionCommand = async ( return response; }; -/** - * deserializeAws_queryBatchDeleteScheduledActionCommandError - */ -const de_BatchDeleteScheduledActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryBatchPutScheduledUpdateGroupActionCommand */ @@ -1762,7 +1620,7 @@ export const de_BatchPutScheduledUpdateGroupActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchPutScheduledUpdateGroupActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1774,38 +1632,6 @@ export const de_BatchPutScheduledUpdateGroupActionCommand = async ( return response; }; -/** - * deserializeAws_queryBatchPutScheduledUpdateGroupActionCommandError - */ -const de_BatchPutScheduledUpdateGroupActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExists": - case "com.amazonaws.autoscaling#AlreadyExistsFault": - throw await de_AlreadyExistsFaultRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.autoscaling#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCancelInstanceRefreshCommand */ @@ -1814,7 +1640,7 @@ export const de_CancelInstanceRefreshCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelInstanceRefreshCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1826,38 +1652,6 @@ export const de_CancelInstanceRefreshCommand = async ( return response; }; -/** - * deserializeAws_queryCancelInstanceRefreshCommandError - */ -const de_CancelInstanceRefreshCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActiveInstanceRefreshNotFound": - case "com.amazonaws.autoscaling#ActiveInstanceRefreshNotFoundFault": - throw await de_ActiveInstanceRefreshNotFoundFaultRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.autoscaling#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCompleteLifecycleActionCommand */ @@ -1866,7 +1660,7 @@ export const de_CompleteLifecycleActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CompleteLifecycleActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1878,32 +1672,6 @@ export const de_CompleteLifecycleActionCommand = async ( return response; }; -/** - * deserializeAws_queryCompleteLifecycleActionCommandError - */ -const de_CompleteLifecycleActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateAutoScalingGroupCommand */ @@ -1912,7 +1680,7 @@ export const de_CreateAutoScalingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAutoScalingGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateAutoScalingGroupCommandOutput = { @@ -1921,41 +1689,6 @@ export const de_CreateAutoScalingGroupCommand = async ( return response; }; -/** - * deserializeAws_queryCreateAutoScalingGroupCommandError - */ -const de_CreateAutoScalingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExists": - case "com.amazonaws.autoscaling#AlreadyExistsFault": - throw await de_AlreadyExistsFaultRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.autoscaling#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ServiceLinkedRoleFailure": - case "com.amazonaws.autoscaling#ServiceLinkedRoleFailure": - throw await de_ServiceLinkedRoleFailureRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateLaunchConfigurationCommand */ @@ -1964,7 +1697,7 @@ export const de_CreateLaunchConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLaunchConfigurationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateLaunchConfigurationCommandOutput = { @@ -1974,46 +1707,14 @@ export const de_CreateLaunchConfigurationCommand = async ( }; /** - * deserializeAws_queryCreateLaunchConfigurationCommandError + * deserializeAws_queryCreateOrUpdateTagsCommand */ -const de_CreateLaunchConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExists": - case "com.amazonaws.autoscaling#AlreadyExistsFault": - throw await de_AlreadyExistsFaultRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.autoscaling#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryCreateOrUpdateTagsCommand - */ -export const de_CreateOrUpdateTagsCommand = async ( +export const de_CreateOrUpdateTagsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateOrUpdateTagsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateOrUpdateTagsCommandOutput = { @@ -2022,41 +1723,6 @@ export const de_CreateOrUpdateTagsCommand = async ( return response; }; -/** - * deserializeAws_queryCreateOrUpdateTagsCommandError - */ -const de_CreateOrUpdateTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExists": - case "com.amazonaws.autoscaling#AlreadyExistsFault": - throw await de_AlreadyExistsFaultRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.autoscaling#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.autoscaling#ResourceInUseFault": - throw await de_ResourceInUseFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteAutoScalingGroupCommand */ @@ -2065,7 +1731,7 @@ export const de_DeleteAutoScalingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAutoScalingGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteAutoScalingGroupCommandOutput = { @@ -2074,38 +1740,6 @@ export const de_DeleteAutoScalingGroupCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteAutoScalingGroupCommandError - */ -const de_DeleteAutoScalingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.autoscaling#ResourceInUseFault": - throw await de_ResourceInUseFaultRes(parsedOutput, context); - case "ScalingActivityInProgress": - case "com.amazonaws.autoscaling#ScalingActivityInProgressFault": - throw await de_ScalingActivityInProgressFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteLaunchConfigurationCommand */ @@ -2114,7 +1748,7 @@ export const de_DeleteLaunchConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLaunchConfigurationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteLaunchConfigurationCommandOutput = { @@ -2123,35 +1757,6 @@ export const de_DeleteLaunchConfigurationCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteLaunchConfigurationCommandError - */ -const de_DeleteLaunchConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.autoscaling#ResourceInUseFault": - throw await de_ResourceInUseFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteLifecycleHookCommand */ @@ -2160,7 +1765,7 @@ export const de_DeleteLifecycleHookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLifecycleHookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2172,32 +1777,6 @@ export const de_DeleteLifecycleHookCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteLifecycleHookCommandError - */ -const de_DeleteLifecycleHookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteNotificationConfigurationCommand */ @@ -2206,7 +1785,7 @@ export const de_DeleteNotificationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNotificationConfigurationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteNotificationConfigurationCommandOutput = { @@ -2215,32 +1794,6 @@ export const de_DeleteNotificationConfigurationCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteNotificationConfigurationCommandError - */ -const de_DeleteNotificationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeletePolicyCommand */ @@ -2249,7 +1802,7 @@ export const de_DeletePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeletePolicyCommandOutput = { @@ -2258,35 +1811,6 @@ export const de_DeletePolicyCommand = async ( return response; }; -/** - * deserializeAws_queryDeletePolicyCommandError - */ -const de_DeletePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ServiceLinkedRoleFailure": - case "com.amazonaws.autoscaling#ServiceLinkedRoleFailure": - throw await de_ServiceLinkedRoleFailureRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteScheduledActionCommand */ @@ -2295,7 +1819,7 @@ export const de_DeleteScheduledActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteScheduledActionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteScheduledActionCommandOutput = { @@ -2304,32 +1828,6 @@ export const de_DeleteScheduledActionCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteScheduledActionCommandError - */ -const de_DeleteScheduledActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteTagsCommand */ @@ -2338,7 +1836,7 @@ export const de_DeleteTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTagsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteTagsCommandOutput = { @@ -2347,35 +1845,6 @@ export const de_DeleteTagsCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteTagsCommandError - */ -const de_DeleteTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.autoscaling#ResourceInUseFault": - throw await de_ResourceInUseFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteWarmPoolCommand */ @@ -2384,7 +1853,7 @@ export const de_DeleteWarmPoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteWarmPoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2397,49 +1866,14 @@ export const de_DeleteWarmPoolCommand = async ( }; /** - * deserializeAws_queryDeleteWarmPoolCommandError + * deserializeAws_queryDescribeAccountLimitsCommand */ -const de_DeleteWarmPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.autoscaling#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.autoscaling#ResourceInUseFault": - throw await de_ResourceInUseFaultRes(parsedOutput, context); - case "ScalingActivityInProgress": - case "com.amazonaws.autoscaling#ScalingActivityInProgressFault": - throw await de_ScalingActivityInProgressFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeAccountLimitsCommand - */ -export const de_DescribeAccountLimitsCommand = async ( +export const de_DescribeAccountLimitsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAccountLimitsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2451,32 +1885,6 @@ export const de_DescribeAccountLimitsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeAccountLimitsCommandError - */ -const de_DescribeAccountLimitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeAdjustmentTypesCommand */ @@ -2485,7 +1893,7 @@ export const de_DescribeAdjustmentTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAdjustmentTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2497,32 +1905,6 @@ export const de_DescribeAdjustmentTypesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeAdjustmentTypesCommandError - */ -const de_DescribeAdjustmentTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeAutoScalingGroupsCommand */ @@ -2531,7 +1913,7 @@ export const de_DescribeAutoScalingGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAutoScalingGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2543,35 +1925,6 @@ export const de_DescribeAutoScalingGroupsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeAutoScalingGroupsCommandError - */ -const de_DescribeAutoScalingGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.autoscaling#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeAutoScalingInstancesCommand */ @@ -2580,7 +1933,7 @@ export const de_DescribeAutoScalingInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAutoScalingInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2592,35 +1945,6 @@ export const de_DescribeAutoScalingInstancesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeAutoScalingInstancesCommandError - */ -const de_DescribeAutoScalingInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.autoscaling#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeAutoScalingNotificationTypesCommand */ @@ -2629,7 +1953,7 @@ export const de_DescribeAutoScalingNotificationTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAutoScalingNotificationTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2641,32 +1965,6 @@ export const de_DescribeAutoScalingNotificationTypesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeAutoScalingNotificationTypesCommandError - */ -const de_DescribeAutoScalingNotificationTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeInstanceRefreshesCommand */ @@ -2675,7 +1973,7 @@ export const de_DescribeInstanceRefreshesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstanceRefreshesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2687,35 +1985,6 @@ export const de_DescribeInstanceRefreshesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeInstanceRefreshesCommandError - */ -const de_DescribeInstanceRefreshesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.autoscaling#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeLaunchConfigurationsCommand */ @@ -2724,7 +1993,7 @@ export const de_DescribeLaunchConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLaunchConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2736,35 +2005,6 @@ export const de_DescribeLaunchConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeLaunchConfigurationsCommandError - */ -const de_DescribeLaunchConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.autoscaling#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeLifecycleHooksCommand */ @@ -2773,7 +2013,7 @@ export const de_DescribeLifecycleHooksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLifecycleHooksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2785,32 +2025,6 @@ export const de_DescribeLifecycleHooksCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeLifecycleHooksCommandError - */ -const de_DescribeLifecycleHooksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeLifecycleHookTypesCommand */ @@ -2819,7 +2033,7 @@ export const de_DescribeLifecycleHookTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLifecycleHookTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2831,32 +2045,6 @@ export const de_DescribeLifecycleHookTypesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeLifecycleHookTypesCommandError - */ -const de_DescribeLifecycleHookTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeLoadBalancersCommand */ @@ -2865,7 +2053,7 @@ export const de_DescribeLoadBalancersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLoadBalancersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2878,43 +2066,14 @@ export const de_DescribeLoadBalancersCommand = async ( }; /** - * deserializeAws_queryDescribeLoadBalancersCommandError + * deserializeAws_queryDescribeLoadBalancerTargetGroupsCommand */ -const de_DescribeLoadBalancersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.autoscaling#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeLoadBalancerTargetGroupsCommand - */ -export const de_DescribeLoadBalancerTargetGroupsCommand = async ( +export const de_DescribeLoadBalancerTargetGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLoadBalancerTargetGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2926,35 +2085,6 @@ export const de_DescribeLoadBalancerTargetGroupsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeLoadBalancerTargetGroupsCommandError - */ -const de_DescribeLoadBalancerTargetGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.autoscaling#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeMetricCollectionTypesCommand */ @@ -2963,7 +2093,7 @@ export const de_DescribeMetricCollectionTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeMetricCollectionTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2975,32 +2105,6 @@ export const de_DescribeMetricCollectionTypesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeMetricCollectionTypesCommandError - */ -const de_DescribeMetricCollectionTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeNotificationConfigurationsCommand */ @@ -3009,7 +2113,7 @@ export const de_DescribeNotificationConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNotificationConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3021,35 +2125,6 @@ export const de_DescribeNotificationConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeNotificationConfigurationsCommandError - */ -const de_DescribeNotificationConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.autoscaling#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribePoliciesCommand */ @@ -3058,7 +2133,7 @@ export const de_DescribePoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePoliciesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3070,38 +2145,6 @@ export const de_DescribePoliciesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribePoliciesCommandError - */ -const de_DescribePoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.autoscaling#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ServiceLinkedRoleFailure": - case "com.amazonaws.autoscaling#ServiceLinkedRoleFailure": - throw await de_ServiceLinkedRoleFailureRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeScalingActivitiesCommand */ @@ -3110,7 +2153,7 @@ export const de_DescribeScalingActivitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeScalingActivitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3122,35 +2165,6 @@ export const de_DescribeScalingActivitiesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeScalingActivitiesCommandError - */ -const de_DescribeScalingActivitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.autoscaling#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeScalingProcessTypesCommand */ @@ -3159,7 +2173,7 @@ export const de_DescribeScalingProcessTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeScalingProcessTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3171,32 +2185,6 @@ export const de_DescribeScalingProcessTypesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeScalingProcessTypesCommandError - */ -const de_DescribeScalingProcessTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeScheduledActionsCommand */ @@ -3205,7 +2193,7 @@ export const de_DescribeScheduledActionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeScheduledActionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3217,35 +2205,6 @@ export const de_DescribeScheduledActionsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeScheduledActionsCommandError - */ -const de_DescribeScheduledActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.autoscaling#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeTagsCommand */ @@ -3254,107 +2213,32 @@ export const de_DescribeTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_TagsType(data.DescribeTagsResult, context); - const response: DescribeTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeTagsCommandError - */ -const de_DescribeTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.autoscaling#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeTerminationPolicyTypesCommand - */ -export const de_DescribeTerminationPolicyTypesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeTerminationPolicyTypesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeTerminationPolicyTypesAnswer(data.DescribeTerminationPolicyTypesResult, context); - const response: DescribeTerminationPolicyTypesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeTerminationPolicyTypesCommandError - */ -const de_DescribeTerminationPolicyTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_TagsType(data.DescribeTagsResult, context); + const response: DescribeTagsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeTrafficSourcesCommand + * deserializeAws_queryDescribeTerminationPolicyTypesCommand */ -export const de_DescribeTrafficSourcesCommand = async ( +export const de_DescribeTerminationPolicyTypesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrafficSourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeTrafficSourcesResponse(data.DescribeTrafficSourcesResult, context); - const response: DescribeTrafficSourcesCommandOutput = { + contents = de_DescribeTerminationPolicyTypesAnswer(data.DescribeTerminationPolicyTypesResult, context); + const response: DescribeTerminationPolicyTypesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3362,32 +2246,23 @@ export const de_DescribeTrafficSourcesCommand = async ( }; /** - * deserializeAws_queryDescribeTrafficSourcesCommandError + * deserializeAws_queryDescribeTrafficSourcesCommand */ -const de_DescribeTrafficSourcesCommandError = async ( +export const de_DescribeTrafficSourcesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.autoscaling#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeTrafficSourcesResponse(data.DescribeTrafficSourcesResult, context); + const response: DescribeTrafficSourcesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3398,7 +2273,7 @@ export const de_DescribeWarmPoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeWarmPoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3410,38 +2285,6 @@ export const de_DescribeWarmPoolCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeWarmPoolCommandError - */ -const de_DescribeWarmPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.autoscaling#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.autoscaling#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDetachInstancesCommand */ @@ -3450,7 +2293,7 @@ export const de_DetachInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetachInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3462,32 +2305,6 @@ export const de_DetachInstancesCommand = async ( return response; }; -/** - * deserializeAws_queryDetachInstancesCommandError - */ -const de_DetachInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDetachLoadBalancersCommand */ @@ -3496,7 +2313,7 @@ export const de_DetachLoadBalancersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetachLoadBalancersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3508,32 +2325,6 @@ export const de_DetachLoadBalancersCommand = async ( return response; }; -/** - * deserializeAws_queryDetachLoadBalancersCommandError - */ -const de_DetachLoadBalancersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDetachLoadBalancerTargetGroupsCommand */ @@ -3542,7 +2333,7 @@ export const de_DetachLoadBalancerTargetGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetachLoadBalancerTargetGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3554,32 +2345,6 @@ export const de_DetachLoadBalancerTargetGroupsCommand = async ( return response; }; -/** - * deserializeAws_queryDetachLoadBalancerTargetGroupsCommandError - */ -const de_DetachLoadBalancerTargetGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDetachTrafficSourcesCommand */ @@ -3588,7 +2353,7 @@ export const de_DetachTrafficSourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetachTrafficSourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3600,32 +2365,6 @@ export const de_DetachTrafficSourcesCommand = async ( return response; }; -/** - * deserializeAws_queryDetachTrafficSourcesCommandError - */ -const de_DetachTrafficSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDisableMetricsCollectionCommand */ @@ -3634,7 +2373,7 @@ export const de_DisableMetricsCollectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableMetricsCollectionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DisableMetricsCollectionCommandOutput = { @@ -3643,32 +2382,6 @@ export const de_DisableMetricsCollectionCommand = async ( return response; }; -/** - * deserializeAws_queryDisableMetricsCollectionCommandError - */ -const de_DisableMetricsCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryEnableMetricsCollectionCommand */ @@ -3677,7 +2390,7 @@ export const de_EnableMetricsCollectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableMetricsCollectionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: EnableMetricsCollectionCommandOutput = { @@ -3686,76 +2399,24 @@ export const de_EnableMetricsCollectionCommand = async ( return response; }; -/** - * deserializeAws_queryEnableMetricsCollectionCommandError - */ -const de_EnableMetricsCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryEnterStandbyCommand */ export const de_EnterStandbyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_EnterStandbyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_EnterStandbyAnswer(data.EnterStandbyResult, context); - const response: EnterStandbyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryEnterStandbyCommandError - */ -const de_EnterStandbyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EnterStandbyAnswer(data.EnterStandbyResult, context); + const response: EnterStandbyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3766,7 +2427,7 @@ export const de_ExecutePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExecutePolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ExecutePolicyCommandOutput = { @@ -3775,35 +2436,6 @@ export const de_ExecutePolicyCommand = async ( return response; }; -/** - * deserializeAws_queryExecutePolicyCommandError - */ -const de_ExecutePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ScalingActivityInProgress": - case "com.amazonaws.autoscaling#ScalingActivityInProgressFault": - throw await de_ScalingActivityInProgressFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryExitStandbyCommand */ @@ -3812,7 +2444,7 @@ export const de_ExitStandbyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExitStandbyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3824,32 +2456,6 @@ export const de_ExitStandbyCommand = async ( return response; }; -/** - * deserializeAws_queryExitStandbyCommandError - */ -const de_ExitStandbyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryGetPredictiveScalingForecastCommand */ @@ -3858,7 +2464,7 @@ export const de_GetPredictiveScalingForecastCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPredictiveScalingForecastCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3870,32 +2476,6 @@ export const de_GetPredictiveScalingForecastCommand = async ( return response; }; -/** - * deserializeAws_queryGetPredictiveScalingForecastCommandError - */ -const de_GetPredictiveScalingForecastCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryPutLifecycleHookCommand */ @@ -3904,7 +2484,7 @@ export const de_PutLifecycleHookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutLifecycleHookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3916,35 +2496,6 @@ export const de_PutLifecycleHookCommand = async ( return response; }; -/** - * deserializeAws_queryPutLifecycleHookCommandError - */ -const de_PutLifecycleHookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.autoscaling#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryPutNotificationConfigurationCommand */ @@ -3953,7 +2504,7 @@ export const de_PutNotificationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutNotificationConfigurationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutNotificationConfigurationCommandOutput = { @@ -3962,38 +2513,6 @@ export const de_PutNotificationConfigurationCommand = async ( return response; }; -/** - * deserializeAws_queryPutNotificationConfigurationCommandError - */ -const de_PutNotificationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.autoscaling#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ServiceLinkedRoleFailure": - case "com.amazonaws.autoscaling#ServiceLinkedRoleFailure": - throw await de_ServiceLinkedRoleFailureRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryPutScalingPolicyCommand */ @@ -4002,7 +2521,7 @@ export const de_PutScalingPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutScalingPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4014,38 +2533,6 @@ export const de_PutScalingPolicyCommand = async ( return response; }; -/** - * deserializeAws_queryPutScalingPolicyCommandError - */ -const de_PutScalingPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.autoscaling#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ServiceLinkedRoleFailure": - case "com.amazonaws.autoscaling#ServiceLinkedRoleFailure": - throw await de_ServiceLinkedRoleFailureRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryPutScheduledUpdateGroupActionCommand */ @@ -4054,7 +2541,7 @@ export const de_PutScheduledUpdateGroupActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutScheduledUpdateGroupActionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutScheduledUpdateGroupActionCommandOutput = { @@ -4063,38 +2550,6 @@ export const de_PutScheduledUpdateGroupActionCommand = async ( return response; }; -/** - * deserializeAws_queryPutScheduledUpdateGroupActionCommandError - */ -const de_PutScheduledUpdateGroupActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExists": - case "com.amazonaws.autoscaling#AlreadyExistsFault": - throw await de_AlreadyExistsFaultRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.autoscaling#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryPutWarmPoolCommand */ @@ -4103,7 +2558,7 @@ export const de_PutWarmPoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutWarmPoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4115,35 +2570,6 @@ export const de_PutWarmPoolCommand = async ( return response; }; -/** - * deserializeAws_queryPutWarmPoolCommandError - */ -const de_PutWarmPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.autoscaling#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryRecordLifecycleActionHeartbeatCommand */ @@ -4152,42 +2578,16 @@ export const de_RecordLifecycleActionHeartbeatCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RecordLifecycleActionHeartbeatCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_RecordLifecycleActionHeartbeatAnswer(data.RecordLifecycleActionHeartbeatResult, context); const response: RecordLifecycleActionHeartbeatCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRecordLifecycleActionHeartbeatCommandError - */ -const de_RecordLifecycleActionHeartbeatCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + ...contents, + }; + return response; }; /** @@ -4198,7 +2598,7 @@ export const de_ResumeProcessesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResumeProcessesCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ResumeProcessesCommandOutput = { @@ -4207,35 +2607,6 @@ export const de_ResumeProcessesCommand = async ( return response; }; -/** - * deserializeAws_queryResumeProcessesCommandError - */ -const de_ResumeProcessesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.autoscaling#ResourceInUseFault": - throw await de_ResourceInUseFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryRollbackInstanceRefreshCommand */ @@ -4244,7 +2615,7 @@ export const de_RollbackInstanceRefreshCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RollbackInstanceRefreshCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4256,41 +2627,6 @@ export const de_RollbackInstanceRefreshCommand = async ( return response; }; -/** - * deserializeAws_queryRollbackInstanceRefreshCommandError - */ -const de_RollbackInstanceRefreshCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActiveInstanceRefreshNotFound": - case "com.amazonaws.autoscaling#ActiveInstanceRefreshNotFoundFault": - throw await de_ActiveInstanceRefreshNotFoundFaultRes(parsedOutput, context); - case "IrreversibleInstanceRefresh": - case "com.amazonaws.autoscaling#IrreversibleInstanceRefreshFault": - throw await de_IrreversibleInstanceRefreshFaultRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.autoscaling#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySetDesiredCapacityCommand */ @@ -4299,7 +2635,7 @@ export const de_SetDesiredCapacityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetDesiredCapacityCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SetDesiredCapacityCommandOutput = { @@ -4308,35 +2644,6 @@ export const de_SetDesiredCapacityCommand = async ( return response; }; -/** - * deserializeAws_querySetDesiredCapacityCommandError - */ -const de_SetDesiredCapacityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ScalingActivityInProgress": - case "com.amazonaws.autoscaling#ScalingActivityInProgressFault": - throw await de_ScalingActivityInProgressFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySetInstanceHealthCommand */ @@ -4345,7 +2652,7 @@ export const de_SetInstanceHealthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetInstanceHealthCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SetInstanceHealthCommandOutput = { @@ -4354,32 +2661,6 @@ export const de_SetInstanceHealthCommand = async ( return response; }; -/** - * deserializeAws_querySetInstanceHealthCommandError - */ -const de_SetInstanceHealthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySetInstanceProtectionCommand */ @@ -4388,7 +2669,7 @@ export const de_SetInstanceProtectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetInstanceProtectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4400,35 +2681,6 @@ export const de_SetInstanceProtectionCommand = async ( return response; }; -/** - * deserializeAws_querySetInstanceProtectionCommandError - */ -const de_SetInstanceProtectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.autoscaling#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryStartInstanceRefreshCommand */ @@ -4437,7 +2689,7 @@ export const de_StartInstanceRefreshCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartInstanceRefreshCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4449,38 +2701,6 @@ export const de_StartInstanceRefreshCommand = async ( return response; }; -/** - * deserializeAws_queryStartInstanceRefreshCommandError - */ -const de_StartInstanceRefreshCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InstanceRefreshInProgress": - case "com.amazonaws.autoscaling#InstanceRefreshInProgressFault": - throw await de_InstanceRefreshInProgressFaultRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.autoscaling#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySuspendProcessesCommand */ @@ -4489,7 +2709,7 @@ export const de_SuspendProcessesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SuspendProcessesCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SuspendProcessesCommandOutput = { @@ -4498,35 +2718,6 @@ export const de_SuspendProcessesCommand = async ( return response; }; -/** - * deserializeAws_querySuspendProcessesCommandError - */ -const de_SuspendProcessesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.autoscaling#ResourceInUseFault": - throw await de_ResourceInUseFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryTerminateInstanceInAutoScalingGroupCommand */ @@ -4535,7 +2726,7 @@ export const de_TerminateInstanceInAutoScalingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TerminateInstanceInAutoScalingGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4547,35 +2738,6 @@ export const de_TerminateInstanceInAutoScalingGroupCommand = async ( return response; }; -/** - * deserializeAws_queryTerminateInstanceInAutoScalingGroupCommandError - */ -const de_TerminateInstanceInAutoScalingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceContention": - case "com.amazonaws.autoscaling#ResourceContentionFault": - throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ScalingActivityInProgress": - case "com.amazonaws.autoscaling#ScalingActivityInProgressFault": - throw await de_ScalingActivityInProgressFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateAutoScalingGroupCommand */ @@ -4584,7 +2746,7 @@ export const de_UpdateAutoScalingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateAutoScalingGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateAutoScalingGroupCommandOutput = { @@ -4594,12 +2756,9 @@ export const de_UpdateAutoScalingGroupCommand = async ( }; /** - * deserializeAws_queryUpdateAutoScalingGroupCommandError + * deserialize_Aws_queryCommandError */ -const de_UpdateAutoScalingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4609,19 +2768,40 @@ const de_UpdateAutoScalingGroupCommandError = async ( case "ResourceContention": case "com.amazonaws.autoscaling#ResourceContentionFault": throw await de_ResourceContentionFaultRes(parsedOutput, context); - case "ScalingActivityInProgress": - case "com.amazonaws.autoscaling#ScalingActivityInProgressFault": - throw await de_ScalingActivityInProgressFaultRes(parsedOutput, context); case "ServiceLinkedRoleFailure": case "com.amazonaws.autoscaling#ServiceLinkedRoleFailure": throw await de_ServiceLinkedRoleFailureRes(parsedOutput, context); + case "AlreadyExists": + case "com.amazonaws.autoscaling#AlreadyExistsFault": + throw await de_AlreadyExistsFaultRes(parsedOutput, context); + case "LimitExceeded": + case "com.amazonaws.autoscaling#LimitExceededFault": + throw await de_LimitExceededFaultRes(parsedOutput, context); + case "ActiveInstanceRefreshNotFound": + case "com.amazonaws.autoscaling#ActiveInstanceRefreshNotFoundFault": + throw await de_ActiveInstanceRefreshNotFoundFaultRes(parsedOutput, context); + case "ResourceInUse": + case "com.amazonaws.autoscaling#ResourceInUseFault": + throw await de_ResourceInUseFaultRes(parsedOutput, context); + case "ScalingActivityInProgress": + case "com.amazonaws.autoscaling#ScalingActivityInProgressFault": + throw await de_ScalingActivityInProgressFaultRes(parsedOutput, context); + case "InvalidNextToken": + case "com.amazonaws.autoscaling#InvalidNextToken": + throw await de_InvalidNextTokenRes(parsedOutput, context); + case "IrreversibleInstanceRefresh": + case "com.amazonaws.autoscaling#IrreversibleInstanceRefreshFault": + throw await de_IrreversibleInstanceRefreshFaultRes(parsedOutput, context); + case "InstanceRefreshInProgress": + case "com.amazonaws.autoscaling#InstanceRefreshInProgressFault": + throw await de_InstanceRefreshInProgressFaultRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody: parsedBody.Error, errorCode, - }); + }) as never; } }; diff --git a/clients/client-b2bi/src/protocols/Aws_json1_0.ts b/clients/client-b2bi/src/protocols/Aws_json1_0.ts index 5cbeaf57c9da..56428a5751d0 100644 --- a/clients/client-b2bi/src/protocols/Aws_json1_0.ts +++ b/clients/client-b2bi/src/protocols/Aws_json1_0.ts @@ -475,7 +475,7 @@ export const de_CreateCapabilityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCapabilityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -487,50 +487,6 @@ export const de_CreateCapabilityCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateCapabilityCommandError - */ -const de_CreateCapabilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.b2bi#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.b2bi#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreatePartnershipCommand */ @@ -539,7 +495,7 @@ export const de_CreatePartnershipCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePartnershipCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -551,50 +507,6 @@ export const de_CreatePartnershipCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreatePartnershipCommandError - */ -const de_CreatePartnershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.b2bi#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.b2bi#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateProfileCommand */ @@ -603,7 +515,7 @@ export const de_CreateProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -615,50 +527,6 @@ export const de_CreateProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateProfileCommandError - */ -const de_CreateProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.b2bi#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.b2bi#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateTransformerCommand */ @@ -667,7 +535,7 @@ export const de_CreateTransformerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTransformerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -679,50 +547,6 @@ export const de_CreateTransformerCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateTransformerCommandError - */ -const de_CreateTransformerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.b2bi#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.b2bi#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteCapabilityCommand */ @@ -731,7 +555,7 @@ export const de_DeleteCapabilityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCapabilityCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteCapabilityCommandOutput = { @@ -741,622 +565,70 @@ export const de_DeleteCapabilityCommand = async ( }; /** - * deserializeAws_json1_0DeleteCapabilityCommandError - */ -const de_DeleteCapabilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.b2bi#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeletePartnershipCommand - */ -export const de_DeletePartnershipCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeletePartnershipCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeletePartnershipCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_0DeletePartnershipCommandError - */ -const de_DeletePartnershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.b2bi#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteProfileCommand - */ -export const de_DeleteProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteProfileCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteProfileCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteProfileCommandError - */ -const de_DeleteProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.b2bi#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteTransformerCommand - */ -export const de_DeleteTransformerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteTransformerCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteTransformerCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteTransformerCommandError - */ -const de_DeleteTransformerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.b2bi#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetCapabilityCommand - */ -export const de_GetCapabilityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetCapabilityCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetCapabilityResponse(data, context); - const response: GetCapabilityCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetCapabilityCommandError - */ -const de_GetCapabilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetPartnershipCommand - */ -export const de_GetPartnershipCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetPartnershipCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetPartnershipResponse(data, context); - const response: GetPartnershipCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetPartnershipCommandError - */ -const de_GetPartnershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetProfileCommand - */ -export const de_GetProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetProfileCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetProfileResponse(data, context); - const response: GetProfileCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetProfileCommandError - */ -const de_GetProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetTransformerCommand - */ -export const de_GetTransformerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetTransformerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetTransformerResponse(data, context); - const response: GetTransformerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetTransformerCommandError - */ -const de_GetTransformerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetTransformerJobCommand - */ -export const de_GetTransformerJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetTransformerJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetTransformerJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetTransformerJobCommandError - */ -const de_GetTransformerJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListCapabilitiesCommand - */ -export const de_ListCapabilitiesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListCapabilitiesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListCapabilitiesResponse(data, context); - const response: ListCapabilitiesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListCapabilitiesCommandError + * deserializeAws_json1_0DeletePartnershipCommand */ -const de_ListCapabilitiesCommandError = async ( +export const de_DeletePartnershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeletePartnershipCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; }; /** - * deserializeAws_json1_0ListPartnershipsCommand + * deserializeAws_json1_0DeleteProfileCommand */ -export const de_ListPartnershipsCommand = async ( +export const de_DeleteProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListPartnershipsCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListPartnershipsResponse(data, context); - const response: ListPartnershipsCommandOutput = { + await collectBody(output.body, context); + const response: DeleteProfileCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_0ListPartnershipsCommandError + * deserializeAws_json1_0DeleteTransformerCommand */ -const de_ListPartnershipsCommandError = async ( +export const de_DeleteTransformerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteTransformerCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_0ListProfilesCommand + * deserializeAws_json1_0GetCapabilityCommand */ -export const de_ListProfilesCommand = async ( +export const de_GetCapabilityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListProfilesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListProfilesResponse(data, context); - const response: ListProfilesCommandOutput = { + contents = de_GetCapabilityResponse(data, context); + const response: GetCapabilityCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1364,39 +636,39 @@ export const de_ListProfilesCommand = async ( }; /** - * deserializeAws_json1_0ListProfilesCommandError + * deserializeAws_json1_0GetPartnershipCommand */ -const de_ListProfilesCommandError = async ( +export const de_GetPartnershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetPartnershipResponse(data, context); + const response: GetPartnershipCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; }; /** - * deserializeAws_json1_0ListTagsForResourceCommand + * deserializeAws_json1_0GetProfileCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_GetProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_GetProfileResponse(data, context); + const response: GetProfileCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1404,51 +676,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_0ListTagsForResourceCommandError + * deserializeAws_json1_0GetTransformerCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_GetTransformerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetTransformerResponse(data, context); + const response: GetTransformerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListTransformersCommand + * deserializeAws_json1_0GetTransformerJobCommand */ -export const de_ListTransformersCommand = async ( +export const de_GetTransformerJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTransformersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListTransformersResponse(data, context); - const response: ListTransformersCommandOutput = { + contents = _json(data); + const response: GetTransformerJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1456,39 +716,39 @@ export const de_ListTransformersCommand = async ( }; /** - * deserializeAws_json1_0ListTransformersCommandError + * deserializeAws_json1_0ListCapabilitiesCommand */ -const de_ListTransformersCommandError = async ( +export const de_ListCapabilitiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListCapabilitiesResponse(data, context); + const response: ListCapabilitiesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; }; /** - * deserializeAws_json1_0StartTransformerJobCommand + * deserializeAws_json1_0ListPartnershipsCommand */ -export const de_StartTransformerJobCommand = async ( +export const de_ListPartnershipsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartTransformerJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartTransformerJobCommandOutput = { + contents = de_ListPartnershipsResponse(data, context); + const response: ListPartnershipsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1496,109 +756,79 @@ export const de_StartTransformerJobCommand = async ( }; /** - * deserializeAws_json1_0StartTransformerJobCommandError + * deserializeAws_json1_0ListProfilesCommand */ -const de_StartTransformerJobCommandError = async ( +export const de_ListProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListProfilesResponse(data, context); + const response: ListProfilesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0TagResourceCommand + * deserializeAws_json1_0ListTagsForResourceCommand */ -export const de_TagResourceCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: TagResourceCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_0TagResourceCommandError + * deserializeAws_json1_0ListTransformersCommand */ -const de_TagResourceCommandError = async ( +export const de_ListTransformersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListTransformersResponse(data, context); + const response: ListTransformersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0TestMappingCommand + * deserializeAws_json1_0StartTransformerJobCommand */ -export const de_TestMappingCommand = async ( +export const de_StartTransformerJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TestMappingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TestMappingCommandOutput = { + const response: StartTransformerJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1606,57 +836,36 @@ export const de_TestMappingCommand = async ( }; /** - * deserializeAws_json1_0TestMappingCommandError + * deserializeAws_json1_0TagResourceCommand */ -const de_TestMappingCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_0TestParsingCommand + * deserializeAws_json1_0TestMappingCommand */ -export const de_TestParsingCommand = async ( +export const de_TestMappingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TestParsingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TestParsingCommandOutput = { + const response: TestMappingCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1664,41 +873,23 @@ export const de_TestParsingCommand = async ( }; /** - * deserializeAws_json1_0TestParsingCommandError + * deserializeAws_json1_0TestParsingCommand */ -const de_TestParsingCommandError = async ( +export const de_TestParsingCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TestParsingCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1709,7 +900,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UntagResourceCommandOutput = { @@ -1718,38 +909,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateCapabilityCommand */ @@ -1758,7 +917,7 @@ export const de_UpdateCapabilityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateCapabilityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1770,50 +929,6 @@ export const de_UpdateCapabilityCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateCapabilityCommandError - */ -const de_UpdateCapabilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.b2bi#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.b2bi#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdatePartnershipCommand */ @@ -1822,7 +937,7 @@ export const de_UpdatePartnershipCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePartnershipCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1834,50 +949,6 @@ export const de_UpdatePartnershipCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdatePartnershipCommandError - */ -const de_UpdatePartnershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.b2bi#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.b2bi#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateProfileCommand */ @@ -1886,7 +957,7 @@ export const de_UpdateProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1898,50 +969,6 @@ export const de_UpdateProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateProfileCommandError - */ -const de_UpdateProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.b2bi#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.b2bi#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.b2bi#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.b2bi#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.b2bi#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.b2bi#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.b2bi#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateTransformerCommand */ @@ -1950,7 +977,7 @@ export const de_UpdateTransformerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTransformerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1963,12 +990,9 @@ export const de_UpdateTransformerCommand = async ( }; /** - * deserializeAws_json1_0UpdateTransformerCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateTransformerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2002,7 +1026,7 @@ const de_UpdateTransformerCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts b/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts index 0bc5540c8af6..6bcde5e8ba8d 100644 --- a/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts +++ b/clients/client-backup-gateway/src/protocols/Aws_json1_0.ts @@ -466,7 +466,7 @@ export const de_AssociateGatewayToServerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateGatewayToServerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -478,41 +478,6 @@ export const de_AssociateGatewayToServerCommand = async ( return response; }; -/** - * deserializeAws_json1_0AssociateGatewayToServerCommandError - */ -const de_AssociateGatewayToServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.backupgateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateGatewayCommand */ @@ -521,7 +486,7 @@ export const de_CreateGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -533,38 +498,6 @@ export const de_CreateGatewayCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateGatewayCommandError - */ -const de_CreateGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteGatewayCommand */ @@ -573,7 +506,7 @@ export const de_DeleteGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -585,41 +518,6 @@ export const de_DeleteGatewayCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteGatewayCommandError - */ -const de_DeleteGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteHypervisorCommand */ @@ -628,7 +526,7 @@ export const de_DeleteHypervisorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteHypervisorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -640,47 +538,6 @@ export const de_DeleteHypervisorCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteHypervisorCommandError - */ -const de_DeleteHypervisorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.backupgateway#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.backupgateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DisassociateGatewayFromServerCommand */ @@ -689,7 +546,7 @@ export const de_DisassociateGatewayFromServerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateGatewayFromServerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -701,44 +558,6 @@ export const de_DisassociateGatewayFromServerCommand = async ( return response; }; -/** - * deserializeAws_json1_0DisassociateGatewayFromServerCommandError - */ -const de_DisassociateGatewayFromServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.backupgateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetBandwidthRateLimitScheduleCommand */ @@ -747,7 +566,7 @@ export const de_GetBandwidthRateLimitScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetBandwidthRateLimitScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -759,41 +578,6 @@ export const de_GetBandwidthRateLimitScheduleCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetBandwidthRateLimitScheduleCommandError - */ -const de_GetBandwidthRateLimitScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetGatewayCommand */ @@ -802,7 +586,7 @@ export const de_GetGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -815,54 +599,39 @@ export const de_GetGatewayCommand = async ( }; /** - * deserializeAws_json1_0GetGatewayCommandError + * deserializeAws_json1_0GetHypervisorCommand */ -const de_GetGatewayCommandError = async ( +export const de_GetHypervisorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetHypervisorOutput(data, context); + const response: GetHypervisorCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0GetHypervisorCommand + * deserializeAws_json1_0GetHypervisorPropertyMappingsCommand */ -export const de_GetHypervisorCommand = async ( +export const de_GetHypervisorPropertyMappingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetHypervisorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetHypervisorOutput(data, context); - const response: GetHypervisorCommandOutput = { + contents = _json(data); + const response: GetHypervisorPropertyMappingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -870,104 +639,14 @@ export const de_GetHypervisorCommand = async ( }; /** - * deserializeAws_json1_0GetHypervisorCommandError + * deserializeAws_json1_0GetVirtualMachineCommand */ -const de_GetHypervisorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetHypervisorPropertyMappingsCommand - */ -export const de_GetHypervisorPropertyMappingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetHypervisorPropertyMappingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetHypervisorPropertyMappingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetHypervisorPropertyMappingsCommandError - */ -const de_GetHypervisorPropertyMappingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetVirtualMachineCommand - */ -export const de_GetVirtualMachineCommand = async ( +export const de_GetVirtualMachineCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetVirtualMachineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -979,41 +658,6 @@ export const de_GetVirtualMachineCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetVirtualMachineCommandError - */ -const de_GetVirtualMachineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ImportHypervisorConfigurationCommand */ @@ -1022,7 +666,7 @@ export const de_ImportHypervisorConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportHypervisorConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1034,44 +678,6 @@ export const de_ImportHypervisorConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_0ImportHypervisorConfigurationCommandError - */ -const de_ImportHypervisorConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.backupgateway#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.backupgateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListGatewaysCommand */ @@ -1080,7 +686,7 @@ export const de_ListGatewaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListGatewaysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1092,38 +698,6 @@ export const de_ListGatewaysCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListGatewaysCommandError - */ -const de_ListGatewaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListHypervisorsCommand */ @@ -1132,7 +706,7 @@ export const de_ListHypervisorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListHypervisorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1144,38 +718,6 @@ export const de_ListHypervisorsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListHypervisorsCommandError - */ -const de_ListHypervisorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListTagsForResourceCommand */ @@ -1184,7 +726,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1196,41 +738,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListVirtualMachinesCommand */ @@ -1239,7 +746,7 @@ export const de_ListVirtualMachinesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListVirtualMachinesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1251,38 +758,6 @@ export const de_ListVirtualMachinesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListVirtualMachinesCommandError - */ -const de_ListVirtualMachinesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0PutBandwidthRateLimitScheduleCommand */ @@ -1291,7 +766,7 @@ export const de_PutBandwidthRateLimitScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutBandwidthRateLimitScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1303,41 +778,6 @@ export const de_PutBandwidthRateLimitScheduleCommand = async ( return response; }; -/** - * deserializeAws_json1_0PutBandwidthRateLimitScheduleCommandError - */ -const de_PutBandwidthRateLimitScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0PutHypervisorPropertyMappingsCommand */ @@ -1346,57 +786,16 @@ export const de_PutHypervisorPropertyMappingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutHypervisorPropertyMappingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutHypervisorPropertyMappingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0PutHypervisorPropertyMappingsCommandError - */ -const de_PutHypervisorPropertyMappingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.backupgateway#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.backupgateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const response: PutHypervisorPropertyMappingsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1407,7 +806,7 @@ export const de_PutMaintenanceStartTimeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutMaintenanceStartTimeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1419,44 +818,6 @@ export const de_PutMaintenanceStartTimeCommand = async ( return response; }; -/** - * deserializeAws_json1_0PutMaintenanceStartTimeCommandError - */ -const de_PutMaintenanceStartTimeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.backupgateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0StartVirtualMachinesMetadataSyncCommand */ @@ -1465,7 +826,7 @@ export const de_StartVirtualMachinesMetadataSyncCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartVirtualMachinesMetadataSyncCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1477,44 +838,6 @@ export const de_StartVirtualMachinesMetadataSyncCommand = async ( return response; }; -/** - * deserializeAws_json1_0StartVirtualMachinesMetadataSyncCommandError - */ -const de_StartVirtualMachinesMetadataSyncCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.backupgateway#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TagResourceCommand */ @@ -1523,7 +846,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1535,41 +858,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TestHypervisorConfigurationCommand */ @@ -1578,7 +866,7 @@ export const de_TestHypervisorConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TestHypervisorConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1590,44 +878,6 @@ export const de_TestHypervisorConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_0TestHypervisorConfigurationCommandError - */ -const de_TestHypervisorConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.backupgateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UntagResourceCommand */ @@ -1636,7 +886,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1648,41 +898,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateGatewayInformationCommand */ @@ -1691,7 +906,7 @@ export const de_UpdateGatewayInformationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateGatewayInformationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1703,44 +918,6 @@ export const de_UpdateGatewayInformationCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateGatewayInformationCommandError - */ -const de_UpdateGatewayInformationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.backupgateway#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateGatewaySoftwareNowCommand */ @@ -1749,7 +926,7 @@ export const de_UpdateGatewaySoftwareNowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateGatewaySoftwareNowCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1761,41 +938,6 @@ export const de_UpdateGatewaySoftwareNowCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateGatewaySoftwareNowCommandError - */ -const de_UpdateGatewaySoftwareNowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.backupgateway#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupgateway#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.backupgateway#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateHypervisorCommand */ @@ -1804,7 +946,7 @@ export const de_UpdateHypervisorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateHypervisorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1817,43 +959,40 @@ export const de_UpdateHypervisorCommand = async ( }; /** - * deserializeAws_json1_0UpdateHypervisorCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateHypervisorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.backupgateway#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); case "ConflictException": case "com.amazonaws.backupgateway#ConflictException": throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.backupgateway#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupgateway#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.backupgateway#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.backupgateway#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.backupgateway#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.backupgateway#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-backup/src/protocols/Aws_restJson1.ts b/clients/client-backup/src/protocols/Aws_restJson1.ts index 354c01452053..c4bbccd5f2fb 100644 --- a/clients/client-backup/src/protocols/Aws_restJson1.ts +++ b/clients/client-backup/src/protocols/Aws_restJson1.ts @@ -2244,7 +2244,7 @@ export const de_CancelLegalHoldCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CancelLegalHoldCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2253,44 +2253,6 @@ export const de_CancelLegalHoldCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelLegalHoldCommandError - */ -const de_CancelLegalHoldCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.backup#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBackupPlanCommand */ @@ -2299,7 +2261,7 @@ export const de_CreateBackupPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBackupPlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2316,44 +2278,6 @@ export const de_CreateBackupPlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBackupPlanCommandError - */ -const de_CreateBackupPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.backup#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.backup#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBackupSelectionCommand */ @@ -2362,7 +2286,7 @@ export const de_CreateBackupSelectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBackupSelectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2377,44 +2301,6 @@ export const de_CreateBackupSelectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBackupSelectionCommandError - */ -const de_CreateBackupSelectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.backup#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.backup#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBackupVaultCommand */ @@ -2423,7 +2309,7 @@ export const de_CreateBackupVaultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBackupVaultCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2438,44 +2324,6 @@ export const de_CreateBackupVaultCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBackupVaultCommandError - */ -const de_CreateBackupVaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.backup#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.backup#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFrameworkCommand */ @@ -2484,7 +2332,7 @@ export const de_CreateFrameworkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFrameworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2498,44 +2346,6 @@ export const de_CreateFrameworkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFrameworkCommandError - */ -const de_CreateFrameworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.backup#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.backup#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLegalHoldCommand */ @@ -2544,7 +2354,7 @@ export const de_CreateLegalHoldCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLegalHoldCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2563,41 +2373,6 @@ export const de_CreateLegalHoldCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLegalHoldCommandError - */ -const de_CreateLegalHoldCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.backup#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLogicallyAirGappedBackupVaultCommand */ @@ -2606,7 +2381,7 @@ export const de_CreateLogicallyAirGappedBackupVaultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLogicallyAirGappedBackupVaultCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2622,47 +2397,6 @@ export const de_CreateLogicallyAirGappedBackupVaultCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLogicallyAirGappedBackupVaultCommandError - */ -const de_CreateLogicallyAirGappedBackupVaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.backup#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.backup#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateReportPlanCommand */ @@ -2671,7 +2405,7 @@ export const de_CreateReportPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateReportPlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2687,52 +2421,14 @@ export const de_CreateReportPlanCommand = async ( }; /** - * deserializeAws_restJson1CreateReportPlanCommandError + * deserializeAws_restJson1CreateRestoreTestingPlanCommand */ -const de_CreateReportPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.backup#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.backup#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateRestoreTestingPlanCommand - */ -export const de_CreateRestoreTestingPlanCommand = async ( +export const de_CreateRestoreTestingPlanCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateRestoreTestingPlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2747,47 +2443,6 @@ export const de_CreateRestoreTestingPlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRestoreTestingPlanCommandError - */ -const de_CreateRestoreTestingPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.backup#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.backup#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.backup#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRestoreTestingSelectionCommand */ @@ -2796,7 +2451,7 @@ export const de_CreateRestoreTestingSelectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateRestoreTestingSelectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2812,47 +2467,6 @@ export const de_CreateRestoreTestingSelectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRestoreTestingSelectionCommandError - */ -const de_CreateRestoreTestingSelectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.backup#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.backup#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBackupPlanCommand */ @@ -2861,7 +2475,7 @@ export const de_DeleteBackupPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBackupPlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2877,44 +2491,6 @@ export const de_DeleteBackupPlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteBackupPlanCommandError - */ -const de_DeleteBackupPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBackupSelectionCommand */ @@ -2923,7 +2499,7 @@ export const de_DeleteBackupSelectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBackupSelectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2932,41 +2508,6 @@ export const de_DeleteBackupSelectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteBackupSelectionCommandError - */ -const de_DeleteBackupSelectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBackupVaultCommand */ @@ -2975,7 +2516,7 @@ export const de_DeleteBackupVaultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBackupVaultCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2985,52 +2526,31 @@ export const de_DeleteBackupVaultCommand = async ( }; /** - * deserializeAws_restJson1DeleteBackupVaultCommandError + * deserializeAws_restJson1DeleteBackupVaultAccessPolicyCommand */ -const de_DeleteBackupVaultCommandError = async ( +export const de_DeleteBackupVaultAccessPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteBackupVaultAccessPolicyCommand + * deserializeAws_restJson1DeleteBackupVaultLockConfigurationCommand */ -export const de_DeleteBackupVaultAccessPolicyCommand = async ( +export const de_DeleteBackupVaultLockConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBackupVaultAccessPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3040,49 +2560,31 @@ export const de_DeleteBackupVaultAccessPolicyCommand = async ( }; /** - * deserializeAws_restJson1DeleteBackupVaultAccessPolicyCommandError + * deserializeAws_restJson1DeleteBackupVaultNotificationsCommand */ -const de_DeleteBackupVaultAccessPolicyCommandError = async ( +export const de_DeleteBackupVaultNotificationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteBackupVaultLockConfigurationCommand + * deserializeAws_restJson1DeleteFrameworkCommand */ -export const de_DeleteBackupVaultLockConfigurationCommand = async ( +export const de_DeleteFrameworkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBackupVaultLockConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3092,3728 +2594,1347 @@ export const de_DeleteBackupVaultLockConfigurationCommand = async ( }; /** - * deserializeAws_restJson1DeleteBackupVaultLockConfigurationCommandError + * deserializeAws_restJson1DeleteRecoveryPointCommand */ -const de_DeleteBackupVaultLockConfigurationCommandError = async ( +export const de_DeleteRecoveryPointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteBackupVaultNotificationsCommand - */ -export const de_DeleteBackupVaultNotificationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBackupVaultNotificationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteBackupVaultNotificationsCommandError - */ -const de_DeleteBackupVaultNotificationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteFrameworkCommand - */ -export const de_DeleteFrameworkCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFrameworkCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteFrameworkCommandError - */ -const de_DeleteFrameworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.backup#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRecoveryPointCommand - */ -export const de_DeleteRecoveryPointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRecoveryPointCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRecoveryPointCommandError - */ -const de_DeleteRecoveryPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.backup#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteReportPlanCommand - */ -export const de_DeleteReportPlanCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteReportPlanCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteReportPlanCommandError - */ -const de_DeleteReportPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.backup#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRestoreTestingPlanCommand - */ -export const de_DeleteRestoreTestingPlanCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRestoreTestingPlanCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRestoreTestingPlanCommandError - */ -const de_DeleteRestoreTestingPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRestoreTestingSelectionCommand - */ -export const de_DeleteRestoreTestingSelectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRestoreTestingSelectionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRestoreTestingSelectionCommandError - */ -const de_DeleteRestoreTestingSelectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeBackupJobCommand - */ -export const de_DescribeBackupJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBackupJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AccountId: __expectString, - BackupJobId: __expectString, - BackupOptions: _json, - BackupSizeInBytes: __expectLong, - BackupType: __expectString, - BackupVaultArn: __expectString, - BackupVaultName: __expectString, - BytesTransferred: __expectLong, - ChildJobsInState: _json, - CompletionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - CreatedBy: _json, - CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - ExpectedCompletionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - IamRoleArn: __expectString, - InitiationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - IsParent: __expectBoolean, - MessageCategory: __expectString, - NumberOfChildJobs: __expectLong, - ParentJobId: __expectString, - PercentDone: __expectString, - RecoveryPointArn: __expectString, - ResourceArn: __expectString, - ResourceName: __expectString, - ResourceType: __expectString, - StartBy: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - State: __expectString, - StatusMessage: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeBackupJobCommandError - */ -const de_DescribeBackupJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyFailureException": - case "com.amazonaws.backup#DependencyFailureException": - throw await de_DependencyFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeBackupVaultCommand - */ -export const de_DescribeBackupVaultCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBackupVaultCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BackupVaultArn: __expectString, - BackupVaultName: __expectString, - CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - CreatorRequestId: __expectString, - EncryptionKeyArn: __expectString, - LockDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - Locked: __expectBoolean, - MaxRetentionDays: __expectLong, - MinRetentionDays: __expectLong, - NumberOfRecoveryPoints: __expectLong, - VaultType: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeBackupVaultCommandError - */ -const de_DescribeBackupVaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeCopyJobCommand - */ -export const de_DescribeCopyJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeCopyJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CopyJob: (_) => de_CopyJob(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeCopyJobCommandError - */ -const de_DescribeCopyJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeFrameworkCommand - */ -export const de_DescribeFrameworkCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFrameworkCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CreationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - DeploymentStatus: __expectString, - FrameworkArn: __expectString, - FrameworkControls: _json, - FrameworkDescription: __expectString, - FrameworkName: __expectString, - FrameworkStatus: __expectString, - IdempotencyToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeFrameworkCommandError - */ -const de_DescribeFrameworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeGlobalSettingsCommand - */ -export const de_DescribeGlobalSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeGlobalSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - GlobalSettings: _json, - LastUpdateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeGlobalSettingsCommandError - */ -const de_DescribeGlobalSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeProtectedResourceCommand - */ -export const de_DescribeProtectedResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeProtectedResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LastBackupTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - LastBackupVaultArn: __expectString, - LastRecoveryPointArn: __expectString, - LatestRestoreExecutionTimeMinutes: __expectLong, - LatestRestoreJobCreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - LatestRestoreRecoveryPointCreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - ResourceArn: __expectString, - ResourceName: __expectString, - ResourceType: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeProtectedResourceCommandError - */ -const de_DescribeProtectedResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeRecoveryPointCommand - */ -export const de_DescribeRecoveryPointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRecoveryPointCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BackupSizeInBytes: __expectLong, - BackupVaultArn: __expectString, - BackupVaultName: __expectString, - CalculatedLifecycle: (_) => de_CalculatedLifecycle(_, context), - CompletionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - CompositeMemberIdentifier: __expectString, - CreatedBy: _json, - CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - EncryptionKeyArn: __expectString, - IamRoleArn: __expectString, - IsEncrypted: __expectBoolean, - IsParent: __expectBoolean, - LastRestoreTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - Lifecycle: _json, - ParentRecoveryPointArn: __expectString, - RecoveryPointArn: __expectString, - ResourceArn: __expectString, - ResourceName: __expectString, - ResourceType: __expectString, - SourceBackupVaultArn: __expectString, - Status: __expectString, - StatusMessage: __expectString, - StorageClass: __expectString, - VaultType: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeRecoveryPointCommandError - */ -const de_DescribeRecoveryPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeRegionSettingsCommand - */ -export const de_DescribeRegionSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRegionSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ResourceTypeManagementPreference: _json, - ResourceTypeOptInPreference: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeRegionSettingsCommandError - */ -const de_DescribeRegionSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeReportJobCommand - */ -export const de_DescribeReportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeReportJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ReportJob: (_) => de_ReportJob(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeReportJobCommandError - */ -const de_DescribeReportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeReportPlanCommand - */ -export const de_DescribeReportPlanCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeReportPlanCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ReportPlan: (_) => de_ReportPlan(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeReportPlanCommandError - */ -const de_DescribeReportPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeRestoreJobCommand - */ -export const de_DescribeRestoreJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRestoreJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AccountId: __expectString, - BackupSizeInBytes: __expectLong, - CompletionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - CreatedBy: _json, - CreatedResourceArn: __expectString, - CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - DeletionStatus: __expectString, - DeletionStatusMessage: __expectString, - ExpectedCompletionTimeMinutes: __expectLong, - IamRoleArn: __expectString, - PercentDone: __expectString, - RecoveryPointArn: __expectString, - RecoveryPointCreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - ResourceType: __expectString, - RestoreJobId: __expectString, - Status: __expectString, - StatusMessage: __expectString, - ValidationStatus: __expectString, - ValidationStatusMessage: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeRestoreJobCommandError - */ -const de_DescribeRestoreJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyFailureException": - case "com.amazonaws.backup#DependencyFailureException": - throw await de_DependencyFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateRecoveryPointCommand - */ -export const de_DisassociateRecoveryPointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateRecoveryPointCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateRecoveryPointCommandError - */ -const de_DisassociateRecoveryPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.backup#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateRecoveryPointFromParentCommand - */ -export const de_DisassociateRecoveryPointFromParentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DisassociateRecoveryPointFromParentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateRecoveryPointFromParentCommandError - */ -const de_DisassociateRecoveryPointFromParentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ExportBackupPlanTemplateCommand - */ -export const de_ExportBackupPlanTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExportBackupPlanTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BackupPlanTemplateJson: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ExportBackupPlanTemplateCommandError - */ -const de_ExportBackupPlanTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetBackupPlanCommand - */ -export const de_GetBackupPlanCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBackupPlanCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AdvancedBackupSettings: _json, - BackupPlan: _json, - BackupPlanArn: __expectString, - BackupPlanId: __expectString, - CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - CreatorRequestId: __expectString, - DeletionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - LastExecutionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - VersionId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetBackupPlanCommandError - */ -const de_GetBackupPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetBackupPlanFromJSONCommand - */ -export const de_GetBackupPlanFromJSONCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBackupPlanFromJSONCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BackupPlan: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetBackupPlanFromJSONCommandError - */ -const de_GetBackupPlanFromJSONCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.backup#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetBackupPlanFromTemplateCommand - */ -export const de_GetBackupPlanFromTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBackupPlanFromTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BackupPlanDocument: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetBackupPlanFromTemplateCommandError - */ -const de_GetBackupPlanFromTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetBackupSelectionCommand - */ -export const de_GetBackupSelectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBackupSelectionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BackupPlanId: __expectString, - BackupSelection: _json, - CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - CreatorRequestId: __expectString, - SelectionId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetBackupSelectionCommandError - */ -const de_GetBackupSelectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetBackupVaultAccessPolicyCommand - */ -export const de_GetBackupVaultAccessPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBackupVaultAccessPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BackupVaultArn: __expectString, - BackupVaultName: __expectString, - Policy: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetBackupVaultAccessPolicyCommandError - */ -const de_GetBackupVaultAccessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetBackupVaultNotificationsCommand - */ -export const de_GetBackupVaultNotificationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBackupVaultNotificationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BackupVaultArn: __expectString, - BackupVaultEvents: _json, - BackupVaultName: __expectString, - SNSTopicArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetBackupVaultNotificationsCommandError - */ -const de_GetBackupVaultNotificationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetLegalHoldCommand - */ -export const de_GetLegalHoldCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLegalHoldCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CancelDescription: __expectString, - CancellationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - Description: __expectString, - LegalHoldArn: __expectString, - LegalHoldId: __expectString, - RecoveryPointSelection: (_) => de_RecoveryPointSelection(_, context), - RetainRecordUntil: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - Status: __expectString, - Title: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetLegalHoldCommandError - */ -const de_GetLegalHoldCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRecoveryPointRestoreMetadataCommand - */ -export const de_GetRecoveryPointRestoreMetadataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRecoveryPointRestoreMetadataCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BackupVaultArn: __expectString, - RecoveryPointArn: __expectString, - ResourceType: __expectString, - RestoreMetadata: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRecoveryPointRestoreMetadataCommandError - */ -const de_GetRecoveryPointRestoreMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRestoreJobMetadataCommand - */ -export const de_GetRestoreJobMetadataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRestoreJobMetadataCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Metadata: _json, - RestoreJobId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRestoreJobMetadataCommandError - */ -const de_GetRestoreJobMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRestoreTestingInferredMetadataCommand - */ -export const de_GetRestoreTestingInferredMetadataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRestoreTestingInferredMetadataCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - InferredMetadata: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRestoreTestingInferredMetadataCommandError - */ -const de_GetRestoreTestingInferredMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRestoreTestingPlanCommand - */ -export const de_GetRestoreTestingPlanCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRestoreTestingPlanCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RestoreTestingPlan: (_) => de_RestoreTestingPlanForGet(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRestoreTestingPlanCommandError - */ -const de_GetRestoreTestingPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRestoreTestingSelectionCommand - */ -export const de_GetRestoreTestingSelectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRestoreTestingSelectionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RestoreTestingSelection: (_) => de_RestoreTestingSelectionForGet(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRestoreTestingSelectionCommandError - */ -const de_GetRestoreTestingSelectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSupportedResourceTypesCommand - */ -export const de_GetSupportedResourceTypesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSupportedResourceTypesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ResourceTypes: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSupportedResourceTypesCommandError - */ -const de_GetSupportedResourceTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListBackupJobsCommand - */ -export const de_ListBackupJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBackupJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BackupJobs: (_) => de_BackupJobsList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListBackupJobsCommandError - */ -const de_ListBackupJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListBackupJobSummariesCommand + * deserializeAws_restJson1DeleteReportPlanCommand */ -export const de_ListBackupJobSummariesCommand = async ( +export const de_DeleteReportPlanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBackupJobSummariesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AggregationPeriod: __expectString, - BackupJobSummaries: (_) => de_BackupJobSummaryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListBackupJobSummariesCommandError - */ -const de_ListBackupJobSummariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListBackupPlansCommand + * deserializeAws_restJson1DeleteRestoreTestingPlanCommand */ -export const de_ListBackupPlansCommand = async ( +export const de_DeleteRestoreTestingPlanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBackupPlansCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BackupPlansList: (_) => de_BackupPlansList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListBackupPlansCommandError + * deserializeAws_restJson1DeleteRestoreTestingSelectionCommand */ -const de_ListBackupPlansCommandError = async ( +export const de_DeleteRestoreTestingSelectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListBackupPlanTemplatesCommand + * deserializeAws_restJson1DescribeBackupJobCommand */ -export const de_ListBackupPlanTemplatesCommand = async ( +export const de_DescribeBackupJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBackupPlanTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - BackupPlanTemplatesList: _json, - NextToken: __expectString, + AccountId: __expectString, + BackupJobId: __expectString, + BackupOptions: _json, + BackupSizeInBytes: __expectLong, + BackupType: __expectString, + BackupVaultArn: __expectString, + BackupVaultName: __expectString, + BytesTransferred: __expectLong, + ChildJobsInState: _json, + CompletionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + CreatedBy: _json, + CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + ExpectedCompletionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + IamRoleArn: __expectString, + InitiationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + IsParent: __expectBoolean, + MessageCategory: __expectString, + NumberOfChildJobs: __expectLong, + ParentJobId: __expectString, + PercentDone: __expectString, + RecoveryPointArn: __expectString, + ResourceArn: __expectString, + ResourceName: __expectString, + ResourceType: __expectString, + StartBy: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + State: __expectString, + StatusMessage: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListBackupPlanTemplatesCommandError - */ -const de_ListBackupPlanTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListBackupPlanVersionsCommand + * deserializeAws_restJson1DescribeBackupVaultCommand */ -export const de_ListBackupPlanVersionsCommand = async ( +export const de_DescribeBackupVaultCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBackupPlanVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - BackupPlanVersionsList: (_) => de_BackupPlanVersionsList(_, context), - NextToken: __expectString, + BackupVaultArn: __expectString, + BackupVaultName: __expectString, + CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + CreatorRequestId: __expectString, + EncryptionKeyArn: __expectString, + LockDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Locked: __expectBoolean, + MaxRetentionDays: __expectLong, + MinRetentionDays: __expectLong, + NumberOfRecoveryPoints: __expectLong, + VaultType: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListBackupPlanVersionsCommandError - */ -const de_ListBackupPlanVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListBackupSelectionsCommand + * deserializeAws_restJson1DescribeCopyJobCommand */ -export const de_ListBackupSelectionsCommand = async ( +export const de_DescribeCopyJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBackupSelectionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - BackupSelectionsList: (_) => de_BackupSelectionsList(_, context), - NextToken: __expectString, + CopyJob: (_) => de_CopyJob(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListBackupSelectionsCommandError - */ -const de_ListBackupSelectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListBackupVaultsCommand + * deserializeAws_restJson1DescribeFrameworkCommand */ -export const de_ListBackupVaultsCommand = async ( +export const de_DescribeFrameworkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBackupVaultsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - BackupVaultList: (_) => de_BackupVaultList(_, context), - NextToken: __expectString, + CreationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + DeploymentStatus: __expectString, + FrameworkArn: __expectString, + FrameworkControls: _json, + FrameworkDescription: __expectString, + FrameworkName: __expectString, + FrameworkStatus: __expectString, + IdempotencyToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListBackupVaultsCommandError + * deserializeAws_restJson1DescribeGlobalSettingsCommand */ -const de_ListBackupVaultsCommandError = async ( +export const de_DescribeGlobalSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + GlobalSettings: _json, + LastUpdateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListCopyJobsCommand + * deserializeAws_restJson1DescribeProtectedResourceCommand */ -export const de_ListCopyJobsCommand = async ( +export const de_DescribeProtectedResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCopyJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CopyJobs: (_) => de_CopyJobsList(_, context), - NextToken: __expectString, + LastBackupTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + LastBackupVaultArn: __expectString, + LastRecoveryPointArn: __expectString, + LatestRestoreExecutionTimeMinutes: __expectLong, + LatestRestoreJobCreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + LatestRestoreRecoveryPointCreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + ResourceArn: __expectString, + ResourceName: __expectString, + ResourceType: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListCopyJobsCommandError + * deserializeAws_restJson1DescribeRecoveryPointCommand */ -const de_ListCopyJobsCommandError = async ( +export const de_DescribeRecoveryPointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + BackupSizeInBytes: __expectLong, + BackupVaultArn: __expectString, + BackupVaultName: __expectString, + CalculatedLifecycle: (_) => de_CalculatedLifecycle(_, context), + CompletionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + CompositeMemberIdentifier: __expectString, + CreatedBy: _json, + CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + EncryptionKeyArn: __expectString, + IamRoleArn: __expectString, + IsEncrypted: __expectBoolean, + IsParent: __expectBoolean, + LastRestoreTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Lifecycle: _json, + ParentRecoveryPointArn: __expectString, + RecoveryPointArn: __expectString, + ResourceArn: __expectString, + ResourceName: __expectString, + ResourceType: __expectString, + SourceBackupVaultArn: __expectString, + Status: __expectString, + StatusMessage: __expectString, + StorageClass: __expectString, + VaultType: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListCopyJobSummariesCommand + * deserializeAws_restJson1DescribeRegionSettingsCommand */ -export const de_ListCopyJobSummariesCommand = async ( +export const de_DescribeRegionSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCopyJobSummariesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AggregationPeriod: __expectString, - CopyJobSummaries: (_) => de_CopyJobSummaryList(_, context), - NextToken: __expectString, + ResourceTypeManagementPreference: _json, + ResourceTypeOptInPreference: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListCopyJobSummariesCommandError + * deserializeAws_restJson1DescribeReportJobCommand */ -const de_ListCopyJobSummariesCommandError = async ( +export const de_DescribeReportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ReportJob: (_) => de_ReportJob(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListFrameworksCommand + * deserializeAws_restJson1DescribeReportPlanCommand */ -export const de_ListFrameworksCommand = async ( +export const de_DescribeReportPlanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFrameworksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Frameworks: (_) => de_FrameworkList(_, context), - NextToken: __expectString, + ReportPlan: (_) => de_ReportPlan(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListFrameworksCommandError + * deserializeAws_restJson1DescribeRestoreJobCommand */ -const de_ListFrameworksCommandError = async ( +export const de_DescribeRestoreJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AccountId: __expectString, + BackupSizeInBytes: __expectLong, + CompletionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + CreatedBy: _json, + CreatedResourceArn: __expectString, + CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + DeletionStatus: __expectString, + DeletionStatusMessage: __expectString, + ExpectedCompletionTimeMinutes: __expectLong, + IamRoleArn: __expectString, + PercentDone: __expectString, + RecoveryPointArn: __expectString, + RecoveryPointCreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + ResourceType: __expectString, + RestoreJobId: __expectString, + Status: __expectString, + StatusMessage: __expectString, + ValidationStatus: __expectString, + ValidationStatusMessage: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListLegalHoldsCommand + * deserializeAws_restJson1DisassociateRecoveryPointCommand */ -export const de_ListLegalHoldsCommand = async ( +export const de_DisassociateRecoveryPointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLegalHoldsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LegalHolds: (_) => de_LegalHoldsList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListLegalHoldsCommandError + * deserializeAws_restJson1DisassociateRecoveryPointFromParentCommand */ -const de_ListLegalHoldsCommandError = async ( +export const de_DisassociateRecoveryPointFromParentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListProtectedResourcesCommand + * deserializeAws_restJson1ExportBackupPlanTemplateCommand */ -export const de_ListProtectedResourcesCommand = async ( +export const de_ExportBackupPlanTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProtectedResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - Results: (_) => de_ProtectedResourcesList(_, context), + BackupPlanTemplateJson: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListProtectedResourcesCommandError + * deserializeAws_restJson1GetBackupPlanCommand */ -const de_ListProtectedResourcesCommandError = async ( +export const de_GetBackupPlanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AdvancedBackupSettings: _json, + BackupPlan: _json, + BackupPlanArn: __expectString, + BackupPlanId: __expectString, + CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + CreatorRequestId: __expectString, + DeletionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + LastExecutionDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + VersionId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListProtectedResourcesByBackupVaultCommand + * deserializeAws_restJson1GetBackupPlanFromJSONCommand */ -export const de_ListProtectedResourcesByBackupVaultCommand = async ( +export const de_GetBackupPlanFromJSONCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProtectedResourcesByBackupVaultCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - Results: (_) => de_ProtectedResourcesList(_, context), + BackupPlan: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListProtectedResourcesByBackupVaultCommandError + * deserializeAws_restJson1GetBackupPlanFromTemplateCommand */ -const de_ListProtectedResourcesByBackupVaultCommandError = async ( +export const de_GetBackupPlanFromTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + BackupPlanDocument: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRecoveryPointsByBackupVaultCommand + * deserializeAws_restJson1GetBackupSelectionCommand */ -export const de_ListRecoveryPointsByBackupVaultCommand = async ( +export const de_GetBackupSelectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecoveryPointsByBackupVaultCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - RecoveryPoints: (_) => de_RecoveryPointByBackupVaultList(_, context), + BackupPlanId: __expectString, + BackupSelection: _json, + CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + CreatorRequestId: __expectString, + SelectionId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRecoveryPointsByBackupVaultCommandError + * deserializeAws_restJson1GetBackupVaultAccessPolicyCommand */ -const de_ListRecoveryPointsByBackupVaultCommandError = async ( +export const de_GetBackupVaultAccessPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + BackupVaultArn: __expectString, + BackupVaultName: __expectString, + Policy: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRecoveryPointsByLegalHoldCommand + * deserializeAws_restJson1GetBackupVaultNotificationsCommand */ -export const de_ListRecoveryPointsByLegalHoldCommand = async ( +export const de_GetBackupVaultNotificationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecoveryPointsByLegalHoldCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - RecoveryPoints: _json, + BackupVaultArn: __expectString, + BackupVaultEvents: _json, + BackupVaultName: __expectString, + SNSTopicArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRecoveryPointsByLegalHoldCommandError + * deserializeAws_restJson1GetLegalHoldCommand */ -const de_ListRecoveryPointsByLegalHoldCommandError = async ( +export const de_GetLegalHoldCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CancelDescription: __expectString, + CancellationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Description: __expectString, + LegalHoldArn: __expectString, + LegalHoldId: __expectString, + RecoveryPointSelection: (_) => de_RecoveryPointSelection(_, context), + RetainRecordUntil: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Status: __expectString, + Title: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRecoveryPointsByResourceCommand + * deserializeAws_restJson1GetRecoveryPointRestoreMetadataCommand */ -export const de_ListRecoveryPointsByResourceCommand = async ( +export const de_GetRecoveryPointRestoreMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecoveryPointsByResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - RecoveryPoints: (_) => de_RecoveryPointByResourceList(_, context), + BackupVaultArn: __expectString, + RecoveryPointArn: __expectString, + ResourceType: __expectString, + RestoreMetadata: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRecoveryPointsByResourceCommandError + * deserializeAws_restJson1GetRestoreJobMetadataCommand */ -const de_ListRecoveryPointsByResourceCommandError = async ( +export const de_GetRestoreJobMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Metadata: _json, + RestoreJobId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListReportJobsCommand + * deserializeAws_restJson1GetRestoreTestingInferredMetadataCommand */ -export const de_ListReportJobsCommand = async ( +export const de_GetRestoreTestingInferredMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReportJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - ReportJobs: (_) => de_ReportJobList(_, context), + InferredMetadata: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListReportJobsCommandError + * deserializeAws_restJson1GetRestoreTestingPlanCommand */ -const de_ListReportJobsCommandError = async ( +export const de_GetRestoreTestingPlanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RestoreTestingPlan: (_) => de_RestoreTestingPlanForGet(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListReportPlansCommand + * deserializeAws_restJson1GetRestoreTestingSelectionCommand */ -export const de_ListReportPlansCommand = async ( +export const de_GetRestoreTestingSelectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReportPlansCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - ReportPlans: (_) => de_ReportPlanList(_, context), + RestoreTestingSelection: (_) => de_RestoreTestingSelectionForGet(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListReportPlansCommandError + * deserializeAws_restJson1GetSupportedResourceTypesCommand */ -const de_ListReportPlansCommandError = async ( +export const de_GetSupportedResourceTypesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ResourceTypes: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRestoreJobsCommand + * deserializeAws_restJson1ListBackupJobsCommand */ -export const de_ListRestoreJobsCommand = async ( +export const de_ListBackupJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRestoreJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + BackupJobs: (_) => de_BackupJobsList(_, context), NextToken: __expectString, - RestoreJobs: (_) => de_RestoreJobsList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRestoreJobsCommandError - */ -const de_ListRestoreJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListRestoreJobsByProtectedResourceCommand + * deserializeAws_restJson1ListBackupJobSummariesCommand */ -export const de_ListRestoreJobsByProtectedResourceCommand = async ( +export const de_ListBackupJobSummariesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRestoreJobsByProtectedResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + AggregationPeriod: __expectString, + BackupJobSummaries: (_) => de_BackupJobSummaryList(_, context), NextToken: __expectString, - RestoreJobs: (_) => de_RestoreJobsList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRestoreJobsByProtectedResourceCommandError + * deserializeAws_restJson1ListBackupPlansCommand */ -const de_ListRestoreJobsByProtectedResourceCommandError = async ( +export const de_ListBackupPlansCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + BackupPlansList: (_) => de_BackupPlansList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRestoreJobSummariesCommand + * deserializeAws_restJson1ListBackupPlanTemplatesCommand */ -export const de_ListRestoreJobSummariesCommand = async ( +export const de_ListBackupPlanTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRestoreJobSummariesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AggregationPeriod: __expectString, + BackupPlanTemplatesList: _json, NextToken: __expectString, - RestoreJobSummaries: (_) => de_RestoreJobSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRestoreJobSummariesCommandError + * deserializeAws_restJson1ListBackupPlanVersionsCommand */ -const de_ListRestoreJobSummariesCommandError = async ( +export const de_ListBackupPlanVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + BackupPlanVersionsList: (_) => de_BackupPlanVersionsList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRestoreTestingPlansCommand + * deserializeAws_restJson1ListBackupSelectionsCommand */ -export const de_ListRestoreTestingPlansCommand = async ( +export const de_ListBackupSelectionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRestoreTestingPlansCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + BackupSelectionsList: (_) => de_BackupSelectionsList(_, context), NextToken: __expectString, - RestoreTestingPlans: (_) => de_RestoreTestingPlans(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRestoreTestingPlansCommandError + * deserializeAws_restJson1ListBackupVaultsCommand */ -const de_ListRestoreTestingPlansCommandError = async ( +export const de_ListBackupVaultsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + BackupVaultList: (_) => de_BackupVaultList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRestoreTestingSelectionsCommand + * deserializeAws_restJson1ListCopyJobsCommand */ -export const de_ListRestoreTestingSelectionsCommand = async ( +export const de_ListCopyJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRestoreTestingSelectionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + CopyJobs: (_) => de_CopyJobsList(_, context), NextToken: __expectString, - RestoreTestingSelections: (_) => de_RestoreTestingSelections(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRestoreTestingSelectionsCommandError + * deserializeAws_restJson1ListCopyJobSummariesCommand */ -const de_ListRestoreTestingSelectionsCommandError = async ( +export const de_ListCopyJobSummariesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AggregationPeriod: __expectString, + CopyJobSummaries: (_) => de_CopyJobSummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsCommand + * deserializeAws_restJson1ListFrameworksCommand */ -export const de_ListTagsCommand = async ( +export const de_ListFrameworksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + Frameworks: (_) => de_FrameworkList(_, context), NextToken: __expectString, - Tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsCommandError + * deserializeAws_restJson1ListLegalHoldsCommand */ -const de_ListTagsCommandError = async ( +export const de_ListLegalHoldsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LegalHolds: (_) => de_LegalHoldsList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutBackupVaultAccessPolicyCommand + * deserializeAws_restJson1ListProtectedResourcesCommand */ -export const de_PutBackupVaultAccessPolicyCommand = async ( +export const de_ListProtectedResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBackupVaultAccessPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Results: (_) => de_ProtectedResourcesList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutBackupVaultAccessPolicyCommandError + * deserializeAws_restJson1ListProtectedResourcesByBackupVaultCommand */ -const de_PutBackupVaultAccessPolicyCommandError = async ( +export const de_ListProtectedResourcesByBackupVaultCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Results: (_) => de_ProtectedResourcesList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutBackupVaultLockConfigurationCommand + * deserializeAws_restJson1ListRecoveryPointsByBackupVaultCommand */ -export const de_PutBackupVaultLockConfigurationCommand = async ( +export const de_ListRecoveryPointsByBackupVaultCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBackupVaultLockConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + RecoveryPoints: (_) => de_RecoveryPointByBackupVaultList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutBackupVaultLockConfigurationCommandError + * deserializeAws_restJson1ListRecoveryPointsByLegalHoldCommand */ -const de_PutBackupVaultLockConfigurationCommandError = async ( +export const de_ListRecoveryPointsByLegalHoldCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + RecoveryPoints: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutBackupVaultNotificationsCommand + * deserializeAws_restJson1ListRecoveryPointsByResourceCommand */ -export const de_PutBackupVaultNotificationsCommand = async ( +export const de_ListRecoveryPointsByResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBackupVaultNotificationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + RecoveryPoints: (_) => de_RecoveryPointByResourceList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutBackupVaultNotificationsCommandError + * deserializeAws_restJson1ListReportJobsCommand */ -const de_PutBackupVaultNotificationsCommandError = async ( +export const de_ListReportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + ReportJobs: (_) => de_ReportJobList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutRestoreValidationResultCommand + * deserializeAws_restJson1ListReportPlansCommand */ -export const de_PutRestoreValidationResultCommand = async ( +export const de_ListReportPlansCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_PutRestoreValidationResultCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + ReportPlans: (_) => de_ReportPlanList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutRestoreValidationResultCommandError + * deserializeAws_restJson1ListRestoreJobsCommand */ -const de_PutRestoreValidationResultCommandError = async ( +export const de_ListRestoreJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + RestoreJobs: (_) => de_RestoreJobsList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartBackupJobCommand + * deserializeAws_restJson1ListRestoreJobsByProtectedResourceCommand */ -export const de_StartBackupJobCommand = async ( +export const de_ListRestoreJobsByProtectedResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartBackupJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - BackupJobId: __expectString, - CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - IsParent: __expectBoolean, - RecoveryPointArn: __expectString, + NextToken: __expectString, + RestoreJobs: (_) => de_RestoreJobsList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartBackupJobCommandError + * deserializeAws_restJson1ListRestoreJobSummariesCommand */ -const de_StartBackupJobCommandError = async ( +export const de_ListRestoreJobSummariesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.backup#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AggregationPeriod: __expectString, + NextToken: __expectString, + RestoreJobSummaries: (_) => de_RestoreJobSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartCopyJobCommand + * deserializeAws_restJson1ListRestoreTestingPlansCommand */ -export const de_StartCopyJobCommand = async ( +export const de_ListRestoreTestingPlansCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartCopyJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CopyJobId: __expectString, - CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - IsParent: __expectBoolean, + NextToken: __expectString, + RestoreTestingPlans: (_) => de_RestoreTestingPlans(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartCopyJobCommandError + * deserializeAws_restJson1ListRestoreTestingSelectionsCommand */ -const de_StartCopyJobCommandError = async ( +export const de_ListRestoreTestingSelectionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.backup#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + RestoreTestingSelections: (_) => de_RestoreTestingSelections(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartReportJobCommand + * deserializeAws_restJson1ListTagsCommand */ -export const de_StartReportJobCommand = async ( +export const de_ListTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartReportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ReportJobId: __expectString, + NextToken: __expectString, + Tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartReportJobCommandError + * deserializeAws_restJson1PutBackupVaultAccessPolicyCommand */ -const de_StartReportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_PutBackupVaultAccessPolicyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1StartRestoreJobCommand + * deserializeAws_restJson1PutBackupVaultLockConfigurationCommand */ -export const de_StartRestoreJobCommand = async ( +export const de_PutBackupVaultLockConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartRestoreJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RestoreJobId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1StartRestoreJobCommandError + * deserializeAws_restJson1PutBackupVaultNotificationsCommand */ -const de_StartRestoreJobCommandError = async ( +export const de_PutBackupVaultNotificationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1StopBackupJobCommand + * deserializeAws_restJson1PutRestoreValidationResultCommand */ -export const de_StopBackupJobCommand = async ( +export const de_PutRestoreValidationResultCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopBackupJobCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6823,275 +3944,191 @@ export const de_StopBackupJobCommand = async ( }; /** - * deserializeAws_restJson1StopBackupJobCommandError + * deserializeAws_restJson1StartBackupJobCommand */ -const de_StopBackupJobCommandError = async ( +export const de_StartBackupJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + BackupJobId: __expectString, + CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + IsParent: __expectBoolean, + RecoveryPointArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1StartCopyJobCommand */ -export const de_TagResourceCommand = async ( +export const de_StartCopyJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CopyJobId: __expectString, + CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + IsParent: __expectBoolean, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1StartReportJobCommand */ -const de_TagResourceCommandError = async ( +export const de_StartReportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.backup#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ReportJobId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1StartRestoreJobCommand */ -export const de_UntagResourceCommand = async ( +export const de_StartRestoreJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RestoreJobId: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1StopBackupJobCommand */ -const de_UntagResourceCommandError = async ( +export const de_StopBackupJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateBackupPlanCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UpdateBackupPlanCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBackupPlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AdvancedBackupSettings: _json, - BackupPlanArn: __expectString, - BackupPlanId: __expectString, - CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - VersionId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1UpdateBackupPlanCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UpdateBackupPlanCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateFrameworkCommand + * deserializeAws_restJson1UpdateBackupPlanCommand */ -export const de_UpdateFrameworkCommand = async ( +export const de_UpdateBackupPlanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFrameworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CreationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - FrameworkArn: __expectString, - FrameworkName: __expectString, + AdvancedBackupSettings: _json, + BackupPlanArn: __expectString, + BackupPlanId: __expectString, + CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + VersionId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateFrameworkCommandError + * deserializeAws_restJson1UpdateFrameworkCommand */ -const de_UpdateFrameworkCommandError = async ( +export const de_UpdateFrameworkCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.backup#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.backup#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.backup#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CreationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + FrameworkArn: __expectString, + FrameworkName: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -7102,7 +4139,7 @@ export const de_UpdateGlobalSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGlobalSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7111,41 +4148,6 @@ export const de_UpdateGlobalSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateGlobalSettingsCommandError - */ -const de_UpdateGlobalSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRecoveryPointLifecycleCommand */ @@ -7154,7 +4156,7 @@ export const de_UpdateRecoveryPointLifecycleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRecoveryPointLifecycleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7170,44 +4172,6 @@ export const de_UpdateRecoveryPointLifecycleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRecoveryPointLifecycleCommandError - */ -const de_UpdateRecoveryPointLifecycleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.backup#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRegionSettingsCommand */ @@ -7216,7 +4180,7 @@ export const de_UpdateRegionSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRegionSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7225,38 +4189,6 @@ export const de_UpdateRegionSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRegionSettingsCommandError - */ -const de_UpdateRegionSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateReportPlanCommand */ @@ -7265,7 +4197,7 @@ export const de_UpdateReportPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateReportPlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7280,44 +4212,6 @@ export const de_UpdateReportPlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateReportPlanCommandError - */ -const de_UpdateReportPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.backup#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRestoreTestingPlanCommand */ @@ -7326,7 +4220,7 @@ export const de_UpdateRestoreTestingPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRestoreTestingPlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7342,44 +4236,6 @@ export const de_UpdateRestoreTestingPlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRestoreTestingPlanCommandError - */ -const de_UpdateRestoreTestingPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.backup#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.backup#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.backup#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backup#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backup#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRestoreTestingSelectionCommand */ @@ -7388,7 +4244,7 @@ export const de_UpdateRestoreTestingSelectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRestoreTestingSelectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7406,24 +4262,21 @@ export const de_UpdateRestoreTestingSelectionCommand = async ( }; /** - * deserializeAws_restJson1UpdateRestoreTestingSelectionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateRestoreTestingSelectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ConflictException": - case "com.amazonaws.backup#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InvalidParameterValueException": case "com.amazonaws.backup#InvalidParameterValueException": throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); + case "InvalidResourceStateException": + case "com.amazonaws.backup#InvalidResourceStateException": + throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); case "MissingParameterValueException": case "com.amazonaws.backup#MissingParameterValueException": throw await de_MissingParameterValueExceptionRes(parsedOutput, context); @@ -7433,13 +4286,28 @@ const de_UpdateRestoreTestingSelectionCommandError = async ( case "ServiceUnavailableException": case "com.amazonaws.backup#ServiceUnavailableException": throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "AlreadyExistsException": + case "com.amazonaws.backup#AlreadyExistsException": + throw await de_AlreadyExistsExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.backup#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.backup#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.backup#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "DependencyFailureException": + case "com.amazonaws.backup#DependencyFailureException": + throw await de_DependencyFailureExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-backupstorage/src/protocols/Aws_restJson1.ts b/clients/client-backupstorage/src/protocols/Aws_restJson1.ts index 9d26f1868154..f66472cd4240 100644 --- a/clients/client-backupstorage/src/protocols/Aws_restJson1.ts +++ b/clients/client-backupstorage/src/protocols/Aws_restJson1.ts @@ -268,7 +268,7 @@ export const de_DeleteObjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -277,50 +277,6 @@ export const de_DeleteObjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteObjectCommandError - */ -const de_DeleteObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.backupstorage#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.backupstorage#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupstorage#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableException": - case "com.amazonaws.backupstorage#RetryableException": - throw await de_RetryableExceptionRes(parsedOutput, context); - case "ServiceInternalException": - case "com.amazonaws.backupstorage#ServiceInternalException": - throw await de_ServiceInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backupstorage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupstorage#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetChunkCommand */ @@ -329,7 +285,7 @@ export const de_GetChunkCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChunkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -343,50 +299,6 @@ export const de_GetChunkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetChunkCommandError - */ -const de_GetChunkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.backupstorage#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.backupstorage#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "KMSInvalidKeyUsageException": - case "com.amazonaws.backupstorage#KMSInvalidKeyUsageException": - throw await de_KMSInvalidKeyUsageExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupstorage#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableException": - case "com.amazonaws.backupstorage#RetryableException": - throw await de_RetryableExceptionRes(parsedOutput, context); - case "ServiceInternalException": - case "com.amazonaws.backupstorage#ServiceInternalException": - throw await de_ServiceInternalExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupstorage#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetObjectMetadataCommand */ @@ -395,7 +307,7 @@ export const de_GetObjectMetadataCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetObjectMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -410,53 +322,6 @@ export const de_GetObjectMetadataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetObjectMetadataCommandError - */ -const de_GetObjectMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.backupstorage#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.backupstorage#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "KMSInvalidKeyUsageException": - case "com.amazonaws.backupstorage#KMSInvalidKeyUsageException": - throw await de_KMSInvalidKeyUsageExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupstorage#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableException": - case "com.amazonaws.backupstorage#RetryableException": - throw await de_RetryableExceptionRes(parsedOutput, context); - case "ServiceInternalException": - case "com.amazonaws.backupstorage#ServiceInternalException": - throw await de_ServiceInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backupstorage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupstorage#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListChunksCommand */ @@ -465,7 +330,7 @@ export const de_ListChunksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChunksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -479,47 +344,6 @@ export const de_ListChunksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListChunksCommandError - */ -const de_ListChunksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.backupstorage#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.backupstorage#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupstorage#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableException": - case "com.amazonaws.backupstorage#RetryableException": - throw await de_RetryableExceptionRes(parsedOutput, context); - case "ServiceInternalException": - case "com.amazonaws.backupstorage#ServiceInternalException": - throw await de_ServiceInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backupstorage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListObjectsCommand */ @@ -528,7 +352,7 @@ export const de_ListObjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListObjectsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -542,53 +366,6 @@ export const de_ListObjectsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListObjectsCommandError - */ -const de_ListObjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.backupstorage#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.backupstorage#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "KMSInvalidKeyUsageException": - case "com.amazonaws.backupstorage#KMSInvalidKeyUsageException": - throw await de_KMSInvalidKeyUsageExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.backupstorage#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableException": - case "com.amazonaws.backupstorage#RetryableException": - throw await de_RetryableExceptionRes(parsedOutput, context); - case "ServiceInternalException": - case "com.amazonaws.backupstorage#ServiceInternalException": - throw await de_ServiceInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backupstorage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupstorage#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1NotifyObjectCompleteCommand */ @@ -597,7 +374,7 @@ export const de_NotifyObjectCompleteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_NotifyObjectCompleteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -611,53 +388,6 @@ export const de_NotifyObjectCompleteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1NotifyObjectCompleteCommandError - */ -const de_NotifyObjectCompleteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.backupstorage#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.backupstorage#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "KMSInvalidKeyUsageException": - case "com.amazonaws.backupstorage#KMSInvalidKeyUsageException": - throw await de_KMSInvalidKeyUsageExceptionRes(parsedOutput, context); - case "NotReadableInputStreamException": - case "com.amazonaws.backupstorage#NotReadableInputStreamException": - throw await de_NotReadableInputStreamExceptionRes(parsedOutput, context); - case "RetryableException": - case "com.amazonaws.backupstorage#RetryableException": - throw await de_RetryableExceptionRes(parsedOutput, context); - case "ServiceInternalException": - case "com.amazonaws.backupstorage#ServiceInternalException": - throw await de_ServiceInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backupstorage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupstorage#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutChunkCommand */ @@ -666,7 +396,7 @@ export const de_PutChunkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutChunkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -680,53 +410,6 @@ export const de_PutChunkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutChunkCommandError - */ -const de_PutChunkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.backupstorage#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.backupstorage#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "KMSInvalidKeyUsageException": - case "com.amazonaws.backupstorage#KMSInvalidKeyUsageException": - throw await de_KMSInvalidKeyUsageExceptionRes(parsedOutput, context); - case "NotReadableInputStreamException": - case "com.amazonaws.backupstorage#NotReadableInputStreamException": - throw await de_NotReadableInputStreamExceptionRes(parsedOutput, context); - case "RetryableException": - case "com.amazonaws.backupstorage#RetryableException": - throw await de_RetryableExceptionRes(parsedOutput, context); - case "ServiceInternalException": - case "com.amazonaws.backupstorage#ServiceInternalException": - throw await de_ServiceInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backupstorage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupstorage#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutObjectCommand */ @@ -735,7 +418,7 @@ export const de_PutObjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -751,53 +434,6 @@ export const de_PutObjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutObjectCommandError - */ -const de_PutObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.backupstorage#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.backupstorage#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "KMSInvalidKeyUsageException": - case "com.amazonaws.backupstorage#KMSInvalidKeyUsageException": - throw await de_KMSInvalidKeyUsageExceptionRes(parsedOutput, context); - case "NotReadableInputStreamException": - case "com.amazonaws.backupstorage#NotReadableInputStreamException": - throw await de_NotReadableInputStreamExceptionRes(parsedOutput, context); - case "RetryableException": - case "com.amazonaws.backupstorage#RetryableException": - throw await de_RetryableExceptionRes(parsedOutput, context); - case "ServiceInternalException": - case "com.amazonaws.backupstorage#ServiceInternalException": - throw await de_ServiceInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.backupstorage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.backupstorage#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartObjectCommand */ @@ -806,7 +442,7 @@ export const de_StartObjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -820,12 +456,9 @@ export const de_StartObjectCommand = async ( }; /** - * deserializeAws_restJson1StartObjectCommandError + * deserialize_Aws_restJson1CommandError */ -const de_StartObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -835,9 +468,6 @@ const de_StartObjectCommandError = async ( case "AccessDeniedException": case "com.amazonaws.backupstorage#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DataAlreadyExistsException": - case "com.amazonaws.backupstorage#DataAlreadyExistsException": - throw await de_DataAlreadyExistsExceptionRes(parsedOutput, context); case "IllegalArgumentException": case "com.amazonaws.backupstorage#IllegalArgumentException": throw await de_IllegalArgumentExceptionRes(parsedOutput, context); @@ -856,13 +486,22 @@ const de_StartObjectCommandError = async ( case "ThrottlingException": case "com.amazonaws.backupstorage#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "KMSInvalidKeyUsageException": + case "com.amazonaws.backupstorage#KMSInvalidKeyUsageException": + throw await de_KMSInvalidKeyUsageExceptionRes(parsedOutput, context); + case "NotReadableInputStreamException": + case "com.amazonaws.backupstorage#NotReadableInputStreamException": + throw await de_NotReadableInputStreamExceptionRes(parsedOutput, context); + case "DataAlreadyExistsException": + case "com.amazonaws.backupstorage#DataAlreadyExistsException": + throw await de_DataAlreadyExistsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-batch/src/protocols/Aws_restJson1.ts b/clients/client-batch/src/protocols/Aws_restJson1.ts index 4c110a316830..5c012e569c1d 100644 --- a/clients/client-batch/src/protocols/Aws_restJson1.ts +++ b/clients/client-batch/src/protocols/Aws_restJson1.ts @@ -745,7 +745,7 @@ export const de_CancelJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -754,35 +754,6 @@ export const de_CancelJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelJobCommandError - */ -const de_CancelJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateComputeEnvironmentCommand */ @@ -791,7 +762,7 @@ export const de_CreateComputeEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateComputeEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -805,35 +776,6 @@ export const de_CreateComputeEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateComputeEnvironmentCommandError - */ -const de_CreateComputeEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateJobQueueCommand */ @@ -842,7 +784,7 @@ export const de_CreateJobQueueCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateJobQueueCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -856,35 +798,6 @@ export const de_CreateJobQueueCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateJobQueueCommandError - */ -const de_CreateJobQueueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSchedulingPolicyCommand */ @@ -893,7 +806,7 @@ export const de_CreateSchedulingPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSchedulingPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -907,35 +820,6 @@ export const de_CreateSchedulingPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSchedulingPolicyCommandError - */ -const de_CreateSchedulingPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteComputeEnvironmentCommand */ @@ -944,7 +828,7 @@ export const de_DeleteComputeEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteComputeEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -953,35 +837,6 @@ export const de_DeleteComputeEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteComputeEnvironmentCommandError - */ -const de_DeleteComputeEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteJobQueueCommand */ @@ -990,7 +845,7 @@ export const de_DeleteJobQueueCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteJobQueueCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -999,35 +854,6 @@ export const de_DeleteJobQueueCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteJobQueueCommandError - */ -const de_DeleteJobQueueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSchedulingPolicyCommand */ @@ -1036,7 +862,7 @@ export const de_DeleteSchedulingPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSchedulingPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1045,35 +871,6 @@ export const de_DeleteSchedulingPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSchedulingPolicyCommandError - */ -const de_DeleteSchedulingPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeregisterJobDefinitionCommand */ @@ -1082,7 +879,7 @@ export const de_DeregisterJobDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeregisterJobDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1091,35 +888,6 @@ export const de_DeregisterJobDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeregisterJobDefinitionCommandError - */ -const de_DeregisterJobDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeComputeEnvironmentsCommand */ @@ -1128,7 +896,7 @@ export const de_DescribeComputeEnvironmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeComputeEnvironmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1142,35 +910,6 @@ export const de_DescribeComputeEnvironmentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeComputeEnvironmentsCommandError - */ -const de_DescribeComputeEnvironmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeJobDefinitionsCommand */ @@ -1179,7 +918,7 @@ export const de_DescribeJobDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1193,35 +932,6 @@ export const de_DescribeJobDefinitionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeJobDefinitionsCommandError - */ -const de_DescribeJobDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeJobQueuesCommand */ @@ -1230,7 +940,7 @@ export const de_DescribeJobQueuesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobQueuesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1244,35 +954,6 @@ export const de_DescribeJobQueuesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeJobQueuesCommandError - */ -const de_DescribeJobQueuesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeJobsCommand */ @@ -1281,7 +962,7 @@ export const de_DescribeJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1294,35 +975,6 @@ export const de_DescribeJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeJobsCommandError - */ -const de_DescribeJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeSchedulingPoliciesCommand */ @@ -1331,148 +983,61 @@ export const de_DescribeSchedulingPoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSchedulingPoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - schedulingPolicies: (_) => de_SchedulingPolicyDetailList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeSchedulingPoliciesCommandError - */ -const de_DescribeSchedulingPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListJobsCommand - */ -export const de_ListJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - jobSummaryList: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListJobsCommandError - */ -const de_ListJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + schedulingPolicies: (_) => de_SchedulingPolicyDetailList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListSchedulingPoliciesCommand + * deserializeAws_restJson1ListJobsCommand */ -export const de_ListSchedulingPoliciesCommand = async ( +export const de_ListJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSchedulingPoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + jobSummaryList: _json, nextToken: __expectString, - schedulingPolicies: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSchedulingPoliciesCommandError + * deserializeAws_restJson1ListSchedulingPoliciesCommand */ -const de_ListSchedulingPoliciesCommandError = async ( +export const de_ListSchedulingPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + schedulingPolicies: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1483,7 +1048,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1496,35 +1061,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RegisterJobDefinitionCommand */ @@ -1533,7 +1069,7 @@ export const de_RegisterJobDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterJobDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1548,35 +1084,6 @@ export const de_RegisterJobDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RegisterJobDefinitionCommandError - */ -const de_RegisterJobDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SubmitJobCommand */ @@ -1585,7 +1092,7 @@ export const de_SubmitJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SubmitJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1600,35 +1107,6 @@ export const de_SubmitJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SubmitJobCommandError - */ -const de_SubmitJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1637,7 +1115,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1646,35 +1124,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TerminateJobCommand */ @@ -1683,7 +1132,7 @@ export const de_TerminateJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TerminateJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1692,35 +1141,6 @@ export const de_TerminateJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TerminateJobCommandError - */ -const de_TerminateJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1729,7 +1149,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1738,35 +1158,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateComputeEnvironmentCommand */ @@ -1775,7 +1166,7 @@ export const de_UpdateComputeEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateComputeEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1789,35 +1180,6 @@ export const de_UpdateComputeEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateComputeEnvironmentCommandError - */ -const de_UpdateComputeEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateJobQueueCommand */ @@ -1826,7 +1188,7 @@ export const de_UpdateJobQueueCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateJobQueueCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1840,35 +1202,6 @@ export const de_UpdateJobQueueCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateJobQueueCommandError - */ -const de_UpdateJobQueueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.batch#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.batch#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSchedulingPolicyCommand */ @@ -1877,7 +1210,7 @@ export const de_UpdateSchedulingPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSchedulingPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1887,12 +1220,9 @@ export const de_UpdateSchedulingPolicyCommand = async ( }; /** - * deserializeAws_restJson1UpdateSchedulingPolicyCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateSchedulingPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1911,7 +1241,7 @@ const de_UpdateSchedulingPolicyCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-bcm-data-exports/src/protocols/Aws_json1_1.ts b/clients/client-bcm-data-exports/src/protocols/Aws_json1_1.ts index 2b432bd717af..acf99e9a1528 100644 --- a/clients/client-bcm-data-exports/src/protocols/Aws_json1_1.ts +++ b/clients/client-bcm-data-exports/src/protocols/Aws_json1_1.ts @@ -232,7 +232,7 @@ export const de_CreateExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateExportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -244,41 +244,6 @@ export const de_CreateExportCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateExportCommandError - */ -const de_CreateExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.bcmdataexports#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bcmdataexports#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bcmdataexports#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bcmdataexports#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteExportCommand */ @@ -287,7 +252,7 @@ export const de_DeleteExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteExportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -299,41 +264,6 @@ export const de_DeleteExportCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteExportCommandError - */ -const de_DeleteExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.bcmdataexports#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bcmdataexports#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bcmdataexports#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bcmdataexports#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetExecutionCommand */ @@ -342,7 +272,7 @@ export const de_GetExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -354,41 +284,6 @@ export const de_GetExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetExecutionCommandError - */ -const de_GetExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.bcmdataexports#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bcmdataexports#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bcmdataexports#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bcmdataexports#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetExportCommand */ @@ -397,7 +292,7 @@ export const de_GetExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetExportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -409,41 +304,6 @@ export const de_GetExportCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetExportCommandError - */ -const de_GetExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.bcmdataexports#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bcmdataexports#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bcmdataexports#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bcmdataexports#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetTableCommand */ @@ -452,7 +312,7 @@ export const de_GetTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -464,38 +324,6 @@ export const de_GetTableCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetTableCommandError - */ -const de_GetTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.bcmdataexports#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bcmdataexports#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bcmdataexports#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListExecutionsCommand */ @@ -504,7 +332,7 @@ export const de_ListExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -516,41 +344,6 @@ export const de_ListExecutionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListExecutionsCommandError - */ -const de_ListExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.bcmdataexports#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bcmdataexports#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bcmdataexports#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bcmdataexports#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListExportsCommand */ @@ -559,7 +352,7 @@ export const de_ListExportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListExportsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -571,38 +364,6 @@ export const de_ListExportsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListExportsCommandError - */ -const de_ListExportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.bcmdataexports#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bcmdataexports#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bcmdataexports#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTablesCommand */ @@ -611,7 +372,7 @@ export const de_ListTablesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTablesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -623,38 +384,6 @@ export const de_ListTablesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTablesCommandError - */ -const de_ListTablesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.bcmdataexports#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bcmdataexports#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bcmdataexports#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -663,7 +392,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -675,41 +404,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.bcmdataexports#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bcmdataexports#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bcmdataexports#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bcmdataexports#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -718,7 +412,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -730,41 +424,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.bcmdataexports#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bcmdataexports#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bcmdataexports#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bcmdataexports#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -773,7 +432,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -785,41 +444,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.bcmdataexports#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bcmdataexports#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bcmdataexports#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bcmdataexports#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateExportCommand */ @@ -828,7 +452,7 @@ export const de_UpdateExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateExportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -841,12 +465,9 @@ export const de_UpdateExportCommand = async ( }; /** - * deserializeAws_json1_1UpdateExportCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -856,22 +477,25 @@ const de_UpdateExportCommandError = async ( case "InternalServerException": case "com.amazonaws.bcmdataexports#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bcmdataexports#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bcmdataexports#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.bcmdataexports#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.bcmdataexports#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.bcmdataexports#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts b/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts index 5d0d5ce21fe1..80ea152ba27d 100644 --- a/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts @@ -147,7 +147,7 @@ export const de_InvokeAgentCommand = async ( context: __SerdeContext & __EventStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_InvokeAgentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -159,56 +159,6 @@ export const de_InvokeAgentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1InvokeAgentCommandError - */ -const de_InvokeAgentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagentruntime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadGatewayException": - case "com.amazonaws.bedrockagentruntime#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagentruntime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DependencyFailedException": - case "com.amazonaws.bedrockagentruntime#DependencyFailedException": - throw await de_DependencyFailedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagentruntime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagentruntime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagentruntime#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagentruntime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RetrieveCommand */ @@ -217,7 +167,7 @@ export const de_RetrieveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RetrieveCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -231,56 +181,6 @@ export const de_RetrieveCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RetrieveCommandError - */ -const de_RetrieveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagentruntime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadGatewayException": - case "com.amazonaws.bedrockagentruntime#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagentruntime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DependencyFailedException": - case "com.amazonaws.bedrockagentruntime#DependencyFailedException": - throw await de_DependencyFailedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagentruntime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagentruntime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagentruntime#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagentruntime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RetrieveAndGenerateCommand */ @@ -289,7 +189,7 @@ export const de_RetrieveAndGenerateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RetrieveAndGenerateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -305,12 +205,9 @@ export const de_RetrieveAndGenerateCommand = async ( }; /** - * deserializeAws_restJson1RetrieveAndGenerateCommandError + * deserialize_Aws_restJson1CommandError */ -const de_RetrieveAndGenerateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -350,7 +247,7 @@ const de_RetrieveAndGenerateCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts b/clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts index 44f752c625e3..78e7b5449d74 100644 --- a/clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts +++ b/clients/client-bedrock-agent/src/protocols/Aws_restJson1.ts @@ -1069,7 +1069,7 @@ export const de_AssociateAgentKnowledgeBaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateAgentKnowledgeBaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1082,50 +1082,6 @@ export const de_AssociateAgentKnowledgeBaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateAgentKnowledgeBaseCommandError - */ -const de_AssociateAgentKnowledgeBaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAgentCommand */ @@ -1134,7 +1090,7 @@ export const de_CreateAgentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateAgentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1147,47 +1103,6 @@ export const de_CreateAgentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAgentCommandError - */ -const de_CreateAgentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAgentActionGroupCommand */ @@ -1196,7 +1111,7 @@ export const de_CreateAgentActionGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAgentActionGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1209,50 +1124,6 @@ export const de_CreateAgentActionGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAgentActionGroupCommandError - */ -const de_CreateAgentActionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAgentAliasCommand */ @@ -1261,7 +1132,7 @@ export const de_CreateAgentAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateAgentAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1274,50 +1145,6 @@ export const de_CreateAgentAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAgentAliasCommandError - */ -const de_CreateAgentAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDataSourceCommand */ @@ -1326,7 +1153,7 @@ export const de_CreateDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1339,50 +1166,6 @@ export const de_CreateDataSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDataSourceCommandError - */ -const de_CreateDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateKnowledgeBaseCommand */ @@ -1391,7 +1174,7 @@ export const de_CreateKnowledgeBaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateKnowledgeBaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1404,47 +1187,6 @@ export const de_CreateKnowledgeBaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateKnowledgeBaseCommandError - */ -const de_CreateKnowledgeBaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAgentCommand */ @@ -1453,7 +1195,7 @@ export const de_DeleteAgentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteAgentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1468,55 +1210,14 @@ export const de_DeleteAgentCommand = async ( }; /** - * deserializeAws_restJson1DeleteAgentCommandError + * deserializeAws_restJson1DeleteAgentActionGroupCommand */ -const de_DeleteAgentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAgentActionGroupCommand - */ -export const de_DeleteAgentActionGroupCommand = async ( +export const de_DeleteAgentActionGroupCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAgentActionGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1525,47 +1226,6 @@ export const de_DeleteAgentActionGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAgentActionGroupCommandError - */ -const de_DeleteAgentActionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAgentAliasCommand */ @@ -1574,7 +1234,7 @@ export const de_DeleteAgentAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteAgentAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1589,44 +1249,6 @@ export const de_DeleteAgentAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAgentAliasCommandError - */ -const de_DeleteAgentAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAgentVersionCommand */ @@ -1635,7 +1257,7 @@ export const de_DeleteAgentVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteAgentVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1650,47 +1272,6 @@ export const de_DeleteAgentVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAgentVersionCommandError - */ -const de_DeleteAgentVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDataSourceCommand */ @@ -1699,7 +1280,7 @@ export const de_DeleteDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1714,47 +1295,6 @@ export const de_DeleteDataSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDataSourceCommandError - */ -const de_DeleteDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteKnowledgeBaseCommand */ @@ -1763,7 +1303,7 @@ export const de_DeleteKnowledgeBaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteKnowledgeBaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1777,47 +1317,6 @@ export const de_DeleteKnowledgeBaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteKnowledgeBaseCommandError - */ -const de_DeleteKnowledgeBaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateAgentKnowledgeBaseCommand */ @@ -1826,7 +1325,7 @@ export const de_DisassociateAgentKnowledgeBaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DisassociateAgentKnowledgeBaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1835,47 +1334,6 @@ export const de_DisassociateAgentKnowledgeBaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateAgentKnowledgeBaseCommandError - */ -const de_DisassociateAgentKnowledgeBaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAgentCommand */ @@ -1884,7 +1342,7 @@ export const de_GetAgentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAgentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1898,52 +1356,14 @@ export const de_GetAgentCommand = async ( }; /** - * deserializeAws_restJson1GetAgentCommandError + * deserializeAws_restJson1GetAgentActionGroupCommand */ -const de_GetAgentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAgentActionGroupCommand - */ -export const de_GetAgentActionGroupCommand = async ( +export const de_GetAgentActionGroupCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAgentActionGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1956,44 +1376,6 @@ export const de_GetAgentActionGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAgentActionGroupCommandError - */ -const de_GetAgentActionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAgentAliasCommand */ @@ -2002,7 +1384,7 @@ export const de_GetAgentAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAgentAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2015,44 +1397,6 @@ export const de_GetAgentAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAgentAliasCommandError - */ -const de_GetAgentAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAgentKnowledgeBaseCommand */ @@ -2061,7 +1405,7 @@ export const de_GetAgentKnowledgeBaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAgentKnowledgeBaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2074,44 +1418,6 @@ export const de_GetAgentKnowledgeBaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAgentKnowledgeBaseCommandError - */ -const de_GetAgentKnowledgeBaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAgentVersionCommand */ @@ -2120,7 +1426,7 @@ export const de_GetAgentVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAgentVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2133,44 +1439,6 @@ export const de_GetAgentVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAgentVersionCommandError - */ -const de_GetAgentVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDataSourceCommand */ @@ -2179,7 +1447,7 @@ export const de_GetDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2192,44 +1460,6 @@ export const de_GetDataSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDataSourceCommandError - */ -const de_GetDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIngestionJobCommand */ @@ -2238,7 +1468,7 @@ export const de_GetIngestionJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIngestionJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2251,44 +1481,6 @@ export const de_GetIngestionJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetIngestionJobCommandError - */ -const de_GetIngestionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetKnowledgeBaseCommand */ @@ -2297,7 +1489,7 @@ export const de_GetKnowledgeBaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetKnowledgeBaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2311,52 +1503,14 @@ export const de_GetKnowledgeBaseCommand = async ( }; /** - * deserializeAws_restJson1GetKnowledgeBaseCommandError + * deserializeAws_restJson1ListAgentActionGroupsCommand */ -const de_GetKnowledgeBaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAgentActionGroupsCommand - */ -export const de_ListAgentActionGroupsCommand = async ( +export const de_ListAgentActionGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAgentActionGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2370,44 +1524,6 @@ export const de_ListAgentActionGroupsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAgentActionGroupsCommandError - */ -const de_ListAgentActionGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAgentAliasesCommand */ @@ -2416,7 +1532,7 @@ export const de_ListAgentAliasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAgentAliasesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2430,44 +1546,6 @@ export const de_ListAgentAliasesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAgentAliasesCommandError - */ -const de_ListAgentAliasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAgentKnowledgeBasesCommand */ @@ -2476,7 +1554,7 @@ export const de_ListAgentKnowledgeBasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAgentKnowledgeBasesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2490,44 +1568,6 @@ export const de_ListAgentKnowledgeBasesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAgentKnowledgeBasesCommandError - */ -const de_ListAgentKnowledgeBasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAgentsCommand */ @@ -2536,7 +1576,7 @@ export const de_ListAgentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAgentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2550,41 +1590,6 @@ export const de_ListAgentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAgentsCommandError - */ -const de_ListAgentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAgentVersionsCommand */ @@ -2593,7 +1598,7 @@ export const de_ListAgentVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAgentVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2607,44 +1612,6 @@ export const de_ListAgentVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAgentVersionsCommandError - */ -const de_ListAgentVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDataSourcesCommand */ @@ -2653,7 +1620,7 @@ export const de_ListDataSourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataSourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2667,44 +1634,6 @@ export const de_ListDataSourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDataSourcesCommandError - */ -const de_ListDataSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIngestionJobsCommand */ @@ -2713,7 +1642,7 @@ export const de_ListIngestionJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIngestionJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2727,44 +1656,6 @@ export const de_ListIngestionJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListIngestionJobsCommandError - */ -const de_ListIngestionJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListKnowledgeBasesCommand */ @@ -2773,7 +1664,7 @@ export const de_ListKnowledgeBasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKnowledgeBasesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2787,41 +1678,6 @@ export const de_ListKnowledgeBasesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListKnowledgeBasesCommandError - */ -const de_ListKnowledgeBasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -2830,7 +1686,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2843,44 +1699,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PrepareAgentCommand */ @@ -2889,7 +1707,7 @@ export const de_PrepareAgentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_PrepareAgentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2905,50 +1723,6 @@ export const de_PrepareAgentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PrepareAgentCommandError - */ -const de_PrepareAgentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartIngestionJobCommand */ @@ -2956,131 +1730,29 @@ export const de_StartIngestionJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartIngestionJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ingestionJob: (_) => de_IngestionJob(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartIngestionJobCommandError - */ -const de_StartIngestionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ingestionJob: (_) => de_IngestionJob(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UntagResourceCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3090,41 +1762,20 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -3135,7 +1786,7 @@ export const de_UpdateAgentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateAgentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3148,50 +1799,6 @@ export const de_UpdateAgentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAgentCommandError - */ -const de_UpdateAgentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAgentActionGroupCommand */ @@ -3200,7 +1807,7 @@ export const de_UpdateAgentActionGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAgentActionGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3213,50 +1820,6 @@ export const de_UpdateAgentActionGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAgentActionGroupCommandError - */ -const de_UpdateAgentActionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAgentAliasCommand */ @@ -3265,7 +1828,7 @@ export const de_UpdateAgentAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateAgentAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3278,50 +1841,6 @@ export const de_UpdateAgentAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAgentAliasCommandError - */ -const de_UpdateAgentAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAgentKnowledgeBaseCommand */ @@ -3330,7 +1849,7 @@ export const de_UpdateAgentKnowledgeBaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAgentKnowledgeBaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3343,47 +1862,6 @@ export const de_UpdateAgentKnowledgeBaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAgentKnowledgeBaseCommandError - */ -const de_UpdateAgentKnowledgeBaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDataSourceCommand */ @@ -3392,7 +1870,7 @@ export const de_UpdateDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3405,47 +1883,6 @@ export const de_UpdateDataSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDataSourceCommandError - */ -const de_UpdateDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockagent#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrockagent#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockagent#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockagent#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockagent#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockagent#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateKnowledgeBaseCommand */ @@ -3454,7 +1891,7 @@ export const de_UpdateKnowledgeBaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateKnowledgeBaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3468,12 +1905,9 @@ export const de_UpdateKnowledgeBaseCommand = async ( }; /** - * deserializeAws_restJson1UpdateKnowledgeBaseCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateKnowledgeBaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3492,6 +1926,9 @@ const de_UpdateKnowledgeBaseCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.bedrockagent#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bedrockagent#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.bedrockagent#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -3504,7 +1941,7 @@ const de_UpdateKnowledgeBaseCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-bedrock-runtime/src/protocols/Aws_restJson1.ts b/clients/client-bedrock-runtime/src/protocols/Aws_restJson1.ts index 50194f67b38a..72248344fd37 100644 --- a/clients/client-bedrock-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-bedrock-runtime/src/protocols/Aws_restJson1.ts @@ -92,7 +92,7 @@ export const de_InvokeModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_InvokeModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -103,56 +103,6 @@ export const de_InvokeModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1InvokeModelCommandError - */ -const de_InvokeModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrockruntime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrockruntime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ModelErrorException": - case "com.amazonaws.bedrockruntime#ModelErrorException": - throw await de_ModelErrorExceptionRes(parsedOutput, context); - case "ModelNotReadyException": - case "com.amazonaws.bedrockruntime#ModelNotReadyException": - throw await de_ModelNotReadyExceptionRes(parsedOutput, context); - case "ModelTimeoutException": - case "com.amazonaws.bedrockruntime#ModelTimeoutException": - throw await de_ModelTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrockruntime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrockruntime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrockruntime#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrockruntime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1InvokeModelWithResponseStreamCommand */ @@ -161,7 +111,7 @@ export const de_InvokeModelWithResponseStreamCommand = async ( context: __SerdeContext & __EventStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_InvokeModelWithResponseStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -173,12 +123,9 @@ export const de_InvokeModelWithResponseStreamCommand = async ( }; /** - * deserializeAws_restJson1InvokeModelWithResponseStreamCommandError + * deserialize_Aws_restJson1CommandError */ -const de_InvokeModelWithResponseStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -197,9 +144,6 @@ const de_InvokeModelWithResponseStreamCommandError = async ( case "ModelNotReadyException": case "com.amazonaws.bedrockruntime#ModelNotReadyException": throw await de_ModelNotReadyExceptionRes(parsedOutput, context); - case "ModelStreamErrorException": - case "com.amazonaws.bedrockruntime#ModelStreamErrorException": - throw await de_ModelStreamErrorExceptionRes(parsedOutput, context); case "ModelTimeoutException": case "com.amazonaws.bedrockruntime#ModelTimeoutException": throw await de_ModelTimeoutExceptionRes(parsedOutput, context); @@ -215,13 +159,16 @@ const de_InvokeModelWithResponseStreamCommandError = async ( case "ValidationException": case "com.amazonaws.bedrockruntime#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ModelStreamErrorException": + case "com.amazonaws.bedrockruntime#ModelStreamErrorException": + throw await de_ModelStreamErrorExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-bedrock/src/protocols/Aws_restJson1.ts b/clients/client-bedrock/src/protocols/Aws_restJson1.ts index 70de1ceb6049..4960a1c66ab7 100644 --- a/clients/client-bedrock/src/protocols/Aws_restJson1.ts +++ b/clients/client-bedrock/src/protocols/Aws_restJson1.ts @@ -560,7 +560,7 @@ export const de_CreateModelCustomizationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateModelCustomizationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -573,53 +573,6 @@ export const de_CreateModelCustomizationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateModelCustomizationJobCommandError - */ -const de_CreateModelCustomizationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrock#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrock#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrock#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.bedrock#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProvisionedModelThroughputCommand */ @@ -628,7 +581,7 @@ export const de_CreateProvisionedModelThroughputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateProvisionedModelThroughputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -641,50 +594,6 @@ export const de_CreateProvisionedModelThroughputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProvisionedModelThroughputCommandError - */ -const de_CreateProvisionedModelThroughputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrock#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.bedrock#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.bedrock#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteCustomModelCommand */ @@ -693,7 +602,7 @@ export const de_DeleteCustomModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCustomModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -702,47 +611,6 @@ export const de_DeleteCustomModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteCustomModelCommandError - */ -const de_DeleteCustomModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrock#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrock#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteModelInvocationLoggingConfigurationCommand */ @@ -751,7 +619,7 @@ export const de_DeleteModelInvocationLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteModelInvocationLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -760,38 +628,6 @@ export const de_DeleteModelInvocationLoggingConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteModelInvocationLoggingConfigurationCommandError - */ -const de_DeleteModelInvocationLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteProvisionedModelThroughputCommand */ @@ -800,7 +636,7 @@ export const de_DeleteProvisionedModelThroughputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProvisionedModelThroughputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -809,47 +645,6 @@ export const de_DeleteProvisionedModelThroughputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteProvisionedModelThroughputCommandError - */ -const de_DeleteProvisionedModelThroughputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrock#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrock#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCustomModelCommand */ @@ -858,7 +653,7 @@ export const de_GetCustomModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCustomModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -884,44 +679,6 @@ export const de_GetCustomModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCustomModelCommandError - */ -const de_GetCustomModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrock#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetFoundationModelCommand */ @@ -930,7 +687,7 @@ export const de_GetFoundationModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFoundationModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -943,44 +700,6 @@ export const de_GetFoundationModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetFoundationModelCommandError - */ -const de_GetFoundationModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrock#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetModelCustomizationJobCommand */ @@ -989,7 +708,7 @@ export const de_GetModelCustomizationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetModelCustomizationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1022,44 +741,6 @@ export const de_GetModelCustomizationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetModelCustomizationJobCommandError - */ -const de_GetModelCustomizationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrock#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetModelInvocationLoggingConfigurationCommand */ @@ -1068,7 +749,7 @@ export const de_GetModelInvocationLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetModelInvocationLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1081,38 +762,6 @@ export const de_GetModelInvocationLoggingConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetModelInvocationLoggingConfigurationCommandError - */ -const de_GetModelInvocationLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetProvisionedModelThroughputCommand */ @@ -1121,7 +770,7 @@ export const de_GetProvisionedModelThroughputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProvisionedModelThroughputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1146,44 +795,6 @@ export const de_GetProvisionedModelThroughputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetProvisionedModelThroughputCommandError - */ -const de_GetProvisionedModelThroughputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrock#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCustomModelsCommand */ @@ -1192,7 +803,7 @@ export const de_ListCustomModelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCustomModelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1206,41 +817,6 @@ export const de_ListCustomModelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCustomModelsCommandError - */ -const de_ListCustomModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListFoundationModelsCommand */ @@ -1249,7 +825,7 @@ export const de_ListFoundationModelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFoundationModelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1258,43 +834,8 @@ export const de_ListFoundationModelsCommand = async ( const doc = take(data, { modelSummaries: _json, }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListFoundationModelsCommandError - */ -const de_ListFoundationModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Object.assign(contents, doc); + return contents; }; /** @@ -1305,7 +846,7 @@ export const de_ListModelCustomizationJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListModelCustomizationJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1319,41 +860,6 @@ export const de_ListModelCustomizationJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListModelCustomizationJobsCommandError - */ -const de_ListModelCustomizationJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProvisionedModelThroughputsCommand */ @@ -1362,7 +868,7 @@ export const de_ListProvisionedModelThroughputsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProvisionedModelThroughputsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1376,41 +882,6 @@ export const de_ListProvisionedModelThroughputsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListProvisionedModelThroughputsCommandError - */ -const de_ListProvisionedModelThroughputsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1419,7 +890,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1432,44 +903,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrock#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutModelInvocationLoggingConfigurationCommand */ @@ -1478,7 +911,7 @@ export const de_PutModelInvocationLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutModelInvocationLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1487,41 +920,6 @@ export const de_PutModelInvocationLoggingConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutModelInvocationLoggingConfigurationCommandError - */ -const de_PutModelInvocationLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopModelCustomizationJobCommand */ @@ -1530,7 +928,7 @@ export const de_StopModelCustomizationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopModelCustomizationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1539,47 +937,6 @@ export const de_StopModelCustomizationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopModelCustomizationJobCommandError - */ -const de_StopModelCustomizationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.bedrock#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrock#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1588,7 +945,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1597,47 +954,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrock#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.bedrock#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1646,7 +962,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1655,44 +971,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.bedrock#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.bedrock#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.bedrock#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.bedrock#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.bedrock#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateProvisionedModelThroughputCommand */ @@ -1701,7 +979,7 @@ export const de_UpdateProvisionedModelThroughputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProvisionedModelThroughputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1711,12 +989,9 @@ export const de_UpdateProvisionedModelThroughputCommand = async ( }; /** - * deserializeAws_restJson1UpdateProvisionedModelThroughputCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateProvisionedModelThroughputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1726,15 +1001,24 @@ const de_UpdateProvisionedModelThroughputCommandError = async ( case "AccessDeniedException": case "com.amazonaws.bedrock#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.bedrock#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.bedrock#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.bedrock#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.bedrock#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.bedrock#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.bedrock#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.bedrock#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); @@ -1744,7 +1028,7 @@ const de_UpdateProvisionedModelThroughputCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-billingconductor/src/protocols/Aws_restJson1.ts b/clients/client-billingconductor/src/protocols/Aws_restJson1.ts index dbd1b05e35a2..e0f7dd245dad 100644 --- a/clients/client-billingconductor/src/protocols/Aws_restJson1.ts +++ b/clients/client-billingconductor/src/protocols/Aws_restJson1.ts @@ -947,7 +947,7 @@ export const de_AssociateAccountsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateAccountsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -960,50 +960,6 @@ export const de_AssociateAccountsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateAccountsCommandError - */ -const de_AssociateAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.billingconductor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceLimitExceededException": - case "com.amazonaws.billingconductor#ServiceLimitExceededException": - throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociatePricingRulesCommand */ @@ -1012,7 +968,7 @@ export const de_AssociatePricingRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociatePricingRulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1025,50 +981,6 @@ export const de_AssociatePricingRulesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociatePricingRulesCommandError - */ -const de_AssociatePricingRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.billingconductor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceLimitExceededException": - case "com.amazonaws.billingconductor#ServiceLimitExceededException": - throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchAssociateResourcesToCustomLineItemCommand */ @@ -1077,7 +989,7 @@ export const de_BatchAssociateResourcesToCustomLineItemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchAssociateResourcesToCustomLineItemCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1091,50 +1003,6 @@ export const de_BatchAssociateResourcesToCustomLineItemCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchAssociateResourcesToCustomLineItemCommandError - */ -const de_BatchAssociateResourcesToCustomLineItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.billingconductor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceLimitExceededException": - case "com.amazonaws.billingconductor#ServiceLimitExceededException": - throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDisassociateResourcesFromCustomLineItemCommand */ @@ -1143,7 +1011,7 @@ export const de_BatchDisassociateResourcesFromCustomLineItemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDisassociateResourcesFromCustomLineItemCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1157,47 +1025,6 @@ export const de_BatchDisassociateResourcesFromCustomLineItemCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDisassociateResourcesFromCustomLineItemCommandError - */ -const de_BatchDisassociateResourcesFromCustomLineItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.billingconductor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBillingGroupCommand */ @@ -1206,7 +1033,7 @@ export const de_CreateBillingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBillingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1219,47 +1046,6 @@ export const de_CreateBillingGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBillingGroupCommandError - */ -const de_CreateBillingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.billingconductor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceLimitExceededException": - case "com.amazonaws.billingconductor#ServiceLimitExceededException": - throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCustomLineItemCommand */ @@ -1268,7 +1054,7 @@ export const de_CreateCustomLineItemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCustomLineItemCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1282,55 +1068,35 @@ export const de_CreateCustomLineItemCommand = async ( }; /** - * deserializeAws_restJson1CreateCustomLineItemCommandError + * deserializeAws_restJson1CreatePricingPlanCommand */ -const de_CreateCustomLineItemCommandError = async ( +export const de_CreatePricingPlanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.billingconductor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceLimitExceededException": - case "com.amazonaws.billingconductor#ServiceLimitExceededException": - throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreatePricingPlanCommand + * deserializeAws_restJson1CreatePricingRuleCommand */ -export const de_CreatePricingPlanCommand = async ( +export const de_CreatePricingRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePricingPlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1344,120 +1110,14 @@ export const de_CreatePricingPlanCommand = async ( }; /** - * deserializeAws_restJson1CreatePricingPlanCommandError + * deserializeAws_restJson1DeleteBillingGroupCommand */ -const de_CreatePricingPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.billingconductor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceLimitExceededException": - case "com.amazonaws.billingconductor#ServiceLimitExceededException": - throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreatePricingRuleCommand - */ -export const de_CreatePricingRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePricingRuleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreatePricingRuleCommandError - */ -const de_CreatePricingRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.billingconductor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceLimitExceededException": - case "com.amazonaws.billingconductor#ServiceLimitExceededException": - throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteBillingGroupCommand - */ -export const de_DeleteBillingGroupCommand = async ( +export const de_DeleteBillingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBillingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1470,41 +1130,6 @@ export const de_DeleteBillingGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteBillingGroupCommandError - */ -const de_DeleteBillingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteCustomLineItemCommand */ @@ -1513,7 +1138,7 @@ export const de_DeleteCustomLineItemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCustomLineItemCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1526,44 +1151,6 @@ export const de_DeleteCustomLineItemCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteCustomLineItemCommandError - */ -const de_DeleteCustomLineItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.billingconductor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePricingPlanCommand */ @@ -1572,7 +1159,7 @@ export const de_DeletePricingPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePricingPlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1585,44 +1172,6 @@ export const de_DeletePricingPlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePricingPlanCommandError - */ -const de_DeletePricingPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.billingconductor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePricingRuleCommand */ @@ -1631,7 +1180,7 @@ export const de_DeletePricingRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePricingRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1644,44 +1193,6 @@ export const de_DeletePricingRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePricingRuleCommandError - */ -const de_DeletePricingRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.billingconductor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateAccountsCommand */ @@ -1690,7 +1201,7 @@ export const de_DisassociateAccountsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateAccountsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1700,882 +1211,315 @@ export const de_DisassociateAccountsCommand = async ( Arn: __expectString, }); Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateAccountsCommandError - */ -const de_DisassociateAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.billingconductor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociatePricingRulesCommand - */ -export const de_DisassociatePricingRulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociatePricingRulesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociatePricingRulesCommandError - */ -const de_DisassociatePricingRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.billingconductor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetBillingGroupCostReportCommand - */ -export const de_GetBillingGroupCostReportCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBillingGroupCostReportCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BillingGroupCostReportResults: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetBillingGroupCostReportCommandError - */ -const de_GetBillingGroupCostReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAccountAssociationsCommand - */ -export const de_ListAccountAssociationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccountAssociationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LinkedAccounts: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAccountAssociationsCommandError - */ -const de_ListAccountAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListBillingGroupCostReportsCommand - */ -export const de_ListBillingGroupCostReportsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBillingGroupCostReportsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BillingGroupCostReports: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListBillingGroupCostReportsCommandError - */ -const de_ListBillingGroupCostReportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListBillingGroupsCommand - */ -export const de_ListBillingGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBillingGroupsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BillingGroups: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListBillingGroupsCommandError - */ -const de_ListBillingGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListCustomLineItemsCommand - */ -export const de_ListCustomLineItemsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCustomLineItemsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CustomLineItems: (_) => de_CustomLineItemList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListCustomLineItemsCommandError - */ -const de_ListCustomLineItemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListCustomLineItemVersionsCommand - */ -export const de_ListCustomLineItemVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCustomLineItemVersionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CustomLineItemVersions: (_) => de_CustomLineItemVersionList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListCustomLineItemVersionsCommandError - */ -const de_ListCustomLineItemVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return contents; }; /** - * deserializeAws_restJson1ListPricingPlansCommand + * deserializeAws_restJson1DisassociatePricingRulesCommand */ -export const de_ListPricingPlansCommand = async ( +export const de_DisassociatePricingRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPricingPlansCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - BillingPeriod: __expectString, - NextToken: __expectString, - PricingPlans: _json, + Arn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPricingPlansCommandError + * deserializeAws_restJson1GetBillingGroupCostReportCommand */ -const de_ListPricingPlansCommandError = async ( +export const de_GetBillingGroupCostReportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + BillingGroupCostReportResults: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPricingPlansAssociatedWithPricingRuleCommand + * deserializeAws_restJson1ListAccountAssociationsCommand */ -export const de_ListPricingPlansAssociatedWithPricingRuleCommand = async ( +export const de_ListAccountAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPricingPlansAssociatedWithPricingRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - BillingPeriod: __expectString, + LinkedAccounts: _json, NextToken: __expectString, - PricingPlanArns: _json, - PricingRuleArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPricingPlansAssociatedWithPricingRuleCommandError + * deserializeAws_restJson1ListBillingGroupCostReportsCommand */ -const de_ListPricingPlansAssociatedWithPricingRuleCommandError = async ( +export const de_ListBillingGroupCostReportsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + BillingGroupCostReports: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPricingRulesCommand + * deserializeAws_restJson1ListBillingGroupsCommand */ -export const de_ListPricingRulesCommand = async ( +export const de_ListBillingGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPricingRulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - BillingPeriod: __expectString, + BillingGroups: _json, NextToken: __expectString, - PricingRules: (_) => de_PricingRuleList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPricingRulesCommandError + * deserializeAws_restJson1ListCustomLineItemsCommand */ -const de_ListPricingRulesCommandError = async ( +export const de_ListCustomLineItemsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CustomLineItems: (_) => de_CustomLineItemList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPricingRulesAssociatedToPricingPlanCommand + * deserializeAws_restJson1ListCustomLineItemVersionsCommand */ -export const de_ListPricingRulesAssociatedToPricingPlanCommand = async ( +export const de_ListCustomLineItemVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPricingRulesAssociatedToPricingPlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - BillingPeriod: __expectString, + CustomLineItemVersions: (_) => de_CustomLineItemVersionList(_, context), NextToken: __expectString, - PricingPlanArn: __expectString, - PricingRuleArns: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPricingRulesAssociatedToPricingPlanCommandError + * deserializeAws_restJson1ListPricingPlansCommand */ -const de_ListPricingRulesAssociatedToPricingPlanCommandError = async ( +export const de_ListPricingPlansCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + BillingPeriod: __expectString, + NextToken: __expectString, + PricingPlans: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemCommand + * deserializeAws_restJson1ListPricingPlansAssociatedWithPricingRuleCommand */ -export const de_ListResourcesAssociatedToCustomLineItemCommand = async ( +export const de_ListPricingPlansAssociatedWithPricingRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResourcesAssociatedToCustomLineItemCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - AssociatedResources: _json, + BillingPeriod: __expectString, NextToken: __expectString, + PricingPlanArns: _json, + PricingRuleArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemCommandError + * deserializeAws_restJson1ListPricingRulesCommand */ -const de_ListResourcesAssociatedToCustomLineItemCommandError = async ( +export const de_ListPricingRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + BillingPeriod: __expectString, + NextToken: __expectString, + PricingRules: (_) => de_PricingRuleList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListPricingRulesAssociatedToPricingPlanCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListPricingRulesAssociatedToPricingPlanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: _json, + BillingPeriod: __expectString, + NextToken: __expectString, + PricingPlanArn: __expectString, + PricingRuleArns: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListResourcesAssociatedToCustomLineItemCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListResourcesAssociatedToCustomLineItemCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + AssociatedResources: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_TagResourceCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Tags: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -2586,7 +1530,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2595,44 +1539,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBillingGroupCommand */ @@ -2641,7 +1547,7 @@ export const de_UpdateBillingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBillingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2663,47 +1569,6 @@ export const de_UpdateBillingGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateBillingGroupCommandError - */ -const de_UpdateBillingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.billingconductor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateCustomLineItemCommand */ @@ -2712,7 +1577,7 @@ export const de_UpdateCustomLineItemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCustomLineItemCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2731,44 +1596,6 @@ export const de_UpdateCustomLineItemCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateCustomLineItemCommandError - */ -const de_UpdateCustomLineItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePricingPlanCommand */ @@ -2777,7 +1604,7 @@ export const de_UpdatePricingPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePricingPlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2794,47 +1621,6 @@ export const de_UpdatePricingPlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePricingPlanCommandError - */ -const de_UpdatePricingPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.billingconductor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.billingconductor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.billingconductor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.billingconductor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.billingconductor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.billingconductor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePricingRuleCommand */ @@ -2843,7 +1629,7 @@ export const de_UpdatePricingRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePricingRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2869,12 +1655,9 @@ export const de_UpdatePricingRuleCommand = async ( }; /** - * deserializeAws_restJson1UpdatePricingRuleCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdatePricingRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2893,6 +1676,9 @@ const de_UpdatePricingRuleCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.billingconductor#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceLimitExceededException": + case "com.amazonaws.billingconductor#ServiceLimitExceededException": + throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.billingconductor#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -2905,7 +1691,7 @@ const de_UpdatePricingRuleCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-braket/src/protocols/Aws_restJson1.ts b/clients/client-braket/src/protocols/Aws_restJson1.ts index 3a5cc9f96a04..fed1d4184c34 100644 --- a/clients/client-braket/src/protocols/Aws_restJson1.ts +++ b/clients/client-braket/src/protocols/Aws_restJson1.ts @@ -374,7 +374,7 @@ export const de_CancelJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -388,47 +388,6 @@ export const de_CancelJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelJobCommandError - */ -const de_CancelJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.braket#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.braket#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.braket#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.braket#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.braket#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.braket#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelQuantumTaskCommand */ @@ -437,7 +396,7 @@ export const de_CancelQuantumTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelQuantumTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -451,47 +410,6 @@ export const de_CancelQuantumTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelQuantumTaskCommandError - */ -const de_CancelQuantumTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.braket#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.braket#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.braket#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.braket#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.braket#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.braket#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateJobCommand */ @@ -500,7 +418,7 @@ export const de_CreateJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -513,50 +431,6 @@ export const de_CreateJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateJobCommandError - */ -const de_CreateJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.braket#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.braket#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DeviceRetiredException": - case "com.amazonaws.braket#DeviceRetiredException": - throw await de_DeviceRetiredExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.braket#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.braket#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.braket#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.braket#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateQuantumTaskCommand */ @@ -565,7 +439,7 @@ export const de_CreateQuantumTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateQuantumTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -578,50 +452,6 @@ export const de_CreateQuantumTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateQuantumTaskCommandError - */ -const de_CreateQuantumTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.braket#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DeviceOfflineException": - case "com.amazonaws.braket#DeviceOfflineException": - throw await de_DeviceOfflineExceptionRes(parsedOutput, context); - case "DeviceRetiredException": - case "com.amazonaws.braket#DeviceRetiredException": - throw await de_DeviceRetiredExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.braket#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.braket#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.braket#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.braket#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDeviceCommand */ @@ -630,7 +460,7 @@ export const de_GetDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -649,44 +479,6 @@ export const de_GetDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeviceCommandError - */ -const de_GetDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.braket#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.braket#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.braket#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.braket#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.braket#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetJobCommand */ @@ -695,7 +487,7 @@ export const de_GetJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -728,41 +520,6 @@ export const de_GetJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetJobCommandError - */ -const de_GetJobCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.braket#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.braket#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.braket#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.braket#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.braket#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetQuantumTaskCommand */ @@ -771,7 +528,7 @@ export const de_GetQuantumTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetQuantumTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -797,44 +554,6 @@ export const de_GetQuantumTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetQuantumTaskCommandError - */ -const de_GetQuantumTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.braket#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.braket#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.braket#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.braket#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.braket#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -843,7 +562,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -856,38 +575,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.braket#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.braket#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.braket#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchDevicesCommand */ @@ -896,7 +583,7 @@ export const de_SearchDevicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchDevicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -910,41 +597,6 @@ export const de_SearchDevicesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchDevicesCommandError - */ -const de_SearchDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.braket#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.braket#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.braket#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.braket#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchJobsCommand */ @@ -953,7 +605,7 @@ export const de_SearchJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -967,41 +619,6 @@ export const de_SearchJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchJobsCommandError - */ -const de_SearchJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.braket#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.braket#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.braket#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.braket#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchQuantumTasksCommand */ @@ -1010,7 +627,7 @@ export const de_SearchQuantumTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchQuantumTasksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1024,41 +641,6 @@ export const de_SearchQuantumTasksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchQuantumTasksCommandError - */ -const de_SearchQuantumTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.braket#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.braket#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.braket#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.braket#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1067,7 +649,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1076,38 +658,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.braket#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.braket#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.braket#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1116,7 +666,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1126,34 +676,49 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.braket#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.braket#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServiceException": case "com.amazonaws.braket#InternalServiceException": throw await de_InternalServiceExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.braket#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.braket#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.braket#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "DeviceRetiredException": + case "com.amazonaws.braket#DeviceRetiredException": + throw await de_DeviceRetiredExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.braket#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "DeviceOfflineException": + case "com.amazonaws.braket#DeviceOfflineException": + throw await de_DeviceOfflineExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-budgets/src/protocols/Aws_json1_1.ts b/clients/client-budgets/src/protocols/Aws_json1_1.ts index b34800e33085..19862850e972 100644 --- a/clients/client-budgets/src/protocols/Aws_json1_1.ts +++ b/clients/client-budgets/src/protocols/Aws_json1_1.ts @@ -446,7 +446,7 @@ export const de_CreateBudgetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBudgetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -458,47 +458,6 @@ export const de_CreateBudgetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateBudgetCommandError - */ -const de_CreateBudgetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "CreationLimitExceededException": - case "com.amazonaws.budgets#CreationLimitExceededException": - throw await de_CreationLimitExceededExceptionRes(parsedOutput, context); - case "DuplicateRecordException": - case "com.amazonaws.budgets#DuplicateRecordException": - throw await de_DuplicateRecordExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateBudgetActionCommand */ @@ -507,7 +466,7 @@ export const de_CreateBudgetActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBudgetActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -519,50 +478,6 @@ export const de_CreateBudgetActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateBudgetActionCommandError - */ -const de_CreateBudgetActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "CreationLimitExceededException": - case "com.amazonaws.budgets#CreationLimitExceededException": - throw await de_CreationLimitExceededExceptionRes(parsedOutput, context); - case "DuplicateRecordException": - case "com.amazonaws.budgets#DuplicateRecordException": - throw await de_DuplicateRecordExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateNotificationCommand */ @@ -571,7 +486,7 @@ export const de_CreateNotificationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateNotificationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -583,50 +498,6 @@ export const de_CreateNotificationCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateNotificationCommandError - */ -const de_CreateNotificationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "CreationLimitExceededException": - case "com.amazonaws.budgets#CreationLimitExceededException": - throw await de_CreationLimitExceededExceptionRes(parsedOutput, context); - case "DuplicateRecordException": - case "com.amazonaws.budgets#DuplicateRecordException": - throw await de_DuplicateRecordExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateSubscriberCommand */ @@ -635,7 +506,7 @@ export const de_CreateSubscriberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSubscriberCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -647,50 +518,6 @@ export const de_CreateSubscriberCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateSubscriberCommandError - */ -const de_CreateSubscriberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "CreationLimitExceededException": - case "com.amazonaws.budgets#CreationLimitExceededException": - throw await de_CreationLimitExceededExceptionRes(parsedOutput, context); - case "DuplicateRecordException": - case "com.amazonaws.budgets#DuplicateRecordException": - throw await de_DuplicateRecordExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteBudgetCommand */ @@ -699,7 +526,7 @@ export const de_DeleteBudgetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteBudgetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -711,44 +538,6 @@ export const de_DeleteBudgetCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteBudgetCommandError - */ -const de_DeleteBudgetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteBudgetActionCommand */ @@ -757,7 +546,7 @@ export const de_DeleteBudgetActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteBudgetActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -770,60 +559,39 @@ export const de_DeleteBudgetActionCommand = async ( }; /** - * deserializeAws_json1_1DeleteBudgetActionCommandError + * deserializeAws_json1_1DeleteNotificationCommand */ -const de_DeleteBudgetActionCommandError = async ( +export const de_DeleteNotificationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLockedException": - case "com.amazonaws.budgets#ResourceLockedException": - throw await de_ResourceLockedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteNotificationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteNotificationCommand + * deserializeAws_json1_1DeleteSubscriberCommand */ -export const de_DeleteNotificationCommand = async ( +export const de_DeleteSubscriberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteNotificationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteNotificationCommandOutput = { + const response: DeleteSubscriberCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -831,110 +599,14 @@ export const de_DeleteNotificationCommand = async ( }; /** - * deserializeAws_json1_1DeleteNotificationCommandError + * deserializeAws_json1_1DescribeBudgetCommand */ -const de_DeleteNotificationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteSubscriberCommand - */ -export const de_DeleteSubscriberCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteSubscriberCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteSubscriberCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteSubscriberCommandError - */ -const de_DeleteSubscriberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeBudgetCommand - */ -export const de_DescribeBudgetCommand = async ( +export const de_DescribeBudgetCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBudgetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -946,44 +618,6 @@ export const de_DescribeBudgetCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeBudgetCommandError - */ -const de_DescribeBudgetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeBudgetActionCommand */ @@ -992,7 +626,7 @@ export const de_DescribeBudgetActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBudgetActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1004,44 +638,6 @@ export const de_DescribeBudgetActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeBudgetActionCommandError - */ -const de_DescribeBudgetActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeBudgetActionHistoriesCommand */ @@ -1050,7 +646,7 @@ export const de_DescribeBudgetActionHistoriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBudgetActionHistoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1062,47 +658,6 @@ export const de_DescribeBudgetActionHistoriesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeBudgetActionHistoriesCommandError - */ -const de_DescribeBudgetActionHistoriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.budgets#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeBudgetActionsForAccountCommand */ @@ -1111,7 +666,7 @@ export const de_DescribeBudgetActionsForAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBudgetActionsForAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1123,44 +678,6 @@ export const de_DescribeBudgetActionsForAccountCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeBudgetActionsForAccountCommandError - */ -const de_DescribeBudgetActionsForAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.budgets#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeBudgetActionsForBudgetCommand */ @@ -1169,7 +686,7 @@ export const de_DescribeBudgetActionsForBudgetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBudgetActionsForBudgetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1181,47 +698,6 @@ export const de_DescribeBudgetActionsForBudgetCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeBudgetActionsForBudgetCommandError - */ -const de_DescribeBudgetActionsForBudgetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.budgets#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeBudgetNotificationsForAccountCommand */ @@ -1230,7 +706,7 @@ export const de_DescribeBudgetNotificationsForAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBudgetNotificationsForAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1242,50 +718,6 @@ export const de_DescribeBudgetNotificationsForAccountCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeBudgetNotificationsForAccountCommandError - */ -const de_DescribeBudgetNotificationsForAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ExpiredNextTokenException": - case "com.amazonaws.budgets#ExpiredNextTokenException": - throw await de_ExpiredNextTokenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.budgets#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeBudgetPerformanceHistoryCommand */ @@ -1294,7 +726,7 @@ export const de_DescribeBudgetPerformanceHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBudgetPerformanceHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1306,50 +738,6 @@ export const de_DescribeBudgetPerformanceHistoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeBudgetPerformanceHistoryCommandError - */ -const de_DescribeBudgetPerformanceHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ExpiredNextTokenException": - case "com.amazonaws.budgets#ExpiredNextTokenException": - throw await de_ExpiredNextTokenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.budgets#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeBudgetsCommand */ @@ -1358,60 +746,16 @@ export const de_DescribeBudgetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBudgetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_DescribeBudgetsResponse(data, context); const response: DescribeBudgetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeBudgetsCommandError - */ -const de_DescribeBudgetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ExpiredNextTokenException": - case "com.amazonaws.budgets#ExpiredNextTokenException": - throw await de_ExpiredNextTokenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.budgets#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1422,7 +766,7 @@ export const de_DescribeNotificationsForBudgetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNotificationsForBudgetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1434,50 +778,6 @@ export const de_DescribeNotificationsForBudgetCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeNotificationsForBudgetCommandError - */ -const de_DescribeNotificationsForBudgetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ExpiredNextTokenException": - case "com.amazonaws.budgets#ExpiredNextTokenException": - throw await de_ExpiredNextTokenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.budgets#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeSubscribersForNotificationCommand */ @@ -1486,7 +786,7 @@ export const de_DescribeSubscribersForNotificationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSubscribersForNotificationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1498,50 +798,6 @@ export const de_DescribeSubscribersForNotificationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeSubscribersForNotificationCommandError - */ -const de_DescribeSubscribersForNotificationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ExpiredNextTokenException": - case "com.amazonaws.budgets#ExpiredNextTokenException": - throw await de_ExpiredNextTokenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.budgets#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ExecuteBudgetActionCommand */ @@ -1550,7 +806,7 @@ export const de_ExecuteBudgetActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExecuteBudgetActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1562,47 +818,6 @@ export const de_ExecuteBudgetActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1ExecuteBudgetActionCommandError - */ -const de_ExecuteBudgetActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLockedException": - case "com.amazonaws.budgets#ResourceLockedException": - throw await de_ResourceLockedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateBudgetCommand */ @@ -1611,7 +826,7 @@ export const de_UpdateBudgetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateBudgetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1623,44 +838,6 @@ export const de_UpdateBudgetCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateBudgetCommandError - */ -const de_UpdateBudgetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateBudgetActionCommand */ @@ -1669,7 +846,7 @@ export const de_UpdateBudgetActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateBudgetActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1681,47 +858,6 @@ export const de_UpdateBudgetActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateBudgetActionCommandError - */ -const de_UpdateBudgetActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLockedException": - case "com.amazonaws.budgets#ResourceLockedException": - throw await de_ResourceLockedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateNotificationCommand */ @@ -1730,7 +866,7 @@ export const de_UpdateNotificationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateNotificationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1742,47 +878,6 @@ export const de_UpdateNotificationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateNotificationCommandError - */ -const de_UpdateNotificationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.budgets#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DuplicateRecordException": - case "com.amazonaws.budgets#DuplicateRecordException": - throw await de_DuplicateRecordExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.budgets#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.budgets#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.budgets#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSubscriberCommand */ @@ -1791,7 +886,7 @@ export const de_UpdateSubscriberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSubscriberCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1804,12 +899,9 @@ export const de_UpdateSubscriberCommand = async ( }; /** - * deserializeAws_json1_1UpdateSubscriberCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateSubscriberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1819,6 +911,9 @@ const de_UpdateSubscriberCommandError = async ( case "AccessDeniedException": case "com.amazonaws.budgets#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "CreationLimitExceededException": + case "com.amazonaws.budgets#CreationLimitExceededException": + throw await de_CreationLimitExceededExceptionRes(parsedOutput, context); case "DuplicateRecordException": case "com.amazonaws.budgets#DuplicateRecordException": throw await de_DuplicateRecordExceptionRes(parsedOutput, context); @@ -1828,19 +923,28 @@ const de_UpdateSubscriberCommandError = async ( case "InvalidParameterException": case "com.amazonaws.budgets#InvalidParameterException": throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.budgets#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.budgets#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.budgets#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); + case "ResourceLockedException": + case "com.amazonaws.budgets#ResourceLockedException": + throw await de_ResourceLockedExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.budgets#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "ExpiredNextTokenException": + case "com.amazonaws.budgets#ExpiredNextTokenException": + throw await de_ExpiredNextTokenExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts index d83f20792040..d1ed6be9eb08 100644 --- a/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-identity/src/protocols/Aws_restJson1.ts @@ -783,7 +783,7 @@ export const de_CreateAppInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAppInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -796,53 +796,6 @@ export const de_CreateAppInstanceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAppInstanceCommandError - */ -const de_CreateAppInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkidentity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAppInstanceAdminCommand */ @@ -851,7 +804,7 @@ export const de_CreateAppInstanceAdminCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAppInstanceAdminCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -865,53 +818,6 @@ export const de_CreateAppInstanceAdminCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAppInstanceAdminCommandError - */ -const de_CreateAppInstanceAdminCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkidentity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAppInstanceBotCommand */ @@ -920,7 +826,7 @@ export const de_CreateAppInstanceBotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAppInstanceBotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -933,53 +839,6 @@ export const de_CreateAppInstanceBotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAppInstanceBotCommandError - */ -const de_CreateAppInstanceBotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkidentity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAppInstanceUserCommand */ @@ -988,7 +847,7 @@ export const de_CreateAppInstanceUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAppInstanceUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1002,61 +861,31 @@ export const de_CreateAppInstanceUserCommand = async ( }; /** - * deserializeAws_restJson1CreateAppInstanceUserCommandError + * deserializeAws_restJson1DeleteAppInstanceCommand */ -const de_CreateAppInstanceUserCommandError = async ( +export const de_DeleteAppInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkidentity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteAppInstanceCommand + * deserializeAws_restJson1DeleteAppInstanceAdminCommand */ -export const de_DeleteAppInstanceCommand = async ( +export const de_DeleteAppInstanceAdminCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAppInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1066,58 +895,31 @@ export const de_DeleteAppInstanceCommand = async ( }; /** - * deserializeAws_restJson1DeleteAppInstanceCommandError + * deserializeAws_restJson1DeleteAppInstanceBotCommand */ -const de_DeleteAppInstanceCommandError = async ( +export const de_DeleteAppInstanceBotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteAppInstanceAdminCommand + * deserializeAws_restJson1DeleteAppInstanceUserCommand */ -export const de_DeleteAppInstanceAdminCommand = async ( +export const de_DeleteAppInstanceUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAppInstanceAdminCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1127,891 +929,166 @@ export const de_DeleteAppInstanceAdminCommand = async ( }; /** - * deserializeAws_restJson1DeleteAppInstanceAdminCommandError + * deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommand */ -const de_DeleteAppInstanceAdminCommandError = async ( +export const de_DeregisterAppInstanceUserEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkidentity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAppInstanceBotCommand - */ -export const de_DeleteAppInstanceBotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAppInstanceBotCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteAppInstanceBotCommandError - */ -const de_DeleteAppInstanceBotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkidentity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAppInstanceUserCommand - */ -export const de_DeleteAppInstanceUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAppInstanceUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteAppInstanceUserCommandError - */ -const de_DeleteAppInstanceUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkidentity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommand - */ -export const de_DeregisterAppInstanceUserEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeregisterAppInstanceUserEndpointCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeregisterAppInstanceUserEndpointCommandError - */ -const de_DeregisterAppInstanceUserEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceCommand - */ -export const de_DescribeAppInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppInstanceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AppInstance: (_) => de_AppInstance(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceCommandError - */ -const de_DescribeAppInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceAdminCommand - */ -export const de_DescribeAppInstanceAdminCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppInstanceAdminCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AppInstanceAdmin: (_) => de_AppInstanceAdmin(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceAdminCommandError - */ -const de_DescribeAppInstanceAdminCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceBotCommand - */ -export const de_DescribeAppInstanceBotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppInstanceBotCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AppInstanceBot: (_) => de_AppInstanceBot(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceBotCommandError - */ -const de_DescribeAppInstanceBotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkidentity#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceUserCommand - */ -export const de_DescribeAppInstanceUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppInstanceUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AppInstanceUser: (_) => de_AppInstanceUser(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceUserCommandError - */ -const de_DescribeAppInstanceUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceUserEndpointCommand - */ -export const de_DescribeAppInstanceUserEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppInstanceUserEndpointCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AppInstanceUserEndpoint: (_) => de_AppInstanceUserEndpoint(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceUserEndpointCommandError - */ -const de_DescribeAppInstanceUserEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetAppInstanceRetentionSettingsCommand + * deserializeAws_restJson1DescribeAppInstanceCommand */ -export const de_GetAppInstanceRetentionSettingsCommand = async ( +export const de_DescribeAppInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAppInstanceRetentionSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AppInstanceRetentionSettings: _json, - InitiateDeletionTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + AppInstance: (_) => de_AppInstance(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetAppInstanceRetentionSettingsCommandError - */ -const de_GetAppInstanceRetentionSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAppInstanceAdminsCommand + * deserializeAws_restJson1DescribeAppInstanceAdminCommand */ -export const de_ListAppInstanceAdminsCommand = async ( +export const de_DescribeAppInstanceAdminCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppInstanceAdminsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AppInstanceAdmins: _json, - AppInstanceArn: __expectString, - NextToken: __expectString, + AppInstanceAdmin: (_) => de_AppInstanceAdmin(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAppInstanceAdminsCommandError - */ -const de_ListAppInstanceAdminsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAppInstanceBotsCommand + * deserializeAws_restJson1DescribeAppInstanceBotCommand */ -export const de_ListAppInstanceBotsCommand = async ( +export const de_DescribeAppInstanceBotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppInstanceBotsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AppInstanceArn: __expectString, - AppInstanceBots: _json, - NextToken: __expectString, + AppInstanceBot: (_) => de_AppInstanceBot(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAppInstanceBotsCommandError - */ -const de_ListAppInstanceBotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAppInstancesCommand + * deserializeAws_restJson1DescribeAppInstanceUserCommand */ -export const de_ListAppInstancesCommand = async ( +export const de_DescribeAppInstanceUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppInstancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AppInstances: _json, - NextToken: __expectString, + AppInstanceUser: (_) => de_AppInstanceUser(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAppInstancesCommandError - */ -const de_ListAppInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAppInstanceUserEndpointsCommand + * deserializeAws_restJson1DescribeAppInstanceUserEndpointCommand */ -export const de_ListAppInstanceUserEndpointsCommand = async ( +export const de_DescribeAppInstanceUserEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppInstanceUserEndpointsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AppInstanceUserEndpoints: _json, - NextToken: __expectString, + AppInstanceUserEndpoint: (_) => de_AppInstanceUserEndpoint(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAppInstanceUserEndpointsCommandError + * deserializeAws_restJson1GetAppInstanceRetentionSettingsCommand */ -const de_ListAppInstanceUserEndpointsCommandError = async ( +export const de_GetAppInstanceRetentionSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AppInstanceRetentionSettings: _json, + InitiateDeletionTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListAppInstanceUsersCommand + * deserializeAws_restJson1ListAppInstanceAdminsCommand */ -export const de_ListAppInstanceUsersCommand = async ( +export const de_ListAppInstanceAdminsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppInstanceUsersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + AppInstanceAdmins: _json, AppInstanceArn: __expectString, - AppInstanceUsers: _json, NextToken: __expectString, }); Object.assign(contents, doc); @@ -2019,376 +1096,191 @@ export const de_ListAppInstanceUsersCommand = async ( }; /** - * deserializeAws_restJson1ListAppInstanceUsersCommandError - */ -const de_ListAppInstanceUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListAppInstanceBotsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListAppInstanceBotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: _json, + AppInstanceArn: __expectString, + AppInstanceBots: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutAppInstanceRetentionSettingsCommand + * deserializeAws_restJson1ListAppInstancesCommand */ -export const de_PutAppInstanceRetentionSettingsCommand = async ( +export const de_ListAppInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAppInstanceRetentionSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AppInstanceRetentionSettings: _json, - InitiateDeletionTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + AppInstances: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutAppInstanceRetentionSettingsCommandError - */ -const de_PutAppInstanceRetentionSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutAppInstanceUserExpirationSettingsCommand + * deserializeAws_restJson1ListAppInstanceUserEndpointsCommand */ -export const de_PutAppInstanceUserExpirationSettingsCommand = async ( +export const de_ListAppInstanceUserEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAppInstanceUserExpirationSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AppInstanceUserArn: __expectString, - ExpirationSettings: _json, + AppInstanceUserEndpoints: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutAppInstanceUserExpirationSettingsCommandError + * deserializeAws_restJson1ListAppInstanceUsersCommand */ -const de_PutAppInstanceUserExpirationSettingsCommandError = async ( +export const de_ListAppInstanceUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkidentity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AppInstanceArn: __expectString, + AppInstanceUsers: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RegisterAppInstanceUserEndpointCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_RegisterAppInstanceUserEndpointCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_RegisterAppInstanceUserEndpointCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AppInstanceUserArn: __expectString, - EndpointId: __expectString, + Tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RegisterAppInstanceUserEndpointCommandError + * deserializeAws_restJson1PutAppInstanceRetentionSettingsCommand */ -const de_RegisterAppInstanceUserEndpointCommandError = async ( +export const de_PutAppInstanceRetentionSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkidentity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AppInstanceRetentionSettings: _json, + InitiateDeletionTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1PutAppInstanceUserExpirationSettingsCommand */ -export const de_TagResourceCommand = async ( +export const de_PutAppInstanceUserExpirationSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AppInstanceUserArn: __expectString, + ExpirationSettings: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1RegisterAppInstanceUserEndpointCommand */ -const de_TagResourceCommandError = async ( +export const de_RegisterAppInstanceUserEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AppInstanceUserArn: __expectString, + EndpointId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UntagResourceCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2398,44 +1290,20 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -2446,7 +1314,7 @@ export const de_UpdateAppInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAppInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2459,50 +1327,6 @@ export const de_UpdateAppInstanceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAppInstanceCommandError - */ -const de_UpdateAppInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkidentity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAppInstanceBotCommand */ @@ -2511,7 +1335,7 @@ export const de_UpdateAppInstanceBotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAppInstanceBotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2524,53 +1348,6 @@ export const de_UpdateAppInstanceBotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAppInstanceBotCommandError - */ -const de_UpdateAppInstanceBotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkidentity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAppInstanceUserCommand */ @@ -2579,7 +1356,7 @@ export const de_UpdateAppInstanceUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAppInstanceUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2592,53 +1369,6 @@ export const de_UpdateAppInstanceUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAppInstanceUserCommandError - */ -const de_UpdateAppInstanceUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkidentity#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkidentity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkidentity#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkidentity#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkidentity#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkidentity#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAppInstanceUserEndpointCommand */ @@ -2647,7 +1377,7 @@ export const de_UpdateAppInstanceUserEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAppInstanceUserEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2662,12 +1392,9 @@ export const de_UpdateAppInstanceUserEndpointCommand = async ( }; /** - * deserializeAws_restJson1UpdateAppInstanceUserEndpointCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateAppInstanceUserEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2683,6 +1410,9 @@ const de_UpdateAppInstanceUserEndpointCommandError = async ( case "ForbiddenException": case "com.amazonaws.chimesdkidentity#ForbiddenException": throw await de_ForbiddenExceptionRes(parsedOutput, context); + case "ResourceLimitExceededException": + case "com.amazonaws.chimesdkidentity#ResourceLimitExceededException": + throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); case "ServiceFailureException": case "com.amazonaws.chimesdkidentity#ServiceFailureException": throw await de_ServiceFailureExceptionRes(parsedOutput, context); @@ -2695,13 +1425,16 @@ const de_UpdateAppInstanceUserEndpointCommandError = async ( case "UnauthorizedClientException": case "com.amazonaws.chimesdkidentity#UnauthorizedClientException": throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.chimesdkidentity#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts index 92ef7ea2bafb..1da00280dcbd 100644 --- a/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-media-pipelines/src/protocols/Aws_restJson1.ts @@ -889,7 +889,7 @@ export const de_CreateMediaCapturePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateMediaCapturePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -902,50 +902,6 @@ export const de_CreateMediaCapturePipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMediaCapturePipelineCommandError - */ -const de_CreateMediaCapturePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMediaConcatenationPipelineCommand */ @@ -954,7 +910,7 @@ export const de_CreateMediaConcatenationPipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateMediaConcatenationPipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -967,50 +923,6 @@ export const de_CreateMediaConcatenationPipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMediaConcatenationPipelineCommandError - */ -const de_CreateMediaConcatenationPipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMediaInsightsPipelineCommand */ @@ -1019,7 +931,7 @@ export const de_CreateMediaInsightsPipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateMediaInsightsPipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1032,53 +944,6 @@ export const de_CreateMediaInsightsPipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMediaInsightsPipelineCommandError - */ -const de_CreateMediaInsightsPipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMediaInsightsPipelineConfigurationCommand */ @@ -1087,7 +952,7 @@ export const de_CreateMediaInsightsPipelineConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateMediaInsightsPipelineConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1100,53 +965,6 @@ export const de_CreateMediaInsightsPipelineConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMediaInsightsPipelineConfigurationCommandError - */ -const de_CreateMediaInsightsPipelineConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMediaLiveConnectorPipelineCommand */ @@ -1155,7 +973,7 @@ export const de_CreateMediaLiveConnectorPipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateMediaLiveConnectorPipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1168,50 +986,6 @@ export const de_CreateMediaLiveConnectorPipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMediaLiveConnectorPipelineCommandError - */ -const de_CreateMediaLiveConnectorPipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMediaPipelineKinesisVideoStreamPoolCommand */ @@ -1220,7 +994,7 @@ export const de_CreateMediaPipelineKinesisVideoStreamPoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateMediaPipelineKinesisVideoStreamPoolCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1233,53 +1007,6 @@ export const de_CreateMediaPipelineKinesisVideoStreamPoolCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMediaPipelineKinesisVideoStreamPoolCommandError - */ -const de_CreateMediaPipelineKinesisVideoStreamPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmediapipelines#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMediaStreamPipelineCommand */ @@ -1288,7 +1015,7 @@ export const de_CreateMediaStreamPipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateMediaStreamPipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1302,61 +1029,14 @@ export const de_CreateMediaStreamPipelineCommand = async ( }; /** - * deserializeAws_restJson1CreateMediaStreamPipelineCommandError - */ -const de_CreateMediaStreamPipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteMediaCapturePipelineCommand + * deserializeAws_restJson1DeleteMediaCapturePipelineCommand */ export const de_DeleteMediaCapturePipelineCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteMediaCapturePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1365,50 +1045,6 @@ export const de_DeleteMediaCapturePipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteMediaCapturePipelineCommandError - */ -const de_DeleteMediaCapturePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteMediaInsightsPipelineConfigurationCommand */ @@ -1417,7 +1053,7 @@ export const de_DeleteMediaInsightsPipelineConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteMediaInsightsPipelineConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1426,53 +1062,6 @@ export const de_DeleteMediaInsightsPipelineConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteMediaInsightsPipelineConfigurationCommandError - */ -const de_DeleteMediaInsightsPipelineConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmediapipelines#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteMediaPipelineCommand */ @@ -1481,7 +1070,7 @@ export const de_DeleteMediaPipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteMediaPipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1491,779 +1080,245 @@ export const de_DeleteMediaPipelineCommand = async ( }; /** - * deserializeAws_restJson1DeleteMediaPipelineCommandError + * deserializeAws_restJson1DeleteMediaPipelineKinesisVideoStreamPoolCommand */ -const de_DeleteMediaPipelineCommandError = async ( +export const de_DeleteMediaPipelineKinesisVideoStreamPoolCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmediapipelines#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteMediaPipelineKinesisVideoStreamPoolCommand + * deserializeAws_restJson1GetMediaCapturePipelineCommand */ -export const de_DeleteMediaPipelineKinesisVideoStreamPoolCommand = async ( +export const de_GetMediaCapturePipelineCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteMediaPipelineKinesisVideoStreamPoolCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + MediaCapturePipeline: (_) => de_MediaCapturePipeline(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteMediaPipelineKinesisVideoStreamPoolCommandError + * deserializeAws_restJson1GetMediaInsightsPipelineConfigurationCommand */ -const de_DeleteMediaPipelineKinesisVideoStreamPoolCommandError = async ( +export const de_GetMediaInsightsPipelineConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmediapipelines#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + MediaInsightsPipelineConfiguration: (_) => de_MediaInsightsPipelineConfiguration(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetMediaCapturePipelineCommand + * deserializeAws_restJson1GetMediaPipelineCommand */ -export const de_GetMediaCapturePipelineCommand = async ( +export const de_GetMediaPipelineCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMediaCapturePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - MediaCapturePipeline: (_) => de_MediaCapturePipeline(_, context), + MediaPipeline: (_) => de_MediaPipeline(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetMediaCapturePipelineCommandError + * deserializeAws_restJson1GetMediaPipelineKinesisVideoStreamPoolCommand */ -const de_GetMediaCapturePipelineCommandError = async ( +export const de_GetMediaPipelineKinesisVideoStreamPoolCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMediaInsightsPipelineConfigurationCommand - */ -export const de_GetMediaInsightsPipelineConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMediaInsightsPipelineConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - MediaInsightsPipelineConfiguration: (_) => de_MediaInsightsPipelineConfiguration(_, context), + KinesisVideoStreamPoolConfiguration: (_) => de_KinesisVideoStreamPoolConfiguration(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetMediaInsightsPipelineConfigurationCommandError - */ -const de_GetMediaInsightsPipelineConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMediaPipelineCommand + * deserializeAws_restJson1GetSpeakerSearchTaskCommand */ -export const de_GetMediaPipelineCommand = async ( +export const de_GetSpeakerSearchTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMediaPipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - MediaPipeline: (_) => de_MediaPipeline(_, context), + SpeakerSearchTask: (_) => de_SpeakerSearchTask(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetMediaPipelineCommandError - */ -const de_GetMediaPipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMediaPipelineKinesisVideoStreamPoolCommand + * deserializeAws_restJson1GetVoiceToneAnalysisTaskCommand */ -export const de_GetMediaPipelineKinesisVideoStreamPoolCommand = async ( +export const de_GetVoiceToneAnalysisTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMediaPipelineKinesisVideoStreamPoolCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - KinesisVideoStreamPoolConfiguration: (_) => de_KinesisVideoStreamPoolConfiguration(_, context), + VoiceToneAnalysisTask: (_) => de_VoiceToneAnalysisTask(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetMediaPipelineKinesisVideoStreamPoolCommandError + * deserializeAws_restJson1ListMediaCapturePipelinesCommand */ -const de_GetMediaPipelineKinesisVideoStreamPoolCommandError = async ( +export const de_ListMediaCapturePipelinesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + MediaCapturePipelines: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetSpeakerSearchTaskCommand + * deserializeAws_restJson1ListMediaInsightsPipelineConfigurationsCommand */ -export const de_GetSpeakerSearchTaskCommand = async ( +export const de_ListMediaInsightsPipelineConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSpeakerSearchTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SpeakerSearchTask: (_) => de_SpeakerSearchTask(_, context), + MediaInsightsPipelineConfigurations: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetSpeakerSearchTaskCommandError + * deserializeAws_restJson1ListMediaPipelineKinesisVideoStreamPoolsCommand */ -const de_GetSpeakerSearchTaskCommandError = async ( +export const de_ListMediaPipelineKinesisVideoStreamPoolsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + KinesisVideoStreamPools: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetVoiceToneAnalysisTaskCommand + * deserializeAws_restJson1ListMediaPipelinesCommand */ -export const de_GetVoiceToneAnalysisTaskCommand = async ( +export const de_ListMediaPipelinesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceToneAnalysisTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - VoiceToneAnalysisTask: (_) => de_VoiceToneAnalysisTask(_, context), + MediaPipelines: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetVoiceToneAnalysisTaskCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_GetVoiceToneAnalysisTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListMediaCapturePipelinesCommand - */ -export const de_ListMediaCapturePipelinesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMediaCapturePipelinesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - MediaCapturePipelines: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListMediaCapturePipelinesCommandError - */ -const de_ListMediaCapturePipelinesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListMediaInsightsPipelineConfigurationsCommand - */ -export const de_ListMediaInsightsPipelineConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMediaInsightsPipelineConfigurationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - MediaInsightsPipelineConfigurations: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListMediaInsightsPipelineConfigurationsCommandError - */ -const de_ListMediaInsightsPipelineConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListMediaPipelineKinesisVideoStreamPoolsCommand - */ -export const de_ListMediaPipelineKinesisVideoStreamPoolsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMediaPipelineKinesisVideoStreamPoolsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - KinesisVideoStreamPools: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListMediaPipelineKinesisVideoStreamPoolsCommandError - */ -const de_ListMediaPipelineKinesisVideoStreamPoolsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListMediaPipelinesCommand - */ -export const de_ListMediaPipelinesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMediaPipelinesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - MediaPipelines: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListMediaPipelinesCommandError - */ -const de_ListMediaPipelinesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2276,50 +1331,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartSpeakerSearchTaskCommand */ @@ -2328,7 +1339,7 @@ export const de_StartSpeakerSearchTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_StartSpeakerSearchTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2337,262 +1348,57 @@ export const de_StartSpeakerSearchTaskCommand = async ( const doc = take(data, { SpeakerSearchTask: (_) => de_SpeakerSearchTask(_, context), }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartSpeakerSearchTaskCommandError - */ -const de_StartSpeakerSearchTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmediapipelines#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartVoiceToneAnalysisTaskCommand - */ -export const de_StartVoiceToneAnalysisTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_StartVoiceToneAnalysisTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - VoiceToneAnalysisTask: (_) => de_VoiceToneAnalysisTask(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartVoiceToneAnalysisTaskCommandError - */ -const de_StartVoiceToneAnalysisTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmediapipelines#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StopSpeakerSearchTaskCommand - */ -export const de_StopSpeakerSearchTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_StopSpeakerSearchTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1StopSpeakerSearchTaskCommandError - */ -const de_StopSpeakerSearchTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmediapipelines#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StopVoiceToneAnalysisTaskCommand + * deserializeAws_restJson1StartVoiceToneAnalysisTaskCommand */ -export const de_StopVoiceToneAnalysisTaskCommand = async ( +export const de_StartVoiceToneAnalysisTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_StopVoiceToneAnalysisTaskCommandError(output, context); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + VoiceToneAnalysisTask: (_) => de_VoiceToneAnalysisTask(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StopVoiceToneAnalysisTaskCommandError + * deserializeAws_restJson1StopSpeakerSearchTaskCommand */ -const de_StopVoiceToneAnalysisTaskCommandError = async ( +export const de_StopSpeakerSearchTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmediapipelines#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1StopVoiceToneAnalysisTaskCommand */ -export const de_TagResourceCommand = async ( +export const de_StopVoiceToneAnalysisTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2602,47 +1408,20 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -2653,7 +1432,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2662,50 +1441,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMediaInsightsPipelineConfigurationCommand */ @@ -2714,7 +1449,7 @@ export const de_UpdateMediaInsightsPipelineConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMediaInsightsPipelineConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2727,53 +1462,6 @@ export const de_UpdateMediaInsightsPipelineConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateMediaInsightsPipelineConfigurationCommandError - */ -const de_UpdateMediaInsightsPipelineConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmediapipelines#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMediaInsightsPipelineStatusCommand */ @@ -2782,7 +1470,7 @@ export const de_UpdateMediaInsightsPipelineStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMediaInsightsPipelineStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2791,53 +1479,6 @@ export const de_UpdateMediaInsightsPipelineStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateMediaInsightsPipelineStatusCommandError - */ -const de_UpdateMediaInsightsPipelineStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmediapipelines#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmediapipelines#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmediapipelines#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmediapipelines#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMediaPipelineKinesisVideoStreamPoolCommand */ @@ -2846,7 +1487,7 @@ export const de_UpdateMediaPipelineKinesisVideoStreamPoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMediaPipelineKinesisVideoStreamPoolCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2860,12 +1501,9 @@ export const de_UpdateMediaPipelineKinesisVideoStreamPoolCommand = async ( }; /** - * deserializeAws_restJson1UpdateMediaPipelineKinesisVideoStreamPoolCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateMediaPipelineKinesisVideoStreamPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2875,15 +1513,12 @@ const de_UpdateMediaPipelineKinesisVideoStreamPoolCommandError = async ( case "BadRequestException": case "com.amazonaws.chimesdkmediapipelines#BadRequestException": throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmediapipelines#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "ForbiddenException": case "com.amazonaws.chimesdkmediapipelines#ForbiddenException": throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmediapipelines#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); + case "ResourceLimitExceededException": + case "com.amazonaws.chimesdkmediapipelines#ResourceLimitExceededException": + throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); case "ServiceFailureException": case "com.amazonaws.chimesdkmediapipelines#ServiceFailureException": throw await de_ServiceFailureExceptionRes(parsedOutput, context); @@ -2896,13 +1531,19 @@ const de_UpdateMediaPipelineKinesisVideoStreamPoolCommandError = async ( case "UnauthorizedClientException": case "com.amazonaws.chimesdkmediapipelines#UnauthorizedClientException": throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.chimesdkmediapipelines#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.chimesdkmediapipelines#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts index 883aebe02d94..65f125a3de96 100644 --- a/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-meetings/src/protocols/Aws_restJson1.ts @@ -461,7 +461,7 @@ export const de_BatchCreateAttendeeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchCreateAttendeeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -475,56 +475,6 @@ export const de_BatchCreateAttendeeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchCreateAttendeeCommandError - */ -const de_BatchCreateAttendeeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmeetings#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmeetings#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.chimesdkmeetings#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmeetings#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmeetings#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmeetings#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.chimesdkmeetings#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.chimesdkmeetings#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.chimesdkmeetings#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUpdateAttendeeCapabilitiesExceptCommand */ @@ -533,7 +483,7 @@ export const de_BatchUpdateAttendeeCapabilitiesExceptCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpdateAttendeeCapabilitiesExceptCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -542,53 +492,6 @@ export const de_BatchUpdateAttendeeCapabilitiesExceptCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchUpdateAttendeeCapabilitiesExceptCommandError - */ -const de_BatchUpdateAttendeeCapabilitiesExceptCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmeetings#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmeetings#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmeetings#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmeetings#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmeetings#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmeetings#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.chimesdkmeetings#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.chimesdkmeetings#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAttendeeCommand */ @@ -597,7 +500,7 @@ export const de_CreateAttendeeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAttendeeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -610,56 +513,6 @@ export const de_CreateAttendeeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAttendeeCommandError - */ -const de_CreateAttendeeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmeetings#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmeetings#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.chimesdkmeetings#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmeetings#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmeetings#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmeetings#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.chimesdkmeetings#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.chimesdkmeetings#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.chimesdkmeetings#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMeetingCommand */ @@ -668,7 +521,7 @@ export const de_CreateMeetingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMeetingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -681,53 +534,6 @@ export const de_CreateMeetingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMeetingCommandError - */ -const de_CreateMeetingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmeetings#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmeetings#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmeetings#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.chimesdkmeetings#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmeetings#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmeetings#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.chimesdkmeetings#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.chimesdkmeetings#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMeetingWithAttendeesCommand */ @@ -736,7 +542,7 @@ export const de_CreateMeetingWithAttendeesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMeetingWithAttendeesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -751,53 +557,6 @@ export const de_CreateMeetingWithAttendeesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMeetingWithAttendeesCommandError - */ -const de_CreateMeetingWithAttendeesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmeetings#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmeetings#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmeetings#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.chimesdkmeetings#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmeetings#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmeetings#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.chimesdkmeetings#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.chimesdkmeetings#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAttendeeCommand */ @@ -806,7 +565,7 @@ export const de_DeleteAttendeeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAttendeeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -815,50 +574,6 @@ export const de_DeleteAttendeeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAttendeeCommandError - */ -const de_DeleteAttendeeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmeetings#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmeetings#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmeetings#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmeetings#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmeetings#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.chimesdkmeetings#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.chimesdkmeetings#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteMeetingCommand */ @@ -867,7 +582,7 @@ export const de_DeleteMeetingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteMeetingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -876,50 +591,6 @@ export const de_DeleteMeetingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteMeetingCommandError - */ -const de_DeleteMeetingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmeetings#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmeetings#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmeetings#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmeetings#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmeetings#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.chimesdkmeetings#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.chimesdkmeetings#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAttendeeCommand */ @@ -928,7 +599,7 @@ export const de_GetAttendeeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAttendeeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -941,50 +612,6 @@ export const de_GetAttendeeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAttendeeCommandError - */ -const de_GetAttendeeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmeetings#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmeetings#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmeetings#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmeetings#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmeetings#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.chimesdkmeetings#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.chimesdkmeetings#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMeetingCommand */ @@ -993,7 +620,7 @@ export const de_GetMeetingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMeetingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1006,182 +633,47 @@ export const de_GetMeetingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMeetingCommandError - */ -const de_GetMeetingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmeetings#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmeetings#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmeetings#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmeetings#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmeetings#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.chimesdkmeetings#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.chimesdkmeetings#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAttendeesCommand */ export const de_ListAttendeesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAttendeesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Attendees: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAttendeesCommandError - */ -const de_ListAttendeesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmeetings#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmeetings#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmeetings#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmeetings#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmeetings#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.chimesdkmeetings#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.chimesdkmeetings#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: _json, + Attendees: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmeetings#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmeetings#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.chimesdkmeetings#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.chimesdkmeetings#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmeetings#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmeetings#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.chimesdkmeetings#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.chimesdkmeetings#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1192,7 +684,7 @@ export const de_StartMeetingTranscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartMeetingTranscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1201,56 +693,6 @@ export const de_StartMeetingTranscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartMeetingTranscriptionCommandError - */ -const de_StartMeetingTranscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmeetings#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmeetings#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.chimesdkmeetings#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmeetings#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmeetings#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmeetings#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.chimesdkmeetings#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.chimesdkmeetings#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.chimesdkmeetings#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopMeetingTranscriptionCommand */ @@ -1259,7 +701,7 @@ export const de_StopMeetingTranscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopMeetingTranscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1268,53 +710,6 @@ export const de_StopMeetingTranscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopMeetingTranscriptionCommandError - */ -const de_StopMeetingTranscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmeetings#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmeetings#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmeetings#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmeetings#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmeetings#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.chimesdkmeetings#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.chimesdkmeetings#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.chimesdkmeetings#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1323,7 +718,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1332,56 +727,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmeetings#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmeetings#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.chimesdkmeetings#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.chimesdkmeetings#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmeetings#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmeetings#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.chimesdkmeetings#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.chimesdkmeetings#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.chimesdkmeetings#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1390,7 +735,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1399,53 +744,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmeetings#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmeetings#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.chimesdkmeetings#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.chimesdkmeetings#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmeetings#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmeetings#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.chimesdkmeetings#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.chimesdkmeetings#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAttendeeCapabilitiesCommand */ @@ -1454,7 +752,7 @@ export const de_UpdateAttendeeCapabilitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAttendeeCapabilitiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1468,12 +766,9 @@ export const de_UpdateAttendeeCapabilitiesCommand = async ( }; /** - * deserializeAws_restJson1UpdateAttendeeCapabilitiesCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateAttendeeCapabilitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1483,12 +778,12 @@ const de_UpdateAttendeeCapabilitiesCommandError = async ( case "BadRequestException": case "com.amazonaws.chimesdkmeetings#BadRequestException": throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmeetings#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "ForbiddenException": case "com.amazonaws.chimesdkmeetings#ForbiddenException": throw await de_ForbiddenExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.chimesdkmeetings#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "NotFoundException": case "com.amazonaws.chimesdkmeetings#NotFoundException": throw await de_NotFoundExceptionRes(parsedOutput, context); @@ -1504,13 +799,25 @@ const de_UpdateAttendeeCapabilitiesCommandError = async ( case "UnauthorizedException": case "com.amazonaws.chimesdkmeetings#UnauthorizedException": throw await de_UnauthorizedExceptionRes(parsedOutput, context); + case "UnprocessableEntityException": + case "com.amazonaws.chimesdkmeetings#UnprocessableEntityException": + throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.chimesdkmeetings#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.chimesdkmeetings#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.chimesdkmeetings#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts index 9d5cd8e2531b..d322f24e27b6 100644 --- a/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-messaging/src/protocols/Aws_restJson1.ts @@ -1372,7 +1372,7 @@ export const de_AssociateChannelFlowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateChannelFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1381,53 +1381,6 @@ export const de_AssociateChannelFlowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateChannelFlowCommandError - */ -const de_AssociateChannelFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmessaging#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchCreateChannelMembershipCommand */ @@ -1436,7 +1389,7 @@ export const de_BatchCreateChannelMembershipCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchCreateChannelMembershipCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1450,53 +1403,6 @@ export const de_BatchCreateChannelMembershipCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchCreateChannelMembershipCommandError - */ -const de_BatchCreateChannelMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmessaging#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmessaging#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ChannelFlowCallbackCommand */ @@ -1505,7 +1411,7 @@ export const de_ChannelFlowCallbackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ChannelFlowCallbackCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1519,50 +1425,6 @@ export const de_ChannelFlowCallbackCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ChannelFlowCallbackCommandError - */ -const de_ChannelFlowCallbackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateChannelCommand */ @@ -1571,7 +1433,7 @@ export const de_CreateChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1585,340 +1447,136 @@ export const de_CreateChannelCommand = async ( }; /** - * deserializeAws_restJson1CreateChannelCommandError + * deserializeAws_restJson1CreateChannelBanCommand */ -const de_CreateChannelCommandError = async ( +export const de_CreateChannelBanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmessaging#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelArn: __expectString, + Member: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateChannelBanCommand + * deserializeAws_restJson1CreateChannelFlowCommand */ -export const de_CreateChannelBanCommand = async ( +export const de_CreateChannelFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateChannelBanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ChannelArn: __expectString, - Member: _json, + ChannelFlowArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateChannelBanCommandError + * deserializeAws_restJson1CreateChannelMembershipCommand */ -const de_CreateChannelBanCommandError = async ( +export const de_CreateChannelMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmessaging#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelArn: __expectString, + Member: _json, + SubChannelId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateChannelFlowCommand + * deserializeAws_restJson1CreateChannelModeratorCommand */ -export const de_CreateChannelFlowCommand = async ( +export const de_CreateChannelModeratorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateChannelFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ChannelFlowArn: __expectString, + ChannelArn: __expectString, + ChannelModerator: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateChannelFlowCommandError + * deserializeAws_restJson1DeleteChannelCommand */ -const de_CreateChannelFlowCommandError = async ( +export const de_DeleteChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmessaging#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateChannelMembershipCommand - */ -export const de_CreateChannelMembershipCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateChannelMembershipCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelArn: __expectString, - Member: _json, - SubChannelId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateChannelMembershipCommandError - */ -const de_CreateChannelMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmessaging#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmessaging#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateChannelModeratorCommand + * deserializeAws_restJson1DeleteChannelBanCommand */ -export const de_CreateChannelModeratorCommand = async ( +export const de_DeleteChannelBanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateChannelModeratorCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelArn: __expectString, - ChannelModerator: _json, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateChannelModeratorCommandError - */ -const de_CreateChannelModeratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmessaging#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteChannelCommand + * deserializeAws_restJson1DeleteChannelFlowCommand */ -export const de_DeleteChannelCommand = async ( +export const de_DeleteChannelFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1928,58 +1586,14 @@ export const de_DeleteChannelCommand = async ( }; /** - * deserializeAws_restJson1DeleteChannelCommandError - */ -const de_DeleteChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteChannelBanCommand + * deserializeAws_restJson1DeleteChannelMembershipCommand */ -export const de_DeleteChannelBanCommand = async ( +export const de_DeleteChannelMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteChannelBanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1989,794 +1603,31 @@ export const de_DeleteChannelBanCommand = async ( }; /** - * deserializeAws_restJson1DeleteChannelBanCommandError + * deserializeAws_restJson1DeleteChannelMessageCommand */ -const de_DeleteChannelBanCommandError = async ( +export const de_DeleteChannelMessageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteChannelFlowCommand - */ -export const de_DeleteChannelFlowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteChannelFlowCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteChannelFlowCommandError - */ -const de_DeleteChannelFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteChannelMembershipCommand - */ -export const de_DeleteChannelMembershipCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteChannelMembershipCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteChannelMembershipCommandError - */ -const de_DeleteChannelMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteChannelMessageCommand - */ -export const de_DeleteChannelMessageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteChannelMessageCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteChannelMessageCommandError - */ -const de_DeleteChannelMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** * deserializeAws_restJson1DeleteChannelModeratorCommand */ -export const de_DeleteChannelModeratorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteChannelModeratorCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteChannelModeratorCommandError - */ -const de_DeleteChannelModeratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteMessagingStreamingConfigurationsCommand - */ -export const de_DeleteMessagingStreamingConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteMessagingStreamingConfigurationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteMessagingStreamingConfigurationsCommandError - */ -const de_DeleteMessagingStreamingConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeChannelCommand - */ -export const de_DescribeChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Channel: (_) => de_Channel(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeChannelCommandError - */ -const de_DescribeChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeChannelBanCommand - */ -export const de_DescribeChannelBanCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelBanCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelBan: (_) => de_ChannelBan(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeChannelBanCommandError - */ -const de_DescribeChannelBanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmessaging#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeChannelFlowCommand - */ -export const de_DescribeChannelFlowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelFlowCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelFlow: (_) => de_ChannelFlow(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeChannelFlowCommandError - */ -const de_DescribeChannelFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeChannelMembershipCommand - */ -export const de_DescribeChannelMembershipCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelMembershipCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelMembership: (_) => de_ChannelMembership(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeChannelMembershipCommandError - */ -const de_DescribeChannelMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmessaging#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeChannelMembershipForAppInstanceUserCommand - */ -export const de_DescribeChannelMembershipForAppInstanceUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelMembershipForAppInstanceUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelMembership: (_) => de_ChannelMembershipForAppInstanceUserSummary(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeChannelMembershipForAppInstanceUserCommandError - */ -const de_DescribeChannelMembershipForAppInstanceUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeChannelModeratedByAppInstanceUserCommand - */ -export const de_DescribeChannelModeratedByAppInstanceUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelModeratedByAppInstanceUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Channel: (_) => de_ChannelModeratedByAppInstanceUserSummary(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeChannelModeratedByAppInstanceUserCommandError - */ -const de_DescribeChannelModeratedByAppInstanceUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeChannelModeratorCommand - */ -export const de_DescribeChannelModeratorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelModeratorCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelModerator: (_) => de_ChannelModerator(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeChannelModeratorCommandError - */ -const de_DescribeChannelModeratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmessaging#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateChannelFlowCommand - */ -export const de_DisassociateChannelFlowCommand = async ( +export const de_DeleteChannelModeratorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DisassociateChannelFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2786,503 +1637,302 @@ export const de_DisassociateChannelFlowCommand = async ( }; /** - * deserializeAws_restJson1DisassociateChannelFlowCommandError + * deserializeAws_restJson1DeleteMessagingStreamingConfigurationsCommand */ -const de_DisassociateChannelFlowCommandError = async ( +export const de_DeleteMessagingStreamingConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmessaging#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetChannelMembershipPreferencesCommand + * deserializeAws_restJson1DescribeChannelCommand */ -export const de_GetChannelMembershipPreferencesCommand = async ( +export const de_DescribeChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChannelMembershipPreferencesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ChannelArn: __expectString, - Member: _json, - Preferences: _json, + Channel: (_) => de_Channel(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetChannelMembershipPreferencesCommandError + * deserializeAws_restJson1DescribeChannelBanCommand */ -const de_GetChannelMembershipPreferencesCommandError = async ( +export const de_DescribeChannelBanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelBan: (_) => de_ChannelBan(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetChannelMessageCommand + * deserializeAws_restJson1DescribeChannelFlowCommand */ -export const de_GetChannelMessageCommand = async ( +export const de_DescribeChannelFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChannelMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ChannelMessage: (_) => de_ChannelMessage(_, context), + ChannelFlow: (_) => de_ChannelFlow(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetChannelMessageCommandError + * deserializeAws_restJson1DescribeChannelMembershipCommand */ -const de_GetChannelMessageCommandError = async ( +export const de_DescribeChannelMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmessaging#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelMembership: (_) => de_ChannelMembership(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetChannelMessageStatusCommand + * deserializeAws_restJson1DescribeChannelMembershipForAppInstanceUserCommand */ -export const de_GetChannelMessageStatusCommand = async ( +export const de_DescribeChannelMembershipForAppInstanceUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChannelMessageStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Status: _json, + ChannelMembership: (_) => de_ChannelMembershipForAppInstanceUserSummary(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetChannelMessageStatusCommandError + * deserializeAws_restJson1DescribeChannelModeratedByAppInstanceUserCommand */ -const de_GetChannelMessageStatusCommandError = async ( +export const de_DescribeChannelModeratedByAppInstanceUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Channel: (_) => de_ChannelModeratedByAppInstanceUserSummary(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetMessagingSessionEndpointCommand + * deserializeAws_restJson1DescribeChannelModeratorCommand */ -export const de_GetMessagingSessionEndpointCommand = async ( +export const de_DescribeChannelModeratorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMessagingSessionEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Endpoint: _json, + ChannelModerator: (_) => de_ChannelModerator(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetMessagingSessionEndpointCommandError + * deserializeAws_restJson1DisassociateChannelFlowCommand */ -const de_GetMessagingSessionEndpointCommandError = async ( +export const de_DisassociateChannelFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetMessagingStreamingConfigurationsCommand + * deserializeAws_restJson1GetChannelMembershipPreferencesCommand */ -export const de_GetMessagingStreamingConfigurationsCommand = async ( +export const de_GetChannelMembershipPreferencesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMessagingStreamingConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - StreamingConfigurations: _json, + ChannelArn: __expectString, + Member: _json, + Preferences: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetMessagingStreamingConfigurationsCommandError - */ -const de_GetMessagingStreamingConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmessaging#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListChannelBansCommand + * deserializeAws_restJson1GetChannelMessageCommand */ -export const de_ListChannelBansCommand = async ( +export const de_GetChannelMessageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelBansCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ChannelArn: __expectString, - ChannelBans: _json, - NextToken: __expectString, + ChannelMessage: (_) => de_ChannelMessage(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListChannelBansCommandError + * deserializeAws_restJson1GetChannelMessageStatusCommand */ -const de_ListChannelBansCommandError = async ( +export const de_GetChannelMessageStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Status: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListChannelFlowsCommand + * deserializeAws_restJson1GetMessagingSessionEndpointCommand */ -export const de_ListChannelFlowsCommand = async ( +export const de_GetMessagingSessionEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelFlowsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ChannelFlows: _json, - NextToken: __expectString, + Endpoint: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListChannelFlowsCommandError + * deserializeAws_restJson1GetMessagingStreamingConfigurationsCommand */ -const de_ListChannelFlowsCommandError = async ( +export const de_GetMessagingStreamingConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + StreamingConfigurations: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListChannelMembershipsCommand + * deserializeAws_restJson1ListChannelBansCommand */ -export const de_ListChannelMembershipsCommand = async ( +export const de_ListChannelBansCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelMembershipsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3290,7 +1940,7 @@ export const de_ListChannelMembershipsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { ChannelArn: __expectString, - ChannelMemberships: _json, + ChannelBans: _json, NextToken: __expectString, }); Object.assign(contents, doc); @@ -3298,62 +1948,21 @@ export const de_ListChannelMembershipsCommand = async ( }; /** - * deserializeAws_restJson1ListChannelMembershipsCommandError - */ -const de_ListChannelMembershipsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListChannelMembershipsForAppInstanceUserCommand + * deserializeAws_restJson1ListChannelFlowsCommand */ -export const de_ListChannelMembershipsForAppInstanceUserCommand = async ( +export const de_ListChannelFlowsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelMembershipsForAppInstanceUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ChannelMemberships: (_) => de_ChannelMembershipForAppInstanceUserSummaryList(_, context), + ChannelFlows: _json, NextToken: __expectString, }); Object.assign(contents, doc); @@ -3361,109 +1970,72 @@ export const de_ListChannelMembershipsForAppInstanceUserCommand = async ( }; /** - * deserializeAws_restJson1ListChannelMembershipsForAppInstanceUserCommandError + * deserializeAws_restJson1ListChannelMembershipsCommand */ -const de_ListChannelMembershipsForAppInstanceUserCommandError = async ( +export const de_ListChannelMembershipsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelArn: __expectString, + ChannelMemberships: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListChannelMessagesCommand + * deserializeAws_restJson1ListChannelMembershipsForAppInstanceUserCommand */ -export const de_ListChannelMessagesCommand = async ( +export const de_ListChannelMembershipsForAppInstanceUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelMessagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ChannelArn: __expectString, - ChannelMessages: (_) => de_ChannelMessageSummaryList(_, context), + ChannelMemberships: (_) => de_ChannelMembershipForAppInstanceUserSummaryList(_, context), NextToken: __expectString, - SubChannelId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListChannelMessagesCommandError + * deserializeAws_restJson1ListChannelMessagesCommand */ -const de_ListChannelMessagesCommandError = async ( +export const de_ListChannelMessagesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelArn: __expectString, + ChannelMessages: (_) => de_ChannelMessageSummaryList(_, context), + NextToken: __expectString, + SubChannelId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3474,7 +2046,7 @@ export const de_ListChannelModeratorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelModeratorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3489,47 +2061,6 @@ export const de_ListChannelModeratorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListChannelModeratorsCommandError - */ -const de_ListChannelModeratorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListChannelsCommand */ @@ -3538,7 +2069,7 @@ export const de_ListChannelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3552,47 +2083,6 @@ export const de_ListChannelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListChannelsCommandError - */ -const de_ListChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListChannelsAssociatedWithChannelFlowCommand */ @@ -3601,7 +2091,7 @@ export const de_ListChannelsAssociatedWithChannelFlowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelsAssociatedWithChannelFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3615,47 +2105,6 @@ export const de_ListChannelsAssociatedWithChannelFlowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListChannelsAssociatedWithChannelFlowCommandError - */ -const de_ListChannelsAssociatedWithChannelFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListChannelsModeratedByAppInstanceUserCommand */ @@ -3664,7 +2113,7 @@ export const de_ListChannelsModeratedByAppInstanceUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelsModeratedByAppInstanceUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3678,47 +2127,6 @@ export const de_ListChannelsModeratedByAppInstanceUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListChannelsModeratedByAppInstanceUserCommandError - */ -const de_ListChannelsModeratedByAppInstanceUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSubChannelsCommand */ @@ -3727,60 +2135,19 @@ export const de_ListSubChannelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSubChannelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelArn: __expectString, - NextToken: __expectString, - SubChannels: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSubChannelsCommandError - */ -const de_ListSubChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelArn: __expectString, + NextToken: __expectString, + SubChannels: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3791,7 +2158,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3804,47 +2171,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutChannelExpirationSettingsCommand */ @@ -3853,7 +2179,7 @@ export const de_PutChannelExpirationSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutChannelExpirationSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3867,50 +2193,6 @@ export const de_PutChannelExpirationSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutChannelExpirationSettingsCommandError - */ -const de_PutChannelExpirationSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutChannelMembershipPreferencesCommand */ @@ -3919,7 +2201,7 @@ export const de_PutChannelMembershipPreferencesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutChannelMembershipPreferencesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3934,50 +2216,6 @@ export const de_PutChannelMembershipPreferencesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutChannelMembershipPreferencesCommandError - */ -const de_PutChannelMembershipPreferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutMessagingStreamingConfigurationsCommand */ @@ -3986,7 +2224,7 @@ export const de_PutMessagingStreamingConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutMessagingStreamingConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3999,53 +2237,6 @@ export const de_PutMessagingStreamingConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutMessagingStreamingConfigurationsCommandError - */ -const de_PutMessagingStreamingConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkmessaging#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RedactChannelMessageCommand */ @@ -4054,7 +2245,7 @@ export const de_RedactChannelMessageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RedactChannelMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4069,50 +2260,6 @@ export const de_RedactChannelMessageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RedactChannelMessageCommandError - */ -const de_RedactChannelMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchChannelsCommand */ @@ -4121,7 +2268,7 @@ export const de_SearchChannelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchChannelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4129,51 +2276,10 @@ export const de_SearchChannelsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { Channels: (_) => de_ChannelSummaryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SearchChannelsCommandError - */ -const de_SearchChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4184,7 +2290,7 @@ export const de_SendChannelMessageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_SendChannelMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4200,50 +2306,6 @@ export const de_SendChannelMessageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SendChannelMessageCommandError - */ -const de_SendChannelMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -4252,7 +2314,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4261,50 +2323,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkmessaging#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -4313,7 +2331,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4322,47 +2340,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateChannelCommand */ @@ -4371,7 +2348,7 @@ export const de_UpdateChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4384,50 +2361,6 @@ export const de_UpdateChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateChannelCommandError - */ -const de_UpdateChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateChannelFlowCommand */ @@ -4436,7 +2369,7 @@ export const de_UpdateChannelFlowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChannelFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4449,50 +2382,6 @@ export const de_UpdateChannelFlowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateChannelFlowCommandError - */ -const de_UpdateChannelFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateChannelMessageCommand */ @@ -4501,7 +2390,7 @@ export const de_UpdateChannelMessageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChannelMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4517,50 +2406,6 @@ export const de_UpdateChannelMessageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateChannelMessageCommandError - */ -const de_UpdateChannelMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkmessaging#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkmessaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkmessaging#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkmessaging#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkmessaging#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkmessaging#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateChannelReadMarkerCommand */ @@ -4569,7 +2414,7 @@ export const de_UpdateChannelReadMarkerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChannelReadMarkerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4583,12 +2428,9 @@ export const de_UpdateChannelReadMarkerCommand = async ( }; /** - * deserializeAws_restJson1UpdateChannelReadMarkerCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateChannelReadMarkerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4604,6 +2446,9 @@ const de_UpdateChannelReadMarkerCommandError = async ( case "ForbiddenException": case "com.amazonaws.chimesdkmessaging#ForbiddenException": throw await de_ForbiddenExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.chimesdkmessaging#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); case "ServiceFailureException": case "com.amazonaws.chimesdkmessaging#ServiceFailureException": throw await de_ServiceFailureExceptionRes(parsedOutput, context); @@ -4616,13 +2461,16 @@ const de_UpdateChannelReadMarkerCommandError = async ( case "UnauthorizedClientException": case "com.amazonaws.chimesdkmessaging#UnauthorizedClientException": throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); + case "ResourceLimitExceededException": + case "com.amazonaws.chimesdkmessaging#ResourceLimitExceededException": + throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-chime-sdk-voice/src/protocols/Aws_restJson1.ts b/clients/client-chime-sdk-voice/src/protocols/Aws_restJson1.ts index 8ef9e601247c..571458d77bdb 100644 --- a/clients/client-chime-sdk-voice/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime-sdk-voice/src/protocols/Aws_restJson1.ts @@ -2305,7 +2305,7 @@ export const de_AssociatePhoneNumbersWithVoiceConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociatePhoneNumbersWithVoiceConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2318,53 +2318,6 @@ export const de_AssociatePhoneNumbersWithVoiceConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociatePhoneNumbersWithVoiceConnectorCommandError - */ -const de_AssociatePhoneNumbersWithVoiceConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociatePhoneNumbersWithVoiceConnectorGroupCommand */ @@ -2373,7 +2326,7 @@ export const de_AssociatePhoneNumbersWithVoiceConnectorGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociatePhoneNumbersWithVoiceConnectorGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2386,53 +2339,6 @@ export const de_AssociatePhoneNumbersWithVoiceConnectorGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociatePhoneNumbersWithVoiceConnectorGroupCommandError - */ -const de_AssociatePhoneNumbersWithVoiceConnectorGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDeletePhoneNumberCommand */ @@ -2441,7 +2347,7 @@ export const de_BatchDeletePhoneNumberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDeletePhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2454,50 +2360,6 @@ export const de_BatchDeletePhoneNumberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDeletePhoneNumberCommandError - */ -const de_BatchDeletePhoneNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUpdatePhoneNumberCommand */ @@ -2506,7 +2368,7 @@ export const de_BatchUpdatePhoneNumberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpdatePhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2519,50 +2381,6 @@ export const de_BatchUpdatePhoneNumberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchUpdatePhoneNumberCommandError - */ -const de_BatchUpdatePhoneNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePhoneNumberOrderCommand */ @@ -2571,7 +2389,7 @@ export const de_CreatePhoneNumberOrderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreatePhoneNumberOrderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2584,53 +2402,6 @@ export const de_CreatePhoneNumberOrderCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePhoneNumberOrderCommandError - */ -const de_CreatePhoneNumberOrderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkvoice#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProxySessionCommand */ @@ -2639,7 +2410,7 @@ export const de_CreateProxySessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateProxySessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2652,50 +2423,6 @@ export const de_CreateProxySessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProxySessionCommandError - */ -const de_CreateProxySessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSipMediaApplicationCommand */ @@ -2704,7 +2431,7 @@ export const de_CreateSipMediaApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSipMediaApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2718,64 +2445,14 @@ export const de_CreateSipMediaApplicationCommand = async ( }; /** - * deserializeAws_restJson1CreateSipMediaApplicationCommandError - */ -const de_CreateSipMediaApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkvoice#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateSipMediaApplicationCallCommand + * deserializeAws_restJson1CreateSipMediaApplicationCallCommand */ export const de_CreateSipMediaApplicationCallCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSipMediaApplicationCallCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2788,53 +2465,6 @@ export const de_CreateSipMediaApplicationCallCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSipMediaApplicationCallCommandError - */ -const de_CreateSipMediaApplicationCallCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkvoice#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSipRuleCommand */ @@ -2843,7 +2473,7 @@ export const de_CreateSipRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSipRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2856,56 +2486,6 @@ export const de_CreateSipRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSipRuleCommandError - */ -const de_CreateSipRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkvoice#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateVoiceConnectorCommand */ @@ -2914,7 +2494,7 @@ export const de_CreateVoiceConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateVoiceConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2927,53 +2507,6 @@ export const de_CreateVoiceConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateVoiceConnectorCommandError - */ -const de_CreateVoiceConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkvoice#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateVoiceConnectorGroupCommand */ @@ -2982,7 +2515,7 @@ export const de_CreateVoiceConnectorGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateVoiceConnectorGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2996,209 +2529,107 @@ export const de_CreateVoiceConnectorGroupCommand = async ( }; /** - * deserializeAws_restJson1CreateVoiceConnectorGroupCommandError + * deserializeAws_restJson1CreateVoiceProfileCommand */ -const de_CreateVoiceConnectorGroupCommandError = async ( +export const de_CreateVoiceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkvoice#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + VoiceProfile: (_) => de_VoiceProfile(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateVoiceProfileCommand + * deserializeAws_restJson1CreateVoiceProfileDomainCommand */ -export const de_CreateVoiceProfileCommand = async ( +export const de_CreateVoiceProfileDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateVoiceProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - VoiceProfile: (_) => de_VoiceProfile(_, context), + VoiceProfileDomain: (_) => de_VoiceProfileDomain(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateVoiceProfileCommandError + * deserializeAws_restJson1DeletePhoneNumberCommand */ -const de_CreateVoiceProfileCommandError = async ( +export const de_DeletePhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GoneException": - case "com.amazonaws.chimesdkvoice#GoneException": - throw await de_GoneExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkvoice#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateVoiceProfileDomainCommand + * deserializeAws_restJson1DeleteProxySessionCommand */ -export const de_CreateVoiceProfileDomainCommand = async ( +export const de_DeleteProxySessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateVoiceProfileDomainCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - VoiceProfileDomain: (_) => de_VoiceProfileDomain(_, context), - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateVoiceProfileDomainCommandError + * deserializeAws_restJson1DeleteSipMediaApplicationCommand */ -const de_CreateVoiceProfileDomainCommandError = async ( +export const de_DeleteSipMediaApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkvoice#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeletePhoneNumberCommand + * deserializeAws_restJson1DeleteSipRuleCommand */ -export const de_DeletePhoneNumberCommand = async ( +export const de_DeleteSipRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeletePhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3208,58 +2639,31 @@ export const de_DeletePhoneNumberCommand = async ( }; /** - * deserializeAws_restJson1DeletePhoneNumberCommandError + * deserializeAws_restJson1DeleteVoiceConnectorCommand */ -const de_DeletePhoneNumberCommandError = async ( +export const de_DeleteVoiceConnectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteProxySessionCommand + * deserializeAws_restJson1DeleteVoiceConnectorEmergencyCallingConfigurationCommand */ -export const de_DeleteProxySessionCommand = async ( +export const de_DeleteVoiceConnectorEmergencyCallingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteProxySessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3269,58 +2673,31 @@ export const de_DeleteProxySessionCommand = async ( }; /** - * deserializeAws_restJson1DeleteProxySessionCommandError + * deserializeAws_restJson1DeleteVoiceConnectorGroupCommand */ -const de_DeleteProxySessionCommandError = async ( +export const de_DeleteVoiceConnectorGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteSipMediaApplicationCommand + * deserializeAws_restJson1DeleteVoiceConnectorOriginationCommand */ -export const de_DeleteSipMediaApplicationCommand = async ( +export const de_DeleteVoiceConnectorOriginationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSipMediaApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3330,61 +2707,31 @@ export const de_DeleteSipMediaApplicationCommand = async ( }; /** - * deserializeAws_restJson1DeleteSipMediaApplicationCommandError + * deserializeAws_restJson1DeleteVoiceConnectorProxyCommand */ -const de_DeleteSipMediaApplicationCommandError = async ( +export const de_DeleteVoiceConnectorProxyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteSipRuleCommand + * deserializeAws_restJson1DeleteVoiceConnectorStreamingConfigurationCommand */ -export const de_DeleteSipRuleCommand = async ( +export const de_DeleteVoiceConnectorStreamingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSipRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3394,61 +2741,31 @@ export const de_DeleteSipRuleCommand = async ( }; /** - * deserializeAws_restJson1DeleteSipRuleCommandError + * deserializeAws_restJson1DeleteVoiceConnectorTerminationCommand */ -const de_DeleteSipRuleCommandError = async ( +export const de_DeleteVoiceConnectorTerminationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteVoiceConnectorCommand + * deserializeAws_restJson1DeleteVoiceConnectorTerminationCredentialsCommand */ -export const de_DeleteVoiceConnectorCommand = async ( +export const de_DeleteVoiceConnectorTerminationCredentialsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3458,61 +2775,31 @@ export const de_DeleteVoiceConnectorCommand = async ( }; /** - * deserializeAws_restJson1DeleteVoiceConnectorCommandError + * deserializeAws_restJson1DeleteVoiceProfileCommand */ -const de_DeleteVoiceConnectorCommandError = async ( +export const de_DeleteVoiceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteVoiceConnectorEmergencyCallingConfigurationCommand + * deserializeAws_restJson1DeleteVoiceProfileDomainCommand */ -export const de_DeleteVoiceConnectorEmergencyCallingConfigurationCommand = async ( +export const de_DeleteVoiceProfileDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorEmergencyCallingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3522,4107 +2809,969 @@ export const de_DeleteVoiceConnectorEmergencyCallingConfigurationCommand = async }; /** - * deserializeAws_restJson1DeleteVoiceConnectorEmergencyCallingConfigurationCommandError + * deserializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorCommand */ -const de_DeleteVoiceConnectorEmergencyCallingConfigurationCommandError = async ( +export const de_DisassociatePhoneNumbersFromVoiceConnectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PhoneNumberErrors: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteVoiceConnectorGroupCommand + * deserializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorGroupCommand */ -export const de_DeleteVoiceConnectorGroupCommand = async ( +export const de_DisassociatePhoneNumbersFromVoiceConnectorGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorGroupCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PhoneNumberErrors: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteVoiceConnectorGroupCommandError + * deserializeAws_restJson1GetGlobalSettingsCommand */ -const de_DeleteVoiceConnectorGroupCommandError = async ( +export const de_GetGlobalSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + VoiceConnector: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteVoiceConnectorOriginationCommand + * deserializeAws_restJson1GetPhoneNumberCommand */ -export const de_DeleteVoiceConnectorOriginationCommand = async ( +export const de_GetPhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorOriginationCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PhoneNumber: (_) => de_PhoneNumber(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteVoiceConnectorOriginationCommandError + * deserializeAws_restJson1GetPhoneNumberOrderCommand */ -const de_DeleteVoiceConnectorOriginationCommandError = async ( +export const de_GetPhoneNumberOrderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PhoneNumberOrder: (_) => de_PhoneNumberOrder(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteVoiceConnectorProxyCommand + * deserializeAws_restJson1GetPhoneNumberSettingsCommand */ -export const de_DeleteVoiceConnectorProxyCommand = async ( +export const de_GetPhoneNumberSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorProxyCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CallingName: __expectString, + CallingNameUpdatedTimestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteVoiceConnectorProxyCommandError + * deserializeAws_restJson1GetProxySessionCommand */ -const de_DeleteVoiceConnectorProxyCommandError = async ( +export const de_GetProxySessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ProxySession: (_) => de_ProxySession(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteVoiceConnectorStreamingConfigurationCommand + * deserializeAws_restJson1GetSipMediaApplicationCommand */ -export const de_DeleteVoiceConnectorStreamingConfigurationCommand = async ( +export const de_GetSipMediaApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorStreamingConfigurationCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SipMediaApplication: (_) => de_SipMediaApplication(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteVoiceConnectorStreamingConfigurationCommandError + * deserializeAws_restJson1GetSipMediaApplicationAlexaSkillConfigurationCommand */ -const de_DeleteVoiceConnectorStreamingConfigurationCommandError = async ( +export const de_GetSipMediaApplicationAlexaSkillConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SipMediaApplicationAlexaSkillConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteVoiceConnectorTerminationCommand + * deserializeAws_restJson1GetSipMediaApplicationLoggingConfigurationCommand */ -export const de_DeleteVoiceConnectorTerminationCommand = async ( +export const de_GetSipMediaApplicationLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorTerminationCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SipMediaApplicationLoggingConfiguration: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteVoiceConnectorTerminationCommandError + * deserializeAws_restJson1GetSipRuleCommand */ -const de_DeleteVoiceConnectorTerminationCommandError = async ( +export const de_GetSipRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SipRule: (_) => de_SipRule(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteVoiceConnectorTerminationCredentialsCommand + * deserializeAws_restJson1GetSpeakerSearchTaskCommand */ -export const de_DeleteVoiceConnectorTerminationCredentialsCommand = async ( +export const de_GetSpeakerSearchTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorTerminationCredentialsCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SpeakerSearchTask: (_) => de_SpeakerSearchTask(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteVoiceConnectorTerminationCredentialsCommandError + * deserializeAws_restJson1GetVoiceConnectorCommand */ -const de_DeleteVoiceConnectorTerminationCredentialsCommandError = async ( +export const de_GetVoiceConnectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVoiceProfileCommand - */ -export const de_DeleteVoiceProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceProfileCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + VoiceConnector: (_) => de_VoiceConnector(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteVoiceProfileCommandError - */ -const de_DeleteVoiceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVoiceProfileDomainCommand + * deserializeAws_restJson1GetVoiceConnectorEmergencyCallingConfigurationCommand */ -export const de_DeleteVoiceProfileDomainCommand = async ( +export const de_GetVoiceConnectorEmergencyCallingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceProfileDomainCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EmergencyCallingConfiguration: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteVoiceProfileDomainCommandError + * deserializeAws_restJson1GetVoiceConnectorGroupCommand */ -const de_DeleteVoiceProfileDomainCommandError = async ( +export const de_GetVoiceConnectorGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + VoiceConnectorGroup: (_) => de_VoiceConnectorGroup(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorCommand + * deserializeAws_restJson1GetVoiceConnectorLoggingConfigurationCommand */ -export const de_DisassociatePhoneNumbersFromVoiceConnectorCommand = async ( +export const de_GetVoiceConnectorLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociatePhoneNumbersFromVoiceConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - PhoneNumberErrors: _json, + LoggingConfiguration: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorCommandError + * deserializeAws_restJson1GetVoiceConnectorOriginationCommand */ -const de_DisassociatePhoneNumbersFromVoiceConnectorCommandError = async ( +export const de_GetVoiceConnectorOriginationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Origination: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorGroupCommand + * deserializeAws_restJson1GetVoiceConnectorProxyCommand */ -export const de_DisassociatePhoneNumbersFromVoiceConnectorGroupCommand = async ( +export const de_GetVoiceConnectorProxyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociatePhoneNumbersFromVoiceConnectorGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - PhoneNumberErrors: _json, + Proxy: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorGroupCommandError + * deserializeAws_restJson1GetVoiceConnectorStreamingConfigurationCommand */ -const de_DisassociatePhoneNumbersFromVoiceConnectorGroupCommandError = async ( +export const de_GetVoiceConnectorStreamingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + StreamingConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetGlobalSettingsCommand + * deserializeAws_restJson1GetVoiceConnectorTerminationCommand */ -export const de_GetGlobalSettingsCommand = async ( +export const de_GetVoiceConnectorTerminationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGlobalSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - VoiceConnector: _json, + Termination: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetGlobalSettingsCommandError + * deserializeAws_restJson1GetVoiceConnectorTerminationHealthCommand */ -const de_GetGlobalSettingsCommandError = async ( +export const de_GetVoiceConnectorTerminationHealthCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPhoneNumberCommand - */ -export const de_GetPhoneNumberCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - PhoneNumber: (_) => de_PhoneNumber(_, context), + TerminationHealth: (_) => de_TerminationHealth(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetPhoneNumberCommandError - */ -const de_GetPhoneNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPhoneNumberOrderCommand + * deserializeAws_restJson1GetVoiceProfileCommand */ -export const de_GetPhoneNumberOrderCommand = async ( +export const de_GetVoiceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPhoneNumberOrderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - PhoneNumberOrder: (_) => de_PhoneNumberOrder(_, context), + VoiceProfile: (_) => de_VoiceProfile(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetPhoneNumberOrderCommandError - */ -const de_GetPhoneNumberOrderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPhoneNumberSettingsCommand + * deserializeAws_restJson1GetVoiceProfileDomainCommand */ -export const de_GetPhoneNumberSettingsCommand = async ( +export const de_GetVoiceProfileDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPhoneNumberSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CallingName: __expectString, - CallingNameUpdatedTimestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + VoiceProfileDomain: (_) => de_VoiceProfileDomain(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetPhoneNumberSettingsCommandError + * deserializeAws_restJson1GetVoiceToneAnalysisTaskCommand */ -const de_GetPhoneNumberSettingsCommandError = async ( +export const de_GetVoiceToneAnalysisTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + VoiceToneAnalysisTask: (_) => de_VoiceToneAnalysisTask(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetProxySessionCommand + * deserializeAws_restJson1ListAvailableVoiceConnectorRegionsCommand */ -export const de_GetProxySessionCommand = async ( +export const de_ListAvailableVoiceConnectorRegionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProxySessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ProxySession: (_) => de_ProxySession(_, context), + VoiceConnectorRegions: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetProxySessionCommandError + * deserializeAws_restJson1ListPhoneNumberOrdersCommand */ -const de_GetProxySessionCommandError = async ( +export const de_ListPhoneNumberOrdersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + PhoneNumberOrders: (_) => de_PhoneNumberOrderList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetSipMediaApplicationCommand + * deserializeAws_restJson1ListPhoneNumbersCommand */ -export const de_GetSipMediaApplicationCommand = async ( +export const de_ListPhoneNumbersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSipMediaApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SipMediaApplication: (_) => de_SipMediaApplication(_, context), + NextToken: __expectString, + PhoneNumbers: (_) => de_PhoneNumberList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetSipMediaApplicationCommandError + * deserializeAws_restJson1ListProxySessionsCommand */ -const de_GetSipMediaApplicationCommandError = async ( +export const de_ListProxySessionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + ProxySessions: (_) => de_ProxySessions(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetSipMediaApplicationAlexaSkillConfigurationCommand + * deserializeAws_restJson1ListSipMediaApplicationsCommand */ -export const de_GetSipMediaApplicationAlexaSkillConfigurationCommand = async ( +export const de_ListSipMediaApplicationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSipMediaApplicationAlexaSkillConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SipMediaApplicationAlexaSkillConfiguration: _json, + NextToken: __expectString, + SipMediaApplications: (_) => de_SipMediaApplicationList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetSipMediaApplicationAlexaSkillConfigurationCommandError + * deserializeAws_restJson1ListSipRulesCommand */ -const de_GetSipMediaApplicationAlexaSkillConfigurationCommandError = async ( +export const de_ListSipRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + SipRules: (_) => de_SipRuleList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetSipMediaApplicationLoggingConfigurationCommand + * deserializeAws_restJson1ListSupportedPhoneNumberCountriesCommand */ -export const de_GetSipMediaApplicationLoggingConfigurationCommand = async ( +export const de_ListSupportedPhoneNumberCountriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSipMediaApplicationLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SipMediaApplicationLoggingConfiguration: _json, + PhoneNumberCountries: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetSipMediaApplicationLoggingConfigurationCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_GetSipMediaApplicationLoggingConfigurationCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetSipRuleCommand + * deserializeAws_restJson1ListVoiceConnectorGroupsCommand */ -export const de_GetSipRuleCommand = async ( +export const de_ListVoiceConnectorGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSipRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SipRule: (_) => de_SipRule(_, context), + NextToken: __expectString, + VoiceConnectorGroups: (_) => de_VoiceConnectorGroupList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetSipRuleCommandError + * deserializeAws_restJson1ListVoiceConnectorsCommand */ -const de_GetSipRuleCommandError = async ( +export const de_ListVoiceConnectorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + VoiceConnectors: (_) => de_VoiceConnectorList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetSpeakerSearchTaskCommand + * deserializeAws_restJson1ListVoiceConnectorTerminationCredentialsCommand */ -export const de_GetSpeakerSearchTaskCommand = async ( +export const de_ListVoiceConnectorTerminationCredentialsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSpeakerSearchTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SpeakerSearchTask: (_) => de_SpeakerSearchTask(_, context), + Usernames: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetSpeakerSearchTaskCommandError + * deserializeAws_restJson1ListVoiceProfileDomainsCommand */ -const de_GetSpeakerSearchTaskCommandError = async ( +export const de_ListVoiceProfileDomainsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorCommand - */ -export const de_GetVoiceConnectorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - VoiceConnector: (_) => de_VoiceConnector(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorCommandError - */ -const de_GetVoiceConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorEmergencyCallingConfigurationCommand - */ -export const de_GetVoiceConnectorEmergencyCallingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorEmergencyCallingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - EmergencyCallingConfiguration: _json, + NextToken: __expectString, + VoiceProfileDomains: (_) => de_VoiceProfileDomainSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetVoiceConnectorEmergencyCallingConfigurationCommandError - */ -const de_GetVoiceConnectorEmergencyCallingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorGroupCommand + * deserializeAws_restJson1ListVoiceProfilesCommand */ -export const de_GetVoiceConnectorGroupCommand = async ( +export const de_ListVoiceProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - VoiceConnectorGroup: (_) => de_VoiceConnectorGroup(_, context), + NextToken: __expectString, + VoiceProfiles: (_) => de_VoiceProfileSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetVoiceConnectorGroupCommandError - */ -const de_GetVoiceConnectorGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorLoggingConfigurationCommand + * deserializeAws_restJson1PutSipMediaApplicationAlexaSkillConfigurationCommand */ -export const de_GetVoiceConnectorLoggingConfigurationCommand = async ( +export const de_PutSipMediaApplicationAlexaSkillConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - LoggingConfiguration: _json, + SipMediaApplicationAlexaSkillConfiguration: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetVoiceConnectorLoggingConfigurationCommandError - */ -const de_GetVoiceConnectorLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorOriginationCommand + * deserializeAws_restJson1PutSipMediaApplicationLoggingConfigurationCommand */ -export const de_GetVoiceConnectorOriginationCommand = async ( +export const de_PutSipMediaApplicationLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorOriginationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Origination: _json, + SipMediaApplicationLoggingConfiguration: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetVoiceConnectorOriginationCommandError + * deserializeAws_restJson1PutVoiceConnectorEmergencyCallingConfigurationCommand */ -const de_GetVoiceConnectorOriginationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorProxyCommand - */ -export const de_GetVoiceConnectorProxyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorProxyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Proxy: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorProxyCommandError - */ -const de_GetVoiceConnectorProxyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorStreamingConfigurationCommand - */ -export const de_GetVoiceConnectorStreamingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorStreamingConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - StreamingConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorStreamingConfigurationCommandError - */ -const de_GetVoiceConnectorStreamingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorTerminationCommand - */ -export const de_GetVoiceConnectorTerminationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorTerminationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Termination: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorTerminationCommandError - */ -const de_GetVoiceConnectorTerminationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorTerminationHealthCommand - */ -export const de_GetVoiceConnectorTerminationHealthCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorTerminationHealthCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - TerminationHealth: (_) => de_TerminationHealth(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorTerminationHealthCommandError - */ -const de_GetVoiceConnectorTerminationHealthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceProfileCommand - */ -export const de_GetVoiceProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - VoiceProfile: (_) => de_VoiceProfile(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceProfileCommandError - */ -const de_GetVoiceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceProfileDomainCommand - */ -export const de_GetVoiceProfileDomainCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceProfileDomainCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - VoiceProfileDomain: (_) => de_VoiceProfileDomain(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceProfileDomainCommandError - */ -const de_GetVoiceProfileDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceToneAnalysisTaskCommand - */ -export const de_GetVoiceToneAnalysisTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceToneAnalysisTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - VoiceToneAnalysisTask: (_) => de_VoiceToneAnalysisTask(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceToneAnalysisTaskCommandError - */ -const de_GetVoiceToneAnalysisTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAvailableVoiceConnectorRegionsCommand - */ -export const de_ListAvailableVoiceConnectorRegionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAvailableVoiceConnectorRegionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - VoiceConnectorRegions: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAvailableVoiceConnectorRegionsCommandError - */ -const de_ListAvailableVoiceConnectorRegionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPhoneNumberOrdersCommand - */ -export const de_ListPhoneNumberOrdersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPhoneNumberOrdersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - PhoneNumberOrders: (_) => de_PhoneNumberOrderList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPhoneNumberOrdersCommandError - */ -const de_ListPhoneNumberOrdersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPhoneNumbersCommand - */ -export const de_ListPhoneNumbersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPhoneNumbersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - PhoneNumbers: (_) => de_PhoneNumberList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPhoneNumbersCommandError - */ -const de_ListPhoneNumbersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListProxySessionsCommand - */ -export const de_ListProxySessionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProxySessionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - ProxySessions: (_) => de_ProxySessions(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListProxySessionsCommandError - */ -const de_ListProxySessionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSipMediaApplicationsCommand - */ -export const de_ListSipMediaApplicationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSipMediaApplicationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - SipMediaApplications: (_) => de_SipMediaApplicationList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSipMediaApplicationsCommandError - */ -const de_ListSipMediaApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSipRulesCommand - */ -export const de_ListSipRulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSipRulesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - SipRules: (_) => de_SipRuleList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSipRulesCommandError - */ -const de_ListSipRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSupportedPhoneNumberCountriesCommand - */ -export const de_ListSupportedPhoneNumberCountriesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSupportedPhoneNumberCountriesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - PhoneNumberCountries: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSupportedPhoneNumberCountriesCommandError - */ -const de_ListSupportedPhoneNumberCountriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListVoiceConnectorGroupsCommand - */ -export const de_ListVoiceConnectorGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVoiceConnectorGroupsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - VoiceConnectorGroups: (_) => de_VoiceConnectorGroupList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListVoiceConnectorGroupsCommandError - */ -const de_ListVoiceConnectorGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListVoiceConnectorsCommand - */ -export const de_ListVoiceConnectorsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVoiceConnectorsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - VoiceConnectors: (_) => de_VoiceConnectorList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListVoiceConnectorsCommandError - */ -const de_ListVoiceConnectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListVoiceConnectorTerminationCredentialsCommand - */ -export const de_ListVoiceConnectorTerminationCredentialsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVoiceConnectorTerminationCredentialsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Usernames: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListVoiceConnectorTerminationCredentialsCommandError - */ -const de_ListVoiceConnectorTerminationCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListVoiceProfileDomainsCommand - */ -export const de_ListVoiceProfileDomainsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVoiceProfileDomainsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - VoiceProfileDomains: (_) => de_VoiceProfileDomainSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListVoiceProfileDomainsCommandError - */ -const de_ListVoiceProfileDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListVoiceProfilesCommand - */ -export const de_ListVoiceProfilesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVoiceProfilesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - VoiceProfiles: (_) => de_VoiceProfileSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListVoiceProfilesCommandError - */ -const de_ListVoiceProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutSipMediaApplicationAlexaSkillConfigurationCommand - */ -export const de_PutSipMediaApplicationAlexaSkillConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutSipMediaApplicationAlexaSkillConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - SipMediaApplicationAlexaSkillConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutSipMediaApplicationAlexaSkillConfigurationCommandError - */ -const de_PutSipMediaApplicationAlexaSkillConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutSipMediaApplicationLoggingConfigurationCommand - */ -export const de_PutSipMediaApplicationLoggingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutSipMediaApplicationLoggingConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - SipMediaApplicationLoggingConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutSipMediaApplicationLoggingConfigurationCommandError - */ -const de_PutSipMediaApplicationLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorEmergencyCallingConfigurationCommand - */ -export const de_PutVoiceConnectorEmergencyCallingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutVoiceConnectorEmergencyCallingConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - EmergencyCallingConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorEmergencyCallingConfigurationCommandError - */ -const de_PutVoiceConnectorEmergencyCallingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorLoggingConfigurationCommand - */ -export const de_PutVoiceConnectorLoggingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutVoiceConnectorLoggingConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LoggingConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorLoggingConfigurationCommandError - */ -const de_PutVoiceConnectorLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorOriginationCommand - */ -export const de_PutVoiceConnectorOriginationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutVoiceConnectorOriginationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Origination: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorOriginationCommandError - */ -const de_PutVoiceConnectorOriginationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorProxyCommand - */ -export const de_PutVoiceConnectorProxyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutVoiceConnectorProxyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Proxy: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorProxyCommandError - */ -const de_PutVoiceConnectorProxyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorStreamingConfigurationCommand - */ -export const de_PutVoiceConnectorStreamingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutVoiceConnectorStreamingConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - StreamingConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorStreamingConfigurationCommandError - */ -const de_PutVoiceConnectorStreamingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorTerminationCommand - */ -export const de_PutVoiceConnectorTerminationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutVoiceConnectorTerminationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Termination: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorTerminationCommandError - */ -const de_PutVoiceConnectorTerminationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorTerminationCredentialsCommand - */ -export const de_PutVoiceConnectorTerminationCredentialsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_PutVoiceConnectorTerminationCredentialsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorTerminationCredentialsCommandError - */ -const de_PutVoiceConnectorTerminationCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RestorePhoneNumberCommand - */ -export const de_RestorePhoneNumberCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RestorePhoneNumberCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - PhoneNumber: (_) => de_PhoneNumber(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1RestorePhoneNumberCommandError - */ -const de_RestorePhoneNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkvoice#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchAvailablePhoneNumbersCommand - */ -export const de_SearchAvailablePhoneNumbersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchAvailablePhoneNumbersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - E164PhoneNumbers: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SearchAvailablePhoneNumbersCommandError - */ -const de_SearchAvailablePhoneNumbersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartSpeakerSearchTaskCommand - */ -export const de_StartSpeakerSearchTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_StartSpeakerSearchTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - SpeakerSearchTask: (_) => de_SpeakerSearchTask(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartSpeakerSearchTaskCommandError - */ -const de_StartSpeakerSearchTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GoneException": - case "com.amazonaws.chimesdkvoice#GoneException": - throw await de_GoneExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkvoice#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.chimesdkvoice#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartVoiceToneAnalysisTaskCommand - */ -export const de_StartVoiceToneAnalysisTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_StartVoiceToneAnalysisTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - VoiceToneAnalysisTask: (_) => de_VoiceToneAnalysisTask(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartVoiceToneAnalysisTaskCommandError - */ -const de_StartVoiceToneAnalysisTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GoneException": - case "com.amazonaws.chimesdkvoice#GoneException": - throw await de_GoneExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkvoice#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.chimesdkvoice#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StopSpeakerSearchTaskCommand - */ -export const de_StopSpeakerSearchTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_StopSpeakerSearchTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1StopSpeakerSearchTaskCommandError - */ -const de_StopSpeakerSearchTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.chimesdkvoice#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StopVoiceToneAnalysisTaskCommand - */ -export const de_StopVoiceToneAnalysisTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_StopVoiceToneAnalysisTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1StopVoiceToneAnalysisTaskCommandError - */ -const de_StopVoiceToneAnalysisTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.chimesdkvoice#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_PutVoiceConnectorEmergencyCallingConfigurationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EmergencyCallingConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1PutVoiceConnectorLoggingConfigurationCommand */ -export const de_TagResourceCommand = async ( +export const de_PutVoiceConnectorLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LoggingConfiguration: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1PutVoiceConnectorOriginationCommand */ -const de_TagResourceCommandError = async ( +export const de_PutVoiceConnectorOriginationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkvoice#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Origination: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1PutVoiceConnectorProxyCommand */ -export const de_UntagResourceCommand = async ( +export const de_PutVoiceConnectorProxyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Proxy: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1PutVoiceConnectorStreamingConfigurationCommand */ -const de_UntagResourceCommandError = async ( +export const de_PutVoiceConnectorStreamingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + StreamingConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1PutVoiceConnectorTerminationCommand + */ +export const de_PutVoiceConnectorTerminationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Termination: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateGlobalSettingsCommand + * deserializeAws_restJson1PutVoiceConnectorTerminationCredentialsCommand */ -export const de_UpdateGlobalSettingsCommand = async ( +export const de_PutVoiceConnectorTerminationCredentialsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateGlobalSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7632,123 +3781,99 @@ export const de_UpdateGlobalSettingsCommand = async ( }; /** - * deserializeAws_restJson1UpdateGlobalSettingsCommandError + * deserializeAws_restJson1RestorePhoneNumberCommand */ -const de_UpdateGlobalSettingsCommandError = async ( +export const de_RestorePhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PhoneNumber: (_) => de_PhoneNumber(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdatePhoneNumberCommand + * deserializeAws_restJson1SearchAvailablePhoneNumbersCommand */ -export const de_UpdatePhoneNumberCommand = async ( +export const de_SearchAvailablePhoneNumbersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - PhoneNumber: (_) => de_PhoneNumber(_, context), + E164PhoneNumbers: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdatePhoneNumberCommandError + * deserializeAws_restJson1StartSpeakerSearchTaskCommand */ -const de_UpdatePhoneNumberCommandError = async ( +export const de_StartSpeakerSearchTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SpeakerSearchTask: (_) => de_SpeakerSearchTask(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1StartVoiceToneAnalysisTaskCommand + */ +export const de_StartVoiceToneAnalysisTaskCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + VoiceToneAnalysisTask: (_) => de_VoiceToneAnalysisTask(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdatePhoneNumberSettingsCommand + * deserializeAws_restJson1StopSpeakerSearchTaskCommand */ -export const de_UpdatePhoneNumberSettingsCommand = async ( +export const de_StopSpeakerSearchTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdatePhoneNumberSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7758,316 +3883,193 @@ export const de_UpdatePhoneNumberSettingsCommand = async ( }; /** - * deserializeAws_restJson1UpdatePhoneNumberSettingsCommandError + * deserializeAws_restJson1StopVoiceToneAnalysisTaskCommand */ -const de_UpdatePhoneNumberSettingsCommandError = async ( +export const de_StopVoiceToneAnalysisTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateProxySessionCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UpdateProxySessionCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_UpdateProxySessionCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ProxySession: (_) => de_ProxySession(_, context), + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UntagResourceCommand + */ +export const de_UntagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1UpdateProxySessionCommandError + * deserializeAws_restJson1UpdateGlobalSettingsCommand */ -const de_UpdateProxySessionCommandError = async ( +export const de_UpdateGlobalSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateSipMediaApplicationCommand + * deserializeAws_restJson1UpdatePhoneNumberCommand */ -export const de_UpdateSipMediaApplicationCommand = async ( +export const de_UpdatePhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSipMediaApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SipMediaApplication: (_) => de_SipMediaApplication(_, context), + PhoneNumber: (_) => de_PhoneNumber(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateSipMediaApplicationCommandError + * deserializeAws_restJson1UpdatePhoneNumberSettingsCommand */ -const de_UpdateSipMediaApplicationCommandError = async ( +export const de_UpdatePhoneNumberSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateSipMediaApplicationCallCommand + * deserializeAws_restJson1UpdateProxySessionCommand */ -export const de_UpdateSipMediaApplicationCallCommand = async ( +export const de_UpdateProxySessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateSipMediaApplicationCallCommandError(output, context); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SipMediaApplicationCall: _json, + ProxySession: (_) => de_ProxySession(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateSipMediaApplicationCallCommandError + * deserializeAws_restJson1UpdateSipMediaApplicationCommand */ -const de_UpdateSipMediaApplicationCallCommandError = async ( +export const de_UpdateSipMediaApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkvoice#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SipMediaApplication: (_) => de_SipMediaApplication(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateSipRuleCommand + * deserializeAws_restJson1UpdateSipMediaApplicationCallCommand */ -export const de_UpdateSipRuleCommand = async ( +export const de_UpdateSipMediaApplicationCallCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateSipRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SipRule: (_) => de_SipRule(_, context), + SipMediaApplicationCall: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateSipRuleCommandError + * deserializeAws_restJson1UpdateSipRuleCommand */ -const de_UpdateSipRuleCommandError = async ( +export const de_UpdateSipRuleCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chimesdkvoice#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SipRule: (_) => de_SipRule(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -8078,7 +4080,7 @@ export const de_UpdateVoiceConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVoiceConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8091,50 +4093,6 @@ export const de_UpdateVoiceConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateVoiceConnectorCommandError - */ -const de_UpdateVoiceConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVoiceConnectorGroupCommand */ @@ -8143,7 +4101,7 @@ export const de_UpdateVoiceConnectorGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateVoiceConnectorGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8156,53 +4114,6 @@ export const de_UpdateVoiceConnectorGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateVoiceConnectorGroupCommandError - */ -const de_UpdateVoiceConnectorGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVoiceProfileCommand */ @@ -8211,7 +4122,7 @@ export const de_UpdateVoiceProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVoiceProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8224,59 +4135,6 @@ export const de_UpdateVoiceProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateVoiceProfileCommandError - */ -const de_UpdateVoiceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chimesdkvoice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GoneException": - case "com.amazonaws.chimesdkvoice#GoneException": - throw await de_GoneExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVoiceProfileDomainCommand */ @@ -8285,7 +4143,7 @@ export const de_UpdateVoiceProfileDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVoiceProfileDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8298,53 +4156,6 @@ export const de_UpdateVoiceProfileDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateVoiceProfileDomainCommandError - */ -const de_UpdateVoiceProfileDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chimesdkvoice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chimesdkvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chimesdkvoice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chimesdkvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chimesdkvoice#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chimesdkvoice#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chimesdkvoice#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ValidateE911AddressCommand */ @@ -8353,7 +4164,7 @@ export const de_ValidateE911AddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_ValidateE911AddressCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8370,18 +4181,18 @@ export const de_ValidateE911AddressCommand = async ( }; /** - * deserializeAws_restJson1ValidateE911AddressCommandError + * deserialize_Aws_restJson1CommandError */ -const de_ValidateE911AddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.chimesdkvoice#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); case "BadRequestException": case "com.amazonaws.chimesdkvoice#BadRequestException": throw await de_BadRequestExceptionRes(parsedOutput, context); @@ -8403,13 +4214,25 @@ const de_ValidateE911AddressCommandError = async ( case "UnauthorizedClientException": case "com.amazonaws.chimesdkvoice#UnauthorizedClientException": throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); + case "ResourceLimitExceededException": + case "com.amazonaws.chimesdkvoice#ResourceLimitExceededException": + throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.chimesdkvoice#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "GoneException": + case "com.amazonaws.chimesdkvoice#GoneException": + throw await de_GoneExceptionRes(parsedOutput, context); + case "UnprocessableEntityException": + case "com.amazonaws.chimesdkvoice#UnprocessableEntityException": + throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-chime/src/protocols/Aws_restJson1.ts b/clients/client-chime/src/protocols/Aws_restJson1.ts index c0953d8b2390..931c74417b6f 100644 --- a/clients/client-chime/src/protocols/Aws_restJson1.ts +++ b/clients/client-chime/src/protocols/Aws_restJson1.ts @@ -5072,7 +5072,7 @@ export const de_AssociatePhoneNumbersWithVoiceConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociatePhoneNumbersWithVoiceConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5085,53 +5085,6 @@ export const de_AssociatePhoneNumbersWithVoiceConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociatePhoneNumbersWithVoiceConnectorCommandError - */ -const de_AssociatePhoneNumbersWithVoiceConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociatePhoneNumbersWithVoiceConnectorGroupCommand */ @@ -5140,7 +5093,7 @@ export const de_AssociatePhoneNumbersWithVoiceConnectorGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociatePhoneNumbersWithVoiceConnectorGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5153,53 +5106,6 @@ export const de_AssociatePhoneNumbersWithVoiceConnectorGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociatePhoneNumbersWithVoiceConnectorGroupCommandError - */ -const de_AssociatePhoneNumbersWithVoiceConnectorGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociatePhoneNumberWithUserCommand */ @@ -5208,7 +5114,7 @@ export const de_AssociatePhoneNumberWithUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociatePhoneNumberWithUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5217,53 +5123,6 @@ export const de_AssociatePhoneNumberWithUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociatePhoneNumberWithUserCommandError - */ -const de_AssociatePhoneNumberWithUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateSigninDelegateGroupsWithAccountCommand */ @@ -5272,7 +5131,7 @@ export const de_AssociateSigninDelegateGroupsWithAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateSigninDelegateGroupsWithAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5281,50 +5140,6 @@ export const de_AssociateSigninDelegateGroupsWithAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateSigninDelegateGroupsWithAccountCommandError - */ -const de_AssociateSigninDelegateGroupsWithAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchCreateAttendeeCommand */ @@ -5333,7 +5148,7 @@ export const de_BatchCreateAttendeeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_BatchCreateAttendeeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5347,53 +5162,6 @@ export const de_BatchCreateAttendeeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchCreateAttendeeCommandError - */ -const de_BatchCreateAttendeeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchCreateChannelMembershipCommand */ @@ -5402,7 +5170,7 @@ export const de_BatchCreateChannelMembershipCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchCreateChannelMembershipCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5416,47 +5184,6 @@ export const de_BatchCreateChannelMembershipCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchCreateChannelMembershipCommandError - */ -const de_BatchCreateChannelMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchCreateRoomMembershipCommand */ @@ -5465,7 +5192,7 @@ export const de_BatchCreateRoomMembershipCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_BatchCreateRoomMembershipCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5479,58 +5206,14 @@ export const de_BatchCreateRoomMembershipCommand = async ( }; /** - * deserializeAws_restJson1BatchCreateRoomMembershipCommandError - */ -const de_BatchCreateRoomMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1BatchDeletePhoneNumberCommand + * deserializeAws_restJson1BatchDeletePhoneNumberCommand */ export const de_BatchDeletePhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDeletePhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5543,50 +5226,6 @@ export const de_BatchDeletePhoneNumberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDeletePhoneNumberCommandError - */ -const de_BatchDeletePhoneNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchSuspendUserCommand */ @@ -5595,7 +5234,7 @@ export const de_BatchSuspendUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchSuspendUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5608,50 +5247,6 @@ export const de_BatchSuspendUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchSuspendUserCommandError - */ -const de_BatchSuspendUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUnsuspendUserCommand */ @@ -5660,7 +5255,7 @@ export const de_BatchUnsuspendUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUnsuspendUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5673,50 +5268,6 @@ export const de_BatchUnsuspendUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchUnsuspendUserCommandError - */ -const de_BatchUnsuspendUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUpdatePhoneNumberCommand */ @@ -5725,7 +5276,7 @@ export const de_BatchUpdatePhoneNumberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpdatePhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5738,50 +5289,6 @@ export const de_BatchUpdatePhoneNumberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchUpdatePhoneNumberCommandError - */ -const de_BatchUpdatePhoneNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUpdateUserCommand */ @@ -5790,7 +5297,7 @@ export const de_BatchUpdateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpdateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5803,50 +5310,6 @@ export const de_BatchUpdateUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchUpdateUserCommandError - */ -const de_BatchUpdateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAccountCommand */ @@ -5855,7 +5318,7 @@ export const de_CreateAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5869,58 +5332,14 @@ export const de_CreateAccountCommand = async ( }; /** - * deserializeAws_restJson1CreateAccountCommandError + * deserializeAws_restJson1CreateAppInstanceCommand */ -const de_CreateAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateAppInstanceCommand - */ -export const de_CreateAppInstanceCommand = async ( +export const de_CreateAppInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAppInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5933,53 +5352,6 @@ export const de_CreateAppInstanceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAppInstanceCommandError - */ -const de_CreateAppInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAppInstanceAdminCommand */ @@ -5988,7 +5360,7 @@ export const de_CreateAppInstanceAdminCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAppInstanceAdminCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6002,53 +5374,6 @@ export const de_CreateAppInstanceAdminCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAppInstanceAdminCommandError - */ -const de_CreateAppInstanceAdminCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAppInstanceUserCommand */ @@ -6057,7 +5382,7 @@ export const de_CreateAppInstanceUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAppInstanceUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6070,53 +5395,6 @@ export const de_CreateAppInstanceUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAppInstanceUserCommandError - */ -const de_CreateAppInstanceUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAttendeeCommand */ @@ -6125,7 +5403,7 @@ export const de_CreateAttendeeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAttendeeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6138,53 +5416,6 @@ export const de_CreateAttendeeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAttendeeCommandError - */ -const de_CreateAttendeeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBotCommand */ @@ -6193,7 +5424,7 @@ export const de_CreateBotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateBotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6206,53 +5437,6 @@ export const de_CreateBotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBotCommandError - */ -const de_CreateBotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateChannelCommand */ @@ -6261,7 +5445,7 @@ export const de_CreateChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6274,53 +5458,6 @@ export const de_CreateChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateChannelCommandError - */ -const de_CreateChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateChannelBanCommand */ @@ -6329,7 +5466,7 @@ export const de_CreateChannelBanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateChannelBanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6343,53 +5480,6 @@ export const de_CreateChannelBanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateChannelBanCommandError - */ -const de_CreateChannelBanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateChannelMembershipCommand */ @@ -6398,7 +5488,7 @@ export const de_CreateChannelMembershipCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateChannelMembershipCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6412,53 +5502,6 @@ export const de_CreateChannelMembershipCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateChannelMembershipCommandError - */ -const de_CreateChannelMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateChannelModeratorCommand */ @@ -6467,7 +5510,7 @@ export const de_CreateChannelModeratorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateChannelModeratorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6482,132 +5525,85 @@ export const de_CreateChannelModeratorCommand = async ( }; /** - * deserializeAws_restJson1CreateChannelModeratorCommandError + * deserializeAws_restJson1CreateMediaCapturePipelineCommand */ -const de_CreateChannelModeratorCommandError = async ( +export const de_CreateMediaCapturePipelineCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + MediaCapturePipeline: (_) => de_MediaCapturePipeline(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateMediaCapturePipelineCommand + * deserializeAws_restJson1CreateMeetingCommand */ -export const de_CreateMediaCapturePipelineCommand = async ( +export const de_CreateMeetingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateMediaCapturePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - MediaCapturePipeline: (_) => de_MediaCapturePipeline(_, context), + Meeting: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateMediaCapturePipelineCommandError + * deserializeAws_restJson1CreateMeetingDialOutCommand */ -const de_CreateMediaCapturePipelineCommandError = async ( +export const de_CreateMeetingDialOutCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + TransactionId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateMeetingCommand + * deserializeAws_restJson1CreateMeetingWithAttendeesCommand */ -export const de_CreateMeetingCommand = async ( +export const de_CreateMeetingWithAttendeesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateMeetingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + Attendees: _json, + Errors: _json, Meeting: _json, }); Object.assign(contents, doc); @@ -6615,879 +5611,462 @@ export const de_CreateMeetingCommand = async ( }; /** - * deserializeAws_restJson1CreateMeetingCommandError + * deserializeAws_restJson1CreatePhoneNumberOrderCommand */ -const de_CreateMeetingCommandError = async ( +export const de_CreatePhoneNumberOrderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateMeetingDialOutCommand - */ -export const de_CreateMeetingDialOutCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateMeetingDialOutCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - TransactionId: __expectString, + PhoneNumberOrder: (_) => de_PhoneNumberOrder(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateMeetingDialOutCommandError - */ -const de_CreateMeetingDialOutCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateMeetingWithAttendeesCommand + * deserializeAws_restJson1CreateProxySessionCommand */ -export const de_CreateMeetingWithAttendeesCommand = async ( +export const de_CreateProxySessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateMeetingWithAttendeesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Attendees: _json, - Errors: _json, - Meeting: _json, + ProxySession: (_) => de_ProxySession(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateMeetingWithAttendeesCommandError - */ -const de_CreateMeetingWithAttendeesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreatePhoneNumberOrderCommand + * deserializeAws_restJson1CreateRoomCommand */ -export const de_CreatePhoneNumberOrderCommand = async ( +export const de_CreateRoomCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreatePhoneNumberOrderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - PhoneNumberOrder: (_) => de_PhoneNumberOrder(_, context), + Room: (_) => de_Room(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreatePhoneNumberOrderCommandError + * deserializeAws_restJson1CreateRoomMembershipCommand */ -const de_CreatePhoneNumberOrderCommandError = async ( +export const de_CreateRoomMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RoomMembership: (_) => de_RoomMembership(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateProxySessionCommand + * deserializeAws_restJson1CreateSipMediaApplicationCommand */ -export const de_CreateProxySessionCommand = async ( +export const de_CreateSipMediaApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateProxySessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ProxySession: (_) => de_ProxySession(_, context), + SipMediaApplication: (_) => de_SipMediaApplication(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateProxySessionCommandError + * deserializeAws_restJson1CreateSipMediaApplicationCallCommand */ -const de_CreateProxySessionCommandError = async ( +export const de_CreateSipMediaApplicationCallCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SipMediaApplicationCall: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateRoomCommand + * deserializeAws_restJson1CreateSipRuleCommand */ -export const de_CreateRoomCommand = async ( +export const de_CreateSipRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateRoomCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Room: (_) => de_Room(_, context), + SipRule: (_) => de_SipRule(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateRoomCommandError + * deserializeAws_restJson1CreateUserCommand */ -const de_CreateRoomCommandError = async ( +export const de_CreateUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + User: (_) => de_User(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateRoomMembershipCommand + * deserializeAws_restJson1CreateVoiceConnectorCommand */ -export const de_CreateRoomMembershipCommand = async ( +export const de_CreateVoiceConnectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateRoomMembershipCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - RoomMembership: (_) => de_RoomMembership(_, context), + VoiceConnector: (_) => de_VoiceConnector(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateRoomMembershipCommandError + * deserializeAws_restJson1CreateVoiceConnectorGroupCommand */ -const de_CreateRoomMembershipCommandError = async ( +export const de_CreateVoiceConnectorGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + VoiceConnectorGroup: (_) => de_VoiceConnectorGroup(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateSipMediaApplicationCommand + * deserializeAws_restJson1DeleteAccountCommand */ -export const de_CreateSipMediaApplicationCommand = async ( +export const de_DeleteAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSipMediaApplicationCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - SipMediaApplication: (_) => de_SipMediaApplication(_, context), - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateSipMediaApplicationCommandError + * deserializeAws_restJson1DeleteAppInstanceCommand */ -const de_CreateSipMediaApplicationCommandError = async ( +export const de_DeleteAppInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateSipMediaApplicationCallCommand + * deserializeAws_restJson1DeleteAppInstanceAdminCommand */ -export const de_CreateSipMediaApplicationCallCommand = async ( +export const de_DeleteAppInstanceAdminCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSipMediaApplicationCallCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - SipMediaApplicationCall: _json, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateSipMediaApplicationCallCommandError + * deserializeAws_restJson1DeleteAppInstanceStreamingConfigurationsCommand */ -const de_CreateSipMediaApplicationCallCommandError = async ( +export const de_DeleteAppInstanceStreamingConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateSipRuleCommand + * deserializeAws_restJson1DeleteAppInstanceUserCommand */ -export const de_CreateSipRuleCommand = async ( +export const de_DeleteAppInstanceUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSipRuleCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - SipRule: (_) => de_SipRule(_, context), - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateSipRuleCommandError + * deserializeAws_restJson1DeleteAttendeeCommand */ -const de_CreateSipRuleCommandError = async ( +export const de_DeleteAttendeeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateUserCommand + * deserializeAws_restJson1DeleteChannelCommand */ -export const de_CreateUserCommand = async ( +export const de_DeleteChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateUserCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - User: (_) => de_User(_, context), - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateUserCommandError + * deserializeAws_restJson1DeleteChannelBanCommand */ -const de_CreateUserCommandError = async ( +export const de_DeleteChannelBanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateVoiceConnectorCommand + * deserializeAws_restJson1DeleteChannelMembershipCommand */ -export const de_CreateVoiceConnectorCommand = async ( +export const de_DeleteChannelMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateVoiceConnectorCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - VoiceConnector: (_) => de_VoiceConnector(_, context), + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteChannelMessageCommand + */ +export const de_DeleteChannelMessageCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateVoiceConnectorCommandError + * deserializeAws_restJson1DeleteChannelModeratorCommand */ -const de_CreateVoiceConnectorCommandError = async ( +export const de_DeleteChannelModeratorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateVoiceConnectorGroupCommand + * deserializeAws_restJson1DeleteEventsConfigurationCommand */ -export const de_CreateVoiceConnectorGroupCommand = async ( +export const de_DeleteEventsConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateVoiceConnectorGroupCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - VoiceConnectorGroup: (_) => de_VoiceConnectorGroup(_, context), + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteMediaCapturePipelineCommand + */ +export const de_DeleteMediaCapturePipelineCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateVoiceConnectorGroupCommandError + * deserializeAws_restJson1DeleteMeetingCommand */ -const de_CreateVoiceConnectorGroupCommandError = async ( +export const de_DeleteMeetingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteAccountCommand + * deserializeAws_restJson1DeletePhoneNumberCommand */ -export const de_DeleteAccountCommand = async ( +export const de_DeletePhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7497,61 +6076,31 @@ export const de_DeleteAccountCommand = async ( }; /** - * deserializeAws_restJson1DeleteAccountCommandError + * deserializeAws_restJson1DeleteProxySessionCommand */ -const de_DeleteAccountCommandError = async ( +export const de_DeleteProxySessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.chime#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteAppInstanceCommand + * deserializeAws_restJson1DeleteRoomCommand */ -export const de_DeleteAppInstanceCommand = async ( +export const de_DeleteRoomCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAppInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7561,55 +6110,31 @@ export const de_DeleteAppInstanceCommand = async ( }; /** - * deserializeAws_restJson1DeleteAppInstanceCommandError + * deserializeAws_restJson1DeleteRoomMembershipCommand */ -const de_DeleteAppInstanceCommandError = async ( +export const de_DeleteRoomMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteAppInstanceAdminCommand + * deserializeAws_restJson1DeleteSipMediaApplicationCommand */ -export const de_DeleteAppInstanceAdminCommand = async ( +export const de_DeleteSipMediaApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAppInstanceAdminCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7619,58 +6144,31 @@ export const de_DeleteAppInstanceAdminCommand = async ( }; /** - * deserializeAws_restJson1DeleteAppInstanceAdminCommandError + * deserializeAws_restJson1DeleteSipRuleCommand */ -const de_DeleteAppInstanceAdminCommandError = async ( +export const de_DeleteSipRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteAppInstanceStreamingConfigurationsCommand + * deserializeAws_restJson1DeleteVoiceConnectorCommand */ -export const de_DeleteAppInstanceStreamingConfigurationsCommand = async ( +export const de_DeleteVoiceConnectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAppInstanceStreamingConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7680,58 +6178,31 @@ export const de_DeleteAppInstanceStreamingConfigurationsCommand = async ( }; /** - * deserializeAws_restJson1DeleteAppInstanceStreamingConfigurationsCommandError + * deserializeAws_restJson1DeleteVoiceConnectorEmergencyCallingConfigurationCommand */ -const de_DeleteAppInstanceStreamingConfigurationsCommandError = async ( +export const de_DeleteVoiceConnectorEmergencyCallingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteAppInstanceUserCommand + * deserializeAws_restJson1DeleteVoiceConnectorGroupCommand */ -export const de_DeleteAppInstanceUserCommand = async ( +export const de_DeleteVoiceConnectorGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAppInstanceUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7741,55 +6212,31 @@ export const de_DeleteAppInstanceUserCommand = async ( }; /** - * deserializeAws_restJson1DeleteAppInstanceUserCommandError + * deserializeAws_restJson1DeleteVoiceConnectorOriginationCommand */ -const de_DeleteAppInstanceUserCommandError = async ( +export const de_DeleteVoiceConnectorOriginationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteAttendeeCommand + * deserializeAws_restJson1DeleteVoiceConnectorProxyCommand */ -export const de_DeleteAttendeeCommand = async ( +export const de_DeleteVoiceConnectorProxyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAttendeeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7799,58 +6246,14 @@ export const de_DeleteAttendeeCommand = async ( }; /** - * deserializeAws_restJson1DeleteAttendeeCommandError + * deserializeAws_restJson1DeleteVoiceConnectorStreamingConfigurationCommand */ -const de_DeleteAttendeeCommandError = async ( +export const de_DeleteVoiceConnectorStreamingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteChannelCommand - */ -export const de_DeleteChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7860,55 +6263,31 @@ export const de_DeleteChannelCommand = async ( }; /** - * deserializeAws_restJson1DeleteChannelCommandError + * deserializeAws_restJson1DeleteVoiceConnectorTerminationCommand */ -const de_DeleteChannelCommandError = async ( +export const de_DeleteVoiceConnectorTerminationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteChannelBanCommand + * deserializeAws_restJson1DeleteVoiceConnectorTerminationCredentialsCommand */ -export const de_DeleteChannelBanCommand = async ( +export const de_DeleteVoiceConnectorTerminationCredentialsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteChannelBanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7918,290 +6297,203 @@ export const de_DeleteChannelBanCommand = async ( }; /** - * deserializeAws_restJson1DeleteChannelBanCommandError + * deserializeAws_restJson1DescribeAppInstanceCommand */ -const de_DeleteChannelBanCommandError = async ( +export const de_DescribeAppInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AppInstance: (_) => de_AppInstance(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteChannelMembershipCommand + * deserializeAws_restJson1DescribeAppInstanceAdminCommand */ -export const de_DeleteChannelMembershipCommand = async ( +export const de_DescribeAppInstanceAdminCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteChannelMembershipCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AppInstanceAdmin: (_) => de_AppInstanceAdmin(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteChannelMembershipCommandError + * deserializeAws_restJson1DescribeAppInstanceUserCommand */ -const de_DeleteChannelMembershipCommandError = async ( +export const de_DescribeAppInstanceUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AppInstanceUser: (_) => de_AppInstanceUser(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteChannelMessageCommand + * deserializeAws_restJson1DescribeChannelCommand */ -export const de_DeleteChannelMessageCommand = async ( +export const de_DescribeChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteChannelMessageCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Channel: (_) => de_Channel(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteChannelMessageCommandError + * deserializeAws_restJson1DescribeChannelBanCommand */ -const de_DeleteChannelMessageCommandError = async ( +export const de_DescribeChannelBanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelBan: (_) => de_ChannelBan(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteChannelModeratorCommand + * deserializeAws_restJson1DescribeChannelMembershipCommand */ -export const de_DeleteChannelModeratorCommand = async ( +export const de_DescribeChannelMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteChannelModeratorCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelMembership: (_) => de_ChannelMembership(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteChannelModeratorCommandError + * deserializeAws_restJson1DescribeChannelMembershipForAppInstanceUserCommand */ -const de_DeleteChannelModeratorCommandError = async ( +export const de_DescribeChannelMembershipForAppInstanceUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelMembership: (_) => de_ChannelMembershipForAppInstanceUserSummary(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteEventsConfigurationCommand + * deserializeAws_restJson1DescribeChannelModeratedByAppInstanceUserCommand */ -export const de_DeleteEventsConfigurationCommand = async ( +export const de_DescribeChannelModeratedByAppInstanceUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteEventsConfigurationCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Channel: (_) => de_ChannelModeratedByAppInstanceUserSummary(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteEventsConfigurationCommandError + * deserializeAws_restJson1DescribeChannelModeratorCommand */ -const de_DeleteEventsConfigurationCommandError = async ( +export const de_DescribeChannelModeratorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelModerator: (_) => de_ChannelModerator(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteMediaCapturePipelineCommand + * deserializeAws_restJson1DisassociatePhoneNumberFromUserCommand */ -export const de_DeleteMediaCapturePipelineCommand = async ( +export const de_DisassociatePhoneNumberFromUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteMediaCapturePipelineCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8211,58 +6503,56 @@ export const de_DeleteMediaCapturePipelineCommand = async ( }; /** - * deserializeAws_restJson1DeleteMediaCapturePipelineCommandError + * deserializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorCommand */ -const de_DeleteMediaCapturePipelineCommandError = async ( +export const de_DisassociatePhoneNumbersFromVoiceConnectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PhoneNumberErrors: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteMeetingCommand + * deserializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorGroupCommand */ -export const de_DeleteMeetingCommand = async ( +export const de_DisassociatePhoneNumbersFromVoiceConnectorGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteMeetingCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PhoneNumberErrors: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1DisassociateSigninDelegateGroupsFromAccountCommand + */ +export const de_DisassociateSigninDelegateGroupsFromAccountCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8272,6198 +6562,522 @@ export const de_DeleteMeetingCommand = async ( }; /** - * deserializeAws_restJson1DeleteMeetingCommandError + * deserializeAws_restJson1GetAccountCommand */ -const de_DeleteMeetingCommandError = async ( +export const de_GetAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Account: (_) => de_Account(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeletePhoneNumberCommand + * deserializeAws_restJson1GetAccountSettingsCommand */ -export const de_DeletePhoneNumberCommand = async ( +export const de_GetAccountSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeletePhoneNumberCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AccountSettings: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeletePhoneNumberCommandError + * deserializeAws_restJson1GetAppInstanceRetentionSettingsCommand */ -const de_DeletePhoneNumberCommandError = async ( +export const de_GetAppInstanceRetentionSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteProxySessionCommand - */ -export const de_DeleteProxySessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteProxySessionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteProxySessionCommandError - */ -const de_DeleteProxySessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRoomCommand - */ -export const de_DeleteRoomCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRoomCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRoomCommandError - */ -const de_DeleteRoomCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRoomMembershipCommand - */ -export const de_DeleteRoomMembershipCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRoomMembershipCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRoomMembershipCommandError - */ -const de_DeleteRoomMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSipMediaApplicationCommand - */ -export const de_DeleteSipMediaApplicationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSipMediaApplicationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSipMediaApplicationCommandError - */ -const de_DeleteSipMediaApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSipRuleCommand - */ -export const de_DeleteSipRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSipRuleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSipRuleCommandError - */ -const de_DeleteSipRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorCommand - */ -export const de_DeleteVoiceConnectorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorCommandError - */ -const de_DeleteVoiceConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorEmergencyCallingConfigurationCommand - */ -export const de_DeleteVoiceConnectorEmergencyCallingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorEmergencyCallingConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorEmergencyCallingConfigurationCommandError - */ -const de_DeleteVoiceConnectorEmergencyCallingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorGroupCommand - */ -export const de_DeleteVoiceConnectorGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorGroupCommandError - */ -const de_DeleteVoiceConnectorGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorOriginationCommand - */ -export const de_DeleteVoiceConnectorOriginationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorOriginationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorOriginationCommandError - */ -const de_DeleteVoiceConnectorOriginationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorProxyCommand - */ -export const de_DeleteVoiceConnectorProxyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorProxyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorProxyCommandError - */ -const de_DeleteVoiceConnectorProxyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorStreamingConfigurationCommand - */ -export const de_DeleteVoiceConnectorStreamingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorStreamingConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorStreamingConfigurationCommandError - */ -const de_DeleteVoiceConnectorStreamingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorTerminationCommand - */ -export const de_DeleteVoiceConnectorTerminationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorTerminationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorTerminationCommandError - */ -const de_DeleteVoiceConnectorTerminationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorTerminationCredentialsCommand - */ -export const de_DeleteVoiceConnectorTerminationCredentialsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVoiceConnectorTerminationCredentialsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVoiceConnectorTerminationCredentialsCommandError - */ -const de_DeleteVoiceConnectorTerminationCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceCommand - */ -export const de_DescribeAppInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppInstanceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AppInstance: (_) => de_AppInstance(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceCommandError - */ -const de_DescribeAppInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceAdminCommand - */ -export const de_DescribeAppInstanceAdminCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppInstanceAdminCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AppInstanceAdmin: (_) => de_AppInstanceAdmin(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceAdminCommandError - */ -const de_DescribeAppInstanceAdminCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceUserCommand - */ -export const de_DescribeAppInstanceUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppInstanceUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AppInstanceUser: (_) => de_AppInstanceUser(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAppInstanceUserCommandError - */ -const de_DescribeAppInstanceUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeChannelCommand - */ -export const de_DescribeChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Channel: (_) => de_Channel(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeChannelCommandError - */ -const de_DescribeChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeChannelBanCommand - */ -export const de_DescribeChannelBanCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelBanCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelBan: (_) => de_ChannelBan(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeChannelBanCommandError - */ -const de_DescribeChannelBanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeChannelMembershipCommand - */ -export const de_DescribeChannelMembershipCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelMembershipCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelMembership: (_) => de_ChannelMembership(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeChannelMembershipCommandError - */ -const de_DescribeChannelMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeChannelMembershipForAppInstanceUserCommand - */ -export const de_DescribeChannelMembershipForAppInstanceUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelMembershipForAppInstanceUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelMembership: (_) => de_ChannelMembershipForAppInstanceUserSummary(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeChannelMembershipForAppInstanceUserCommandError - */ -const de_DescribeChannelMembershipForAppInstanceUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeChannelModeratedByAppInstanceUserCommand - */ -export const de_DescribeChannelModeratedByAppInstanceUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelModeratedByAppInstanceUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Channel: (_) => de_ChannelModeratedByAppInstanceUserSummary(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeChannelModeratedByAppInstanceUserCommandError - */ -const de_DescribeChannelModeratedByAppInstanceUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeChannelModeratorCommand - */ -export const de_DescribeChannelModeratorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelModeratorCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelModerator: (_) => de_ChannelModerator(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeChannelModeratorCommandError - */ -const de_DescribeChannelModeratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociatePhoneNumberFromUserCommand - */ -export const de_DisassociatePhoneNumberFromUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociatePhoneNumberFromUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociatePhoneNumberFromUserCommandError - */ -const de_DisassociatePhoneNumberFromUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorCommand - */ -export const de_DisassociatePhoneNumbersFromVoiceConnectorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociatePhoneNumbersFromVoiceConnectorCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - PhoneNumberErrors: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorCommandError - */ -const de_DisassociatePhoneNumbersFromVoiceConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorGroupCommand - */ -export const de_DisassociatePhoneNumbersFromVoiceConnectorGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociatePhoneNumbersFromVoiceConnectorGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - PhoneNumberErrors: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociatePhoneNumbersFromVoiceConnectorGroupCommandError - */ -const de_DisassociatePhoneNumbersFromVoiceConnectorGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateSigninDelegateGroupsFromAccountCommand - */ -export const de_DisassociateSigninDelegateGroupsFromAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateSigninDelegateGroupsFromAccountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateSigninDelegateGroupsFromAccountCommandError - */ -const de_DisassociateSigninDelegateGroupsFromAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAccountCommand - */ -export const de_GetAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Account: (_) => de_Account(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAccountCommandError - */ -const de_GetAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAccountSettingsCommand - */ -export const de_GetAccountSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccountSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AccountSettings: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAccountSettingsCommandError - */ -const de_GetAccountSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAppInstanceRetentionSettingsCommand - */ -export const de_GetAppInstanceRetentionSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAppInstanceRetentionSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AppInstanceRetentionSettings: _json, - InitiateDeletionTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAppInstanceRetentionSettingsCommandError - */ -const de_GetAppInstanceRetentionSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAppInstanceStreamingConfigurationsCommand - */ -export const de_GetAppInstanceStreamingConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAppInstanceStreamingConfigurationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AppInstanceStreamingConfigurations: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAppInstanceStreamingConfigurationsCommandError - */ -const de_GetAppInstanceStreamingConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAttendeeCommand - */ -export const de_GetAttendeeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAttendeeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Attendee: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAttendeeCommandError - */ -const de_GetAttendeeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetBotCommand - */ -export const de_GetBotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBotCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Bot: (_) => de_Bot(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetBotCommandError - */ -const de_GetBotCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetChannelMessageCommand - */ -export const de_GetChannelMessageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChannelMessageCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelMessage: (_) => de_ChannelMessage(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetChannelMessageCommandError - */ -const de_GetChannelMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEventsConfigurationCommand - */ -export const de_GetEventsConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEventsConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - EventsConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEventsConfigurationCommandError - */ -const de_GetEventsConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetGlobalSettingsCommand - */ -export const de_GetGlobalSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGlobalSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BusinessCalling: _json, - VoiceConnector: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetGlobalSettingsCommandError - */ -const de_GetGlobalSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMediaCapturePipelineCommand - */ -export const de_GetMediaCapturePipelineCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMediaCapturePipelineCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - MediaCapturePipeline: (_) => de_MediaCapturePipeline(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMediaCapturePipelineCommandError - */ -const de_GetMediaCapturePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMeetingCommand - */ -export const de_GetMeetingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMeetingCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Meeting: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMeetingCommandError - */ -const de_GetMeetingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMessagingSessionEndpointCommand - */ -export const de_GetMessagingSessionEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMessagingSessionEndpointCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Endpoint: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMessagingSessionEndpointCommandError - */ -const de_GetMessagingSessionEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPhoneNumberCommand - */ -export const de_GetPhoneNumberCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPhoneNumberCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - PhoneNumber: (_) => de_PhoneNumber(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPhoneNumberCommandError - */ -const de_GetPhoneNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPhoneNumberOrderCommand - */ -export const de_GetPhoneNumberOrderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPhoneNumberOrderCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - PhoneNumberOrder: (_) => de_PhoneNumberOrder(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPhoneNumberOrderCommandError - */ -const de_GetPhoneNumberOrderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPhoneNumberSettingsCommand - */ -export const de_GetPhoneNumberSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPhoneNumberSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CallingName: __expectString, - CallingNameUpdatedTimestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPhoneNumberSettingsCommandError - */ -const de_GetPhoneNumberSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetProxySessionCommand - */ -export const de_GetProxySessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProxySessionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ProxySession: (_) => de_ProxySession(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetProxySessionCommandError - */ -const de_GetProxySessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRetentionSettingsCommand - */ -export const de_GetRetentionSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRetentionSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - InitiateDeletionTimestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - RetentionSettings: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRetentionSettingsCommandError - */ -const de_GetRetentionSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRoomCommand - */ -export const de_GetRoomCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRoomCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Room: (_) => de_Room(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRoomCommandError - */ -const de_GetRoomCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSipMediaApplicationCommand - */ -export const de_GetSipMediaApplicationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSipMediaApplicationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - SipMediaApplication: (_) => de_SipMediaApplication(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSipMediaApplicationCommandError - */ -const de_GetSipMediaApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSipMediaApplicationLoggingConfigurationCommand - */ -export const de_GetSipMediaApplicationLoggingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSipMediaApplicationLoggingConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - SipMediaApplicationLoggingConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSipMediaApplicationLoggingConfigurationCommandError - */ -const de_GetSipMediaApplicationLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSipRuleCommand - */ -export const de_GetSipRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSipRuleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - SipRule: (_) => de_SipRule(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSipRuleCommandError - */ -const de_GetSipRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetUserCommand - */ -export const de_GetUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - User: (_) => de_User(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetUserCommandError - */ -const de_GetUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetUserSettingsCommand - */ -export const de_GetUserSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUserSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - UserSettings: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetUserSettingsCommandError - */ -const de_GetUserSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorCommand - */ -export const de_GetVoiceConnectorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - VoiceConnector: (_) => de_VoiceConnector(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorCommandError - */ -const de_GetVoiceConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorEmergencyCallingConfigurationCommand - */ -export const de_GetVoiceConnectorEmergencyCallingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorEmergencyCallingConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - EmergencyCallingConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorEmergencyCallingConfigurationCommandError - */ -const de_GetVoiceConnectorEmergencyCallingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorGroupCommand - */ -export const de_GetVoiceConnectorGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - VoiceConnectorGroup: (_) => de_VoiceConnectorGroup(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorGroupCommandError - */ -const de_GetVoiceConnectorGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorLoggingConfigurationCommand - */ -export const de_GetVoiceConnectorLoggingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorLoggingConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LoggingConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorLoggingConfigurationCommandError - */ -const de_GetVoiceConnectorLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorOriginationCommand - */ -export const de_GetVoiceConnectorOriginationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorOriginationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Origination: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorOriginationCommandError - */ -const de_GetVoiceConnectorOriginationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorProxyCommand - */ -export const de_GetVoiceConnectorProxyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorProxyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Proxy: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorProxyCommandError - */ -const de_GetVoiceConnectorProxyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorStreamingConfigurationCommand - */ -export const de_GetVoiceConnectorStreamingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorStreamingConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - StreamingConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorStreamingConfigurationCommandError - */ -const de_GetVoiceConnectorStreamingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorTerminationCommand - */ -export const de_GetVoiceConnectorTerminationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorTerminationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Termination: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorTerminationCommandError - */ -const de_GetVoiceConnectorTerminationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorTerminationHealthCommand - */ -export const de_GetVoiceConnectorTerminationHealthCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceConnectorTerminationHealthCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - TerminationHealth: (_) => de_TerminationHealth(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVoiceConnectorTerminationHealthCommandError - */ -const de_GetVoiceConnectorTerminationHealthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1InviteUsersCommand - */ -export const de_InviteUsersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_InviteUsersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Invites: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1InviteUsersCommandError - */ -const de_InviteUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAccountsCommand - */ -export const de_ListAccountsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccountsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Accounts: (_) => de_AccountList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAccountsCommandError - */ -const de_ListAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAppInstanceAdminsCommand - */ -export const de_ListAppInstanceAdminsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppInstanceAdminsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AppInstanceAdmins: _json, - AppInstanceArn: __expectString, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAppInstanceAdminsCommandError - */ -const de_ListAppInstanceAdminsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAppInstancesCommand - */ -export const de_ListAppInstancesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppInstancesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AppInstances: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAppInstancesCommandError - */ -const de_ListAppInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAppInstanceUsersCommand - */ -export const de_ListAppInstanceUsersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppInstanceUsersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AppInstanceArn: __expectString, - AppInstanceUsers: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAppInstanceUsersCommandError - */ -const de_ListAppInstanceUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAttendeesCommand - */ -export const de_ListAttendeesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAttendeesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Attendees: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAttendeesCommandError - */ -const de_ListAttendeesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAttendeeTagsCommand - */ -export const de_ListAttendeeTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAttendeeTagsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAttendeeTagsCommandError - */ -const de_ListAttendeeTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListBotsCommand - */ -export const de_ListBotsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBotsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Bots: (_) => de_BotList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListBotsCommandError - */ -const de_ListBotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListChannelBansCommand - */ -export const de_ListChannelBansCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelBansCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelArn: __expectString, - ChannelBans: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListChannelBansCommandError - */ -const de_ListChannelBansCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListChannelMembershipsCommand - */ -export const de_ListChannelMembershipsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelMembershipsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelArn: __expectString, - ChannelMemberships: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListChannelMembershipsCommandError - */ -const de_ListChannelMembershipsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListChannelMembershipsForAppInstanceUserCommand - */ -export const de_ListChannelMembershipsForAppInstanceUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelMembershipsForAppInstanceUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelMemberships: (_) => de_ChannelMembershipForAppInstanceUserSummaryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListChannelMembershipsForAppInstanceUserCommandError - */ -const de_ListChannelMembershipsForAppInstanceUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListChannelMessagesCommand - */ -export const de_ListChannelMessagesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelMessagesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelArn: __expectString, - ChannelMessages: (_) => de_ChannelMessageSummaryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListChannelMessagesCommandError - */ -const de_ListChannelMessagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListChannelModeratorsCommand - */ -export const de_ListChannelModeratorsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelModeratorsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelArn: __expectString, - ChannelModerators: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListChannelModeratorsCommandError - */ -const de_ListChannelModeratorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListChannelsCommand - */ -export const de_ListChannelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Channels: (_) => de_ChannelSummaryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListChannelsCommandError - */ -const de_ListChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListChannelsModeratedByAppInstanceUserCommand - */ -export const de_ListChannelsModeratedByAppInstanceUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelsModeratedByAppInstanceUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Channels: (_) => de_ChannelModeratedByAppInstanceUserSummaryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListChannelsModeratedByAppInstanceUserCommandError - */ -const de_ListChannelsModeratedByAppInstanceUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListMediaCapturePipelinesCommand - */ -export const de_ListMediaCapturePipelinesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMediaCapturePipelinesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - MediaCapturePipelines: (_) => de_MediaCapturePipelineList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListMediaCapturePipelinesCommandError - */ -const de_ListMediaCapturePipelinesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListMeetingsCommand - */ -export const de_ListMeetingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMeetingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Meetings: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListMeetingsCommandError - */ -const de_ListMeetingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListMeetingTagsCommand - */ -export const de_ListMeetingTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMeetingTagsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListMeetingTagsCommandError - */ -const de_ListMeetingTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPhoneNumberOrdersCommand - */ -export const de_ListPhoneNumberOrdersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPhoneNumberOrdersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - PhoneNumberOrders: (_) => de_PhoneNumberOrderList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPhoneNumberOrdersCommandError - */ -const de_ListPhoneNumberOrdersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPhoneNumbersCommand - */ -export const de_ListPhoneNumbersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPhoneNumbersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - PhoneNumbers: (_) => de_PhoneNumberList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPhoneNumbersCommandError - */ -const de_ListPhoneNumbersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListProxySessionsCommand - */ -export const de_ListProxySessionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProxySessionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - ProxySessions: (_) => de_ProxySessions(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListProxySessionsCommandError - */ -const de_ListProxySessionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListRoomMembershipsCommand - */ -export const de_ListRoomMembershipsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRoomMembershipsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - RoomMemberships: (_) => de_RoomMembershipList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListRoomMembershipsCommandError - */ -const de_ListRoomMembershipsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListRoomsCommand - */ -export const de_ListRoomsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRoomsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Rooms: (_) => de_RoomList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListRoomsCommandError - */ -const de_ListRoomsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSipMediaApplicationsCommand - */ -export const de_ListSipMediaApplicationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSipMediaApplicationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - SipMediaApplications: (_) => de_SipMediaApplicationList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSipMediaApplicationsCommandError - */ -const de_ListSipMediaApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSipRulesCommand - */ -export const de_ListSipRulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSipRulesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - SipRules: (_) => de_SipRuleList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSipRulesCommandError - */ -const de_ListSipRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSupportedPhoneNumberCountriesCommand - */ -export const de_ListSupportedPhoneNumberCountriesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSupportedPhoneNumberCountriesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - PhoneNumberCountries: _json, + AppInstanceRetentionSettings: _json, + InitiateDeletionTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSupportedPhoneNumberCountriesCommandError - */ -const de_ListSupportedPhoneNumberCountriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1GetAppInstanceStreamingConfigurationsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_GetAppInstanceStreamingConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: _json, + AppInstanceStreamingConfigurations: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListUsersCommand + * deserializeAws_restJson1GetAttendeeCommand */ -export const de_ListUsersCommand = async ( +export const de_GetAttendeeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUsersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - Users: (_) => de_UserList(_, context), + Attendee: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListUsersCommandError - */ -const de_ListUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListVoiceConnectorGroupsCommand + * deserializeAws_restJson1GetBotCommand */ -export const de_ListVoiceConnectorGroupsCommand = async ( +export const de_GetBotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVoiceConnectorGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - VoiceConnectorGroups: (_) => de_VoiceConnectorGroupList(_, context), + Bot: (_) => de_Bot(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListVoiceConnectorGroupsCommandError - */ -const de_ListVoiceConnectorGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListVoiceConnectorsCommand + * deserializeAws_restJson1GetChannelMessageCommand */ -export const de_ListVoiceConnectorsCommand = async ( +export const de_GetChannelMessageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVoiceConnectorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - VoiceConnectors: (_) => de_VoiceConnectorList(_, context), + ChannelMessage: (_) => de_ChannelMessage(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListVoiceConnectorsCommandError + * deserializeAws_restJson1GetEventsConfigurationCommand */ -const de_ListVoiceConnectorsCommandError = async ( +export const de_GetEventsConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EventsConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListVoiceConnectorTerminationCredentialsCommand + * deserializeAws_restJson1GetGlobalSettingsCommand */ -export const de_ListVoiceConnectorTerminationCredentialsCommand = async ( +export const de_GetGlobalSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVoiceConnectorTerminationCredentialsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Usernames: _json, + BusinessCalling: _json, + VoiceConnector: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListVoiceConnectorTerminationCredentialsCommandError + * deserializeAws_restJson1GetMediaCapturePipelineCommand */ -const de_ListVoiceConnectorTerminationCredentialsCommandError = async ( +export const de_GetMediaCapturePipelineCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + MediaCapturePipeline: (_) => de_MediaCapturePipeline(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1LogoutUserCommand + * deserializeAws_restJson1GetMeetingCommand */ -export const de_LogoutUserCommand = async ( +export const de_GetMeetingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_LogoutUserCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Meeting: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1LogoutUserCommandError + * deserializeAws_restJson1GetMessagingSessionEndpointCommand */ -const de_LogoutUserCommandError = async ( +export const de_GetMessagingSessionEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Endpoint: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutAppInstanceRetentionSettingsCommand + * deserializeAws_restJson1GetPhoneNumberCommand */ -export const de_PutAppInstanceRetentionSettingsCommand = async ( +export const de_GetPhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAppInstanceRetentionSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AppInstanceRetentionSettings: _json, - InitiateDeletionTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + PhoneNumber: (_) => de_PhoneNumber(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutAppInstanceRetentionSettingsCommandError + * deserializeAws_restJson1GetPhoneNumberOrderCommand */ -const de_PutAppInstanceRetentionSettingsCommandError = async ( +export const de_GetPhoneNumberOrderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PhoneNumberOrder: (_) => de_PhoneNumberOrder(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutAppInstanceStreamingConfigurationsCommand + * deserializeAws_restJson1GetPhoneNumberSettingsCommand */ -export const de_PutAppInstanceStreamingConfigurationsCommand = async ( +export const de_GetPhoneNumberSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAppInstanceStreamingConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AppInstanceStreamingConfigurations: _json, + CallingName: __expectString, + CallingNameUpdatedTimestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutAppInstanceStreamingConfigurationsCommandError + * deserializeAws_restJson1GetProxySessionCommand */ -const de_PutAppInstanceStreamingConfigurationsCommandError = async ( +export const de_GetProxySessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ProxySession: (_) => de_ProxySession(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetRetentionSettingsCommand + */ +export const de_GetRetentionSettingsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + InitiateDeletionTimestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + RetentionSettings: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetRoomCommand + */ +export const de_GetRoomCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Room: (_) => de_Room(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutEventsConfigurationCommand + * deserializeAws_restJson1GetSipMediaApplicationCommand */ -export const de_PutEventsConfigurationCommand = async ( +export const de_GetSipMediaApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_PutEventsConfigurationCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - EventsConfiguration: _json, + SipMediaApplication: (_) => de_SipMediaApplication(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutEventsConfigurationCommandError + * deserializeAws_restJson1GetSipMediaApplicationLoggingConfigurationCommand */ -const de_PutEventsConfigurationCommandError = async ( +export const de_GetSipMediaApplicationLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SipMediaApplicationLoggingConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutRetentionSettingsCommand + * deserializeAws_restJson1GetSipRuleCommand */ -export const de_PutRetentionSettingsCommand = async ( +export const de_GetSipRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_PutRetentionSettingsCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - InitiateDeletionTimestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - RetentionSettings: _json, + SipRule: (_) => de_SipRule(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutRetentionSettingsCommandError + * deserializeAws_restJson1GetUserCommand */ -const de_PutRetentionSettingsCommandError = async ( +export const de_GetUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + User: (_) => de_User(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutSipMediaApplicationLoggingConfigurationCommand + * deserializeAws_restJson1GetUserSettingsCommand */ -export const de_PutSipMediaApplicationLoggingConfigurationCommand = async ( +export const de_GetUserSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutSipMediaApplicationLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SipMediaApplicationLoggingConfiguration: _json, + UserSettings: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutSipMediaApplicationLoggingConfigurationCommandError + * deserializeAws_restJson1GetVoiceConnectorCommand */ -const de_PutSipMediaApplicationLoggingConfigurationCommandError = async ( +export const de_GetVoiceConnectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + VoiceConnector: (_) => de_VoiceConnector(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutVoiceConnectorEmergencyCallingConfigurationCommand + * deserializeAws_restJson1GetVoiceConnectorEmergencyCallingConfigurationCommand */ -export const de_PutVoiceConnectorEmergencyCallingConfigurationCommand = async ( +export const de_GetVoiceConnectorEmergencyCallingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutVoiceConnectorEmergencyCallingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -14477,58 +7091,35 @@ export const de_PutVoiceConnectorEmergencyCallingConfigurationCommand = async ( }; /** - * deserializeAws_restJson1PutVoiceConnectorEmergencyCallingConfigurationCommandError + * deserializeAws_restJson1GetVoiceConnectorGroupCommand */ -const de_PutVoiceConnectorEmergencyCallingConfigurationCommandError = async ( +export const de_GetVoiceConnectorGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + VoiceConnectorGroup: (_) => de_VoiceConnectorGroup(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutVoiceConnectorLoggingConfigurationCommand + * deserializeAws_restJson1GetVoiceConnectorLoggingConfigurationCommand */ -export const de_PutVoiceConnectorLoggingConfigurationCommand = async ( +export const de_GetVoiceConnectorLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutVoiceConnectorLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -14542,58 +7133,14 @@ export const de_PutVoiceConnectorLoggingConfigurationCommand = async ( }; /** - * deserializeAws_restJson1PutVoiceConnectorLoggingConfigurationCommandError - */ -const de_PutVoiceConnectorLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorOriginationCommand + * deserializeAws_restJson1GetVoiceConnectorOriginationCommand */ -export const de_PutVoiceConnectorOriginationCommand = async ( +export const de_GetVoiceConnectorOriginationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutVoiceConnectorOriginationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -14607,58 +7154,14 @@ export const de_PutVoiceConnectorOriginationCommand = async ( }; /** - * deserializeAws_restJson1PutVoiceConnectorOriginationCommandError - */ -const de_PutVoiceConnectorOriginationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutVoiceConnectorProxyCommand + * deserializeAws_restJson1GetVoiceConnectorProxyCommand */ -export const de_PutVoiceConnectorProxyCommand = async ( +export const de_GetVoiceConnectorProxyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutVoiceConnectorProxyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -14672,1591 +7175,1167 @@ export const de_PutVoiceConnectorProxyCommand = async ( }; /** - * deserializeAws_restJson1PutVoiceConnectorProxyCommandError + * deserializeAws_restJson1GetVoiceConnectorStreamingConfigurationCommand */ -const de_PutVoiceConnectorProxyCommandError = async ( +export const de_GetVoiceConnectorStreamingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + StreamingConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutVoiceConnectorStreamingConfigurationCommand + * deserializeAws_restJson1GetVoiceConnectorTerminationCommand */ -export const de_PutVoiceConnectorStreamingConfigurationCommand = async ( +export const de_GetVoiceConnectorTerminationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutVoiceConnectorStreamingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - StreamingConfiguration: _json, + Termination: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutVoiceConnectorStreamingConfigurationCommandError + * deserializeAws_restJson1GetVoiceConnectorTerminationHealthCommand */ -const de_PutVoiceConnectorStreamingConfigurationCommandError = async ( +export const de_GetVoiceConnectorTerminationHealthCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + TerminationHealth: (_) => de_TerminationHealth(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutVoiceConnectorTerminationCommand + * deserializeAws_restJson1InviteUsersCommand */ -export const de_PutVoiceConnectorTerminationCommand = async ( +export const de_InviteUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutVoiceConnectorTerminationCommandError(output, context); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Termination: _json, + Invites: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutVoiceConnectorTerminationCommandError + * deserializeAws_restJson1ListAccountsCommand */ -const de_PutVoiceConnectorTerminationCommandError = async ( +export const de_ListAccountsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Accounts: (_) => de_AccountList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutVoiceConnectorTerminationCredentialsCommand + * deserializeAws_restJson1ListAppInstanceAdminsCommand */ -export const de_PutVoiceConnectorTerminationCredentialsCommand = async ( +export const de_ListAppInstanceAdminsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_PutVoiceConnectorTerminationCredentialsCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AppInstanceAdmins: _json, + AppInstanceArn: __expectString, + NextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutVoiceConnectorTerminationCredentialsCommandError + * deserializeAws_restJson1ListAppInstancesCommand */ -const de_PutVoiceConnectorTerminationCredentialsCommandError = async ( +export const de_ListAppInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AppInstances: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RedactChannelMessageCommand + * deserializeAws_restJson1ListAppInstanceUsersCommand */ -export const de_RedactChannelMessageCommand = async ( +export const de_ListAppInstanceUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RedactChannelMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ChannelArn: __expectString, - MessageId: __expectString, + AppInstanceArn: __expectString, + AppInstanceUsers: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RedactChannelMessageCommandError + * deserializeAws_restJson1ListAttendeesCommand */ -const de_RedactChannelMessageCommandError = async ( +export const de_ListAttendeesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Attendees: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RedactConversationMessageCommand + * deserializeAws_restJson1ListAttendeeTagsCommand */ -export const de_RedactConversationMessageCommand = async ( +export const de_ListAttendeeTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RedactConversationMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Tags: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RedactConversationMessageCommandError + * deserializeAws_restJson1ListBotsCommand */ -const de_RedactConversationMessageCommandError = async ( +export const de_ListBotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Bots: (_) => de_BotList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RedactRoomMessageCommand + * deserializeAws_restJson1ListChannelBansCommand */ -export const de_RedactRoomMessageCommand = async ( +export const de_ListChannelBansCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RedactRoomMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelArn: __expectString, + ChannelBans: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RedactRoomMessageCommandError + * deserializeAws_restJson1ListChannelMembershipsCommand */ -const de_RedactRoomMessageCommandError = async ( +export const de_ListChannelMembershipsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelArn: __expectString, + ChannelMemberships: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListChannelMembershipsForAppInstanceUserCommand + */ +export const de_ListChannelMembershipsForAppInstanceUserCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelMemberships: (_) => de_ChannelMembershipForAppInstanceUserSummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RegenerateSecurityTokenCommand + * deserializeAws_restJson1ListChannelMessagesCommand */ -export const de_RegenerateSecurityTokenCommand = async ( +export const de_ListChannelMessagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegenerateSecurityTokenCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Bot: (_) => de_Bot(_, context), + ChannelArn: __expectString, + ChannelMessages: (_) => de_ChannelMessageSummaryList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RegenerateSecurityTokenCommandError + * deserializeAws_restJson1ListChannelModeratorsCommand */ -const de_RegenerateSecurityTokenCommandError = async ( +export const de_ListChannelModeratorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelArn: __expectString, + ChannelModerators: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ResetPersonalPINCommand + * deserializeAws_restJson1ListChannelsCommand */ -export const de_ResetPersonalPINCommand = async ( +export const de_ListChannelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ResetPersonalPINCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - User: (_) => de_User(_, context), + Channels: (_) => de_ChannelSummaryList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ResetPersonalPINCommandError + * deserializeAws_restJson1ListChannelsModeratedByAppInstanceUserCommand */ -const de_ResetPersonalPINCommandError = async ( +export const de_ListChannelsModeratedByAppInstanceUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Channels: (_) => de_ChannelModeratedByAppInstanceUserSummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListMediaCapturePipelinesCommand + */ +export const de_ListMediaCapturePipelinesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + MediaCapturePipelines: (_) => de_MediaCapturePipelineList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RestorePhoneNumberCommand + * deserializeAws_restJson1ListMeetingsCommand */ -export const de_RestorePhoneNumberCommand = async ( +export const de_ListMeetingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RestorePhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - PhoneNumber: (_) => de_PhoneNumber(_, context), + Meetings: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RestorePhoneNumberCommandError + * deserializeAws_restJson1ListMeetingTagsCommand */ -const de_RestorePhoneNumberCommandError = async ( +export const de_ListMeetingTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SearchAvailablePhoneNumbersCommand + * deserializeAws_restJson1ListPhoneNumberOrdersCommand */ -export const de_SearchAvailablePhoneNumbersCommand = async ( +export const de_ListPhoneNumberOrdersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchAvailablePhoneNumbersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - E164PhoneNumbers: _json, NextToken: __expectString, + PhoneNumberOrders: (_) => de_PhoneNumberOrderList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SearchAvailablePhoneNumbersCommandError + * deserializeAws_restJson1ListPhoneNumbersCommand */ -const de_SearchAvailablePhoneNumbersCommandError = async ( +export const de_ListPhoneNumbersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.chime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + PhoneNumbers: (_) => de_PhoneNumberList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SendChannelMessageCommand + * deserializeAws_restJson1ListProxySessionsCommand */ -export const de_SendChannelMessageCommand = async ( +export const de_ListProxySessionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_SendChannelMessageCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ChannelArn: __expectString, - MessageId: __expectString, + NextToken: __expectString, + ProxySessions: (_) => de_ProxySessions(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SendChannelMessageCommandError + * deserializeAws_restJson1ListRoomMembershipsCommand */ -const de_SendChannelMessageCommandError = async ( +export const de_ListRoomMembershipsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + RoomMemberships: (_) => de_RoomMembershipList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartMeetingTranscriptionCommand + * deserializeAws_restJson1ListRoomsCommand */ -export const de_StartMeetingTranscriptionCommand = async ( +export const de_ListRoomsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartMeetingTranscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Rooms: (_) => de_RoomList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartMeetingTranscriptionCommandError + * deserializeAws_restJson1ListSipMediaApplicationsCommand */ -const de_StartMeetingTranscriptionCommandError = async ( +export const de_ListSipMediaApplicationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.chime#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + SipMediaApplications: (_) => de_SipMediaApplicationList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StopMeetingTranscriptionCommand + * deserializeAws_restJson1ListSipRulesCommand */ -export const de_StopMeetingTranscriptionCommand = async ( +export const de_ListSipRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopMeetingTranscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + SipRules: (_) => de_SipRuleList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StopMeetingTranscriptionCommandError + * deserializeAws_restJson1ListSupportedPhoneNumberCountriesCommand */ -const de_StopMeetingTranscriptionCommandError = async ( +export const de_ListSupportedPhoneNumberCountriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.chime#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PhoneNumberCountries: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagAttendeeCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_TagAttendeeCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagAttendeeCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Tags: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagAttendeeCommandError + * deserializeAws_restJson1ListUsersCommand */ -const de_TagAttendeeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_ListUsersCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Users: (_) => de_UserList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagMeetingCommand + * deserializeAws_restJson1ListVoiceConnectorGroupsCommand */ -export const de_TagMeetingCommand = async ( +export const de_ListVoiceConnectorGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagMeetingCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + VoiceConnectorGroups: (_) => de_VoiceConnectorGroupList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagMeetingCommandError + * deserializeAws_restJson1ListVoiceConnectorsCommand */ -const de_TagMeetingCommandError = async ( +export const de_ListVoiceConnectorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + VoiceConnectors: (_) => de_VoiceConnectorList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListVoiceConnectorTerminationCredentialsCommand */ -export const de_TagResourceCommand = async ( +export const de_ListVoiceConnectorTerminationCredentialsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Usernames: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1LogoutUserCommand */ -const de_TagResourceCommandError = async ( +export const de_LogoutUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UntagAttendeeCommand + * deserializeAws_restJson1PutAppInstanceRetentionSettingsCommand */ -export const de_UntagAttendeeCommand = async ( +export const de_PutAppInstanceRetentionSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagAttendeeCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AppInstanceRetentionSettings: _json, + InitiateDeletionTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagAttendeeCommandError + * deserializeAws_restJson1PutAppInstanceStreamingConfigurationsCommand */ -const de_UntagAttendeeCommandError = async ( +export const de_PutAppInstanceStreamingConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AppInstanceStreamingConfigurations: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagMeetingCommand + * deserializeAws_restJson1PutEventsConfigurationCommand */ -export const de_UntagMeetingCommand = async ( +export const de_PutEventsConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagMeetingCommandError(output, context); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EventsConfiguration: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagMeetingCommandError + * deserializeAws_restJson1PutRetentionSettingsCommand */ -const de_UntagMeetingCommandError = async ( +export const de_PutRetentionSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + InitiateDeletionTimestamp: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + RetentionSettings: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1PutSipMediaApplicationLoggingConfigurationCommand */ -export const de_UntagResourceCommand = async ( +export const de_PutSipMediaApplicationLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SipMediaApplicationLoggingConfiguration: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1PutVoiceConnectorEmergencyCallingConfigurationCommand */ -const de_UntagResourceCommandError = async ( +export const de_PutVoiceConnectorEmergencyCallingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EmergencyCallingConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateAccountCommand + * deserializeAws_restJson1PutVoiceConnectorLoggingConfigurationCommand */ -export const de_UpdateAccountCommand = async ( +export const de_PutVoiceConnectorLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Account: (_) => de_Account(_, context), + LoggingConfiguration: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateAccountCommandError + * deserializeAws_restJson1PutVoiceConnectorOriginationCommand */ -const de_UpdateAccountCommandError = async ( +export const de_PutVoiceConnectorOriginationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Origination: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateAccountSettingsCommand + * deserializeAws_restJson1PutVoiceConnectorProxyCommand */ -export const de_UpdateAccountSettingsCommand = async ( +export const de_PutVoiceConnectorProxyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateAccountSettingsCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Proxy: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateAccountSettingsCommandError + * deserializeAws_restJson1PutVoiceConnectorStreamingConfigurationCommand */ -const de_UpdateAccountSettingsCommandError = async ( +export const de_PutVoiceConnectorStreamingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + StreamingConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateAppInstanceCommand + * deserializeAws_restJson1PutVoiceConnectorTerminationCommand */ -export const de_UpdateAppInstanceCommand = async ( +export const de_PutVoiceConnectorTerminationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAppInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AppInstanceArn: __expectString, + Termination: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateAppInstanceCommandError + * deserializeAws_restJson1PutVoiceConnectorTerminationCredentialsCommand */ -const de_UpdateAppInstanceCommandError = async ( +export const de_PutVoiceConnectorTerminationCredentialsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1RedactChannelMessageCommand + */ +export const de_RedactChannelMessageCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelArn: __expectString, + MessageId: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1RedactConversationMessageCommand + */ +export const de_RedactConversationMessageCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateAppInstanceUserCommand + * deserializeAws_restJson1RedactRoomMessageCommand */ -export const de_UpdateAppInstanceUserCommand = async ( +export const de_RedactRoomMessageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1RegenerateSecurityTokenCommand + */ +export const de_RegenerateSecurityTokenCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAppInstanceUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AppInstanceUserArn: __expectString, + Bot: (_) => de_Bot(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateAppInstanceUserCommandError + * deserializeAws_restJson1ResetPersonalPINCommand */ -const de_UpdateAppInstanceUserCommandError = async ( +export const de_ResetPersonalPINCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + User: (_) => de_User(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateBotCommand + * deserializeAws_restJson1RestorePhoneNumberCommand */ -export const de_UpdateBotCommand = async ( +export const de_RestorePhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Bot: (_) => de_Bot(_, context), + PhoneNumber: (_) => de_PhoneNumber(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateBotCommandError + * deserializeAws_restJson1SearchAvailablePhoneNumbersCommand */ -const de_UpdateBotCommandError = async ( +export const de_SearchAvailablePhoneNumbersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + E164PhoneNumbers: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateChannelCommand + * deserializeAws_restJson1SendChannelMessageCommand */ -export const de_UpdateChannelCommand = async ( +export const de_SendChannelMessageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChannelCommandError(output, context); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -16264,195 +8343,123 @@ export const de_UpdateChannelCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { ChannelArn: __expectString, + MessageId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateChannelCommandError + * deserializeAws_restJson1StartMeetingTranscriptionCommand */ -const de_UpdateChannelCommandError = async ( +export const de_StartMeetingTranscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateChannelMessageCommand + * deserializeAws_restJson1StopMeetingTranscriptionCommand */ -export const de_UpdateChannelMessageCommand = async ( +export const de_StopMeetingTranscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChannelMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelArn: __expectString, - MessageId: __expectString, + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1TagAttendeeCommand + */ +export const de_TagAttendeeCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1UpdateChannelMessageCommandError + * deserializeAws_restJson1TagMeetingCommand */ -const de_UpdateChannelMessageCommandError = async ( +export const de_TagMeetingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateChannelReadMarkerCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UpdateChannelReadMarkerCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChannelReadMarkerCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelArn: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1UpdateChannelReadMarkerCommandError + * deserializeAws_restJson1UntagAttendeeCommand */ -const de_UpdateChannelReadMarkerCommandError = async ( +export const de_UntagAttendeeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateGlobalSettingsCommand + * deserializeAws_restJson1UntagMeetingCommand */ -export const de_UpdateGlobalSettingsCommand = async ( +export const de_UntagMeetingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateGlobalSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -16462,123 +8469,52 @@ export const de_UpdateGlobalSettingsCommand = async ( }; /** - * deserializeAws_restJson1UpdateGlobalSettingsCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UpdateGlobalSettingsCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdatePhoneNumberCommand + * deserializeAws_restJson1UpdateAccountCommand */ -export const de_UpdatePhoneNumberCommand = async ( +export const de_UpdateAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - PhoneNumber: (_) => de_PhoneNumber(_, context), + Account: (_) => de_Account(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdatePhoneNumberCommandError - */ -const de_UpdatePhoneNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdatePhoneNumberSettingsCommand + * deserializeAws_restJson1UpdateAccountSettingsCommand */ -export const de_UpdatePhoneNumberSettingsCommand = async ( +export const de_UpdateAccountSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdatePhoneNumberSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -16588,446 +8524,311 @@ export const de_UpdatePhoneNumberSettingsCommand = async ( }; /** - * deserializeAws_restJson1UpdatePhoneNumberSettingsCommandError + * deserializeAws_restJson1UpdateAppInstanceCommand */ -const de_UpdatePhoneNumberSettingsCommandError = async ( +export const de_UpdateAppInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AppInstanceArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateProxySessionCommand + * deserializeAws_restJson1UpdateAppInstanceUserCommand */ -export const de_UpdateProxySessionCommand = async ( +export const de_UpdateAppInstanceUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_UpdateProxySessionCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ProxySession: (_) => de_ProxySession(_, context), + AppInstanceUserArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateProxySessionCommandError + * deserializeAws_restJson1UpdateBotCommand */ -const de_UpdateProxySessionCommandError = async ( +export const de_UpdateBotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Bot: (_) => de_Bot(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateRoomCommand + * deserializeAws_restJson1UpdateChannelCommand */ -export const de_UpdateRoomCommand = async ( +export const de_UpdateChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRoomCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Room: (_) => de_Room(_, context), + ChannelArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateRoomCommandError + * deserializeAws_restJson1UpdateChannelMessageCommand */ -const de_UpdateRoomCommandError = async ( +export const de_UpdateChannelMessageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelArn: __expectString, + MessageId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateRoomMembershipCommand + * deserializeAws_restJson1UpdateChannelReadMarkerCommand */ -export const de_UpdateRoomMembershipCommand = async ( +export const de_UpdateChannelReadMarkerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRoomMembershipCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - RoomMembership: (_) => de_RoomMembership(_, context), + ChannelArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateRoomMembershipCommandError + * deserializeAws_restJson1UpdateGlobalSettingsCommand */ -const de_UpdateRoomMembershipCommandError = async ( +export const de_UpdateGlobalSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateSipMediaApplicationCommand + * deserializeAws_restJson1UpdatePhoneNumberCommand */ -export const de_UpdateSipMediaApplicationCommand = async ( +export const de_UpdatePhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSipMediaApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SipMediaApplication: (_) => de_SipMediaApplication(_, context), + PhoneNumber: (_) => de_PhoneNumber(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateSipMediaApplicationCommandError + * deserializeAws_restJson1UpdatePhoneNumberSettingsCommand */ -const de_UpdateSipMediaApplicationCommandError = async ( +export const de_UpdatePhoneNumberSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateSipMediaApplicationCallCommand + * deserializeAws_restJson1UpdateProxySessionCommand */ -export const de_UpdateSipMediaApplicationCallCommand = async ( +export const de_UpdateProxySessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateSipMediaApplicationCallCommandError(output, context); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SipMediaApplicationCall: _json, + ProxySession: (_) => de_ProxySession(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateSipMediaApplicationCallCommandError + * deserializeAws_restJson1UpdateRoomCommand */ -const de_UpdateSipMediaApplicationCallCommandError = async ( +export const de_UpdateRoomCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Room: (_) => de_Room(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateRoomMembershipCommand + */ +export const de_UpdateRoomMembershipCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RoomMembership: (_) => de_RoomMembership(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateSipMediaApplicationCommand + */ +export const de_UpdateSipMediaApplicationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SipMediaApplication: (_) => de_SipMediaApplication(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateSipRuleCommand + * deserializeAws_restJson1UpdateSipMediaApplicationCallCommand */ -export const de_UpdateSipRuleCommand = async ( +export const de_UpdateSipMediaApplicationCallCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateSipRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SipRule: (_) => de_SipRule(_, context), + SipMediaApplicationCall: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateSipRuleCommandError + * deserializeAws_restJson1UpdateSipRuleCommand */ -const de_UpdateSipRuleCommandError = async ( +export const de_UpdateSipRuleCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.chime#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SipRule: (_) => de_SipRule(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -17038,7 +8839,7 @@ export const de_UpdateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -17051,50 +8852,6 @@ export const de_UpdateUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateUserCommandError - */ -const de_UpdateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateUserSettingsCommand */ @@ -17103,7 +8860,7 @@ export const de_UpdateUserSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateUserSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -17112,50 +8869,6 @@ export const de_UpdateUserSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateUserSettingsCommandError - */ -const de_UpdateUserSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVoiceConnectorCommand */ @@ -17164,7 +8877,7 @@ export const de_UpdateVoiceConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVoiceConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -17177,50 +8890,6 @@ export const de_UpdateVoiceConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateVoiceConnectorCommandError - */ -const de_UpdateVoiceConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVoiceConnectorGroupCommand */ @@ -17229,7 +8898,7 @@ export const de_UpdateVoiceConnectorGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateVoiceConnectorGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -17242,53 +8911,6 @@ export const de_UpdateVoiceConnectorGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateVoiceConnectorGroupCommandError - */ -const de_UpdateVoiceConnectorGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.chime#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.chime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.chime#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.chime#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.chime#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.chime#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottledClientException": - case "com.amazonaws.chime#ThrottledClientException": - throw await de_ThrottledClientExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.chime#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ValidateE911AddressCommand */ @@ -17297,7 +8919,7 @@ export const de_ValidateE911AddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_ValidateE911AddressCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -17314,18 +8936,18 @@ export const de_ValidateE911AddressCommand = async ( }; /** - * deserializeAws_restJson1ValidateE911AddressCommandError + * deserialize_Aws_restJson1CommandError */ -const de_ValidateE911AddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.chime#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); case "BadRequestException": case "com.amazonaws.chime#BadRequestException": throw await de_BadRequestExceptionRes(parsedOutput, context); @@ -17347,13 +8969,22 @@ const de_ValidateE911AddressCommandError = async ( case "UnauthorizedClientException": case "com.amazonaws.chime#UnauthorizedClientException": throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); + case "ResourceLimitExceededException": + case "com.amazonaws.chime#ResourceLimitExceededException": + throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.chime#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "UnprocessableEntityException": + case "com.amazonaws.chime#UnprocessableEntityException": + throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts b/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts index d38ec0231fc8..975b2fa3ddf3 100644 --- a/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts +++ b/clients/client-cleanrooms/src/protocols/Aws_restJson1.ts @@ -1649,7 +1649,7 @@ export const de_BatchGetCollaborationAnalysisTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetCollaborationAnalysisTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1663,44 +1663,6 @@ export const de_BatchGetCollaborationAnalysisTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetCollaborationAnalysisTemplateCommandError - */ -const de_BatchGetCollaborationAnalysisTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetSchemaCommand */ @@ -1709,7 +1671,7 @@ export const de_BatchGetSchemaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetSchemaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1723,44 +1685,6 @@ export const de_BatchGetSchemaCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetSchemaCommandError - */ -const de_BatchGetSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAnalysisTemplateCommand */ @@ -1769,7 +1693,7 @@ export const de_CreateAnalysisTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAnalysisTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1782,50 +1706,6 @@ export const de_CreateAnalysisTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAnalysisTemplateCommandError - */ -const de_CreateAnalysisTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cleanrooms#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCollaborationCommand */ @@ -1834,7 +1714,7 @@ export const de_CreateCollaborationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCollaborationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1847,44 +1727,6 @@ export const de_CreateCollaborationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCollaborationCommandError - */ -const de_CreateCollaborationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cleanrooms#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConfiguredAudienceModelAssociationCommand */ @@ -1893,7 +1735,7 @@ export const de_CreateConfiguredAudienceModelAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConfiguredAudienceModelAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1906,50 +1748,6 @@ export const de_CreateConfiguredAudienceModelAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConfiguredAudienceModelAssociationCommandError - */ -const de_CreateConfiguredAudienceModelAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cleanrooms#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConfiguredTableCommand */ @@ -1958,7 +1756,7 @@ export const de_CreateConfiguredTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConfiguredTableCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1972,185 +1770,56 @@ export const de_CreateConfiguredTableCommand = async ( }; /** - * deserializeAws_restJson1CreateConfiguredTableCommandError + * deserializeAws_restJson1CreateConfiguredTableAnalysisRuleCommand */ -const de_CreateConfiguredTableCommandError = async ( +export const de_CreateConfiguredTableAnalysisRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cleanrooms#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + analysisRule: (_) => de_ConfiguredTableAnalysisRule(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateConfiguredTableAnalysisRuleCommand + * deserializeAws_restJson1CreateConfiguredTableAssociationCommand */ -export const de_CreateConfiguredTableAnalysisRuleCommand = async ( +export const de_CreateConfiguredTableAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConfiguredTableAnalysisRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - analysisRule: (_) => de_ConfiguredTableAnalysisRule(_, context), + configuredTableAssociation: (_) => de_ConfiguredTableAssociation(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateConfiguredTableAnalysisRuleCommandError + * deserializeAws_restJson1CreateMembershipCommand */ -const de_CreateConfiguredTableAnalysisRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateConfiguredTableAssociationCommand - */ -export const de_CreateConfiguredTableAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConfiguredTableAssociationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - configuredTableAssociation: (_) => de_ConfiguredTableAssociation(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateConfiguredTableAssociationCommandError - */ -const de_CreateConfiguredTableAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cleanrooms#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateMembershipCommand - */ -export const de_CreateMembershipCommand = async ( +export const de_CreateMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMembershipCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2163,50 +1832,6 @@ export const de_CreateMembershipCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMembershipCommandError - */ -const de_CreateMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cleanrooms#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePrivacyBudgetTemplateCommand */ @@ -2215,7 +1840,7 @@ export const de_CreatePrivacyBudgetTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePrivacyBudgetTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2228,47 +1853,6 @@ export const de_CreatePrivacyBudgetTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePrivacyBudgetTemplateCommandError - */ -const de_CreatePrivacyBudgetTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAnalysisTemplateCommand */ @@ -2277,7 +1861,7 @@ export const de_DeleteAnalysisTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAnalysisTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2287,52 +1871,31 @@ export const de_DeleteAnalysisTemplateCommand = async ( }; /** - * deserializeAws_restJson1DeleteAnalysisTemplateCommandError + * deserializeAws_restJson1DeleteCollaborationCommand */ -const de_DeleteAnalysisTemplateCommandError = async ( +export const de_DeleteCollaborationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteCollaborationCommand + * deserializeAws_restJson1DeleteConfiguredAudienceModelAssociationCommand */ -export const de_DeleteCollaborationCommand = async ( +export const de_DeleteConfiguredAudienceModelAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteCollaborationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2342,49 +1905,31 @@ export const de_DeleteCollaborationCommand = async ( }; /** - * deserializeAws_restJson1DeleteCollaborationCommandError + * deserializeAws_restJson1DeleteConfiguredTableCommand */ -const de_DeleteCollaborationCommandError = async ( +export const de_DeleteConfiguredTableCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteConfiguredAudienceModelAssociationCommand + * deserializeAws_restJson1DeleteConfiguredTableAnalysisRuleCommand */ -export const de_DeleteConfiguredAudienceModelAssociationCommand = async ( +export const de_DeleteConfiguredTableAnalysisRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteConfiguredAudienceModelAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2394,168 +1939,14 @@ export const de_DeleteConfiguredAudienceModelAssociationCommand = async ( }; /** - * deserializeAws_restJson1DeleteConfiguredAudienceModelAssociationCommandError + * deserializeAws_restJson1DeleteConfiguredTableAssociationCommand */ -const de_DeleteConfiguredAudienceModelAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteConfiguredTableCommand - */ -export const de_DeleteConfiguredTableCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteConfiguredTableCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteConfiguredTableCommandError - */ -const de_DeleteConfiguredTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteConfiguredTableAnalysisRuleCommand - */ -export const de_DeleteConfiguredTableAnalysisRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteConfiguredTableAnalysisRuleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteConfiguredTableAnalysisRuleCommandError - */ -const de_DeleteConfiguredTableAnalysisRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteConfiguredTableAssociationCommand - */ -export const de_DeleteConfiguredTableAssociationCommand = async ( +export const de_DeleteConfiguredTableAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteConfiguredTableAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2564,1536 +1955,368 @@ export const de_DeleteConfiguredTableAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteConfiguredTableAssociationCommandError - */ -const de_DeleteConfiguredTableAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteMemberCommand */ -export const de_DeleteMemberCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteMemberCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteMemberCommandError - */ -const de_DeleteMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteMembershipCommand - */ -export const de_DeleteMembershipCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteMembershipCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteMembershipCommandError - */ -const de_DeleteMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePrivacyBudgetTemplateCommand - */ -export const de_DeletePrivacyBudgetTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeletePrivacyBudgetTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeletePrivacyBudgetTemplateCommandError - */ -const de_DeletePrivacyBudgetTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAnalysisTemplateCommand - */ -export const de_GetAnalysisTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAnalysisTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - analysisTemplate: (_) => de_AnalysisTemplate(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAnalysisTemplateCommandError - */ -const de_GetAnalysisTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCollaborationCommand - */ -export const de_GetCollaborationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCollaborationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - collaboration: (_) => de_Collaboration(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetCollaborationCommandError - */ -const de_GetCollaborationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCollaborationAnalysisTemplateCommand - */ -export const de_GetCollaborationAnalysisTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCollaborationAnalysisTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - collaborationAnalysisTemplate: (_) => de_CollaborationAnalysisTemplate(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetCollaborationAnalysisTemplateCommandError - */ -const de_GetCollaborationAnalysisTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCollaborationConfiguredAudienceModelAssociationCommand - */ -export const de_GetCollaborationConfiguredAudienceModelAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCollaborationConfiguredAudienceModelAssociationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - collaborationConfiguredAudienceModelAssociation: (_) => - de_CollaborationConfiguredAudienceModelAssociation(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetCollaborationConfiguredAudienceModelAssociationCommandError - */ -const de_GetCollaborationConfiguredAudienceModelAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCollaborationPrivacyBudgetTemplateCommand - */ -export const de_GetCollaborationPrivacyBudgetTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCollaborationPrivacyBudgetTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - collaborationPrivacyBudgetTemplate: (_) => de_CollaborationPrivacyBudgetTemplate(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetCollaborationPrivacyBudgetTemplateCommandError - */ -const de_GetCollaborationPrivacyBudgetTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetConfiguredAudienceModelAssociationCommand - */ -export const de_GetConfiguredAudienceModelAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfiguredAudienceModelAssociationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - configuredAudienceModelAssociation: (_) => de_ConfiguredAudienceModelAssociation(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetConfiguredAudienceModelAssociationCommandError - */ -const de_GetConfiguredAudienceModelAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetConfiguredTableCommand - */ -export const de_GetConfiguredTableCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfiguredTableCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - configuredTable: (_) => de_ConfiguredTable(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetConfiguredTableCommandError - */ -const de_GetConfiguredTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetConfiguredTableAnalysisRuleCommand - */ -export const de_GetConfiguredTableAnalysisRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfiguredTableAnalysisRuleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - analysisRule: (_) => de_ConfiguredTableAnalysisRule(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetConfiguredTableAnalysisRuleCommandError - */ -const de_GetConfiguredTableAnalysisRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetConfiguredTableAssociationCommand - */ -export const de_GetConfiguredTableAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfiguredTableAssociationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - configuredTableAssociation: (_) => de_ConfiguredTableAssociation(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetConfiguredTableAssociationCommandError - */ -const de_GetConfiguredTableAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMembershipCommand - */ -export const de_GetMembershipCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMembershipCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - membership: (_) => de_Membership(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMembershipCommandError - */ -const de_GetMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPrivacyBudgetTemplateCommand - */ -export const de_GetPrivacyBudgetTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPrivacyBudgetTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - privacyBudgetTemplate: (_) => de_PrivacyBudgetTemplate(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPrivacyBudgetTemplateCommandError - */ -const de_GetPrivacyBudgetTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetProtectedQueryCommand - */ -export const de_GetProtectedQueryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProtectedQueryCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - protectedQuery: (_) => de_ProtectedQuery(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetProtectedQueryCommandError - */ -const de_GetProtectedQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSchemaCommand - */ -export const de_GetSchemaCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSchemaCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - schema: (_) => de_Schema(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSchemaCommandError - */ -const de_GetSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSchemaAnalysisRuleCommand - */ -export const de_GetSchemaAnalysisRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSchemaAnalysisRuleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - analysisRule: (_) => de_AnalysisRule(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSchemaAnalysisRuleCommandError - */ -const de_GetSchemaAnalysisRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_DeleteMemberCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListAnalysisTemplatesCommand + * deserializeAws_restJson1DeleteMembershipCommand */ -export const de_ListAnalysisTemplatesCommand = async ( +export const de_DeleteMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnalysisTemplatesCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - analysisTemplateSummaries: (_) => de_AnalysisTemplateSummaryList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListAnalysisTemplatesCommandError + * deserializeAws_restJson1DeletePrivacyBudgetTemplateCommand */ -const de_ListAnalysisTemplatesCommandError = async ( +export const de_DeletePrivacyBudgetTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListCollaborationAnalysisTemplatesCommand + * deserializeAws_restJson1GetAnalysisTemplateCommand */ -export const de_ListCollaborationAnalysisTemplatesCommand = async ( +export const de_GetAnalysisTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCollaborationAnalysisTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - collaborationAnalysisTemplateSummaries: (_) => de_CollaborationAnalysisTemplateSummaryList(_, context), - nextToken: __expectString, + analysisTemplate: (_) => de_AnalysisTemplate(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListCollaborationAnalysisTemplatesCommandError + * deserializeAws_restJson1GetCollaborationCommand */ -const de_ListCollaborationAnalysisTemplatesCommandError = async ( +export const de_GetCollaborationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + collaboration: (_) => de_Collaboration(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListCollaborationConfiguredAudienceModelAssociationsCommand + * deserializeAws_restJson1GetCollaborationAnalysisTemplateCommand */ -export const de_ListCollaborationConfiguredAudienceModelAssociationsCommand = async ( +export const de_GetCollaborationAnalysisTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCollaborationConfiguredAudienceModelAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - collaborationConfiguredAudienceModelAssociationSummaries: (_) => - de_CollaborationConfiguredAudienceModelAssociationSummaryList(_, context), - nextToken: __expectString, + collaborationAnalysisTemplate: (_) => de_CollaborationAnalysisTemplate(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListCollaborationConfiguredAudienceModelAssociationsCommandError + * deserializeAws_restJson1GetCollaborationConfiguredAudienceModelAssociationCommand */ -const de_ListCollaborationConfiguredAudienceModelAssociationsCommandError = async ( +export const de_GetCollaborationConfiguredAudienceModelAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + collaborationConfiguredAudienceModelAssociation: (_) => + de_CollaborationConfiguredAudienceModelAssociation(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListCollaborationPrivacyBudgetsCommand + * deserializeAws_restJson1GetCollaborationPrivacyBudgetTemplateCommand */ -export const de_ListCollaborationPrivacyBudgetsCommand = async ( +export const de_GetCollaborationPrivacyBudgetTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCollaborationPrivacyBudgetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - collaborationPrivacyBudgetSummaries: (_) => de_CollaborationPrivacyBudgetSummaryList(_, context), - nextToken: __expectString, + collaborationPrivacyBudgetTemplate: (_) => de_CollaborationPrivacyBudgetTemplate(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListCollaborationPrivacyBudgetsCommandError + * deserializeAws_restJson1GetConfiguredAudienceModelAssociationCommand */ -const de_ListCollaborationPrivacyBudgetsCommandError = async ( +export const de_GetConfiguredAudienceModelAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + configuredAudienceModelAssociation: (_) => de_ConfiguredAudienceModelAssociation(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListCollaborationPrivacyBudgetTemplatesCommand + * deserializeAws_restJson1GetConfiguredTableCommand */ -export const de_ListCollaborationPrivacyBudgetTemplatesCommand = async ( +export const de_GetConfiguredTableCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCollaborationPrivacyBudgetTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - collaborationPrivacyBudgetTemplateSummaries: (_) => de_CollaborationPrivacyBudgetTemplateSummaryList(_, context), - nextToken: __expectString, + configuredTable: (_) => de_ConfiguredTable(_, context), }); Object.assign(contents, doc); return contents; }; - -/** - * deserializeAws_restJson1ListCollaborationPrivacyBudgetTemplatesCommandError - */ -const de_ListCollaborationPrivacyBudgetTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + +/** + * deserializeAws_restJson1GetConfiguredTableAnalysisRuleCommand + */ +export const de_GetConfiguredTableAnalysisRuleCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + analysisRule: (_) => de_ConfiguredTableAnalysisRule(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListCollaborationsCommand + * deserializeAws_restJson1GetConfiguredTableAssociationCommand */ -export const de_ListCollaborationsCommand = async ( +export const de_GetConfiguredTableAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCollaborationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - collaborationList: (_) => de_CollaborationSummaryList(_, context), - nextToken: __expectString, + configuredTableAssociation: (_) => de_ConfiguredTableAssociation(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListCollaborationsCommandError + * deserializeAws_restJson1GetMembershipCommand */ -const de_ListCollaborationsCommandError = async ( +export const de_GetMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + membership: (_) => de_Membership(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListConfiguredAudienceModelAssociationsCommand + * deserializeAws_restJson1GetPrivacyBudgetTemplateCommand */ -export const de_ListConfiguredAudienceModelAssociationsCommand = async ( +export const de_GetPrivacyBudgetTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConfiguredAudienceModelAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - configuredAudienceModelAssociationSummaries: (_) => de_ConfiguredAudienceModelAssociationSummaryList(_, context), - nextToken: __expectString, + privacyBudgetTemplate: (_) => de_PrivacyBudgetTemplate(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListConfiguredAudienceModelAssociationsCommandError + * deserializeAws_restJson1GetProtectedQueryCommand */ -const de_ListConfiguredAudienceModelAssociationsCommandError = async ( +export const de_GetProtectedQueryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + protectedQuery: (_) => de_ProtectedQuery(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListConfiguredTableAssociationsCommand + * deserializeAws_restJson1GetSchemaCommand */ -export const de_ListConfiguredTableAssociationsCommand = async ( +export const de_GetSchemaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConfiguredTableAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - configuredTableAssociationSummaries: (_) => de_ConfiguredTableAssociationSummaryList(_, context), - nextToken: __expectString, + schema: (_) => de_Schema(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListConfiguredTableAssociationsCommandError + * deserializeAws_restJson1GetSchemaAnalysisRuleCommand */ -const de_ListConfiguredTableAssociationsCommandError = async ( +export const de_GetSchemaAnalysisRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + analysisRule: (_) => de_AnalysisRule(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListConfiguredTablesCommand + * deserializeAws_restJson1ListAnalysisTemplatesCommand */ -export const de_ListConfiguredTablesCommand = async ( +export const de_ListAnalysisTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConfiguredTablesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - configuredTableSummaries: (_) => de_ConfiguredTableSummaryList(_, context), + analysisTemplateSummaries: (_) => de_AnalysisTemplateSummaryList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -4101,56 +2324,44 @@ export const de_ListConfiguredTablesCommand = async ( }; /** - * deserializeAws_restJson1ListConfiguredTablesCommandError + * deserializeAws_restJson1ListCollaborationAnalysisTemplatesCommand */ -const de_ListConfiguredTablesCommandError = async ( +export const de_ListCollaborationAnalysisTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + collaborationAnalysisTemplateSummaries: (_) => de_CollaborationAnalysisTemplateSummaryList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListMembersCommand + * deserializeAws_restJson1ListCollaborationConfiguredAudienceModelAssociationsCommand */ -export const de_ListMembersCommand = async ( +export const de_ListCollaborationConfiguredAudienceModelAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - memberSummaries: (_) => de_MemberSummaryList(_, context), + collaborationConfiguredAudienceModelAssociationSummaries: (_) => + de_CollaborationConfiguredAudienceModelAssociationSummaryList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -4158,59 +2369,43 @@ export const de_ListMembersCommand = async ( }; /** - * deserializeAws_restJson1ListMembersCommandError + * deserializeAws_restJson1ListCollaborationPrivacyBudgetsCommand */ -const de_ListMembersCommandError = async ( +export const de_ListCollaborationPrivacyBudgetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + collaborationPrivacyBudgetSummaries: (_) => de_CollaborationPrivacyBudgetSummaryList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListMembershipsCommand + * deserializeAws_restJson1ListCollaborationPrivacyBudgetTemplatesCommand */ -export const de_ListMembershipsCommand = async ( +export const de_ListCollaborationPrivacyBudgetTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMembershipsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - membershipSummaries: (_) => de_MembershipSummaryList(_, context), + collaborationPrivacyBudgetTemplateSummaries: (_) => de_CollaborationPrivacyBudgetTemplateSummaryList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -4218,229 +2413,168 @@ export const de_ListMembershipsCommand = async ( }; /** - * deserializeAws_restJson1ListMembershipsCommandError + * deserializeAws_restJson1ListCollaborationsCommand */ -const de_ListMembershipsCommandError = async ( +export const de_ListCollaborationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + collaborationList: (_) => de_CollaborationSummaryList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPrivacyBudgetsCommand + * deserializeAws_restJson1ListConfiguredAudienceModelAssociationsCommand */ -export const de_ListPrivacyBudgetsCommand = async ( +export const de_ListConfiguredAudienceModelAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPrivacyBudgetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + configuredAudienceModelAssociationSummaries: (_) => de_ConfiguredAudienceModelAssociationSummaryList(_, context), nextToken: __expectString, - privacyBudgetSummaries: (_) => de_PrivacyBudgetSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPrivacyBudgetsCommandError + * deserializeAws_restJson1ListConfiguredTableAssociationsCommand */ -const de_ListPrivacyBudgetsCommandError = async ( +export const de_ListConfiguredTableAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + configuredTableAssociationSummaries: (_) => de_ConfiguredTableAssociationSummaryList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPrivacyBudgetTemplatesCommand + * deserializeAws_restJson1ListConfiguredTablesCommand */ -export const de_ListPrivacyBudgetTemplatesCommand = async ( +export const de_ListConfiguredTablesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPrivacyBudgetTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + configuredTableSummaries: (_) => de_ConfiguredTableSummaryList(_, context), nextToken: __expectString, - privacyBudgetTemplateSummaries: (_) => de_PrivacyBudgetTemplateSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPrivacyBudgetTemplatesCommandError + * deserializeAws_restJson1ListMembersCommand */ -const de_ListPrivacyBudgetTemplatesCommandError = async ( +export const de_ListMembersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + memberSummaries: (_) => de_MemberSummaryList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListProtectedQueriesCommand + * deserializeAws_restJson1ListMembershipsCommand */ -export const de_ListProtectedQueriesCommand = async ( +export const de_ListMembershipsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProtectedQueriesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + membershipSummaries: (_) => de_MembershipSummaryList(_, context), nextToken: __expectString, - protectedQueries: (_) => de_ProtectedQuerySummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListProtectedQueriesCommandError + * deserializeAws_restJson1ListPrivacyBudgetsCommand */ -const de_ListProtectedQueriesCommandError = async ( +export const de_ListPrivacyBudgetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + privacyBudgetSummaries: (_) => de_PrivacyBudgetSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListSchemasCommand + * deserializeAws_restJson1ListPrivacyBudgetTemplatesCommand */ -export const de_ListSchemasCommand = async ( +export const de_ListPrivacyBudgetTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSchemasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4448,98 +2582,75 @@ export const de_ListSchemasCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - schemaSummaries: (_) => de_SchemaSummaryList(_, context), + privacyBudgetTemplateSummaries: (_) => de_PrivacyBudgetTemplateSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSchemasCommandError + * deserializeAws_restJson1ListProtectedQueriesCommand */ -const de_ListSchemasCommandError = async ( +export const de_ListProtectedQueriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + protectedQueries: (_) => de_ProtectedQuerySummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListSchemasCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListSchemasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + nextToken: __expectString, + schemaSummaries: (_) => de_SchemaSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4550,7 +2661,7 @@ export const de_PreviewPrivacyImpactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PreviewPrivacyImpactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4563,44 +2674,6 @@ export const de_PreviewPrivacyImpactCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PreviewPrivacyImpactCommandError - */ -const de_PreviewPrivacyImpactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartProtectedQueryCommand */ @@ -4609,7 +2682,7 @@ export const de_StartProtectedQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartProtectedQueryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4622,47 +2695,6 @@ export const de_StartProtectedQueryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartProtectedQueryCommandError - */ -const de_StartProtectedQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cleanrooms#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -4671,7 +2703,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4680,35 +2712,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -4717,7 +2720,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4726,35 +2729,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAnalysisTemplateCommand */ @@ -4763,170 +2737,59 @@ export const de_UpdateAnalysisTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAnalysisTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - analysisTemplate: (_) => de_AnalysisTemplate(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateAnalysisTemplateCommandError - */ -const de_UpdateAnalysisTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateCollaborationCommand - */ -export const de_UpdateCollaborationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCollaborationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - collaboration: (_) => de_Collaboration(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateCollaborationCommandError - */ -const de_UpdateCollaborationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + analysisTemplate: (_) => de_AnalysisTemplate(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateConfiguredAudienceModelAssociationCommand + * deserializeAws_restJson1UpdateCollaborationCommand */ -export const de_UpdateConfiguredAudienceModelAssociationCommand = async ( +export const de_UpdateCollaborationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConfiguredAudienceModelAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - configuredAudienceModelAssociation: (_) => de_ConfiguredAudienceModelAssociation(_, context), + collaboration: (_) => de_Collaboration(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateConfiguredAudienceModelAssociationCommandError + * deserializeAws_restJson1UpdateConfiguredAudienceModelAssociationCommand */ -const de_UpdateConfiguredAudienceModelAssociationCommandError = async ( +export const de_UpdateConfiguredAudienceModelAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + configuredAudienceModelAssociation: (_) => de_ConfiguredAudienceModelAssociation(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4937,7 +2800,7 @@ export const de_UpdateConfiguredTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConfiguredTableCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4950,47 +2813,6 @@ export const de_UpdateConfiguredTableCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateConfiguredTableCommandError - */ -const de_UpdateConfiguredTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConfiguredTableAnalysisRuleCommand */ @@ -4999,7 +2821,7 @@ export const de_UpdateConfiguredTableAnalysisRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConfiguredTableAnalysisRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5012,47 +2834,6 @@ export const de_UpdateConfiguredTableAnalysisRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateConfiguredTableAnalysisRuleCommandError - */ -const de_UpdateConfiguredTableAnalysisRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConfiguredTableAssociationCommand */ @@ -5061,7 +2842,7 @@ export const de_UpdateConfiguredTableAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConfiguredTableAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5074,47 +2855,6 @@ export const de_UpdateConfiguredTableAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateConfiguredTableAssociationCommandError - */ -const de_UpdateConfiguredTableAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMembershipCommand */ @@ -5123,7 +2863,7 @@ export const de_UpdateMembershipCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMembershipCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5136,47 +2876,6 @@ export const de_UpdateMembershipCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateMembershipCommandError - */ -const de_UpdateMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePrivacyBudgetTemplateCommand */ @@ -5185,7 +2884,7 @@ export const de_UpdatePrivacyBudgetTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePrivacyBudgetTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5198,47 +2897,6 @@ export const de_UpdatePrivacyBudgetTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePrivacyBudgetTemplateCommandError - */ -const de_UpdatePrivacyBudgetTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanrooms#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cleanrooms#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanrooms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cleanrooms#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanrooms#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateProtectedQueryCommand */ @@ -5247,7 +2905,7 @@ export const de_UpdateProtectedQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProtectedQueryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5261,12 +2919,9 @@ export const de_UpdateProtectedQueryCommand = async ( }; /** - * deserializeAws_restJson1UpdateProtectedQueryCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateProtectedQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5276,9 +2931,6 @@ const de_UpdateProtectedQueryCommandError = async ( case "AccessDeniedException": case "com.amazonaws.cleanrooms#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanrooms#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.cleanrooms#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); @@ -5291,13 +2943,19 @@ const de_UpdateProtectedQueryCommandError = async ( case "ValidationException": case "com.amazonaws.cleanrooms#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.cleanrooms#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.cleanrooms#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cleanroomsml/src/protocols/Aws_restJson1.ts b/clients/client-cleanroomsml/src/protocols/Aws_restJson1.ts index 9fbfda9eeb12..24708db98d32 100644 --- a/clients/client-cleanroomsml/src/protocols/Aws_restJson1.ts +++ b/clients/client-cleanroomsml/src/protocols/Aws_restJson1.ts @@ -656,7 +656,7 @@ export const de_CreateAudienceModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAudienceModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -669,44 +669,6 @@ export const de_CreateAudienceModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAudienceModelCommandError - */ -const de_CreateAudienceModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanroomsml#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cleanroomsml#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConfiguredAudienceModelCommand */ @@ -715,7 +677,7 @@ export const de_CreateConfiguredAudienceModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConfiguredAudienceModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -728,44 +690,6 @@ export const de_CreateConfiguredAudienceModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConfiguredAudienceModelCommandError - */ -const de_CreateConfiguredAudienceModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanroomsml#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cleanroomsml#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateTrainingDatasetCommand */ @@ -774,7 +698,7 @@ export const de_CreateTrainingDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTrainingDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -787,38 +711,6 @@ export const de_CreateTrainingDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTrainingDatasetCommandError - */ -const de_CreateTrainingDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanroomsml#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAudienceGenerationJobCommand */ @@ -827,7 +719,7 @@ export const de_DeleteAudienceGenerationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAudienceGenerationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -836,41 +728,6 @@ export const de_DeleteAudienceGenerationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAudienceGenerationJobCommandError - */ -const de_DeleteAudienceGenerationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanroomsml#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAudienceModelCommand */ @@ -879,7 +736,7 @@ export const de_DeleteAudienceModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAudienceModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -888,41 +745,6 @@ export const de_DeleteAudienceModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAudienceModelCommandError - */ -const de_DeleteAudienceModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanroomsml#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteConfiguredAudienceModelCommand */ @@ -931,7 +753,7 @@ export const de_DeleteConfiguredAudienceModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConfiguredAudienceModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -940,41 +762,6 @@ export const de_DeleteConfiguredAudienceModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteConfiguredAudienceModelCommandError - */ -const de_DeleteConfiguredAudienceModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanroomsml#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteConfiguredAudienceModelPolicyCommand */ @@ -983,7 +770,7 @@ export const de_DeleteConfiguredAudienceModelPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConfiguredAudienceModelPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -992,38 +779,6 @@ export const de_DeleteConfiguredAudienceModelPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteConfiguredAudienceModelPolicyCommandError - */ -const de_DeleteConfiguredAudienceModelPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteTrainingDatasetCommand */ @@ -1032,7 +787,7 @@ export const de_DeleteTrainingDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTrainingDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1041,41 +796,6 @@ export const de_DeleteTrainingDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteTrainingDatasetCommandError - */ -const de_DeleteTrainingDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanroomsml#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAudienceGenerationJobCommand */ @@ -1084,7 +804,7 @@ export const de_GetAudienceGenerationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAudienceGenerationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1110,38 +830,6 @@ export const de_GetAudienceGenerationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAudienceGenerationJobCommandError - */ -const de_GetAudienceGenerationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAudienceModelCommand */ @@ -1150,7 +838,7 @@ export const de_GetAudienceModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAudienceModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1175,38 +863,6 @@ export const de_GetAudienceModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAudienceModelCommandError - */ -const de_GetAudienceModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConfiguredAudienceModelCommand */ @@ -1215,7 +871,7 @@ export const de_GetConfiguredAudienceModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfiguredAudienceModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1240,38 +896,6 @@ export const de_GetConfiguredAudienceModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetConfiguredAudienceModelCommandError - */ -const de_GetConfiguredAudienceModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConfiguredAudienceModelPolicyCommand */ @@ -1280,7 +904,7 @@ export const de_GetConfiguredAudienceModelPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfiguredAudienceModelPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1295,38 +919,6 @@ export const de_GetConfiguredAudienceModelPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetConfiguredAudienceModelPolicyCommandError - */ -const de_GetConfiguredAudienceModelPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTrainingDatasetCommand */ @@ -1335,7 +927,7 @@ export const de_GetTrainingDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTrainingDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1356,38 +948,6 @@ export const de_GetTrainingDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTrainingDatasetCommandError - */ -const de_GetTrainingDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAudienceExportJobsCommand */ @@ -1396,7 +956,7 @@ export const de_ListAudienceExportJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAudienceExportJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1410,35 +970,6 @@ export const de_ListAudienceExportJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAudienceExportJobsCommandError - */ -const de_ListAudienceExportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAudienceGenerationJobsCommand */ @@ -1447,7 +978,7 @@ export const de_ListAudienceGenerationJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAudienceGenerationJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1462,101 +993,21 @@ export const de_ListAudienceGenerationJobsCommand = async ( }; /** - * deserializeAws_restJson1ListAudienceGenerationJobsCommandError - */ -const de_ListAudienceGenerationJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAudienceModelsCommand - */ -export const de_ListAudienceModelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAudienceModelsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - audienceModels: (_) => de_AudienceModelList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAudienceModelsCommandError - */ -const de_ListAudienceModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListConfiguredAudienceModelsCommand + * deserializeAws_restJson1ListAudienceModelsCommand */ -export const de_ListConfiguredAudienceModelsCommand = async ( +export const de_ListAudienceModelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConfiguredAudienceModelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - configuredAudienceModels: (_) => de_ConfiguredAudienceModelList(_, context), + audienceModels: (_) => de_AudienceModelList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -1564,32 +1015,25 @@ export const de_ListConfiguredAudienceModelsCommand = async ( }; /** - * deserializeAws_restJson1ListConfiguredAudienceModelsCommandError + * deserializeAws_restJson1ListConfiguredAudienceModelsCommand */ -const de_ListConfiguredAudienceModelsCommandError = async ( +export const de_ListConfiguredAudienceModelsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + configuredAudienceModels: (_) => de_ConfiguredAudienceModelList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1600,7 +1044,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1613,38 +1057,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTrainingDatasetsCommand */ @@ -1653,7 +1065,7 @@ export const de_ListTrainingDatasetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTrainingDatasetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1667,35 +1079,6 @@ export const de_ListTrainingDatasetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTrainingDatasetsCommandError - */ -const de_ListTrainingDatasetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutConfiguredAudienceModelPolicyCommand */ @@ -1704,7 +1087,7 @@ export const de_PutConfiguredAudienceModelPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutConfiguredAudienceModelPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1718,38 +1101,6 @@ export const de_PutConfiguredAudienceModelPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutConfiguredAudienceModelPolicyCommandError - */ -const de_PutConfiguredAudienceModelPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartAudienceExportJobCommand */ @@ -1758,7 +1109,7 @@ export const de_StartAudienceExportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartAudienceExportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1767,44 +1118,6 @@ export const de_StartAudienceExportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartAudienceExportJobCommandError - */ -const de_StartAudienceExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanroomsml#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cleanroomsml#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartAudienceGenerationJobCommand */ @@ -1813,7 +1126,7 @@ export const de_StartAudienceGenerationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartAudienceGenerationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1826,44 +1139,6 @@ export const de_StartAudienceGenerationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartAudienceGenerationJobCommandError - */ -const de_StartAudienceGenerationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cleanroomsml#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cleanroomsml#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1872,7 +1147,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1881,38 +1156,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1921,7 +1164,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1930,38 +1173,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cleanroomsml#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cleanroomsml#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cleanroomsml#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConfiguredAudienceModelCommand */ @@ -1970,7 +1181,7 @@ export const de_UpdateConfiguredAudienceModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConfiguredAudienceModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1984,12 +1195,9 @@ export const de_UpdateConfiguredAudienceModelCommand = async ( }; /** - * deserializeAws_restJson1UpdateConfiguredAudienceModelCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateConfiguredAudienceModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2005,6 +1213,9 @@ const de_UpdateConfiguredAudienceModelCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.cleanroomsml#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.cleanroomsml#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.cleanroomsml#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); @@ -2014,7 +1225,7 @@ const de_UpdateConfiguredAudienceModelCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cloud9/src/protocols/Aws_json1_1.ts b/clients/client-cloud9/src/protocols/Aws_json1_1.ts index 617ae3c88aad..7d2bb17eae8e 100644 --- a/clients/client-cloud9/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloud9/src/protocols/Aws_json1_1.ts @@ -263,7 +263,7 @@ export const de_CreateEnvironmentEC2Command = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEnvironmentEC2CommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -275,50 +275,6 @@ export const de_CreateEnvironmentEC2Command = async ( return response; }; -/** - * deserializeAws_json1_1CreateEnvironmentEC2CommandError - */ -const de_CreateEnvironmentEC2CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.cloud9#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloud9#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cloud9#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.cloud9#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloud9#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.cloud9#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cloud9#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateEnvironmentMembershipCommand */ @@ -327,7 +283,7 @@ export const de_CreateEnvironmentMembershipCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEnvironmentMembershipCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -339,50 +295,6 @@ export const de_CreateEnvironmentMembershipCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateEnvironmentMembershipCommandError - */ -const de_CreateEnvironmentMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.cloud9#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloud9#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cloud9#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.cloud9#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloud9#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.cloud9#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cloud9#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteEnvironmentCommand */ @@ -391,7 +303,7 @@ export const de_DeleteEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -403,50 +315,6 @@ export const de_DeleteEnvironmentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteEnvironmentCommandError - */ -const de_DeleteEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.cloud9#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloud9#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cloud9#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.cloud9#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloud9#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.cloud9#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cloud9#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteEnvironmentMembershipCommand */ @@ -455,7 +323,7 @@ export const de_DeleteEnvironmentMembershipCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEnvironmentMembershipCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -467,50 +335,6 @@ export const de_DeleteEnvironmentMembershipCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteEnvironmentMembershipCommandError - */ -const de_DeleteEnvironmentMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.cloud9#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloud9#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cloud9#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.cloud9#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloud9#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.cloud9#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cloud9#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEnvironmentMembershipsCommand */ @@ -519,7 +343,7 @@ export const de_DescribeEnvironmentMembershipsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEnvironmentMembershipsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -531,50 +355,6 @@ export const de_DescribeEnvironmentMembershipsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEnvironmentMembershipsCommandError - */ -const de_DescribeEnvironmentMembershipsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.cloud9#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloud9#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cloud9#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.cloud9#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloud9#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.cloud9#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cloud9#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEnvironmentsCommand */ @@ -583,7 +363,7 @@ export const de_DescribeEnvironmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEnvironmentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -595,50 +375,6 @@ export const de_DescribeEnvironmentsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEnvironmentsCommandError - */ -const de_DescribeEnvironmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.cloud9#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloud9#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cloud9#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.cloud9#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloud9#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.cloud9#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cloud9#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEnvironmentStatusCommand */ @@ -647,7 +383,7 @@ export const de_DescribeEnvironmentStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEnvironmentStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -659,50 +395,6 @@ export const de_DescribeEnvironmentStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEnvironmentStatusCommandError - */ -const de_DescribeEnvironmentStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.cloud9#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloud9#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cloud9#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.cloud9#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloud9#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.cloud9#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cloud9#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListEnvironmentsCommand */ @@ -711,7 +403,7 @@ export const de_ListEnvironmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListEnvironmentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -723,50 +415,6 @@ export const de_ListEnvironmentsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListEnvironmentsCommandError - */ -const de_ListEnvironmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.cloud9#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloud9#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cloud9#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.cloud9#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloud9#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.cloud9#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cloud9#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -775,7 +423,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -787,38 +435,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.cloud9#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.cloud9#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.cloud9#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -827,7 +443,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -839,41 +455,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.cloud9#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentAccessException": - case "com.amazonaws.cloud9#ConcurrentAccessException": - throw await de_ConcurrentAccessExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.cloud9#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.cloud9#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -882,7 +463,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -894,41 +475,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.cloud9#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentAccessException": - case "com.amazonaws.cloud9#ConcurrentAccessException": - throw await de_ConcurrentAccessExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.cloud9#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.cloud9#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateEnvironmentCommand */ @@ -937,7 +483,7 @@ export const de_UpdateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -949,50 +495,6 @@ export const de_UpdateEnvironmentCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateEnvironmentCommandError - */ -const de_UpdateEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.cloud9#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloud9#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cloud9#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.cloud9#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloud9#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.cloud9#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cloud9#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateEnvironmentMembershipCommand */ @@ -1001,7 +503,7 @@ export const de_UpdateEnvironmentMembershipCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateEnvironmentMembershipCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1014,12 +516,9 @@ export const de_UpdateEnvironmentMembershipCommand = async ( }; /** - * deserializeAws_json1_1UpdateEnvironmentMembershipCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateEnvironmentMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1047,13 +546,16 @@ const de_UpdateEnvironmentMembershipCommandError = async ( case "TooManyRequestsException": case "com.amazonaws.cloud9#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "ConcurrentAccessException": + case "com.amazonaws.cloud9#ConcurrentAccessException": + throw await de_ConcurrentAccessExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts b/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts index afe1ee9c270a..3398e84df2d5 100644 --- a/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts +++ b/clients/client-cloudcontrol/src/protocols/Aws_json1_0.ts @@ -191,7 +191,7 @@ export const de_CancelResourceRequestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelResourceRequestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -203,35 +203,6 @@ export const de_CancelResourceRequestCommand = async ( return response; }; -/** - * deserializeAws_json1_0CancelResourceRequestCommandError - */ -const de_CancelResourceRequestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudcontrol#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "RequestTokenNotFoundException": - case "com.amazonaws.cloudcontrol#RequestTokenNotFoundException": - throw await de_RequestTokenNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateResourceCommand */ @@ -240,7 +211,7 @@ export const de_CreateResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -252,86 +223,6 @@ export const de_CreateResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateResourceCommandError - */ -const de_CreateResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.cloudcontrol#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ClientTokenConflictException": - case "com.amazonaws.cloudcontrol#ClientTokenConflictException": - throw await de_ClientTokenConflictExceptionRes(parsedOutput, context); - case "ConcurrentOperationException": - case "com.amazonaws.cloudcontrol#ConcurrentOperationException": - throw await de_ConcurrentOperationExceptionRes(parsedOutput, context); - case "GeneralServiceException": - case "com.amazonaws.cloudcontrol#GeneralServiceException": - throw await de_GeneralServiceExceptionRes(parsedOutput, context); - case "HandlerFailureException": - case "com.amazonaws.cloudcontrol#HandlerFailureException": - throw await de_HandlerFailureExceptionRes(parsedOutput, context); - case "HandlerInternalFailureException": - case "com.amazonaws.cloudcontrol#HandlerInternalFailureException": - throw await de_HandlerInternalFailureExceptionRes(parsedOutput, context); - case "InvalidCredentialsException": - case "com.amazonaws.cloudcontrol#InvalidCredentialsException": - throw await de_InvalidCredentialsExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudcontrol#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NetworkFailureException": - case "com.amazonaws.cloudcontrol#NetworkFailureException": - throw await de_NetworkFailureExceptionRes(parsedOutput, context); - case "NotStabilizedException": - case "com.amazonaws.cloudcontrol#NotStabilizedException": - throw await de_NotStabilizedExceptionRes(parsedOutput, context); - case "NotUpdatableException": - case "com.amazonaws.cloudcontrol#NotUpdatableException": - throw await de_NotUpdatableExceptionRes(parsedOutput, context); - case "PrivateTypeException": - case "com.amazonaws.cloudcontrol#PrivateTypeException": - throw await de_PrivateTypeExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cloudcontrol#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudcontrol#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceInternalErrorException": - case "com.amazonaws.cloudcontrol#ServiceInternalErrorException": - throw await de_ServiceInternalErrorExceptionRes(parsedOutput, context); - case "ServiceLimitExceededException": - case "com.amazonaws.cloudcontrol#ServiceLimitExceededException": - throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudcontrol#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TypeNotFoundException": - case "com.amazonaws.cloudcontrol#TypeNotFoundException": - throw await de_TypeNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedActionException": - case "com.amazonaws.cloudcontrol#UnsupportedActionException": - throw await de_UnsupportedActionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteResourceCommand */ @@ -340,7 +231,7 @@ export const de_DeleteResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -352,86 +243,6 @@ export const de_DeleteResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteResourceCommandError - */ -const de_DeleteResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.cloudcontrol#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ClientTokenConflictException": - case "com.amazonaws.cloudcontrol#ClientTokenConflictException": - throw await de_ClientTokenConflictExceptionRes(parsedOutput, context); - case "ConcurrentOperationException": - case "com.amazonaws.cloudcontrol#ConcurrentOperationException": - throw await de_ConcurrentOperationExceptionRes(parsedOutput, context); - case "GeneralServiceException": - case "com.amazonaws.cloudcontrol#GeneralServiceException": - throw await de_GeneralServiceExceptionRes(parsedOutput, context); - case "HandlerFailureException": - case "com.amazonaws.cloudcontrol#HandlerFailureException": - throw await de_HandlerFailureExceptionRes(parsedOutput, context); - case "HandlerInternalFailureException": - case "com.amazonaws.cloudcontrol#HandlerInternalFailureException": - throw await de_HandlerInternalFailureExceptionRes(parsedOutput, context); - case "InvalidCredentialsException": - case "com.amazonaws.cloudcontrol#InvalidCredentialsException": - throw await de_InvalidCredentialsExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudcontrol#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NetworkFailureException": - case "com.amazonaws.cloudcontrol#NetworkFailureException": - throw await de_NetworkFailureExceptionRes(parsedOutput, context); - case "NotStabilizedException": - case "com.amazonaws.cloudcontrol#NotStabilizedException": - throw await de_NotStabilizedExceptionRes(parsedOutput, context); - case "NotUpdatableException": - case "com.amazonaws.cloudcontrol#NotUpdatableException": - throw await de_NotUpdatableExceptionRes(parsedOutput, context); - case "PrivateTypeException": - case "com.amazonaws.cloudcontrol#PrivateTypeException": - throw await de_PrivateTypeExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cloudcontrol#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudcontrol#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceInternalErrorException": - case "com.amazonaws.cloudcontrol#ServiceInternalErrorException": - throw await de_ServiceInternalErrorExceptionRes(parsedOutput, context); - case "ServiceLimitExceededException": - case "com.amazonaws.cloudcontrol#ServiceLimitExceededException": - throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudcontrol#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TypeNotFoundException": - case "com.amazonaws.cloudcontrol#TypeNotFoundException": - throw await de_TypeNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedActionException": - case "com.amazonaws.cloudcontrol#UnsupportedActionException": - throw await de_UnsupportedActionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetResourceCommand */ @@ -440,7 +251,7 @@ export const de_GetResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -452,80 +263,6 @@ export const de_GetResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetResourceCommandError - */ -const de_GetResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.cloudcontrol#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "GeneralServiceException": - case "com.amazonaws.cloudcontrol#GeneralServiceException": - throw await de_GeneralServiceExceptionRes(parsedOutput, context); - case "HandlerFailureException": - case "com.amazonaws.cloudcontrol#HandlerFailureException": - throw await de_HandlerFailureExceptionRes(parsedOutput, context); - case "HandlerInternalFailureException": - case "com.amazonaws.cloudcontrol#HandlerInternalFailureException": - throw await de_HandlerInternalFailureExceptionRes(parsedOutput, context); - case "InvalidCredentialsException": - case "com.amazonaws.cloudcontrol#InvalidCredentialsException": - throw await de_InvalidCredentialsExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudcontrol#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NetworkFailureException": - case "com.amazonaws.cloudcontrol#NetworkFailureException": - throw await de_NetworkFailureExceptionRes(parsedOutput, context); - case "NotStabilizedException": - case "com.amazonaws.cloudcontrol#NotStabilizedException": - throw await de_NotStabilizedExceptionRes(parsedOutput, context); - case "NotUpdatableException": - case "com.amazonaws.cloudcontrol#NotUpdatableException": - throw await de_NotUpdatableExceptionRes(parsedOutput, context); - case "PrivateTypeException": - case "com.amazonaws.cloudcontrol#PrivateTypeException": - throw await de_PrivateTypeExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cloudcontrol#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudcontrol#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceInternalErrorException": - case "com.amazonaws.cloudcontrol#ServiceInternalErrorException": - throw await de_ServiceInternalErrorExceptionRes(parsedOutput, context); - case "ServiceLimitExceededException": - case "com.amazonaws.cloudcontrol#ServiceLimitExceededException": - throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudcontrol#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TypeNotFoundException": - case "com.amazonaws.cloudcontrol#TypeNotFoundException": - throw await de_TypeNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedActionException": - case "com.amazonaws.cloudcontrol#UnsupportedActionException": - throw await de_UnsupportedActionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetResourceRequestStatusCommand */ @@ -534,7 +271,7 @@ export const de_GetResourceRequestStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetResourceRequestStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -546,32 +283,6 @@ export const de_GetResourceRequestStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetResourceRequestStatusCommandError - */ -const de_GetResourceRequestStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestTokenNotFoundException": - case "com.amazonaws.cloudcontrol#RequestTokenNotFoundException": - throw await de_RequestTokenNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListResourceRequestsCommand */ @@ -580,7 +291,7 @@ export const de_ListResourceRequestsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListResourceRequestsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -592,26 +303,6 @@ export const de_ListResourceRequestsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListResourceRequestsCommandError - */ -const de_ListResourceRequestsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_0ListResourcesCommand */ @@ -620,7 +311,7 @@ export const de_ListResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -632,80 +323,6 @@ export const de_ListResourcesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListResourcesCommandError - */ -const de_ListResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.cloudcontrol#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "GeneralServiceException": - case "com.amazonaws.cloudcontrol#GeneralServiceException": - throw await de_GeneralServiceExceptionRes(parsedOutput, context); - case "HandlerFailureException": - case "com.amazonaws.cloudcontrol#HandlerFailureException": - throw await de_HandlerFailureExceptionRes(parsedOutput, context); - case "HandlerInternalFailureException": - case "com.amazonaws.cloudcontrol#HandlerInternalFailureException": - throw await de_HandlerInternalFailureExceptionRes(parsedOutput, context); - case "InvalidCredentialsException": - case "com.amazonaws.cloudcontrol#InvalidCredentialsException": - throw await de_InvalidCredentialsExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudcontrol#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NetworkFailureException": - case "com.amazonaws.cloudcontrol#NetworkFailureException": - throw await de_NetworkFailureExceptionRes(parsedOutput, context); - case "NotStabilizedException": - case "com.amazonaws.cloudcontrol#NotStabilizedException": - throw await de_NotStabilizedExceptionRes(parsedOutput, context); - case "NotUpdatableException": - case "com.amazonaws.cloudcontrol#NotUpdatableException": - throw await de_NotUpdatableExceptionRes(parsedOutput, context); - case "PrivateTypeException": - case "com.amazonaws.cloudcontrol#PrivateTypeException": - throw await de_PrivateTypeExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cloudcontrol#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudcontrol#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceInternalErrorException": - case "com.amazonaws.cloudcontrol#ServiceInternalErrorException": - throw await de_ServiceInternalErrorExceptionRes(parsedOutput, context); - case "ServiceLimitExceededException": - case "com.amazonaws.cloudcontrol#ServiceLimitExceededException": - throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudcontrol#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TypeNotFoundException": - case "com.amazonaws.cloudcontrol#TypeNotFoundException": - throw await de_TypeNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedActionException": - case "com.amazonaws.cloudcontrol#UnsupportedActionException": - throw await de_UnsupportedActionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateResourceCommand */ @@ -714,7 +331,7 @@ export const de_UpdateResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -727,18 +344,21 @@ export const de_UpdateResourceCommand = async ( }; /** - * deserializeAws_json1_0UpdateResourceCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "ConcurrentModificationException": + case "com.amazonaws.cloudcontrol#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "RequestTokenNotFoundException": + case "com.amazonaws.cloudcontrol#RequestTokenNotFoundException": + throw await de_RequestTokenNotFoundExceptionRes(parsedOutput, context); case "AlreadyExistsException": case "com.amazonaws.cloudcontrol#AlreadyExistsException": throw await de_AlreadyExistsExceptionRes(parsedOutput, context); @@ -802,7 +422,7 @@ const de_UpdateResourceCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts b/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts index 465747048882..ce3103fa80dc 100644 --- a/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts +++ b/clients/client-clouddirectory/src/protocols/Aws_restJson1.ts @@ -1852,7 +1852,7 @@ export const de_AddFacetToObjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AddFacetToObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1861,56 +1861,6 @@ export const de_AddFacetToObjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddFacetToObjectCommandError - */ -const de_AddFacetToObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ApplySchemaCommand */ @@ -1919,7 +1869,7 @@ export const de_ApplySchemaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ApplySchemaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1933,56 +1883,6 @@ export const de_ApplySchemaCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ApplySchemaCommandError - */ -const de_ApplySchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidAttachmentException": - case "com.amazonaws.clouddirectory#InvalidAttachmentException": - throw await de_InvalidAttachmentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "SchemaAlreadyExistsException": - case "com.amazonaws.clouddirectory#SchemaAlreadyExistsException": - throw await de_SchemaAlreadyExistsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AttachObjectCommand */ @@ -1991,7 +1891,7 @@ export const de_AttachObjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AttachObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2004,62 +1904,6 @@ export const de_AttachObjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AttachObjectCommandError - */ -const de_AttachObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidAttachmentException": - case "com.amazonaws.clouddirectory#InvalidAttachmentException": - throw await de_InvalidAttachmentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "LinkNameAlreadyInUseException": - case "com.amazonaws.clouddirectory#LinkNameAlreadyInUseException": - throw await de_LinkNameAlreadyInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AttachPolicyCommand */ @@ -2068,7 +1912,7 @@ export const de_AttachPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AttachPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2077,56 +1921,6 @@ export const de_AttachPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AttachPolicyCommandError - */ -const de_AttachPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotPolicyException": - case "com.amazonaws.clouddirectory#NotPolicyException": - throw await de_NotPolicyExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AttachToIndexCommand */ @@ -2135,7 +1929,7 @@ export const de_AttachToIndexCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AttachToIndexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2148,65 +1942,6 @@ export const de_AttachToIndexCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AttachToIndexCommandError - */ -const de_AttachToIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "IndexedAttributeMissingException": - case "com.amazonaws.clouddirectory#IndexedAttributeMissingException": - throw await de_IndexedAttributeMissingExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidAttachmentException": - case "com.amazonaws.clouddirectory#InvalidAttachmentException": - throw await de_InvalidAttachmentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "LinkNameAlreadyInUseException": - case "com.amazonaws.clouddirectory#LinkNameAlreadyInUseException": - throw await de_LinkNameAlreadyInUseExceptionRes(parsedOutput, context); - case "NotIndexException": - case "com.amazonaws.clouddirectory#NotIndexException": - throw await de_NotIndexExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AttachTypedLinkCommand */ @@ -2215,7 +1950,7 @@ export const de_AttachTypedLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AttachTypedLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2229,67 +1964,14 @@ export const de_AttachTypedLinkCommand = async ( }; /** - * deserializeAws_restJson1AttachTypedLinkCommandError + * deserializeAws_restJson1BatchReadCommand */ -const de_AttachTypedLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidAttachmentException": - case "com.amazonaws.clouddirectory#InvalidAttachmentException": - throw await de_InvalidAttachmentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1BatchReadCommand - */ -export const de_BatchReadCommand = async ( +export const de_BatchReadCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchReadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2302,50 +1984,6 @@ export const de_BatchReadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchReadCommandError - */ -const de_BatchReadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchWriteCommand */ @@ -2354,7 +1992,7 @@ export const de_BatchWriteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchWriteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2367,53 +2005,6 @@ export const de_BatchWriteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchWriteCommandError - */ -const de_BatchWriteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BatchWriteException": - case "com.amazonaws.clouddirectory#BatchWriteException": - throw await de_BatchWriteExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDirectoryCommand */ @@ -2422,7 +2013,7 @@ export const de_CreateDirectoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDirectoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2438,53 +2029,6 @@ export const de_CreateDirectoryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDirectoryCommandError - */ -const de_CreateDirectoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryAlreadyExistsException": - case "com.amazonaws.clouddirectory#DirectoryAlreadyExistsException": - throw await de_DirectoryAlreadyExistsExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFacetCommand */ @@ -2493,7 +2037,7 @@ export const de_CreateFacetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFacetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2503,67 +2047,35 @@ export const de_CreateFacetCommand = async ( }; /** - * deserializeAws_restJson1CreateFacetCommandError + * deserializeAws_restJson1CreateIndexCommand */ -const de_CreateFacetCommandError = async ( +export const de_CreateIndexCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "FacetAlreadyExistsException": - case "com.amazonaws.clouddirectory#FacetAlreadyExistsException": - throw await de_FacetAlreadyExistsExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidRuleException": - case "com.amazonaws.clouddirectory#InvalidRuleException": - throw await de_InvalidRuleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ObjectIdentifier: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateIndexCommand + * deserializeAws_restJson1CreateObjectCommand */ -export const de_CreateIndexCommand = async ( +export const de_CreateObjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateIndexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2577,212 +2089,128 @@ export const de_CreateIndexCommand = async ( }; /** - * deserializeAws_restJson1CreateIndexCommandError + * deserializeAws_restJson1CreateSchemaCommand */ -const de_CreateIndexCommandError = async ( +export const de_CreateSchemaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "LinkNameAlreadyInUseException": - case "com.amazonaws.clouddirectory#LinkNameAlreadyInUseException": - throw await de_LinkNameAlreadyInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "UnsupportedIndexTypeException": - case "com.amazonaws.clouddirectory#UnsupportedIndexTypeException": - throw await de_UnsupportedIndexTypeExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SchemaArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateObjectCommand + * deserializeAws_restJson1CreateTypedLinkFacetCommand */ -export const de_CreateObjectCommand = async ( +export const de_CreateTypedLinkFacetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteDirectoryCommand + */ +export const de_DeleteDirectoryCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ObjectIdentifier: __expectString, + DirectoryArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateObjectCommandError + * deserializeAws_restJson1DeleteFacetCommand */ -const de_CreateObjectCommandError = async ( +export const de_DeleteFacetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "LinkNameAlreadyInUseException": - case "com.amazonaws.clouddirectory#LinkNameAlreadyInUseException": - throw await de_LinkNameAlreadyInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "UnsupportedIndexTypeException": - case "com.amazonaws.clouddirectory#UnsupportedIndexTypeException": - throw await de_UnsupportedIndexTypeExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateSchemaCommand + * deserializeAws_restJson1DeleteObjectCommand */ -export const de_CreateSchemaCommand = async ( +export const de_DeleteObjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSchemaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - SchemaArn: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateSchemaCommandError + * deserializeAws_restJson1DeleteSchemaCommand */ -const de_CreateSchemaCommandError = async ( +export const de_DeleteSchemaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "SchemaAlreadyExistsException": - case "com.amazonaws.clouddirectory#SchemaAlreadyExistsException": - throw await de_SchemaAlreadyExistsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SchemaArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateTypedLinkFacetCommand + * deserializeAws_restJson1DeleteTypedLinkFacetCommand */ -export const de_CreateTypedLinkFacetCommand = async ( +export const de_DeleteTypedLinkFacetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTypedLinkFacetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2792,138 +2220,73 @@ export const de_CreateTypedLinkFacetCommand = async ( }; /** - * deserializeAws_restJson1CreateTypedLinkFacetCommandError + * deserializeAws_restJson1DetachFromIndexCommand */ -const de_CreateTypedLinkFacetCommandError = async ( +export const de_DetachFromIndexCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "FacetAlreadyExistsException": - case "com.amazonaws.clouddirectory#FacetAlreadyExistsException": - throw await de_FacetAlreadyExistsExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidRuleException": - case "com.amazonaws.clouddirectory#InvalidRuleException": - throw await de_InvalidRuleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DetachedObjectIdentifier: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteDirectoryCommand + * deserializeAws_restJson1DetachObjectCommand */ -export const de_DeleteDirectoryCommand = async ( +export const de_DetachObjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDirectoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DirectoryArn: __expectString, + DetachedObjectIdentifier: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteDirectoryCommandError + * deserializeAws_restJson1DetachPolicyCommand */ -const de_DeleteDirectoryCommandError = async ( +export const de_DetachPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryDeletedException": - case "com.amazonaws.clouddirectory#DirectoryDeletedException": - throw await de_DirectoryDeletedExceptionRes(parsedOutput, context); - case "DirectoryNotDisabledException": - case "com.amazonaws.clouddirectory#DirectoryNotDisabledException": - throw await de_DirectoryNotDisabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteFacetCommand + * deserializeAws_restJson1DetachTypedLinkCommand */ -export const de_DeleteFacetCommand = async ( +export const de_DetachTypedLinkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFacetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2933,3321 +2296,847 @@ export const de_DeleteFacetCommand = async ( }; /** - * deserializeAws_restJson1DeleteFacetCommandError + * deserializeAws_restJson1DisableDirectoryCommand */ -const de_DeleteFacetCommandError = async ( +export const de_DisableDirectoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "FacetInUseException": - case "com.amazonaws.clouddirectory#FacetInUseException": - throw await de_FacetInUseExceptionRes(parsedOutput, context); - case "FacetNotFoundException": - case "com.amazonaws.clouddirectory#FacetNotFoundException": - throw await de_FacetNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DirectoryArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteObjectCommand + * deserializeAws_restJson1EnableDirectoryCommand */ -export const de_DeleteObjectCommand = async ( +export const de_EnableDirectoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DirectoryArn: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteObjectCommandError + * deserializeAws_restJson1GetAppliedSchemaVersionCommand */ -const de_DeleteObjectCommandError = async ( +export const de_GetAppliedSchemaVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ObjectNotDetachedException": - case "com.amazonaws.clouddirectory#ObjectNotDetachedException": - throw await de_ObjectNotDetachedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AppliedSchemaArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteSchemaCommand + * deserializeAws_restJson1GetDirectoryCommand */ -export const de_DeleteSchemaCommand = async ( +export const de_GetDirectoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSchemaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SchemaArn: __expectString, + Directory: (_) => de_Directory(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteSchemaCommandError + * deserializeAws_restJson1GetFacetCommand */ -const de_DeleteSchemaCommandError = async ( +export const de_GetFacetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "StillContainsLinksException": - case "com.amazonaws.clouddirectory#StillContainsLinksException": - throw await de_StillContainsLinksExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Facet: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteTypedLinkFacetCommand + * deserializeAws_restJson1GetLinkAttributesCommand */ -export const de_DeleteTypedLinkFacetCommand = async ( +export const de_GetLinkAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTypedLinkFacetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Attributes: (_) => de_AttributeKeyAndValueList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteTypedLinkFacetCommandError + * deserializeAws_restJson1GetObjectAttributesCommand */ -const de_DeleteTypedLinkFacetCommandError = async ( +export const de_GetObjectAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "FacetNotFoundException": - case "com.amazonaws.clouddirectory#FacetNotFoundException": - throw await de_FacetNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Attributes: (_) => de_AttributeKeyAndValueList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DetachFromIndexCommand + * deserializeAws_restJson1GetObjectInformationCommand */ -export const de_DetachFromIndexCommand = async ( +export const de_GetObjectInformationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DetachFromIndexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DetachedObjectIdentifier: __expectString, + ObjectIdentifier: __expectString, + SchemaFacets: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DetachFromIndexCommandError + * deserializeAws_restJson1GetSchemaAsJsonCommand */ -const de_DetachFromIndexCommandError = async ( +export const de_GetSchemaAsJsonCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotIndexException": - case "com.amazonaws.clouddirectory#NotIndexException": - throw await de_NotIndexExceptionRes(parsedOutput, context); - case "ObjectAlreadyDetachedException": - case "com.amazonaws.clouddirectory#ObjectAlreadyDetachedException": - throw await de_ObjectAlreadyDetachedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Document: __expectString, + Name: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DetachObjectCommand + * deserializeAws_restJson1GetTypedLinkFacetInformationCommand */ -export const de_DetachObjectCommand = async ( +export const de_GetTypedLinkFacetInformationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DetachObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DetachedObjectIdentifier: __expectString, + IdentityAttributeOrder: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DetachObjectCommandError + * deserializeAws_restJson1ListAppliedSchemaArnsCommand */ -const de_DetachObjectCommandError = async ( +export const de_ListAppliedSchemaArnsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotNodeException": - case "com.amazonaws.clouddirectory#NotNodeException": - throw await de_NotNodeExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + SchemaArns: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DetachPolicyCommand + * deserializeAws_restJson1ListAttachedIndicesCommand */ -export const de_DetachPolicyCommand = async ( +export const de_ListAttachedIndicesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DetachPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + IndexAttachments: (_) => de_IndexAttachmentList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DetachPolicyCommandError + * deserializeAws_restJson1ListDevelopmentSchemaArnsCommand */ -const de_DetachPolicyCommandError = async ( +export const de_ListDevelopmentSchemaArnsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotPolicyException": - case "com.amazonaws.clouddirectory#NotPolicyException": - throw await de_NotPolicyExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + SchemaArns: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DetachTypedLinkCommand + * deserializeAws_restJson1ListDirectoriesCommand */ -export const de_DetachTypedLinkCommand = async ( +export const de_ListDirectoriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DetachTypedLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Directories: (_) => de_DirectoryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DetachTypedLinkCommandError + * deserializeAws_restJson1ListFacetAttributesCommand */ -const de_DetachTypedLinkCommandError = async ( +export const de_ListFacetAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Attributes: (_) => de_FacetAttributeList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DisableDirectoryCommand + * deserializeAws_restJson1ListFacetNamesCommand */ -export const de_DisableDirectoryCommand = async ( +export const de_ListFacetNamesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableDirectoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DirectoryArn: __expectString, + FacetNames: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DisableDirectoryCommandError + * deserializeAws_restJson1ListIncomingTypedLinksCommand */ -const de_DisableDirectoryCommandError = async ( +export const de_ListIncomingTypedLinksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryDeletedException": - case "com.amazonaws.clouddirectory#DirectoryDeletedException": - throw await de_DirectoryDeletedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LinkSpecifiers: (_) => de_TypedLinkSpecifierList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1EnableDirectoryCommand + * deserializeAws_restJson1ListIndexCommand */ -export const de_EnableDirectoryCommand = async ( +export const de_ListIndexCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableDirectoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DirectoryArn: __expectString, + IndexAttachments: (_) => de_IndexAttachmentList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1EnableDirectoryCommandError + * deserializeAws_restJson1ListManagedSchemaArnsCommand */ -const de_EnableDirectoryCommandError = async ( +export const de_ListManagedSchemaArnsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryDeletedException": - case "com.amazonaws.clouddirectory#DirectoryDeletedException": - throw await de_DirectoryDeletedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + SchemaArns: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetAppliedSchemaVersionCommand + * deserializeAws_restJson1ListObjectAttributesCommand */ -export const de_GetAppliedSchemaVersionCommand = async ( +export const de_ListObjectAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAppliedSchemaVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AppliedSchemaArn: __expectString, + Attributes: (_) => de_AttributeKeyAndValueList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetAppliedSchemaVersionCommandError + * deserializeAws_restJson1ListObjectChildrenCommand */ -const de_GetAppliedSchemaVersionCommandError = async ( +export const de_ListObjectChildrenCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Children: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetDirectoryCommand + * deserializeAws_restJson1ListObjectParentPathsCommand */ -export const de_GetDirectoryCommand = async ( +export const de_ListObjectParentPathsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDirectoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Directory: (_) => de_Directory(_, context), + NextToken: __expectString, + PathToObjectIdentifiersList: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetDirectoryCommandError + * deserializeAws_restJson1ListObjectParentsCommand */ -const de_GetDirectoryCommandError = async ( +export const de_ListObjectParentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFacetCommand - */ -export const de_GetFacetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFacetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Facet: _json, + NextToken: __expectString, + ParentLinks: _json, + Parents: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetFacetCommandError - */ -const de_GetFacetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "FacetNotFoundException": - case "com.amazonaws.clouddirectory#FacetNotFoundException": - throw await de_FacetNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetLinkAttributesCommand + * deserializeAws_restJson1ListObjectPoliciesCommand */ -export const de_GetLinkAttributesCommand = async ( +export const de_ListObjectPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLinkAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Attributes: (_) => de_AttributeKeyAndValueList(_, context), + AttachedPolicyIds: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetLinkAttributesCommandError + * deserializeAws_restJson1ListOutgoingTypedLinksCommand */ -const de_GetLinkAttributesCommandError = async ( +export const de_ListOutgoingTypedLinksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + TypedLinkSpecifiers: (_) => de_TypedLinkSpecifierList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetObjectAttributesCommand + * deserializeAws_restJson1ListPolicyAttachmentsCommand */ -export const de_GetObjectAttributesCommand = async ( +export const de_ListPolicyAttachmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetObjectAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Attributes: (_) => de_AttributeKeyAndValueList(_, context), + NextToken: __expectString, + ObjectIdentifiers: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetObjectAttributesCommandError + * deserializeAws_restJson1ListPublishedSchemaArnsCommand */ -const de_GetObjectAttributesCommandError = async ( +export const de_ListPublishedSchemaArnsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + SchemaArns: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetObjectInformationCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_GetObjectInformationCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetObjectInformationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ObjectIdentifier: __expectString, - SchemaFacets: _json, + NextToken: __expectString, + Tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetObjectInformationCommandError + * deserializeAws_restJson1ListTypedLinkFacetAttributesCommand */ -const de_GetObjectInformationCommandError = async ( +export const de_ListTypedLinkFacetAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Attributes: (_) => de_TypedLinkAttributeDefinitionList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetSchemaAsJsonCommand + * deserializeAws_restJson1ListTypedLinkFacetNamesCommand */ -export const de_GetSchemaAsJsonCommand = async ( +export const de_ListTypedLinkFacetNamesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSchemaAsJsonCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Document: __expectString, - Name: __expectString, + FacetNames: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetSchemaAsJsonCommandError - */ -const de_GetSchemaAsJsonCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetTypedLinkFacetInformationCommand + * deserializeAws_restJson1LookupPolicyCommand */ -export const de_GetTypedLinkFacetInformationCommand = async ( +export const de_LookupPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTypedLinkFacetInformationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - IdentityAttributeOrder: _json, + NextToken: __expectString, + PolicyToPathList: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetTypedLinkFacetInformationCommandError + * deserializeAws_restJson1PublishSchemaCommand */ -const de_GetTypedLinkFacetInformationCommandError = async ( +export const de_PublishSchemaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "FacetNotFoundException": - case "com.amazonaws.clouddirectory#FacetNotFoundException": - throw await de_FacetNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PublishedSchemaArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListAppliedSchemaArnsCommand + * deserializeAws_restJson1PutSchemaFromJsonCommand */ -export const de_ListAppliedSchemaArnsCommand = async ( +export const de_PutSchemaFromJsonCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppliedSchemaArnsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - SchemaArns: _json, + Arn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAppliedSchemaArnsCommandError + * deserializeAws_restJson1RemoveFacetFromObjectCommand */ -const de_ListAppliedSchemaArnsCommandError = async ( +export const de_RemoveFacetFromObjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListAttachedIndicesCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_ListAttachedIndicesCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAttachedIndicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - IndexAttachments: (_) => de_IndexAttachmentList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListAttachedIndicesCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_ListAttachedIndicesCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListDevelopmentSchemaArnsCommand + * deserializeAws_restJson1UpdateFacetCommand */ -export const de_ListDevelopmentSchemaArnsCommand = async ( +export const de_UpdateFacetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDevelopmentSchemaArnsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - SchemaArns: _json, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListDevelopmentSchemaArnsCommandError + * deserializeAws_restJson1UpdateLinkAttributesCommand */ -const de_ListDevelopmentSchemaArnsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDirectoriesCommand - */ -export const de_ListDirectoriesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDirectoriesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Directories: (_) => de_DirectoryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDirectoriesCommandError - */ -const de_ListDirectoriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListFacetAttributesCommand - */ -export const de_ListFacetAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFacetAttributesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Attributes: (_) => de_FacetAttributeList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListFacetAttributesCommandError - */ -const de_ListFacetAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "FacetNotFoundException": - case "com.amazonaws.clouddirectory#FacetNotFoundException": - throw await de_FacetNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListFacetNamesCommand - */ -export const de_ListFacetNamesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFacetNamesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - FacetNames: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListFacetNamesCommandError - */ -const de_ListFacetNamesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListIncomingTypedLinksCommand - */ -export const de_ListIncomingTypedLinksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIncomingTypedLinksCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LinkSpecifiers: (_) => de_TypedLinkSpecifierList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListIncomingTypedLinksCommandError - */ -const de_ListIncomingTypedLinksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListIndexCommand - */ -export const de_ListIndexCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIndexCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - IndexAttachments: (_) => de_IndexAttachmentList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListIndexCommandError - */ -const de_ListIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotIndexException": - case "com.amazonaws.clouddirectory#NotIndexException": - throw await de_NotIndexExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListManagedSchemaArnsCommand - */ -export const de_ListManagedSchemaArnsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListManagedSchemaArnsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - SchemaArns: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListManagedSchemaArnsCommandError - */ -const de_ListManagedSchemaArnsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListObjectAttributesCommand - */ -export const de_ListObjectAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListObjectAttributesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Attributes: (_) => de_AttributeKeyAndValueList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListObjectAttributesCommandError - */ -const de_ListObjectAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListObjectChildrenCommand - */ -export const de_ListObjectChildrenCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListObjectChildrenCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Children: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListObjectChildrenCommandError - */ -const de_ListObjectChildrenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotNodeException": - case "com.amazonaws.clouddirectory#NotNodeException": - throw await de_NotNodeExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListObjectParentPathsCommand - */ -export const de_ListObjectParentPathsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListObjectParentPathsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - PathToObjectIdentifiersList: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListObjectParentPathsCommandError - */ -const de_ListObjectParentPathsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListObjectParentsCommand - */ -export const de_ListObjectParentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListObjectParentsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - ParentLinks: _json, - Parents: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListObjectParentsCommandError - */ -const de_ListObjectParentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "CannotListParentOfRootException": - case "com.amazonaws.clouddirectory#CannotListParentOfRootException": - throw await de_CannotListParentOfRootExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListObjectPoliciesCommand - */ -export const de_ListObjectPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListObjectPoliciesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AttachedPolicyIds: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListObjectPoliciesCommandError - */ -const de_ListObjectPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListOutgoingTypedLinksCommand - */ -export const de_ListOutgoingTypedLinksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOutgoingTypedLinksCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - TypedLinkSpecifiers: (_) => de_TypedLinkSpecifierList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListOutgoingTypedLinksCommandError - */ -const de_ListOutgoingTypedLinksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPolicyAttachmentsCommand - */ -export const de_ListPolicyAttachmentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPolicyAttachmentsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - ObjectIdentifiers: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPolicyAttachmentsCommandError - */ -const de_ListPolicyAttachmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotPolicyException": - case "com.amazonaws.clouddirectory#NotPolicyException": - throw await de_NotPolicyExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPublishedSchemaArnsCommand - */ -export const de_ListPublishedSchemaArnsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPublishedSchemaArnsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - SchemaArns: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPublishedSchemaArnsCommandError - */ -const de_ListPublishedSchemaArnsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidTaggingRequestException": - case "com.amazonaws.clouddirectory#InvalidTaggingRequestException": - throw await de_InvalidTaggingRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTypedLinkFacetAttributesCommand - */ -export const de_ListTypedLinkFacetAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTypedLinkFacetAttributesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Attributes: (_) => de_TypedLinkAttributeDefinitionList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTypedLinkFacetAttributesCommandError - */ -const de_ListTypedLinkFacetAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "FacetNotFoundException": - case "com.amazonaws.clouddirectory#FacetNotFoundException": - throw await de_FacetNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTypedLinkFacetNamesCommand - */ -export const de_ListTypedLinkFacetNamesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTypedLinkFacetNamesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - FacetNames: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTypedLinkFacetNamesCommandError - */ -const de_ListTypedLinkFacetNamesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1LookupPolicyCommand - */ -export const de_LookupPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_LookupPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - PolicyToPathList: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1LookupPolicyCommandError - */ -const de_LookupPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.clouddirectory#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PublishSchemaCommand - */ -export const de_PublishSchemaCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PublishSchemaCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - PublishedSchemaArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PublishSchemaCommandError - */ -const de_PublishSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "SchemaAlreadyPublishedException": - case "com.amazonaws.clouddirectory#SchemaAlreadyPublishedException": - throw await de_SchemaAlreadyPublishedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutSchemaFromJsonCommand - */ -export const de_PutSchemaFromJsonCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutSchemaFromJsonCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutSchemaFromJsonCommandError - */ -const de_PutSchemaFromJsonCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidRuleException": - case "com.amazonaws.clouddirectory#InvalidRuleException": - throw await de_InvalidRuleExceptionRes(parsedOutput, context); - case "InvalidSchemaDocException": - case "com.amazonaws.clouddirectory#InvalidSchemaDocException": - throw await de_InvalidSchemaDocExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RemoveFacetFromObjectCommand - */ -export const de_RemoveFacetFromObjectCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveFacetFromObjectCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1RemoveFacetFromObjectCommandError - */ -const de_RemoveFacetFromObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidTaggingRequestException": - case "com.amazonaws.clouddirectory#InvalidTaggingRequestException": - throw await de_InvalidTaggingRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UntagResourceCommand - */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidTaggingRequestException": - case "com.amazonaws.clouddirectory#InvalidTaggingRequestException": - throw await de_InvalidTaggingRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateFacetCommand - */ -export const de_UpdateFacetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFacetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateFacetCommandError - */ -const de_UpdateFacetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "FacetNotFoundException": - case "com.amazonaws.clouddirectory#FacetNotFoundException": - throw await de_FacetNotFoundExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidFacetUpdateException": - case "com.amazonaws.clouddirectory#InvalidFacetUpdateException": - throw await de_InvalidFacetUpdateExceptionRes(parsedOutput, context); - case "InvalidRuleException": - case "com.amazonaws.clouddirectory#InvalidRuleException": - throw await de_InvalidRuleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateLinkAttributesCommand - */ -export const de_UpdateLinkAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLinkAttributesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateLinkAttributesCommandError - */ -const de_UpdateLinkAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateObjectAttributesCommand - */ -export const de_UpdateObjectAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateObjectAttributesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ObjectIdentifier: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateObjectAttributesCommandError - */ -const de_UpdateObjectAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DirectoryNotEnabledException": - case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": - throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "LinkNameAlreadyInUseException": - case "com.amazonaws.clouddirectory#LinkNameAlreadyInUseException": - throw await de_LinkNameAlreadyInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_UpdateLinkAttributesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateSchemaCommand + * deserializeAws_restJson1UpdateObjectAttributesCommand */ -export const de_UpdateSchemaCommand = async ( +export const de_UpdateObjectAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSchemaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SchemaArn: __expectString, + ObjectIdentifier: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateSchemaCommandError + * deserializeAws_restJson1UpdateSchemaCommand */ -const de_UpdateSchemaCommandError = async ( +export const de_UpdateSchemaCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SchemaArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -6258,7 +3147,7 @@ export const de_UpdateTypedLinkFacetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTypedLinkFacetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6267,62 +3156,6 @@ export const de_UpdateTypedLinkFacetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateTypedLinkFacetCommandError - */ -const de_UpdateTypedLinkFacetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "FacetNotFoundException": - case "com.amazonaws.clouddirectory#FacetNotFoundException": - throw await de_FacetNotFoundExceptionRes(parsedOutput, context); - case "FacetValidationException": - case "com.amazonaws.clouddirectory#FacetValidationException": - throw await de_FacetValidationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidFacetUpdateException": - case "com.amazonaws.clouddirectory#InvalidFacetUpdateException": - throw await de_InvalidFacetUpdateExceptionRes(parsedOutput, context); - case "InvalidRuleException": - case "com.amazonaws.clouddirectory#InvalidRuleException": - throw await de_InvalidRuleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.clouddirectory#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpgradeAppliedSchemaCommand */ @@ -6331,7 +3164,7 @@ export const de_UpgradeAppliedSchemaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpgradeAppliedSchemaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6345,56 +3178,6 @@ export const de_UpgradeAppliedSchemaCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpgradeAppliedSchemaCommandError - */ -const de_UpgradeAppliedSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.clouddirectory#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleSchemaException": - case "com.amazonaws.clouddirectory#IncompatibleSchemaException": - throw await de_IncompatibleSchemaExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.clouddirectory#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.clouddirectory#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidAttachmentException": - case "com.amazonaws.clouddirectory#InvalidAttachmentException": - throw await de_InvalidAttachmentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.clouddirectory#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryableConflictException": - case "com.amazonaws.clouddirectory#RetryableConflictException": - throw await de_RetryableConflictExceptionRes(parsedOutput, context); - case "SchemaAlreadyExistsException": - case "com.amazonaws.clouddirectory#SchemaAlreadyExistsException": - throw await de_SchemaAlreadyExistsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.clouddirectory#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpgradePublishedSchemaCommand */ @@ -6403,7 +3186,7 @@ export const de_UpgradePublishedSchemaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpgradePublishedSchemaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6417,12 +3200,9 @@ export const de_UpgradePublishedSchemaCommand = async ( }; /** - * deserializeAws_restJson1UpgradePublishedSchemaCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpgradePublishedSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -6432,18 +3212,18 @@ const de_UpgradePublishedSchemaCommandError = async ( case "AccessDeniedException": case "com.amazonaws.clouddirectory#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleSchemaException": - case "com.amazonaws.clouddirectory#IncompatibleSchemaException": - throw await de_IncompatibleSchemaExceptionRes(parsedOutput, context); + case "DirectoryNotEnabledException": + case "com.amazonaws.clouddirectory#DirectoryNotEnabledException": + throw await de_DirectoryNotEnabledExceptionRes(parsedOutput, context); + case "FacetValidationException": + case "com.amazonaws.clouddirectory#FacetValidationException": + throw await de_FacetValidationExceptionRes(parsedOutput, context); case "InternalServiceException": case "com.amazonaws.clouddirectory#InternalServiceException": throw await de_InternalServiceExceptionRes(parsedOutput, context); case "InvalidArnException": case "com.amazonaws.clouddirectory#InvalidArnException": throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidAttachmentException": - case "com.amazonaws.clouddirectory#InvalidAttachmentException": - throw await de_InvalidAttachmentExceptionRes(parsedOutput, context); case "LimitExceededException": case "com.amazonaws.clouddirectory#LimitExceededException": throw await de_LimitExceededExceptionRes(parsedOutput, context); @@ -6456,13 +3236,91 @@ const de_UpgradePublishedSchemaCommandError = async ( case "ValidationException": case "com.amazonaws.clouddirectory#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "InvalidAttachmentException": + case "com.amazonaws.clouddirectory#InvalidAttachmentException": + throw await de_InvalidAttachmentExceptionRes(parsedOutput, context); + case "SchemaAlreadyExistsException": + case "com.amazonaws.clouddirectory#SchemaAlreadyExistsException": + throw await de_SchemaAlreadyExistsExceptionRes(parsedOutput, context); + case "LinkNameAlreadyInUseException": + case "com.amazonaws.clouddirectory#LinkNameAlreadyInUseException": + throw await de_LinkNameAlreadyInUseExceptionRes(parsedOutput, context); + case "NotPolicyException": + case "com.amazonaws.clouddirectory#NotPolicyException": + throw await de_NotPolicyExceptionRes(parsedOutput, context); + case "IndexedAttributeMissingException": + case "com.amazonaws.clouddirectory#IndexedAttributeMissingException": + throw await de_IndexedAttributeMissingExceptionRes(parsedOutput, context); + case "NotIndexException": + case "com.amazonaws.clouddirectory#NotIndexException": + throw await de_NotIndexExceptionRes(parsedOutput, context); + case "BatchWriteException": + case "com.amazonaws.clouddirectory#BatchWriteException": + throw await de_BatchWriteExceptionRes(parsedOutput, context); + case "DirectoryAlreadyExistsException": + case "com.amazonaws.clouddirectory#DirectoryAlreadyExistsException": + throw await de_DirectoryAlreadyExistsExceptionRes(parsedOutput, context); + case "FacetAlreadyExistsException": + case "com.amazonaws.clouddirectory#FacetAlreadyExistsException": + throw await de_FacetAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidRuleException": + case "com.amazonaws.clouddirectory#InvalidRuleException": + throw await de_InvalidRuleExceptionRes(parsedOutput, context); + case "UnsupportedIndexTypeException": + case "com.amazonaws.clouddirectory#UnsupportedIndexTypeException": + throw await de_UnsupportedIndexTypeExceptionRes(parsedOutput, context); + case "DirectoryDeletedException": + case "com.amazonaws.clouddirectory#DirectoryDeletedException": + throw await de_DirectoryDeletedExceptionRes(parsedOutput, context); + case "DirectoryNotDisabledException": + case "com.amazonaws.clouddirectory#DirectoryNotDisabledException": + throw await de_DirectoryNotDisabledExceptionRes(parsedOutput, context); + case "FacetInUseException": + case "com.amazonaws.clouddirectory#FacetInUseException": + throw await de_FacetInUseExceptionRes(parsedOutput, context); + case "FacetNotFoundException": + case "com.amazonaws.clouddirectory#FacetNotFoundException": + throw await de_FacetNotFoundExceptionRes(parsedOutput, context); + case "ObjectNotDetachedException": + case "com.amazonaws.clouddirectory#ObjectNotDetachedException": + throw await de_ObjectNotDetachedExceptionRes(parsedOutput, context); + case "StillContainsLinksException": + case "com.amazonaws.clouddirectory#StillContainsLinksException": + throw await de_StillContainsLinksExceptionRes(parsedOutput, context); + case "ObjectAlreadyDetachedException": + case "com.amazonaws.clouddirectory#ObjectAlreadyDetachedException": + throw await de_ObjectAlreadyDetachedExceptionRes(parsedOutput, context); + case "NotNodeException": + case "com.amazonaws.clouddirectory#NotNodeException": + throw await de_NotNodeExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.clouddirectory#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "CannotListParentOfRootException": + case "com.amazonaws.clouddirectory#CannotListParentOfRootException": + throw await de_CannotListParentOfRootExceptionRes(parsedOutput, context); + case "InvalidTaggingRequestException": + case "com.amazonaws.clouddirectory#InvalidTaggingRequestException": + throw await de_InvalidTaggingRequestExceptionRes(parsedOutput, context); + case "SchemaAlreadyPublishedException": + case "com.amazonaws.clouddirectory#SchemaAlreadyPublishedException": + throw await de_SchemaAlreadyPublishedExceptionRes(parsedOutput, context); + case "InvalidSchemaDocException": + case "com.amazonaws.clouddirectory#InvalidSchemaDocException": + throw await de_InvalidSchemaDocExceptionRes(parsedOutput, context); + case "InvalidFacetUpdateException": + case "com.amazonaws.clouddirectory#InvalidFacetUpdateException": + throw await de_InvalidFacetUpdateExceptionRes(parsedOutput, context); + case "IncompatibleSchemaException": + case "com.amazonaws.clouddirectory#IncompatibleSchemaException": + throw await de_IncompatibleSchemaExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cloudformation/src/protocols/Aws_query.ts b/clients/client-cloudformation/src/protocols/Aws_query.ts index bced6c282e81..17b11cdc4841 100644 --- a/clients/client-cloudformation/src/protocols/Aws_query.ts +++ b/clients/client-cloudformation/src/protocols/Aws_query.ts @@ -1876,7 +1876,7 @@ export const de_ActivateOrganizationsAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ActivateOrganizationsAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1888,35 +1888,6 @@ export const de_ActivateOrganizationsAccessCommand = async ( return response; }; -/** - * deserializeAws_queryActivateOrganizationsAccessCommandError - */ -const de_ActivateOrganizationsAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidOperationException": - case "com.amazonaws.cloudformation#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "OperationNotFoundException": - case "com.amazonaws.cloudformation#OperationNotFoundException": - throw await de_OperationNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryActivateTypeCommand */ @@ -1925,7 +1896,7 @@ export const de_ActivateTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ActivateTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1937,35 +1908,6 @@ export const de_ActivateTypeCommand = async ( return response; }; -/** - * deserializeAws_queryActivateTypeCommandError - */ -const de_ActivateTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - case "TypeNotFoundException": - case "com.amazonaws.cloudformation#TypeNotFoundException": - throw await de_TypeNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryBatchDescribeTypeConfigurationsCommand */ @@ -1974,7 +1916,7 @@ export const de_BatchDescribeTypeConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDescribeTypeConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1986,35 +1928,6 @@ export const de_BatchDescribeTypeConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_queryBatchDescribeTypeConfigurationsCommandError - */ -const de_BatchDescribeTypeConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - case "TypeConfigurationNotFoundException": - case "com.amazonaws.cloudformation#TypeConfigurationNotFoundException": - throw await de_TypeConfigurationNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCancelUpdateStackCommand */ @@ -2023,7 +1936,7 @@ export const de_CancelUpdateStackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelUpdateStackCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CancelUpdateStackCommandOutput = { @@ -2032,32 +1945,6 @@ export const de_CancelUpdateStackCommand = async ( return response; }; -/** - * deserializeAws_queryCancelUpdateStackCommandError - */ -const de_CancelUpdateStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "TokenAlreadyExistsException": - case "com.amazonaws.cloudformation#TokenAlreadyExistsException": - throw await de_TokenAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryContinueUpdateRollbackCommand */ @@ -2066,7 +1953,7 @@ export const de_ContinueUpdateRollbackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ContinueUpdateRollbackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2078,32 +1965,6 @@ export const de_ContinueUpdateRollbackCommand = async ( return response; }; -/** - * deserializeAws_queryContinueUpdateRollbackCommandError - */ -const de_ContinueUpdateRollbackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "TokenAlreadyExistsException": - case "com.amazonaws.cloudformation#TokenAlreadyExistsException": - throw await de_TokenAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateChangeSetCommand */ @@ -2112,7 +1973,7 @@ export const de_CreateChangeSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateChangeSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2124,38 +1985,6 @@ export const de_CreateChangeSetCommand = async ( return response; }; -/** - * deserializeAws_queryCreateChangeSetCommandError - */ -const de_CreateChangeSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.cloudformation#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InsufficientCapabilitiesException": - case "com.amazonaws.cloudformation#InsufficientCapabilitiesException": - throw await de_InsufficientCapabilitiesExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudformation#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateGeneratedTemplateCommand */ @@ -2164,7 +1993,7 @@ export const de_CreateGeneratedTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateGeneratedTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2177,51 +2006,39 @@ export const de_CreateGeneratedTemplateCommand = async ( }; /** - * deserializeAws_queryCreateGeneratedTemplateCommandError + * deserializeAws_queryCreateStackCommand */ -const de_CreateGeneratedTemplateCommandError = async ( +export const de_CreateStackCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.cloudformation#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ConcurrentResourcesLimitExceeded": - case "com.amazonaws.cloudformation#ConcurrentResourcesLimitExceededException": - throw await de_ConcurrentResourcesLimitExceededExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudformation#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateStackOutput(data.CreateStackResult, context); + const response: CreateStackCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateStackCommand + * deserializeAws_queryCreateStackInstancesCommand */ -export const de_CreateStackCommand = async ( +export const de_CreateStackInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateStackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateStackOutput(data.CreateStackResult, context); - const response: CreateStackCommandOutput = { + contents = de_CreateStackInstancesOutput(data.CreateStackInstancesResult, context); + const response: CreateStackInstancesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2229,54 +2046,39 @@ export const de_CreateStackCommand = async ( }; /** - * deserializeAws_queryCreateStackCommandError + * deserializeAws_queryCreateStackSetCommand */ -const de_CreateStackCommandError = async ( +export const de_CreateStackSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.cloudformation#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InsufficientCapabilitiesException": - case "com.amazonaws.cloudformation#InsufficientCapabilitiesException": - throw await de_InsufficientCapabilitiesExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudformation#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TokenAlreadyExistsException": - case "com.amazonaws.cloudformation#TokenAlreadyExistsException": - throw await de_TokenAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateStackSetOutput(data.CreateStackSetResult, context); + const response: CreateStackSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateStackInstancesCommand + * deserializeAws_queryDeactivateOrganizationsAccessCommand */ -export const de_CreateStackInstancesCommand = async ( +export const de_DeactivateOrganizationsAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateStackInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateStackInstancesOutput(data.CreateStackInstancesResult, context); - const response: CreateStackInstancesCommandOutput = { + contents = de_DeactivateOrganizationsAccessOutput(data.DeactivateOrganizationsAccessResult, context); + const response: DeactivateOrganizationsAccessCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2284,156 +2086,14 @@ export const de_CreateStackInstancesCommand = async ( }; /** - * deserializeAws_queryCreateStackInstancesCommandError + * deserializeAws_queryDeactivateTypeCommand */ -const de_CreateStackInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidOperationException": - case "com.amazonaws.cloudformation#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudformation#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationIdAlreadyExistsException": - case "com.amazonaws.cloudformation#OperationIdAlreadyExistsException": - throw await de_OperationIdAlreadyExistsExceptionRes(parsedOutput, context); - case "OperationInProgressException": - case "com.amazonaws.cloudformation#OperationInProgressException": - throw await de_OperationInProgressExceptionRes(parsedOutput, context); - case "StackSetNotFoundException": - case "com.amazonaws.cloudformation#StackSetNotFoundException": - throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); - case "StaleRequestException": - case "com.amazonaws.cloudformation#StaleRequestException": - throw await de_StaleRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryCreateStackSetCommand - */ -export const de_CreateStackSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateStackSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateStackSetOutput(data.CreateStackSetResult, context); - const response: CreateStackSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryCreateStackSetCommandError - */ -const de_CreateStackSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CreatedButModifiedException": - case "com.amazonaws.cloudformation#CreatedButModifiedException": - throw await de_CreatedButModifiedExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudformation#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NameAlreadyExistsException": - case "com.amazonaws.cloudformation#NameAlreadyExistsException": - throw await de_NameAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeactivateOrganizationsAccessCommand - */ -export const de_DeactivateOrganizationsAccessCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeactivateOrganizationsAccessCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeactivateOrganizationsAccessOutput(data.DeactivateOrganizationsAccessResult, context); - const response: DeactivateOrganizationsAccessCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDeactivateOrganizationsAccessCommandError - */ -const de_DeactivateOrganizationsAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidOperationException": - case "com.amazonaws.cloudformation#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "OperationNotFoundException": - case "com.amazonaws.cloudformation#OperationNotFoundException": - throw await de_OperationNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeactivateTypeCommand - */ -export const de_DeactivateTypeCommand = async ( +export const de_DeactivateTypeCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeactivateTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2445,35 +2105,6 @@ export const de_DeactivateTypeCommand = async ( return response; }; -/** - * deserializeAws_queryDeactivateTypeCommandError - */ -const de_DeactivateTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - case "TypeNotFoundException": - case "com.amazonaws.cloudformation#TypeNotFoundException": - throw await de_TypeNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteChangeSetCommand */ @@ -2482,7 +2113,7 @@ export const de_DeleteChangeSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteChangeSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2494,32 +2125,6 @@ export const de_DeleteChangeSetCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteChangeSetCommandError - */ -const de_DeleteChangeSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidChangeSetStatus": - case "com.amazonaws.cloudformation#InvalidChangeSetStatusException": - throw await de_InvalidChangeSetStatusExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteGeneratedTemplateCommand */ @@ -2528,7 +2133,7 @@ export const de_DeleteGeneratedTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteGeneratedTemplateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteGeneratedTemplateCommandOutput = { @@ -2537,35 +2142,6 @@ export const de_DeleteGeneratedTemplateCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteGeneratedTemplateCommandError - */ -const de_DeleteGeneratedTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentResourcesLimitExceeded": - case "com.amazonaws.cloudformation#ConcurrentResourcesLimitExceededException": - throw await de_ConcurrentResourcesLimitExceededExceptionRes(parsedOutput, context); - case "GeneratedTemplateNotFound": - case "com.amazonaws.cloudformation#GeneratedTemplateNotFoundException": - throw await de_GeneratedTemplateNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteStackCommand */ @@ -2574,7 +2150,7 @@ export const de_DeleteStackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteStackCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteStackCommandOutput = { @@ -2583,32 +2159,6 @@ export const de_DeleteStackCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteStackCommandError - */ -const de_DeleteStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "TokenAlreadyExistsException": - case "com.amazonaws.cloudformation#TokenAlreadyExistsException": - throw await de_TokenAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteStackInstancesCommand */ @@ -2617,7 +2167,7 @@ export const de_DeleteStackInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteStackInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2629,44 +2179,6 @@ export const de_DeleteStackInstancesCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteStackInstancesCommandError - */ -const de_DeleteStackInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidOperationException": - case "com.amazonaws.cloudformation#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "OperationIdAlreadyExistsException": - case "com.amazonaws.cloudformation#OperationIdAlreadyExistsException": - throw await de_OperationIdAlreadyExistsExceptionRes(parsedOutput, context); - case "OperationInProgressException": - case "com.amazonaws.cloudformation#OperationInProgressException": - throw await de_OperationInProgressExceptionRes(parsedOutput, context); - case "StackSetNotFoundException": - case "com.amazonaws.cloudformation#StackSetNotFoundException": - throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); - case "StaleRequestException": - case "com.amazonaws.cloudformation#StaleRequestException": - throw await de_StaleRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteStackSetCommand */ @@ -2675,7 +2187,7 @@ export const de_DeleteStackSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteStackSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2687,35 +2199,6 @@ export const de_DeleteStackSetCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteStackSetCommandError - */ -const de_DeleteStackSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationInProgressException": - case "com.amazonaws.cloudformation#OperationInProgressException": - throw await de_OperationInProgressExceptionRes(parsedOutput, context); - case "StackSetNotEmptyException": - case "com.amazonaws.cloudformation#StackSetNotEmptyException": - throw await de_StackSetNotEmptyExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeregisterTypeCommand */ @@ -2724,7 +2207,7 @@ export const de_DeregisterTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2736,35 +2219,6 @@ export const de_DeregisterTypeCommand = async ( return response; }; -/** - * deserializeAws_queryDeregisterTypeCommandError - */ -const de_DeregisterTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - case "TypeNotFoundException": - case "com.amazonaws.cloudformation#TypeNotFoundException": - throw await de_TypeNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeAccountLimitsCommand */ @@ -2773,7 +2227,7 @@ export const de_DescribeAccountLimitsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAccountLimitsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2785,26 +2239,6 @@ export const de_DescribeAccountLimitsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeAccountLimitsCommandError - */ -const de_DescribeAccountLimitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeChangeSetCommand */ @@ -2813,104 +2247,32 @@ export const de_DescribeChangeSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeChangeSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_DescribeChangeSetOutput(data.DescribeChangeSetResult, context); const response: DescribeChangeSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeChangeSetCommandError - */ -const de_DescribeChangeSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ChangeSetNotFound": - case "com.amazonaws.cloudformation#ChangeSetNotFoundException": - throw await de_ChangeSetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeChangeSetHooksCommand - */ -export const de_DescribeChangeSetHooksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeChangeSetHooksCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeChangeSetHooksOutput(data.DescribeChangeSetHooksResult, context); - const response: DescribeChangeSetHooksCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeChangeSetHooksCommandError - */ -const de_DescribeChangeSetHooksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ChangeSetNotFound": - case "com.amazonaws.cloudformation#ChangeSetNotFoundException": - throw await de_ChangeSetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeGeneratedTemplateCommand + * deserializeAws_queryDescribeChangeSetHooksCommand */ -export const de_DescribeGeneratedTemplateCommand = async ( +export const de_DescribeChangeSetHooksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeGeneratedTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeGeneratedTemplateOutput(data.DescribeGeneratedTemplateResult, context); - const response: DescribeGeneratedTemplateCommandOutput = { + contents = de_DescribeChangeSetHooksOutput(data.DescribeChangeSetHooksResult, context); + const response: DescribeChangeSetHooksCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2918,29 +2280,23 @@ export const de_DescribeGeneratedTemplateCommand = async ( }; /** - * deserializeAws_queryDescribeGeneratedTemplateCommandError + * deserializeAws_queryDescribeGeneratedTemplateCommand */ -const de_DescribeGeneratedTemplateCommandError = async ( +export const de_DescribeGeneratedTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GeneratedTemplateNotFound": - case "com.amazonaws.cloudformation#GeneratedTemplateNotFoundException": - throw await de_GeneratedTemplateNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeGeneratedTemplateOutput(data.DescribeGeneratedTemplateResult, context); + const response: DescribeGeneratedTemplateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2951,7 +2307,7 @@ export const de_DescribeOrganizationsAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeOrganizationsAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2963,35 +2319,6 @@ export const de_DescribeOrganizationsAccessCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeOrganizationsAccessCommandError - */ -const de_DescribeOrganizationsAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidOperationException": - case "com.amazonaws.cloudformation#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "OperationNotFoundException": - case "com.amazonaws.cloudformation#OperationNotFoundException": - throw await de_OperationNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribePublisherCommand */ @@ -3000,7 +2327,7 @@ export const de_DescribePublisherCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePublisherCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3012,32 +2339,6 @@ export const de_DescribePublisherCommand = async ( return response; }; -/** - * deserializeAws_queryDescribePublisherCommandError - */ -const de_DescribePublisherCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeResourceScanCommand */ @@ -3046,7 +2347,7 @@ export const de_DescribeResourceScanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeResourceScanCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3058,32 +2359,6 @@ export const de_DescribeResourceScanCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeResourceScanCommandError - */ -const de_DescribeResourceScanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceScanNotFound": - case "com.amazonaws.cloudformation#ResourceScanNotFoundException": - throw await de_ResourceScanNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeStackDriftDetectionStatusCommand */ @@ -3092,7 +2367,7 @@ export const de_DescribeStackDriftDetectionStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStackDriftDetectionStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3104,26 +2379,6 @@ export const de_DescribeStackDriftDetectionStatusCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeStackDriftDetectionStatusCommandError - */ -const de_DescribeStackDriftDetectionStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeStackEventsCommand */ @@ -3132,7 +2387,7 @@ export const de_DescribeStackEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStackEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3144,26 +2399,6 @@ export const de_DescribeStackEventsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeStackEventsCommandError - */ -const de_DescribeStackEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeStackInstanceCommand */ @@ -3172,7 +2407,7 @@ export const de_DescribeStackInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStackInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3184,35 +2419,6 @@ export const de_DescribeStackInstanceCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeStackInstanceCommandError - */ -const de_DescribeStackInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "StackInstanceNotFoundException": - case "com.amazonaws.cloudformation#StackInstanceNotFoundException": - throw await de_StackInstanceNotFoundExceptionRes(parsedOutput, context); - case "StackSetNotFoundException": - case "com.amazonaws.cloudformation#StackSetNotFoundException": - throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeStackResourceCommand */ @@ -3221,7 +2427,7 @@ export const de_DescribeStackResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStackResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3233,26 +2439,6 @@ export const de_DescribeStackResourceCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeStackResourceCommandError - */ -const de_DescribeStackResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeStackResourceDriftsCommand */ @@ -3261,7 +2447,7 @@ export const de_DescribeStackResourceDriftsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStackResourceDriftsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3273,26 +2459,6 @@ export const de_DescribeStackResourceDriftsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeStackResourceDriftsCommandError - */ -const de_DescribeStackResourceDriftsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeStackResourcesCommand */ @@ -3301,7 +2467,7 @@ export const de_DescribeStackResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStackResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3313,26 +2479,6 @@ export const de_DescribeStackResourcesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeStackResourcesCommandError - */ -const de_DescribeStackResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeStacksCommand */ @@ -3341,7 +2487,7 @@ export const de_DescribeStacksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStacksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3353,70 +2499,24 @@ export const de_DescribeStacksCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeStacksCommandError - */ -const de_DescribeStacksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeStackSetCommand */ export const de_DescribeStackSetCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeStackSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeStackSetOutput(data.DescribeStackSetResult, context); - const response: DescribeStackSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeStackSetCommandError - */ -const de_DescribeStackSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "StackSetNotFoundException": - case "com.amazonaws.cloudformation#StackSetNotFoundException": - throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeStackSetOutput(data.DescribeStackSetResult, context); + const response: DescribeStackSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3427,7 +2527,7 @@ export const de_DescribeStackSetOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStackSetOperationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3439,35 +2539,6 @@ export const de_DescribeStackSetOperationCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeStackSetOperationCommandError - */ -const de_DescribeStackSetOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotFoundException": - case "com.amazonaws.cloudformation#OperationNotFoundException": - throw await de_OperationNotFoundExceptionRes(parsedOutput, context); - case "StackSetNotFoundException": - case "com.amazonaws.cloudformation#StackSetNotFoundException": - throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeTypeCommand */ @@ -3476,7 +2547,7 @@ export const de_DescribeTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3488,35 +2559,6 @@ export const de_DescribeTypeCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeTypeCommandError - */ -const de_DescribeTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - case "TypeNotFoundException": - case "com.amazonaws.cloudformation#TypeNotFoundException": - throw await de_TypeNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeTypeRegistrationCommand */ @@ -3525,7 +2567,7 @@ export const de_DescribeTypeRegistrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTypeRegistrationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3537,32 +2579,6 @@ export const de_DescribeTypeRegistrationCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeTypeRegistrationCommandError - */ -const de_DescribeTypeRegistrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDetectStackDriftCommand */ @@ -3571,7 +2587,7 @@ export const de_DetectStackDriftCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetectStackDriftCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3583,26 +2599,6 @@ export const de_DetectStackDriftCommand = async ( return response; }; -/** - * deserializeAws_queryDetectStackDriftCommandError - */ -const de_DetectStackDriftCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDetectStackResourceDriftCommand */ @@ -3611,7 +2607,7 @@ export const de_DetectStackResourceDriftCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetectStackResourceDriftCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3623,26 +2619,6 @@ export const de_DetectStackResourceDriftCommand = async ( return response; }; -/** - * deserializeAws_queryDetectStackResourceDriftCommandError - */ -const de_DetectStackResourceDriftCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDetectStackSetDriftCommand */ @@ -3651,7 +2627,7 @@ export const de_DetectStackSetDriftCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetectStackSetDriftCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3663,38 +2639,6 @@ export const de_DetectStackSetDriftCommand = async ( return response; }; -/** - * deserializeAws_queryDetectStackSetDriftCommandError - */ -const de_DetectStackSetDriftCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidOperationException": - case "com.amazonaws.cloudformation#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "OperationInProgressException": - case "com.amazonaws.cloudformation#OperationInProgressException": - throw await de_OperationInProgressExceptionRes(parsedOutput, context); - case "StackSetNotFoundException": - case "com.amazonaws.cloudformation#StackSetNotFoundException": - throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryEstimateTemplateCostCommand */ @@ -3703,7 +2647,7 @@ export const de_EstimateTemplateCostCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EstimateTemplateCostCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3715,26 +2659,6 @@ export const de_EstimateTemplateCostCommand = async ( return response; }; -/** - * deserializeAws_queryEstimateTemplateCostCommandError - */ -const de_EstimateTemplateCostCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryExecuteChangeSetCommand */ @@ -3743,7 +2667,7 @@ export const de_ExecuteChangeSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExecuteChangeSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3755,41 +2679,6 @@ export const de_ExecuteChangeSetCommand = async ( return response; }; -/** - * deserializeAws_queryExecuteChangeSetCommandError - */ -const de_ExecuteChangeSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ChangeSetNotFound": - case "com.amazonaws.cloudformation#ChangeSetNotFoundException": - throw await de_ChangeSetNotFoundExceptionRes(parsedOutput, context); - case "InsufficientCapabilitiesException": - case "com.amazonaws.cloudformation#InsufficientCapabilitiesException": - throw await de_InsufficientCapabilitiesExceptionRes(parsedOutput, context); - case "InvalidChangeSetStatus": - case "com.amazonaws.cloudformation#InvalidChangeSetStatusException": - throw await de_InvalidChangeSetStatusExceptionRes(parsedOutput, context); - case "TokenAlreadyExistsException": - case "com.amazonaws.cloudformation#TokenAlreadyExistsException": - throw await de_TokenAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryGetGeneratedTemplateCommand */ @@ -3798,7 +2687,7 @@ export const de_GetGeneratedTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetGeneratedTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3810,32 +2699,6 @@ export const de_GetGeneratedTemplateCommand = async ( return response; }; -/** - * deserializeAws_queryGetGeneratedTemplateCommandError - */ -const de_GetGeneratedTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GeneratedTemplateNotFound": - case "com.amazonaws.cloudformation#GeneratedTemplateNotFoundException": - throw await de_GeneratedTemplateNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryGetStackPolicyCommand */ @@ -3844,7 +2707,7 @@ export const de_GetStackPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetStackPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3856,26 +2719,6 @@ export const de_GetStackPolicyCommand = async ( return response; }; -/** - * deserializeAws_queryGetStackPolicyCommandError - */ -const de_GetStackPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryGetTemplateCommand */ @@ -3884,42 +2727,16 @@ export const de_GetTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_GetTemplateOutput(data.GetTemplateResult, context); const response: GetTemplateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetTemplateCommandError - */ -const de_GetTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ChangeSetNotFound": - case "com.amazonaws.cloudformation#ChangeSetNotFoundException": - throw await de_ChangeSetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3930,7 +2747,7 @@ export const de_GetTemplateSummaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTemplateSummaryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3942,32 +2759,6 @@ export const de_GetTemplateSummaryCommand = async ( return response; }; -/** - * deserializeAws_queryGetTemplateSummaryCommandError - */ -const de_GetTemplateSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "StackSetNotFoundException": - case "com.amazonaws.cloudformation#StackSetNotFoundException": - throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryImportStacksToStackSetCommand */ @@ -3976,7 +2767,7 @@ export const de_ImportStacksToStackSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportStacksToStackSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3988,50 +2779,6 @@ export const de_ImportStacksToStackSetCommand = async ( return response; }; -/** - * deserializeAws_queryImportStacksToStackSetCommandError - */ -const de_ImportStacksToStackSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidOperationException": - case "com.amazonaws.cloudformation#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudformation#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationIdAlreadyExistsException": - case "com.amazonaws.cloudformation#OperationIdAlreadyExistsException": - throw await de_OperationIdAlreadyExistsExceptionRes(parsedOutput, context); - case "OperationInProgressException": - case "com.amazonaws.cloudformation#OperationInProgressException": - throw await de_OperationInProgressExceptionRes(parsedOutput, context); - case "StackNotFoundException": - case "com.amazonaws.cloudformation#StackNotFoundException": - throw await de_StackNotFoundExceptionRes(parsedOutput, context); - case "StackSetNotFoundException": - case "com.amazonaws.cloudformation#StackSetNotFoundException": - throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); - case "StaleRequestException": - case "com.amazonaws.cloudformation#StaleRequestException": - throw await de_StaleRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryListChangeSetsCommand */ @@ -4040,7 +2787,7 @@ export const de_ListChangeSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListChangeSetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4052,26 +2799,6 @@ export const de_ListChangeSetsCommand = async ( return response; }; -/** - * deserializeAws_queryListChangeSetsCommandError - */ -const de_ListChangeSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListExportsCommand */ @@ -4080,7 +2807,7 @@ export const de_ListExportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListExportsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4092,26 +2819,6 @@ export const de_ListExportsCommand = async ( return response; }; -/** - * deserializeAws_queryListExportsCommandError - */ -const de_ListExportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListGeneratedTemplatesCommand */ @@ -4120,7 +2827,7 @@ export const de_ListGeneratedTemplatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListGeneratedTemplatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4132,26 +2839,6 @@ export const de_ListGeneratedTemplatesCommand = async ( return response; }; -/** - * deserializeAws_queryListGeneratedTemplatesCommandError - */ -const de_ListGeneratedTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListImportsCommand */ @@ -4160,7 +2847,7 @@ export const de_ListImportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListImportsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4172,26 +2859,6 @@ export const de_ListImportsCommand = async ( return response; }; -/** - * deserializeAws_queryListImportsCommandError - */ -const de_ListImportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListResourceScanRelatedResourcesCommand */ @@ -4200,7 +2867,7 @@ export const de_ListResourceScanRelatedResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListResourceScanRelatedResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4212,35 +2879,6 @@ export const de_ListResourceScanRelatedResourcesCommand = async ( return response; }; -/** - * deserializeAws_queryListResourceScanRelatedResourcesCommandError - */ -const de_ListResourceScanRelatedResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceScanInProgress": - case "com.amazonaws.cloudformation#ResourceScanInProgressException": - throw await de_ResourceScanInProgressExceptionRes(parsedOutput, context); - case "ResourceScanNotFound": - case "com.amazonaws.cloudformation#ResourceScanNotFoundException": - throw await de_ResourceScanNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryListResourceScanResourcesCommand */ @@ -4249,7 +2887,7 @@ export const de_ListResourceScanResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListResourceScanResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4261,35 +2899,6 @@ export const de_ListResourceScanResourcesCommand = async ( return response; }; -/** - * deserializeAws_queryListResourceScanResourcesCommandError - */ -const de_ListResourceScanResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceScanInProgress": - case "com.amazonaws.cloudformation#ResourceScanInProgressException": - throw await de_ResourceScanInProgressExceptionRes(parsedOutput, context); - case "ResourceScanNotFound": - case "com.amazonaws.cloudformation#ResourceScanNotFoundException": - throw await de_ResourceScanNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryListResourceScansCommand */ @@ -4298,7 +2907,7 @@ export const de_ListResourceScansCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListResourceScansCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4310,26 +2919,6 @@ export const de_ListResourceScansCommand = async ( return response; }; -/** - * deserializeAws_queryListResourceScansCommandError - */ -const de_ListResourceScansCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListStackInstanceResourceDriftsCommand */ @@ -4338,7 +2927,7 @@ export const de_ListStackInstanceResourceDriftsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStackInstanceResourceDriftsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4350,38 +2939,6 @@ export const de_ListStackInstanceResourceDriftsCommand = async ( return response; }; -/** - * deserializeAws_queryListStackInstanceResourceDriftsCommandError - */ -const de_ListStackInstanceResourceDriftsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotFoundException": - case "com.amazonaws.cloudformation#OperationNotFoundException": - throw await de_OperationNotFoundExceptionRes(parsedOutput, context); - case "StackInstanceNotFoundException": - case "com.amazonaws.cloudformation#StackInstanceNotFoundException": - throw await de_StackInstanceNotFoundExceptionRes(parsedOutput, context); - case "StackSetNotFoundException": - case "com.amazonaws.cloudformation#StackSetNotFoundException": - throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryListStackInstancesCommand */ @@ -4390,7 +2947,7 @@ export const de_ListStackInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStackInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4402,32 +2959,6 @@ export const de_ListStackInstancesCommand = async ( return response; }; -/** - * deserializeAws_queryListStackInstancesCommandError - */ -const de_ListStackInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "StackSetNotFoundException": - case "com.amazonaws.cloudformation#StackSetNotFoundException": - throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryListStackResourcesCommand */ @@ -4436,7 +2967,7 @@ export const de_ListStackResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStackResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4448,26 +2979,6 @@ export const de_ListStackResourcesCommand = async ( return response; }; -/** - * deserializeAws_queryListStackResourcesCommandError - */ -const de_ListStackResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListStacksCommand */ @@ -4476,7 +2987,7 @@ export const de_ListStacksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStacksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4488,26 +2999,6 @@ export const de_ListStacksCommand = async ( return response; }; -/** - * deserializeAws_queryListStacksCommandError - */ -const de_ListStacksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListStackSetOperationResultsCommand */ @@ -4516,7 +3007,7 @@ export const de_ListStackSetOperationResultsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStackSetOperationResultsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4528,35 +3019,6 @@ export const de_ListStackSetOperationResultsCommand = async ( return response; }; -/** - * deserializeAws_queryListStackSetOperationResultsCommandError - */ -const de_ListStackSetOperationResultsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotFoundException": - case "com.amazonaws.cloudformation#OperationNotFoundException": - throw await de_OperationNotFoundExceptionRes(parsedOutput, context); - case "StackSetNotFoundException": - case "com.amazonaws.cloudformation#StackSetNotFoundException": - throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryListStackSetOperationsCommand */ @@ -4565,7 +3027,7 @@ export const de_ListStackSetOperationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStackSetOperationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4577,32 +3039,6 @@ export const de_ListStackSetOperationsCommand = async ( return response; }; -/** - * deserializeAws_queryListStackSetOperationsCommandError - */ -const de_ListStackSetOperationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "StackSetNotFoundException": - case "com.amazonaws.cloudformation#StackSetNotFoundException": - throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryListStackSetsCommand */ @@ -4611,7 +3047,7 @@ export const de_ListStackSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStackSetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4623,26 +3059,6 @@ export const de_ListStackSetsCommand = async ( return response; }; -/** - * deserializeAws_queryListStackSetsCommandError - */ -const de_ListStackSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListTypeRegistrationsCommand */ @@ -4651,7 +3067,7 @@ export const de_ListTypeRegistrationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTypeRegistrationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4663,32 +3079,6 @@ export const de_ListTypeRegistrationsCommand = async ( return response; }; -/** - * deserializeAws_queryListTypeRegistrationsCommandError - */ -const de_ListTypeRegistrationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryListTypesCommand */ @@ -4697,7 +3087,7 @@ export const de_ListTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4709,32 +3099,6 @@ export const de_ListTypesCommand = async ( return response; }; -/** - * deserializeAws_queryListTypesCommandError - */ -const de_ListTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryListTypeVersionsCommand */ @@ -4743,7 +3107,7 @@ export const de_ListTypeVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTypeVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4755,32 +3119,6 @@ export const de_ListTypeVersionsCommand = async ( return response; }; -/** - * deserializeAws_queryListTypeVersionsCommandError - */ -const de_ListTypeVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryPublishTypeCommand */ @@ -4789,7 +3127,7 @@ export const de_PublishTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PublishTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4801,144 +3139,40 @@ export const de_PublishTypeCommand = async ( return response; }; -/** - * deserializeAws_queryPublishTypeCommandError - */ -const de_PublishTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - case "TypeNotFoundException": - case "com.amazonaws.cloudformation#TypeNotFoundException": - throw await de_TypeNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryRecordHandlerProgressCommand */ export const de_RecordHandlerProgressCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RecordHandlerProgressCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RecordHandlerProgressOutput(data.RecordHandlerProgressResult, context); - const response: RecordHandlerProgressCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRecordHandlerProgressCommandError - */ -const de_RecordHandlerProgressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConditionalCheckFailed": - case "com.amazonaws.cloudformation#OperationStatusCheckFailedException": - throw await de_OperationStatusCheckFailedExceptionRes(parsedOutput, context); - case "InvalidStateTransition": - case "com.amazonaws.cloudformation#InvalidStateTransitionException": - throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRegisterPublisherCommand - */ -export const de_RegisterPublisherCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RegisterPublisherCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RegisterPublisherOutput(data.RegisterPublisherResult, context); - const response: RegisterPublisherCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRegisterPublisherCommandError - */ -const de_RegisterPublisherCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RecordHandlerProgressOutput(data.RecordHandlerProgressResult, context); + const response: RecordHandlerProgressCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryRegisterTypeCommand + * deserializeAws_queryRegisterPublisherCommand */ -export const de_RegisterTypeCommand = async ( +export const de_RegisterPublisherCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RegisterTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RegisterTypeOutput(data.RegisterTypeResult, context); - const response: RegisterTypeCommandOutput = { + contents = de_RegisterPublisherOutput(data.RegisterPublisherResult, context); + const response: RegisterPublisherCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4946,29 +3180,23 @@ export const de_RegisterTypeCommand = async ( }; /** - * deserializeAws_queryRegisterTypeCommandError + * deserializeAws_queryRegisterTypeCommand */ -const de_RegisterTypeCommandError = async ( +export const de_RegisterTypeCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RegisterTypeOutput(data.RegisterTypeResult, context); + const response: RegisterTypeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -4979,7 +3207,7 @@ export const de_RollbackStackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RollbackStackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4991,32 +3219,6 @@ export const de_RollbackStackCommand = async ( return response; }; -/** - * deserializeAws_queryRollbackStackCommandError - */ -const de_RollbackStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "TokenAlreadyExistsException": - case "com.amazonaws.cloudformation#TokenAlreadyExistsException": - throw await de_TokenAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySetStackPolicyCommand */ @@ -5025,7 +3227,7 @@ export const de_SetStackPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetStackPolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SetStackPolicyCommandOutput = { @@ -5034,26 +3236,6 @@ export const de_SetStackPolicyCommand = async ( return response; }; -/** - * deserializeAws_querySetStackPolicyCommandError - */ -const de_SetStackPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_querySetTypeConfigurationCommand */ @@ -5062,7 +3244,7 @@ export const de_SetTypeConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetTypeConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5074,35 +3256,6 @@ export const de_SetTypeConfigurationCommand = async ( return response; }; -/** - * deserializeAws_querySetTypeConfigurationCommandError - */ -const de_SetTypeConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - case "TypeNotFoundException": - case "com.amazonaws.cloudformation#TypeNotFoundException": - throw await de_TypeNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySetTypeDefaultVersionCommand */ @@ -5111,7 +3264,7 @@ export const de_SetTypeDefaultVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetTypeDefaultVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5123,35 +3276,6 @@ export const de_SetTypeDefaultVersionCommand = async ( return response; }; -/** - * deserializeAws_querySetTypeDefaultVersionCommandError - */ -const de_SetTypeDefaultVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - case "TypeNotFoundException": - case "com.amazonaws.cloudformation#TypeNotFoundException": - throw await de_TypeNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySignalResourceCommand */ @@ -5160,7 +3284,7 @@ export const de_SignalResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SignalResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SignalResourceCommandOutput = { @@ -5169,26 +3293,6 @@ export const de_SignalResourceCommand = async ( return response; }; -/** - * deserializeAws_querySignalResourceCommandError - */ -const de_SignalResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryStartResourceScanCommand */ @@ -5197,7 +3301,7 @@ export const de_StartResourceScanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartResourceScanCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5209,35 +3313,6 @@ export const de_StartResourceScanCommand = async ( return response; }; -/** - * deserializeAws_queryStartResourceScanCommandError - */ -const de_StartResourceScanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceScanInProgress": - case "com.amazonaws.cloudformation#ResourceScanInProgressException": - throw await de_ResourceScanInProgressExceptionRes(parsedOutput, context); - case "ResourceScanLimitExceeded": - case "com.amazonaws.cloudformation#ResourceScanLimitExceededException": - throw await de_ResourceScanLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryStopStackSetOperationCommand */ @@ -5246,7 +3321,7 @@ export const de_StopStackSetOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopStackSetOperationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5254,105 +3329,24 @@ export const de_StopStackSetOperationCommand = async ( const response: StopStackSetOperationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryStopStackSetOperationCommandError - */ -const de_StopStackSetOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidOperationException": - case "com.amazonaws.cloudformation#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "OperationNotFoundException": - case "com.amazonaws.cloudformation#OperationNotFoundException": - throw await de_OperationNotFoundExceptionRes(parsedOutput, context); - case "StackSetNotFoundException": - case "com.amazonaws.cloudformation#StackSetNotFoundException": - throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryTestTypeCommand - */ -export const de_TestTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TestTypeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_TestTypeOutput(data.TestTypeResult, context); - const response: TestTypeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryTestTypeCommandError - */ -const de_TestTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CFNRegistryException": - case "com.amazonaws.cloudformation#CFNRegistryException": - throw await de_CFNRegistryExceptionRes(parsedOutput, context); - case "TypeNotFoundException": - case "com.amazonaws.cloudformation#TypeNotFoundException": - throw await de_TypeNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + }; + return response; }; /** - * deserializeAws_queryUpdateGeneratedTemplateCommand + * deserializeAws_queryTestTypeCommand */ -export const de_UpdateGeneratedTemplateCommand = async ( +export const de_TestTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateGeneratedTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateGeneratedTemplateOutput(data.UpdateGeneratedTemplateResult, context); - const response: UpdateGeneratedTemplateCommandOutput = { + contents = de_TestTypeOutput(data.TestTypeResult, context); + const response: TestTypeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5360,35 +3354,23 @@ export const de_UpdateGeneratedTemplateCommand = async ( }; /** - * deserializeAws_queryUpdateGeneratedTemplateCommandError + * deserializeAws_queryUpdateGeneratedTemplateCommand */ -const de_UpdateGeneratedTemplateCommandError = async ( +export const de_UpdateGeneratedTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.cloudformation#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "GeneratedTemplateNotFound": - case "com.amazonaws.cloudformation#GeneratedTemplateNotFoundException": - throw await de_GeneratedTemplateNotFoundExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudformation#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateGeneratedTemplateOutput(data.UpdateGeneratedTemplateResult, context); + const response: UpdateGeneratedTemplateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -5399,7 +3381,7 @@ export const de_UpdateStackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateStackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5411,35 +3393,6 @@ export const de_UpdateStackCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateStackCommandError - */ -const de_UpdateStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientCapabilitiesException": - case "com.amazonaws.cloudformation#InsufficientCapabilitiesException": - throw await de_InsufficientCapabilitiesExceptionRes(parsedOutput, context); - case "TokenAlreadyExistsException": - case "com.amazonaws.cloudformation#TokenAlreadyExistsException": - throw await de_TokenAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateStackInstancesCommand */ @@ -5448,7 +3401,7 @@ export const de_UpdateStackInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateStackInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5460,47 +3413,6 @@ export const de_UpdateStackInstancesCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateStackInstancesCommandError - */ -const de_UpdateStackInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidOperationException": - case "com.amazonaws.cloudformation#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "OperationIdAlreadyExistsException": - case "com.amazonaws.cloudformation#OperationIdAlreadyExistsException": - throw await de_OperationIdAlreadyExistsExceptionRes(parsedOutput, context); - case "OperationInProgressException": - case "com.amazonaws.cloudformation#OperationInProgressException": - throw await de_OperationInProgressExceptionRes(parsedOutput, context); - case "StackInstanceNotFoundException": - case "com.amazonaws.cloudformation#StackInstanceNotFoundException": - throw await de_StackInstanceNotFoundExceptionRes(parsedOutput, context); - case "StackSetNotFoundException": - case "com.amazonaws.cloudformation#StackSetNotFoundException": - throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); - case "StaleRequestException": - case "com.amazonaws.cloudformation#StaleRequestException": - throw await de_StaleRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateStackSetCommand */ @@ -5509,7 +3421,7 @@ export const de_UpdateStackSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateStackSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5521,47 +3433,6 @@ export const de_UpdateStackSetCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateStackSetCommandError - */ -const de_UpdateStackSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidOperationException": - case "com.amazonaws.cloudformation#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "OperationIdAlreadyExistsException": - case "com.amazonaws.cloudformation#OperationIdAlreadyExistsException": - throw await de_OperationIdAlreadyExistsExceptionRes(parsedOutput, context); - case "OperationInProgressException": - case "com.amazonaws.cloudformation#OperationInProgressException": - throw await de_OperationInProgressExceptionRes(parsedOutput, context); - case "StackInstanceNotFoundException": - case "com.amazonaws.cloudformation#StackInstanceNotFoundException": - throw await de_StackInstanceNotFoundExceptionRes(parsedOutput, context); - case "StackSetNotFoundException": - case "com.amazonaws.cloudformation#StackSetNotFoundException": - throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); - case "StaleRequestException": - case "com.amazonaws.cloudformation#StaleRequestException": - throw await de_StaleRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateTerminationProtectionCommand */ @@ -5570,7 +3441,7 @@ export const de_UpdateTerminationProtectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTerminationProtectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5582,26 +3453,6 @@ export const de_UpdateTerminationProtectionCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateTerminationProtectionCommandError - */ -const de_UpdateTerminationProtectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryValidateTemplateCommand */ @@ -5610,7 +3461,7 @@ export const de_ValidateTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ValidateTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5623,23 +3474,104 @@ export const de_ValidateTemplateCommand = async ( }; /** - * deserializeAws_queryValidateTemplateCommandError + * deserialize_Aws_queryCommandError */ -const de_ValidateTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + switch (errorCode) { + case "InvalidOperationException": + case "com.amazonaws.cloudformation#InvalidOperationException": + throw await de_InvalidOperationExceptionRes(parsedOutput, context); + case "OperationNotFoundException": + case "com.amazonaws.cloudformation#OperationNotFoundException": + throw await de_OperationNotFoundExceptionRes(parsedOutput, context); + case "CFNRegistryException": + case "com.amazonaws.cloudformation#CFNRegistryException": + throw await de_CFNRegistryExceptionRes(parsedOutput, context); + case "TypeNotFoundException": + case "com.amazonaws.cloudformation#TypeNotFoundException": + throw await de_TypeNotFoundExceptionRes(parsedOutput, context); + case "TypeConfigurationNotFoundException": + case "com.amazonaws.cloudformation#TypeConfigurationNotFoundException": + throw await de_TypeConfigurationNotFoundExceptionRes(parsedOutput, context); + case "TokenAlreadyExistsException": + case "com.amazonaws.cloudformation#TokenAlreadyExistsException": + throw await de_TokenAlreadyExistsExceptionRes(parsedOutput, context); + case "AlreadyExistsException": + case "com.amazonaws.cloudformation#AlreadyExistsException": + throw await de_AlreadyExistsExceptionRes(parsedOutput, context); + case "InsufficientCapabilitiesException": + case "com.amazonaws.cloudformation#InsufficientCapabilitiesException": + throw await de_InsufficientCapabilitiesExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.cloudformation#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ConcurrentResourcesLimitExceeded": + case "com.amazonaws.cloudformation#ConcurrentResourcesLimitExceededException": + throw await de_ConcurrentResourcesLimitExceededExceptionRes(parsedOutput, context); + case "OperationIdAlreadyExistsException": + case "com.amazonaws.cloudformation#OperationIdAlreadyExistsException": + throw await de_OperationIdAlreadyExistsExceptionRes(parsedOutput, context); + case "OperationInProgressException": + case "com.amazonaws.cloudformation#OperationInProgressException": + throw await de_OperationInProgressExceptionRes(parsedOutput, context); + case "StackSetNotFoundException": + case "com.amazonaws.cloudformation#StackSetNotFoundException": + throw await de_StackSetNotFoundExceptionRes(parsedOutput, context); + case "StaleRequestException": + case "com.amazonaws.cloudformation#StaleRequestException": + throw await de_StaleRequestExceptionRes(parsedOutput, context); + case "CreatedButModifiedException": + case "com.amazonaws.cloudformation#CreatedButModifiedException": + throw await de_CreatedButModifiedExceptionRes(parsedOutput, context); + case "NameAlreadyExistsException": + case "com.amazonaws.cloudformation#NameAlreadyExistsException": + throw await de_NameAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidChangeSetStatus": + case "com.amazonaws.cloudformation#InvalidChangeSetStatusException": + throw await de_InvalidChangeSetStatusExceptionRes(parsedOutput, context); + case "GeneratedTemplateNotFound": + case "com.amazonaws.cloudformation#GeneratedTemplateNotFoundException": + throw await de_GeneratedTemplateNotFoundExceptionRes(parsedOutput, context); + case "StackSetNotEmptyException": + case "com.amazonaws.cloudformation#StackSetNotEmptyException": + throw await de_StackSetNotEmptyExceptionRes(parsedOutput, context); + case "ChangeSetNotFound": + case "com.amazonaws.cloudformation#ChangeSetNotFoundException": + throw await de_ChangeSetNotFoundExceptionRes(parsedOutput, context); + case "ResourceScanNotFound": + case "com.amazonaws.cloudformation#ResourceScanNotFoundException": + throw await de_ResourceScanNotFoundExceptionRes(parsedOutput, context); + case "StackInstanceNotFoundException": + case "com.amazonaws.cloudformation#StackInstanceNotFoundException": + throw await de_StackInstanceNotFoundExceptionRes(parsedOutput, context); + case "StackNotFoundException": + case "com.amazonaws.cloudformation#StackNotFoundException": + throw await de_StackNotFoundExceptionRes(parsedOutput, context); + case "ResourceScanInProgress": + case "com.amazonaws.cloudformation#ResourceScanInProgressException": + throw await de_ResourceScanInProgressExceptionRes(parsedOutput, context); + case "ConditionalCheckFailed": + case "com.amazonaws.cloudformation#OperationStatusCheckFailedException": + throw await de_OperationStatusCheckFailedExceptionRes(parsedOutput, context); + case "InvalidStateTransition": + case "com.amazonaws.cloudformation#InvalidStateTransitionException": + throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context); + case "ResourceScanLimitExceeded": + case "com.amazonaws.cloudformation#ResourceScanLimitExceededException": + throw await de_ResourceScanLimitExceededExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody: parsedBody.Error, + errorCode, + }) as never; + } }; /** diff --git a/clients/client-cloudfront-keyvaluestore/src/protocols/Aws_restJson1.ts b/clients/client-cloudfront-keyvaluestore/src/protocols/Aws_restJson1.ts index 96d86c40eae4..944327c5333a 100644 --- a/clients/client-cloudfront-keyvaluestore/src/protocols/Aws_restJson1.ts +++ b/clients/client-cloudfront-keyvaluestore/src/protocols/Aws_restJson1.ts @@ -169,7 +169,7 @@ export const de_DeleteKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -184,47 +184,6 @@ export const de_DeleteKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteKeyCommandError - */ -const de_DeleteKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cloudfrontkeyvaluestore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudfrontkeyvaluestore#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cloudfrontkeyvaluestore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudfrontkeyvaluestore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cloudfrontkeyvaluestore#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudfrontkeyvaluestore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeKeyValueStoreCommand */ @@ -233,7 +192,7 @@ export const de_DescribeKeyValueStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeKeyValueStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -253,41 +212,6 @@ export const de_DescribeKeyValueStoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeKeyValueStoreCommandError - */ -const de_DescribeKeyValueStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cloudfrontkeyvaluestore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudfrontkeyvaluestore#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cloudfrontkeyvaluestore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudfrontkeyvaluestore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetKeyCommand */ @@ -296,7 +220,7 @@ export const de_GetKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -312,38 +236,6 @@ export const de_GetKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetKeyCommandError - */ -const de_GetKeyCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cloudfrontkeyvaluestore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudfrontkeyvaluestore#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cloudfrontkeyvaluestore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudfrontkeyvaluestore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListKeysCommand */ @@ -352,7 +244,7 @@ export const de_ListKeysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKeysCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -366,44 +258,6 @@ export const de_ListKeysCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListKeysCommandError - */ -const de_ListKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cloudfrontkeyvaluestore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudfrontkeyvaluestore#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cloudfrontkeyvaluestore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudfrontkeyvaluestore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudfrontkeyvaluestore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutKeyCommand */ @@ -412,7 +266,7 @@ export const de_PutKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -427,44 +281,6 @@ export const de_PutKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutKeyCommandError - */ -const de_PutKeyCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cloudfrontkeyvaluestore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudfrontkeyvaluestore#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.cloudfrontkeyvaluestore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudfrontkeyvaluestore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cloudfrontkeyvaluestore#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudfrontkeyvaluestore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateKeysCommand */ @@ -473,7 +289,7 @@ export const de_UpdateKeysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateKeysCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -489,12 +305,9 @@ export const de_UpdateKeysCommand = async ( }; /** - * deserializeAws_restJson1UpdateKeysCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -525,7 +338,7 @@ const de_UpdateKeysCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cloudfront/src/protocols/Aws_restXml.ts b/clients/client-cloudfront/src/protocols/Aws_restXml.ts index d17528a09598..8a30e3c33700 100644 --- a/clients/client-cloudfront/src/protocols/Aws_restXml.ts +++ b/clients/client-cloudfront/src/protocols/Aws_restXml.ts @@ -3012,7 +3012,7 @@ export const de_AssociateAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3021,44 +3021,6 @@ export const de_AssociateAliasCommand = async ( return contents; }; -/** - * deserializeAws_restXmlAssociateAliasCommandError - */ -const de_AssociateAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "IllegalUpdate": - case "com.amazonaws.cloudfront#IllegalUpdate": - throw await de_IllegalUpdateRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchDistribution": - case "com.amazonaws.cloudfront#NoSuchDistribution": - throw await de_NoSuchDistributionRes(parsedOutput, context); - case "TooManyDistributionCNAMEs": - case "com.amazonaws.cloudfront#TooManyDistributionCNAMEs": - throw await de_TooManyDistributionCNAMEsRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlCopyDistributionCommand */ @@ -3067,7 +3029,7 @@ export const de_CopyDistributionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CopyDistributionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3079,221 +3041,6 @@ export const de_CopyDistributionCommand = async ( return contents; }; -/** - * deserializeAws_restXmlCopyDistributionCommandError - */ -const de_CopyDistributionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "CNAMEAlreadyExists": - case "com.amazonaws.cloudfront#CNAMEAlreadyExists": - throw await de_CNAMEAlreadyExistsRes(parsedOutput, context); - case "DistributionAlreadyExists": - case "com.amazonaws.cloudfront#DistributionAlreadyExists": - throw await de_DistributionAlreadyExistsRes(parsedOutput, context); - case "IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior": - case "com.amazonaws.cloudfront#IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior": - throw await de_IllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidDefaultRootObject": - case "com.amazonaws.cloudfront#InvalidDefaultRootObject": - throw await de_InvalidDefaultRootObjectRes(parsedOutput, context); - case "InvalidErrorCode": - case "com.amazonaws.cloudfront#InvalidErrorCode": - throw await de_InvalidErrorCodeRes(parsedOutput, context); - case "InvalidForwardCookies": - case "com.amazonaws.cloudfront#InvalidForwardCookies": - throw await de_InvalidForwardCookiesRes(parsedOutput, context); - case "InvalidFunctionAssociation": - case "com.amazonaws.cloudfront#InvalidFunctionAssociation": - throw await de_InvalidFunctionAssociationRes(parsedOutput, context); - case "InvalidGeoRestrictionParameter": - case "com.amazonaws.cloudfront#InvalidGeoRestrictionParameter": - throw await de_InvalidGeoRestrictionParameterRes(parsedOutput, context); - case "InvalidHeadersForS3Origin": - case "com.amazonaws.cloudfront#InvalidHeadersForS3Origin": - throw await de_InvalidHeadersForS3OriginRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "InvalidLambdaFunctionAssociation": - case "com.amazonaws.cloudfront#InvalidLambdaFunctionAssociation": - throw await de_InvalidLambdaFunctionAssociationRes(parsedOutput, context); - case "InvalidLocationCode": - case "com.amazonaws.cloudfront#InvalidLocationCode": - throw await de_InvalidLocationCodeRes(parsedOutput, context); - case "InvalidMinimumProtocolVersion": - case "com.amazonaws.cloudfront#InvalidMinimumProtocolVersion": - throw await de_InvalidMinimumProtocolVersionRes(parsedOutput, context); - case "InvalidOrigin": - case "com.amazonaws.cloudfront#InvalidOrigin": - throw await de_InvalidOriginRes(parsedOutput, context); - case "InvalidOriginAccessControl": - case "com.amazonaws.cloudfront#InvalidOriginAccessControl": - throw await de_InvalidOriginAccessControlRes(parsedOutput, context); - case "InvalidOriginAccessIdentity": - case "com.amazonaws.cloudfront#InvalidOriginAccessIdentity": - throw await de_InvalidOriginAccessIdentityRes(parsedOutput, context); - case "InvalidOriginKeepaliveTimeout": - case "com.amazonaws.cloudfront#InvalidOriginKeepaliveTimeout": - throw await de_InvalidOriginKeepaliveTimeoutRes(parsedOutput, context); - case "InvalidOriginReadTimeout": - case "com.amazonaws.cloudfront#InvalidOriginReadTimeout": - throw await de_InvalidOriginReadTimeoutRes(parsedOutput, context); - case "InvalidProtocolSettings": - case "com.amazonaws.cloudfront#InvalidProtocolSettings": - throw await de_InvalidProtocolSettingsRes(parsedOutput, context); - case "InvalidQueryStringParameters": - case "com.amazonaws.cloudfront#InvalidQueryStringParameters": - throw await de_InvalidQueryStringParametersRes(parsedOutput, context); - case "InvalidRelativePath": - case "com.amazonaws.cloudfront#InvalidRelativePath": - throw await de_InvalidRelativePathRes(parsedOutput, context); - case "InvalidRequiredProtocol": - case "com.amazonaws.cloudfront#InvalidRequiredProtocol": - throw await de_InvalidRequiredProtocolRes(parsedOutput, context); - case "InvalidResponseCode": - case "com.amazonaws.cloudfront#InvalidResponseCode": - throw await de_InvalidResponseCodeRes(parsedOutput, context); - case "InvalidTTLOrder": - case "com.amazonaws.cloudfront#InvalidTTLOrder": - throw await de_InvalidTTLOrderRes(parsedOutput, context); - case "InvalidViewerCertificate": - case "com.amazonaws.cloudfront#InvalidViewerCertificate": - throw await de_InvalidViewerCertificateRes(parsedOutput, context); - case "InvalidWebACLId": - case "com.amazonaws.cloudfront#InvalidWebACLId": - throw await de_InvalidWebACLIdRes(parsedOutput, context); - case "MissingBody": - case "com.amazonaws.cloudfront#MissingBody": - throw await de_MissingBodyRes(parsedOutput, context); - case "NoSuchCachePolicy": - case "com.amazonaws.cloudfront#NoSuchCachePolicy": - throw await de_NoSuchCachePolicyRes(parsedOutput, context); - case "NoSuchDistribution": - case "com.amazonaws.cloudfront#NoSuchDistribution": - throw await de_NoSuchDistributionRes(parsedOutput, context); - case "NoSuchFieldLevelEncryptionConfig": - case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig": - throw await de_NoSuchFieldLevelEncryptionConfigRes(parsedOutput, context); - case "NoSuchOrigin": - case "com.amazonaws.cloudfront#NoSuchOrigin": - throw await de_NoSuchOriginRes(parsedOutput, context); - case "NoSuchOriginRequestPolicy": - case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy": - throw await de_NoSuchOriginRequestPolicyRes(parsedOutput, context); - case "NoSuchRealtimeLogConfig": - case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig": - throw await de_NoSuchRealtimeLogConfigRes(parsedOutput, context); - case "NoSuchResponseHeadersPolicy": - case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy": - throw await de_NoSuchResponseHeadersPolicyRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "RealtimeLogConfigOwnerMismatch": - case "com.amazonaws.cloudfront#RealtimeLogConfigOwnerMismatch": - throw await de_RealtimeLogConfigOwnerMismatchRes(parsedOutput, context); - case "TooManyCacheBehaviors": - case "com.amazonaws.cloudfront#TooManyCacheBehaviors": - throw await de_TooManyCacheBehaviorsRes(parsedOutput, context); - case "TooManyCertificates": - case "com.amazonaws.cloudfront#TooManyCertificates": - throw await de_TooManyCertificatesRes(parsedOutput, context); - case "TooManyCookieNamesInWhiteList": - case "com.amazonaws.cloudfront#TooManyCookieNamesInWhiteList": - throw await de_TooManyCookieNamesInWhiteListRes(parsedOutput, context); - case "TooManyDistributionCNAMEs": - case "com.amazonaws.cloudfront#TooManyDistributionCNAMEs": - throw await de_TooManyDistributionCNAMEsRes(parsedOutput, context); - case "TooManyDistributions": - case "com.amazonaws.cloudfront#TooManyDistributions": - throw await de_TooManyDistributionsRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToCachePolicy": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToCachePolicy": - throw await de_TooManyDistributionsAssociatedToCachePolicyRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToFieldLevelEncryptionConfig": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToFieldLevelEncryptionConfig": - throw await de_TooManyDistributionsAssociatedToFieldLevelEncryptionConfigRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToKeyGroup": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToKeyGroup": - throw await de_TooManyDistributionsAssociatedToKeyGroupRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToOriginAccessControl": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginAccessControl": - throw await de_TooManyDistributionsAssociatedToOriginAccessControlRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToOriginRequestPolicy": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginRequestPolicy": - throw await de_TooManyDistributionsAssociatedToOriginRequestPolicyRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToResponseHeadersPolicy": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToResponseHeadersPolicy": - throw await de_TooManyDistributionsAssociatedToResponseHeadersPolicyRes(parsedOutput, context); - case "TooManyDistributionsWithFunctionAssociations": - case "com.amazonaws.cloudfront#TooManyDistributionsWithFunctionAssociations": - throw await de_TooManyDistributionsWithFunctionAssociationsRes(parsedOutput, context); - case "TooManyDistributionsWithLambdaAssociations": - case "com.amazonaws.cloudfront#TooManyDistributionsWithLambdaAssociations": - throw await de_TooManyDistributionsWithLambdaAssociationsRes(parsedOutput, context); - case "TooManyDistributionsWithSingleFunctionARN": - case "com.amazonaws.cloudfront#TooManyDistributionsWithSingleFunctionARN": - throw await de_TooManyDistributionsWithSingleFunctionARNRes(parsedOutput, context); - case "TooManyFunctionAssociations": - case "com.amazonaws.cloudfront#TooManyFunctionAssociations": - throw await de_TooManyFunctionAssociationsRes(parsedOutput, context); - case "TooManyHeadersInForwardedValues": - case "com.amazonaws.cloudfront#TooManyHeadersInForwardedValues": - throw await de_TooManyHeadersInForwardedValuesRes(parsedOutput, context); - case "TooManyKeyGroupsAssociatedToDistribution": - case "com.amazonaws.cloudfront#TooManyKeyGroupsAssociatedToDistribution": - throw await de_TooManyKeyGroupsAssociatedToDistributionRes(parsedOutput, context); - case "TooManyLambdaFunctionAssociations": - case "com.amazonaws.cloudfront#TooManyLambdaFunctionAssociations": - throw await de_TooManyLambdaFunctionAssociationsRes(parsedOutput, context); - case "TooManyOriginCustomHeaders": - case "com.amazonaws.cloudfront#TooManyOriginCustomHeaders": - throw await de_TooManyOriginCustomHeadersRes(parsedOutput, context); - case "TooManyOriginGroupsPerDistribution": - case "com.amazonaws.cloudfront#TooManyOriginGroupsPerDistribution": - throw await de_TooManyOriginGroupsPerDistributionRes(parsedOutput, context); - case "TooManyOrigins": - case "com.amazonaws.cloudfront#TooManyOrigins": - throw await de_TooManyOriginsRes(parsedOutput, context); - case "TooManyQueryStringParameters": - case "com.amazonaws.cloudfront#TooManyQueryStringParameters": - throw await de_TooManyQueryStringParametersRes(parsedOutput, context); - case "TooManyTrustedSigners": - case "com.amazonaws.cloudfront#TooManyTrustedSigners": - throw await de_TooManyTrustedSignersRes(parsedOutput, context); - case "TrustedKeyGroupDoesNotExist": - case "com.amazonaws.cloudfront#TrustedKeyGroupDoesNotExist": - throw await de_TrustedKeyGroupDoesNotExistRes(parsedOutput, context); - case "TrustedSignerDoesNotExist": - case "com.amazonaws.cloudfront#TrustedSignerDoesNotExist": - throw await de_TrustedSignerDoesNotExistRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlCreateCachePolicyCommand */ @@ -3302,7 +3049,7 @@ export const de_CreateCachePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateCachePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3315,61 +3062,34 @@ export const de_CreateCachePolicyCommand = async ( }; /** - * deserializeAws_restXmlCreateCachePolicyCommandError + * deserializeAws_restXmlCreateCloudFrontOriginAccessIdentityCommand */ -const de_CreateCachePolicyCommandError = async ( +export const de_CreateCloudFrontOriginAccessIdentityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "CachePolicyAlreadyExists": - case "com.amazonaws.cloudfront#CachePolicyAlreadyExists": - throw await de_CachePolicyAlreadyExistsRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "TooManyCachePolicies": - case "com.amazonaws.cloudfront#TooManyCachePolicies": - throw await de_TooManyCachePoliciesRes(parsedOutput, context); - case "TooManyCookiesInCachePolicy": - case "com.amazonaws.cloudfront#TooManyCookiesInCachePolicy": - throw await de_TooManyCookiesInCachePolicyRes(parsedOutput, context); - case "TooManyHeadersInCachePolicy": - case "com.amazonaws.cloudfront#TooManyHeadersInCachePolicy": - throw await de_TooManyHeadersInCachePolicyRes(parsedOutput, context); - case "TooManyQueryStringsInCachePolicy": - case "com.amazonaws.cloudfront#TooManyQueryStringsInCachePolicy": - throw await de_TooManyQueryStringsInCachePolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_L]: [, output.headers[_lo]], + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.CloudFrontOriginAccessIdentity = de_CloudFrontOriginAccessIdentity(data, context); + return contents; }; /** - * deserializeAws_restXmlCreateCloudFrontOriginAccessIdentityCommand + * deserializeAws_restXmlCreateContinuousDeploymentPolicyCommand */ -export const de_CreateCloudFrontOriginAccessIdentityCommand = async ( +export const de_CreateContinuousDeploymentPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateCloudFrontOriginAccessIdentityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3377,57 +3097,39 @@ export const de_CreateCloudFrontOriginAccessIdentityCommand = async ( [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CloudFrontOriginAccessIdentity = de_CloudFrontOriginAccessIdentity(data, context); + contents.ContinuousDeploymentPolicy = de_ContinuousDeploymentPolicy(data, context); return contents; }; /** - * deserializeAws_restXmlCreateCloudFrontOriginAccessIdentityCommandError + * deserializeAws_restXmlCreateDistributionCommand */ -const de_CreateCloudFrontOriginAccessIdentityCommandError = async ( +export const de_CreateDistributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudFrontOriginAccessIdentityAlreadyExists": - case "com.amazonaws.cloudfront#CloudFrontOriginAccessIdentityAlreadyExists": - throw await de_CloudFrontOriginAccessIdentityAlreadyExistsRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "MissingBody": - case "com.amazonaws.cloudfront#MissingBody": - throw await de_MissingBodyRes(parsedOutput, context); - case "TooManyCloudFrontOriginAccessIdentities": - case "com.amazonaws.cloudfront#TooManyCloudFrontOriginAccessIdentities": - throw await de_TooManyCloudFrontOriginAccessIdentitiesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_L]: [, output.headers[_lo]], + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.Distribution = de_Distribution(data, context); + return contents; }; /** - * deserializeAws_restXmlCreateContinuousDeploymentPolicyCommand + * deserializeAws_restXmlCreateDistributionWithTagsCommand */ -export const de_CreateContinuousDeploymentPolicyCommand = async ( +export const de_CreateDistributionWithTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateContinuousDeploymentPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3435,60 +3137,39 @@ export const de_CreateContinuousDeploymentPolicyCommand = async ( [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ContinuousDeploymentPolicy = de_ContinuousDeploymentPolicy(data, context); + contents.Distribution = de_Distribution(data, context); return contents; }; /** - * deserializeAws_restXmlCreateContinuousDeploymentPolicyCommandError + * deserializeAws_restXmlCreateFieldLevelEncryptionConfigCommand */ -const de_CreateContinuousDeploymentPolicyCommandError = async ( +export const de_CreateFieldLevelEncryptionConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "ContinuousDeploymentPolicyAlreadyExists": - case "com.amazonaws.cloudfront#ContinuousDeploymentPolicyAlreadyExists": - throw await de_ContinuousDeploymentPolicyAlreadyExistsRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "StagingDistributionInUse": - case "com.amazonaws.cloudfront#StagingDistributionInUse": - throw await de_StagingDistributionInUseRes(parsedOutput, context); - case "TooManyContinuousDeploymentPolicies": - case "com.amazonaws.cloudfront#TooManyContinuousDeploymentPolicies": - throw await de_TooManyContinuousDeploymentPoliciesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_L]: [, output.headers[_lo]], + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.FieldLevelEncryption = de_FieldLevelEncryption(data, context); + return contents; }; /** - * deserializeAws_restXmlCreateDistributionCommand + * deserializeAws_restXmlCreateFieldLevelEncryptionProfileCommand */ -export const de_CreateDistributionCommand = async ( +export const de_CreateFieldLevelEncryptionProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDistributionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3496,237 +3177,58 @@ export const de_CreateDistributionCommand = async ( [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.Distribution = de_Distribution(data, context); + contents.FieldLevelEncryptionProfile = de_FieldLevelEncryptionProfile(data, context); return contents; }; /** - * deserializeAws_restXmlCreateDistributionCommandError + * deserializeAws_restXmlCreateFunctionCommand */ -const de_CreateDistributionCommandError = async ( +export const de_CreateFunctionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "CNAMEAlreadyExists": - case "com.amazonaws.cloudfront#CNAMEAlreadyExists": - throw await de_CNAMEAlreadyExistsRes(parsedOutput, context); - case "ContinuousDeploymentPolicyInUse": - case "com.amazonaws.cloudfront#ContinuousDeploymentPolicyInUse": - throw await de_ContinuousDeploymentPolicyInUseRes(parsedOutput, context); - case "DistributionAlreadyExists": - case "com.amazonaws.cloudfront#DistributionAlreadyExists": - throw await de_DistributionAlreadyExistsRes(parsedOutput, context); - case "IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior": - case "com.amazonaws.cloudfront#IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior": - throw await de_IllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorRes(parsedOutput, context); - case "IllegalOriginAccessConfiguration": - case "com.amazonaws.cloudfront#IllegalOriginAccessConfiguration": - throw await de_IllegalOriginAccessConfigurationRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidDefaultRootObject": - case "com.amazonaws.cloudfront#InvalidDefaultRootObject": - throw await de_InvalidDefaultRootObjectRes(parsedOutput, context); - case "InvalidDomainNameForOriginAccessControl": - case "com.amazonaws.cloudfront#InvalidDomainNameForOriginAccessControl": - throw await de_InvalidDomainNameForOriginAccessControlRes(parsedOutput, context); - case "InvalidErrorCode": - case "com.amazonaws.cloudfront#InvalidErrorCode": - throw await de_InvalidErrorCodeRes(parsedOutput, context); - case "InvalidForwardCookies": - case "com.amazonaws.cloudfront#InvalidForwardCookies": - throw await de_InvalidForwardCookiesRes(parsedOutput, context); - case "InvalidFunctionAssociation": - case "com.amazonaws.cloudfront#InvalidFunctionAssociation": - throw await de_InvalidFunctionAssociationRes(parsedOutput, context); - case "InvalidGeoRestrictionParameter": - case "com.amazonaws.cloudfront#InvalidGeoRestrictionParameter": - throw await de_InvalidGeoRestrictionParameterRes(parsedOutput, context); - case "InvalidHeadersForS3Origin": - case "com.amazonaws.cloudfront#InvalidHeadersForS3Origin": - throw await de_InvalidHeadersForS3OriginRes(parsedOutput, context); - case "InvalidLambdaFunctionAssociation": - case "com.amazonaws.cloudfront#InvalidLambdaFunctionAssociation": - throw await de_InvalidLambdaFunctionAssociationRes(parsedOutput, context); - case "InvalidLocationCode": - case "com.amazonaws.cloudfront#InvalidLocationCode": - throw await de_InvalidLocationCodeRes(parsedOutput, context); - case "InvalidMinimumProtocolVersion": - case "com.amazonaws.cloudfront#InvalidMinimumProtocolVersion": - throw await de_InvalidMinimumProtocolVersionRes(parsedOutput, context); - case "InvalidOrigin": - case "com.amazonaws.cloudfront#InvalidOrigin": - throw await de_InvalidOriginRes(parsedOutput, context); - case "InvalidOriginAccessControl": - case "com.amazonaws.cloudfront#InvalidOriginAccessControl": - throw await de_InvalidOriginAccessControlRes(parsedOutput, context); - case "InvalidOriginAccessIdentity": - case "com.amazonaws.cloudfront#InvalidOriginAccessIdentity": - throw await de_InvalidOriginAccessIdentityRes(parsedOutput, context); - case "InvalidOriginKeepaliveTimeout": - case "com.amazonaws.cloudfront#InvalidOriginKeepaliveTimeout": - throw await de_InvalidOriginKeepaliveTimeoutRes(parsedOutput, context); - case "InvalidOriginReadTimeout": - case "com.amazonaws.cloudfront#InvalidOriginReadTimeout": - throw await de_InvalidOriginReadTimeoutRes(parsedOutput, context); - case "InvalidProtocolSettings": - case "com.amazonaws.cloudfront#InvalidProtocolSettings": - throw await de_InvalidProtocolSettingsRes(parsedOutput, context); - case "InvalidQueryStringParameters": - case "com.amazonaws.cloudfront#InvalidQueryStringParameters": - throw await de_InvalidQueryStringParametersRes(parsedOutput, context); - case "InvalidRelativePath": - case "com.amazonaws.cloudfront#InvalidRelativePath": - throw await de_InvalidRelativePathRes(parsedOutput, context); - case "InvalidRequiredProtocol": - case "com.amazonaws.cloudfront#InvalidRequiredProtocol": - throw await de_InvalidRequiredProtocolRes(parsedOutput, context); - case "InvalidResponseCode": - case "com.amazonaws.cloudfront#InvalidResponseCode": - throw await de_InvalidResponseCodeRes(parsedOutput, context); - case "InvalidTTLOrder": - case "com.amazonaws.cloudfront#InvalidTTLOrder": - throw await de_InvalidTTLOrderRes(parsedOutput, context); - case "InvalidViewerCertificate": - case "com.amazonaws.cloudfront#InvalidViewerCertificate": - throw await de_InvalidViewerCertificateRes(parsedOutput, context); - case "InvalidWebACLId": - case "com.amazonaws.cloudfront#InvalidWebACLId": - throw await de_InvalidWebACLIdRes(parsedOutput, context); - case "MissingBody": - case "com.amazonaws.cloudfront#MissingBody": - throw await de_MissingBodyRes(parsedOutput, context); - case "NoSuchCachePolicy": - case "com.amazonaws.cloudfront#NoSuchCachePolicy": - throw await de_NoSuchCachePolicyRes(parsedOutput, context); - case "NoSuchContinuousDeploymentPolicy": - case "com.amazonaws.cloudfront#NoSuchContinuousDeploymentPolicy": - throw await de_NoSuchContinuousDeploymentPolicyRes(parsedOutput, context); - case "NoSuchFieldLevelEncryptionConfig": - case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig": - throw await de_NoSuchFieldLevelEncryptionConfigRes(parsedOutput, context); - case "NoSuchOrigin": - case "com.amazonaws.cloudfront#NoSuchOrigin": - throw await de_NoSuchOriginRes(parsedOutput, context); - case "NoSuchOriginRequestPolicy": - case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy": - throw await de_NoSuchOriginRequestPolicyRes(parsedOutput, context); - case "NoSuchRealtimeLogConfig": - case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig": - throw await de_NoSuchRealtimeLogConfigRes(parsedOutput, context); - case "NoSuchResponseHeadersPolicy": - case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy": - throw await de_NoSuchResponseHeadersPolicyRes(parsedOutput, context); - case "RealtimeLogConfigOwnerMismatch": - case "com.amazonaws.cloudfront#RealtimeLogConfigOwnerMismatch": - throw await de_RealtimeLogConfigOwnerMismatchRes(parsedOutput, context); - case "TooManyCacheBehaviors": - case "com.amazonaws.cloudfront#TooManyCacheBehaviors": - throw await de_TooManyCacheBehaviorsRes(parsedOutput, context); - case "TooManyCertificates": - case "com.amazonaws.cloudfront#TooManyCertificates": - throw await de_TooManyCertificatesRes(parsedOutput, context); - case "TooManyCookieNamesInWhiteList": - case "com.amazonaws.cloudfront#TooManyCookieNamesInWhiteList": - throw await de_TooManyCookieNamesInWhiteListRes(parsedOutput, context); - case "TooManyDistributionCNAMEs": - case "com.amazonaws.cloudfront#TooManyDistributionCNAMEs": - throw await de_TooManyDistributionCNAMEsRes(parsedOutput, context); - case "TooManyDistributions": - case "com.amazonaws.cloudfront#TooManyDistributions": - throw await de_TooManyDistributionsRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToCachePolicy": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToCachePolicy": - throw await de_TooManyDistributionsAssociatedToCachePolicyRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToFieldLevelEncryptionConfig": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToFieldLevelEncryptionConfig": - throw await de_TooManyDistributionsAssociatedToFieldLevelEncryptionConfigRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToKeyGroup": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToKeyGroup": - throw await de_TooManyDistributionsAssociatedToKeyGroupRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToOriginAccessControl": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginAccessControl": - throw await de_TooManyDistributionsAssociatedToOriginAccessControlRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToOriginRequestPolicy": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginRequestPolicy": - throw await de_TooManyDistributionsAssociatedToOriginRequestPolicyRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToResponseHeadersPolicy": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToResponseHeadersPolicy": - throw await de_TooManyDistributionsAssociatedToResponseHeadersPolicyRes(parsedOutput, context); - case "TooManyDistributionsWithFunctionAssociations": - case "com.amazonaws.cloudfront#TooManyDistributionsWithFunctionAssociations": - throw await de_TooManyDistributionsWithFunctionAssociationsRes(parsedOutput, context); - case "TooManyDistributionsWithLambdaAssociations": - case "com.amazonaws.cloudfront#TooManyDistributionsWithLambdaAssociations": - throw await de_TooManyDistributionsWithLambdaAssociationsRes(parsedOutput, context); - case "TooManyDistributionsWithSingleFunctionARN": - case "com.amazonaws.cloudfront#TooManyDistributionsWithSingleFunctionARN": - throw await de_TooManyDistributionsWithSingleFunctionARNRes(parsedOutput, context); - case "TooManyFunctionAssociations": - case "com.amazonaws.cloudfront#TooManyFunctionAssociations": - throw await de_TooManyFunctionAssociationsRes(parsedOutput, context); - case "TooManyHeadersInForwardedValues": - case "com.amazonaws.cloudfront#TooManyHeadersInForwardedValues": - throw await de_TooManyHeadersInForwardedValuesRes(parsedOutput, context); - case "TooManyKeyGroupsAssociatedToDistribution": - case "com.amazonaws.cloudfront#TooManyKeyGroupsAssociatedToDistribution": - throw await de_TooManyKeyGroupsAssociatedToDistributionRes(parsedOutput, context); - case "TooManyLambdaFunctionAssociations": - case "com.amazonaws.cloudfront#TooManyLambdaFunctionAssociations": - throw await de_TooManyLambdaFunctionAssociationsRes(parsedOutput, context); - case "TooManyOriginCustomHeaders": - case "com.amazonaws.cloudfront#TooManyOriginCustomHeaders": - throw await de_TooManyOriginCustomHeadersRes(parsedOutput, context); - case "TooManyOriginGroupsPerDistribution": - case "com.amazonaws.cloudfront#TooManyOriginGroupsPerDistribution": - throw await de_TooManyOriginGroupsPerDistributionRes(parsedOutput, context); - case "TooManyOrigins": - case "com.amazonaws.cloudfront#TooManyOrigins": - throw await de_TooManyOriginsRes(parsedOutput, context); - case "TooManyQueryStringParameters": - case "com.amazonaws.cloudfront#TooManyQueryStringParameters": - throw await de_TooManyQueryStringParametersRes(parsedOutput, context); - case "TooManyTrustedSigners": - case "com.amazonaws.cloudfront#TooManyTrustedSigners": - throw await de_TooManyTrustedSignersRes(parsedOutput, context); - case "TrustedKeyGroupDoesNotExist": - case "com.amazonaws.cloudfront#TrustedKeyGroupDoesNotExist": - throw await de_TrustedKeyGroupDoesNotExistRes(parsedOutput, context); - case "TrustedSignerDoesNotExist": - case "com.amazonaws.cloudfront#TrustedSignerDoesNotExist": - throw await de_TrustedSignerDoesNotExistRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_L]: [, output.headers[_lo]], + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.FunctionSummary = de_FunctionSummary(data, context); + return contents; }; /** - * deserializeAws_restXmlCreateDistributionWithTagsCommand + * deserializeAws_restXmlCreateInvalidationCommand */ -export const de_CreateDistributionWithTagsCommand = async ( +export const de_CreateInvalidationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_L]: [, output.headers[_lo]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.Invalidation = de_Invalidation(data, context); + return contents; +}; + +/** + * deserializeAws_restXmlCreateKeyGroupCommand + */ +export const de_CreateKeyGroupCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDistributionWithTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3734,240 +3236,57 @@ export const de_CreateDistributionWithTagsCommand = async ( [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.Distribution = de_Distribution(data, context); + contents.KeyGroup = de_KeyGroup(data, context); return contents; }; /** - * deserializeAws_restXmlCreateDistributionWithTagsCommandError + * deserializeAws_restXmlCreateKeyValueStoreCommand */ -const de_CreateDistributionWithTagsCommandError = async ( +export const de_CreateKeyValueStoreCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "CNAMEAlreadyExists": - case "com.amazonaws.cloudfront#CNAMEAlreadyExists": - throw await de_CNAMEAlreadyExistsRes(parsedOutput, context); - case "ContinuousDeploymentPolicyInUse": - case "com.amazonaws.cloudfront#ContinuousDeploymentPolicyInUse": - throw await de_ContinuousDeploymentPolicyInUseRes(parsedOutput, context); - case "DistributionAlreadyExists": - case "com.amazonaws.cloudfront#DistributionAlreadyExists": - throw await de_DistributionAlreadyExistsRes(parsedOutput, context); - case "IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior": - case "com.amazonaws.cloudfront#IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior": - throw await de_IllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorRes(parsedOutput, context); - case "IllegalOriginAccessConfiguration": - case "com.amazonaws.cloudfront#IllegalOriginAccessConfiguration": - throw await de_IllegalOriginAccessConfigurationRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidDefaultRootObject": - case "com.amazonaws.cloudfront#InvalidDefaultRootObject": - throw await de_InvalidDefaultRootObjectRes(parsedOutput, context); - case "InvalidDomainNameForOriginAccessControl": - case "com.amazonaws.cloudfront#InvalidDomainNameForOriginAccessControl": - throw await de_InvalidDomainNameForOriginAccessControlRes(parsedOutput, context); - case "InvalidErrorCode": - case "com.amazonaws.cloudfront#InvalidErrorCode": - throw await de_InvalidErrorCodeRes(parsedOutput, context); - case "InvalidForwardCookies": - case "com.amazonaws.cloudfront#InvalidForwardCookies": - throw await de_InvalidForwardCookiesRes(parsedOutput, context); - case "InvalidFunctionAssociation": - case "com.amazonaws.cloudfront#InvalidFunctionAssociation": - throw await de_InvalidFunctionAssociationRes(parsedOutput, context); - case "InvalidGeoRestrictionParameter": - case "com.amazonaws.cloudfront#InvalidGeoRestrictionParameter": - throw await de_InvalidGeoRestrictionParameterRes(parsedOutput, context); - case "InvalidHeadersForS3Origin": - case "com.amazonaws.cloudfront#InvalidHeadersForS3Origin": - throw await de_InvalidHeadersForS3OriginRes(parsedOutput, context); - case "InvalidLambdaFunctionAssociation": - case "com.amazonaws.cloudfront#InvalidLambdaFunctionAssociation": - throw await de_InvalidLambdaFunctionAssociationRes(parsedOutput, context); - case "InvalidLocationCode": - case "com.amazonaws.cloudfront#InvalidLocationCode": - throw await de_InvalidLocationCodeRes(parsedOutput, context); - case "InvalidMinimumProtocolVersion": - case "com.amazonaws.cloudfront#InvalidMinimumProtocolVersion": - throw await de_InvalidMinimumProtocolVersionRes(parsedOutput, context); - case "InvalidOrigin": - case "com.amazonaws.cloudfront#InvalidOrigin": - throw await de_InvalidOriginRes(parsedOutput, context); - case "InvalidOriginAccessControl": - case "com.amazonaws.cloudfront#InvalidOriginAccessControl": - throw await de_InvalidOriginAccessControlRes(parsedOutput, context); - case "InvalidOriginAccessIdentity": - case "com.amazonaws.cloudfront#InvalidOriginAccessIdentity": - throw await de_InvalidOriginAccessIdentityRes(parsedOutput, context); - case "InvalidOriginKeepaliveTimeout": - case "com.amazonaws.cloudfront#InvalidOriginKeepaliveTimeout": - throw await de_InvalidOriginKeepaliveTimeoutRes(parsedOutput, context); - case "InvalidOriginReadTimeout": - case "com.amazonaws.cloudfront#InvalidOriginReadTimeout": - throw await de_InvalidOriginReadTimeoutRes(parsedOutput, context); - case "InvalidProtocolSettings": - case "com.amazonaws.cloudfront#InvalidProtocolSettings": - throw await de_InvalidProtocolSettingsRes(parsedOutput, context); - case "InvalidQueryStringParameters": - case "com.amazonaws.cloudfront#InvalidQueryStringParameters": - throw await de_InvalidQueryStringParametersRes(parsedOutput, context); - case "InvalidRelativePath": - case "com.amazonaws.cloudfront#InvalidRelativePath": - throw await de_InvalidRelativePathRes(parsedOutput, context); - case "InvalidRequiredProtocol": - case "com.amazonaws.cloudfront#InvalidRequiredProtocol": - throw await de_InvalidRequiredProtocolRes(parsedOutput, context); - case "InvalidResponseCode": - case "com.amazonaws.cloudfront#InvalidResponseCode": - throw await de_InvalidResponseCodeRes(parsedOutput, context); - case "InvalidTTLOrder": - case "com.amazonaws.cloudfront#InvalidTTLOrder": - throw await de_InvalidTTLOrderRes(parsedOutput, context); - case "InvalidTagging": - case "com.amazonaws.cloudfront#InvalidTagging": - throw await de_InvalidTaggingRes(parsedOutput, context); - case "InvalidViewerCertificate": - case "com.amazonaws.cloudfront#InvalidViewerCertificate": - throw await de_InvalidViewerCertificateRes(parsedOutput, context); - case "InvalidWebACLId": - case "com.amazonaws.cloudfront#InvalidWebACLId": - throw await de_InvalidWebACLIdRes(parsedOutput, context); - case "MissingBody": - case "com.amazonaws.cloudfront#MissingBody": - throw await de_MissingBodyRes(parsedOutput, context); - case "NoSuchCachePolicy": - case "com.amazonaws.cloudfront#NoSuchCachePolicy": - throw await de_NoSuchCachePolicyRes(parsedOutput, context); - case "NoSuchContinuousDeploymentPolicy": - case "com.amazonaws.cloudfront#NoSuchContinuousDeploymentPolicy": - throw await de_NoSuchContinuousDeploymentPolicyRes(parsedOutput, context); - case "NoSuchFieldLevelEncryptionConfig": - case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig": - throw await de_NoSuchFieldLevelEncryptionConfigRes(parsedOutput, context); - case "NoSuchOrigin": - case "com.amazonaws.cloudfront#NoSuchOrigin": - throw await de_NoSuchOriginRes(parsedOutput, context); - case "NoSuchOriginRequestPolicy": - case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy": - throw await de_NoSuchOriginRequestPolicyRes(parsedOutput, context); - case "NoSuchRealtimeLogConfig": - case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig": - throw await de_NoSuchRealtimeLogConfigRes(parsedOutput, context); - case "NoSuchResponseHeadersPolicy": - case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy": - throw await de_NoSuchResponseHeadersPolicyRes(parsedOutput, context); - case "RealtimeLogConfigOwnerMismatch": - case "com.amazonaws.cloudfront#RealtimeLogConfigOwnerMismatch": - throw await de_RealtimeLogConfigOwnerMismatchRes(parsedOutput, context); - case "TooManyCacheBehaviors": - case "com.amazonaws.cloudfront#TooManyCacheBehaviors": - throw await de_TooManyCacheBehaviorsRes(parsedOutput, context); - case "TooManyCertificates": - case "com.amazonaws.cloudfront#TooManyCertificates": - throw await de_TooManyCertificatesRes(parsedOutput, context); - case "TooManyCookieNamesInWhiteList": - case "com.amazonaws.cloudfront#TooManyCookieNamesInWhiteList": - throw await de_TooManyCookieNamesInWhiteListRes(parsedOutput, context); - case "TooManyDistributionCNAMEs": - case "com.amazonaws.cloudfront#TooManyDistributionCNAMEs": - throw await de_TooManyDistributionCNAMEsRes(parsedOutput, context); - case "TooManyDistributions": - case "com.amazonaws.cloudfront#TooManyDistributions": - throw await de_TooManyDistributionsRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToCachePolicy": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToCachePolicy": - throw await de_TooManyDistributionsAssociatedToCachePolicyRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToFieldLevelEncryptionConfig": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToFieldLevelEncryptionConfig": - throw await de_TooManyDistributionsAssociatedToFieldLevelEncryptionConfigRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToKeyGroup": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToKeyGroup": - throw await de_TooManyDistributionsAssociatedToKeyGroupRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToOriginAccessControl": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginAccessControl": - throw await de_TooManyDistributionsAssociatedToOriginAccessControlRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToOriginRequestPolicy": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginRequestPolicy": - throw await de_TooManyDistributionsAssociatedToOriginRequestPolicyRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToResponseHeadersPolicy": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToResponseHeadersPolicy": - throw await de_TooManyDistributionsAssociatedToResponseHeadersPolicyRes(parsedOutput, context); - case "TooManyDistributionsWithFunctionAssociations": - case "com.amazonaws.cloudfront#TooManyDistributionsWithFunctionAssociations": - throw await de_TooManyDistributionsWithFunctionAssociationsRes(parsedOutput, context); - case "TooManyDistributionsWithLambdaAssociations": - case "com.amazonaws.cloudfront#TooManyDistributionsWithLambdaAssociations": - throw await de_TooManyDistributionsWithLambdaAssociationsRes(parsedOutput, context); - case "TooManyDistributionsWithSingleFunctionARN": - case "com.amazonaws.cloudfront#TooManyDistributionsWithSingleFunctionARN": - throw await de_TooManyDistributionsWithSingleFunctionARNRes(parsedOutput, context); - case "TooManyFunctionAssociations": - case "com.amazonaws.cloudfront#TooManyFunctionAssociations": - throw await de_TooManyFunctionAssociationsRes(parsedOutput, context); - case "TooManyHeadersInForwardedValues": - case "com.amazonaws.cloudfront#TooManyHeadersInForwardedValues": - throw await de_TooManyHeadersInForwardedValuesRes(parsedOutput, context); - case "TooManyKeyGroupsAssociatedToDistribution": - case "com.amazonaws.cloudfront#TooManyKeyGroupsAssociatedToDistribution": - throw await de_TooManyKeyGroupsAssociatedToDistributionRes(parsedOutput, context); - case "TooManyLambdaFunctionAssociations": - case "com.amazonaws.cloudfront#TooManyLambdaFunctionAssociations": - throw await de_TooManyLambdaFunctionAssociationsRes(parsedOutput, context); - case "TooManyOriginCustomHeaders": - case "com.amazonaws.cloudfront#TooManyOriginCustomHeaders": - throw await de_TooManyOriginCustomHeadersRes(parsedOutput, context); - case "TooManyOriginGroupsPerDistribution": - case "com.amazonaws.cloudfront#TooManyOriginGroupsPerDistribution": - throw await de_TooManyOriginGroupsPerDistributionRes(parsedOutput, context); - case "TooManyOrigins": - case "com.amazonaws.cloudfront#TooManyOrigins": - throw await de_TooManyOriginsRes(parsedOutput, context); - case "TooManyQueryStringParameters": - case "com.amazonaws.cloudfront#TooManyQueryStringParameters": - throw await de_TooManyQueryStringParametersRes(parsedOutput, context); - case "TooManyTrustedSigners": - case "com.amazonaws.cloudfront#TooManyTrustedSigners": - throw await de_TooManyTrustedSignersRes(parsedOutput, context); - case "TrustedKeyGroupDoesNotExist": - case "com.amazonaws.cloudfront#TrustedKeyGroupDoesNotExist": - throw await de_TrustedKeyGroupDoesNotExistRes(parsedOutput, context); - case "TrustedSignerDoesNotExist": - case "com.amazonaws.cloudfront#TrustedSignerDoesNotExist": - throw await de_TrustedSignerDoesNotExistRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + [_L]: [, output.headers[_lo]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.KeyValueStore = de_KeyValueStore(data, context); + return contents; }; /** - * deserializeAws_restXmlCreateFieldLevelEncryptionConfigCommand + * deserializeAws_restXmlCreateMonitoringSubscriptionCommand */ -export const de_CreateFieldLevelEncryptionConfigCommand = async ( +export const de_CreateMonitoringSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.MonitoringSubscription = de_MonitoringSubscription(data, context); + return contents; +}; + +/** + * deserializeAws_restXmlCreateOriginAccessControlCommand + */ +export const de_CreateOriginAccessControlCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateFieldLevelEncryptionConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3975,66 +3294,39 @@ export const de_CreateFieldLevelEncryptionConfigCommand = async ( [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.FieldLevelEncryption = de_FieldLevelEncryption(data, context); + contents.OriginAccessControl = de_OriginAccessControl(data, context); return contents; }; /** - * deserializeAws_restXmlCreateFieldLevelEncryptionConfigCommandError + * deserializeAws_restXmlCreateOriginRequestPolicyCommand */ -const de_CreateFieldLevelEncryptionConfigCommandError = async ( +export const de_CreateOriginRequestPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "FieldLevelEncryptionConfigAlreadyExists": - case "com.amazonaws.cloudfront#FieldLevelEncryptionConfigAlreadyExists": - throw await de_FieldLevelEncryptionConfigAlreadyExistsRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchFieldLevelEncryptionProfile": - case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionProfile": - throw await de_NoSuchFieldLevelEncryptionProfileRes(parsedOutput, context); - case "QueryArgProfileEmpty": - case "com.amazonaws.cloudfront#QueryArgProfileEmpty": - throw await de_QueryArgProfileEmptyRes(parsedOutput, context); - case "TooManyFieldLevelEncryptionConfigs": - case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionConfigs": - throw await de_TooManyFieldLevelEncryptionConfigsRes(parsedOutput, context); - case "TooManyFieldLevelEncryptionContentTypeProfiles": - case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionContentTypeProfiles": - throw await de_TooManyFieldLevelEncryptionContentTypeProfilesRes(parsedOutput, context); - case "TooManyFieldLevelEncryptionQueryArgProfiles": - case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionQueryArgProfiles": - throw await de_TooManyFieldLevelEncryptionQueryArgProfilesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_L]: [, output.headers[_lo]], + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.OriginRequestPolicy = de_OriginRequestPolicy(data, context); + return contents; }; /** - * deserializeAws_restXmlCreateFieldLevelEncryptionProfileCommand + * deserializeAws_restXmlCreatePublicKeyCommand */ -export const de_CreateFieldLevelEncryptionProfileCommand = async ( +export const de_CreatePublicKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateFieldLevelEncryptionProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4042,66 +3334,39 @@ export const de_CreateFieldLevelEncryptionProfileCommand = async ( [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.FieldLevelEncryptionProfile = de_FieldLevelEncryptionProfile(data, context); + contents.PublicKey = de_PublicKey(data, context); return contents; }; /** - * deserializeAws_restXmlCreateFieldLevelEncryptionProfileCommandError + * deserializeAws_restXmlCreateRealtimeLogConfigCommand */ -const de_CreateFieldLevelEncryptionProfileCommandError = async ( +export const de_CreateRealtimeLogConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "FieldLevelEncryptionProfileAlreadyExists": - case "com.amazonaws.cloudfront#FieldLevelEncryptionProfileAlreadyExists": - throw await de_FieldLevelEncryptionProfileAlreadyExistsRes(parsedOutput, context); - case "FieldLevelEncryptionProfileSizeExceeded": - case "com.amazonaws.cloudfront#FieldLevelEncryptionProfileSizeExceeded": - throw await de_FieldLevelEncryptionProfileSizeExceededRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchPublicKey": - case "com.amazonaws.cloudfront#NoSuchPublicKey": - throw await de_NoSuchPublicKeyRes(parsedOutput, context); - case "TooManyFieldLevelEncryptionEncryptionEntities": - case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionEncryptionEntities": - throw await de_TooManyFieldLevelEncryptionEncryptionEntitiesRes(parsedOutput, context); - case "TooManyFieldLevelEncryptionFieldPatterns": - case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionFieldPatterns": - throw await de_TooManyFieldLevelEncryptionFieldPatternsRes(parsedOutput, context); - case "TooManyFieldLevelEncryptionProfiles": - case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionProfiles": - throw await de_TooManyFieldLevelEncryptionProfilesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_RLC] != null) { + contents[_RLC] = de_RealtimeLogConfig(data[_RLC], context); } + return contents; }; /** - * deserializeAws_restXmlCreateFunctionCommand + * deserializeAws_restXmlCreateResponseHeadersPolicyCommand */ -export const de_CreateFunctionCommand = async ( +export const de_CreateResponseHeadersPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateFunctionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4109,5697 +3374,1703 @@ export const de_CreateFunctionCommand = async ( [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.FunctionSummary = de_FunctionSummary(data, context); + contents.ResponseHeadersPolicy = de_ResponseHeadersPolicy(data, context); return contents; }; /** - * deserializeAws_restXmlCreateFunctionCommandError + * deserializeAws_restXmlCreateStreamingDistributionCommand */ -const de_CreateFunctionCommandError = async ( +export const de_CreateStreamingDistributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "FunctionAlreadyExists": - case "com.amazonaws.cloudfront#FunctionAlreadyExists": - throw await de_FunctionAlreadyExistsRes(parsedOutput, context); - case "FunctionSizeLimitExceeded": - case "com.amazonaws.cloudfront#FunctionSizeLimitExceeded": - throw await de_FunctionSizeLimitExceededRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "TooManyFunctions": - case "com.amazonaws.cloudfront#TooManyFunctions": - throw await de_TooManyFunctionsRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.cloudfront#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_L]: [, output.headers[_lo]], + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.StreamingDistribution = de_StreamingDistribution(data, context); + return contents; }; /** - * deserializeAws_restXmlCreateInvalidationCommand + * deserializeAws_restXmlCreateStreamingDistributionWithTagsCommand */ -export const de_CreateInvalidationCommand = async ( +export const de_CreateStreamingDistributionWithTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateInvalidationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), [_L]: [, output.headers[_lo]], + [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.Invalidation = de_Invalidation(data, context); + contents.StreamingDistribution = de_StreamingDistribution(data, context); return contents; }; /** - * deserializeAws_restXmlCreateInvalidationCommandError + * deserializeAws_restXmlDeleteCachePolicyCommand */ -const de_CreateInvalidationCommandError = async ( +export const de_DeleteCachePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "BatchTooLarge": - case "com.amazonaws.cloudfront#BatchTooLarge": - throw await de_BatchTooLargeRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "MissingBody": - case "com.amazonaws.cloudfront#MissingBody": - throw await de_MissingBodyRes(parsedOutput, context); - case "NoSuchDistribution": - case "com.amazonaws.cloudfront#NoSuchDistribution": - throw await de_NoSuchDistributionRes(parsedOutput, context); - case "TooManyInvalidationsInProgress": - case "com.amazonaws.cloudfront#TooManyInvalidationsInProgress": - throw await de_TooManyInvalidationsInProgressRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restXmlCreateKeyGroupCommand + * deserializeAws_restXmlDeleteCloudFrontOriginAccessIdentityCommand */ -export const de_CreateKeyGroupCommand = async ( +export const de_DeleteCloudFrontOriginAccessIdentityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateKeyGroupCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_L]: [, output.headers[_lo]], - [_ET]: [, output.headers[_e]], }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.KeyGroup = de_KeyGroup(data, context); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restXmlCreateKeyGroupCommandError + * deserializeAws_restXmlDeleteContinuousDeploymentPolicyCommand */ -const de_CreateKeyGroupCommandError = async ( +export const de_DeleteContinuousDeploymentPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "KeyGroupAlreadyExists": - case "com.amazonaws.cloudfront#KeyGroupAlreadyExists": - throw await de_KeyGroupAlreadyExistsRes(parsedOutput, context); - case "TooManyKeyGroups": - case "com.amazonaws.cloudfront#TooManyKeyGroups": - throw await de_TooManyKeyGroupsRes(parsedOutput, context); - case "TooManyPublicKeysInKeyGroup": - case "com.amazonaws.cloudfront#TooManyPublicKeysInKeyGroup": - throw await de_TooManyPublicKeysInKeyGroupRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restXmlCreateKeyValueStoreCommand + * deserializeAws_restXmlDeleteDistributionCommand */ -export const de_CreateKeyValueStoreCommand = async ( +export const de_DeleteDistributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateKeyValueStoreCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - [_L]: [, output.headers[_lo]], }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.KeyValueStore = de_KeyValueStore(data, context); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restXmlCreateKeyValueStoreCommandError + * deserializeAws_restXmlDeleteFieldLevelEncryptionConfigCommand */ -const de_CreateKeyValueStoreCommandError = async ( +export const de_DeleteFieldLevelEncryptionConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "EntityAlreadyExists": - case "com.amazonaws.cloudfront#EntityAlreadyExists": - throw await de_EntityAlreadyExistsRes(parsedOutput, context); - case "EntityLimitExceeded": - case "com.amazonaws.cloudfront#EntityLimitExceeded": - throw await de_EntityLimitExceededRes(parsedOutput, context); - case "EntitySizeLimitExceeded": - case "com.amazonaws.cloudfront#EntitySizeLimitExceeded": - throw await de_EntitySizeLimitExceededRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restXmlCreateMonitoringSubscriptionCommand + * deserializeAws_restXmlDeleteFieldLevelEncryptionProfileCommand */ -export const de_CreateMonitoringSubscriptionCommand = async ( +export const de_DeleteFieldLevelEncryptionProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMonitoringSubscriptionCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.MonitoringSubscription = de_MonitoringSubscription(data, context); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restXmlCreateMonitoringSubscriptionCommandError + * deserializeAws_restXmlDeleteFunctionCommand */ -const de_CreateMonitoringSubscriptionCommandError = async ( +export const de_DeleteFunctionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "MonitoringSubscriptionAlreadyExists": - case "com.amazonaws.cloudfront#MonitoringSubscriptionAlreadyExists": - throw await de_MonitoringSubscriptionAlreadyExistsRes(parsedOutput, context); - case "NoSuchDistribution": - case "com.amazonaws.cloudfront#NoSuchDistribution": - throw await de_NoSuchDistributionRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.cloudfront#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restXmlCreateOriginAccessControlCommand + * deserializeAws_restXmlDeleteKeyGroupCommand */ -export const de_CreateOriginAccessControlCommand = async ( +export const de_DeleteKeyGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateOriginAccessControlCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_L]: [, output.headers[_lo]], - [_ET]: [, output.headers[_e]], }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.OriginAccessControl = de_OriginAccessControl(data, context); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restXmlCreateOriginAccessControlCommandError + * deserializeAws_restXmlDeleteKeyValueStoreCommand */ -const de_CreateOriginAccessControlCommandError = async ( +export const de_DeleteKeyValueStoreCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "OriginAccessControlAlreadyExists": - case "com.amazonaws.cloudfront#OriginAccessControlAlreadyExists": - throw await de_OriginAccessControlAlreadyExistsRes(parsedOutput, context); - case "TooManyOriginAccessControls": - case "com.amazonaws.cloudfront#TooManyOriginAccessControls": - throw await de_TooManyOriginAccessControlsRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restXmlCreateOriginRequestPolicyCommand + * deserializeAws_restXmlDeleteMonitoringSubscriptionCommand */ -export const de_CreateOriginRequestPolicyCommand = async ( +export const de_DeleteMonitoringSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateOriginRequestPolicyCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_L]: [, output.headers[_lo]], - [_ET]: [, output.headers[_e]], }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.OriginRequestPolicy = de_OriginRequestPolicy(data, context); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restXmlCreateOriginRequestPolicyCommandError + * deserializeAws_restXmlDeleteOriginAccessControlCommand */ -const de_CreateOriginRequestPolicyCommandError = async ( +export const de_DeleteOriginAccessControlCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "OriginRequestPolicyAlreadyExists": - case "com.amazonaws.cloudfront#OriginRequestPolicyAlreadyExists": - throw await de_OriginRequestPolicyAlreadyExistsRes(parsedOutput, context); - case "TooManyCookiesInOriginRequestPolicy": - case "com.amazonaws.cloudfront#TooManyCookiesInOriginRequestPolicy": - throw await de_TooManyCookiesInOriginRequestPolicyRes(parsedOutput, context); - case "TooManyHeadersInOriginRequestPolicy": - case "com.amazonaws.cloudfront#TooManyHeadersInOriginRequestPolicy": - throw await de_TooManyHeadersInOriginRequestPolicyRes(parsedOutput, context); - case "TooManyOriginRequestPolicies": - case "com.amazonaws.cloudfront#TooManyOriginRequestPolicies": - throw await de_TooManyOriginRequestPoliciesRes(parsedOutput, context); - case "TooManyQueryStringsInOriginRequestPolicy": - case "com.amazonaws.cloudfront#TooManyQueryStringsInOriginRequestPolicy": - throw await de_TooManyQueryStringsInOriginRequestPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restXmlCreatePublicKeyCommand + * deserializeAws_restXmlDeleteOriginRequestPolicyCommand */ -export const de_CreatePublicKeyCommand = async ( +export const de_DeleteOriginRequestPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreatePublicKeyCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_L]: [, output.headers[_lo]], - [_ET]: [, output.headers[_e]], }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.PublicKey = de_PublicKey(data, context); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restXmlCreatePublicKeyCommandError + * deserializeAws_restXmlDeletePublicKeyCommand */ -const de_CreatePublicKeyCommandError = async ( +export const de_DeletePublicKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "PublicKeyAlreadyExists": - case "com.amazonaws.cloudfront#PublicKeyAlreadyExists": - throw await de_PublicKeyAlreadyExistsRes(parsedOutput, context); - case "TooManyPublicKeys": - case "com.amazonaws.cloudfront#TooManyPublicKeys": - throw await de_TooManyPublicKeysRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restXmlCreateRealtimeLogConfigCommand + * deserializeAws_restXmlDeleteRealtimeLogConfigCommand */ -export const de_CreateRealtimeLogConfigCommand = async ( +export const de_DeleteRealtimeLogConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateRealtimeLogConfigCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_RLC] != null) { - contents[_RLC] = de_RealtimeLogConfig(data[_RLC], context); - } + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restXmlCreateRealtimeLogConfigCommandError + * deserializeAws_restXmlDeleteResponseHeadersPolicyCommand */ -const de_CreateRealtimeLogConfigCommandError = async ( +export const de_DeleteResponseHeadersPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "RealtimeLogConfigAlreadyExists": - case "com.amazonaws.cloudfront#RealtimeLogConfigAlreadyExists": - throw await de_RealtimeLogConfigAlreadyExistsRes(parsedOutput, context); - case "TooManyRealtimeLogConfigs": - case "com.amazonaws.cloudfront#TooManyRealtimeLogConfigs": - throw await de_TooManyRealtimeLogConfigsRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restXmlCreateResponseHeadersPolicyCommand + * deserializeAws_restXmlDeleteStreamingDistributionCommand */ -export const de_CreateResponseHeadersPolicyCommand = async ( +export const de_DeleteStreamingDistributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateResponseHeadersPolicyCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_L]: [, output.headers[_lo]], - [_ET]: [, output.headers[_e]], }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ResponseHeadersPolicy = de_ResponseHeadersPolicy(data, context); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restXmlCreateResponseHeadersPolicyCommandError + * deserializeAws_restXmlDescribeFunctionCommand */ -const de_CreateResponseHeadersPolicyCommandError = async ( +export const de_DescribeFunctionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "ResponseHeadersPolicyAlreadyExists": - case "com.amazonaws.cloudfront#ResponseHeadersPolicyAlreadyExists": - throw await de_ResponseHeadersPolicyAlreadyExistsRes(parsedOutput, context); - case "TooLongCSPInResponseHeadersPolicy": - case "com.amazonaws.cloudfront#TooLongCSPInResponseHeadersPolicy": - throw await de_TooLongCSPInResponseHeadersPolicyRes(parsedOutput, context); - case "TooManyCustomHeadersInResponseHeadersPolicy": - case "com.amazonaws.cloudfront#TooManyCustomHeadersInResponseHeadersPolicy": - throw await de_TooManyCustomHeadersInResponseHeadersPolicyRes(parsedOutput, context); - case "TooManyRemoveHeadersInResponseHeadersPolicy": - case "com.amazonaws.cloudfront#TooManyRemoveHeadersInResponseHeadersPolicy": - throw await de_TooManyRemoveHeadersInResponseHeadersPolicyRes(parsedOutput, context); - case "TooManyResponseHeadersPolicies": - case "com.amazonaws.cloudfront#TooManyResponseHeadersPolicies": - throw await de_TooManyResponseHeadersPoliciesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.FunctionSummary = de_FunctionSummary(data, context); + return contents; }; /** - * deserializeAws_restXmlCreateStreamingDistributionCommand + * deserializeAws_restXmlDescribeKeyValueStoreCommand */ -export const de_CreateStreamingDistributionCommand = async ( +export const de_DescribeKeyValueStoreCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateStreamingDistributionCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_L]: [, output.headers[_lo]], [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.StreamingDistribution = de_StreamingDistribution(data, context); + contents.KeyValueStore = de_KeyValueStore(data, context); return contents; }; /** - * deserializeAws_restXmlCreateStreamingDistributionCommandError + * deserializeAws_restXmlGetCachePolicyCommand */ -const de_CreateStreamingDistributionCommandError = async ( +export const de_GetCachePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "CNAMEAlreadyExists": - case "com.amazonaws.cloudfront#CNAMEAlreadyExists": - throw await de_CNAMEAlreadyExistsRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidOrigin": - case "com.amazonaws.cloudfront#InvalidOrigin": - throw await de_InvalidOriginRes(parsedOutput, context); - case "InvalidOriginAccessControl": - case "com.amazonaws.cloudfront#InvalidOriginAccessControl": - throw await de_InvalidOriginAccessControlRes(parsedOutput, context); - case "InvalidOriginAccessIdentity": - case "com.amazonaws.cloudfront#InvalidOriginAccessIdentity": - throw await de_InvalidOriginAccessIdentityRes(parsedOutput, context); - case "MissingBody": - case "com.amazonaws.cloudfront#MissingBody": - throw await de_MissingBodyRes(parsedOutput, context); - case "StreamingDistributionAlreadyExists": - case "com.amazonaws.cloudfront#StreamingDistributionAlreadyExists": - throw await de_StreamingDistributionAlreadyExistsRes(parsedOutput, context); - case "TooManyStreamingDistributionCNAMEs": - case "com.amazonaws.cloudfront#TooManyStreamingDistributionCNAMEs": - throw await de_TooManyStreamingDistributionCNAMEsRes(parsedOutput, context); - case "TooManyStreamingDistributions": - case "com.amazonaws.cloudfront#TooManyStreamingDistributions": - throw await de_TooManyStreamingDistributionsRes(parsedOutput, context); - case "TooManyTrustedSigners": - case "com.amazonaws.cloudfront#TooManyTrustedSigners": - throw await de_TooManyTrustedSignersRes(parsedOutput, context); - case "TrustedSignerDoesNotExist": - case "com.amazonaws.cloudfront#TrustedSignerDoesNotExist": - throw await de_TrustedSignerDoesNotExistRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.CachePolicy = de_CachePolicy(data, context); + return contents; }; /** - * deserializeAws_restXmlCreateStreamingDistributionWithTagsCommand + * deserializeAws_restXmlGetCachePolicyConfigCommand */ -export const de_CreateStreamingDistributionWithTagsCommand = async ( +export const de_GetCachePolicyConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateStreamingDistributionWithTagsCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_L]: [, output.headers[_lo]], [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.StreamingDistribution = de_StreamingDistribution(data, context); + contents.CachePolicyConfig = de_CachePolicyConfig(data, context); return contents; }; /** - * deserializeAws_restXmlCreateStreamingDistributionWithTagsCommandError + * deserializeAws_restXmlGetCloudFrontOriginAccessIdentityCommand */ -const de_CreateStreamingDistributionWithTagsCommandError = async ( +export const de_GetCloudFrontOriginAccessIdentityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "CNAMEAlreadyExists": - case "com.amazonaws.cloudfront#CNAMEAlreadyExists": - throw await de_CNAMEAlreadyExistsRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidOrigin": - case "com.amazonaws.cloudfront#InvalidOrigin": - throw await de_InvalidOriginRes(parsedOutput, context); - case "InvalidOriginAccessControl": - case "com.amazonaws.cloudfront#InvalidOriginAccessControl": - throw await de_InvalidOriginAccessControlRes(parsedOutput, context); - case "InvalidOriginAccessIdentity": - case "com.amazonaws.cloudfront#InvalidOriginAccessIdentity": - throw await de_InvalidOriginAccessIdentityRes(parsedOutput, context); - case "InvalidTagging": - case "com.amazonaws.cloudfront#InvalidTagging": - throw await de_InvalidTaggingRes(parsedOutput, context); - case "MissingBody": - case "com.amazonaws.cloudfront#MissingBody": - throw await de_MissingBodyRes(parsedOutput, context); - case "StreamingDistributionAlreadyExists": - case "com.amazonaws.cloudfront#StreamingDistributionAlreadyExists": - throw await de_StreamingDistributionAlreadyExistsRes(parsedOutput, context); - case "TooManyStreamingDistributionCNAMEs": - case "com.amazonaws.cloudfront#TooManyStreamingDistributionCNAMEs": - throw await de_TooManyStreamingDistributionCNAMEsRes(parsedOutput, context); - case "TooManyStreamingDistributions": - case "com.amazonaws.cloudfront#TooManyStreamingDistributions": - throw await de_TooManyStreamingDistributionsRes(parsedOutput, context); - case "TooManyTrustedSigners": - case "com.amazonaws.cloudfront#TooManyTrustedSigners": - throw await de_TooManyTrustedSignersRes(parsedOutput, context); - case "TrustedSignerDoesNotExist": - case "com.amazonaws.cloudfront#TrustedSignerDoesNotExist": - throw await de_TrustedSignerDoesNotExistRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.CloudFrontOriginAccessIdentity = de_CloudFrontOriginAccessIdentity(data, context); + return contents; }; /** - * deserializeAws_restXmlDeleteCachePolicyCommand + * deserializeAws_restXmlGetCloudFrontOriginAccessIdentityConfigCommand */ -export const de_DeleteCachePolicyCommand = async ( +export const de_GetCloudFrontOriginAccessIdentityConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteCachePolicyCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.CloudFrontOriginAccessIdentityConfig = de_CloudFrontOriginAccessIdentityConfig(data, context); return contents; }; /** - * deserializeAws_restXmlDeleteCachePolicyCommandError + * deserializeAws_restXmlGetContinuousDeploymentPolicyCommand */ -const de_DeleteCachePolicyCommandError = async ( +export const de_GetContinuousDeploymentPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "CachePolicyInUse": - case "com.amazonaws.cloudfront#CachePolicyInUse": - throw await de_CachePolicyInUseRes(parsedOutput, context); - case "IllegalDelete": - case "com.amazonaws.cloudfront#IllegalDelete": - throw await de_IllegalDeleteRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchCachePolicy": - case "com.amazonaws.cloudfront#NoSuchCachePolicy": - throw await de_NoSuchCachePolicyRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.ContinuousDeploymentPolicy = de_ContinuousDeploymentPolicy(data, context); + return contents; }; /** - * deserializeAws_restXmlDeleteCloudFrontOriginAccessIdentityCommand + * deserializeAws_restXmlGetContinuousDeploymentPolicyConfigCommand */ -export const de_DeleteCloudFrontOriginAccessIdentityCommand = async ( +export const de_GetContinuousDeploymentPolicyConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteCloudFrontOriginAccessIdentityCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.ContinuousDeploymentPolicyConfig = de_ContinuousDeploymentPolicyConfig(data, context); return contents; }; /** - * deserializeAws_restXmlDeleteCloudFrontOriginAccessIdentityCommandError + * deserializeAws_restXmlGetDistributionCommand */ -const de_DeleteCloudFrontOriginAccessIdentityCommandError = async ( +export const de_GetDistributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "CloudFrontOriginAccessIdentityInUse": - case "com.amazonaws.cloudfront#CloudFrontOriginAccessIdentityInUse": - throw await de_CloudFrontOriginAccessIdentityInUseRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchCloudFrontOriginAccessIdentity": - case "com.amazonaws.cloudfront#NoSuchCloudFrontOriginAccessIdentity": - throw await de_NoSuchCloudFrontOriginAccessIdentityRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.Distribution = de_Distribution(data, context); + return contents; }; /** - * deserializeAws_restXmlDeleteContinuousDeploymentPolicyCommand + * deserializeAws_restXmlGetDistributionConfigCommand */ -export const de_DeleteContinuousDeploymentPolicyCommand = async ( +export const de_GetDistributionConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteContinuousDeploymentPolicyCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.DistributionConfig = de_DistributionConfig(data, context); return contents; }; /** - * deserializeAws_restXmlDeleteContinuousDeploymentPolicyCommandError + * deserializeAws_restXmlGetFieldLevelEncryptionCommand */ -const de_DeleteContinuousDeploymentPolicyCommandError = async ( +export const de_GetFieldLevelEncryptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "ContinuousDeploymentPolicyInUse": - case "com.amazonaws.cloudfront#ContinuousDeploymentPolicyInUse": - throw await de_ContinuousDeploymentPolicyInUseRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchContinuousDeploymentPolicy": - case "com.amazonaws.cloudfront#NoSuchContinuousDeploymentPolicy": - throw await de_NoSuchContinuousDeploymentPolicyRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.FieldLevelEncryption = de_FieldLevelEncryption(data, context); + return contents; }; /** - * deserializeAws_restXmlDeleteDistributionCommand + * deserializeAws_restXmlGetFieldLevelEncryptionConfigCommand */ -export const de_DeleteDistributionCommand = async ( +export const de_GetFieldLevelEncryptionConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDistributionCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.FieldLevelEncryptionConfig = de_FieldLevelEncryptionConfig(data, context); return contents; }; /** - * deserializeAws_restXmlDeleteDistributionCommandError + * deserializeAws_restXmlGetFieldLevelEncryptionProfileCommand */ -const de_DeleteDistributionCommandError = async ( +export const de_GetFieldLevelEncryptionProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "DistributionNotDisabled": - case "com.amazonaws.cloudfront#DistributionNotDisabled": - throw await de_DistributionNotDisabledRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchDistribution": - case "com.amazonaws.cloudfront#NoSuchDistribution": - throw await de_NoSuchDistributionRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.FieldLevelEncryptionProfile = de_FieldLevelEncryptionProfile(data, context); + return contents; }; /** - * deserializeAws_restXmlDeleteFieldLevelEncryptionConfigCommand + * deserializeAws_restXmlGetFieldLevelEncryptionProfileConfigCommand */ -export const de_DeleteFieldLevelEncryptionConfigCommand = async ( +export const de_GetFieldLevelEncryptionProfileConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteFieldLevelEncryptionConfigCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.FieldLevelEncryptionProfileConfig = de_FieldLevelEncryptionProfileConfig(data, context); return contents; }; /** - * deserializeAws_restXmlDeleteFieldLevelEncryptionConfigCommandError + * deserializeAws_restXmlGetFunctionCommand */ -const de_DeleteFieldLevelEncryptionConfigCommandError = async ( +export const de_GetFunctionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "FieldLevelEncryptionConfigInUse": - case "com.amazonaws.cloudfront#FieldLevelEncryptionConfigInUse": - throw await de_FieldLevelEncryptionConfigInUseRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchFieldLevelEncryptionConfig": - case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig": - throw await de_NoSuchFieldLevelEncryptionConfigRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + [_CT]: [, output.headers[_ct]], + }); + const data: any = await collectBody(output.body, context); + contents.FunctionCode = data; + return contents; }; /** - * deserializeAws_restXmlDeleteFieldLevelEncryptionProfileCommand + * deserializeAws_restXmlGetInvalidationCommand */ -export const de_DeleteFieldLevelEncryptionProfileCommand = async ( +export const de_GetInvalidationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteFieldLevelEncryptionProfileCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.Invalidation = de_Invalidation(data, context); return contents; }; /** - * deserializeAws_restXmlDeleteFieldLevelEncryptionProfileCommandError + * deserializeAws_restXmlGetKeyGroupCommand */ -const de_DeleteFieldLevelEncryptionProfileCommandError = async ( +export const de_GetKeyGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "FieldLevelEncryptionProfileInUse": - case "com.amazonaws.cloudfront#FieldLevelEncryptionProfileInUse": - throw await de_FieldLevelEncryptionProfileInUseRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchFieldLevelEncryptionProfile": - case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionProfile": - throw await de_NoSuchFieldLevelEncryptionProfileRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.KeyGroup = de_KeyGroup(data, context); + return contents; }; /** - * deserializeAws_restXmlDeleteFunctionCommand + * deserializeAws_restXmlGetKeyGroupConfigCommand */ -export const de_DeleteFunctionCommand = async ( +export const de_GetKeyGroupConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteFunctionCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.KeyGroupConfig = de_KeyGroupConfig(data, context); return contents; }; /** - * deserializeAws_restXmlDeleteFunctionCommandError + * deserializeAws_restXmlGetMonitoringSubscriptionCommand */ -const de_DeleteFunctionCommandError = async ( +export const de_GetMonitoringSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "FunctionInUse": - case "com.amazonaws.cloudfront#FunctionInUse": - throw await de_FunctionInUseRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchFunctionExists": - case "com.amazonaws.cloudfront#NoSuchFunctionExists": - throw await de_NoSuchFunctionExistsRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.cloudfront#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.MonitoringSubscription = de_MonitoringSubscription(data, context); + return contents; }; /** - * deserializeAws_restXmlDeleteKeyGroupCommand + * deserializeAws_restXmlGetOriginAccessControlCommand */ -export const de_DeleteKeyGroupCommand = async ( +export const de_GetOriginAccessControlCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteKeyGroupCommandError(output, context); - } +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } const contents: any = map({ $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.OriginAccessControl = de_OriginAccessControl(data, context); return contents; }; /** - * deserializeAws_restXmlDeleteKeyGroupCommandError + * deserializeAws_restXmlGetOriginAccessControlConfigCommand */ -const de_DeleteKeyGroupCommandError = async ( +export const de_GetOriginAccessControlConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchResource": - case "com.amazonaws.cloudfront#NoSuchResource": - throw await de_NoSuchResourceRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.cloudfront#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.OriginAccessControlConfig = de_OriginAccessControlConfig(data, context); + return contents; }; /** - * deserializeAws_restXmlDeleteKeyValueStoreCommand + * deserializeAws_restXmlGetOriginRequestPolicyCommand */ -export const de_DeleteKeyValueStoreCommand = async ( +export const de_GetOriginRequestPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteKeyValueStoreCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.OriginRequestPolicy = de_OriginRequestPolicy(data, context); return contents; }; /** - * deserializeAws_restXmlDeleteKeyValueStoreCommandError + * deserializeAws_restXmlGetOriginRequestPolicyConfigCommand */ -const de_DeleteKeyValueStoreCommandError = async ( +export const de_GetOriginRequestPolicyConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "CannotDeleteEntityWhileInUse": - case "com.amazonaws.cloudfront#CannotDeleteEntityWhileInUse": - throw await de_CannotDeleteEntityWhileInUseRes(parsedOutput, context); - case "EntityNotFound": - case "com.amazonaws.cloudfront#EntityNotFound": - throw await de_EntityNotFoundRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.OriginRequestPolicyConfig = de_OriginRequestPolicyConfig(data, context); + return contents; }; /** - * deserializeAws_restXmlDeleteMonitoringSubscriptionCommand + * deserializeAws_restXmlGetPublicKeyCommand */ -export const de_DeleteMonitoringSubscriptionCommand = async ( +export const de_GetPublicKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMonitoringSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.PublicKey = de_PublicKey(data, context); return contents; }; /** - * deserializeAws_restXmlDeleteMonitoringSubscriptionCommandError + * deserializeAws_restXmlGetPublicKeyConfigCommand */ -const de_DeleteMonitoringSubscriptionCommandError = async ( +export const de_GetPublicKeyConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchDistribution": - case "com.amazonaws.cloudfront#NoSuchDistribution": - throw await de_NoSuchDistributionRes(parsedOutput, context); - case "NoSuchMonitoringSubscription": - case "com.amazonaws.cloudfront#NoSuchMonitoringSubscription": - throw await de_NoSuchMonitoringSubscriptionRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.cloudfront#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.PublicKeyConfig = de_PublicKeyConfig(data, context); + return contents; }; /** - * deserializeAws_restXmlDeleteOriginAccessControlCommand + * deserializeAws_restXmlGetRealtimeLogConfigCommand */ -export const de_DeleteOriginAccessControlCommand = async ( +export const de_GetRealtimeLogConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteOriginAccessControlCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_RLC] != null) { + contents[_RLC] = de_RealtimeLogConfig(data[_RLC], context); + } return contents; }; /** - * deserializeAws_restXmlDeleteOriginAccessControlCommandError + * deserializeAws_restXmlGetResponseHeadersPolicyCommand */ -const de_DeleteOriginAccessControlCommandError = async ( +export const de_GetResponseHeadersPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchOriginAccessControl": - case "com.amazonaws.cloudfront#NoSuchOriginAccessControl": - throw await de_NoSuchOriginAccessControlRes(parsedOutput, context); - case "OriginAccessControlInUse": - case "com.amazonaws.cloudfront#OriginAccessControlInUse": - throw await de_OriginAccessControlInUseRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.ResponseHeadersPolicy = de_ResponseHeadersPolicy(data, context); + return contents; }; /** - * deserializeAws_restXmlDeleteOriginRequestPolicyCommand + * deserializeAws_restXmlGetResponseHeadersPolicyConfigCommand */ -export const de_DeleteOriginRequestPolicyCommand = async ( +export const de_GetResponseHeadersPolicyConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteOriginRequestPolicyCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.ResponseHeadersPolicyConfig = de_ResponseHeadersPolicyConfig(data, context); return contents; }; /** - * deserializeAws_restXmlDeleteOriginRequestPolicyCommandError + * deserializeAws_restXmlGetStreamingDistributionCommand */ -const de_DeleteOriginRequestPolicyCommandError = async ( +export const de_GetStreamingDistributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "IllegalDelete": - case "com.amazonaws.cloudfront#IllegalDelete": - throw await de_IllegalDeleteRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchOriginRequestPolicy": - case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy": - throw await de_NoSuchOriginRequestPolicyRes(parsedOutput, context); - case "OriginRequestPolicyInUse": - case "com.amazonaws.cloudfront#OriginRequestPolicyInUse": - throw await de_OriginRequestPolicyInUseRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.StreamingDistribution = de_StreamingDistribution(data, context); + return contents; }; /** - * deserializeAws_restXmlDeletePublicKeyCommand + * deserializeAws_restXmlGetStreamingDistributionConfigCommand */ -export const de_DeletePublicKeyCommand = async ( +export const de_GetStreamingDistributionConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeletePublicKeyCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.StreamingDistributionConfig = de_StreamingDistributionConfig(data, context); return contents; }; /** - * deserializeAws_restXmlDeletePublicKeyCommandError + * deserializeAws_restXmlListCachePoliciesCommand */ -const de_DeletePublicKeyCommandError = async ( +export const de_ListCachePoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchPublicKey": - case "com.amazonaws.cloudfront#NoSuchPublicKey": - throw await de_NoSuchPublicKeyRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "PublicKeyInUse": - case "com.amazonaws.cloudfront#PublicKeyInUse": - throw await de_PublicKeyInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.CachePolicyList = de_CachePolicyList(data, context); + return contents; }; /** - * deserializeAws_restXmlDeleteRealtimeLogConfigCommand + * deserializeAws_restXmlListCloudFrontOriginAccessIdentitiesCommand */ -export const de_DeleteRealtimeLogConfigCommand = async ( +export const de_ListCloudFrontOriginAccessIdentitiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRealtimeLogConfigCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.CloudFrontOriginAccessIdentityList = de_CloudFrontOriginAccessIdentityList(data, context); return contents; }; /** - * deserializeAws_restXmlDeleteRealtimeLogConfigCommandError + * deserializeAws_restXmlListConflictingAliasesCommand */ -const de_DeleteRealtimeLogConfigCommandError = async ( +export const de_ListConflictingAliasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchRealtimeLogConfig": - case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig": - throw await de_NoSuchRealtimeLogConfigRes(parsedOutput, context); - case "RealtimeLogConfigInUse": - case "com.amazonaws.cloudfront#RealtimeLogConfigInUse": - throw await de_RealtimeLogConfigInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.ConflictingAliasesList = de_ConflictingAliasesList(data, context); + return contents; }; /** - * deserializeAws_restXmlDeleteResponseHeadersPolicyCommand + * deserializeAws_restXmlListContinuousDeploymentPoliciesCommand */ -export const de_DeleteResponseHeadersPolicyCommand = async ( +export const de_ListContinuousDeploymentPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteResponseHeadersPolicyCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.ContinuousDeploymentPolicyList = de_ContinuousDeploymentPolicyList(data, context); return contents; }; /** - * deserializeAws_restXmlDeleteResponseHeadersPolicyCommandError + * deserializeAws_restXmlListDistributionsCommand */ -const de_DeleteResponseHeadersPolicyCommandError = async ( +export const de_ListDistributionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "IllegalDelete": - case "com.amazonaws.cloudfront#IllegalDelete": - throw await de_IllegalDeleteRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchResponseHeadersPolicy": - case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy": - throw await de_NoSuchResponseHeadersPolicyRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "ResponseHeadersPolicyInUse": - case "com.amazonaws.cloudfront#ResponseHeadersPolicyInUse": - throw await de_ResponseHeadersPolicyInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.DistributionList = de_DistributionList(data, context); + return contents; }; /** - * deserializeAws_restXmlDeleteStreamingDistributionCommand + * deserializeAws_restXmlListDistributionsByCachePolicyIdCommand */ -export const de_DeleteStreamingDistributionCommand = async ( +export const de_ListDistributionsByCachePolicyIdCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteStreamingDistributionCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.DistributionIdList = de_DistributionIdList(data, context); return contents; }; /** - * deserializeAws_restXmlDeleteStreamingDistributionCommandError + * deserializeAws_restXmlListDistributionsByKeyGroupCommand */ -const de_DeleteStreamingDistributionCommandError = async ( +export const de_ListDistributionsByKeyGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchStreamingDistribution": - case "com.amazonaws.cloudfront#NoSuchStreamingDistribution": - throw await de_NoSuchStreamingDistributionRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "StreamingDistributionNotDisabled": - case "com.amazonaws.cloudfront#StreamingDistributionNotDisabled": - throw await de_StreamingDistributionNotDisabledRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.DistributionIdList = de_DistributionIdList(data, context); + return contents; }; /** - * deserializeAws_restXmlDescribeFunctionCommand + * deserializeAws_restXmlListDistributionsByOriginRequestPolicyIdCommand */ -export const de_DescribeFunctionCommand = async ( +export const de_ListDistributionsByOriginRequestPolicyIdCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFunctionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.FunctionSummary = de_FunctionSummary(data, context); + contents.DistributionIdList = de_DistributionIdList(data, context); return contents; }; /** - * deserializeAws_restXmlDescribeFunctionCommandError + * deserializeAws_restXmlListDistributionsByRealtimeLogConfigCommand */ -const de_DescribeFunctionCommandError = async ( +export const de_ListDistributionsByRealtimeLogConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchFunctionExists": - case "com.amazonaws.cloudfront#NoSuchFunctionExists": - throw await de_NoSuchFunctionExistsRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.cloudfront#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.DistributionList = de_DistributionList(data, context); + return contents; }; /** - * deserializeAws_restXmlDescribeKeyValueStoreCommand + * deserializeAws_restXmlListDistributionsByResponseHeadersPolicyIdCommand */ -export const de_DescribeKeyValueStoreCommand = async ( +export const de_ListDistributionsByResponseHeadersPolicyIdCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeKeyValueStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.KeyValueStore = de_KeyValueStore(data, context); + contents.DistributionIdList = de_DistributionIdList(data, context); return contents; }; /** - * deserializeAws_restXmlDescribeKeyValueStoreCommandError + * deserializeAws_restXmlListDistributionsByWebACLIdCommand */ -const de_DescribeKeyValueStoreCommandError = async ( +export const de_ListDistributionsByWebACLIdCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "EntityNotFound": - case "com.amazonaws.cloudfront#EntityNotFound": - throw await de_EntityNotFoundRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.DistributionList = de_DistributionList(data, context); + return contents; }; /** - * deserializeAws_restXmlGetCachePolicyCommand + * deserializeAws_restXmlListFieldLevelEncryptionConfigsCommand */ -export const de_GetCachePolicyCommand = async ( +export const de_ListFieldLevelEncryptionConfigsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCachePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CachePolicy = de_CachePolicy(data, context); + contents.FieldLevelEncryptionList = de_FieldLevelEncryptionList(data, context); return contents; }; /** - * deserializeAws_restXmlGetCachePolicyCommandError + * deserializeAws_restXmlListFieldLevelEncryptionProfilesCommand */ -const de_GetCachePolicyCommandError = async ( +export const de_ListFieldLevelEncryptionProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchCachePolicy": - case "com.amazonaws.cloudfront#NoSuchCachePolicy": - throw await de_NoSuchCachePolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.FieldLevelEncryptionProfileList = de_FieldLevelEncryptionProfileList(data, context); + return contents; }; /** - * deserializeAws_restXmlGetCachePolicyConfigCommand + * deserializeAws_restXmlListFunctionsCommand */ -export const de_GetCachePolicyConfigCommand = async ( +export const de_ListFunctionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCachePolicyConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CachePolicyConfig = de_CachePolicyConfig(data, context); + contents.FunctionList = de_FunctionList(data, context); return contents; }; /** - * deserializeAws_restXmlGetCachePolicyConfigCommandError + * deserializeAws_restXmlListInvalidationsCommand */ -const de_GetCachePolicyConfigCommandError = async ( +export const de_ListInvalidationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchCachePolicy": - case "com.amazonaws.cloudfront#NoSuchCachePolicy": - throw await de_NoSuchCachePolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.InvalidationList = de_InvalidationList(data, context); + return contents; }; /** - * deserializeAws_restXmlGetCloudFrontOriginAccessIdentityCommand + * deserializeAws_restXmlListKeyGroupsCommand */ -export const de_GetCloudFrontOriginAccessIdentityCommand = async ( +export const de_ListKeyGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCloudFrontOriginAccessIdentityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CloudFrontOriginAccessIdentity = de_CloudFrontOriginAccessIdentity(data, context); + contents.KeyGroupList = de_KeyGroupList(data, context); return contents; }; /** - * deserializeAws_restXmlGetCloudFrontOriginAccessIdentityCommandError + * deserializeAws_restXmlListKeyValueStoresCommand */ -const de_GetCloudFrontOriginAccessIdentityCommandError = async ( +export const de_ListKeyValueStoresCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchCloudFrontOriginAccessIdentity": - case "com.amazonaws.cloudfront#NoSuchCloudFrontOriginAccessIdentity": - throw await de_NoSuchCloudFrontOriginAccessIdentityRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.KeyValueStoreList = de_KeyValueStoreList(data, context); + return contents; }; /** - * deserializeAws_restXmlGetCloudFrontOriginAccessIdentityConfigCommand + * deserializeAws_restXmlListOriginAccessControlsCommand */ -export const de_GetCloudFrontOriginAccessIdentityConfigCommand = async ( +export const de_ListOriginAccessControlsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCloudFrontOriginAccessIdentityConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CloudFrontOriginAccessIdentityConfig = de_CloudFrontOriginAccessIdentityConfig(data, context); + contents.OriginAccessControlList = de_OriginAccessControlList(data, context); return contents; }; /** - * deserializeAws_restXmlGetCloudFrontOriginAccessIdentityConfigCommandError + * deserializeAws_restXmlListOriginRequestPoliciesCommand */ -const de_GetCloudFrontOriginAccessIdentityConfigCommandError = async ( +export const de_ListOriginRequestPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchCloudFrontOriginAccessIdentity": - case "com.amazonaws.cloudfront#NoSuchCloudFrontOriginAccessIdentity": - throw await de_NoSuchCloudFrontOriginAccessIdentityRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.OriginRequestPolicyList = de_OriginRequestPolicyList(data, context); + return contents; }; /** - * deserializeAws_restXmlGetContinuousDeploymentPolicyCommand + * deserializeAws_restXmlListPublicKeysCommand */ -export const de_GetContinuousDeploymentPolicyCommand = async ( +export const de_ListPublicKeysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetContinuousDeploymentPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ContinuousDeploymentPolicy = de_ContinuousDeploymentPolicy(data, context); + contents.PublicKeyList = de_PublicKeyList(data, context); return contents; }; /** - * deserializeAws_restXmlGetContinuousDeploymentPolicyCommandError + * deserializeAws_restXmlListRealtimeLogConfigsCommand */ -const de_GetContinuousDeploymentPolicyCommandError = async ( +export const de_ListRealtimeLogConfigsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchContinuousDeploymentPolicy": - case "com.amazonaws.cloudfront#NoSuchContinuousDeploymentPolicy": - throw await de_NoSuchContinuousDeploymentPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.RealtimeLogConfigs = de_RealtimeLogConfigs(data, context); + return contents; }; /** - * deserializeAws_restXmlGetContinuousDeploymentPolicyConfigCommand + * deserializeAws_restXmlListResponseHeadersPoliciesCommand */ -export const de_GetContinuousDeploymentPolicyConfigCommand = async ( +export const de_ListResponseHeadersPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetContinuousDeploymentPolicyConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ContinuousDeploymentPolicyConfig = de_ContinuousDeploymentPolicyConfig(data, context); + contents.ResponseHeadersPolicyList = de_ResponseHeadersPolicyList(data, context); return contents; }; /** - * deserializeAws_restXmlGetContinuousDeploymentPolicyConfigCommandError + * deserializeAws_restXmlListStreamingDistributionsCommand */ -const de_GetContinuousDeploymentPolicyConfigCommandError = async ( +export const de_ListStreamingDistributionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchContinuousDeploymentPolicy": - case "com.amazonaws.cloudfront#NoSuchContinuousDeploymentPolicy": - throw await de_NoSuchContinuousDeploymentPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.StreamingDistributionList = de_StreamingDistributionList(data, context); + return contents; }; /** - * deserializeAws_restXmlGetDistributionCommand + * deserializeAws_restXmlListTagsForResourceCommand */ -export const de_GetDistributionCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDistributionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.Distribution = de_Distribution(data, context); + contents.Tags = de_Tags(data, context); return contents; }; /** - * deserializeAws_restXmlGetDistributionCommandError + * deserializeAws_restXmlPublishFunctionCommand */ -const de_GetDistributionCommandError = async ( +export const de_PublishFunctionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchDistribution": - case "com.amazonaws.cloudfront#NoSuchDistribution": - throw await de_NoSuchDistributionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.FunctionSummary = de_FunctionSummary(data, context); + return contents; }; /** - * deserializeAws_restXmlGetDistributionConfigCommand + * deserializeAws_restXmlTagResourceCommand */ -export const de_GetDistributionConfigCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDistributionConfigCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.DistributionConfig = de_DistributionConfig(data, context); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restXmlGetDistributionConfigCommandError + * deserializeAws_restXmlTestFunctionCommand */ -const de_GetDistributionConfigCommandError = async ( +export const de_TestFunctionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchDistribution": - case "com.amazonaws.cloudfront#NoSuchDistribution": - throw await de_NoSuchDistributionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.TestResult = de_TestResult(data, context); + return contents; }; /** - * deserializeAws_restXmlGetFieldLevelEncryptionCommand + * deserializeAws_restXmlUntagResourceCommand */ -export const de_GetFieldLevelEncryptionCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFieldLevelEncryptionCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.FieldLevelEncryption = de_FieldLevelEncryption(data, context); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restXmlGetFieldLevelEncryptionCommandError + * deserializeAws_restXmlUpdateCachePolicyCommand */ -const de_GetFieldLevelEncryptionCommandError = async ( +export const de_UpdateCachePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchFieldLevelEncryptionConfig": - case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig": - throw await de_NoSuchFieldLevelEncryptionConfigRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.CachePolicy = de_CachePolicy(data, context); + return contents; }; /** - * deserializeAws_restXmlGetFieldLevelEncryptionConfigCommand + * deserializeAws_restXmlUpdateCloudFrontOriginAccessIdentityCommand */ -export const de_GetFieldLevelEncryptionConfigCommand = async ( +export const de_UpdateCloudFrontOriginAccessIdentityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFieldLevelEncryptionConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.FieldLevelEncryptionConfig = de_FieldLevelEncryptionConfig(data, context); + contents.CloudFrontOriginAccessIdentity = de_CloudFrontOriginAccessIdentity(data, context); return contents; }; /** - * deserializeAws_restXmlGetFieldLevelEncryptionConfigCommandError + * deserializeAws_restXmlUpdateContinuousDeploymentPolicyCommand */ -const de_GetFieldLevelEncryptionConfigCommandError = async ( +export const de_UpdateContinuousDeploymentPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchFieldLevelEncryptionConfig": - case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig": - throw await de_NoSuchFieldLevelEncryptionConfigRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.ContinuousDeploymentPolicy = de_ContinuousDeploymentPolicy(data, context); + return contents; }; /** - * deserializeAws_restXmlGetFieldLevelEncryptionProfileCommand + * deserializeAws_restXmlUpdateDistributionCommand */ -export const de_GetFieldLevelEncryptionProfileCommand = async ( +export const de_UpdateDistributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFieldLevelEncryptionProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.FieldLevelEncryptionProfile = de_FieldLevelEncryptionProfile(data, context); + contents.Distribution = de_Distribution(data, context); return contents; }; /** - * deserializeAws_restXmlGetFieldLevelEncryptionProfileCommandError + * deserializeAws_restXmlUpdateDistributionWithStagingConfigCommand */ -const de_GetFieldLevelEncryptionProfileCommandError = async ( +export const de_UpdateDistributionWithStagingConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchFieldLevelEncryptionProfile": - case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionProfile": - throw await de_NoSuchFieldLevelEncryptionProfileRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.Distribution = de_Distribution(data, context); + return contents; }; /** - * deserializeAws_restXmlGetFieldLevelEncryptionProfileConfigCommand + * deserializeAws_restXmlUpdateFieldLevelEncryptionConfigCommand */ -export const de_GetFieldLevelEncryptionProfileConfigCommand = async ( +export const de_UpdateFieldLevelEncryptionConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFieldLevelEncryptionProfileConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.FieldLevelEncryptionProfileConfig = de_FieldLevelEncryptionProfileConfig(data, context); + contents.FieldLevelEncryption = de_FieldLevelEncryption(data, context); return contents; }; /** - * deserializeAws_restXmlGetFieldLevelEncryptionProfileConfigCommandError + * deserializeAws_restXmlUpdateFieldLevelEncryptionProfileCommand */ -const de_GetFieldLevelEncryptionProfileConfigCommandError = async ( +export const de_UpdateFieldLevelEncryptionProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchFieldLevelEncryptionProfile": - case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionProfile": - throw await de_NoSuchFieldLevelEncryptionProfileRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.FieldLevelEncryptionProfile = de_FieldLevelEncryptionProfile(data, context); + return contents; }; /** - * deserializeAws_restXmlGetFunctionCommand + * deserializeAws_restXmlUpdateFunctionCommand */ -export const de_GetFunctionCommand = async ( +export const de_UpdateFunctionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFunctionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - [_CT]: [, output.headers[_ct]], + [_ET]: [, output.headers[_et]], }); - const data: any = await collectBody(output.body, context); - contents.FunctionCode = data; + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.FunctionSummary = de_FunctionSummary(data, context); return contents; }; /** - * deserializeAws_restXmlGetFunctionCommandError + * deserializeAws_restXmlUpdateKeyGroupCommand */ -const de_GetFunctionCommandError = async ( +export const de_UpdateKeyGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchFunctionExists": - case "com.amazonaws.cloudfront#NoSuchFunctionExists": - throw await de_NoSuchFunctionExistsRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.cloudfront#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetInvalidationCommand - */ -export const de_GetInvalidationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInvalidationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.Invalidation = de_Invalidation(data, context); + contents.KeyGroup = de_KeyGroup(data, context); return contents; }; /** - * deserializeAws_restXmlGetInvalidationCommandError - */ -const de_GetInvalidationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchDistribution": - case "com.amazonaws.cloudfront#NoSuchDistribution": - throw await de_NoSuchDistributionRes(parsedOutput, context); - case "NoSuchInvalidation": - case "com.amazonaws.cloudfront#NoSuchInvalidation": - throw await de_NoSuchInvalidationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetKeyGroupCommand + * deserializeAws_restXmlUpdateKeyValueStoreCommand */ -export const de_GetKeyGroupCommand = async ( +export const de_UpdateKeyValueStoreCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetKeyGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.KeyGroup = de_KeyGroup(data, context); + contents.KeyValueStore = de_KeyValueStore(data, context); return contents; }; /** - * deserializeAws_restXmlGetKeyGroupCommandError - */ -const de_GetKeyGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchResource": - case "com.amazonaws.cloudfront#NoSuchResource": - throw await de_NoSuchResourceRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetKeyGroupConfigCommand + * deserializeAws_restXmlUpdateOriginAccessControlCommand */ -export const de_GetKeyGroupConfigCommand = async ( +export const de_UpdateOriginAccessControlCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetKeyGroupConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.KeyGroupConfig = de_KeyGroupConfig(data, context); + contents.OriginAccessControl = de_OriginAccessControl(data, context); return contents; }; /** - * deserializeAws_restXmlGetKeyGroupConfigCommandError - */ -const de_GetKeyGroupConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchResource": - case "com.amazonaws.cloudfront#NoSuchResource": - throw await de_NoSuchResourceRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetMonitoringSubscriptionCommand + * deserializeAws_restXmlUpdateOriginRequestPolicyCommand */ -export const de_GetMonitoringSubscriptionCommand = async ( +export const de_UpdateOriginRequestPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMonitoringSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), + [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.MonitoringSubscription = de_MonitoringSubscription(data, context); + contents.OriginRequestPolicy = de_OriginRequestPolicy(data, context); return contents; }; /** - * deserializeAws_restXmlGetMonitoringSubscriptionCommandError - */ -const de_GetMonitoringSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchDistribution": - case "com.amazonaws.cloudfront#NoSuchDistribution": - throw await de_NoSuchDistributionRes(parsedOutput, context); - case "NoSuchMonitoringSubscription": - case "com.amazonaws.cloudfront#NoSuchMonitoringSubscription": - throw await de_NoSuchMonitoringSubscriptionRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.cloudfront#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetOriginAccessControlCommand + * deserializeAws_restXmlUpdatePublicKeyCommand */ -export const de_GetOriginAccessControlCommand = async ( +export const de_UpdatePublicKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOriginAccessControlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.OriginAccessControl = de_OriginAccessControl(data, context); + contents.PublicKey = de_PublicKey(data, context); return contents; }; /** - * deserializeAws_restXmlGetOriginAccessControlCommandError + * deserializeAws_restXmlUpdateRealtimeLogConfigCommand */ -const de_GetOriginAccessControlCommandError = async ( +export const de_UpdateRealtimeLogConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchOriginAccessControl": - case "com.amazonaws.cloudfront#NoSuchOriginAccessControl": - throw await de_NoSuchOriginAccessControlRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_RLC] != null) { + contents[_RLC] = de_RealtimeLogConfig(data[_RLC], context); } + return contents; }; /** - * deserializeAws_restXmlGetOriginAccessControlConfigCommand + * deserializeAws_restXmlUpdateResponseHeadersPolicyCommand */ -export const de_GetOriginAccessControlConfigCommand = async ( +export const de_UpdateResponseHeadersPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOriginAccessControlConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.OriginAccessControlConfig = de_OriginAccessControlConfig(data, context); + contents.ResponseHeadersPolicy = de_ResponseHeadersPolicy(data, context); return contents; }; /** - * deserializeAws_restXmlGetOriginAccessControlConfigCommandError - */ -const de_GetOriginAccessControlConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchOriginAccessControl": - case "com.amazonaws.cloudfront#NoSuchOriginAccessControl": - throw await de_NoSuchOriginAccessControlRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetOriginRequestPolicyCommand + * deserializeAws_restXmlUpdateStreamingDistributionCommand */ -export const de_GetOriginRequestPolicyCommand = async ( +export const de_UpdateStreamingDistributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOriginRequestPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), [_ET]: [, output.headers[_e]], }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.OriginRequestPolicy = de_OriginRequestPolicy(data, context); + contents.StreamingDistribution = de_StreamingDistribution(data, context); return contents; }; /** - * deserializeAws_restXmlGetOriginRequestPolicyCommandError + * deserialize_Aws_restXmlCommandError */ -const de_GetOriginRequestPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchOriginRequestPolicy": - case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy": - throw await de_NoSuchOriginRequestPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetOriginRequestPolicyConfigCommand - */ -export const de_GetOriginRequestPolicyConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOriginRequestPolicyConfigCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.OriginRequestPolicyConfig = de_OriginRequestPolicyConfig(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlGetOriginRequestPolicyConfigCommandError - */ -const de_GetOriginRequestPolicyConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchOriginRequestPolicy": - case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy": - throw await de_NoSuchOriginRequestPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetPublicKeyCommand - */ -export const de_GetPublicKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPublicKeyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.PublicKey = de_PublicKey(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlGetPublicKeyCommandError - */ -const de_GetPublicKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchPublicKey": - case "com.amazonaws.cloudfront#NoSuchPublicKey": - throw await de_NoSuchPublicKeyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetPublicKeyConfigCommand - */ -export const de_GetPublicKeyConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPublicKeyConfigCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.PublicKeyConfig = de_PublicKeyConfig(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlGetPublicKeyConfigCommandError - */ -const de_GetPublicKeyConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchPublicKey": - case "com.amazonaws.cloudfront#NoSuchPublicKey": - throw await de_NoSuchPublicKeyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetRealtimeLogConfigCommand - */ -export const de_GetRealtimeLogConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRealtimeLogConfigCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_RLC] != null) { - contents[_RLC] = de_RealtimeLogConfig(data[_RLC], context); - } - return contents; -}; - -/** - * deserializeAws_restXmlGetRealtimeLogConfigCommandError - */ -const de_GetRealtimeLogConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchRealtimeLogConfig": - case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig": - throw await de_NoSuchRealtimeLogConfigRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetResponseHeadersPolicyCommand - */ -export const de_GetResponseHeadersPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResponseHeadersPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ResponseHeadersPolicy = de_ResponseHeadersPolicy(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlGetResponseHeadersPolicyCommandError - */ -const de_GetResponseHeadersPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchResponseHeadersPolicy": - case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy": - throw await de_NoSuchResponseHeadersPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetResponseHeadersPolicyConfigCommand - */ -export const de_GetResponseHeadersPolicyConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResponseHeadersPolicyConfigCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ResponseHeadersPolicyConfig = de_ResponseHeadersPolicyConfig(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlGetResponseHeadersPolicyConfigCommandError - */ -const de_GetResponseHeadersPolicyConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchResponseHeadersPolicy": - case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy": - throw await de_NoSuchResponseHeadersPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetStreamingDistributionCommand - */ -export const de_GetStreamingDistributionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStreamingDistributionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.StreamingDistribution = de_StreamingDistribution(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlGetStreamingDistributionCommandError - */ -const de_GetStreamingDistributionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchStreamingDistribution": - case "com.amazonaws.cloudfront#NoSuchStreamingDistribution": - throw await de_NoSuchStreamingDistributionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetStreamingDistributionConfigCommand - */ -export const de_GetStreamingDistributionConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStreamingDistributionConfigCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.StreamingDistributionConfig = de_StreamingDistributionConfig(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlGetStreamingDistributionConfigCommandError - */ -const de_GetStreamingDistributionConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "NoSuchStreamingDistribution": - case "com.amazonaws.cloudfront#NoSuchStreamingDistribution": - throw await de_NoSuchStreamingDistributionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListCachePoliciesCommand - */ -export const de_ListCachePoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCachePoliciesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CachePolicyList = de_CachePolicyList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListCachePoliciesCommandError - */ -const de_ListCachePoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchCachePolicy": - case "com.amazonaws.cloudfront#NoSuchCachePolicy": - throw await de_NoSuchCachePolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListCloudFrontOriginAccessIdentitiesCommand - */ -export const de_ListCloudFrontOriginAccessIdentitiesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCloudFrontOriginAccessIdentitiesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CloudFrontOriginAccessIdentityList = de_CloudFrontOriginAccessIdentityList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListCloudFrontOriginAccessIdentitiesCommandError - */ -const de_ListCloudFrontOriginAccessIdentitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListConflictingAliasesCommand - */ -export const de_ListConflictingAliasesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConflictingAliasesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ConflictingAliasesList = de_ConflictingAliasesList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListConflictingAliasesCommandError - */ -const de_ListConflictingAliasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchDistribution": - case "com.amazonaws.cloudfront#NoSuchDistribution": - throw await de_NoSuchDistributionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListContinuousDeploymentPoliciesCommand - */ -export const de_ListContinuousDeploymentPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListContinuousDeploymentPoliciesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ContinuousDeploymentPolicyList = de_ContinuousDeploymentPolicyList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListContinuousDeploymentPoliciesCommandError - */ -const de_ListContinuousDeploymentPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchContinuousDeploymentPolicy": - case "com.amazonaws.cloudfront#NoSuchContinuousDeploymentPolicy": - throw await de_NoSuchContinuousDeploymentPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListDistributionsCommand - */ -export const de_ListDistributionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDistributionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.DistributionList = de_DistributionList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListDistributionsCommandError - */ -const de_ListDistributionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListDistributionsByCachePolicyIdCommand - */ -export const de_ListDistributionsByCachePolicyIdCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDistributionsByCachePolicyIdCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.DistributionIdList = de_DistributionIdList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListDistributionsByCachePolicyIdCommandError - */ -const de_ListDistributionsByCachePolicyIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchCachePolicy": - case "com.amazonaws.cloudfront#NoSuchCachePolicy": - throw await de_NoSuchCachePolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListDistributionsByKeyGroupCommand - */ -export const de_ListDistributionsByKeyGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDistributionsByKeyGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.DistributionIdList = de_DistributionIdList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListDistributionsByKeyGroupCommandError - */ -const de_ListDistributionsByKeyGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchResource": - case "com.amazonaws.cloudfront#NoSuchResource": - throw await de_NoSuchResourceRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListDistributionsByOriginRequestPolicyIdCommand - */ -export const de_ListDistributionsByOriginRequestPolicyIdCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDistributionsByOriginRequestPolicyIdCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.DistributionIdList = de_DistributionIdList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListDistributionsByOriginRequestPolicyIdCommandError - */ -const de_ListDistributionsByOriginRequestPolicyIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchOriginRequestPolicy": - case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy": - throw await de_NoSuchOriginRequestPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListDistributionsByRealtimeLogConfigCommand - */ -export const de_ListDistributionsByRealtimeLogConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDistributionsByRealtimeLogConfigCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.DistributionList = de_DistributionList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListDistributionsByRealtimeLogConfigCommandError - */ -const de_ListDistributionsByRealtimeLogConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListDistributionsByResponseHeadersPolicyIdCommand - */ -export const de_ListDistributionsByResponseHeadersPolicyIdCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDistributionsByResponseHeadersPolicyIdCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.DistributionIdList = de_DistributionIdList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListDistributionsByResponseHeadersPolicyIdCommandError - */ -const de_ListDistributionsByResponseHeadersPolicyIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchResponseHeadersPolicy": - case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy": - throw await de_NoSuchResponseHeadersPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListDistributionsByWebACLIdCommand - */ -export const de_ListDistributionsByWebACLIdCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDistributionsByWebACLIdCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.DistributionList = de_DistributionList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListDistributionsByWebACLIdCommandError - */ -const de_ListDistributionsByWebACLIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidWebACLId": - case "com.amazonaws.cloudfront#InvalidWebACLId": - throw await de_InvalidWebACLIdRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListFieldLevelEncryptionConfigsCommand - */ -export const de_ListFieldLevelEncryptionConfigsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFieldLevelEncryptionConfigsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.FieldLevelEncryptionList = de_FieldLevelEncryptionList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListFieldLevelEncryptionConfigsCommandError - */ -const de_ListFieldLevelEncryptionConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListFieldLevelEncryptionProfilesCommand - */ -export const de_ListFieldLevelEncryptionProfilesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFieldLevelEncryptionProfilesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.FieldLevelEncryptionProfileList = de_FieldLevelEncryptionProfileList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListFieldLevelEncryptionProfilesCommandError - */ -const de_ListFieldLevelEncryptionProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListFunctionsCommand - */ -export const de_ListFunctionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFunctionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.FunctionList = de_FunctionList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListFunctionsCommandError - */ -const de_ListFunctionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.cloudfront#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListInvalidationsCommand - */ -export const de_ListInvalidationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInvalidationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.InvalidationList = de_InvalidationList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListInvalidationsCommandError - */ -const de_ListInvalidationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchDistribution": - case "com.amazonaws.cloudfront#NoSuchDistribution": - throw await de_NoSuchDistributionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListKeyGroupsCommand - */ -export const de_ListKeyGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKeyGroupsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.KeyGroupList = de_KeyGroupList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListKeyGroupsCommandError - */ -const de_ListKeyGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListKeyValueStoresCommand - */ -export const de_ListKeyValueStoresCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKeyValueStoresCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.KeyValueStoreList = de_KeyValueStoreList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListKeyValueStoresCommandError - */ -const de_ListKeyValueStoresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListOriginAccessControlsCommand - */ -export const de_ListOriginAccessControlsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOriginAccessControlsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.OriginAccessControlList = de_OriginAccessControlList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListOriginAccessControlsCommandError - */ -const de_ListOriginAccessControlsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListOriginRequestPoliciesCommand - */ -export const de_ListOriginRequestPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOriginRequestPoliciesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.OriginRequestPolicyList = de_OriginRequestPolicyList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListOriginRequestPoliciesCommandError - */ -const de_ListOriginRequestPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchOriginRequestPolicy": - case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy": - throw await de_NoSuchOriginRequestPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListPublicKeysCommand - */ -export const de_ListPublicKeysCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPublicKeysCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.PublicKeyList = de_PublicKeyList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListPublicKeysCommandError - */ -const de_ListPublicKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListRealtimeLogConfigsCommand - */ -export const de_ListRealtimeLogConfigsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRealtimeLogConfigsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.RealtimeLogConfigs = de_RealtimeLogConfigs(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListRealtimeLogConfigsCommandError - */ -const de_ListRealtimeLogConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchRealtimeLogConfig": - case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig": - throw await de_NoSuchRealtimeLogConfigRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListResponseHeadersPoliciesCommand - */ -export const de_ListResponseHeadersPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResponseHeadersPoliciesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ResponseHeadersPolicyList = de_ResponseHeadersPolicyList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListResponseHeadersPoliciesCommandError - */ -const de_ListResponseHeadersPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchResponseHeadersPolicy": - case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy": - throw await de_NoSuchResponseHeadersPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListStreamingDistributionsCommand - */ -export const de_ListStreamingDistributionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStreamingDistributionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.StreamingDistributionList = de_StreamingDistributionList(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListStreamingDistributionsCommandError - */ -const de_ListStreamingDistributionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.Tags = de_Tags(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidTagging": - case "com.amazonaws.cloudfront#InvalidTagging": - throw await de_InvalidTaggingRes(parsedOutput, context); - case "NoSuchResource": - case "com.amazonaws.cloudfront#NoSuchResource": - throw await de_NoSuchResourceRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlPublishFunctionCommand - */ -export const de_PublishFunctionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PublishFunctionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.FunctionSummary = de_FunctionSummary(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlPublishFunctionCommandError - */ -const de_PublishFunctionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchFunctionExists": - case "com.amazonaws.cloudfront#NoSuchFunctionExists": - throw await de_NoSuchFunctionExistsRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.cloudfront#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlTagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restXmlTagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidTagging": - case "com.amazonaws.cloudfront#InvalidTagging": - throw await de_InvalidTaggingRes(parsedOutput, context); - case "NoSuchResource": - case "com.amazonaws.cloudfront#NoSuchResource": - throw await de_NoSuchResourceRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlTestFunctionCommand - */ -export const de_TestFunctionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TestFunctionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.TestResult = de_TestResult(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlTestFunctionCommandError - */ -const de_TestFunctionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchFunctionExists": - case "com.amazonaws.cloudfront#NoSuchFunctionExists": - throw await de_NoSuchFunctionExistsRes(parsedOutput, context); - case "TestFunctionFailed": - case "com.amazonaws.cloudfront#TestFunctionFailed": - throw await de_TestFunctionFailedRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.cloudfront#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUntagResourceCommand - */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restXmlUntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidTagging": - case "com.amazonaws.cloudfront#InvalidTagging": - throw await de_InvalidTaggingRes(parsedOutput, context); - case "NoSuchResource": - case "com.amazonaws.cloudfront#NoSuchResource": - throw await de_NoSuchResourceRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateCachePolicyCommand - */ -export const de_UpdateCachePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCachePolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CachePolicy = de_CachePolicy(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdateCachePolicyCommandError - */ -const de_UpdateCachePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "CachePolicyAlreadyExists": - case "com.amazonaws.cloudfront#CachePolicyAlreadyExists": - throw await de_CachePolicyAlreadyExistsRes(parsedOutput, context); - case "IllegalUpdate": - case "com.amazonaws.cloudfront#IllegalUpdate": - throw await de_IllegalUpdateRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchCachePolicy": - case "com.amazonaws.cloudfront#NoSuchCachePolicy": - throw await de_NoSuchCachePolicyRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "TooManyCookiesInCachePolicy": - case "com.amazonaws.cloudfront#TooManyCookiesInCachePolicy": - throw await de_TooManyCookiesInCachePolicyRes(parsedOutput, context); - case "TooManyHeadersInCachePolicy": - case "com.amazonaws.cloudfront#TooManyHeadersInCachePolicy": - throw await de_TooManyHeadersInCachePolicyRes(parsedOutput, context); - case "TooManyQueryStringsInCachePolicy": - case "com.amazonaws.cloudfront#TooManyQueryStringsInCachePolicy": - throw await de_TooManyQueryStringsInCachePolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateCloudFrontOriginAccessIdentityCommand - */ -export const de_UpdateCloudFrontOriginAccessIdentityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCloudFrontOriginAccessIdentityCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CloudFrontOriginAccessIdentity = de_CloudFrontOriginAccessIdentity(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdateCloudFrontOriginAccessIdentityCommandError - */ -const de_UpdateCloudFrontOriginAccessIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "IllegalUpdate": - case "com.amazonaws.cloudfront#IllegalUpdate": - throw await de_IllegalUpdateRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "MissingBody": - case "com.amazonaws.cloudfront#MissingBody": - throw await de_MissingBodyRes(parsedOutput, context); - case "NoSuchCloudFrontOriginAccessIdentity": - case "com.amazonaws.cloudfront#NoSuchCloudFrontOriginAccessIdentity": - throw await de_NoSuchCloudFrontOriginAccessIdentityRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateContinuousDeploymentPolicyCommand - */ -export const de_UpdateContinuousDeploymentPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateContinuousDeploymentPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ContinuousDeploymentPolicy = de_ContinuousDeploymentPolicy(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdateContinuousDeploymentPolicyCommandError - */ -const de_UpdateContinuousDeploymentPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchContinuousDeploymentPolicy": - case "com.amazonaws.cloudfront#NoSuchContinuousDeploymentPolicy": - throw await de_NoSuchContinuousDeploymentPolicyRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "StagingDistributionInUse": - case "com.amazonaws.cloudfront#StagingDistributionInUse": - throw await de_StagingDistributionInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateDistributionCommand - */ -export const de_UpdateDistributionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDistributionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.Distribution = de_Distribution(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdateDistributionCommandError - */ -const de_UpdateDistributionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "CNAMEAlreadyExists": - case "com.amazonaws.cloudfront#CNAMEAlreadyExists": - throw await de_CNAMEAlreadyExistsRes(parsedOutput, context); - case "ContinuousDeploymentPolicyInUse": - case "com.amazonaws.cloudfront#ContinuousDeploymentPolicyInUse": - throw await de_ContinuousDeploymentPolicyInUseRes(parsedOutput, context); - case "IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior": - case "com.amazonaws.cloudfront#IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior": - throw await de_IllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorRes(parsedOutput, context); - case "IllegalOriginAccessConfiguration": - case "com.amazonaws.cloudfront#IllegalOriginAccessConfiguration": - throw await de_IllegalOriginAccessConfigurationRes(parsedOutput, context); - case "IllegalUpdate": - case "com.amazonaws.cloudfront#IllegalUpdate": - throw await de_IllegalUpdateRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidDefaultRootObject": - case "com.amazonaws.cloudfront#InvalidDefaultRootObject": - throw await de_InvalidDefaultRootObjectRes(parsedOutput, context); - case "InvalidDomainNameForOriginAccessControl": - case "com.amazonaws.cloudfront#InvalidDomainNameForOriginAccessControl": - throw await de_InvalidDomainNameForOriginAccessControlRes(parsedOutput, context); - case "InvalidErrorCode": - case "com.amazonaws.cloudfront#InvalidErrorCode": - throw await de_InvalidErrorCodeRes(parsedOutput, context); - case "InvalidForwardCookies": - case "com.amazonaws.cloudfront#InvalidForwardCookies": - throw await de_InvalidForwardCookiesRes(parsedOutput, context); - case "InvalidFunctionAssociation": - case "com.amazonaws.cloudfront#InvalidFunctionAssociation": - throw await de_InvalidFunctionAssociationRes(parsedOutput, context); - case "InvalidGeoRestrictionParameter": - case "com.amazonaws.cloudfront#InvalidGeoRestrictionParameter": - throw await de_InvalidGeoRestrictionParameterRes(parsedOutput, context); - case "InvalidHeadersForS3Origin": - case "com.amazonaws.cloudfront#InvalidHeadersForS3Origin": - throw await de_InvalidHeadersForS3OriginRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "InvalidLambdaFunctionAssociation": - case "com.amazonaws.cloudfront#InvalidLambdaFunctionAssociation": - throw await de_InvalidLambdaFunctionAssociationRes(parsedOutput, context); - case "InvalidLocationCode": - case "com.amazonaws.cloudfront#InvalidLocationCode": - throw await de_InvalidLocationCodeRes(parsedOutput, context); - case "InvalidMinimumProtocolVersion": - case "com.amazonaws.cloudfront#InvalidMinimumProtocolVersion": - throw await de_InvalidMinimumProtocolVersionRes(parsedOutput, context); - case "InvalidOriginAccessControl": - case "com.amazonaws.cloudfront#InvalidOriginAccessControl": - throw await de_InvalidOriginAccessControlRes(parsedOutput, context); - case "InvalidOriginAccessIdentity": - case "com.amazonaws.cloudfront#InvalidOriginAccessIdentity": - throw await de_InvalidOriginAccessIdentityRes(parsedOutput, context); - case "InvalidOriginKeepaliveTimeout": - case "com.amazonaws.cloudfront#InvalidOriginKeepaliveTimeout": - throw await de_InvalidOriginKeepaliveTimeoutRes(parsedOutput, context); - case "InvalidOriginReadTimeout": - case "com.amazonaws.cloudfront#InvalidOriginReadTimeout": - throw await de_InvalidOriginReadTimeoutRes(parsedOutput, context); - case "InvalidQueryStringParameters": - case "com.amazonaws.cloudfront#InvalidQueryStringParameters": - throw await de_InvalidQueryStringParametersRes(parsedOutput, context); - case "InvalidRelativePath": - case "com.amazonaws.cloudfront#InvalidRelativePath": - throw await de_InvalidRelativePathRes(parsedOutput, context); - case "InvalidRequiredProtocol": - case "com.amazonaws.cloudfront#InvalidRequiredProtocol": - throw await de_InvalidRequiredProtocolRes(parsedOutput, context); - case "InvalidResponseCode": - case "com.amazonaws.cloudfront#InvalidResponseCode": - throw await de_InvalidResponseCodeRes(parsedOutput, context); - case "InvalidTTLOrder": - case "com.amazonaws.cloudfront#InvalidTTLOrder": - throw await de_InvalidTTLOrderRes(parsedOutput, context); - case "InvalidViewerCertificate": - case "com.amazonaws.cloudfront#InvalidViewerCertificate": - throw await de_InvalidViewerCertificateRes(parsedOutput, context); - case "InvalidWebACLId": - case "com.amazonaws.cloudfront#InvalidWebACLId": - throw await de_InvalidWebACLIdRes(parsedOutput, context); - case "MissingBody": - case "com.amazonaws.cloudfront#MissingBody": - throw await de_MissingBodyRes(parsedOutput, context); - case "NoSuchCachePolicy": - case "com.amazonaws.cloudfront#NoSuchCachePolicy": - throw await de_NoSuchCachePolicyRes(parsedOutput, context); - case "NoSuchContinuousDeploymentPolicy": - case "com.amazonaws.cloudfront#NoSuchContinuousDeploymentPolicy": - throw await de_NoSuchContinuousDeploymentPolicyRes(parsedOutput, context); - case "NoSuchDistribution": - case "com.amazonaws.cloudfront#NoSuchDistribution": - throw await de_NoSuchDistributionRes(parsedOutput, context); - case "NoSuchFieldLevelEncryptionConfig": - case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig": - throw await de_NoSuchFieldLevelEncryptionConfigRes(parsedOutput, context); - case "NoSuchOrigin": - case "com.amazonaws.cloudfront#NoSuchOrigin": - throw await de_NoSuchOriginRes(parsedOutput, context); - case "NoSuchOriginRequestPolicy": - case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy": - throw await de_NoSuchOriginRequestPolicyRes(parsedOutput, context); - case "NoSuchRealtimeLogConfig": - case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig": - throw await de_NoSuchRealtimeLogConfigRes(parsedOutput, context); - case "NoSuchResponseHeadersPolicy": - case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy": - throw await de_NoSuchResponseHeadersPolicyRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "RealtimeLogConfigOwnerMismatch": - case "com.amazonaws.cloudfront#RealtimeLogConfigOwnerMismatch": - throw await de_RealtimeLogConfigOwnerMismatchRes(parsedOutput, context); - case "StagingDistributionInUse": - case "com.amazonaws.cloudfront#StagingDistributionInUse": - throw await de_StagingDistributionInUseRes(parsedOutput, context); - case "TooManyCacheBehaviors": - case "com.amazonaws.cloudfront#TooManyCacheBehaviors": - throw await de_TooManyCacheBehaviorsRes(parsedOutput, context); - case "TooManyCertificates": - case "com.amazonaws.cloudfront#TooManyCertificates": - throw await de_TooManyCertificatesRes(parsedOutput, context); - case "TooManyCookieNamesInWhiteList": - case "com.amazonaws.cloudfront#TooManyCookieNamesInWhiteList": - throw await de_TooManyCookieNamesInWhiteListRes(parsedOutput, context); - case "TooManyDistributionCNAMEs": - case "com.amazonaws.cloudfront#TooManyDistributionCNAMEs": - throw await de_TooManyDistributionCNAMEsRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToCachePolicy": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToCachePolicy": - throw await de_TooManyDistributionsAssociatedToCachePolicyRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToFieldLevelEncryptionConfig": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToFieldLevelEncryptionConfig": - throw await de_TooManyDistributionsAssociatedToFieldLevelEncryptionConfigRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToKeyGroup": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToKeyGroup": - throw await de_TooManyDistributionsAssociatedToKeyGroupRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToOriginAccessControl": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginAccessControl": - throw await de_TooManyDistributionsAssociatedToOriginAccessControlRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToOriginRequestPolicy": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginRequestPolicy": - throw await de_TooManyDistributionsAssociatedToOriginRequestPolicyRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToResponseHeadersPolicy": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToResponseHeadersPolicy": - throw await de_TooManyDistributionsAssociatedToResponseHeadersPolicyRes(parsedOutput, context); - case "TooManyDistributionsWithFunctionAssociations": - case "com.amazonaws.cloudfront#TooManyDistributionsWithFunctionAssociations": - throw await de_TooManyDistributionsWithFunctionAssociationsRes(parsedOutput, context); - case "TooManyDistributionsWithLambdaAssociations": - case "com.amazonaws.cloudfront#TooManyDistributionsWithLambdaAssociations": - throw await de_TooManyDistributionsWithLambdaAssociationsRes(parsedOutput, context); - case "TooManyDistributionsWithSingleFunctionARN": - case "com.amazonaws.cloudfront#TooManyDistributionsWithSingleFunctionARN": - throw await de_TooManyDistributionsWithSingleFunctionARNRes(parsedOutput, context); - case "TooManyFunctionAssociations": - case "com.amazonaws.cloudfront#TooManyFunctionAssociations": - throw await de_TooManyFunctionAssociationsRes(parsedOutput, context); - case "TooManyHeadersInForwardedValues": - case "com.amazonaws.cloudfront#TooManyHeadersInForwardedValues": - throw await de_TooManyHeadersInForwardedValuesRes(parsedOutput, context); - case "TooManyKeyGroupsAssociatedToDistribution": - case "com.amazonaws.cloudfront#TooManyKeyGroupsAssociatedToDistribution": - throw await de_TooManyKeyGroupsAssociatedToDistributionRes(parsedOutput, context); - case "TooManyLambdaFunctionAssociations": - case "com.amazonaws.cloudfront#TooManyLambdaFunctionAssociations": - throw await de_TooManyLambdaFunctionAssociationsRes(parsedOutput, context); - case "TooManyOriginCustomHeaders": - case "com.amazonaws.cloudfront#TooManyOriginCustomHeaders": - throw await de_TooManyOriginCustomHeadersRes(parsedOutput, context); - case "TooManyOriginGroupsPerDistribution": - case "com.amazonaws.cloudfront#TooManyOriginGroupsPerDistribution": - throw await de_TooManyOriginGroupsPerDistributionRes(parsedOutput, context); - case "TooManyOrigins": - case "com.amazonaws.cloudfront#TooManyOrigins": - throw await de_TooManyOriginsRes(parsedOutput, context); - case "TooManyQueryStringParameters": - case "com.amazonaws.cloudfront#TooManyQueryStringParameters": - throw await de_TooManyQueryStringParametersRes(parsedOutput, context); - case "TooManyTrustedSigners": - case "com.amazonaws.cloudfront#TooManyTrustedSigners": - throw await de_TooManyTrustedSignersRes(parsedOutput, context); - case "TrustedKeyGroupDoesNotExist": - case "com.amazonaws.cloudfront#TrustedKeyGroupDoesNotExist": - throw await de_TrustedKeyGroupDoesNotExistRes(parsedOutput, context); - case "TrustedSignerDoesNotExist": - case "com.amazonaws.cloudfront#TrustedSignerDoesNotExist": - throw await de_TrustedSignerDoesNotExistRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateDistributionWithStagingConfigCommand - */ -export const de_UpdateDistributionWithStagingConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDistributionWithStagingConfigCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.Distribution = de_Distribution(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdateDistributionWithStagingConfigCommandError - */ -const de_UpdateDistributionWithStagingConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "CNAMEAlreadyExists": - case "com.amazonaws.cloudfront#CNAMEAlreadyExists": - throw await de_CNAMEAlreadyExistsRes(parsedOutput, context); - case "IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior": - case "com.amazonaws.cloudfront#IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior": - throw await de_IllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorRes(parsedOutput, context); - case "IllegalUpdate": - case "com.amazonaws.cloudfront#IllegalUpdate": - throw await de_IllegalUpdateRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidDefaultRootObject": - case "com.amazonaws.cloudfront#InvalidDefaultRootObject": - throw await de_InvalidDefaultRootObjectRes(parsedOutput, context); - case "InvalidErrorCode": - case "com.amazonaws.cloudfront#InvalidErrorCode": - throw await de_InvalidErrorCodeRes(parsedOutput, context); - case "InvalidForwardCookies": - case "com.amazonaws.cloudfront#InvalidForwardCookies": - throw await de_InvalidForwardCookiesRes(parsedOutput, context); - case "InvalidFunctionAssociation": - case "com.amazonaws.cloudfront#InvalidFunctionAssociation": - throw await de_InvalidFunctionAssociationRes(parsedOutput, context); - case "InvalidGeoRestrictionParameter": - case "com.amazonaws.cloudfront#InvalidGeoRestrictionParameter": - throw await de_InvalidGeoRestrictionParameterRes(parsedOutput, context); - case "InvalidHeadersForS3Origin": - case "com.amazonaws.cloudfront#InvalidHeadersForS3Origin": - throw await de_InvalidHeadersForS3OriginRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "InvalidLambdaFunctionAssociation": - case "com.amazonaws.cloudfront#InvalidLambdaFunctionAssociation": - throw await de_InvalidLambdaFunctionAssociationRes(parsedOutput, context); - case "InvalidLocationCode": - case "com.amazonaws.cloudfront#InvalidLocationCode": - throw await de_InvalidLocationCodeRes(parsedOutput, context); - case "InvalidMinimumProtocolVersion": - case "com.amazonaws.cloudfront#InvalidMinimumProtocolVersion": - throw await de_InvalidMinimumProtocolVersionRes(parsedOutput, context); - case "InvalidOriginAccessControl": - case "com.amazonaws.cloudfront#InvalidOriginAccessControl": - throw await de_InvalidOriginAccessControlRes(parsedOutput, context); - case "InvalidOriginAccessIdentity": - case "com.amazonaws.cloudfront#InvalidOriginAccessIdentity": - throw await de_InvalidOriginAccessIdentityRes(parsedOutput, context); - case "InvalidOriginKeepaliveTimeout": - case "com.amazonaws.cloudfront#InvalidOriginKeepaliveTimeout": - throw await de_InvalidOriginKeepaliveTimeoutRes(parsedOutput, context); - case "InvalidOriginReadTimeout": - case "com.amazonaws.cloudfront#InvalidOriginReadTimeout": - throw await de_InvalidOriginReadTimeoutRes(parsedOutput, context); - case "InvalidQueryStringParameters": - case "com.amazonaws.cloudfront#InvalidQueryStringParameters": - throw await de_InvalidQueryStringParametersRes(parsedOutput, context); - case "InvalidRelativePath": - case "com.amazonaws.cloudfront#InvalidRelativePath": - throw await de_InvalidRelativePathRes(parsedOutput, context); - case "InvalidRequiredProtocol": - case "com.amazonaws.cloudfront#InvalidRequiredProtocol": - throw await de_InvalidRequiredProtocolRes(parsedOutput, context); - case "InvalidResponseCode": - case "com.amazonaws.cloudfront#InvalidResponseCode": - throw await de_InvalidResponseCodeRes(parsedOutput, context); - case "InvalidTTLOrder": - case "com.amazonaws.cloudfront#InvalidTTLOrder": - throw await de_InvalidTTLOrderRes(parsedOutput, context); - case "InvalidViewerCertificate": - case "com.amazonaws.cloudfront#InvalidViewerCertificate": - throw await de_InvalidViewerCertificateRes(parsedOutput, context); - case "InvalidWebACLId": - case "com.amazonaws.cloudfront#InvalidWebACLId": - throw await de_InvalidWebACLIdRes(parsedOutput, context); - case "MissingBody": - case "com.amazonaws.cloudfront#MissingBody": - throw await de_MissingBodyRes(parsedOutput, context); - case "NoSuchCachePolicy": - case "com.amazonaws.cloudfront#NoSuchCachePolicy": - throw await de_NoSuchCachePolicyRes(parsedOutput, context); - case "NoSuchDistribution": - case "com.amazonaws.cloudfront#NoSuchDistribution": - throw await de_NoSuchDistributionRes(parsedOutput, context); - case "NoSuchFieldLevelEncryptionConfig": - case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig": - throw await de_NoSuchFieldLevelEncryptionConfigRes(parsedOutput, context); - case "NoSuchOrigin": - case "com.amazonaws.cloudfront#NoSuchOrigin": - throw await de_NoSuchOriginRes(parsedOutput, context); - case "NoSuchOriginRequestPolicy": - case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy": - throw await de_NoSuchOriginRequestPolicyRes(parsedOutput, context); - case "NoSuchRealtimeLogConfig": - case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig": - throw await de_NoSuchRealtimeLogConfigRes(parsedOutput, context); - case "NoSuchResponseHeadersPolicy": - case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy": - throw await de_NoSuchResponseHeadersPolicyRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "RealtimeLogConfigOwnerMismatch": - case "com.amazonaws.cloudfront#RealtimeLogConfigOwnerMismatch": - throw await de_RealtimeLogConfigOwnerMismatchRes(parsedOutput, context); - case "TooManyCacheBehaviors": - case "com.amazonaws.cloudfront#TooManyCacheBehaviors": - throw await de_TooManyCacheBehaviorsRes(parsedOutput, context); - case "TooManyCertificates": - case "com.amazonaws.cloudfront#TooManyCertificates": - throw await de_TooManyCertificatesRes(parsedOutput, context); - case "TooManyCookieNamesInWhiteList": - case "com.amazonaws.cloudfront#TooManyCookieNamesInWhiteList": - throw await de_TooManyCookieNamesInWhiteListRes(parsedOutput, context); - case "TooManyDistributionCNAMEs": - case "com.amazonaws.cloudfront#TooManyDistributionCNAMEs": - throw await de_TooManyDistributionCNAMEsRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToCachePolicy": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToCachePolicy": - throw await de_TooManyDistributionsAssociatedToCachePolicyRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToFieldLevelEncryptionConfig": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToFieldLevelEncryptionConfig": - throw await de_TooManyDistributionsAssociatedToFieldLevelEncryptionConfigRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToKeyGroup": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToKeyGroup": - throw await de_TooManyDistributionsAssociatedToKeyGroupRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToOriginAccessControl": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginAccessControl": - throw await de_TooManyDistributionsAssociatedToOriginAccessControlRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToOriginRequestPolicy": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginRequestPolicy": - throw await de_TooManyDistributionsAssociatedToOriginRequestPolicyRes(parsedOutput, context); - case "TooManyDistributionsAssociatedToResponseHeadersPolicy": - case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToResponseHeadersPolicy": - throw await de_TooManyDistributionsAssociatedToResponseHeadersPolicyRes(parsedOutput, context); - case "TooManyDistributionsWithFunctionAssociations": - case "com.amazonaws.cloudfront#TooManyDistributionsWithFunctionAssociations": - throw await de_TooManyDistributionsWithFunctionAssociationsRes(parsedOutput, context); - case "TooManyDistributionsWithLambdaAssociations": - case "com.amazonaws.cloudfront#TooManyDistributionsWithLambdaAssociations": - throw await de_TooManyDistributionsWithLambdaAssociationsRes(parsedOutput, context); - case "TooManyDistributionsWithSingleFunctionARN": - case "com.amazonaws.cloudfront#TooManyDistributionsWithSingleFunctionARN": - throw await de_TooManyDistributionsWithSingleFunctionARNRes(parsedOutput, context); - case "TooManyFunctionAssociations": - case "com.amazonaws.cloudfront#TooManyFunctionAssociations": - throw await de_TooManyFunctionAssociationsRes(parsedOutput, context); - case "TooManyHeadersInForwardedValues": - case "com.amazonaws.cloudfront#TooManyHeadersInForwardedValues": - throw await de_TooManyHeadersInForwardedValuesRes(parsedOutput, context); - case "TooManyKeyGroupsAssociatedToDistribution": - case "com.amazonaws.cloudfront#TooManyKeyGroupsAssociatedToDistribution": - throw await de_TooManyKeyGroupsAssociatedToDistributionRes(parsedOutput, context); - case "TooManyLambdaFunctionAssociations": - case "com.amazonaws.cloudfront#TooManyLambdaFunctionAssociations": - throw await de_TooManyLambdaFunctionAssociationsRes(parsedOutput, context); - case "TooManyOriginCustomHeaders": - case "com.amazonaws.cloudfront#TooManyOriginCustomHeaders": - throw await de_TooManyOriginCustomHeadersRes(parsedOutput, context); - case "TooManyOriginGroupsPerDistribution": - case "com.amazonaws.cloudfront#TooManyOriginGroupsPerDistribution": - throw await de_TooManyOriginGroupsPerDistributionRes(parsedOutput, context); - case "TooManyOrigins": - case "com.amazonaws.cloudfront#TooManyOrigins": - throw await de_TooManyOriginsRes(parsedOutput, context); - case "TooManyQueryStringParameters": - case "com.amazonaws.cloudfront#TooManyQueryStringParameters": - throw await de_TooManyQueryStringParametersRes(parsedOutput, context); - case "TooManyTrustedSigners": - case "com.amazonaws.cloudfront#TooManyTrustedSigners": - throw await de_TooManyTrustedSignersRes(parsedOutput, context); - case "TrustedKeyGroupDoesNotExist": - case "com.amazonaws.cloudfront#TrustedKeyGroupDoesNotExist": - throw await de_TrustedKeyGroupDoesNotExistRes(parsedOutput, context); - case "TrustedSignerDoesNotExist": - case "com.amazonaws.cloudfront#TrustedSignerDoesNotExist": - throw await de_TrustedSignerDoesNotExistRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateFieldLevelEncryptionConfigCommand - */ -export const de_UpdateFieldLevelEncryptionConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFieldLevelEncryptionConfigCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.FieldLevelEncryption = de_FieldLevelEncryption(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdateFieldLevelEncryptionConfigCommandError - */ -const de_UpdateFieldLevelEncryptionConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "IllegalUpdate": - case "com.amazonaws.cloudfront#IllegalUpdate": - throw await de_IllegalUpdateRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchFieldLevelEncryptionConfig": - case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig": - throw await de_NoSuchFieldLevelEncryptionConfigRes(parsedOutput, context); - case "NoSuchFieldLevelEncryptionProfile": - case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionProfile": - throw await de_NoSuchFieldLevelEncryptionProfileRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "QueryArgProfileEmpty": - case "com.amazonaws.cloudfront#QueryArgProfileEmpty": - throw await de_QueryArgProfileEmptyRes(parsedOutput, context); - case "TooManyFieldLevelEncryptionContentTypeProfiles": - case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionContentTypeProfiles": - throw await de_TooManyFieldLevelEncryptionContentTypeProfilesRes(parsedOutput, context); - case "TooManyFieldLevelEncryptionQueryArgProfiles": - case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionQueryArgProfiles": - throw await de_TooManyFieldLevelEncryptionQueryArgProfilesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateFieldLevelEncryptionProfileCommand - */ -export const de_UpdateFieldLevelEncryptionProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFieldLevelEncryptionProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.FieldLevelEncryptionProfile = de_FieldLevelEncryptionProfile(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdateFieldLevelEncryptionProfileCommandError - */ -const de_UpdateFieldLevelEncryptionProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "FieldLevelEncryptionProfileAlreadyExists": - case "com.amazonaws.cloudfront#FieldLevelEncryptionProfileAlreadyExists": - throw await de_FieldLevelEncryptionProfileAlreadyExistsRes(parsedOutput, context); - case "FieldLevelEncryptionProfileSizeExceeded": - case "com.amazonaws.cloudfront#FieldLevelEncryptionProfileSizeExceeded": - throw await de_FieldLevelEncryptionProfileSizeExceededRes(parsedOutput, context); - case "IllegalUpdate": - case "com.amazonaws.cloudfront#IllegalUpdate": - throw await de_IllegalUpdateRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchFieldLevelEncryptionProfile": - case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionProfile": - throw await de_NoSuchFieldLevelEncryptionProfileRes(parsedOutput, context); - case "NoSuchPublicKey": - case "com.amazonaws.cloudfront#NoSuchPublicKey": - throw await de_NoSuchPublicKeyRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "TooManyFieldLevelEncryptionEncryptionEntities": - case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionEncryptionEntities": - throw await de_TooManyFieldLevelEncryptionEncryptionEntitiesRes(parsedOutput, context); - case "TooManyFieldLevelEncryptionFieldPatterns": - case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionFieldPatterns": - throw await de_TooManyFieldLevelEncryptionFieldPatternsRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateFunctionCommand - */ -export const de_UpdateFunctionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFunctionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_et]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.FunctionSummary = de_FunctionSummary(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdateFunctionCommandError - */ -const de_UpdateFunctionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "FunctionSizeLimitExceeded": - case "com.amazonaws.cloudfront#FunctionSizeLimitExceeded": - throw await de_FunctionSizeLimitExceededRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchFunctionExists": - case "com.amazonaws.cloudfront#NoSuchFunctionExists": - throw await de_NoSuchFunctionExistsRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.cloudfront#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateKeyGroupCommand - */ -export const de_UpdateKeyGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateKeyGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.KeyGroup = de_KeyGroup(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdateKeyGroupCommandError - */ -const de_UpdateKeyGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "KeyGroupAlreadyExists": - case "com.amazonaws.cloudfront#KeyGroupAlreadyExists": - throw await de_KeyGroupAlreadyExistsRes(parsedOutput, context); - case "NoSuchResource": - case "com.amazonaws.cloudfront#NoSuchResource": - throw await de_NoSuchResourceRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "TooManyPublicKeysInKeyGroup": - case "com.amazonaws.cloudfront#TooManyPublicKeysInKeyGroup": - throw await de_TooManyPublicKeysInKeyGroupRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateKeyValueStoreCommand - */ -export const de_UpdateKeyValueStoreCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateKeyValueStoreCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.KeyValueStore = de_KeyValueStore(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdateKeyValueStoreCommandError - */ -const de_UpdateKeyValueStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "EntityNotFound": - case "com.amazonaws.cloudfront#EntityNotFound": - throw await de_EntityNotFoundRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateOriginAccessControlCommand - */ -export const de_UpdateOriginAccessControlCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateOriginAccessControlCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.OriginAccessControl = de_OriginAccessControl(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdateOriginAccessControlCommandError - */ -const de_UpdateOriginAccessControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "IllegalUpdate": - case "com.amazonaws.cloudfront#IllegalUpdate": - throw await de_IllegalUpdateRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchOriginAccessControl": - case "com.amazonaws.cloudfront#NoSuchOriginAccessControl": - throw await de_NoSuchOriginAccessControlRes(parsedOutput, context); - case "OriginAccessControlAlreadyExists": - case "com.amazonaws.cloudfront#OriginAccessControlAlreadyExists": - throw await de_OriginAccessControlAlreadyExistsRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateOriginRequestPolicyCommand - */ -export const de_UpdateOriginRequestPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateOriginRequestPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.OriginRequestPolicy = de_OriginRequestPolicy(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdateOriginRequestPolicyCommandError - */ -const de_UpdateOriginRequestPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "IllegalUpdate": - case "com.amazonaws.cloudfront#IllegalUpdate": - throw await de_IllegalUpdateRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchOriginRequestPolicy": - case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy": - throw await de_NoSuchOriginRequestPolicyRes(parsedOutput, context); - case "OriginRequestPolicyAlreadyExists": - case "com.amazonaws.cloudfront#OriginRequestPolicyAlreadyExists": - throw await de_OriginRequestPolicyAlreadyExistsRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - case "TooManyCookiesInOriginRequestPolicy": - case "com.amazonaws.cloudfront#TooManyCookiesInOriginRequestPolicy": - throw await de_TooManyCookiesInOriginRequestPolicyRes(parsedOutput, context); - case "TooManyHeadersInOriginRequestPolicy": - case "com.amazonaws.cloudfront#TooManyHeadersInOriginRequestPolicy": - throw await de_TooManyHeadersInOriginRequestPolicyRes(parsedOutput, context); - case "TooManyQueryStringsInOriginRequestPolicy": - case "com.amazonaws.cloudfront#TooManyQueryStringsInOriginRequestPolicy": - throw await de_TooManyQueryStringsInOriginRequestPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdatePublicKeyCommand - */ -export const de_UpdatePublicKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePublicKeyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.PublicKey = de_PublicKey(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdatePublicKeyCommandError - */ -const de_UpdatePublicKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "CannotChangeImmutablePublicKeyFields": - case "com.amazonaws.cloudfront#CannotChangeImmutablePublicKeyFields": - throw await de_CannotChangeImmutablePublicKeyFieldsRes(parsedOutput, context); - case "IllegalUpdate": - case "com.amazonaws.cloudfront#IllegalUpdate": - throw await de_IllegalUpdateRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "NoSuchPublicKey": - case "com.amazonaws.cloudfront#NoSuchPublicKey": - throw await de_NoSuchPublicKeyRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateRealtimeLogConfigCommand - */ -export const de_UpdateRealtimeLogConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRealtimeLogConfigCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_RLC] != null) { - contents[_RLC] = de_RealtimeLogConfig(data[_RLC], context); - } - return contents; -}; - -/** - * deserializeAws_restXmlUpdateRealtimeLogConfigCommandError - */ -const de_UpdateRealtimeLogConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "NoSuchRealtimeLogConfig": - case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig": - throw await de_NoSuchRealtimeLogConfigRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateResponseHeadersPolicyCommand - */ -export const de_UpdateResponseHeadersPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateResponseHeadersPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ResponseHeadersPolicy = de_ResponseHeadersPolicy(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdateResponseHeadersPolicyCommandError - */ -const de_UpdateResponseHeadersPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -9812,21 +5083,348 @@ const de_UpdateResponseHeadersPolicyCommandError = async ( case "IllegalUpdate": case "com.amazonaws.cloudfront#IllegalUpdate": throw await de_IllegalUpdateRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); case "InvalidArgument": case "com.amazonaws.cloudfront#InvalidArgument": throw await de_InvalidArgumentRes(parsedOutput, context); + case "NoSuchDistribution": + case "com.amazonaws.cloudfront#NoSuchDistribution": + throw await de_NoSuchDistributionRes(parsedOutput, context); + case "TooManyDistributionCNAMEs": + case "com.amazonaws.cloudfront#TooManyDistributionCNAMEs": + throw await de_TooManyDistributionCNAMEsRes(parsedOutput, context); + case "CNAMEAlreadyExists": + case "com.amazonaws.cloudfront#CNAMEAlreadyExists": + throw await de_CNAMEAlreadyExistsRes(parsedOutput, context); + case "DistributionAlreadyExists": + case "com.amazonaws.cloudfront#DistributionAlreadyExists": + throw await de_DistributionAlreadyExistsRes(parsedOutput, context); + case "IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior": + case "com.amazonaws.cloudfront#IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior": + throw await de_IllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorRes(parsedOutput, context); + case "InconsistentQuantities": + case "com.amazonaws.cloudfront#InconsistentQuantities": + throw await de_InconsistentQuantitiesRes(parsedOutput, context); + case "InvalidDefaultRootObject": + case "com.amazonaws.cloudfront#InvalidDefaultRootObject": + throw await de_InvalidDefaultRootObjectRes(parsedOutput, context); + case "InvalidErrorCode": + case "com.amazonaws.cloudfront#InvalidErrorCode": + throw await de_InvalidErrorCodeRes(parsedOutput, context); + case "InvalidForwardCookies": + case "com.amazonaws.cloudfront#InvalidForwardCookies": + throw await de_InvalidForwardCookiesRes(parsedOutput, context); + case "InvalidFunctionAssociation": + case "com.amazonaws.cloudfront#InvalidFunctionAssociation": + throw await de_InvalidFunctionAssociationRes(parsedOutput, context); + case "InvalidGeoRestrictionParameter": + case "com.amazonaws.cloudfront#InvalidGeoRestrictionParameter": + throw await de_InvalidGeoRestrictionParameterRes(parsedOutput, context); + case "InvalidHeadersForS3Origin": + case "com.amazonaws.cloudfront#InvalidHeadersForS3Origin": + throw await de_InvalidHeadersForS3OriginRes(parsedOutput, context); case "InvalidIfMatchVersion": case "com.amazonaws.cloudfront#InvalidIfMatchVersion": throw await de_InvalidIfMatchVersionRes(parsedOutput, context); + case "InvalidLambdaFunctionAssociation": + case "com.amazonaws.cloudfront#InvalidLambdaFunctionAssociation": + throw await de_InvalidLambdaFunctionAssociationRes(parsedOutput, context); + case "InvalidLocationCode": + case "com.amazonaws.cloudfront#InvalidLocationCode": + throw await de_InvalidLocationCodeRes(parsedOutput, context); + case "InvalidMinimumProtocolVersion": + case "com.amazonaws.cloudfront#InvalidMinimumProtocolVersion": + throw await de_InvalidMinimumProtocolVersionRes(parsedOutput, context); + case "InvalidOrigin": + case "com.amazonaws.cloudfront#InvalidOrigin": + throw await de_InvalidOriginRes(parsedOutput, context); + case "InvalidOriginAccessControl": + case "com.amazonaws.cloudfront#InvalidOriginAccessControl": + throw await de_InvalidOriginAccessControlRes(parsedOutput, context); + case "InvalidOriginAccessIdentity": + case "com.amazonaws.cloudfront#InvalidOriginAccessIdentity": + throw await de_InvalidOriginAccessIdentityRes(parsedOutput, context); + case "InvalidOriginKeepaliveTimeout": + case "com.amazonaws.cloudfront#InvalidOriginKeepaliveTimeout": + throw await de_InvalidOriginKeepaliveTimeoutRes(parsedOutput, context); + case "InvalidOriginReadTimeout": + case "com.amazonaws.cloudfront#InvalidOriginReadTimeout": + throw await de_InvalidOriginReadTimeoutRes(parsedOutput, context); + case "InvalidProtocolSettings": + case "com.amazonaws.cloudfront#InvalidProtocolSettings": + throw await de_InvalidProtocolSettingsRes(parsedOutput, context); + case "InvalidQueryStringParameters": + case "com.amazonaws.cloudfront#InvalidQueryStringParameters": + throw await de_InvalidQueryStringParametersRes(parsedOutput, context); + case "InvalidRelativePath": + case "com.amazonaws.cloudfront#InvalidRelativePath": + throw await de_InvalidRelativePathRes(parsedOutput, context); + case "InvalidRequiredProtocol": + case "com.amazonaws.cloudfront#InvalidRequiredProtocol": + throw await de_InvalidRequiredProtocolRes(parsedOutput, context); + case "InvalidResponseCode": + case "com.amazonaws.cloudfront#InvalidResponseCode": + throw await de_InvalidResponseCodeRes(parsedOutput, context); + case "InvalidTTLOrder": + case "com.amazonaws.cloudfront#InvalidTTLOrder": + throw await de_InvalidTTLOrderRes(parsedOutput, context); + case "InvalidViewerCertificate": + case "com.amazonaws.cloudfront#InvalidViewerCertificate": + throw await de_InvalidViewerCertificateRes(parsedOutput, context); + case "InvalidWebACLId": + case "com.amazonaws.cloudfront#InvalidWebACLId": + throw await de_InvalidWebACLIdRes(parsedOutput, context); + case "MissingBody": + case "com.amazonaws.cloudfront#MissingBody": + throw await de_MissingBodyRes(parsedOutput, context); + case "NoSuchCachePolicy": + case "com.amazonaws.cloudfront#NoSuchCachePolicy": + throw await de_NoSuchCachePolicyRes(parsedOutput, context); + case "NoSuchFieldLevelEncryptionConfig": + case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig": + throw await de_NoSuchFieldLevelEncryptionConfigRes(parsedOutput, context); + case "NoSuchOrigin": + case "com.amazonaws.cloudfront#NoSuchOrigin": + throw await de_NoSuchOriginRes(parsedOutput, context); + case "NoSuchOriginRequestPolicy": + case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy": + throw await de_NoSuchOriginRequestPolicyRes(parsedOutput, context); + case "NoSuchRealtimeLogConfig": + case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig": + throw await de_NoSuchRealtimeLogConfigRes(parsedOutput, context); case "NoSuchResponseHeadersPolicy": case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy": throw await de_NoSuchResponseHeadersPolicyRes(parsedOutput, context); case "PreconditionFailed": case "com.amazonaws.cloudfront#PreconditionFailed": throw await de_PreconditionFailedRes(parsedOutput, context); + case "RealtimeLogConfigOwnerMismatch": + case "com.amazonaws.cloudfront#RealtimeLogConfigOwnerMismatch": + throw await de_RealtimeLogConfigOwnerMismatchRes(parsedOutput, context); + case "TooManyCacheBehaviors": + case "com.amazonaws.cloudfront#TooManyCacheBehaviors": + throw await de_TooManyCacheBehaviorsRes(parsedOutput, context); + case "TooManyCertificates": + case "com.amazonaws.cloudfront#TooManyCertificates": + throw await de_TooManyCertificatesRes(parsedOutput, context); + case "TooManyCookieNamesInWhiteList": + case "com.amazonaws.cloudfront#TooManyCookieNamesInWhiteList": + throw await de_TooManyCookieNamesInWhiteListRes(parsedOutput, context); + case "TooManyDistributions": + case "com.amazonaws.cloudfront#TooManyDistributions": + throw await de_TooManyDistributionsRes(parsedOutput, context); + case "TooManyDistributionsAssociatedToCachePolicy": + case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToCachePolicy": + throw await de_TooManyDistributionsAssociatedToCachePolicyRes(parsedOutput, context); + case "TooManyDistributionsAssociatedToFieldLevelEncryptionConfig": + case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToFieldLevelEncryptionConfig": + throw await de_TooManyDistributionsAssociatedToFieldLevelEncryptionConfigRes(parsedOutput, context); + case "TooManyDistributionsAssociatedToKeyGroup": + case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToKeyGroup": + throw await de_TooManyDistributionsAssociatedToKeyGroupRes(parsedOutput, context); + case "TooManyDistributionsAssociatedToOriginAccessControl": + case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginAccessControl": + throw await de_TooManyDistributionsAssociatedToOriginAccessControlRes(parsedOutput, context); + case "TooManyDistributionsAssociatedToOriginRequestPolicy": + case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginRequestPolicy": + throw await de_TooManyDistributionsAssociatedToOriginRequestPolicyRes(parsedOutput, context); + case "TooManyDistributionsAssociatedToResponseHeadersPolicy": + case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToResponseHeadersPolicy": + throw await de_TooManyDistributionsAssociatedToResponseHeadersPolicyRes(parsedOutput, context); + case "TooManyDistributionsWithFunctionAssociations": + case "com.amazonaws.cloudfront#TooManyDistributionsWithFunctionAssociations": + throw await de_TooManyDistributionsWithFunctionAssociationsRes(parsedOutput, context); + case "TooManyDistributionsWithLambdaAssociations": + case "com.amazonaws.cloudfront#TooManyDistributionsWithLambdaAssociations": + throw await de_TooManyDistributionsWithLambdaAssociationsRes(parsedOutput, context); + case "TooManyDistributionsWithSingleFunctionARN": + case "com.amazonaws.cloudfront#TooManyDistributionsWithSingleFunctionARN": + throw await de_TooManyDistributionsWithSingleFunctionARNRes(parsedOutput, context); + case "TooManyFunctionAssociations": + case "com.amazonaws.cloudfront#TooManyFunctionAssociations": + throw await de_TooManyFunctionAssociationsRes(parsedOutput, context); + case "TooManyHeadersInForwardedValues": + case "com.amazonaws.cloudfront#TooManyHeadersInForwardedValues": + throw await de_TooManyHeadersInForwardedValuesRes(parsedOutput, context); + case "TooManyKeyGroupsAssociatedToDistribution": + case "com.amazonaws.cloudfront#TooManyKeyGroupsAssociatedToDistribution": + throw await de_TooManyKeyGroupsAssociatedToDistributionRes(parsedOutput, context); + case "TooManyLambdaFunctionAssociations": + case "com.amazonaws.cloudfront#TooManyLambdaFunctionAssociations": + throw await de_TooManyLambdaFunctionAssociationsRes(parsedOutput, context); + case "TooManyOriginCustomHeaders": + case "com.amazonaws.cloudfront#TooManyOriginCustomHeaders": + throw await de_TooManyOriginCustomHeadersRes(parsedOutput, context); + case "TooManyOriginGroupsPerDistribution": + case "com.amazonaws.cloudfront#TooManyOriginGroupsPerDistribution": + throw await de_TooManyOriginGroupsPerDistributionRes(parsedOutput, context); + case "TooManyOrigins": + case "com.amazonaws.cloudfront#TooManyOrigins": + throw await de_TooManyOriginsRes(parsedOutput, context); + case "TooManyQueryStringParameters": + case "com.amazonaws.cloudfront#TooManyQueryStringParameters": + throw await de_TooManyQueryStringParametersRes(parsedOutput, context); + case "TooManyTrustedSigners": + case "com.amazonaws.cloudfront#TooManyTrustedSigners": + throw await de_TooManyTrustedSignersRes(parsedOutput, context); + case "TrustedKeyGroupDoesNotExist": + case "com.amazonaws.cloudfront#TrustedKeyGroupDoesNotExist": + throw await de_TrustedKeyGroupDoesNotExistRes(parsedOutput, context); + case "TrustedSignerDoesNotExist": + case "com.amazonaws.cloudfront#TrustedSignerDoesNotExist": + throw await de_TrustedSignerDoesNotExistRes(parsedOutput, context); + case "CachePolicyAlreadyExists": + case "com.amazonaws.cloudfront#CachePolicyAlreadyExists": + throw await de_CachePolicyAlreadyExistsRes(parsedOutput, context); + case "TooManyCachePolicies": + case "com.amazonaws.cloudfront#TooManyCachePolicies": + throw await de_TooManyCachePoliciesRes(parsedOutput, context); + case "TooManyCookiesInCachePolicy": + case "com.amazonaws.cloudfront#TooManyCookiesInCachePolicy": + throw await de_TooManyCookiesInCachePolicyRes(parsedOutput, context); + case "TooManyHeadersInCachePolicy": + case "com.amazonaws.cloudfront#TooManyHeadersInCachePolicy": + throw await de_TooManyHeadersInCachePolicyRes(parsedOutput, context); + case "TooManyQueryStringsInCachePolicy": + case "com.amazonaws.cloudfront#TooManyQueryStringsInCachePolicy": + throw await de_TooManyQueryStringsInCachePolicyRes(parsedOutput, context); + case "CloudFrontOriginAccessIdentityAlreadyExists": + case "com.amazonaws.cloudfront#CloudFrontOriginAccessIdentityAlreadyExists": + throw await de_CloudFrontOriginAccessIdentityAlreadyExistsRes(parsedOutput, context); + case "TooManyCloudFrontOriginAccessIdentities": + case "com.amazonaws.cloudfront#TooManyCloudFrontOriginAccessIdentities": + throw await de_TooManyCloudFrontOriginAccessIdentitiesRes(parsedOutput, context); + case "ContinuousDeploymentPolicyAlreadyExists": + case "com.amazonaws.cloudfront#ContinuousDeploymentPolicyAlreadyExists": + throw await de_ContinuousDeploymentPolicyAlreadyExistsRes(parsedOutput, context); + case "StagingDistributionInUse": + case "com.amazonaws.cloudfront#StagingDistributionInUse": + throw await de_StagingDistributionInUseRes(parsedOutput, context); + case "TooManyContinuousDeploymentPolicies": + case "com.amazonaws.cloudfront#TooManyContinuousDeploymentPolicies": + throw await de_TooManyContinuousDeploymentPoliciesRes(parsedOutput, context); + case "ContinuousDeploymentPolicyInUse": + case "com.amazonaws.cloudfront#ContinuousDeploymentPolicyInUse": + throw await de_ContinuousDeploymentPolicyInUseRes(parsedOutput, context); + case "IllegalOriginAccessConfiguration": + case "com.amazonaws.cloudfront#IllegalOriginAccessConfiguration": + throw await de_IllegalOriginAccessConfigurationRes(parsedOutput, context); + case "InvalidDomainNameForOriginAccessControl": + case "com.amazonaws.cloudfront#InvalidDomainNameForOriginAccessControl": + throw await de_InvalidDomainNameForOriginAccessControlRes(parsedOutput, context); + case "NoSuchContinuousDeploymentPolicy": + case "com.amazonaws.cloudfront#NoSuchContinuousDeploymentPolicy": + throw await de_NoSuchContinuousDeploymentPolicyRes(parsedOutput, context); + case "InvalidTagging": + case "com.amazonaws.cloudfront#InvalidTagging": + throw await de_InvalidTaggingRes(parsedOutput, context); + case "FieldLevelEncryptionConfigAlreadyExists": + case "com.amazonaws.cloudfront#FieldLevelEncryptionConfigAlreadyExists": + throw await de_FieldLevelEncryptionConfigAlreadyExistsRes(parsedOutput, context); + case "NoSuchFieldLevelEncryptionProfile": + case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionProfile": + throw await de_NoSuchFieldLevelEncryptionProfileRes(parsedOutput, context); + case "QueryArgProfileEmpty": + case "com.amazonaws.cloudfront#QueryArgProfileEmpty": + throw await de_QueryArgProfileEmptyRes(parsedOutput, context); + case "TooManyFieldLevelEncryptionConfigs": + case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionConfigs": + throw await de_TooManyFieldLevelEncryptionConfigsRes(parsedOutput, context); + case "TooManyFieldLevelEncryptionContentTypeProfiles": + case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionContentTypeProfiles": + throw await de_TooManyFieldLevelEncryptionContentTypeProfilesRes(parsedOutput, context); + case "TooManyFieldLevelEncryptionQueryArgProfiles": + case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionQueryArgProfiles": + throw await de_TooManyFieldLevelEncryptionQueryArgProfilesRes(parsedOutput, context); + case "FieldLevelEncryptionProfileAlreadyExists": + case "com.amazonaws.cloudfront#FieldLevelEncryptionProfileAlreadyExists": + throw await de_FieldLevelEncryptionProfileAlreadyExistsRes(parsedOutput, context); + case "FieldLevelEncryptionProfileSizeExceeded": + case "com.amazonaws.cloudfront#FieldLevelEncryptionProfileSizeExceeded": + throw await de_FieldLevelEncryptionProfileSizeExceededRes(parsedOutput, context); + case "NoSuchPublicKey": + case "com.amazonaws.cloudfront#NoSuchPublicKey": + throw await de_NoSuchPublicKeyRes(parsedOutput, context); + case "TooManyFieldLevelEncryptionEncryptionEntities": + case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionEncryptionEntities": + throw await de_TooManyFieldLevelEncryptionEncryptionEntitiesRes(parsedOutput, context); + case "TooManyFieldLevelEncryptionFieldPatterns": + case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionFieldPatterns": + throw await de_TooManyFieldLevelEncryptionFieldPatternsRes(parsedOutput, context); + case "TooManyFieldLevelEncryptionProfiles": + case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionProfiles": + throw await de_TooManyFieldLevelEncryptionProfilesRes(parsedOutput, context); + case "FunctionAlreadyExists": + case "com.amazonaws.cloudfront#FunctionAlreadyExists": + throw await de_FunctionAlreadyExistsRes(parsedOutput, context); + case "FunctionSizeLimitExceeded": + case "com.amazonaws.cloudfront#FunctionSizeLimitExceeded": + throw await de_FunctionSizeLimitExceededRes(parsedOutput, context); + case "TooManyFunctions": + case "com.amazonaws.cloudfront#TooManyFunctions": + throw await de_TooManyFunctionsRes(parsedOutput, context); + case "UnsupportedOperation": + case "com.amazonaws.cloudfront#UnsupportedOperation": + throw await de_UnsupportedOperationRes(parsedOutput, context); + case "BatchTooLarge": + case "com.amazonaws.cloudfront#BatchTooLarge": + throw await de_BatchTooLargeRes(parsedOutput, context); + case "TooManyInvalidationsInProgress": + case "com.amazonaws.cloudfront#TooManyInvalidationsInProgress": + throw await de_TooManyInvalidationsInProgressRes(parsedOutput, context); + case "KeyGroupAlreadyExists": + case "com.amazonaws.cloudfront#KeyGroupAlreadyExists": + throw await de_KeyGroupAlreadyExistsRes(parsedOutput, context); + case "TooManyKeyGroups": + case "com.amazonaws.cloudfront#TooManyKeyGroups": + throw await de_TooManyKeyGroupsRes(parsedOutput, context); + case "TooManyPublicKeysInKeyGroup": + case "com.amazonaws.cloudfront#TooManyPublicKeysInKeyGroup": + throw await de_TooManyPublicKeysInKeyGroupRes(parsedOutput, context); + case "EntityAlreadyExists": + case "com.amazonaws.cloudfront#EntityAlreadyExists": + throw await de_EntityAlreadyExistsRes(parsedOutput, context); + case "EntityLimitExceeded": + case "com.amazonaws.cloudfront#EntityLimitExceeded": + throw await de_EntityLimitExceededRes(parsedOutput, context); + case "EntitySizeLimitExceeded": + case "com.amazonaws.cloudfront#EntitySizeLimitExceeded": + throw await de_EntitySizeLimitExceededRes(parsedOutput, context); + case "MonitoringSubscriptionAlreadyExists": + case "com.amazonaws.cloudfront#MonitoringSubscriptionAlreadyExists": + throw await de_MonitoringSubscriptionAlreadyExistsRes(parsedOutput, context); + case "OriginAccessControlAlreadyExists": + case "com.amazonaws.cloudfront#OriginAccessControlAlreadyExists": + throw await de_OriginAccessControlAlreadyExistsRes(parsedOutput, context); + case "TooManyOriginAccessControls": + case "com.amazonaws.cloudfront#TooManyOriginAccessControls": + throw await de_TooManyOriginAccessControlsRes(parsedOutput, context); + case "OriginRequestPolicyAlreadyExists": + case "com.amazonaws.cloudfront#OriginRequestPolicyAlreadyExists": + throw await de_OriginRequestPolicyAlreadyExistsRes(parsedOutput, context); + case "TooManyCookiesInOriginRequestPolicy": + case "com.amazonaws.cloudfront#TooManyCookiesInOriginRequestPolicy": + throw await de_TooManyCookiesInOriginRequestPolicyRes(parsedOutput, context); + case "TooManyHeadersInOriginRequestPolicy": + case "com.amazonaws.cloudfront#TooManyHeadersInOriginRequestPolicy": + throw await de_TooManyHeadersInOriginRequestPolicyRes(parsedOutput, context); + case "TooManyOriginRequestPolicies": + case "com.amazonaws.cloudfront#TooManyOriginRequestPolicies": + throw await de_TooManyOriginRequestPoliciesRes(parsedOutput, context); + case "TooManyQueryStringsInOriginRequestPolicy": + case "com.amazonaws.cloudfront#TooManyQueryStringsInOriginRequestPolicy": + throw await de_TooManyQueryStringsInOriginRequestPolicyRes(parsedOutput, context); + case "PublicKeyAlreadyExists": + case "com.amazonaws.cloudfront#PublicKeyAlreadyExists": + throw await de_PublicKeyAlreadyExistsRes(parsedOutput, context); + case "TooManyPublicKeys": + case "com.amazonaws.cloudfront#TooManyPublicKeys": + throw await de_TooManyPublicKeysRes(parsedOutput, context); + case "RealtimeLogConfigAlreadyExists": + case "com.amazonaws.cloudfront#RealtimeLogConfigAlreadyExists": + throw await de_RealtimeLogConfigAlreadyExistsRes(parsedOutput, context); + case "TooManyRealtimeLogConfigs": + case "com.amazonaws.cloudfront#TooManyRealtimeLogConfigs": + throw await de_TooManyRealtimeLogConfigsRes(parsedOutput, context); case "ResponseHeadersPolicyAlreadyExists": case "com.amazonaws.cloudfront#ResponseHeadersPolicyAlreadyExists": throw await de_ResponseHeadersPolicyAlreadyExistsRes(parsedOutput, context); @@ -9839,97 +5437,100 @@ const de_UpdateResponseHeadersPolicyCommandError = async ( case "TooManyRemoveHeadersInResponseHeadersPolicy": case "com.amazonaws.cloudfront#TooManyRemoveHeadersInResponseHeadersPolicy": throw await de_TooManyRemoveHeadersInResponseHeadersPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateStreamingDistributionCommand - */ -export const de_UpdateStreamingDistributionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateStreamingDistributionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_ET]: [, output.headers[_e]], - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.StreamingDistribution = de_StreamingDistribution(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdateStreamingDistributionCommandError - */ -const de_UpdateStreamingDistributionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDenied": - case "com.amazonaws.cloudfront#AccessDenied": - throw await de_AccessDeniedRes(parsedOutput, context); - case "CNAMEAlreadyExists": - case "com.amazonaws.cloudfront#CNAMEAlreadyExists": - throw await de_CNAMEAlreadyExistsRes(parsedOutput, context); - case "IllegalUpdate": - case "com.amazonaws.cloudfront#IllegalUpdate": - throw await de_IllegalUpdateRes(parsedOutput, context); - case "InconsistentQuantities": - case "com.amazonaws.cloudfront#InconsistentQuantities": - throw await de_InconsistentQuantitiesRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.cloudfront#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidIfMatchVersion": - case "com.amazonaws.cloudfront#InvalidIfMatchVersion": - throw await de_InvalidIfMatchVersionRes(parsedOutput, context); - case "InvalidOriginAccessControl": - case "com.amazonaws.cloudfront#InvalidOriginAccessControl": - throw await de_InvalidOriginAccessControlRes(parsedOutput, context); - case "InvalidOriginAccessIdentity": - case "com.amazonaws.cloudfront#InvalidOriginAccessIdentity": - throw await de_InvalidOriginAccessIdentityRes(parsedOutput, context); - case "MissingBody": - case "com.amazonaws.cloudfront#MissingBody": - throw await de_MissingBodyRes(parsedOutput, context); - case "NoSuchStreamingDistribution": - case "com.amazonaws.cloudfront#NoSuchStreamingDistribution": - throw await de_NoSuchStreamingDistributionRes(parsedOutput, context); - case "PreconditionFailed": - case "com.amazonaws.cloudfront#PreconditionFailed": - throw await de_PreconditionFailedRes(parsedOutput, context); + case "TooManyResponseHeadersPolicies": + case "com.amazonaws.cloudfront#TooManyResponseHeadersPolicies": + throw await de_TooManyResponseHeadersPoliciesRes(parsedOutput, context); + case "StreamingDistributionAlreadyExists": + case "com.amazonaws.cloudfront#StreamingDistributionAlreadyExists": + throw await de_StreamingDistributionAlreadyExistsRes(parsedOutput, context); case "TooManyStreamingDistributionCNAMEs": case "com.amazonaws.cloudfront#TooManyStreamingDistributionCNAMEs": throw await de_TooManyStreamingDistributionCNAMEsRes(parsedOutput, context); - case "TooManyTrustedSigners": - case "com.amazonaws.cloudfront#TooManyTrustedSigners": - throw await de_TooManyTrustedSignersRes(parsedOutput, context); - case "TrustedSignerDoesNotExist": - case "com.amazonaws.cloudfront#TrustedSignerDoesNotExist": - throw await de_TrustedSignerDoesNotExistRes(parsedOutput, context); + case "TooManyStreamingDistributions": + case "com.amazonaws.cloudfront#TooManyStreamingDistributions": + throw await de_TooManyStreamingDistributionsRes(parsedOutput, context); + case "CachePolicyInUse": + case "com.amazonaws.cloudfront#CachePolicyInUse": + throw await de_CachePolicyInUseRes(parsedOutput, context); + case "IllegalDelete": + case "com.amazonaws.cloudfront#IllegalDelete": + throw await de_IllegalDeleteRes(parsedOutput, context); + case "CloudFrontOriginAccessIdentityInUse": + case "com.amazonaws.cloudfront#CloudFrontOriginAccessIdentityInUse": + throw await de_CloudFrontOriginAccessIdentityInUseRes(parsedOutput, context); + case "NoSuchCloudFrontOriginAccessIdentity": + case "com.amazonaws.cloudfront#NoSuchCloudFrontOriginAccessIdentity": + throw await de_NoSuchCloudFrontOriginAccessIdentityRes(parsedOutput, context); + case "DistributionNotDisabled": + case "com.amazonaws.cloudfront#DistributionNotDisabled": + throw await de_DistributionNotDisabledRes(parsedOutput, context); + case "FieldLevelEncryptionConfigInUse": + case "com.amazonaws.cloudfront#FieldLevelEncryptionConfigInUse": + throw await de_FieldLevelEncryptionConfigInUseRes(parsedOutput, context); + case "FieldLevelEncryptionProfileInUse": + case "com.amazonaws.cloudfront#FieldLevelEncryptionProfileInUse": + throw await de_FieldLevelEncryptionProfileInUseRes(parsedOutput, context); + case "FunctionInUse": + case "com.amazonaws.cloudfront#FunctionInUse": + throw await de_FunctionInUseRes(parsedOutput, context); + case "NoSuchFunctionExists": + case "com.amazonaws.cloudfront#NoSuchFunctionExists": + throw await de_NoSuchFunctionExistsRes(parsedOutput, context); + case "NoSuchResource": + case "com.amazonaws.cloudfront#NoSuchResource": + throw await de_NoSuchResourceRes(parsedOutput, context); + case "ResourceInUse": + case "com.amazonaws.cloudfront#ResourceInUse": + throw await de_ResourceInUseRes(parsedOutput, context); + case "CannotDeleteEntityWhileInUse": + case "com.amazonaws.cloudfront#CannotDeleteEntityWhileInUse": + throw await de_CannotDeleteEntityWhileInUseRes(parsedOutput, context); + case "EntityNotFound": + case "com.amazonaws.cloudfront#EntityNotFound": + throw await de_EntityNotFoundRes(parsedOutput, context); + case "NoSuchMonitoringSubscription": + case "com.amazonaws.cloudfront#NoSuchMonitoringSubscription": + throw await de_NoSuchMonitoringSubscriptionRes(parsedOutput, context); + case "NoSuchOriginAccessControl": + case "com.amazonaws.cloudfront#NoSuchOriginAccessControl": + throw await de_NoSuchOriginAccessControlRes(parsedOutput, context); + case "OriginAccessControlInUse": + case "com.amazonaws.cloudfront#OriginAccessControlInUse": + throw await de_OriginAccessControlInUseRes(parsedOutput, context); + case "OriginRequestPolicyInUse": + case "com.amazonaws.cloudfront#OriginRequestPolicyInUse": + throw await de_OriginRequestPolicyInUseRes(parsedOutput, context); + case "PublicKeyInUse": + case "com.amazonaws.cloudfront#PublicKeyInUse": + throw await de_PublicKeyInUseRes(parsedOutput, context); + case "RealtimeLogConfigInUse": + case "com.amazonaws.cloudfront#RealtimeLogConfigInUse": + throw await de_RealtimeLogConfigInUseRes(parsedOutput, context); + case "ResponseHeadersPolicyInUse": + case "com.amazonaws.cloudfront#ResponseHeadersPolicyInUse": + throw await de_ResponseHeadersPolicyInUseRes(parsedOutput, context); + case "NoSuchStreamingDistribution": + case "com.amazonaws.cloudfront#NoSuchStreamingDistribution": + throw await de_NoSuchStreamingDistributionRes(parsedOutput, context); + case "StreamingDistributionNotDisabled": + case "com.amazonaws.cloudfront#StreamingDistributionNotDisabled": + throw await de_StreamingDistributionNotDisabledRes(parsedOutput, context); + case "NoSuchInvalidation": + case "com.amazonaws.cloudfront#NoSuchInvalidation": + throw await de_NoSuchInvalidationRes(parsedOutput, context); + case "TestFunctionFailed": + case "com.amazonaws.cloudfront#TestFunctionFailed": + throw await de_TestFunctionFailedRes(parsedOutput, context); + case "CannotChangeImmutablePublicKeyFields": + case "com.amazonaws.cloudfront#CannotChangeImmutablePublicKeyFields": + throw await de_CannotChangeImmutablePublicKeyFieldsRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody: parsedBody.Error, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts b/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts index 97fd8db93971..358674dab22e 100644 --- a/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudhsm-v2/src/protocols/Aws_json1_1.ts @@ -279,7 +279,7 @@ export const de_CopyBackupToRegionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopyBackupToRegionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -291,47 +291,6 @@ export const de_CopyBackupToRegionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CopyBackupToRegionCommandError - */ -const de_CopyBackupToRegionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmAccessDeniedException": - case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": - throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context); - case "CloudHsmInternalFailureException": - case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException": - throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context); - case "CloudHsmInvalidRequestException": - case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException": - throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context); - case "CloudHsmResourceNotFoundException": - case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException": - throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsmv2#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "CloudHsmTagException": - case "com.amazonaws.cloudhsmv2#CloudHsmTagException": - throw await de_CloudHsmTagExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateClusterCommand */ @@ -340,7 +299,7 @@ export const de_CreateClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -352,47 +311,6 @@ export const de_CreateClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateClusterCommandError - */ -const de_CreateClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmAccessDeniedException": - case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": - throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context); - case "CloudHsmInternalFailureException": - case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException": - throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context); - case "CloudHsmInvalidRequestException": - case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException": - throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context); - case "CloudHsmResourceNotFoundException": - case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException": - throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsmv2#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "CloudHsmTagException": - case "com.amazonaws.cloudhsmv2#CloudHsmTagException": - throw await de_CloudHsmTagExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateHsmCommand */ @@ -401,7 +319,7 @@ export const de_CreateHsmCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateHsmCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -413,44 +331,6 @@ export const de_CreateHsmCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateHsmCommandError - */ -const de_CreateHsmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmAccessDeniedException": - case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": - throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context); - case "CloudHsmInternalFailureException": - case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException": - throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context); - case "CloudHsmInvalidRequestException": - case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException": - throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context); - case "CloudHsmResourceNotFoundException": - case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException": - throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsmv2#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteBackupCommand */ @@ -459,7 +339,7 @@ export const de_DeleteBackupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteBackupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -471,44 +351,6 @@ export const de_DeleteBackupCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteBackupCommandError - */ -const de_DeleteBackupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmAccessDeniedException": - case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": - throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context); - case "CloudHsmInternalFailureException": - case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException": - throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context); - case "CloudHsmInvalidRequestException": - case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException": - throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context); - case "CloudHsmResourceNotFoundException": - case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException": - throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsmv2#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteClusterCommand */ @@ -517,7 +359,7 @@ export const de_DeleteClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -529,47 +371,6 @@ export const de_DeleteClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteClusterCommandError - */ -const de_DeleteClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmAccessDeniedException": - case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": - throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context); - case "CloudHsmInternalFailureException": - case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException": - throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context); - case "CloudHsmInvalidRequestException": - case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException": - throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context); - case "CloudHsmResourceNotFoundException": - case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException": - throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsmv2#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "CloudHsmTagException": - case "com.amazonaws.cloudhsmv2#CloudHsmTagException": - throw await de_CloudHsmTagExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteHsmCommand */ @@ -578,7 +379,7 @@ export const de_DeleteHsmCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteHsmCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -590,44 +391,6 @@ export const de_DeleteHsmCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteHsmCommandError - */ -const de_DeleteHsmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmAccessDeniedException": - case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": - throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context); - case "CloudHsmInternalFailureException": - case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException": - throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context); - case "CloudHsmInvalidRequestException": - case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException": - throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context); - case "CloudHsmResourceNotFoundException": - case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException": - throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsmv2#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeBackupsCommand */ @@ -636,7 +399,7 @@ export const de_DescribeBackupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBackupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -648,47 +411,6 @@ export const de_DescribeBackupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeBackupsCommandError - */ -const de_DescribeBackupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmAccessDeniedException": - case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": - throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context); - case "CloudHsmInternalFailureException": - case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException": - throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context); - case "CloudHsmInvalidRequestException": - case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException": - throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context); - case "CloudHsmResourceNotFoundException": - case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException": - throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsmv2#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "CloudHsmTagException": - case "com.amazonaws.cloudhsmv2#CloudHsmTagException": - throw await de_CloudHsmTagExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeClustersCommand */ @@ -697,7 +419,7 @@ export const de_DescribeClustersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeClustersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -709,44 +431,6 @@ export const de_DescribeClustersCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeClustersCommandError - */ -const de_DescribeClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmAccessDeniedException": - case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": - throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context); - case "CloudHsmInternalFailureException": - case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException": - throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context); - case "CloudHsmInvalidRequestException": - case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException": - throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsmv2#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "CloudHsmTagException": - case "com.amazonaws.cloudhsmv2#CloudHsmTagException": - throw await de_CloudHsmTagExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1InitializeClusterCommand */ @@ -755,7 +439,7 @@ export const de_InitializeClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_InitializeClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -767,44 +451,6 @@ export const de_InitializeClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1InitializeClusterCommandError - */ -const de_InitializeClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmAccessDeniedException": - case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": - throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context); - case "CloudHsmInternalFailureException": - case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException": - throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context); - case "CloudHsmInvalidRequestException": - case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException": - throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context); - case "CloudHsmResourceNotFoundException": - case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException": - throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsmv2#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsCommand */ @@ -813,7 +459,7 @@ export const de_ListTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -825,47 +471,6 @@ export const de_ListTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsCommandError - */ -const de_ListTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmAccessDeniedException": - case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": - throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context); - case "CloudHsmInternalFailureException": - case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException": - throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context); - case "CloudHsmInvalidRequestException": - case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException": - throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context); - case "CloudHsmResourceNotFoundException": - case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException": - throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsmv2#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "CloudHsmTagException": - case "com.amazonaws.cloudhsmv2#CloudHsmTagException": - throw await de_CloudHsmTagExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifyBackupAttributesCommand */ @@ -874,7 +479,7 @@ export const de_ModifyBackupAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyBackupAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -886,44 +491,6 @@ export const de_ModifyBackupAttributesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyBackupAttributesCommandError - */ -const de_ModifyBackupAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmAccessDeniedException": - case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": - throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context); - case "CloudHsmInternalFailureException": - case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException": - throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context); - case "CloudHsmInvalidRequestException": - case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException": - throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context); - case "CloudHsmResourceNotFoundException": - case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException": - throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsmv2#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifyClusterCommand */ @@ -932,7 +499,7 @@ export const de_ModifyClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -944,44 +511,6 @@ export const de_ModifyClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyClusterCommandError - */ -const de_ModifyClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmAccessDeniedException": - case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": - throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context); - case "CloudHsmInternalFailureException": - case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException": - throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context); - case "CloudHsmInvalidRequestException": - case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException": - throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context); - case "CloudHsmResourceNotFoundException": - case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException": - throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsmv2#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RestoreBackupCommand */ @@ -990,7 +519,7 @@ export const de_RestoreBackupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreBackupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1002,44 +531,6 @@ export const de_RestoreBackupCommand = async ( return response; }; -/** - * deserializeAws_json1_1RestoreBackupCommandError - */ -const de_RestoreBackupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmAccessDeniedException": - case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": - throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context); - case "CloudHsmInternalFailureException": - case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException": - throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context); - case "CloudHsmInvalidRequestException": - case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException": - throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context); - case "CloudHsmResourceNotFoundException": - case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException": - throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsmv2#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -1048,7 +539,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1060,47 +551,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmAccessDeniedException": - case "com.amazonaws.cloudhsmv2#CloudHsmAccessDeniedException": - throw await de_CloudHsmAccessDeniedExceptionRes(parsedOutput, context); - case "CloudHsmInternalFailureException": - case "com.amazonaws.cloudhsmv2#CloudHsmInternalFailureException": - throw await de_CloudHsmInternalFailureExceptionRes(parsedOutput, context); - case "CloudHsmInvalidRequestException": - case "com.amazonaws.cloudhsmv2#CloudHsmInvalidRequestException": - throw await de_CloudHsmInvalidRequestExceptionRes(parsedOutput, context); - case "CloudHsmResourceNotFoundException": - case "com.amazonaws.cloudhsmv2#CloudHsmResourceNotFoundException": - throw await de_CloudHsmResourceNotFoundExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsmv2#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "CloudHsmTagException": - case "com.amazonaws.cloudhsmv2#CloudHsmTagException": - throw await de_CloudHsmTagExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -1109,7 +559,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1122,12 +572,9 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1158,7 +605,7 @@ const de_UntagResourceCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts b/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts index 2939b0f0d731..029b154e30eb 100644 --- a/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudhsm/src/protocols/Aws_json1_1.ts @@ -335,7 +335,7 @@ export const de_AddTagsToResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsToResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -347,38 +347,6 @@ export const de_AddTagsToResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddTagsToResourceCommandError - */ -const de_AddTagsToResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateHapgCommand */ @@ -387,7 +355,7 @@ export const de_CreateHapgCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateHapgCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -399,38 +367,6 @@ export const de_CreateHapgCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateHapgCommandError - */ -const de_CreateHapgCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateHsmCommand */ @@ -439,7 +375,7 @@ export const de_CreateHsmCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateHsmCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -451,38 +387,6 @@ export const de_CreateHsmCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateHsmCommandError - */ -const de_CreateHsmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLunaClientCommand */ @@ -491,7 +395,7 @@ export const de_CreateLunaClientCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLunaClientCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -503,38 +407,6 @@ export const de_CreateLunaClientCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateLunaClientCommandError - */ -const de_CreateLunaClientCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteHapgCommand */ @@ -543,7 +415,7 @@ export const de_DeleteHapgCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteHapgCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -555,38 +427,6 @@ export const de_DeleteHapgCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteHapgCommandError - */ -const de_DeleteHapgCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteHsmCommand */ @@ -595,7 +435,7 @@ export const de_DeleteHsmCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteHsmCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -607,38 +447,6 @@ export const de_DeleteHsmCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteHsmCommandError - */ -const de_DeleteHsmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteLunaClientCommand */ @@ -647,7 +455,7 @@ export const de_DeleteLunaClientCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLunaClientCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -659,38 +467,6 @@ export const de_DeleteLunaClientCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteLunaClientCommandError - */ -const de_DeleteLunaClientCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeHapgCommand */ @@ -699,7 +475,7 @@ export const de_DescribeHapgCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeHapgCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -711,38 +487,6 @@ export const de_DescribeHapgCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeHapgCommandError - */ -const de_DescribeHapgCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeHsmCommand */ @@ -751,168 +495,32 @@ export const de_DescribeHsmCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeHsmCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); const response: DescribeHsmCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeHsmCommandError - */ -const de_DescribeHsmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeLunaClientCommand - */ -export const de_DescribeLunaClientCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeLunaClientCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeLunaClientCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeLunaClientCommandError - */ -const de_DescribeLunaClientCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetConfigCommand - */ -export const de_GetConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetConfigCommandError - */ -const de_GetConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListAvailableZonesCommand + * deserializeAws_json1_1DescribeLunaClientCommand */ -export const de_ListAvailableZonesCommand = async ( +export const de_DescribeLunaClientCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAvailableZonesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListAvailableZonesCommandOutput = { + const response: DescribeLunaClientCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -920,51 +528,39 @@ export const de_ListAvailableZonesCommand = async ( }; /** - * deserializeAws_json1_1ListAvailableZonesCommandError + * deserializeAws_json1_1GetConfigCommand */ -const de_ListAvailableZonesCommandError = async ( +export const de_GetConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetConfigCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListHapgsCommand + * deserializeAws_json1_1ListAvailableZonesCommand */ -export const de_ListHapgsCommand = async ( +export const de_ListAvailableZonesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListHapgsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListHapgsCommandOutput = { + const response: ListAvailableZonesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -972,35 +568,23 @@ export const de_ListHapgsCommand = async ( }; /** - * deserializeAws_json1_1ListHapgsCommandError + * deserializeAws_json1_1ListHapgsCommand */ -const de_ListHapgsCommandError = async ( +export const de_ListHapgsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListHapgsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1011,7 +595,7 @@ export const de_ListHsmsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListHsmsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1023,38 +607,6 @@ export const de_ListHsmsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListHsmsCommandError - */ -const de_ListHsmsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListLunaClientsCommand */ @@ -1063,7 +615,7 @@ export const de_ListLunaClientsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListLunaClientsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1075,38 +627,6 @@ export const de_ListLunaClientsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListLunaClientsCommandError - */ -const de_ListLunaClientsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -1115,7 +635,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1127,38 +647,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifyHapgCommand */ @@ -1167,7 +655,7 @@ export const de_ModifyHapgCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyHapgCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1179,38 +667,6 @@ export const de_ModifyHapgCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyHapgCommandError - */ -const de_ModifyHapgCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifyHsmCommand */ @@ -1219,7 +675,7 @@ export const de_ModifyHsmCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyHsmCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1231,38 +687,6 @@ export const de_ModifyHsmCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyHsmCommandError - */ -const de_ModifyHsmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmInternalException": - case "com.amazonaws.cloudhsm#CloudHsmInternalException": - throw await de_CloudHsmInternalExceptionRes(parsedOutput, context); - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.cloudhsm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifyLunaClientCommand */ @@ -1271,7 +695,7 @@ export const de_ModifyLunaClientCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyLunaClientCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1283,32 +707,6 @@ export const de_ModifyLunaClientCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyLunaClientCommandError - */ -const de_ModifyLunaClientCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmServiceException": - case "com.amazonaws.cloudhsm#CloudHsmServiceException": - throw await de_CloudHsmServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RemoveTagsFromResourceCommand */ @@ -1317,7 +715,7 @@ export const de_RemoveTagsFromResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveTagsFromResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1330,12 +728,9 @@ export const de_RemoveTagsFromResourceCommand = async ( }; /** - * deserializeAws_json1_1RemoveTagsFromResourceCommandError + * deserialize_Aws_json1_1CommandError */ -const de_RemoveTagsFromResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1357,7 +752,7 @@ const de_RemoveTagsFromResourceCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cloudsearch-domain/src/protocols/Aws_restJson1.ts b/clients/client-cloudsearch-domain/src/protocols/Aws_restJson1.ts index 6f6eecdaa180..1d5aeef784d0 100644 --- a/clients/client-cloudsearch-domain/src/protocols/Aws_restJson1.ts +++ b/clients/client-cloudsearch-domain/src/protocols/Aws_restJson1.ts @@ -110,7 +110,7 @@ export const de_SearchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -126,29 +126,6 @@ export const de_SearchCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchCommandError - */ -const de_SearchCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "SearchException": - case "com.amazonaws.cloudsearchdomain#SearchException": - throw await de_SearchExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SuggestCommand */ @@ -157,7 +134,7 @@ export const de_SuggestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SuggestCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -171,32 +148,6 @@ export const de_SuggestCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SuggestCommandError - */ -const de_SuggestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "SearchException": - case "com.amazonaws.cloudsearchdomain#SearchException": - throw await de_SearchExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UploadDocumentsCommand */ @@ -205,7 +156,7 @@ export const de_UploadDocumentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UploadDocumentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -222,18 +173,18 @@ export const de_UploadDocumentsCommand = async ( }; /** - * deserializeAws_restJson1UploadDocumentsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UploadDocumentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "SearchException": + case "com.amazonaws.cloudsearchdomain#SearchException": + throw await de_SearchExceptionRes(parsedOutput, context); case "DocumentServiceException": case "com.amazonaws.cloudsearchdomain#DocumentServiceException": throw await de_DocumentServiceExceptionRes(parsedOutput, context); @@ -243,7 +194,7 @@ const de_UploadDocumentsCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cloudsearch/src/protocols/Aws_query.ts b/clients/client-cloudsearch/src/protocols/Aws_query.ts index d560332b3825..a0bd9a9922b3 100644 --- a/clients/client-cloudsearch/src/protocols/Aws_query.ts +++ b/clients/client-cloudsearch/src/protocols/Aws_query.ts @@ -631,7 +631,7 @@ export const de_BuildSuggestersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BuildSuggestersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -643,41 +643,6 @@ export const de_BuildSuggestersCommand = async ( return response; }; -/** - * deserializeAws_queryBuildSuggestersCommandError - */ -const de_BuildSuggestersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudsearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateDomainCommand */ @@ -686,7 +651,7 @@ export const de_CreateDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -698,44 +663,6 @@ export const de_CreateDomainCommand = async ( return response; }; -/** - * deserializeAws_queryCreateDomainCommandError - */ -const de_CreateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.cloudsearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExists": - case "com.amazonaws.cloudsearch#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudsearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDefineAnalysisSchemeCommand */ @@ -744,7 +671,7 @@ export const de_DefineAnalysisSchemeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DefineAnalysisSchemeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -756,47 +683,6 @@ export const de_DefineAnalysisSchemeCommand = async ( return response; }; -/** - * deserializeAws_queryDefineAnalysisSchemeCommandError - */ -const de_DefineAnalysisSchemeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidType": - case "com.amazonaws.cloudsearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.cloudsearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudsearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDefineExpressionCommand */ @@ -805,7 +691,7 @@ export const de_DefineExpressionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DefineExpressionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -817,47 +703,6 @@ export const de_DefineExpressionCommand = async ( return response; }; -/** - * deserializeAws_queryDefineExpressionCommandError - */ -const de_DefineExpressionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidType": - case "com.amazonaws.cloudsearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.cloudsearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudsearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDefineIndexFieldCommand */ @@ -866,7 +711,7 @@ export const de_DefineIndexFieldCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DefineIndexFieldCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -878,47 +723,6 @@ export const de_DefineIndexFieldCommand = async ( return response; }; -/** - * deserializeAws_queryDefineIndexFieldCommandError - */ -const de_DefineIndexFieldCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidType": - case "com.amazonaws.cloudsearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.cloudsearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudsearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDefineSuggesterCommand */ @@ -927,7 +731,7 @@ export const de_DefineSuggesterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DefineSuggesterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -940,60 +744,39 @@ export const de_DefineSuggesterCommand = async ( }; /** - * deserializeAws_queryDefineSuggesterCommandError + * deserializeAws_queryDeleteAnalysisSchemeCommand */ -const de_DefineSuggesterCommandError = async ( +export const de_DeleteAnalysisSchemeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidType": - case "com.amazonaws.cloudsearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.cloudsearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudsearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteAnalysisSchemeResponse(data.DeleteAnalysisSchemeResult, context); + const response: DeleteAnalysisSchemeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteAnalysisSchemeCommand + * deserializeAws_queryDeleteDomainCommand */ -export const de_DeleteAnalysisSchemeCommand = async ( +export const de_DeleteDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteAnalysisSchemeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteAnalysisSchemeResponse(data.DeleteAnalysisSchemeResult, context); - const response: DeleteAnalysisSchemeCommandOutput = { + contents = de_DeleteDomainResponse(data.DeleteDomainResult, context); + const response: DeleteDomainCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1001,150 +784,25 @@ export const de_DeleteAnalysisSchemeCommand = async ( }; /** - * deserializeAws_queryDeleteAnalysisSchemeCommandError + * deserializeAws_queryDeleteExpressionCommand */ -const de_DeleteAnalysisSchemeCommandError = async ( +export const de_DeleteExpressionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidType": - case "com.amazonaws.cloudsearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudsearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteDomainCommand - */ -export const de_DeleteDomainCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDomainCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteDomainResponse(data.DeleteDomainResult, context); - const response: DeleteDomainCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDeleteDomainCommandError - */ -const de_DeleteDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteExpressionCommand - */ -export const de_DeleteExpressionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteExpressionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteExpressionResponse(data.DeleteExpressionResult, context); - const response: DeleteExpressionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteExpressionResponse(data.DeleteExpressionResult, context); + const response: DeleteExpressionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; return response; }; -/** - * deserializeAws_queryDeleteExpressionCommandError - */ -const de_DeleteExpressionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidType": - case "com.amazonaws.cloudsearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudsearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteIndexFieldCommand */ @@ -1153,7 +811,7 @@ export const de_DeleteIndexFieldCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteIndexFieldCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1165,44 +823,6 @@ export const de_DeleteIndexFieldCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteIndexFieldCommandError - */ -const de_DeleteIndexFieldCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidType": - case "com.amazonaws.cloudsearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudsearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteSuggesterCommand */ @@ -1211,7 +831,7 @@ export const de_DeleteSuggesterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSuggesterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1223,44 +843,6 @@ export const de_DeleteSuggesterCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteSuggesterCommandError - */ -const de_DeleteSuggesterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidType": - case "com.amazonaws.cloudsearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudsearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeAnalysisSchemesCommand */ @@ -1269,7 +851,7 @@ export const de_DescribeAnalysisSchemesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAnalysisSchemesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1281,38 +863,6 @@ export const de_DescribeAnalysisSchemesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeAnalysisSchemesCommandError - */ -const de_DescribeAnalysisSchemesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeAvailabilityOptionsCommand */ @@ -1321,7 +871,7 @@ export const de_DescribeAvailabilityOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAvailabilityOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1333,47 +883,6 @@ export const de_DescribeAvailabilityOptionsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeAvailabilityOptionsCommandError - */ -const de_DescribeAvailabilityOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledAction": - case "com.amazonaws.cloudsearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidType": - case "com.amazonaws.cloudsearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.cloudsearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeDomainEndpointOptionsCommand */ @@ -1382,7 +891,7 @@ export const de_DescribeDomainEndpointOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDomainEndpointOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1394,44 +903,6 @@ export const de_DescribeDomainEndpointOptionsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeDomainEndpointOptionsCommandError - */ -const de_DescribeDomainEndpointOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledAction": - case "com.amazonaws.cloudsearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.cloudsearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeDomainsCommand */ @@ -1440,7 +911,7 @@ export const de_DescribeDomainsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDomainsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1452,35 +923,6 @@ export const de_DescribeDomainsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeDomainsCommandError - */ -const de_DescribeDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeExpressionsCommand */ @@ -1489,7 +931,7 @@ export const de_DescribeExpressionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeExpressionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1501,38 +943,6 @@ export const de_DescribeExpressionsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeExpressionsCommandError - */ -const de_DescribeExpressionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeIndexFieldsCommand */ @@ -1541,7 +951,7 @@ export const de_DescribeIndexFieldsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeIndexFieldsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1553,156 +963,40 @@ export const de_DescribeIndexFieldsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeIndexFieldsCommandError - */ -const de_DescribeIndexFieldsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeScalingParametersCommand */ export const de_DescribeScalingParametersCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeScalingParametersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeScalingParametersResponse(data.DescribeScalingParametersResult, context); - const response: DescribeScalingParametersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeScalingParametersCommandError - */ -const de_DescribeScalingParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeServiceAccessPoliciesCommand - */ -export const de_DescribeServiceAccessPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeServiceAccessPoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeServiceAccessPoliciesResponse(data.DescribeServiceAccessPoliciesResult, context); - const response: DescribeServiceAccessPoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeServiceAccessPoliciesCommandError - */ -const de_DescribeServiceAccessPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeScalingParametersResponse(data.DescribeScalingParametersResult, context); + const response: DescribeScalingParametersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeSuggestersCommand + * deserializeAws_queryDescribeServiceAccessPoliciesCommand */ -export const de_DescribeSuggestersCommand = async ( +export const de_DescribeServiceAccessPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeSuggestersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeSuggestersResponse(data.DescribeSuggestersResult, context); - const response: DescribeSuggestersCommandOutput = { + contents = de_DescribeServiceAccessPoliciesResponse(data.DescribeServiceAccessPoliciesResult, context); + const response: DescribeServiceAccessPoliciesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1710,35 +1004,23 @@ export const de_DescribeSuggestersCommand = async ( }; /** - * deserializeAws_queryDescribeSuggestersCommandError + * deserializeAws_queryDescribeSuggestersCommand */ -const de_DescribeSuggestersCommandError = async ( +export const de_DescribeSuggestersCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeSuggestersResponse(data.DescribeSuggestersResult, context); + const response: DescribeSuggestersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1749,7 +1031,7 @@ export const de_IndexDocumentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_IndexDocumentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1761,41 +1043,6 @@ export const de_IndexDocumentsCommand = async ( return response; }; -/** - * deserializeAws_queryIndexDocumentsCommandError - */ -const de_IndexDocumentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudsearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryListDomainNamesCommand */ @@ -1804,7 +1051,7 @@ export const de_ListDomainNamesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListDomainNamesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1816,32 +1063,6 @@ export const de_ListDomainNamesCommand = async ( return response; }; -/** - * deserializeAws_queryListDomainNamesCommandError - */ -const de_ListDomainNamesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateAvailabilityOptionsCommand */ @@ -1850,7 +1071,7 @@ export const de_UpdateAvailabilityOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateAvailabilityOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1862,50 +1083,6 @@ export const de_UpdateAvailabilityOptionsCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateAvailabilityOptionsCommandError - */ -const de_UpdateAvailabilityOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledAction": - case "com.amazonaws.cloudsearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidType": - case "com.amazonaws.cloudsearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.cloudsearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudsearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateDomainEndpointOptionsCommand */ @@ -1914,7 +1091,7 @@ export const de_UpdateDomainEndpointOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDomainEndpointOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1926,50 +1103,6 @@ export const de_UpdateDomainEndpointOptionsCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateDomainEndpointOptionsCommandError - */ -const de_UpdateDomainEndpointOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledAction": - case "com.amazonaws.cloudsearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidType": - case "com.amazonaws.cloudsearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.cloudsearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudsearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateScalingParametersCommand */ @@ -1978,7 +1111,7 @@ export const de_UpdateScalingParametersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateScalingParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1990,47 +1123,6 @@ export const de_UpdateScalingParametersCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateScalingParametersCommandError - */ -const de_UpdateScalingParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.cloudsearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudsearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidType": - case "com.amazonaws.cloudsearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.cloudsearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudsearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudsearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateServiceAccessPoliciesCommand */ @@ -2039,7 +1131,7 @@ export const de_UpdateServiceAccessPoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateServiceAccessPoliciesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2052,12 +1144,9 @@ export const de_UpdateServiceAccessPoliciesCommand = async ( }; /** - * deserializeAws_queryUpdateServiceAccessPoliciesCommandError + * deserialize_Aws_queryCommandError */ -const de_UpdateServiceAccessPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2070,25 +1159,31 @@ const de_UpdateServiceAccessPoliciesCommandError = async ( case "InternalException": case "com.amazonaws.cloudsearch#InternalException": throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidType": - case "com.amazonaws.cloudsearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.cloudsearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); case "ResourceNotFound": case "com.amazonaws.cloudsearch#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.cloudsearch#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "LimitExceeded": + case "com.amazonaws.cloudsearch#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExists": + case "com.amazonaws.cloudsearch#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidType": + case "com.amazonaws.cloudsearch#InvalidTypeException": + throw await de_InvalidTypeExceptionRes(parsedOutput, context); + case "DisabledAction": + case "com.amazonaws.cloudsearch#DisabledOperationException": + throw await de_DisabledOperationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody: parsedBody.Error, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cloudtrail-data/src/protocols/Aws_restJson1.ts b/clients/client-cloudtrail-data/src/protocols/Aws_restJson1.ts index 3a5e5701fa2b..1a8c36b8ea8a 100644 --- a/clients/client-cloudtrail-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-cloudtrail-data/src/protocols/Aws_restJson1.ts @@ -65,7 +65,7 @@ export const de_PutAuditEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAuditEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -80,12 +80,9 @@ export const de_PutAuditEventsCommand = async ( }; /** - * deserializeAws_restJson1PutAuditEventsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_PutAuditEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -116,7 +113,7 @@ const de_PutAuditEventsCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts b/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts index 8c714c472707..f7f15dd8ff8f 100644 --- a/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudtrail/src/protocols/Aws_json1_1.ts @@ -926,7 +926,7 @@ export const de_AddTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -938,77 +938,6 @@ export const de_AddTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddTagsCommandError - */ -const de_AddTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ChannelARNInvalidException": - case "com.amazonaws.cloudtrail#ChannelARNInvalidException": - throw await de_ChannelARNInvalidExceptionRes(parsedOutput, context); - case "ChannelNotFoundException": - case "com.amazonaws.cloudtrail#ChannelNotFoundException": - throw await de_ChannelNotFoundExceptionRes(parsedOutput, context); - case "CloudTrailARNInvalidException": - case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": - throw await de_CloudTrailARNInvalidExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudtrail#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InactiveEventDataStoreException": - case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": - throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.cloudtrail#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "InvalidTrailNameException": - case "com.amazonaws.cloudtrail#InvalidTrailNameException": - throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudtrail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceTypeNotSupportedException": - case "com.amazonaws.cloudtrail#ResourceTypeNotSupportedException": - throw await de_ResourceTypeNotSupportedExceptionRes(parsedOutput, context); - case "TagsLimitExceededException": - case "com.amazonaws.cloudtrail#TagsLimitExceededException": - throw await de_TagsLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelQueryCommand */ @@ -1017,7 +946,7 @@ export const de_CancelQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelQueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1029,59 +958,6 @@ export const de_CancelQueryCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelQueryCommandError - */ -const de_CancelQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.cloudtrail#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InactiveEventDataStoreException": - case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": - throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); - case "InactiveQueryException": - case "com.amazonaws.cloudtrail#InactiveQueryException": - throw await de_InactiveQueryExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "QueryIdNotFoundException": - case "com.amazonaws.cloudtrail#QueryIdNotFoundException": - throw await de_QueryIdNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateChannelCommand */ @@ -1090,7 +966,7 @@ export const de_CreateChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateChannelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1102,65 +978,6 @@ export const de_CreateChannelCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateChannelCommandError - */ -const de_CreateChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ChannelAlreadyExistsException": - case "com.amazonaws.cloudtrail#ChannelAlreadyExistsException": - throw await de_ChannelAlreadyExistsExceptionRes(parsedOutput, context); - case "ChannelMaxLimitExceededException": - case "com.amazonaws.cloudtrail#ChannelMaxLimitExceededException": - throw await de_ChannelMaxLimitExceededExceptionRes(parsedOutput, context); - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InactiveEventDataStoreException": - case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": - throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); - case "InvalidEventDataStoreCategoryException": - case "com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException": - throw await de_InvalidEventDataStoreCategoryExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSourceException": - case "com.amazonaws.cloudtrail#InvalidSourceException": - throw await de_InvalidSourceExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.cloudtrail#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "TagsLimitExceededException": - case "com.amazonaws.cloudtrail#TagsLimitExceededException": - throw await de_TagsLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateEventDataStoreCommand */ @@ -1169,7 +986,7 @@ export const de_CreateEventDataStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEventDataStoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1181,83 +998,6 @@ export const de_CreateEventDataStoreCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateEventDataStoreCommandError - */ -const de_CreateEventDataStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudTrailAccessNotEnabledException": - case "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException": - throw await de_CloudTrailAccessNotEnabledExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudtrail#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "EventDataStoreAlreadyExistsException": - case "com.amazonaws.cloudtrail#EventDataStoreAlreadyExistsException": - throw await de_EventDataStoreAlreadyExistsExceptionRes(parsedOutput, context); - case "EventDataStoreMaxLimitExceededException": - case "com.amazonaws.cloudtrail#EventDataStoreMaxLimitExceededException": - throw await de_EventDataStoreMaxLimitExceededExceptionRes(parsedOutput, context); - case "InsufficientDependencyServiceAccessPermissionException": - case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": - throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); - case "InsufficientEncryptionPolicyException": - case "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException": - throw await de_InsufficientEncryptionPolicyExceptionRes(parsedOutput, context); - case "InvalidEventSelectorsException": - case "com.amazonaws.cloudtrail#InvalidEventSelectorsException": - throw await de_InvalidEventSelectorsExceptionRes(parsedOutput, context); - case "InvalidKmsKeyIdException": - case "com.amazonaws.cloudtrail#InvalidKmsKeyIdException": - throw await de_InvalidKmsKeyIdExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.cloudtrail#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.cloudtrail#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "KmsKeyNotFoundException": - case "com.amazonaws.cloudtrail#KmsKeyNotFoundException": - throw await de_KmsKeyNotFoundExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "OrganizationNotInAllFeaturesModeException": - case "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException": - throw await de_OrganizationNotInAllFeaturesModeExceptionRes(parsedOutput, context); - case "OrganizationsNotInUseException": - case "com.amazonaws.cloudtrail#OrganizationsNotInUseException": - throw await de_OrganizationsNotInUseExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTrailCommand */ @@ -1266,7 +1006,7 @@ export const de_CreateTrailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTrailCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1279,133 +1019,14 @@ export const de_CreateTrailCommand = async ( }; /** - * deserializeAws_json1_1CreateTrailCommandError + * deserializeAws_json1_1DeleteChannelCommand */ -const de_CreateTrailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudTrailAccessNotEnabledException": - case "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException": - throw await de_CloudTrailAccessNotEnabledExceptionRes(parsedOutput, context); - case "CloudTrailInvalidClientTokenIdException": - case "com.amazonaws.cloudtrail#CloudTrailInvalidClientTokenIdException": - throw await de_CloudTrailInvalidClientTokenIdExceptionRes(parsedOutput, context); - case "CloudWatchLogsDeliveryUnavailableException": - case "com.amazonaws.cloudtrail#CloudWatchLogsDeliveryUnavailableException": - throw await de_CloudWatchLogsDeliveryUnavailableExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudtrail#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InsufficientDependencyServiceAccessPermissionException": - case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": - throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); - case "InsufficientEncryptionPolicyException": - case "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException": - throw await de_InsufficientEncryptionPolicyExceptionRes(parsedOutput, context); - case "InsufficientS3BucketPolicyException": - case "com.amazonaws.cloudtrail#InsufficientS3BucketPolicyException": - throw await de_InsufficientS3BucketPolicyExceptionRes(parsedOutput, context); - case "InsufficientSnsTopicPolicyException": - case "com.amazonaws.cloudtrail#InsufficientSnsTopicPolicyException": - throw await de_InsufficientSnsTopicPolicyExceptionRes(parsedOutput, context); - case "InvalidCloudWatchLogsLogGroupArnException": - case "com.amazonaws.cloudtrail#InvalidCloudWatchLogsLogGroupArnException": - throw await de_InvalidCloudWatchLogsLogGroupArnExceptionRes(parsedOutput, context); - case "InvalidCloudWatchLogsRoleArnException": - case "com.amazonaws.cloudtrail#InvalidCloudWatchLogsRoleArnException": - throw await de_InvalidCloudWatchLogsRoleArnExceptionRes(parsedOutput, context); - case "InvalidKmsKeyIdException": - case "com.amazonaws.cloudtrail#InvalidKmsKeyIdException": - throw await de_InvalidKmsKeyIdExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.cloudtrail#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidS3BucketNameException": - case "com.amazonaws.cloudtrail#InvalidS3BucketNameException": - throw await de_InvalidS3BucketNameExceptionRes(parsedOutput, context); - case "InvalidS3PrefixException": - case "com.amazonaws.cloudtrail#InvalidS3PrefixException": - throw await de_InvalidS3PrefixExceptionRes(parsedOutput, context); - case "InvalidSnsTopicNameException": - case "com.amazonaws.cloudtrail#InvalidSnsTopicNameException": - throw await de_InvalidSnsTopicNameExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.cloudtrail#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "InvalidTrailNameException": - case "com.amazonaws.cloudtrail#InvalidTrailNameException": - throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.cloudtrail#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "KmsKeyDisabledException": - case "com.amazonaws.cloudtrail#KmsKeyDisabledException": - throw await de_KmsKeyDisabledExceptionRes(parsedOutput, context); - case "KmsKeyNotFoundException": - case "com.amazonaws.cloudtrail#KmsKeyNotFoundException": - throw await de_KmsKeyNotFoundExceptionRes(parsedOutput, context); - case "MaximumNumberOfTrailsExceededException": - case "com.amazonaws.cloudtrail#MaximumNumberOfTrailsExceededException": - throw await de_MaximumNumberOfTrailsExceededExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "OrganizationNotInAllFeaturesModeException": - case "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException": - throw await de_OrganizationNotInAllFeaturesModeExceptionRes(parsedOutput, context); - case "OrganizationsNotInUseException": - case "com.amazonaws.cloudtrail#OrganizationsNotInUseException": - throw await de_OrganizationsNotInUseExceptionRes(parsedOutput, context); - case "S3BucketDoesNotExistException": - case "com.amazonaws.cloudtrail#S3BucketDoesNotExistException": - throw await de_S3BucketDoesNotExistExceptionRes(parsedOutput, context); - case "TagsLimitExceededException": - case "com.amazonaws.cloudtrail#TagsLimitExceededException": - throw await de_TagsLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudtrail#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TrailAlreadyExistsException": - case "com.amazonaws.cloudtrail#TrailAlreadyExistsException": - throw await de_TrailAlreadyExistsExceptionRes(parsedOutput, context); - case "TrailNotProvidedException": - case "com.amazonaws.cloudtrail#TrailNotProvidedException": - throw await de_TrailNotProvidedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteChannelCommand - */ -export const de_DeleteChannelCommand = async ( +export const de_DeleteChannelCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteChannelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1417,41 +1038,6 @@ export const de_DeleteChannelCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteChannelCommandError - */ -const de_DeleteChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ChannelARNInvalidException": - case "com.amazonaws.cloudtrail#ChannelARNInvalidException": - throw await de_ChannelARNInvalidExceptionRes(parsedOutput, context); - case "ChannelNotFoundException": - case "com.amazonaws.cloudtrail#ChannelNotFoundException": - throw await de_ChannelNotFoundExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteEventDataStoreCommand */ @@ -1460,7 +1046,7 @@ export const de_DeleteEventDataStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEventDataStoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1472,71 +1058,6 @@ export const de_DeleteEventDataStoreCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteEventDataStoreCommandError - */ -const de_DeleteEventDataStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ChannelExistsForEDSException": - case "com.amazonaws.cloudtrail#ChannelExistsForEDSException": - throw await de_ChannelExistsForEDSExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudtrail#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreFederationEnabledException": - case "com.amazonaws.cloudtrail#EventDataStoreFederationEnabledException": - throw await de_EventDataStoreFederationEnabledExceptionRes(parsedOutput, context); - case "EventDataStoreHasOngoingImportException": - case "com.amazonaws.cloudtrail#EventDataStoreHasOngoingImportException": - throw await de_EventDataStoreHasOngoingImportExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "EventDataStoreTerminationProtectedException": - case "com.amazonaws.cloudtrail#EventDataStoreTerminationProtectedException": - throw await de_EventDataStoreTerminationProtectedExceptionRes(parsedOutput, context); - case "InactiveEventDataStoreException": - case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": - throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); - case "InsufficientDependencyServiceAccessPermissionException": - case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": - throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteResourcePolicyCommand */ @@ -1545,7 +1066,7 @@ export const de_DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1557,47 +1078,6 @@ export const de_DeleteResourcePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceARNNotValidException": - case "com.amazonaws.cloudtrail#ResourceARNNotValidException": - throw await de_ResourceARNNotValidExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudtrail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourcePolicyNotFoundException": - case "com.amazonaws.cloudtrail#ResourcePolicyNotFoundException": - throw await de_ResourcePolicyNotFoundExceptionRes(parsedOutput, context); - case "ResourceTypeNotSupportedException": - case "com.amazonaws.cloudtrail#ResourceTypeNotSupportedException": - throw await de_ResourceTypeNotSupportedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteTrailCommand */ @@ -1606,7 +1086,7 @@ export const de_DeleteTrailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTrailCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1619,70 +1099,14 @@ export const de_DeleteTrailCommand = async ( }; /** - * deserializeAws_json1_1DeleteTrailCommandError + * deserializeAws_json1_1DeregisterOrganizationDelegatedAdminCommand */ -const de_DeleteTrailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudTrailARNInvalidException": - case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": - throw await de_CloudTrailARNInvalidExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudtrail#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InsufficientDependencyServiceAccessPermissionException": - case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": - throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); - case "InvalidHomeRegionException": - case "com.amazonaws.cloudtrail#InvalidHomeRegionException": - throw await de_InvalidHomeRegionExceptionRes(parsedOutput, context); - case "InvalidTrailNameException": - case "com.amazonaws.cloudtrail#InvalidTrailNameException": - throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudtrail#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TrailNotFoundException": - case "com.amazonaws.cloudtrail#TrailNotFoundException": - throw await de_TrailNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeregisterOrganizationDelegatedAdminCommand - */ -export const de_DeregisterOrganizationDelegatedAdminCommand = async ( +export const de_DeregisterOrganizationDelegatedAdminCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterOrganizationDelegatedAdminCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1694,62 +1118,6 @@ export const de_DeregisterOrganizationDelegatedAdminCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeregisterOrganizationDelegatedAdminCommandError - */ -const de_DeregisterOrganizationDelegatedAdminCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountNotFoundException": - case "com.amazonaws.cloudtrail#AccountNotFoundException": - throw await de_AccountNotFoundExceptionRes(parsedOutput, context); - case "AccountNotRegisteredException": - case "com.amazonaws.cloudtrail#AccountNotRegisteredException": - throw await de_AccountNotRegisteredExceptionRes(parsedOutput, context); - case "CloudTrailAccessNotEnabledException": - case "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException": - throw await de_CloudTrailAccessNotEnabledExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudtrail#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InsufficientDependencyServiceAccessPermissionException": - case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": - throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotOrganizationManagementAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationManagementAccountException": - throw await de_NotOrganizationManagementAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "OrganizationNotInAllFeaturesModeException": - case "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException": - throw await de_OrganizationNotInAllFeaturesModeExceptionRes(parsedOutput, context); - case "OrganizationsNotInUseException": - case "com.amazonaws.cloudtrail#OrganizationsNotInUseException": - throw await de_OrganizationsNotInUseExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeQueryCommand */ @@ -1758,7 +1126,7 @@ export const de_DescribeQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeQueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1770,53 +1138,6 @@ export const de_DescribeQueryCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeQueryCommandError - */ -const de_DescribeQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InactiveEventDataStoreException": - case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": - throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "QueryIdNotFoundException": - case "com.amazonaws.cloudtrail#QueryIdNotFoundException": - throw await de_QueryIdNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTrailsCommand */ @@ -1825,7 +1146,7 @@ export const de_DescribeTrailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrailsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1837,41 +1158,6 @@ export const de_DescribeTrailsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTrailsCommandError - */ -const de_DescribeTrailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidTrailNameException": - case "com.amazonaws.cloudtrail#InvalidTrailNameException": - throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisableFederationCommand */ @@ -1880,7 +1166,7 @@ export const de_DisableFederationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableFederationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1893,84 +1179,39 @@ export const de_DisableFederationCommand = async ( }; /** - * deserializeAws_json1_1DisableFederationCommandError + * deserializeAws_json1_1EnableFederationCommand */ -const de_DisableFederationCommandError = async ( +export const de_EnableFederationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cloudtrail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "CloudTrailAccessNotEnabledException": - case "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException": - throw await de_CloudTrailAccessNotEnabledExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.cloudtrail#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InactiveEventDataStoreException": - case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": - throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); - case "InsufficientDependencyServiceAccessPermissionException": - case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": - throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "OrganizationNotInAllFeaturesModeException": - case "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException": - throw await de_OrganizationNotInAllFeaturesModeExceptionRes(parsedOutput, context); - case "OrganizationsNotInUseException": - case "com.amazonaws.cloudtrail#OrganizationsNotInUseException": - throw await de_OrganizationsNotInUseExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: EnableFederationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1EnableFederationCommand + * deserializeAws_json1_1GetChannelCommand */ -export const de_EnableFederationCommand = async ( +export const de_GetChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_EnableFederationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: EnableFederationCommandOutput = { + contents = de_GetChannelResponse(data, context); + const response: GetChannelCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1978,87 +1219,39 @@ export const de_EnableFederationCommand = async ( }; /** - * deserializeAws_json1_1EnableFederationCommandError + * deserializeAws_json1_1GetEventDataStoreCommand */ -const de_EnableFederationCommandError = async ( +export const de_GetEventDataStoreCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cloudtrail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "CloudTrailAccessNotEnabledException": - case "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException": - throw await de_CloudTrailAccessNotEnabledExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.cloudtrail#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreFederationEnabledException": - case "com.amazonaws.cloudtrail#EventDataStoreFederationEnabledException": - throw await de_EventDataStoreFederationEnabledExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InactiveEventDataStoreException": - case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": - throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); - case "InsufficientDependencyServiceAccessPermissionException": - case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": - throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "OrganizationNotInAllFeaturesModeException": - case "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException": - throw await de_OrganizationNotInAllFeaturesModeExceptionRes(parsedOutput, context); - case "OrganizationsNotInUseException": - case "com.amazonaws.cloudtrail#OrganizationsNotInUseException": - throw await de_OrganizationsNotInUseExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetEventDataStoreResponse(data, context); + const response: GetEventDataStoreCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetChannelCommand + * deserializeAws_json1_1GetEventSelectorsCommand */ -export const de_GetChannelCommand = async ( +export const de_GetEventSelectorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetChannelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetChannelResponse(data, context); - const response: GetChannelCommandOutput = { + contents = _json(data); + const response: GetEventSelectorsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2066,54 +1259,39 @@ export const de_GetChannelCommand = async ( }; /** - * deserializeAws_json1_1GetChannelCommandError + * deserializeAws_json1_1GetImportCommand */ -const de_GetChannelCommandError = async ( +export const de_GetImportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ChannelARNInvalidException": - case "com.amazonaws.cloudtrail#ChannelARNInvalidException": - throw await de_ChannelARNInvalidExceptionRes(parsedOutput, context); - case "ChannelNotFoundException": - case "com.amazonaws.cloudtrail#ChannelNotFoundException": - throw await de_ChannelNotFoundExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetImportResponse(data, context); + const response: GetImportCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetEventDataStoreCommand + * deserializeAws_json1_1GetInsightSelectorsCommand */ -export const de_GetEventDataStoreCommand = async ( +export const de_GetInsightSelectorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetEventDataStoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetEventDataStoreResponse(data, context); - const response: GetEventDataStoreCommandOutput = { + contents = _json(data); + const response: GetInsightSelectorsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2121,60 +1299,39 @@ export const de_GetEventDataStoreCommand = async ( }; /** - * deserializeAws_json1_1GetEventDataStoreCommandError + * deserializeAws_json1_1GetQueryResultsCommand */ -const de_GetEventDataStoreCommandError = async ( +export const de_GetQueryResultsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetQueryResultsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetEventSelectorsCommand + * deserializeAws_json1_1GetResourcePolicyCommand */ -export const de_GetEventSelectorsCommand = async ( +export const de_GetResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetEventSelectorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetEventSelectorsCommandOutput = { + const response: GetResourcePolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2182,60 +1339,39 @@ export const de_GetEventSelectorsCommand = async ( }; /** - * deserializeAws_json1_1GetEventSelectorsCommandError + * deserializeAws_json1_1GetTrailCommand */ -const de_GetEventSelectorsCommandError = async ( +export const de_GetTrailCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudTrailARNInvalidException": - case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": - throw await de_CloudTrailARNInvalidExceptionRes(parsedOutput, context); - case "InvalidTrailNameException": - case "com.amazonaws.cloudtrail#InvalidTrailNameException": - throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "TrailNotFoundException": - case "com.amazonaws.cloudtrail#TrailNotFoundException": - throw await de_TrailNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetTrailCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetImportCommand + * deserializeAws_json1_1GetTrailStatusCommand */ -export const de_GetImportCommand = async ( +export const de_GetTrailStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetImportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetImportResponse(data, context); - const response: GetImportCommandOutput = { + contents = de_GetTrailStatusResponse(data, context); + const response: GetTrailStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2243,54 +1379,39 @@ export const de_GetImportCommand = async ( }; /** - * deserializeAws_json1_1GetImportCommandError + * deserializeAws_json1_1ListChannelsCommand */ -const de_GetImportCommandError = async ( +export const de_ListChannelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImportNotFoundException": - case "com.amazonaws.cloudtrail#ImportNotFoundException": - throw await de_ImportNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } -}; + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListChannelsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; /** - * deserializeAws_json1_1GetInsightSelectorsCommand + * deserializeAws_json1_1ListEventDataStoresCommand */ -export const de_GetInsightSelectorsCommand = async ( +export const de_ListEventDataStoresCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetInsightSelectorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetInsightSelectorsCommandOutput = { + contents = de_ListEventDataStoresResponse(data, context); + const response: ListEventDataStoresCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2298,72 +1419,39 @@ export const de_GetInsightSelectorsCommand = async ( }; /** - * deserializeAws_json1_1GetInsightSelectorsCommandError + * deserializeAws_json1_1ListImportFailuresCommand */ -const de_GetInsightSelectorsCommandError = async ( +export const de_ListImportFailuresCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudTrailARNInvalidException": - case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": - throw await de_CloudTrailARNInvalidExceptionRes(parsedOutput, context); - case "InsightNotEnabledException": - case "com.amazonaws.cloudtrail#InsightNotEnabledException": - throw await de_InsightNotEnabledExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.cloudtrail#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTrailNameException": - case "com.amazonaws.cloudtrail#InvalidTrailNameException": - throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudtrail#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TrailNotFoundException": - case "com.amazonaws.cloudtrail#TrailNotFoundException": - throw await de_TrailNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListImportFailuresResponse(data, context); + const response: ListImportFailuresCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetQueryResultsCommand + * deserializeAws_json1_1ListImportsCommand */ -export const de_GetQueryResultsCommand = async ( +export const de_ListImportsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetQueryResultsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetQueryResultsCommandOutput = { + contents = de_ListImportsResponse(data, context); + const response: ListImportsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2371,75 +1459,39 @@ export const de_GetQueryResultsCommand = async ( }; /** - * deserializeAws_json1_1GetQueryResultsCommandError + * deserializeAws_json1_1ListInsightsMetricDataCommand */ -const de_GetQueryResultsCommandError = async ( +export const de_ListInsightsMetricDataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InactiveEventDataStoreException": - case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": - throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); - case "InsufficientEncryptionPolicyException": - case "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException": - throw await de_InsufficientEncryptionPolicyExceptionRes(parsedOutput, context); - case "InvalidMaxResultsException": - case "com.amazonaws.cloudtrail#InvalidMaxResultsException": - throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.cloudtrail#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "QueryIdNotFoundException": - case "com.amazonaws.cloudtrail#QueryIdNotFoundException": - throw await de_QueryIdNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListInsightsMetricDataResponse(data, context); + const response: ListInsightsMetricDataCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetResourcePolicyCommand + * deserializeAws_json1_1ListPublicKeysCommand */ -export const de_GetResourcePolicyCommand = async ( +export const de_ListPublicKeysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetResourcePolicyCommandOutput = { + contents = de_ListPublicKeysResponse(data, context); + const response: ListPublicKeysCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2447,60 +1499,39 @@ export const de_GetResourcePolicyCommand = async ( }; /** - * deserializeAws_json1_1GetResourcePolicyCommandError + * deserializeAws_json1_1ListQueriesCommand */ -const de_GetResourcePolicyCommandError = async ( +export const de_ListQueriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceARNNotValidException": - case "com.amazonaws.cloudtrail#ResourceARNNotValidException": - throw await de_ResourceARNNotValidExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudtrail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourcePolicyNotFoundException": - case "com.amazonaws.cloudtrail#ResourcePolicyNotFoundException": - throw await de_ResourcePolicyNotFoundExceptionRes(parsedOutput, context); - case "ResourceTypeNotSupportedException": - case "com.amazonaws.cloudtrail#ResourceTypeNotSupportedException": - throw await de_ResourceTypeNotSupportedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListQueriesResponse(data, context); + const response: ListQueriesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetTrailCommand + * deserializeAws_json1_1ListTagsCommand */ -export const de_GetTrailCommand = async ( +export const de_ListTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetTrailCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetTrailCommandOutput = { + const response: ListTagsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2508,57 +1539,39 @@ export const de_GetTrailCommand = async ( }; /** - * deserializeAws_json1_1GetTrailCommandError + * deserializeAws_json1_1ListTrailsCommand */ -const de_GetTrailCommandError = async ( +export const de_ListTrailsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudTrailARNInvalidException": - case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": - throw await de_CloudTrailARNInvalidExceptionRes(parsedOutput, context); - case "InvalidTrailNameException": - case "com.amazonaws.cloudtrail#InvalidTrailNameException": - throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "TrailNotFoundException": - case "com.amazonaws.cloudtrail#TrailNotFoundException": - throw await de_TrailNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTrailsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetTrailStatusCommand + * deserializeAws_json1_1LookupEventsCommand */ -export const de_GetTrailStatusCommand = async ( +export const de_LookupEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetTrailStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetTrailStatusResponse(data, context); - const response: GetTrailStatusCommandOutput = { + contents = de_LookupEventsResponse(data, context); + const response: LookupEventsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2566,57 +1579,19 @@ export const de_GetTrailStatusCommand = async ( }; /** - * deserializeAws_json1_1GetTrailStatusCommandError + * deserializeAws_json1_1PutEventSelectorsCommand */ -const de_GetTrailStatusCommandError = async ( +export const de_PutEventSelectorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudTrailARNInvalidException": - case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": - throw await de_CloudTrailARNInvalidExceptionRes(parsedOutput, context); - case "InvalidTrailNameException": - case "com.amazonaws.cloudtrail#InvalidTrailNameException": - throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "TrailNotFoundException": - case "com.amazonaws.cloudtrail#TrailNotFoundException": - throw await de_TrailNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListChannelsCommand - */ -export const de_ListChannelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListChannelsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListChannelsCommandOutput = { + const response: PutEventSelectorsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2624,51 +1599,19 @@ export const de_ListChannelsCommand = async ( }; /** - * deserializeAws_json1_1ListChannelsCommandError - */ -const de_ListChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.cloudtrail#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListEventDataStoresCommand + * deserializeAws_json1_1PutInsightSelectorsCommand */ -export const de_ListEventDataStoresCommand = async ( +export const de_PutInsightSelectorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListEventDataStoresCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListEventDataStoresResponse(data, context); - const response: ListEventDataStoresCommandOutput = { + contents = _json(data); + const response: PutInsightSelectorsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2676,57 +1619,19 @@ export const de_ListEventDataStoresCommand = async ( }; /** - * deserializeAws_json1_1ListEventDataStoresCommandError - */ -const de_ListEventDataStoresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidMaxResultsException": - case "com.amazonaws.cloudtrail#InvalidMaxResultsException": - throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.cloudtrail#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListImportFailuresCommand + * deserializeAws_json1_1PutResourcePolicyCommand */ -export const de_ListImportFailuresCommand = async ( +export const de_PutResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListImportFailuresCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListImportFailuresResponse(data, context); - const response: ListImportFailuresCommandOutput = { + contents = _json(data); + const response: PutResourcePolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2734,51 +1639,19 @@ export const de_ListImportFailuresCommand = async ( }; /** - * deserializeAws_json1_1ListImportFailuresCommandError - */ -const de_ListImportFailuresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.cloudtrail#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListImportsCommand + * deserializeAws_json1_1RegisterOrganizationDelegatedAdminCommand */ -export const de_ListImportsCommand = async ( +export const de_RegisterOrganizationDelegatedAdminCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListImportsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListImportsResponse(data, context); - const response: ListImportsCommandOutput = { + contents = _json(data); + const response: RegisterOrganizationDelegatedAdminCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2786,57 +1659,19 @@ export const de_ListImportsCommand = async ( }; /** - * deserializeAws_json1_1ListImportsCommandError - */ -const de_ListImportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.cloudtrail#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListInsightsMetricDataCommand + * deserializeAws_json1_1RemoveTagsCommand */ -export const de_ListInsightsMetricDataCommand = async ( +export const de_RemoveTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListInsightsMetricDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListInsightsMetricDataResponse(data, context); - const response: ListInsightsMetricDataCommandOutput = { + contents = _json(data); + const response: RemoveTagsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2844,51 +1679,39 @@ export const de_ListInsightsMetricDataCommand = async ( }; /** - * deserializeAws_json1_1ListInsightsMetricDataCommandError + * deserializeAws_json1_1RestoreEventDataStoreCommand */ -const de_ListInsightsMetricDataCommandError = async ( +export const de_RestoreEventDataStoreCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RestoreEventDataStoreResponse(data, context); + const response: RestoreEventDataStoreCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListPublicKeysCommand + * deserializeAws_json1_1StartEventDataStoreIngestionCommand */ -export const de_ListPublicKeysCommand = async ( +export const de_StartEventDataStoreIngestionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListPublicKeysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListPublicKeysResponse(data, context); - const response: ListPublicKeysCommandOutput = { + contents = _json(data); + const response: StartEventDataStoreIngestionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2896,1188 +1719,39 @@ export const de_ListPublicKeysCommand = async ( }; /** - * deserializeAws_json1_1ListPublicKeysCommandError + * deserializeAws_json1_1StartImportCommand */ -const de_ListPublicKeysCommandError = async ( +export const de_StartImportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidTimeRangeException": - case "com.amazonaws.cloudtrail#InvalidTimeRangeException": - throw await de_InvalidTimeRangeExceptionRes(parsedOutput, context); - case "InvalidTokenException": - case "com.amazonaws.cloudtrail#InvalidTokenException": - throw await de_InvalidTokenExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListQueriesCommand - */ -export const de_ListQueriesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListQueriesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListQueriesResponse(data, context); - const response: ListQueriesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListQueriesCommandError - */ -const de_ListQueriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InactiveEventDataStoreException": - case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": - throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); - case "InvalidDateRangeException": - case "com.amazonaws.cloudtrail#InvalidDateRangeException": - throw await de_InvalidDateRangeExceptionRes(parsedOutput, context); - case "InvalidMaxResultsException": - case "com.amazonaws.cloudtrail#InvalidMaxResultsException": - throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.cloudtrail#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidQueryStatusException": - case "com.amazonaws.cloudtrail#InvalidQueryStatusException": - throw await de_InvalidQueryStatusExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsCommand - */ -export const de_ListTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsCommandError - */ -const de_ListTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ChannelARNInvalidException": - case "com.amazonaws.cloudtrail#ChannelARNInvalidException": - throw await de_ChannelARNInvalidExceptionRes(parsedOutput, context); - case "CloudTrailARNInvalidException": - case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": - throw await de_CloudTrailARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InactiveEventDataStoreException": - case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": - throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); - case "InvalidTokenException": - case "com.amazonaws.cloudtrail#InvalidTokenException": - throw await de_InvalidTokenExceptionRes(parsedOutput, context); - case "InvalidTrailNameException": - case "com.amazonaws.cloudtrail#InvalidTrailNameException": - throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudtrail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceTypeNotSupportedException": - case "com.amazonaws.cloudtrail#ResourceTypeNotSupportedException": - throw await de_ResourceTypeNotSupportedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTrailsCommand - */ -export const de_ListTrailsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTrailsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTrailsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTrailsCommandError - */ -const de_ListTrailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1LookupEventsCommand - */ -export const de_LookupEventsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_LookupEventsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_LookupEventsResponse(data, context); - const response: LookupEventsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1LookupEventsCommandError - */ -const de_LookupEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidEventCategoryException": - case "com.amazonaws.cloudtrail#InvalidEventCategoryException": - throw await de_InvalidEventCategoryExceptionRes(parsedOutput, context); - case "InvalidLookupAttributesException": - case "com.amazonaws.cloudtrail#InvalidLookupAttributesException": - throw await de_InvalidLookupAttributesExceptionRes(parsedOutput, context); - case "InvalidMaxResultsException": - case "com.amazonaws.cloudtrail#InvalidMaxResultsException": - throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.cloudtrail#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidTimeRangeException": - case "com.amazonaws.cloudtrail#InvalidTimeRangeException": - throw await de_InvalidTimeRangeExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutEventSelectorsCommand - */ -export const de_PutEventSelectorsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutEventSelectorsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutEventSelectorsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutEventSelectorsCommandError - */ -const de_PutEventSelectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudTrailARNInvalidException": - case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": - throw await de_CloudTrailARNInvalidExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudtrail#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InsufficientDependencyServiceAccessPermissionException": - case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": - throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); - case "InvalidEventSelectorsException": - case "com.amazonaws.cloudtrail#InvalidEventSelectorsException": - throw await de_InvalidEventSelectorsExceptionRes(parsedOutput, context); - case "InvalidHomeRegionException": - case "com.amazonaws.cloudtrail#InvalidHomeRegionException": - throw await de_InvalidHomeRegionExceptionRes(parsedOutput, context); - case "InvalidTrailNameException": - case "com.amazonaws.cloudtrail#InvalidTrailNameException": - throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudtrail#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TrailNotFoundException": - case "com.amazonaws.cloudtrail#TrailNotFoundException": - throw await de_TrailNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutInsightSelectorsCommand - */ -export const de_PutInsightSelectorsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutInsightSelectorsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutInsightSelectorsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutInsightSelectorsCommandError - */ -const de_PutInsightSelectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudTrailARNInvalidException": - case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": - throw await de_CloudTrailARNInvalidExceptionRes(parsedOutput, context); - case "InsufficientEncryptionPolicyException": - case "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException": - throw await de_InsufficientEncryptionPolicyExceptionRes(parsedOutput, context); - case "InsufficientS3BucketPolicyException": - case "com.amazonaws.cloudtrail#InsufficientS3BucketPolicyException": - throw await de_InsufficientS3BucketPolicyExceptionRes(parsedOutput, context); - case "InvalidHomeRegionException": - case "com.amazonaws.cloudtrail#InvalidHomeRegionException": - throw await de_InvalidHomeRegionExceptionRes(parsedOutput, context); - case "InvalidInsightSelectorsException": - case "com.amazonaws.cloudtrail#InvalidInsightSelectorsException": - throw await de_InvalidInsightSelectorsExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.cloudtrail#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTrailNameException": - case "com.amazonaws.cloudtrail#InvalidTrailNameException": - throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.cloudtrail#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "S3BucketDoesNotExistException": - case "com.amazonaws.cloudtrail#S3BucketDoesNotExistException": - throw await de_S3BucketDoesNotExistExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudtrail#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TrailNotFoundException": - case "com.amazonaws.cloudtrail#TrailNotFoundException": - throw await de_TrailNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutResourcePolicyCommand - */ -export const de_PutResourcePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutResourcePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceARNNotValidException": - case "com.amazonaws.cloudtrail#ResourceARNNotValidException": - throw await de_ResourceARNNotValidExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudtrail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourcePolicyNotValidException": - case "com.amazonaws.cloudtrail#ResourcePolicyNotValidException": - throw await de_ResourcePolicyNotValidExceptionRes(parsedOutput, context); - case "ResourceTypeNotSupportedException": - case "com.amazonaws.cloudtrail#ResourceTypeNotSupportedException": - throw await de_ResourceTypeNotSupportedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RegisterOrganizationDelegatedAdminCommand - */ -export const de_RegisterOrganizationDelegatedAdminCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RegisterOrganizationDelegatedAdminCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: RegisterOrganizationDelegatedAdminCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RegisterOrganizationDelegatedAdminCommandError - */ -const de_RegisterOrganizationDelegatedAdminCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountNotFoundException": - case "com.amazonaws.cloudtrail#AccountNotFoundException": - throw await de_AccountNotFoundExceptionRes(parsedOutput, context); - case "AccountRegisteredException": - case "com.amazonaws.cloudtrail#AccountRegisteredException": - throw await de_AccountRegisteredExceptionRes(parsedOutput, context); - case "CannotDelegateManagementAccountException": - case "com.amazonaws.cloudtrail#CannotDelegateManagementAccountException": - throw await de_CannotDelegateManagementAccountExceptionRes(parsedOutput, context); - case "CloudTrailAccessNotEnabledException": - case "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException": - throw await de_CloudTrailAccessNotEnabledExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudtrail#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DelegatedAdminAccountLimitExceededException": - case "com.amazonaws.cloudtrail#DelegatedAdminAccountLimitExceededException": - throw await de_DelegatedAdminAccountLimitExceededExceptionRes(parsedOutput, context); - case "InsufficientDependencyServiceAccessPermissionException": - case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": - throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotOrganizationManagementAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationManagementAccountException": - throw await de_NotOrganizationManagementAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "OrganizationNotInAllFeaturesModeException": - case "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException": - throw await de_OrganizationNotInAllFeaturesModeExceptionRes(parsedOutput, context); - case "OrganizationsNotInUseException": - case "com.amazonaws.cloudtrail#OrganizationsNotInUseException": - throw await de_OrganizationsNotInUseExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RemoveTagsCommand - */ -export const de_RemoveTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: RemoveTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RemoveTagsCommandError - */ -const de_RemoveTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ChannelARNInvalidException": - case "com.amazonaws.cloudtrail#ChannelARNInvalidException": - throw await de_ChannelARNInvalidExceptionRes(parsedOutput, context); - case "ChannelNotFoundException": - case "com.amazonaws.cloudtrail#ChannelNotFoundException": - throw await de_ChannelNotFoundExceptionRes(parsedOutput, context); - case "CloudTrailARNInvalidException": - case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": - throw await de_CloudTrailARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InactiveEventDataStoreException": - case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": - throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.cloudtrail#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "InvalidTrailNameException": - case "com.amazonaws.cloudtrail#InvalidTrailNameException": - throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudtrail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceTypeNotSupportedException": - case "com.amazonaws.cloudtrail#ResourceTypeNotSupportedException": - throw await de_ResourceTypeNotSupportedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RestoreEventDataStoreCommand - */ -export const de_RestoreEventDataStoreCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RestoreEventDataStoreCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RestoreEventDataStoreResponse(data, context); - const response: RestoreEventDataStoreCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RestoreEventDataStoreCommandError - */ -const de_RestoreEventDataStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudTrailAccessNotEnabledException": - case "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException": - throw await de_CloudTrailAccessNotEnabledExceptionRes(parsedOutput, context); - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreMaxLimitExceededException": - case "com.amazonaws.cloudtrail#EventDataStoreMaxLimitExceededException": - throw await de_EventDataStoreMaxLimitExceededExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InsufficientDependencyServiceAccessPermissionException": - case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": - throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); - case "InvalidEventDataStoreStatusException": - case "com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException": - throw await de_InvalidEventDataStoreStatusExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "OrganizationNotInAllFeaturesModeException": - case "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException": - throw await de_OrganizationNotInAllFeaturesModeExceptionRes(parsedOutput, context); - case "OrganizationsNotInUseException": - case "com.amazonaws.cloudtrail#OrganizationsNotInUseException": - throw await de_OrganizationsNotInUseExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartEventDataStoreIngestionCommand - */ -export const de_StartEventDataStoreIngestionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartEventDataStoreIngestionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartEventDataStoreIngestionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartEventDataStoreIngestionCommandError - */ -const de_StartEventDataStoreIngestionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InsufficientDependencyServiceAccessPermissionException": - case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": - throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); - case "InvalidEventDataStoreCategoryException": - case "com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException": - throw await de_InvalidEventDataStoreCategoryExceptionRes(parsedOutput, context); - case "InvalidEventDataStoreStatusException": - case "com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException": - throw await de_InvalidEventDataStoreStatusExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartImportCommand - */ -export const de_StartImportCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartImportCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_StartImportResponse(data, context); - const response: StartImportCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartImportCommandError - */ -const de_StartImportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountHasOngoingImportException": - case "com.amazonaws.cloudtrail#AccountHasOngoingImportException": - throw await de_AccountHasOngoingImportExceptionRes(parsedOutput, context); - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "ImportNotFoundException": - case "com.amazonaws.cloudtrail#ImportNotFoundException": - throw await de_ImportNotFoundExceptionRes(parsedOutput, context); - case "InactiveEventDataStoreException": - case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": - throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); - case "InsufficientEncryptionPolicyException": - case "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException": - throw await de_InsufficientEncryptionPolicyExceptionRes(parsedOutput, context); - case "InvalidEventDataStoreCategoryException": - case "com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException": - throw await de_InvalidEventDataStoreCategoryExceptionRes(parsedOutput, context); - case "InvalidEventDataStoreStatusException": - case "com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException": - throw await de_InvalidEventDataStoreStatusExceptionRes(parsedOutput, context); - case "InvalidImportSourceException": - case "com.amazonaws.cloudtrail#InvalidImportSourceException": - throw await de_InvalidImportSourceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartLoggingCommand - */ -export const de_StartLoggingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartLoggingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartLoggingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartLoggingCommandError - */ -const de_StartLoggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudTrailARNInvalidException": - case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": - throw await de_CloudTrailARNInvalidExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudtrail#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InsufficientDependencyServiceAccessPermissionException": - case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": - throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); - case "InvalidHomeRegionException": - case "com.amazonaws.cloudtrail#InvalidHomeRegionException": - throw await de_InvalidHomeRegionExceptionRes(parsedOutput, context); - case "InvalidTrailNameException": - case "com.amazonaws.cloudtrail#InvalidTrailNameException": - throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudtrail#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TrailNotFoundException": - case "com.amazonaws.cloudtrail#TrailNotFoundException": - throw await de_TrailNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartQueryCommand - */ -export const de_StartQueryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartQueryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartQueryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartQueryCommandError - */ -const de_StartQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InactiveEventDataStoreException": - case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": - throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); - case "InsufficientEncryptionPolicyException": - case "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException": - throw await de_InsufficientEncryptionPolicyExceptionRes(parsedOutput, context); - case "InsufficientS3BucketPolicyException": - case "com.amazonaws.cloudtrail#InsufficientS3BucketPolicyException": - throw await de_InsufficientS3BucketPolicyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidQueryStatementException": - case "com.amazonaws.cloudtrail#InvalidQueryStatementException": - throw await de_InvalidQueryStatementExceptionRes(parsedOutput, context); - case "InvalidS3BucketNameException": - case "com.amazonaws.cloudtrail#InvalidS3BucketNameException": - throw await de_InvalidS3BucketNameExceptionRes(parsedOutput, context); - case "InvalidS3PrefixException": - case "com.amazonaws.cloudtrail#InvalidS3PrefixException": - throw await de_InvalidS3PrefixExceptionRes(parsedOutput, context); - case "MaxConcurrentQueriesException": - case "com.amazonaws.cloudtrail#MaxConcurrentQueriesException": - throw await de_MaxConcurrentQueriesExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "S3BucketDoesNotExistException": - case "com.amazonaws.cloudtrail#S3BucketDoesNotExistException": - throw await de_S3BucketDoesNotExistExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StopEventDataStoreIngestionCommand - */ -export const de_StopEventDataStoreIngestionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopEventDataStoreIngestionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StopEventDataStoreIngestionCommandOutput = { + contents = de_StartImportResponse(data, context); + const response: StartImportCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; - return response; -}; - -/** - * deserializeAws_json1_1StopEventDataStoreIngestionCommandError - */ -const de_StopEventDataStoreIngestionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InsufficientDependencyServiceAccessPermissionException": - case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": - throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); - case "InvalidEventDataStoreCategoryException": - case "com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException": - throw await de_InvalidEventDataStoreCategoryExceptionRes(parsedOutput, context); - case "InvalidEventDataStoreStatusException": - case "com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException": - throw await de_InvalidEventDataStoreStatusExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1StopImportCommand + * deserializeAws_json1_1StartLoggingCommand */ -export const de_StopImportCommand = async ( +export const de_StartLoggingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopImportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StopImportResponse(data, context); - const response: StopImportCommandOutput = { + contents = _json(data); + const response: StartLoggingCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4085,54 +1759,39 @@ export const de_StopImportCommand = async ( }; /** - * deserializeAws_json1_1StopImportCommandError + * deserializeAws_json1_1StartQueryCommand */ -const de_StopImportCommandError = async ( +export const de_StartQueryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImportNotFoundException": - case "com.amazonaws.cloudtrail#ImportNotFoundException": - throw await de_ImportNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartQueryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopLoggingCommand + * deserializeAws_json1_1StopEventDataStoreIngestionCommand */ -export const de_StopLoggingCommand = async ( +export const de_StopEventDataStoreIngestionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopLoggingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopLoggingCommandOutput = { + const response: StopEventDataStoreIngestionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4140,75 +1799,39 @@ export const de_StopLoggingCommand = async ( }; /** - * deserializeAws_json1_1StopLoggingCommandError + * deserializeAws_json1_1StopImportCommand */ -const de_StopLoggingCommandError = async ( +export const de_StopImportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudTrailARNInvalidException": - case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": - throw await de_CloudTrailARNInvalidExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudtrail#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InsufficientDependencyServiceAccessPermissionException": - case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": - throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); - case "InvalidHomeRegionException": - case "com.amazonaws.cloudtrail#InvalidHomeRegionException": - throw await de_InvalidHomeRegionExceptionRes(parsedOutput, context); - case "InvalidTrailNameException": - case "com.amazonaws.cloudtrail#InvalidTrailNameException": - throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudtrail#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TrailNotFoundException": - case "com.amazonaws.cloudtrail#TrailNotFoundException": - throw await de_TrailNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StopImportResponse(data, context); + const response: StopImportCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateChannelCommand + * deserializeAws_json1_1StopLoggingCommand */ -export const de_UpdateChannelCommand = async ( +export const de_StopLoggingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateChannelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateChannelCommandOutput = { + const response: StopLoggingCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4216,56 +1839,23 @@ export const de_UpdateChannelCommand = async ( }; /** - * deserializeAws_json1_1UpdateChannelCommandError + * deserializeAws_json1_1UpdateChannelCommand */ -const de_UpdateChannelCommandError = async ( +export const de_UpdateChannelCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ChannelARNInvalidException": - case "com.amazonaws.cloudtrail#ChannelARNInvalidException": - throw await de_ChannelARNInvalidExceptionRes(parsedOutput, context); - case "ChannelAlreadyExistsException": - case "com.amazonaws.cloudtrail#ChannelAlreadyExistsException": - throw await de_ChannelAlreadyExistsExceptionRes(parsedOutput, context); - case "ChannelNotFoundException": - case "com.amazonaws.cloudtrail#ChannelNotFoundException": - throw await de_ChannelNotFoundExceptionRes(parsedOutput, context); - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InactiveEventDataStoreException": - case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": - throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); - case "InvalidEventDataStoreCategoryException": - case "com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException": - throw await de_InvalidEventDataStoreCategoryExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateChannelCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -4276,7 +1866,7 @@ export const de_UpdateEventDataStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateEventDataStoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4285,90 +1875,7 @@ export const de_UpdateEventDataStoreCommand = async ( $metadata: deserializeMetadata(output), ...contents, }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateEventDataStoreCommandError - */ -const de_UpdateEventDataStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudTrailAccessNotEnabledException": - case "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException": - throw await de_CloudTrailAccessNotEnabledExceptionRes(parsedOutput, context); - case "EventDataStoreARNInvalidException": - case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": - throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); - case "EventDataStoreAlreadyExistsException": - case "com.amazonaws.cloudtrail#EventDataStoreAlreadyExistsException": - throw await de_EventDataStoreAlreadyExistsExceptionRes(parsedOutput, context); - case "EventDataStoreHasOngoingImportException": - case "com.amazonaws.cloudtrail#EventDataStoreHasOngoingImportException": - throw await de_EventDataStoreHasOngoingImportExceptionRes(parsedOutput, context); - case "EventDataStoreNotFoundException": - case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": - throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); - case "InactiveEventDataStoreException": - case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": - throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); - case "InsufficientDependencyServiceAccessPermissionException": - case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": - throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); - case "InsufficientEncryptionPolicyException": - case "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException": - throw await de_InsufficientEncryptionPolicyExceptionRes(parsedOutput, context); - case "InvalidEventSelectorsException": - case "com.amazonaws.cloudtrail#InvalidEventSelectorsException": - throw await de_InvalidEventSelectorsExceptionRes(parsedOutput, context); - case "InvalidInsightSelectorsException": - case "com.amazonaws.cloudtrail#InvalidInsightSelectorsException": - throw await de_InvalidInsightSelectorsExceptionRes(parsedOutput, context); - case "InvalidKmsKeyIdException": - case "com.amazonaws.cloudtrail#InvalidKmsKeyIdException": - throw await de_InvalidKmsKeyIdExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.cloudtrail#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "KmsKeyNotFoundException": - case "com.amazonaws.cloudtrail#KmsKeyNotFoundException": - throw await de_KmsKeyNotFoundExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "OrganizationNotInAllFeaturesModeException": - case "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException": - throw await de_OrganizationNotInAllFeaturesModeExceptionRes(parsedOutput, context); - case "OrganizationsNotInUseException": - case "com.amazonaws.cloudtrail#OrganizationsNotInUseException": - throw await de_OrganizationsNotInUseExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** @@ -4379,7 +1886,7 @@ export const de_UpdateTrailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTrailCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4392,39 +1899,123 @@ export const de_UpdateTrailCommand = async ( }; /** - * deserializeAws_json1_1UpdateTrailCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateTrailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "ChannelARNInvalidException": + case "com.amazonaws.cloudtrail#ChannelARNInvalidException": + throw await de_ChannelARNInvalidExceptionRes(parsedOutput, context); + case "ChannelNotFoundException": + case "com.amazonaws.cloudtrail#ChannelNotFoundException": + throw await de_ChannelNotFoundExceptionRes(parsedOutput, context); case "CloudTrailARNInvalidException": case "com.amazonaws.cloudtrail#CloudTrailARNInvalidException": throw await de_CloudTrailARNInvalidExceptionRes(parsedOutput, context); - case "CloudTrailAccessNotEnabledException": - case "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException": - throw await de_CloudTrailAccessNotEnabledExceptionRes(parsedOutput, context); - case "CloudTrailInvalidClientTokenIdException": - case "com.amazonaws.cloudtrail#CloudTrailInvalidClientTokenIdException": - throw await de_CloudTrailInvalidClientTokenIdExceptionRes(parsedOutput, context); - case "CloudWatchLogsDeliveryUnavailableException": - case "com.amazonaws.cloudtrail#CloudWatchLogsDeliveryUnavailableException": - throw await de_CloudWatchLogsDeliveryUnavailableExceptionRes(parsedOutput, context); case "ConflictException": case "com.amazonaws.cloudtrail#ConflictException": throw await de_ConflictExceptionRes(parsedOutput, context); + case "EventDataStoreARNInvalidException": + case "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException": + throw await de_EventDataStoreARNInvalidExceptionRes(parsedOutput, context); + case "EventDataStoreNotFoundException": + case "com.amazonaws.cloudtrail#EventDataStoreNotFoundException": + throw await de_EventDataStoreNotFoundExceptionRes(parsedOutput, context); + case "InactiveEventDataStoreException": + case "com.amazonaws.cloudtrail#InactiveEventDataStoreException": + throw await de_InactiveEventDataStoreExceptionRes(parsedOutput, context); + case "InvalidTagParameterException": + case "com.amazonaws.cloudtrail#InvalidTagParameterException": + throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); + case "InvalidTrailNameException": + case "com.amazonaws.cloudtrail#InvalidTrailNameException": + throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); + case "NoManagementAccountSLRExistsException": + case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": + throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); + case "NotOrganizationMasterAccountException": + case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": + throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); + case "OperationNotPermittedException": + case "com.amazonaws.cloudtrail#OperationNotPermittedException": + throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cloudtrail#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ResourceTypeNotSupportedException": + case "com.amazonaws.cloudtrail#ResourceTypeNotSupportedException": + throw await de_ResourceTypeNotSupportedExceptionRes(parsedOutput, context); + case "TagsLimitExceededException": + case "com.amazonaws.cloudtrail#TagsLimitExceededException": + throw await de_TagsLimitExceededExceptionRes(parsedOutput, context); + case "UnsupportedOperationException": + case "com.amazonaws.cloudtrail#UnsupportedOperationException": + throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); + case "InactiveQueryException": + case "com.amazonaws.cloudtrail#InactiveQueryException": + throw await de_InactiveQueryExceptionRes(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.cloudtrail#InvalidParameterException": + throw await de_InvalidParameterExceptionRes(parsedOutput, context); + case "QueryIdNotFoundException": + case "com.amazonaws.cloudtrail#QueryIdNotFoundException": + throw await de_QueryIdNotFoundExceptionRes(parsedOutput, context); + case "ChannelAlreadyExistsException": + case "com.amazonaws.cloudtrail#ChannelAlreadyExistsException": + throw await de_ChannelAlreadyExistsExceptionRes(parsedOutput, context); + case "ChannelMaxLimitExceededException": + case "com.amazonaws.cloudtrail#ChannelMaxLimitExceededException": + throw await de_ChannelMaxLimitExceededExceptionRes(parsedOutput, context); + case "InvalidEventDataStoreCategoryException": + case "com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException": + throw await de_InvalidEventDataStoreCategoryExceptionRes(parsedOutput, context); + case "InvalidSourceException": + case "com.amazonaws.cloudtrail#InvalidSourceException": + throw await de_InvalidSourceExceptionRes(parsedOutput, context); + case "CloudTrailAccessNotEnabledException": + case "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException": + throw await de_CloudTrailAccessNotEnabledExceptionRes(parsedOutput, context); + case "EventDataStoreAlreadyExistsException": + case "com.amazonaws.cloudtrail#EventDataStoreAlreadyExistsException": + throw await de_EventDataStoreAlreadyExistsExceptionRes(parsedOutput, context); + case "EventDataStoreMaxLimitExceededException": + case "com.amazonaws.cloudtrail#EventDataStoreMaxLimitExceededException": + throw await de_EventDataStoreMaxLimitExceededExceptionRes(parsedOutput, context); case "InsufficientDependencyServiceAccessPermissionException": case "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException": throw await de_InsufficientDependencyServiceAccessPermissionExceptionRes(parsedOutput, context); case "InsufficientEncryptionPolicyException": case "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException": throw await de_InsufficientEncryptionPolicyExceptionRes(parsedOutput, context); + case "InvalidEventSelectorsException": + case "com.amazonaws.cloudtrail#InvalidEventSelectorsException": + throw await de_InvalidEventSelectorsExceptionRes(parsedOutput, context); + case "InvalidKmsKeyIdException": + case "com.amazonaws.cloudtrail#InvalidKmsKeyIdException": + throw await de_InvalidKmsKeyIdExceptionRes(parsedOutput, context); + case "KmsException": + case "com.amazonaws.cloudtrail#KmsException": + throw await de_KmsExceptionRes(parsedOutput, context); + case "KmsKeyNotFoundException": + case "com.amazonaws.cloudtrail#KmsKeyNotFoundException": + throw await de_KmsKeyNotFoundExceptionRes(parsedOutput, context); + case "OrganizationNotInAllFeaturesModeException": + case "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException": + throw await de_OrganizationNotInAllFeaturesModeExceptionRes(parsedOutput, context); + case "OrganizationsNotInUseException": + case "com.amazonaws.cloudtrail#OrganizationsNotInUseException": + throw await de_OrganizationsNotInUseExceptionRes(parsedOutput, context); + case "CloudTrailInvalidClientTokenIdException": + case "com.amazonaws.cloudtrail#CloudTrailInvalidClientTokenIdException": + throw await de_CloudTrailInvalidClientTokenIdExceptionRes(parsedOutput, context); + case "CloudWatchLogsDeliveryUnavailableException": + case "com.amazonaws.cloudtrail#CloudWatchLogsDeliveryUnavailableException": + throw await de_CloudWatchLogsDeliveryUnavailableExceptionRes(parsedOutput, context); case "InsufficientS3BucketPolicyException": case "com.amazonaws.cloudtrail#InsufficientS3BucketPolicyException": throw await de_InsufficientS3BucketPolicyExceptionRes(parsedOutput, context); @@ -4437,21 +2028,9 @@ const de_UpdateTrailCommandError = async ( case "InvalidCloudWatchLogsRoleArnException": case "com.amazonaws.cloudtrail#InvalidCloudWatchLogsRoleArnException": throw await de_InvalidCloudWatchLogsRoleArnExceptionRes(parsedOutput, context); - case "InvalidEventSelectorsException": - case "com.amazonaws.cloudtrail#InvalidEventSelectorsException": - throw await de_InvalidEventSelectorsExceptionRes(parsedOutput, context); - case "InvalidHomeRegionException": - case "com.amazonaws.cloudtrail#InvalidHomeRegionException": - throw await de_InvalidHomeRegionExceptionRes(parsedOutput, context); - case "InvalidKmsKeyIdException": - case "com.amazonaws.cloudtrail#InvalidKmsKeyIdException": - throw await de_InvalidKmsKeyIdExceptionRes(parsedOutput, context); case "InvalidParameterCombinationException": case "com.amazonaws.cloudtrail#InvalidParameterCombinationException": throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudtrail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); case "InvalidS3BucketNameException": case "com.amazonaws.cloudtrail#InvalidS3BucketNameException": throw await de_InvalidS3BucketNameExceptionRes(parsedOutput, context); @@ -4461,55 +2040,130 @@ const de_UpdateTrailCommandError = async ( case "InvalidSnsTopicNameException": case "com.amazonaws.cloudtrail#InvalidSnsTopicNameException": throw await de_InvalidSnsTopicNameExceptionRes(parsedOutput, context); - case "InvalidTrailNameException": - case "com.amazonaws.cloudtrail#InvalidTrailNameException": - throw await de_InvalidTrailNameExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.cloudtrail#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); case "KmsKeyDisabledException": case "com.amazonaws.cloudtrail#KmsKeyDisabledException": throw await de_KmsKeyDisabledExceptionRes(parsedOutput, context); - case "KmsKeyNotFoundException": - case "com.amazonaws.cloudtrail#KmsKeyNotFoundException": - throw await de_KmsKeyNotFoundExceptionRes(parsedOutput, context); - case "NoManagementAccountSLRExistsException": - case "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException": - throw await de_NoManagementAccountSLRExistsExceptionRes(parsedOutput, context); - case "NotOrganizationMasterAccountException": - case "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException": - throw await de_NotOrganizationMasterAccountExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.cloudtrail#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "OrganizationNotInAllFeaturesModeException": - case "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException": - throw await de_OrganizationNotInAllFeaturesModeExceptionRes(parsedOutput, context); - case "OrganizationsNotInUseException": - case "com.amazonaws.cloudtrail#OrganizationsNotInUseException": - throw await de_OrganizationsNotInUseExceptionRes(parsedOutput, context); + case "MaximumNumberOfTrailsExceededException": + case "com.amazonaws.cloudtrail#MaximumNumberOfTrailsExceededException": + throw await de_MaximumNumberOfTrailsExceededExceptionRes(parsedOutput, context); case "S3BucketDoesNotExistException": case "com.amazonaws.cloudtrail#S3BucketDoesNotExistException": throw await de_S3BucketDoesNotExistExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.cloudtrail#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TrailNotFoundException": - case "com.amazonaws.cloudtrail#TrailNotFoundException": - throw await de_TrailNotFoundExceptionRes(parsedOutput, context); + case "TrailAlreadyExistsException": + case "com.amazonaws.cloudtrail#TrailAlreadyExistsException": + throw await de_TrailAlreadyExistsExceptionRes(parsedOutput, context); case "TrailNotProvidedException": case "com.amazonaws.cloudtrail#TrailNotProvidedException": throw await de_TrailNotProvidedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cloudtrail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); + case "ChannelExistsForEDSException": + case "com.amazonaws.cloudtrail#ChannelExistsForEDSException": + throw await de_ChannelExistsForEDSExceptionRes(parsedOutput, context); + case "EventDataStoreFederationEnabledException": + case "com.amazonaws.cloudtrail#EventDataStoreFederationEnabledException": + throw await de_EventDataStoreFederationEnabledExceptionRes(parsedOutput, context); + case "EventDataStoreHasOngoingImportException": + case "com.amazonaws.cloudtrail#EventDataStoreHasOngoingImportException": + throw await de_EventDataStoreHasOngoingImportExceptionRes(parsedOutput, context); + case "EventDataStoreTerminationProtectedException": + case "com.amazonaws.cloudtrail#EventDataStoreTerminationProtectedException": + throw await de_EventDataStoreTerminationProtectedExceptionRes(parsedOutput, context); + case "ResourceARNNotValidException": + case "com.amazonaws.cloudtrail#ResourceARNNotValidException": + throw await de_ResourceARNNotValidExceptionRes(parsedOutput, context); + case "ResourcePolicyNotFoundException": + case "com.amazonaws.cloudtrail#ResourcePolicyNotFoundException": + throw await de_ResourcePolicyNotFoundExceptionRes(parsedOutput, context); + case "InvalidHomeRegionException": + case "com.amazonaws.cloudtrail#InvalidHomeRegionException": + throw await de_InvalidHomeRegionExceptionRes(parsedOutput, context); + case "TrailNotFoundException": + case "com.amazonaws.cloudtrail#TrailNotFoundException": + throw await de_TrailNotFoundExceptionRes(parsedOutput, context); + case "AccountNotFoundException": + case "com.amazonaws.cloudtrail#AccountNotFoundException": + throw await de_AccountNotFoundExceptionRes(parsedOutput, context); + case "AccountNotRegisteredException": + case "com.amazonaws.cloudtrail#AccountNotRegisteredException": + throw await de_AccountNotRegisteredExceptionRes(parsedOutput, context); + case "NotOrganizationManagementAccountException": + case "com.amazonaws.cloudtrail#NotOrganizationManagementAccountException": + throw await de_NotOrganizationManagementAccountExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.cloudtrail#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.cloudtrail#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "ImportNotFoundException": + case "com.amazonaws.cloudtrail#ImportNotFoundException": + throw await de_ImportNotFoundExceptionRes(parsedOutput, context); + case "InsightNotEnabledException": + case "com.amazonaws.cloudtrail#InsightNotEnabledException": + throw await de_InsightNotEnabledExceptionRes(parsedOutput, context); + case "InvalidMaxResultsException": + case "com.amazonaws.cloudtrail#InvalidMaxResultsException": + throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.cloudtrail#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "InvalidTimeRangeException": + case "com.amazonaws.cloudtrail#InvalidTimeRangeException": + throw await de_InvalidTimeRangeExceptionRes(parsedOutput, context); + case "InvalidTokenException": + case "com.amazonaws.cloudtrail#InvalidTokenException": + throw await de_InvalidTokenExceptionRes(parsedOutput, context); + case "InvalidDateRangeException": + case "com.amazonaws.cloudtrail#InvalidDateRangeException": + throw await de_InvalidDateRangeExceptionRes(parsedOutput, context); + case "InvalidQueryStatusException": + case "com.amazonaws.cloudtrail#InvalidQueryStatusException": + throw await de_InvalidQueryStatusExceptionRes(parsedOutput, context); + case "InvalidEventCategoryException": + case "com.amazonaws.cloudtrail#InvalidEventCategoryException": + throw await de_InvalidEventCategoryExceptionRes(parsedOutput, context); + case "InvalidLookupAttributesException": + case "com.amazonaws.cloudtrail#InvalidLookupAttributesException": + throw await de_InvalidLookupAttributesExceptionRes(parsedOutput, context); + case "InvalidInsightSelectorsException": + case "com.amazonaws.cloudtrail#InvalidInsightSelectorsException": + throw await de_InvalidInsightSelectorsExceptionRes(parsedOutput, context); + case "ResourcePolicyNotValidException": + case "com.amazonaws.cloudtrail#ResourcePolicyNotValidException": + throw await de_ResourcePolicyNotValidExceptionRes(parsedOutput, context); + case "AccountRegisteredException": + case "com.amazonaws.cloudtrail#AccountRegisteredException": + throw await de_AccountRegisteredExceptionRes(parsedOutput, context); + case "CannotDelegateManagementAccountException": + case "com.amazonaws.cloudtrail#CannotDelegateManagementAccountException": + throw await de_CannotDelegateManagementAccountExceptionRes(parsedOutput, context); + case "DelegatedAdminAccountLimitExceededException": + case "com.amazonaws.cloudtrail#DelegatedAdminAccountLimitExceededException": + throw await de_DelegatedAdminAccountLimitExceededExceptionRes(parsedOutput, context); + case "InvalidEventDataStoreStatusException": + case "com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException": + throw await de_InvalidEventDataStoreStatusExceptionRes(parsedOutput, context); + case "AccountHasOngoingImportException": + case "com.amazonaws.cloudtrail#AccountHasOngoingImportException": + throw await de_AccountHasOngoingImportExceptionRes(parsedOutput, context); + case "InvalidImportSourceException": + case "com.amazonaws.cloudtrail#InvalidImportSourceException": + throw await de_InvalidImportSourceExceptionRes(parsedOutput, context); + case "InvalidQueryStatementException": + case "com.amazonaws.cloudtrail#InvalidQueryStatementException": + throw await de_InvalidQueryStatementExceptionRes(parsedOutput, context); + case "MaxConcurrentQueriesException": + case "com.amazonaws.cloudtrail#MaxConcurrentQueriesException": + throw await de_MaxConcurrentQueriesExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts index 391987de6b7a..dd7842bb0f7d 100644 --- a/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudwatch-events/src/protocols/Aws_json1_1.ts @@ -922,7 +922,7 @@ export const de_ActivateEventSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ActivateEventSourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ActivateEventSourceCommandOutput = { @@ -931,44 +931,6 @@ export const de_ActivateEventSourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ActivateEventSourceCommandError - */ -const de_ActivateEventSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.cloudwatchevents#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.cloudwatchevents#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelReplayCommand */ @@ -977,7 +939,7 @@ export const de_CancelReplayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelReplayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -989,41 +951,6 @@ export const de_CancelReplayCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelReplayCommandError - */ -const de_CancelReplayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "IllegalStatusException": - case "com.amazonaws.cloudwatchevents#IllegalStatusException": - throw await de_IllegalStatusExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateApiDestinationCommand */ @@ -1032,7 +959,7 @@ export const de_CreateApiDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateApiDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1044,41 +971,6 @@ export const de_CreateApiDestinationCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateApiDestinationCommandError - */ -const de_CreateApiDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchevents#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.cloudwatchevents#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateArchiveCommand */ @@ -1087,7 +979,7 @@ export const de_CreateArchiveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateArchiveCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1099,47 +991,6 @@ export const de_CreateArchiveCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateArchiveCommandError - */ -const de_CreateArchiveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidEventPatternException": - case "com.amazonaws.cloudwatchevents#InvalidEventPatternException": - throw await de_InvalidEventPatternExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchevents#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.cloudwatchevents#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateConnectionCommand */ @@ -1148,7 +999,7 @@ export const de_CreateConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1160,38 +1011,6 @@ export const de_CreateConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateConnectionCommandError - */ -const de_CreateConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchevents#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.cloudwatchevents#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateEventBusCommand */ @@ -1200,7 +1019,7 @@ export const de_CreateEventBusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEventBusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1212,50 +1031,6 @@ export const de_CreateEventBusCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateEventBusCommandError - */ -const de_CreateEventBusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.cloudwatchevents#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchevents#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.cloudwatchevents#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.cloudwatchevents#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePartnerEventSourceCommand */ @@ -1264,7 +1039,7 @@ export const de_CreatePartnerEventSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePartnerEventSourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1275,166 +1050,38 @@ export const de_CreatePartnerEventSourceCommand = async ( }; return response; }; - -/** - * deserializeAws_json1_1CreatePartnerEventSourceCommandError - */ -const de_CreatePartnerEventSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchevents#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.cloudwatchevents#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.cloudwatchevents#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeactivateEventSourceCommand - */ -export const de_DeactivateEventSourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeactivateEventSourceCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeactivateEventSourceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeactivateEventSourceCommandError - */ -const de_DeactivateEventSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.cloudwatchevents#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.cloudwatchevents#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeauthorizeConnectionCommand - */ -export const de_DeauthorizeConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeauthorizeConnectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeauthorizeConnectionResponse(data, context); - const response: DeauthorizeConnectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeauthorizeConnectionCommandError - */ -const de_DeauthorizeConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + +/** + * deserializeAws_json1_1DeactivateEventSourceCommand + */ +export const de_DeactivateEventSourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeactivateEventSourceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteApiDestinationCommand + * deserializeAws_json1_1DeauthorizeConnectionCommand */ -export const de_DeleteApiDestinationCommand = async ( +export const de_DeauthorizeConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteApiDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteApiDestinationCommandOutput = { + contents = de_DeauthorizeConnectionResponse(data, context); + const response: DeauthorizeConnectionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1442,35 +1089,23 @@ export const de_DeleteApiDestinationCommand = async ( }; /** - * deserializeAws_json1_1DeleteApiDestinationCommandError + * deserializeAws_json1_1DeleteApiDestinationCommand */ -const de_DeleteApiDestinationCommandError = async ( +export const de_DeleteApiDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteApiDestinationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1481,7 +1116,7 @@ export const de_DeleteArchiveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteArchiveCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1493,38 +1128,6 @@ export const de_DeleteArchiveCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteArchiveCommandError - */ -const de_DeleteArchiveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteConnectionCommand */ @@ -1533,7 +1136,7 @@ export const de_DeleteConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1545,38 +1148,6 @@ export const de_DeleteConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteConnectionCommandError - */ -const de_DeleteConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteEventBusCommand */ @@ -1585,7 +1156,7 @@ export const de_DeleteEventBusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEventBusCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteEventBusCommandOutput = { @@ -1594,35 +1165,6 @@ export const de_DeleteEventBusCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteEventBusCommandError - */ -const de_DeleteEventBusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeletePartnerEventSourceCommand */ @@ -1631,7 +1173,7 @@ export const de_DeletePartnerEventSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePartnerEventSourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeletePartnerEventSourceCommandOutput = { @@ -1640,38 +1182,6 @@ export const de_DeletePartnerEventSourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeletePartnerEventSourceCommandError - */ -const de_DeletePartnerEventSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.cloudwatchevents#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteRuleCommand */ @@ -1680,7 +1190,7 @@ export const de_DeleteRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRuleCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteRuleCommandOutput = { @@ -1689,41 +1199,6 @@ export const de_DeleteRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteRuleCommandError - */ -const de_DeleteRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.cloudwatchevents#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeApiDestinationCommand */ @@ -1732,7 +1207,7 @@ export const de_DescribeApiDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeApiDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1744,35 +1219,6 @@ export const de_DescribeApiDestinationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeApiDestinationCommandError - */ -const de_DescribeApiDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeArchiveCommand */ @@ -1781,7 +1227,7 @@ export const de_DescribeArchiveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeArchiveCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1793,38 +1239,6 @@ export const de_DescribeArchiveCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeArchiveCommandError - */ -const de_DescribeArchiveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.cloudwatchevents#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeConnectionCommand */ @@ -1833,7 +1247,7 @@ export const de_DescribeConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1845,35 +1259,6 @@ export const de_DescribeConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeConnectionCommandError - */ -const de_DescribeConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEventBusCommand */ @@ -1882,7 +1267,7 @@ export const de_DescribeEventBusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventBusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1894,35 +1279,6 @@ export const de_DescribeEventBusCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEventBusCommandError - */ -const de_DescribeEventBusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEventSourceCommand */ @@ -1931,7 +1287,7 @@ export const de_DescribeEventSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventSourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1943,38 +1299,6 @@ export const de_DescribeEventSourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEventSourceCommandError - */ -const de_DescribeEventSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.cloudwatchevents#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribePartnerEventSourceCommand */ @@ -1983,7 +1307,7 @@ export const de_DescribePartnerEventSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePartnerEventSourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1995,38 +1319,6 @@ export const de_DescribePartnerEventSourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribePartnerEventSourceCommandError - */ -const de_DescribePartnerEventSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.cloudwatchevents#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeReplayCommand */ @@ -2035,7 +1327,7 @@ export const de_DescribeReplayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeReplayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2047,35 +1339,6 @@ export const de_DescribeReplayCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeReplayCommandError - */ -const de_DescribeReplayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeRuleCommand */ @@ -2084,7 +1347,7 @@ export const de_DescribeRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2096,35 +1359,6 @@ export const de_DescribeRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeRuleCommandError - */ -const de_DescribeRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisableRuleCommand */ @@ -2133,7 +1367,7 @@ export const de_DisableRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableRuleCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DisableRuleCommandOutput = { @@ -2142,41 +1376,6 @@ export const de_DisableRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisableRuleCommandError - */ -const de_DisableRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.cloudwatchevents#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1EnableRuleCommand */ @@ -2185,7 +1384,7 @@ export const de_EnableRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableRuleCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: EnableRuleCommandOutput = { @@ -2194,41 +1393,6 @@ export const de_EnableRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1EnableRuleCommandError - */ -const de_EnableRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.cloudwatchevents#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListApiDestinationsCommand */ @@ -2237,42 +1401,16 @@ export const de_ListApiDestinationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListApiDestinationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListApiDestinationsResponse(data, context); - const response: ListApiDestinationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListApiDestinationsCommandError - */ -const de_ListApiDestinationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + let contents: any = {}; + contents = de_ListApiDestinationsResponse(data, context); + const response: ListApiDestinationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2283,7 +1421,7 @@ export const de_ListArchivesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListArchivesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2295,35 +1433,6 @@ export const de_ListArchivesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListArchivesCommandError - */ -const de_ListArchivesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListConnectionsCommand */ @@ -2332,7 +1441,7 @@ export const de_ListConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2344,32 +1453,6 @@ export const de_ListConnectionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListConnectionsCommandError - */ -const de_ListConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListEventBusesCommand */ @@ -2378,7 +1461,7 @@ export const de_ListEventBusesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListEventBusesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2390,32 +1473,6 @@ export const de_ListEventBusesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListEventBusesCommandError - */ -const de_ListEventBusesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListEventSourcesCommand */ @@ -2424,7 +1481,7 @@ export const de_ListEventSourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListEventSourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2436,35 +1493,6 @@ export const de_ListEventSourcesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListEventSourcesCommandError - */ -const de_ListEventSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.cloudwatchevents#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPartnerEventSourceAccountsCommand */ @@ -2473,7 +1501,7 @@ export const de_ListPartnerEventSourceAccountsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPartnerEventSourceAccountsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2485,38 +1513,6 @@ export const de_ListPartnerEventSourceAccountsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPartnerEventSourceAccountsCommandError - */ -const de_ListPartnerEventSourceAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.cloudwatchevents#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPartnerEventSourcesCommand */ @@ -2525,7 +1521,7 @@ export const de_ListPartnerEventSourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPartnerEventSourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2537,35 +1533,6 @@ export const de_ListPartnerEventSourcesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPartnerEventSourcesCommandError - */ -const de_ListPartnerEventSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.cloudwatchevents#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListReplaysCommand */ @@ -2574,7 +1541,7 @@ export const de_ListReplaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListReplaysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2586,32 +1553,6 @@ export const de_ListReplaysCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListReplaysCommandError - */ -const de_ListReplaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListRuleNamesByTargetCommand */ @@ -2620,7 +1561,7 @@ export const de_ListRuleNamesByTargetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRuleNamesByTargetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2628,102 +1569,24 @@ export const de_ListRuleNamesByTargetCommand = async ( const response: ListRuleNamesByTargetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRuleNamesByTargetCommandError - */ -const de_ListRuleNamesByTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRulesCommand - */ -export const de_ListRulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRulesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListRulesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRulesCommandError - */ -const de_ListRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1ListRulesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + const response: ListRulesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2731,32 +1594,23 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2767,7 +1621,7 @@ export const de_ListTargetsByRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTargetsByRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2779,35 +1633,6 @@ export const de_ListTargetsByRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTargetsByRuleCommandError - */ -const de_ListTargetsByRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutEventsCommand */ @@ -2816,7 +1641,7 @@ export const de_PutEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2828,32 +1653,6 @@ export const de_PutEventsCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutEventsCommandError - */ -const de_PutEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutPartnerEventsCommand */ @@ -2862,7 +1661,7 @@ export const de_PutPartnerEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutPartnerEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2874,35 +1673,6 @@ export const de_PutPartnerEventsCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutPartnerEventsCommandError - */ -const de_PutPartnerEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.cloudwatchevents#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutPermissionCommand */ @@ -2911,7 +1681,7 @@ export const de_PutPermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutPermissionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutPermissionCommandOutput = { @@ -2920,44 +1690,6 @@ export const de_PutPermissionCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutPermissionCommandError - */ -const de_PutPermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.cloudwatchevents#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "PolicyLengthExceededException": - case "com.amazonaws.cloudwatchevents#PolicyLengthExceededException": - throw await de_PolicyLengthExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutRuleCommand */ @@ -2966,7 +1698,7 @@ export const de_PutRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2978,47 +1710,6 @@ export const de_PutRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutRuleCommandError - */ -const de_PutRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidEventPatternException": - case "com.amazonaws.cloudwatchevents#InvalidEventPatternException": - throw await de_InvalidEventPatternExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchevents#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.cloudwatchevents#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutTargetsCommand */ @@ -3027,7 +1718,7 @@ export const de_PutTargetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutTargetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3039,44 +1730,6 @@ export const de_PutTargetsCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutTargetsCommandError - */ -const de_PutTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchevents#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.cloudwatchevents#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RemovePermissionCommand */ @@ -3085,48 +1738,13 @@ export const de_RemovePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemovePermissionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RemovePermissionCommandOutput = { $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1RemovePermissionCommandError - */ -const de_RemovePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.cloudwatchevents#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }; + return response; }; /** @@ -3137,7 +1755,7 @@ export const de_RemoveTargetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveTargetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3149,41 +1767,6 @@ export const de_RemoveTargetsCommand = async ( return response; }; -/** - * deserializeAws_json1_1RemoveTargetsCommandError - */ -const de_RemoveTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.cloudwatchevents#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartReplayCommand */ @@ -3192,7 +1775,7 @@ export const de_StartReplayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartReplayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3204,44 +1787,6 @@ export const de_StartReplayCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartReplayCommandError - */ -const de_StartReplayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidEventPatternException": - case "com.amazonaws.cloudwatchevents#InvalidEventPatternException": - throw await de_InvalidEventPatternExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchevents#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.cloudwatchevents#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -3250,7 +1795,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3262,41 +1807,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.cloudwatchevents#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TestEventPatternCommand */ @@ -3305,7 +1815,7 @@ export const de_TestEventPatternCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TestEventPatternCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3317,35 +1827,6 @@ export const de_TestEventPatternCommand = async ( return response; }; -/** - * deserializeAws_json1_1TestEventPatternCommandError - */ -const de_TestEventPatternCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidEventPatternException": - case "com.amazonaws.cloudwatchevents#InvalidEventPatternException": - throw await de_InvalidEventPatternExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -3354,7 +1835,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3366,41 +1847,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.cloudwatchevents#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateApiDestinationCommand */ @@ -3409,7 +1855,7 @@ export const de_UpdateApiDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateApiDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3421,41 +1867,6 @@ export const de_UpdateApiDestinationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateApiDestinationCommandError - */ -const de_UpdateApiDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchevents#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateArchiveCommand */ @@ -3464,7 +1875,7 @@ export const de_UpdateArchiveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateArchiveCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3476,44 +1887,6 @@ export const de_UpdateArchiveCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateArchiveCommandError - */ -const de_UpdateArchiveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatchevents#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.cloudwatchevents#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidEventPatternException": - case "com.amazonaws.cloudwatchevents#InvalidEventPatternException": - throw await de_InvalidEventPatternExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchevents#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateConnectionCommand */ @@ -3522,7 +1895,7 @@ export const de_UpdateConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3535,12 +1908,9 @@ export const de_UpdateConnectionCommand = async ( }; /** - * deserializeAws_json1_1UpdateConnectionCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3553,19 +1923,40 @@ const de_UpdateConnectionCommandError = async ( case "InternalException": case "com.amazonaws.cloudwatchevents#InternalException": throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchevents#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "InvalidStateException": + case "com.amazonaws.cloudwatchevents#InvalidStateException": + throw await de_InvalidStateExceptionRes(parsedOutput, context); + case "OperationDisabledException": + case "com.amazonaws.cloudwatchevents#OperationDisabledException": + throw await de_OperationDisabledExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.cloudwatchevents#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "IllegalStatusException": + case "com.amazonaws.cloudwatchevents#IllegalStatusException": + throw await de_IllegalStatusExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.cloudwatchevents#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.cloudwatchevents#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidEventPatternException": + case "com.amazonaws.cloudwatchevents#InvalidEventPatternException": + throw await de_InvalidEventPatternExceptionRes(parsedOutput, context); + case "ManagedRuleException": + case "com.amazonaws.cloudwatchevents#ManagedRuleException": + throw await de_ManagedRuleExceptionRes(parsedOutput, context); + case "PolicyLengthExceededException": + case "com.amazonaws.cloudwatchevents#PolicyLengthExceededException": + throw await de_PolicyLengthExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts index bd901969590a..d49685b78599 100644 --- a/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts +++ b/clients/client-cloudwatch-logs/src/protocols/Aws_json1_1.ts @@ -1279,7 +1279,7 @@ export const de_AssociateKmsKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateKmsKeyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AssociateKmsKeyCommandOutput = { @@ -1288,41 +1288,6 @@ export const de_AssociateKmsKeyCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateKmsKeyCommandError - */ -const de_AssociateKmsKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelExportTaskCommand */ @@ -1331,7 +1296,7 @@ export const de_CancelExportTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelExportTaskCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CancelExportTaskCommandOutput = { @@ -1340,41 +1305,6 @@ export const de_CancelExportTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelExportTaskCommandError - */ -const de_CancelExportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidOperationException": - case "com.amazonaws.cloudwatchlogs#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDeliveryCommand */ @@ -1383,7 +1313,7 @@ export const de_CreateDeliveryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDeliveryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1395,50 +1325,6 @@ export const de_CreateDeliveryCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDeliveryCommandError - */ -const de_CreateDeliveryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cloudwatchlogs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.cloudwatchlogs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cloudwatchlogs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudwatchlogs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudwatchlogs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateExportTaskCommand */ @@ -1447,7 +1333,7 @@ export const de_CreateExportTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateExportTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1459,47 +1345,6 @@ export const de_CreateExportTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateExportTaskCommandError - */ -const de_CreateExportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchlogs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.cloudwatchlogs#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLogAnomalyDetectorCommand */ @@ -1508,7 +1353,7 @@ export const de_CreateLogAnomalyDetectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLogAnomalyDetectorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1520,44 +1365,6 @@ export const de_CreateLogAnomalyDetectorCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateLogAnomalyDetectorCommandError - */ -const de_CreateLogAnomalyDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchlogs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLogGroupCommand */ @@ -1566,7 +1373,7 @@ export const de_CreateLogGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLogGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateLogGroupCommandOutput = { @@ -1575,44 +1382,6 @@ export const de_CreateLogGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateLogGroupCommandError - */ -const de_CreateLogGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchlogs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.cloudwatchlogs#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLogStreamCommand */ @@ -1621,7 +1390,7 @@ export const de_CreateLogStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLogStreamCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateLogStreamCommandOutput = { @@ -1631,2069 +1400,277 @@ export const de_CreateLogStreamCommand = async ( }; /** - * deserializeAws_json1_1CreateLogStreamCommandError + * deserializeAws_json1_1DeleteAccountPolicyCommand */ -const de_CreateLogStreamCommandError = async ( +export const de_DeleteAccountPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.cloudwatchlogs#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteAccountPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteAccountPolicyCommand + * deserializeAws_json1_1DeleteDataProtectionPolicyCommand */ -export const de_DeleteAccountPolicyCommand = async ( +export const de_DeleteDataProtectionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteAccountPolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteAccountPolicyCommandOutput = { + const response: DeleteDataProtectionPolicyCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteAccountPolicyCommandError + * deserializeAws_json1_1DeleteDeliveryCommand */ -const de_DeleteAccountPolicyCommandError = async ( +export const de_DeleteDeliveryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteDeliveryCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteDataProtectionPolicyCommand + * deserializeAws_json1_1DeleteDeliveryDestinationCommand */ -export const de_DeleteDataProtectionPolicyCommand = async ( +export const de_DeleteDeliveryDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDataProtectionPolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteDataProtectionPolicyCommandOutput = { + const response: DeleteDeliveryDestinationCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteDataProtectionPolicyCommandError + * deserializeAws_json1_1DeleteDeliveryDestinationPolicyCommand */ -const de_DeleteDataProtectionPolicyCommandError = async ( +export const de_DeleteDeliveryDestinationPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteDeliveryDestinationPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteDeliveryCommand + * deserializeAws_json1_1DeleteDeliverySourceCommand */ -export const de_DeleteDeliveryCommand = async ( +export const de_DeleteDeliverySourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDeliveryCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteDeliveryCommandOutput = { + const response: DeleteDeliverySourceCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteDeliveryCommandError + * deserializeAws_json1_1DeleteDestinationCommand */ -const de_DeleteDeliveryCommandError = async ( +export const de_DeleteDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.cloudwatchlogs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cloudwatchlogs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudwatchlogs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudwatchlogs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteDestinationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteDeliveryDestinationCommand + * deserializeAws_json1_1DeleteLogAnomalyDetectorCommand */ -export const de_DeleteDeliveryDestinationCommand = async ( +export const de_DeleteLogAnomalyDetectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDeliveryDestinationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteDeliveryDestinationCommandOutput = { + const response: DeleteLogAnomalyDetectorCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteDeliveryDestinationCommandError + * deserializeAws_json1_1DeleteLogGroupCommand */ -const de_DeleteDeliveryDestinationCommandError = async ( +export const de_DeleteLogGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.cloudwatchlogs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cloudwatchlogs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudwatchlogs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudwatchlogs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteLogGroupCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteDeliveryDestinationPolicyCommand + * deserializeAws_json1_1DeleteLogStreamCommand */ -export const de_DeleteDeliveryDestinationPolicyCommand = async ( +export const de_DeleteLogStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDeliveryDestinationPolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteDeliveryDestinationPolicyCommandOutput = { + const response: DeleteLogStreamCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteDeliveryDestinationPolicyCommandError + * deserializeAws_json1_1DeleteMetricFilterCommand */ -const de_DeleteDeliveryDestinationPolicyCommandError = async ( +export const de_DeleteMetricFilterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeleteMetricFilterCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.cloudwatchlogs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudwatchlogs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DeleteQueryDefinitionCommand + */ +export const de_DeleteQueryDefinitionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteQueryDefinitionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteDeliverySourceCommand + * deserializeAws_json1_1DeleteResourcePolicyCommand */ -export const de_DeleteDeliverySourceCommand = async ( +export const de_DeleteResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDeliverySourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteDeliverySourceCommandOutput = { + const response: DeleteResourcePolicyCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteDeliverySourceCommandError + * deserializeAws_json1_1DeleteRetentionPolicyCommand */ -const de_DeleteDeliverySourceCommandError = async ( +export const de_DeleteRetentionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeleteRetentionPolicyCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.cloudwatchlogs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cloudwatchlogs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudwatchlogs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudwatchlogs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDestinationCommand - */ -export const de_DeleteDestinationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDestinationCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteDestinationCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDestinationCommandError - */ -const de_DeleteDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteLogAnomalyDetectorCommand - */ -export const de_DeleteLogAnomalyDetectorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteLogAnomalyDetectorCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteLogAnomalyDetectorCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteLogAnomalyDetectorCommandError - */ -const de_DeleteLogAnomalyDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteLogGroupCommand - */ -export const de_DeleteLogGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteLogGroupCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteLogGroupCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteLogGroupCommandError - */ -const de_DeleteLogGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteLogStreamCommand - */ -export const de_DeleteLogStreamCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteLogStreamCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteLogStreamCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteLogStreamCommandError - */ -const de_DeleteLogStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteMetricFilterCommand - */ -export const de_DeleteMetricFilterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteMetricFilterCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteMetricFilterCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteMetricFilterCommandError - */ -const de_DeleteMetricFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteQueryDefinitionCommand - */ -export const de_DeleteQueryDefinitionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteQueryDefinitionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteQueryDefinitionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteQueryDefinitionCommandError - */ -const de_DeleteQueryDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteResourcePolicyCommand - */ -export const de_DeleteResourcePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteResourcePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteRetentionPolicyCommand - */ -export const de_DeleteRetentionPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteRetentionPolicyCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteRetentionPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteRetentionPolicyCommandError - */ -const de_DeleteRetentionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteSubscriptionFilterCommand - */ -export const de_DeleteSubscriptionFilterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteSubscriptionFilterCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteSubscriptionFilterCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteSubscriptionFilterCommandError - */ -const de_DeleteSubscriptionFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAccountPoliciesCommand - */ -export const de_DescribeAccountPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAccountPoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeAccountPoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAccountPoliciesCommandError - */ -const de_DescribeAccountPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDeliveriesCommand - */ -export const de_DescribeDeliveriesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDeliveriesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeDeliveriesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeDeliveriesCommandError - */ -const de_DescribeDeliveriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceQuotaExceededException": - case "com.amazonaws.cloudwatchlogs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudwatchlogs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudwatchlogs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDeliveryDestinationsCommand - */ -export const de_DescribeDeliveryDestinationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDeliveryDestinationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeDeliveryDestinationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeDeliveryDestinationsCommandError - */ -const de_DescribeDeliveryDestinationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceQuotaExceededException": - case "com.amazonaws.cloudwatchlogs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudwatchlogs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudwatchlogs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDeliverySourcesCommand - */ -export const de_DescribeDeliverySourcesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDeliverySourcesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeDeliverySourcesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeDeliverySourcesCommandError - */ -const de_DescribeDeliverySourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceQuotaExceededException": - case "com.amazonaws.cloudwatchlogs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudwatchlogs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudwatchlogs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDestinationsCommand - */ -export const de_DescribeDestinationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDestinationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeDestinationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeDestinationsCommandError - */ -const de_DescribeDestinationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeExportTasksCommand - */ -export const de_DescribeExportTasksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeExportTasksCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeExportTasksCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeExportTasksCommandError - */ -const de_DescribeExportTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeLogGroupsCommand - */ -export const de_DescribeLogGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeLogGroupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeLogGroupsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeLogGroupsCommandError - */ -const de_DescribeLogGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeLogStreamsCommand - */ -export const de_DescribeLogStreamsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeLogStreamsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeLogStreamsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeLogStreamsCommandError - */ -const de_DescribeLogStreamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeMetricFiltersCommand - */ -export const de_DescribeMetricFiltersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeMetricFiltersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeMetricFiltersResponse(data, context); - const response: DescribeMetricFiltersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeMetricFiltersCommandError - */ -const de_DescribeMetricFiltersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeQueriesCommand - */ -export const de_DescribeQueriesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeQueriesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeQueriesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeQueriesCommandError - */ -const de_DescribeQueriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeQueryDefinitionsCommand - */ -export const de_DescribeQueryDefinitionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeQueryDefinitionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeQueryDefinitionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeQueryDefinitionsCommandError - */ -const de_DescribeQueryDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeResourcePoliciesCommand - */ -export const de_DescribeResourcePoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeResourcePoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeResourcePoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeResourcePoliciesCommandError - */ -const de_DescribeResourcePoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeSubscriptionFiltersCommand - */ -export const de_DescribeSubscriptionFiltersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeSubscriptionFiltersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeSubscriptionFiltersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeSubscriptionFiltersCommandError - */ -const de_DescribeSubscriptionFiltersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociateKmsKeyCommand - */ -export const de_DisassociateKmsKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisassociateKmsKeyCommandError(output, context); - } - await collectBody(output.body, context); - const response: DisassociateKmsKeyCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DisassociateKmsKeyCommandError - */ -const de_DisassociateKmsKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1FilterLogEventsCommand - */ -export const de_FilterLogEventsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_FilterLogEventsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: FilterLogEventsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1FilterLogEventsCommandError - */ -const de_FilterLogEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDataProtectionPolicyCommand - */ -export const de_GetDataProtectionPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDataProtectionPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetDataProtectionPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDataProtectionPolicyCommandError - */ -const de_GetDataProtectionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDeliveryCommand - */ -export const de_GetDeliveryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDeliveryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetDeliveryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDeliveryCommandError - */ -const de_GetDeliveryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cloudwatchlogs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudwatchlogs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudwatchlogs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDeliveryDestinationCommand - */ -export const de_GetDeliveryDestinationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDeliveryDestinationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetDeliveryDestinationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDeliveryDestinationCommandError - */ -const de_GetDeliveryDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cloudwatchlogs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudwatchlogs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudwatchlogs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDeliveryDestinationPolicyCommand - */ -export const de_GetDeliveryDestinationPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDeliveryDestinationPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetDeliveryDestinationPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDeliveryDestinationPolicyCommandError - */ -const de_GetDeliveryDestinationPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudwatchlogs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDeliverySourceCommand - */ -export const de_GetDeliverySourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDeliverySourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetDeliverySourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDeliverySourceCommandError - */ -const de_GetDeliverySourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cloudwatchlogs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudwatchlogs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudwatchlogs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLogAnomalyDetectorCommand - */ -export const de_GetLogAnomalyDetectorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLogAnomalyDetectorCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetLogAnomalyDetectorCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetLogAnomalyDetectorCommandError - */ -const de_GetLogAnomalyDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLogEventsCommand - */ -export const de_GetLogEventsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLogEventsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetLogEventsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetLogEventsCommandError - */ -const de_GetLogEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLogGroupFieldsCommand - */ -export const de_GetLogGroupFieldsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLogGroupFieldsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetLogGroupFieldsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetLogGroupFieldsCommandError - */ -const de_GetLogGroupFieldsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchlogs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DeleteSubscriptionFilterCommand + */ +export const de_DeleteSubscriptionFilterCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteSubscriptionFilterCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1GetLogRecordCommand + * deserializeAws_json1_1DescribeAccountPoliciesCommand */ -export const de_GetLogRecordCommand = async ( +export const de_DescribeAccountPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetLogRecordCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetLogRecordCommandOutput = { + const response: DescribeAccountPoliciesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3701,54 +1678,39 @@ export const de_GetLogRecordCommand = async ( }; /** - * deserializeAws_json1_1GetLogRecordCommandError + * deserializeAws_json1_1DescribeDeliveriesCommand */ -const de_GetLogRecordCommandError = async ( +export const de_DescribeDeliveriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchlogs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeDeliveriesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetQueryResultsCommand + * deserializeAws_json1_1DescribeDeliveryDestinationsCommand */ -export const de_GetQueryResultsCommand = async ( +export const de_DescribeDeliveryDestinationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetQueryResultsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetQueryResultsResponse(data, context); - const response: GetQueryResultsCommandOutput = { + contents = _json(data); + const response: DescribeDeliveryDestinationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3756,51 +1718,39 @@ export const de_GetQueryResultsCommand = async ( }; /** - * deserializeAws_json1_1GetQueryResultsCommandError + * deserializeAws_json1_1DescribeDeliverySourcesCommand */ -const de_GetQueryResultsCommandError = async ( +export const de_DescribeDeliverySourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeDeliverySourcesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListAnomaliesCommand + * deserializeAws_json1_1DescribeDestinationsCommand */ -export const de_ListAnomaliesCommand = async ( +export const de_DescribeDestinationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAnomaliesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListAnomaliesCommandOutput = { + const response: DescribeDestinationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3808,54 +1758,39 @@ export const de_ListAnomaliesCommand = async ( }; /** - * deserializeAws_json1_1ListAnomaliesCommandError + * deserializeAws_json1_1DescribeExportTasksCommand */ -const de_ListAnomaliesCommandError = async ( +export const de_DescribeExportTasksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeExportTasksCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListLogAnomalyDetectorsCommand + * deserializeAws_json1_1DescribeLogGroupsCommand */ -export const de_ListLogAnomalyDetectorsCommand = async ( +export const de_DescribeLogGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListLogAnomalyDetectorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListLogAnomalyDetectorsCommandOutput = { + const response: DescribeLogGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3863,54 +1798,39 @@ export const de_ListLogAnomalyDetectorsCommand = async ( }; /** - * deserializeAws_json1_1ListLogAnomalyDetectorsCommandError + * deserializeAws_json1_1DescribeLogStreamsCommand */ -const de_ListLogAnomalyDetectorsCommandError = async ( +export const de_DescribeLogStreamsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeLogStreamsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1DescribeMetricFiltersCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_DescribeMetricFiltersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_DescribeMetricFiltersResponse(data, context); + const response: DescribeMetricFiltersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3918,51 +1838,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1DescribeQueriesCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_DescribeQueriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeQueriesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsLogGroupCommand + * deserializeAws_json1_1DescribeQueryDefinitionsCommand */ -export const de_ListTagsLogGroupCommand = async ( +export const de_DescribeQueryDefinitionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsLogGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTagsLogGroupCommandOutput = { + const response: DescribeQueryDefinitionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3970,48 +1878,39 @@ export const de_ListTagsLogGroupCommand = async ( }; /** - * deserializeAws_json1_1ListTagsLogGroupCommandError + * deserializeAws_json1_1DescribeResourcePoliciesCommand */ -const de_ListTagsLogGroupCommandError = async ( +export const de_DescribeResourcePoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeResourcePoliciesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutAccountPolicyCommand + * deserializeAws_json1_1DescribeSubscriptionFiltersCommand */ -export const de_PutAccountPolicyCommand = async ( +export const de_DescribeSubscriptionFiltersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutAccountPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutAccountPolicyCommandOutput = { + const response: DescribeSubscriptionFiltersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4019,54 +1918,36 @@ export const de_PutAccountPolicyCommand = async ( }; /** - * deserializeAws_json1_1PutAccountPolicyCommandError + * deserializeAws_json1_1DisassociateKmsKeyCommand */ -const de_PutAccountPolicyCommandError = async ( +export const de_DisassociateKmsKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchlogs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DisassociateKmsKeyCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1PutDataProtectionPolicyCommand + * deserializeAws_json1_1FilterLogEventsCommand */ -export const de_PutDataProtectionPolicyCommand = async ( +export const de_FilterLogEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutDataProtectionPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutDataProtectionPolicyCommandOutput = { + const response: FilterLogEventsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4074,57 +1955,19 @@ export const de_PutDataProtectionPolicyCommand = async ( }; /** - * deserializeAws_json1_1PutDataProtectionPolicyCommandError - */ -const de_PutDataProtectionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchlogs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutDeliveryDestinationCommand + * deserializeAws_json1_1GetDataProtectionPolicyCommand */ -export const de_PutDeliveryDestinationCommand = async ( +export const de_GetDataProtectionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutDeliveryDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutDeliveryDestinationCommandOutput = { + const response: GetDataProtectionPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4132,60 +1975,39 @@ export const de_PutDeliveryDestinationCommand = async ( }; /** - * deserializeAws_json1_1PutDeliveryDestinationCommandError + * deserializeAws_json1_1GetDeliveryCommand */ -const de_PutDeliveryDestinationCommandError = async ( +export const de_GetDeliveryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.cloudwatchlogs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cloudwatchlogs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudwatchlogs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudwatchlogs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetDeliveryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutDeliveryDestinationPolicyCommand + * deserializeAws_json1_1GetDeliveryDestinationCommand */ -export const de_PutDeliveryDestinationPolicyCommand = async ( +export const de_GetDeliveryDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutDeliveryDestinationPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutDeliveryDestinationPolicyCommandOutput = { + const response: GetDeliveryDestinationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4193,54 +2015,39 @@ export const de_PutDeliveryDestinationPolicyCommand = async ( }; /** - * deserializeAws_json1_1PutDeliveryDestinationPolicyCommandError + * deserializeAws_json1_1GetDeliveryDestinationPolicyCommand */ -const de_PutDeliveryDestinationPolicyCommandError = async ( +export const de_GetDeliveryDestinationPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.cloudwatchlogs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudwatchlogs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetDeliveryDestinationPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutDeliverySourceCommand + * deserializeAws_json1_1GetDeliverySourceCommand */ -export const de_PutDeliverySourceCommand = async ( +export const de_GetDeliverySourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutDeliverySourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutDeliverySourceCommandOutput = { + const response: GetDeliverySourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4248,60 +2055,39 @@ export const de_PutDeliverySourceCommand = async ( }; /** - * deserializeAws_json1_1PutDeliverySourceCommandError + * deserializeAws_json1_1GetLogAnomalyDetectorCommand */ -const de_PutDeliverySourceCommandError = async ( +export const de_GetLogAnomalyDetectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.cloudwatchlogs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.cloudwatchlogs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.cloudwatchlogs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.cloudwatchlogs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetLogAnomalyDetectorCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutDestinationCommand + * deserializeAws_json1_1GetLogEventsCommand */ -export const de_PutDestinationCommand = async ( +export const de_GetLogEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutDestinationCommandOutput = { + const response: GetLogEventsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4309,100 +2095,79 @@ export const de_PutDestinationCommand = async ( }; /** - * deserializeAws_json1_1PutDestinationCommandError + * deserializeAws_json1_1GetLogGroupFieldsCommand */ -const de_PutDestinationCommandError = async ( +export const de_GetLogGroupFieldsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetLogGroupFieldsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutDestinationPolicyCommand + * deserializeAws_json1_1GetLogRecordCommand */ -export const de_PutDestinationPolicyCommand = async ( +export const de_GetLogRecordCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutDestinationPolicyCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: PutDestinationPolicyCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetLogRecordCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1PutDestinationPolicyCommandError + * deserializeAws_json1_1GetQueryResultsCommand */ -const de_PutDestinationPolicyCommandError = async ( +export const de_GetQueryResultsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetQueryResultsResponse(data, context); + const response: GetQueryResultsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutLogEventsCommand + * deserializeAws_json1_1ListAnomaliesCommand */ -export const de_PutLogEventsCommand = async ( +export const de_ListAnomaliesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutLogEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutLogEventsCommandOutput = { + const response: ListAnomaliesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4410,115 +2175,79 @@ export const de_PutLogEventsCommand = async ( }; /** - * deserializeAws_json1_1PutLogEventsCommandError + * deserializeAws_json1_1ListLogAnomalyDetectorsCommand */ -const de_PutLogEventsCommandError = async ( +export const de_ListLogAnomalyDetectorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DataAlreadyAcceptedException": - case "com.amazonaws.cloudwatchlogs#DataAlreadyAcceptedException": - throw await de_DataAlreadyAcceptedExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSequenceTokenException": - case "com.amazonaws.cloudwatchlogs#InvalidSequenceTokenException": - throw await de_InvalidSequenceTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnrecognizedClientException": - case "com.amazonaws.cloudwatchlogs#UnrecognizedClientException": - throw await de_UnrecognizedClientExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListLogAnomalyDetectorsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutMetricFilterCommand + * deserializeAws_json1_1ListTagsForResourceCommand */ -export const de_PutMetricFilterCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutMetricFilterCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: PutMetricFilterCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1PutMetricFilterCommandError + * deserializeAws_json1_1ListTagsLogGroupCommand */ -const de_PutMetricFilterCommandError = async ( +export const de_ListTagsLogGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchlogs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsLogGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutQueryDefinitionCommand + * deserializeAws_json1_1PutAccountPolicyCommand */ -export const de_PutQueryDefinitionCommand = async ( +export const de_PutAccountPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutQueryDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutQueryDefinitionCommandOutput = { + const response: PutAccountPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4526,54 +2255,59 @@ export const de_PutQueryDefinitionCommand = async ( }; /** - * deserializeAws_json1_1PutQueryDefinitionCommandError + * deserializeAws_json1_1PutDataProtectionPolicyCommand */ -const de_PutQueryDefinitionCommandError = async ( +export const de_PutDataProtectionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutDataProtectionPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchlogs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1PutDeliveryDestinationCommand + */ +export const de_PutDeliveryDestinationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutDeliveryDestinationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutResourcePolicyCommand + * deserializeAws_json1_1PutDeliveryDestinationPolicyCommand */ -export const de_PutResourcePolicyCommand = async ( +export const de_PutDeliveryDestinationPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutResourcePolicyCommandOutput = { + const response: PutDeliveryDestinationPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4581,156 +2315,133 @@ export const de_PutResourcePolicyCommand = async ( }; /** - * deserializeAws_json1_1PutResourcePolicyCommandError + * deserializeAws_json1_1PutDeliverySourceCommand */ -const de_PutResourcePolicyCommandError = async ( +export const de_PutDeliverySourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutDeliverySourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchlogs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1PutDestinationCommand + */ +export const de_PutDestinationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutDestinationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutRetentionPolicyCommand + * deserializeAws_json1_1PutDestinationPolicyCommand */ -export const de_PutRetentionPolicyCommand = async ( +export const de_PutDestinationPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutRetentionPolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: PutRetentionPolicyCommandOutput = { + const response: PutDestinationPolicyCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1PutRetentionPolicyCommandError + * deserializeAws_json1_1PutLogEventsCommand */ -const de_PutRetentionPolicyCommandError = async ( +export const de_PutLogEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutLogEventsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutSubscriptionFilterCommand + * deserializeAws_json1_1PutMetricFilterCommand */ -export const de_PutSubscriptionFilterCommand = async ( +export const de_PutMetricFilterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutSubscriptionFilterCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: PutSubscriptionFilterCommandOutput = { + const response: PutMetricFilterCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1PutSubscriptionFilterCommandError + * deserializeAws_json1_1PutQueryDefinitionCommand */ -const de_PutSubscriptionFilterCommandError = async ( +export const de_PutQueryDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchlogs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutQueryDefinitionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartLiveTailCommand + * deserializeAws_json1_1PutResourcePolicyCommand */ -export const de_StartLiveTailCommand = async ( +export const de_PutResourcePolicyCommand = async ( output: __HttpResponse, - context: __SerdeContext & __EventStreamSerdeContext -): Promise => { + context: __SerdeContext +): Promise => { if (output.statusCode >= 300) { - return de_StartLiveTailCommandError(output, context); + return de_CommandError(output, context); } - const contents = { responseStream: de_StartLiveTailResponseStream(output.body, context) }; - const response: StartLiveTailCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutResourcePolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4738,115 +2449,71 @@ export const de_StartLiveTailCommand = async ( }; /** - * deserializeAws_json1_1StartLiveTailCommandError + * deserializeAws_json1_1PutRetentionPolicyCommand */ -const de_StartLiveTailCommandError = async ( +export const de_PutRetentionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.cloudwatchlogs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.cloudwatchlogs#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchlogs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: PutRetentionPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1StartQueryCommand + * deserializeAws_json1_1PutSubscriptionFilterCommand */ -export const de_StartQueryCommand = async ( +export const de_PutSubscriptionFilterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartQueryCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartQueryCommandOutput = { + await collectBody(output.body, context); + const response: PutSubscriptionFilterCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1StartQueryCommandError + * deserializeAws_json1_1StartLiveTailCommand */ -const de_StartQueryCommandError = async ( +export const de_StartLiveTailCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatchlogs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedQueryException": - case "com.amazonaws.cloudwatchlogs#MalformedQueryException": - throw await de_MalformedQueryExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext & __EventStreamSerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents = { responseStream: de_StartLiveTailResponseStream(output.body, context) }; + const response: StartLiveTailCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopQueryCommand + * deserializeAws_json1_1StartQueryCommand */ -export const de_StopQueryCommand = async ( +export const de_StartQueryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopQueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopQueryCommandOutput = { + const response: StartQueryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4854,35 +2521,23 @@ export const de_StopQueryCommand = async ( }; /** - * deserializeAws_json1_1StopQueryCommandError + * deserializeAws_json1_1StopQueryCommand */ -const de_StopQueryCommandError = async ( +export const de_StopQueryCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StopQueryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -4893,7 +2548,7 @@ export const de_TagLogGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagLogGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: TagLogGroupCommandOutput = { @@ -4902,35 +2557,6 @@ export const de_TagLogGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagLogGroupCommandError - */ -const de_TagLogGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -4939,7 +2565,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: TagResourceCommandOutput = { @@ -4948,41 +2574,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.cloudwatchlogs#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TestMetricFilterCommand */ @@ -4991,7 +2582,7 @@ export const de_TestMetricFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TestMetricFilterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5003,35 +2594,6 @@ export const de_TestMetricFilterCommand = async ( return response; }; -/** - * deserializeAws_json1_1TestMetricFilterCommandError - */ -const de_TestMetricFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagLogGroupCommand */ @@ -5040,7 +2602,7 @@ export const de_UntagLogGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagLogGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UntagLogGroupCommandOutput = { @@ -5049,32 +2611,6 @@ export const de_UntagLogGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagLogGroupCommandError - */ -const de_UntagLogGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -5083,7 +2619,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UntagResourceCommandOutput = { @@ -5092,38 +2628,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateAnomalyCommand */ @@ -5132,7 +2636,7 @@ export const de_UpdateAnomalyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateAnomalyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateAnomalyCommandOutput = { @@ -5141,41 +2645,6 @@ export const de_UpdateAnomalyCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateAnomalyCommandError - */ -const de_UpdateAnomalyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.cloudwatchlogs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationAbortedException": - case "com.amazonaws.cloudwatchlogs#OperationAbortedException": - throw await de_OperationAbortedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatchlogs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateLogAnomalyDetectorCommand */ @@ -5184,7 +2653,7 @@ export const de_UpdateLogAnomalyDetectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLogAnomalyDetectorCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateLogAnomalyDetectorCommandOutput = { @@ -5194,12 +2663,9 @@ export const de_UpdateLogAnomalyDetectorCommand = async ( }; /** - * deserializeAws_json1_1UpdateLogAnomalyDetectorCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateLogAnomalyDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5218,13 +2684,52 @@ const de_UpdateLogAnomalyDetectorCommandError = async ( case "ServiceUnavailableException": case "com.amazonaws.cloudwatchlogs#ServiceUnavailableException": throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "InvalidOperationException": + case "com.amazonaws.cloudwatchlogs#InvalidOperationException": + throw await de_InvalidOperationExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.cloudwatchlogs#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.cloudwatchlogs#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.cloudwatchlogs#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.cloudwatchlogs#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.cloudwatchlogs#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.cloudwatchlogs#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.cloudwatchlogs#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "DataAlreadyAcceptedException": + case "com.amazonaws.cloudwatchlogs#DataAlreadyAcceptedException": + throw await de_DataAlreadyAcceptedExceptionRes(parsedOutput, context); + case "InvalidSequenceTokenException": + case "com.amazonaws.cloudwatchlogs#InvalidSequenceTokenException": + throw await de_InvalidSequenceTokenExceptionRes(parsedOutput, context); + case "UnrecognizedClientException": + case "com.amazonaws.cloudwatchlogs#UnrecognizedClientException": + throw await de_UnrecognizedClientExceptionRes(parsedOutput, context); + case "MalformedQueryException": + case "com.amazonaws.cloudwatchlogs#MalformedQueryException": + throw await de_MalformedQueryExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.cloudwatchlogs#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cloudwatch/src/protocols/Aws_query.ts b/clients/client-cloudwatch/src/protocols/Aws_query.ts index 822bb2105ea7..f0c2d85281c3 100644 --- a/clients/client-cloudwatch/src/protocols/Aws_query.ts +++ b/clients/client-cloudwatch/src/protocols/Aws_query.ts @@ -112,7 +112,6 @@ import { ConcurrentModificationException, DashboardEntry, DashboardInvalidInputError, - DashboardNotFoundError, DashboardValidationMessage, Datapoint, DeleteAlarmsInput, @@ -878,7 +877,7 @@ export const de_DeleteAlarmsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAlarmsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteAlarmsCommandOutput = { @@ -887,32 +886,6 @@ export const de_DeleteAlarmsCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteAlarmsCommandError - */ -const de_DeleteAlarmsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.cloudwatch#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteAnomalyDetectorCommand */ @@ -921,7 +894,7 @@ export const de_DeleteAnomalyDetectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAnomalyDetectorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -933,44 +906,6 @@ export const de_DeleteAnomalyDetectorCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteAnomalyDetectorCommandError - */ -const de_DeleteAnomalyDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.cloudwatch#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteDashboardsCommand */ @@ -979,7 +914,7 @@ export const de_DeleteDashboardsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDashboardsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -991,38 +926,6 @@ export const de_DeleteDashboardsCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteDashboardsCommandError - */ -const de_DeleteDashboardsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudwatch#DashboardNotFoundError": - throw await de_DashboardNotFoundErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteInsightRulesCommand */ @@ -1031,7 +934,7 @@ export const de_DeleteInsightRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteInsightRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1043,35 +946,6 @@ export const de_DeleteInsightRulesCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteInsightRulesCommandError - */ -const de_DeleteInsightRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteMetricStreamCommand */ @@ -1080,7 +954,7 @@ export const de_DeleteMetricStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteMetricStreamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1092,38 +966,6 @@ export const de_DeleteMetricStreamCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteMetricStreamCommandError - */ -const de_DeleteMetricStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeAlarmHistoryCommand */ @@ -1132,7 +974,7 @@ export const de_DescribeAlarmHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAlarmHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1144,32 +986,6 @@ export const de_DescribeAlarmHistoryCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeAlarmHistoryCommandError - */ -const de_DescribeAlarmHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.cloudwatch#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeAlarmsCommand */ @@ -1178,7 +994,7 @@ export const de_DescribeAlarmsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAlarmsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1190,32 +1006,6 @@ export const de_DescribeAlarmsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeAlarmsCommandError - */ -const de_DescribeAlarmsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.cloudwatch#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeAlarmsForMetricCommand */ @@ -1224,7 +1014,7 @@ export const de_DescribeAlarmsForMetricCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAlarmsForMetricCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1236,26 +1026,6 @@ export const de_DescribeAlarmsForMetricCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeAlarmsForMetricCommandError - */ -const de_DescribeAlarmsForMetricCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeAnomalyDetectorsCommand */ @@ -1264,7 +1034,7 @@ export const de_DescribeAnomalyDetectorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAnomalyDetectorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1276,41 +1046,6 @@ export const de_DescribeAnomalyDetectorsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeAnomalyDetectorsCommandError - */ -const de_DescribeAnomalyDetectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.cloudwatch#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.cloudwatch#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeInsightRulesCommand */ @@ -1319,7 +1054,7 @@ export const de_DescribeInsightRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInsightRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1332,68 +1067,22 @@ export const de_DescribeInsightRulesCommand = async ( }; /** - * deserializeAws_queryDescribeInsightRulesCommandError + * deserializeAws_queryDisableAlarmActionsCommand */ -const de_DescribeInsightRulesCommandError = async ( +export const de_DisableAlarmActionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.cloudwatch#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDisableAlarmActionsCommand - */ -export const de_DisableAlarmActionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisableAlarmActionsCommandError(output, context); - } - await collectBody(output.body, context); - const response: DisableAlarmActionsCommandOutput = { - $metadata: deserializeMetadata(output), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DisableAlarmActionsCommandOutput = { + $metadata: deserializeMetadata(output), }; return response; }; -/** - * deserializeAws_queryDisableAlarmActionsCommandError - */ -const de_DisableAlarmActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDisableInsightRulesCommand */ @@ -1402,7 +1091,7 @@ export const de_DisableInsightRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableInsightRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1414,35 +1103,6 @@ export const de_DisableInsightRulesCommand = async ( return response; }; -/** - * deserializeAws_queryDisableInsightRulesCommandError - */ -const de_DisableInsightRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryEnableAlarmActionsCommand */ @@ -1451,7 +1111,7 @@ export const de_EnableAlarmActionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableAlarmActionsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: EnableAlarmActionsCommandOutput = { @@ -1460,26 +1120,6 @@ export const de_EnableAlarmActionsCommand = async ( return response; }; -/** - * deserializeAws_queryEnableAlarmActionsCommandError - */ -const de_EnableAlarmActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryEnableInsightRulesCommand */ @@ -1488,7 +1128,7 @@ export const de_EnableInsightRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableInsightRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1500,38 +1140,6 @@ export const de_EnableInsightRulesCommand = async ( return response; }; -/** - * deserializeAws_queryEnableInsightRulesCommandError - */ -const de_EnableInsightRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryGetDashboardCommand */ @@ -1540,7 +1148,7 @@ export const de_GetDashboardCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDashboardCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1552,38 +1160,6 @@ export const de_GetDashboardCommand = async ( return response; }; -/** - * deserializeAws_queryGetDashboardCommandError - */ -const de_GetDashboardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudwatch#DashboardNotFoundError": - throw await de_DashboardNotFoundErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryGetInsightRuleReportCommand */ @@ -1592,7 +1168,7 @@ export const de_GetInsightRuleReportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetInsightRuleReportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1604,38 +1180,6 @@ export const de_GetInsightRuleReportCommand = async ( return response; }; -/** - * deserializeAws_queryGetInsightRuleReportCommandError - */ -const de_GetInsightRuleReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryGetMetricDataCommand */ @@ -1644,7 +1188,7 @@ export const de_GetMetricDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetMetricDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1657,45 +1201,39 @@ export const de_GetMetricDataCommand = async ( }; /** - * deserializeAws_queryGetMetricDataCommandError + * deserializeAws_queryGetMetricStatisticsCommand */ -const de_GetMetricDataCommandError = async ( +export const de_GetMetricStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.cloudwatch#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetMetricStatisticsOutput(data.GetMetricStatisticsResult, context); + const response: GetMetricStatisticsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGetMetricStatisticsCommand + * deserializeAws_queryGetMetricStreamCommand */ -export const de_GetMetricStatisticsCommand = async ( +export const de_GetMetricStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetMetricStatisticsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetMetricStatisticsOutput(data.GetMetricStatisticsResult, context); - const response: GetMetricStatisticsCommandOutput = { + contents = de_GetMetricStreamOutput(data.GetMetricStreamResult, context); + const response: GetMetricStreamCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1703,54 +1241,39 @@ export const de_GetMetricStatisticsCommand = async ( }; /** - * deserializeAws_queryGetMetricStatisticsCommandError + * deserializeAws_queryGetMetricWidgetImageCommand */ -const de_GetMetricStatisticsCommandError = async ( +export const de_GetMetricWidgetImageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.cloudwatch#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetMetricWidgetImageOutput(data.GetMetricWidgetImageResult, context); + const response: GetMetricWidgetImageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGetMetricStreamCommand + * deserializeAws_queryListDashboardsCommand */ -export const de_GetMetricStreamCommand = async ( +export const de_ListDashboardsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetMetricStreamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetMetricStreamOutput(data.GetMetricStreamResult, context); - const response: GetMetricStreamCommandOutput = { + contents = de_ListDashboardsOutput(data.ListDashboardsResult, context); + const response: ListDashboardsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1758,141 +1281,14 @@ export const de_GetMetricStreamCommand = async ( }; /** - * deserializeAws_queryGetMetricStreamCommandError + * deserializeAws_queryListManagedInsightRulesCommand */ -const de_GetMetricStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.cloudwatch#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetMetricWidgetImageCommand - */ -export const de_GetMetricWidgetImageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetMetricWidgetImageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetMetricWidgetImageOutput(data.GetMetricWidgetImageResult, context); - const response: GetMetricWidgetImageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetMetricWidgetImageCommandError - */ -const de_GetMetricWidgetImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryListDashboardsCommand - */ -export const de_ListDashboardsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDashboardsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDashboardsOutput(data.ListDashboardsResult, context); - const response: ListDashboardsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListDashboardsCommandError - */ -const de_ListDashboardsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListManagedInsightRulesCommand - */ -export const de_ListManagedInsightRulesCommand = async ( +export const de_ListManagedInsightRulesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListManagedInsightRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1904,38 +1300,6 @@ export const de_ListManagedInsightRulesCommand = async ( return response; }; -/** - * deserializeAws_queryListManagedInsightRulesCommandError - */ -const de_ListManagedInsightRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextToken": - case "com.amazonaws.cloudwatch#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryListMetricsCommand */ @@ -1944,7 +1308,7 @@ export const de_ListMetricsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListMetricsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1956,35 +1320,6 @@ export const de_ListMetricsCommand = async ( return response; }; -/** - * deserializeAws_queryListMetricsCommandError - */ -const de_ListMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryListMetricStreamsCommand */ @@ -1993,7 +1328,7 @@ export const de_ListMetricStreamsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListMetricStreamsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2005,41 +1340,6 @@ export const de_ListMetricStreamsCommand = async ( return response; }; -/** - * deserializeAws_queryListMetricStreamsCommandError - */ -const de_ListMetricStreamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.cloudwatch#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryListTagsForResourceCommand */ @@ -2048,7 +1348,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2060,38 +1360,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_queryListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryPutAnomalyDetectorCommand */ @@ -2100,7 +1368,7 @@ export const de_PutAnomalyDetectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutAnomalyDetectorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2112,44 +1380,6 @@ export const de_PutAnomalyDetectorCommand = async ( return response; }; -/** - * deserializeAws_queryPutAnomalyDetectorCommandError - */ -const de_PutAnomalyDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.cloudwatch#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryPutCompositeAlarmCommand */ @@ -2158,7 +1388,7 @@ export const de_PutCompositeAlarmCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutCompositeAlarmCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutCompositeAlarmCommandOutput = { @@ -2167,32 +1397,6 @@ export const de_PutCompositeAlarmCommand = async ( return response; }; -/** - * deserializeAws_queryPutCompositeAlarmCommandError - */ -const de_PutCompositeAlarmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.cloudwatch#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryPutDashboardCommand */ @@ -2201,7 +1405,7 @@ export const de_PutDashboardCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutDashboardCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2213,35 +1417,6 @@ export const de_PutDashboardCommand = async ( return response; }; -/** - * deserializeAws_queryPutDashboardCommandError - */ -const de_PutDashboardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterInput": - case "com.amazonaws.cloudwatch#DashboardInvalidInputError": - throw await de_DashboardInvalidInputErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryPutInsightRuleCommand */ @@ -2250,7 +1425,7 @@ export const de_PutInsightRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutInsightRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2262,38 +1437,6 @@ export const de_PutInsightRuleCommand = async ( return response; }; -/** - * deserializeAws_queryPutInsightRuleCommandError - */ -const de_PutInsightRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cloudwatch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryPutManagedInsightRulesCommand */ @@ -2302,140 +1445,50 @@ export const de_PutManagedInsightRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutManagedInsightRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_PutManagedInsightRulesOutput(data.PutManagedInsightRulesResult, context); - const response: PutManagedInsightRulesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryPutManagedInsightRulesCommandError - */ -const de_PutManagedInsightRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPutMetricAlarmCommand - */ -export const de_PutMetricAlarmCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutMetricAlarmCommandError(output, context); - } - await collectBody(output.body, context); - const response: PutMetricAlarmCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryPutMetricAlarmCommandError - */ -const de_PutMetricAlarmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.cloudwatch#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + const response: PutManagedInsightRulesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryPutMetricDataCommand + * deserializeAws_queryPutMetricAlarmCommand */ -export const de_PutMetricDataCommand = async ( +export const de_PutMetricAlarmCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutMetricDataCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: PutMetricDataCommandOutput = { + const response: PutMetricAlarmCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryPutMetricDataCommandError + * deserializeAws_queryPutMetricDataCommand */ -const de_PutMetricDataCommandError = async ( +export const de_PutMetricDataCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.cloudwatch#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: PutMetricDataCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** @@ -2446,7 +1499,7 @@ export const de_PutMetricStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutMetricStreamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2458,44 +1511,6 @@ export const de_PutMetricStreamCommand = async ( return response; }; -/** - * deserializeAws_queryPutMetricStreamCommandError - */ -const de_PutMetricStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatch#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.cloudwatch#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySetAlarmStateCommand */ @@ -2504,7 +1519,7 @@ export const de_SetAlarmStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetAlarmStateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SetAlarmStateCommandOutput = { @@ -2513,35 +1528,6 @@ export const de_SetAlarmStateCommand = async ( return response; }; -/** - * deserializeAws_querySetAlarmStateCommandError - */ -const de_SetAlarmStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidFormat": - case "com.amazonaws.cloudwatch#InvalidFormatFault": - throw await de_InvalidFormatFaultRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.cloudwatch#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryStartMetricStreamsCommand */ @@ -2550,7 +1536,7 @@ export const de_StartMetricStreamsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartMetricStreamsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2562,38 +1548,6 @@ export const de_StartMetricStreamsCommand = async ( return response; }; -/** - * deserializeAws_queryStartMetricStreamsCommandError - */ -const de_StartMetricStreamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryStopMetricStreamsCommand */ @@ -2602,7 +1556,7 @@ export const de_StopMetricStreamsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopMetricStreamsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2614,38 +1568,6 @@ export const de_StopMetricStreamsCommand = async ( return response; }; -/** - * deserializeAws_queryStopMetricStreamsCommandError - */ -const de_StopMetricStreamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameter": - case "com.amazonaws.cloudwatch#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryTagResourceCommand */ @@ -2654,7 +1576,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2666,41 +1588,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_queryTagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatch#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.cloudwatch#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.cloudwatch#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cloudwatch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUntagResourceCommand */ @@ -2709,7 +1596,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2722,37 +1609,58 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_queryUntagResourceCommandError + * deserialize_Aws_queryCommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cloudwatch#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "ResourceNotFound": + case "com.amazonaws.cloudwatch#ResourceNotFound": + throw await de_ResourceNotFoundRes(parsedOutput, context); case "InternalServiceError": case "com.amazonaws.cloudwatch#InternalServiceFault": throw await de_InternalServiceFaultRes(parsedOutput, context); + case "InvalidParameterCombination": + case "com.amazonaws.cloudwatch#InvalidParameterCombinationException": + throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); case "InvalidParameterValue": case "com.amazonaws.cloudwatch#InvalidParameterValueException": throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); + case "MissingParameter": + case "com.amazonaws.cloudwatch#MissingRequiredParameterException": + throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.cloudwatch#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "InvalidNextToken": + case "com.amazonaws.cloudwatch#InvalidNextToken": + throw await de_InvalidNextTokenRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.cloudwatch#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "LimitExceeded": + case "com.amazonaws.cloudwatch#LimitExceededFault": + throw await de_LimitExceededFaultRes(parsedOutput, context); + case "InvalidParameterInput": + case "com.amazonaws.cloudwatch#DashboardInvalidInputError": + throw await de_DashboardInvalidInputErrorRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.cloudwatch#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "InvalidFormat": + case "com.amazonaws.cloudwatch#InvalidFormatFault": + throw await de_InvalidFormatFaultRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody: parsedBody.Error, errorCode, - }); + }) as never; } }; @@ -2788,22 +1696,6 @@ const de_DashboardInvalidInputErrorRes = async ( return __decorateServiceException(exception, body); }; -/** - * deserializeAws_queryDashboardNotFoundErrorRes - */ -const de_DashboardNotFoundErrorRes = async ( - parsedOutput: any, - context: __SerdeContext -): Promise => { - const body = parsedOutput.body; - const deserialized: any = de_DashboardNotFoundError(body.Error, context); - const exception = new DashboardNotFoundError({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized, - }); - return __decorateServiceException(exception, body); -}; - /** * deserializeAws_queryInternalServiceFaultRes */ @@ -5122,17 +4014,6 @@ const de_DashboardInvalidInputError = (output: any, context: __SerdeContext): Da return contents; }; -/** - * deserializeAws_queryDashboardNotFoundError - */ -const de_DashboardNotFoundError = (output: any, context: __SerdeContext): DashboardNotFoundError => { - const contents: any = {}; - if (output[_me] != null) { - contents[_me] = __expectString(output[_me]); - } - return contents; -}; - /** * deserializeAws_queryDashboardValidationMessage */ diff --git a/clients/client-codeartifact/src/protocols/Aws_restJson1.ts b/clients/client-codeartifact/src/protocols/Aws_restJson1.ts index 921cca9371b1..638b32810607 100644 --- a/clients/client-codeartifact/src/protocols/Aws_restJson1.ts +++ b/clients/client-codeartifact/src/protocols/Aws_restJson1.ts @@ -1091,7 +1091,7 @@ export const de_AssociateExternalConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateExternalConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1104,50 +1104,6 @@ export const de_AssociateExternalConnectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateExternalConnectionCommandError - */ -const de_AssociateExternalConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codeartifact#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CopyPackageVersionsCommand */ @@ -1156,7 +1112,7 @@ export const de_CopyPackageVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CopyPackageVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1170,50 +1126,6 @@ export const de_CopyPackageVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CopyPackageVersionsCommandError - */ -const de_CopyPackageVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codeartifact#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDomainCommand */ @@ -1222,7 +1134,7 @@ export const de_CreateDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1235,50 +1147,6 @@ export const de_CreateDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDomainCommandError - */ -const de_CreateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codeartifact#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRepositoryCommand */ @@ -1287,7 +1155,7 @@ export const de_CreateRepositoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRepositoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1300,50 +1168,6 @@ export const de_CreateRepositoryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRepositoryCommandError - */ -const de_CreateRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codeartifact#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDomainCommand */ @@ -1352,7 +1176,7 @@ export const de_DeleteDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1365,44 +1189,6 @@ export const de_DeleteDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDomainCommandError - */ -const de_DeleteDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDomainPermissionsPolicyCommand */ @@ -1411,7 +1197,7 @@ export const de_DeleteDomainPermissionsPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDomainPermissionsPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1425,1163 +1211,301 @@ export const de_DeleteDomainPermissionsPolicyCommand = async ( }; /** - * deserializeAws_restJson1DeleteDomainPermissionsPolicyCommandError + * deserializeAws_restJson1DeletePackageCommand */ -const de_DeleteDomainPermissionsPolicyCommandError = async ( +export const de_DeletePackageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + deletedPackage: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeletePackageCommand + * deserializeAws_restJson1DeletePackageVersionsCommand */ -export const de_DeletePackageCommand = async ( +export const de_DeletePackageVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - deletedPackage: _json, + failedVersions: _json, + successfulVersions: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeletePackageCommandError + * deserializeAws_restJson1DeleteRepositoryCommand */ -const de_DeletePackageCommandError = async ( +export const de_DeleteRepositoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + repository: (_) => de_RepositoryDescription(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeletePackageVersionsCommand + * deserializeAws_restJson1DeleteRepositoryPermissionsPolicyCommand */ -export const de_DeletePackageVersionsCommand = async ( +export const de_DeleteRepositoryPermissionsPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePackageVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - failedVersions: _json, - successfulVersions: _json, + policy: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeletePackageVersionsCommandError + * deserializeAws_restJson1DescribeDomainCommand */ -const de_DeletePackageVersionsCommandError = async ( +export const de_DescribeDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + domain: (_) => de_DomainDescription(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteRepositoryCommand + * deserializeAws_restJson1DescribePackageCommand */ -export const de_DeleteRepositoryCommand = async ( +export const de_DescribePackageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRepositoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - repository: (_) => de_RepositoryDescription(_, context), + package: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteRepositoryCommandError + * deserializeAws_restJson1DescribePackageVersionCommand */ -const de_DeleteRepositoryCommandError = async ( +export const de_DescribePackageVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + packageVersion: (_) => de_PackageVersionDescription(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteRepositoryPermissionsPolicyCommand + * deserializeAws_restJson1DescribeRepositoryCommand */ -export const de_DeleteRepositoryPermissionsPolicyCommand = async ( +export const de_DescribeRepositoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRepositoryPermissionsPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - policy: _json, + repository: (_) => de_RepositoryDescription(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteRepositoryPermissionsPolicyCommandError + * deserializeAws_restJson1DisassociateExternalConnectionCommand */ -const de_DeleteRepositoryPermissionsPolicyCommandError = async ( +export const de_DisassociateExternalConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + repository: (_) => de_RepositoryDescription(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeDomainCommand + * deserializeAws_restJson1DisposePackageVersionsCommand */ -export const de_DescribeDomainCommand = async ( +export const de_DisposePackageVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - domain: (_) => de_DomainDescription(_, context), + failedVersions: _json, + successfulVersions: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeDomainCommandError + * deserializeAws_restJson1GetAuthorizationTokenCommand */ -const de_DescribeDomainCommandError = async ( +export const de_GetAuthorizationTokenCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + authorizationToken: __expectString, + expiration: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribePackageCommand + * deserializeAws_restJson1GetDomainPermissionsPolicyCommand */ -export const de_DescribePackageCommand = async ( +export const de_GetDomainPermissionsPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - package: _json, + policy: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribePackageCommandError - */ -const de_DescribePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribePackageVersionCommand - */ -export const de_DescribePackageVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePackageVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - packageVersion: (_) => de_PackageVersionDescription(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribePackageVersionCommandError - */ -const de_DescribePackageVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeRepositoryCommand - */ -export const de_DescribeRepositoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRepositoryCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - repository: (_) => de_RepositoryDescription(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeRepositoryCommandError - */ -const de_DescribeRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateExternalConnectionCommand - */ -export const de_DisassociateExternalConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateExternalConnectionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - repository: (_) => de_RepositoryDescription(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateExternalConnectionCommandError - */ -const de_DisassociateExternalConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codeartifact#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisposePackageVersionsCommand - */ -export const de_DisposePackageVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisposePackageVersionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - failedVersions: _json, - successfulVersions: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DisposePackageVersionsCommandError - */ -const de_DisposePackageVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAuthorizationTokenCommand - */ -export const de_GetAuthorizationTokenCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAuthorizationTokenCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - authorizationToken: __expectString, - expiration: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAuthorizationTokenCommandError - */ -const de_GetAuthorizationTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDomainPermissionsPolicyCommand - */ -export const de_GetDomainPermissionsPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDomainPermissionsPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - policy: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDomainPermissionsPolicyCommandError - */ -const de_GetDomainPermissionsPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPackageVersionAssetCommand - */ -export const de_GetPackageVersionAssetCommand = async ( - output: __HttpResponse, - context: __SerdeContext & __SdkStreamSerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPackageVersionAssetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_aN]: [, output.headers[_xa]], - [_pV]: [, output.headers[_xp]], - [_pVR]: [, output.headers[_xp_]], - }); - const data: any = output.body; - context.sdkStreamMixin(data); - contents.asset = data; - return contents; -}; - -/** - * deserializeAws_restJson1GetPackageVersionAssetCommandError - */ -const de_GetPackageVersionAssetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPackageVersionReadmeCommand - */ -export const de_GetPackageVersionReadmeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPackageVersionReadmeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - format: __expectString, - namespace: __expectString, - package: __expectString, - readme: __expectString, - version: __expectString, - versionRevision: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPackageVersionReadmeCommandError - */ -const de_GetPackageVersionReadmeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRepositoryEndpointCommand - */ -export const de_GetRepositoryEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRepositoryEndpointCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - repositoryEndpoint: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRepositoryEndpointCommandError - */ -const de_GetRepositoryEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRepositoryPermissionsPolicyCommand - */ -export const de_GetRepositoryPermissionsPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRepositoryPermissionsPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - policy: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRepositoryPermissionsPolicyCommandError - */ -const de_GetRepositoryPermissionsPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDomainsCommand - */ -export const de_ListDomainsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDomainsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - domains: (_) => de_DomainSummaryList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDomainsCommandError - */ -const de_ListDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPackagesCommand + * deserializeAws_restJson1GetPackageVersionAssetCommand */ -export const de_ListPackagesCommand = async ( +export const de_GetPackageVersionAssetCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { + context: __SerdeContext & __SdkStreamSerdeContext +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPackagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), + [_aN]: [, output.headers[_xa]], + [_pV]: [, output.headers[_xp]], + [_pVR]: [, output.headers[_xp_]], }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - packages: _json, - }); - Object.assign(contents, doc); + const data: any = output.body; + context.sdkStreamMixin(data); + contents.asset = data; return contents; }; /** - * deserializeAws_restJson1ListPackagesCommandError - */ -const de_ListPackagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPackageVersionAssetsCommand + * deserializeAws_restJson1GetPackageVersionReadmeCommand */ -export const de_ListPackageVersionAssetsCommand = async ( +export const de_GetPackageVersionReadmeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPackageVersionAssetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - assets: _json, format: __expectString, namespace: __expectString, - nextToken: __expectString, package: __expectString, + readme: __expectString, version: __expectString, versionRevision: __expectString, }); @@ -2590,479 +1514,282 @@ export const de_ListPackageVersionAssetsCommand = async ( }; /** - * deserializeAws_restJson1ListPackageVersionAssetsCommandError - */ -const de_ListPackageVersionAssetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPackageVersionDependenciesCommand + * deserializeAws_restJson1GetRepositoryEndpointCommand */ -export const de_ListPackageVersionDependenciesCommand = async ( +export const de_GetRepositoryEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPackageVersionDependenciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - dependencies: _json, - format: __expectString, - namespace: __expectString, - nextToken: __expectString, - package: __expectString, - version: __expectString, - versionRevision: __expectString, + repositoryEndpoint: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPackageVersionDependenciesCommandError - */ -const de_ListPackageVersionDependenciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPackageVersionsCommand + * deserializeAws_restJson1GetRepositoryPermissionsPolicyCommand */ -export const de_ListPackageVersionsCommand = async ( +export const de_GetRepositoryPermissionsPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPackageVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - defaultDisplayVersion: __expectString, - format: __expectString, - namespace: __expectString, - nextToken: __expectString, - package: __expectString, - versions: _json, + policy: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPackageVersionsCommandError - */ -const de_ListPackageVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListRepositoriesCommand + * deserializeAws_restJson1ListDomainsCommand */ -export const de_ListRepositoriesCommand = async ( +export const de_ListDomainsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRepositoriesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + domains: (_) => de_DomainSummaryList(_, context), nextToken: __expectString, - repositories: (_) => de_RepositorySummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRepositoriesCommandError + * deserializeAws_restJson1ListPackagesCommand */ -const de_ListRepositoriesCommandError = async ( +export const de_ListPackagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + packages: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRepositoriesInDomainCommand + * deserializeAws_restJson1ListPackageVersionAssetsCommand */ -export const de_ListRepositoriesInDomainCommand = async ( +export const de_ListPackageVersionAssetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRepositoriesInDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + assets: _json, + format: __expectString, + namespace: __expectString, nextToken: __expectString, - repositories: (_) => de_RepositorySummaryList(_, context), + package: __expectString, + version: __expectString, + versionRevision: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRepositoriesInDomainCommandError + * deserializeAws_restJson1ListPackageVersionDependenciesCommand */ -const de_ListRepositoriesInDomainCommandError = async ( +export const de_ListPackageVersionDependenciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + dependencies: _json, + format: __expectString, + namespace: __expectString, + nextToken: __expectString, + package: __expectString, + version: __expectString, + versionRevision: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListPackageVersionsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListPackageVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + defaultDisplayVersion: __expectString, + format: __expectString, + namespace: __expectString, + nextToken: __expectString, + package: __expectString, + versions: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListRepositoriesCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListRepositoriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + repositories: (_) => de_RepositorySummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PublishPackageVersionCommand + * deserializeAws_restJson1ListRepositoriesInDomainCommand */ -export const de_PublishPackageVersionCommand = async ( +export const de_ListRepositoriesInDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PublishPackageVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - asset: _json, - format: __expectString, - namespace: __expectString, - package: __expectString, - status: __expectString, - version: __expectString, - versionRevision: __expectString, + nextToken: __expectString, + repositories: (_) => de_RepositorySummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PublishPackageVersionCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_PublishPackageVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codeartifact#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_ListTagsForResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutDomainPermissionsPolicyCommand + * deserializeAws_restJson1PublishPackageVersionCommand */ -export const de_PutDomainPermissionsPolicyCommand = async ( +export const de_PublishPackageVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutDomainPermissionsPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - policy: _json, + asset: _json, + format: __expectString, + namespace: __expectString, + package: __expectString, + status: __expectString, + version: __expectString, + versionRevision: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutDomainPermissionsPolicyCommandError + * deserializeAws_restJson1PutDomainPermissionsPolicyCommand */ -const de_PutDomainPermissionsPolicyCommandError = async ( +export const de_PutDomainPermissionsPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codeartifact#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + policy: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3073,7 +1800,7 @@ export const de_PutPackageOriginConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutPackageOriginConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3086,44 +1813,6 @@ export const de_PutPackageOriginConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutPackageOriginConfigurationCommandError - */ -const de_PutPackageOriginConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutRepositoryPermissionsPolicyCommand */ @@ -3132,7 +1821,7 @@ export const de_PutRepositoryPermissionsPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutRepositoryPermissionsPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3145,50 +1834,6 @@ export const de_PutRepositoryPermissionsPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutRepositoryPermissionsPolicyCommandError - */ -const de_PutRepositoryPermissionsPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codeartifact#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -3197,7 +1842,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3206,44 +1851,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codeartifact#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -3252,7 +1859,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3261,41 +1868,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePackageVersionsStatusCommand */ @@ -3304,7 +1876,7 @@ export const de_UpdatePackageVersionsStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePackageVersionsStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3318,47 +1890,6 @@ export const de_UpdatePackageVersionsStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePackageVersionsStatusCommandError - */ -const de_UpdatePackageVersionsStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codeartifact#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codeartifact#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeartifact#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeartifact#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeartifact#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeartifact#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRepositoryCommand */ @@ -3367,7 +1898,7 @@ export const de_UpdateRepositoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRepositoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3381,12 +1912,9 @@ export const de_UpdateRepositoryCommand = async ( }; /** - * deserializeAws_restJson1UpdateRepositoryCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3420,7 +1948,7 @@ const de_UpdateRepositoryCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-codebuild/src/protocols/Aws_json1_1.ts b/clients/client-codebuild/src/protocols/Aws_json1_1.ts index 6ad81f83b14b..325ea168bf26 100644 --- a/clients/client-codebuild/src/protocols/Aws_json1_1.ts +++ b/clients/client-codebuild/src/protocols/Aws_json1_1.ts @@ -900,7 +900,7 @@ export const de_BatchDeleteBuildsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDeleteBuildsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -912,32 +912,6 @@ export const de_BatchDeleteBuildsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDeleteBuildsCommandError - */ -const de_BatchDeleteBuildsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetBuildBatchesCommand */ @@ -946,7 +920,7 @@ export const de_BatchGetBuildBatchesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetBuildBatchesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -958,32 +932,6 @@ export const de_BatchGetBuildBatchesCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetBuildBatchesCommandError - */ -const de_BatchGetBuildBatchesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetBuildsCommand */ @@ -992,7 +940,7 @@ export const de_BatchGetBuildsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetBuildsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1004,32 +952,6 @@ export const de_BatchGetBuildsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetBuildsCommandError - */ -const de_BatchGetBuildsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetFleetsCommand */ @@ -1038,7 +960,7 @@ export const de_BatchGetFleetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetFleetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1050,32 +972,6 @@ export const de_BatchGetFleetsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetFleetsCommandError - */ -const de_BatchGetFleetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetProjectsCommand */ @@ -1084,7 +980,7 @@ export const de_BatchGetProjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetProjectsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1096,32 +992,6 @@ export const de_BatchGetProjectsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetProjectsCommandError - */ -const de_BatchGetProjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetReportGroupsCommand */ @@ -1130,7 +1000,7 @@ export const de_BatchGetReportGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetReportGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1142,32 +1012,6 @@ export const de_BatchGetReportGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetReportGroupsCommandError - */ -const de_BatchGetReportGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetReportsCommand */ @@ -1176,7 +1020,7 @@ export const de_BatchGetReportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetReportsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1188,32 +1032,6 @@ export const de_BatchGetReportsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetReportsCommandError - */ -const de_BatchGetReportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateFleetCommand */ @@ -1222,7 +1040,7 @@ export const de_CreateFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1234,38 +1052,6 @@ export const de_CreateFleetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateFleetCommandError - */ -const de_CreateFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountLimitExceededException": - case "com.amazonaws.codebuild#AccountLimitExceededException": - throw await de_AccountLimitExceededExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.codebuild#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateProjectCommand */ @@ -1274,7 +1060,7 @@ export const de_CreateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1286,38 +1072,6 @@ export const de_CreateProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateProjectCommandError - */ -const de_CreateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountLimitExceededException": - case "com.amazonaws.codebuild#AccountLimitExceededException": - throw await de_AccountLimitExceededExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.codebuild#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateReportGroupCommand */ @@ -1326,7 +1080,7 @@ export const de_CreateReportGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateReportGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1338,38 +1092,6 @@ export const de_CreateReportGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateReportGroupCommandError - */ -const de_CreateReportGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountLimitExceededException": - case "com.amazonaws.codebuild#AccountLimitExceededException": - throw await de_AccountLimitExceededExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.codebuild#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateWebhookCommand */ @@ -1378,7 +1100,7 @@ export const de_CreateWebhookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateWebhookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1391,49 +1113,14 @@ export const de_CreateWebhookCommand = async ( }; /** - * deserializeAws_json1_1CreateWebhookCommandError + * deserializeAws_json1_1DeleteBuildBatchCommand */ -const de_CreateWebhookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OAuthProviderException": - case "com.amazonaws.codebuild#OAuthProviderException": - throw await de_OAuthProviderExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.codebuild#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteBuildBatchCommand - */ -export const de_DeleteBuildBatchCommand = async ( +export const de_DeleteBuildBatchCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteBuildBatchCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1445,32 +1132,6 @@ export const de_DeleteBuildBatchCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteBuildBatchCommandError - */ -const de_DeleteBuildBatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteFleetCommand */ @@ -1479,7 +1140,7 @@ export const de_DeleteFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1491,32 +1152,6 @@ export const de_DeleteFleetCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteFleetCommandError - */ -const de_DeleteFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteProjectCommand */ @@ -1525,7 +1160,7 @@ export const de_DeleteProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1537,32 +1172,6 @@ export const de_DeleteProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteProjectCommandError - */ -const de_DeleteProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteReportCommand */ @@ -1571,7 +1180,7 @@ export const de_DeleteReportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteReportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1583,32 +1192,6 @@ export const de_DeleteReportCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteReportCommandError - */ -const de_DeleteReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteReportGroupCommand */ @@ -1617,7 +1200,7 @@ export const de_DeleteReportGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteReportGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1629,32 +1212,6 @@ export const de_DeleteReportGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteReportGroupCommandError - */ -const de_DeleteReportGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteResourcePolicyCommand */ @@ -1663,7 +1220,7 @@ export const de_DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1675,32 +1232,6 @@ export const de_DeleteResourcePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteSourceCredentialsCommand */ @@ -1709,7 +1240,7 @@ export const de_DeleteSourceCredentialsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSourceCredentialsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1721,35 +1252,6 @@ export const de_DeleteSourceCredentialsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteSourceCredentialsCommandError - */ -const de_DeleteSourceCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteWebhookCommand */ @@ -1758,7 +1260,7 @@ export const de_DeleteWebhookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteWebhookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1770,38 +1272,6 @@ export const de_DeleteWebhookCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteWebhookCommandError - */ -const de_DeleteWebhookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OAuthProviderException": - case "com.amazonaws.codebuild#OAuthProviderException": - throw await de_OAuthProviderExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeCodeCoveragesCommand */ @@ -1810,7 +1280,7 @@ export const de_DescribeCodeCoveragesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCodeCoveragesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1822,32 +1292,6 @@ export const de_DescribeCodeCoveragesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeCodeCoveragesCommandError - */ -const de_DescribeCodeCoveragesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTestCasesCommand */ @@ -1856,7 +1300,7 @@ export const de_DescribeTestCasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTestCasesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1869,43 +1313,14 @@ export const de_DescribeTestCasesCommand = async ( }; /** - * deserializeAws_json1_1DescribeTestCasesCommandError + * deserializeAws_json1_1GetReportGroupTrendCommand */ -const de_DescribeTestCasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetReportGroupTrendCommand - */ -export const de_GetReportGroupTrendCommand = async ( +export const de_GetReportGroupTrendCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetReportGroupTrendCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1917,35 +1332,6 @@ export const de_GetReportGroupTrendCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetReportGroupTrendCommandError - */ -const de_GetReportGroupTrendCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetResourcePolicyCommand */ @@ -1954,7 +1340,7 @@ export const de_GetResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1966,35 +1352,6 @@ export const de_GetResourcePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetResourcePolicyCommandError - */ -const de_GetResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ImportSourceCredentialsCommand */ @@ -2003,7 +1360,7 @@ export const de_ImportSourceCredentialsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportSourceCredentialsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2015,38 +1372,6 @@ export const de_ImportSourceCredentialsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ImportSourceCredentialsCommandError - */ -const de_ImportSourceCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountLimitExceededException": - case "com.amazonaws.codebuild#AccountLimitExceededException": - throw await de_AccountLimitExceededExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.codebuild#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1InvalidateProjectCacheCommand */ @@ -2055,7 +1380,7 @@ export const de_InvalidateProjectCacheCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_InvalidateProjectCacheCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2067,35 +1392,6 @@ export const de_InvalidateProjectCacheCommand = async ( return response; }; -/** - * deserializeAws_json1_1InvalidateProjectCacheCommandError - */ -const de_InvalidateProjectCacheCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListBuildBatchesCommand */ @@ -2104,7 +1400,7 @@ export const de_ListBuildBatchesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListBuildBatchesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2116,32 +1412,6 @@ export const de_ListBuildBatchesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListBuildBatchesCommandError - */ -const de_ListBuildBatchesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListBuildBatchesForProjectCommand */ @@ -2150,7 +1420,7 @@ export const de_ListBuildBatchesForProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListBuildBatchesForProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2162,35 +1432,6 @@ export const de_ListBuildBatchesForProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListBuildBatchesForProjectCommandError - */ -const de_ListBuildBatchesForProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListBuildsCommand */ @@ -2199,7 +1440,7 @@ export const de_ListBuildsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListBuildsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2211,32 +1452,6 @@ export const de_ListBuildsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListBuildsCommandError - */ -const de_ListBuildsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListBuildsForProjectCommand */ @@ -2245,7 +1460,7 @@ export const de_ListBuildsForProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListBuildsForProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2257,35 +1472,6 @@ export const de_ListBuildsForProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListBuildsForProjectCommandError - */ -const de_ListBuildsForProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListCuratedEnvironmentImagesCommand */ @@ -2294,7 +1480,7 @@ export const de_ListCuratedEnvironmentImagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListCuratedEnvironmentImagesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2306,26 +1492,6 @@ export const de_ListCuratedEnvironmentImagesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListCuratedEnvironmentImagesCommandError - */ -const de_ListCuratedEnvironmentImagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListFleetsCommand */ @@ -2334,7 +1500,7 @@ export const de_ListFleetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListFleetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2346,32 +1512,6 @@ export const de_ListFleetsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListFleetsCommandError - */ -const de_ListFleetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListProjectsCommand */ @@ -2380,7 +1520,7 @@ export const de_ListProjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListProjectsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2392,32 +1532,6 @@ export const de_ListProjectsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListProjectsCommandError - */ -const de_ListProjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListReportGroupsCommand */ @@ -2426,7 +1540,7 @@ export const de_ListReportGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListReportGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2438,32 +1552,6 @@ export const de_ListReportGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListReportGroupsCommandError - */ -const de_ListReportGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListReportsCommand */ @@ -2472,7 +1560,7 @@ export const de_ListReportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListReportsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2484,32 +1572,6 @@ export const de_ListReportsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListReportsCommandError - */ -const de_ListReportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListReportsForReportGroupCommand */ @@ -2518,7 +1580,7 @@ export const de_ListReportsForReportGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListReportsForReportGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2530,35 +1592,6 @@ export const de_ListReportsForReportGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListReportsForReportGroupCommandError - */ -const de_ListReportsForReportGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListSharedProjectsCommand */ @@ -2567,7 +1600,7 @@ export const de_ListSharedProjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSharedProjectsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2579,32 +1612,6 @@ export const de_ListSharedProjectsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSharedProjectsCommandError - */ -const de_ListSharedProjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListSharedReportGroupsCommand */ @@ -2613,7 +1620,7 @@ export const de_ListSharedReportGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSharedReportGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2625,32 +1632,6 @@ export const de_ListSharedReportGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSharedReportGroupsCommandError - */ -const de_ListSharedReportGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListSourceCredentialsCommand */ @@ -2659,7 +1640,7 @@ export const de_ListSourceCredentialsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSourceCredentialsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2671,32 +1652,6 @@ export const de_ListSourceCredentialsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSourceCredentialsCommandError - */ -const de_ListSourceCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutResourcePolicyCommand */ @@ -2705,7 +1660,7 @@ export const de_PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2717,35 +1672,6 @@ export const de_PutResourcePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RetryBuildCommand */ @@ -2754,48 +1680,16 @@ export const de_RetryBuildCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RetryBuildCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RetryBuildOutput(data, context); - const response: RetryBuildCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RetryBuildCommandError - */ -const de_RetryBuildCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountLimitExceededException": - case "com.amazonaws.codebuild#AccountLimitExceededException": - throw await de_AccountLimitExceededExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + let contents: any = {}; + contents = de_RetryBuildOutput(data, context); + const response: RetryBuildCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2806,7 +1700,7 @@ export const de_RetryBuildBatchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RetryBuildBatchCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2818,35 +1712,6 @@ export const de_RetryBuildBatchCommand = async ( return response; }; -/** - * deserializeAws_json1_1RetryBuildBatchCommandError - */ -const de_RetryBuildBatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartBuildCommand */ @@ -2855,7 +1720,7 @@ export const de_StartBuildCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartBuildCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2867,38 +1732,6 @@ export const de_StartBuildCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartBuildCommandError - */ -const de_StartBuildCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountLimitExceededException": - case "com.amazonaws.codebuild#AccountLimitExceededException": - throw await de_AccountLimitExceededExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartBuildBatchCommand */ @@ -2907,7 +1740,7 @@ export const de_StartBuildBatchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartBuildBatchCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2919,35 +1752,6 @@ export const de_StartBuildBatchCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartBuildBatchCommandError - */ -const de_StartBuildBatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopBuildCommand */ @@ -2956,7 +1760,7 @@ export const de_StopBuildCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopBuildCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2968,35 +1772,6 @@ export const de_StopBuildCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopBuildCommandError - */ -const de_StopBuildCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopBuildBatchCommand */ @@ -3005,7 +1780,7 @@ export const de_StopBuildBatchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopBuildBatchCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3017,35 +1792,6 @@ export const de_StopBuildBatchCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopBuildBatchCommandError - */ -const de_StopBuildBatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateFleetCommand */ @@ -3054,7 +1800,7 @@ export const de_UpdateFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3066,38 +1812,6 @@ export const de_UpdateFleetCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateFleetCommandError - */ -const de_UpdateFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountLimitExceededException": - case "com.amazonaws.codebuild#AccountLimitExceededException": - throw await de_AccountLimitExceededExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateProjectCommand */ @@ -3106,7 +1820,7 @@ export const de_UpdateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3118,35 +1832,6 @@ export const de_UpdateProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateProjectCommandError - */ -const de_UpdateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateProjectVisibilityCommand */ @@ -3155,7 +1840,7 @@ export const de_UpdateProjectVisibilityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateProjectVisibilityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3167,35 +1852,6 @@ export const de_UpdateProjectVisibilityCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateProjectVisibilityCommandError - */ -const de_UpdateProjectVisibilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateReportGroupCommand */ @@ -3204,7 +1860,7 @@ export const de_UpdateReportGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateReportGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3216,35 +1872,6 @@ export const de_UpdateReportGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateReportGroupCommandError - */ -const de_UpdateReportGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.codebuild#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codebuild#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateWebhookCommand */ @@ -3253,7 +1880,7 @@ export const de_UpdateWebhookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateWebhookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3266,12 +1893,9 @@ export const de_UpdateWebhookCommand = async ( }; /** - * deserializeAws_json1_1UpdateWebhookCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateWebhookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3281,6 +1905,12 @@ const de_UpdateWebhookCommandError = async ( case "InvalidInputException": case "com.amazonaws.codebuild#InvalidInputException": throw await de_InvalidInputExceptionRes(parsedOutput, context); + case "AccountLimitExceededException": + case "com.amazonaws.codebuild#AccountLimitExceededException": + throw await de_AccountLimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.codebuild#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); case "OAuthProviderException": case "com.amazonaws.codebuild#OAuthProviderException": throw await de_OAuthProviderExceptionRes(parsedOutput, context); @@ -3293,7 +1923,7 @@ const de_UpdateWebhookCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-codecatalyst/src/protocols/Aws_restJson1.ts b/clients/client-codecatalyst/src/protocols/Aws_restJson1.ts index c849acbb4049..ed25407b761c 100644 --- a/clients/client-codecatalyst/src/protocols/Aws_restJson1.ts +++ b/clients/client-codecatalyst/src/protocols/Aws_restJson1.ts @@ -980,7 +980,7 @@ export const de_CreateAccessTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAccessTokenCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -996,47 +996,6 @@ export const de_CreateAccessTokenCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAccessTokenCommandError - */ -const de_CreateAccessTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDevEnvironmentCommand */ @@ -1045,7 +1004,7 @@ export const de_CreateDevEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDevEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1061,47 +1020,6 @@ export const de_CreateDevEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDevEnvironmentCommandError - */ -const de_CreateDevEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProjectCommand */ @@ -1110,7 +1028,7 @@ export const de_CreateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1126,47 +1044,6 @@ export const de_CreateProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProjectCommandError - */ -const de_CreateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSourceRepositoryCommand */ @@ -1175,7 +1052,7 @@ export const de_CreateSourceRepositoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSourceRepositoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1191,47 +1068,6 @@ export const de_CreateSourceRepositoryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSourceRepositoryCommandError - */ -const de_CreateSourceRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSourceRepositoryBranchCommand */ @@ -1240,7 +1076,7 @@ export const de_CreateSourceRepositoryBranchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSourceRepositoryBranchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1256,47 +1092,6 @@ export const de_CreateSourceRepositoryBranchCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSourceRepositoryBranchCommandError - */ -const de_CreateSourceRepositoryBranchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAccessTokenCommand */ @@ -1305,7 +1100,7 @@ export const de_DeleteAccessTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAccessTokenCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1315,63 +1110,45 @@ export const de_DeleteAccessTokenCommand = async ( }; /** - * deserializeAws_restJson1DeleteAccessTokenCommandError + * deserializeAws_restJson1DeleteDevEnvironmentCommand */ -const de_DeleteAccessTokenCommandError = async ( +export const de_DeleteDevEnvironmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + id: __expectString, + projectName: __expectString, + spaceName: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteDevEnvironmentCommand + * deserializeAws_restJson1DeleteProjectCommand */ -export const de_DeleteDevEnvironmentCommand = async ( +export const de_DeleteProjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDevEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - id: __expectString, - projectName: __expectString, + displayName: __expectString, + name: __expectString, spaceName: __expectString, }); Object.assign(contents, doc); @@ -1379,119 +1156,14 @@ export const de_DeleteDevEnvironmentCommand = async ( }; /** - * deserializeAws_restJson1DeleteDevEnvironmentCommandError + * deserializeAws_restJson1DeleteSourceRepositoryCommand */ -const de_DeleteDevEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteProjectCommand - */ -export const de_DeleteProjectCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProjectCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - displayName: __expectString, - name: __expectString, - spaceName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteProjectCommandError - */ -const de_DeleteProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSourceRepositoryCommand - */ -export const de_DeleteSourceRepositoryCommand = async ( +export const de_DeleteSourceRepositoryCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSourceRepositoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1506,47 +1178,6 @@ export const de_DeleteSourceRepositoryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSourceRepositoryCommandError - */ -const de_DeleteSourceRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSpaceCommand */ @@ -1555,7 +1186,7 @@ export const de_DeleteSpaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSpaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1569,47 +1200,6 @@ export const de_DeleteSpaceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSpaceCommandError - */ -const de_DeleteSpaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDevEnvironmentCommand */ @@ -1618,7 +1208,7 @@ export const de_GetDevEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDevEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1644,47 +1234,6 @@ export const de_GetDevEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDevEnvironmentCommandError - */ -const de_GetDevEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetProjectCommand */ @@ -1693,7 +1242,7 @@ export const de_GetProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1709,47 +1258,6 @@ export const de_GetProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetProjectCommandError - */ -const de_GetProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSourceRepositoryCommand */ @@ -1758,7 +1266,7 @@ export const de_GetSourceRepositoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSourceRepositoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1777,55 +1285,14 @@ export const de_GetSourceRepositoryCommand = async ( }; /** - * deserializeAws_restJson1GetSourceRepositoryCommandError + * deserializeAws_restJson1GetSourceRepositoryCloneUrlsCommand */ -const de_GetSourceRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSourceRepositoryCloneUrlsCommand - */ -export const de_GetSourceRepositoryCloneUrlsCommand = async ( +export const de_GetSourceRepositoryCloneUrlsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSourceRepositoryCloneUrlsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1838,47 +1305,6 @@ export const de_GetSourceRepositoryCloneUrlsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSourceRepositoryCloneUrlsCommandError - */ -const de_GetSourceRepositoryCloneUrlsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSpaceCommand */ @@ -1887,7 +1313,7 @@ export const de_GetSpaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSpaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1903,47 +1329,6 @@ export const de_GetSpaceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSpaceCommandError - */ -const de_GetSpaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSubscriptionCommand */ @@ -1952,7 +1337,7 @@ export const de_GetSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1966,47 +1351,6 @@ export const de_GetSubscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSubscriptionCommandError - */ -const de_GetSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetUserDetailsCommand */ @@ -2015,7 +1359,7 @@ export const de_GetUserDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUserDetailsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2032,47 +1376,6 @@ export const de_GetUserDetailsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetUserDetailsCommandError - */ -const de_GetUserDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetWorkflowCommand */ @@ -2081,7 +1384,7 @@ export const de_GetWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2104,47 +1407,6 @@ export const de_GetWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetWorkflowCommandError - */ -const de_GetWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetWorkflowRunCommand */ @@ -2153,7 +1415,7 @@ export const de_GetWorkflowRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkflowRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2175,55 +1437,14 @@ export const de_GetWorkflowRunCommand = async ( }; /** - * deserializeAws_restJson1GetWorkflowRunCommandError + * deserializeAws_restJson1ListAccessTokensCommand */ -const de_GetWorkflowRunCommandError = async ( +export const de_ListAccessTokensCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAccessTokensCommand - */ -export const de_ListAccessTokensCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccessTokensCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2237,47 +1458,6 @@ export const de_ListAccessTokensCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAccessTokensCommandError - */ -const de_ListAccessTokensCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDevEnvironmentsCommand */ @@ -2286,7 +1466,7 @@ export const de_ListDevEnvironmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDevEnvironmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2300,47 +1480,6 @@ export const de_ListDevEnvironmentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDevEnvironmentsCommandError - */ -const de_ListDevEnvironmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDevEnvironmentSessionsCommand */ @@ -2349,7 +1488,7 @@ export const de_ListDevEnvironmentSessionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDevEnvironmentSessionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2363,47 +1502,6 @@ export const de_ListDevEnvironmentSessionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDevEnvironmentSessionsCommandError - */ -const de_ListDevEnvironmentSessionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEventLogsCommand */ @@ -2412,7 +1510,7 @@ export const de_ListEventLogsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEventLogsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2426,47 +1524,6 @@ export const de_ListEventLogsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEventLogsCommandError - */ -const de_ListEventLogsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProjectsCommand */ @@ -2475,7 +1532,7 @@ export const de_ListProjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProjectsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2489,47 +1546,6 @@ export const de_ListProjectsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListProjectsCommandError - */ -const de_ListProjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSourceRepositoriesCommand */ @@ -2538,7 +1554,7 @@ export const de_ListSourceRepositoriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSourceRepositoriesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2552,47 +1568,6 @@ export const de_ListSourceRepositoriesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSourceRepositoriesCommandError - */ -const de_ListSourceRepositoriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSourceRepositoryBranchesCommand */ @@ -2601,7 +1576,7 @@ export const de_ListSourceRepositoryBranchesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSourceRepositoryBranchesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2615,47 +1590,6 @@ export const de_ListSourceRepositoryBranchesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSourceRepositoryBranchesCommandError - */ -const de_ListSourceRepositoryBranchesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSpacesCommand */ @@ -2664,7 +1598,7 @@ export const de_ListSpacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSpacesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2678,47 +1612,6 @@ export const de_ListSpacesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSpacesCommandError - */ -const de_ListSpacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWorkflowRunsCommand */ @@ -2727,7 +1620,7 @@ export const de_ListWorkflowRunsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkflowRunsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2741,47 +1634,6 @@ export const de_ListWorkflowRunsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListWorkflowRunsCommandError - */ -const de_ListWorkflowRunsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWorkflowsCommand */ @@ -2790,7 +1642,7 @@ export const de_ListWorkflowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkflowsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2804,47 +1656,6 @@ export const de_ListWorkflowsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListWorkflowsCommandError - */ -const de_ListWorkflowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartDevEnvironmentCommand */ @@ -2853,192 +1664,69 @@ export const de_StartDevEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartDevEnvironmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - id: __expectString, - projectName: __expectString, - spaceName: __expectString, - status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartDevEnvironmentCommandError - */ -const de_StartDevEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartDevEnvironmentSessionCommand - */ -export const de_StartDevEnvironmentSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartDevEnvironmentSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - accessDetails: _json, - id: __expectString, - projectName: __expectString, - sessionId: __expectString, - spaceName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartDevEnvironmentSessionCommandError - */ -const de_StartDevEnvironmentSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + id: __expectString, + projectName: __expectString, + spaceName: __expectString, + status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartWorkflowRunCommand + * deserializeAws_restJson1StartDevEnvironmentSessionCommand */ -export const de_StartWorkflowRunCommand = async ( +export const de_StartDevEnvironmentSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartWorkflowRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + accessDetails: _json, id: __expectString, projectName: __expectString, + sessionId: __expectString, spaceName: __expectString, - workflowId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartWorkflowRunCommandError + * deserializeAws_restJson1StartWorkflowRunCommand */ -const de_StartWorkflowRunCommandError = async ( +export const de_StartWorkflowRunCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + id: __expectString, + projectName: __expectString, + spaceName: __expectString, + workflowId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3049,7 +1737,7 @@ export const de_StopDevEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopDevEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3065,47 +1753,6 @@ export const de_StopDevEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopDevEnvironmentCommandError - */ -const de_StopDevEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopDevEnvironmentSessionCommand */ @@ -3114,7 +1761,7 @@ export const de_StopDevEnvironmentSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopDevEnvironmentSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3130,47 +1777,6 @@ export const de_StopDevEnvironmentSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopDevEnvironmentSessionCommandError - */ -const de_StopDevEnvironmentSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDevEnvironmentCommand */ @@ -3179,7 +1785,7 @@ export const de_UpdateDevEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDevEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3199,47 +1805,6 @@ export const de_UpdateDevEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDevEnvironmentCommandError - */ -const de_UpdateDevEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateProjectCommand */ @@ -3248,7 +1813,7 @@ export const de_UpdateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3264,47 +1829,6 @@ export const de_UpdateProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateProjectCommandError - */ -const de_UpdateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSpaceCommand */ @@ -3313,7 +1837,7 @@ export const de_UpdateSpaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSpaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3328,47 +1852,6 @@ export const de_UpdateSpaceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSpaceCommandError - */ -const de_UpdateSpaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codecatalyst#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codecatalyst#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codecatalyst#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codecatalyst#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codecatalyst#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codecatalyst#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1VerifySessionCommand */ @@ -3377,7 +1860,7 @@ export const de_VerifySessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_VerifySessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3391,12 +1874,9 @@ export const de_VerifySessionCommand = async ( }; /** - * deserializeAws_restJson1VerifySessionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_VerifySessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3427,7 +1907,7 @@ const de_VerifySessionCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-codecommit/src/protocols/Aws_json1_1.ts b/clients/client-codecommit/src/protocols/Aws_json1_1.ts index 303ad811ac68..99ea087ef1a9 100644 --- a/clients/client-codecommit/src/protocols/Aws_json1_1.ts +++ b/clients/client-codecommit/src/protocols/Aws_json1_1.ts @@ -1605,7 +1605,7 @@ export const de_AssociateApprovalRuleTemplateWithRepositoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateApprovalRuleTemplateWithRepositoryCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AssociateApprovalRuleTemplateWithRepositoryCommandOutput = { @@ -1614,65 +1614,6 @@ export const de_AssociateApprovalRuleTemplateWithRepositoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateApprovalRuleTemplateWithRepositoryCommandError - */ -const de_AssociateApprovalRuleTemplateWithRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApprovalRuleTemplateDoesNotExistException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": - throw await de_ApprovalRuleTemplateDoesNotExistExceptionRes(parsedOutput, context); - case "ApprovalRuleTemplateNameRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateNameRequiredException": - throw await de_ApprovalRuleTemplateNameRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleTemplateNameException": - case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateNameException": - throw await de_InvalidApprovalRuleTemplateNameExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "MaximumRuleTemplatesAssociatedWithRepositoryException": - case "com.amazonaws.codecommit#MaximumRuleTemplatesAssociatedWithRepositoryException": - throw await de_MaximumRuleTemplatesAssociatedWithRepositoryExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchAssociateApprovalRuleTemplateWithRepositoriesCommand */ @@ -1681,7 +1622,7 @@ export const de_BatchAssociateApprovalRuleTemplateWithRepositoriesCommand = asyn context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchAssociateApprovalRuleTemplateWithRepositoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1693,59 +1634,6 @@ export const de_BatchAssociateApprovalRuleTemplateWithRepositoriesCommand = asyn return response; }; -/** - * deserializeAws_json1_1BatchAssociateApprovalRuleTemplateWithRepositoriesCommandError - */ -const de_BatchAssociateApprovalRuleTemplateWithRepositoriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApprovalRuleTemplateDoesNotExistException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": - throw await de_ApprovalRuleTemplateDoesNotExistExceptionRes(parsedOutput, context); - case "ApprovalRuleTemplateNameRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateNameRequiredException": - throw await de_ApprovalRuleTemplateNameRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleTemplateNameException": - case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateNameException": - throw await de_InvalidApprovalRuleTemplateNameExceptionRes(parsedOutput, context); - case "MaximumRepositoryNamesExceededException": - case "com.amazonaws.codecommit#MaximumRepositoryNamesExceededException": - throw await de_MaximumRepositoryNamesExceededExceptionRes(parsedOutput, context); - case "RepositoryNamesRequiredException": - case "com.amazonaws.codecommit#RepositoryNamesRequiredException": - throw await de_RepositoryNamesRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDescribeMergeConflictsCommand */ @@ -1754,7 +1642,7 @@ export const de_BatchDescribeMergeConflictsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDescribeMergeConflictsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1766,92 +1654,6 @@ export const de_BatchDescribeMergeConflictsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDescribeMergeConflictsCommandError - */ -const de_BatchDescribeMergeConflictsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitRequiredException": - case "com.amazonaws.codecommit#CommitRequiredException": - throw await de_CommitRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidCommitException": - case "com.amazonaws.codecommit#InvalidCommitException": - throw await de_InvalidCommitExceptionRes(parsedOutput, context); - case "InvalidConflictDetailLevelException": - case "com.amazonaws.codecommit#InvalidConflictDetailLevelException": - throw await de_InvalidConflictDetailLevelExceptionRes(parsedOutput, context); - case "InvalidConflictResolutionStrategyException": - case "com.amazonaws.codecommit#InvalidConflictResolutionStrategyException": - throw await de_InvalidConflictResolutionStrategyExceptionRes(parsedOutput, context); - case "InvalidContinuationTokenException": - case "com.amazonaws.codecommit#InvalidContinuationTokenException": - throw await de_InvalidContinuationTokenExceptionRes(parsedOutput, context); - case "InvalidMaxConflictFilesException": - case "com.amazonaws.codecommit#InvalidMaxConflictFilesException": - throw await de_InvalidMaxConflictFilesExceptionRes(parsedOutput, context); - case "InvalidMaxMergeHunksException": - case "com.amazonaws.codecommit#InvalidMaxMergeHunksException": - throw await de_InvalidMaxMergeHunksExceptionRes(parsedOutput, context); - case "InvalidMergeOptionException": - case "com.amazonaws.codecommit#InvalidMergeOptionException": - throw await de_InvalidMergeOptionExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "MaximumFileContentToLoadExceededException": - case "com.amazonaws.codecommit#MaximumFileContentToLoadExceededException": - throw await de_MaximumFileContentToLoadExceededExceptionRes(parsedOutput, context); - case "MaximumItemsToCompareExceededException": - case "com.amazonaws.codecommit#MaximumItemsToCompareExceededException": - throw await de_MaximumItemsToCompareExceededExceptionRes(parsedOutput, context); - case "MergeOptionRequiredException": - case "com.amazonaws.codecommit#MergeOptionRequiredException": - throw await de_MergeOptionRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "TipsDivergenceExceededException": - case "com.amazonaws.codecommit#TipsDivergenceExceededException": - throw await de_TipsDivergenceExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDisassociateApprovalRuleTemplateFromRepositoriesCommand */ @@ -1860,7 +1662,7 @@ export const de_BatchDisassociateApprovalRuleTemplateFromRepositoriesCommand = a context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDisassociateApprovalRuleTemplateFromRepositoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1873,72 +1675,39 @@ export const de_BatchDisassociateApprovalRuleTemplateFromRepositoriesCommand = a }; /** - * deserializeAws_json1_1BatchDisassociateApprovalRuleTemplateFromRepositoriesCommandError + * deserializeAws_json1_1BatchGetCommitsCommand */ -const de_BatchDisassociateApprovalRuleTemplateFromRepositoriesCommandError = async ( +export const de_BatchGetCommitsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApprovalRuleTemplateDoesNotExistException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": - throw await de_ApprovalRuleTemplateDoesNotExistExceptionRes(parsedOutput, context); - case "ApprovalRuleTemplateNameRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateNameRequiredException": - throw await de_ApprovalRuleTemplateNameRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleTemplateNameException": - case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateNameException": - throw await de_InvalidApprovalRuleTemplateNameExceptionRes(parsedOutput, context); - case "MaximumRepositoryNamesExceededException": - case "com.amazonaws.codecommit#MaximumRepositoryNamesExceededException": - throw await de_MaximumRepositoryNamesExceededExceptionRes(parsedOutput, context); - case "RepositoryNamesRequiredException": - case "com.amazonaws.codecommit#RepositoryNamesRequiredException": - throw await de_RepositoryNamesRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: BatchGetCommitsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1BatchGetCommitsCommand + * deserializeAws_json1_1BatchGetRepositoriesCommand */ -export const de_BatchGetCommitsCommand = async ( +export const de_BatchGetRepositoriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_BatchGetCommitsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: BatchGetCommitsCommandOutput = { + contents = de_BatchGetRepositoriesOutput(data, context); + const response: BatchGetRepositoriesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1946,72 +1715,19 @@ export const de_BatchGetCommitsCommand = async ( }; /** - * deserializeAws_json1_1BatchGetCommitsCommandError + * deserializeAws_json1_1CreateApprovalRuleTemplateCommand */ -const de_BatchGetCommitsCommandError = async ( +export const de_CreateApprovalRuleTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommitIdsLimitExceededException": - case "com.amazonaws.codecommit#CommitIdsLimitExceededException": - throw await de_CommitIdsLimitExceededExceptionRes(parsedOutput, context); - case "CommitIdsListRequiredException": - case "com.amazonaws.codecommit#CommitIdsListRequiredException": - throw await de_CommitIdsListRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1BatchGetRepositoriesCommand - */ -export const de_BatchGetRepositoriesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_BatchGetRepositoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_BatchGetRepositoriesOutput(data, context); - const response: BatchGetRepositoriesCommandOutput = { + contents = de_CreateApprovalRuleTemplateOutput(data, context); + const response: CreateApprovalRuleTemplateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2019,66 +1735,36 @@ export const de_BatchGetRepositoriesCommand = async ( }; /** - * deserializeAws_json1_1BatchGetRepositoriesCommandError + * deserializeAws_json1_1CreateBranchCommand */ -const de_BatchGetRepositoriesCommandError = async ( +export const de_CreateBranchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "MaximumRepositoryNamesExceededException": - case "com.amazonaws.codecommit#MaximumRepositoryNamesExceededException": - throw await de_MaximumRepositoryNamesExceededExceptionRes(parsedOutput, context); - case "RepositoryNamesRequiredException": - case "com.amazonaws.codecommit#RepositoryNamesRequiredException": - throw await de_RepositoryNamesRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: CreateBranchCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1CreateApprovalRuleTemplateCommand + * deserializeAws_json1_1CreateCommitCommand */ -export const de_CreateApprovalRuleTemplateCommand = async ( +export const de_CreateCommitCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateApprovalRuleTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateApprovalRuleTemplateOutput(data, context); - const response: CreateApprovalRuleTemplateCommandOutput = { + contents = _json(data); + const response: CreateCommitCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2086,145 +1772,79 @@ export const de_CreateApprovalRuleTemplateCommand = async ( }; /** - * deserializeAws_json1_1CreateApprovalRuleTemplateCommandError + * deserializeAws_json1_1CreatePullRequestCommand */ -const de_CreateApprovalRuleTemplateCommandError = async ( +export const de_CreatePullRequestCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApprovalRuleTemplateContentRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateContentRequiredException": - throw await de_ApprovalRuleTemplateContentRequiredExceptionRes(parsedOutput, context); - case "ApprovalRuleTemplateNameAlreadyExistsException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateNameAlreadyExistsException": - throw await de_ApprovalRuleTemplateNameAlreadyExistsExceptionRes(parsedOutput, context); - case "ApprovalRuleTemplateNameRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateNameRequiredException": - throw await de_ApprovalRuleTemplateNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleTemplateContentException": - case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateContentException": - throw await de_InvalidApprovalRuleTemplateContentExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleTemplateDescriptionException": - case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateDescriptionException": - throw await de_InvalidApprovalRuleTemplateDescriptionExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleTemplateNameException": - case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateNameException": - throw await de_InvalidApprovalRuleTemplateNameExceptionRes(parsedOutput, context); - case "NumberOfRuleTemplatesExceededException": - case "com.amazonaws.codecommit#NumberOfRuleTemplatesExceededException": - throw await de_NumberOfRuleTemplatesExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreatePullRequestOutput(data, context); + const response: CreatePullRequestCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateBranchCommand + * deserializeAws_json1_1CreatePullRequestApprovalRuleCommand */ -export const de_CreateBranchCommand = async ( +export const de_CreatePullRequestApprovalRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateBranchCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: CreateBranchCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreatePullRequestApprovalRuleOutput(data, context); + const response: CreatePullRequestApprovalRuleCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1CreateBranchCommandError + * deserializeAws_json1_1CreateRepositoryCommand */ -const de_CreateBranchCommandError = async ( +export const de_CreateRepositoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BranchNameExistsException": - case "com.amazonaws.codecommit#BranchNameExistsException": - throw await de_BranchNameExistsExceptionRes(parsedOutput, context); - case "BranchNameRequiredException": - case "com.amazonaws.codecommit#BranchNameRequiredException": - throw await de_BranchNameRequiredExceptionRes(parsedOutput, context); - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitIdRequiredException": - case "com.amazonaws.codecommit#CommitIdRequiredException": - throw await de_CommitIdRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidBranchNameException": - case "com.amazonaws.codecommit#InvalidBranchNameException": - throw await de_InvalidBranchNameExceptionRes(parsedOutput, context); - case "InvalidCommitIdException": - case "com.amazonaws.codecommit#InvalidCommitIdException": - throw await de_InvalidCommitIdExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateRepositoryOutput(data, context); + const response: CreateRepositoryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateCommitCommand + * deserializeAws_json1_1CreateUnreferencedMergeCommitCommand */ -export const de_CreateCommitCommand = async ( +export const de_CreateUnreferencedMergeCommitCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateCommitCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateCommitCommandOutput = { + const response: CreateUnreferencedMergeCommitCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2232,156 +1852,39 @@ export const de_CreateCommitCommand = async ( }; /** - * deserializeAws_json1_1CreateCommitCommandError + * deserializeAws_json1_1DeleteApprovalRuleTemplateCommand */ -const de_CreateCommitCommandError = async ( +export const de_DeleteApprovalRuleTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BranchDoesNotExistException": - case "com.amazonaws.codecommit#BranchDoesNotExistException": - throw await de_BranchDoesNotExistExceptionRes(parsedOutput, context); - case "BranchNameIsTagNameException": - case "com.amazonaws.codecommit#BranchNameIsTagNameException": - throw await de_BranchNameIsTagNameExceptionRes(parsedOutput, context); - case "BranchNameRequiredException": - case "com.amazonaws.codecommit#BranchNameRequiredException": - throw await de_BranchNameRequiredExceptionRes(parsedOutput, context); - case "CommitMessageLengthExceededException": - case "com.amazonaws.codecommit#CommitMessageLengthExceededException": - throw await de_CommitMessageLengthExceededExceptionRes(parsedOutput, context); - case "DirectoryNameConflictsWithFileNameException": - case "com.amazonaws.codecommit#DirectoryNameConflictsWithFileNameException": - throw await de_DirectoryNameConflictsWithFileNameExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "FileContentAndSourceFileSpecifiedException": - case "com.amazonaws.codecommit#FileContentAndSourceFileSpecifiedException": - throw await de_FileContentAndSourceFileSpecifiedExceptionRes(parsedOutput, context); - case "FileContentSizeLimitExceededException": - case "com.amazonaws.codecommit#FileContentSizeLimitExceededException": - throw await de_FileContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "FileDoesNotExistException": - case "com.amazonaws.codecommit#FileDoesNotExistException": - throw await de_FileDoesNotExistExceptionRes(parsedOutput, context); - case "FileEntryRequiredException": - case "com.amazonaws.codecommit#FileEntryRequiredException": - throw await de_FileEntryRequiredExceptionRes(parsedOutput, context); - case "FileModeRequiredException": - case "com.amazonaws.codecommit#FileModeRequiredException": - throw await de_FileModeRequiredExceptionRes(parsedOutput, context); - case "FileNameConflictsWithDirectoryNameException": - case "com.amazonaws.codecommit#FileNameConflictsWithDirectoryNameException": - throw await de_FileNameConflictsWithDirectoryNameExceptionRes(parsedOutput, context); - case "FilePathConflictsWithSubmodulePathException": - case "com.amazonaws.codecommit#FilePathConflictsWithSubmodulePathException": - throw await de_FilePathConflictsWithSubmodulePathExceptionRes(parsedOutput, context); - case "FolderContentSizeLimitExceededException": - case "com.amazonaws.codecommit#FolderContentSizeLimitExceededException": - throw await de_FolderContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "InvalidBranchNameException": - case "com.amazonaws.codecommit#InvalidBranchNameException": - throw await de_InvalidBranchNameExceptionRes(parsedOutput, context); - case "InvalidDeletionParameterException": - case "com.amazonaws.codecommit#InvalidDeletionParameterException": - throw await de_InvalidDeletionParameterExceptionRes(parsedOutput, context); - case "InvalidEmailException": - case "com.amazonaws.codecommit#InvalidEmailException": - throw await de_InvalidEmailExceptionRes(parsedOutput, context); - case "InvalidFileModeException": - case "com.amazonaws.codecommit#InvalidFileModeException": - throw await de_InvalidFileModeExceptionRes(parsedOutput, context); - case "InvalidParentCommitIdException": - case "com.amazonaws.codecommit#InvalidParentCommitIdException": - throw await de_InvalidParentCommitIdExceptionRes(parsedOutput, context); - case "InvalidPathException": - case "com.amazonaws.codecommit#InvalidPathException": - throw await de_InvalidPathExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "MaximumFileEntriesExceededException": - case "com.amazonaws.codecommit#MaximumFileEntriesExceededException": - throw await de_MaximumFileEntriesExceededExceptionRes(parsedOutput, context); - case "NameLengthExceededException": - case "com.amazonaws.codecommit#NameLengthExceededException": - throw await de_NameLengthExceededExceptionRes(parsedOutput, context); - case "NoChangeException": - case "com.amazonaws.codecommit#NoChangeException": - throw await de_NoChangeExceptionRes(parsedOutput, context); - case "ParentCommitDoesNotExistException": - case "com.amazonaws.codecommit#ParentCommitDoesNotExistException": - throw await de_ParentCommitDoesNotExistExceptionRes(parsedOutput, context); - case "ParentCommitIdOutdatedException": - case "com.amazonaws.codecommit#ParentCommitIdOutdatedException": - throw await de_ParentCommitIdOutdatedExceptionRes(parsedOutput, context); - case "ParentCommitIdRequiredException": - case "com.amazonaws.codecommit#ParentCommitIdRequiredException": - throw await de_ParentCommitIdRequiredExceptionRes(parsedOutput, context); - case "PathRequiredException": - case "com.amazonaws.codecommit#PathRequiredException": - throw await de_PathRequiredExceptionRes(parsedOutput, context); - case "PutFileEntryConflictException": - case "com.amazonaws.codecommit#PutFileEntryConflictException": - throw await de_PutFileEntryConflictExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "RestrictedSourceFileException": - case "com.amazonaws.codecommit#RestrictedSourceFileException": - throw await de_RestrictedSourceFileExceptionRes(parsedOutput, context); - case "SamePathRequestException": - case "com.amazonaws.codecommit#SamePathRequestException": - throw await de_SamePathRequestExceptionRes(parsedOutput, context); - case "SourceFileOrContentRequiredException": - case "com.amazonaws.codecommit#SourceFileOrContentRequiredException": - throw await de_SourceFileOrContentRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteApprovalRuleTemplateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreatePullRequestCommand + * deserializeAws_json1_1DeleteBranchCommand */ -export const de_CreatePullRequestCommand = async ( +export const de_DeleteBranchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreatePullRequestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreatePullRequestOutput(data, context); - const response: CreatePullRequestCommandOutput = { + contents = _json(data); + const response: DeleteBranchCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2389,117 +1892,39 @@ export const de_CreatePullRequestCommand = async ( }; /** - * deserializeAws_json1_1CreatePullRequestCommandError + * deserializeAws_json1_1DeleteCommentContentCommand */ -const de_CreatePullRequestCommandError = async ( +export const de_DeleteCommentContentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientRequestTokenRequiredException": - case "com.amazonaws.codecommit#ClientRequestTokenRequiredException": - throw await de_ClientRequestTokenRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "IdempotencyParameterMismatchException": - case "com.amazonaws.codecommit#IdempotencyParameterMismatchException": - throw await de_IdempotencyParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientRequestTokenException": - case "com.amazonaws.codecommit#InvalidClientRequestTokenException": - throw await de_InvalidClientRequestTokenExceptionRes(parsedOutput, context); - case "InvalidDescriptionException": - case "com.amazonaws.codecommit#InvalidDescriptionException": - throw await de_InvalidDescriptionExceptionRes(parsedOutput, context); - case "InvalidReferenceNameException": - case "com.amazonaws.codecommit#InvalidReferenceNameException": - throw await de_InvalidReferenceNameExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "InvalidTargetException": - case "com.amazonaws.codecommit#InvalidTargetException": - throw await de_InvalidTargetExceptionRes(parsedOutput, context); - case "InvalidTargetsException": - case "com.amazonaws.codecommit#InvalidTargetsException": - throw await de_InvalidTargetsExceptionRes(parsedOutput, context); - case "InvalidTitleException": - case "com.amazonaws.codecommit#InvalidTitleException": - throw await de_InvalidTitleExceptionRes(parsedOutput, context); - case "MaximumOpenPullRequestsExceededException": - case "com.amazonaws.codecommit#MaximumOpenPullRequestsExceededException": - throw await de_MaximumOpenPullRequestsExceededExceptionRes(parsedOutput, context); - case "MultipleRepositoriesInPullRequestException": - case "com.amazonaws.codecommit#MultipleRepositoriesInPullRequestException": - throw await de_MultipleRepositoriesInPullRequestExceptionRes(parsedOutput, context); - case "ReferenceDoesNotExistException": - case "com.amazonaws.codecommit#ReferenceDoesNotExistException": - throw await de_ReferenceDoesNotExistExceptionRes(parsedOutput, context); - case "ReferenceNameRequiredException": - case "com.amazonaws.codecommit#ReferenceNameRequiredException": - throw await de_ReferenceNameRequiredExceptionRes(parsedOutput, context); - case "ReferenceTypeNotSupportedException": - case "com.amazonaws.codecommit#ReferenceTypeNotSupportedException": - throw await de_ReferenceTypeNotSupportedExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "SourceAndDestinationAreSameException": - case "com.amazonaws.codecommit#SourceAndDestinationAreSameException": - throw await de_SourceAndDestinationAreSameExceptionRes(parsedOutput, context); - case "TargetRequiredException": - case "com.amazonaws.codecommit#TargetRequiredException": - throw await de_TargetRequiredExceptionRes(parsedOutput, context); - case "TargetsRequiredException": - case "com.amazonaws.codecommit#TargetsRequiredException": - throw await de_TargetsRequiredExceptionRes(parsedOutput, context); - case "TitleRequiredException": - case "com.amazonaws.codecommit#TitleRequiredException": - throw await de_TitleRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteCommentContentOutput(data, context); + const response: DeleteCommentContentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreatePullRequestApprovalRuleCommand + * deserializeAws_json1_1DeleteFileCommand */ -export const de_CreatePullRequestApprovalRuleCommand = async ( +export const de_DeleteFileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreatePullRequestApprovalRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreatePullRequestApprovalRuleOutput(data, context); - const response: CreatePullRequestApprovalRuleCommandOutput = { + contents = _json(data); + const response: DeleteFileCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2507,87 +1932,59 @@ export const de_CreatePullRequestApprovalRuleCommand = async ( }; /** - * deserializeAws_json1_1CreatePullRequestApprovalRuleCommandError + * deserializeAws_json1_1DeletePullRequestApprovalRuleCommand */ -const de_CreatePullRequestApprovalRuleCommandError = async ( +export const de_DeletePullRequestApprovalRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeletePullRequestApprovalRuleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApprovalRuleContentRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleContentRequiredException": - throw await de_ApprovalRuleContentRequiredExceptionRes(parsedOutput, context); - case "ApprovalRuleNameAlreadyExistsException": - case "com.amazonaws.codecommit#ApprovalRuleNameAlreadyExistsException": - throw await de_ApprovalRuleNameAlreadyExistsExceptionRes(parsedOutput, context); - case "ApprovalRuleNameRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleNameRequiredException": - throw await de_ApprovalRuleNameRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleContentException": - case "com.amazonaws.codecommit#InvalidApprovalRuleContentException": - throw await de_InvalidApprovalRuleContentExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleNameException": - case "com.amazonaws.codecommit#InvalidApprovalRuleNameException": - throw await de_InvalidApprovalRuleNameExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "NumberOfRulesExceededException": - case "com.amazonaws.codecommit#NumberOfRulesExceededException": - throw await de_NumberOfRulesExceededExceptionRes(parsedOutput, context); - case "PullRequestAlreadyClosedException": - case "com.amazonaws.codecommit#PullRequestAlreadyClosedException": - throw await de_PullRequestAlreadyClosedExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DeleteRepositoryCommand + */ +export const de_DeleteRepositoryCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteRepositoryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateRepositoryCommand + * deserializeAws_json1_1DescribeMergeConflictsCommand */ -export const de_CreateRepositoryCommand = async ( +export const de_DescribeMergeConflictsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateRepositoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateRepositoryOutput(data, context); - const response: CreateRepositoryCommandOutput = { + contents = _json(data); + const response: DescribeMergeConflictsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2595,90 +1992,56 @@ export const de_CreateRepositoryCommand = async ( }; /** - * deserializeAws_json1_1CreateRepositoryCommandError + * deserializeAws_json1_1DescribePullRequestEventsCommand */ -const de_CreateRepositoryCommandError = async ( +export const de_DescribePullRequestEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribePullRequestEventsOutput(data, context); + const response: DescribePullRequestEventsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyInvalidIdException": - case "com.amazonaws.codecommit#EncryptionKeyInvalidIdException": - throw await de_EncryptionKeyInvalidIdExceptionRes(parsedOutput, context); - case "EncryptionKeyInvalidUsageException": - case "com.amazonaws.codecommit#EncryptionKeyInvalidUsageException": - throw await de_EncryptionKeyInvalidUsageExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidRepositoryDescriptionException": - case "com.amazonaws.codecommit#InvalidRepositoryDescriptionException": - throw await de_InvalidRepositoryDescriptionExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "InvalidSystemTagUsageException": - case "com.amazonaws.codecommit#InvalidSystemTagUsageException": - throw await de_InvalidSystemTagUsageExceptionRes(parsedOutput, context); - case "InvalidTagsMapException": - case "com.amazonaws.codecommit#InvalidTagsMapException": - throw await de_InvalidTagsMapExceptionRes(parsedOutput, context); - case "RepositoryLimitExceededException": - case "com.amazonaws.codecommit#RepositoryLimitExceededException": - throw await de_RepositoryLimitExceededExceptionRes(parsedOutput, context); - case "RepositoryNameExistsException": - case "com.amazonaws.codecommit#RepositoryNameExistsException": - throw await de_RepositoryNameExistsExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "TagPolicyException": - case "com.amazonaws.codecommit#TagPolicyException": - throw await de_TagPolicyExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.codecommit#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DisassociateApprovalRuleTemplateFromRepositoryCommand + */ +export const de_DisassociateApprovalRuleTemplateFromRepositoryCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DisassociateApprovalRuleTemplateFromRepositoryCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1CreateUnreferencedMergeCommitCommand + * deserializeAws_json1_1EvaluatePullRequestApprovalRulesCommand */ -export const de_CreateUnreferencedMergeCommitCommand = async ( +export const de_EvaluatePullRequestApprovalRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateUnreferencedMergeCommitCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateUnreferencedMergeCommitCommandOutput = { + const response: EvaluatePullRequestApprovalRulesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2686,150 +2049,59 @@ export const de_CreateUnreferencedMergeCommitCommand = async ( }; /** - * deserializeAws_json1_1CreateUnreferencedMergeCommitCommandError + * deserializeAws_json1_1GetApprovalRuleTemplateCommand */ -const de_CreateUnreferencedMergeCommitCommandError = async ( +export const de_GetApprovalRuleTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetApprovalRuleTemplateOutput(data, context); + const response: GetApprovalRuleTemplateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitMessageLengthExceededException": - case "com.amazonaws.codecommit#CommitMessageLengthExceededException": - throw await de_CommitMessageLengthExceededExceptionRes(parsedOutput, context); - case "CommitRequiredException": - case "com.amazonaws.codecommit#CommitRequiredException": - throw await de_CommitRequiredExceptionRes(parsedOutput, context); - case "ConcurrentReferenceUpdateException": - case "com.amazonaws.codecommit#ConcurrentReferenceUpdateException": - throw await de_ConcurrentReferenceUpdateExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "FileContentSizeLimitExceededException": - case "com.amazonaws.codecommit#FileContentSizeLimitExceededException": - throw await de_FileContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "FileModeRequiredException": - case "com.amazonaws.codecommit#FileModeRequiredException": - throw await de_FileModeRequiredExceptionRes(parsedOutput, context); - case "FolderContentSizeLimitExceededException": - case "com.amazonaws.codecommit#FolderContentSizeLimitExceededException": - throw await de_FolderContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "InvalidCommitException": - case "com.amazonaws.codecommit#InvalidCommitException": - throw await de_InvalidCommitExceptionRes(parsedOutput, context); - case "InvalidConflictDetailLevelException": - case "com.amazonaws.codecommit#InvalidConflictDetailLevelException": - throw await de_InvalidConflictDetailLevelExceptionRes(parsedOutput, context); - case "InvalidConflictResolutionException": - case "com.amazonaws.codecommit#InvalidConflictResolutionException": - throw await de_InvalidConflictResolutionExceptionRes(parsedOutput, context); - case "InvalidConflictResolutionStrategyException": - case "com.amazonaws.codecommit#InvalidConflictResolutionStrategyException": - throw await de_InvalidConflictResolutionStrategyExceptionRes(parsedOutput, context); - case "InvalidEmailException": - case "com.amazonaws.codecommit#InvalidEmailException": - throw await de_InvalidEmailExceptionRes(parsedOutput, context); - case "InvalidFileModeException": - case "com.amazonaws.codecommit#InvalidFileModeException": - throw await de_InvalidFileModeExceptionRes(parsedOutput, context); - case "InvalidMergeOptionException": - case "com.amazonaws.codecommit#InvalidMergeOptionException": - throw await de_InvalidMergeOptionExceptionRes(parsedOutput, context); - case "InvalidPathException": - case "com.amazonaws.codecommit#InvalidPathException": - throw await de_InvalidPathExceptionRes(parsedOutput, context); - case "InvalidReplacementContentException": - case "com.amazonaws.codecommit#InvalidReplacementContentException": - throw await de_InvalidReplacementContentExceptionRes(parsedOutput, context); - case "InvalidReplacementTypeException": - case "com.amazonaws.codecommit#InvalidReplacementTypeException": - throw await de_InvalidReplacementTypeExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "ManualMergeRequiredException": - case "com.amazonaws.codecommit#ManualMergeRequiredException": - throw await de_ManualMergeRequiredExceptionRes(parsedOutput, context); - case "MaximumConflictResolutionEntriesExceededException": - case "com.amazonaws.codecommit#MaximumConflictResolutionEntriesExceededException": - throw await de_MaximumConflictResolutionEntriesExceededExceptionRes(parsedOutput, context); - case "MaximumFileContentToLoadExceededException": - case "com.amazonaws.codecommit#MaximumFileContentToLoadExceededException": - throw await de_MaximumFileContentToLoadExceededExceptionRes(parsedOutput, context); - case "MaximumItemsToCompareExceededException": - case "com.amazonaws.codecommit#MaximumItemsToCompareExceededException": - throw await de_MaximumItemsToCompareExceededExceptionRes(parsedOutput, context); - case "MergeOptionRequiredException": - case "com.amazonaws.codecommit#MergeOptionRequiredException": - throw await de_MergeOptionRequiredExceptionRes(parsedOutput, context); - case "MultipleConflictResolutionEntriesException": - case "com.amazonaws.codecommit#MultipleConflictResolutionEntriesException": - throw await de_MultipleConflictResolutionEntriesExceptionRes(parsedOutput, context); - case "NameLengthExceededException": - case "com.amazonaws.codecommit#NameLengthExceededException": - throw await de_NameLengthExceededExceptionRes(parsedOutput, context); - case "PathRequiredException": - case "com.amazonaws.codecommit#PathRequiredException": - throw await de_PathRequiredExceptionRes(parsedOutput, context); - case "ReplacementContentRequiredException": - case "com.amazonaws.codecommit#ReplacementContentRequiredException": - throw await de_ReplacementContentRequiredExceptionRes(parsedOutput, context); - case "ReplacementTypeRequiredException": - case "com.amazonaws.codecommit#ReplacementTypeRequiredException": - throw await de_ReplacementTypeRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "TipsDivergenceExceededException": - case "com.amazonaws.codecommit#TipsDivergenceExceededException": - throw await de_TipsDivergenceExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1GetBlobCommand + */ +export const de_GetBlobCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetBlobOutput(data, context); + const response: GetBlobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteApprovalRuleTemplateCommand + * deserializeAws_json1_1GetBranchCommand */ -export const de_DeleteApprovalRuleTemplateCommand = async ( +export const de_GetBranchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteApprovalRuleTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteApprovalRuleTemplateCommandOutput = { + const response: GetBranchCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2837,51 +2109,39 @@ export const de_DeleteApprovalRuleTemplateCommand = async ( }; /** - * deserializeAws_json1_1DeleteApprovalRuleTemplateCommandError + * deserializeAws_json1_1GetCommentCommand */ -const de_DeleteApprovalRuleTemplateCommandError = async ( +export const de_GetCommentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApprovalRuleTemplateInUseException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateInUseException": - throw await de_ApprovalRuleTemplateInUseExceptionRes(parsedOutput, context); - case "ApprovalRuleTemplateNameRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateNameRequiredException": - throw await de_ApprovalRuleTemplateNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleTemplateNameException": - case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateNameException": - throw await de_InvalidApprovalRuleTemplateNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetCommentOutput(data, context); + const response: GetCommentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteBranchCommand + * deserializeAws_json1_1GetCommentReactionsCommand */ -export const de_DeleteBranchCommand = async ( +export const de_GetCommentReactionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteBranchCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteBranchCommandOutput = { + const response: GetCommentReactionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2889,75 +2149,39 @@ export const de_DeleteBranchCommand = async ( }; /** - * deserializeAws_json1_1DeleteBranchCommandError + * deserializeAws_json1_1GetCommentsForComparedCommitCommand */ -const de_DeleteBranchCommandError = async ( +export const de_GetCommentsForComparedCommitCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BranchNameRequiredException": - case "com.amazonaws.codecommit#BranchNameRequiredException": - throw await de_BranchNameRequiredExceptionRes(parsedOutput, context); - case "DefaultBranchCannotBeDeletedException": - case "com.amazonaws.codecommit#DefaultBranchCannotBeDeletedException": - throw await de_DefaultBranchCannotBeDeletedExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidBranchNameException": - case "com.amazonaws.codecommit#InvalidBranchNameException": - throw await de_InvalidBranchNameExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetCommentsForComparedCommitOutput(data, context); + const response: GetCommentsForComparedCommitCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteCommentContentCommand + * deserializeAws_json1_1GetCommentsForPullRequestCommand */ -export const de_DeleteCommentContentCommand = async ( +export const de_GetCommentsForPullRequestCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteCommentContentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteCommentContentOutput(data, context); - const response: DeleteCommentContentCommandOutput = { + contents = de_GetCommentsForPullRequestOutput(data, context); + const response: GetCommentsForPullRequestCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2965,54 +2189,39 @@ export const de_DeleteCommentContentCommand = async ( }; /** - * deserializeAws_json1_1DeleteCommentContentCommandError + * deserializeAws_json1_1GetCommitCommand */ -const de_DeleteCommentContentCommandError = async ( +export const de_GetCommitCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommentDeletedException": - case "com.amazonaws.codecommit#CommentDeletedException": - throw await de_CommentDeletedExceptionRes(parsedOutput, context); - case "CommentDoesNotExistException": - case "com.amazonaws.codecommit#CommentDoesNotExistException": - throw await de_CommentDoesNotExistExceptionRes(parsedOutput, context); - case "CommentIdRequiredException": - case "com.amazonaws.codecommit#CommentIdRequiredException": - throw await de_CommentIdRequiredExceptionRes(parsedOutput, context); - case "InvalidCommentIdException": - case "com.amazonaws.codecommit#InvalidCommentIdException": - throw await de_InvalidCommentIdExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetCommitCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteFileCommand + * deserializeAws_json1_1GetDifferencesCommand */ -export const de_DeleteFileCommand = async ( +export const de_GetDifferencesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteFileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteFileCommandOutput = { + const response: GetDifferencesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3020,108 +2229,39 @@ export const de_DeleteFileCommand = async ( }; /** - * deserializeAws_json1_1DeleteFileCommandError + * deserializeAws_json1_1GetFileCommand */ -const de_DeleteFileCommandError = async ( +export const de_GetFileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BranchDoesNotExistException": - case "com.amazonaws.codecommit#BranchDoesNotExistException": - throw await de_BranchDoesNotExistExceptionRes(parsedOutput, context); - case "BranchNameIsTagNameException": - case "com.amazonaws.codecommit#BranchNameIsTagNameException": - throw await de_BranchNameIsTagNameExceptionRes(parsedOutput, context); - case "BranchNameRequiredException": - case "com.amazonaws.codecommit#BranchNameRequiredException": - throw await de_BranchNameRequiredExceptionRes(parsedOutput, context); - case "CommitMessageLengthExceededException": - case "com.amazonaws.codecommit#CommitMessageLengthExceededException": - throw await de_CommitMessageLengthExceededExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "FileDoesNotExistException": - case "com.amazonaws.codecommit#FileDoesNotExistException": - throw await de_FileDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidBranchNameException": - case "com.amazonaws.codecommit#InvalidBranchNameException": - throw await de_InvalidBranchNameExceptionRes(parsedOutput, context); - case "InvalidEmailException": - case "com.amazonaws.codecommit#InvalidEmailException": - throw await de_InvalidEmailExceptionRes(parsedOutput, context); - case "InvalidParentCommitIdException": - case "com.amazonaws.codecommit#InvalidParentCommitIdException": - throw await de_InvalidParentCommitIdExceptionRes(parsedOutput, context); - case "InvalidPathException": - case "com.amazonaws.codecommit#InvalidPathException": - throw await de_InvalidPathExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "NameLengthExceededException": - case "com.amazonaws.codecommit#NameLengthExceededException": - throw await de_NameLengthExceededExceptionRes(parsedOutput, context); - case "ParentCommitDoesNotExistException": - case "com.amazonaws.codecommit#ParentCommitDoesNotExistException": - throw await de_ParentCommitDoesNotExistExceptionRes(parsedOutput, context); - case "ParentCommitIdOutdatedException": - case "com.amazonaws.codecommit#ParentCommitIdOutdatedException": - throw await de_ParentCommitIdOutdatedExceptionRes(parsedOutput, context); - case "ParentCommitIdRequiredException": - case "com.amazonaws.codecommit#ParentCommitIdRequiredException": - throw await de_ParentCommitIdRequiredExceptionRes(parsedOutput, context); - case "PathRequiredException": - case "com.amazonaws.codecommit#PathRequiredException": - throw await de_PathRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetFileOutput(data, context); + const response: GetFileCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeletePullRequestApprovalRuleCommand + * deserializeAws_json1_1GetFolderCommand */ -export const de_DeletePullRequestApprovalRuleCommand = async ( +export const de_GetFolderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeletePullRequestApprovalRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeletePullRequestApprovalRuleCommandOutput = { + const response: GetFolderCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3129,78 +2269,39 @@ export const de_DeletePullRequestApprovalRuleCommand = async ( }; /** - * deserializeAws_json1_1DeletePullRequestApprovalRuleCommandError + * deserializeAws_json1_1GetMergeCommitCommand */ -const de_DeletePullRequestApprovalRuleCommandError = async ( +export const de_GetMergeCommitCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApprovalRuleNameRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleNameRequiredException": - throw await de_ApprovalRuleNameRequiredExceptionRes(parsedOutput, context); - case "CannotDeleteApprovalRuleFromTemplateException": - case "com.amazonaws.codecommit#CannotDeleteApprovalRuleFromTemplateException": - throw await de_CannotDeleteApprovalRuleFromTemplateExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleNameException": - case "com.amazonaws.codecommit#InvalidApprovalRuleNameException": - throw await de_InvalidApprovalRuleNameExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "PullRequestAlreadyClosedException": - case "com.amazonaws.codecommit#PullRequestAlreadyClosedException": - throw await de_PullRequestAlreadyClosedExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetMergeCommitCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRepositoryCommand + * deserializeAws_json1_1GetMergeConflictsCommand */ -export const de_DeleteRepositoryCommand = async ( +export const de_GetMergeConflictsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRepositoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRepositoryCommandOutput = { + const response: GetMergeConflictsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3208,63 +2309,59 @@ export const de_DeleteRepositoryCommand = async ( }; /** - * deserializeAws_json1_1DeleteRepositoryCommandError + * deserializeAws_json1_1GetMergeOptionsCommand */ -const de_DeleteRepositoryCommandError = async ( +export const de_GetMergeOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetMergeOptionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1GetPullRequestCommand + */ +export const de_GetPullRequestCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetPullRequestOutput(data, context); + const response: GetPullRequestCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeMergeConflictsCommand + * deserializeAws_json1_1GetPullRequestApprovalStatesCommand */ -export const de_DescribeMergeConflictsCommand = async ( +export const de_GetPullRequestApprovalStatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeMergeConflictsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeMergeConflictsCommandOutput = { + const response: GetPullRequestApprovalStatesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3272,111 +2369,39 @@ export const de_DescribeMergeConflictsCommand = async ( }; /** - * deserializeAws_json1_1DescribeMergeConflictsCommandError + * deserializeAws_json1_1GetPullRequestOverrideStateCommand */ -const de_DescribeMergeConflictsCommandError = async ( +export const de_GetPullRequestOverrideStateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetPullRequestOverrideStateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitRequiredException": - case "com.amazonaws.codecommit#CommitRequiredException": - throw await de_CommitRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "FileDoesNotExistException": - case "com.amazonaws.codecommit#FileDoesNotExistException": - throw await de_FileDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidCommitException": - case "com.amazonaws.codecommit#InvalidCommitException": - throw await de_InvalidCommitExceptionRes(parsedOutput, context); - case "InvalidConflictDetailLevelException": - case "com.amazonaws.codecommit#InvalidConflictDetailLevelException": - throw await de_InvalidConflictDetailLevelExceptionRes(parsedOutput, context); - case "InvalidConflictResolutionStrategyException": - case "com.amazonaws.codecommit#InvalidConflictResolutionStrategyException": - throw await de_InvalidConflictResolutionStrategyExceptionRes(parsedOutput, context); - case "InvalidContinuationTokenException": - case "com.amazonaws.codecommit#InvalidContinuationTokenException": - throw await de_InvalidContinuationTokenExceptionRes(parsedOutput, context); - case "InvalidMaxMergeHunksException": - case "com.amazonaws.codecommit#InvalidMaxMergeHunksException": - throw await de_InvalidMaxMergeHunksExceptionRes(parsedOutput, context); - case "InvalidMergeOptionException": - case "com.amazonaws.codecommit#InvalidMergeOptionException": - throw await de_InvalidMergeOptionExceptionRes(parsedOutput, context); - case "InvalidPathException": - case "com.amazonaws.codecommit#InvalidPathException": - throw await de_InvalidPathExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "MaximumFileContentToLoadExceededException": - case "com.amazonaws.codecommit#MaximumFileContentToLoadExceededException": - throw await de_MaximumFileContentToLoadExceededExceptionRes(parsedOutput, context); - case "MaximumItemsToCompareExceededException": - case "com.amazonaws.codecommit#MaximumItemsToCompareExceededException": - throw await de_MaximumItemsToCompareExceededExceptionRes(parsedOutput, context); - case "MergeOptionRequiredException": - case "com.amazonaws.codecommit#MergeOptionRequiredException": - throw await de_MergeOptionRequiredExceptionRes(parsedOutput, context); - case "PathRequiredException": - case "com.amazonaws.codecommit#PathRequiredException": - throw await de_PathRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "TipsDivergenceExceededException": - case "com.amazonaws.codecommit#TipsDivergenceExceededException": - throw await de_TipsDivergenceExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1DescribePullRequestEventsCommand + * deserializeAws_json1_1GetRepositoryCommand */ -export const de_DescribePullRequestEventsCommand = async ( +export const de_GetRepositoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribePullRequestEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribePullRequestEventsOutput(data, context); - const response: DescribePullRequestEventsCommandOutput = { + contents = de_GetRepositoryOutput(data, context); + const response: GetRepositoryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3384,154 +2409,99 @@ export const de_DescribePullRequestEventsCommand = async ( }; /** - * deserializeAws_json1_1DescribePullRequestEventsCommandError + * deserializeAws_json1_1GetRepositoryTriggersCommand */ -const de_DescribePullRequestEventsCommandError = async ( +export const de_GetRepositoryTriggersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActorDoesNotExistException": - case "com.amazonaws.codecommit#ActorDoesNotExistException": - throw await de_ActorDoesNotExistExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidActorArnException": - case "com.amazonaws.codecommit#InvalidActorArnException": - throw await de_InvalidActorArnExceptionRes(parsedOutput, context); - case "InvalidContinuationTokenException": - case "com.amazonaws.codecommit#InvalidContinuationTokenException": - throw await de_InvalidContinuationTokenExceptionRes(parsedOutput, context); - case "InvalidMaxResultsException": - case "com.amazonaws.codecommit#InvalidMaxResultsException": - throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); - case "InvalidPullRequestEventTypeException": - case "com.amazonaws.codecommit#InvalidPullRequestEventTypeException": - throw await de_InvalidPullRequestEventTypeExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetRepositoryTriggersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisassociateApprovalRuleTemplateFromRepositoryCommand + * deserializeAws_json1_1ListApprovalRuleTemplatesCommand */ -export const de_DisassociateApprovalRuleTemplateFromRepositoryCommand = async ( +export const de_ListApprovalRuleTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateApprovalRuleTemplateFromRepositoryCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DisassociateApprovalRuleTemplateFromRepositoryCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListApprovalRuleTemplatesCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1DisassociateApprovalRuleTemplateFromRepositoryCommandError + * deserializeAws_json1_1ListAssociatedApprovalRuleTemplatesForRepositoryCommand */ -const de_DisassociateApprovalRuleTemplateFromRepositoryCommandError = async ( +export const de_ListAssociatedApprovalRuleTemplatesForRepositoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListAssociatedApprovalRuleTemplatesForRepositoryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApprovalRuleTemplateDoesNotExistException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": - throw await de_ApprovalRuleTemplateDoesNotExistExceptionRes(parsedOutput, context); - case "ApprovalRuleTemplateNameRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateNameRequiredException": - throw await de_ApprovalRuleTemplateNameRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleTemplateNameException": - case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateNameException": - throw await de_InvalidApprovalRuleTemplateNameExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1ListBranchesCommand + */ +export const de_ListBranchesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListBranchesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1EvaluatePullRequestApprovalRulesCommand + * deserializeAws_json1_1ListFileCommitHistoryCommand */ -export const de_EvaluatePullRequestApprovalRulesCommand = async ( +export const de_ListFileCommitHistoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_EvaluatePullRequestApprovalRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: EvaluatePullRequestApprovalRulesCommandOutput = { + const response: ListFileCommitHistoryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3539,75 +2509,39 @@ export const de_EvaluatePullRequestApprovalRulesCommand = async ( }; /** - * deserializeAws_json1_1EvaluatePullRequestApprovalRulesCommandError + * deserializeAws_json1_1ListPullRequestsCommand */ -const de_EvaluatePullRequestApprovalRulesCommandError = async ( +export const de_ListPullRequestsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListPullRequestsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "InvalidRevisionIdException": - case "com.amazonaws.codecommit#InvalidRevisionIdException": - throw await de_InvalidRevisionIdExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - case "RevisionIdRequiredException": - case "com.amazonaws.codecommit#RevisionIdRequiredException": - throw await de_RevisionIdRequiredExceptionRes(parsedOutput, context); - case "RevisionNotCurrentException": - case "com.amazonaws.codecommit#RevisionNotCurrentException": - throw await de_RevisionNotCurrentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1GetApprovalRuleTemplateCommand + * deserializeAws_json1_1ListRepositoriesCommand */ -export const de_GetApprovalRuleTemplateCommand = async ( +export const de_ListRepositoriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetApprovalRuleTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetApprovalRuleTemplateOutput(data, context); - const response: GetApprovalRuleTemplateCommandOutput = { + contents = _json(data); + const response: ListRepositoriesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3615,51 +2549,39 @@ export const de_GetApprovalRuleTemplateCommand = async ( }; /** - * deserializeAws_json1_1GetApprovalRuleTemplateCommandError + * deserializeAws_json1_1ListRepositoriesForApprovalRuleTemplateCommand */ -const de_GetApprovalRuleTemplateCommandError = async ( +export const de_ListRepositoriesForApprovalRuleTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApprovalRuleTemplateDoesNotExistException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": - throw await de_ApprovalRuleTemplateDoesNotExistExceptionRes(parsedOutput, context); - case "ApprovalRuleTemplateNameRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateNameRequiredException": - throw await de_ApprovalRuleTemplateNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleTemplateNameException": - case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateNameException": - throw await de_InvalidApprovalRuleTemplateNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListRepositoriesForApprovalRuleTemplateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetBlobCommand + * deserializeAws_json1_1ListTagsForResourceCommand */ -export const de_GetBlobCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetBlobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetBlobOutput(data, context); - const response: GetBlobCommandOutput = { + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3667,78 +2589,39 @@ export const de_GetBlobCommand = async ( }; /** - * deserializeAws_json1_1GetBlobCommandError + * deserializeAws_json1_1MergeBranchesByFastForwardCommand */ -const de_GetBlobCommandError = async ( +export const de_MergeBranchesByFastForwardCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BlobIdDoesNotExistException": - case "com.amazonaws.codecommit#BlobIdDoesNotExistException": - throw await de_BlobIdDoesNotExistExceptionRes(parsedOutput, context); - case "BlobIdRequiredException": - case "com.amazonaws.codecommit#BlobIdRequiredException": - throw await de_BlobIdRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "FileTooLargeException": - case "com.amazonaws.codecommit#FileTooLargeException": - throw await de_FileTooLargeExceptionRes(parsedOutput, context); - case "InvalidBlobIdException": - case "com.amazonaws.codecommit#InvalidBlobIdException": - throw await de_InvalidBlobIdExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: MergeBranchesByFastForwardCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetBranchCommand + * deserializeAws_json1_1MergeBranchesBySquashCommand */ -export const de_GetBranchCommand = async ( +export const de_MergeBranchesBySquashCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetBranchCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetBranchCommandOutput = { + const response: MergeBranchesBySquashCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3746,75 +2629,39 @@ export const de_GetBranchCommand = async ( }; /** - * deserializeAws_json1_1GetBranchCommandError + * deserializeAws_json1_1MergeBranchesByThreeWayCommand */ -const de_GetBranchCommandError = async ( +export const de_MergeBranchesByThreeWayCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BranchDoesNotExistException": - case "com.amazonaws.codecommit#BranchDoesNotExistException": - throw await de_BranchDoesNotExistExceptionRes(parsedOutput, context); - case "BranchNameRequiredException": - case "com.amazonaws.codecommit#BranchNameRequiredException": - throw await de_BranchNameRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidBranchNameException": - case "com.amazonaws.codecommit#InvalidBranchNameException": - throw await de_InvalidBranchNameExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: MergeBranchesByThreeWayCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetCommentCommand + * deserializeAws_json1_1MergePullRequestByFastForwardCommand */ -export const de_GetCommentCommand = async ( +export const de_MergePullRequestByFastForwardCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetCommentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetCommentOutput(data, context); - const response: GetCommentCommandOutput = { + contents = de_MergePullRequestByFastForwardOutput(data, context); + const response: MergePullRequestByFastForwardCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3822,69 +2669,39 @@ export const de_GetCommentCommand = async ( }; /** - * deserializeAws_json1_1GetCommentCommandError + * deserializeAws_json1_1MergePullRequestBySquashCommand */ -const de_GetCommentCommandError = async ( +export const de_MergePullRequestBySquashCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_MergePullRequestBySquashOutput(data, context); + const response: MergePullRequestBySquashCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommentDeletedException": - case "com.amazonaws.codecommit#CommentDeletedException": - throw await de_CommentDeletedExceptionRes(parsedOutput, context); - case "CommentDoesNotExistException": - case "com.amazonaws.codecommit#CommentDoesNotExistException": - throw await de_CommentDoesNotExistExceptionRes(parsedOutput, context); - case "CommentIdRequiredException": - case "com.amazonaws.codecommit#CommentIdRequiredException": - throw await de_CommentIdRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidCommentIdException": - case "com.amazonaws.codecommit#InvalidCommentIdException": - throw await de_InvalidCommentIdExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1GetCommentReactionsCommand + * deserializeAws_json1_1MergePullRequestByThreeWayCommand */ -export const de_GetCommentReactionsCommand = async ( +export const de_MergePullRequestByThreeWayCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetCommentReactionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetCommentReactionsCommandOutput = { + contents = de_MergePullRequestByThreeWayOutput(data, context); + const response: MergePullRequestByThreeWayCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3892,63 +2709,36 @@ export const de_GetCommentReactionsCommand = async ( }; /** - * deserializeAws_json1_1GetCommentReactionsCommandError + * deserializeAws_json1_1OverridePullRequestApprovalRulesCommand */ -const de_GetCommentReactionsCommandError = async ( +export const de_OverridePullRequestApprovalRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommentDeletedException": - case "com.amazonaws.codecommit#CommentDeletedException": - throw await de_CommentDeletedExceptionRes(parsedOutput, context); - case "CommentDoesNotExistException": - case "com.amazonaws.codecommit#CommentDoesNotExistException": - throw await de_CommentDoesNotExistExceptionRes(parsedOutput, context); - case "CommentIdRequiredException": - case "com.amazonaws.codecommit#CommentIdRequiredException": - throw await de_CommentIdRequiredExceptionRes(parsedOutput, context); - case "InvalidCommentIdException": - case "com.amazonaws.codecommit#InvalidCommentIdException": - throw await de_InvalidCommentIdExceptionRes(parsedOutput, context); - case "InvalidContinuationTokenException": - case "com.amazonaws.codecommit#InvalidContinuationTokenException": - throw await de_InvalidContinuationTokenExceptionRes(parsedOutput, context); - case "InvalidMaxResultsException": - case "com.amazonaws.codecommit#InvalidMaxResultsException": - throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); - case "InvalidReactionUserArnException": - case "com.amazonaws.codecommit#InvalidReactionUserArnException": - throw await de_InvalidReactionUserArnExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: OverridePullRequestApprovalRulesCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1GetCommentsForComparedCommitCommand + * deserializeAws_json1_1PostCommentForComparedCommitCommand */ -export const de_GetCommentsForComparedCommitCommand = async ( +export const de_PostCommentForComparedCommitCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetCommentsForComparedCommitCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetCommentsForComparedCommitOutput(data, context); - const response: GetCommentsForComparedCommitCommandOutput = { + contents = de_PostCommentForComparedCommitOutput(data, context); + const response: PostCommentForComparedCommitCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3956,81 +2746,39 @@ export const de_GetCommentsForComparedCommitCommand = async ( }; /** - * deserializeAws_json1_1GetCommentsForComparedCommitCommandError + * deserializeAws_json1_1PostCommentForPullRequestCommand */ -const de_GetCommentsForComparedCommitCommandError = async ( +export const de_PostCommentForPullRequestCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitIdRequiredException": - case "com.amazonaws.codecommit#CommitIdRequiredException": - throw await de_CommitIdRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidCommitIdException": - case "com.amazonaws.codecommit#InvalidCommitIdException": - throw await de_InvalidCommitIdExceptionRes(parsedOutput, context); - case "InvalidContinuationTokenException": - case "com.amazonaws.codecommit#InvalidContinuationTokenException": - throw await de_InvalidContinuationTokenExceptionRes(parsedOutput, context); - case "InvalidMaxResultsException": - case "com.amazonaws.codecommit#InvalidMaxResultsException": - throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_PostCommentForPullRequestOutput(data, context); + const response: PostCommentForPullRequestCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetCommentsForPullRequestCommand + * deserializeAws_json1_1PostCommentReplyCommand */ -export const de_GetCommentsForPullRequestCommand = async ( +export const de_PostCommentReplyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetCommentsForPullRequestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetCommentsForPullRequestOutput(data, context); - const response: GetCommentsForPullRequestCommandOutput = { + contents = de_PostCommentReplyOutput(data, context); + const response: PostCommentReplyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4038,93 +2786,36 @@ export const de_GetCommentsForPullRequestCommand = async ( }; /** - * deserializeAws_json1_1GetCommentsForPullRequestCommandError + * deserializeAws_json1_1PutCommentReactionCommand */ -const de_GetCommentsForPullRequestCommandError = async ( +export const de_PutCommentReactionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitIdRequiredException": - case "com.amazonaws.codecommit#CommitIdRequiredException": - throw await de_CommitIdRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidCommitIdException": - case "com.amazonaws.codecommit#InvalidCommitIdException": - throw await de_InvalidCommitIdExceptionRes(parsedOutput, context); - case "InvalidContinuationTokenException": - case "com.amazonaws.codecommit#InvalidContinuationTokenException": - throw await de_InvalidContinuationTokenExceptionRes(parsedOutput, context); - case "InvalidMaxResultsException": - case "com.amazonaws.codecommit#InvalidMaxResultsException": - throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "RepositoryNotAssociatedWithPullRequestException": - case "com.amazonaws.codecommit#RepositoryNotAssociatedWithPullRequestException": - throw await de_RepositoryNotAssociatedWithPullRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: PutCommentReactionCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1GetCommitCommand + * deserializeAws_json1_1PutFileCommand */ -export const de_GetCommitCommand = async ( +export const de_PutFileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetCommitCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetCommitCommandOutput = { + const response: PutFileCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4132,75 +2823,56 @@ export const de_GetCommitCommand = async ( }; /** - * deserializeAws_json1_1GetCommitCommandError + * deserializeAws_json1_1PutRepositoryTriggersCommand */ -const de_GetCommitCommandError = async ( +export const de_PutRepositoryTriggersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommitIdDoesNotExistException": - case "com.amazonaws.codecommit#CommitIdDoesNotExistException": - throw await de_CommitIdDoesNotExistExceptionRes(parsedOutput, context); - case "CommitIdRequiredException": - case "com.amazonaws.codecommit#CommitIdRequiredException": - throw await de_CommitIdRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidCommitIdException": - case "com.amazonaws.codecommit#InvalidCommitIdException": - throw await de_InvalidCommitIdExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutRepositoryTriggersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetDifferencesCommand + * deserializeAws_json1_1TagResourceCommand */ -export const de_GetDifferencesCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_json1_1TestRepositoryTriggersCommand + */ +export const de_TestRepositoryTriggersCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { if (output.statusCode >= 300) { - return de_GetDifferencesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetDifferencesCommandOutput = { + const response: TestRepositoryTriggersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4208,90 +2880,36 @@ export const de_GetDifferencesCommand = async ( }; /** - * deserializeAws_json1_1GetDifferencesCommandError + * deserializeAws_json1_1UntagResourceCommand */ -const de_GetDifferencesCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitRequiredException": - case "com.amazonaws.codecommit#CommitRequiredException": - throw await de_CommitRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidCommitException": - case "com.amazonaws.codecommit#InvalidCommitException": - throw await de_InvalidCommitExceptionRes(parsedOutput, context); - case "InvalidCommitIdException": - case "com.amazonaws.codecommit#InvalidCommitIdException": - throw await de_InvalidCommitIdExceptionRes(parsedOutput, context); - case "InvalidContinuationTokenException": - case "com.amazonaws.codecommit#InvalidContinuationTokenException": - throw await de_InvalidContinuationTokenExceptionRes(parsedOutput, context); - case "InvalidMaxResultsException": - case "com.amazonaws.codecommit#InvalidMaxResultsException": - throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); - case "InvalidPathException": - case "com.amazonaws.codecommit#InvalidPathException": - throw await de_InvalidPathExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "PathDoesNotExistException": - case "com.amazonaws.codecommit#PathDoesNotExistException": - throw await de_PathDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1GetFileCommand + * deserializeAws_json1_1UpdateApprovalRuleTemplateContentCommand */ -export const de_GetFileCommand = async ( +export const de_UpdateApprovalRuleTemplateContentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetFileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetFileOutput(data, context); - const response: GetFileCommandOutput = { + contents = de_UpdateApprovalRuleTemplateContentOutput(data, context); + const response: UpdateApprovalRuleTemplateContentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4299,84 +2917,59 @@ export const de_GetFileCommand = async ( }; /** - * deserializeAws_json1_1GetFileCommandError + * deserializeAws_json1_1UpdateApprovalRuleTemplateDescriptionCommand */ -const de_GetFileCommandError = async ( +export const de_UpdateApprovalRuleTemplateDescriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateApprovalRuleTemplateDescriptionOutput(data, context); + const response: UpdateApprovalRuleTemplateDescriptionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "FileDoesNotExistException": - case "com.amazonaws.codecommit#FileDoesNotExistException": - throw await de_FileDoesNotExistExceptionRes(parsedOutput, context); - case "FileTooLargeException": - case "com.amazonaws.codecommit#FileTooLargeException": - throw await de_FileTooLargeExceptionRes(parsedOutput, context); - case "InvalidCommitException": - case "com.amazonaws.codecommit#InvalidCommitException": - throw await de_InvalidCommitExceptionRes(parsedOutput, context); - case "InvalidPathException": - case "com.amazonaws.codecommit#InvalidPathException": - throw await de_InvalidPathExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "PathRequiredException": - case "com.amazonaws.codecommit#PathRequiredException": - throw await de_PathRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1UpdateApprovalRuleTemplateNameCommand + */ +export const de_UpdateApprovalRuleTemplateNameCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateApprovalRuleTemplateNameOutput(data, context); + const response: UpdateApprovalRuleTemplateNameCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetFolderCommand + * deserializeAws_json1_1UpdateCommentCommand */ -export const de_GetFolderCommand = async ( +export const de_UpdateCommentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetFolderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetFolderCommandOutput = { + contents = de_UpdateCommentOutput(data, context); + const response: UpdateCommentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4384,81 +2977,73 @@ export const de_GetFolderCommand = async ( }; /** - * deserializeAws_json1_1GetFolderCommandError + * deserializeAws_json1_1UpdateDefaultBranchCommand */ -const de_GetFolderCommandError = async ( +export const de_UpdateDefaultBranchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: UpdateDefaultBranchCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "FolderDoesNotExistException": - case "com.amazonaws.codecommit#FolderDoesNotExistException": - throw await de_FolderDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidCommitException": - case "com.amazonaws.codecommit#InvalidCommitException": - throw await de_InvalidCommitExceptionRes(parsedOutput, context); - case "InvalidPathException": - case "com.amazonaws.codecommit#InvalidPathException": - throw await de_InvalidPathExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "PathRequiredException": - case "com.amazonaws.codecommit#PathRequiredException": - throw await de_PathRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1UpdatePullRequestApprovalRuleContentCommand + */ +export const de_UpdatePullRequestApprovalRuleContentCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdatePullRequestApprovalRuleContentOutput(data, context); + const response: UpdatePullRequestApprovalRuleContentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1UpdatePullRequestApprovalStateCommand + */ +export const de_UpdatePullRequestApprovalStateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UpdatePullRequestApprovalStateCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1GetMergeCommitCommand + * deserializeAws_json1_1UpdatePullRequestDescriptionCommand */ -export const de_GetMergeCommitCommand = async ( +export const de_UpdatePullRequestDescriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetMergeCommitCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetMergeCommitCommandOutput = { + contents = de_UpdatePullRequestDescriptionOutput(data, context); + const response: UpdatePullRequestDescriptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4466,81 +3051,76 @@ export const de_GetMergeCommitCommand = async ( }; /** - * deserializeAws_json1_1GetMergeCommitCommandError + * deserializeAws_json1_1UpdatePullRequestStatusCommand */ -const de_GetMergeCommitCommandError = async ( +export const de_UpdatePullRequestStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdatePullRequestStatusOutput(data, context); + const response: UpdatePullRequestStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitRequiredException": - case "com.amazonaws.codecommit#CommitRequiredException": - throw await de_CommitRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidCommitException": - case "com.amazonaws.codecommit#InvalidCommitException": - throw await de_InvalidCommitExceptionRes(parsedOutput, context); - case "InvalidConflictDetailLevelException": - case "com.amazonaws.codecommit#InvalidConflictDetailLevelException": - throw await de_InvalidConflictDetailLevelExceptionRes(parsedOutput, context); - case "InvalidConflictResolutionStrategyException": - case "com.amazonaws.codecommit#InvalidConflictResolutionStrategyException": - throw await de_InvalidConflictResolutionStrategyExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1UpdatePullRequestTitleCommand + */ +export const de_UpdatePullRequestTitleCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdatePullRequestTitleOutput(data, context); + const response: UpdatePullRequestTitleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetMergeConflictsCommand + * deserializeAws_json1_1UpdateRepositoryDescriptionCommand */ -export const de_GetMergeConflictsCommand = async ( +export const de_UpdateRepositoryDescriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: UpdateRepositoryDescriptionCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_json1_1UpdateRepositoryEncryptionKeyCommand + */ +export const de_UpdateRepositoryEncryptionKeyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { if (output.statusCode >= 300) { - return de_GetMergeConflictsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetMergeConflictsCommandOutput = { + const response: UpdateRepositoryEncryptionKeyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4548,24 +3128,38 @@ export const de_GetMergeConflictsCommand = async ( }; /** - * deserializeAws_json1_1GetMergeConflictsCommandError + * deserializeAws_json1_1UpdateRepositoryNameCommand */ -const de_GetMergeConflictsCommandError = async ( +export const de_UpdateRepositoryNameCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: UpdateRepositoryNameCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserialize_Aws_json1_1CommandError + */ +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitRequiredException": - case "com.amazonaws.codecommit#CommitRequiredException": - throw await de_CommitRequiredExceptionRes(parsedOutput, context); + case "ApprovalRuleTemplateDoesNotExistException": + case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": + throw await de_ApprovalRuleTemplateDoesNotExistExceptionRes(parsedOutput, context); + case "ApprovalRuleTemplateNameRequiredException": + case "com.amazonaws.codecommit#ApprovalRuleTemplateNameRequiredException": + throw await de_ApprovalRuleTemplateNameRequiredExceptionRes(parsedOutput, context); case "EncryptionIntegrityChecksFailedException": case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); @@ -4581,6 +3175,33 @@ const de_GetMergeConflictsCommandError = async ( case "EncryptionKeyUnavailableException": case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); + case "InvalidApprovalRuleTemplateNameException": + case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateNameException": + throw await de_InvalidApprovalRuleTemplateNameExceptionRes(parsedOutput, context); + case "InvalidRepositoryNameException": + case "com.amazonaws.codecommit#InvalidRepositoryNameException": + throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); + case "MaximumRuleTemplatesAssociatedWithRepositoryException": + case "com.amazonaws.codecommit#MaximumRuleTemplatesAssociatedWithRepositoryException": + throw await de_MaximumRuleTemplatesAssociatedWithRepositoryExceptionRes(parsedOutput, context); + case "RepositoryDoesNotExistException": + case "com.amazonaws.codecommit#RepositoryDoesNotExistException": + throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); + case "RepositoryNameRequiredException": + case "com.amazonaws.codecommit#RepositoryNameRequiredException": + throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); + case "MaximumRepositoryNamesExceededException": + case "com.amazonaws.codecommit#MaximumRepositoryNamesExceededException": + throw await de_MaximumRepositoryNamesExceededExceptionRes(parsedOutput, context); + case "RepositoryNamesRequiredException": + case "com.amazonaws.codecommit#RepositoryNamesRequiredException": + throw await de_RepositoryNamesRequiredExceptionRes(parsedOutput, context); + case "CommitDoesNotExistException": + case "com.amazonaws.codecommit#CommitDoesNotExistException": + throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); + case "CommitRequiredException": + case "com.amazonaws.codecommit#CommitRequiredException": + throw await de_CommitRequiredExceptionRes(parsedOutput, context); case "InvalidCommitException": case "com.amazonaws.codecommit#InvalidCommitException": throw await de_InvalidCommitExceptionRes(parsedOutput, context); @@ -4593,21 +3214,15 @@ const de_GetMergeConflictsCommandError = async ( case "InvalidContinuationTokenException": case "com.amazonaws.codecommit#InvalidContinuationTokenException": throw await de_InvalidContinuationTokenExceptionRes(parsedOutput, context); - case "InvalidDestinationCommitSpecifierException": - case "com.amazonaws.codecommit#InvalidDestinationCommitSpecifierException": - throw await de_InvalidDestinationCommitSpecifierExceptionRes(parsedOutput, context); case "InvalidMaxConflictFilesException": case "com.amazonaws.codecommit#InvalidMaxConflictFilesException": throw await de_InvalidMaxConflictFilesExceptionRes(parsedOutput, context); + case "InvalidMaxMergeHunksException": + case "com.amazonaws.codecommit#InvalidMaxMergeHunksException": + throw await de_InvalidMaxMergeHunksExceptionRes(parsedOutput, context); case "InvalidMergeOptionException": case "com.amazonaws.codecommit#InvalidMergeOptionException": throw await de_InvalidMergeOptionExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "InvalidSourceCommitSpecifierException": - case "com.amazonaws.codecommit#InvalidSourceCommitSpecifierException": - throw await de_InvalidSourceCommitSpecifierExceptionRes(parsedOutput, context); case "MaximumFileContentToLoadExceededException": case "com.amazonaws.codecommit#MaximumFileContentToLoadExceededException": throw await de_MaximumFileContentToLoadExceededExceptionRes(parsedOutput, context); @@ -4617,3638 +3232,499 @@ const de_GetMergeConflictsCommandError = async ( case "MergeOptionRequiredException": case "com.amazonaws.codecommit#MergeOptionRequiredException": throw await de_MergeOptionRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "TipsDivergenceExceededException": - case "com.amazonaws.codecommit#TipsDivergenceExceededException": - throw await de_TipsDivergenceExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetMergeOptionsCommand - */ -export const de_GetMergeOptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetMergeOptionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetMergeOptionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetMergeOptionsCommandError - */ -const de_GetMergeOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitRequiredException": - case "com.amazonaws.codecommit#CommitRequiredException": - throw await de_CommitRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidCommitException": - case "com.amazonaws.codecommit#InvalidCommitException": - throw await de_InvalidCommitExceptionRes(parsedOutput, context); - case "InvalidConflictDetailLevelException": - case "com.amazonaws.codecommit#InvalidConflictDetailLevelException": - throw await de_InvalidConflictDetailLevelExceptionRes(parsedOutput, context); - case "InvalidConflictResolutionStrategyException": - case "com.amazonaws.codecommit#InvalidConflictResolutionStrategyException": - throw await de_InvalidConflictResolutionStrategyExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "MaximumFileContentToLoadExceededException": - case "com.amazonaws.codecommit#MaximumFileContentToLoadExceededException": - throw await de_MaximumFileContentToLoadExceededExceptionRes(parsedOutput, context); - case "MaximumItemsToCompareExceededException": - case "com.amazonaws.codecommit#MaximumItemsToCompareExceededException": - throw await de_MaximumItemsToCompareExceededExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); case "TipsDivergenceExceededException": case "com.amazonaws.codecommit#TipsDivergenceExceededException": throw await de_TipsDivergenceExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetPullRequestCommand - */ -export const de_GetPullRequestCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetPullRequestCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetPullRequestOutput(data, context); - const response: GetPullRequestCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetPullRequestCommandError - */ -const de_GetPullRequestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetPullRequestApprovalStatesCommand - */ -export const de_GetPullRequestApprovalStatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetPullRequestApprovalStatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetPullRequestApprovalStatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetPullRequestApprovalStatesCommandError - */ -const de_GetPullRequestApprovalStatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "InvalidRevisionIdException": - case "com.amazonaws.codecommit#InvalidRevisionIdException": - throw await de_InvalidRevisionIdExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - case "RevisionIdRequiredException": - case "com.amazonaws.codecommit#RevisionIdRequiredException": - throw await de_RevisionIdRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetPullRequestOverrideStateCommand - */ -export const de_GetPullRequestOverrideStateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetPullRequestOverrideStateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetPullRequestOverrideStateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetPullRequestOverrideStateCommandError - */ -const de_GetPullRequestOverrideStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); + case "CommitIdsLimitExceededException": + case "com.amazonaws.codecommit#CommitIdsLimitExceededException": + throw await de_CommitIdsLimitExceededExceptionRes(parsedOutput, context); + case "CommitIdsListRequiredException": + case "com.amazonaws.codecommit#CommitIdsListRequiredException": + throw await de_CommitIdsListRequiredExceptionRes(parsedOutput, context); + case "ApprovalRuleTemplateContentRequiredException": + case "com.amazonaws.codecommit#ApprovalRuleTemplateContentRequiredException": + throw await de_ApprovalRuleTemplateContentRequiredExceptionRes(parsedOutput, context); + case "ApprovalRuleTemplateNameAlreadyExistsException": + case "com.amazonaws.codecommit#ApprovalRuleTemplateNameAlreadyExistsException": + throw await de_ApprovalRuleTemplateNameAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidApprovalRuleTemplateContentException": + case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateContentException": + throw await de_InvalidApprovalRuleTemplateContentExceptionRes(parsedOutput, context); + case "InvalidApprovalRuleTemplateDescriptionException": + case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateDescriptionException": + throw await de_InvalidApprovalRuleTemplateDescriptionExceptionRes(parsedOutput, context); + case "NumberOfRuleTemplatesExceededException": + case "com.amazonaws.codecommit#NumberOfRuleTemplatesExceededException": + throw await de_NumberOfRuleTemplatesExceededExceptionRes(parsedOutput, context); + case "BranchNameExistsException": + case "com.amazonaws.codecommit#BranchNameExistsException": + throw await de_BranchNameExistsExceptionRes(parsedOutput, context); + case "BranchNameRequiredException": + case "com.amazonaws.codecommit#BranchNameRequiredException": + throw await de_BranchNameRequiredExceptionRes(parsedOutput, context); + case "CommitIdRequiredException": + case "com.amazonaws.codecommit#CommitIdRequiredException": + throw await de_CommitIdRequiredExceptionRes(parsedOutput, context); + case "InvalidBranchNameException": + case "com.amazonaws.codecommit#InvalidBranchNameException": + throw await de_InvalidBranchNameExceptionRes(parsedOutput, context); + case "InvalidCommitIdException": + case "com.amazonaws.codecommit#InvalidCommitIdException": + throw await de_InvalidCommitIdExceptionRes(parsedOutput, context); + case "BranchDoesNotExistException": + case "com.amazonaws.codecommit#BranchDoesNotExistException": + throw await de_BranchDoesNotExistExceptionRes(parsedOutput, context); + case "BranchNameIsTagNameException": + case "com.amazonaws.codecommit#BranchNameIsTagNameException": + throw await de_BranchNameIsTagNameExceptionRes(parsedOutput, context); + case "CommitMessageLengthExceededException": + case "com.amazonaws.codecommit#CommitMessageLengthExceededException": + throw await de_CommitMessageLengthExceededExceptionRes(parsedOutput, context); + case "DirectoryNameConflictsWithFileNameException": + case "com.amazonaws.codecommit#DirectoryNameConflictsWithFileNameException": + throw await de_DirectoryNameConflictsWithFileNameExceptionRes(parsedOutput, context); + case "FileContentAndSourceFileSpecifiedException": + case "com.amazonaws.codecommit#FileContentAndSourceFileSpecifiedException": + throw await de_FileContentAndSourceFileSpecifiedExceptionRes(parsedOutput, context); + case "FileContentSizeLimitExceededException": + case "com.amazonaws.codecommit#FileContentSizeLimitExceededException": + throw await de_FileContentSizeLimitExceededExceptionRes(parsedOutput, context); + case "FileDoesNotExistException": + case "com.amazonaws.codecommit#FileDoesNotExistException": + throw await de_FileDoesNotExistExceptionRes(parsedOutput, context); + case "FileEntryRequiredException": + case "com.amazonaws.codecommit#FileEntryRequiredException": + throw await de_FileEntryRequiredExceptionRes(parsedOutput, context); + case "FileModeRequiredException": + case "com.amazonaws.codecommit#FileModeRequiredException": + throw await de_FileModeRequiredExceptionRes(parsedOutput, context); + case "FileNameConflictsWithDirectoryNameException": + case "com.amazonaws.codecommit#FileNameConflictsWithDirectoryNameException": + throw await de_FileNameConflictsWithDirectoryNameExceptionRes(parsedOutput, context); + case "FilePathConflictsWithSubmodulePathException": + case "com.amazonaws.codecommit#FilePathConflictsWithSubmodulePathException": + throw await de_FilePathConflictsWithSubmodulePathExceptionRes(parsedOutput, context); + case "FolderContentSizeLimitExceededException": + case "com.amazonaws.codecommit#FolderContentSizeLimitExceededException": + throw await de_FolderContentSizeLimitExceededExceptionRes(parsedOutput, context); + case "InvalidDeletionParameterException": + case "com.amazonaws.codecommit#InvalidDeletionParameterException": + throw await de_InvalidDeletionParameterExceptionRes(parsedOutput, context); + case "InvalidEmailException": + case "com.amazonaws.codecommit#InvalidEmailException": + throw await de_InvalidEmailExceptionRes(parsedOutput, context); + case "InvalidFileModeException": + case "com.amazonaws.codecommit#InvalidFileModeException": + throw await de_InvalidFileModeExceptionRes(parsedOutput, context); + case "InvalidParentCommitIdException": + case "com.amazonaws.codecommit#InvalidParentCommitIdException": + throw await de_InvalidParentCommitIdExceptionRes(parsedOutput, context); + case "InvalidPathException": + case "com.amazonaws.codecommit#InvalidPathException": + throw await de_InvalidPathExceptionRes(parsedOutput, context); + case "MaximumFileEntriesExceededException": + case "com.amazonaws.codecommit#MaximumFileEntriesExceededException": + throw await de_MaximumFileEntriesExceededExceptionRes(parsedOutput, context); + case "NameLengthExceededException": + case "com.amazonaws.codecommit#NameLengthExceededException": + throw await de_NameLengthExceededExceptionRes(parsedOutput, context); + case "NoChangeException": + case "com.amazonaws.codecommit#NoChangeException": + throw await de_NoChangeExceptionRes(parsedOutput, context); + case "ParentCommitDoesNotExistException": + case "com.amazonaws.codecommit#ParentCommitDoesNotExistException": + throw await de_ParentCommitDoesNotExistExceptionRes(parsedOutput, context); + case "ParentCommitIdOutdatedException": + case "com.amazonaws.codecommit#ParentCommitIdOutdatedException": + throw await de_ParentCommitIdOutdatedExceptionRes(parsedOutput, context); + case "ParentCommitIdRequiredException": + case "com.amazonaws.codecommit#ParentCommitIdRequiredException": + throw await de_ParentCommitIdRequiredExceptionRes(parsedOutput, context); + case "PathRequiredException": + case "com.amazonaws.codecommit#PathRequiredException": + throw await de_PathRequiredExceptionRes(parsedOutput, context); + case "PutFileEntryConflictException": + case "com.amazonaws.codecommit#PutFileEntryConflictException": + throw await de_PutFileEntryConflictExceptionRes(parsedOutput, context); + case "RestrictedSourceFileException": + case "com.amazonaws.codecommit#RestrictedSourceFileException": + throw await de_RestrictedSourceFileExceptionRes(parsedOutput, context); + case "SamePathRequestException": + case "com.amazonaws.codecommit#SamePathRequestException": + throw await de_SamePathRequestExceptionRes(parsedOutput, context); + case "SourceFileOrContentRequiredException": + case "com.amazonaws.codecommit#SourceFileOrContentRequiredException": + throw await de_SourceFileOrContentRequiredExceptionRes(parsedOutput, context); + case "ClientRequestTokenRequiredException": + case "com.amazonaws.codecommit#ClientRequestTokenRequiredException": + throw await de_ClientRequestTokenRequiredExceptionRes(parsedOutput, context); + case "IdempotencyParameterMismatchException": + case "com.amazonaws.codecommit#IdempotencyParameterMismatchException": + throw await de_IdempotencyParameterMismatchExceptionRes(parsedOutput, context); + case "InvalidClientRequestTokenException": + case "com.amazonaws.codecommit#InvalidClientRequestTokenException": + throw await de_InvalidClientRequestTokenExceptionRes(parsedOutput, context); + case "InvalidDescriptionException": + case "com.amazonaws.codecommit#InvalidDescriptionException": + throw await de_InvalidDescriptionExceptionRes(parsedOutput, context); + case "InvalidReferenceNameException": + case "com.amazonaws.codecommit#InvalidReferenceNameException": + throw await de_InvalidReferenceNameExceptionRes(parsedOutput, context); + case "InvalidTargetException": + case "com.amazonaws.codecommit#InvalidTargetException": + throw await de_InvalidTargetExceptionRes(parsedOutput, context); + case "InvalidTargetsException": + case "com.amazonaws.codecommit#InvalidTargetsException": + throw await de_InvalidTargetsExceptionRes(parsedOutput, context); + case "InvalidTitleException": + case "com.amazonaws.codecommit#InvalidTitleException": + throw await de_InvalidTitleExceptionRes(parsedOutput, context); + case "MaximumOpenPullRequestsExceededException": + case "com.amazonaws.codecommit#MaximumOpenPullRequestsExceededException": + throw await de_MaximumOpenPullRequestsExceededExceptionRes(parsedOutput, context); + case "MultipleRepositoriesInPullRequestException": + case "com.amazonaws.codecommit#MultipleRepositoriesInPullRequestException": + throw await de_MultipleRepositoriesInPullRequestExceptionRes(parsedOutput, context); + case "ReferenceDoesNotExistException": + case "com.amazonaws.codecommit#ReferenceDoesNotExistException": + throw await de_ReferenceDoesNotExistExceptionRes(parsedOutput, context); + case "ReferenceNameRequiredException": + case "com.amazonaws.codecommit#ReferenceNameRequiredException": + throw await de_ReferenceNameRequiredExceptionRes(parsedOutput, context); + case "ReferenceTypeNotSupportedException": + case "com.amazonaws.codecommit#ReferenceTypeNotSupportedException": + throw await de_ReferenceTypeNotSupportedExceptionRes(parsedOutput, context); + case "SourceAndDestinationAreSameException": + case "com.amazonaws.codecommit#SourceAndDestinationAreSameException": + throw await de_SourceAndDestinationAreSameExceptionRes(parsedOutput, context); + case "TargetRequiredException": + case "com.amazonaws.codecommit#TargetRequiredException": + throw await de_TargetRequiredExceptionRes(parsedOutput, context); + case "TargetsRequiredException": + case "com.amazonaws.codecommit#TargetsRequiredException": + throw await de_TargetsRequiredExceptionRes(parsedOutput, context); + case "TitleRequiredException": + case "com.amazonaws.codecommit#TitleRequiredException": + throw await de_TitleRequiredExceptionRes(parsedOutput, context); + case "ApprovalRuleContentRequiredException": + case "com.amazonaws.codecommit#ApprovalRuleContentRequiredException": + throw await de_ApprovalRuleContentRequiredExceptionRes(parsedOutput, context); + case "ApprovalRuleNameAlreadyExistsException": + case "com.amazonaws.codecommit#ApprovalRuleNameAlreadyExistsException": + throw await de_ApprovalRuleNameAlreadyExistsExceptionRes(parsedOutput, context); + case "ApprovalRuleNameRequiredException": + case "com.amazonaws.codecommit#ApprovalRuleNameRequiredException": + throw await de_ApprovalRuleNameRequiredExceptionRes(parsedOutput, context); + case "InvalidApprovalRuleContentException": + case "com.amazonaws.codecommit#InvalidApprovalRuleContentException": + throw await de_InvalidApprovalRuleContentExceptionRes(parsedOutput, context); + case "InvalidApprovalRuleNameException": + case "com.amazonaws.codecommit#InvalidApprovalRuleNameException": + throw await de_InvalidApprovalRuleNameExceptionRes(parsedOutput, context); case "InvalidPullRequestIdException": case "com.amazonaws.codecommit#InvalidPullRequestIdException": throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "InvalidRevisionIdException": - case "com.amazonaws.codecommit#InvalidRevisionIdException": - throw await de_InvalidRevisionIdExceptionRes(parsedOutput, context); + case "NumberOfRulesExceededException": + case "com.amazonaws.codecommit#NumberOfRulesExceededException": + throw await de_NumberOfRulesExceededExceptionRes(parsedOutput, context); + case "PullRequestAlreadyClosedException": + case "com.amazonaws.codecommit#PullRequestAlreadyClosedException": + throw await de_PullRequestAlreadyClosedExceptionRes(parsedOutput, context); case "PullRequestDoesNotExistException": case "com.amazonaws.codecommit#PullRequestDoesNotExistException": throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); case "PullRequestIdRequiredException": case "com.amazonaws.codecommit#PullRequestIdRequiredException": throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - case "RevisionIdRequiredException": - case "com.amazonaws.codecommit#RevisionIdRequiredException": - throw await de_RevisionIdRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRepositoryCommand - */ -export const de_GetRepositoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRepositoryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetRepositoryOutput(data, context); - const response: GetRepositoryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRepositoryCommandError - */ -const de_GetRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRepositoryTriggersCommand - */ -export const de_GetRepositoryTriggersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRepositoryTriggersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetRepositoryTriggersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRepositoryTriggersCommandError - */ -const de_GetRepositoryTriggersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListApprovalRuleTemplatesCommand - */ -export const de_ListApprovalRuleTemplatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListApprovalRuleTemplatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListApprovalRuleTemplatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListApprovalRuleTemplatesCommandError - */ -const de_ListApprovalRuleTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidContinuationTokenException": - case "com.amazonaws.codecommit#InvalidContinuationTokenException": - throw await de_InvalidContinuationTokenExceptionRes(parsedOutput, context); + case "EncryptionKeyInvalidIdException": + case "com.amazonaws.codecommit#EncryptionKeyInvalidIdException": + throw await de_EncryptionKeyInvalidIdExceptionRes(parsedOutput, context); + case "EncryptionKeyInvalidUsageException": + case "com.amazonaws.codecommit#EncryptionKeyInvalidUsageException": + throw await de_EncryptionKeyInvalidUsageExceptionRes(parsedOutput, context); + case "InvalidRepositoryDescriptionException": + case "com.amazonaws.codecommit#InvalidRepositoryDescriptionException": + throw await de_InvalidRepositoryDescriptionExceptionRes(parsedOutput, context); + case "InvalidSystemTagUsageException": + case "com.amazonaws.codecommit#InvalidSystemTagUsageException": + throw await de_InvalidSystemTagUsageExceptionRes(parsedOutput, context); + case "InvalidTagsMapException": + case "com.amazonaws.codecommit#InvalidTagsMapException": + throw await de_InvalidTagsMapExceptionRes(parsedOutput, context); + case "RepositoryLimitExceededException": + case "com.amazonaws.codecommit#RepositoryLimitExceededException": + throw await de_RepositoryLimitExceededExceptionRes(parsedOutput, context); + case "RepositoryNameExistsException": + case "com.amazonaws.codecommit#RepositoryNameExistsException": + throw await de_RepositoryNameExistsExceptionRes(parsedOutput, context); + case "TagPolicyException": + case "com.amazonaws.codecommit#TagPolicyException": + throw await de_TagPolicyExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.codecommit#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "ConcurrentReferenceUpdateException": + case "com.amazonaws.codecommit#ConcurrentReferenceUpdateException": + throw await de_ConcurrentReferenceUpdateExceptionRes(parsedOutput, context); + case "InvalidConflictResolutionException": + case "com.amazonaws.codecommit#InvalidConflictResolutionException": + throw await de_InvalidConflictResolutionExceptionRes(parsedOutput, context); + case "InvalidReplacementContentException": + case "com.amazonaws.codecommit#InvalidReplacementContentException": + throw await de_InvalidReplacementContentExceptionRes(parsedOutput, context); + case "InvalidReplacementTypeException": + case "com.amazonaws.codecommit#InvalidReplacementTypeException": + throw await de_InvalidReplacementTypeExceptionRes(parsedOutput, context); + case "ManualMergeRequiredException": + case "com.amazonaws.codecommit#ManualMergeRequiredException": + throw await de_ManualMergeRequiredExceptionRes(parsedOutput, context); + case "MaximumConflictResolutionEntriesExceededException": + case "com.amazonaws.codecommit#MaximumConflictResolutionEntriesExceededException": + throw await de_MaximumConflictResolutionEntriesExceededExceptionRes(parsedOutput, context); + case "MultipleConflictResolutionEntriesException": + case "com.amazonaws.codecommit#MultipleConflictResolutionEntriesException": + throw await de_MultipleConflictResolutionEntriesExceptionRes(parsedOutput, context); + case "ReplacementContentRequiredException": + case "com.amazonaws.codecommit#ReplacementContentRequiredException": + throw await de_ReplacementContentRequiredExceptionRes(parsedOutput, context); + case "ReplacementTypeRequiredException": + case "com.amazonaws.codecommit#ReplacementTypeRequiredException": + throw await de_ReplacementTypeRequiredExceptionRes(parsedOutput, context); + case "ApprovalRuleTemplateInUseException": + case "com.amazonaws.codecommit#ApprovalRuleTemplateInUseException": + throw await de_ApprovalRuleTemplateInUseExceptionRes(parsedOutput, context); + case "DefaultBranchCannotBeDeletedException": + case "com.amazonaws.codecommit#DefaultBranchCannotBeDeletedException": + throw await de_DefaultBranchCannotBeDeletedExceptionRes(parsedOutput, context); + case "CommentDeletedException": + case "com.amazonaws.codecommit#CommentDeletedException": + throw await de_CommentDeletedExceptionRes(parsedOutput, context); + case "CommentDoesNotExistException": + case "com.amazonaws.codecommit#CommentDoesNotExistException": + throw await de_CommentDoesNotExistExceptionRes(parsedOutput, context); + case "CommentIdRequiredException": + case "com.amazonaws.codecommit#CommentIdRequiredException": + throw await de_CommentIdRequiredExceptionRes(parsedOutput, context); + case "InvalidCommentIdException": + case "com.amazonaws.codecommit#InvalidCommentIdException": + throw await de_InvalidCommentIdExceptionRes(parsedOutput, context); + case "CannotDeleteApprovalRuleFromTemplateException": + case "com.amazonaws.codecommit#CannotDeleteApprovalRuleFromTemplateException": + throw await de_CannotDeleteApprovalRuleFromTemplateExceptionRes(parsedOutput, context); + case "ActorDoesNotExistException": + case "com.amazonaws.codecommit#ActorDoesNotExistException": + throw await de_ActorDoesNotExistExceptionRes(parsedOutput, context); + case "InvalidActorArnException": + case "com.amazonaws.codecommit#InvalidActorArnException": + throw await de_InvalidActorArnExceptionRes(parsedOutput, context); case "InvalidMaxResultsException": case "com.amazonaws.codecommit#InvalidMaxResultsException": throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAssociatedApprovalRuleTemplatesForRepositoryCommand - */ -export const de_ListAssociatedApprovalRuleTemplatesForRepositoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAssociatedApprovalRuleTemplatesForRepositoryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListAssociatedApprovalRuleTemplatesForRepositoryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAssociatedApprovalRuleTemplatesForRepositoryCommandError - */ -const de_ListAssociatedApprovalRuleTemplatesForRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidContinuationTokenException": - case "com.amazonaws.codecommit#InvalidContinuationTokenException": - throw await de_InvalidContinuationTokenExceptionRes(parsedOutput, context); - case "InvalidMaxResultsException": - case "com.amazonaws.codecommit#InvalidMaxResultsException": - throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListBranchesCommand - */ -export const de_ListBranchesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListBranchesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListBranchesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListBranchesCommandError - */ -const de_ListBranchesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidContinuationTokenException": - case "com.amazonaws.codecommit#InvalidContinuationTokenException": - throw await de_InvalidContinuationTokenExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListFileCommitHistoryCommand - */ -export const de_ListFileCommitHistoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListFileCommitHistoryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListFileCommitHistoryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListFileCommitHistoryCommandError - */ -const de_ListFileCommitHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitRequiredException": - case "com.amazonaws.codecommit#CommitRequiredException": - throw await de_CommitRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidCommitException": - case "com.amazonaws.codecommit#InvalidCommitException": - throw await de_InvalidCommitExceptionRes(parsedOutput, context); - case "InvalidContinuationTokenException": - case "com.amazonaws.codecommit#InvalidContinuationTokenException": - throw await de_InvalidContinuationTokenExceptionRes(parsedOutput, context); - case "InvalidMaxResultsException": - case "com.amazonaws.codecommit#InvalidMaxResultsException": - throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "TipsDivergenceExceededException": - case "com.amazonaws.codecommit#TipsDivergenceExceededException": - throw await de_TipsDivergenceExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListPullRequestsCommand - */ -export const de_ListPullRequestsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPullRequestsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListPullRequestsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListPullRequestsCommandError - */ -const de_ListPullRequestsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorDoesNotExistException": - case "com.amazonaws.codecommit#AuthorDoesNotExistException": - throw await de_AuthorDoesNotExistExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidAuthorArnException": - case "com.amazonaws.codecommit#InvalidAuthorArnException": - throw await de_InvalidAuthorArnExceptionRes(parsedOutput, context); - case "InvalidContinuationTokenException": - case "com.amazonaws.codecommit#InvalidContinuationTokenException": - throw await de_InvalidContinuationTokenExceptionRes(parsedOutput, context); - case "InvalidMaxResultsException": - case "com.amazonaws.codecommit#InvalidMaxResultsException": - throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); - case "InvalidPullRequestStatusException": - case "com.amazonaws.codecommit#InvalidPullRequestStatusException": - throw await de_InvalidPullRequestStatusExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRepositoriesCommand - */ -export const de_ListRepositoriesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRepositoriesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListRepositoriesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRepositoriesCommandError - */ -const de_ListRepositoriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidContinuationTokenException": - case "com.amazonaws.codecommit#InvalidContinuationTokenException": - throw await de_InvalidContinuationTokenExceptionRes(parsedOutput, context); - case "InvalidOrderException": - case "com.amazonaws.codecommit#InvalidOrderException": - throw await de_InvalidOrderExceptionRes(parsedOutput, context); - case "InvalidSortByException": - case "com.amazonaws.codecommit#InvalidSortByException": - throw await de_InvalidSortByExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRepositoriesForApprovalRuleTemplateCommand - */ -export const de_ListRepositoriesForApprovalRuleTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRepositoriesForApprovalRuleTemplateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListRepositoriesForApprovalRuleTemplateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRepositoriesForApprovalRuleTemplateCommandError - */ -const de_ListRepositoriesForApprovalRuleTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApprovalRuleTemplateDoesNotExistException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": - throw await de_ApprovalRuleTemplateDoesNotExistExceptionRes(parsedOutput, context); - case "ApprovalRuleTemplateNameRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateNameRequiredException": - throw await de_ApprovalRuleTemplateNameRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleTemplateNameException": - case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateNameException": - throw await de_InvalidApprovalRuleTemplateNameExceptionRes(parsedOutput, context); - case "InvalidContinuationTokenException": - case "com.amazonaws.codecommit#InvalidContinuationTokenException": - throw await de_InvalidContinuationTokenExceptionRes(parsedOutput, context); - case "InvalidMaxResultsException": - case "com.amazonaws.codecommit#InvalidMaxResultsException": - throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "InvalidResourceArnException": - case "com.amazonaws.codecommit#InvalidResourceArnException": - throw await de_InvalidResourceArnExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "ResourceArnRequiredException": - case "com.amazonaws.codecommit#ResourceArnRequiredException": - throw await de_ResourceArnRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1MergeBranchesByFastForwardCommand - */ -export const de_MergeBranchesByFastForwardCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_MergeBranchesByFastForwardCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: MergeBranchesByFastForwardCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1MergeBranchesByFastForwardCommandError - */ -const de_MergeBranchesByFastForwardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BranchDoesNotExistException": - case "com.amazonaws.codecommit#BranchDoesNotExistException": - throw await de_BranchDoesNotExistExceptionRes(parsedOutput, context); - case "BranchNameIsTagNameException": - case "com.amazonaws.codecommit#BranchNameIsTagNameException": - throw await de_BranchNameIsTagNameExceptionRes(parsedOutput, context); - case "BranchNameRequiredException": - case "com.amazonaws.codecommit#BranchNameRequiredException": - throw await de_BranchNameRequiredExceptionRes(parsedOutput, context); - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitRequiredException": - case "com.amazonaws.codecommit#CommitRequiredException": - throw await de_CommitRequiredExceptionRes(parsedOutput, context); - case "ConcurrentReferenceUpdateException": - case "com.amazonaws.codecommit#ConcurrentReferenceUpdateException": - throw await de_ConcurrentReferenceUpdateExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidBranchNameException": - case "com.amazonaws.codecommit#InvalidBranchNameException": - throw await de_InvalidBranchNameExceptionRes(parsedOutput, context); - case "InvalidCommitException": - case "com.amazonaws.codecommit#InvalidCommitException": - throw await de_InvalidCommitExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "InvalidTargetBranchException": - case "com.amazonaws.codecommit#InvalidTargetBranchException": - throw await de_InvalidTargetBranchExceptionRes(parsedOutput, context); - case "ManualMergeRequiredException": - case "com.amazonaws.codecommit#ManualMergeRequiredException": - throw await de_ManualMergeRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "TipsDivergenceExceededException": - case "com.amazonaws.codecommit#TipsDivergenceExceededException": - throw await de_TipsDivergenceExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1MergeBranchesBySquashCommand - */ -export const de_MergeBranchesBySquashCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_MergeBranchesBySquashCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: MergeBranchesBySquashCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1MergeBranchesBySquashCommandError - */ -const de_MergeBranchesBySquashCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BranchDoesNotExistException": - case "com.amazonaws.codecommit#BranchDoesNotExistException": - throw await de_BranchDoesNotExistExceptionRes(parsedOutput, context); - case "BranchNameIsTagNameException": - case "com.amazonaws.codecommit#BranchNameIsTagNameException": - throw await de_BranchNameIsTagNameExceptionRes(parsedOutput, context); - case "BranchNameRequiredException": - case "com.amazonaws.codecommit#BranchNameRequiredException": - throw await de_BranchNameRequiredExceptionRes(parsedOutput, context); - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitMessageLengthExceededException": - case "com.amazonaws.codecommit#CommitMessageLengthExceededException": - throw await de_CommitMessageLengthExceededExceptionRes(parsedOutput, context); - case "CommitRequiredException": - case "com.amazonaws.codecommit#CommitRequiredException": - throw await de_CommitRequiredExceptionRes(parsedOutput, context); - case "ConcurrentReferenceUpdateException": - case "com.amazonaws.codecommit#ConcurrentReferenceUpdateException": - throw await de_ConcurrentReferenceUpdateExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "FileContentSizeLimitExceededException": - case "com.amazonaws.codecommit#FileContentSizeLimitExceededException": - throw await de_FileContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "FileModeRequiredException": - case "com.amazonaws.codecommit#FileModeRequiredException": - throw await de_FileModeRequiredExceptionRes(parsedOutput, context); - case "FolderContentSizeLimitExceededException": - case "com.amazonaws.codecommit#FolderContentSizeLimitExceededException": - throw await de_FolderContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "InvalidBranchNameException": - case "com.amazonaws.codecommit#InvalidBranchNameException": - throw await de_InvalidBranchNameExceptionRes(parsedOutput, context); - case "InvalidCommitException": - case "com.amazonaws.codecommit#InvalidCommitException": - throw await de_InvalidCommitExceptionRes(parsedOutput, context); - case "InvalidConflictDetailLevelException": - case "com.amazonaws.codecommit#InvalidConflictDetailLevelException": - throw await de_InvalidConflictDetailLevelExceptionRes(parsedOutput, context); - case "InvalidConflictResolutionException": - case "com.amazonaws.codecommit#InvalidConflictResolutionException": - throw await de_InvalidConflictResolutionExceptionRes(parsedOutput, context); - case "InvalidConflictResolutionStrategyException": - case "com.amazonaws.codecommit#InvalidConflictResolutionStrategyException": - throw await de_InvalidConflictResolutionStrategyExceptionRes(parsedOutput, context); - case "InvalidEmailException": - case "com.amazonaws.codecommit#InvalidEmailException": - throw await de_InvalidEmailExceptionRes(parsedOutput, context); - case "InvalidFileModeException": - case "com.amazonaws.codecommit#InvalidFileModeException": - throw await de_InvalidFileModeExceptionRes(parsedOutput, context); - case "InvalidPathException": - case "com.amazonaws.codecommit#InvalidPathException": - throw await de_InvalidPathExceptionRes(parsedOutput, context); - case "InvalidReplacementContentException": - case "com.amazonaws.codecommit#InvalidReplacementContentException": - throw await de_InvalidReplacementContentExceptionRes(parsedOutput, context); - case "InvalidReplacementTypeException": - case "com.amazonaws.codecommit#InvalidReplacementTypeException": - throw await de_InvalidReplacementTypeExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "InvalidTargetBranchException": - case "com.amazonaws.codecommit#InvalidTargetBranchException": - throw await de_InvalidTargetBranchExceptionRes(parsedOutput, context); - case "ManualMergeRequiredException": - case "com.amazonaws.codecommit#ManualMergeRequiredException": - throw await de_ManualMergeRequiredExceptionRes(parsedOutput, context); - case "MaximumConflictResolutionEntriesExceededException": - case "com.amazonaws.codecommit#MaximumConflictResolutionEntriesExceededException": - throw await de_MaximumConflictResolutionEntriesExceededExceptionRes(parsedOutput, context); - case "MaximumFileContentToLoadExceededException": - case "com.amazonaws.codecommit#MaximumFileContentToLoadExceededException": - throw await de_MaximumFileContentToLoadExceededExceptionRes(parsedOutput, context); - case "MaximumItemsToCompareExceededException": - case "com.amazonaws.codecommit#MaximumItemsToCompareExceededException": - throw await de_MaximumItemsToCompareExceededExceptionRes(parsedOutput, context); - case "MultipleConflictResolutionEntriesException": - case "com.amazonaws.codecommit#MultipleConflictResolutionEntriesException": - throw await de_MultipleConflictResolutionEntriesExceptionRes(parsedOutput, context); - case "NameLengthExceededException": - case "com.amazonaws.codecommit#NameLengthExceededException": - throw await de_NameLengthExceededExceptionRes(parsedOutput, context); - case "PathRequiredException": - case "com.amazonaws.codecommit#PathRequiredException": - throw await de_PathRequiredExceptionRes(parsedOutput, context); - case "ReplacementContentRequiredException": - case "com.amazonaws.codecommit#ReplacementContentRequiredException": - throw await de_ReplacementContentRequiredExceptionRes(parsedOutput, context); - case "ReplacementTypeRequiredException": - case "com.amazonaws.codecommit#ReplacementTypeRequiredException": - throw await de_ReplacementTypeRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "TipsDivergenceExceededException": - case "com.amazonaws.codecommit#TipsDivergenceExceededException": - throw await de_TipsDivergenceExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1MergeBranchesByThreeWayCommand - */ -export const de_MergeBranchesByThreeWayCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_MergeBranchesByThreeWayCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: MergeBranchesByThreeWayCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1MergeBranchesByThreeWayCommandError - */ -const de_MergeBranchesByThreeWayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BranchDoesNotExistException": - case "com.amazonaws.codecommit#BranchDoesNotExistException": - throw await de_BranchDoesNotExistExceptionRes(parsedOutput, context); - case "BranchNameIsTagNameException": - case "com.amazonaws.codecommit#BranchNameIsTagNameException": - throw await de_BranchNameIsTagNameExceptionRes(parsedOutput, context); - case "BranchNameRequiredException": - case "com.amazonaws.codecommit#BranchNameRequiredException": - throw await de_BranchNameRequiredExceptionRes(parsedOutput, context); - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitMessageLengthExceededException": - case "com.amazonaws.codecommit#CommitMessageLengthExceededException": - throw await de_CommitMessageLengthExceededExceptionRes(parsedOutput, context); - case "CommitRequiredException": - case "com.amazonaws.codecommit#CommitRequiredException": - throw await de_CommitRequiredExceptionRes(parsedOutput, context); - case "ConcurrentReferenceUpdateException": - case "com.amazonaws.codecommit#ConcurrentReferenceUpdateException": - throw await de_ConcurrentReferenceUpdateExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "FileContentSizeLimitExceededException": - case "com.amazonaws.codecommit#FileContentSizeLimitExceededException": - throw await de_FileContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "FileModeRequiredException": - case "com.amazonaws.codecommit#FileModeRequiredException": - throw await de_FileModeRequiredExceptionRes(parsedOutput, context); - case "FolderContentSizeLimitExceededException": - case "com.amazonaws.codecommit#FolderContentSizeLimitExceededException": - throw await de_FolderContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "InvalidBranchNameException": - case "com.amazonaws.codecommit#InvalidBranchNameException": - throw await de_InvalidBranchNameExceptionRes(parsedOutput, context); - case "InvalidCommitException": - case "com.amazonaws.codecommit#InvalidCommitException": - throw await de_InvalidCommitExceptionRes(parsedOutput, context); - case "InvalidConflictDetailLevelException": - case "com.amazonaws.codecommit#InvalidConflictDetailLevelException": - throw await de_InvalidConflictDetailLevelExceptionRes(parsedOutput, context); - case "InvalidConflictResolutionException": - case "com.amazonaws.codecommit#InvalidConflictResolutionException": - throw await de_InvalidConflictResolutionExceptionRes(parsedOutput, context); - case "InvalidConflictResolutionStrategyException": - case "com.amazonaws.codecommit#InvalidConflictResolutionStrategyException": - throw await de_InvalidConflictResolutionStrategyExceptionRes(parsedOutput, context); - case "InvalidEmailException": - case "com.amazonaws.codecommit#InvalidEmailException": - throw await de_InvalidEmailExceptionRes(parsedOutput, context); - case "InvalidFileModeException": - case "com.amazonaws.codecommit#InvalidFileModeException": - throw await de_InvalidFileModeExceptionRes(parsedOutput, context); - case "InvalidPathException": - case "com.amazonaws.codecommit#InvalidPathException": - throw await de_InvalidPathExceptionRes(parsedOutput, context); - case "InvalidReplacementContentException": - case "com.amazonaws.codecommit#InvalidReplacementContentException": - throw await de_InvalidReplacementContentExceptionRes(parsedOutput, context); - case "InvalidReplacementTypeException": - case "com.amazonaws.codecommit#InvalidReplacementTypeException": - throw await de_InvalidReplacementTypeExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "InvalidTargetBranchException": - case "com.amazonaws.codecommit#InvalidTargetBranchException": - throw await de_InvalidTargetBranchExceptionRes(parsedOutput, context); - case "ManualMergeRequiredException": - case "com.amazonaws.codecommit#ManualMergeRequiredException": - throw await de_ManualMergeRequiredExceptionRes(parsedOutput, context); - case "MaximumConflictResolutionEntriesExceededException": - case "com.amazonaws.codecommit#MaximumConflictResolutionEntriesExceededException": - throw await de_MaximumConflictResolutionEntriesExceededExceptionRes(parsedOutput, context); - case "MaximumFileContentToLoadExceededException": - case "com.amazonaws.codecommit#MaximumFileContentToLoadExceededException": - throw await de_MaximumFileContentToLoadExceededExceptionRes(parsedOutput, context); - case "MaximumItemsToCompareExceededException": - case "com.amazonaws.codecommit#MaximumItemsToCompareExceededException": - throw await de_MaximumItemsToCompareExceededExceptionRes(parsedOutput, context); - case "MultipleConflictResolutionEntriesException": - case "com.amazonaws.codecommit#MultipleConflictResolutionEntriesException": - throw await de_MultipleConflictResolutionEntriesExceptionRes(parsedOutput, context); - case "NameLengthExceededException": - case "com.amazonaws.codecommit#NameLengthExceededException": - throw await de_NameLengthExceededExceptionRes(parsedOutput, context); - case "PathRequiredException": - case "com.amazonaws.codecommit#PathRequiredException": - throw await de_PathRequiredExceptionRes(parsedOutput, context); - case "ReplacementContentRequiredException": - case "com.amazonaws.codecommit#ReplacementContentRequiredException": - throw await de_ReplacementContentRequiredExceptionRes(parsedOutput, context); - case "ReplacementTypeRequiredException": - case "com.amazonaws.codecommit#ReplacementTypeRequiredException": - throw await de_ReplacementTypeRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "TipsDivergenceExceededException": - case "com.amazonaws.codecommit#TipsDivergenceExceededException": - throw await de_TipsDivergenceExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1MergePullRequestByFastForwardCommand - */ -export const de_MergePullRequestByFastForwardCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_MergePullRequestByFastForwardCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_MergePullRequestByFastForwardOutput(data, context); - const response: MergePullRequestByFastForwardCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1MergePullRequestByFastForwardCommandError - */ -const de_MergePullRequestByFastForwardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentReferenceUpdateException": - case "com.amazonaws.codecommit#ConcurrentReferenceUpdateException": - throw await de_ConcurrentReferenceUpdateExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidCommitIdException": - case "com.amazonaws.codecommit#InvalidCommitIdException": - throw await de_InvalidCommitIdExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "ManualMergeRequiredException": - case "com.amazonaws.codecommit#ManualMergeRequiredException": - throw await de_ManualMergeRequiredExceptionRes(parsedOutput, context); - case "PullRequestAlreadyClosedException": - case "com.amazonaws.codecommit#PullRequestAlreadyClosedException": - throw await de_PullRequestAlreadyClosedExceptionRes(parsedOutput, context); - case "PullRequestApprovalRulesNotSatisfiedException": - case "com.amazonaws.codecommit#PullRequestApprovalRulesNotSatisfiedException": - throw await de_PullRequestApprovalRulesNotSatisfiedExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - case "ReferenceDoesNotExistException": - case "com.amazonaws.codecommit#ReferenceDoesNotExistException": - throw await de_ReferenceDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "RepositoryNotAssociatedWithPullRequestException": - case "com.amazonaws.codecommit#RepositoryNotAssociatedWithPullRequestException": - throw await de_RepositoryNotAssociatedWithPullRequestExceptionRes(parsedOutput, context); - case "TipOfSourceReferenceIsDifferentException": - case "com.amazonaws.codecommit#TipOfSourceReferenceIsDifferentException": - throw await de_TipOfSourceReferenceIsDifferentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1MergePullRequestBySquashCommand - */ -export const de_MergePullRequestBySquashCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_MergePullRequestBySquashCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_MergePullRequestBySquashOutput(data, context); - const response: MergePullRequestBySquashCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1MergePullRequestBySquashCommandError - */ -const de_MergePullRequestBySquashCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommitMessageLengthExceededException": - case "com.amazonaws.codecommit#CommitMessageLengthExceededException": - throw await de_CommitMessageLengthExceededExceptionRes(parsedOutput, context); - case "ConcurrentReferenceUpdateException": - case "com.amazonaws.codecommit#ConcurrentReferenceUpdateException": - throw await de_ConcurrentReferenceUpdateExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "FileContentSizeLimitExceededException": - case "com.amazonaws.codecommit#FileContentSizeLimitExceededException": - throw await de_FileContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "FolderContentSizeLimitExceededException": - case "com.amazonaws.codecommit#FolderContentSizeLimitExceededException": - throw await de_FolderContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "InvalidCommitIdException": - case "com.amazonaws.codecommit#InvalidCommitIdException": - throw await de_InvalidCommitIdExceptionRes(parsedOutput, context); - case "InvalidConflictDetailLevelException": - case "com.amazonaws.codecommit#InvalidConflictDetailLevelException": - throw await de_InvalidConflictDetailLevelExceptionRes(parsedOutput, context); - case "InvalidConflictResolutionException": - case "com.amazonaws.codecommit#InvalidConflictResolutionException": - throw await de_InvalidConflictResolutionExceptionRes(parsedOutput, context); - case "InvalidConflictResolutionStrategyException": - case "com.amazonaws.codecommit#InvalidConflictResolutionStrategyException": - throw await de_InvalidConflictResolutionStrategyExceptionRes(parsedOutput, context); - case "InvalidEmailException": - case "com.amazonaws.codecommit#InvalidEmailException": - throw await de_InvalidEmailExceptionRes(parsedOutput, context); - case "InvalidFileModeException": - case "com.amazonaws.codecommit#InvalidFileModeException": - throw await de_InvalidFileModeExceptionRes(parsedOutput, context); - case "InvalidPathException": - case "com.amazonaws.codecommit#InvalidPathException": - throw await de_InvalidPathExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "InvalidReplacementContentException": - case "com.amazonaws.codecommit#InvalidReplacementContentException": - throw await de_InvalidReplacementContentExceptionRes(parsedOutput, context); - case "InvalidReplacementTypeException": - case "com.amazonaws.codecommit#InvalidReplacementTypeException": - throw await de_InvalidReplacementTypeExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "ManualMergeRequiredException": - case "com.amazonaws.codecommit#ManualMergeRequiredException": - throw await de_ManualMergeRequiredExceptionRes(parsedOutput, context); - case "MaximumConflictResolutionEntriesExceededException": - case "com.amazonaws.codecommit#MaximumConflictResolutionEntriesExceededException": - throw await de_MaximumConflictResolutionEntriesExceededExceptionRes(parsedOutput, context); - case "MaximumFileContentToLoadExceededException": - case "com.amazonaws.codecommit#MaximumFileContentToLoadExceededException": - throw await de_MaximumFileContentToLoadExceededExceptionRes(parsedOutput, context); - case "MaximumItemsToCompareExceededException": - case "com.amazonaws.codecommit#MaximumItemsToCompareExceededException": - throw await de_MaximumItemsToCompareExceededExceptionRes(parsedOutput, context); - case "MultipleConflictResolutionEntriesException": - case "com.amazonaws.codecommit#MultipleConflictResolutionEntriesException": - throw await de_MultipleConflictResolutionEntriesExceptionRes(parsedOutput, context); - case "NameLengthExceededException": - case "com.amazonaws.codecommit#NameLengthExceededException": - throw await de_NameLengthExceededExceptionRes(parsedOutput, context); - case "PathRequiredException": - case "com.amazonaws.codecommit#PathRequiredException": - throw await de_PathRequiredExceptionRes(parsedOutput, context); - case "PullRequestAlreadyClosedException": - case "com.amazonaws.codecommit#PullRequestAlreadyClosedException": - throw await de_PullRequestAlreadyClosedExceptionRes(parsedOutput, context); - case "PullRequestApprovalRulesNotSatisfiedException": - case "com.amazonaws.codecommit#PullRequestApprovalRulesNotSatisfiedException": - throw await de_PullRequestApprovalRulesNotSatisfiedExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - case "ReplacementContentRequiredException": - case "com.amazonaws.codecommit#ReplacementContentRequiredException": - throw await de_ReplacementContentRequiredExceptionRes(parsedOutput, context); - case "ReplacementTypeRequiredException": - case "com.amazonaws.codecommit#ReplacementTypeRequiredException": - throw await de_ReplacementTypeRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "RepositoryNotAssociatedWithPullRequestException": - case "com.amazonaws.codecommit#RepositoryNotAssociatedWithPullRequestException": - throw await de_RepositoryNotAssociatedWithPullRequestExceptionRes(parsedOutput, context); - case "TipOfSourceReferenceIsDifferentException": - case "com.amazonaws.codecommit#TipOfSourceReferenceIsDifferentException": - throw await de_TipOfSourceReferenceIsDifferentExceptionRes(parsedOutput, context); - case "TipsDivergenceExceededException": - case "com.amazonaws.codecommit#TipsDivergenceExceededException": - throw await de_TipsDivergenceExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1MergePullRequestByThreeWayCommand - */ -export const de_MergePullRequestByThreeWayCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_MergePullRequestByThreeWayCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_MergePullRequestByThreeWayOutput(data, context); - const response: MergePullRequestByThreeWayCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1MergePullRequestByThreeWayCommandError - */ -const de_MergePullRequestByThreeWayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommitMessageLengthExceededException": - case "com.amazonaws.codecommit#CommitMessageLengthExceededException": - throw await de_CommitMessageLengthExceededExceptionRes(parsedOutput, context); - case "ConcurrentReferenceUpdateException": - case "com.amazonaws.codecommit#ConcurrentReferenceUpdateException": - throw await de_ConcurrentReferenceUpdateExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "FileContentSizeLimitExceededException": - case "com.amazonaws.codecommit#FileContentSizeLimitExceededException": - throw await de_FileContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "FolderContentSizeLimitExceededException": - case "com.amazonaws.codecommit#FolderContentSizeLimitExceededException": - throw await de_FolderContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "InvalidCommitIdException": - case "com.amazonaws.codecommit#InvalidCommitIdException": - throw await de_InvalidCommitIdExceptionRes(parsedOutput, context); - case "InvalidConflictDetailLevelException": - case "com.amazonaws.codecommit#InvalidConflictDetailLevelException": - throw await de_InvalidConflictDetailLevelExceptionRes(parsedOutput, context); - case "InvalidConflictResolutionException": - case "com.amazonaws.codecommit#InvalidConflictResolutionException": - throw await de_InvalidConflictResolutionExceptionRes(parsedOutput, context); - case "InvalidConflictResolutionStrategyException": - case "com.amazonaws.codecommit#InvalidConflictResolutionStrategyException": - throw await de_InvalidConflictResolutionStrategyExceptionRes(parsedOutput, context); - case "InvalidEmailException": - case "com.amazonaws.codecommit#InvalidEmailException": - throw await de_InvalidEmailExceptionRes(parsedOutput, context); - case "InvalidFileModeException": - case "com.amazonaws.codecommit#InvalidFileModeException": - throw await de_InvalidFileModeExceptionRes(parsedOutput, context); - case "InvalidPathException": - case "com.amazonaws.codecommit#InvalidPathException": - throw await de_InvalidPathExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "InvalidReplacementContentException": - case "com.amazonaws.codecommit#InvalidReplacementContentException": - throw await de_InvalidReplacementContentExceptionRes(parsedOutput, context); - case "InvalidReplacementTypeException": - case "com.amazonaws.codecommit#InvalidReplacementTypeException": - throw await de_InvalidReplacementTypeExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "ManualMergeRequiredException": - case "com.amazonaws.codecommit#ManualMergeRequiredException": - throw await de_ManualMergeRequiredExceptionRes(parsedOutput, context); - case "MaximumConflictResolutionEntriesExceededException": - case "com.amazonaws.codecommit#MaximumConflictResolutionEntriesExceededException": - throw await de_MaximumConflictResolutionEntriesExceededExceptionRes(parsedOutput, context); - case "MaximumFileContentToLoadExceededException": - case "com.amazonaws.codecommit#MaximumFileContentToLoadExceededException": - throw await de_MaximumFileContentToLoadExceededExceptionRes(parsedOutput, context); - case "MaximumItemsToCompareExceededException": - case "com.amazonaws.codecommit#MaximumItemsToCompareExceededException": - throw await de_MaximumItemsToCompareExceededExceptionRes(parsedOutput, context); - case "MultipleConflictResolutionEntriesException": - case "com.amazonaws.codecommit#MultipleConflictResolutionEntriesException": - throw await de_MultipleConflictResolutionEntriesExceptionRes(parsedOutput, context); - case "NameLengthExceededException": - case "com.amazonaws.codecommit#NameLengthExceededException": - throw await de_NameLengthExceededExceptionRes(parsedOutput, context); - case "PathRequiredException": - case "com.amazonaws.codecommit#PathRequiredException": - throw await de_PathRequiredExceptionRes(parsedOutput, context); - case "PullRequestAlreadyClosedException": - case "com.amazonaws.codecommit#PullRequestAlreadyClosedException": - throw await de_PullRequestAlreadyClosedExceptionRes(parsedOutput, context); - case "PullRequestApprovalRulesNotSatisfiedException": - case "com.amazonaws.codecommit#PullRequestApprovalRulesNotSatisfiedException": - throw await de_PullRequestApprovalRulesNotSatisfiedExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - case "ReplacementContentRequiredException": - case "com.amazonaws.codecommit#ReplacementContentRequiredException": - throw await de_ReplacementContentRequiredExceptionRes(parsedOutput, context); - case "ReplacementTypeRequiredException": - case "com.amazonaws.codecommit#ReplacementTypeRequiredException": - throw await de_ReplacementTypeRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "RepositoryNotAssociatedWithPullRequestException": - case "com.amazonaws.codecommit#RepositoryNotAssociatedWithPullRequestException": - throw await de_RepositoryNotAssociatedWithPullRequestExceptionRes(parsedOutput, context); - case "TipOfSourceReferenceIsDifferentException": - case "com.amazonaws.codecommit#TipOfSourceReferenceIsDifferentException": - throw await de_TipOfSourceReferenceIsDifferentExceptionRes(parsedOutput, context); - case "TipsDivergenceExceededException": - case "com.amazonaws.codecommit#TipsDivergenceExceededException": - throw await de_TipsDivergenceExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1OverridePullRequestApprovalRulesCommand - */ -export const de_OverridePullRequestApprovalRulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_OverridePullRequestApprovalRulesCommandError(output, context); - } - await collectBody(output.body, context); - const response: OverridePullRequestApprovalRulesCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1OverridePullRequestApprovalRulesCommandError - */ -const de_OverridePullRequestApprovalRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidOverrideStatusException": - case "com.amazonaws.codecommit#InvalidOverrideStatusException": - throw await de_InvalidOverrideStatusExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "InvalidRevisionIdException": - case "com.amazonaws.codecommit#InvalidRevisionIdException": - throw await de_InvalidRevisionIdExceptionRes(parsedOutput, context); - case "OverrideAlreadySetException": - case "com.amazonaws.codecommit#OverrideAlreadySetException": - throw await de_OverrideAlreadySetExceptionRes(parsedOutput, context); - case "OverrideStatusRequiredException": - case "com.amazonaws.codecommit#OverrideStatusRequiredException": - throw await de_OverrideStatusRequiredExceptionRes(parsedOutput, context); - case "PullRequestAlreadyClosedException": - case "com.amazonaws.codecommit#PullRequestAlreadyClosedException": - throw await de_PullRequestAlreadyClosedExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - case "RevisionIdRequiredException": - case "com.amazonaws.codecommit#RevisionIdRequiredException": - throw await de_RevisionIdRequiredExceptionRes(parsedOutput, context); - case "RevisionNotCurrentException": - case "com.amazonaws.codecommit#RevisionNotCurrentException": - throw await de_RevisionNotCurrentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PostCommentForComparedCommitCommand - */ -export const de_PostCommentForComparedCommitCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PostCommentForComparedCommitCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PostCommentForComparedCommitOutput(data, context); - const response: PostCommentForComparedCommitCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PostCommentForComparedCommitCommandError - */ -const de_PostCommentForComparedCommitCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BeforeCommitIdAndAfterCommitIdAreSameException": - case "com.amazonaws.codecommit#BeforeCommitIdAndAfterCommitIdAreSameException": - throw await de_BeforeCommitIdAndAfterCommitIdAreSameExceptionRes(parsedOutput, context); - case "ClientRequestTokenRequiredException": - case "com.amazonaws.codecommit#ClientRequestTokenRequiredException": - throw await de_ClientRequestTokenRequiredExceptionRes(parsedOutput, context); - case "CommentContentRequiredException": - case "com.amazonaws.codecommit#CommentContentRequiredException": - throw await de_CommentContentRequiredExceptionRes(parsedOutput, context); - case "CommentContentSizeLimitExceededException": - case "com.amazonaws.codecommit#CommentContentSizeLimitExceededException": - throw await de_CommentContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitIdRequiredException": - case "com.amazonaws.codecommit#CommitIdRequiredException": - throw await de_CommitIdRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "IdempotencyParameterMismatchException": - case "com.amazonaws.codecommit#IdempotencyParameterMismatchException": - throw await de_IdempotencyParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientRequestTokenException": - case "com.amazonaws.codecommit#InvalidClientRequestTokenException": - throw await de_InvalidClientRequestTokenExceptionRes(parsedOutput, context); - case "InvalidCommitIdException": - case "com.amazonaws.codecommit#InvalidCommitIdException": - throw await de_InvalidCommitIdExceptionRes(parsedOutput, context); - case "InvalidFileLocationException": - case "com.amazonaws.codecommit#InvalidFileLocationException": - throw await de_InvalidFileLocationExceptionRes(parsedOutput, context); - case "InvalidFilePositionException": - case "com.amazonaws.codecommit#InvalidFilePositionException": - throw await de_InvalidFilePositionExceptionRes(parsedOutput, context); - case "InvalidPathException": - case "com.amazonaws.codecommit#InvalidPathException": - throw await de_InvalidPathExceptionRes(parsedOutput, context); - case "InvalidRelativeFileVersionEnumException": - case "com.amazonaws.codecommit#InvalidRelativeFileVersionEnumException": - throw await de_InvalidRelativeFileVersionEnumExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "PathDoesNotExistException": - case "com.amazonaws.codecommit#PathDoesNotExistException": - throw await de_PathDoesNotExistExceptionRes(parsedOutput, context); - case "PathRequiredException": - case "com.amazonaws.codecommit#PathRequiredException": - throw await de_PathRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PostCommentForPullRequestCommand - */ -export const de_PostCommentForPullRequestCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PostCommentForPullRequestCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PostCommentForPullRequestOutput(data, context); - const response: PostCommentForPullRequestCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PostCommentForPullRequestCommandError - */ -const de_PostCommentForPullRequestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BeforeCommitIdAndAfterCommitIdAreSameException": - case "com.amazonaws.codecommit#BeforeCommitIdAndAfterCommitIdAreSameException": - throw await de_BeforeCommitIdAndAfterCommitIdAreSameExceptionRes(parsedOutput, context); - case "ClientRequestTokenRequiredException": - case "com.amazonaws.codecommit#ClientRequestTokenRequiredException": - throw await de_ClientRequestTokenRequiredExceptionRes(parsedOutput, context); - case "CommentContentRequiredException": - case "com.amazonaws.codecommit#CommentContentRequiredException": - throw await de_CommentContentRequiredExceptionRes(parsedOutput, context); - case "CommentContentSizeLimitExceededException": - case "com.amazonaws.codecommit#CommentContentSizeLimitExceededException": - throw await de_CommentContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "CommitDoesNotExistException": - case "com.amazonaws.codecommit#CommitDoesNotExistException": - throw await de_CommitDoesNotExistExceptionRes(parsedOutput, context); - case "CommitIdRequiredException": - case "com.amazonaws.codecommit#CommitIdRequiredException": - throw await de_CommitIdRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "IdempotencyParameterMismatchException": - case "com.amazonaws.codecommit#IdempotencyParameterMismatchException": - throw await de_IdempotencyParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientRequestTokenException": - case "com.amazonaws.codecommit#InvalidClientRequestTokenException": - throw await de_InvalidClientRequestTokenExceptionRes(parsedOutput, context); - case "InvalidCommitIdException": - case "com.amazonaws.codecommit#InvalidCommitIdException": - throw await de_InvalidCommitIdExceptionRes(parsedOutput, context); - case "InvalidFileLocationException": - case "com.amazonaws.codecommit#InvalidFileLocationException": - throw await de_InvalidFileLocationExceptionRes(parsedOutput, context); - case "InvalidFilePositionException": - case "com.amazonaws.codecommit#InvalidFilePositionException": - throw await de_InvalidFilePositionExceptionRes(parsedOutput, context); - case "InvalidPathException": - case "com.amazonaws.codecommit#InvalidPathException": - throw await de_InvalidPathExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "InvalidRelativeFileVersionEnumException": - case "com.amazonaws.codecommit#InvalidRelativeFileVersionEnumException": - throw await de_InvalidRelativeFileVersionEnumExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "PathDoesNotExistException": - case "com.amazonaws.codecommit#PathDoesNotExistException": - throw await de_PathDoesNotExistExceptionRes(parsedOutput, context); - case "PathRequiredException": - case "com.amazonaws.codecommit#PathRequiredException": - throw await de_PathRequiredExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "RepositoryNotAssociatedWithPullRequestException": - case "com.amazonaws.codecommit#RepositoryNotAssociatedWithPullRequestException": - throw await de_RepositoryNotAssociatedWithPullRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PostCommentReplyCommand - */ -export const de_PostCommentReplyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PostCommentReplyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PostCommentReplyOutput(data, context); - const response: PostCommentReplyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PostCommentReplyCommandError - */ -const de_PostCommentReplyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientRequestTokenRequiredException": - case "com.amazonaws.codecommit#ClientRequestTokenRequiredException": - throw await de_ClientRequestTokenRequiredExceptionRes(parsedOutput, context); - case "CommentContentRequiredException": - case "com.amazonaws.codecommit#CommentContentRequiredException": - throw await de_CommentContentRequiredExceptionRes(parsedOutput, context); - case "CommentContentSizeLimitExceededException": - case "com.amazonaws.codecommit#CommentContentSizeLimitExceededException": - throw await de_CommentContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "CommentDoesNotExistException": - case "com.amazonaws.codecommit#CommentDoesNotExistException": - throw await de_CommentDoesNotExistExceptionRes(parsedOutput, context); - case "CommentIdRequiredException": - case "com.amazonaws.codecommit#CommentIdRequiredException": - throw await de_CommentIdRequiredExceptionRes(parsedOutput, context); - case "IdempotencyParameterMismatchException": - case "com.amazonaws.codecommit#IdempotencyParameterMismatchException": - throw await de_IdempotencyParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientRequestTokenException": - case "com.amazonaws.codecommit#InvalidClientRequestTokenException": - throw await de_InvalidClientRequestTokenExceptionRes(parsedOutput, context); - case "InvalidCommentIdException": - case "com.amazonaws.codecommit#InvalidCommentIdException": - throw await de_InvalidCommentIdExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutCommentReactionCommand - */ -export const de_PutCommentReactionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutCommentReactionCommandError(output, context); - } - await collectBody(output.body, context); - const response: PutCommentReactionCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1PutCommentReactionCommandError - */ -const de_PutCommentReactionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CommentDeletedException": - case "com.amazonaws.codecommit#CommentDeletedException": - throw await de_CommentDeletedExceptionRes(parsedOutput, context); - case "CommentDoesNotExistException": - case "com.amazonaws.codecommit#CommentDoesNotExistException": - throw await de_CommentDoesNotExistExceptionRes(parsedOutput, context); - case "CommentIdRequiredException": - case "com.amazonaws.codecommit#CommentIdRequiredException": - throw await de_CommentIdRequiredExceptionRes(parsedOutput, context); - case "InvalidCommentIdException": - case "com.amazonaws.codecommit#InvalidCommentIdException": - throw await de_InvalidCommentIdExceptionRes(parsedOutput, context); - case "InvalidReactionValueException": - case "com.amazonaws.codecommit#InvalidReactionValueException": - throw await de_InvalidReactionValueExceptionRes(parsedOutput, context); - case "ReactionLimitExceededException": - case "com.amazonaws.codecommit#ReactionLimitExceededException": - throw await de_ReactionLimitExceededExceptionRes(parsedOutput, context); - case "ReactionValueRequiredException": - case "com.amazonaws.codecommit#ReactionValueRequiredException": - throw await de_ReactionValueRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutFileCommand - */ -export const de_PutFileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutFileCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutFileCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutFileCommandError - */ -const de_PutFileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BranchDoesNotExistException": - case "com.amazonaws.codecommit#BranchDoesNotExistException": - throw await de_BranchDoesNotExistExceptionRes(parsedOutput, context); - case "BranchNameIsTagNameException": - case "com.amazonaws.codecommit#BranchNameIsTagNameException": - throw await de_BranchNameIsTagNameExceptionRes(parsedOutput, context); - case "BranchNameRequiredException": - case "com.amazonaws.codecommit#BranchNameRequiredException": - throw await de_BranchNameRequiredExceptionRes(parsedOutput, context); - case "CommitMessageLengthExceededException": - case "com.amazonaws.codecommit#CommitMessageLengthExceededException": - throw await de_CommitMessageLengthExceededExceptionRes(parsedOutput, context); - case "DirectoryNameConflictsWithFileNameException": - case "com.amazonaws.codecommit#DirectoryNameConflictsWithFileNameException": - throw await de_DirectoryNameConflictsWithFileNameExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "FileContentRequiredException": - case "com.amazonaws.codecommit#FileContentRequiredException": - throw await de_FileContentRequiredExceptionRes(parsedOutput, context); - case "FileContentSizeLimitExceededException": - case "com.amazonaws.codecommit#FileContentSizeLimitExceededException": - throw await de_FileContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "FileNameConflictsWithDirectoryNameException": - case "com.amazonaws.codecommit#FileNameConflictsWithDirectoryNameException": - throw await de_FileNameConflictsWithDirectoryNameExceptionRes(parsedOutput, context); - case "FilePathConflictsWithSubmodulePathException": - case "com.amazonaws.codecommit#FilePathConflictsWithSubmodulePathException": - throw await de_FilePathConflictsWithSubmodulePathExceptionRes(parsedOutput, context); - case "FolderContentSizeLimitExceededException": - case "com.amazonaws.codecommit#FolderContentSizeLimitExceededException": - throw await de_FolderContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "InvalidBranchNameException": - case "com.amazonaws.codecommit#InvalidBranchNameException": - throw await de_InvalidBranchNameExceptionRes(parsedOutput, context); - case "InvalidDeletionParameterException": - case "com.amazonaws.codecommit#InvalidDeletionParameterException": - throw await de_InvalidDeletionParameterExceptionRes(parsedOutput, context); - case "InvalidEmailException": - case "com.amazonaws.codecommit#InvalidEmailException": - throw await de_InvalidEmailExceptionRes(parsedOutput, context); - case "InvalidFileModeException": - case "com.amazonaws.codecommit#InvalidFileModeException": - throw await de_InvalidFileModeExceptionRes(parsedOutput, context); - case "InvalidParentCommitIdException": - case "com.amazonaws.codecommit#InvalidParentCommitIdException": - throw await de_InvalidParentCommitIdExceptionRes(parsedOutput, context); - case "InvalidPathException": - case "com.amazonaws.codecommit#InvalidPathException": - throw await de_InvalidPathExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "NameLengthExceededException": - case "com.amazonaws.codecommit#NameLengthExceededException": - throw await de_NameLengthExceededExceptionRes(parsedOutput, context); - case "ParentCommitDoesNotExistException": - case "com.amazonaws.codecommit#ParentCommitDoesNotExistException": - throw await de_ParentCommitDoesNotExistExceptionRes(parsedOutput, context); - case "ParentCommitIdOutdatedException": - case "com.amazonaws.codecommit#ParentCommitIdOutdatedException": - throw await de_ParentCommitIdOutdatedExceptionRes(parsedOutput, context); - case "ParentCommitIdRequiredException": - case "com.amazonaws.codecommit#ParentCommitIdRequiredException": - throw await de_ParentCommitIdRequiredExceptionRes(parsedOutput, context); - case "PathRequiredException": - case "com.amazonaws.codecommit#PathRequiredException": - throw await de_PathRequiredExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "SameFileContentException": - case "com.amazonaws.codecommit#SameFileContentException": - throw await de_SameFileContentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutRepositoryTriggersCommand - */ -export const de_PutRepositoryTriggersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutRepositoryTriggersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutRepositoryTriggersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutRepositoryTriggersCommandError - */ -const de_PutRepositoryTriggersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "InvalidRepositoryTriggerBranchNameException": - case "com.amazonaws.codecommit#InvalidRepositoryTriggerBranchNameException": - throw await de_InvalidRepositoryTriggerBranchNameExceptionRes(parsedOutput, context); - case "InvalidRepositoryTriggerCustomDataException": - case "com.amazonaws.codecommit#InvalidRepositoryTriggerCustomDataException": - throw await de_InvalidRepositoryTriggerCustomDataExceptionRes(parsedOutput, context); - case "InvalidRepositoryTriggerDestinationArnException": - case "com.amazonaws.codecommit#InvalidRepositoryTriggerDestinationArnException": - throw await de_InvalidRepositoryTriggerDestinationArnExceptionRes(parsedOutput, context); - case "InvalidRepositoryTriggerEventsException": - case "com.amazonaws.codecommit#InvalidRepositoryTriggerEventsException": - throw await de_InvalidRepositoryTriggerEventsExceptionRes(parsedOutput, context); - case "InvalidRepositoryTriggerNameException": - case "com.amazonaws.codecommit#InvalidRepositoryTriggerNameException": - throw await de_InvalidRepositoryTriggerNameExceptionRes(parsedOutput, context); - case "InvalidRepositoryTriggerRegionException": - case "com.amazonaws.codecommit#InvalidRepositoryTriggerRegionException": - throw await de_InvalidRepositoryTriggerRegionExceptionRes(parsedOutput, context); - case "MaximumBranchesExceededException": - case "com.amazonaws.codecommit#MaximumBranchesExceededException": - throw await de_MaximumBranchesExceededExceptionRes(parsedOutput, context); - case "MaximumRepositoryTriggersExceededException": - case "com.amazonaws.codecommit#MaximumRepositoryTriggersExceededException": - throw await de_MaximumRepositoryTriggersExceededExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "RepositoryTriggerBranchNameListRequiredException": - case "com.amazonaws.codecommit#RepositoryTriggerBranchNameListRequiredException": - throw await de_RepositoryTriggerBranchNameListRequiredExceptionRes(parsedOutput, context); - case "RepositoryTriggerDestinationArnRequiredException": - case "com.amazonaws.codecommit#RepositoryTriggerDestinationArnRequiredException": - throw await de_RepositoryTriggerDestinationArnRequiredExceptionRes(parsedOutput, context); - case "RepositoryTriggerEventsListRequiredException": - case "com.amazonaws.codecommit#RepositoryTriggerEventsListRequiredException": - throw await de_RepositoryTriggerEventsListRequiredExceptionRes(parsedOutput, context); - case "RepositoryTriggerNameRequiredException": - case "com.amazonaws.codecommit#RepositoryTriggerNameRequiredException": - throw await de_RepositoryTriggerNameRequiredExceptionRes(parsedOutput, context); - case "RepositoryTriggersListRequiredException": - case "com.amazonaws.codecommit#RepositoryTriggersListRequiredException": - throw await de_RepositoryTriggersListRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - await collectBody(output.body, context); - const response: TagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "InvalidResourceArnException": - case "com.amazonaws.codecommit#InvalidResourceArnException": - throw await de_InvalidResourceArnExceptionRes(parsedOutput, context); - case "InvalidSystemTagUsageException": - case "com.amazonaws.codecommit#InvalidSystemTagUsageException": - throw await de_InvalidSystemTagUsageExceptionRes(parsedOutput, context); - case "InvalidTagsMapException": - case "com.amazonaws.codecommit#InvalidTagsMapException": - throw await de_InvalidTagsMapExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "ResourceArnRequiredException": - case "com.amazonaws.codecommit#ResourceArnRequiredException": - throw await de_ResourceArnRequiredExceptionRes(parsedOutput, context); - case "TagPolicyException": - case "com.amazonaws.codecommit#TagPolicyException": - throw await de_TagPolicyExceptionRes(parsedOutput, context); - case "TagsMapRequiredException": - case "com.amazonaws.codecommit#TagsMapRequiredException": - throw await de_TagsMapRequiredExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.codecommit#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1TestRepositoryTriggersCommand - */ -export const de_TestRepositoryTriggersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TestRepositoryTriggersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: TestRepositoryTriggersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1TestRepositoryTriggersCommandError - */ -const de_TestRepositoryTriggersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "InvalidRepositoryTriggerBranchNameException": - case "com.amazonaws.codecommit#InvalidRepositoryTriggerBranchNameException": - throw await de_InvalidRepositoryTriggerBranchNameExceptionRes(parsedOutput, context); - case "InvalidRepositoryTriggerCustomDataException": - case "com.amazonaws.codecommit#InvalidRepositoryTriggerCustomDataException": - throw await de_InvalidRepositoryTriggerCustomDataExceptionRes(parsedOutput, context); - case "InvalidRepositoryTriggerDestinationArnException": - case "com.amazonaws.codecommit#InvalidRepositoryTriggerDestinationArnException": - throw await de_InvalidRepositoryTriggerDestinationArnExceptionRes(parsedOutput, context); - case "InvalidRepositoryTriggerEventsException": - case "com.amazonaws.codecommit#InvalidRepositoryTriggerEventsException": - throw await de_InvalidRepositoryTriggerEventsExceptionRes(parsedOutput, context); - case "InvalidRepositoryTriggerNameException": - case "com.amazonaws.codecommit#InvalidRepositoryTriggerNameException": - throw await de_InvalidRepositoryTriggerNameExceptionRes(parsedOutput, context); - case "InvalidRepositoryTriggerRegionException": - case "com.amazonaws.codecommit#InvalidRepositoryTriggerRegionException": - throw await de_InvalidRepositoryTriggerRegionExceptionRes(parsedOutput, context); - case "MaximumBranchesExceededException": - case "com.amazonaws.codecommit#MaximumBranchesExceededException": - throw await de_MaximumBranchesExceededExceptionRes(parsedOutput, context); - case "MaximumRepositoryTriggersExceededException": - case "com.amazonaws.codecommit#MaximumRepositoryTriggersExceededException": - throw await de_MaximumRepositoryTriggersExceededExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - case "RepositoryTriggerBranchNameListRequiredException": - case "com.amazonaws.codecommit#RepositoryTriggerBranchNameListRequiredException": - throw await de_RepositoryTriggerBranchNameListRequiredExceptionRes(parsedOutput, context); - case "RepositoryTriggerDestinationArnRequiredException": - case "com.amazonaws.codecommit#RepositoryTriggerDestinationArnRequiredException": - throw await de_RepositoryTriggerDestinationArnRequiredExceptionRes(parsedOutput, context); - case "RepositoryTriggerEventsListRequiredException": - case "com.amazonaws.codecommit#RepositoryTriggerEventsListRequiredException": - throw await de_RepositoryTriggerEventsListRequiredExceptionRes(parsedOutput, context); - case "RepositoryTriggerNameRequiredException": - case "com.amazonaws.codecommit#RepositoryTriggerNameRequiredException": - throw await de_RepositoryTriggerNameRequiredExceptionRes(parsedOutput, context); - case "RepositoryTriggersListRequiredException": - case "com.amazonaws.codecommit#RepositoryTriggersListRequiredException": - throw await de_RepositoryTriggersListRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UntagResourceCommand - */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - await collectBody(output.body, context); - const response: UntagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "InvalidResourceArnException": - case "com.amazonaws.codecommit#InvalidResourceArnException": - throw await de_InvalidResourceArnExceptionRes(parsedOutput, context); - case "InvalidSystemTagUsageException": - case "com.amazonaws.codecommit#InvalidSystemTagUsageException": - throw await de_InvalidSystemTagUsageExceptionRes(parsedOutput, context); - case "InvalidTagKeysListException": - case "com.amazonaws.codecommit#InvalidTagKeysListException": - throw await de_InvalidTagKeysListExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "ResourceArnRequiredException": - case "com.amazonaws.codecommit#ResourceArnRequiredException": - throw await de_ResourceArnRequiredExceptionRes(parsedOutput, context); - case "TagKeysListRequiredException": - case "com.amazonaws.codecommit#TagKeysListRequiredException": - throw await de_TagKeysListRequiredExceptionRes(parsedOutput, context); - case "TagPolicyException": - case "com.amazonaws.codecommit#TagPolicyException": - throw await de_TagPolicyExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.codecommit#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateApprovalRuleTemplateContentCommand - */ -export const de_UpdateApprovalRuleTemplateContentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateApprovalRuleTemplateContentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateApprovalRuleTemplateContentOutput(data, context); - const response: UpdateApprovalRuleTemplateContentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateApprovalRuleTemplateContentCommandError - */ -const de_UpdateApprovalRuleTemplateContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApprovalRuleTemplateContentRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateContentRequiredException": - throw await de_ApprovalRuleTemplateContentRequiredExceptionRes(parsedOutput, context); - case "ApprovalRuleTemplateDoesNotExistException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": - throw await de_ApprovalRuleTemplateDoesNotExistExceptionRes(parsedOutput, context); - case "ApprovalRuleTemplateNameRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateNameRequiredException": - throw await de_ApprovalRuleTemplateNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleTemplateContentException": - case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateContentException": - throw await de_InvalidApprovalRuleTemplateContentExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleTemplateNameException": - case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateNameException": - throw await de_InvalidApprovalRuleTemplateNameExceptionRes(parsedOutput, context); - case "InvalidRuleContentSha256Exception": - case "com.amazonaws.codecommit#InvalidRuleContentSha256Exception": - throw await de_InvalidRuleContentSha256ExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateApprovalRuleTemplateDescriptionCommand - */ -export const de_UpdateApprovalRuleTemplateDescriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateApprovalRuleTemplateDescriptionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateApprovalRuleTemplateDescriptionOutput(data, context); - const response: UpdateApprovalRuleTemplateDescriptionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateApprovalRuleTemplateDescriptionCommandError - */ -const de_UpdateApprovalRuleTemplateDescriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApprovalRuleTemplateDoesNotExistException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": - throw await de_ApprovalRuleTemplateDoesNotExistExceptionRes(parsedOutput, context); - case "ApprovalRuleTemplateNameRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateNameRequiredException": - throw await de_ApprovalRuleTemplateNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleTemplateDescriptionException": - case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateDescriptionException": - throw await de_InvalidApprovalRuleTemplateDescriptionExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleTemplateNameException": - case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateNameException": - throw await de_InvalidApprovalRuleTemplateNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateApprovalRuleTemplateNameCommand - */ -export const de_UpdateApprovalRuleTemplateNameCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateApprovalRuleTemplateNameCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateApprovalRuleTemplateNameOutput(data, context); - const response: UpdateApprovalRuleTemplateNameCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateApprovalRuleTemplateNameCommandError - */ -const de_UpdateApprovalRuleTemplateNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApprovalRuleTemplateDoesNotExistException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateDoesNotExistException": - throw await de_ApprovalRuleTemplateDoesNotExistExceptionRes(parsedOutput, context); - case "ApprovalRuleTemplateNameAlreadyExistsException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateNameAlreadyExistsException": - throw await de_ApprovalRuleTemplateNameAlreadyExistsExceptionRes(parsedOutput, context); - case "ApprovalRuleTemplateNameRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleTemplateNameRequiredException": - throw await de_ApprovalRuleTemplateNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleTemplateNameException": - case "com.amazonaws.codecommit#InvalidApprovalRuleTemplateNameException": - throw await de_InvalidApprovalRuleTemplateNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateCommentCommand - */ -export const de_UpdateCommentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateCommentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateCommentOutput(data, context); - const response: UpdateCommentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateCommentCommandError - */ -const de_UpdateCommentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { + case "InvalidPullRequestEventTypeException": + case "com.amazonaws.codecommit#InvalidPullRequestEventTypeException": + throw await de_InvalidPullRequestEventTypeExceptionRes(parsedOutput, context); + case "InvalidRevisionIdException": + case "com.amazonaws.codecommit#InvalidRevisionIdException": + throw await de_InvalidRevisionIdExceptionRes(parsedOutput, context); + case "RevisionIdRequiredException": + case "com.amazonaws.codecommit#RevisionIdRequiredException": + throw await de_RevisionIdRequiredExceptionRes(parsedOutput, context); + case "RevisionNotCurrentException": + case "com.amazonaws.codecommit#RevisionNotCurrentException": + throw await de_RevisionNotCurrentExceptionRes(parsedOutput, context); + case "BlobIdDoesNotExistException": + case "com.amazonaws.codecommit#BlobIdDoesNotExistException": + throw await de_BlobIdDoesNotExistExceptionRes(parsedOutput, context); + case "BlobIdRequiredException": + case "com.amazonaws.codecommit#BlobIdRequiredException": + throw await de_BlobIdRequiredExceptionRes(parsedOutput, context); + case "FileTooLargeException": + case "com.amazonaws.codecommit#FileTooLargeException": + throw await de_FileTooLargeExceptionRes(parsedOutput, context); + case "InvalidBlobIdException": + case "com.amazonaws.codecommit#InvalidBlobIdException": + throw await de_InvalidBlobIdExceptionRes(parsedOutput, context); + case "InvalidReactionUserArnException": + case "com.amazonaws.codecommit#InvalidReactionUserArnException": + throw await de_InvalidReactionUserArnExceptionRes(parsedOutput, context); + case "RepositoryNotAssociatedWithPullRequestException": + case "com.amazonaws.codecommit#RepositoryNotAssociatedWithPullRequestException": + throw await de_RepositoryNotAssociatedWithPullRequestExceptionRes(parsedOutput, context); + case "CommitIdDoesNotExistException": + case "com.amazonaws.codecommit#CommitIdDoesNotExistException": + throw await de_CommitIdDoesNotExistExceptionRes(parsedOutput, context); + case "PathDoesNotExistException": + case "com.amazonaws.codecommit#PathDoesNotExistException": + throw await de_PathDoesNotExistExceptionRes(parsedOutput, context); + case "FolderDoesNotExistException": + case "com.amazonaws.codecommit#FolderDoesNotExistException": + throw await de_FolderDoesNotExistExceptionRes(parsedOutput, context); + case "InvalidDestinationCommitSpecifierException": + case "com.amazonaws.codecommit#InvalidDestinationCommitSpecifierException": + throw await de_InvalidDestinationCommitSpecifierExceptionRes(parsedOutput, context); + case "InvalidSourceCommitSpecifierException": + case "com.amazonaws.codecommit#InvalidSourceCommitSpecifierException": + throw await de_InvalidSourceCommitSpecifierExceptionRes(parsedOutput, context); + case "AuthorDoesNotExistException": + case "com.amazonaws.codecommit#AuthorDoesNotExistException": + throw await de_AuthorDoesNotExistExceptionRes(parsedOutput, context); + case "InvalidAuthorArnException": + case "com.amazonaws.codecommit#InvalidAuthorArnException": + throw await de_InvalidAuthorArnExceptionRes(parsedOutput, context); + case "InvalidPullRequestStatusException": + case "com.amazonaws.codecommit#InvalidPullRequestStatusException": + throw await de_InvalidPullRequestStatusExceptionRes(parsedOutput, context); + case "InvalidOrderException": + case "com.amazonaws.codecommit#InvalidOrderException": + throw await de_InvalidOrderExceptionRes(parsedOutput, context); + case "InvalidSortByException": + case "com.amazonaws.codecommit#InvalidSortByException": + throw await de_InvalidSortByExceptionRes(parsedOutput, context); + case "InvalidResourceArnException": + case "com.amazonaws.codecommit#InvalidResourceArnException": + throw await de_InvalidResourceArnExceptionRes(parsedOutput, context); + case "ResourceArnRequiredException": + case "com.amazonaws.codecommit#ResourceArnRequiredException": + throw await de_ResourceArnRequiredExceptionRes(parsedOutput, context); + case "InvalidTargetBranchException": + case "com.amazonaws.codecommit#InvalidTargetBranchException": + throw await de_InvalidTargetBranchExceptionRes(parsedOutput, context); + case "PullRequestApprovalRulesNotSatisfiedException": + case "com.amazonaws.codecommit#PullRequestApprovalRulesNotSatisfiedException": + throw await de_PullRequestApprovalRulesNotSatisfiedExceptionRes(parsedOutput, context); + case "TipOfSourceReferenceIsDifferentException": + case "com.amazonaws.codecommit#TipOfSourceReferenceIsDifferentException": + throw await de_TipOfSourceReferenceIsDifferentExceptionRes(parsedOutput, context); + case "InvalidOverrideStatusException": + case "com.amazonaws.codecommit#InvalidOverrideStatusException": + throw await de_InvalidOverrideStatusExceptionRes(parsedOutput, context); + case "OverrideAlreadySetException": + case "com.amazonaws.codecommit#OverrideAlreadySetException": + throw await de_OverrideAlreadySetExceptionRes(parsedOutput, context); + case "OverrideStatusRequiredException": + case "com.amazonaws.codecommit#OverrideStatusRequiredException": + throw await de_OverrideStatusRequiredExceptionRes(parsedOutput, context); + case "BeforeCommitIdAndAfterCommitIdAreSameException": + case "com.amazonaws.codecommit#BeforeCommitIdAndAfterCommitIdAreSameException": + throw await de_BeforeCommitIdAndAfterCommitIdAreSameExceptionRes(parsedOutput, context); case "CommentContentRequiredException": case "com.amazonaws.codecommit#CommentContentRequiredException": throw await de_CommentContentRequiredExceptionRes(parsedOutput, context); case "CommentContentSizeLimitExceededException": case "com.amazonaws.codecommit#CommentContentSizeLimitExceededException": throw await de_CommentContentSizeLimitExceededExceptionRes(parsedOutput, context); - case "CommentDeletedException": - case "com.amazonaws.codecommit#CommentDeletedException": - throw await de_CommentDeletedExceptionRes(parsedOutput, context); - case "CommentDoesNotExistException": - case "com.amazonaws.codecommit#CommentDoesNotExistException": - throw await de_CommentDoesNotExistExceptionRes(parsedOutput, context); - case "CommentIdRequiredException": - case "com.amazonaws.codecommit#CommentIdRequiredException": - throw await de_CommentIdRequiredExceptionRes(parsedOutput, context); - case "CommentNotCreatedByCallerException": - case "com.amazonaws.codecommit#CommentNotCreatedByCallerException": - throw await de_CommentNotCreatedByCallerExceptionRes(parsedOutput, context); - case "InvalidCommentIdException": - case "com.amazonaws.codecommit#InvalidCommentIdException": - throw await de_InvalidCommentIdExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateDefaultBranchCommand - */ -export const de_UpdateDefaultBranchCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateDefaultBranchCommandError(output, context); - } - await collectBody(output.body, context); - const response: UpdateDefaultBranchCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateDefaultBranchCommandError - */ -const de_UpdateDefaultBranchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BranchDoesNotExistException": - case "com.amazonaws.codecommit#BranchDoesNotExistException": - throw await de_BranchDoesNotExistExceptionRes(parsedOutput, context); - case "BranchNameRequiredException": - case "com.amazonaws.codecommit#BranchNameRequiredException": - throw await de_BranchNameRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidBranchNameException": - case "com.amazonaws.codecommit#InvalidBranchNameException": - throw await de_InvalidBranchNameExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdatePullRequestApprovalRuleContentCommand - */ -export const de_UpdatePullRequestApprovalRuleContentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdatePullRequestApprovalRuleContentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdatePullRequestApprovalRuleContentOutput(data, context); - const response: UpdatePullRequestApprovalRuleContentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdatePullRequestApprovalRuleContentCommandError - */ -const de_UpdatePullRequestApprovalRuleContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApprovalRuleContentRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleContentRequiredException": - throw await de_ApprovalRuleContentRequiredExceptionRes(parsedOutput, context); + case "InvalidFileLocationException": + case "com.amazonaws.codecommit#InvalidFileLocationException": + throw await de_InvalidFileLocationExceptionRes(parsedOutput, context); + case "InvalidFilePositionException": + case "com.amazonaws.codecommit#InvalidFilePositionException": + throw await de_InvalidFilePositionExceptionRes(parsedOutput, context); + case "InvalidRelativeFileVersionEnumException": + case "com.amazonaws.codecommit#InvalidRelativeFileVersionEnumException": + throw await de_InvalidRelativeFileVersionEnumExceptionRes(parsedOutput, context); + case "InvalidReactionValueException": + case "com.amazonaws.codecommit#InvalidReactionValueException": + throw await de_InvalidReactionValueExceptionRes(parsedOutput, context); + case "ReactionLimitExceededException": + case "com.amazonaws.codecommit#ReactionLimitExceededException": + throw await de_ReactionLimitExceededExceptionRes(parsedOutput, context); + case "ReactionValueRequiredException": + case "com.amazonaws.codecommit#ReactionValueRequiredException": + throw await de_ReactionValueRequiredExceptionRes(parsedOutput, context); + case "FileContentRequiredException": + case "com.amazonaws.codecommit#FileContentRequiredException": + throw await de_FileContentRequiredExceptionRes(parsedOutput, context); + case "SameFileContentException": + case "com.amazonaws.codecommit#SameFileContentException": + throw await de_SameFileContentExceptionRes(parsedOutput, context); + case "InvalidRepositoryTriggerBranchNameException": + case "com.amazonaws.codecommit#InvalidRepositoryTriggerBranchNameException": + throw await de_InvalidRepositoryTriggerBranchNameExceptionRes(parsedOutput, context); + case "InvalidRepositoryTriggerCustomDataException": + case "com.amazonaws.codecommit#InvalidRepositoryTriggerCustomDataException": + throw await de_InvalidRepositoryTriggerCustomDataExceptionRes(parsedOutput, context); + case "InvalidRepositoryTriggerDestinationArnException": + case "com.amazonaws.codecommit#InvalidRepositoryTriggerDestinationArnException": + throw await de_InvalidRepositoryTriggerDestinationArnExceptionRes(parsedOutput, context); + case "InvalidRepositoryTriggerEventsException": + case "com.amazonaws.codecommit#InvalidRepositoryTriggerEventsException": + throw await de_InvalidRepositoryTriggerEventsExceptionRes(parsedOutput, context); + case "InvalidRepositoryTriggerNameException": + case "com.amazonaws.codecommit#InvalidRepositoryTriggerNameException": + throw await de_InvalidRepositoryTriggerNameExceptionRes(parsedOutput, context); + case "InvalidRepositoryTriggerRegionException": + case "com.amazonaws.codecommit#InvalidRepositoryTriggerRegionException": + throw await de_InvalidRepositoryTriggerRegionExceptionRes(parsedOutput, context); + case "MaximumBranchesExceededException": + case "com.amazonaws.codecommit#MaximumBranchesExceededException": + throw await de_MaximumBranchesExceededExceptionRes(parsedOutput, context); + case "MaximumRepositoryTriggersExceededException": + case "com.amazonaws.codecommit#MaximumRepositoryTriggersExceededException": + throw await de_MaximumRepositoryTriggersExceededExceptionRes(parsedOutput, context); + case "RepositoryTriggerBranchNameListRequiredException": + case "com.amazonaws.codecommit#RepositoryTriggerBranchNameListRequiredException": + throw await de_RepositoryTriggerBranchNameListRequiredExceptionRes(parsedOutput, context); + case "RepositoryTriggerDestinationArnRequiredException": + case "com.amazonaws.codecommit#RepositoryTriggerDestinationArnRequiredException": + throw await de_RepositoryTriggerDestinationArnRequiredExceptionRes(parsedOutput, context); + case "RepositoryTriggerEventsListRequiredException": + case "com.amazonaws.codecommit#RepositoryTriggerEventsListRequiredException": + throw await de_RepositoryTriggerEventsListRequiredExceptionRes(parsedOutput, context); + case "RepositoryTriggerNameRequiredException": + case "com.amazonaws.codecommit#RepositoryTriggerNameRequiredException": + throw await de_RepositoryTriggerNameRequiredExceptionRes(parsedOutput, context); + case "RepositoryTriggersListRequiredException": + case "com.amazonaws.codecommit#RepositoryTriggersListRequiredException": + throw await de_RepositoryTriggersListRequiredExceptionRes(parsedOutput, context); + case "TagsMapRequiredException": + case "com.amazonaws.codecommit#TagsMapRequiredException": + throw await de_TagsMapRequiredExceptionRes(parsedOutput, context); + case "InvalidTagKeysListException": + case "com.amazonaws.codecommit#InvalidTagKeysListException": + throw await de_InvalidTagKeysListExceptionRes(parsedOutput, context); + case "TagKeysListRequiredException": + case "com.amazonaws.codecommit#TagKeysListRequiredException": + throw await de_TagKeysListRequiredExceptionRes(parsedOutput, context); + case "InvalidRuleContentSha256Exception": + case "com.amazonaws.codecommit#InvalidRuleContentSha256Exception": + throw await de_InvalidRuleContentSha256ExceptionRes(parsedOutput, context); + case "CommentNotCreatedByCallerException": + case "com.amazonaws.codecommit#CommentNotCreatedByCallerException": + throw await de_CommentNotCreatedByCallerExceptionRes(parsedOutput, context); case "ApprovalRuleDoesNotExistException": case "com.amazonaws.codecommit#ApprovalRuleDoesNotExistException": throw await de_ApprovalRuleDoesNotExistExceptionRes(parsedOutput, context); - case "ApprovalRuleNameRequiredException": - case "com.amazonaws.codecommit#ApprovalRuleNameRequiredException": - throw await de_ApprovalRuleNameRequiredExceptionRes(parsedOutput, context); case "CannotModifyApprovalRuleFromTemplateException": case "com.amazonaws.codecommit#CannotModifyApprovalRuleFromTemplateException": - throw await de_CannotModifyApprovalRuleFromTemplateExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleContentException": - case "com.amazonaws.codecommit#InvalidApprovalRuleContentException": - throw await de_InvalidApprovalRuleContentExceptionRes(parsedOutput, context); - case "InvalidApprovalRuleNameException": - case "com.amazonaws.codecommit#InvalidApprovalRuleNameException": - throw await de_InvalidApprovalRuleNameExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "InvalidRuleContentSha256Exception": - case "com.amazonaws.codecommit#InvalidRuleContentSha256Exception": - throw await de_InvalidRuleContentSha256ExceptionRes(parsedOutput, context); - case "PullRequestAlreadyClosedException": - case "com.amazonaws.codecommit#PullRequestAlreadyClosedException": - throw await de_PullRequestAlreadyClosedExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdatePullRequestApprovalStateCommand - */ -export const de_UpdatePullRequestApprovalStateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdatePullRequestApprovalStateCommandError(output, context); - } - await collectBody(output.body, context); - const response: UpdatePullRequestApprovalStateCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdatePullRequestApprovalStateCommandError - */ -const de_UpdatePullRequestApprovalStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApprovalStateRequiredException": - case "com.amazonaws.codecommit#ApprovalStateRequiredException": - throw await de_ApprovalStateRequiredExceptionRes(parsedOutput, context); - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidApprovalStateException": - case "com.amazonaws.codecommit#InvalidApprovalStateException": - throw await de_InvalidApprovalStateExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "InvalidRevisionIdException": - case "com.amazonaws.codecommit#InvalidRevisionIdException": - throw await de_InvalidRevisionIdExceptionRes(parsedOutput, context); - case "MaximumNumberOfApprovalsExceededException": - case "com.amazonaws.codecommit#MaximumNumberOfApprovalsExceededException": - throw await de_MaximumNumberOfApprovalsExceededExceptionRes(parsedOutput, context); - case "PullRequestAlreadyClosedException": - case "com.amazonaws.codecommit#PullRequestAlreadyClosedException": - throw await de_PullRequestAlreadyClosedExceptionRes(parsedOutput, context); - case "PullRequestCannotBeApprovedByAuthorException": - case "com.amazonaws.codecommit#PullRequestCannotBeApprovedByAuthorException": - throw await de_PullRequestCannotBeApprovedByAuthorExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - case "RevisionIdRequiredException": - case "com.amazonaws.codecommit#RevisionIdRequiredException": - throw await de_RevisionIdRequiredExceptionRes(parsedOutput, context); - case "RevisionNotCurrentException": - case "com.amazonaws.codecommit#RevisionNotCurrentException": - throw await de_RevisionNotCurrentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdatePullRequestDescriptionCommand - */ -export const de_UpdatePullRequestDescriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdatePullRequestDescriptionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdatePullRequestDescriptionOutput(data, context); - const response: UpdatePullRequestDescriptionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdatePullRequestDescriptionCommandError - */ -const de_UpdatePullRequestDescriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidDescriptionException": - case "com.amazonaws.codecommit#InvalidDescriptionException": - throw await de_InvalidDescriptionExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "PullRequestAlreadyClosedException": - case "com.amazonaws.codecommit#PullRequestAlreadyClosedException": - throw await de_PullRequestAlreadyClosedExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdatePullRequestStatusCommand - */ -export const de_UpdatePullRequestStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdatePullRequestStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdatePullRequestStatusOutput(data, context); - const response: UpdatePullRequestStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdatePullRequestStatusCommandError - */ -const de_UpdatePullRequestStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "InvalidPullRequestStatusException": - case "com.amazonaws.codecommit#InvalidPullRequestStatusException": - throw await de_InvalidPullRequestStatusExceptionRes(parsedOutput, context); + throw await de_CannotModifyApprovalRuleFromTemplateExceptionRes(parsedOutput, context); + case "ApprovalStateRequiredException": + case "com.amazonaws.codecommit#ApprovalStateRequiredException": + throw await de_ApprovalStateRequiredExceptionRes(parsedOutput, context); + case "InvalidApprovalStateException": + case "com.amazonaws.codecommit#InvalidApprovalStateException": + throw await de_InvalidApprovalStateExceptionRes(parsedOutput, context); + case "MaximumNumberOfApprovalsExceededException": + case "com.amazonaws.codecommit#MaximumNumberOfApprovalsExceededException": + throw await de_MaximumNumberOfApprovalsExceededExceptionRes(parsedOutput, context); + case "PullRequestCannotBeApprovedByAuthorException": + case "com.amazonaws.codecommit#PullRequestCannotBeApprovedByAuthorException": + throw await de_PullRequestCannotBeApprovedByAuthorExceptionRes(parsedOutput, context); case "InvalidPullRequestStatusUpdateException": case "com.amazonaws.codecommit#InvalidPullRequestStatusUpdateException": throw await de_InvalidPullRequestStatusUpdateExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); case "PullRequestStatusRequiredException": case "com.amazonaws.codecommit#PullRequestStatusRequiredException": throw await de_PullRequestStatusRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdatePullRequestTitleCommand - */ -export const de_UpdatePullRequestTitleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdatePullRequestTitleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdatePullRequestTitleOutput(data, context); - const response: UpdatePullRequestTitleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdatePullRequestTitleCommandError - */ -const de_UpdatePullRequestTitleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidPullRequestIdException": - case "com.amazonaws.codecommit#InvalidPullRequestIdException": - throw await de_InvalidPullRequestIdExceptionRes(parsedOutput, context); - case "InvalidTitleException": - case "com.amazonaws.codecommit#InvalidTitleException": - throw await de_InvalidTitleExceptionRes(parsedOutput, context); - case "PullRequestAlreadyClosedException": - case "com.amazonaws.codecommit#PullRequestAlreadyClosedException": - throw await de_PullRequestAlreadyClosedExceptionRes(parsedOutput, context); - case "PullRequestDoesNotExistException": - case "com.amazonaws.codecommit#PullRequestDoesNotExistException": - throw await de_PullRequestDoesNotExistExceptionRes(parsedOutput, context); - case "PullRequestIdRequiredException": - case "com.amazonaws.codecommit#PullRequestIdRequiredException": - throw await de_PullRequestIdRequiredExceptionRes(parsedOutput, context); - case "TitleRequiredException": - case "com.amazonaws.codecommit#TitleRequiredException": - throw await de_TitleRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateRepositoryDescriptionCommand - */ -export const de_UpdateRepositoryDescriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateRepositoryDescriptionCommandError(output, context); - } - await collectBody(output.body, context); - const response: UpdateRepositoryDescriptionCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateRepositoryDescriptionCommandError - */ -const de_UpdateRepositoryDescriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidRepositoryDescriptionException": - case "com.amazonaws.codecommit#InvalidRepositoryDescriptionException": - throw await de_InvalidRepositoryDescriptionExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateRepositoryEncryptionKeyCommand - */ -export const de_UpdateRepositoryEncryptionKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateRepositoryEncryptionKeyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateRepositoryEncryptionKeyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateRepositoryEncryptionKeyCommandError - */ -const de_UpdateRepositoryEncryptionKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EncryptionIntegrityChecksFailedException": - case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": - throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); - case "EncryptionKeyAccessDeniedException": - case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": - throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); - case "EncryptionKeyDisabledException": - case "com.amazonaws.codecommit#EncryptionKeyDisabledException": - throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); - case "EncryptionKeyInvalidIdException": - case "com.amazonaws.codecommit#EncryptionKeyInvalidIdException": - throw await de_EncryptionKeyInvalidIdExceptionRes(parsedOutput, context); - case "EncryptionKeyInvalidUsageException": - case "com.amazonaws.codecommit#EncryptionKeyInvalidUsageException": - throw await de_EncryptionKeyInvalidUsageExceptionRes(parsedOutput, context); - case "EncryptionKeyNotFoundException": - case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": - throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); case "EncryptionKeyRequiredException": case "com.amazonaws.codecommit#EncryptionKeyRequiredException": throw await de_EncryptionKeyRequiredExceptionRes(parsedOutput, context); - case "EncryptionKeyUnavailableException": - case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": - throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateRepositoryNameCommand - */ -export const de_UpdateRepositoryNameCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateRepositoryNameCommandError(output, context); - } - await collectBody(output.body, context); - const response: UpdateRepositoryNameCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateRepositoryNameCommandError - */ -const de_UpdateRepositoryNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRepositoryNameException": - case "com.amazonaws.codecommit#InvalidRepositoryNameException": - throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); - case "RepositoryDoesNotExistException": - case "com.amazonaws.codecommit#RepositoryDoesNotExistException": - throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); - case "RepositoryNameExistsException": - case "com.amazonaws.codecommit#RepositoryNameExistsException": - throw await de_RepositoryNameExistsExceptionRes(parsedOutput, context); - case "RepositoryNameRequiredException": - case "com.amazonaws.codecommit#RepositoryNameRequiredException": - throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-codedeploy/src/protocols/Aws_json1_1.ts b/clients/client-codedeploy/src/protocols/Aws_json1_1.ts index 27b28a5e3851..d0dfaea125dd 100644 --- a/clients/client-codedeploy/src/protocols/Aws_json1_1.ts +++ b/clients/client-codedeploy/src/protocols/Aws_json1_1.ts @@ -1021,7 +1021,7 @@ export const de_AddTagsToOnPremisesInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsToOnPremisesInstancesCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AddTagsToOnPremisesInstancesCommandOutput = { @@ -1030,50 +1030,6 @@ export const de_AddTagsToOnPremisesInstancesCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddTagsToOnPremisesInstancesCommandError - */ -const de_AddTagsToOnPremisesInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InstanceLimitExceededException": - case "com.amazonaws.codedeploy#InstanceLimitExceededException": - throw await de_InstanceLimitExceededExceptionRes(parsedOutput, context); - case "InstanceNameRequiredException": - case "com.amazonaws.codedeploy#InstanceNameRequiredException": - throw await de_InstanceNameRequiredExceptionRes(parsedOutput, context); - case "InstanceNotRegisteredException": - case "com.amazonaws.codedeploy#InstanceNotRegisteredException": - throw await de_InstanceNotRegisteredExceptionRes(parsedOutput, context); - case "InvalidInstanceNameException": - case "com.amazonaws.codedeploy#InvalidInstanceNameException": - throw await de_InvalidInstanceNameExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.codedeploy#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); - case "TagLimitExceededException": - case "com.amazonaws.codedeploy#TagLimitExceededException": - throw await de_TagLimitExceededExceptionRes(parsedOutput, context); - case "TagRequiredException": - case "com.amazonaws.codedeploy#TagRequiredException": - throw await de_TagRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetApplicationRevisionsCommand */ @@ -1082,7 +1038,7 @@ export const de_BatchGetApplicationRevisionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetApplicationRevisionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1094,47 +1050,6 @@ export const de_BatchGetApplicationRevisionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetApplicationRevisionsCommandError - */ -const de_BatchGetApplicationRevisionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "BatchLimitExceededException": - case "com.amazonaws.codedeploy#BatchLimitExceededException": - throw await de_BatchLimitExceededExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - case "InvalidRevisionException": - case "com.amazonaws.codedeploy#InvalidRevisionException": - throw await de_InvalidRevisionExceptionRes(parsedOutput, context); - case "RevisionRequiredException": - case "com.amazonaws.codedeploy#RevisionRequiredException": - throw await de_RevisionRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetApplicationsCommand */ @@ -1143,7 +1058,7 @@ export const de_BatchGetApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetApplicationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1155,41 +1070,6 @@ export const de_BatchGetApplicationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetApplicationsCommandError - */ -const de_BatchGetApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "BatchLimitExceededException": - case "com.amazonaws.codedeploy#BatchLimitExceededException": - throw await de_BatchLimitExceededExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetDeploymentGroupsCommand */ @@ -1198,7 +1078,7 @@ export const de_BatchGetDeploymentGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetDeploymentGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1210,50 +1090,6 @@ export const de_BatchGetDeploymentGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetDeploymentGroupsCommandError - */ -const de_BatchGetDeploymentGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "BatchLimitExceededException": - case "com.amazonaws.codedeploy#BatchLimitExceededException": - throw await de_BatchLimitExceededExceptionRes(parsedOutput, context); - case "DeploymentConfigDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentConfigDoesNotExistException": - throw await de_DeploymentConfigDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentGroupNameRequiredException": - case "com.amazonaws.codedeploy#DeploymentGroupNameRequiredException": - throw await de_DeploymentGroupNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - case "InvalidDeploymentGroupNameException": - case "com.amazonaws.codedeploy#InvalidDeploymentGroupNameException": - throw await de_InvalidDeploymentGroupNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetDeploymentInstancesCommand */ @@ -1262,7 +1098,7 @@ export const de_BatchGetDeploymentInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetDeploymentInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1274,50 +1110,6 @@ export const de_BatchGetDeploymentInstancesCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetDeploymentInstancesCommandError - */ -const de_BatchGetDeploymentInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BatchLimitExceededException": - case "com.amazonaws.codedeploy#BatchLimitExceededException": - throw await de_BatchLimitExceededExceptionRes(parsedOutput, context); - case "DeploymentDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": - throw await de_DeploymentDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentIdRequiredException": - case "com.amazonaws.codedeploy#DeploymentIdRequiredException": - throw await de_DeploymentIdRequiredExceptionRes(parsedOutput, context); - case "InstanceIdRequiredException": - case "com.amazonaws.codedeploy#InstanceIdRequiredException": - throw await de_InstanceIdRequiredExceptionRes(parsedOutput, context); - case "InvalidComputePlatformException": - case "com.amazonaws.codedeploy#InvalidComputePlatformException": - throw await de_InvalidComputePlatformExceptionRes(parsedOutput, context); - case "InvalidDeploymentIdException": - case "com.amazonaws.codedeploy#InvalidDeploymentIdException": - throw await de_InvalidDeploymentIdExceptionRes(parsedOutput, context); - case "InvalidInstanceNameException": - case "com.amazonaws.codedeploy#InvalidInstanceNameException": - throw await de_InvalidInstanceNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetDeploymentsCommand */ @@ -1326,7 +1118,7 @@ export const de_BatchGetDeploymentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetDeploymentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1339,51 +1131,39 @@ export const de_BatchGetDeploymentsCommand = async ( }; /** - * deserializeAws_json1_1BatchGetDeploymentsCommandError + * deserializeAws_json1_1BatchGetDeploymentTargetsCommand */ -const de_BatchGetDeploymentsCommandError = async ( +export const de_BatchGetDeploymentTargetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BatchLimitExceededException": - case "com.amazonaws.codedeploy#BatchLimitExceededException": - throw await de_BatchLimitExceededExceptionRes(parsedOutput, context); - case "DeploymentIdRequiredException": - case "com.amazonaws.codedeploy#DeploymentIdRequiredException": - throw await de_DeploymentIdRequiredExceptionRes(parsedOutput, context); - case "InvalidDeploymentIdException": - case "com.amazonaws.codedeploy#InvalidDeploymentIdException": - throw await de_InvalidDeploymentIdExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_BatchGetDeploymentTargetsOutput(data, context); + const response: BatchGetDeploymentTargetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1BatchGetDeploymentTargetsCommand + * deserializeAws_json1_1BatchGetOnPremisesInstancesCommand */ -export const de_BatchGetDeploymentTargetsCommand = async ( +export const de_BatchGetOnPremisesInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_BatchGetDeploymentTargetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_BatchGetDeploymentTargetsOutput(data, context); - const response: BatchGetDeploymentTargetsCommandOutput = { + contents = de_BatchGetOnPremisesInstancesOutput(data, context); + const response: BatchGetOnPremisesInstancesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1391,69 +1171,56 @@ export const de_BatchGetDeploymentTargetsCommand = async ( }; /** - * deserializeAws_json1_1BatchGetDeploymentTargetsCommandError + * deserializeAws_json1_1ContinueDeploymentCommand */ -const de_BatchGetDeploymentTargetsCommandError = async ( +export const de_ContinueDeploymentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: ContinueDeploymentCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeploymentDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": - throw await de_DeploymentDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentIdRequiredException": - case "com.amazonaws.codedeploy#DeploymentIdRequiredException": - throw await de_DeploymentIdRequiredExceptionRes(parsedOutput, context); - case "DeploymentNotStartedException": - case "com.amazonaws.codedeploy#DeploymentNotStartedException": - throw await de_DeploymentNotStartedExceptionRes(parsedOutput, context); - case "DeploymentTargetDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentTargetDoesNotExistException": - throw await de_DeploymentTargetDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentTargetIdRequiredException": - case "com.amazonaws.codedeploy#DeploymentTargetIdRequiredException": - throw await de_DeploymentTargetIdRequiredExceptionRes(parsedOutput, context); - case "DeploymentTargetListSizeExceededException": - case "com.amazonaws.codedeploy#DeploymentTargetListSizeExceededException": - throw await de_DeploymentTargetListSizeExceededExceptionRes(parsedOutput, context); - case "InstanceDoesNotExistException": - case "com.amazonaws.codedeploy#InstanceDoesNotExistException": - throw await de_InstanceDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidDeploymentIdException": - case "com.amazonaws.codedeploy#InvalidDeploymentIdException": - throw await de_InvalidDeploymentIdExceptionRes(parsedOutput, context); - case "InvalidDeploymentTargetIdException": - case "com.amazonaws.codedeploy#InvalidDeploymentTargetIdException": - throw await de_InvalidDeploymentTargetIdExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1CreateApplicationCommand + */ +export const de_CreateApplicationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateApplicationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1BatchGetOnPremisesInstancesCommand + * deserializeAws_json1_1CreateDeploymentCommand */ -export const de_BatchGetOnPremisesInstancesCommand = async ( +export const de_CreateDeploymentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_BatchGetOnPremisesInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_BatchGetOnPremisesInstancesOutput(data, context); - const response: BatchGetOnPremisesInstancesCommandOutput = { + contents = _json(data); + const response: CreateDeploymentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1461,115 +1228,93 @@ export const de_BatchGetOnPremisesInstancesCommand = async ( }; /** - * deserializeAws_json1_1BatchGetOnPremisesInstancesCommandError + * deserializeAws_json1_1CreateDeploymentConfigCommand */ -const de_BatchGetOnPremisesInstancesCommandError = async ( +export const de_CreateDeploymentConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateDeploymentConfigCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BatchLimitExceededException": - case "com.amazonaws.codedeploy#BatchLimitExceededException": - throw await de_BatchLimitExceededExceptionRes(parsedOutput, context); - case "InstanceNameRequiredException": - case "com.amazonaws.codedeploy#InstanceNameRequiredException": - throw await de_InstanceNameRequiredExceptionRes(parsedOutput, context); - case "InvalidInstanceNameException": - case "com.amazonaws.codedeploy#InvalidInstanceNameException": - throw await de_InvalidInstanceNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1CreateDeploymentGroupCommand + */ +export const de_CreateDeploymentGroupCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateDeploymentGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ContinueDeploymentCommand + * deserializeAws_json1_1DeleteApplicationCommand */ -export const de_ContinueDeploymentCommand = async ( +export const de_DeleteApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ContinueDeploymentCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: ContinueDeploymentCommandOutput = { + const response: DeleteApplicationCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1ContinueDeploymentCommandError + * deserializeAws_json1_1DeleteDeploymentConfigCommand */ -const de_ContinueDeploymentCommandError = async ( +export const de_DeleteDeploymentConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeploymentAlreadyCompletedException": - case "com.amazonaws.codedeploy#DeploymentAlreadyCompletedException": - throw await de_DeploymentAlreadyCompletedExceptionRes(parsedOutput, context); - case "DeploymentDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": - throw await de_DeploymentDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentIdRequiredException": - case "com.amazonaws.codedeploy#DeploymentIdRequiredException": - throw await de_DeploymentIdRequiredExceptionRes(parsedOutput, context); - case "DeploymentIsNotInReadyStateException": - case "com.amazonaws.codedeploy#DeploymentIsNotInReadyStateException": - throw await de_DeploymentIsNotInReadyStateExceptionRes(parsedOutput, context); - case "InvalidDeploymentIdException": - case "com.amazonaws.codedeploy#InvalidDeploymentIdException": - throw await de_InvalidDeploymentIdExceptionRes(parsedOutput, context); - case "InvalidDeploymentStatusException": - case "com.amazonaws.codedeploy#InvalidDeploymentStatusException": - throw await de_InvalidDeploymentStatusExceptionRes(parsedOutput, context); - case "InvalidDeploymentWaitTypeException": - case "com.amazonaws.codedeploy#InvalidDeploymentWaitTypeException": - throw await de_InvalidDeploymentWaitTypeExceptionRes(parsedOutput, context); - case "UnsupportedActionForDeploymentTypeException": - case "com.amazonaws.codedeploy#UnsupportedActionForDeploymentTypeException": - throw await de_UnsupportedActionForDeploymentTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteDeploymentConfigCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1CreateApplicationCommand + * deserializeAws_json1_1DeleteDeploymentGroupCommand */ -export const de_CreateApplicationCommand = async ( +export const de_DeleteDeploymentGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateApplicationCommandOutput = { + const response: DeleteDeploymentGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1577,60 +1322,39 @@ export const de_CreateApplicationCommand = async ( }; /** - * deserializeAws_json1_1CreateApplicationCommandError + * deserializeAws_json1_1DeleteGitHubAccountTokenCommand */ -const de_CreateApplicationCommandError = async ( +export const de_DeleteGitHubAccountTokenCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationAlreadyExistsException": - case "com.amazonaws.codedeploy#ApplicationAlreadyExistsException": - throw await de_ApplicationAlreadyExistsExceptionRes(parsedOutput, context); - case "ApplicationLimitExceededException": - case "com.amazonaws.codedeploy#ApplicationLimitExceededException": - throw await de_ApplicationLimitExceededExceptionRes(parsedOutput, context); - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - case "InvalidComputePlatformException": - case "com.amazonaws.codedeploy#InvalidComputePlatformException": - throw await de_InvalidComputePlatformExceptionRes(parsedOutput, context); - case "InvalidTagsToAddException": - case "com.amazonaws.codedeploy#InvalidTagsToAddException": - throw await de_InvalidTagsToAddExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteGitHubAccountTokenCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateDeploymentCommand + * deserializeAws_json1_1DeleteResourcesByExternalIdCommand */ -export const de_CreateDeploymentCommand = async ( +export const de_DeleteResourcesByExternalIdCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDeploymentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateDeploymentCommandOutput = { + const response: DeleteResourcesByExternalIdCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1638,1468 +1362,56 @@ export const de_CreateDeploymentCommand = async ( }; /** - * deserializeAws_json1_1CreateDeploymentCommandError + * deserializeAws_json1_1DeregisterOnPremisesInstanceCommand */ -const de_CreateDeploymentCommandError = async ( +export const de_DeregisterOnPremisesInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlarmsLimitExceededException": - case "com.amazonaws.codedeploy#AlarmsLimitExceededException": - throw await de_AlarmsLimitExceededExceptionRes(parsedOutput, context); - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "DeploymentConfigDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentConfigDoesNotExistException": - throw await de_DeploymentConfigDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentGroupDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentGroupDoesNotExistException": - throw await de_DeploymentGroupDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentGroupNameRequiredException": - case "com.amazonaws.codedeploy#DeploymentGroupNameRequiredException": - throw await de_DeploymentGroupNameRequiredExceptionRes(parsedOutput, context); - case "DeploymentLimitExceededException": - case "com.amazonaws.codedeploy#DeploymentLimitExceededException": - throw await de_DeploymentLimitExceededExceptionRes(parsedOutput, context); - case "DescriptionTooLongException": - case "com.amazonaws.codedeploy#DescriptionTooLongException": - throw await de_DescriptionTooLongExceptionRes(parsedOutput, context); - case "InvalidAlarmConfigException": - case "com.amazonaws.codedeploy#InvalidAlarmConfigException": - throw await de_InvalidAlarmConfigExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - case "InvalidAutoRollbackConfigException": - case "com.amazonaws.codedeploy#InvalidAutoRollbackConfigException": - throw await de_InvalidAutoRollbackConfigExceptionRes(parsedOutput, context); - case "InvalidAutoScalingGroupException": - case "com.amazonaws.codedeploy#InvalidAutoScalingGroupException": - throw await de_InvalidAutoScalingGroupExceptionRes(parsedOutput, context); - case "InvalidDeploymentConfigNameException": - case "com.amazonaws.codedeploy#InvalidDeploymentConfigNameException": - throw await de_InvalidDeploymentConfigNameExceptionRes(parsedOutput, context); - case "InvalidDeploymentGroupNameException": - case "com.amazonaws.codedeploy#InvalidDeploymentGroupNameException": - throw await de_InvalidDeploymentGroupNameExceptionRes(parsedOutput, context); - case "InvalidFileExistsBehaviorException": - case "com.amazonaws.codedeploy#InvalidFileExistsBehaviorException": - throw await de_InvalidFileExistsBehaviorExceptionRes(parsedOutput, context); - case "InvalidGitHubAccountTokenException": - case "com.amazonaws.codedeploy#InvalidGitHubAccountTokenException": - throw await de_InvalidGitHubAccountTokenExceptionRes(parsedOutput, context); - case "InvalidIgnoreApplicationStopFailuresValueException": - case "com.amazonaws.codedeploy#InvalidIgnoreApplicationStopFailuresValueException": - throw await de_InvalidIgnoreApplicationStopFailuresValueExceptionRes(parsedOutput, context); - case "InvalidLoadBalancerInfoException": - case "com.amazonaws.codedeploy#InvalidLoadBalancerInfoException": - throw await de_InvalidLoadBalancerInfoExceptionRes(parsedOutput, context); - case "InvalidRevisionException": - case "com.amazonaws.codedeploy#InvalidRevisionException": - throw await de_InvalidRevisionExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.codedeploy#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - case "InvalidTargetInstancesException": - case "com.amazonaws.codedeploy#InvalidTargetInstancesException": - throw await de_InvalidTargetInstancesExceptionRes(parsedOutput, context); - case "InvalidTrafficRoutingConfigurationException": - case "com.amazonaws.codedeploy#InvalidTrafficRoutingConfigurationException": - throw await de_InvalidTrafficRoutingConfigurationExceptionRes(parsedOutput, context); - case "InvalidUpdateOutdatedInstancesOnlyValueException": - case "com.amazonaws.codedeploy#InvalidUpdateOutdatedInstancesOnlyValueException": - throw await de_InvalidUpdateOutdatedInstancesOnlyValueExceptionRes(parsedOutput, context); - case "RevisionDoesNotExistException": - case "com.amazonaws.codedeploy#RevisionDoesNotExistException": - throw await de_RevisionDoesNotExistExceptionRes(parsedOutput, context); - case "RevisionRequiredException": - case "com.amazonaws.codedeploy#RevisionRequiredException": - throw await de_RevisionRequiredExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codedeploy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateDeploymentConfigCommand - */ -export const de_CreateDeploymentConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateDeploymentConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateDeploymentConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateDeploymentConfigCommandError - */ -const de_CreateDeploymentConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeploymentConfigAlreadyExistsException": - case "com.amazonaws.codedeploy#DeploymentConfigAlreadyExistsException": - throw await de_DeploymentConfigAlreadyExistsExceptionRes(parsedOutput, context); - case "DeploymentConfigLimitExceededException": - case "com.amazonaws.codedeploy#DeploymentConfigLimitExceededException": - throw await de_DeploymentConfigLimitExceededExceptionRes(parsedOutput, context); - case "DeploymentConfigNameRequiredException": - case "com.amazonaws.codedeploy#DeploymentConfigNameRequiredException": - throw await de_DeploymentConfigNameRequiredExceptionRes(parsedOutput, context); - case "InvalidComputePlatformException": - case "com.amazonaws.codedeploy#InvalidComputePlatformException": - throw await de_InvalidComputePlatformExceptionRes(parsedOutput, context); - case "InvalidDeploymentConfigNameException": - case "com.amazonaws.codedeploy#InvalidDeploymentConfigNameException": - throw await de_InvalidDeploymentConfigNameExceptionRes(parsedOutput, context); - case "InvalidMinimumHealthyHostValueException": - case "com.amazonaws.codedeploy#InvalidMinimumHealthyHostValueException": - throw await de_InvalidMinimumHealthyHostValueExceptionRes(parsedOutput, context); - case "InvalidTrafficRoutingConfigurationException": - case "com.amazonaws.codedeploy#InvalidTrafficRoutingConfigurationException": - throw await de_InvalidTrafficRoutingConfigurationExceptionRes(parsedOutput, context); - case "InvalidZonalDeploymentConfigurationException": - case "com.amazonaws.codedeploy#InvalidZonalDeploymentConfigurationException": - throw await de_InvalidZonalDeploymentConfigurationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateDeploymentGroupCommand - */ -export const de_CreateDeploymentGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateDeploymentGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateDeploymentGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateDeploymentGroupCommandError - */ -const de_CreateDeploymentGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlarmsLimitExceededException": - case "com.amazonaws.codedeploy#AlarmsLimitExceededException": - throw await de_AlarmsLimitExceededExceptionRes(parsedOutput, context); - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "DeploymentConfigDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentConfigDoesNotExistException": - throw await de_DeploymentConfigDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentGroupAlreadyExistsException": - case "com.amazonaws.codedeploy#DeploymentGroupAlreadyExistsException": - throw await de_DeploymentGroupAlreadyExistsExceptionRes(parsedOutput, context); - case "DeploymentGroupLimitExceededException": - case "com.amazonaws.codedeploy#DeploymentGroupLimitExceededException": - throw await de_DeploymentGroupLimitExceededExceptionRes(parsedOutput, context); - case "DeploymentGroupNameRequiredException": - case "com.amazonaws.codedeploy#DeploymentGroupNameRequiredException": - throw await de_DeploymentGroupNameRequiredExceptionRes(parsedOutput, context); - case "ECSServiceMappingLimitExceededException": - case "com.amazonaws.codedeploy#ECSServiceMappingLimitExceededException": - throw await de_ECSServiceMappingLimitExceededExceptionRes(parsedOutput, context); - case "InvalidAlarmConfigException": - case "com.amazonaws.codedeploy#InvalidAlarmConfigException": - throw await de_InvalidAlarmConfigExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - case "InvalidAutoRollbackConfigException": - case "com.amazonaws.codedeploy#InvalidAutoRollbackConfigException": - throw await de_InvalidAutoRollbackConfigExceptionRes(parsedOutput, context); - case "InvalidAutoScalingGroupException": - case "com.amazonaws.codedeploy#InvalidAutoScalingGroupException": - throw await de_InvalidAutoScalingGroupExceptionRes(parsedOutput, context); - case "InvalidBlueGreenDeploymentConfigurationException": - case "com.amazonaws.codedeploy#InvalidBlueGreenDeploymentConfigurationException": - throw await de_InvalidBlueGreenDeploymentConfigurationExceptionRes(parsedOutput, context); - case "InvalidDeploymentConfigNameException": - case "com.amazonaws.codedeploy#InvalidDeploymentConfigNameException": - throw await de_InvalidDeploymentConfigNameExceptionRes(parsedOutput, context); - case "InvalidDeploymentGroupNameException": - case "com.amazonaws.codedeploy#InvalidDeploymentGroupNameException": - throw await de_InvalidDeploymentGroupNameExceptionRes(parsedOutput, context); - case "InvalidDeploymentStyleException": - case "com.amazonaws.codedeploy#InvalidDeploymentStyleException": - throw await de_InvalidDeploymentStyleExceptionRes(parsedOutput, context); - case "InvalidEC2TagCombinationException": - case "com.amazonaws.codedeploy#InvalidEC2TagCombinationException": - throw await de_InvalidEC2TagCombinationExceptionRes(parsedOutput, context); - case "InvalidEC2TagException": - case "com.amazonaws.codedeploy#InvalidEC2TagException": - throw await de_InvalidEC2TagExceptionRes(parsedOutput, context); - case "InvalidECSServiceException": - case "com.amazonaws.codedeploy#InvalidECSServiceException": - throw await de_InvalidECSServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codedeploy#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidLoadBalancerInfoException": - case "com.amazonaws.codedeploy#InvalidLoadBalancerInfoException": - throw await de_InvalidLoadBalancerInfoExceptionRes(parsedOutput, context); - case "InvalidOnPremisesTagCombinationException": - case "com.amazonaws.codedeploy#InvalidOnPremisesTagCombinationException": - throw await de_InvalidOnPremisesTagCombinationExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.codedeploy#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.codedeploy#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); - case "InvalidTagsToAddException": - case "com.amazonaws.codedeploy#InvalidTagsToAddException": - throw await de_InvalidTagsToAddExceptionRes(parsedOutput, context); - case "InvalidTargetGroupPairException": - case "com.amazonaws.codedeploy#InvalidTargetGroupPairException": - throw await de_InvalidTargetGroupPairExceptionRes(parsedOutput, context); - case "InvalidTrafficRoutingConfigurationException": - case "com.amazonaws.codedeploy#InvalidTrafficRoutingConfigurationException": - throw await de_InvalidTrafficRoutingConfigurationExceptionRes(parsedOutput, context); - case "InvalidTriggerConfigException": - case "com.amazonaws.codedeploy#InvalidTriggerConfigException": - throw await de_InvalidTriggerConfigExceptionRes(parsedOutput, context); - case "LifecycleHookLimitExceededException": - case "com.amazonaws.codedeploy#LifecycleHookLimitExceededException": - throw await de_LifecycleHookLimitExceededExceptionRes(parsedOutput, context); - case "RoleRequiredException": - case "com.amazonaws.codedeploy#RoleRequiredException": - throw await de_RoleRequiredExceptionRes(parsedOutput, context); - case "TagSetListLimitExceededException": - case "com.amazonaws.codedeploy#TagSetListLimitExceededException": - throw await de_TagSetListLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codedeploy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TriggerTargetsLimitExceededException": - case "com.amazonaws.codedeploy#TriggerTargetsLimitExceededException": - throw await de_TriggerTargetsLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteApplicationCommand - */ -export const de_DeleteApplicationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteApplicationCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteApplicationCommandError - */ -const de_DeleteApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.codedeploy#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDeploymentConfigCommand - */ -export const de_DeleteDeploymentConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDeploymentConfigCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteDeploymentConfigCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDeploymentConfigCommandError - */ -const de_DeleteDeploymentConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeploymentConfigInUseException": - case "com.amazonaws.codedeploy#DeploymentConfigInUseException": - throw await de_DeploymentConfigInUseExceptionRes(parsedOutput, context); - case "DeploymentConfigNameRequiredException": - case "com.amazonaws.codedeploy#DeploymentConfigNameRequiredException": - throw await de_DeploymentConfigNameRequiredExceptionRes(parsedOutput, context); - case "InvalidDeploymentConfigNameException": - case "com.amazonaws.codedeploy#InvalidDeploymentConfigNameException": - throw await de_InvalidDeploymentConfigNameExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.codedeploy#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDeploymentGroupCommand - */ -export const de_DeleteDeploymentGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDeploymentGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteDeploymentGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDeploymentGroupCommandError - */ -const de_DeleteDeploymentGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "DeploymentGroupNameRequiredException": - case "com.amazonaws.codedeploy#DeploymentGroupNameRequiredException": - throw await de_DeploymentGroupNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - case "InvalidDeploymentGroupNameException": - case "com.amazonaws.codedeploy#InvalidDeploymentGroupNameException": - throw await de_InvalidDeploymentGroupNameExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.codedeploy#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteGitHubAccountTokenCommand - */ -export const de_DeleteGitHubAccountTokenCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteGitHubAccountTokenCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteGitHubAccountTokenCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteGitHubAccountTokenCommandError - */ -const de_DeleteGitHubAccountTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GitHubAccountTokenDoesNotExistException": - case "com.amazonaws.codedeploy#GitHubAccountTokenDoesNotExistException": - throw await de_GitHubAccountTokenDoesNotExistExceptionRes(parsedOutput, context); - case "GitHubAccountTokenNameRequiredException": - case "com.amazonaws.codedeploy#GitHubAccountTokenNameRequiredException": - throw await de_GitHubAccountTokenNameRequiredExceptionRes(parsedOutput, context); - case "InvalidGitHubAccountTokenNameException": - case "com.amazonaws.codedeploy#InvalidGitHubAccountTokenNameException": - throw await de_InvalidGitHubAccountTokenNameExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.codedeploy#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceValidationException": - case "com.amazonaws.codedeploy#ResourceValidationException": - throw await de_ResourceValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteResourcesByExternalIdCommand - */ -export const de_DeleteResourcesByExternalIdCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteResourcesByExternalIdCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteResourcesByExternalIdCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteResourcesByExternalIdCommandError - */ -const de_DeleteResourcesByExternalIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1DeregisterOnPremisesInstanceCommand - */ -export const de_DeregisterOnPremisesInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeregisterOnPremisesInstanceCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeregisterOnPremisesInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeregisterOnPremisesInstanceCommandError - */ -const de_DeregisterOnPremisesInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InstanceNameRequiredException": - case "com.amazonaws.codedeploy#InstanceNameRequiredException": - throw await de_InstanceNameRequiredExceptionRes(parsedOutput, context); - case "InvalidInstanceNameException": - case "com.amazonaws.codedeploy#InvalidInstanceNameException": - throw await de_InvalidInstanceNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetApplicationCommand - */ -export const de_GetApplicationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetApplicationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetApplicationOutput(data, context); - const response: GetApplicationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetApplicationCommandError - */ -const de_GetApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetApplicationRevisionCommand - */ -export const de_GetApplicationRevisionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetApplicationRevisionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetApplicationRevisionOutput(data, context); - const response: GetApplicationRevisionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetApplicationRevisionCommandError - */ -const de_GetApplicationRevisionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - case "InvalidRevisionException": - case "com.amazonaws.codedeploy#InvalidRevisionException": - throw await de_InvalidRevisionExceptionRes(parsedOutput, context); - case "RevisionDoesNotExistException": - case "com.amazonaws.codedeploy#RevisionDoesNotExistException": - throw await de_RevisionDoesNotExistExceptionRes(parsedOutput, context); - case "RevisionRequiredException": - case "com.amazonaws.codedeploy#RevisionRequiredException": - throw await de_RevisionRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDeploymentCommand - */ -export const de_GetDeploymentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDeploymentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDeploymentOutput(data, context); - const response: GetDeploymentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDeploymentCommandError - */ -const de_GetDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeploymentDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": - throw await de_DeploymentDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentIdRequiredException": - case "com.amazonaws.codedeploy#DeploymentIdRequiredException": - throw await de_DeploymentIdRequiredExceptionRes(parsedOutput, context); - case "InvalidDeploymentIdException": - case "com.amazonaws.codedeploy#InvalidDeploymentIdException": - throw await de_InvalidDeploymentIdExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDeploymentConfigCommand - */ -export const de_GetDeploymentConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDeploymentConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDeploymentConfigOutput(data, context); - const response: GetDeploymentConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDeploymentConfigCommandError - */ -const de_GetDeploymentConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeploymentConfigDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentConfigDoesNotExistException": - throw await de_DeploymentConfigDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentConfigNameRequiredException": - case "com.amazonaws.codedeploy#DeploymentConfigNameRequiredException": - throw await de_DeploymentConfigNameRequiredExceptionRes(parsedOutput, context); - case "InvalidComputePlatformException": - case "com.amazonaws.codedeploy#InvalidComputePlatformException": - throw await de_InvalidComputePlatformExceptionRes(parsedOutput, context); - case "InvalidDeploymentConfigNameException": - case "com.amazonaws.codedeploy#InvalidDeploymentConfigNameException": - throw await de_InvalidDeploymentConfigNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDeploymentGroupCommand - */ -export const de_GetDeploymentGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDeploymentGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDeploymentGroupOutput(data, context); - const response: GetDeploymentGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDeploymentGroupCommandError - */ -const de_GetDeploymentGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "DeploymentConfigDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentConfigDoesNotExistException": - throw await de_DeploymentConfigDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentGroupDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentGroupDoesNotExistException": - throw await de_DeploymentGroupDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentGroupNameRequiredException": - case "com.amazonaws.codedeploy#DeploymentGroupNameRequiredException": - throw await de_DeploymentGroupNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - case "InvalidDeploymentGroupNameException": - case "com.amazonaws.codedeploy#InvalidDeploymentGroupNameException": - throw await de_InvalidDeploymentGroupNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDeploymentInstanceCommand - */ -export const de_GetDeploymentInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDeploymentInstanceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDeploymentInstanceOutput(data, context); - const response: GetDeploymentInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDeploymentInstanceCommandError - */ -const de_GetDeploymentInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeploymentDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": - throw await de_DeploymentDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentIdRequiredException": - case "com.amazonaws.codedeploy#DeploymentIdRequiredException": - throw await de_DeploymentIdRequiredExceptionRes(parsedOutput, context); - case "InstanceDoesNotExistException": - case "com.amazonaws.codedeploy#InstanceDoesNotExistException": - throw await de_InstanceDoesNotExistExceptionRes(parsedOutput, context); - case "InstanceIdRequiredException": - case "com.amazonaws.codedeploy#InstanceIdRequiredException": - throw await de_InstanceIdRequiredExceptionRes(parsedOutput, context); - case "InvalidComputePlatformException": - case "com.amazonaws.codedeploy#InvalidComputePlatformException": - throw await de_InvalidComputePlatformExceptionRes(parsedOutput, context); - case "InvalidDeploymentIdException": - case "com.amazonaws.codedeploy#InvalidDeploymentIdException": - throw await de_InvalidDeploymentIdExceptionRes(parsedOutput, context); - case "InvalidInstanceNameException": - case "com.amazonaws.codedeploy#InvalidInstanceNameException": - throw await de_InvalidInstanceNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDeploymentTargetCommand - */ -export const de_GetDeploymentTargetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDeploymentTargetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDeploymentTargetOutput(data, context); - const response: GetDeploymentTargetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDeploymentTargetCommandError - */ -const de_GetDeploymentTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeploymentDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": - throw await de_DeploymentDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentIdRequiredException": - case "com.amazonaws.codedeploy#DeploymentIdRequiredException": - throw await de_DeploymentIdRequiredExceptionRes(parsedOutput, context); - case "DeploymentNotStartedException": - case "com.amazonaws.codedeploy#DeploymentNotStartedException": - throw await de_DeploymentNotStartedExceptionRes(parsedOutput, context); - case "DeploymentTargetDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentTargetDoesNotExistException": - throw await de_DeploymentTargetDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentTargetIdRequiredException": - case "com.amazonaws.codedeploy#DeploymentTargetIdRequiredException": - throw await de_DeploymentTargetIdRequiredExceptionRes(parsedOutput, context); - case "InvalidDeploymentIdException": - case "com.amazonaws.codedeploy#InvalidDeploymentIdException": - throw await de_InvalidDeploymentIdExceptionRes(parsedOutput, context); - case "InvalidDeploymentTargetIdException": - case "com.amazonaws.codedeploy#InvalidDeploymentTargetIdException": - throw await de_InvalidDeploymentTargetIdExceptionRes(parsedOutput, context); - case "InvalidInstanceNameException": - case "com.amazonaws.codedeploy#InvalidInstanceNameException": - throw await de_InvalidInstanceNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetOnPremisesInstanceCommand - */ -export const de_GetOnPremisesInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetOnPremisesInstanceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetOnPremisesInstanceOutput(data, context); - const response: GetOnPremisesInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetOnPremisesInstanceCommandError - */ -const de_GetOnPremisesInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InstanceNameRequiredException": - case "com.amazonaws.codedeploy#InstanceNameRequiredException": - throw await de_InstanceNameRequiredExceptionRes(parsedOutput, context); - case "InstanceNotRegisteredException": - case "com.amazonaws.codedeploy#InstanceNotRegisteredException": - throw await de_InstanceNotRegisteredExceptionRes(parsedOutput, context); - case "InvalidInstanceNameException": - case "com.amazonaws.codedeploy#InvalidInstanceNameException": - throw await de_InvalidInstanceNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListApplicationRevisionsCommand - */ -export const de_ListApplicationRevisionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListApplicationRevisionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListApplicationRevisionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListApplicationRevisionsCommandError - */ -const de_ListApplicationRevisionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "BucketNameFilterRequiredException": - case "com.amazonaws.codedeploy#BucketNameFilterRequiredException": - throw await de_BucketNameFilterRequiredExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - case "InvalidBucketNameFilterException": - case "com.amazonaws.codedeploy#InvalidBucketNameFilterException": - throw await de_InvalidBucketNameFilterExceptionRes(parsedOutput, context); - case "InvalidDeployedStateFilterException": - case "com.amazonaws.codedeploy#InvalidDeployedStateFilterException": - throw await de_InvalidDeployedStateFilterExceptionRes(parsedOutput, context); - case "InvalidKeyPrefixFilterException": - case "com.amazonaws.codedeploy#InvalidKeyPrefixFilterException": - throw await de_InvalidKeyPrefixFilterExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.codedeploy#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidSortByException": - case "com.amazonaws.codedeploy#InvalidSortByException": - throw await de_InvalidSortByExceptionRes(parsedOutput, context); - case "InvalidSortOrderException": - case "com.amazonaws.codedeploy#InvalidSortOrderException": - throw await de_InvalidSortOrderExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListApplicationsCommand - */ -export const de_ListApplicationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListApplicationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListApplicationsCommandError - */ -const de_ListApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codedeploy#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDeploymentConfigsCommand - */ -export const de_ListDeploymentConfigsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDeploymentConfigsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListDeploymentConfigsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDeploymentConfigsCommandError - */ -const de_ListDeploymentConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codedeploy#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDeploymentGroupsCommand - */ -export const de_ListDeploymentGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDeploymentGroupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListDeploymentGroupsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDeploymentGroupsCommandError - */ -const de_ListDeploymentGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.codedeploy#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDeploymentInstancesCommand - */ -export const de_ListDeploymentInstancesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDeploymentInstancesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListDeploymentInstancesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeregisterOnPremisesInstanceCommandOutput = { + $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1ListDeploymentInstancesCommandError - */ -const de_ListDeploymentInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeploymentDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": - throw await de_DeploymentDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentIdRequiredException": - case "com.amazonaws.codedeploy#DeploymentIdRequiredException": - throw await de_DeploymentIdRequiredExceptionRes(parsedOutput, context); - case "DeploymentNotStartedException": - case "com.amazonaws.codedeploy#DeploymentNotStartedException": - throw await de_DeploymentNotStartedExceptionRes(parsedOutput, context); - case "InvalidComputePlatformException": - case "com.amazonaws.codedeploy#InvalidComputePlatformException": - throw await de_InvalidComputePlatformExceptionRes(parsedOutput, context); - case "InvalidDeploymentIdException": - case "com.amazonaws.codedeploy#InvalidDeploymentIdException": - throw await de_InvalidDeploymentIdExceptionRes(parsedOutput, context); - case "InvalidDeploymentInstanceTypeException": - case "com.amazonaws.codedeploy#InvalidDeploymentInstanceTypeException": - throw await de_InvalidDeploymentInstanceTypeExceptionRes(parsedOutput, context); - case "InvalidInstanceStatusException": - case "com.amazonaws.codedeploy#InvalidInstanceStatusException": - throw await de_InvalidInstanceStatusExceptionRes(parsedOutput, context); - case "InvalidInstanceTypeException": - case "com.amazonaws.codedeploy#InvalidInstanceTypeException": - throw await de_InvalidInstanceTypeExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.codedeploy#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidTargetFilterNameException": - case "com.amazonaws.codedeploy#InvalidTargetFilterNameException": - throw await de_InvalidTargetFilterNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDeploymentsCommand + * deserializeAws_json1_1GetApplicationCommand */ -export const de_ListDeploymentsCommand = async ( +export const de_GetApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDeploymentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListDeploymentsCommandOutput = { + contents = de_GetApplicationOutput(data, context); + const response: GetApplicationCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDeploymentsCommandError - */ -const de_ListDeploymentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "DeploymentGroupDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentGroupDoesNotExistException": - throw await de_DeploymentGroupDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentGroupNameRequiredException": - case "com.amazonaws.codedeploy#DeploymentGroupNameRequiredException": - throw await de_DeploymentGroupNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - case "InvalidDeploymentGroupNameException": - case "com.amazonaws.codedeploy#InvalidDeploymentGroupNameException": - throw await de_InvalidDeploymentGroupNameExceptionRes(parsedOutput, context); - case "InvalidDeploymentStatusException": - case "com.amazonaws.codedeploy#InvalidDeploymentStatusException": - throw await de_InvalidDeploymentStatusExceptionRes(parsedOutput, context); - case "InvalidExternalIdException": - case "com.amazonaws.codedeploy#InvalidExternalIdException": - throw await de_InvalidExternalIdExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codedeploy#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.codedeploy#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidTimeRangeException": - case "com.amazonaws.codedeploy#InvalidTimeRangeException": - throw await de_InvalidTimeRangeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListDeploymentTargetsCommand + * deserializeAws_json1_1GetApplicationRevisionCommand */ -export const de_ListDeploymentTargetsCommand = async ( +export const de_GetApplicationRevisionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDeploymentTargetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListDeploymentTargetsCommandOutput = { + contents = de_GetApplicationRevisionOutput(data, context); + const response: GetApplicationRevisionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3107,69 +1419,39 @@ export const de_ListDeploymentTargetsCommand = async ( }; /** - * deserializeAws_json1_1ListDeploymentTargetsCommandError + * deserializeAws_json1_1GetDeploymentCommand */ -const de_ListDeploymentTargetsCommandError = async ( +export const de_GetDeploymentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeploymentDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": - throw await de_DeploymentDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentIdRequiredException": - case "com.amazonaws.codedeploy#DeploymentIdRequiredException": - throw await de_DeploymentIdRequiredExceptionRes(parsedOutput, context); - case "DeploymentNotStartedException": - case "com.amazonaws.codedeploy#DeploymentNotStartedException": - throw await de_DeploymentNotStartedExceptionRes(parsedOutput, context); - case "InvalidDeploymentIdException": - case "com.amazonaws.codedeploy#InvalidDeploymentIdException": - throw await de_InvalidDeploymentIdExceptionRes(parsedOutput, context); - case "InvalidDeploymentInstanceTypeException": - case "com.amazonaws.codedeploy#InvalidDeploymentInstanceTypeException": - throw await de_InvalidDeploymentInstanceTypeExceptionRes(parsedOutput, context); - case "InvalidInstanceStatusException": - case "com.amazonaws.codedeploy#InvalidInstanceStatusException": - throw await de_InvalidInstanceStatusExceptionRes(parsedOutput, context); - case "InvalidInstanceTypeException": - case "com.amazonaws.codedeploy#InvalidInstanceTypeException": - throw await de_InvalidInstanceTypeExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.codedeploy#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidTargetFilterNameException": - case "com.amazonaws.codedeploy#InvalidTargetFilterNameException": - throw await de_InvalidTargetFilterNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetDeploymentOutput(data, context); + const response: GetDeploymentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListGitHubAccountTokenNamesCommand + * deserializeAws_json1_1GetDeploymentConfigCommand */ -export const de_ListGitHubAccountTokenNamesCommand = async ( +export const de_GetDeploymentConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListGitHubAccountTokenNamesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListGitHubAccountTokenNamesCommandOutput = { + contents = de_GetDeploymentConfigOutput(data, context); + const response: GetDeploymentConfigCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3177,51 +1459,39 @@ export const de_ListGitHubAccountTokenNamesCommand = async ( }; /** - * deserializeAws_json1_1ListGitHubAccountTokenNamesCommandError + * deserializeAws_json1_1GetDeploymentGroupCommand */ -const de_ListGitHubAccountTokenNamesCommandError = async ( +export const de_GetDeploymentGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codedeploy#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.codedeploy#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceValidationException": - case "com.amazonaws.codedeploy#ResourceValidationException": - throw await de_ResourceValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetDeploymentGroupOutput(data, context); + const response: GetDeploymentGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListOnPremisesInstancesCommand + * deserializeAws_json1_1GetDeploymentInstanceCommand */ -export const de_ListOnPremisesInstancesCommand = async ( +export const de_GetDeploymentInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListOnPremisesInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListOnPremisesInstancesCommandOutput = { + contents = de_GetDeploymentInstanceOutput(data, context); + const response: GetDeploymentInstanceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3229,51 +1499,39 @@ export const de_ListOnPremisesInstancesCommand = async ( }; /** - * deserializeAws_json1_1ListOnPremisesInstancesCommandError + * deserializeAws_json1_1GetDeploymentTargetCommand */ -const de_ListOnPremisesInstancesCommandError = async ( +export const de_GetDeploymentTargetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codedeploy#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidRegistrationStatusException": - case "com.amazonaws.codedeploy#InvalidRegistrationStatusException": - throw await de_InvalidRegistrationStatusExceptionRes(parsedOutput, context); - case "InvalidTagFilterException": - case "com.amazonaws.codedeploy#InvalidTagFilterException": - throw await de_InvalidTagFilterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetDeploymentTargetOutput(data, context); + const response: GetDeploymentTargetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1GetOnPremisesInstanceCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_GetOnPremisesInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_GetOnPremisesInstanceOutput(data, context); + const response: GetOnPremisesInstanceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3281,51 +1539,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1ListApplicationRevisionsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListApplicationRevisionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArnNotSupportedException": - case "com.amazonaws.codedeploy#ArnNotSupportedException": - throw await de_ArnNotSupportedExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.codedeploy#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "ResourceArnRequiredException": - case "com.amazonaws.codedeploy#ResourceArnRequiredException": - throw await de_ResourceArnRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListApplicationRevisionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutLifecycleEventHookExecutionStatusCommand + * deserializeAws_json1_1ListApplicationsCommand */ -export const de_PutLifecycleEventHookExecutionStatusCommand = async ( +export const de_ListApplicationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutLifecycleEventHookExecutionStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutLifecycleEventHookExecutionStatusCommandOutput = { + const response: ListApplicationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3333,371 +1579,267 @@ export const de_PutLifecycleEventHookExecutionStatusCommand = async ( }; /** - * deserializeAws_json1_1PutLifecycleEventHookExecutionStatusCommandError + * deserializeAws_json1_1ListDeploymentConfigsCommand */ -const de_PutLifecycleEventHookExecutionStatusCommandError = async ( +export const de_ListDeploymentConfigsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListDeploymentConfigsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeploymentDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": - throw await de_DeploymentDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentIdRequiredException": - case "com.amazonaws.codedeploy#DeploymentIdRequiredException": - throw await de_DeploymentIdRequiredExceptionRes(parsedOutput, context); - case "InvalidDeploymentIdException": - case "com.amazonaws.codedeploy#InvalidDeploymentIdException": - throw await de_InvalidDeploymentIdExceptionRes(parsedOutput, context); - case "InvalidLifecycleEventHookExecutionIdException": - case "com.amazonaws.codedeploy#InvalidLifecycleEventHookExecutionIdException": - throw await de_InvalidLifecycleEventHookExecutionIdExceptionRes(parsedOutput, context); - case "InvalidLifecycleEventHookExecutionStatusException": - case "com.amazonaws.codedeploy#InvalidLifecycleEventHookExecutionStatusException": - throw await de_InvalidLifecycleEventHookExecutionStatusExceptionRes(parsedOutput, context); - case "LifecycleEventAlreadyCompletedException": - case "com.amazonaws.codedeploy#LifecycleEventAlreadyCompletedException": - throw await de_LifecycleEventAlreadyCompletedExceptionRes(parsedOutput, context); - case "UnsupportedActionForDeploymentTypeException": - case "com.amazonaws.codedeploy#UnsupportedActionForDeploymentTypeException": - throw await de_UnsupportedActionForDeploymentTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1ListDeploymentGroupsCommand + */ +export const de_ListDeploymentGroupsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListDeploymentGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RegisterApplicationRevisionCommand + * deserializeAws_json1_1ListDeploymentInstancesCommand */ -export const de_RegisterApplicationRevisionCommand = async ( +export const de_ListDeploymentInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RegisterApplicationRevisionCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: RegisterApplicationRevisionCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListDeploymentInstancesCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1RegisterApplicationRevisionCommandError + * deserializeAws_json1_1ListDeploymentsCommand */ -const de_RegisterApplicationRevisionCommandError = async ( +export const de_ListDeploymentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "DescriptionTooLongException": - case "com.amazonaws.codedeploy#DescriptionTooLongException": - throw await de_DescriptionTooLongExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - case "InvalidRevisionException": - case "com.amazonaws.codedeploy#InvalidRevisionException": - throw await de_InvalidRevisionExceptionRes(parsedOutput, context); - case "RevisionRequiredException": - case "com.amazonaws.codedeploy#RevisionRequiredException": - throw await de_RevisionRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListDeploymentsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RegisterOnPremisesInstanceCommand + * deserializeAws_json1_1ListDeploymentTargetsCommand */ -export const de_RegisterOnPremisesInstanceCommand = async ( +export const de_ListDeploymentTargetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RegisterOnPremisesInstanceCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: RegisterOnPremisesInstanceCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListDeploymentTargetsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1RegisterOnPremisesInstanceCommandError + * deserializeAws_json1_1ListGitHubAccountTokenNamesCommand */ -const de_RegisterOnPremisesInstanceCommandError = async ( +export const de_ListGitHubAccountTokenNamesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IamArnRequiredException": - case "com.amazonaws.codedeploy#IamArnRequiredException": - throw await de_IamArnRequiredExceptionRes(parsedOutput, context); - case "IamSessionArnAlreadyRegisteredException": - case "com.amazonaws.codedeploy#IamSessionArnAlreadyRegisteredException": - throw await de_IamSessionArnAlreadyRegisteredExceptionRes(parsedOutput, context); - case "IamUserArnAlreadyRegisteredException": - case "com.amazonaws.codedeploy#IamUserArnAlreadyRegisteredException": - throw await de_IamUserArnAlreadyRegisteredExceptionRes(parsedOutput, context); - case "IamUserArnRequiredException": - case "com.amazonaws.codedeploy#IamUserArnRequiredException": - throw await de_IamUserArnRequiredExceptionRes(parsedOutput, context); - case "InstanceNameAlreadyRegisteredException": - case "com.amazonaws.codedeploy#InstanceNameAlreadyRegisteredException": - throw await de_InstanceNameAlreadyRegisteredExceptionRes(parsedOutput, context); - case "InstanceNameRequiredException": - case "com.amazonaws.codedeploy#InstanceNameRequiredException": - throw await de_InstanceNameRequiredExceptionRes(parsedOutput, context); - case "InvalidIamSessionArnException": - case "com.amazonaws.codedeploy#InvalidIamSessionArnException": - throw await de_InvalidIamSessionArnExceptionRes(parsedOutput, context); - case "InvalidIamUserArnException": - case "com.amazonaws.codedeploy#InvalidIamUserArnException": - throw await de_InvalidIamUserArnExceptionRes(parsedOutput, context); - case "InvalidInstanceNameException": - case "com.amazonaws.codedeploy#InvalidInstanceNameException": - throw await de_InvalidInstanceNameExceptionRes(parsedOutput, context); - case "MultipleIamArnsProvidedException": - case "com.amazonaws.codedeploy#MultipleIamArnsProvidedException": - throw await de_MultipleIamArnsProvidedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListGitHubAccountTokenNamesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RemoveTagsFromOnPremisesInstancesCommand + * deserializeAws_json1_1ListOnPremisesInstancesCommand */ -export const de_RemoveTagsFromOnPremisesInstancesCommand = async ( +export const de_ListOnPremisesInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RemoveTagsFromOnPremisesInstancesCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: RemoveTagsFromOnPremisesInstancesCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListOnPremisesInstancesCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1RemoveTagsFromOnPremisesInstancesCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_RemoveTagsFromOnPremisesInstancesCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InstanceLimitExceededException": - case "com.amazonaws.codedeploy#InstanceLimitExceededException": - throw await de_InstanceLimitExceededExceptionRes(parsedOutput, context); - case "InstanceNameRequiredException": - case "com.amazonaws.codedeploy#InstanceNameRequiredException": - throw await de_InstanceNameRequiredExceptionRes(parsedOutput, context); - case "InstanceNotRegisteredException": - case "com.amazonaws.codedeploy#InstanceNotRegisteredException": - throw await de_InstanceNotRegisteredExceptionRes(parsedOutput, context); - case "InvalidInstanceNameException": - case "com.amazonaws.codedeploy#InvalidInstanceNameException": - throw await de_InvalidInstanceNameExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.codedeploy#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); - case "TagLimitExceededException": - case "com.amazonaws.codedeploy#TagLimitExceededException": - throw await de_TagLimitExceededExceptionRes(parsedOutput, context); - case "TagRequiredException": - case "com.amazonaws.codedeploy#TagRequiredException": - throw await de_TagRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1PutLifecycleEventHookExecutionStatusCommand + */ +export const de_PutLifecycleEventHookExecutionStatusCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutLifecycleEventHookExecutionStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SkipWaitTimeForInstanceTerminationCommand + * deserializeAws_json1_1RegisterApplicationRevisionCommand */ -export const de_SkipWaitTimeForInstanceTerminationCommand = async ( +export const de_RegisterApplicationRevisionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SkipWaitTimeForInstanceTerminationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: SkipWaitTimeForInstanceTerminationCommandOutput = { + const response: RegisterApplicationRevisionCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1SkipWaitTimeForInstanceTerminationCommandError + * deserializeAws_json1_1RegisterOnPremisesInstanceCommand */ -const de_SkipWaitTimeForInstanceTerminationCommandError = async ( +export const de_RegisterOnPremisesInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeploymentAlreadyCompletedException": - case "com.amazonaws.codedeploy#DeploymentAlreadyCompletedException": - throw await de_DeploymentAlreadyCompletedExceptionRes(parsedOutput, context); - case "DeploymentDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": - throw await de_DeploymentDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentIdRequiredException": - case "com.amazonaws.codedeploy#DeploymentIdRequiredException": - throw await de_DeploymentIdRequiredExceptionRes(parsedOutput, context); - case "DeploymentNotStartedException": - case "com.amazonaws.codedeploy#DeploymentNotStartedException": - throw await de_DeploymentNotStartedExceptionRes(parsedOutput, context); - case "InvalidDeploymentIdException": - case "com.amazonaws.codedeploy#InvalidDeploymentIdException": - throw await de_InvalidDeploymentIdExceptionRes(parsedOutput, context); - case "UnsupportedActionForDeploymentTypeException": - case "com.amazonaws.codedeploy#UnsupportedActionForDeploymentTypeException": - throw await de_UnsupportedActionForDeploymentTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: RegisterOnPremisesInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1StopDeploymentCommand + * deserializeAws_json1_1RemoveTagsFromOnPremisesInstancesCommand */ -export const de_StopDeploymentCommand = async ( +export const de_RemoveTagsFromOnPremisesInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopDeploymentCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StopDeploymentCommandOutput = { + await collectBody(output.body, context); + const response: RemoveTagsFromOnPremisesInstancesCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1StopDeploymentCommandError + * deserializeAws_json1_1SkipWaitTimeForInstanceTerminationCommand */ -const de_StopDeploymentCommandError = async ( +export const de_SkipWaitTimeForInstanceTerminationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeploymentAlreadyCompletedException": - case "com.amazonaws.codedeploy#DeploymentAlreadyCompletedException": - throw await de_DeploymentAlreadyCompletedExceptionRes(parsedOutput, context); - case "DeploymentDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": - throw await de_DeploymentDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentGroupDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentGroupDoesNotExistException": - throw await de_DeploymentGroupDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentIdRequiredException": - case "com.amazonaws.codedeploy#DeploymentIdRequiredException": - throw await de_DeploymentIdRequiredExceptionRes(parsedOutput, context); - case "InvalidDeploymentIdException": - case "com.amazonaws.codedeploy#InvalidDeploymentIdException": - throw await de_InvalidDeploymentIdExceptionRes(parsedOutput, context); - case "UnsupportedActionForDeploymentTypeException": - case "com.amazonaws.codedeploy#UnsupportedActionForDeploymentTypeException": - throw await de_UnsupportedActionForDeploymentTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: SkipWaitTimeForInstanceTerminationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1StopDeploymentCommand */ -export const de_TagResourceCommand = async ( +export const de_StopDeploymentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: StopDeploymentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3705,50 +1847,23 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ArnNotSupportedException": - case "com.amazonaws.codedeploy#ArnNotSupportedException": - throw await de_ArnNotSupportedExceptionRes(parsedOutput, context); - case "DeploymentConfigDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentConfigDoesNotExistException": - throw await de_DeploymentConfigDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentGroupDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentGroupDoesNotExistException": - throw await de_DeploymentGroupDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.codedeploy#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidTagsToAddException": - case "com.amazonaws.codedeploy#InvalidTagsToAddException": - throw await de_InvalidTagsToAddExceptionRes(parsedOutput, context); - case "ResourceArnRequiredException": - case "com.amazonaws.codedeploy#ResourceArnRequiredException": - throw await de_ResourceArnRequiredExceptionRes(parsedOutput, context); - case "TagRequiredException": - case "com.amazonaws.codedeploy#TagRequiredException": - throw await de_TagRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3759,7 +1874,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3771,53 +1886,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ArnNotSupportedException": - case "com.amazonaws.codedeploy#ArnNotSupportedException": - throw await de_ArnNotSupportedExceptionRes(parsedOutput, context); - case "DeploymentConfigDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentConfigDoesNotExistException": - throw await de_DeploymentConfigDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentGroupDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentGroupDoesNotExistException": - throw await de_DeploymentGroupDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.codedeploy#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidTagsToAddException": - case "com.amazonaws.codedeploy#InvalidTagsToAddException": - throw await de_InvalidTagsToAddExceptionRes(parsedOutput, context); - case "ResourceArnRequiredException": - case "com.amazonaws.codedeploy#ResourceArnRequiredException": - throw await de_ResourceArnRequiredExceptionRes(parsedOutput, context); - case "TagRequiredException": - case "com.amazonaws.codedeploy#TagRequiredException": - throw await de_TagRequiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateApplicationCommand */ @@ -3826,7 +1894,7 @@ export const de_UpdateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateApplicationCommandOutput = { @@ -3835,41 +1903,6 @@ export const de_UpdateApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateApplicationCommandError - */ -const de_UpdateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ApplicationAlreadyExistsException": - case "com.amazonaws.codedeploy#ApplicationAlreadyExistsException": - throw await de_ApplicationAlreadyExistsExceptionRes(parsedOutput, context); - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDeploymentGroupCommand */ @@ -3878,7 +1911,7 @@ export const de_UpdateDeploymentGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDeploymentGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3891,63 +1924,201 @@ export const de_UpdateDeploymentGroupCommand = async ( }; /** - * deserializeAws_json1_1UpdateDeploymentGroupCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateDeploymentGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "InstanceLimitExceededException": + case "com.amazonaws.codedeploy#InstanceLimitExceededException": + throw await de_InstanceLimitExceededExceptionRes(parsedOutput, context); + case "InstanceNameRequiredException": + case "com.amazonaws.codedeploy#InstanceNameRequiredException": + throw await de_InstanceNameRequiredExceptionRes(parsedOutput, context); + case "InstanceNotRegisteredException": + case "com.amazonaws.codedeploy#InstanceNotRegisteredException": + throw await de_InstanceNotRegisteredExceptionRes(parsedOutput, context); + case "InvalidInstanceNameException": + case "com.amazonaws.codedeploy#InvalidInstanceNameException": + throw await de_InvalidInstanceNameExceptionRes(parsedOutput, context); + case "InvalidTagException": + case "com.amazonaws.codedeploy#InvalidTagException": + throw await de_InvalidTagExceptionRes(parsedOutput, context); + case "TagLimitExceededException": + case "com.amazonaws.codedeploy#TagLimitExceededException": + throw await de_TagLimitExceededExceptionRes(parsedOutput, context); + case "TagRequiredException": + case "com.amazonaws.codedeploy#TagRequiredException": + throw await de_TagRequiredExceptionRes(parsedOutput, context); + case "ApplicationDoesNotExistException": + case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": + throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); + case "ApplicationNameRequiredException": + case "com.amazonaws.codedeploy#ApplicationNameRequiredException": + throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); + case "BatchLimitExceededException": + case "com.amazonaws.codedeploy#BatchLimitExceededException": + throw await de_BatchLimitExceededExceptionRes(parsedOutput, context); + case "InvalidApplicationNameException": + case "com.amazonaws.codedeploy#InvalidApplicationNameException": + throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); + case "InvalidRevisionException": + case "com.amazonaws.codedeploy#InvalidRevisionException": + throw await de_InvalidRevisionExceptionRes(parsedOutput, context); + case "RevisionRequiredException": + case "com.amazonaws.codedeploy#RevisionRequiredException": + throw await de_RevisionRequiredExceptionRes(parsedOutput, context); + case "DeploymentConfigDoesNotExistException": + case "com.amazonaws.codedeploy#DeploymentConfigDoesNotExistException": + throw await de_DeploymentConfigDoesNotExistExceptionRes(parsedOutput, context); + case "DeploymentGroupNameRequiredException": + case "com.amazonaws.codedeploy#DeploymentGroupNameRequiredException": + throw await de_DeploymentGroupNameRequiredExceptionRes(parsedOutput, context); + case "InvalidDeploymentGroupNameException": + case "com.amazonaws.codedeploy#InvalidDeploymentGroupNameException": + throw await de_InvalidDeploymentGroupNameExceptionRes(parsedOutput, context); + case "DeploymentDoesNotExistException": + case "com.amazonaws.codedeploy#DeploymentDoesNotExistException": + throw await de_DeploymentDoesNotExistExceptionRes(parsedOutput, context); + case "DeploymentIdRequiredException": + case "com.amazonaws.codedeploy#DeploymentIdRequiredException": + throw await de_DeploymentIdRequiredExceptionRes(parsedOutput, context); + case "InstanceIdRequiredException": + case "com.amazonaws.codedeploy#InstanceIdRequiredException": + throw await de_InstanceIdRequiredExceptionRes(parsedOutput, context); + case "InvalidComputePlatformException": + case "com.amazonaws.codedeploy#InvalidComputePlatformException": + throw await de_InvalidComputePlatformExceptionRes(parsedOutput, context); + case "InvalidDeploymentIdException": + case "com.amazonaws.codedeploy#InvalidDeploymentIdException": + throw await de_InvalidDeploymentIdExceptionRes(parsedOutput, context); + case "DeploymentNotStartedException": + case "com.amazonaws.codedeploy#DeploymentNotStartedException": + throw await de_DeploymentNotStartedExceptionRes(parsedOutput, context); + case "DeploymentTargetDoesNotExistException": + case "com.amazonaws.codedeploy#DeploymentTargetDoesNotExistException": + throw await de_DeploymentTargetDoesNotExistExceptionRes(parsedOutput, context); + case "DeploymentTargetIdRequiredException": + case "com.amazonaws.codedeploy#DeploymentTargetIdRequiredException": + throw await de_DeploymentTargetIdRequiredExceptionRes(parsedOutput, context); + case "DeploymentTargetListSizeExceededException": + case "com.amazonaws.codedeploy#DeploymentTargetListSizeExceededException": + throw await de_DeploymentTargetListSizeExceededExceptionRes(parsedOutput, context); + case "InstanceDoesNotExistException": + case "com.amazonaws.codedeploy#InstanceDoesNotExistException": + throw await de_InstanceDoesNotExistExceptionRes(parsedOutput, context); + case "InvalidDeploymentTargetIdException": + case "com.amazonaws.codedeploy#InvalidDeploymentTargetIdException": + throw await de_InvalidDeploymentTargetIdExceptionRes(parsedOutput, context); + case "DeploymentAlreadyCompletedException": + case "com.amazonaws.codedeploy#DeploymentAlreadyCompletedException": + throw await de_DeploymentAlreadyCompletedExceptionRes(parsedOutput, context); + case "DeploymentIsNotInReadyStateException": + case "com.amazonaws.codedeploy#DeploymentIsNotInReadyStateException": + throw await de_DeploymentIsNotInReadyStateExceptionRes(parsedOutput, context); + case "InvalidDeploymentStatusException": + case "com.amazonaws.codedeploy#InvalidDeploymentStatusException": + throw await de_InvalidDeploymentStatusExceptionRes(parsedOutput, context); + case "InvalidDeploymentWaitTypeException": + case "com.amazonaws.codedeploy#InvalidDeploymentWaitTypeException": + throw await de_InvalidDeploymentWaitTypeExceptionRes(parsedOutput, context); + case "UnsupportedActionForDeploymentTypeException": + case "com.amazonaws.codedeploy#UnsupportedActionForDeploymentTypeException": + throw await de_UnsupportedActionForDeploymentTypeExceptionRes(parsedOutput, context); + case "ApplicationAlreadyExistsException": + case "com.amazonaws.codedeploy#ApplicationAlreadyExistsException": + throw await de_ApplicationAlreadyExistsExceptionRes(parsedOutput, context); + case "ApplicationLimitExceededException": + case "com.amazonaws.codedeploy#ApplicationLimitExceededException": + throw await de_ApplicationLimitExceededExceptionRes(parsedOutput, context); + case "InvalidTagsToAddException": + case "com.amazonaws.codedeploy#InvalidTagsToAddException": + throw await de_InvalidTagsToAddExceptionRes(parsedOutput, context); case "AlarmsLimitExceededException": case "com.amazonaws.codedeploy#AlarmsLimitExceededException": throw await de_AlarmsLimitExceededExceptionRes(parsedOutput, context); - case "ApplicationDoesNotExistException": - case "com.amazonaws.codedeploy#ApplicationDoesNotExistException": - throw await de_ApplicationDoesNotExistExceptionRes(parsedOutput, context); - case "ApplicationNameRequiredException": - case "com.amazonaws.codedeploy#ApplicationNameRequiredException": - throw await de_ApplicationNameRequiredExceptionRes(parsedOutput, context); - case "DeploymentConfigDoesNotExistException": - case "com.amazonaws.codedeploy#DeploymentConfigDoesNotExistException": - throw await de_DeploymentConfigDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentGroupAlreadyExistsException": - case "com.amazonaws.codedeploy#DeploymentGroupAlreadyExistsException": - throw await de_DeploymentGroupAlreadyExistsExceptionRes(parsedOutput, context); case "DeploymentGroupDoesNotExistException": case "com.amazonaws.codedeploy#DeploymentGroupDoesNotExistException": throw await de_DeploymentGroupDoesNotExistExceptionRes(parsedOutput, context); - case "DeploymentGroupNameRequiredException": - case "com.amazonaws.codedeploy#DeploymentGroupNameRequiredException": - throw await de_DeploymentGroupNameRequiredExceptionRes(parsedOutput, context); - case "ECSServiceMappingLimitExceededException": - case "com.amazonaws.codedeploy#ECSServiceMappingLimitExceededException": - throw await de_ECSServiceMappingLimitExceededExceptionRes(parsedOutput, context); + case "DeploymentLimitExceededException": + case "com.amazonaws.codedeploy#DeploymentLimitExceededException": + throw await de_DeploymentLimitExceededExceptionRes(parsedOutput, context); + case "DescriptionTooLongException": + case "com.amazonaws.codedeploy#DescriptionTooLongException": + throw await de_DescriptionTooLongExceptionRes(parsedOutput, context); case "InvalidAlarmConfigException": case "com.amazonaws.codedeploy#InvalidAlarmConfigException": throw await de_InvalidAlarmConfigExceptionRes(parsedOutput, context); - case "InvalidApplicationNameException": - case "com.amazonaws.codedeploy#InvalidApplicationNameException": - throw await de_InvalidApplicationNameExceptionRes(parsedOutput, context); case "InvalidAutoRollbackConfigException": case "com.amazonaws.codedeploy#InvalidAutoRollbackConfigException": throw await de_InvalidAutoRollbackConfigExceptionRes(parsedOutput, context); case "InvalidAutoScalingGroupException": case "com.amazonaws.codedeploy#InvalidAutoScalingGroupException": throw await de_InvalidAutoScalingGroupExceptionRes(parsedOutput, context); - case "InvalidBlueGreenDeploymentConfigurationException": - case "com.amazonaws.codedeploy#InvalidBlueGreenDeploymentConfigurationException": - throw await de_InvalidBlueGreenDeploymentConfigurationExceptionRes(parsedOutput, context); case "InvalidDeploymentConfigNameException": case "com.amazonaws.codedeploy#InvalidDeploymentConfigNameException": throw await de_InvalidDeploymentConfigNameExceptionRes(parsedOutput, context); - case "InvalidDeploymentGroupNameException": - case "com.amazonaws.codedeploy#InvalidDeploymentGroupNameException": - throw await de_InvalidDeploymentGroupNameExceptionRes(parsedOutput, context); + case "InvalidFileExistsBehaviorException": + case "com.amazonaws.codedeploy#InvalidFileExistsBehaviorException": + throw await de_InvalidFileExistsBehaviorExceptionRes(parsedOutput, context); + case "InvalidGitHubAccountTokenException": + case "com.amazonaws.codedeploy#InvalidGitHubAccountTokenException": + throw await de_InvalidGitHubAccountTokenExceptionRes(parsedOutput, context); + case "InvalidIgnoreApplicationStopFailuresValueException": + case "com.amazonaws.codedeploy#InvalidIgnoreApplicationStopFailuresValueException": + throw await de_InvalidIgnoreApplicationStopFailuresValueExceptionRes(parsedOutput, context); + case "InvalidLoadBalancerInfoException": + case "com.amazonaws.codedeploy#InvalidLoadBalancerInfoException": + throw await de_InvalidLoadBalancerInfoExceptionRes(parsedOutput, context); + case "InvalidRoleException": + case "com.amazonaws.codedeploy#InvalidRoleException": + throw await de_InvalidRoleExceptionRes(parsedOutput, context); + case "InvalidTargetInstancesException": + case "com.amazonaws.codedeploy#InvalidTargetInstancesException": + throw await de_InvalidTargetInstancesExceptionRes(parsedOutput, context); + case "InvalidTrafficRoutingConfigurationException": + case "com.amazonaws.codedeploy#InvalidTrafficRoutingConfigurationException": + throw await de_InvalidTrafficRoutingConfigurationExceptionRes(parsedOutput, context); + case "InvalidUpdateOutdatedInstancesOnlyValueException": + case "com.amazonaws.codedeploy#InvalidUpdateOutdatedInstancesOnlyValueException": + throw await de_InvalidUpdateOutdatedInstancesOnlyValueExceptionRes(parsedOutput, context); + case "RevisionDoesNotExistException": + case "com.amazonaws.codedeploy#RevisionDoesNotExistException": + throw await de_RevisionDoesNotExistExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.codedeploy#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "DeploymentConfigAlreadyExistsException": + case "com.amazonaws.codedeploy#DeploymentConfigAlreadyExistsException": + throw await de_DeploymentConfigAlreadyExistsExceptionRes(parsedOutput, context); + case "DeploymentConfigLimitExceededException": + case "com.amazonaws.codedeploy#DeploymentConfigLimitExceededException": + throw await de_DeploymentConfigLimitExceededExceptionRes(parsedOutput, context); + case "DeploymentConfigNameRequiredException": + case "com.amazonaws.codedeploy#DeploymentConfigNameRequiredException": + throw await de_DeploymentConfigNameRequiredExceptionRes(parsedOutput, context); + case "InvalidMinimumHealthyHostValueException": + case "com.amazonaws.codedeploy#InvalidMinimumHealthyHostValueException": + throw await de_InvalidMinimumHealthyHostValueExceptionRes(parsedOutput, context); + case "InvalidZonalDeploymentConfigurationException": + case "com.amazonaws.codedeploy#InvalidZonalDeploymentConfigurationException": + throw await de_InvalidZonalDeploymentConfigurationExceptionRes(parsedOutput, context); + case "DeploymentGroupAlreadyExistsException": + case "com.amazonaws.codedeploy#DeploymentGroupAlreadyExistsException": + throw await de_DeploymentGroupAlreadyExistsExceptionRes(parsedOutput, context); + case "DeploymentGroupLimitExceededException": + case "com.amazonaws.codedeploy#DeploymentGroupLimitExceededException": + throw await de_DeploymentGroupLimitExceededExceptionRes(parsedOutput, context); + case "ECSServiceMappingLimitExceededException": + case "com.amazonaws.codedeploy#ECSServiceMappingLimitExceededException": + throw await de_ECSServiceMappingLimitExceededExceptionRes(parsedOutput, context); + case "InvalidBlueGreenDeploymentConfigurationException": + case "com.amazonaws.codedeploy#InvalidBlueGreenDeploymentConfigurationException": + throw await de_InvalidBlueGreenDeploymentConfigurationExceptionRes(parsedOutput, context); case "InvalidDeploymentStyleException": case "com.amazonaws.codedeploy#InvalidDeploymentStyleException": throw await de_InvalidDeploymentStyleExceptionRes(parsedOutput, context); @@ -3963,46 +2134,142 @@ const de_UpdateDeploymentGroupCommandError = async ( case "InvalidInputException": case "com.amazonaws.codedeploy#InvalidInputException": throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidLoadBalancerInfoException": - case "com.amazonaws.codedeploy#InvalidLoadBalancerInfoException": - throw await de_InvalidLoadBalancerInfoExceptionRes(parsedOutput, context); case "InvalidOnPremisesTagCombinationException": case "com.amazonaws.codedeploy#InvalidOnPremisesTagCombinationException": throw await de_InvalidOnPremisesTagCombinationExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.codedeploy#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.codedeploy#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); case "InvalidTargetGroupPairException": case "com.amazonaws.codedeploy#InvalidTargetGroupPairException": throw await de_InvalidTargetGroupPairExceptionRes(parsedOutput, context); - case "InvalidTrafficRoutingConfigurationException": - case "com.amazonaws.codedeploy#InvalidTrafficRoutingConfigurationException": - throw await de_InvalidTrafficRoutingConfigurationExceptionRes(parsedOutput, context); case "InvalidTriggerConfigException": case "com.amazonaws.codedeploy#InvalidTriggerConfigException": throw await de_InvalidTriggerConfigExceptionRes(parsedOutput, context); case "LifecycleHookLimitExceededException": case "com.amazonaws.codedeploy#LifecycleHookLimitExceededException": throw await de_LifecycleHookLimitExceededExceptionRes(parsedOutput, context); + case "RoleRequiredException": + case "com.amazonaws.codedeploy#RoleRequiredException": + throw await de_RoleRequiredExceptionRes(parsedOutput, context); case "TagSetListLimitExceededException": case "com.amazonaws.codedeploy#TagSetListLimitExceededException": throw await de_TagSetListLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codedeploy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); case "TriggerTargetsLimitExceededException": case "com.amazonaws.codedeploy#TriggerTargetsLimitExceededException": throw await de_TriggerTargetsLimitExceededExceptionRes(parsedOutput, context); + case "DeploymentConfigInUseException": + case "com.amazonaws.codedeploy#DeploymentConfigInUseException": + throw await de_DeploymentConfigInUseExceptionRes(parsedOutput, context); + case "InvalidOperationException": + case "com.amazonaws.codedeploy#InvalidOperationException": + throw await de_InvalidOperationExceptionRes(parsedOutput, context); + case "GitHubAccountTokenDoesNotExistException": + case "com.amazonaws.codedeploy#GitHubAccountTokenDoesNotExistException": + throw await de_GitHubAccountTokenDoesNotExistExceptionRes(parsedOutput, context); + case "GitHubAccountTokenNameRequiredException": + case "com.amazonaws.codedeploy#GitHubAccountTokenNameRequiredException": + throw await de_GitHubAccountTokenNameRequiredExceptionRes(parsedOutput, context); + case "InvalidGitHubAccountTokenNameException": + case "com.amazonaws.codedeploy#InvalidGitHubAccountTokenNameException": + throw await de_InvalidGitHubAccountTokenNameExceptionRes(parsedOutput, context); + case "OperationNotSupportedException": + case "com.amazonaws.codedeploy#OperationNotSupportedException": + throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); + case "ResourceValidationException": + case "com.amazonaws.codedeploy#ResourceValidationException": + throw await de_ResourceValidationExceptionRes(parsedOutput, context); + case "BucketNameFilterRequiredException": + case "com.amazonaws.codedeploy#BucketNameFilterRequiredException": + throw await de_BucketNameFilterRequiredExceptionRes(parsedOutput, context); + case "InvalidBucketNameFilterException": + case "com.amazonaws.codedeploy#InvalidBucketNameFilterException": + throw await de_InvalidBucketNameFilterExceptionRes(parsedOutput, context); + case "InvalidDeployedStateFilterException": + case "com.amazonaws.codedeploy#InvalidDeployedStateFilterException": + throw await de_InvalidDeployedStateFilterExceptionRes(parsedOutput, context); + case "InvalidKeyPrefixFilterException": + case "com.amazonaws.codedeploy#InvalidKeyPrefixFilterException": + throw await de_InvalidKeyPrefixFilterExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.codedeploy#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "InvalidSortByException": + case "com.amazonaws.codedeploy#InvalidSortByException": + throw await de_InvalidSortByExceptionRes(parsedOutput, context); + case "InvalidSortOrderException": + case "com.amazonaws.codedeploy#InvalidSortOrderException": + throw await de_InvalidSortOrderExceptionRes(parsedOutput, context); + case "InvalidDeploymentInstanceTypeException": + case "com.amazonaws.codedeploy#InvalidDeploymentInstanceTypeException": + throw await de_InvalidDeploymentInstanceTypeExceptionRes(parsedOutput, context); + case "InvalidInstanceStatusException": + case "com.amazonaws.codedeploy#InvalidInstanceStatusException": + throw await de_InvalidInstanceStatusExceptionRes(parsedOutput, context); + case "InvalidInstanceTypeException": + case "com.amazonaws.codedeploy#InvalidInstanceTypeException": + throw await de_InvalidInstanceTypeExceptionRes(parsedOutput, context); + case "InvalidTargetFilterNameException": + case "com.amazonaws.codedeploy#InvalidTargetFilterNameException": + throw await de_InvalidTargetFilterNameExceptionRes(parsedOutput, context); + case "InvalidExternalIdException": + case "com.amazonaws.codedeploy#InvalidExternalIdException": + throw await de_InvalidExternalIdExceptionRes(parsedOutput, context); + case "InvalidTimeRangeException": + case "com.amazonaws.codedeploy#InvalidTimeRangeException": + throw await de_InvalidTimeRangeExceptionRes(parsedOutput, context); + case "InvalidRegistrationStatusException": + case "com.amazonaws.codedeploy#InvalidRegistrationStatusException": + throw await de_InvalidRegistrationStatusExceptionRes(parsedOutput, context); + case "InvalidTagFilterException": + case "com.amazonaws.codedeploy#InvalidTagFilterException": + throw await de_InvalidTagFilterExceptionRes(parsedOutput, context); + case "ArnNotSupportedException": + case "com.amazonaws.codedeploy#ArnNotSupportedException": + throw await de_ArnNotSupportedExceptionRes(parsedOutput, context); + case "InvalidArnException": + case "com.amazonaws.codedeploy#InvalidArnException": + throw await de_InvalidArnExceptionRes(parsedOutput, context); + case "ResourceArnRequiredException": + case "com.amazonaws.codedeploy#ResourceArnRequiredException": + throw await de_ResourceArnRequiredExceptionRes(parsedOutput, context); + case "InvalidLifecycleEventHookExecutionIdException": + case "com.amazonaws.codedeploy#InvalidLifecycleEventHookExecutionIdException": + throw await de_InvalidLifecycleEventHookExecutionIdExceptionRes(parsedOutput, context); + case "InvalidLifecycleEventHookExecutionStatusException": + case "com.amazonaws.codedeploy#InvalidLifecycleEventHookExecutionStatusException": + throw await de_InvalidLifecycleEventHookExecutionStatusExceptionRes(parsedOutput, context); + case "LifecycleEventAlreadyCompletedException": + case "com.amazonaws.codedeploy#LifecycleEventAlreadyCompletedException": + throw await de_LifecycleEventAlreadyCompletedExceptionRes(parsedOutput, context); + case "IamArnRequiredException": + case "com.amazonaws.codedeploy#IamArnRequiredException": + throw await de_IamArnRequiredExceptionRes(parsedOutput, context); + case "IamSessionArnAlreadyRegisteredException": + case "com.amazonaws.codedeploy#IamSessionArnAlreadyRegisteredException": + throw await de_IamSessionArnAlreadyRegisteredExceptionRes(parsedOutput, context); + case "IamUserArnAlreadyRegisteredException": + case "com.amazonaws.codedeploy#IamUserArnAlreadyRegisteredException": + throw await de_IamUserArnAlreadyRegisteredExceptionRes(parsedOutput, context); + case "IamUserArnRequiredException": + case "com.amazonaws.codedeploy#IamUserArnRequiredException": + throw await de_IamUserArnRequiredExceptionRes(parsedOutput, context); + case "InstanceNameAlreadyRegisteredException": + case "com.amazonaws.codedeploy#InstanceNameAlreadyRegisteredException": + throw await de_InstanceNameAlreadyRegisteredExceptionRes(parsedOutput, context); + case "InvalidIamSessionArnException": + case "com.amazonaws.codedeploy#InvalidIamSessionArnException": + throw await de_InvalidIamSessionArnExceptionRes(parsedOutput, context); + case "InvalidIamUserArnException": + case "com.amazonaws.codedeploy#InvalidIamUserArnException": + throw await de_InvalidIamUserArnExceptionRes(parsedOutput, context); + case "MultipleIamArnsProvidedException": + case "com.amazonaws.codedeploy#MultipleIamArnsProvidedException": + throw await de_MultipleIamArnsProvidedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts b/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts index 3e51dd9fd3bc..78d06492c24e 100644 --- a/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts +++ b/clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts @@ -397,7 +397,7 @@ export const de_AssociateRepositoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateRepositoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -411,44 +411,6 @@ export const de_AssociateRepositoryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateRepositoryCommandError - */ -const de_AssociateRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurureviewer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codegurureviewer#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurureviewer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurureviewer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurureviewer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCodeReviewCommand */ @@ -457,7 +419,7 @@ export const de_CreateCodeReviewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCodeReviewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -470,47 +432,6 @@ export const de_CreateCodeReviewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCodeReviewCommandError - */ -const de_CreateCodeReviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurureviewer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codegurureviewer#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurureviewer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurureviewer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurureviewer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurureviewer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeCodeReviewCommand */ @@ -519,7 +440,7 @@ export const de_DescribeCodeReviewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeCodeReviewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -532,44 +453,6 @@ export const de_DescribeCodeReviewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeCodeReviewCommandError - */ -const de_DescribeCodeReviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurureviewer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurureviewer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurureviewer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurureviewer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurureviewer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeRecommendationFeedbackCommand */ @@ -578,7 +461,7 @@ export const de_DescribeRecommendationFeedbackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRecommendationFeedbackCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -591,44 +474,6 @@ export const de_DescribeRecommendationFeedbackCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeRecommendationFeedbackCommandError - */ -const de_DescribeRecommendationFeedbackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurureviewer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurureviewer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurureviewer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurureviewer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurureviewer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeRepositoryAssociationCommand */ @@ -637,7 +482,7 @@ export const de_DescribeRepositoryAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRepositoryAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -651,44 +496,6 @@ export const de_DescribeRepositoryAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeRepositoryAssociationCommandError - */ -const de_DescribeRepositoryAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurureviewer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurureviewer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.codegurureviewer#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurureviewer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurureviewer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateRepositoryCommand */ @@ -697,7 +504,7 @@ export const de_DisassociateRepositoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateRepositoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -711,47 +518,6 @@ export const de_DisassociateRepositoryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateRepositoryCommandError - */ -const de_DisassociateRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurureviewer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codegurureviewer#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurureviewer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.codegurureviewer#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurureviewer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurureviewer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCodeReviewsCommand */ @@ -760,7 +526,7 @@ export const de_ListCodeReviewsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCodeReviewsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -774,41 +540,6 @@ export const de_ListCodeReviewsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCodeReviewsCommandError - */ -const de_ListCodeReviewsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurureviewer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurureviewer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurureviewer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurureviewer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRecommendationFeedbackCommand */ @@ -817,7 +548,7 @@ export const de_ListRecommendationFeedbackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecommendationFeedbackCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -831,44 +562,6 @@ export const de_ListRecommendationFeedbackCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRecommendationFeedbackCommandError - */ -const de_ListRecommendationFeedbackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurureviewer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurureviewer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurureviewer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurureviewer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurureviewer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRecommendationsCommand */ @@ -877,7 +570,7 @@ export const de_ListRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -891,44 +584,6 @@ export const de_ListRecommendationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRecommendationsCommandError - */ -const de_ListRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurureviewer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurureviewer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurureviewer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurureviewer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurureviewer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRepositoryAssociationsCommand */ @@ -937,7 +592,7 @@ export const de_ListRepositoryAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRepositoryAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -951,38 +606,6 @@ export const de_ListRepositoryAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRepositoryAssociationsCommandError - */ -const de_ListRepositoryAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codegurureviewer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurureviewer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurureviewer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -991,7 +614,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1004,38 +627,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codegurureviewer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurureviewer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurureviewer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutRecommendationFeedbackCommand */ @@ -1044,7 +635,7 @@ export const de_PutRecommendationFeedbackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutRecommendationFeedbackCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1053,44 +644,6 @@ export const de_PutRecommendationFeedbackCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutRecommendationFeedbackCommandError - */ -const de_PutRecommendationFeedbackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurureviewer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurureviewer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurureviewer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurureviewer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurureviewer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1099,7 +652,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1108,38 +661,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codegurureviewer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurureviewer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurureviewer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1148,7 +669,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1158,34 +679,43 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.codegurureviewer#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.codegurureviewer#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.codegurureviewer#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurureviewer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.codegurureviewer#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.codegurureviewer#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.codegurureviewer#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.codegurureviewer#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-codeguru-security/src/protocols/Aws_restJson1.ts b/clients/client-codeguru-security/src/protocols/Aws_restJson1.ts index 1a55e996c44a..c857684f1b01 100644 --- a/clients/client-codeguru-security/src/protocols/Aws_restJson1.ts +++ b/clients/client-codeguru-security/src/protocols/Aws_restJson1.ts @@ -356,7 +356,7 @@ export const de_BatchGetFindingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -370,41 +370,6 @@ export const de_BatchGetFindingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetFindingsCommandError - */ -const de_BatchGetFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurusecurity#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurusecurity#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurusecurity#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurusecurity#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateScanCommand */ @@ -413,7 +378,7 @@ export const de_CreateScanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateScanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -430,47 +395,6 @@ export const de_CreateScanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateScanCommandError - */ -const de_CreateScanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurusecurity#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codegurusecurity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurusecurity#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurusecurity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurusecurity#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurusecurity#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateUploadUrlCommand */ @@ -479,7 +403,7 @@ export const de_CreateUploadUrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateUploadUrlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -494,41 +418,6 @@ export const de_CreateUploadUrlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateUploadUrlCommandError - */ -const de_CreateUploadUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurusecurity#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurusecurity#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurusecurity#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurusecurity#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAccountConfigurationCommand */ @@ -537,7 +426,7 @@ export const de_GetAccountConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccountConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -550,41 +439,6 @@ export const de_GetAccountConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAccountConfigurationCommandError - */ -const de_GetAccountConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurusecurity#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurusecurity#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurusecurity#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurusecurity#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetFindingsCommand */ @@ -593,7 +447,7 @@ export const de_GetFindingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -607,47 +461,6 @@ export const de_GetFindingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetFindingsCommandError - */ -const de_GetFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurusecurity#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codegurusecurity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurusecurity#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurusecurity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurusecurity#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurusecurity#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMetricsSummaryCommand */ @@ -656,7 +469,7 @@ export const de_GetMetricsSummaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMetricsSummaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -669,41 +482,6 @@ export const de_GetMetricsSummaryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMetricsSummaryCommandError - */ -const de_GetMetricsSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurusecurity#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurusecurity#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurusecurity#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurusecurity#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetScanCommand */ @@ -712,7 +490,7 @@ export const de_GetScanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetScanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -732,41 +510,6 @@ export const de_GetScanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetScanCommandError - */ -const de_GetScanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurusecurity#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurusecurity#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurusecurity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurusecurity#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListFindingsMetricsCommand */ @@ -775,7 +518,7 @@ export const de_ListFindingsMetricsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFindingsMetricsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -789,41 +532,6 @@ export const de_ListFindingsMetricsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFindingsMetricsCommandError - */ -const de_ListFindingsMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurusecurity#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurusecurity#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurusecurity#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurusecurity#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListScansCommand */ @@ -832,7 +540,7 @@ export const de_ListScansCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListScansCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -846,41 +554,6 @@ export const de_ListScansCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListScansCommandError - */ -const de_ListScansCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurusecurity#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurusecurity#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurusecurity#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurusecurity#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -889,7 +562,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -902,47 +575,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurusecurity#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codegurusecurity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurusecurity#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurusecurity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurusecurity#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurusecurity#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -951,7 +583,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -960,47 +592,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurusecurity#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codegurusecurity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurusecurity#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurusecurity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurusecurity#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurusecurity#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1009,7 +600,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1018,47 +609,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codegurusecurity#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.codegurusecurity#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codegurusecurity#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurusecurity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codegurusecurity#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codegurusecurity#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAccountConfigurationCommand */ @@ -1067,7 +617,7 @@ export const de_UpdateAccountConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAccountConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1081,12 +631,9 @@ export const de_UpdateAccountConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateAccountConfigurationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateAccountConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1099,22 +646,25 @@ const de_UpdateAccountConfigurationCommandError = async ( case "InternalServerException": case "com.amazonaws.codegurusecurity#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codegurusecurity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.codegurusecurity#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.codegurusecurity#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.codegurusecurity#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.codegurusecurity#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts b/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts index 7b1aef871d8a..4e5768a5b9cc 100644 --- a/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts +++ b/clients/client-codeguruprofiler/src/protocols/Aws_restJson1.ts @@ -631,7 +631,7 @@ export const de_AddNotificationChannelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AddNotificationChannelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -644,47 +644,6 @@ export const de_AddNotificationChannelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddNotificationChannelsCommandError - */ -const de_AddNotificationChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.codeguruprofiler#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codeguruprofiler#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetFrameMetricDataCommand */ @@ -693,7 +652,7 @@ export const de_BatchGetFrameMetricDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetFrameMetricDataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -711,41 +670,6 @@ export const de_BatchGetFrameMetricDataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetFrameMetricDataCommandError - */ -const de_BatchGetFrameMetricDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ConfigureAgentCommand */ @@ -754,7 +678,7 @@ export const de_ConfigureAgentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ConfigureAgentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -764,41 +688,6 @@ export const de_ConfigureAgentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ConfigureAgentCommandError - */ -const de_ConfigureAgentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProfilingGroupCommand */ @@ -807,7 +696,7 @@ export const de_CreateProfilingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateProfilingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -817,44 +706,6 @@ export const de_CreateProfilingGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProfilingGroupCommandError - */ -const de_CreateProfilingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.codeguruprofiler#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.codeguruprofiler#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteProfilingGroupCommand */ @@ -863,7 +714,7 @@ export const de_DeleteProfilingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteProfilingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -872,44 +723,6 @@ export const de_DeleteProfilingGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteProfilingGroupCommandError - */ -const de_DeleteProfilingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.codeguruprofiler#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeProfilingGroupCommand */ @@ -918,7 +731,7 @@ export const de_DescribeProfilingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeProfilingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -928,41 +741,6 @@ export const de_DescribeProfilingGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeProfilingGroupCommandError - */ -const de_DescribeProfilingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetFindingsReportAccountSummaryCommand */ @@ -971,7 +749,7 @@ export const de_GetFindingsReportAccountSummaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFindingsReportAccountSummaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -985,38 +763,6 @@ export const de_GetFindingsReportAccountSummaryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetFindingsReportAccountSummaryCommandError - */ -const de_GetFindingsReportAccountSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetNotificationConfigurationCommand */ @@ -1025,7 +771,7 @@ export const de_GetNotificationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetNotificationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1038,41 +784,6 @@ export const de_GetNotificationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetNotificationConfigurationCommandError - */ -const de_GetNotificationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPolicyCommand */ @@ -1081,7 +792,7 @@ export const de_GetPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1095,38 +806,6 @@ export const de_GetPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetPolicyCommandError - */ -const de_GetPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetProfileCommand */ @@ -1135,7 +814,7 @@ export const de_GetProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1147,41 +826,6 @@ export const de_GetProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetProfileCommandError - */ -const de_GetProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRecommendationsCommand */ @@ -1190,7 +834,7 @@ export const de_GetRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1207,41 +851,6 @@ export const de_GetRecommendationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRecommendationsCommandError - */ -const de_GetRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListFindingsReportsCommand */ @@ -1250,7 +859,7 @@ export const de_ListFindingsReportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFindingsReportsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1264,41 +873,6 @@ export const de_ListFindingsReportsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFindingsReportsCommandError - */ -const de_ListFindingsReportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProfileTimesCommand */ @@ -1307,7 +881,7 @@ export const de_ListProfileTimesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProfileTimesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1321,41 +895,6 @@ export const de_ListProfileTimesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListProfileTimesCommandError - */ -const de_ListProfileTimesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProfilingGroupsCommand */ @@ -1363,154 +902,58 @@ export const de_ListProfilingGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProfilingGroupsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - profilingGroupNames: _json, - profilingGroups: (_) => de_ProfilingGroupDescriptions(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListProfilingGroupsCommandError - */ -const de_ListProfilingGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + profilingGroupNames: _json, + profilingGroups: (_) => de_ProfilingGroupDescriptions(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PostAgentProfileCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_PostAgentProfileCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_PostAgentProfileCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PostAgentProfileCommandError + * deserializeAws_restJson1PostAgentProfileCommand */ -const de_PostAgentProfileCommandError = async ( +export const de_PostAgentProfileCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -1521,7 +964,7 @@ export const de_PutPermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutPermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1535,44 +978,6 @@ export const de_PutPermissionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutPermissionCommandError - */ -const de_PutPermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.codeguruprofiler#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RemoveNotificationChannelCommand */ @@ -1581,7 +986,7 @@ export const de_RemoveNotificationChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveNotificationChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1594,41 +999,6 @@ export const de_RemoveNotificationChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RemoveNotificationChannelCommandError - */ -const de_RemoveNotificationChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RemovePermissionCommand */ @@ -1637,7 +1007,7 @@ export const de_RemovePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemovePermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1651,44 +1021,6 @@ export const de_RemovePermissionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RemovePermissionCommandError - */ -const de_RemovePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.codeguruprofiler#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SubmitFeedbackCommand */ @@ -1697,7 +1029,7 @@ export const de_SubmitFeedbackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_SubmitFeedbackCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1706,41 +1038,6 @@ export const de_SubmitFeedbackCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SubmitFeedbackCommandError - */ -const de_SubmitFeedbackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codeguruprofiler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1749,7 +1046,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1758,38 +1055,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1798,7 +1063,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1807,38 +1072,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.codeguruprofiler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codeguruprofiler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateProfilingGroupCommand */ @@ -1847,7 +1080,7 @@ export const de_UpdateProfilingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProfilingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1858,12 +1091,9 @@ export const de_UpdateProfilingGroupCommand = async ( }; /** - * deserializeAws_restJson1UpdateProfilingGroupCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateProfilingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1879,6 +1109,9 @@ const de_UpdateProfilingGroupCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.codeguruprofiler#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.codeguruprofiler#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.codeguruprofiler#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -1891,7 +1124,7 @@ const de_UpdateProfilingGroupCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-codepipeline/src/protocols/Aws_json1_1.ts b/clients/client-codepipeline/src/protocols/Aws_json1_1.ts index bdf28cc1fd2c..d25e6bfa6c78 100644 --- a/clients/client-codepipeline/src/protocols/Aws_json1_1.ts +++ b/clients/client-codepipeline/src/protocols/Aws_json1_1.ts @@ -773,7 +773,7 @@ export const de_AcknowledgeJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcknowledgeJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -785,38 +785,6 @@ export const de_AcknowledgeJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1AcknowledgeJobCommandError - */ -const de_AcknowledgeJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNonceException": - case "com.amazonaws.codepipeline#InvalidNonceException": - throw await de_InvalidNonceExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.codepipeline#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AcknowledgeThirdPartyJobCommand */ @@ -825,7 +793,7 @@ export const de_AcknowledgeThirdPartyJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcknowledgeThirdPartyJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -837,41 +805,6 @@ export const de_AcknowledgeThirdPartyJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1AcknowledgeThirdPartyJobCommandError - */ -const de_AcknowledgeThirdPartyJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidClientTokenException": - case "com.amazonaws.codepipeline#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidNonceException": - case "com.amazonaws.codepipeline#InvalidNonceException": - throw await de_InvalidNonceExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.codepipeline#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateCustomActionTypeCommand */ @@ -880,7 +813,7 @@ export const de_CreateCustomActionTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCustomActionTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -892,44 +825,6 @@ export const de_CreateCustomActionTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCustomActionTypeCommandError - */ -const de_CreateCustomActionTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codepipeline#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidTagsException": - case "com.amazonaws.codepipeline#InvalidTagsException": - throw await de_InvalidTagsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.codepipeline#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.codepipeline#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePipelineCommand */ @@ -938,7 +833,7 @@ export const de_CreatePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePipelineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -950,59 +845,6 @@ export const de_CreatePipelineCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePipelineCommandError - */ -const de_CreatePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codepipeline#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidActionDeclarationException": - case "com.amazonaws.codepipeline#InvalidActionDeclarationException": - throw await de_InvalidActionDeclarationExceptionRes(parsedOutput, context); - case "InvalidBlockerDeclarationException": - case "com.amazonaws.codepipeline#InvalidBlockerDeclarationException": - throw await de_InvalidBlockerDeclarationExceptionRes(parsedOutput, context); - case "InvalidStageDeclarationException": - case "com.amazonaws.codepipeline#InvalidStageDeclarationException": - throw await de_InvalidStageDeclarationExceptionRes(parsedOutput, context); - case "InvalidStructureException": - case "com.amazonaws.codepipeline#InvalidStructureException": - throw await de_InvalidStructureExceptionRes(parsedOutput, context); - case "InvalidTagsException": - case "com.amazonaws.codepipeline#InvalidTagsException": - throw await de_InvalidTagsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.codepipeline#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PipelineNameInUseException": - case "com.amazonaws.codepipeline#PipelineNameInUseException": - throw await de_PipelineNameInUseExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.codepipeline#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteCustomActionTypeCommand */ @@ -1011,7 +853,7 @@ export const de_DeleteCustomActionTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCustomActionTypeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteCustomActionTypeCommandOutput = { @@ -1020,35 +862,6 @@ export const de_DeleteCustomActionTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteCustomActionTypeCommandError - */ -const de_DeleteCustomActionTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codepipeline#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeletePipelineCommand */ @@ -1057,7 +870,7 @@ export const de_DeletePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePipelineCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeletePipelineCommandOutput = { @@ -1066,35 +879,6 @@ export const de_DeletePipelineCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeletePipelineCommandError - */ -const de_DeletePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codepipeline#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteWebhookCommand */ @@ -1103,7 +887,7 @@ export const de_DeleteWebhookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteWebhookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1115,35 +899,6 @@ export const de_DeleteWebhookCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteWebhookCommandError - */ -const de_DeleteWebhookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codepipeline#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeregisterWebhookWithThirdPartyCommand */ @@ -1152,7 +907,7 @@ export const de_DeregisterWebhookWithThirdPartyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterWebhookWithThirdPartyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1164,35 +919,6 @@ export const de_DeregisterWebhookWithThirdPartyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeregisterWebhookWithThirdPartyCommandError - */ -const de_DeregisterWebhookWithThirdPartyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - case "WebhookNotFoundException": - case "com.amazonaws.codepipeline#WebhookNotFoundException": - throw await de_WebhookNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisableStageTransitionCommand */ @@ -1201,7 +927,7 @@ export const de_DisableStageTransitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableStageTransitionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DisableStageTransitionCommandOutput = { @@ -1211,46 +937,14 @@ export const de_DisableStageTransitionCommand = async ( }; /** - * deserializeAws_json1_1DisableStageTransitionCommandError + * deserializeAws_json1_1EnableStageTransitionCommand */ -const de_DisableStageTransitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "PipelineNotFoundException": - case "com.amazonaws.codepipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "StageNotFoundException": - case "com.amazonaws.codepipeline#StageNotFoundException": - throw await de_StageNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1EnableStageTransitionCommand - */ -export const de_EnableStageTransitionCommand = async ( +export const de_EnableStageTransitionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableStageTransitionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: EnableStageTransitionCommandOutput = { @@ -1259,38 +953,6 @@ export const de_EnableStageTransitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1EnableStageTransitionCommandError - */ -const de_EnableStageTransitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "PipelineNotFoundException": - case "com.amazonaws.codepipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "StageNotFoundException": - case "com.amazonaws.codepipeline#StageNotFoundException": - throw await de_StageNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetActionTypeCommand */ @@ -1299,7 +961,7 @@ export const de_GetActionTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetActionTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1311,35 +973,6 @@ export const de_GetActionTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetActionTypeCommandError - */ -const de_GetActionTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActionTypeNotFoundException": - case "com.amazonaws.codepipeline#ActionTypeNotFoundException": - throw await de_ActionTypeNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetJobDetailsCommand */ @@ -1348,7 +981,7 @@ export const de_GetJobDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetJobDetailsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1360,35 +993,6 @@ export const de_GetJobDetailsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetJobDetailsCommandError - */ -const de_GetJobDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "JobNotFoundException": - case "com.amazonaws.codepipeline#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetPipelineCommand */ @@ -1397,7 +1001,7 @@ export const de_GetPipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPipelineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1409,38 +1013,6 @@ export const de_GetPipelineCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetPipelineCommandError - */ -const de_GetPipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "PipelineNotFoundException": - case "com.amazonaws.codepipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "PipelineVersionNotFoundException": - case "com.amazonaws.codepipeline#PipelineVersionNotFoundException": - throw await de_PipelineVersionNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetPipelineExecutionCommand */ @@ -1449,7 +1021,7 @@ export const de_GetPipelineExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPipelineExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1461,38 +1033,6 @@ export const de_GetPipelineExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetPipelineExecutionCommandError - */ -const de_GetPipelineExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "PipelineExecutionNotFoundException": - case "com.amazonaws.codepipeline#PipelineExecutionNotFoundException": - throw await de_PipelineExecutionNotFoundExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.codepipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetPipelineStateCommand */ @@ -1501,7 +1041,7 @@ export const de_GetPipelineStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPipelineStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1513,35 +1053,6 @@ export const de_GetPipelineStateCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetPipelineStateCommandError - */ -const de_GetPipelineStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "PipelineNotFoundException": - case "com.amazonaws.codepipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetThirdPartyJobDetailsCommand */ @@ -1550,7 +1061,7 @@ export const de_GetThirdPartyJobDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetThirdPartyJobDetailsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1562,41 +1073,6 @@ export const de_GetThirdPartyJobDetailsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetThirdPartyJobDetailsCommandError - */ -const de_GetThirdPartyJobDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidClientTokenException": - case "com.amazonaws.codepipeline#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidJobException": - case "com.amazonaws.codepipeline#InvalidJobException": - throw await de_InvalidJobExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.codepipeline#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListActionExecutionsCommand */ @@ -1605,7 +1081,7 @@ export const de_ListActionExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListActionExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1617,41 +1093,6 @@ export const de_ListActionExecutionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListActionExecutionsCommandError - */ -const de_ListActionExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codepipeline#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "PipelineExecutionNotFoundException": - case "com.amazonaws.codepipeline#PipelineExecutionNotFoundException": - throw await de_PipelineExecutionNotFoundExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.codepipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListActionTypesCommand */ @@ -1660,7 +1101,7 @@ export const de_ListActionTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListActionTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1672,35 +1113,6 @@ export const de_ListActionTypesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListActionTypesCommandError - */ -const de_ListActionTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codepipeline#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPipelineExecutionsCommand */ @@ -1709,7 +1121,7 @@ export const de_ListPipelineExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPipelineExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1721,38 +1133,6 @@ export const de_ListPipelineExecutionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPipelineExecutionsCommandError - */ -const de_ListPipelineExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codepipeline#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.codepipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPipelinesCommand */ @@ -1761,7 +1141,7 @@ export const de_ListPipelinesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPipelinesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1773,35 +1153,6 @@ export const de_ListPipelinesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPipelinesCommandError - */ -const de_ListPipelinesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codepipeline#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -1810,7 +1161,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1822,41 +1173,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.codepipeline#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.codepipeline#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codepipeline#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListWebhooksCommand */ @@ -1865,7 +1181,7 @@ export const de_ListWebhooksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListWebhooksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1877,35 +1193,6 @@ export const de_ListWebhooksCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListWebhooksCommandError - */ -const de_ListWebhooksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codepipeline#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PollForJobsCommand */ @@ -1914,7 +1201,7 @@ export const de_PollForJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PollForJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1926,35 +1213,6 @@ export const de_PollForJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1PollForJobsCommandError - */ -const de_PollForJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActionTypeNotFoundException": - case "com.amazonaws.codepipeline#ActionTypeNotFoundException": - throw await de_ActionTypeNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PollForThirdPartyJobsCommand */ @@ -1963,7 +1221,7 @@ export const de_PollForThirdPartyJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PollForThirdPartyJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1975,35 +1233,6 @@ export const de_PollForThirdPartyJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1PollForThirdPartyJobsCommandError - */ -const de_PollForThirdPartyJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActionTypeNotFoundException": - case "com.amazonaws.codepipeline#ActionTypeNotFoundException": - throw await de_ActionTypeNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutActionRevisionCommand */ @@ -2012,7 +1241,7 @@ export const de_PutActionRevisionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutActionRevisionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2024,41 +1253,6 @@ export const de_PutActionRevisionCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutActionRevisionCommandError - */ -const de_PutActionRevisionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActionNotFoundException": - case "com.amazonaws.codepipeline#ActionNotFoundException": - throw await de_ActionNotFoundExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.codepipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "StageNotFoundException": - case "com.amazonaws.codepipeline#StageNotFoundException": - throw await de_StageNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutApprovalResultCommand */ @@ -2067,7 +1261,7 @@ export const de_PutApprovalResultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutApprovalResultCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2080,95 +1274,22 @@ export const de_PutApprovalResultCommand = async ( }; /** - * deserializeAws_json1_1PutApprovalResultCommandError + * deserializeAws_json1_1PutJobFailureResultCommand */ -const de_PutApprovalResultCommandError = async ( +export const de_PutJobFailureResultCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActionNotFoundException": - case "com.amazonaws.codepipeline#ActionNotFoundException": - throw await de_ActionNotFoundExceptionRes(parsedOutput, context); - case "ApprovalAlreadyCompletedException": - case "com.amazonaws.codepipeline#ApprovalAlreadyCompletedException": - throw await de_ApprovalAlreadyCompletedExceptionRes(parsedOutput, context); - case "InvalidApprovalTokenException": - case "com.amazonaws.codepipeline#InvalidApprovalTokenException": - throw await de_InvalidApprovalTokenExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.codepipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "StageNotFoundException": - case "com.amazonaws.codepipeline#StageNotFoundException": - throw await de_StageNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutJobFailureResultCommand - */ -export const de_PutJobFailureResultCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutJobFailureResultCommandError(output, context); - } - await collectBody(output.body, context); - const response: PutJobFailureResultCommandOutput = { - $metadata: deserializeMetadata(output), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: PutJobFailureResultCommandOutput = { + $metadata: deserializeMetadata(output), }; return response; }; -/** - * deserializeAws_json1_1PutJobFailureResultCommandError - */ -const de_PutJobFailureResultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidJobStateException": - case "com.amazonaws.codepipeline#InvalidJobStateException": - throw await de_InvalidJobStateExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.codepipeline#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutJobSuccessResultCommand */ @@ -2177,7 +1298,7 @@ export const de_PutJobSuccessResultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutJobSuccessResultCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutJobSuccessResultCommandOutput = { @@ -2186,41 +1307,6 @@ export const de_PutJobSuccessResultCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutJobSuccessResultCommandError - */ -const de_PutJobSuccessResultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidJobStateException": - case "com.amazonaws.codepipeline#InvalidJobStateException": - throw await de_InvalidJobStateExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.codepipeline#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "OutputVariablesSizeExceededException": - case "com.amazonaws.codepipeline#OutputVariablesSizeExceededException": - throw await de_OutputVariablesSizeExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutThirdPartyJobFailureResultCommand */ @@ -2229,7 +1315,7 @@ export const de_PutThirdPartyJobFailureResultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutThirdPartyJobFailureResultCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutThirdPartyJobFailureResultCommandOutput = { @@ -2238,41 +1324,6 @@ export const de_PutThirdPartyJobFailureResultCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutThirdPartyJobFailureResultCommandError - */ -const de_PutThirdPartyJobFailureResultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidClientTokenException": - case "com.amazonaws.codepipeline#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidJobStateException": - case "com.amazonaws.codepipeline#InvalidJobStateException": - throw await de_InvalidJobStateExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.codepipeline#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutThirdPartyJobSuccessResultCommand */ @@ -2281,7 +1332,7 @@ export const de_PutThirdPartyJobSuccessResultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutThirdPartyJobSuccessResultCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutThirdPartyJobSuccessResultCommandOutput = { @@ -2290,41 +1341,6 @@ export const de_PutThirdPartyJobSuccessResultCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutThirdPartyJobSuccessResultCommandError - */ -const de_PutThirdPartyJobSuccessResultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidClientTokenException": - case "com.amazonaws.codepipeline#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidJobStateException": - case "com.amazonaws.codepipeline#InvalidJobStateException": - throw await de_InvalidJobStateExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.codepipeline#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutWebhookCommand */ @@ -2333,7 +1349,7 @@ export const de_PutWebhookCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutWebhookCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2345,53 +1361,6 @@ export const de_PutWebhookCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutWebhookCommandError - */ -const de_PutWebhookCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codepipeline#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidTagsException": - case "com.amazonaws.codepipeline#InvalidTagsException": - throw await de_InvalidTagsExceptionRes(parsedOutput, context); - case "InvalidWebhookAuthenticationParametersException": - case "com.amazonaws.codepipeline#InvalidWebhookAuthenticationParametersException": - throw await de_InvalidWebhookAuthenticationParametersExceptionRes(parsedOutput, context); - case "InvalidWebhookFilterPatternException": - case "com.amazonaws.codepipeline#InvalidWebhookFilterPatternException": - throw await de_InvalidWebhookFilterPatternExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.codepipeline#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.codepipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.codepipeline#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RegisterWebhookWithThirdPartyCommand */ @@ -2400,7 +1369,7 @@ export const de_RegisterWebhookWithThirdPartyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterWebhookWithThirdPartyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2412,35 +1381,6 @@ export const de_RegisterWebhookWithThirdPartyCommand = async ( return response; }; -/** - * deserializeAws_json1_1RegisterWebhookWithThirdPartyCommandError - */ -const de_RegisterWebhookWithThirdPartyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - case "WebhookNotFoundException": - case "com.amazonaws.codepipeline#WebhookNotFoundException": - throw await de_WebhookNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RetryStageExecutionCommand */ @@ -2449,7 +1389,7 @@ export const de_RetryStageExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RetryStageExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2461,47 +1401,6 @@ export const de_RetryStageExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1RetryStageExecutionCommandError - */ -const de_RetryStageExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.codepipeline#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "NotLatestPipelineExecutionException": - case "com.amazonaws.codepipeline#NotLatestPipelineExecutionException": - throw await de_NotLatestPipelineExecutionExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.codepipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "StageNotFoundException": - case "com.amazonaws.codepipeline#StageNotFoundException": - throw await de_StageNotFoundExceptionRes(parsedOutput, context); - case "StageNotRetryableException": - case "com.amazonaws.codepipeline#StageNotRetryableException": - throw await de_StageNotRetryableExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartPipelineExecutionCommand */ @@ -2510,7 +1409,7 @@ export const de_StartPipelineExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartPipelineExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2523,46 +1422,14 @@ export const de_StartPipelineExecutionCommand = async ( }; /** - * deserializeAws_json1_1StartPipelineExecutionCommandError + * deserializeAws_json1_1StopPipelineExecutionCommand */ -const de_StartPipelineExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.codepipeline#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.codepipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StopPipelineExecutionCommand - */ -export const de_StopPipelineExecutionCommand = async ( +export const de_StopPipelineExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopPipelineExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2574,44 +1441,6 @@ export const de_StopPipelineExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopPipelineExecutionCommandError - */ -const de_StopPipelineExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.codepipeline#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DuplicatedStopRequestException": - case "com.amazonaws.codepipeline#DuplicatedStopRequestException": - throw await de_DuplicatedStopRequestExceptionRes(parsedOutput, context); - case "PipelineExecutionNotStoppableException": - case "com.amazonaws.codepipeline#PipelineExecutionNotStoppableException": - throw await de_PipelineExecutionNotStoppableExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.codepipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -2620,7 +1449,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2632,47 +1461,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codepipeline#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.codepipeline#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidTagsException": - case "com.amazonaws.codepipeline#InvalidTagsException": - throw await de_InvalidTagsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codepipeline#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.codepipeline#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -2681,7 +1469,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2693,44 +1481,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codepipeline#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.codepipeline#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidTagsException": - case "com.amazonaws.codepipeline#InvalidTagsException": - throw await de_InvalidTagsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codepipeline#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateActionTypeCommand */ @@ -2739,7 +1489,7 @@ export const de_UpdateActionTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateActionTypeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateActionTypeCommandOutput = { @@ -2748,38 +1498,6 @@ export const de_UpdateActionTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateActionTypeCommandError - */ -const de_UpdateActionTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActionTypeNotFoundException": - case "com.amazonaws.codepipeline#ActionTypeNotFoundException": - throw await de_ActionTypeNotFoundExceptionRes(parsedOutput, context); - case "RequestFailedException": - case "com.amazonaws.codepipeline#RequestFailedException": - throw await de_RequestFailedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdatePipelineCommand */ @@ -2788,7 +1506,7 @@ export const de_UpdatePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePipelineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2801,18 +1519,39 @@ export const de_UpdatePipelineCommand = async ( }; /** - * deserializeAws_json1_1UpdatePipelineCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdatePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "InvalidNonceException": + case "com.amazonaws.codepipeline#InvalidNonceException": + throw await de_InvalidNonceExceptionRes(parsedOutput, context); + case "JobNotFoundException": + case "com.amazonaws.codepipeline#JobNotFoundException": + throw await de_JobNotFoundExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.codepipeline#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "InvalidClientTokenException": + case "com.amazonaws.codepipeline#InvalidClientTokenException": + throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.codepipeline#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "InvalidTagsException": + case "com.amazonaws.codepipeline#InvalidTagsException": + throw await de_InvalidTagsExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.codepipeline#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.codepipeline#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); case "InvalidActionDeclarationException": case "com.amazonaws.codepipeline#InvalidActionDeclarationException": throw await de_InvalidActionDeclarationExceptionRes(parsedOutput, context); @@ -2825,19 +1564,85 @@ const de_UpdatePipelineCommandError = async ( case "InvalidStructureException": case "com.amazonaws.codepipeline#InvalidStructureException": throw await de_InvalidStructureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.codepipeline#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codepipeline#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); + case "PipelineNameInUseException": + case "com.amazonaws.codepipeline#PipelineNameInUseException": + throw await de_PipelineNameInUseExceptionRes(parsedOutput, context); + case "WebhookNotFoundException": + case "com.amazonaws.codepipeline#WebhookNotFoundException": + throw await de_WebhookNotFoundExceptionRes(parsedOutput, context); + case "PipelineNotFoundException": + case "com.amazonaws.codepipeline#PipelineNotFoundException": + throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); + case "StageNotFoundException": + case "com.amazonaws.codepipeline#StageNotFoundException": + throw await de_StageNotFoundExceptionRes(parsedOutput, context); + case "ActionTypeNotFoundException": + case "com.amazonaws.codepipeline#ActionTypeNotFoundException": + throw await de_ActionTypeNotFoundExceptionRes(parsedOutput, context); + case "PipelineVersionNotFoundException": + case "com.amazonaws.codepipeline#PipelineVersionNotFoundException": + throw await de_PipelineVersionNotFoundExceptionRes(parsedOutput, context); + case "PipelineExecutionNotFoundException": + case "com.amazonaws.codepipeline#PipelineExecutionNotFoundException": + throw await de_PipelineExecutionNotFoundExceptionRes(parsedOutput, context); + case "InvalidJobException": + case "com.amazonaws.codepipeline#InvalidJobException": + throw await de_InvalidJobExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.codepipeline#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "InvalidArnException": + case "com.amazonaws.codepipeline#InvalidArnException": + throw await de_InvalidArnExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.codepipeline#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ActionNotFoundException": + case "com.amazonaws.codepipeline#ActionNotFoundException": + throw await de_ActionNotFoundExceptionRes(parsedOutput, context); + case "ApprovalAlreadyCompletedException": + case "com.amazonaws.codepipeline#ApprovalAlreadyCompletedException": + throw await de_ApprovalAlreadyCompletedExceptionRes(parsedOutput, context); + case "InvalidApprovalTokenException": + case "com.amazonaws.codepipeline#InvalidApprovalTokenException": + throw await de_InvalidApprovalTokenExceptionRes(parsedOutput, context); + case "InvalidJobStateException": + case "com.amazonaws.codepipeline#InvalidJobStateException": + throw await de_InvalidJobStateExceptionRes(parsedOutput, context); + case "OutputVariablesSizeExceededException": + case "com.amazonaws.codepipeline#OutputVariablesSizeExceededException": + throw await de_OutputVariablesSizeExceededExceptionRes(parsedOutput, context); + case "InvalidWebhookAuthenticationParametersException": + case "com.amazonaws.codepipeline#InvalidWebhookAuthenticationParametersException": + throw await de_InvalidWebhookAuthenticationParametersExceptionRes(parsedOutput, context); + case "InvalidWebhookFilterPatternException": + case "com.amazonaws.codepipeline#InvalidWebhookFilterPatternException": + throw await de_InvalidWebhookFilterPatternExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.codepipeline#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "NotLatestPipelineExecutionException": + case "com.amazonaws.codepipeline#NotLatestPipelineExecutionException": + throw await de_NotLatestPipelineExecutionExceptionRes(parsedOutput, context); + case "StageNotRetryableException": + case "com.amazonaws.codepipeline#StageNotRetryableException": + throw await de_StageNotRetryableExceptionRes(parsedOutput, context); + case "DuplicatedStopRequestException": + case "com.amazonaws.codepipeline#DuplicatedStopRequestException": + throw await de_DuplicatedStopRequestExceptionRes(parsedOutput, context); + case "PipelineExecutionNotStoppableException": + case "com.amazonaws.codepipeline#PipelineExecutionNotStoppableException": + throw await de_PipelineExecutionNotStoppableExceptionRes(parsedOutput, context); + case "RequestFailedException": + case "com.amazonaws.codepipeline#RequestFailedException": + throw await de_RequestFailedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts b/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts index 4cd5addc195f..52842a6fe5b5 100644 --- a/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts +++ b/clients/client-codestar-connections/src/protocols/Aws_json1_0.ts @@ -506,7 +506,7 @@ export const de_CreateConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -518,38 +518,6 @@ export const de_CreateConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateConnectionCommandError - */ -const de_CreateConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.codestarconnections#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.codestarconnections#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateHostCommand */ @@ -558,7 +526,7 @@ export const de_CreateHostCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateHostCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -570,32 +538,6 @@ export const de_CreateHostCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateHostCommandError - */ -const de_CreateHostCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.codestarconnections#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateRepositoryLinkCommand */ @@ -604,7 +546,7 @@ export const de_CreateRepositoryLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRepositoryLinkCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -616,50 +558,6 @@ export const de_CreateRepositoryLinkCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateRepositoryLinkCommandError - */ -const de_CreateRepositoryLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codestarconnections#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.codestarconnections#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codestarconnections#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codestarconnections#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.codestarconnections#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.codestarconnections#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codestarconnections#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateSyncConfigurationCommand */ @@ -668,7 +566,7 @@ export const de_CreateSyncConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSyncConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -680,50 +578,6 @@ export const de_CreateSyncConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateSyncConfigurationCommandError - */ -const de_CreateSyncConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codestarconnections#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.codestarconnections#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codestarconnections#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codestarconnections#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.codestarconnections#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.codestarconnections#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codestarconnections#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteConnectionCommand */ @@ -732,7 +586,7 @@ export const de_DeleteConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -744,32 +598,6 @@ export const de_DeleteConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteConnectionCommandError - */ -const de_DeleteConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteHostCommand */ @@ -778,7 +606,7 @@ export const de_DeleteHostCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteHostCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -791,48 +619,39 @@ export const de_DeleteHostCommand = async ( }; /** - * deserializeAws_json1_0DeleteHostCommandError + * deserializeAws_json1_0DeleteRepositoryLinkCommand */ -const de_DeleteHostCommandError = async ( +export const de_DeleteRepositoryLinkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.codestarconnections#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteRepositoryLinkCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DeleteRepositoryLinkCommand + * deserializeAws_json1_0DeleteSyncConfigurationCommand */ -export const de_DeleteRepositoryLinkCommand = async ( +export const de_DeleteSyncConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRepositoryLinkCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRepositoryLinkCommandOutput = { + const response: DeleteSyncConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -840,66 +659,39 @@ export const de_DeleteRepositoryLinkCommand = async ( }; /** - * deserializeAws_json1_0DeleteRepositoryLinkCommandError + * deserializeAws_json1_0GetConnectionCommand */ -const de_DeleteRepositoryLinkCommandError = async ( +export const de_GetConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codestarconnections#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.codestarconnections#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codestarconnections#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codestarconnections#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "SyncConfigurationStillExistsException": - case "com.amazonaws.codestarconnections#SyncConfigurationStillExistsException": - throw await de_SyncConfigurationStillExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codestarconnections#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedProviderTypeException": - case "com.amazonaws.codestarconnections#UnsupportedProviderTypeException": - throw await de_UnsupportedProviderTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetConnectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DeleteSyncConfigurationCommand + * deserializeAws_json1_0GetHostCommand */ -export const de_DeleteSyncConfigurationCommand = async ( +export const de_GetHostCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSyncConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteSyncConfigurationCommandOutput = { + const response: GetHostCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -907,153 +699,14 @@ export const de_DeleteSyncConfigurationCommand = async ( }; /** - * deserializeAws_json1_0DeleteSyncConfigurationCommandError + * deserializeAws_json1_0GetRepositoryLinkCommand */ -const de_DeleteSyncConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codestarconnections#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.codestarconnections#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codestarconnections#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codestarconnections#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.codestarconnections#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codestarconnections#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetConnectionCommand - */ -export const de_GetConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetConnectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetConnectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetConnectionCommandError - */ -const de_GetConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.codestarconnections#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetHostCommand - */ -export const de_GetHostCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetHostCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetHostCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetHostCommandError - */ -const de_GetHostCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.codestarconnections#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetRepositoryLinkCommand - */ -export const de_GetRepositoryLinkCommand = async ( +export const de_GetRepositoryLinkCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRepositoryLinkCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1065,47 +718,6 @@ export const de_GetRepositoryLinkCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetRepositoryLinkCommandError - */ -const de_GetRepositoryLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codestarconnections#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.codestarconnections#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codestarconnections#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codestarconnections#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codestarconnections#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetRepositorySyncStatusCommand */ @@ -1114,7 +726,7 @@ export const de_GetRepositorySyncStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRepositorySyncStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1126,44 +738,6 @@ export const de_GetRepositorySyncStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetRepositorySyncStatusCommandError - */ -const de_GetRepositorySyncStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codestarconnections#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codestarconnections#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codestarconnections#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codestarconnections#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetResourceSyncStatusCommand */ @@ -1172,7 +746,7 @@ export const de_GetResourceSyncStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetResourceSyncStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1184,44 +758,6 @@ export const de_GetResourceSyncStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetResourceSyncStatusCommandError - */ -const de_GetResourceSyncStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codestarconnections#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codestarconnections#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codestarconnections#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codestarconnections#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetSyncBlockerSummaryCommand */ @@ -1230,7 +766,7 @@ export const de_GetSyncBlockerSummaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSyncBlockerSummaryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1242,44 +778,6 @@ export const de_GetSyncBlockerSummaryCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetSyncBlockerSummaryCommandError - */ -const de_GetSyncBlockerSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codestarconnections#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codestarconnections#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codestarconnections#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codestarconnections#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetSyncConfigurationCommand */ @@ -1288,7 +786,7 @@ export const de_GetSyncConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSyncConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1300,44 +798,6 @@ export const de_GetSyncConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetSyncConfigurationCommandError - */ -const de_GetSyncConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codestarconnections#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codestarconnections#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codestarconnections#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codestarconnections#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListConnectionsCommand */ @@ -1346,7 +806,7 @@ export const de_ListConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1358,32 +818,6 @@ export const de_ListConnectionsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListConnectionsCommandError - */ -const de_ListConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListHostsCommand */ @@ -1392,7 +826,7 @@ export const de_ListHostsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListHostsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1404,26 +838,6 @@ export const de_ListHostsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListHostsCommandError - */ -const de_ListHostsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_0ListRepositoryLinksCommand */ @@ -1432,189 +846,32 @@ export const de_ListRepositoryLinksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRepositoryLinksCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListRepositoryLinksCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListRepositoryLinksCommandError - */ -const de_ListRepositoryLinksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codestarconnections#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.codestarconnections#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codestarconnections#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codestarconnections#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codestarconnections#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListRepositorySyncDefinitionsCommand - */ -export const de_ListRepositorySyncDefinitionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRepositorySyncDefinitionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListRepositorySyncDefinitionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListRepositorySyncDefinitionsCommandError - */ -const de_ListRepositorySyncDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codestarconnections#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codestarconnections#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codestarconnections#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codestarconnections#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListSyncConfigurationsCommand - */ -export const de_ListSyncConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSyncConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListSyncConfigurationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListSyncConfigurationsCommandError - */ -const de_ListSyncConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codestarconnections#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codestarconnections#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codestarconnections#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codestarconnections#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + let contents: any = {}; + contents = _json(data); + const response: ListRepositoryLinksCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListTagsForResourceCommand + * deserializeAws_json1_0ListRepositorySyncDefinitionsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListRepositorySyncDefinitionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + const response: ListRepositorySyncDefinitionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1622,45 +879,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_0ListTagsForResourceCommandError + * deserializeAws_json1_0ListSyncConfigurationsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListSyncConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListSyncConfigurationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0TagResourceCommand + * deserializeAws_json1_0ListTagsForResourceCommand */ -export const de_TagResourceCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1668,32 +919,23 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_0TagResourceCommandError + * deserializeAws_json1_0TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.codestarconnections#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1704,7 +946,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1716,32 +958,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateHostCommand */ @@ -1750,7 +966,7 @@ export const de_UpdateHostCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateHostCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1762,41 +978,6 @@ export const de_UpdateHostCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateHostCommandError - */ -const de_UpdateHostCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.codestarconnections#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.codestarconnections#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.codestarconnections#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateRepositoryLinkCommand */ @@ -1805,7 +986,7 @@ export const de_UpdateRepositoryLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRepositoryLinkCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1817,50 +998,6 @@ export const de_UpdateRepositoryLinkCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateRepositoryLinkCommandError - */ -const de_UpdateRepositoryLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codestarconnections#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConditionalCheckFailedException": - case "com.amazonaws.codestarconnections#ConditionalCheckFailedException": - throw await de_ConditionalCheckFailedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codestarconnections#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codestarconnections#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codestarconnections#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UpdateOutOfSyncException": - case "com.amazonaws.codestarconnections#UpdateOutOfSyncException": - throw await de_UpdateOutOfSyncExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateSyncBlockerCommand */ @@ -1869,7 +1006,7 @@ export const de_UpdateSyncBlockerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSyncBlockerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1881,50 +1018,6 @@ export const de_UpdateSyncBlockerCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateSyncBlockerCommandError - */ -const de_UpdateSyncBlockerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codestarconnections#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.codestarconnections#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.codestarconnections#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "RetryLatestCommitFailedException": - case "com.amazonaws.codestarconnections#RetryLatestCommitFailedException": - throw await de_RetryLatestCommitFailedExceptionRes(parsedOutput, context); - case "SyncBlockerDoesNotExistException": - case "com.amazonaws.codestarconnections#SyncBlockerDoesNotExistException": - throw await de_SyncBlockerDoesNotExistExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.codestarconnections#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateSyncConfigurationCommand */ @@ -1933,7 +1026,7 @@ export const de_UpdateSyncConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSyncConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1946,18 +1039,24 @@ export const de_UpdateSyncConfigurationCommand = async ( }; /** - * deserializeAws_json1_0UpdateSyncConfigurationCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateSyncConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "LimitExceededException": + case "com.amazonaws.codestarconnections#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.codestarconnections#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ResourceUnavailableException": + case "com.amazonaws.codestarconnections#ResourceUnavailableException": + throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); case "AccessDeniedException": case "com.amazonaws.codestarconnections#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); @@ -1970,22 +1069,43 @@ const de_UpdateSyncConfigurationCommandError = async ( case "InvalidInputException": case "com.amazonaws.codestarconnections#InvalidInputException": throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarconnections#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.codestarconnections#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.codestarconnections#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "SyncConfigurationStillExistsException": + case "com.amazonaws.codestarconnections#SyncConfigurationStillExistsException": + throw await de_SyncConfigurationStillExistsExceptionRes(parsedOutput, context); + case "UnsupportedProviderTypeException": + case "com.amazonaws.codestarconnections#UnsupportedProviderTypeException": + throw await de_UnsupportedProviderTypeExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.codestarconnections#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "UnsupportedOperationException": + case "com.amazonaws.codestarconnections#UnsupportedOperationException": + throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); + case "ConditionalCheckFailedException": + case "com.amazonaws.codestarconnections#ConditionalCheckFailedException": + throw await de_ConditionalCheckFailedExceptionRes(parsedOutput, context); case "UpdateOutOfSyncException": case "com.amazonaws.codestarconnections#UpdateOutOfSyncException": throw await de_UpdateOutOfSyncExceptionRes(parsedOutput, context); + case "RetryLatestCommitFailedException": + case "com.amazonaws.codestarconnections#RetryLatestCommitFailedException": + throw await de_RetryLatestCommitFailedExceptionRes(parsedOutput, context); + case "SyncBlockerDoesNotExistException": + case "com.amazonaws.codestarconnections#SyncBlockerDoesNotExistException": + throw await de_SyncBlockerDoesNotExistExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts b/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts index 31947b6f78ff..0d02bf60b4ff 100644 --- a/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts +++ b/clients/client-codestar-notifications/src/protocols/Aws_restJson1.ts @@ -387,7 +387,7 @@ export const de_CreateNotificationRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateNotificationRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -400,47 +400,6 @@ export const de_CreateNotificationRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateNotificationRuleCommandError - */ -const de_CreateNotificationRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.codestarnotifications#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.codestarnotifications#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConfigurationException": - case "com.amazonaws.codestarnotifications#ConfigurationException": - throw await de_ConfigurationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.codestarnotifications#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.codestarnotifications#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestarnotifications#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteNotificationRuleCommand */ @@ -449,7 +408,7 @@ export const de_DeleteNotificationRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteNotificationRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -462,38 +421,6 @@ export const de_DeleteNotificationRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteNotificationRuleCommandError - */ -const de_DeleteNotificationRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codestarnotifications#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.codestarnotifications#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestarnotifications#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteTargetCommand */ @@ -502,7 +429,7 @@ export const de_DeleteTargetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTargetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -511,32 +438,6 @@ export const de_DeleteTargetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteTargetCommandError - */ -const de_DeleteTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.codestarnotifications#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeNotificationRuleCommand */ @@ -545,7 +446,7 @@ export const de_DescribeNotificationRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeNotificationRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -568,35 +469,6 @@ export const de_DescribeNotificationRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeNotificationRuleCommandError - */ -const de_DescribeNotificationRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.codestarnotifications#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestarnotifications#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEventTypesCommand */ @@ -605,7 +477,7 @@ export const de_ListEventTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEventTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -619,35 +491,6 @@ export const de_ListEventTypesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEventTypesCommandError - */ -const de_ListEventTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codestarnotifications#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestarnotifications#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListNotificationRulesCommand */ @@ -656,7 +499,7 @@ export const de_ListNotificationRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNotificationRulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -670,35 +513,6 @@ export const de_ListNotificationRulesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListNotificationRulesCommandError - */ -const de_ListNotificationRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codestarnotifications#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestarnotifications#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -707,7 +521,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -720,35 +534,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.codestarnotifications#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestarnotifications#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTargetsCommand */ @@ -757,7 +542,7 @@ export const de_ListTargetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTargetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -771,35 +556,6 @@ export const de_ListTargetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTargetsCommandError - */ -const de_ListTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codestarnotifications#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestarnotifications#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SubscribeCommand */ @@ -808,7 +564,7 @@ export const de_SubscribeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SubscribeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -821,38 +577,6 @@ export const de_SubscribeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SubscribeCommandError - */ -const de_SubscribeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConfigurationException": - case "com.amazonaws.codestarnotifications#ConfigurationException": - throw await de_ConfigurationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarnotifications#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestarnotifications#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -861,7 +585,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -874,41 +598,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codestarnotifications#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.codestarnotifications#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarnotifications#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestarnotifications#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UnsubscribeCommand */ @@ -917,7 +606,7 @@ export const de_UnsubscribeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UnsubscribeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -930,32 +619,6 @@ export const de_UnsubscribeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UnsubscribeCommandError - */ -const de_UnsubscribeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.codestarnotifications#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -964,7 +627,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -973,41 +636,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codestarnotifications#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.codestarnotifications#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarnotifications#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestarnotifications#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateNotificationRuleCommand */ @@ -1016,7 +644,7 @@ export const de_UpdateNotificationRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateNotificationRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1026,34 +654,46 @@ export const de_UpdateNotificationRuleCommand = async ( }; /** - * deserializeAws_restJson1UpdateNotificationRuleCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateNotificationRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.codestarnotifications#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.codestarnotifications#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); case "ConfigurationException": case "com.amazonaws.codestarnotifications#ConfigurationException": throw await de_ConfigurationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.codestarnotifications#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.codestarnotifications#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.codestarnotifications#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.codestarnotifications#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.codestarnotifications#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.codestarnotifications#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-codestar/src/protocols/Aws_json1_1.ts b/clients/client-codestar/src/protocols/Aws_json1_1.ts index 23d9ec2736df..1c3555f12094 100644 --- a/clients/client-codestar/src/protocols/Aws_json1_1.ts +++ b/clients/client-codestar/src/protocols/Aws_json1_1.ts @@ -334,7 +334,7 @@ export const de_AssociateTeamMemberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateTeamMemberCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -346,50 +346,6 @@ export const de_AssociateTeamMemberCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateTeamMemberCommandError - */ -const de_AssociateTeamMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codestar#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidServiceRoleException": - case "com.amazonaws.codestar#InvalidServiceRoleException": - throw await de_InvalidServiceRoleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.codestar#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProjectConfigurationException": - case "com.amazonaws.codestar#ProjectConfigurationException": - throw await de_ProjectConfigurationExceptionRes(parsedOutput, context); - case "ProjectNotFoundException": - case "com.amazonaws.codestar#ProjectNotFoundException": - throw await de_ProjectNotFoundExceptionRes(parsedOutput, context); - case "TeamMemberAlreadyAssociatedException": - case "com.amazonaws.codestar#TeamMemberAlreadyAssociatedException": - throw await de_TeamMemberAlreadyAssociatedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateProjectCommand */ @@ -398,7 +354,7 @@ export const de_CreateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -410,50 +366,6 @@ export const de_CreateProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateProjectCommandError - */ -const de_CreateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codestar#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidServiceRoleException": - case "com.amazonaws.codestar#InvalidServiceRoleException": - throw await de_InvalidServiceRoleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.codestar#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProjectAlreadyExistsException": - case "com.amazonaws.codestar#ProjectAlreadyExistsException": - throw await de_ProjectAlreadyExistsExceptionRes(parsedOutput, context); - case "ProjectConfigurationException": - case "com.amazonaws.codestar#ProjectConfigurationException": - throw await de_ProjectConfigurationExceptionRes(parsedOutput, context); - case "ProjectCreationFailedException": - case "com.amazonaws.codestar#ProjectCreationFailedException": - throw await de_ProjectCreationFailedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateUserProfileCommand */ @@ -462,7 +374,7 @@ export const de_CreateUserProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateUserProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -474,35 +386,6 @@ export const de_CreateUserProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateUserProfileCommandError - */ -const de_CreateUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UserProfileAlreadyExistsException": - case "com.amazonaws.codestar#UserProfileAlreadyExistsException": - throw await de_UserProfileAlreadyExistsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteProjectCommand */ @@ -511,7 +394,7 @@ export const de_DeleteProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -523,38 +406,6 @@ export const de_DeleteProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteProjectCommandError - */ -const de_DeleteProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codestar#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidServiceRoleException": - case "com.amazonaws.codestar#InvalidServiceRoleException": - throw await de_InvalidServiceRoleExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteUserProfileCommand */ @@ -563,7 +414,7 @@ export const de_DeleteUserProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteUserProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -575,32 +426,6 @@ export const de_DeleteUserProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteUserProfileCommandError - */ -const de_DeleteUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeProjectCommand */ @@ -609,7 +434,7 @@ export const de_DescribeProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -621,44 +446,6 @@ export const de_DescribeProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeProjectCommandError - */ -const de_DescribeProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codestar#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidServiceRoleException": - case "com.amazonaws.codestar#InvalidServiceRoleException": - throw await de_InvalidServiceRoleExceptionRes(parsedOutput, context); - case "ProjectConfigurationException": - case "com.amazonaws.codestar#ProjectConfigurationException": - throw await de_ProjectConfigurationExceptionRes(parsedOutput, context); - case "ProjectNotFoundException": - case "com.amazonaws.codestar#ProjectNotFoundException": - throw await de_ProjectNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeUserProfileCommand */ @@ -667,7 +454,7 @@ export const de_DescribeUserProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeUserProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -679,35 +466,6 @@ export const de_DescribeUserProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeUserProfileCommandError - */ -const de_DescribeUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UserProfileNotFoundException": - case "com.amazonaws.codestar#UserProfileNotFoundException": - throw await de_UserProfileNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisassociateTeamMemberCommand */ @@ -716,7 +474,7 @@ export const de_DisassociateTeamMemberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateTeamMemberCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -728,41 +486,6 @@ export const de_DisassociateTeamMemberCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateTeamMemberCommandError - */ -const de_DisassociateTeamMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codestar#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidServiceRoleException": - case "com.amazonaws.codestar#InvalidServiceRoleException": - throw await de_InvalidServiceRoleExceptionRes(parsedOutput, context); - case "ProjectNotFoundException": - case "com.amazonaws.codestar#ProjectNotFoundException": - throw await de_ProjectNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListProjectsCommand */ @@ -771,7 +494,7 @@ export const de_ListProjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListProjectsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -783,35 +506,6 @@ export const de_ListProjectsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListProjectsCommandError - */ -const de_ListProjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codestar#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListResourcesCommand */ @@ -820,7 +514,7 @@ export const de_ListResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -829,39 +523,7 @@ export const de_ListResourcesCommand = async ( $metadata: deserializeMetadata(output), ...contents, }; - return response; -}; - -/** - * deserializeAws_json1_1ListResourcesCommandError - */ -const de_ListResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codestar#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ProjectNotFoundException": - case "com.amazonaws.codestar#ProjectNotFoundException": - throw await de_ProjectNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** @@ -872,7 +534,7 @@ export const de_ListTagsForProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -884,38 +546,6 @@ export const de_ListTagsForProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForProjectCommandError - */ -const de_ListTagsForProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codestar#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ProjectNotFoundException": - case "com.amazonaws.codestar#ProjectNotFoundException": - throw await de_ProjectNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTeamMembersCommand */ @@ -924,7 +554,7 @@ export const de_ListTeamMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTeamMembersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -936,38 +566,6 @@ export const de_ListTeamMembersCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTeamMembersCommandError - */ -const de_ListTeamMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codestar#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ProjectNotFoundException": - case "com.amazonaws.codestar#ProjectNotFoundException": - throw await de_ProjectNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListUserProfilesCommand */ @@ -976,7 +574,7 @@ export const de_ListUserProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListUserProfilesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -988,35 +586,6 @@ export const de_ListUserProfilesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListUserProfilesCommandError - */ -const de_ListUserProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.codestar#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagProjectCommand */ @@ -1025,7 +594,7 @@ export const de_TagProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1037,41 +606,6 @@ export const de_TagProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagProjectCommandError - */ -const de_TagProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codestar#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.codestar#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProjectNotFoundException": - case "com.amazonaws.codestar#ProjectNotFoundException": - throw await de_ProjectNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagProjectCommand */ @@ -1080,7 +614,7 @@ export const de_UntagProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1092,41 +626,6 @@ export const de_UntagProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagProjectCommandError - */ -const de_UntagProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.codestar#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.codestar#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProjectNotFoundException": - case "com.amazonaws.codestar#ProjectNotFoundException": - throw await de_ProjectNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateProjectCommand */ @@ -1135,7 +634,7 @@ export const de_UpdateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1147,35 +646,6 @@ export const de_UpdateProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateProjectCommandError - */ -const de_UpdateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ProjectNotFoundException": - case "com.amazonaws.codestar#ProjectNotFoundException": - throw await de_ProjectNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateTeamMemberCommand */ @@ -1184,7 +654,7 @@ export const de_UpdateTeamMemberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTeamMemberCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1197,12 +667,29 @@ export const de_UpdateTeamMemberCommand = async ( }; /** - * deserializeAws_json1_1UpdateTeamMemberCommandError + * deserializeAws_json1_1UpdateUserProfileCommand */ -const de_UpdateTeamMemberCommandError = async ( +export const de_UpdateUserProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateUserProfileResult(data, context); + const response: UpdateUserProfileCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserialize_Aws_json1_1CommandError + */ +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1224,68 +711,37 @@ const de_UpdateTeamMemberCommandError = async ( case "ProjectNotFoundException": case "com.amazonaws.codestar#ProjectNotFoundException": throw await de_ProjectNotFoundExceptionRes(parsedOutput, context); - case "TeamMemberNotFoundException": - case "com.amazonaws.codestar#TeamMemberNotFoundException": - throw await de_TeamMemberNotFoundExceptionRes(parsedOutput, context); + case "TeamMemberAlreadyAssociatedException": + case "com.amazonaws.codestar#TeamMemberAlreadyAssociatedException": + throw await de_TeamMemberAlreadyAssociatedExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.codestar#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateUserProfileCommand - */ -export const de_UpdateUserProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateUserProfileCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateUserProfileResult(data, context); - const response: UpdateUserProfileCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateUserProfileCommandError - */ -const de_UpdateUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { + case "ProjectAlreadyExistsException": + case "com.amazonaws.codestar#ProjectAlreadyExistsException": + throw await de_ProjectAlreadyExistsExceptionRes(parsedOutput, context); + case "ProjectCreationFailedException": + case "com.amazonaws.codestar#ProjectCreationFailedException": + throw await de_ProjectCreationFailedExceptionRes(parsedOutput, context); + case "UserProfileAlreadyExistsException": + case "com.amazonaws.codestar#UserProfileAlreadyExistsException": + throw await de_UserProfileAlreadyExistsExceptionRes(parsedOutput, context); case "UserProfileNotFoundException": case "com.amazonaws.codestar#UserProfileNotFoundException": throw await de_UserProfileNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.codestar#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.codestar#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "TeamMemberNotFoundException": + case "com.amazonaws.codestar#TeamMemberNotFoundException": + throw await de_TeamMemberNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts b/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts index 2ccae691097d..8ae7b8e98ef2 100644 --- a/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts +++ b/clients/client-cognito-identity-provider/src/protocols/Aws_json1_1.ts @@ -1892,7 +1892,7 @@ export const de_AddCustomAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddCustomAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1904,47 +1904,6 @@ export const de_AddCustomAttributesCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddCustomAttributesCommandError - */ -const de_AddCustomAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserImportInProgressException": - case "com.amazonaws.cognitoidentityprovider#UserImportInProgressException": - throw await de_UserImportInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AdminAddUserToGroupCommand */ @@ -1953,7 +1912,7 @@ export const de_AdminAddUserToGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AdminAddUserToGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AdminAddUserToGroupCommandOutput = { @@ -1962,47 +1921,6 @@ export const de_AdminAddUserToGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1AdminAddUserToGroupCommandError - */ -const de_AdminAddUserToGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AdminConfirmSignUpCommand */ @@ -2011,7 +1929,7 @@ export const de_AdminConfirmSignUpCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AdminConfirmSignUpCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2023,62 +1941,6 @@ export const de_AdminConfirmSignUpCommand = async ( return response; }; -/** - * deserializeAws_json1_1AdminConfirmSignUpCommandError - */ -const de_AdminConfirmSignUpCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyFailedAttemptsException": - case "com.amazonaws.cognitoidentityprovider#TooManyFailedAttemptsException": - throw await de_TooManyFailedAttemptsExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnexpectedLambdaException": - case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": - throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); - case "UserLambdaValidationException": - case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": - throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AdminCreateUserCommand */ @@ -2087,7 +1949,7 @@ export const de_AdminCreateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AdminCreateUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2099,77 +1961,6 @@ export const de_AdminCreateUserCommand = async ( return response; }; -/** - * deserializeAws_json1_1AdminCreateUserCommandError - */ -const de_AdminCreateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeDeliveryFailureException": - case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException": - throw await de_CodeDeliveryFailureExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPasswordException": - case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException": - throw await de_InvalidPasswordExceptionRes(parsedOutput, context); - case "InvalidSmsRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": - throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidSmsRoleTrustRelationshipException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": - throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.cognitoidentityprovider#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnexpectedLambdaException": - case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": - throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); - case "UnsupportedUserStateException": - case "com.amazonaws.cognitoidentityprovider#UnsupportedUserStateException": - throw await de_UnsupportedUserStateExceptionRes(parsedOutput, context); - case "UserLambdaValidationException": - case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": - throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - case "UsernameExistsException": - case "com.amazonaws.cognitoidentityprovider#UsernameExistsException": - throw await de_UsernameExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AdminDeleteUserCommand */ @@ -2178,7 +1969,7 @@ export const de_AdminDeleteUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AdminDeleteUserCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AdminDeleteUserCommandOutput = { @@ -2188,60 +1979,39 @@ export const de_AdminDeleteUserCommand = async ( }; /** - * deserializeAws_json1_1AdminDeleteUserCommandError + * deserializeAws_json1_1AdminDeleteUserAttributesCommand */ -const de_AdminDeleteUserCommandError = async ( +export const de_AdminDeleteUserAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: AdminDeleteUserAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1AdminDeleteUserAttributesCommand + * deserializeAws_json1_1AdminDisableProviderForUserCommand */ -export const de_AdminDeleteUserAttributesCommand = async ( +export const de_AdminDisableProviderForUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AdminDeleteUserAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: AdminDeleteUserAttributesCommandOutput = { + const response: AdminDisableProviderForUserCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2249,60 +2019,39 @@ export const de_AdminDeleteUserAttributesCommand = async ( }; /** - * deserializeAws_json1_1AdminDeleteUserAttributesCommandError + * deserializeAws_json1_1AdminDisableUserCommand */ -const de_AdminDeleteUserAttributesCommandError = async ( +export const de_AdminDisableUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: AdminDisableUserCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1AdminDisableProviderForUserCommand + * deserializeAws_json1_1AdminEnableUserCommand */ -export const de_AdminDisableProviderForUserCommand = async ( +export const de_AdminEnableUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AdminDisableProviderForUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: AdminDisableProviderForUserCommandOutput = { + const response: AdminEnableUserCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2310,63 +2059,36 @@ export const de_AdminDisableProviderForUserCommand = async ( }; /** - * deserializeAws_json1_1AdminDisableProviderForUserCommandError + * deserializeAws_json1_1AdminForgetDeviceCommand */ -const de_AdminDisableProviderForUserCommandError = async ( +export const de_AdminForgetDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AliasExistsException": - case "com.amazonaws.cognitoidentityprovider#AliasExistsException": - throw await de_AliasExistsExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: AdminForgetDeviceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1AdminDisableUserCommand + * deserializeAws_json1_1AdminGetDeviceCommand */ -export const de_AdminDisableUserCommand = async ( +export const de_AdminGetDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AdminDisableUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: AdminDisableUserCommandOutput = { + contents = de_AdminGetDeviceResponse(data, context); + const response: AdminGetDeviceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2374,60 +2096,39 @@ export const de_AdminDisableUserCommand = async ( }; /** - * deserializeAws_json1_1AdminDisableUserCommandError + * deserializeAws_json1_1AdminGetUserCommand */ -const de_AdminDisableUserCommandError = async ( +export const de_AdminGetUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_AdminGetUserResponse(data, context); + const response: AdminGetUserCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1AdminEnableUserCommand + * deserializeAws_json1_1AdminInitiateAuthCommand */ -export const de_AdminEnableUserCommand = async ( +export const de_AdminInitiateAuthCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AdminEnableUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: AdminEnableUserCommandOutput = { + const response: AdminInitiateAuthCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2435,121 +2136,59 @@ export const de_AdminEnableUserCommand = async ( }; /** - * deserializeAws_json1_1AdminEnableUserCommandError - */ -const de_AdminEnableUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1AdminForgetDeviceCommand + * deserializeAws_json1_1AdminLinkProviderForUserCommand */ -export const de_AdminForgetDeviceCommand = async ( +export const de_AdminLinkProviderForUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AdminForgetDeviceCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: AdminForgetDeviceCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: AdminLinkProviderForUserCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1AdminForgetDeviceCommandError + * deserializeAws_json1_1AdminListDevicesCommand */ -const de_AdminForgetDeviceCommandError = async ( +export const de_AdminListDevicesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidUserPoolConfigurationException": - case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException": - throw await de_InvalidUserPoolConfigurationExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_AdminListDevicesResponse(data, context); + const response: AdminListDevicesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1AdminGetDeviceCommand + * deserializeAws_json1_1AdminListGroupsForUserCommand */ -export const de_AdminGetDeviceCommand = async ( +export const de_AdminListGroupsForUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AdminGetDeviceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_AdminGetDeviceResponse(data, context); - const response: AdminGetDeviceCommandOutput = { + contents = de_AdminListGroupsForUserResponse(data, context); + const response: AdminListGroupsForUserCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2557,60 +2196,56 @@ export const de_AdminGetDeviceCommand = async ( }; /** - * deserializeAws_json1_1AdminGetDeviceCommandError + * deserializeAws_json1_1AdminListUserAuthEventsCommand */ -const de_AdminGetDeviceCommandError = async ( +export const de_AdminListUserAuthEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_AdminListUserAuthEventsResponse(data, context); + const response: AdminListUserAuthEventsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidUserPoolConfigurationException": - case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException": - throw await de_InvalidUserPoolConfigurationExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1AdminRemoveUserFromGroupCommand + */ +export const de_AdminRemoveUserFromGroupCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: AdminRemoveUserFromGroupCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1AdminGetUserCommand + * deserializeAws_json1_1AdminResetUserPasswordCommand */ -export const de_AdminGetUserCommand = async ( +export const de_AdminResetUserPasswordCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AdminGetUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_AdminGetUserResponse(data, context); - const response: AdminGetUserCommandOutput = { + contents = _json(data); + const response: AdminResetUserPasswordCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2618,60 +2253,39 @@ export const de_AdminGetUserCommand = async ( }; /** - * deserializeAws_json1_1AdminGetUserCommandError + * deserializeAws_json1_1AdminRespondToAuthChallengeCommand */ -const de_AdminGetUserCommandError = async ( +export const de_AdminRespondToAuthChallengeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: AdminRespondToAuthChallengeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1AdminInitiateAuthCommand + * deserializeAws_json1_1AdminSetUserMFAPreferenceCommand */ -export const de_AdminInitiateAuthCommand = async ( +export const de_AdminSetUserMFAPreferenceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AdminInitiateAuthCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: AdminInitiateAuthCommandOutput = { + const response: AdminSetUserMFAPreferenceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2679,87 +2293,39 @@ export const de_AdminInitiateAuthCommand = async ( }; /** - * deserializeAws_json1_1AdminInitiateAuthCommandError + * deserializeAws_json1_1AdminSetUserPasswordCommand */ -const de_AdminInitiateAuthCommandError = async ( +export const de_AdminSetUserPasswordCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSmsRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": - throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidSmsRoleTrustRelationshipException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": - throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); - case "InvalidUserPoolConfigurationException": - case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException": - throw await de_InvalidUserPoolConfigurationExceptionRes(parsedOutput, context); - case "MFAMethodNotFoundException": - case "com.amazonaws.cognitoidentityprovider#MFAMethodNotFoundException": - throw await de_MFAMethodNotFoundExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnexpectedLambdaException": - case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": - throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); - case "UserLambdaValidationException": - case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": - throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: AdminSetUserPasswordCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1AdminLinkProviderForUserCommand + * deserializeAws_json1_1AdminSetUserSettingsCommand */ -export const de_AdminLinkProviderForUserCommand = async ( +export const de_AdminSetUserSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AdminLinkProviderForUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: AdminLinkProviderForUserCommandOutput = { + const response: AdminSetUserSettingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2767,66 +2333,39 @@ export const de_AdminLinkProviderForUserCommand = async ( }; /** - * deserializeAws_json1_1AdminLinkProviderForUserCommandError + * deserializeAws_json1_1AdminUpdateAuthEventFeedbackCommand */ -const de_AdminLinkProviderForUserCommandError = async ( +export const de_AdminUpdateAuthEventFeedbackCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AliasExistsException": - case "com.amazonaws.cognitoidentityprovider#AliasExistsException": - throw await de_AliasExistsExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: AdminUpdateAuthEventFeedbackCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1AdminListDevicesCommand + * deserializeAws_json1_1AdminUpdateDeviceStatusCommand */ -export const de_AdminListDevicesCommand = async ( +export const de_AdminUpdateDeviceStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AdminListDevicesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_AdminListDevicesResponse(data, context); - const response: AdminListDevicesCommandOutput = { + contents = _json(data); + const response: AdminUpdateDeviceStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2834,60 +2373,39 @@ export const de_AdminListDevicesCommand = async ( }; /** - * deserializeAws_json1_1AdminListDevicesCommandError + * deserializeAws_json1_1AdminUpdateUserAttributesCommand */ -const de_AdminListDevicesCommandError = async ( +export const de_AdminUpdateUserAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidUserPoolConfigurationException": - case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException": - throw await de_InvalidUserPoolConfigurationExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: AdminUpdateUserAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1AdminListGroupsForUserCommand + * deserializeAws_json1_1AdminUserGlobalSignOutCommand */ -export const de_AdminListGroupsForUserCommand = async ( +export const de_AdminUserGlobalSignOutCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AdminListGroupsForUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_AdminListGroupsForUserResponse(data, context); - const response: AdminListGroupsForUserCommandOutput = { + contents = _json(data); + const response: AdminUserGlobalSignOutCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2895,60 +2413,39 @@ export const de_AdminListGroupsForUserCommand = async ( }; /** - * deserializeAws_json1_1AdminListGroupsForUserCommandError + * deserializeAws_json1_1AssociateSoftwareTokenCommand */ -const de_AdminListGroupsForUserCommandError = async ( +export const de_AssociateSoftwareTokenCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: AssociateSoftwareTokenCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1AdminListUserAuthEventsCommand + * deserializeAws_json1_1ChangePasswordCommand */ -export const de_AdminListUserAuthEventsCommand = async ( +export const de_ChangePasswordCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AdminListUserAuthEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_AdminListUserAuthEventsResponse(data, context); - const response: AdminListUserAuthEventsCommandOutput = { + contents = _json(data); + const response: ChangePasswordCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2956,121 +2453,119 @@ export const de_AdminListUserAuthEventsCommand = async ( }; /** - * deserializeAws_json1_1AdminListUserAuthEventsCommandError + * deserializeAws_json1_1ConfirmDeviceCommand */ -const de_AdminListUserAuthEventsCommandError = async ( +export const de_ConfirmDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ConfirmDeviceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - case "UserPoolAddOnNotEnabledException": - case "com.amazonaws.cognitoidentityprovider#UserPoolAddOnNotEnabledException": - throw await de_UserPoolAddOnNotEnabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1ConfirmForgotPasswordCommand + */ +export const de_ConfirmForgotPasswordCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ConfirmForgotPasswordCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1AdminRemoveUserFromGroupCommand + * deserializeAws_json1_1ConfirmSignUpCommand */ -export const de_AdminRemoveUserFromGroupCommand = async ( +export const de_ConfirmSignUpCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AdminRemoveUserFromGroupCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: AdminRemoveUserFromGroupCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ConfirmSignUpCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1AdminRemoveUserFromGroupCommandError + * deserializeAws_json1_1CreateGroupCommand */ -const de_AdminRemoveUserFromGroupCommandError = async ( +export const de_CreateGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateGroupResponse(data, context); + const response: CreateGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1CreateIdentityProviderCommand + */ +export const de_CreateIdentityProviderCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateIdentityProviderResponse(data, context); + const response: CreateIdentityProviderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1AdminResetUserPasswordCommand + * deserializeAws_json1_1CreateResourceServerCommand */ -export const de_AdminResetUserPasswordCommand = async ( +export const de_CreateResourceServerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AdminResetUserPasswordCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: AdminResetUserPasswordCommandOutput = { + const response: CreateResourceServerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3078,3575 +2573,19 @@ export const de_AdminResetUserPasswordCommand = async ( }; /** - * deserializeAws_json1_1AdminResetUserPasswordCommandError + * deserializeAws_json1_1CreateUserImportJobCommand */ -const de_AdminResetUserPasswordCommandError = async ( +export const de_CreateUserImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidEmailRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException": - throw await de_InvalidEmailRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSmsRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": - throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidSmsRoleTrustRelationshipException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": - throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnexpectedLambdaException": - case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": - throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); - case "UserLambdaValidationException": - case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": - throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1AdminRespondToAuthChallengeCommand - */ -export const de_AdminRespondToAuthChallengeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_AdminRespondToAuthChallengeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: AdminRespondToAuthChallengeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1AdminRespondToAuthChallengeCommandError - */ -const de_AdminRespondToAuthChallengeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AliasExistsException": - case "com.amazonaws.cognitoidentityprovider#AliasExistsException": - throw await de_AliasExistsExceptionRes(parsedOutput, context); - case "CodeMismatchException": - case "com.amazonaws.cognitoidentityprovider#CodeMismatchException": - throw await de_CodeMismatchExceptionRes(parsedOutput, context); - case "ExpiredCodeException": - case "com.amazonaws.cognitoidentityprovider#ExpiredCodeException": - throw await de_ExpiredCodeExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPasswordException": - case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException": - throw await de_InvalidPasswordExceptionRes(parsedOutput, context); - case "InvalidSmsRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": - throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidSmsRoleTrustRelationshipException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": - throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); - case "InvalidUserPoolConfigurationException": - case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException": - throw await de_InvalidUserPoolConfigurationExceptionRes(parsedOutput, context); - case "MFAMethodNotFoundException": - case "com.amazonaws.cognitoidentityprovider#MFAMethodNotFoundException": - throw await de_MFAMethodNotFoundExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "SoftwareTokenMFANotFoundException": - case "com.amazonaws.cognitoidentityprovider#SoftwareTokenMFANotFoundException": - throw await de_SoftwareTokenMFANotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnexpectedLambdaException": - case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": - throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); - case "UserLambdaValidationException": - case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": - throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1AdminSetUserMFAPreferenceCommand - */ -export const de_AdminSetUserMFAPreferenceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_AdminSetUserMFAPreferenceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: AdminSetUserMFAPreferenceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1AdminSetUserMFAPreferenceCommandError - */ -const de_AdminSetUserMFAPreferenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1AdminSetUserPasswordCommand - */ -export const de_AdminSetUserPasswordCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_AdminSetUserPasswordCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: AdminSetUserPasswordCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1AdminSetUserPasswordCommandError - */ -const de_AdminSetUserPasswordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPasswordException": - case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException": - throw await de_InvalidPasswordExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1AdminSetUserSettingsCommand - */ -export const de_AdminSetUserSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_AdminSetUserSettingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: AdminSetUserSettingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1AdminSetUserSettingsCommandError - */ -const de_AdminSetUserSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1AdminUpdateAuthEventFeedbackCommand - */ -export const de_AdminUpdateAuthEventFeedbackCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_AdminUpdateAuthEventFeedbackCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: AdminUpdateAuthEventFeedbackCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1AdminUpdateAuthEventFeedbackCommandError - */ -const de_AdminUpdateAuthEventFeedbackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - case "UserPoolAddOnNotEnabledException": - case "com.amazonaws.cognitoidentityprovider#UserPoolAddOnNotEnabledException": - throw await de_UserPoolAddOnNotEnabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1AdminUpdateDeviceStatusCommand - */ -export const de_AdminUpdateDeviceStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_AdminUpdateDeviceStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: AdminUpdateDeviceStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1AdminUpdateDeviceStatusCommandError - */ -const de_AdminUpdateDeviceStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidUserPoolConfigurationException": - case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException": - throw await de_InvalidUserPoolConfigurationExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1AdminUpdateUserAttributesCommand - */ -export const de_AdminUpdateUserAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_AdminUpdateUserAttributesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: AdminUpdateUserAttributesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1AdminUpdateUserAttributesCommandError - */ -const de_AdminUpdateUserAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AliasExistsException": - case "com.amazonaws.cognitoidentityprovider#AliasExistsException": - throw await de_AliasExistsExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidEmailRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException": - throw await de_InvalidEmailRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSmsRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": - throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidSmsRoleTrustRelationshipException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": - throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnexpectedLambdaException": - case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": - throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); - case "UserLambdaValidationException": - case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": - throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1AdminUserGlobalSignOutCommand - */ -export const de_AdminUserGlobalSignOutCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_AdminUserGlobalSignOutCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: AdminUserGlobalSignOutCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1AdminUserGlobalSignOutCommandError - */ -const de_AdminUserGlobalSignOutCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1AssociateSoftwareTokenCommand - */ -export const de_AssociateSoftwareTokenCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_AssociateSoftwareTokenCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: AssociateSoftwareTokenCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1AssociateSoftwareTokenCommandError - */ -const de_AssociateSoftwareTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cognitoidentityprovider#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "SoftwareTokenMFANotFoundException": - case "com.amazonaws.cognitoidentityprovider#SoftwareTokenMFANotFoundException": - throw await de_SoftwareTokenMFANotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ChangePasswordCommand - */ -export const de_ChangePasswordCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ChangePasswordCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ChangePasswordCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ChangePasswordCommandError - */ -const de_ChangePasswordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPasswordException": - case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException": - throw await de_InvalidPasswordExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ConfirmDeviceCommand - */ -export const de_ConfirmDeviceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ConfirmDeviceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ConfirmDeviceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ConfirmDeviceCommandError - */ -const de_ConfirmDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPasswordException": - case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException": - throw await de_InvalidPasswordExceptionRes(parsedOutput, context); - case "InvalidUserPoolConfigurationException": - case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException": - throw await de_InvalidUserPoolConfigurationExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - case "UsernameExistsException": - case "com.amazonaws.cognitoidentityprovider#UsernameExistsException": - throw await de_UsernameExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ConfirmForgotPasswordCommand - */ -export const de_ConfirmForgotPasswordCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ConfirmForgotPasswordCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ConfirmForgotPasswordCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ConfirmForgotPasswordCommandError - */ -const de_ConfirmForgotPasswordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeMismatchException": - case "com.amazonaws.cognitoidentityprovider#CodeMismatchException": - throw await de_CodeMismatchExceptionRes(parsedOutput, context); - case "ExpiredCodeException": - case "com.amazonaws.cognitoidentityprovider#ExpiredCodeException": - throw await de_ExpiredCodeExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPasswordException": - case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException": - throw await de_InvalidPasswordExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyFailedAttemptsException": - case "com.amazonaws.cognitoidentityprovider#TooManyFailedAttemptsException": - throw await de_TooManyFailedAttemptsExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnexpectedLambdaException": - case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": - throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); - case "UserLambdaValidationException": - case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": - throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ConfirmSignUpCommand - */ -export const de_ConfirmSignUpCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ConfirmSignUpCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ConfirmSignUpCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ConfirmSignUpCommandError - */ -const de_ConfirmSignUpCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AliasExistsException": - case "com.amazonaws.cognitoidentityprovider#AliasExistsException": - throw await de_AliasExistsExceptionRes(parsedOutput, context); - case "CodeMismatchException": - case "com.amazonaws.cognitoidentityprovider#CodeMismatchException": - throw await de_CodeMismatchExceptionRes(parsedOutput, context); - case "ExpiredCodeException": - case "com.amazonaws.cognitoidentityprovider#ExpiredCodeException": - throw await de_ExpiredCodeExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyFailedAttemptsException": - case "com.amazonaws.cognitoidentityprovider#TooManyFailedAttemptsException": - throw await de_TooManyFailedAttemptsExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnexpectedLambdaException": - case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": - throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); - case "UserLambdaValidationException": - case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": - throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateGroupCommand - */ -export const de_CreateGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateGroupResponse(data, context); - const response: CreateGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateGroupCommandError - */ -const de_CreateGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GroupExistsException": - case "com.amazonaws.cognitoidentityprovider#GroupExistsException": - throw await de_GroupExistsExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateIdentityProviderCommand - */ -export const de_CreateIdentityProviderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateIdentityProviderCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateIdentityProviderResponse(data, context); - const response: CreateIdentityProviderCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateIdentityProviderCommandError - */ -const de_CreateIdentityProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateProviderException": - case "com.amazonaws.cognitoidentityprovider#DuplicateProviderException": - throw await de_DuplicateProviderExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateResourceServerCommand - */ -export const de_CreateResourceServerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateResourceServerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateResourceServerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateResourceServerCommandError - */ -const de_CreateResourceServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateUserImportJobCommand - */ -export const de_CreateUserImportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateUserImportJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateUserImportJobResponse(data, context); - const response: CreateUserImportJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateUserImportJobCommandError - */ -const de_CreateUserImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.cognitoidentityprovider#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateUserPoolCommand - */ -export const de_CreateUserPoolCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateUserPoolCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateUserPoolResponse(data, context); - const response: CreateUserPoolCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateUserPoolCommandError - */ -const de_CreateUserPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidEmailRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException": - throw await de_InvalidEmailRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSmsRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": - throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidSmsRoleTrustRelationshipException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": - throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserPoolTaggingException": - case "com.amazonaws.cognitoidentityprovider#UserPoolTaggingException": - throw await de_UserPoolTaggingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateUserPoolClientCommand - */ -export const de_CreateUserPoolClientCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateUserPoolClientCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateUserPoolClientResponse(data, context); - const response: CreateUserPoolClientCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateUserPoolClientCommandError - */ -const de_CreateUserPoolClientCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOAuthFlowException": - case "com.amazonaws.cognitoidentityprovider#InvalidOAuthFlowException": - throw await de_InvalidOAuthFlowExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ScopeDoesNotExistException": - case "com.amazonaws.cognitoidentityprovider#ScopeDoesNotExistException": - throw await de_ScopeDoesNotExistExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateUserPoolDomainCommand - */ -export const de_CreateUserPoolDomainCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateUserPoolDomainCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateUserPoolDomainCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateUserPoolDomainCommandError - */ -const de_CreateUserPoolDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteGroupCommand - */ -export const de_DeleteGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteGroupCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteGroupCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteGroupCommandError - */ -const de_DeleteGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteIdentityProviderCommand - */ -export const de_DeleteIdentityProviderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteIdentityProviderCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteIdentityProviderCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteIdentityProviderCommandError - */ -const de_DeleteIdentityProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cognitoidentityprovider#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedIdentityProviderException": - case "com.amazonaws.cognitoidentityprovider#UnsupportedIdentityProviderException": - throw await de_UnsupportedIdentityProviderExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteResourceServerCommand - */ -export const de_DeleteResourceServerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteResourceServerCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteResourceServerCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteResourceServerCommandError - */ -const de_DeleteResourceServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteUserCommand - */ -export const de_DeleteUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteUserCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteUserCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteUserCommandError - */ -const de_DeleteUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteUserAttributesCommand - */ -export const de_DeleteUserAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteUserAttributesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteUserAttributesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteUserAttributesCommandError - */ -const de_DeleteUserAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteUserPoolCommand - */ -export const de_DeleteUserPoolCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteUserPoolCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteUserPoolCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteUserPoolCommandError - */ -const de_DeleteUserPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserImportInProgressException": - case "com.amazonaws.cognitoidentityprovider#UserImportInProgressException": - throw await de_UserImportInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteUserPoolClientCommand - */ -export const de_DeleteUserPoolClientCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteUserPoolClientCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteUserPoolClientCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteUserPoolClientCommandError - */ -const de_DeleteUserPoolClientCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cognitoidentityprovider#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteUserPoolDomainCommand - */ -export const de_DeleteUserPoolDomainCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteUserPoolDomainCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteUserPoolDomainCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteUserPoolDomainCommandError - */ -const de_DeleteUserPoolDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeIdentityProviderCommand - */ -export const de_DescribeIdentityProviderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeIdentityProviderCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeIdentityProviderResponse(data, context); - const response: DescribeIdentityProviderCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeIdentityProviderCommandError - */ -const de_DescribeIdentityProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeResourceServerCommand - */ -export const de_DescribeResourceServerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeResourceServerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeResourceServerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeResourceServerCommandError - */ -const de_DescribeResourceServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeRiskConfigurationCommand - */ -export const de_DescribeRiskConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeRiskConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeRiskConfigurationResponse(data, context); - const response: DescribeRiskConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeRiskConfigurationCommandError - */ -const de_DescribeRiskConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserPoolAddOnNotEnabledException": - case "com.amazonaws.cognitoidentityprovider#UserPoolAddOnNotEnabledException": - throw await de_UserPoolAddOnNotEnabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeUserImportJobCommand - */ -export const de_DescribeUserImportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeUserImportJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeUserImportJobResponse(data, context); - const response: DescribeUserImportJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeUserImportJobCommandError - */ -const de_DescribeUserImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeUserPoolCommand - */ -export const de_DescribeUserPoolCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeUserPoolCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeUserPoolResponse(data, context); - const response: DescribeUserPoolCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeUserPoolCommandError - */ -const de_DescribeUserPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserPoolTaggingException": - case "com.amazonaws.cognitoidentityprovider#UserPoolTaggingException": - throw await de_UserPoolTaggingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeUserPoolClientCommand - */ -export const de_DescribeUserPoolClientCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeUserPoolClientCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeUserPoolClientResponse(data, context); - const response: DescribeUserPoolClientCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeUserPoolClientCommandError - */ -const de_DescribeUserPoolClientCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeUserPoolDomainCommand - */ -export const de_DescribeUserPoolDomainCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeUserPoolDomainCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeUserPoolDomainCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeUserPoolDomainCommandError - */ -const de_DescribeUserPoolDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ForgetDeviceCommand - */ -export const de_ForgetDeviceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ForgetDeviceCommandError(output, context); - } - await collectBody(output.body, context); - const response: ForgetDeviceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1ForgetDeviceCommandError - */ -const de_ForgetDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidUserPoolConfigurationException": - case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException": - throw await de_InvalidUserPoolConfigurationExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ForgotPasswordCommand - */ -export const de_ForgotPasswordCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ForgotPasswordCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ForgotPasswordCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ForgotPasswordCommandError - */ -const de_ForgotPasswordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeDeliveryFailureException": - case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException": - throw await de_CodeDeliveryFailureExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidEmailRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException": - throw await de_InvalidEmailRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSmsRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": - throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidSmsRoleTrustRelationshipException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": - throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnexpectedLambdaException": - case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": - throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); - case "UserLambdaValidationException": - case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": - throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCSVHeaderCommand - */ -export const de_GetCSVHeaderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetCSVHeaderCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetCSVHeaderCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetCSVHeaderCommandError - */ -const de_GetCSVHeaderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDeviceCommand - */ -export const de_GetDeviceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDeviceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDeviceResponse(data, context); - const response: GetDeviceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDeviceCommandError - */ -const de_GetDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidUserPoolConfigurationException": - case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException": - throw await de_InvalidUserPoolConfigurationExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetGroupCommand - */ -export const de_GetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetGroupResponse(data, context); - const response: GetGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetGroupCommandError - */ -const de_GetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetIdentityProviderByIdentifierCommand - */ -export const de_GetIdentityProviderByIdentifierCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetIdentityProviderByIdentifierCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetIdentityProviderByIdentifierResponse(data, context); - const response: GetIdentityProviderByIdentifierCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetIdentityProviderByIdentifierCommandError - */ -const de_GetIdentityProviderByIdentifierCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLogDeliveryConfigurationCommand - */ -export const de_GetLogDeliveryConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLogDeliveryConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetLogDeliveryConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetLogDeliveryConfigurationCommandError - */ -const de_GetLogDeliveryConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSigningCertificateCommand - */ -export const de_GetSigningCertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSigningCertificateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetSigningCertificateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSigningCertificateCommandError - */ -const de_GetSigningCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetUICustomizationCommand - */ -export const de_GetUICustomizationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetUICustomizationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetUICustomizationResponse(data, context); - const response: GetUICustomizationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetUICustomizationCommandError - */ -const de_GetUICustomizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetUserCommand - */ -export const de_GetUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetUserCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetUserCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetUserCommandError - */ -const de_GetUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetUserAttributeVerificationCodeCommand - */ -export const de_GetUserAttributeVerificationCodeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetUserAttributeVerificationCodeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetUserAttributeVerificationCodeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetUserAttributeVerificationCodeCommandError - */ -const de_GetUserAttributeVerificationCodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeDeliveryFailureException": - case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException": - throw await de_CodeDeliveryFailureExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidEmailRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException": - throw await de_InvalidEmailRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSmsRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": - throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidSmsRoleTrustRelationshipException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": - throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnexpectedLambdaException": - case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": - throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); - case "UserLambdaValidationException": - case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": - throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetUserPoolMfaConfigCommand - */ -export const de_GetUserPoolMfaConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetUserPoolMfaConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetUserPoolMfaConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetUserPoolMfaConfigCommandError - */ -const de_GetUserPoolMfaConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GlobalSignOutCommand - */ -export const de_GlobalSignOutCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GlobalSignOutCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GlobalSignOutCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GlobalSignOutCommandError - */ -const de_GlobalSignOutCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1InitiateAuthCommand - */ -export const de_InitiateAuthCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_InitiateAuthCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: InitiateAuthCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1InitiateAuthCommandError - */ -const de_InitiateAuthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSmsRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": - throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidSmsRoleTrustRelationshipException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": - throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); - case "InvalidUserPoolConfigurationException": - case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException": - throw await de_InvalidUserPoolConfigurationExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnexpectedLambdaException": - case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": - throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); - case "UserLambdaValidationException": - case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": - throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDevicesCommand - */ -export const de_ListDevicesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDevicesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDevicesResponse(data, context); - const response: ListDevicesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDevicesCommandError - */ -const de_ListDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidUserPoolConfigurationException": - case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException": - throw await de_InvalidUserPoolConfigurationExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListGroupsCommand - */ -export const de_ListGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListGroupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListGroupsResponse(data, context); - const response: ListGroupsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListGroupsCommandError - */ -const de_ListGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListIdentityProvidersCommand - */ -export const de_ListIdentityProvidersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListIdentityProvidersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListIdentityProvidersResponse(data, context); - const response: ListIdentityProvidersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListIdentityProvidersCommandError - */ -const de_ListIdentityProvidersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListResourceServersCommand - */ -export const de_ListResourceServersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListResourceServersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListResourceServersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListResourceServersCommandError - */ -const de_ListResourceServersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_CreateUserImportJobResponse(data, context); + const response: CreateUserImportJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6654,57 +2593,19 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListUserImportJobsCommand + * deserializeAws_json1_1CreateUserPoolCommand */ -export const de_ListUserImportJobsCommand = async ( +export const de_CreateUserPoolCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListUserImportJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListUserImportJobsResponse(data, context); - const response: ListUserImportJobsCommandOutput = { + contents = de_CreateUserPoolResponse(data, context); + const response: CreateUserPoolCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6712,57 +2613,19 @@ export const de_ListUserImportJobsCommand = async ( }; /** - * deserializeAws_json1_1ListUserImportJobsCommandError - */ -const de_ListUserImportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListUserPoolClientsCommand + * deserializeAws_json1_1CreateUserPoolClientCommand */ -export const de_ListUserPoolClientsCommand = async ( +export const de_CreateUserPoolClientCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListUserPoolClientsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListUserPoolClientsCommandOutput = { + contents = de_CreateUserPoolClientResponse(data, context); + const response: CreateUserPoolClientCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6770,57 +2633,19 @@ export const de_ListUserPoolClientsCommand = async ( }; /** - * deserializeAws_json1_1ListUserPoolClientsCommandError - */ -const de_ListUserPoolClientsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListUserPoolsCommand + * deserializeAws_json1_1CreateUserPoolDomainCommand */ -export const de_ListUserPoolsCommand = async ( +export const de_CreateUserPoolDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListUserPoolsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListUserPoolsResponse(data, context); - const response: ListUserPoolsCommandOutput = { + contents = _json(data); + const response: CreateUserPoolDomainCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6828,112 +2653,87 @@ export const de_ListUserPoolsCommand = async ( }; /** - * deserializeAws_json1_1ListUserPoolsCommandError + * deserializeAws_json1_1DeleteGroupCommand */ -const de_ListUserPoolsCommandError = async ( +export const de_DeleteGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteGroupCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListUsersCommand + * deserializeAws_json1_1DeleteIdentityProviderCommand */ -export const de_ListUsersCommand = async ( +export const de_DeleteIdentityProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListUsersCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListUsersResponse(data, context); - const response: ListUsersCommandOutput = { + await collectBody(output.body, context); + const response: DeleteIdentityProviderCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1ListUsersCommandError + * deserializeAws_json1_1DeleteResourceServerCommand */ -const de_ListUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_DeleteResourceServerCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteResourceServerCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListUsersInGroupCommand + * deserializeAws_json1_1DeleteUserCommand */ -export const de_ListUsersInGroupCommand = async ( +export const de_DeleteUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeleteUserCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_json1_1DeleteUserAttributesCommand + */ +export const de_DeleteUserAttributesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { if (output.statusCode >= 300) { - return de_ListUsersInGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListUsersInGroupResponse(data, context); - const response: ListUsersInGroupCommandOutput = { + contents = _json(data); + const response: DeleteUserAttributesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6941,57 +2741,53 @@ export const de_ListUsersInGroupCommand = async ( }; /** - * deserializeAws_json1_1ListUsersInGroupCommandError + * deserializeAws_json1_1DeleteUserPoolCommand */ -const de_ListUsersInGroupCommandError = async ( +export const de_DeleteUserPoolCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeleteUserPoolCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DeleteUserPoolClientCommand + */ +export const de_DeleteUserPoolClientCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteUserPoolClientCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ResendConfirmationCodeCommand + * deserializeAws_json1_1DeleteUserPoolDomainCommand */ -export const de_ResendConfirmationCodeCommand = async ( +export const de_DeleteUserPoolDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ResendConfirmationCodeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ResendConfirmationCodeCommandOutput = { + const response: DeleteUserPoolDomainCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6999,87 +2795,39 @@ export const de_ResendConfirmationCodeCommand = async ( }; /** - * deserializeAws_json1_1ResendConfirmationCodeCommandError + * deserializeAws_json1_1DescribeIdentityProviderCommand */ -const de_ResendConfirmationCodeCommandError = async ( +export const de_DescribeIdentityProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeDeliveryFailureException": - case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException": - throw await de_CodeDeliveryFailureExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidEmailRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException": - throw await de_InvalidEmailRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSmsRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": - throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidSmsRoleTrustRelationshipException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": - throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnexpectedLambdaException": - case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": - throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); - case "UserLambdaValidationException": - case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": - throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeIdentityProviderResponse(data, context); + const response: DescribeIdentityProviderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RespondToAuthChallengeCommand + * deserializeAws_json1_1DescribeResourceServerCommand */ -export const de_RespondToAuthChallengeCommand = async ( +export const de_DescribeResourceServerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RespondToAuthChallengeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: RespondToAuthChallengeCommandOutput = { + const response: DescribeResourceServerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7087,105 +2835,39 @@ export const de_RespondToAuthChallengeCommand = async ( }; /** - * deserializeAws_json1_1RespondToAuthChallengeCommandError + * deserializeAws_json1_1DescribeRiskConfigurationCommand */ -const de_RespondToAuthChallengeCommandError = async ( +export const de_DescribeRiskConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AliasExistsException": - case "com.amazonaws.cognitoidentityprovider#AliasExistsException": - throw await de_AliasExistsExceptionRes(parsedOutput, context); - case "CodeMismatchException": - case "com.amazonaws.cognitoidentityprovider#CodeMismatchException": - throw await de_CodeMismatchExceptionRes(parsedOutput, context); - case "ExpiredCodeException": - case "com.amazonaws.cognitoidentityprovider#ExpiredCodeException": - throw await de_ExpiredCodeExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPasswordException": - case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException": - throw await de_InvalidPasswordExceptionRes(parsedOutput, context); - case "InvalidSmsRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": - throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidSmsRoleTrustRelationshipException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": - throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); - case "InvalidUserPoolConfigurationException": - case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException": - throw await de_InvalidUserPoolConfigurationExceptionRes(parsedOutput, context); - case "MFAMethodNotFoundException": - case "com.amazonaws.cognitoidentityprovider#MFAMethodNotFoundException": - throw await de_MFAMethodNotFoundExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "SoftwareTokenMFANotFoundException": - case "com.amazonaws.cognitoidentityprovider#SoftwareTokenMFANotFoundException": - throw await de_SoftwareTokenMFANotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnexpectedLambdaException": - case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": - throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); - case "UserLambdaValidationException": - case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": - throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeRiskConfigurationResponse(data, context); + const response: DescribeRiskConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RevokeTokenCommand + * deserializeAws_json1_1DescribeUserImportJobCommand */ -export const de_RevokeTokenCommand = async ( +export const de_DescribeUserImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RevokeTokenCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: RevokeTokenCommandOutput = { + contents = de_DescribeUserImportJobResponse(data, context); + const response: DescribeUserImportJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7193,63 +2875,59 @@ export const de_RevokeTokenCommand = async ( }; /** - * deserializeAws_json1_1RevokeTokenCommandError + * deserializeAws_json1_1DescribeUserPoolCommand */ -const de_RevokeTokenCommandError = async ( +export const de_DescribeUserPoolCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeUserPoolResponse(data, context); + const response: DescribeUserPoolCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.cognitoidentityprovider#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.cognitoidentityprovider#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - case "UnsupportedTokenTypeException": - case "com.amazonaws.cognitoidentityprovider#UnsupportedTokenTypeException": - throw await de_UnsupportedTokenTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DescribeUserPoolClientCommand + */ +export const de_DescribeUserPoolClientCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeUserPoolClientResponse(data, context); + const response: DescribeUserPoolClientCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SetLogDeliveryConfigurationCommand + * deserializeAws_json1_1DescribeUserPoolDomainCommand */ -export const de_SetLogDeliveryConfigurationCommand = async ( +export const de_DescribeUserPoolDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetLogDeliveryConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: SetLogDeliveryConfigurationCommandOutput = { + const response: DescribeUserPoolDomainCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7257,57 +2935,36 @@ export const de_SetLogDeliveryConfigurationCommand = async ( }; /** - * deserializeAws_json1_1SetLogDeliveryConfigurationCommandError + * deserializeAws_json1_1ForgetDeviceCommand */ -const de_SetLogDeliveryConfigurationCommandError = async ( +export const de_ForgetDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: ForgetDeviceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1SetRiskConfigurationCommand + * deserializeAws_json1_1ForgotPasswordCommand */ -export const de_SetRiskConfigurationCommand = async ( +export const de_ForgotPasswordCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetRiskConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_SetRiskConfigurationResponse(data, context); - const response: SetRiskConfigurationCommandOutput = { + contents = _json(data); + const response: ForgotPasswordCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7315,66 +2972,59 @@ export const de_SetRiskConfigurationCommand = async ( }; /** - * deserializeAws_json1_1SetRiskConfigurationCommandError + * deserializeAws_json1_1GetCSVHeaderCommand */ -const de_SetRiskConfigurationCommandError = async ( +export const de_GetCSVHeaderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetCSVHeaderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeDeliveryFailureException": - case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException": - throw await de_CodeDeliveryFailureExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidEmailRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException": - throw await de_InvalidEmailRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserPoolAddOnNotEnabledException": - case "com.amazonaws.cognitoidentityprovider#UserPoolAddOnNotEnabledException": - throw await de_UserPoolAddOnNotEnabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1GetDeviceCommand + */ +export const de_GetDeviceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetDeviceResponse(data, context); + const response: GetDeviceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SetUICustomizationCommand + * deserializeAws_json1_1GetGroupCommand */ -export const de_SetUICustomizationCommand = async ( +export const de_GetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetUICustomizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_SetUICustomizationResponse(data, context); - const response: SetUICustomizationCommandOutput = { + contents = de_GetGroupResponse(data, context); + const response: GetGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7382,57 +3032,59 @@ export const de_SetUICustomizationCommand = async ( }; /** - * deserializeAws_json1_1SetUICustomizationCommandError + * deserializeAws_json1_1GetIdentityProviderByIdentifierCommand */ -const de_SetUICustomizationCommandError = async ( +export const de_GetIdentityProviderByIdentifierCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetIdentityProviderByIdentifierResponse(data, context); + const response: GetIdentityProviderByIdentifierCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1GetLogDeliveryConfigurationCommand + */ +export const de_GetLogDeliveryConfigurationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetLogDeliveryConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SetUserMFAPreferenceCommand + * deserializeAws_json1_1GetSigningCertificateCommand */ -export const de_SetUserMFAPreferenceCommand = async ( +export const de_GetSigningCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetUserMFAPreferenceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: SetUserMFAPreferenceCommandOutput = { + const response: GetSigningCertificateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7440,66 +3092,39 @@ export const de_SetUserMFAPreferenceCommand = async ( }; /** - * deserializeAws_json1_1SetUserMFAPreferenceCommandError + * deserializeAws_json1_1GetUICustomizationCommand */ -const de_SetUserMFAPreferenceCommandError = async ( +export const de_GetUICustomizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetUICustomizationResponse(data, context); + const response: GetUICustomizationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SetUserPoolMfaConfigCommand + * deserializeAws_json1_1GetUserCommand */ -export const de_SetUserPoolMfaConfigCommand = async ( +export const de_GetUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetUserPoolMfaConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: SetUserPoolMfaConfigCommandOutput = { + const response: GetUserCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7507,63 +3132,39 @@ export const de_SetUserPoolMfaConfigCommand = async ( }; /** - * deserializeAws_json1_1SetUserPoolMfaConfigCommandError + * deserializeAws_json1_1GetUserAttributeVerificationCodeCommand */ -const de_SetUserPoolMfaConfigCommandError = async ( +export const de_GetUserAttributeVerificationCodeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSmsRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": - throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidSmsRoleTrustRelationshipException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": - throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetUserAttributeVerificationCodeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SetUserSettingsCommand + * deserializeAws_json1_1GetUserPoolMfaConfigCommand */ -export const de_SetUserSettingsCommand = async ( +export const de_GetUserPoolMfaConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetUserSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: SetUserSettingsCommandOutput = { + const response: GetUserPoolMfaConfigCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7571,66 +3172,39 @@ export const de_SetUserSettingsCommand = async ( }; /** - * deserializeAws_json1_1SetUserSettingsCommandError + * deserializeAws_json1_1GlobalSignOutCommand */ -const de_SetUserSettingsCommandError = async ( +export const de_GlobalSignOutCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GlobalSignOutCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SignUpCommand + * deserializeAws_json1_1InitiateAuthCommand */ -export const de_SignUpCommand = async ( +export const de_InitiateAuthCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SignUpCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: SignUpCommandOutput = { + const response: InitiateAuthCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7638,84 +3212,39 @@ export const de_SignUpCommand = async ( }; /** - * deserializeAws_json1_1SignUpCommandError + * deserializeAws_json1_1ListDevicesCommand */ -const de_SignUpCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeDeliveryFailureException": - case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException": - throw await de_CodeDeliveryFailureExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidEmailRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException": - throw await de_InvalidEmailRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPasswordException": - case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException": - throw await de_InvalidPasswordExceptionRes(parsedOutput, context); - case "InvalidSmsRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": - throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidSmsRoleTrustRelationshipException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": - throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnexpectedLambdaException": - case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": - throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); - case "UserLambdaValidationException": - case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": - throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); - case "UsernameExistsException": - case "com.amazonaws.cognitoidentityprovider#UsernameExistsException": - throw await de_UsernameExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_ListDevicesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDevicesResponse(data, context); + const response: ListDevicesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartUserImportJobCommand + * deserializeAws_json1_1ListGroupsCommand */ -export const de_StartUserImportJobCommand = async ( +export const de_ListGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartUserImportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StartUserImportJobResponse(data, context); - const response: StartUserImportJobCommandOutput = { + contents = de_ListGroupsResponse(data, context); + const response: ListGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7723,60 +3252,39 @@ export const de_StartUserImportJobCommand = async ( }; /** - * deserializeAws_json1_1StartUserImportJobCommandError + * deserializeAws_json1_1ListIdentityProvidersCommand */ -const de_StartUserImportJobCommandError = async ( +export const de_ListIdentityProvidersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.cognitoidentityprovider#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListIdentityProvidersResponse(data, context); + const response: ListIdentityProvidersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopUserImportJobCommand + * deserializeAws_json1_1ListResourceServersCommand */ -export const de_StopUserImportJobCommand = async ( +export const de_ListResourceServersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopUserImportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StopUserImportJobResponse(data, context); - const response: StopUserImportJobCommandOutput = { + contents = _json(data); + const response: ListResourceServersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7784,60 +3292,59 @@ export const de_StopUserImportJobCommand = async ( }; /** - * deserializeAws_json1_1StopUserImportJobCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_StopUserImportJobCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.cognitoidentityprovider#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1ListUserImportJobsCommand + */ +export const de_ListUserImportJobsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListUserImportJobsResponse(data, context); + const response: ListUserImportJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1ListUserPoolClientsCommand */ -export const de_TagResourceCommand = async ( +export const de_ListUserPoolClientsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: ListUserPoolClientsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7845,57 +3352,79 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1ListUserPoolsCommand */ -const de_TagResourceCommandError = async ( +export const de_ListUserPoolsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListUserPoolsResponse(data, context); + const response: ListUserPoolsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1ListUsersCommand + */ +export const de_ListUsersCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListUsersResponse(data, context); + const response: ListUsersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UntagResourceCommand + * deserializeAws_json1_1ListUsersInGroupCommand */ -export const de_UntagResourceCommand = async ( +export const de_ListUsersInGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListUsersInGroupResponse(data, context); + const response: ListUsersInGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1ResendConfirmationCodeCommand + */ +export const de_ResendConfirmationCodeCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UntagResourceCommandOutput = { + const response: ResendConfirmationCodeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7903,57 +3432,59 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserializeAws_json1_1RespondToAuthChallengeCommand */ -const de_UntagResourceCommandError = async ( +export const de_RespondToAuthChallengeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: RespondToAuthChallengeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1RevokeTokenCommand + */ +export const de_RevokeTokenCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: RevokeTokenCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateAuthEventFeedbackCommand + * deserializeAws_json1_1SetLogDeliveryConfigurationCommand */ -export const de_UpdateAuthEventFeedbackCommand = async ( +export const de_SetLogDeliveryConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateAuthEventFeedbackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateAuthEventFeedbackCommandOutput = { + const response: SetLogDeliveryConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7961,63 +3492,59 @@ export const de_UpdateAuthEventFeedbackCommand = async ( }; /** - * deserializeAws_json1_1UpdateAuthEventFeedbackCommandError + * deserializeAws_json1_1SetRiskConfigurationCommand */ -const de_UpdateAuthEventFeedbackCommandError = async ( +export const de_SetRiskConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SetRiskConfigurationResponse(data, context); + const response: SetRiskConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - case "UserPoolAddOnNotEnabledException": - case "com.amazonaws.cognitoidentityprovider#UserPoolAddOnNotEnabledException": - throw await de_UserPoolAddOnNotEnabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1SetUICustomizationCommand + */ +export const de_SetUICustomizationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SetUICustomizationResponse(data, context); + const response: SetUICustomizationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateDeviceStatusCommand + * deserializeAws_json1_1SetUserMFAPreferenceCommand */ -export const de_UpdateDeviceStatusCommand = async ( +export const de_SetUserMFAPreferenceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateDeviceStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateDeviceStatusCommandOutput = { + const response: SetUserMFAPreferenceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8025,72 +3552,39 @@ export const de_UpdateDeviceStatusCommand = async ( }; /** - * deserializeAws_json1_1UpdateDeviceStatusCommandError + * deserializeAws_json1_1SetUserPoolMfaConfigCommand */ -const de_UpdateDeviceStatusCommandError = async ( +export const de_SetUserPoolMfaConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidUserPoolConfigurationException": - case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException": - throw await de_InvalidUserPoolConfigurationExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: SetUserPoolMfaConfigCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateGroupCommand + * deserializeAws_json1_1SetUserSettingsCommand */ -export const de_UpdateGroupCommand = async ( +export const de_SetUserSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateGroupResponse(data, context); - const response: UpdateGroupCommandOutput = { + contents = _json(data); + const response: SetUserSettingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8098,57 +3592,39 @@ export const de_UpdateGroupCommand = async ( }; /** - * deserializeAws_json1_1UpdateGroupCommandError + * deserializeAws_json1_1SignUpCommand */ -const de_UpdateGroupCommandError = async ( +export const de_SignUpCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: SignUpCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateIdentityProviderCommand + * deserializeAws_json1_1StartUserImportJobCommand */ -export const de_UpdateIdentityProviderCommand = async ( +export const de_StartUserImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateIdentityProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateIdentityProviderResponse(data, context); - const response: UpdateIdentityProviderCommandOutput = { + contents = de_StartUserImportJobResponse(data, context); + const response: StartUserImportJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8156,63 +3632,39 @@ export const de_UpdateIdentityProviderCommand = async ( }; /** - * deserializeAws_json1_1UpdateIdentityProviderCommandError + * deserializeAws_json1_1StopUserImportJobCommand */ -const de_UpdateIdentityProviderCommandError = async ( +export const de_StopUserImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cognitoidentityprovider#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedIdentityProviderException": - case "com.amazonaws.cognitoidentityprovider#UnsupportedIdentityProviderException": - throw await de_UnsupportedIdentityProviderExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StopUserImportJobResponse(data, context); + const response: StopUserImportJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateResourceServerCommand + * deserializeAws_json1_1TagResourceCommand */ -export const de_UpdateResourceServerCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateResourceServerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateResourceServerCommandOutput = { + const response: TagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8220,57 +3672,39 @@ export const de_UpdateResourceServerCommand = async ( }; /** - * deserializeAws_json1_1UpdateResourceServerCommandError + * deserializeAws_json1_1UntagResourceCommand */ -const de_UpdateResourceServerCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateUserAttributesCommand + * deserializeAws_json1_1UpdateAuthEventFeedbackCommand */ -export const de_UpdateUserAttributesCommand = async ( +export const de_UpdateAuthEventFeedbackCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateUserAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateUserAttributesCommandOutput = { + const response: UpdateAuthEventFeedbackCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8278,99 +3712,39 @@ export const de_UpdateUserAttributesCommand = async ( }; /** - * deserializeAws_json1_1UpdateUserAttributesCommandError + * deserializeAws_json1_1UpdateDeviceStatusCommand */ -const de_UpdateUserAttributesCommandError = async ( +export const de_UpdateDeviceStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AliasExistsException": - case "com.amazonaws.cognitoidentityprovider#AliasExistsException": - throw await de_AliasExistsExceptionRes(parsedOutput, context); - case "CodeDeliveryFailureException": - case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException": - throw await de_CodeDeliveryFailureExceptionRes(parsedOutput, context); - case "CodeMismatchException": - case "com.amazonaws.cognitoidentityprovider#CodeMismatchException": - throw await de_CodeMismatchExceptionRes(parsedOutput, context); - case "ExpiredCodeException": - case "com.amazonaws.cognitoidentityprovider#ExpiredCodeException": - throw await de_ExpiredCodeExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidEmailRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException": - throw await de_InvalidEmailRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidLambdaResponseException": - case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": - throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSmsRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": - throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidSmsRoleTrustRelationshipException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": - throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnexpectedLambdaException": - case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": - throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); - case "UserLambdaValidationException": - case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": - throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateDeviceStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateUserPoolCommand + * deserializeAws_json1_1UpdateGroupCommand */ -export const de_UpdateUserPoolCommand = async ( +export const de_UpdateGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateUserPoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: UpdateUserPoolCommandOutput = { + contents = de_UpdateGroupResponse(data, context); + const response: UpdateGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8378,75 +3752,39 @@ export const de_UpdateUserPoolCommand = async ( }; /** - * deserializeAws_json1_1UpdateUserPoolCommandError + * deserializeAws_json1_1UpdateIdentityProviderCommand */ -const de_UpdateUserPoolCommandError = async ( +export const de_UpdateIdentityProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cognitoidentityprovider#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidEmailRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException": - throw await de_InvalidEmailRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSmsRoleAccessPolicyException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": - throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); - case "InvalidSmsRoleTrustRelationshipException": - case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": - throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserImportInProgressException": - case "com.amazonaws.cognitoidentityprovider#UserImportInProgressException": - throw await de_UserImportInProgressExceptionRes(parsedOutput, context); - case "UserPoolTaggingException": - case "com.amazonaws.cognitoidentityprovider#UserPoolTaggingException": - throw await de_UserPoolTaggingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateIdentityProviderResponse(data, context); + const response: UpdateIdentityProviderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateUserPoolClientCommand + * deserializeAws_json1_1UpdateResourceServerCommand */ -export const de_UpdateUserPoolClientCommand = async ( +export const de_UpdateResourceServerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateUserPoolClientCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateUserPoolClientResponse(data, context); - const response: UpdateUserPoolClientCommandOutput = { + contents = _json(data); + const response: UpdateResourceServerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8454,66 +3792,39 @@ export const de_UpdateUserPoolClientCommand = async ( }; /** - * deserializeAws_json1_1UpdateUserPoolClientCommandError + * deserializeAws_json1_1UpdateUserAttributesCommand */ -const de_UpdateUserPoolClientCommandError = async ( +export const de_UpdateUserAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cognitoidentityprovider#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOAuthFlowException": - case "com.amazonaws.cognitoidentityprovider#InvalidOAuthFlowException": - throw await de_InvalidOAuthFlowExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ScopeDoesNotExistException": - case "com.amazonaws.cognitoidentityprovider#ScopeDoesNotExistException": - throw await de_ScopeDoesNotExistExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateUserAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateUserPoolDomainCommand + * deserializeAws_json1_1UpdateUserPoolCommand */ -export const de_UpdateUserPoolDomainCommand = async ( +export const de_UpdateUserPoolCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateUserPoolDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateUserPoolDomainCommandOutput = { + const response: UpdateUserPoolCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8521,57 +3832,39 @@ export const de_UpdateUserPoolDomainCommand = async ( }; /** - * deserializeAws_json1_1UpdateUserPoolDomainCommandError + * deserializeAws_json1_1UpdateUserPoolClientCommand */ -const de_UpdateUserPoolDomainCommandError = async ( +export const de_UpdateUserPoolClientCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateUserPoolClientResponse(data, context); + const response: UpdateUserPoolClientCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1VerifySoftwareTokenCommand + * deserializeAws_json1_1UpdateUserPoolDomainCommand */ -export const de_VerifySoftwareTokenCommand = async ( +export const de_UpdateUserPoolDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_VerifySoftwareTokenCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: VerifySoftwareTokenCommandOutput = { + const response: UpdateUserPoolDomainCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8579,65 +3872,23 @@ export const de_VerifySoftwareTokenCommand = async ( }; /** - * deserializeAws_json1_1VerifySoftwareTokenCommandError + * deserializeAws_json1_1VerifySoftwareTokenCommand */ -const de_VerifySoftwareTokenCommandError = async ( +export const de_VerifySoftwareTokenCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeMismatchException": - case "com.amazonaws.cognitoidentityprovider#CodeMismatchException": - throw await de_CodeMismatchExceptionRes(parsedOutput, context); - case "EnableSoftwareTokenMFAException": - case "com.amazonaws.cognitoidentityprovider#EnableSoftwareTokenMFAException": - throw await de_EnableSoftwareTokenMFAExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentityprovider#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidUserPoolConfigurationException": - case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException": - throw await de_InvalidUserPoolConfigurationExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "SoftwareTokenMFANotFoundException": - case "com.amazonaws.cognitoidentityprovider#SoftwareTokenMFANotFoundException": - throw await de_SoftwareTokenMFANotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: VerifySoftwareTokenCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -8648,7 +3899,7 @@ export const de_VerifyUserAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_VerifyUserAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8661,64 +3912,145 @@ export const de_VerifyUserAttributeCommand = async ( }; /** - * deserializeAws_json1_1VerifyUserAttributeCommandError + * deserialize_Aws_json1_1CommandError */ -const de_VerifyUserAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "AliasExistsException": - case "com.amazonaws.cognitoidentityprovider#AliasExistsException": - throw await de_AliasExistsExceptionRes(parsedOutput, context); - case "CodeMismatchException": - case "com.amazonaws.cognitoidentityprovider#CodeMismatchException": - throw await de_CodeMismatchExceptionRes(parsedOutput, context); - case "ExpiredCodeException": - case "com.amazonaws.cognitoidentityprovider#ExpiredCodeException": - throw await de_ExpiredCodeExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.cognitoidentityprovider#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); case "InternalErrorException": case "com.amazonaws.cognitoidentityprovider#InternalErrorException": throw await de_InternalErrorExceptionRes(parsedOutput, context); case "InvalidParameterException": case "com.amazonaws.cognitoidentityprovider#InvalidParameterException": throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentityprovider#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); case "NotAuthorizedException": case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException": throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PasswordResetRequiredException": - case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": - throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UserNotConfirmedException": - case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": - throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); + case "UserImportInProgressException": + case "com.amazonaws.cognitoidentityprovider#UserImportInProgressException": + throw await de_UserImportInProgressExceptionRes(parsedOutput, context); case "UserNotFoundException": case "com.amazonaws.cognitoidentityprovider#UserNotFoundException": throw await de_UserNotFoundExceptionRes(parsedOutput, context); + case "InvalidLambdaResponseException": + case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException": + throw await de_InvalidLambdaResponseExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.cognitoidentityprovider#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "TooManyFailedAttemptsException": + case "com.amazonaws.cognitoidentityprovider#TooManyFailedAttemptsException": + throw await de_TooManyFailedAttemptsExceptionRes(parsedOutput, context); + case "UnexpectedLambdaException": + case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException": + throw await de_UnexpectedLambdaExceptionRes(parsedOutput, context); + case "UserLambdaValidationException": + case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException": + throw await de_UserLambdaValidationExceptionRes(parsedOutput, context); + case "CodeDeliveryFailureException": + case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException": + throw await de_CodeDeliveryFailureExceptionRes(parsedOutput, context); + case "InvalidPasswordException": + case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException": + throw await de_InvalidPasswordExceptionRes(parsedOutput, context); + case "InvalidSmsRoleAccessPolicyException": + case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException": + throw await de_InvalidSmsRoleAccessPolicyExceptionRes(parsedOutput, context); + case "InvalidSmsRoleTrustRelationshipException": + case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException": + throw await de_InvalidSmsRoleTrustRelationshipExceptionRes(parsedOutput, context); + case "PreconditionNotMetException": + case "com.amazonaws.cognitoidentityprovider#PreconditionNotMetException": + throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); + case "UnsupportedUserStateException": + case "com.amazonaws.cognitoidentityprovider#UnsupportedUserStateException": + throw await de_UnsupportedUserStateExceptionRes(parsedOutput, context); + case "UsernameExistsException": + case "com.amazonaws.cognitoidentityprovider#UsernameExistsException": + throw await de_UsernameExistsExceptionRes(parsedOutput, context); + case "AliasExistsException": + case "com.amazonaws.cognitoidentityprovider#AliasExistsException": + throw await de_AliasExistsExceptionRes(parsedOutput, context); + case "InvalidUserPoolConfigurationException": + case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException": + throw await de_InvalidUserPoolConfigurationExceptionRes(parsedOutput, context); + case "MFAMethodNotFoundException": + case "com.amazonaws.cognitoidentityprovider#MFAMethodNotFoundException": + throw await de_MFAMethodNotFoundExceptionRes(parsedOutput, context); + case "PasswordResetRequiredException": + case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException": + throw await de_PasswordResetRequiredExceptionRes(parsedOutput, context); + case "UserNotConfirmedException": + case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException": + throw await de_UserNotConfirmedExceptionRes(parsedOutput, context); + case "UserPoolAddOnNotEnabledException": + case "com.amazonaws.cognitoidentityprovider#UserPoolAddOnNotEnabledException": + throw await de_UserPoolAddOnNotEnabledExceptionRes(parsedOutput, context); + case "InvalidEmailRoleAccessPolicyException": + case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException": + throw await de_InvalidEmailRoleAccessPolicyExceptionRes(parsedOutput, context); + case "CodeMismatchException": + case "com.amazonaws.cognitoidentityprovider#CodeMismatchException": + throw await de_CodeMismatchExceptionRes(parsedOutput, context); + case "ExpiredCodeException": + case "com.amazonaws.cognitoidentityprovider#ExpiredCodeException": + throw await de_ExpiredCodeExceptionRes(parsedOutput, context); + case "SoftwareTokenMFANotFoundException": + case "com.amazonaws.cognitoidentityprovider#SoftwareTokenMFANotFoundException": + throw await de_SoftwareTokenMFANotFoundExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.cognitoidentityprovider#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "ForbiddenException": + case "com.amazonaws.cognitoidentityprovider#ForbiddenException": + throw await de_ForbiddenExceptionRes(parsedOutput, context); + case "GroupExistsException": + case "com.amazonaws.cognitoidentityprovider#GroupExistsException": + throw await de_GroupExistsExceptionRes(parsedOutput, context); + case "DuplicateProviderException": + case "com.amazonaws.cognitoidentityprovider#DuplicateProviderException": + throw await de_DuplicateProviderExceptionRes(parsedOutput, context); + case "UserPoolTaggingException": + case "com.amazonaws.cognitoidentityprovider#UserPoolTaggingException": + throw await de_UserPoolTaggingExceptionRes(parsedOutput, context); + case "InvalidOAuthFlowException": + case "com.amazonaws.cognitoidentityprovider#InvalidOAuthFlowException": + throw await de_InvalidOAuthFlowExceptionRes(parsedOutput, context); + case "ScopeDoesNotExistException": + case "com.amazonaws.cognitoidentityprovider#ScopeDoesNotExistException": + throw await de_ScopeDoesNotExistExceptionRes(parsedOutput, context); + case "UnsupportedIdentityProviderException": + case "com.amazonaws.cognitoidentityprovider#UnsupportedIdentityProviderException": + throw await de_UnsupportedIdentityProviderExceptionRes(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.cognitoidentityprovider#UnauthorizedException": + throw await de_UnauthorizedExceptionRes(parsedOutput, context); + case "UnsupportedOperationException": + case "com.amazonaws.cognitoidentityprovider#UnsupportedOperationException": + throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); + case "UnsupportedTokenTypeException": + case "com.amazonaws.cognitoidentityprovider#UnsupportedTokenTypeException": + throw await de_UnsupportedTokenTypeExceptionRes(parsedOutput, context); + case "EnableSoftwareTokenMFAException": + case "com.amazonaws.cognitoidentityprovider#EnableSoftwareTokenMFAException": + throw await de_EnableSoftwareTokenMFAExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts b/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts index ab468dd8dec0..4ba8430b494a 100644 --- a/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts +++ b/clients/client-cognito-identity/src/protocols/Aws_json1_1.ts @@ -424,7 +424,7 @@ export const de_CreateIdentityPoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateIdentityPoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -436,47 +436,6 @@ export const de_CreateIdentityPoolCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateIdentityPoolCommandError - */ -const de_CreateIdentityPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentity#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cognitoidentity#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteIdentitiesCommand */ @@ -485,7 +444,7 @@ export const de_DeleteIdentitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteIdentitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -497,38 +456,6 @@ export const de_DeleteIdentitiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteIdentitiesCommandError - */ -const de_DeleteIdentitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteIdentityPoolCommand */ @@ -537,7 +464,7 @@ export const de_DeleteIdentityPoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteIdentityPoolCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteIdentityPoolCommandOutput = { @@ -546,44 +473,6 @@ export const de_DeleteIdentityPoolCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteIdentityPoolCommandError - */ -const de_DeleteIdentityPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeIdentityCommand */ @@ -592,7 +481,7 @@ export const de_DescribeIdentityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeIdentityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -604,44 +493,6 @@ export const de_DescribeIdentityCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeIdentityCommandError - */ -const de_DescribeIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeIdentityPoolCommand */ @@ -650,7 +501,7 @@ export const de_DescribeIdentityPoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeIdentityPoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -662,44 +513,6 @@ export const de_DescribeIdentityPoolCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeIdentityPoolCommandError - */ -const de_DescribeIdentityPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetCredentialsForIdentityCommand */ @@ -708,7 +521,7 @@ export const de_GetCredentialsForIdentityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCredentialsForIdentityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -720,59 +533,12 @@ export const de_GetCredentialsForIdentityCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCredentialsForIdentityCommandError - */ -const de_GetCredentialsForIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExternalServiceException": - case "com.amazonaws.cognitoidentity#ExternalServiceException": - throw await de_ExternalServiceExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidIdentityPoolConfigurationException": - case "com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException": - throw await de_InvalidIdentityPoolConfigurationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cognitoidentity#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetIdCommand */ export const de_GetIdCommand = async (output: __HttpResponse, context: __SerdeContext): Promise => { if (output.statusCode >= 300) { - return de_GetIdCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -784,50 +550,6 @@ export const de_GetIdCommand = async (output: __HttpResponse, context: __SerdeCo return response; }; -/** - * deserializeAws_json1_1GetIdCommandError - */ -const de_GetIdCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExternalServiceException": - case "com.amazonaws.cognitoidentity#ExternalServiceException": - throw await de_ExternalServiceExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitoidentity#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cognitoidentity#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetIdentityPoolRolesCommand */ @@ -836,201 +558,32 @@ export const de_GetIdentityPoolRolesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetIdentityPoolRolesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetIdentityPoolRolesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetIdentityPoolRolesCommandError - */ -const de_GetIdentityPoolRolesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cognitoidentity#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetOpenIdTokenCommand - */ -export const de_GetOpenIdTokenCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetOpenIdTokenCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetOpenIdTokenCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetOpenIdTokenCommandError - */ -const de_GetOpenIdTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExternalServiceException": - case "com.amazonaws.cognitoidentity#ExternalServiceException": - throw await de_ExternalServiceExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cognitoidentity#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand - */ -export const de_GetOpenIdTokenForDeveloperIdentityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetOpenIdTokenForDeveloperIdentityCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetOpenIdTokenForDeveloperIdentityCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommandError - */ -const de_GetOpenIdTokenForDeveloperIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeveloperUserAlreadyRegisteredException": - case "com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException": - throw await de_DeveloperUserAlreadyRegisteredExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cognitoidentity#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + let contents: any = {}; + contents = _json(data); + const response: GetIdentityPoolRolesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetPrincipalTagAttributeMapCommand + * deserializeAws_json1_1GetOpenIdTokenCommand */ -export const de_GetPrincipalTagAttributeMapCommand = async ( +export const de_GetOpenIdTokenCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetPrincipalTagAttributeMapCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetPrincipalTagAttributeMapCommandOutput = { + const response: GetOpenIdTokenCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1038,57 +591,39 @@ export const de_GetPrincipalTagAttributeMapCommand = async ( }; /** - * deserializeAws_json1_1GetPrincipalTagAttributeMapCommandError + * deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand */ -const de_GetPrincipalTagAttributeMapCommandError = async ( +export const de_GetOpenIdTokenForDeveloperIdentityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetOpenIdTokenForDeveloperIdentityCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListIdentitiesCommand + * deserializeAws_json1_1GetPrincipalTagAttributeMapCommand */ -export const de_ListIdentitiesCommand = async ( +export const de_GetPrincipalTagAttributeMapCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListIdentitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListIdentitiesResponse(data, context); - const response: ListIdentitiesCommandOutput = { + contents = _json(data); + const response: GetPrincipalTagAttributeMapCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1096,41 +631,23 @@ export const de_ListIdentitiesCommand = async ( }; /** - * deserializeAws_json1_1ListIdentitiesCommandError + * deserializeAws_json1_1ListIdentitiesCommand */ -const de_ListIdentitiesCommandError = async ( +export const de_ListIdentitiesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListIdentitiesResponse(data, context); + const response: ListIdentitiesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1141,7 +658,7 @@ export const de_ListIdentityPoolsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListIdentityPoolsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1153,44 +670,6 @@ export const de_ListIdentityPoolsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListIdentityPoolsCommandError - */ -const de_ListIdentityPoolsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -1199,7 +678,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1211,44 +690,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1LookupDeveloperIdentityCommand */ @@ -1257,7 +698,7 @@ export const de_LookupDeveloperIdentityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_LookupDeveloperIdentityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1269,47 +710,6 @@ export const de_LookupDeveloperIdentityCommand = async ( return response; }; -/** - * deserializeAws_json1_1LookupDeveloperIdentityCommandError - */ -const de_LookupDeveloperIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cognitoidentity#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1MergeDeveloperIdentitiesCommand */ @@ -1318,57 +718,16 @@ export const de_MergeDeveloperIdentitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_MergeDeveloperIdentitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: MergeDeveloperIdentitiesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1MergeDeveloperIdentitiesCommandError - */ -const de_MergeDeveloperIdentitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cognitoidentity#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + let contents: any = {}; + contents = _json(data); + const response: MergeDeveloperIdentitiesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1379,7 +738,7 @@ export const de_SetIdentityPoolRolesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetIdentityPoolRolesCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SetIdentityPoolRolesCommandOutput = { @@ -1388,50 +747,6 @@ export const de_SetIdentityPoolRolesCommand = async ( return response; }; -/** - * deserializeAws_json1_1SetIdentityPoolRolesCommandError - */ -const de_SetIdentityPoolRolesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cognitoidentity#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cognitoidentity#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SetPrincipalTagAttributeMapCommand */ @@ -1440,7 +755,7 @@ export const de_SetPrincipalTagAttributeMapCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetPrincipalTagAttributeMapCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1452,44 +767,6 @@ export const de_SetPrincipalTagAttributeMapCommand = async ( return response; }; -/** - * deserializeAws_json1_1SetPrincipalTagAttributeMapCommandError - */ -const de_SetPrincipalTagAttributeMapCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -1498,7 +775,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1510,44 +787,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UnlinkDeveloperIdentityCommand */ @@ -1556,7 +795,7 @@ export const de_UnlinkDeveloperIdentityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UnlinkDeveloperIdentityCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UnlinkDeveloperIdentityCommandOutput = { @@ -1565,47 +804,6 @@ export const de_UnlinkDeveloperIdentityCommand = async ( return response; }; -/** - * deserializeAws_json1_1UnlinkDeveloperIdentityCommandError - */ -const de_UnlinkDeveloperIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cognitoidentity#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UnlinkIdentityCommand */ @@ -1614,7 +812,7 @@ export const de_UnlinkIdentityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UnlinkIdentityCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UnlinkIdentityCommandOutput = { @@ -1623,50 +821,6 @@ export const de_UnlinkIdentityCommand = async ( return response; }; -/** - * deserializeAws_json1_1UnlinkIdentityCommandError - */ -const de_UnlinkIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExternalServiceException": - case "com.amazonaws.cognitoidentity#ExternalServiceException": - throw await de_ExternalServiceExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cognitoidentity#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -1675,7 +829,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1687,44 +841,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitoidentity#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitoidentity#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitoidentity#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitoidentity#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateIdentityPoolCommand */ @@ -1733,7 +849,7 @@ export const de_UpdateIdentityPoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateIdentityPoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1746,21 +862,15 @@ export const de_UpdateIdentityPoolCommand = async ( }; /** - * deserializeAws_json1_1UpdateIdentityPoolCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateIdentityPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cognitoidentity#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); case "InternalErrorException": case "com.amazonaws.cognitoidentity#InternalErrorException": throw await de_InternalErrorExceptionRes(parsedOutput, context); @@ -1776,19 +886,31 @@ const de_UpdateIdentityPoolCommandError = async ( case "ResourceConflictException": case "com.amazonaws.cognitoidentity#ResourceConflictException": throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitoidentity#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.cognitoidentity#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.cognitoidentity#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ExternalServiceException": + case "com.amazonaws.cognitoidentity#ExternalServiceException": + throw await de_ExternalServiceExceptionRes(parsedOutput, context); + case "InvalidIdentityPoolConfigurationException": + case "com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException": + throw await de_InvalidIdentityPoolConfigurationExceptionRes(parsedOutput, context); + case "DeveloperUserAlreadyRegisteredException": + case "com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException": + throw await de_DeveloperUserAlreadyRegisteredExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.cognitoidentity#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts b/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts index 719c37354bdb..c93bbe06491a 100644 --- a/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts +++ b/clients/client-cognito-sync/src/protocols/Aws_restJson1.ts @@ -430,7 +430,7 @@ export const de_BulkPublishCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BulkPublishCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -443,47 +443,6 @@ export const de_BulkPublishCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BulkPublishCommandError - */ -const de_BulkPublishCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyStreamedException": - case "com.amazonaws.cognitosync#AlreadyStreamedException": - throw await de_AlreadyStreamedExceptionRes(parsedOutput, context); - case "DuplicateRequestException": - case "com.amazonaws.cognitosync#DuplicateRequestException": - throw await de_DuplicateRequestExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitosync#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDatasetCommand */ @@ -492,7 +451,7 @@ export const de_DeleteDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -505,47 +464,6 @@ export const de_DeleteDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDatasetCommandError - */ -const de_DeleteDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cognitosync#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitosync#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitosync#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDatasetCommand */ @@ -554,7 +472,7 @@ export const de_DescribeDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -567,44 +485,6 @@ export const de_DescribeDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDatasetCommandError - */ -const de_DescribeDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitosync#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitosync#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeIdentityPoolUsageCommand */ @@ -613,7 +493,7 @@ export const de_DescribeIdentityPoolUsageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeIdentityPoolUsageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -626,44 +506,6 @@ export const de_DescribeIdentityPoolUsageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeIdentityPoolUsageCommandError - */ -const de_DescribeIdentityPoolUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitosync#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitosync#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeIdentityUsageCommand */ @@ -672,7 +514,7 @@ export const de_DescribeIdentityUsageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeIdentityUsageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -685,44 +527,6 @@ export const de_DescribeIdentityUsageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeIdentityUsageCommandError - */ -const de_DescribeIdentityUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitosync#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitosync#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBulkPublishDetailsCommand */ @@ -731,7 +535,7 @@ export const de_GetBulkPublishDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBulkPublishDetailsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -748,41 +552,6 @@ export const de_GetBulkPublishDetailsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBulkPublishDetailsCommandError - */ -const de_GetBulkPublishDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitosync#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCognitoEventsCommand */ @@ -791,7 +560,7 @@ export const de_GetCognitoEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCognitoEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -804,44 +573,6 @@ export const de_GetCognitoEventsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCognitoEventsCommandError - */ -const de_GetCognitoEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitosync#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitosync#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIdentityPoolConfigurationCommand */ @@ -850,7 +581,7 @@ export const de_GetIdentityPoolConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIdentityPoolConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -866,52 +597,14 @@ export const de_GetIdentityPoolConfigurationCommand = async ( }; /** - * deserializeAws_restJson1GetIdentityPoolConfigurationCommandError + * deserializeAws_restJson1ListDatasetsCommand */ -const de_GetIdentityPoolConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitosync#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitosync#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDatasetsCommand - */ -export const de_ListDatasetsCommand = async ( +export const de_ListDatasetsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDatasetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -926,41 +619,6 @@ export const de_ListDatasetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDatasetsCommandError - */ -const de_ListDatasetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitosync#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIdentityPoolUsageCommand */ @@ -969,7 +627,7 @@ export const de_ListIdentityPoolUsageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIdentityPoolUsageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -985,41 +643,6 @@ export const de_ListIdentityPoolUsageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListIdentityPoolUsageCommandError - */ -const de_ListIdentityPoolUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitosync#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRecordsCommand */ @@ -1028,7 +651,7 @@ export const de_ListRecordsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecordsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1049,41 +672,6 @@ export const de_ListRecordsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRecordsCommandError - */ -const de_ListRecordsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitosync#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RegisterDeviceCommand */ @@ -1092,7 +680,7 @@ export const de_RegisterDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1105,47 +693,6 @@ export const de_RegisterDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RegisterDeviceCommandError - */ -const de_RegisterDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidConfigurationException": - case "com.amazonaws.cognitosync#InvalidConfigurationException": - throw await de_InvalidConfigurationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitosync#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitosync#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SetCognitoEventsCommand */ @@ -1154,7 +701,7 @@ export const de_SetCognitoEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SetCognitoEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1163,44 +710,6 @@ export const de_SetCognitoEventsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SetCognitoEventsCommandError - */ -const de_SetCognitoEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitosync#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitosync#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SetIdentityPoolConfigurationCommand */ @@ -1209,7 +718,7 @@ export const de_SetIdentityPoolConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SetIdentityPoolConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1224,47 +733,6 @@ export const de_SetIdentityPoolConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SetIdentityPoolConfigurationCommandError - */ -const de_SetIdentityPoolConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.cognitosync#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitosync#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitosync#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SubscribeToDatasetCommand */ @@ -1273,7 +741,7 @@ export const de_SubscribeToDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SubscribeToDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1282,47 +750,6 @@ export const de_SubscribeToDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SubscribeToDatasetCommandError - */ -const de_SubscribeToDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidConfigurationException": - case "com.amazonaws.cognitosync#InvalidConfigurationException": - throw await de_InvalidConfigurationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitosync#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitosync#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UnsubscribeFromDatasetCommand */ @@ -1331,7 +758,7 @@ export const de_UnsubscribeFromDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UnsubscribeFromDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1340,47 +767,6 @@ export const de_UnsubscribeFromDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UnsubscribeFromDatasetCommandError - */ -const de_UnsubscribeFromDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.cognitosync#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidConfigurationException": - case "com.amazonaws.cognitosync#InvalidConfigurationException": - throw await de_InvalidConfigurationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.cognitosync#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.cognitosync#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.cognitosync#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.cognitosync#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRecordsCommand */ @@ -1389,7 +775,7 @@ export const de_UpdateRecordsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRecordsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1403,52 +789,61 @@ export const de_UpdateRecordsCommand = async ( }; /** - * deserializeAws_restJson1UpdateRecordsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateRecordsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AlreadyStreamedException": + case "com.amazonaws.cognitosync#AlreadyStreamedException": + throw await de_AlreadyStreamedExceptionRes(parsedOutput, context); + case "DuplicateRequestException": + case "com.amazonaws.cognitosync#DuplicateRequestException": + throw await de_DuplicateRequestExceptionRes(parsedOutput, context); case "InternalErrorException": case "com.amazonaws.cognitosync#InternalErrorException": throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidLambdaFunctionOutputException": - case "com.amazonaws.cognitosync#InvalidLambdaFunctionOutputException": - throw await de_InvalidLambdaFunctionOutputExceptionRes(parsedOutput, context); case "InvalidParameterException": case "com.amazonaws.cognitosync#InvalidParameterException": throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LambdaThrottledException": - case "com.amazonaws.cognitosync#LambdaThrottledException": - throw await de_LambdaThrottledExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.cognitosync#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); case "NotAuthorizedException": case "com.amazonaws.cognitosync#NotAuthorizedException": throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.cognitosync#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.cognitosync#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.cognitosync#ResourceConflictException": + throw await de_ResourceConflictExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.cognitosync#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "InvalidConfigurationException": + case "com.amazonaws.cognitosync#InvalidConfigurationException": + throw await de_InvalidConfigurationExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.cognitosync#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "InvalidLambdaFunctionOutputException": + case "com.amazonaws.cognitosync#InvalidLambdaFunctionOutputException": + throw await de_InvalidLambdaFunctionOutputExceptionRes(parsedOutput, context); + case "LambdaThrottledException": + case "com.amazonaws.cognitosync#LambdaThrottledException": + throw await de_LambdaThrottledExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.cognitosync#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-comprehend/src/protocols/Aws_json1_1.ts b/clients/client-comprehend/src/protocols/Aws_json1_1.ts index a0280d9ae8ff..a106bba5a0a5 100644 --- a/clients/client-comprehend/src/protocols/Aws_json1_1.ts +++ b/clients/client-comprehend/src/protocols/Aws_json1_1.ts @@ -1653,7 +1653,7 @@ export const de_BatchDetectDominantLanguageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDetectDominantLanguageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1665,41 +1665,6 @@ export const de_BatchDetectDominantLanguageCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDetectDominantLanguageCommandError - */ -const de_BatchDetectDominantLanguageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BatchSizeLimitExceededException": - case "com.amazonaws.comprehend#BatchSizeLimitExceededException": - throw await de_BatchSizeLimitExceededExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDetectEntitiesCommand */ @@ -1708,7 +1673,7 @@ export const de_BatchDetectEntitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDetectEntitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1720,44 +1685,6 @@ export const de_BatchDetectEntitiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDetectEntitiesCommandError - */ -const de_BatchDetectEntitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BatchSizeLimitExceededException": - case "com.amazonaws.comprehend#BatchSizeLimitExceededException": - throw await de_BatchSizeLimitExceededExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDetectKeyPhrasesCommand */ @@ -1766,7 +1693,7 @@ export const de_BatchDetectKeyPhrasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDetectKeyPhrasesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1778,44 +1705,6 @@ export const de_BatchDetectKeyPhrasesCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDetectKeyPhrasesCommandError - */ -const de_BatchDetectKeyPhrasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BatchSizeLimitExceededException": - case "com.amazonaws.comprehend#BatchSizeLimitExceededException": - throw await de_BatchSizeLimitExceededExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDetectSentimentCommand */ @@ -1824,7 +1713,7 @@ export const de_BatchDetectSentimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDetectSentimentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1836,44 +1725,6 @@ export const de_BatchDetectSentimentCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDetectSentimentCommandError - */ -const de_BatchDetectSentimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BatchSizeLimitExceededException": - case "com.amazonaws.comprehend#BatchSizeLimitExceededException": - throw await de_BatchSizeLimitExceededExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDetectSyntaxCommand */ @@ -1882,7 +1733,7 @@ export const de_BatchDetectSyntaxCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDetectSyntaxCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1894,44 +1745,6 @@ export const de_BatchDetectSyntaxCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDetectSyntaxCommandError - */ -const de_BatchDetectSyntaxCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BatchSizeLimitExceededException": - case "com.amazonaws.comprehend#BatchSizeLimitExceededException": - throw await de_BatchSizeLimitExceededExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDetectTargetedSentimentCommand */ @@ -1940,7 +1753,7 @@ export const de_BatchDetectTargetedSentimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDetectTargetedSentimentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1952,44 +1765,6 @@ export const de_BatchDetectTargetedSentimentCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDetectTargetedSentimentCommandError - */ -const de_BatchDetectTargetedSentimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BatchSizeLimitExceededException": - case "com.amazonaws.comprehend#BatchSizeLimitExceededException": - throw await de_BatchSizeLimitExceededExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ClassifyDocumentCommand */ @@ -1998,7 +1773,7 @@ export const de_ClassifyDocumentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ClassifyDocumentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2011,54 +1786,39 @@ export const de_ClassifyDocumentCommand = async ( }; /** - * deserializeAws_json1_1ClassifyDocumentCommandError + * deserializeAws_json1_1ContainsPiiEntitiesCommand */ -const de_ClassifyDocumentCommandError = async ( +export const de_ContainsPiiEntitiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.comprehend#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ContainsPiiEntitiesResponse(data, context); + const response: ContainsPiiEntitiesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ContainsPiiEntitiesCommand + * deserializeAws_json1_1CreateDatasetCommand */ -export const de_ContainsPiiEntitiesCommand = async ( +export const de_CreateDatasetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ContainsPiiEntitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ContainsPiiEntitiesResponse(data, context); - const response: ContainsPiiEntitiesCommandOutput = { + contents = _json(data); + const response: CreateDatasetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2066,54 +1826,39 @@ export const de_ContainsPiiEntitiesCommand = async ( }; /** - * deserializeAws_json1_1ContainsPiiEntitiesCommandError + * deserializeAws_json1_1CreateDocumentClassifierCommand */ -const de_ContainsPiiEntitiesCommandError = async ( +export const de_CreateDocumentClassifierCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateDocumentClassifierCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateDatasetCommand + * deserializeAws_json1_1CreateEndpointCommand */ -export const de_CreateDatasetCommand = async ( +export const de_CreateEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDatasetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateDatasetCommandOutput = { + const response: CreateEndpointCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2121,63 +1866,39 @@ export const de_CreateDatasetCommand = async ( }; /** - * deserializeAws_json1_1CreateDatasetCommandError + * deserializeAws_json1_1CreateEntityRecognizerCommand */ -const de_CreateDatasetCommandError = async ( +export const de_CreateEntityRecognizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.comprehend#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateEntityRecognizerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateDocumentClassifierCommand + * deserializeAws_json1_1CreateFlywheelCommand */ -export const de_CreateDocumentClassifierCommand = async ( +export const de_CreateFlywheelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDocumentClassifierCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateDocumentClassifierCommandOutput = { + const response: CreateFlywheelCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2185,66 +1906,39 @@ export const de_CreateDocumentClassifierCommand = async ( }; /** - * deserializeAws_json1_1CreateDocumentClassifierCommandError + * deserializeAws_json1_1DeleteDocumentClassifierCommand */ -const de_CreateDocumentClassifierCommandError = async ( +export const de_DeleteDocumentClassifierCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "KmsKeyValidationException": - case "com.amazonaws.comprehend#KmsKeyValidationException": - throw await de_KmsKeyValidationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.comprehend#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteDocumentClassifierCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateEndpointCommand + * deserializeAws_json1_1DeleteEndpointCommand */ -export const de_CreateEndpointCommand = async ( +export const de_DeleteEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateEndpointCommandOutput = { + const response: DeleteEndpointCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2252,66 +1946,59 @@ export const de_CreateEndpointCommand = async ( }; /** - * deserializeAws_json1_1CreateEndpointCommandError + * deserializeAws_json1_1DeleteEntityRecognizerCommand */ -const de_CreateEndpointCommandError = async ( +export const de_DeleteEntityRecognizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteEntityRecognizerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.comprehend#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.comprehend#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DeleteFlywheelCommand + */ +export const de_DeleteFlywheelCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteFlywheelCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateEntityRecognizerCommand + * deserializeAws_json1_1DeleteResourcePolicyCommand */ -export const de_CreateEntityRecognizerCommand = async ( +export const de_DeleteResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateEntityRecognizerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateEntityRecognizerCommandOutput = { + const response: DeleteResourcePolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2319,66 +2006,39 @@ export const de_CreateEntityRecognizerCommand = async ( }; /** - * deserializeAws_json1_1CreateEntityRecognizerCommandError + * deserializeAws_json1_1DescribeDatasetCommand */ -const de_CreateEntityRecognizerCommandError = async ( +export const de_DescribeDatasetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDatasetResponse(data, context); + const response: DescribeDatasetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "KmsKeyValidationException": - case "com.amazonaws.comprehend#KmsKeyValidationException": - throw await de_KmsKeyValidationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.comprehend#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1CreateFlywheelCommand + * deserializeAws_json1_1DescribeDocumentClassificationJobCommand */ -export const de_CreateFlywheelCommand = async ( +export const de_DescribeDocumentClassificationJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateFlywheelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: CreateFlywheelCommandOutput = { + contents = de_DescribeDocumentClassificationJobResponse(data, context); + const response: DescribeDocumentClassificationJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2386,72 +2046,39 @@ export const de_CreateFlywheelCommand = async ( }; /** - * deserializeAws_json1_1CreateFlywheelCommandError + * deserializeAws_json1_1DescribeDocumentClassifierCommand */ -const de_CreateFlywheelCommandError = async ( +export const de_DescribeDocumentClassifierCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "KmsKeyValidationException": - case "com.amazonaws.comprehend#KmsKeyValidationException": - throw await de_KmsKeyValidationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.comprehend#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.comprehend#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDocumentClassifierResponse(data, context); + const response: DescribeDocumentClassifierCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteDocumentClassifierCommand + * deserializeAws_json1_1DescribeDominantLanguageDetectionJobCommand */ -export const de_DeleteDocumentClassifierCommand = async ( +export const de_DescribeDominantLanguageDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDocumentClassifierCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteDocumentClassifierCommandOutput = { + contents = de_DescribeDominantLanguageDetectionJobResponse(data, context); + const response: DescribeDominantLanguageDetectionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2459,60 +2086,39 @@ export const de_DeleteDocumentClassifierCommand = async ( }; /** - * deserializeAws_json1_1DeleteDocumentClassifierCommandError + * deserializeAws_json1_1DescribeEndpointCommand */ -const de_DeleteDocumentClassifierCommandError = async ( +export const de_DescribeEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.comprehend#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeEndpointResponse(data, context); + const response: DescribeEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteEndpointCommand + * deserializeAws_json1_1DescribeEntitiesDetectionJobCommand */ -export const de_DeleteEndpointCommand = async ( +export const de_DescribeEntitiesDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteEndpointCommandOutput = { + contents = de_DescribeEntitiesDetectionJobResponse(data, context); + const response: DescribeEntitiesDetectionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2520,57 +2126,39 @@ export const de_DeleteEndpointCommand = async ( }; /** - * deserializeAws_json1_1DeleteEndpointCommandError + * deserializeAws_json1_1DescribeEntityRecognizerCommand */ -const de_DeleteEndpointCommandError = async ( +export const de_DescribeEntityRecognizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeEntityRecognizerResponse(data, context); + const response: DescribeEntityRecognizerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteEntityRecognizerCommand + * deserializeAws_json1_1DescribeEventsDetectionJobCommand */ -export const de_DeleteEntityRecognizerCommand = async ( +export const de_DescribeEventsDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteEntityRecognizerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteEntityRecognizerCommandOutput = { + contents = de_DescribeEventsDetectionJobResponse(data, context); + const response: DescribeEventsDetectionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2578,60 +2166,39 @@ export const de_DeleteEntityRecognizerCommand = async ( }; /** - * deserializeAws_json1_1DeleteEntityRecognizerCommandError + * deserializeAws_json1_1DescribeFlywheelCommand */ -const de_DeleteEntityRecognizerCommandError = async ( +export const de_DescribeFlywheelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.comprehend#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeFlywheelResponse(data, context); + const response: DescribeFlywheelCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteFlywheelCommand + * deserializeAws_json1_1DescribeFlywheelIterationCommand */ -export const de_DeleteFlywheelCommand = async ( +export const de_DescribeFlywheelIterationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteFlywheelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteFlywheelCommandOutput = { + contents = de_DescribeFlywheelIterationResponse(data, context); + const response: DescribeFlywheelIterationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2639,60 +2206,39 @@ export const de_DeleteFlywheelCommand = async ( }; /** - * deserializeAws_json1_1DeleteFlywheelCommandError + * deserializeAws_json1_1DescribeKeyPhrasesDetectionJobCommand */ -const de_DeleteFlywheelCommandError = async ( +export const de_DescribeKeyPhrasesDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.comprehend#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeKeyPhrasesDetectionJobResponse(data, context); + const response: DescribeKeyPhrasesDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteResourcePolicyCommand + * deserializeAws_json1_1DescribePiiEntitiesDetectionJobCommand */ -export const de_DeleteResourcePolicyCommand = async ( +export const de_DescribePiiEntitiesDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteResourcePolicyCommandOutput = { + contents = de_DescribePiiEntitiesDetectionJobResponse(data, context); + const response: DescribePiiEntitiesDetectionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2700,51 +2246,39 @@ export const de_DeleteResourcePolicyCommand = async ( }; /** - * deserializeAws_json1_1DeleteResourcePolicyCommandError + * deserializeAws_json1_1DescribeResourcePolicyCommand */ -const de_DeleteResourcePolicyCommandError = async ( +export const de_DescribeResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeResourcePolicyResponse(data, context); + const response: DescribeResourcePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeDatasetCommand + * deserializeAws_json1_1DescribeSentimentDetectionJobCommand */ -export const de_DescribeDatasetCommand = async ( +export const de_DescribeSentimentDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDatasetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDatasetResponse(data, context); - const response: DescribeDatasetCommandOutput = { + contents = de_DescribeSentimentDetectionJobResponse(data, context); + const response: DescribeSentimentDetectionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2752,54 +2286,39 @@ export const de_DescribeDatasetCommand = async ( }; /** - * deserializeAws_json1_1DescribeDatasetCommandError + * deserializeAws_json1_1DescribeTargetedSentimentDetectionJobCommand */ -const de_DescribeDatasetCommandError = async ( +export const de_DescribeTargetedSentimentDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeTargetedSentimentDetectionJobResponse(data, context); + const response: DescribeTargetedSentimentDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeDocumentClassificationJobCommand + * deserializeAws_json1_1DescribeTopicsDetectionJobCommand */ -export const de_DescribeDocumentClassificationJobCommand = async ( +export const de_DescribeTopicsDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDocumentClassificationJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDocumentClassificationJobResponse(data, context); - const response: DescribeDocumentClassificationJobCommandOutput = { + contents = de_DescribeTopicsDetectionJobResponse(data, context); + const response: DescribeTopicsDetectionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2807,54 +2326,39 @@ export const de_DescribeDocumentClassificationJobCommand = async ( }; /** - * deserializeAws_json1_1DescribeDocumentClassificationJobCommandError + * deserializeAws_json1_1DetectDominantLanguageCommand */ -const de_DescribeDocumentClassificationJobCommandError = async ( +export const de_DetectDominantLanguageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DetectDominantLanguageResponse(data, context); + const response: DetectDominantLanguageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeDocumentClassifierCommand + * deserializeAws_json1_1DetectEntitiesCommand */ -export const de_DescribeDocumentClassifierCommand = async ( +export const de_DetectEntitiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDocumentClassifierCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDocumentClassifierResponse(data, context); - const response: DescribeDocumentClassifierCommandOutput = { + contents = de_DetectEntitiesResponse(data, context); + const response: DetectEntitiesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2862,54 +2366,39 @@ export const de_DescribeDocumentClassifierCommand = async ( }; /** - * deserializeAws_json1_1DescribeDocumentClassifierCommandError + * deserializeAws_json1_1DetectKeyPhrasesCommand */ -const de_DescribeDocumentClassifierCommandError = async ( +export const de_DetectKeyPhrasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DetectKeyPhrasesResponse(data, context); + const response: DetectKeyPhrasesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeDominantLanguageDetectionJobCommand + * deserializeAws_json1_1DetectPiiEntitiesCommand */ -export const de_DescribeDominantLanguageDetectionJobCommand = async ( +export const de_DetectPiiEntitiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDominantLanguageDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDominantLanguageDetectionJobResponse(data, context); - const response: DescribeDominantLanguageDetectionJobCommandOutput = { + contents = de_DetectPiiEntitiesResponse(data, context); + const response: DetectPiiEntitiesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2917,54 +2406,39 @@ export const de_DescribeDominantLanguageDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1DescribeDominantLanguageDetectionJobCommandError + * deserializeAws_json1_1DetectSentimentCommand */ -const de_DescribeDominantLanguageDetectionJobCommandError = async ( +export const de_DetectSentimentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DetectSentimentResponse(data, context); + const response: DetectSentimentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1DescribeEndpointCommand + * deserializeAws_json1_1DetectSyntaxCommand */ -export const de_DescribeEndpointCommand = async ( +export const de_DetectSyntaxCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEndpointResponse(data, context); - const response: DescribeEndpointCommandOutput = { + contents = de_DetectSyntaxResponse(data, context); + const response: DetectSyntaxCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2972,54 +2446,19 @@ export const de_DescribeEndpointCommand = async ( }; /** - * deserializeAws_json1_1DescribeEndpointCommandError - */ -const de_DescribeEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeEntitiesDetectionJobCommand + * deserializeAws_json1_1DetectTargetedSentimentCommand */ -export const de_DescribeEntitiesDetectionJobCommand = async ( +export const de_DetectTargetedSentimentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEntitiesDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEntitiesDetectionJobResponse(data, context); - const response: DescribeEntitiesDetectionJobCommandOutput = { + contents = de_DetectTargetedSentimentResponse(data, context); + const response: DetectTargetedSentimentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3027,54 +2466,39 @@ export const de_DescribeEntitiesDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1DescribeEntitiesDetectionJobCommandError + * deserializeAws_json1_1DetectToxicContentCommand */ -const de_DescribeEntitiesDetectionJobCommandError = async ( +export const de_DetectToxicContentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DetectToxicContentResponse(data, context); + const response: DetectToxicContentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeEntityRecognizerCommand + * deserializeAws_json1_1ImportModelCommand */ -export const de_DescribeEntityRecognizerCommand = async ( +export const de_ImportModelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEntityRecognizerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEntityRecognizerResponse(data, context); - const response: DescribeEntityRecognizerCommandOutput = { + contents = _json(data); + const response: ImportModelCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3082,54 +2506,39 @@ export const de_DescribeEntityRecognizerCommand = async ( }; /** - * deserializeAws_json1_1DescribeEntityRecognizerCommandError + * deserializeAws_json1_1ListDatasetsCommand */ -const de_DescribeEntityRecognizerCommandError = async ( +export const de_ListDatasetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDatasetsResponse(data, context); + const response: ListDatasetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeEventsDetectionJobCommand + * deserializeAws_json1_1ListDocumentClassificationJobsCommand */ -export const de_DescribeEventsDetectionJobCommand = async ( +export const de_ListDocumentClassificationJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventsDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEventsDetectionJobResponse(data, context); - const response: DescribeEventsDetectionJobCommandOutput = { + contents = de_ListDocumentClassificationJobsResponse(data, context); + const response: ListDocumentClassificationJobsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3137,54 +2546,39 @@ export const de_DescribeEventsDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1DescribeEventsDetectionJobCommandError + * deserializeAws_json1_1ListDocumentClassifiersCommand */ -const de_DescribeEventsDetectionJobCommandError = async ( +export const de_ListDocumentClassifiersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDocumentClassifiersResponse(data, context); + const response: ListDocumentClassifiersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeFlywheelCommand + * deserializeAws_json1_1ListDocumentClassifierSummariesCommand */ -export const de_DescribeFlywheelCommand = async ( +export const de_ListDocumentClassifierSummariesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeFlywheelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeFlywheelResponse(data, context); - const response: DescribeFlywheelCommandOutput = { + contents = de_ListDocumentClassifierSummariesResponse(data, context); + const response: ListDocumentClassifierSummariesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3192,54 +2586,39 @@ export const de_DescribeFlywheelCommand = async ( }; /** - * deserializeAws_json1_1DescribeFlywheelCommandError + * deserializeAws_json1_1ListDominantLanguageDetectionJobsCommand */ -const de_DescribeFlywheelCommandError = async ( +export const de_ListDominantLanguageDetectionJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDominantLanguageDetectionJobsResponse(data, context); + const response: ListDominantLanguageDetectionJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeFlywheelIterationCommand + * deserializeAws_json1_1ListEndpointsCommand */ -export const de_DescribeFlywheelIterationCommand = async ( +export const de_ListEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeFlywheelIterationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeFlywheelIterationResponse(data, context); - const response: DescribeFlywheelIterationCommandOutput = { + contents = de_ListEndpointsResponse(data, context); + const response: ListEndpointsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3247,54 +2626,19 @@ export const de_DescribeFlywheelIterationCommand = async ( }; /** - * deserializeAws_json1_1DescribeFlywheelIterationCommandError + * deserializeAws_json1_1ListEntitiesDetectionJobsCommand */ -const de_DescribeFlywheelIterationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeKeyPhrasesDetectionJobCommand - */ -export const de_DescribeKeyPhrasesDetectionJobCommand = async ( +export const de_ListEntitiesDetectionJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeKeyPhrasesDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeKeyPhrasesDetectionJobResponse(data, context); - const response: DescribeKeyPhrasesDetectionJobCommandOutput = { + contents = de_ListEntitiesDetectionJobsResponse(data, context); + const response: ListEntitiesDetectionJobsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3302,54 +2646,19 @@ export const de_DescribeKeyPhrasesDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1DescribeKeyPhrasesDetectionJobCommandError - */ -const de_DescribeKeyPhrasesDetectionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribePiiEntitiesDetectionJobCommand + * deserializeAws_json1_1ListEntityRecognizersCommand */ -export const de_DescribePiiEntitiesDetectionJobCommand = async ( +export const de_ListEntityRecognizersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribePiiEntitiesDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribePiiEntitiesDetectionJobResponse(data, context); - const response: DescribePiiEntitiesDetectionJobCommandOutput = { + contents = de_ListEntityRecognizersResponse(data, context); + const response: ListEntityRecognizersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3357,54 +2666,19 @@ export const de_DescribePiiEntitiesDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1DescribePiiEntitiesDetectionJobCommandError - */ -const de_DescribePiiEntitiesDetectionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeResourcePolicyCommand + * deserializeAws_json1_1ListEntityRecognizerSummariesCommand */ -export const de_DescribeResourcePolicyCommand = async ( +export const de_ListEntityRecognizerSummariesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeResourcePolicyResponse(data, context); - const response: DescribeResourcePolicyCommandOutput = { + contents = de_ListEntityRecognizerSummariesResponse(data, context); + const response: ListEntityRecognizerSummariesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3412,51 +2686,19 @@ export const de_DescribeResourcePolicyCommand = async ( }; /** - * deserializeAws_json1_1DescribeResourcePolicyCommandError - */ -const de_DescribeResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeSentimentDetectionJobCommand + * deserializeAws_json1_1ListEventsDetectionJobsCommand */ -export const de_DescribeSentimentDetectionJobCommand = async ( +export const de_ListEventsDetectionJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeSentimentDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeSentimentDetectionJobResponse(data, context); - const response: DescribeSentimentDetectionJobCommandOutput = { + contents = de_ListEventsDetectionJobsResponse(data, context); + const response: ListEventsDetectionJobsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3464,54 +2706,19 @@ export const de_DescribeSentimentDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1DescribeSentimentDetectionJobCommandError - */ -const de_DescribeSentimentDetectionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeTargetedSentimentDetectionJobCommand + * deserializeAws_json1_1ListFlywheelIterationHistoryCommand */ -export const de_DescribeTargetedSentimentDetectionJobCommand = async ( +export const de_ListFlywheelIterationHistoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeTargetedSentimentDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeTargetedSentimentDetectionJobResponse(data, context); - const response: DescribeTargetedSentimentDetectionJobCommandOutput = { + contents = de_ListFlywheelIterationHistoryResponse(data, context); + const response: ListFlywheelIterationHistoryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3519,54 +2726,19 @@ export const de_DescribeTargetedSentimentDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1DescribeTargetedSentimentDetectionJobCommandError - */ -const de_DescribeTargetedSentimentDetectionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeTopicsDetectionJobCommand + * deserializeAws_json1_1ListFlywheelsCommand */ -export const de_DescribeTopicsDetectionJobCommand = async ( +export const de_ListFlywheelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeTopicsDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeTopicsDetectionJobResponse(data, context); - const response: DescribeTopicsDetectionJobCommandOutput = { + contents = de_ListFlywheelsResponse(data, context); + const response: ListFlywheelsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3574,1914 +2746,19 @@ export const de_DescribeTopicsDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1DescribeTopicsDetectionJobCommandError - */ -const de_DescribeTopicsDetectionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetectDominantLanguageCommand - */ -export const de_DetectDominantLanguageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetectDominantLanguageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetectDominantLanguageResponse(data, context); - const response: DetectDominantLanguageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetectDominantLanguageCommandError - */ -const de_DetectDominantLanguageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetectEntitiesCommand - */ -export const de_DetectEntitiesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetectEntitiesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetectEntitiesResponse(data, context); - const response: DetectEntitiesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetectEntitiesCommandError - */ -const de_DetectEntitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.comprehend#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetectKeyPhrasesCommand - */ -export const de_DetectKeyPhrasesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetectKeyPhrasesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetectKeyPhrasesResponse(data, context); - const response: DetectKeyPhrasesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetectKeyPhrasesCommandError - */ -const de_DetectKeyPhrasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetectPiiEntitiesCommand - */ -export const de_DetectPiiEntitiesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetectPiiEntitiesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetectPiiEntitiesResponse(data, context); - const response: DetectPiiEntitiesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetectPiiEntitiesCommandError - */ -const de_DetectPiiEntitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetectSentimentCommand - */ -export const de_DetectSentimentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetectSentimentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetectSentimentResponse(data, context); - const response: DetectSentimentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetectSentimentCommandError - */ -const de_DetectSentimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetectSyntaxCommand - */ -export const de_DetectSyntaxCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetectSyntaxCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetectSyntaxResponse(data, context); - const response: DetectSyntaxCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetectSyntaxCommandError - */ -const de_DetectSyntaxCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetectTargetedSentimentCommand - */ -export const de_DetectTargetedSentimentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetectTargetedSentimentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetectTargetedSentimentResponse(data, context); - const response: DetectTargetedSentimentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetectTargetedSentimentCommandError - */ -const de_DetectTargetedSentimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetectToxicContentCommand - */ -export const de_DetectToxicContentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetectToxicContentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetectToxicContentResponse(data, context); - const response: DetectToxicContentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetectToxicContentCommandError - */ -const de_DetectToxicContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehend#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedLanguageException": - case "com.amazonaws.comprehend#UnsupportedLanguageException": - throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ImportModelCommand - */ -export const de_ImportModelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ImportModelCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ImportModelCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ImportModelCommandError - */ -const de_ImportModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "KmsKeyValidationException": - case "com.amazonaws.comprehend#KmsKeyValidationException": - throw await de_KmsKeyValidationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.comprehend#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.comprehend#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDatasetsCommand - */ -export const de_ListDatasetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDatasetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDatasetsResponse(data, context); - const response: ListDatasetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDatasetsCommandError - */ -const de_ListDatasetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidFilterException": - case "com.amazonaws.comprehend#InvalidFilterException": - throw await de_InvalidFilterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDocumentClassificationJobsCommand - */ -export const de_ListDocumentClassificationJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDocumentClassificationJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDocumentClassificationJobsResponse(data, context); - const response: ListDocumentClassificationJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDocumentClassificationJobsCommandError - */ -const de_ListDocumentClassificationJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidFilterException": - case "com.amazonaws.comprehend#InvalidFilterException": - throw await de_InvalidFilterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDocumentClassifiersCommand - */ -export const de_ListDocumentClassifiersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDocumentClassifiersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDocumentClassifiersResponse(data, context); - const response: ListDocumentClassifiersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDocumentClassifiersCommandError - */ -const de_ListDocumentClassifiersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidFilterException": - case "com.amazonaws.comprehend#InvalidFilterException": - throw await de_InvalidFilterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDocumentClassifierSummariesCommand - */ -export const de_ListDocumentClassifierSummariesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDocumentClassifierSummariesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDocumentClassifierSummariesResponse(data, context); - const response: ListDocumentClassifierSummariesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDocumentClassifierSummariesCommandError - */ -const de_ListDocumentClassifierSummariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDominantLanguageDetectionJobsCommand - */ -export const de_ListDominantLanguageDetectionJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDominantLanguageDetectionJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDominantLanguageDetectionJobsResponse(data, context); - const response: ListDominantLanguageDetectionJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDominantLanguageDetectionJobsCommandError - */ -const de_ListDominantLanguageDetectionJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidFilterException": - case "com.amazonaws.comprehend#InvalidFilterException": - throw await de_InvalidFilterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListEndpointsCommand - */ -export const de_ListEndpointsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListEndpointsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListEndpointsResponse(data, context); - const response: ListEndpointsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListEndpointsCommandError - */ -const de_ListEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListEntitiesDetectionJobsCommand - */ -export const de_ListEntitiesDetectionJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListEntitiesDetectionJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListEntitiesDetectionJobsResponse(data, context); - const response: ListEntitiesDetectionJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListEntitiesDetectionJobsCommandError - */ -const de_ListEntitiesDetectionJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidFilterException": - case "com.amazonaws.comprehend#InvalidFilterException": - throw await de_InvalidFilterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListEntityRecognizersCommand - */ -export const de_ListEntityRecognizersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListEntityRecognizersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListEntityRecognizersResponse(data, context); - const response: ListEntityRecognizersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListEntityRecognizersCommandError - */ -const de_ListEntityRecognizersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidFilterException": - case "com.amazonaws.comprehend#InvalidFilterException": - throw await de_InvalidFilterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListEntityRecognizerSummariesCommand - */ -export const de_ListEntityRecognizerSummariesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListEntityRecognizerSummariesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListEntityRecognizerSummariesResponse(data, context); - const response: ListEntityRecognizerSummariesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListEntityRecognizerSummariesCommandError - */ -const de_ListEntityRecognizerSummariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListEventsDetectionJobsCommand - */ -export const de_ListEventsDetectionJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListEventsDetectionJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListEventsDetectionJobsResponse(data, context); - const response: ListEventsDetectionJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListEventsDetectionJobsCommandError - */ -const de_ListEventsDetectionJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidFilterException": - case "com.amazonaws.comprehend#InvalidFilterException": - throw await de_InvalidFilterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListFlywheelIterationHistoryCommand - */ -export const de_ListFlywheelIterationHistoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListFlywheelIterationHistoryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListFlywheelIterationHistoryResponse(data, context); - const response: ListFlywheelIterationHistoryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListFlywheelIterationHistoryCommandError - */ -const de_ListFlywheelIterationHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidFilterException": - case "com.amazonaws.comprehend#InvalidFilterException": - throw await de_InvalidFilterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListFlywheelsCommand - */ -export const de_ListFlywheelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListFlywheelsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListFlywheelsResponse(data, context); - const response: ListFlywheelsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListFlywheelsCommandError - */ -const de_ListFlywheelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidFilterException": - case "com.amazonaws.comprehend#InvalidFilterException": - throw await de_InvalidFilterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListKeyPhrasesDetectionJobsCommand - */ -export const de_ListKeyPhrasesDetectionJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListKeyPhrasesDetectionJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListKeyPhrasesDetectionJobsResponse(data, context); - const response: ListKeyPhrasesDetectionJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListKeyPhrasesDetectionJobsCommandError - */ -const de_ListKeyPhrasesDetectionJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidFilterException": - case "com.amazonaws.comprehend#InvalidFilterException": - throw await de_InvalidFilterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListPiiEntitiesDetectionJobsCommand - */ -export const de_ListPiiEntitiesDetectionJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPiiEntitiesDetectionJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListPiiEntitiesDetectionJobsResponse(data, context); - const response: ListPiiEntitiesDetectionJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListPiiEntitiesDetectionJobsCommandError - */ -const de_ListPiiEntitiesDetectionJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidFilterException": - case "com.amazonaws.comprehend#InvalidFilterException": - throw await de_InvalidFilterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListSentimentDetectionJobsCommand - */ -export const de_ListSentimentDetectionJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSentimentDetectionJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListSentimentDetectionJobsResponse(data, context); - const response: ListSentimentDetectionJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListSentimentDetectionJobsCommandError - */ -const de_ListSentimentDetectionJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidFilterException": - case "com.amazonaws.comprehend#InvalidFilterException": - throw await de_InvalidFilterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTargetedSentimentDetectionJobsCommand - */ -export const de_ListTargetedSentimentDetectionJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTargetedSentimentDetectionJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListTargetedSentimentDetectionJobsResponse(data, context); - const response: ListTargetedSentimentDetectionJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTargetedSentimentDetectionJobsCommandError - */ -const de_ListTargetedSentimentDetectionJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidFilterException": - case "com.amazonaws.comprehend#InvalidFilterException": - throw await de_InvalidFilterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTopicsDetectionJobsCommand - */ -export const de_ListTopicsDetectionJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTopicsDetectionJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListTopicsDetectionJobsResponse(data, context); - const response: ListTopicsDetectionJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTopicsDetectionJobsCommandError - */ -const de_ListTopicsDetectionJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidFilterException": - case "com.amazonaws.comprehend#InvalidFilterException": - throw await de_InvalidFilterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutResourcePolicyCommand - */ -export const de_PutResourcePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutResourcePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartDocumentClassificationJobCommand - */ -export const de_StartDocumentClassificationJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartDocumentClassificationJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartDocumentClassificationJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartDocumentClassificationJobCommandError - */ -const de_StartDocumentClassificationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "KmsKeyValidationException": - case "com.amazonaws.comprehend#KmsKeyValidationException": - throw await de_KmsKeyValidationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.comprehend#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartDominantLanguageDetectionJobCommand - */ -export const de_StartDominantLanguageDetectionJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartDominantLanguageDetectionJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartDominantLanguageDetectionJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartDominantLanguageDetectionJobCommandError - */ -const de_StartDominantLanguageDetectionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "KmsKeyValidationException": - case "com.amazonaws.comprehend#KmsKeyValidationException": - throw await de_KmsKeyValidationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartEntitiesDetectionJobCommand - */ -export const de_StartEntitiesDetectionJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartEntitiesDetectionJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartEntitiesDetectionJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartEntitiesDetectionJobCommandError - */ -const de_StartEntitiesDetectionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "KmsKeyValidationException": - case "com.amazonaws.comprehend#KmsKeyValidationException": - throw await de_KmsKeyValidationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.comprehend#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartEventsDetectionJobCommand - */ -export const de_StartEventsDetectionJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartEventsDetectionJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartEventsDetectionJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartEventsDetectionJobCommandError - */ -const de_StartEventsDetectionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "KmsKeyValidationException": - case "com.amazonaws.comprehend#KmsKeyValidationException": - throw await de_KmsKeyValidationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartFlywheelIterationCommand - */ -export const de_StartFlywheelIterationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartFlywheelIterationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartFlywheelIterationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartFlywheelIterationCommandError - */ -const de_StartFlywheelIterationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartKeyPhrasesDetectionJobCommand + * deserializeAws_json1_1ListKeyPhrasesDetectionJobsCommand */ -export const de_StartKeyPhrasesDetectionJobCommand = async ( +export const de_ListKeyPhrasesDetectionJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartKeyPhrasesDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartKeyPhrasesDetectionJobCommandOutput = { + contents = de_ListKeyPhrasesDetectionJobsResponse(data, context); + const response: ListKeyPhrasesDetectionJobsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5489,60 +2766,39 @@ export const de_StartKeyPhrasesDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1StartKeyPhrasesDetectionJobCommandError + * deserializeAws_json1_1ListPiiEntitiesDetectionJobsCommand */ -const de_StartKeyPhrasesDetectionJobCommandError = async ( +export const de_ListPiiEntitiesDetectionJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "KmsKeyValidationException": - case "com.amazonaws.comprehend#KmsKeyValidationException": - throw await de_KmsKeyValidationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListPiiEntitiesDetectionJobsResponse(data, context); + const response: ListPiiEntitiesDetectionJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartPiiEntitiesDetectionJobCommand + * deserializeAws_json1_1ListSentimentDetectionJobsCommand */ -export const de_StartPiiEntitiesDetectionJobCommand = async ( +export const de_ListSentimentDetectionJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartPiiEntitiesDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartPiiEntitiesDetectionJobCommandOutput = { + contents = de_ListSentimentDetectionJobsResponse(data, context); + const response: ListSentimentDetectionJobsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5550,60 +2806,39 @@ export const de_StartPiiEntitiesDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1StartPiiEntitiesDetectionJobCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_StartPiiEntitiesDetectionJobCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "KmsKeyValidationException": - case "com.amazonaws.comprehend#KmsKeyValidationException": - throw await de_KmsKeyValidationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartSentimentDetectionJobCommand + * deserializeAws_json1_1ListTargetedSentimentDetectionJobsCommand */ -export const de_StartSentimentDetectionJobCommand = async ( +export const de_ListTargetedSentimentDetectionJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartSentimentDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartSentimentDetectionJobCommandOutput = { + contents = de_ListTargetedSentimentDetectionJobsResponse(data, context); + const response: ListTargetedSentimentDetectionJobsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5611,60 +2846,39 @@ export const de_StartSentimentDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1StartSentimentDetectionJobCommandError + * deserializeAws_json1_1ListTopicsDetectionJobsCommand */ -const de_StartSentimentDetectionJobCommandError = async ( +export const de_ListTopicsDetectionJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "KmsKeyValidationException": - case "com.amazonaws.comprehend#KmsKeyValidationException": - throw await de_KmsKeyValidationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListTopicsDetectionJobsResponse(data, context); + const response: ListTopicsDetectionJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartTargetedSentimentDetectionJobCommand + * deserializeAws_json1_1PutResourcePolicyCommand */ -export const de_StartTargetedSentimentDetectionJobCommand = async ( +export const de_PutResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartTargetedSentimentDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartTargetedSentimentDetectionJobCommandOutput = { + const response: PutResourcePolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5672,60 +2886,39 @@ export const de_StartTargetedSentimentDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1StartTargetedSentimentDetectionJobCommandError + * deserializeAws_json1_1StartDocumentClassificationJobCommand */ -const de_StartTargetedSentimentDetectionJobCommandError = async ( +export const de_StartDocumentClassificationJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "KmsKeyValidationException": - case "com.amazonaws.comprehend#KmsKeyValidationException": - throw await de_KmsKeyValidationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartDocumentClassificationJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartTopicsDetectionJobCommand + * deserializeAws_json1_1StartDominantLanguageDetectionJobCommand */ -export const de_StartTopicsDetectionJobCommand = async ( +export const de_StartDominantLanguageDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartTopicsDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartTopicsDetectionJobCommandOutput = { + const response: StartDominantLanguageDetectionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5733,60 +2926,39 @@ export const de_StartTopicsDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1StartTopicsDetectionJobCommandError + * deserializeAws_json1_1StartEntitiesDetectionJobCommand */ -const de_StartTopicsDetectionJobCommandError = async ( +export const de_StartEntitiesDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "KmsKeyValidationException": - case "com.amazonaws.comprehend#KmsKeyValidationException": - throw await de_KmsKeyValidationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartEntitiesDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopDominantLanguageDetectionJobCommand + * deserializeAws_json1_1StartEventsDetectionJobCommand */ -export const de_StopDominantLanguageDetectionJobCommand = async ( +export const de_StartEventsDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopDominantLanguageDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopDominantLanguageDetectionJobCommandOutput = { + const response: StartEventsDetectionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5794,51 +2966,39 @@ export const de_StopDominantLanguageDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1StopDominantLanguageDetectionJobCommandError + * deserializeAws_json1_1StartFlywheelIterationCommand */ -const de_StopDominantLanguageDetectionJobCommandError = async ( +export const de_StartFlywheelIterationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartFlywheelIterationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopEntitiesDetectionJobCommand + * deserializeAws_json1_1StartKeyPhrasesDetectionJobCommand */ -export const de_StopEntitiesDetectionJobCommand = async ( +export const de_StartKeyPhrasesDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopEntitiesDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopEntitiesDetectionJobCommandOutput = { + const response: StartKeyPhrasesDetectionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5846,51 +3006,39 @@ export const de_StopEntitiesDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1StopEntitiesDetectionJobCommandError + * deserializeAws_json1_1StartPiiEntitiesDetectionJobCommand */ -const de_StopEntitiesDetectionJobCommandError = async ( +export const de_StartPiiEntitiesDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartPiiEntitiesDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopEventsDetectionJobCommand + * deserializeAws_json1_1StartSentimentDetectionJobCommand */ -export const de_StopEventsDetectionJobCommand = async ( +export const de_StartSentimentDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopEventsDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopEventsDetectionJobCommandOutput = { + const response: StartSentimentDetectionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5898,51 +3046,39 @@ export const de_StopEventsDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1StopEventsDetectionJobCommandError + * deserializeAws_json1_1StartTargetedSentimentDetectionJobCommand */ -const de_StopEventsDetectionJobCommandError = async ( +export const de_StartTargetedSentimentDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartTargetedSentimentDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopKeyPhrasesDetectionJobCommand + * deserializeAws_json1_1StartTopicsDetectionJobCommand */ -export const de_StopKeyPhrasesDetectionJobCommand = async ( +export const de_StartTopicsDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopKeyPhrasesDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopKeyPhrasesDetectionJobCommandOutput = { + const response: StartTopicsDetectionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5950,51 +3086,39 @@ export const de_StopKeyPhrasesDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1StopKeyPhrasesDetectionJobCommandError + * deserializeAws_json1_1StopDominantLanguageDetectionJobCommand */ -const de_StopKeyPhrasesDetectionJobCommandError = async ( +export const de_StopDominantLanguageDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StopDominantLanguageDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopPiiEntitiesDetectionJobCommand + * deserializeAws_json1_1StopEntitiesDetectionJobCommand */ -export const de_StopPiiEntitiesDetectionJobCommand = async ( +export const de_StopEntitiesDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopPiiEntitiesDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopPiiEntitiesDetectionJobCommandOutput = { + const response: StopEntitiesDetectionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6002,51 +3126,39 @@ export const de_StopPiiEntitiesDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1StopPiiEntitiesDetectionJobCommandError + * deserializeAws_json1_1StopEventsDetectionJobCommand */ -const de_StopPiiEntitiesDetectionJobCommandError = async ( +export const de_StopEventsDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StopEventsDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopSentimentDetectionJobCommand + * deserializeAws_json1_1StopKeyPhrasesDetectionJobCommand */ -export const de_StopSentimentDetectionJobCommand = async ( +export const de_StopKeyPhrasesDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopSentimentDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopSentimentDetectionJobCommandOutput = { + const response: StopKeyPhrasesDetectionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6054,51 +3166,39 @@ export const de_StopSentimentDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1StopSentimentDetectionJobCommandError + * deserializeAws_json1_1StopPiiEntitiesDetectionJobCommand */ -const de_StopSentimentDetectionJobCommandError = async ( +export const de_StopPiiEntitiesDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StopPiiEntitiesDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopTargetedSentimentDetectionJobCommand + * deserializeAws_json1_1StopSentimentDetectionJobCommand */ -export const de_StopTargetedSentimentDetectionJobCommand = async ( +export const de_StopSentimentDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopTargetedSentimentDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopTargetedSentimentDetectionJobCommandOutput = { + const response: StopSentimentDetectionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6106,35 +3206,23 @@ export const de_StopTargetedSentimentDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1StopTargetedSentimentDetectionJobCommandError + * deserializeAws_json1_1StopTargetedSentimentDetectionJobCommand */ -const de_StopTargetedSentimentDetectionJobCommandError = async ( +export const de_StopTargetedSentimentDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "JobNotFoundException": - case "com.amazonaws.comprehend#JobNotFoundException": - throw await de_JobNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StopTargetedSentimentDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -6145,7 +3233,7 @@ export const de_StopTrainingDocumentClassifierCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopTrainingDocumentClassifierCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6157,41 +3245,6 @@ export const de_StopTrainingDocumentClassifierCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopTrainingDocumentClassifierCommandError - */ -const de_StopTrainingDocumentClassifierCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopTrainingEntityRecognizerCommand */ @@ -6200,7 +3253,7 @@ export const de_StopTrainingEntityRecognizerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopTrainingEntityRecognizerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6212,41 +3265,6 @@ export const de_StopTrainingEntityRecognizerCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopTrainingEntityRecognizerCommandError - */ -const de_StopTrainingEntityRecognizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -6255,7 +3273,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6267,44 +3285,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.comprehend#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.comprehend#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -6313,7 +3293,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6325,44 +3305,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.comprehend#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagKeysException": - case "com.amazonaws.comprehend#TooManyTagKeysException": - throw await de_TooManyTagKeysExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateEndpointCommand */ @@ -6371,7 +3313,7 @@ export const de_UpdateEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6383,50 +3325,6 @@ export const de_UpdateEndpointCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateEndpointCommandError - */ -const de_UpdateEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehend#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehend#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.comprehend#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.comprehend#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehend#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.comprehend#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehend#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateFlywheelCommand */ @@ -6435,7 +3333,7 @@ export const de_UpdateFlywheelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateFlywheelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6448,40 +3346,70 @@ export const de_UpdateFlywheelCommand = async ( }; /** - * deserializeAws_json1_1UpdateFlywheelCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateFlywheelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "BatchSizeLimitExceededException": + case "com.amazonaws.comprehend#BatchSizeLimitExceededException": + throw await de_BatchSizeLimitExceededExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.comprehend#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "InvalidRequestException": case "com.amazonaws.comprehend#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "KmsKeyValidationException": - case "com.amazonaws.comprehend#KmsKeyValidationException": - throw await de_KmsKeyValidationExceptionRes(parsedOutput, context); + case "TextSizeLimitExceededException": + case "com.amazonaws.comprehend#TextSizeLimitExceededException": + throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); + case "UnsupportedLanguageException": + case "com.amazonaws.comprehend#UnsupportedLanguageException": + throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context); + case "ResourceUnavailableException": + case "com.amazonaws.comprehend#ResourceUnavailableException": + throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.comprehend#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); + case "ResourceLimitExceededException": + case "com.amazonaws.comprehend#ResourceLimitExceededException": + throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.comprehend#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.comprehend#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.comprehend#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "KmsKeyValidationException": + case "com.amazonaws.comprehend#KmsKeyValidationException": + throw await de_KmsKeyValidationExceptionRes(parsedOutput, context); + case "JobNotFoundException": + case "com.amazonaws.comprehend#JobNotFoundException": + throw await de_JobNotFoundExceptionRes(parsedOutput, context); + case "InvalidFilterException": + case "com.amazonaws.comprehend#InvalidFilterException": + throw await de_InvalidFilterExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.comprehend#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "TooManyTagKeysException": + case "com.amazonaws.comprehend#TooManyTagKeysException": + throw await de_TooManyTagKeysExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts b/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts index ad087db40f0e..1e26e1d6726e 100644 --- a/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts +++ b/clients/client-comprehendmedical/src/protocols/Aws_json1_1.ts @@ -527,7 +527,7 @@ export const de_DescribeEntitiesDetectionV2JobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEntitiesDetectionV2JobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -539,41 +539,6 @@ export const de_DescribeEntitiesDetectionV2JobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEntitiesDetectionV2JobCommandError - */ -const de_DescribeEntitiesDetectionV2JobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehendmedical#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeICD10CMInferenceJobCommand */ @@ -582,7 +547,7 @@ export const de_DescribeICD10CMInferenceJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeICD10CMInferenceJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -594,41 +559,6 @@ export const de_DescribeICD10CMInferenceJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeICD10CMInferenceJobCommandError - */ -const de_DescribeICD10CMInferenceJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehendmedical#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribePHIDetectionJobCommand */ @@ -637,7 +567,7 @@ export const de_DescribePHIDetectionJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePHIDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -649,41 +579,6 @@ export const de_DescribePHIDetectionJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribePHIDetectionJobCommandError - */ -const de_DescribePHIDetectionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehendmedical#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeRxNormInferenceJobCommand */ @@ -692,7 +587,7 @@ export const de_DescribeRxNormInferenceJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRxNormInferenceJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -704,41 +599,6 @@ export const de_DescribeRxNormInferenceJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeRxNormInferenceJobCommandError - */ -const de_DescribeRxNormInferenceJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehendmedical#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeSNOMEDCTInferenceJobCommand */ @@ -747,7 +607,7 @@ export const de_DescribeSNOMEDCTInferenceJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSNOMEDCTInferenceJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -759,41 +619,6 @@ export const de_DescribeSNOMEDCTInferenceJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeSNOMEDCTInferenceJobCommandError - */ -const de_DescribeSNOMEDCTInferenceJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehendmedical#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DetectEntitiesCommand */ @@ -802,7 +627,7 @@ export const de_DetectEntitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetectEntitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -814,47 +639,6 @@ export const de_DetectEntitiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DetectEntitiesCommandError - */ -const de_DetectEntitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEncodingException": - case "com.amazonaws.comprehendmedical#InvalidEncodingException": - throw await de_InvalidEncodingExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.comprehendmedical#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehendmedical#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DetectEntitiesV2Command */ @@ -863,7 +647,7 @@ export const de_DetectEntitiesV2Command = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetectEntitiesV2CommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -876,60 +660,39 @@ export const de_DetectEntitiesV2Command = async ( }; /** - * deserializeAws_json1_1DetectEntitiesV2CommandError + * deserializeAws_json1_1DetectPHICommand */ -const de_DetectEntitiesV2CommandError = async ( +export const de_DetectPHICommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEncodingException": - case "com.amazonaws.comprehendmedical#InvalidEncodingException": - throw await de_InvalidEncodingExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.comprehendmedical#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehendmedical#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DetectPHIResponse(data, context); + const response: DetectPHICommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DetectPHICommand + * deserializeAws_json1_1InferICD10CMCommand */ -export const de_DetectPHICommand = async ( +export const de_InferICD10CMCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DetectPHICommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DetectPHIResponse(data, context); - const response: DetectPHICommandOutput = { + contents = de_InferICD10CMResponse(data, context); + const response: InferICD10CMCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -937,116 +700,14 @@ export const de_DetectPHICommand = async ( }; /** - * deserializeAws_json1_1DetectPHICommandError + * deserializeAws_json1_1InferRxNormCommand */ -const de_DetectPHICommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEncodingException": - case "com.amazonaws.comprehendmedical#InvalidEncodingException": - throw await de_InvalidEncodingExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.comprehendmedical#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehendmedical#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1InferICD10CMCommand - */ -export const de_InferICD10CMCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_InferICD10CMCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_InferICD10CMResponse(data, context); - const response: InferICD10CMCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1InferICD10CMCommandError - */ -const de_InferICD10CMCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEncodingException": - case "com.amazonaws.comprehendmedical#InvalidEncodingException": - throw await de_InvalidEncodingExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.comprehendmedical#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehendmedical#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1InferRxNormCommand - */ -export const de_InferRxNormCommand = async ( +export const de_InferRxNormCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_InferRxNormCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1058,47 +719,6 @@ export const de_InferRxNormCommand = async ( return response; }; -/** - * deserializeAws_json1_1InferRxNormCommandError - */ -const de_InferRxNormCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEncodingException": - case "com.amazonaws.comprehendmedical#InvalidEncodingException": - throw await de_InvalidEncodingExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.comprehendmedical#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehendmedical#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1InferSNOMEDCTCommand */ @@ -1107,7 +727,7 @@ export const de_InferSNOMEDCTCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_InferSNOMEDCTCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1119,47 +739,6 @@ export const de_InferSNOMEDCTCommand = async ( return response; }; -/** - * deserializeAws_json1_1InferSNOMEDCTCommandError - */ -const de_InferSNOMEDCTCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEncodingException": - case "com.amazonaws.comprehendmedical#InvalidEncodingException": - throw await de_InvalidEncodingExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.comprehendmedical#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.comprehendmedical#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListEntitiesDetectionV2JobsCommand */ @@ -1168,7 +747,7 @@ export const de_ListEntitiesDetectionV2JobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListEntitiesDetectionV2JobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1180,41 +759,6 @@ export const de_ListEntitiesDetectionV2JobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListEntitiesDetectionV2JobsCommandError - */ -const de_ListEntitiesDetectionV2JobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.comprehendmedical#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListICD10CMInferenceJobsCommand */ @@ -1223,7 +767,7 @@ export const de_ListICD10CMInferenceJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListICD10CMInferenceJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1235,41 +779,6 @@ export const de_ListICD10CMInferenceJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListICD10CMInferenceJobsCommandError - */ -const de_ListICD10CMInferenceJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.comprehendmedical#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPHIDetectionJobsCommand */ @@ -1278,7 +787,7 @@ export const de_ListPHIDetectionJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPHIDetectionJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1290,41 +799,6 @@ export const de_ListPHIDetectionJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPHIDetectionJobsCommandError - */ -const de_ListPHIDetectionJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.comprehendmedical#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListRxNormInferenceJobsCommand */ @@ -1333,7 +807,7 @@ export const de_ListRxNormInferenceJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRxNormInferenceJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1345,41 +819,6 @@ export const de_ListRxNormInferenceJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListRxNormInferenceJobsCommandError - */ -const de_ListRxNormInferenceJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.comprehendmedical#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListSNOMEDCTInferenceJobsCommand */ @@ -1388,177 +827,32 @@ export const de_ListSNOMEDCTInferenceJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSNOMEDCTInferenceJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_ListSNOMEDCTInferenceJobsResponse(data, context); - const response: ListSNOMEDCTInferenceJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListSNOMEDCTInferenceJobsCommandError - */ -const de_ListSNOMEDCTInferenceJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.comprehendmedical#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartEntitiesDetectionV2JobCommand - */ -export const de_StartEntitiesDetectionV2JobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartEntitiesDetectionV2JobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartEntitiesDetectionV2JobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartEntitiesDetectionV2JobCommandError - */ -const de_StartEntitiesDetectionV2JobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehendmedical#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartICD10CMInferenceJobCommand - */ -export const de_StartICD10CMInferenceJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartICD10CMInferenceJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartICD10CMInferenceJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartICD10CMInferenceJobCommandError - */ -const de_StartICD10CMInferenceJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehendmedical#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const response: ListSNOMEDCTInferenceJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartPHIDetectionJobCommand + * deserializeAws_json1_1StartEntitiesDetectionV2JobCommand */ -export const de_StartPHIDetectionJobCommand = async ( +export const de_StartEntitiesDetectionV2JobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartPHIDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartPHIDetectionJobCommandOutput = { + const response: StartEntitiesDetectionV2JobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1566,54 +860,39 @@ export const de_StartPHIDetectionJobCommand = async ( }; /** - * deserializeAws_json1_1StartPHIDetectionJobCommandError + * deserializeAws_json1_1StartICD10CMInferenceJobCommand */ -const de_StartPHIDetectionJobCommandError = async ( +export const de_StartICD10CMInferenceJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehendmedical#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartICD10CMInferenceJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartRxNormInferenceJobCommand + * deserializeAws_json1_1StartPHIDetectionJobCommand */ -export const de_StartRxNormInferenceJobCommand = async ( +export const de_StartPHIDetectionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartRxNormInferenceJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartRxNormInferenceJobCommandOutput = { + const response: StartPHIDetectionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1621,38 +900,23 @@ export const de_StartRxNormInferenceJobCommand = async ( }; /** - * deserializeAws_json1_1StartRxNormInferenceJobCommandError + * deserializeAws_json1_1StartRxNormInferenceJobCommand */ -const de_StartRxNormInferenceJobCommandError = async ( +export const de_StartRxNormInferenceJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehendmedical#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartRxNormInferenceJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1663,7 +927,7 @@ export const de_StartSNOMEDCTInferenceJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartSNOMEDCTInferenceJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1675,41 +939,6 @@ export const de_StartSNOMEDCTInferenceJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartSNOMEDCTInferenceJobCommandError - */ -const de_StartSNOMEDCTInferenceJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehendmedical#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.comprehendmedical#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopEntitiesDetectionV2JobCommand */ @@ -1718,7 +947,7 @@ export const de_StopEntitiesDetectionV2JobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopEntitiesDetectionV2JobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1730,38 +959,6 @@ export const de_StopEntitiesDetectionV2JobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopEntitiesDetectionV2JobCommandError - */ -const de_StopEntitiesDetectionV2JobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehendmedical#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopICD10CMInferenceJobCommand */ @@ -1770,7 +967,7 @@ export const de_StopICD10CMInferenceJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopICD10CMInferenceJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1782,38 +979,6 @@ export const de_StopICD10CMInferenceJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopICD10CMInferenceJobCommandError - */ -const de_StopICD10CMInferenceJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehendmedical#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopPHIDetectionJobCommand */ @@ -1822,7 +987,7 @@ export const de_StopPHIDetectionJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopPHIDetectionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1834,38 +999,6 @@ export const de_StopPHIDetectionJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopPHIDetectionJobCommandError - */ -const de_StopPHIDetectionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehendmedical#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopRxNormInferenceJobCommand */ @@ -1874,7 +1007,7 @@ export const de_StopRxNormInferenceJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopRxNormInferenceJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1886,38 +1019,6 @@ export const de_StopRxNormInferenceJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopRxNormInferenceJobCommandError - */ -const de_StopRxNormInferenceJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.comprehendmedical#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.comprehendmedical#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.comprehendmedical#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopSNOMEDCTInferenceJobCommand */ @@ -1926,7 +1027,7 @@ export const de_StopSNOMEDCTInferenceJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopSNOMEDCTInferenceJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1939,12 +1040,9 @@ export const de_StopSNOMEDCTInferenceJobCommand = async ( }; /** - * deserializeAws_json1_1StopSNOMEDCTInferenceJobCommandError + * deserialize_Aws_json1_1CommandError */ -const de_StopSNOMEDCTInferenceJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1963,13 +1061,25 @@ const de_StopSNOMEDCTInferenceJobCommandError = async ( case "TooManyRequestsException": case "com.amazonaws.comprehendmedical#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "InvalidEncodingException": + case "com.amazonaws.comprehendmedical#InvalidEncodingException": + throw await de_InvalidEncodingExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.comprehendmedical#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "TextSizeLimitExceededException": + case "com.amazonaws.comprehendmedical#TextSizeLimitExceededException": + throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.comprehendmedical#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts b/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts index 8456802565a8..627bae7a2a49 100644 --- a/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts +++ b/clients/client-compute-optimizer/src/protocols/Aws_json1_0.ts @@ -531,7 +531,7 @@ export const de_DeleteRecommendationPreferencesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRecommendationPreferencesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -543,53 +543,6 @@ export const de_DeleteRecommendationPreferencesCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteRecommendationPreferencesCommandError - */ -const de_DeleteRecommendationPreferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.computeoptimizer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeRecommendationExportJobsCommand */ @@ -598,7 +551,7 @@ export const de_DescribeRecommendationExportJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRecommendationExportJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -610,53 +563,6 @@ export const de_DescribeRecommendationExportJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeRecommendationExportJobsCommandError - */ -const de_DescribeRecommendationExportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.computeoptimizer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ExportAutoScalingGroupRecommendationsCommand */ @@ -665,7 +571,7 @@ export const de_ExportAutoScalingGroupRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExportAutoScalingGroupRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -677,53 +583,6 @@ export const de_ExportAutoScalingGroupRecommendationsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ExportAutoScalingGroupRecommendationsCommandError - */ -const de_ExportAutoScalingGroupRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.computeoptimizer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ExportEBSVolumeRecommendationsCommand */ @@ -732,7 +591,7 @@ export const de_ExportEBSVolumeRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExportEBSVolumeRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -745,66 +604,39 @@ export const de_ExportEBSVolumeRecommendationsCommand = async ( }; /** - * deserializeAws_json1_0ExportEBSVolumeRecommendationsCommandError + * deserializeAws_json1_0ExportEC2InstanceRecommendationsCommand */ -const de_ExportEBSVolumeRecommendationsCommandError = async ( +export const de_ExportEC2InstanceRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.computeoptimizer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ExportEC2InstanceRecommendationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ExportEC2InstanceRecommendationsCommand + * deserializeAws_json1_0ExportECSServiceRecommendationsCommand */ -export const de_ExportEC2InstanceRecommendationsCommand = async ( +export const de_ExportECSServiceRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ExportEC2InstanceRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ExportEC2InstanceRecommendationsCommandOutput = { + const response: ExportECSServiceRecommendationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -812,66 +644,39 @@ export const de_ExportEC2InstanceRecommendationsCommand = async ( }; /** - * deserializeAws_json1_0ExportEC2InstanceRecommendationsCommandError + * deserializeAws_json1_0ExportLambdaFunctionRecommendationsCommand */ -const de_ExportEC2InstanceRecommendationsCommandError = async ( +export const de_ExportLambdaFunctionRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.computeoptimizer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ExportLambdaFunctionRecommendationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ExportECSServiceRecommendationsCommand + * deserializeAws_json1_0ExportLicenseRecommendationsCommand */ -export const de_ExportECSServiceRecommendationsCommand = async ( +export const de_ExportLicenseRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ExportECSServiceRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ExportECSServiceRecommendationsCommandOutput = { + const response: ExportLicenseRecommendationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -879,468 +684,19 @@ export const de_ExportECSServiceRecommendationsCommand = async ( }; /** - * deserializeAws_json1_0ExportECSServiceRecommendationsCommandError + * deserializeAws_json1_0GetAutoScalingGroupRecommendationsCommand */ -const de_ExportECSServiceRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.computeoptimizer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ExportLambdaFunctionRecommendationsCommand - */ -export const de_ExportLambdaFunctionRecommendationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ExportLambdaFunctionRecommendationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ExportLambdaFunctionRecommendationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ExportLambdaFunctionRecommendationsCommandError - */ -const de_ExportLambdaFunctionRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.computeoptimizer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ExportLicenseRecommendationsCommand - */ -export const de_ExportLicenseRecommendationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ExportLicenseRecommendationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ExportLicenseRecommendationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ExportLicenseRecommendationsCommandError - */ -const de_ExportLicenseRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.computeoptimizer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetAutoScalingGroupRecommendationsCommand - */ -export const de_GetAutoScalingGroupRecommendationsCommand = async ( +export const de_GetAutoScalingGroupRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAutoScalingGroupRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_GetAutoScalingGroupRecommendationsResponse(data, context); - const response: GetAutoScalingGroupRecommendationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetAutoScalingGroupRecommendationsCommandError - */ -const de_GetAutoScalingGroupRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.computeoptimizer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetEBSVolumeRecommendationsCommand - */ -export const de_GetEBSVolumeRecommendationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetEBSVolumeRecommendationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetEBSVolumeRecommendationsResponse(data, context); - const response: GetEBSVolumeRecommendationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetEBSVolumeRecommendationsCommandError - */ -const de_GetEBSVolumeRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.computeoptimizer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetEC2InstanceRecommendationsCommand - */ -export const de_GetEC2InstanceRecommendationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetEC2InstanceRecommendationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetEC2InstanceRecommendationsResponse(data, context); - const response: GetEC2InstanceRecommendationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetEC2InstanceRecommendationsCommandError - */ -const de_GetEC2InstanceRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.computeoptimizer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetEC2RecommendationProjectedMetricsCommand - */ -export const de_GetEC2RecommendationProjectedMetricsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetEC2RecommendationProjectedMetricsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetEC2RecommendationProjectedMetricsResponse(data, context); - const response: GetEC2RecommendationProjectedMetricsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetEC2RecommendationProjectedMetricsCommandError - */ -const de_GetEC2RecommendationProjectedMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.computeoptimizer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetECSServiceRecommendationProjectedMetricsCommand - */ -export const de_GetECSServiceRecommendationProjectedMetricsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetECSServiceRecommendationProjectedMetricsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetECSServiceRecommendationProjectedMetricsResponse(data, context); - const response: GetECSServiceRecommendationProjectedMetricsCommandOutput = { + const response: GetAutoScalingGroupRecommendationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1348,66 +704,19 @@ export const de_GetECSServiceRecommendationProjectedMetricsCommand = async ( }; /** - * deserializeAws_json1_0GetECSServiceRecommendationProjectedMetricsCommandError - */ -const de_GetECSServiceRecommendationProjectedMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.computeoptimizer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetECSServiceRecommendationsCommand + * deserializeAws_json1_0GetEBSVolumeRecommendationsCommand */ -export const de_GetECSServiceRecommendationsCommand = async ( +export const de_GetEBSVolumeRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetECSServiceRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetECSServiceRecommendationsResponse(data, context); - const response: GetECSServiceRecommendationsCommandOutput = { + contents = de_GetEBSVolumeRecommendationsResponse(data, context); + const response: GetEBSVolumeRecommendationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1415,66 +724,19 @@ export const de_GetECSServiceRecommendationsCommand = async ( }; /** - * deserializeAws_json1_0GetECSServiceRecommendationsCommandError - */ -const de_GetECSServiceRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.computeoptimizer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetEffectiveRecommendationPreferencesCommand + * deserializeAws_json1_0GetEC2InstanceRecommendationsCommand */ -export const de_GetEffectiveRecommendationPreferencesCommand = async ( +export const de_GetEC2InstanceRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetEffectiveRecommendationPreferencesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetEffectiveRecommendationPreferencesCommandOutput = { + contents = de_GetEC2InstanceRecommendationsResponse(data, context); + const response: GetEC2InstanceRecommendationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1482,66 +744,39 @@ export const de_GetEffectiveRecommendationPreferencesCommand = async ( }; /** - * deserializeAws_json1_0GetEffectiveRecommendationPreferencesCommandError + * deserializeAws_json1_0GetEC2RecommendationProjectedMetricsCommand */ -const de_GetEffectiveRecommendationPreferencesCommandError = async ( +export const de_GetEC2RecommendationProjectedMetricsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.computeoptimizer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetEC2RecommendationProjectedMetricsResponse(data, context); + const response: GetEC2RecommendationProjectedMetricsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0GetEnrollmentStatusCommand + * deserializeAws_json1_0GetECSServiceRecommendationProjectedMetricsCommand */ -export const de_GetEnrollmentStatusCommand = async ( +export const de_GetECSServiceRecommendationProjectedMetricsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetEnrollmentStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetEnrollmentStatusResponse(data, context); - const response: GetEnrollmentStatusCommandOutput = { + contents = de_GetECSServiceRecommendationProjectedMetricsResponse(data, context); + const response: GetECSServiceRecommendationProjectedMetricsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1549,60 +784,39 @@ export const de_GetEnrollmentStatusCommand = async ( }; /** - * deserializeAws_json1_0GetEnrollmentStatusCommandError + * deserializeAws_json1_0GetECSServiceRecommendationsCommand */ -const de_GetEnrollmentStatusCommandError = async ( +export const de_GetECSServiceRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetECSServiceRecommendationsResponse(data, context); + const response: GetECSServiceRecommendationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0GetEnrollmentStatusesForOrganizationCommand + * deserializeAws_json1_0GetEffectiveRecommendationPreferencesCommand */ -export const de_GetEnrollmentStatusesForOrganizationCommand = async ( +export const de_GetEffectiveRecommendationPreferencesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetEnrollmentStatusesForOrganizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetEnrollmentStatusesForOrganizationResponse(data, context); - const response: GetEnrollmentStatusesForOrganizationCommandOutput = { + contents = _json(data); + const response: GetEffectiveRecommendationPreferencesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1610,60 +824,39 @@ export const de_GetEnrollmentStatusesForOrganizationCommand = async ( }; /** - * deserializeAws_json1_0GetEnrollmentStatusesForOrganizationCommandError - */ -const de_GetEnrollmentStatusesForOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + * deserializeAws_json1_0GetEnrollmentStatusCommand + */ +export const de_GetEnrollmentStatusCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetEnrollmentStatusResponse(data, context); + const response: GetEnrollmentStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0GetLambdaFunctionRecommendationsCommand + * deserializeAws_json1_0GetEnrollmentStatusesForOrganizationCommand */ -export const de_GetLambdaFunctionRecommendationsCommand = async ( +export const de_GetEnrollmentStatusesForOrganizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetLambdaFunctionRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetLambdaFunctionRecommendationsResponse(data, context); - const response: GetLambdaFunctionRecommendationsCommandOutput = { + contents = de_GetEnrollmentStatusesForOrganizationResponse(data, context); + const response: GetEnrollmentStatusesForOrganizationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1671,50 +864,23 @@ export const de_GetLambdaFunctionRecommendationsCommand = async ( }; /** - * deserializeAws_json1_0GetLambdaFunctionRecommendationsCommandError + * deserializeAws_json1_0GetLambdaFunctionRecommendationsCommand */ -const de_GetLambdaFunctionRecommendationsCommandError = async ( +export const de_GetLambdaFunctionRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.computeoptimizer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetLambdaFunctionRecommendationsResponse(data, context); + const response: GetLambdaFunctionRecommendationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1725,7 +891,7 @@ export const de_GetLicenseRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetLicenseRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1737,53 +903,6 @@ export const de_GetLicenseRecommendationsCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetLicenseRecommendationsCommandError - */ -const de_GetLicenseRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.computeoptimizer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetRecommendationPreferencesCommand */ @@ -1792,7 +911,7 @@ export const de_GetRecommendationPreferencesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRecommendationPreferencesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1804,53 +923,6 @@ export const de_GetRecommendationPreferencesCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetRecommendationPreferencesCommandError - */ -const de_GetRecommendationPreferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.computeoptimizer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetRecommendationSummariesCommand */ @@ -1859,7 +931,7 @@ export const de_GetRecommendationSummariesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRecommendationSummariesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1871,50 +943,6 @@ export const de_GetRecommendationSummariesCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetRecommendationSummariesCommandError - */ -const de_GetRecommendationSummariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0PutRecommendationPreferencesCommand */ @@ -1923,7 +951,7 @@ export const de_PutRecommendationPreferencesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutRecommendationPreferencesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1935,53 +963,6 @@ export const de_PutRecommendationPreferencesCommand = async ( return response; }; -/** - * deserializeAws_json1_0PutRecommendationPreferencesCommandError - */ -const de_PutRecommendationPreferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.computeoptimizer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.computeoptimizer#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.computeoptimizer#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingAuthenticationToken": - case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": - throw await de_MissingAuthenticationTokenRes(parsedOutput, context); - case "OptInRequiredException": - case "com.amazonaws.computeoptimizer#OptInRequiredException": - throw await de_OptInRequiredExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.computeoptimizer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.computeoptimizer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.computeoptimizer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateEnrollmentStatusCommand */ @@ -1990,7 +971,7 @@ export const de_UpdateEnrollmentStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateEnrollmentStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2003,12 +984,9 @@ export const de_UpdateEnrollmentStatusCommand = async ( }; /** - * deserializeAws_json1_0UpdateEnrollmentStatusCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateEnrollmentStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2027,19 +1005,28 @@ const de_UpdateEnrollmentStatusCommandError = async ( case "MissingAuthenticationToken": case "com.amazonaws.computeoptimizer#MissingAuthenticationToken": throw await de_MissingAuthenticationTokenRes(parsedOutput, context); + case "OptInRequiredException": + case "com.amazonaws.computeoptimizer#OptInRequiredException": + throw await de_OptInRequiredExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.computeoptimizer#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ServiceUnavailableException": case "com.amazonaws.computeoptimizer#ServiceUnavailableException": throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.computeoptimizer#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.computeoptimizer#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-config-service/src/protocols/Aws_json1_1.ts b/clients/client-config-service/src/protocols/Aws_json1_1.ts index baa9f3391726..f6b21f80effb 100644 --- a/clients/client-config-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-config-service/src/protocols/Aws_json1_1.ts @@ -1827,7 +1827,7 @@ export const de_BatchGetAggregateResourceConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetAggregateResourceConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1839,35 +1839,6 @@ export const de_BatchGetAggregateResourceConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetAggregateResourceConfigCommandError - */ -const de_BatchGetAggregateResourceConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchConfigurationAggregatorException": - case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": - throw await de_NoSuchConfigurationAggregatorExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetResourceConfigCommand */ @@ -1876,7 +1847,7 @@ export const de_BatchGetResourceConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetResourceConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1888,35 +1859,6 @@ export const de_BatchGetResourceConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetResourceConfigCommandError - */ -const de_BatchGetResourceConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoAvailableConfigurationRecorderException": - case "com.amazonaws.configservice#NoAvailableConfigurationRecorderException": - throw await de_NoAvailableConfigurationRecorderExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAggregationAuthorizationCommand */ @@ -1925,7 +1867,7 @@ export const de_DeleteAggregationAuthorizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAggregationAuthorizationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteAggregationAuthorizationCommandOutput = { @@ -1934,32 +1876,6 @@ export const de_DeleteAggregationAuthorizationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAggregationAuthorizationCommandError - */ -const de_DeleteAggregationAuthorizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteConfigRuleCommand */ @@ -1968,7 +1884,7 @@ export const de_DeleteConfigRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteConfigRuleCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteConfigRuleCommandOutput = { @@ -1977,35 +1893,6 @@ export const de_DeleteConfigRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteConfigRuleCommandError - */ -const de_DeleteConfigRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchConfigRuleException": - case "com.amazonaws.configservice#NoSuchConfigRuleException": - throw await de_NoSuchConfigRuleExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.configservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteConfigurationAggregatorCommand */ @@ -2014,7 +1901,7 @@ export const de_DeleteConfigurationAggregatorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteConfigurationAggregatorCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteConfigurationAggregatorCommandOutput = { @@ -2023,32 +1910,6 @@ export const de_DeleteConfigurationAggregatorCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteConfigurationAggregatorCommandError - */ -const de_DeleteConfigurationAggregatorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchConfigurationAggregatorException": - case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": - throw await de_NoSuchConfigurationAggregatorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteConfigurationRecorderCommand */ @@ -2057,7 +1918,7 @@ export const de_DeleteConfigurationRecorderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteConfigurationRecorderCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteConfigurationRecorderCommandOutput = { @@ -2066,32 +1927,6 @@ export const de_DeleteConfigurationRecorderCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteConfigurationRecorderCommandError - */ -const de_DeleteConfigurationRecorderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchConfigurationRecorderException": - case "com.amazonaws.configservice#NoSuchConfigurationRecorderException": - throw await de_NoSuchConfigurationRecorderExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteConformancePackCommand */ @@ -2100,7 +1935,7 @@ export const de_DeleteConformancePackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteConformancePackCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteConformancePackCommandOutput = { @@ -2109,35 +1944,6 @@ export const de_DeleteConformancePackCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteConformancePackCommandError - */ -const de_DeleteConformancePackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchConformancePackException": - case "com.amazonaws.configservice#NoSuchConformancePackException": - throw await de_NoSuchConformancePackExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.configservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteDeliveryChannelCommand */ @@ -2146,7 +1952,7 @@ export const de_DeleteDeliveryChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDeliveryChannelCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteDeliveryChannelCommandOutput = { @@ -2155,35 +1961,6 @@ export const de_DeleteDeliveryChannelCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteDeliveryChannelCommandError - */ -const de_DeleteDeliveryChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LastDeliveryChannelDeleteFailedException": - case "com.amazonaws.configservice#LastDeliveryChannelDeleteFailedException": - throw await de_LastDeliveryChannelDeleteFailedExceptionRes(parsedOutput, context); - case "NoSuchDeliveryChannelException": - case "com.amazonaws.configservice#NoSuchDeliveryChannelException": - throw await de_NoSuchDeliveryChannelExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteEvaluationResultsCommand */ @@ -2192,7 +1969,7 @@ export const de_DeleteEvaluationResultsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEvaluationResultsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2204,35 +1981,6 @@ export const de_DeleteEvaluationResultsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteEvaluationResultsCommandError - */ -const de_DeleteEvaluationResultsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchConfigRuleException": - case "com.amazonaws.configservice#NoSuchConfigRuleException": - throw await de_NoSuchConfigRuleExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.configservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteOrganizationConfigRuleCommand */ @@ -2241,7 +1989,7 @@ export const de_DeleteOrganizationConfigRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteOrganizationConfigRuleCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteOrganizationConfigRuleCommandOutput = { @@ -2250,38 +1998,6 @@ export const de_DeleteOrganizationConfigRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteOrganizationConfigRuleCommandError - */ -const de_DeleteOrganizationConfigRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchOrganizationConfigRuleException": - case "com.amazonaws.configservice#NoSuchOrganizationConfigRuleException": - throw await de_NoSuchOrganizationConfigRuleExceptionRes(parsedOutput, context); - case "OrganizationAccessDeniedException": - case "com.amazonaws.configservice#OrganizationAccessDeniedException": - throw await de_OrganizationAccessDeniedExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.configservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteOrganizationConformancePackCommand */ @@ -2290,7 +2006,7 @@ export const de_DeleteOrganizationConformancePackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteOrganizationConformancePackCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteOrganizationConformancePackCommandOutput = { @@ -2300,46 +2016,14 @@ export const de_DeleteOrganizationConformancePackCommand = async ( }; /** - * deserializeAws_json1_1DeleteOrganizationConformancePackCommandError + * deserializeAws_json1_1DeletePendingAggregationRequestCommand */ -const de_DeleteOrganizationConformancePackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchOrganizationConformancePackException": - case "com.amazonaws.configservice#NoSuchOrganizationConformancePackException": - throw await de_NoSuchOrganizationConformancePackExceptionRes(parsedOutput, context); - case "OrganizationAccessDeniedException": - case "com.amazonaws.configservice#OrganizationAccessDeniedException": - throw await de_OrganizationAccessDeniedExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.configservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeletePendingAggregationRequestCommand - */ -export const de_DeletePendingAggregationRequestCommand = async ( +export const de_DeletePendingAggregationRequestCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePendingAggregationRequestCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeletePendingAggregationRequestCommandOutput = { @@ -2348,32 +2032,6 @@ export const de_DeletePendingAggregationRequestCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeletePendingAggregationRequestCommandError - */ -const de_DeletePendingAggregationRequestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteRemediationConfigurationCommand */ @@ -2382,7 +2040,7 @@ export const de_DeleteRemediationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRemediationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2394,41 +2052,6 @@ export const de_DeleteRemediationConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteRemediationConfigurationCommandError - */ -const de_DeleteRemediationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPermissionsException": - case "com.amazonaws.configservice#InsufficientPermissionsException": - throw await de_InsufficientPermissionsExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoSuchRemediationConfigurationException": - case "com.amazonaws.configservice#NoSuchRemediationConfigurationException": - throw await de_NoSuchRemediationConfigurationExceptionRes(parsedOutput, context); - case "RemediationInProgressException": - case "com.amazonaws.configservice#RemediationInProgressException": - throw await de_RemediationInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteRemediationExceptionsCommand */ @@ -2437,7 +2060,7 @@ export const de_DeleteRemediationExceptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRemediationExceptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2449,32 +2072,6 @@ export const de_DeleteRemediationExceptionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteRemediationExceptionsCommandError - */ -const de_DeleteRemediationExceptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchRemediationExceptionException": - case "com.amazonaws.configservice#NoSuchRemediationExceptionException": - throw await de_NoSuchRemediationExceptionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteResourceConfigCommand */ @@ -2483,7 +2080,7 @@ export const de_DeleteResourceConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteResourceConfigCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteResourceConfigCommandOutput = { @@ -2492,35 +2089,6 @@ export const de_DeleteResourceConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteResourceConfigCommandError - */ -const de_DeleteResourceConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoRunningConfigurationRecorderException": - case "com.amazonaws.configservice#NoRunningConfigurationRecorderException": - throw await de_NoRunningConfigurationRecorderExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteRetentionConfigurationCommand */ @@ -2529,7 +2097,7 @@ export const de_DeleteRetentionConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRetentionConfigurationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteRetentionConfigurationCommandOutput = { @@ -2538,35 +2106,6 @@ export const de_DeleteRetentionConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteRetentionConfigurationCommandError - */ -const de_DeleteRetentionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoSuchRetentionConfigurationException": - case "com.amazonaws.configservice#NoSuchRetentionConfigurationException": - throw await de_NoSuchRetentionConfigurationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteStoredQueryCommand */ @@ -2575,7 +2114,7 @@ export const de_DeleteStoredQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteStoredQueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2587,35 +2126,6 @@ export const de_DeleteStoredQueryCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteStoredQueryCommandError - */ -const de_DeleteStoredQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.configservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeliverConfigSnapshotCommand */ @@ -2624,7 +2134,7 @@ export const de_DeliverConfigSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeliverConfigSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2636,38 +2146,6 @@ export const de_DeliverConfigSnapshotCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeliverConfigSnapshotCommandError - */ -const de_DeliverConfigSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoAvailableConfigurationRecorderException": - case "com.amazonaws.configservice#NoAvailableConfigurationRecorderException": - throw await de_NoAvailableConfigurationRecorderExceptionRes(parsedOutput, context); - case "NoRunningConfigurationRecorderException": - case "com.amazonaws.configservice#NoRunningConfigurationRecorderException": - throw await de_NoRunningConfigurationRecorderExceptionRes(parsedOutput, context); - case "NoSuchDeliveryChannelException": - case "com.amazonaws.configservice#NoSuchDeliveryChannelException": - throw await de_NoSuchDeliveryChannelExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAggregateComplianceByConfigRulesCommand */ @@ -2676,7 +2154,7 @@ export const de_DescribeAggregateComplianceByConfigRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAggregateComplianceByConfigRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2688,41 +2166,6 @@ export const de_DescribeAggregateComplianceByConfigRulesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAggregateComplianceByConfigRulesCommandError - */ -const de_DescribeAggregateComplianceByConfigRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoSuchConfigurationAggregatorException": - case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": - throw await de_NoSuchConfigurationAggregatorExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAggregateComplianceByConformancePacksCommand */ @@ -2731,7 +2174,7 @@ export const de_DescribeAggregateComplianceByConformancePacksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAggregateComplianceByConformancePacksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2744,49 +2187,14 @@ export const de_DescribeAggregateComplianceByConformancePacksCommand = async ( }; /** - * deserializeAws_json1_1DescribeAggregateComplianceByConformancePacksCommandError + * deserializeAws_json1_1DescribeAggregationAuthorizationsCommand */ -const de_DescribeAggregateComplianceByConformancePacksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoSuchConfigurationAggregatorException": - case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": - throw await de_NoSuchConfigurationAggregatorExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAggregationAuthorizationsCommand - */ -export const de_DescribeAggregationAuthorizationsCommand = async ( +export const de_DescribeAggregationAuthorizationsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAggregationAuthorizationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2798,38 +2206,6 @@ export const de_DescribeAggregationAuthorizationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAggregationAuthorizationsCommandError - */ -const de_DescribeAggregationAuthorizationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeComplianceByConfigRuleCommand */ @@ -2838,7 +2214,7 @@ export const de_DescribeComplianceByConfigRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeComplianceByConfigRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2850,38 +2226,6 @@ export const de_DescribeComplianceByConfigRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeComplianceByConfigRuleCommandError - */ -const de_DescribeComplianceByConfigRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoSuchConfigRuleException": - case "com.amazonaws.configservice#NoSuchConfigRuleException": - throw await de_NoSuchConfigRuleExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeComplianceByResourceCommand */ @@ -2890,7 +2234,7 @@ export const de_DescribeComplianceByResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeComplianceByResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2902,35 +2246,6 @@ export const de_DescribeComplianceByResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeComplianceByResourceCommandError - */ -const de_DescribeComplianceByResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeConfigRuleEvaluationStatusCommand */ @@ -2939,7 +2254,7 @@ export const de_DescribeConfigRuleEvaluationStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConfigRuleEvaluationStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2951,38 +2266,6 @@ export const de_DescribeConfigRuleEvaluationStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeConfigRuleEvaluationStatusCommandError - */ -const de_DescribeConfigRuleEvaluationStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoSuchConfigRuleException": - case "com.amazonaws.configservice#NoSuchConfigRuleException": - throw await de_NoSuchConfigRuleExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeConfigRulesCommand */ @@ -2991,7 +2274,7 @@ export const de_DescribeConfigRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConfigRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3003,38 +2286,6 @@ export const de_DescribeConfigRulesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeConfigRulesCommandError - */ -const de_DescribeConfigRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoSuchConfigRuleException": - case "com.amazonaws.configservice#NoSuchConfigRuleException": - throw await de_NoSuchConfigRuleExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeConfigurationAggregatorsCommand */ @@ -3043,7 +2294,7 @@ export const de_DescribeConfigurationAggregatorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConfigurationAggregatorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3055,41 +2306,6 @@ export const de_DescribeConfigurationAggregatorsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeConfigurationAggregatorsCommandError - */ -const de_DescribeConfigurationAggregatorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoSuchConfigurationAggregatorException": - case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": - throw await de_NoSuchConfigurationAggregatorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeConfigurationAggregatorSourcesStatusCommand */ @@ -3098,7 +2314,7 @@ export const de_DescribeConfigurationAggregatorSourcesStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConfigurationAggregatorSourcesStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3111,54 +2327,39 @@ export const de_DescribeConfigurationAggregatorSourcesStatusCommand = async ( }; /** - * deserializeAws_json1_1DescribeConfigurationAggregatorSourcesStatusCommandError + * deserializeAws_json1_1DescribeConfigurationRecordersCommand */ -const de_DescribeConfigurationAggregatorSourcesStatusCommandError = async ( +export const de_DescribeConfigurationRecordersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoSuchConfigurationAggregatorException": - case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": - throw await de_NoSuchConfigurationAggregatorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeConfigurationRecordersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeConfigurationRecordersCommand + * deserializeAws_json1_1DescribeConfigurationRecorderStatusCommand */ -export const de_DescribeConfigurationRecordersCommand = async ( +export const de_DescribeConfigurationRecorderStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeConfigurationRecordersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeConfigurationRecordersCommandOutput = { + contents = de_DescribeConfigurationRecorderStatusResponse(data, context); + const response: DescribeConfigurationRecorderStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3166,86 +2367,14 @@ export const de_DescribeConfigurationRecordersCommand = async ( }; /** - * deserializeAws_json1_1DescribeConfigurationRecordersCommandError + * deserializeAws_json1_1DescribeConformancePackComplianceCommand */ -const de_DescribeConfigurationRecordersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchConfigurationRecorderException": - case "com.amazonaws.configservice#NoSuchConfigurationRecorderException": - throw await de_NoSuchConfigurationRecorderExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeConfigurationRecorderStatusCommand - */ -export const de_DescribeConfigurationRecorderStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeConfigurationRecorderStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeConfigurationRecorderStatusResponse(data, context); - const response: DescribeConfigurationRecorderStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeConfigurationRecorderStatusCommandError - */ -const de_DescribeConfigurationRecorderStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchConfigurationRecorderException": - case "com.amazonaws.configservice#NoSuchConfigurationRecorderException": - throw await de_NoSuchConfigurationRecorderExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeConformancePackComplianceCommand - */ -export const de_DescribeConformancePackComplianceCommand = async ( +export const de_DescribeConformancePackComplianceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConformancePackComplianceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3257,44 +2386,6 @@ export const de_DescribeConformancePackComplianceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeConformancePackComplianceCommandError - */ -const de_DescribeConformancePackComplianceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoSuchConfigRuleInConformancePackException": - case "com.amazonaws.configservice#NoSuchConfigRuleInConformancePackException": - throw await de_NoSuchConfigRuleInConformancePackExceptionRes(parsedOutput, context); - case "NoSuchConformancePackException": - case "com.amazonaws.configservice#NoSuchConformancePackException": - throw await de_NoSuchConformancePackExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeConformancePacksCommand */ @@ -3303,7 +2394,7 @@ export const de_DescribeConformancePacksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConformancePacksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3315,41 +2406,6 @@ export const de_DescribeConformancePacksCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeConformancePacksCommandError - */ -const de_DescribeConformancePacksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoSuchConformancePackException": - case "com.amazonaws.configservice#NoSuchConformancePackException": - throw await de_NoSuchConformancePackExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeConformancePackStatusCommand */ @@ -3358,7 +2414,7 @@ export const de_DescribeConformancePackStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConformancePackStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3370,38 +2426,6 @@ export const de_DescribeConformancePackStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeConformancePackStatusCommandError - */ -const de_DescribeConformancePackStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeDeliveryChannelsCommand */ @@ -3410,7 +2434,7 @@ export const de_DescribeDeliveryChannelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDeliveryChannelsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3422,32 +2446,6 @@ export const de_DescribeDeliveryChannelsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDeliveryChannelsCommandError - */ -const de_DescribeDeliveryChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchDeliveryChannelException": - case "com.amazonaws.configservice#NoSuchDeliveryChannelException": - throw await de_NoSuchDeliveryChannelExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeDeliveryChannelStatusCommand */ @@ -3456,7 +2454,7 @@ export const de_DescribeDeliveryChannelStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDeliveryChannelStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3468,32 +2466,6 @@ export const de_DescribeDeliveryChannelStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDeliveryChannelStatusCommandError - */ -const de_DescribeDeliveryChannelStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchDeliveryChannelException": - case "com.amazonaws.configservice#NoSuchDeliveryChannelException": - throw await de_NoSuchDeliveryChannelExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeOrganizationConfigRulesCommand */ @@ -3502,7 +2474,7 @@ export const de_DescribeOrganizationConfigRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeOrganizationConfigRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3515,54 +2487,39 @@ export const de_DescribeOrganizationConfigRulesCommand = async ( }; /** - * deserializeAws_json1_1DescribeOrganizationConfigRulesCommandError + * deserializeAws_json1_1DescribeOrganizationConfigRuleStatusesCommand */ -const de_DescribeOrganizationConfigRulesCommandError = async ( +export const de_DescribeOrganizationConfigRuleStatusesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoSuchOrganizationConfigRuleException": - case "com.amazonaws.configservice#NoSuchOrganizationConfigRuleException": - throw await de_NoSuchOrganizationConfigRuleExceptionRes(parsedOutput, context); - case "OrganizationAccessDeniedException": - case "com.amazonaws.configservice#OrganizationAccessDeniedException": - throw await de_OrganizationAccessDeniedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeOrganizationConfigRuleStatusesResponse(data, context); + const response: DescribeOrganizationConfigRuleStatusesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeOrganizationConfigRuleStatusesCommand + * deserializeAws_json1_1DescribeOrganizationConformancePacksCommand */ -export const de_DescribeOrganizationConfigRuleStatusesCommand = async ( +export const de_DescribeOrganizationConformancePacksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeOrganizationConfigRuleStatusesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeOrganizationConfigRuleStatusesResponse(data, context); - const response: DescribeOrganizationConfigRuleStatusesCommandOutput = { + contents = de_DescribeOrganizationConformancePacksResponse(data, context); + const response: DescribeOrganizationConformancePacksCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3570,104 +2527,14 @@ export const de_DescribeOrganizationConfigRuleStatusesCommand = async ( }; /** - * deserializeAws_json1_1DescribeOrganizationConfigRuleStatusesCommandError + * deserializeAws_json1_1DescribeOrganizationConformancePackStatusesCommand */ -const de_DescribeOrganizationConfigRuleStatusesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoSuchOrganizationConfigRuleException": - case "com.amazonaws.configservice#NoSuchOrganizationConfigRuleException": - throw await de_NoSuchOrganizationConfigRuleExceptionRes(parsedOutput, context); - case "OrganizationAccessDeniedException": - case "com.amazonaws.configservice#OrganizationAccessDeniedException": - throw await de_OrganizationAccessDeniedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeOrganizationConformancePacksCommand - */ -export const de_DescribeOrganizationConformancePacksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeOrganizationConformancePacksCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeOrganizationConformancePacksResponse(data, context); - const response: DescribeOrganizationConformancePacksCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeOrganizationConformancePacksCommandError - */ -const de_DescribeOrganizationConformancePacksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoSuchOrganizationConformancePackException": - case "com.amazonaws.configservice#NoSuchOrganizationConformancePackException": - throw await de_NoSuchOrganizationConformancePackExceptionRes(parsedOutput, context); - case "OrganizationAccessDeniedException": - case "com.amazonaws.configservice#OrganizationAccessDeniedException": - throw await de_OrganizationAccessDeniedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeOrganizationConformancePackStatusesCommand - */ -export const de_DescribeOrganizationConformancePackStatusesCommand = async ( +export const de_DescribeOrganizationConformancePackStatusesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeOrganizationConformancePackStatusesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3679,41 +2546,6 @@ export const de_DescribeOrganizationConformancePackStatusesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeOrganizationConformancePackStatusesCommandError - */ -const de_DescribeOrganizationConformancePackStatusesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoSuchOrganizationConformancePackException": - case "com.amazonaws.configservice#NoSuchOrganizationConformancePackException": - throw await de_NoSuchOrganizationConformancePackExceptionRes(parsedOutput, context); - case "OrganizationAccessDeniedException": - case "com.amazonaws.configservice#OrganizationAccessDeniedException": - throw await de_OrganizationAccessDeniedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribePendingAggregationRequestsCommand */ @@ -3722,7 +2554,7 @@ export const de_DescribePendingAggregationRequestsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePendingAggregationRequestsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3734,38 +2566,6 @@ export const de_DescribePendingAggregationRequestsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribePendingAggregationRequestsCommandError - */ -const de_DescribePendingAggregationRequestsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeRemediationConfigurationsCommand */ @@ -3774,7 +2574,7 @@ export const de_DescribeRemediationConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRemediationConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3786,26 +2586,6 @@ export const de_DescribeRemediationConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeRemediationConfigurationsCommandError - */ -const de_DescribeRemediationConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribeRemediationExceptionsCommand */ @@ -3814,7 +2594,7 @@ export const de_DescribeRemediationExceptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRemediationExceptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3826,35 +2606,6 @@ export const de_DescribeRemediationExceptionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeRemediationExceptionsCommandError - */ -const de_DescribeRemediationExceptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeRemediationExecutionStatusCommand */ @@ -3863,7 +2614,7 @@ export const de_DescribeRemediationExecutionStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRemediationExecutionStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3875,38 +2626,6 @@ export const de_DescribeRemediationExecutionStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeRemediationExecutionStatusCommandError - */ -const de_DescribeRemediationExecutionStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoSuchRemediationConfigurationException": - case "com.amazonaws.configservice#NoSuchRemediationConfigurationException": - throw await de_NoSuchRemediationConfigurationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeRetentionConfigurationsCommand */ @@ -3915,7 +2634,7 @@ export const de_DescribeRetentionConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRetentionConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3927,38 +2646,6 @@ export const de_DescribeRetentionConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeRetentionConfigurationsCommandError - */ -const de_DescribeRetentionConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoSuchRetentionConfigurationException": - case "com.amazonaws.configservice#NoSuchRetentionConfigurationException": - throw await de_NoSuchRetentionConfigurationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAggregateComplianceDetailsByConfigRuleCommand */ @@ -3967,7 +2654,7 @@ export const de_GetAggregateComplianceDetailsByConfigRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAggregateComplianceDetailsByConfigRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3980,95 +2667,25 @@ export const de_GetAggregateComplianceDetailsByConfigRuleCommand = async ( }; /** - * deserializeAws_json1_1GetAggregateComplianceDetailsByConfigRuleCommandError + * deserializeAws_json1_1GetAggregateConfigRuleComplianceSummaryCommand */ -const de_GetAggregateComplianceDetailsByConfigRuleCommandError = async ( +export const de_GetAggregateConfigRuleComplianceSummaryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoSuchConfigurationAggregatorException": - case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": - throw await de_NoSuchConfigurationAggregatorExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetAggregateConfigRuleComplianceSummaryCommand - */ -export const de_GetAggregateConfigRuleComplianceSummaryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetAggregateConfigRuleComplianceSummaryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetAggregateConfigRuleComplianceSummaryResponse(data, context); - const response: GetAggregateConfigRuleComplianceSummaryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetAggregateConfigRuleComplianceSummaryResponse(data, context); + const response: GetAggregateConfigRuleComplianceSummaryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; return response; }; -/** - * deserializeAws_json1_1GetAggregateConfigRuleComplianceSummaryCommandError - */ -const de_GetAggregateConfigRuleComplianceSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoSuchConfigurationAggregatorException": - case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": - throw await de_NoSuchConfigurationAggregatorExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAggregateConformancePackComplianceSummaryCommand */ @@ -4077,7 +2694,7 @@ export const de_GetAggregateConformancePackComplianceSummaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAggregateConformancePackComplianceSummaryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4089,41 +2706,6 @@ export const de_GetAggregateConformancePackComplianceSummaryCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAggregateConformancePackComplianceSummaryCommandError - */ -const de_GetAggregateConformancePackComplianceSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoSuchConfigurationAggregatorException": - case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": - throw await de_NoSuchConfigurationAggregatorExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAggregateDiscoveredResourceCountsCommand */ @@ -4132,7 +2714,7 @@ export const de_GetAggregateDiscoveredResourceCountsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAggregateDiscoveredResourceCountsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4144,41 +2726,6 @@ export const de_GetAggregateDiscoveredResourceCountsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAggregateDiscoveredResourceCountsCommandError - */ -const de_GetAggregateDiscoveredResourceCountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoSuchConfigurationAggregatorException": - case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": - throw await de_NoSuchConfigurationAggregatorExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAggregateResourceConfigCommand */ @@ -4187,7 +2734,7 @@ export const de_GetAggregateResourceConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAggregateResourceConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4199,41 +2746,6 @@ export const de_GetAggregateResourceConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAggregateResourceConfigCommandError - */ -const de_GetAggregateResourceConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchConfigurationAggregatorException": - case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": - throw await de_NoSuchConfigurationAggregatorExceptionRes(parsedOutput, context); - case "OversizedConfigurationItemException": - case "com.amazonaws.configservice#OversizedConfigurationItemException": - throw await de_OversizedConfigurationItemExceptionRes(parsedOutput, context); - case "ResourceNotDiscoveredException": - case "com.amazonaws.configservice#ResourceNotDiscoveredException": - throw await de_ResourceNotDiscoveredExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetComplianceDetailsByConfigRuleCommand */ @@ -4242,7 +2754,7 @@ export const de_GetComplianceDetailsByConfigRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetComplianceDetailsByConfigRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4254,38 +2766,6 @@ export const de_GetComplianceDetailsByConfigRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetComplianceDetailsByConfigRuleCommandError - */ -const de_GetComplianceDetailsByConfigRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoSuchConfigRuleException": - case "com.amazonaws.configservice#NoSuchConfigRuleException": - throw await de_NoSuchConfigRuleExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetComplianceDetailsByResourceCommand */ @@ -4294,7 +2774,7 @@ export const de_GetComplianceDetailsByResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetComplianceDetailsByResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4306,32 +2786,6 @@ export const de_GetComplianceDetailsByResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetComplianceDetailsByResourceCommandError - */ -const de_GetComplianceDetailsByResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetComplianceSummaryByConfigRuleCommand */ @@ -4340,7 +2794,7 @@ export const de_GetComplianceSummaryByConfigRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetComplianceSummaryByConfigRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4352,26 +2806,6 @@ export const de_GetComplianceSummaryByConfigRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetComplianceSummaryByConfigRuleCommandError - */ -const de_GetComplianceSummaryByConfigRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1GetComplianceSummaryByResourceTypeCommand */ @@ -4380,7 +2814,7 @@ export const de_GetComplianceSummaryByResourceTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetComplianceSummaryByResourceTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4392,32 +2826,6 @@ export const de_GetComplianceSummaryByResourceTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetComplianceSummaryByResourceTypeCommandError - */ -const de_GetComplianceSummaryByResourceTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetConformancePackComplianceDetailsCommand */ @@ -4426,7 +2834,7 @@ export const de_GetConformancePackComplianceDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetConformancePackComplianceDetailsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4439,52 +2847,14 @@ export const de_GetConformancePackComplianceDetailsCommand = async ( }; /** - * deserializeAws_json1_1GetConformancePackComplianceDetailsCommandError + * deserializeAws_json1_1GetConformancePackComplianceSummaryCommand */ -const de_GetConformancePackComplianceDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoSuchConfigRuleInConformancePackException": - case "com.amazonaws.configservice#NoSuchConfigRuleInConformancePackException": - throw await de_NoSuchConfigRuleInConformancePackExceptionRes(parsedOutput, context); - case "NoSuchConformancePackException": - case "com.amazonaws.configservice#NoSuchConformancePackException": - throw await de_NoSuchConformancePackExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetConformancePackComplianceSummaryCommand - */ -export const de_GetConformancePackComplianceSummaryCommand = async ( +export const de_GetConformancePackComplianceSummaryCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetConformancePackComplianceSummaryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4496,38 +2866,6 @@ export const de_GetConformancePackComplianceSummaryCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetConformancePackComplianceSummaryCommandError - */ -const de_GetConformancePackComplianceSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoSuchConformancePackException": - case "com.amazonaws.configservice#NoSuchConformancePackException": - throw await de_NoSuchConformancePackExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetCustomRulePolicyCommand */ @@ -4536,7 +2874,7 @@ export const de_GetCustomRulePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCustomRulePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4548,32 +2886,6 @@ export const de_GetCustomRulePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCustomRulePolicyCommandError - */ -const de_GetCustomRulePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchConfigRuleException": - case "com.amazonaws.configservice#NoSuchConfigRuleException": - throw await de_NoSuchConfigRuleExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetDiscoveredResourceCountsCommand */ @@ -4582,7 +2894,7 @@ export const de_GetDiscoveredResourceCountsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDiscoveredResourceCountsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4594,38 +2906,6 @@ export const de_GetDiscoveredResourceCountsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetDiscoveredResourceCountsCommandError - */ -const de_GetDiscoveredResourceCountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetOrganizationConfigRuleDetailedStatusCommand */ @@ -4634,7 +2914,7 @@ export const de_GetOrganizationConfigRuleDetailedStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetOrganizationConfigRuleDetailedStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4646,41 +2926,6 @@ export const de_GetOrganizationConfigRuleDetailedStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetOrganizationConfigRuleDetailedStatusCommandError - */ -const de_GetOrganizationConfigRuleDetailedStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoSuchOrganizationConfigRuleException": - case "com.amazonaws.configservice#NoSuchOrganizationConfigRuleException": - throw await de_NoSuchOrganizationConfigRuleExceptionRes(parsedOutput, context); - case "OrganizationAccessDeniedException": - case "com.amazonaws.configservice#OrganizationAccessDeniedException": - throw await de_OrganizationAccessDeniedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetOrganizationConformancePackDetailedStatusCommand */ @@ -4689,7 +2934,7 @@ export const de_GetOrganizationConformancePackDetailedStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetOrganizationConformancePackDetailedStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4701,41 +2946,6 @@ export const de_GetOrganizationConformancePackDetailedStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetOrganizationConformancePackDetailedStatusCommandError - */ -const de_GetOrganizationConformancePackDetailedStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoSuchOrganizationConformancePackException": - case "com.amazonaws.configservice#NoSuchOrganizationConformancePackException": - throw await de_NoSuchOrganizationConformancePackExceptionRes(parsedOutput, context); - case "OrganizationAccessDeniedException": - case "com.amazonaws.configservice#OrganizationAccessDeniedException": - throw await de_OrganizationAccessDeniedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetOrganizationCustomRulePolicyCommand */ @@ -4744,7 +2954,7 @@ export const de_GetOrganizationCustomRulePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetOrganizationCustomRulePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4756,35 +2966,6 @@ export const de_GetOrganizationCustomRulePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetOrganizationCustomRulePolicyCommandError - */ -const de_GetOrganizationCustomRulePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchOrganizationConfigRuleException": - case "com.amazonaws.configservice#NoSuchOrganizationConfigRuleException": - throw await de_NoSuchOrganizationConfigRuleExceptionRes(parsedOutput, context); - case "OrganizationAccessDeniedException": - case "com.amazonaws.configservice#OrganizationAccessDeniedException": - throw await de_OrganizationAccessDeniedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetResourceConfigHistoryCommand */ @@ -4793,7 +2974,7 @@ export const de_GetResourceConfigHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetResourceConfigHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4805,47 +2986,6 @@ export const de_GetResourceConfigHistoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetResourceConfigHistoryCommandError - */ -const de_GetResourceConfigHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidTimeRangeException": - case "com.amazonaws.configservice#InvalidTimeRangeException": - throw await de_InvalidTimeRangeExceptionRes(parsedOutput, context); - case "NoAvailableConfigurationRecorderException": - case "com.amazonaws.configservice#NoAvailableConfigurationRecorderException": - throw await de_NoAvailableConfigurationRecorderExceptionRes(parsedOutput, context); - case "ResourceNotDiscoveredException": - case "com.amazonaws.configservice#ResourceNotDiscoveredException": - throw await de_ResourceNotDiscoveredExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetResourceEvaluationSummaryCommand */ @@ -4854,7 +2994,7 @@ export const de_GetResourceEvaluationSummaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetResourceEvaluationSummaryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4867,40 +3007,14 @@ export const de_GetResourceEvaluationSummaryCommand = async ( }; /** - * deserializeAws_json1_1GetResourceEvaluationSummaryCommandError + * deserializeAws_json1_1GetStoredQueryCommand */ -const de_GetResourceEvaluationSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.configservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetStoredQueryCommand - */ -export const de_GetStoredQueryCommand = async ( +export const de_GetStoredQueryCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetStoredQueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4912,35 +3026,6 @@ export const de_GetStoredQueryCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetStoredQueryCommandError - */ -const de_GetStoredQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.configservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAggregateDiscoveredResourcesCommand */ @@ -4949,7 +3034,7 @@ export const de_ListAggregateDiscoveredResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAggregateDiscoveredResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4961,41 +3046,6 @@ export const de_ListAggregateDiscoveredResourcesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAggregateDiscoveredResourcesCommandError - */ -const de_ListAggregateDiscoveredResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoSuchConfigurationAggregatorException": - case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": - throw await de_NoSuchConfigurationAggregatorExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListConformancePackComplianceScoresCommand */ @@ -5004,7 +3054,7 @@ export const de_ListConformancePackComplianceScoresCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListConformancePackComplianceScoresCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5016,38 +3066,6 @@ export const de_ListConformancePackComplianceScoresCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListConformancePackComplianceScoresCommandError - */ -const de_ListConformancePackComplianceScoresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListDiscoveredResourcesCommand */ @@ -5056,7 +3074,7 @@ export const de_ListDiscoveredResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListDiscoveredResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5068,41 +3086,6 @@ export const de_ListDiscoveredResourcesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListDiscoveredResourcesCommandError - */ -const de_ListDiscoveredResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoAvailableConfigurationRecorderException": - case "com.amazonaws.configservice#NoAvailableConfigurationRecorderException": - throw await de_NoAvailableConfigurationRecorderExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListResourceEvaluationsCommand */ @@ -5111,7 +3094,7 @@ export const de_ListResourceEvaluationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListResourceEvaluationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5123,38 +3106,6 @@ export const de_ListResourceEvaluationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListResourceEvaluationsCommandError - */ -const de_ListResourceEvaluationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidTimeRangeException": - case "com.amazonaws.configservice#InvalidTimeRangeException": - throw await de_InvalidTimeRangeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListStoredQueriesCommand */ @@ -5163,7 +3114,7 @@ export const de_ListStoredQueriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStoredQueriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5175,35 +3126,6 @@ export const de_ListStoredQueriesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListStoredQueriesCommandError - */ -const de_ListStoredQueriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -5212,7 +3134,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5224,41 +3146,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.configservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutAggregationAuthorizationCommand */ @@ -5267,7 +3154,7 @@ export const de_PutAggregationAuthorizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutAggregationAuthorizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5279,32 +3166,6 @@ export const de_PutAggregationAuthorizationCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutAggregationAuthorizationCommandError - */ -const de_PutAggregationAuthorizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutConfigRuleCommand */ @@ -5313,7 +3174,7 @@ export const de_PutConfigRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutConfigRuleCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutConfigRuleCommandOutput = { @@ -5323,52 +3184,14 @@ export const de_PutConfigRuleCommand = async ( }; /** - * deserializeAws_json1_1PutConfigRuleCommandError + * deserializeAws_json1_1PutConfigurationAggregatorCommand */ -const de_PutConfigRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPermissionsException": - case "com.amazonaws.configservice#InsufficientPermissionsException": - throw await de_InsufficientPermissionsExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MaxNumberOfConfigRulesExceededException": - case "com.amazonaws.configservice#MaxNumberOfConfigRulesExceededException": - throw await de_MaxNumberOfConfigRulesExceededExceptionRes(parsedOutput, context); - case "NoAvailableConfigurationRecorderException": - case "com.amazonaws.configservice#NoAvailableConfigurationRecorderException": - throw await de_NoAvailableConfigurationRecorderExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.configservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutConfigurationAggregatorCommand - */ -export const de_PutConfigurationAggregatorCommand = async ( +export const de_PutConfigurationAggregatorCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutConfigurationAggregatorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5380,47 +3203,6 @@ export const de_PutConfigurationAggregatorCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutConfigurationAggregatorCommandError - */ -const de_PutConfigurationAggregatorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.configservice#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.configservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoAvailableOrganizationException": - case "com.amazonaws.configservice#NoAvailableOrganizationException": - throw await de_NoAvailableOrganizationExceptionRes(parsedOutput, context); - case "OrganizationAccessDeniedException": - case "com.amazonaws.configservice#OrganizationAccessDeniedException": - throw await de_OrganizationAccessDeniedExceptionRes(parsedOutput, context); - case "OrganizationAllFeaturesNotEnabledException": - case "com.amazonaws.configservice#OrganizationAllFeaturesNotEnabledException": - throw await de_OrganizationAllFeaturesNotEnabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutConfigurationRecorderCommand */ @@ -5429,7 +3211,7 @@ export const de_PutConfigurationRecorderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutConfigurationRecorderCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutConfigurationRecorderCommandOutput = { @@ -5438,44 +3220,6 @@ export const de_PutConfigurationRecorderCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutConfigurationRecorderCommandError - */ -const de_PutConfigurationRecorderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidConfigurationRecorderNameException": - case "com.amazonaws.configservice#InvalidConfigurationRecorderNameException": - throw await de_InvalidConfigurationRecorderNameExceptionRes(parsedOutput, context); - case "InvalidRecordingGroupException": - case "com.amazonaws.configservice#InvalidRecordingGroupException": - throw await de_InvalidRecordingGroupExceptionRes(parsedOutput, context); - case "InvalidRoleException": - case "com.amazonaws.configservice#InvalidRoleException": - throw await de_InvalidRoleExceptionRes(parsedOutput, context); - case "MaxNumberOfConfigurationRecordersExceededException": - case "com.amazonaws.configservice#MaxNumberOfConfigurationRecordersExceededException": - throw await de_MaxNumberOfConfigurationRecordersExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutConformancePackCommand */ @@ -5484,7 +3228,7 @@ export const de_PutConformancePackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutConformancePackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5496,44 +3240,6 @@ export const de_PutConformancePackCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutConformancePackCommandError - */ -const de_PutConformancePackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConformancePackTemplateValidationException": - case "com.amazonaws.configservice#ConformancePackTemplateValidationException": - throw await de_ConformancePackTemplateValidationExceptionRes(parsedOutput, context); - case "InsufficientPermissionsException": - case "com.amazonaws.configservice#InsufficientPermissionsException": - throw await de_InsufficientPermissionsExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MaxNumberOfConformancePacksExceededException": - case "com.amazonaws.configservice#MaxNumberOfConformancePacksExceededException": - throw await de_MaxNumberOfConformancePacksExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.configservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutDeliveryChannelCommand */ @@ -5542,7 +3248,7 @@ export const de_PutDeliveryChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutDeliveryChannelCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutDeliveryChannelCommandOutput = { @@ -5551,53 +3257,6 @@ export const de_PutDeliveryChannelCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutDeliveryChannelCommandError - */ -const de_PutDeliveryChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientDeliveryPolicyException": - case "com.amazonaws.configservice#InsufficientDeliveryPolicyException": - throw await de_InsufficientDeliveryPolicyExceptionRes(parsedOutput, context); - case "InvalidDeliveryChannelNameException": - case "com.amazonaws.configservice#InvalidDeliveryChannelNameException": - throw await de_InvalidDeliveryChannelNameExceptionRes(parsedOutput, context); - case "InvalidS3KeyPrefixException": - case "com.amazonaws.configservice#InvalidS3KeyPrefixException": - throw await de_InvalidS3KeyPrefixExceptionRes(parsedOutput, context); - case "InvalidS3KmsKeyArnException": - case "com.amazonaws.configservice#InvalidS3KmsKeyArnException": - throw await de_InvalidS3KmsKeyArnExceptionRes(parsedOutput, context); - case "InvalidSNSTopicARNException": - case "com.amazonaws.configservice#InvalidSNSTopicARNException": - throw await de_InvalidSNSTopicARNExceptionRes(parsedOutput, context); - case "MaxNumberOfDeliveryChannelsExceededException": - case "com.amazonaws.configservice#MaxNumberOfDeliveryChannelsExceededException": - throw await de_MaxNumberOfDeliveryChannelsExceededExceptionRes(parsedOutput, context); - case "NoAvailableConfigurationRecorderException": - case "com.amazonaws.configservice#NoAvailableConfigurationRecorderException": - throw await de_NoAvailableConfigurationRecorderExceptionRes(parsedOutput, context); - case "NoSuchBucketException": - case "com.amazonaws.configservice#NoSuchBucketException": - throw await de_NoSuchBucketExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutEvaluationsCommand */ @@ -5606,7 +3265,7 @@ export const de_PutEvaluationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutEvaluationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5618,38 +3277,6 @@ export const de_PutEvaluationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutEvaluationsCommandError - */ -const de_PutEvaluationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidResultTokenException": - case "com.amazonaws.configservice#InvalidResultTokenException": - throw await de_InvalidResultTokenExceptionRes(parsedOutput, context); - case "NoSuchConfigRuleException": - case "com.amazonaws.configservice#NoSuchConfigRuleException": - throw await de_NoSuchConfigRuleExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutExternalEvaluationCommand */ @@ -5658,7 +3285,7 @@ export const de_PutExternalEvaluationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutExternalEvaluationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5671,48 +3298,39 @@ export const de_PutExternalEvaluationCommand = async ( }; /** - * deserializeAws_json1_1PutExternalEvaluationCommandError + * deserializeAws_json1_1PutOrganizationConfigRuleCommand */ -const de_PutExternalEvaluationCommandError = async ( +export const de_PutOrganizationConfigRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoSuchConfigRuleException": - case "com.amazonaws.configservice#NoSuchConfigRuleException": - throw await de_NoSuchConfigRuleExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutOrganizationConfigRuleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutOrganizationConfigRuleCommand + * deserializeAws_json1_1PutOrganizationConformancePackCommand */ -export const de_PutOrganizationConfigRuleCommand = async ( +export const de_PutOrganizationConformancePackCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutOrganizationConfigRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutOrganizationConfigRuleCommandOutput = { + const response: PutOrganizationConformancePackCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5720,128 +3338,14 @@ export const de_PutOrganizationConfigRuleCommand = async ( }; /** - * deserializeAws_json1_1PutOrganizationConfigRuleCommandError + * deserializeAws_json1_1PutRemediationConfigurationsCommand */ -const de_PutOrganizationConfigRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPermissionsException": - case "com.amazonaws.configservice#InsufficientPermissionsException": - throw await de_InsufficientPermissionsExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MaxNumberOfOrganizationConfigRulesExceededException": - case "com.amazonaws.configservice#MaxNumberOfOrganizationConfigRulesExceededException": - throw await de_MaxNumberOfOrganizationConfigRulesExceededExceptionRes(parsedOutput, context); - case "NoAvailableOrganizationException": - case "com.amazonaws.configservice#NoAvailableOrganizationException": - throw await de_NoAvailableOrganizationExceptionRes(parsedOutput, context); - case "OrganizationAccessDeniedException": - case "com.amazonaws.configservice#OrganizationAccessDeniedException": - throw await de_OrganizationAccessDeniedExceptionRes(parsedOutput, context); - case "OrganizationAllFeaturesNotEnabledException": - case "com.amazonaws.configservice#OrganizationAllFeaturesNotEnabledException": - throw await de_OrganizationAllFeaturesNotEnabledExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.configservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutOrganizationConformancePackCommand - */ -export const de_PutOrganizationConformancePackCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutOrganizationConformancePackCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutOrganizationConformancePackCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutOrganizationConformancePackCommandError - */ -const de_PutOrganizationConformancePackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPermissionsException": - case "com.amazonaws.configservice#InsufficientPermissionsException": - throw await de_InsufficientPermissionsExceptionRes(parsedOutput, context); - case "MaxNumberOfOrganizationConformancePacksExceededException": - case "com.amazonaws.configservice#MaxNumberOfOrganizationConformancePacksExceededException": - throw await de_MaxNumberOfOrganizationConformancePacksExceededExceptionRes(parsedOutput, context); - case "NoAvailableOrganizationException": - case "com.amazonaws.configservice#NoAvailableOrganizationException": - throw await de_NoAvailableOrganizationExceptionRes(parsedOutput, context); - case "OrganizationAccessDeniedException": - case "com.amazonaws.configservice#OrganizationAccessDeniedException": - throw await de_OrganizationAccessDeniedExceptionRes(parsedOutput, context); - case "OrganizationAllFeaturesNotEnabledException": - case "com.amazonaws.configservice#OrganizationAllFeaturesNotEnabledException": - throw await de_OrganizationAllFeaturesNotEnabledExceptionRes(parsedOutput, context); - case "OrganizationConformancePackTemplateValidationException": - case "com.amazonaws.configservice#OrganizationConformancePackTemplateValidationException": - throw await de_OrganizationConformancePackTemplateValidationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.configservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutRemediationConfigurationsCommand - */ -export const de_PutRemediationConfigurationsCommand = async ( +export const de_PutRemediationConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutRemediationConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5853,35 +3357,6 @@ export const de_PutRemediationConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutRemediationConfigurationsCommandError - */ -const de_PutRemediationConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPermissionsException": - case "com.amazonaws.configservice#InsufficientPermissionsException": - throw await de_InsufficientPermissionsExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutRemediationExceptionsCommand */ @@ -5890,7 +3365,7 @@ export const de_PutRemediationExceptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutRemediationExceptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5902,35 +3377,6 @@ export const de_PutRemediationExceptionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutRemediationExceptionsCommandError - */ -const de_PutRemediationExceptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPermissionsException": - case "com.amazonaws.configservice#InsufficientPermissionsException": - throw await de_InsufficientPermissionsExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutResourceConfigCommand */ @@ -5939,7 +3385,7 @@ export const de_PutResourceConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutResourceConfigCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutResourceConfigCommandOutput = { @@ -5948,41 +3394,6 @@ export const de_PutResourceConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutResourceConfigCommandError - */ -const de_PutResourceConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPermissionsException": - case "com.amazonaws.configservice#InsufficientPermissionsException": - throw await de_InsufficientPermissionsExceptionRes(parsedOutput, context); - case "MaxActiveResourcesExceededException": - case "com.amazonaws.configservice#MaxActiveResourcesExceededException": - throw await de_MaxActiveResourcesExceededExceptionRes(parsedOutput, context); - case "NoRunningConfigurationRecorderException": - case "com.amazonaws.configservice#NoRunningConfigurationRecorderException": - throw await de_NoRunningConfigurationRecorderExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutRetentionConfigurationCommand */ @@ -5991,7 +3402,7 @@ export const de_PutRetentionConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutRetentionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6003,35 +3414,6 @@ export const de_PutRetentionConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutRetentionConfigurationCommandError - */ -const de_PutRetentionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MaxNumberOfRetentionConfigurationsExceededException": - case "com.amazonaws.configservice#MaxNumberOfRetentionConfigurationsExceededException": - throw await de_MaxNumberOfRetentionConfigurationsExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutStoredQueryCommand */ @@ -6040,7 +3422,7 @@ export const de_PutStoredQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutStoredQueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6052,38 +3434,6 @@ export const de_PutStoredQueryCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutStoredQueryCommandError - */ -const de_PutStoredQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceConcurrentModificationException": - case "com.amazonaws.configservice#ResourceConcurrentModificationException": - throw await de_ResourceConcurrentModificationExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.configservice#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SelectAggregateResourceConfigCommand */ @@ -6092,7 +3442,7 @@ export const de_SelectAggregateResourceConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SelectAggregateResourceConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6105,49 +3455,14 @@ export const de_SelectAggregateResourceConfigCommand = async ( }; /** - * deserializeAws_json1_1SelectAggregateResourceConfigCommandError + * deserializeAws_json1_1SelectResourceConfigCommand */ -const de_SelectAggregateResourceConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidExpressionException": - case "com.amazonaws.configservice#InvalidExpressionException": - throw await de_InvalidExpressionExceptionRes(parsedOutput, context); - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "NoSuchConfigurationAggregatorException": - case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": - throw await de_NoSuchConfigurationAggregatorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1SelectResourceConfigCommand - */ -export const de_SelectResourceConfigCommand = async ( +export const de_SelectResourceConfigCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SelectResourceConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6159,38 +3474,6 @@ export const de_SelectResourceConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1SelectResourceConfigCommandError - */ -const de_SelectResourceConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidExpressionException": - case "com.amazonaws.configservice#InvalidExpressionException": - throw await de_InvalidExpressionExceptionRes(parsedOutput, context); - case "InvalidLimitException": - case "com.amazonaws.configservice#InvalidLimitException": - throw await de_InvalidLimitExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.configservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartConfigRulesEvaluationCommand */ @@ -6199,7 +3482,7 @@ export const de_StartConfigRulesEvaluationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartConfigRulesEvaluationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6211,41 +3494,6 @@ export const de_StartConfigRulesEvaluationCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartConfigRulesEvaluationCommandError - */ -const de_StartConfigRulesEvaluationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.configservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchConfigRuleException": - case "com.amazonaws.configservice#NoSuchConfigRuleException": - throw await de_NoSuchConfigRuleExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.configservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartConfigurationRecorderCommand */ @@ -6254,7 +3502,7 @@ export const de_StartConfigurationRecorderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartConfigurationRecorderCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StartConfigurationRecorderCommandOutput = { @@ -6263,35 +3511,6 @@ export const de_StartConfigurationRecorderCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartConfigurationRecorderCommandError - */ -const de_StartConfigurationRecorderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoAvailableDeliveryChannelException": - case "com.amazonaws.configservice#NoAvailableDeliveryChannelException": - throw await de_NoAvailableDeliveryChannelExceptionRes(parsedOutput, context); - case "NoSuchConfigurationRecorderException": - case "com.amazonaws.configservice#NoSuchConfigurationRecorderException": - throw await de_NoSuchConfigurationRecorderExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartRemediationExecutionCommand */ @@ -6300,7 +3519,7 @@ export const de_StartRemediationExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartRemediationExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6312,38 +3531,6 @@ export const de_StartRemediationExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartRemediationExecutionCommandError - */ -const de_StartRemediationExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPermissionsException": - case "com.amazonaws.configservice#InsufficientPermissionsException": - throw await de_InsufficientPermissionsExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoSuchRemediationConfigurationException": - case "com.amazonaws.configservice#NoSuchRemediationConfigurationException": - throw await de_NoSuchRemediationConfigurationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartResourceEvaluationCommand */ @@ -6352,7 +3539,7 @@ export const de_StartResourceEvaluationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartResourceEvaluationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6364,35 +3551,6 @@ export const de_StartResourceEvaluationCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartResourceEvaluationCommandError - */ -const de_StartResourceEvaluationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatch": - case "com.amazonaws.configservice#IdempotentParameterMismatch": - throw await de_IdempotentParameterMismatchRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.configservice#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopConfigurationRecorderCommand */ @@ -6401,7 +3559,7 @@ export const de_StopConfigurationRecorderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopConfigurationRecorderCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopConfigurationRecorderCommandOutput = { @@ -6410,32 +3568,6 @@ export const de_StopConfigurationRecorderCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopConfigurationRecorderCommandError - */ -const de_StopConfigurationRecorderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchConfigurationRecorderException": - case "com.amazonaws.configservice#NoSuchConfigurationRecorderException": - throw await de_NoSuchConfigurationRecorderExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -6444,7 +3576,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: TagResourceCommandOutput = { @@ -6453,38 +3585,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.configservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.configservice#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.configservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -6493,7 +3593,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UntagResourceCommandOutput = { @@ -6503,31 +3603,184 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.configservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "NoSuchConfigurationAggregatorException": + case "com.amazonaws.configservice#NoSuchConfigurationAggregatorException": + throw await de_NoSuchConfigurationAggregatorExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.configservice#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "NoAvailableConfigurationRecorderException": + case "com.amazonaws.configservice#NoAvailableConfigurationRecorderException": + throw await de_NoAvailableConfigurationRecorderExceptionRes(parsedOutput, context); + case "InvalidParameterValueException": + case "com.amazonaws.configservice#InvalidParameterValueException": + throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); + case "NoSuchConfigRuleException": + case "com.amazonaws.configservice#NoSuchConfigRuleException": + throw await de_NoSuchConfigRuleExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.configservice#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); + case "NoSuchConfigurationRecorderException": + case "com.amazonaws.configservice#NoSuchConfigurationRecorderException": + throw await de_NoSuchConfigurationRecorderExceptionRes(parsedOutput, context); + case "NoSuchConformancePackException": + case "com.amazonaws.configservice#NoSuchConformancePackException": + throw await de_NoSuchConformancePackExceptionRes(parsedOutput, context); + case "LastDeliveryChannelDeleteFailedException": + case "com.amazonaws.configservice#LastDeliveryChannelDeleteFailedException": + throw await de_LastDeliveryChannelDeleteFailedExceptionRes(parsedOutput, context); + case "NoSuchDeliveryChannelException": + case "com.amazonaws.configservice#NoSuchDeliveryChannelException": + throw await de_NoSuchDeliveryChannelExceptionRes(parsedOutput, context); + case "NoSuchOrganizationConfigRuleException": + case "com.amazonaws.configservice#NoSuchOrganizationConfigRuleException": + throw await de_NoSuchOrganizationConfigRuleExceptionRes(parsedOutput, context); + case "OrganizationAccessDeniedException": + case "com.amazonaws.configservice#OrganizationAccessDeniedException": + throw await de_OrganizationAccessDeniedExceptionRes(parsedOutput, context); + case "NoSuchOrganizationConformancePackException": + case "com.amazonaws.configservice#NoSuchOrganizationConformancePackException": + throw await de_NoSuchOrganizationConformancePackExceptionRes(parsedOutput, context); + case "InsufficientPermissionsException": + case "com.amazonaws.configservice#InsufficientPermissionsException": + throw await de_InsufficientPermissionsExceptionRes(parsedOutput, context); + case "NoSuchRemediationConfigurationException": + case "com.amazonaws.configservice#NoSuchRemediationConfigurationException": + throw await de_NoSuchRemediationConfigurationExceptionRes(parsedOutput, context); + case "RemediationInProgressException": + case "com.amazonaws.configservice#RemediationInProgressException": + throw await de_RemediationInProgressExceptionRes(parsedOutput, context); + case "NoSuchRemediationExceptionException": + case "com.amazonaws.configservice#NoSuchRemediationExceptionException": + throw await de_NoSuchRemediationExceptionExceptionRes(parsedOutput, context); + case "NoRunningConfigurationRecorderException": + case "com.amazonaws.configservice#NoRunningConfigurationRecorderException": + throw await de_NoRunningConfigurationRecorderExceptionRes(parsedOutput, context); + case "NoSuchRetentionConfigurationException": + case "com.amazonaws.configservice#NoSuchRetentionConfigurationException": + throw await de_NoSuchRetentionConfigurationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.configservice#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "InvalidLimitException": + case "com.amazonaws.configservice#InvalidLimitException": + throw await de_InvalidLimitExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.configservice#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "NoSuchConfigRuleInConformancePackException": + case "com.amazonaws.configservice#NoSuchConfigRuleInConformancePackException": + throw await de_NoSuchConfigRuleInConformancePackExceptionRes(parsedOutput, context); + case "OversizedConfigurationItemException": + case "com.amazonaws.configservice#OversizedConfigurationItemException": + throw await de_OversizedConfigurationItemExceptionRes(parsedOutput, context); + case "ResourceNotDiscoveredException": + case "com.amazonaws.configservice#ResourceNotDiscoveredException": + throw await de_ResourceNotDiscoveredExceptionRes(parsedOutput, context); + case "InvalidTimeRangeException": + case "com.amazonaws.configservice#InvalidTimeRangeException": + throw await de_InvalidTimeRangeExceptionRes(parsedOutput, context); + case "MaxNumberOfConfigRulesExceededException": + case "com.amazonaws.configservice#MaxNumberOfConfigRulesExceededException": + throw await de_MaxNumberOfConfigRulesExceededExceptionRes(parsedOutput, context); + case "InvalidRoleException": + case "com.amazonaws.configservice#InvalidRoleException": + throw await de_InvalidRoleExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.configservice#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "NoAvailableOrganizationException": + case "com.amazonaws.configservice#NoAvailableOrganizationException": + throw await de_NoAvailableOrganizationExceptionRes(parsedOutput, context); + case "OrganizationAllFeaturesNotEnabledException": + case "com.amazonaws.configservice#OrganizationAllFeaturesNotEnabledException": + throw await de_OrganizationAllFeaturesNotEnabledExceptionRes(parsedOutput, context); + case "InvalidConfigurationRecorderNameException": + case "com.amazonaws.configservice#InvalidConfigurationRecorderNameException": + throw await de_InvalidConfigurationRecorderNameExceptionRes(parsedOutput, context); + case "InvalidRecordingGroupException": + case "com.amazonaws.configservice#InvalidRecordingGroupException": + throw await de_InvalidRecordingGroupExceptionRes(parsedOutput, context); + case "MaxNumberOfConfigurationRecordersExceededException": + case "com.amazonaws.configservice#MaxNumberOfConfigurationRecordersExceededException": + throw await de_MaxNumberOfConfigurationRecordersExceededExceptionRes(parsedOutput, context); + case "ConformancePackTemplateValidationException": + case "com.amazonaws.configservice#ConformancePackTemplateValidationException": + throw await de_ConformancePackTemplateValidationExceptionRes(parsedOutput, context); + case "MaxNumberOfConformancePacksExceededException": + case "com.amazonaws.configservice#MaxNumberOfConformancePacksExceededException": + throw await de_MaxNumberOfConformancePacksExceededExceptionRes(parsedOutput, context); + case "InsufficientDeliveryPolicyException": + case "com.amazonaws.configservice#InsufficientDeliveryPolicyException": + throw await de_InsufficientDeliveryPolicyExceptionRes(parsedOutput, context); + case "InvalidDeliveryChannelNameException": + case "com.amazonaws.configservice#InvalidDeliveryChannelNameException": + throw await de_InvalidDeliveryChannelNameExceptionRes(parsedOutput, context); + case "InvalidS3KeyPrefixException": + case "com.amazonaws.configservice#InvalidS3KeyPrefixException": + throw await de_InvalidS3KeyPrefixExceptionRes(parsedOutput, context); + case "InvalidS3KmsKeyArnException": + case "com.amazonaws.configservice#InvalidS3KmsKeyArnException": + throw await de_InvalidS3KmsKeyArnExceptionRes(parsedOutput, context); + case "InvalidSNSTopicARNException": + case "com.amazonaws.configservice#InvalidSNSTopicARNException": + throw await de_InvalidSNSTopicARNExceptionRes(parsedOutput, context); + case "MaxNumberOfDeliveryChannelsExceededException": + case "com.amazonaws.configservice#MaxNumberOfDeliveryChannelsExceededException": + throw await de_MaxNumberOfDeliveryChannelsExceededExceptionRes(parsedOutput, context); + case "NoSuchBucketException": + case "com.amazonaws.configservice#NoSuchBucketException": + throw await de_NoSuchBucketExceptionRes(parsedOutput, context); + case "InvalidResultTokenException": + case "com.amazonaws.configservice#InvalidResultTokenException": + throw await de_InvalidResultTokenExceptionRes(parsedOutput, context); + case "MaxNumberOfOrganizationConfigRulesExceededException": + case "com.amazonaws.configservice#MaxNumberOfOrganizationConfigRulesExceededException": + throw await de_MaxNumberOfOrganizationConfigRulesExceededExceptionRes(parsedOutput, context); + case "MaxNumberOfOrganizationConformancePacksExceededException": + case "com.amazonaws.configservice#MaxNumberOfOrganizationConformancePacksExceededException": + throw await de_MaxNumberOfOrganizationConformancePacksExceededExceptionRes(parsedOutput, context); + case "OrganizationConformancePackTemplateValidationException": + case "com.amazonaws.configservice#OrganizationConformancePackTemplateValidationException": + throw await de_OrganizationConformancePackTemplateValidationExceptionRes(parsedOutput, context); + case "MaxActiveResourcesExceededException": + case "com.amazonaws.configservice#MaxActiveResourcesExceededException": + throw await de_MaxActiveResourcesExceededExceptionRes(parsedOutput, context); + case "MaxNumberOfRetentionConfigurationsExceededException": + case "com.amazonaws.configservice#MaxNumberOfRetentionConfigurationsExceededException": + throw await de_MaxNumberOfRetentionConfigurationsExceededExceptionRes(parsedOutput, context); + case "ResourceConcurrentModificationException": + case "com.amazonaws.configservice#ResourceConcurrentModificationException": + throw await de_ResourceConcurrentModificationExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.configservice#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "InvalidExpressionException": + case "com.amazonaws.configservice#InvalidExpressionException": + throw await de_InvalidExpressionExceptionRes(parsedOutput, context); + case "NoAvailableDeliveryChannelException": + case "com.amazonaws.configservice#NoAvailableDeliveryChannelException": + throw await de_NoAvailableDeliveryChannelExceptionRes(parsedOutput, context); + case "IdempotentParameterMismatch": + case "com.amazonaws.configservice#IdempotentParameterMismatch": + throw await de_IdempotentParameterMismatchRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts b/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts index a57287023cb3..b4c5f8da0119 100644 --- a/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts +++ b/clients/client-connect-contact-lens/src/protocols/Aws_restJson1.ts @@ -64,7 +64,7 @@ export const de_ListRealtimeContactAnalysisSegmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRealtimeContactAnalysisSegmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -79,12 +79,9 @@ export const de_ListRealtimeContactAnalysisSegmentsCommand = async ( }; /** - * deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_ListRealtimeContactAnalysisSegmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -112,7 +109,7 @@ const de_ListRealtimeContactAnalysisSegmentsCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-connect/src/protocols/Aws_restJson1.ts b/clients/client-connect/src/protocols/Aws_restJson1.ts index dc490bc4189c..1757ecefc71c 100644 --- a/clients/client-connect/src/protocols/Aws_restJson1.ts +++ b/clients/client-connect/src/protocols/Aws_restJson1.ts @@ -6461,7 +6461,7 @@ export const de_ActivateEvaluationFormCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ActivateEvaluationFormCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6476,44 +6476,6 @@ export const de_ActivateEvaluationFormCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ActivateEvaluationFormCommandError - */ -const de_ActivateEvaluationFormCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateAnalyticsDataSetCommand */ @@ -6522,7 +6484,7 @@ export const de_AssociateAnalyticsDataSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateAnalyticsDataSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6538,44 +6500,6 @@ export const de_AssociateAnalyticsDataSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateAnalyticsDataSetCommandError - */ -const de_AssociateAnalyticsDataSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateApprovedOriginCommand */ @@ -6584,7 +6508,7 @@ export const de_AssociateApprovedOriginCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateApprovedOriginCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6593,50 +6517,6 @@ export const de_AssociateApprovedOriginCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateApprovedOriginCommandError - */ -const de_AssociateApprovedOriginCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateBotCommand */ @@ -6645,7 +6525,7 @@ export const de_AssociateBotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateBotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6654,50 +6534,6 @@ export const de_AssociateBotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateBotCommandError - */ -const de_AssociateBotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateDefaultVocabularyCommand */ @@ -6706,7 +6542,7 @@ export const de_AssociateDefaultVocabularyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateDefaultVocabularyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6716,172 +6552,86 @@ export const de_AssociateDefaultVocabularyCommand = async ( }; /** - * deserializeAws_restJson1AssociateDefaultVocabularyCommandError + * deserializeAws_restJson1AssociateFlowCommand */ -const de_AssociateDefaultVocabularyCommandError = async ( +export const de_AssociateFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1AssociateFlowCommand + * deserializeAws_restJson1AssociateInstanceStorageConfigCommand */ -export const de_AssociateFlowCommand = async ( +export const de_AssociateInstanceStorageConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AssociationId: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1AssociateFlowCommandError + * deserializeAws_restJson1AssociateLambdaFunctionCommand */ -const de_AssociateFlowCommandError = async ( +export const de_AssociateLambdaFunctionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1AssociateInstanceStorageConfigCommand + * deserializeAws_restJson1AssociateLexBotCommand */ -export const de_AssociateInstanceStorageConfigCommand = async ( +export const de_AssociateLexBotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateInstanceStorageConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AssociationId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1AssociateInstanceStorageConfigCommandError + * deserializeAws_restJson1AssociatePhoneNumberContactFlowCommand */ -const de_AssociateInstanceStorageConfigCommandError = async ( +export const de_AssociatePhoneNumberContactFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1AssociateLambdaFunctionCommand - */ -export const de_AssociateLambdaFunctionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateLambdaFunctionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6891,58 +6641,31 @@ export const de_AssociateLambdaFunctionCommand = async ( }; /** - * deserializeAws_restJson1AssociateLambdaFunctionCommandError + * deserializeAws_restJson1AssociateQueueQuickConnectsCommand */ -const de_AssociateLambdaFunctionCommandError = async ( +export const de_AssociateQueueQuickConnectsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1AssociateLexBotCommand + * deserializeAws_restJson1AssociateRoutingProfileQueuesCommand */ -export const de_AssociateLexBotCommand = async ( +export const de_AssociateRoutingProfileQueuesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateLexBotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6952,58 +6675,35 @@ export const de_AssociateLexBotCommand = async ( }; /** - * deserializeAws_restJson1AssociateLexBotCommandError + * deserializeAws_restJson1AssociateSecurityKeyCommand */ -const de_AssociateLexBotCommandError = async ( +export const de_AssociateSecurityKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AssociationId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1AssociatePhoneNumberContactFlowCommand + * deserializeAws_restJson1AssociateTrafficDistributionGroupUserCommand */ -export const de_AssociatePhoneNumberContactFlowCommand = async ( +export const de_AssociateTrafficDistributionGroupUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociatePhoneNumberContactFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7013,786 +6713,486 @@ export const de_AssociatePhoneNumberContactFlowCommand = async ( }; /** - * deserializeAws_restJson1AssociatePhoneNumberContactFlowCommandError + * deserializeAws_restJson1AssociateUserProficienciesCommand */ -const de_AssociatePhoneNumberContactFlowCommandError = async ( +export const de_AssociateUserProficienciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1AssociateQueueQuickConnectsCommand + * deserializeAws_restJson1BatchAssociateAnalyticsDataSetCommand */ -export const de_AssociateQueueQuickConnectsCommand = async ( +export const de_BatchAssociateAnalyticsDataSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateQueueQuickConnectsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Created: _json, + Errors: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1AssociateQueueQuickConnectsCommandError + * deserializeAws_restJson1BatchDisassociateAnalyticsDataSetCommand */ -const de_AssociateQueueQuickConnectsCommandError = async ( +export const de_BatchDisassociateAnalyticsDataSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Deleted: _json, + Errors: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1AssociateRoutingProfileQueuesCommand + * deserializeAws_restJson1BatchGetFlowAssociationCommand */ -export const de_AssociateRoutingProfileQueuesCommand = async ( +export const de_BatchGetFlowAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateRoutingProfileQueuesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + FlowAssociationSummaryList: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1AssociateRoutingProfileQueuesCommandError + * deserializeAws_restJson1BatchPutContactCommand */ -const de_AssociateRoutingProfileQueuesCommandError = async ( +export const de_BatchPutContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1AssociateSecurityKeyCommand - */ -export const de_AssociateSecurityKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateSecurityKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AssociationId: __expectString, + FailedRequestList: _json, + SuccessfulRequestList: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1AssociateSecurityKeyCommandError - */ -const de_AssociateSecurityKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1AssociateTrafficDistributionGroupUserCommand + * deserializeAws_restJson1ClaimPhoneNumberCommand */ -export const de_AssociateTrafficDistributionGroupUserCommand = async ( +export const de_ClaimPhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateTrafficDistributionGroupUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PhoneNumberArn: __expectString, + PhoneNumberId: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1AssociateTrafficDistributionGroupUserCommandError + * deserializeAws_restJson1CreateAgentStatusCommand */ -const de_AssociateTrafficDistributionGroupUserCommandError = async ( +export const de_CreateAgentStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AgentStatusARN: __expectString, + AgentStatusId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1AssociateUserProficienciesCommand + * deserializeAws_restJson1CreateContactFlowCommand */ -export const de_AssociateUserProficienciesCommand = async ( +export const de_CreateContactFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateUserProficienciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ContactFlowArn: __expectString, + ContactFlowId: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1AssociateUserProficienciesCommandError + * deserializeAws_restJson1CreateContactFlowModuleCommand */ -const de_AssociateUserProficienciesCommandError = async ( +export const de_CreateContactFlowModuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Id: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1BatchAssociateAnalyticsDataSetCommand + * deserializeAws_restJson1CreateEvaluationFormCommand */ -export const de_BatchAssociateAnalyticsDataSetCommand = async ( +export const de_CreateEvaluationFormCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchAssociateAnalyticsDataSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Created: _json, - Errors: _json, + EvaluationFormArn: __expectString, + EvaluationFormId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1BatchAssociateAnalyticsDataSetCommandError + * deserializeAws_restJson1CreateHoursOfOperationCommand */ -const de_BatchAssociateAnalyticsDataSetCommandError = async ( +export const de_CreateHoursOfOperationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + HoursOfOperationArn: __expectString, + HoursOfOperationId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1BatchDisassociateAnalyticsDataSetCommand + * deserializeAws_restJson1CreateInstanceCommand */ -export const de_BatchDisassociateAnalyticsDataSetCommand = async ( +export const de_CreateInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDisassociateAnalyticsDataSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Deleted: _json, - Errors: _json, + Arn: __expectString, + Id: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1BatchDisassociateAnalyticsDataSetCommandError + * deserializeAws_restJson1CreateIntegrationAssociationCommand */ -const de_BatchDisassociateAnalyticsDataSetCommandError = async ( +export const de_CreateIntegrationAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1BatchGetFlowAssociationCommand - */ -export const de_BatchGetFlowAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetFlowAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - FlowAssociationSummaryList: _json, + IntegrationAssociationArn: __expectString, + IntegrationAssociationId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1BatchGetFlowAssociationCommandError + * deserializeAws_restJson1CreateParticipantCommand */ -const de_BatchGetFlowAssociationCommandError = async ( +export const de_CreateParticipantCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ParticipantCredentials: _json, + ParticipantId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1BatchPutContactCommand + * deserializeAws_restJson1CreatePersistentContactAssociationCommand */ -export const de_BatchPutContactCommand = async ( +export const de_CreatePersistentContactAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchPutContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - FailedRequestList: _json, - SuccessfulRequestList: _json, + ContinuedFromContactId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1BatchPutContactCommandError + * deserializeAws_restJson1CreatePredefinedAttributeCommand */ -const de_BatchPutContactCommandError = async ( +export const de_CreatePredefinedAttributeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotencyException": - case "com.amazonaws.connect#IdempotencyException": - throw await de_IdempotencyExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ClaimPhoneNumberCommand + * deserializeAws_restJson1CreatePromptCommand */ -export const de_ClaimPhoneNumberCommand = async ( +export const de_CreatePromptCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ClaimPhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - PhoneNumberArn: __expectString, - PhoneNumberId: __expectString, + PromptARN: __expectString, + PromptId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ClaimPhoneNumberCommandError - */ -const de_ClaimPhoneNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotencyException": - case "com.amazonaws.connect#IdempotencyException": - throw await de_IdempotencyExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateAgentStatusCommand + * deserializeAws_restJson1CreateQueueCommand */ -export const de_CreateAgentStatusCommand = async ( +export const de_CreateQueueCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAgentStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AgentStatusARN: __expectString, - AgentStatusId: __expectString, + QueueArn: __expectString, + QueueId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateAgentStatusCommandError + * deserializeAws_restJson1CreateQuickConnectCommand */ -const de_CreateAgentStatusCommandError = async ( +export const de_CreateQuickConnectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + QuickConnectARN: __expectString, + QuickConnectId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateContactFlowCommand + * deserializeAws_restJson1CreateRoutingProfileCommand */ -export const de_CreateContactFlowCommand = async ( +export const de_CreateRoutingProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateContactFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ContactFlowArn: __expectString, - ContactFlowId: __expectString, + RoutingProfileArn: __expectString, + RoutingProfileId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateContactFlowCommandError + * deserializeAws_restJson1CreateRuleCommand */ -const de_CreateContactFlowCommandError = async ( +export const de_CreateRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidContactFlowException": - case "com.amazonaws.connect#InvalidContactFlowException": - throw await de_InvalidContactFlowExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RuleArn: __expectString, + RuleId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateContactFlowModuleCommand + * deserializeAws_restJson1CreateSecurityProfileCommand */ -export const de_CreateContactFlowModuleCommand = async ( +export const de_CreateSecurityProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SecurityProfileArn: __expectString, + SecurityProfileId: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1CreateTaskTemplateCommand + */ +export const de_CreateTaskTemplateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateContactFlowModuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7807,438 +7207,275 @@ export const de_CreateContactFlowModuleCommand = async ( }; /** - * deserializeAws_restJson1CreateContactFlowModuleCommandError + * deserializeAws_restJson1CreateTrafficDistributionGroupCommand */ -const de_CreateContactFlowModuleCommandError = async ( +export const de_CreateTrafficDistributionGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "IdempotencyException": - case "com.amazonaws.connect#IdempotencyException": - throw await de_IdempotencyExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidContactFlowModuleException": - case "com.amazonaws.connect#InvalidContactFlowModuleException": - throw await de_InvalidContactFlowModuleExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Id: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateEvaluationFormCommand + * deserializeAws_restJson1CreateUseCaseCommand */ -export const de_CreateEvaluationFormCommand = async ( +export const de_CreateUseCaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEvaluationFormCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - EvaluationFormArn: __expectString, - EvaluationFormId: __expectString, + UseCaseArn: __expectString, + UseCaseId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateEvaluationFormCommandError + * deserializeAws_restJson1CreateUserCommand */ -const de_CreateEvaluationFormCommandError = async ( +export const de_CreateUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + UserArn: __expectString, + UserId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateHoursOfOperationCommand + * deserializeAws_restJson1CreateUserHierarchyGroupCommand */ -export const de_CreateHoursOfOperationCommand = async ( +export const de_CreateUserHierarchyGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateHoursOfOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - HoursOfOperationArn: __expectString, - HoursOfOperationId: __expectString, + HierarchyGroupArn: __expectString, + HierarchyGroupId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateHoursOfOperationCommandError + * deserializeAws_restJson1CreateViewCommand */ -const de_CreateHoursOfOperationCommandError = async ( +export const de_CreateViewCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + View: (_) => de_View(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateInstanceCommand + * deserializeAws_restJson1CreateViewVersionCommand */ -export const de_CreateInstanceCommand = async ( +export const de_CreateViewVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - Id: __expectString, + View: (_) => de_View(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateInstanceCommandError + * deserializeAws_restJson1CreateVocabularyCommand */ -const de_CreateInstanceCommandError = async ( +export const de_CreateVocabularyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + State: __expectString, + VocabularyArn: __expectString, + VocabularyId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateIntegrationAssociationCommand + * deserializeAws_restJson1DeactivateEvaluationFormCommand */ -export const de_CreateIntegrationAssociationCommand = async ( +export const de_DeactivateEvaluationFormCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateIntegrationAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - IntegrationAssociationArn: __expectString, - IntegrationAssociationId: __expectString, + EvaluationFormArn: __expectString, + EvaluationFormId: __expectString, + EvaluationFormVersion: __expectInt32, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateIntegrationAssociationCommandError + * deserializeAws_restJson1DeleteContactEvaluationCommand */ -const de_CreateIntegrationAssociationCommandError = async ( +export const de_DeleteContactEvaluationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateParticipantCommand + * deserializeAws_restJson1DeleteContactFlowCommand */ -export const de_CreateParticipantCommand = async ( +export const de_DeleteContactFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateParticipantCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ParticipantCredentials: _json, - ParticipantId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateParticipantCommandError + * deserializeAws_restJson1DeleteContactFlowModuleCommand */ -const de_CreateParticipantCommandError = async ( +export const de_DeleteContactFlowModuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreatePersistentContactAssociationCommand + * deserializeAws_restJson1DeleteEvaluationFormCommand */ -export const de_CreatePersistentContactAssociationCommand = async ( +export const de_DeleteEvaluationFormCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePersistentContactAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ContinuedFromContactId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreatePersistentContactAssociationCommandError + * deserializeAws_restJson1DeleteHoursOfOperationCommand */ -const de_CreatePersistentContactAssociationCommandError = async ( +export const de_DeleteHoursOfOperationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreatePredefinedAttributeCommand + * deserializeAws_restJson1DeleteInstanceCommand */ -export const de_CreatePredefinedAttributeCommand = async ( +export const de_DeleteInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePredefinedAttributeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8248,1268 +7485,797 @@ export const de_CreatePredefinedAttributeCommand = async ( }; /** - * deserializeAws_restJson1CreatePredefinedAttributeCommandError + * deserializeAws_restJson1DeleteIntegrationAssociationCommand */ -const de_CreatePredefinedAttributeCommandError = async ( +export const de_DeleteIntegrationAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreatePromptCommand + * deserializeAws_restJson1DeletePredefinedAttributeCommand */ -export const de_CreatePromptCommand = async ( +export const de_DeletePredefinedAttributeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePromptCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - PromptARN: __expectString, - PromptId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreatePromptCommandError + * deserializeAws_restJson1DeletePromptCommand */ -const de_CreatePromptCommandError = async ( +export const de_DeletePromptCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateQueueCommand + * deserializeAws_restJson1DeleteQueueCommand */ -export const de_CreateQueueCommand = async ( +export const de_DeleteQueueCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateQueueCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - QueueArn: __expectString, - QueueId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateQueueCommandError + * deserializeAws_restJson1DeleteQuickConnectCommand */ -const de_CreateQueueCommandError = async ( +export const de_DeleteQuickConnectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateQuickConnectCommand + * deserializeAws_restJson1DeleteRoutingProfileCommand */ -export const de_CreateQuickConnectCommand = async ( +export const de_DeleteRoutingProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateQuickConnectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - QuickConnectARN: __expectString, - QuickConnectId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateQuickConnectCommandError + * deserializeAws_restJson1DeleteRuleCommand */ -const de_CreateQuickConnectCommandError = async ( +export const de_DeleteRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateRoutingProfileCommand + * deserializeAws_restJson1DeleteSecurityProfileCommand */ -export const de_CreateRoutingProfileCommand = async ( +export const de_DeleteSecurityProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRoutingProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RoutingProfileArn: __expectString, - RoutingProfileId: __expectString, + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteTaskTemplateCommand + */ +export const de_DeleteTaskTemplateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateRoutingProfileCommandError + * deserializeAws_restJson1DeleteTrafficDistributionGroupCommand */ -const de_CreateRoutingProfileCommandError = async ( +export const de_DeleteTrafficDistributionGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateRuleCommand + * deserializeAws_restJson1DeleteUseCaseCommand */ -export const de_CreateRuleCommand = async ( +export const de_DeleteUseCaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RuleArn: __expectString, - RuleId: __expectString, + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteUserCommand + */ +export const de_DeleteUserCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateRuleCommandError + * deserializeAws_restJson1DeleteUserHierarchyGroupCommand */ -const de_CreateRuleCommandError = async ( +export const de_DeleteUserHierarchyGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateSecurityProfileCommand + * deserializeAws_restJson1DeleteViewCommand */ -export const de_CreateSecurityProfileCommand = async ( +export const de_DeleteViewCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSecurityProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - SecurityProfileArn: __expectString, - SecurityProfileId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateSecurityProfileCommandError + * deserializeAws_restJson1DeleteViewVersionCommand */ -const de_CreateSecurityProfileCommandError = async ( +export const de_DeleteViewVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateTaskTemplateCommand + * deserializeAws_restJson1DeleteVocabularyCommand */ -export const de_CreateTaskTemplateCommand = async ( +export const de_DeleteVocabularyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTaskTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - Id: __expectString, + State: __expectString, + VocabularyArn: __expectString, + VocabularyId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateTaskTemplateCommandError - */ -const de_CreateTaskTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "PropertyValidationException": - case "com.amazonaws.connect#PropertyValidationException": - throw await de_PropertyValidationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateTrafficDistributionGroupCommand + * deserializeAws_restJson1DescribeAgentStatusCommand */ -export const de_CreateTrafficDistributionGroupCommand = async ( +export const de_DescribeAgentStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTrafficDistributionGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - Id: __expectString, + AgentStatus: (_) => de_AgentStatus(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateTrafficDistributionGroupCommandError + * deserializeAws_restJson1DescribeContactCommand */ -const de_CreateTrafficDistributionGroupCommandError = async ( +export const de_DescribeContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.connect#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Contact: (_) => de_Contact(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateUseCaseCommand + * deserializeAws_restJson1DescribeContactEvaluationCommand */ -export const de_CreateUseCaseCommand = async ( +export const de_DescribeContactEvaluationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateUseCaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - UseCaseArn: __expectString, - UseCaseId: __expectString, + Evaluation: (_) => de_Evaluation(_, context), + EvaluationForm: (_) => de_EvaluationFormContent(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateUseCaseCommandError + * deserializeAws_restJson1DescribeContactFlowCommand */ -const de_CreateUseCaseCommandError = async ( +export const de_DescribeContactFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ContactFlow: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateUserCommand + * deserializeAws_restJson1DescribeContactFlowModuleCommand */ -export const de_CreateUserCommand = async ( +export const de_DescribeContactFlowModuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - UserArn: __expectString, - UserId: __expectString, + ContactFlowModule: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateUserCommandError + * deserializeAws_restJson1DescribeEvaluationFormCommand */ -const de_CreateUserCommandError = async ( +export const de_DescribeEvaluationFormCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EvaluationForm: (_) => de_EvaluationForm(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateUserHierarchyGroupCommand + * deserializeAws_restJson1DescribeHoursOfOperationCommand */ -export const de_CreateUserHierarchyGroupCommand = async ( +export const de_DescribeHoursOfOperationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateUserHierarchyGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - HierarchyGroupArn: __expectString, - HierarchyGroupId: __expectString, + HoursOfOperation: (_) => de_HoursOfOperation(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateUserHierarchyGroupCommandError + * deserializeAws_restJson1DescribeInstanceCommand */ -const de_CreateUserHierarchyGroupCommandError = async ( +export const de_DescribeInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Instance: (_) => de_Instance(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateViewCommand + * deserializeAws_restJson1DescribeInstanceAttributeCommand */ -export const de_CreateViewCommand = async ( +export const de_DescribeInstanceAttributeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateViewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - View: (_) => de_View(_, context), + Attribute: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateViewCommandError + * deserializeAws_restJson1DescribeInstanceStorageConfigCommand */ -const de_CreateViewCommandError = async ( +export const de_DescribeInstanceStorageConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.connect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + StorageConfig: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateViewVersionCommand + * deserializeAws_restJson1DescribePhoneNumberCommand */ -export const de_CreateViewVersionCommand = async ( +export const de_DescribePhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateViewVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - View: (_) => de_View(_, context), + ClaimedPhoneNumberSummary: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateViewVersionCommandError + * deserializeAws_restJson1DescribePredefinedAttributeCommand */ -const de_CreateViewVersionCommandError = async ( +export const de_DescribePredefinedAttributeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.connect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PredefinedAttribute: (_) => de_PredefinedAttribute(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateVocabularyCommand + * deserializeAws_restJson1DescribePromptCommand */ -export const de_CreateVocabularyCommand = async ( +export const de_DescribePromptCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateVocabularyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - State: __expectString, - VocabularyArn: __expectString, - VocabularyId: __expectString, + Prompt: (_) => de_Prompt(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateVocabularyCommandError + * deserializeAws_restJson1DescribeQueueCommand */ -const de_CreateVocabularyCommandError = async ( +export const de_DescribeQueueCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Queue: (_) => de_Queue(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeactivateEvaluationFormCommand + * deserializeAws_restJson1DescribeQuickConnectCommand */ -export const de_DeactivateEvaluationFormCommand = async ( +export const de_DescribeQuickConnectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeactivateEvaluationFormCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - EvaluationFormArn: __expectString, - EvaluationFormId: __expectString, - EvaluationFormVersion: __expectInt32, + QuickConnect: (_) => de_QuickConnect(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeactivateEvaluationFormCommandError + * deserializeAws_restJson1DescribeRoutingProfileCommand */ -const de_DeactivateEvaluationFormCommandError = async ( +export const de_DescribeRoutingProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RoutingProfile: (_) => de_RoutingProfile(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteContactEvaluationCommand + * deserializeAws_restJson1DescribeRuleCommand */ -export const de_DeleteContactEvaluationCommand = async ( +export const de_DescribeRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteContactEvaluationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Rule: (_) => de_Rule(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteContactEvaluationCommandError + * deserializeAws_restJson1DescribeSecurityProfileCommand */ -const de_DeleteContactEvaluationCommandError = async ( +export const de_DescribeSecurityProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SecurityProfile: (_) => de_SecurityProfile(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteContactFlowCommand + * deserializeAws_restJson1DescribeTrafficDistributionGroupCommand */ -export const de_DeleteContactFlowCommand = async ( +export const de_DescribeTrafficDistributionGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteContactFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + TrafficDistributionGroup: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteContactFlowCommandError + * deserializeAws_restJson1DescribeUserCommand */ -const de_DeleteContactFlowCommandError = async ( +export const de_DescribeUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + User: (_) => de_User(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteContactFlowModuleCommand + * deserializeAws_restJson1DescribeUserHierarchyGroupCommand */ -export const de_DeleteContactFlowModuleCommand = async ( +export const de_DescribeUserHierarchyGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteContactFlowModuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + HierarchyGroup: (_) => de_HierarchyGroup(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteContactFlowModuleCommandError + * deserializeAws_restJson1DescribeUserHierarchyStructureCommand */ -const de_DeleteContactFlowModuleCommandError = async ( +export const de_DescribeUserHierarchyStructureCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + HierarchyStructure: (_) => de_HierarchyStructure(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteEvaluationFormCommand + * deserializeAws_restJson1DescribeViewCommand */ -export const de_DeleteEvaluationFormCommand = async ( +export const de_DescribeViewCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEvaluationFormCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + View: (_) => de_View(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteEvaluationFormCommandError + * deserializeAws_restJson1DescribeVocabularyCommand */ -const de_DeleteEvaluationFormCommandError = async ( +export const de_DescribeVocabularyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Vocabulary: (_) => de_Vocabulary(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteHoursOfOperationCommand + * deserializeAws_restJson1DisassociateAnalyticsDataSetCommand */ -export const de_DeleteHoursOfOperationCommand = async ( +export const de_DisassociateAnalyticsDataSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteHoursOfOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9519,52 +8285,31 @@ export const de_DeleteHoursOfOperationCommand = async ( }; /** - * deserializeAws_restJson1DeleteHoursOfOperationCommandError + * deserializeAws_restJson1DisassociateApprovedOriginCommand */ -const de_DeleteHoursOfOperationCommandError = async ( +export const de_DisassociateApprovedOriginCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteInstanceCommand + * deserializeAws_restJson1DisassociateBotCommand */ -export const de_DeleteInstanceCommand = async ( +export const de_DisassociateBotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9574,46 +8319,31 @@ export const de_DeleteInstanceCommand = async ( }; /** - * deserializeAws_restJson1DeleteInstanceCommandError + * deserializeAws_restJson1DisassociateFlowCommand */ -const de_DeleteInstanceCommandError = async ( +export const de_DisassociateFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteIntegrationAssociationCommand + * deserializeAws_restJson1DisassociateInstanceStorageConfigCommand */ -export const de_DeleteIntegrationAssociationCommand = async ( +export const de_DisassociateInstanceStorageConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteIntegrationAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9623,49 +8353,31 @@ export const de_DeleteIntegrationAssociationCommand = async ( }; /** - * deserializeAws_restJson1DeleteIntegrationAssociationCommandError + * deserializeAws_restJson1DisassociateLambdaFunctionCommand */ -const de_DeleteIntegrationAssociationCommandError = async ( +export const de_DisassociateLambdaFunctionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeletePredefinedAttributeCommand + * deserializeAws_restJson1DisassociateLexBotCommand */ -export const de_DeletePredefinedAttributeCommand = async ( +export const de_DisassociateLexBotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePredefinedAttributeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9675,55 +8387,31 @@ export const de_DeletePredefinedAttributeCommand = async ( }; /** - * deserializeAws_restJson1DeletePredefinedAttributeCommandError + * deserializeAws_restJson1DisassociatePhoneNumberContactFlowCommand */ -const de_DeletePredefinedAttributeCommandError = async ( +export const de_DisassociatePhoneNumberContactFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeletePromptCommand + * deserializeAws_restJson1DisassociateQueueQuickConnectsCommand */ -export const de_DeletePromptCommand = async ( +export const de_DisassociateQueueQuickConnectsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePromptCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9733,52 +8421,31 @@ export const de_DeletePromptCommand = async ( }; /** - * deserializeAws_restJson1DeletePromptCommandError + * deserializeAws_restJson1DisassociateRoutingProfileQueuesCommand */ -const de_DeletePromptCommandError = async ( +export const de_DisassociateRoutingProfileQueuesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteQueueCommand + * deserializeAws_restJson1DisassociateSecurityKeyCommand */ -export const de_DeleteQueueCommand = async ( +export const de_DisassociateSecurityKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteQueueCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9788,55 +8455,14 @@ export const de_DeleteQueueCommand = async ( }; /** - * deserializeAws_restJson1DeleteQueueCommandError + * deserializeAws_restJson1DisassociateTrafficDistributionGroupUserCommand */ -const de_DeleteQueueCommandError = async ( +export const de_DisassociateTrafficDistributionGroupUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteQuickConnectCommand - */ -export const de_DeleteQuickConnectCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteQuickConnectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9846,52 +8472,14 @@ export const de_DeleteQuickConnectCommand = async ( }; /** - * deserializeAws_restJson1DeleteQuickConnectCommandError - */ -const de_DeleteQuickConnectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRoutingProfileCommand + * deserializeAws_restJson1DisassociateUserProficienciesCommand */ -export const de_DeleteRoutingProfileCommand = async ( +export const de_DisassociateUserProficienciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRoutingProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9901,7235 +8489,315 @@ export const de_DeleteRoutingProfileCommand = async ( }; /** - * deserializeAws_restJson1DeleteRoutingProfileCommandError + * deserializeAws_restJson1DismissUserContactCommand */ -const de_DeleteRoutingProfileCommandError = async ( +export const de_DismissUserContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteRuleCommand + * deserializeAws_restJson1GetContactAttributesCommand */ -export const de_DeleteRuleCommand = async ( +export const de_GetContactAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Attributes: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteRuleCommandError + * deserializeAws_restJson1GetCurrentMetricDataCommand */ -const de_DeleteRuleCommandError = async ( +export const de_GetCurrentMetricDataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ApproximateTotalCount: __expectLong, + DataSnapshotTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + MetricResults: (_) => de_CurrentMetricResults(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteSecurityProfileCommand + * deserializeAws_restJson1GetCurrentUserDataCommand */ -export const de_DeleteSecurityProfileCommand = async ( +export const de_GetCurrentUserDataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSecurityProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ApproximateTotalCount: __expectLong, + NextToken: __expectString, + UserDataList: (_) => de_UserDataList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteSecurityProfileCommandError + * deserializeAws_restJson1GetFederationTokenCommand */ -const de_DeleteSecurityProfileCommandError = async ( +export const de_GetFederationTokenCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Credentials: (_) => de_Credentials(_, context), + SignInUrl: __expectString, + UserArn: __expectString, + UserId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteTaskTemplateCommand + * deserializeAws_restJson1GetFlowAssociationCommand */ -export const de_DeleteTaskTemplateCommand = async ( +export const de_GetFlowAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTaskTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + FlowId: __expectString, + ResourceId: __expectString, + ResourceType: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteTaskTemplateCommandError + * deserializeAws_restJson1GetMetricDataCommand */ -const de_DeleteTaskTemplateCommandError = async ( +export const de_GetMetricDataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteTrafficDistributionGroupCommand - */ -export const de_DeleteTrafficDistributionGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTrafficDistributionGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteTrafficDistributionGroupCommandError - */ -const de_DeleteTrafficDistributionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteUseCaseCommand - */ -export const de_DeleteUseCaseCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteUseCaseCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteUseCaseCommandError - */ -const de_DeleteUseCaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteUserCommand - */ -export const de_DeleteUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteUserCommandError - */ -const de_DeleteUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteUserHierarchyGroupCommand - */ -export const de_DeleteUserHierarchyGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteUserHierarchyGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteUserHierarchyGroupCommandError - */ -const de_DeleteUserHierarchyGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteViewCommand - */ -export const de_DeleteViewCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteViewCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteViewCommandError - */ -const de_DeleteViewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.connect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteViewVersionCommand - */ -export const de_DeleteViewVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteViewVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteViewVersionCommandError - */ -const de_DeleteViewVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.connect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVocabularyCommand - */ -export const de_DeleteVocabularyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteVocabularyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - State: __expectString, - VocabularyArn: __expectString, - VocabularyId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVocabularyCommandError - */ -const de_DeleteVocabularyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAgentStatusCommand - */ -export const de_DescribeAgentStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAgentStatusCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AgentStatus: (_) => de_AgentStatus(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAgentStatusCommandError - */ -const de_DescribeAgentStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeContactCommand - */ -export const de_DescribeContactCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeContactCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Contact: (_) => de_Contact(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeContactCommandError - */ -const de_DescribeContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeContactEvaluationCommand - */ -export const de_DescribeContactEvaluationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeContactEvaluationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Evaluation: (_) => de_Evaluation(_, context), - EvaluationForm: (_) => de_EvaluationFormContent(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeContactEvaluationCommandError - */ -const de_DescribeContactEvaluationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeContactFlowCommand - */ -export const de_DescribeContactFlowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeContactFlowCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ContactFlow: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeContactFlowCommandError - */ -const de_DescribeContactFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContactFlowNotPublishedException": - case "com.amazonaws.connect#ContactFlowNotPublishedException": - throw await de_ContactFlowNotPublishedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeContactFlowModuleCommand - */ -export const de_DescribeContactFlowModuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeContactFlowModuleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ContactFlowModule: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeContactFlowModuleCommandError - */ -const de_DescribeContactFlowModuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeEvaluationFormCommand - */ -export const de_DescribeEvaluationFormCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeEvaluationFormCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - EvaluationForm: (_) => de_EvaluationForm(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeEvaluationFormCommandError - */ -const de_DescribeEvaluationFormCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeHoursOfOperationCommand - */ -export const de_DescribeHoursOfOperationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeHoursOfOperationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - HoursOfOperation: (_) => de_HoursOfOperation(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeHoursOfOperationCommandError - */ -const de_DescribeHoursOfOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeInstanceCommand - */ -export const de_DescribeInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeInstanceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Instance: (_) => de_Instance(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeInstanceCommandError - */ -const de_DescribeInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeInstanceAttributeCommand - */ -export const de_DescribeInstanceAttributeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeInstanceAttributeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Attribute: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeInstanceAttributeCommandError - */ -const de_DescribeInstanceAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeInstanceStorageConfigCommand - */ -export const de_DescribeInstanceStorageConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeInstanceStorageConfigCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - StorageConfig: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeInstanceStorageConfigCommandError - */ -const de_DescribeInstanceStorageConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribePhoneNumberCommand - */ -export const de_DescribePhoneNumberCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePhoneNumberCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ClaimedPhoneNumberSummary: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribePhoneNumberCommandError - */ -const de_DescribePhoneNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribePredefinedAttributeCommand - */ -export const de_DescribePredefinedAttributeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePredefinedAttributeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - PredefinedAttribute: (_) => de_PredefinedAttribute(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribePredefinedAttributeCommandError - */ -const de_DescribePredefinedAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribePromptCommand - */ -export const de_DescribePromptCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePromptCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Prompt: (_) => de_Prompt(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribePromptCommandError - */ -const de_DescribePromptCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeQueueCommand - */ -export const de_DescribeQueueCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeQueueCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Queue: (_) => de_Queue(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeQueueCommandError - */ -const de_DescribeQueueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeQuickConnectCommand - */ -export const de_DescribeQuickConnectCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeQuickConnectCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - QuickConnect: (_) => de_QuickConnect(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeQuickConnectCommandError - */ -const de_DescribeQuickConnectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeRoutingProfileCommand - */ -export const de_DescribeRoutingProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRoutingProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RoutingProfile: (_) => de_RoutingProfile(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeRoutingProfileCommandError - */ -const de_DescribeRoutingProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeRuleCommand - */ -export const de_DescribeRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRuleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Rule: (_) => de_Rule(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeRuleCommandError - */ -const de_DescribeRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeSecurityProfileCommand - */ -export const de_DescribeSecurityProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSecurityProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - SecurityProfile: (_) => de_SecurityProfile(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeSecurityProfileCommandError - */ -const de_DescribeSecurityProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeTrafficDistributionGroupCommand - */ -export const de_DescribeTrafficDistributionGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTrafficDistributionGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - TrafficDistributionGroup: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeTrafficDistributionGroupCommandError - */ -const de_DescribeTrafficDistributionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeUserCommand - */ -export const de_DescribeUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - User: (_) => de_User(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeUserCommandError - */ -const de_DescribeUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeUserHierarchyGroupCommand - */ -export const de_DescribeUserHierarchyGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeUserHierarchyGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - HierarchyGroup: (_) => de_HierarchyGroup(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeUserHierarchyGroupCommandError - */ -const de_DescribeUserHierarchyGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeUserHierarchyStructureCommand - */ -export const de_DescribeUserHierarchyStructureCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeUserHierarchyStructureCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - HierarchyStructure: (_) => de_HierarchyStructure(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeUserHierarchyStructureCommandError - */ -const de_DescribeUserHierarchyStructureCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeViewCommand - */ -export const de_DescribeViewCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeViewCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - View: (_) => de_View(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeViewCommandError - */ -const de_DescribeViewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.connect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeVocabularyCommand - */ -export const de_DescribeVocabularyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeVocabularyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Vocabulary: (_) => de_Vocabulary(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeVocabularyCommandError - */ -const de_DescribeVocabularyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateAnalyticsDataSetCommand - */ -export const de_DisassociateAnalyticsDataSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateAnalyticsDataSetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateAnalyticsDataSetCommandError - */ -const de_DisassociateAnalyticsDataSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateApprovedOriginCommand - */ -export const de_DisassociateApprovedOriginCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateApprovedOriginCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateApprovedOriginCommandError - */ -const de_DisassociateApprovedOriginCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateBotCommand - */ -export const de_DisassociateBotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateBotCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateBotCommandError - */ -const de_DisassociateBotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateFlowCommand - */ -export const de_DisassociateFlowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateFlowCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateFlowCommandError - */ -const de_DisassociateFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateInstanceStorageConfigCommand - */ -export const de_DisassociateInstanceStorageConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateInstanceStorageConfigCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateInstanceStorageConfigCommandError - */ -const de_DisassociateInstanceStorageConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateLambdaFunctionCommand - */ -export const de_DisassociateLambdaFunctionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateLambdaFunctionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateLambdaFunctionCommandError - */ -const de_DisassociateLambdaFunctionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateLexBotCommand - */ -export const de_DisassociateLexBotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateLexBotCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateLexBotCommandError - */ -const de_DisassociateLexBotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociatePhoneNumberContactFlowCommand - */ -export const de_DisassociatePhoneNumberContactFlowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociatePhoneNumberContactFlowCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociatePhoneNumberContactFlowCommandError - */ -const de_DisassociatePhoneNumberContactFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateQueueQuickConnectsCommand - */ -export const de_DisassociateQueueQuickConnectsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateQueueQuickConnectsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateQueueQuickConnectsCommandError - */ -const de_DisassociateQueueQuickConnectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateRoutingProfileQueuesCommand - */ -export const de_DisassociateRoutingProfileQueuesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateRoutingProfileQueuesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateRoutingProfileQueuesCommandError - */ -const de_DisassociateRoutingProfileQueuesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateSecurityKeyCommand - */ -export const de_DisassociateSecurityKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateSecurityKeyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateSecurityKeyCommandError - */ -const de_DisassociateSecurityKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateTrafficDistributionGroupUserCommand - */ -export const de_DisassociateTrafficDistributionGroupUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateTrafficDistributionGroupUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateTrafficDistributionGroupUserCommandError - */ -const de_DisassociateTrafficDistributionGroupUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateUserProficienciesCommand - */ -export const de_DisassociateUserProficienciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateUserProficienciesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateUserProficienciesCommandError - */ -const de_DisassociateUserProficienciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DismissUserContactCommand - */ -export const de_DismissUserContactCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DismissUserContactCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DismissUserContactCommandError - */ -const de_DismissUserContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetContactAttributesCommand - */ -export const de_GetContactAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetContactAttributesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Attributes: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetContactAttributesCommandError - */ -const de_GetContactAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCurrentMetricDataCommand - */ -export const de_GetCurrentMetricDataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCurrentMetricDataCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ApproximateTotalCount: __expectLong, - DataSnapshotTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - MetricResults: (_) => de_CurrentMetricResults(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetCurrentMetricDataCommandError - */ -const de_GetCurrentMetricDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCurrentUserDataCommand - */ -export const de_GetCurrentUserDataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCurrentUserDataCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ApproximateTotalCount: __expectLong, - NextToken: __expectString, - UserDataList: (_) => de_UserDataList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetCurrentUserDataCommandError - */ -const de_GetCurrentUserDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFederationTokenCommand - */ -export const de_GetFederationTokenCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFederationTokenCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Credentials: (_) => de_Credentials(_, context), - SignInUrl: __expectString, - UserArn: __expectString, - UserId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFederationTokenCommandError - */ -const de_GetFederationTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UserNotFoundException": - case "com.amazonaws.connect#UserNotFoundException": - throw await de_UserNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFlowAssociationCommand - */ -export const de_GetFlowAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFlowAssociationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - FlowId: __expectString, - ResourceId: __expectString, - ResourceType: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFlowAssociationCommandError - */ -const de_GetFlowAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMetricDataCommand - */ -export const de_GetMetricDataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMetricDataCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - MetricResults: (_) => de_HistoricalMetricResults(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMetricDataCommandError - */ -const de_GetMetricDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMetricDataV2Command - */ -export const de_GetMetricDataV2Command = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMetricDataV2CommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - MetricResults: (_) => de_MetricResultsV2(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMetricDataV2CommandError - */ -const de_GetMetricDataV2CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPromptFileCommand - */ -export const de_GetPromptFileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPromptFileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LastModifiedRegion: __expectString, - LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - PromptPresignedUrl: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPromptFileCommandError - */ -const de_GetPromptFileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetTaskTemplateCommand - */ -export const de_GetTaskTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTaskTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - Constraints: _json, - ContactFlowId: __expectString, - CreatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - Defaults: _json, - Description: __expectString, - Fields: _json, - Id: __expectString, - InstanceId: __expectString, - LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - Name: __expectString, - Status: __expectString, - Tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetTaskTemplateCommandError - */ -const de_GetTaskTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetTrafficDistributionCommand - */ -export const de_GetTrafficDistributionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTrafficDistributionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AgentConfig: _json, - Arn: __expectString, - Id: __expectString, - SignInConfig: _json, - TelephonyConfig: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetTrafficDistributionCommandError - */ -const de_GetTrafficDistributionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ImportPhoneNumberCommand - */ -export const de_ImportPhoneNumberCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ImportPhoneNumberCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - PhoneNumberArn: __expectString, - PhoneNumberId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ImportPhoneNumberCommandError - */ -const de_ImportPhoneNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotencyException": - case "com.amazonaws.connect#IdempotencyException": - throw await de_IdempotencyExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAgentStatusesCommand - */ -export const de_ListAgentStatusesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAgentStatusesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AgentStatusSummaryList: (_) => de_AgentStatusSummaryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAgentStatusesCommandError - */ -const de_ListAgentStatusesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAnalyticsDataAssociationsCommand - */ -export const de_ListAnalyticsDataAssociationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnalyticsDataAssociationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Results: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAnalyticsDataAssociationsCommandError - */ -const de_ListAnalyticsDataAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListApprovedOriginsCommand - */ -export const de_ListApprovedOriginsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApprovedOriginsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Origins: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListApprovedOriginsCommandError - */ -const de_ListApprovedOriginsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListBotsCommand - */ -export const de_ListBotsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBotsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LexBots: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListBotsCommandError - */ -const de_ListBotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListContactEvaluationsCommand - */ -export const de_ListContactEvaluationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListContactEvaluationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - EvaluationSummaryList: (_) => de_EvaluationSummaryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListContactEvaluationsCommandError - */ -const de_ListContactEvaluationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListContactFlowModulesCommand - */ -export const de_ListContactFlowModulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListContactFlowModulesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ContactFlowModulesSummaryList: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListContactFlowModulesCommandError - */ -const de_ListContactFlowModulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListContactFlowsCommand - */ -export const de_ListContactFlowsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListContactFlowsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ContactFlowSummaryList: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListContactFlowsCommandError - */ -const de_ListContactFlowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListContactReferencesCommand - */ -export const de_ListContactReferencesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListContactReferencesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - ReferenceSummaryList: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListContactReferencesCommandError - */ -const de_ListContactReferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDefaultVocabulariesCommand - */ -export const de_ListDefaultVocabulariesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDefaultVocabulariesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DefaultVocabularyList: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDefaultVocabulariesCommandError - */ -const de_ListDefaultVocabulariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListEvaluationFormsCommand - */ -export const de_ListEvaluationFormsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEvaluationFormsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - EvaluationFormSummaryList: (_) => de_EvaluationFormSummaryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListEvaluationFormsCommandError - */ -const de_ListEvaluationFormsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListEvaluationFormVersionsCommand - */ -export const de_ListEvaluationFormVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEvaluationFormVersionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - EvaluationFormVersionSummaryList: (_) => de_EvaluationFormVersionSummaryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListEvaluationFormVersionsCommandError - */ -const de_ListEvaluationFormVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListFlowAssociationsCommand - */ -export const de_ListFlowAssociationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFlowAssociationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - FlowAssociationSummaryList: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListFlowAssociationsCommandError - */ -const de_ListFlowAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListHoursOfOperationsCommand - */ -export const de_ListHoursOfOperationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListHoursOfOperationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - HoursOfOperationSummaryList: (_) => de_HoursOfOperationSummaryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListHoursOfOperationsCommandError - */ -const de_ListHoursOfOperationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListInstanceAttributesCommand - */ -export const de_ListInstanceAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInstanceAttributesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Attributes: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListInstanceAttributesCommandError - */ -const de_ListInstanceAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListInstancesCommand - */ -export const de_ListInstancesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInstancesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - InstanceSummaryList: (_) => de_InstanceSummaryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListInstancesCommandError - */ -const de_ListInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListInstanceStorageConfigsCommand - */ -export const de_ListInstanceStorageConfigsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInstanceStorageConfigsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - StorageConfigs: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListInstanceStorageConfigsCommandError - */ -const de_ListInstanceStorageConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListIntegrationAssociationsCommand - */ -export const de_ListIntegrationAssociationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIntegrationAssociationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - IntegrationAssociationSummaryList: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListIntegrationAssociationsCommandError - */ -const de_ListIntegrationAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListLambdaFunctionsCommand - */ -export const de_ListLambdaFunctionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLambdaFunctionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LambdaFunctions: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListLambdaFunctionsCommandError - */ -const de_ListLambdaFunctionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListLexBotsCommand - */ -export const de_ListLexBotsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLexBotsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LexBots: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListLexBotsCommandError - */ -const de_ListLexBotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPhoneNumbersCommand - */ -export const de_ListPhoneNumbersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPhoneNumbersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - PhoneNumberSummaryList: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPhoneNumbersCommandError - */ -const de_ListPhoneNumbersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPhoneNumbersV2Command - */ -export const de_ListPhoneNumbersV2Command = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPhoneNumbersV2CommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ListPhoneNumbersSummaryList: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPhoneNumbersV2CommandError - */ -const de_ListPhoneNumbersV2CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPredefinedAttributesCommand - */ -export const de_ListPredefinedAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPredefinedAttributesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - PredefinedAttributeSummaryList: (_) => de_PredefinedAttributeSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPredefinedAttributesCommandError - */ -const de_ListPredefinedAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPromptsCommand - */ -export const de_ListPromptsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPromptsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - PromptSummaryList: (_) => de_PromptSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPromptsCommandError - */ -const de_ListPromptsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListQueueQuickConnectsCommand - */ -export const de_ListQueueQuickConnectsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListQueueQuickConnectsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LastModifiedRegion: __expectString, - LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - NextToken: __expectString, - QuickConnectSummaryList: (_) => de_QuickConnectSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListQueueQuickConnectsCommandError - */ -const de_ListQueueQuickConnectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListQueuesCommand - */ -export const de_ListQueuesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListQueuesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - QueueSummaryList: (_) => de_QueueSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListQueuesCommandError - */ -const de_ListQueuesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListQuickConnectsCommand - */ -export const de_ListQuickConnectsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListQuickConnectsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - QuickConnectSummaryList: (_) => de_QuickConnectSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListQuickConnectsCommandError - */ -const de_ListQuickConnectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsV2Command - */ -export const de_ListRealtimeContactAnalysisSegmentsV2Command = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRealtimeContactAnalysisSegmentsV2CommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Channel: __expectString, - NextToken: __expectString, - Segments: (_) => de_RealtimeContactAnalysisSegments(_, context), - Status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsV2CommandError - */ -const de_ListRealtimeContactAnalysisSegmentsV2CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "OutputTypeNotFoundException": - case "com.amazonaws.connect#OutputTypeNotFoundException": - throw await de_OutputTypeNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListRoutingProfileQueuesCommand - */ -export const de_ListRoutingProfileQueuesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRoutingProfileQueuesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LastModifiedRegion: __expectString, - LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - NextToken: __expectString, - RoutingProfileQueueConfigSummaryList: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListRoutingProfileQueuesCommandError - */ -const de_ListRoutingProfileQueuesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListRoutingProfilesCommand - */ -export const de_ListRoutingProfilesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRoutingProfilesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - RoutingProfileSummaryList: (_) => de_RoutingProfileSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListRoutingProfilesCommandError - */ -const de_ListRoutingProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListRulesCommand - */ -export const de_ListRulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRulesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - RuleSummaryList: (_) => de_RuleSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListRulesCommandError - */ -const de_ListRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSecurityKeysCommand - */ -export const de_ListSecurityKeysCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSecurityKeysCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - SecurityKeys: (_) => de_SecurityKeysList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSecurityKeysCommandError - */ -const de_ListSecurityKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSecurityProfileApplicationsCommand - */ -export const de_ListSecurityProfileApplicationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSecurityProfileApplicationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Applications: _json, - LastModifiedRegion: __expectString, - LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSecurityProfileApplicationsCommandError - */ -const de_ListSecurityProfileApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSecurityProfilePermissionsCommand - */ -export const de_ListSecurityProfilePermissionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSecurityProfilePermissionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LastModifiedRegion: __expectString, - LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - NextToken: __expectString, - Permissions: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSecurityProfilePermissionsCommandError - */ -const de_ListSecurityProfilePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSecurityProfilesCommand - */ -export const de_ListSecurityProfilesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSecurityProfilesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - SecurityProfileSummaryList: (_) => de_SecurityProfileSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSecurityProfilesCommandError - */ -const de_ListSecurityProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTaskTemplatesCommand - */ -export const de_ListTaskTemplatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTaskTemplatesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - TaskTemplates: (_) => de_TaskTemplateList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTaskTemplatesCommandError - */ -const de_ListTaskTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTrafficDistributionGroupsCommand - */ -export const de_ListTrafficDistributionGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTrafficDistributionGroupsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - TrafficDistributionGroupSummaryList: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTrafficDistributionGroupsCommandError - */ -const de_ListTrafficDistributionGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTrafficDistributionGroupUsersCommand - */ -export const de_ListTrafficDistributionGroupUsersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTrafficDistributionGroupUsersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - TrafficDistributionGroupUserSummaryList: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTrafficDistributionGroupUsersCommandError - */ -const de_ListTrafficDistributionGroupUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListUseCasesCommand - */ -export const de_ListUseCasesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUseCasesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - UseCaseSummaryList: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListUseCasesCommandError - */ -const de_ListUseCasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListUserHierarchyGroupsCommand - */ -export const de_ListUserHierarchyGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUserHierarchyGroupsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - UserHierarchyGroupSummaryList: (_) => de_HierarchyGroupSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListUserHierarchyGroupsCommandError - */ -const de_ListUserHierarchyGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListUserProficienciesCommand - */ -export const de_ListUserProficienciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUserProficienciesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LastModifiedRegion: __expectString, - LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - NextToken: __expectString, - UserProficiencyList: (_) => de_UserProficiencyList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListUserProficienciesCommandError - */ -const de_ListUserProficienciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListUsersCommand - */ -export const de_ListUsersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUsersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - UserSummaryList: (_) => de_UserSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListUsersCommandError - */ -const de_ListUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListViewsCommand - */ -export const de_ListViewsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListViewsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - ViewsSummaryList: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListViewsCommandError - */ -const de_ListViewsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.connect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListViewVersionsCommand - */ -export const de_ListViewVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListViewVersionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - ViewVersionSummaryList: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListViewVersionsCommandError - */ -const de_ListViewVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.connect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1MonitorContactCommand - */ -export const de_MonitorContactCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MonitorContactCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ContactArn: __expectString, - ContactId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1MonitorContactCommandError - */ -const de_MonitorContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotencyException": - case "com.amazonaws.connect#IdempotencyException": - throw await de_IdempotencyExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PauseContactCommand - */ -export const de_PauseContactCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PauseContactCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1PauseContactCommandError - */ -const de_PauseContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutUserStatusCommand - */ -export const de_PutUserStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutUserStatusCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1PutUserStatusCommandError - */ -const de_PutUserStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ReleasePhoneNumberCommand - */ -export const de_ReleasePhoneNumberCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ReleasePhoneNumberCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1ReleasePhoneNumberCommandError - */ -const de_ReleasePhoneNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotencyException": - case "com.amazonaws.connect#IdempotencyException": - throw await de_IdempotencyExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ReplicateInstanceCommand - */ -export const de_ReplicateInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ReplicateInstanceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - Id: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ReplicateInstanceCommandError - */ -const de_ReplicateInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.connect#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ResumeContactCommand - */ -export const de_ResumeContactCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ResumeContactCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1ResumeContactCommandError - */ -const de_ResumeContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ResumeContactRecordingCommand - */ -export const de_ResumeContactRecordingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ResumeContactRecordingCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1ResumeContactRecordingCommandError - */ -const de_ResumeContactRecordingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchAvailablePhoneNumbersCommand - */ -export const de_SearchAvailablePhoneNumbersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchAvailablePhoneNumbersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AvailableNumbersList: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SearchAvailablePhoneNumbersCommandError - */ -const de_SearchAvailablePhoneNumbersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchContactsCommand - */ -export const de_SearchContactsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchContactsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Contacts: (_) => de_Contacts(_, context), - NextToken: __expectString, - TotalCount: __expectLong, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SearchContactsCommandError - */ -const de_SearchContactsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchHoursOfOperationsCommand - */ -export const de_SearchHoursOfOperationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchHoursOfOperationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ApproximateTotalCount: __expectLong, - HoursOfOperations: (_) => de_HoursOfOperationList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SearchHoursOfOperationsCommandError - */ -const de_SearchHoursOfOperationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchPredefinedAttributesCommand - */ -export const de_SearchPredefinedAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchPredefinedAttributesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ApproximateTotalCount: __expectLong, - NextToken: __expectString, - PredefinedAttributes: (_) => de_PredefinedAttributeSearchSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SearchPredefinedAttributesCommandError - */ -const de_SearchPredefinedAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchPromptsCommand - */ -export const de_SearchPromptsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchPromptsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ApproximateTotalCount: __expectLong, - NextToken: __expectString, - Prompts: (_) => de_PromptList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SearchPromptsCommandError - */ -const de_SearchPromptsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchQueuesCommand - */ -export const de_SearchQueuesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchQueuesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ApproximateTotalCount: __expectLong, - NextToken: __expectString, - Queues: (_) => de_QueueSearchSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SearchQueuesCommandError - */ -const de_SearchQueuesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchQuickConnectsCommand - */ -export const de_SearchQuickConnectsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchQuickConnectsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ApproximateTotalCount: __expectLong, + MetricResults: (_) => de_HistoricalMetricResults(_, context), NextToken: __expectString, - QuickConnects: (_) => de_QuickConnectSearchSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SearchQuickConnectsCommandError - */ -const de_SearchQuickConnectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchResourceTagsCommand + * deserializeAws_restJson1GetMetricDataV2Command */ -export const de_SearchResourceTagsCommand = async ( +export const de_GetMetricDataV2Command = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchResourceTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + MetricResults: (_) => de_MetricResultsV2(_, context), NextToken: __expectString, - Tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SearchResourceTagsCommandError - */ -const de_SearchResourceTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MaximumResultReturnedException": - case "com.amazonaws.connect#MaximumResultReturnedException": - throw await de_MaximumResultReturnedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchRoutingProfilesCommand + * deserializeAws_restJson1GetPromptFileCommand */ -export const de_SearchRoutingProfilesCommand = async ( +export const de_GetPromptFileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchRoutingProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ApproximateTotalCount: __expectLong, - NextToken: __expectString, - RoutingProfiles: (_) => de_RoutingProfileList(_, context), + LastModifiedRegion: __expectString, + LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + PromptPresignedUrl: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SearchRoutingProfilesCommandError + * deserializeAws_restJson1GetTaskTemplateCommand */ -const de_SearchRoutingProfilesCommandError = async ( +export const de_GetTaskTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Constraints: _json, + ContactFlowId: __expectString, + CreatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Defaults: _json, + Description: __expectString, + Fields: _json, + Id: __expectString, + InstanceId: __expectString, + LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Name: __expectString, + Status: __expectString, + Tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SearchSecurityProfilesCommand + * deserializeAws_restJson1GetTrafficDistributionCommand */ -export const de_SearchSecurityProfilesCommand = async ( +export const de_GetTrafficDistributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchSecurityProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ApproximateTotalCount: __expectLong, - NextToken: __expectString, - SecurityProfiles: _json, + AgentConfig: _json, + Arn: __expectString, + Id: __expectString, + SignInConfig: _json, + TelephonyConfig: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SearchSecurityProfilesCommandError + * deserializeAws_restJson1ImportPhoneNumberCommand */ -const de_SearchSecurityProfilesCommandError = async ( +export const de_ImportPhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PhoneNumberArn: __expectString, + PhoneNumberId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SearchUsersCommand + * deserializeAws_restJson1ListAgentStatusesCommand */ -export const de_SearchUsersCommand = async ( +export const de_ListAgentStatusesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchUsersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ApproximateTotalCount: __expectLong, + AgentStatusSummaryList: (_) => de_AgentStatusSummaryList(_, context), NextToken: __expectString, - Users: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SearchUsersCommandError - */ -const de_SearchUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchVocabulariesCommand + * deserializeAws_restJson1ListAnalyticsDataAssociationsCommand */ -export const de_SearchVocabulariesCommand = async ( +export const de_ListAnalyticsDataAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchVocabulariesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -17137,1436 +8805,995 @@ export const de_SearchVocabulariesCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { NextToken: __expectString, - VocabularySummaryList: (_) => de_VocabularySummaryList(_, context), + Results: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SearchVocabulariesCommandError - */ -const de_SearchVocabulariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SendChatIntegrationEventCommand + * deserializeAws_restJson1ListApprovedOriginsCommand */ -export const de_SendChatIntegrationEventCommand = async ( +export const de_ListApprovedOriginsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendChatIntegrationEventCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - InitialContactId: __expectString, - NewChatCreated: __expectBoolean, + NextToken: __expectString, + Origins: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SendChatIntegrationEventCommandError + * deserializeAws_restJson1ListBotsCommand */ -const de_SendChatIntegrationEventCommandError = async ( +export const de_ListBotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LexBots: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartChatContactCommand + * deserializeAws_restJson1ListContactEvaluationsCommand */ -export const de_StartChatContactCommand = async ( +export const de_ListContactEvaluationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartChatContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ContactId: __expectString, - ContinuedFromContactId: __expectString, - ParticipantId: __expectString, - ParticipantToken: __expectString, + EvaluationSummaryList: (_) => de_EvaluationSummaryList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartChatContactCommandError - */ -const de_StartChatContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartContactEvaluationCommand + * deserializeAws_restJson1ListContactFlowModulesCommand */ -export const de_StartContactEvaluationCommand = async ( +export const de_ListContactFlowModulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartContactEvaluationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - EvaluationArn: __expectString, - EvaluationId: __expectString, + ContactFlowModulesSummaryList: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartContactEvaluationCommandError - */ -const de_StartContactEvaluationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartContactRecordingCommand + * deserializeAws_restJson1ListContactFlowsCommand */ -export const de_StartContactRecordingCommand = async ( +export const de_ListContactFlowsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartContactRecordingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ContactFlowSummaryList: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartContactRecordingCommandError + * deserializeAws_restJson1ListContactReferencesCommand */ -const de_StartContactRecordingCommandError = async ( +export const de_ListContactReferencesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + ReferenceSummaryList: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartContactStreamingCommand + * deserializeAws_restJson1ListDefaultVocabulariesCommand */ -export const de_StartContactStreamingCommand = async ( +export const de_ListDefaultVocabulariesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartContactStreamingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - StreamingId: __expectString, + DefaultVocabularyList: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartContactStreamingCommandError + * deserializeAws_restJson1ListEvaluationFormsCommand */ -const de_StartContactStreamingCommandError = async ( +export const de_ListEvaluationFormsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EvaluationFormSummaryList: (_) => de_EvaluationFormSummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartOutboundVoiceContactCommand + * deserializeAws_restJson1ListEvaluationFormVersionsCommand */ -export const de_StartOutboundVoiceContactCommand = async ( +export const de_ListEvaluationFormVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartOutboundVoiceContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ContactId: __expectString, + EvaluationFormVersionSummaryList: (_) => de_EvaluationFormVersionSummaryList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartOutboundVoiceContactCommandError + * deserializeAws_restJson1ListFlowAssociationsCommand */ -const de_StartOutboundVoiceContactCommandError = async ( +export const de_ListFlowAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DestinationNotAllowedException": - case "com.amazonaws.connect#DestinationNotAllowedException": - throw await de_DestinationNotAllowedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OutboundContactNotPermittedException": - case "com.amazonaws.connect#OutboundContactNotPermittedException": - throw await de_OutboundContactNotPermittedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + FlowAssociationSummaryList: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartTaskContactCommand + * deserializeAws_restJson1ListHoursOfOperationsCommand */ -export const de_StartTaskContactCommand = async ( +export const de_ListHoursOfOperationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartTaskContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ContactId: __expectString, + HoursOfOperationSummaryList: (_) => de_HoursOfOperationSummaryList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartTaskContactCommandError - */ -const de_StartTaskContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartWebRTCContactCommand + * deserializeAws_restJson1ListInstanceAttributesCommand */ -export const de_StartWebRTCContactCommand = async ( +export const de_ListInstanceAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartWebRTCContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ConnectionData: _json, - ContactId: __expectString, - ParticipantId: __expectString, - ParticipantToken: __expectString, + Attributes: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartWebRTCContactCommandError + * deserializeAws_restJson1ListInstancesCommand */ -const de_StartWebRTCContactCommandError = async ( +export const de_ListInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + InstanceSummaryList: (_) => de_InstanceSummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StopContactCommand + * deserializeAws_restJson1ListInstanceStorageConfigsCommand */ -export const de_StopContactCommand = async ( +export const de_ListInstanceStorageConfigsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + StorageConfigs: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StopContactCommandError + * deserializeAws_restJson1ListIntegrationAssociationsCommand */ -const de_StopContactCommandError = async ( +export const de_ListIntegrationAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContactNotFoundException": - case "com.amazonaws.connect#ContactNotFoundException": - throw await de_ContactNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + IntegrationAssociationSummaryList: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StopContactRecordingCommand + * deserializeAws_restJson1ListLambdaFunctionsCommand */ -export const de_StopContactRecordingCommand = async ( +export const de_ListLambdaFunctionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopContactRecordingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LambdaFunctions: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StopContactRecordingCommandError + * deserializeAws_restJson1ListLexBotsCommand */ -const de_StopContactRecordingCommandError = async ( +export const de_ListLexBotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LexBots: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StopContactStreamingCommand + * deserializeAws_restJson1ListPhoneNumbersCommand */ -export const de_StopContactStreamingCommand = async ( +export const de_ListPhoneNumbersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopContactStreamingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + PhoneNumberSummaryList: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StopContactStreamingCommandError + * deserializeAws_restJson1ListPhoneNumbersV2Command */ -const de_StopContactStreamingCommandError = async ( +export const de_ListPhoneNumbersV2Command = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ListPhoneNumbersSummaryList: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SubmitContactEvaluationCommand + * deserializeAws_restJson1ListPredefinedAttributesCommand */ -export const de_SubmitContactEvaluationCommand = async ( +export const de_ListPredefinedAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SubmitContactEvaluationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - EvaluationArn: __expectString, - EvaluationId: __expectString, + NextToken: __expectString, + PredefinedAttributeSummaryList: (_) => de_PredefinedAttributeSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SubmitContactEvaluationCommandError - */ -const de_SubmitContactEvaluationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SuspendContactRecordingCommand + * deserializeAws_restJson1ListPromptsCommand */ -export const de_SuspendContactRecordingCommand = async ( +export const de_ListPromptsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SuspendContactRecordingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + PromptSummaryList: (_) => de_PromptSummaryList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SuspendContactRecordingCommandError - */ -const de_SuspendContactRecordingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1TagContactCommand + * deserializeAws_restJson1ListQueueQuickConnectsCommand */ -export const de_TagContactCommand = async ( +export const de_ListQueueQuickConnectsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LastModifiedRegion: __expectString, + LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + NextToken: __expectString, + QuickConnectSummaryList: (_) => de_QuickConnectSummaryList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagContactCommandError + * deserializeAws_restJson1ListQueuesCommand */ -const de_TagContactCommandError = async ( +export const de_ListQueuesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + QueueSummaryList: (_) => de_QueueSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListQuickConnectsCommand */ -export const de_TagResourceCommand = async ( +export const de_ListQuickConnectsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + QuickConnectSummaryList: (_) => de_QuickConnectSummaryList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1ListRealtimeContactAnalysisSegmentsV2Command */ -const de_TagResourceCommandError = async ( +export const de_ListRealtimeContactAnalysisSegmentsV2Command = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Channel: __expectString, + NextToken: __expectString, + Segments: (_) => de_RealtimeContactAnalysisSegments(_, context), + Status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TransferContactCommand + * deserializeAws_restJson1ListRoutingProfileQueuesCommand */ -export const de_TransferContactCommand = async ( +export const de_ListRoutingProfileQueuesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TransferContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ContactArn: __expectString, - ContactId: __expectString, + LastModifiedRegion: __expectString, + LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + NextToken: __expectString, + RoutingProfileQueueConfigSummaryList: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TransferContactCommandError + * deserializeAws_restJson1ListRoutingProfilesCommand */ -const de_TransferContactCommandError = async ( +export const de_ListRoutingProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotencyException": - case "com.amazonaws.connect#IdempotencyException": - throw await de_IdempotencyExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + RoutingProfileSummaryList: (_) => de_RoutingProfileSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListRulesCommand + */ +export const de_ListRulesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + RuleSummaryList: (_) => de_RuleSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagContactCommand + * deserializeAws_restJson1ListSecurityKeysCommand */ -export const de_UntagContactCommand = async ( +export const de_ListSecurityKeysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + SecurityKeys: (_) => de_SecurityKeysList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagContactCommandError + * deserializeAws_restJson1ListSecurityProfileApplicationsCommand */ -const de_UntagContactCommandError = async ( +export const de_ListSecurityProfileApplicationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Applications: _json, + LastModifiedRegion: __expectString, + LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1ListSecurityProfilePermissionsCommand */ -export const de_UntagResourceCommand = async ( +export const de_ListSecurityProfilePermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LastModifiedRegion: __expectString, + LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + NextToken: __expectString, + Permissions: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1ListSecurityProfilesCommand */ -const de_UntagResourceCommandError = async ( +export const de_ListSecurityProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + SecurityProfileSummaryList: (_) => de_SecurityProfileSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateAgentStatusCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_UpdateAgentStatusCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAgentStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateAgentStatusCommandError + * deserializeAws_restJson1ListTaskTemplatesCommand */ -const de_UpdateAgentStatusCommandError = async ( +export const de_ListTaskTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + TaskTemplates: (_) => de_TaskTemplateList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateContactCommand + * deserializeAws_restJson1ListTrafficDistributionGroupsCommand */ -export const de_UpdateContactCommand = async ( +export const de_ListTrafficDistributionGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + TrafficDistributionGroupSummaryList: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateContactCommandError + * deserializeAws_restJson1ListTrafficDistributionGroupUsersCommand */ -const de_UpdateContactCommandError = async ( +export const de_ListTrafficDistributionGroupUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + TrafficDistributionGroupUserSummaryList: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateContactAttributesCommand + * deserializeAws_restJson1ListUseCasesCommand */ -export const de_UpdateContactAttributesCommand = async ( +export const de_ListUseCasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateContactAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + UseCaseSummaryList: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateContactAttributesCommandError + * deserializeAws_restJson1ListUserHierarchyGroupsCommand */ -const de_UpdateContactAttributesCommandError = async ( +export const de_ListUserHierarchyGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + UserHierarchyGroupSummaryList: (_) => de_HierarchyGroupSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateContactEvaluationCommand + * deserializeAws_restJson1ListUserProficienciesCommand */ -export const de_UpdateContactEvaluationCommand = async ( +export const de_ListUserProficienciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateContactEvaluationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - EvaluationArn: __expectString, - EvaluationId: __expectString, + LastModifiedRegion: __expectString, + LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + NextToken: __expectString, + UserProficiencyList: (_) => de_UserProficiencyList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateContactEvaluationCommandError + * deserializeAws_restJson1ListUsersCommand */ -const de_UpdateContactEvaluationCommandError = async ( +export const de_ListUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + UserSummaryList: (_) => de_UserSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateContactFlowContentCommand + * deserializeAws_restJson1ListViewsCommand */ -export const de_UpdateContactFlowContentCommand = async ( +export const de_ListViewsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateContactFlowContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + ViewsSummaryList: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateContactFlowContentCommandError + * deserializeAws_restJson1ListViewVersionsCommand */ -const de_UpdateContactFlowContentCommandError = async ( +export const de_ListViewVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidContactFlowException": - case "com.amazonaws.connect#InvalidContactFlowException": - throw await de_InvalidContactFlowExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + ViewVersionSummaryList: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateContactFlowMetadataCommand + * deserializeAws_restJson1MonitorContactCommand */ -export const de_UpdateContactFlowMetadataCommand = async ( +export const de_MonitorContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateContactFlowMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ContactArn: __expectString, + ContactId: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateContactFlowMetadataCommandError + * deserializeAws_restJson1PauseContactCommand */ -const de_UpdateContactFlowMetadataCommandError = async ( +export const de_PauseContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateContactFlowModuleContentCommand + * deserializeAws_restJson1PutUserStatusCommand */ -export const de_UpdateContactFlowModuleContentCommand = async ( +export const de_PutUserStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateContactFlowModuleContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -18576,116 +9803,70 @@ export const de_UpdateContactFlowModuleContentCommand = async ( }; /** - * deserializeAws_restJson1UpdateContactFlowModuleContentCommandError - */ -const de_UpdateContactFlowModuleContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidContactFlowModuleException": - case "com.amazonaws.connect#InvalidContactFlowModuleException": - throw await de_InvalidContactFlowModuleExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + * deserializeAws_restJson1ReleasePhoneNumberCommand + */ +export const de_ReleasePhoneNumberCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateContactFlowModuleMetadataCommand + * deserializeAws_restJson1ReplicateInstanceCommand */ -export const de_UpdateContactFlowModuleMetadataCommand = async ( +export const de_ReplicateInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateContactFlowModuleMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Id: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateContactFlowModuleMetadataCommandError + * deserializeAws_restJson1ResumeContactCommand */ -const de_UpdateContactFlowModuleMetadataCommandError = async ( +export const de_ResumeContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateContactFlowNameCommand + * deserializeAws_restJson1ResumeContactRecordingCommand */ -export const de_UpdateContactFlowNameCommand = async ( +export const de_ResumeContactRecordingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateContactFlowNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -18695,403 +9876,355 @@ export const de_UpdateContactFlowNameCommand = async ( }; /** - * deserializeAws_restJson1UpdateContactFlowNameCommandError + * deserializeAws_restJson1SearchAvailablePhoneNumbersCommand */ -const de_UpdateContactFlowNameCommandError = async ( +export const de_SearchAvailablePhoneNumbersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AvailableNumbersList: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateContactRoutingDataCommand + * deserializeAws_restJson1SearchContactsCommand */ -export const de_UpdateContactRoutingDataCommand = async ( +export const de_SearchContactsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateContactRoutingDataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Contacts: (_) => de_Contacts(_, context), + NextToken: __expectString, + TotalCount: __expectLong, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateContactRoutingDataCommandError + * deserializeAws_restJson1SearchHoursOfOperationsCommand */ -const de_UpdateContactRoutingDataCommandError = async ( +export const de_SearchHoursOfOperationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ApproximateTotalCount: __expectLong, + HoursOfOperations: (_) => de_HoursOfOperationList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateContactScheduleCommand + * deserializeAws_restJson1SearchPredefinedAttributesCommand */ -export const de_UpdateContactScheduleCommand = async ( +export const de_SearchPredefinedAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateContactScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ApproximateTotalCount: __expectLong, + NextToken: __expectString, + PredefinedAttributes: (_) => de_PredefinedAttributeSearchSummaryList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateContactScheduleCommandError + * deserializeAws_restJson1SearchPromptsCommand */ -const de_UpdateContactScheduleCommandError = async ( +export const de_SearchPromptsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.connect#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ApproximateTotalCount: __expectLong, + NextToken: __expectString, + Prompts: (_) => de_PromptList(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1SearchQueuesCommand + */ +export const de_SearchQueuesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ApproximateTotalCount: __expectLong, + NextToken: __expectString, + Queues: (_) => de_QueueSearchSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1SearchQuickConnectsCommand + */ +export const de_SearchQuickConnectsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ApproximateTotalCount: __expectLong, + NextToken: __expectString, + QuickConnects: (_) => de_QuickConnectSearchSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateEvaluationFormCommand + * deserializeAws_restJson1SearchResourceTagsCommand */ -export const de_UpdateEvaluationFormCommand = async ( +export const de_SearchResourceTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEvaluationFormCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - EvaluationFormArn: __expectString, - EvaluationFormId: __expectString, - EvaluationFormVersion: __expectInt32, + NextToken: __expectString, + Tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateEvaluationFormCommandError + * deserializeAws_restJson1SearchRoutingProfilesCommand */ -const de_UpdateEvaluationFormCommandError = async ( +export const de_SearchRoutingProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ApproximateTotalCount: __expectLong, + NextToken: __expectString, + RoutingProfiles: (_) => de_RoutingProfileList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateHoursOfOperationCommand + * deserializeAws_restJson1SearchSecurityProfilesCommand */ -export const de_UpdateHoursOfOperationCommand = async ( +export const de_SearchSecurityProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateHoursOfOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ApproximateTotalCount: __expectLong, + NextToken: __expectString, + SecurityProfiles: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateHoursOfOperationCommandError + * deserializeAws_restJson1SearchUsersCommand */ -const de_UpdateHoursOfOperationCommandError = async ( +export const de_SearchUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ApproximateTotalCount: __expectLong, + NextToken: __expectString, + Users: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateInstanceAttributeCommand + * deserializeAws_restJson1SearchVocabulariesCommand */ -export const de_UpdateInstanceAttributeCommand = async ( +export const de_SearchVocabulariesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateInstanceAttributeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + VocabularySummaryList: (_) => de_VocabularySummaryList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateInstanceAttributeCommandError + * deserializeAws_restJson1SendChatIntegrationEventCommand */ -const de_UpdateInstanceAttributeCommandError = async ( +export const de_SendChatIntegrationEventCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + InitialContactId: __expectString, + NewChatCreated: __expectBoolean, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateInstanceStorageConfigCommand + * deserializeAws_restJson1StartChatContactCommand */ -export const de_UpdateInstanceStorageConfigCommand = async ( +export const de_StartChatContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateInstanceStorageConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ContactId: __expectString, + ContinuedFromContactId: __expectString, + ParticipantId: __expectString, + ParticipantToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateInstanceStorageConfigCommandError + * deserializeAws_restJson1StartContactEvaluationCommand */ -const de_UpdateInstanceStorageConfigCommandError = async ( +export const de_StartContactEvaluationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EvaluationArn: __expectString, + EvaluationId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateParticipantRoleConfigCommand + * deserializeAws_restJson1StartContactRecordingCommand */ -export const de_UpdateParticipantRoleConfigCommand = async ( +export const de_StartContactRecordingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateParticipantRoleConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -19101,185 +10234,118 @@ export const de_UpdateParticipantRoleConfigCommand = async ( }; /** - * deserializeAws_restJson1UpdateParticipantRoleConfigCommandError + * deserializeAws_restJson1StartContactStreamingCommand */ -const de_UpdateParticipantRoleConfigCommandError = async ( +export const de_StartContactStreamingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + StreamingId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdatePhoneNumberCommand + * deserializeAws_restJson1StartOutboundVoiceContactCommand */ -export const de_UpdatePhoneNumberCommand = async ( +export const de_StartOutboundVoiceContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - PhoneNumberArn: __expectString, - PhoneNumberId: __expectString, + ContactId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdatePhoneNumberCommandError + * deserializeAws_restJson1StartTaskContactCommand */ -const de_UpdatePhoneNumberCommandError = async ( +export const de_StartTaskContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotencyException": - case "com.amazonaws.connect#IdempotencyException": - throw await de_IdempotencyExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ContactId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdatePhoneNumberMetadataCommand + * deserializeAws_restJson1StartWebRTCContactCommand */ -export const de_UpdatePhoneNumberMetadataCommand = async ( +export const de_StartWebRTCContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePhoneNumberMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ConnectionData: _json, + ContactId: __expectString, + ParticipantId: __expectString, + ParticipantToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdatePhoneNumberMetadataCommandError + * deserializeAws_restJson1StopContactCommand */ -const de_UpdatePhoneNumberMetadataCommandError = async ( +export const de_StopContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotencyException": - case "com.amazonaws.connect#IdempotencyException": - throw await de_IdempotencyExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdatePredefinedAttributeCommand + * deserializeAws_restJson1StopContactRecordingCommand */ -export const de_UpdatePredefinedAttributeCommand = async ( +export const de_StopContactRecordingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePredefinedAttributeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -19289,112 +10355,70 @@ export const de_UpdatePredefinedAttributeCommand = async ( }; /** - * deserializeAws_restJson1UpdatePredefinedAttributeCommandError + * deserializeAws_restJson1StopContactStreamingCommand */ -const de_UpdatePredefinedAttributeCommandError = async ( +export const de_StopContactStreamingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdatePromptCommand + * deserializeAws_restJson1SubmitContactEvaluationCommand */ -export const de_UpdatePromptCommand = async ( +export const de_SubmitContactEvaluationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePromptCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - PromptARN: __expectString, - PromptId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdatePromptCommandError - */ -const de_UpdatePromptCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + EvaluationArn: __expectString, + EvaluationId: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1SuspendContactRecordingCommand + */ +export const de_SuspendContactRecordingCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateQueueHoursOfOperationCommand + * deserializeAws_restJson1TagContactCommand */ -export const de_UpdateQueueHoursOfOperationCommand = async ( +export const de_TagContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateQueueHoursOfOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -19404,52 +10428,53 @@ export const de_UpdateQueueHoursOfOperationCommand = async ( }; /** - * deserializeAws_restJson1UpdateQueueHoursOfOperationCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_UpdateQueueHoursOfOperationCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateQueueMaxContactsCommand + * deserializeAws_restJson1TransferContactCommand */ -export const de_UpdateQueueMaxContactsCommand = async ( +export const de_TransferContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ContactArn: __expectString, + ContactId: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UntagContactCommand + */ +export const de_UntagContactCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateQueueMaxContactsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -19459,52 +10484,31 @@ export const de_UpdateQueueMaxContactsCommand = async ( }; /** - * deserializeAws_restJson1UpdateQueueMaxContactsCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UpdateQueueMaxContactsCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateQueueNameCommand + * deserializeAws_restJson1UpdateAgentStatusCommand */ -export const de_UpdateQueueNameCommand = async ( +export const de_UpdateAgentStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateQueueNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -19514,55 +10518,31 @@ export const de_UpdateQueueNameCommand = async ( }; /** - * deserializeAws_restJson1UpdateQueueNameCommandError + * deserializeAws_restJson1UpdateContactCommand */ -const de_UpdateQueueNameCommandError = async ( +export const de_UpdateContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateQueueOutboundCallerConfigCommand + * deserializeAws_restJson1UpdateContactAttributesCommand */ -export const de_UpdateQueueOutboundCallerConfigCommand = async ( +export const de_UpdateContactAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateQueueOutboundCallerConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -19572,52 +10552,36 @@ export const de_UpdateQueueOutboundCallerConfigCommand = async ( }; /** - * deserializeAws_restJson1UpdateQueueOutboundCallerConfigCommandError + * deserializeAws_restJson1UpdateContactEvaluationCommand */ -const de_UpdateQueueOutboundCallerConfigCommandError = async ( +export const de_UpdateContactEvaluationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EvaluationArn: __expectString, + EvaluationId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateQueueStatusCommand + * deserializeAws_restJson1UpdateContactFlowContentCommand */ -export const de_UpdateQueueStatusCommand = async ( +export const de_UpdateContactFlowContentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateQueueStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -19627,52 +10591,31 @@ export const de_UpdateQueueStatusCommand = async ( }; /** - * deserializeAws_restJson1UpdateQueueStatusCommandError + * deserializeAws_restJson1UpdateContactFlowMetadataCommand */ -const de_UpdateQueueStatusCommandError = async ( +export const de_UpdateContactFlowMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateQuickConnectConfigCommand + * deserializeAws_restJson1UpdateContactFlowModuleContentCommand */ -export const de_UpdateQuickConnectConfigCommand = async ( +export const de_UpdateContactFlowModuleContentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateQuickConnectConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -19682,52 +10625,31 @@ export const de_UpdateQuickConnectConfigCommand = async ( }; /** - * deserializeAws_restJson1UpdateQuickConnectConfigCommandError + * deserializeAws_restJson1UpdateContactFlowModuleMetadataCommand */ -const de_UpdateQuickConnectConfigCommandError = async ( +export const de_UpdateContactFlowModuleMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateQuickConnectNameCommand + * deserializeAws_restJson1UpdateContactFlowNameCommand */ -export const de_UpdateQuickConnectNameCommand = async ( +export const de_UpdateContactFlowNameCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateQuickConnectNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -19737,52 +10659,31 @@ export const de_UpdateQuickConnectNameCommand = async ( }; /** - * deserializeAws_restJson1UpdateQuickConnectNameCommandError + * deserializeAws_restJson1UpdateContactRoutingDataCommand */ -const de_UpdateQuickConnectNameCommandError = async ( +export const de_UpdateContactRoutingDataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateRoutingProfileAgentAvailabilityTimerCommand + * deserializeAws_restJson1UpdateContactScheduleCommand */ -export const de_UpdateRoutingProfileAgentAvailabilityTimerCommand = async ( +export const de_UpdateContactScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRoutingProfileAgentAvailabilityTimerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -19792,52 +10693,37 @@ export const de_UpdateRoutingProfileAgentAvailabilityTimerCommand = async ( }; /** - * deserializeAws_restJson1UpdateRoutingProfileAgentAvailabilityTimerCommandError + * deserializeAws_restJson1UpdateEvaluationFormCommand */ -const de_UpdateRoutingProfileAgentAvailabilityTimerCommandError = async ( +export const de_UpdateEvaluationFormCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EvaluationFormArn: __expectString, + EvaluationFormId: __expectString, + EvaluationFormVersion: __expectInt32, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateRoutingProfileConcurrencyCommand + * deserializeAws_restJson1UpdateHoursOfOperationCommand */ -export const de_UpdateRoutingProfileConcurrencyCommand = async ( +export const de_UpdateHoursOfOperationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRoutingProfileConcurrencyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -19847,52 +10733,48 @@ export const de_UpdateRoutingProfileConcurrencyCommand = async ( }; /** - * deserializeAws_restJson1UpdateRoutingProfileConcurrencyCommandError + * deserializeAws_restJson1UpdateInstanceAttributeCommand */ -const de_UpdateRoutingProfileConcurrencyCommandError = async ( +export const de_UpdateInstanceAttributeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateRoutingProfileDefaultOutboundQueueCommand + * deserializeAws_restJson1UpdateInstanceStorageConfigCommand */ -export const de_UpdateRoutingProfileDefaultOutboundQueueCommand = async ( +export const de_UpdateInstanceStorageConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateParticipantRoleConfigCommand + */ +export const de_UpdateParticipantRoleConfigCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRoutingProfileDefaultOutboundQueueCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -19902,52 +10784,53 @@ export const de_UpdateRoutingProfileDefaultOutboundQueueCommand = async ( }; /** - * deserializeAws_restJson1UpdateRoutingProfileDefaultOutboundQueueCommandError + * deserializeAws_restJson1UpdatePhoneNumberCommand */ -const de_UpdateRoutingProfileDefaultOutboundQueueCommandError = async ( +export const de_UpdatePhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PhoneNumberArn: __expectString, + PhoneNumberId: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UpdatePhoneNumberMetadataCommand + */ +export const de_UpdatePhoneNumberMetadataCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateRoutingProfileNameCommand + * deserializeAws_restJson1UpdatePredefinedAttributeCommand */ -export const de_UpdateRoutingProfileNameCommand = async ( +export const de_UpdatePredefinedAttributeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRoutingProfileNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -19957,55 +10840,36 @@ export const de_UpdateRoutingProfileNameCommand = async ( }; /** - * deserializeAws_restJson1UpdateRoutingProfileNameCommandError + * deserializeAws_restJson1UpdatePromptCommand */ -const de_UpdateRoutingProfileNameCommandError = async ( +export const de_UpdatePromptCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PromptARN: __expectString, + PromptId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateRoutingProfileQueuesCommand + * deserializeAws_restJson1UpdateQueueHoursOfOperationCommand */ -export const de_UpdateRoutingProfileQueuesCommand = async ( +export const de_UpdateQueueHoursOfOperationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRoutingProfileQueuesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20015,52 +10879,31 @@ export const de_UpdateRoutingProfileQueuesCommand = async ( }; /** - * deserializeAws_restJson1UpdateRoutingProfileQueuesCommandError + * deserializeAws_restJson1UpdateQueueMaxContactsCommand */ -const de_UpdateRoutingProfileQueuesCommandError = async ( +export const de_UpdateQueueMaxContactsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateRuleCommand + * deserializeAws_restJson1UpdateQueueNameCommand */ -export const de_UpdateRuleCommand = async ( +export const de_UpdateQueueNameCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20070,55 +10913,31 @@ export const de_UpdateRuleCommand = async ( }; /** - * deserializeAws_restJson1UpdateRuleCommandError + * deserializeAws_restJson1UpdateQueueOutboundCallerConfigCommand */ -const de_UpdateRuleCommandError = async ( +export const de_UpdateQueueOutboundCallerConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateSecurityProfileCommand + * deserializeAws_restJson1UpdateQueueStatusCommand */ -export const de_UpdateSecurityProfileCommand = async ( +export const de_UpdateQueueStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSecurityProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20128,125 +10947,82 @@ export const de_UpdateSecurityProfileCommand = async ( }; /** - * deserializeAws_restJson1UpdateSecurityProfileCommandError + * deserializeAws_restJson1UpdateQuickConnectConfigCommand */ -const de_UpdateSecurityProfileCommandError = async ( +export const de_UpdateQuickConnectConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateTaskTemplateCommand + * deserializeAws_restJson1UpdateQuickConnectNameCommand */ -export const de_UpdateTaskTemplateCommand = async ( +export const de_UpdateQuickConnectNameCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTaskTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - Constraints: _json, - ContactFlowId: __expectString, - CreatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - Defaults: _json, - Description: __expectString, - Fields: _json, - Id: __expectString, - InstanceId: __expectString, - LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - Name: __expectString, - Status: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1UpdateTaskTemplateCommandError + * deserializeAws_restJson1UpdateRoutingProfileAgentAvailabilityTimerCommand */ -const de_UpdateTaskTemplateCommandError = async ( +export const de_UpdateRoutingProfileAgentAvailabilityTimerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "PropertyValidationException": - case "com.amazonaws.connect#PropertyValidationException": - throw await de_PropertyValidationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateRoutingProfileConcurrencyCommand + */ +export const de_UpdateRoutingProfileConcurrencyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateTrafficDistributionCommand + * deserializeAws_restJson1UpdateRoutingProfileDefaultOutboundQueueCommand */ -export const de_UpdateTrafficDistributionCommand = async ( +export const de_UpdateRoutingProfileDefaultOutboundQueueCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTrafficDistributionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20256,55 +11032,31 @@ export const de_UpdateTrafficDistributionCommand = async ( }; /** - * deserializeAws_restJson1UpdateTrafficDistributionCommandError + * deserializeAws_restJson1UpdateRoutingProfileNameCommand */ -const de_UpdateTrafficDistributionCommandError = async ( +export const de_UpdateRoutingProfileNameCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.connect#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateUserHierarchyCommand + * deserializeAws_restJson1UpdateRoutingProfileQueuesCommand */ -export const de_UpdateUserHierarchyCommand = async ( +export const de_UpdateRoutingProfileQueuesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserHierarchyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20314,52 +11066,31 @@ export const de_UpdateUserHierarchyCommand = async ( }; /** - * deserializeAws_restJson1UpdateUserHierarchyCommandError + * deserializeAws_restJson1UpdateRuleCommand */ -const de_UpdateUserHierarchyCommandError = async ( +export const de_UpdateRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateUserHierarchyGroupNameCommand + * deserializeAws_restJson1UpdateSecurityProfileCommand */ -export const de_UpdateUserHierarchyGroupNameCommand = async ( +export const de_UpdateSecurityProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserHierarchyGroupNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20369,55 +11100,46 @@ export const de_UpdateUserHierarchyGroupNameCommand = async ( }; /** - * deserializeAws_restJson1UpdateUserHierarchyGroupNameCommandError + * deserializeAws_restJson1UpdateTaskTemplateCommand */ -const de_UpdateUserHierarchyGroupNameCommandError = async ( +export const de_UpdateTaskTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Constraints: _json, + ContactFlowId: __expectString, + CreatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Defaults: _json, + Description: __expectString, + Fields: _json, + Id: __expectString, + InstanceId: __expectString, + LastModifiedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Name: __expectString, + Status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateUserHierarchyStructureCommand + * deserializeAws_restJson1UpdateTrafficDistributionCommand */ -export const de_UpdateUserHierarchyStructureCommand = async ( +export const de_UpdateTrafficDistributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserHierarchyStructureCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20427,55 +11149,31 @@ export const de_UpdateUserHierarchyStructureCommand = async ( }; /** - * deserializeAws_restJson1UpdateUserHierarchyStructureCommandError + * deserializeAws_restJson1UpdateUserHierarchyCommand */ -const de_UpdateUserHierarchyStructureCommandError = async ( +export const de_UpdateUserHierarchyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateUserIdentityInfoCommand + * deserializeAws_restJson1UpdateUserHierarchyGroupNameCommand */ -export const de_UpdateUserIdentityInfoCommand = async ( +export const de_UpdateUserHierarchyGroupNameCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserIdentityInfoCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20485,52 +11183,31 @@ export const de_UpdateUserIdentityInfoCommand = async ( }; /** - * deserializeAws_restJson1UpdateUserIdentityInfoCommandError + * deserializeAws_restJson1UpdateUserHierarchyStructureCommand */ -const de_UpdateUserIdentityInfoCommandError = async ( +export const de_UpdateUserHierarchyStructureCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateUserPhoneConfigCommand + * deserializeAws_restJson1UpdateUserIdentityInfoCommand */ -export const de_UpdateUserPhoneConfigCommand = async ( +export const de_UpdateUserIdentityInfoCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserPhoneConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20540,41 +11217,20 @@ export const de_UpdateUserPhoneConfigCommand = async ( }; /** - * deserializeAws_restJson1UpdateUserPhoneConfigCommandError + * deserializeAws_restJson1UpdateUserPhoneConfigCommand */ -const de_UpdateUserPhoneConfigCommandError = async ( +export const de_UpdateUserPhoneConfigCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -20585,7 +11241,7 @@ export const de_UpdateUserProficienciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserProficienciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20594,44 +11250,6 @@ export const de_UpdateUserProficienciesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateUserProficienciesCommandError - */ -const de_UpdateUserProficienciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateUserRoutingProfileCommand */ @@ -20640,7 +11258,7 @@ export const de_UpdateUserRoutingProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserRoutingProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20649,44 +11267,6 @@ export const de_UpdateUserRoutingProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateUserRoutingProfileCommandError - */ -const de_UpdateUserRoutingProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateUserSecurityProfilesCommand */ @@ -20695,7 +11275,7 @@ export const de_UpdateUserSecurityProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserSecurityProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20704,44 +11284,6 @@ export const de_UpdateUserSecurityProfilesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateUserSecurityProfilesCommandError - */ -const de_UpdateUserSecurityProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateViewContentCommand */ @@ -20750,7 +11292,7 @@ export const de_UpdateViewContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateViewContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20763,50 +11305,6 @@ export const de_UpdateViewContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateViewContentCommandError - */ -const de_UpdateViewContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.connect#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.connect#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.connect#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.connect#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.connect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateViewMetadataCommand */ @@ -20815,7 +11313,7 @@ export const de_UpdateViewMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateViewMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20825,49 +11323,97 @@ export const de_UpdateViewMetadataCommand = async ( }; /** - * deserializeAws_restJson1UpdateViewMetadataCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateViewMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DuplicateResourceException": - case "com.amazonaws.connect#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); case "InternalServiceException": case "com.amazonaws.connect#InternalServiceException": throw await de_InternalServiceExceptionRes(parsedOutput, context); case "InvalidParameterException": case "com.amazonaws.connect#InvalidParameterException": throw await de_InvalidParameterExceptionRes(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.connect#ResourceConflictException": + throw await de_ResourceConflictExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.connect#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.connect#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); case "InvalidRequestException": case "com.amazonaws.connect#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.connect#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.connect#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.connect#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "IdempotencyException": + case "com.amazonaws.connect#IdempotencyException": + throw await de_IdempotencyExceptionRes(parsedOutput, context); + case "DuplicateResourceException": + case "com.amazonaws.connect#DuplicateResourceException": + throw await de_DuplicateResourceExceptionRes(parsedOutput, context); + case "InvalidContactFlowException": + case "com.amazonaws.connect#InvalidContactFlowException": + throw await de_InvalidContactFlowExceptionRes(parsedOutput, context); + case "InvalidContactFlowModuleException": + case "com.amazonaws.connect#InvalidContactFlowModuleException": + throw await de_InvalidContactFlowModuleExceptionRes(parsedOutput, context); + case "PropertyValidationException": + case "com.amazonaws.connect#PropertyValidationException": + throw await de_PropertyValidationExceptionRes(parsedOutput, context); + case "ResourceNotReadyException": + case "com.amazonaws.connect#ResourceNotReadyException": + throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); case "ResourceInUseException": case "com.amazonaws.connect#ResourceInUseException": throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.connect#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "ContactFlowNotPublishedException": + case "com.amazonaws.connect#ContactFlowNotPublishedException": + throw await de_ContactFlowNotPublishedExceptionRes(parsedOutput, context); + case "UserNotFoundException": + case "com.amazonaws.connect#UserNotFoundException": + throw await de_UserNotFoundExceptionRes(parsedOutput, context); + case "OutputTypeNotFoundException": + case "com.amazonaws.connect#OutputTypeNotFoundException": + throw await de_OutputTypeNotFoundExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.connect#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "MaximumResultReturnedException": + case "com.amazonaws.connect#MaximumResultReturnedException": + throw await de_MaximumResultReturnedExceptionRes(parsedOutput, context); + case "DestinationNotAllowedException": + case "com.amazonaws.connect#DestinationNotAllowedException": + throw await de_DestinationNotAllowedExceptionRes(parsedOutput, context); + case "OutboundContactNotPermittedException": + case "com.amazonaws.connect#OutboundContactNotPermittedException": + throw await de_OutboundContactNotPermittedExceptionRes(parsedOutput, context); + case "ContactNotFoundException": + case "com.amazonaws.connect#ContactNotFoundException": + throw await de_ContactNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts b/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts index 93383a0d6fc0..dd0d0fc19003 100644 --- a/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts +++ b/clients/client-connectcampaigns/src/protocols/Aws_restJson1.ts @@ -533,7 +533,7 @@ export const de_CreateCampaignCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCampaignCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -548,50 +548,6 @@ export const de_CreateCampaignCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCampaignCommandError - */ -const de_CreateCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcampaigns#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connectcampaigns#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcampaigns#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteCampaignCommand */ @@ -600,7 +556,7 @@ export const de_DeleteCampaignCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCampaignCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -609,41 +565,6 @@ export const de_DeleteCampaignCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteCampaignCommandError - */ -const de_DeleteCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteConnectInstanceConfigCommand */ @@ -652,7 +573,7 @@ export const de_DeleteConnectInstanceConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConnectInstanceConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -661,47 +582,6 @@ export const de_DeleteConnectInstanceConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteConnectInstanceConfigCommandError - */ -const de_DeleteConnectInstanceConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.connectcampaigns#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcampaigns#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteInstanceOnboardingJobCommand */ @@ -710,7 +590,7 @@ export const de_DeleteInstanceOnboardingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteInstanceOnboardingJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -719,44 +599,6 @@ export const de_DeleteInstanceOnboardingJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteInstanceOnboardingJobCommandError - */ -const de_DeleteInstanceOnboardingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.connectcampaigns#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeCampaignCommand */ @@ -765,7 +607,7 @@ export const de_DescribeCampaignCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeCampaignCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -778,41 +620,6 @@ export const de_DescribeCampaignCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeCampaignCommandError - */ -const de_DescribeCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCampaignStateCommand */ @@ -821,7 +628,7 @@ export const de_GetCampaignStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCampaignStateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -834,44 +641,6 @@ export const de_GetCampaignStateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCampaignStateCommandError - */ -const de_GetCampaignStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcampaigns#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCampaignStateBatchCommand */ @@ -880,7 +649,7 @@ export const de_GetCampaignStateBatchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCampaignStateBatchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -894,41 +663,6 @@ export const de_GetCampaignStateBatchCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCampaignStateBatchCommandError - */ -const de_GetCampaignStateBatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcampaigns#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConnectInstanceConfigCommand */ @@ -937,7 +671,7 @@ export const de_GetConnectInstanceConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConnectInstanceConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -951,49 +685,14 @@ export const de_GetConnectInstanceConfigCommand = async ( }; /** - * deserializeAws_restJson1GetConnectInstanceConfigCommandError + * deserializeAws_restJson1GetInstanceOnboardingJobStatusCommand */ -const de_GetConnectInstanceConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetInstanceOnboardingJobStatusCommand - */ -export const de_GetInstanceOnboardingJobStatusCommand = async ( +export const de_GetInstanceOnboardingJobStatusCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInstanceOnboardingJobStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1006,41 +705,6 @@ export const de_GetInstanceOnboardingJobStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetInstanceOnboardingJobStatusCommandError - */ -const de_GetInstanceOnboardingJobStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCampaignsCommand */ @@ -1049,7 +713,7 @@ export const de_ListCampaignsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCampaignsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1063,38 +727,6 @@ export const de_ListCampaignsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCampaignsCommandError - */ -const de_ListCampaignsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1103,7 +735,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1116,44 +748,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcampaigns#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PauseCampaignCommand */ @@ -1162,7 +756,7 @@ export const de_PauseCampaignCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PauseCampaignCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1171,309 +765,54 @@ export const de_PauseCampaignCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PauseCampaignCommandError - */ -const de_PauseCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcampaigns#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidCampaignStateException": - case "com.amazonaws.connectcampaigns#InvalidCampaignStateException": - throw await de_InvalidCampaignStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcampaigns#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutDialRequestBatchCommand */ export const de_PutDialRequestBatchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutDialRequestBatchCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - failedRequests: _json, - successfulRequests: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutDialRequestBatchCommandError - */ -const de_PutDialRequestBatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcampaigns#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidCampaignStateException": - case "com.amazonaws.connectcampaigns#InvalidCampaignStateException": - throw await de_InvalidCampaignStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcampaigns#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ResumeCampaignCommand - */ -export const de_ResumeCampaignCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ResumeCampaignCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1ResumeCampaignCommandError - */ -const de_ResumeCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcampaigns#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidCampaignStateException": - case "com.amazonaws.connectcampaigns#InvalidCampaignStateException": - throw await de_InvalidCampaignStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcampaigns#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartCampaignCommand - */ -export const de_StartCampaignCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartCampaignCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1StartCampaignCommandError - */ -const de_StartCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcampaigns#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidCampaignStateException": - case "com.amazonaws.connectcampaigns#InvalidCampaignStateException": - throw await de_InvalidCampaignStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcampaigns#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartInstanceOnboardingJobCommand - */ -export const de_StartInstanceOnboardingJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartInstanceOnboardingJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - connectInstanceOnboardingJobStatus: _json, + failedRequests: _json, + successfulRequests: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartInstanceOnboardingJobCommandError + * deserializeAws_restJson1ResumeCampaignCommand */ -const de_StartInstanceOnboardingJobCommandError = async ( +export const de_ResumeCampaignCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcampaigns#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcampaigns#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1StopCampaignCommand + * deserializeAws_restJson1StartCampaignCommand */ -export const de_StopCampaignCommand = async ( +export const de_StartCampaignCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopCampaignCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1483,58 +822,35 @@ export const de_StopCampaignCommand = async ( }; /** - * deserializeAws_restJson1StopCampaignCommandError + * deserializeAws_restJson1StartInstanceOnboardingJobCommand */ -const de_StopCampaignCommandError = async ( +export const de_StartInstanceOnboardingJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcampaigns#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidCampaignStateException": - case "com.amazonaws.connectcampaigns#InvalidCampaignStateException": - throw await de_InvalidCampaignStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcampaigns#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + connectInstanceOnboardingJobStatus: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1StopCampaignCommand */ -export const de_TagResourceCommand = async ( +export const de_StopCampaignCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1544,41 +860,20 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcampaigns#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -1589,7 +884,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1598,44 +893,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcampaigns#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateCampaignDialerConfigCommand */ @@ -1644,7 +901,7 @@ export const de_UpdateCampaignDialerConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCampaignDialerConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1653,44 +910,6 @@ export const de_UpdateCampaignDialerConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateCampaignDialerConfigCommandError - */ -const de_UpdateCampaignDialerConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcampaigns#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateCampaignNameCommand */ @@ -1699,7 +918,7 @@ export const de_UpdateCampaignNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCampaignNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1708,44 +927,6 @@ export const de_UpdateCampaignNameCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateCampaignNameCommandError - */ -const de_UpdateCampaignNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcampaigns#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcampaigns#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcampaigns#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcampaigns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcampaigns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateCampaignOutboundCallConfigCommand */ @@ -1754,7 +935,7 @@ export const de_UpdateCampaignOutboundCallConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCampaignOutboundCallConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1764,12 +945,9 @@ export const de_UpdateCampaignOutboundCallConfigCommand = async ( }; /** - * deserializeAws_restJson1UpdateCampaignOutboundCallConfigCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateCampaignOutboundCallConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1788,19 +966,28 @@ const de_UpdateCampaignOutboundCallConfigCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.connectcampaigns#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.connectcampaigns#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.connectcampaigns#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.connectcampaigns#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "InvalidStateException": + case "com.amazonaws.connectcampaigns#InvalidStateException": + throw await de_InvalidStateExceptionRes(parsedOutput, context); + case "InvalidCampaignStateException": + case "com.amazonaws.connectcampaigns#InvalidCampaignStateException": + throw await de_InvalidCampaignStateExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-connectcases/src/protocols/Aws_restJson1.ts b/clients/client-connectcases/src/protocols/Aws_restJson1.ts index 27be5a03da38..ab84c0d90dd0 100644 --- a/clients/client-connectcases/src/protocols/Aws_restJson1.ts +++ b/clients/client-connectcases/src/protocols/Aws_restJson1.ts @@ -824,7 +824,7 @@ export const de_BatchGetFieldCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetFieldCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -838,44 +838,6 @@ export const de_BatchGetFieldCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetFieldCommandError - */ -const de_BatchGetFieldCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchPutFieldOptionsCommand */ @@ -884,7 +846,7 @@ export const de_BatchPutFieldOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchPutFieldOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -897,47 +859,6 @@ export const de_BatchPutFieldOptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchPutFieldOptionsCommandError - */ -const de_BatchPutFieldOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connectcases#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCaseCommand */ @@ -946,7 +867,7 @@ export const de_CreateCaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -960,47 +881,6 @@ export const de_CreateCaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCaseCommandError - */ -const de_CreateCaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcases#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDomainCommand */ @@ -1009,7 +889,7 @@ export const de_CreateDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1024,47 +904,6 @@ export const de_CreateDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDomainCommandError - */ -const de_CreateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcases#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connectcases#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFieldCommand */ @@ -1073,7 +912,7 @@ export const de_CreateFieldCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFieldCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1087,50 +926,6 @@ export const de_CreateFieldCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFieldCommandError - */ -const de_CreateFieldCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcases#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connectcases#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLayoutCommand */ @@ -1139,7 +934,7 @@ export const de_CreateLayoutCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLayoutCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1154,187 +949,58 @@ export const de_CreateLayoutCommand = async ( }; /** - * deserializeAws_restJson1CreateLayoutCommandError + * deserializeAws_restJson1CreateRelatedItemCommand */ -const de_CreateLayoutCommandError = async ( +export const de_CreateRelatedItemCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcases#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connectcases#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + relatedItemArn: __expectString, + relatedItemId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateRelatedItemCommand + * deserializeAws_restJson1CreateTemplateCommand */ -export const de_CreateRelatedItemCommand = async ( +export const de_CreateTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRelatedItemCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - relatedItemArn: __expectString, - relatedItemId: __expectString, + templateArn: __expectString, + templateId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateRelatedItemCommandError + * deserializeAws_restJson1DeleteDomainCommand */ -const de_CreateRelatedItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connectcases#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateTemplateCommand - */ -export const de_CreateTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - templateArn: __expectString, - templateId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateTemplateCommandError - */ -const de_CreateTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcases#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connectcases#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDomainCommand - */ -export const de_DeleteDomainCommand = async ( +export const de_DeleteDomainCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1343,47 +1009,6 @@ export const de_DeleteDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDomainCommandError - */ -const de_DeleteDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcases#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCaseCommand */ @@ -1392,7 +1017,7 @@ export const de_GetCaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1408,44 +1033,6 @@ export const de_GetCaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCaseCommandError - */ -const de_GetCaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCaseAuditEventsCommand */ @@ -1454,7 +1041,7 @@ export const de_GetCaseAuditEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCaseAuditEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1468,44 +1055,6 @@ export const de_GetCaseAuditEventsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCaseAuditEventsCommandError - */ -const de_GetCaseAuditEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCaseEventConfigurationCommand */ @@ -1514,7 +1063,7 @@ export const de_GetCaseEventConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCaseEventConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1527,44 +1076,6 @@ export const de_GetCaseEventConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCaseEventConfigurationCommandError - */ -const de_GetCaseEventConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDomainCommand */ @@ -1573,7 +1084,7 @@ export const de_GetDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1588,541 +1099,115 @@ export const de_GetDomainCommand = async ( tags: (_) => de_Tags(_, context), }); Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDomainCommandError - */ -const de_GetDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetLayoutCommand - */ -export const de_GetLayoutCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLayoutCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - content: (_) => _json(__expectUnion(_)), - layoutArn: __expectString, - layoutId: __expectString, - name: __expectString, - tags: (_) => de_Tags(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetLayoutCommandError - */ -const de_GetLayoutCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetTemplateCommand - */ -export const de_GetTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - description: __expectString, - layoutConfiguration: _json, - name: __expectString, - requiredFields: _json, - status: __expectString, - tags: (_) => de_Tags(_, context), - templateArn: __expectString, - templateId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetTemplateCommandError - */ -const de_GetTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListCasesForContactCommand - */ -export const de_ListCasesForContactCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCasesForContactCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - cases: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListCasesForContactCommandError - */ -const de_ListCasesForContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDomainsCommand - */ -export const de_ListDomainsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDomainsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - domains: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDomainsCommandError - */ -const de_ListDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListFieldOptionsCommand - */ -export const de_ListFieldOptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFieldOptionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - options: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListFieldOptionsCommandError - */ -const de_ListFieldOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListFieldsCommand - */ -export const de_ListFieldsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFieldsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - fields: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListFieldsCommandError - */ -const de_ListFieldsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return contents; }; /** - * deserializeAws_restJson1ListLayoutsCommand + * deserializeAws_restJson1GetLayoutCommand */ -export const de_ListLayoutsCommand = async ( +export const de_GetLayoutCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLayoutsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - layouts: _json, - nextToken: __expectString, + content: (_) => _json(__expectUnion(_)), + layoutArn: __expectString, + layoutId: __expectString, + name: __expectString, + tags: (_) => de_Tags(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListLayoutsCommandError + * deserializeAws_restJson1GetTemplateCommand */ -const de_ListLayoutsCommandError = async ( +export const de_GetTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + description: __expectString, + layoutConfiguration: _json, + name: __expectString, + requiredFields: _json, + status: __expectString, + tags: (_) => de_Tags(_, context), + templateArn: __expectString, + templateId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListCasesForContactCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListCasesForContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: (_) => de_Tags(_, context), + cases: _json, + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListDomainsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListDomainsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + domains: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTemplatesCommand + * deserializeAws_restJson1ListFieldOptionsCommand */ -export const de_ListTemplatesCommand = async ( +export const de_ListFieldOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2130,223 +1215,158 @@ export const de_ListTemplatesCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - templates: _json, + options: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTemplatesCommandError + * deserializeAws_restJson1ListFieldsCommand */ -const de_ListTemplatesCommandError = async ( +export const de_ListFieldsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + fields: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutCaseEventConfigurationCommand + * deserializeAws_restJson1ListLayoutsCommand */ -export const de_PutCaseEventConfigurationCommand = async ( +export const de_ListLayoutsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutCaseEventConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + layouts: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutCaseEventConfigurationCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_PutCaseEventConfigurationCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: (_) => de_Tags(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SearchCasesCommand + * deserializeAws_restJson1ListTemplatesCommand */ -export const de_SearchCasesCommand = async ( +export const de_ListTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchCasesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - cases: (_) => de_SearchCasesResponseItemList(_, context), nextToken: __expectString, + templates: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SearchCasesCommandError - */ -const de_SearchCasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + * deserializeAws_restJson1PutCaseEventConfigurationCommand + */ +export const de_PutCaseEventConfigurationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1SearchRelatedItemsCommand + * deserializeAws_restJson1SearchCasesCommand */ -export const de_SearchRelatedItemsCommand = async ( +export const de_SearchCasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchRelatedItemsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + cases: (_) => de_SearchCasesResponseItemList(_, context), nextToken: __expectString, - relatedItems: (_) => de_SearchRelatedItemsResponseItemList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SearchRelatedItemsCommandError + * deserializeAws_restJson1SearchRelatedItemsCommand */ -const de_SearchRelatedItemsCommandError = async ( +export const de_SearchRelatedItemsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + relatedItems: (_) => de_SearchRelatedItemsResponseItemList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2357,7 +1377,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2366,44 +1386,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2412,7 +1394,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2421,44 +1403,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateCaseCommand */ @@ -2467,7 +1411,7 @@ export const de_UpdateCaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2476,44 +1420,6 @@ export const de_UpdateCaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateCaseCommandError - */ -const de_UpdateCaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFieldCommand */ @@ -2522,7 +1428,7 @@ export const de_UpdateFieldCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFieldCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2531,47 +1437,6 @@ export const de_UpdateFieldCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFieldCommandError - */ -const de_UpdateFieldCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcases#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLayoutCommand */ @@ -2580,7 +1445,7 @@ export const de_UpdateLayoutCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLayoutCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2589,50 +1454,6 @@ export const de_UpdateLayoutCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLayoutCommandError - */ -const de_UpdateLayoutCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectcases#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcases#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectcases#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectcases#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connectcases#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectcases#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectcases#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTemplateCommand */ @@ -2641,7 +1462,7 @@ export const de_UpdateTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2651,12 +1472,9 @@ export const de_UpdateTemplateCommand = async ( }; /** - * deserializeAws_restJson1UpdateTemplateCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2666,9 +1484,6 @@ const de_UpdateTemplateCommandError = async ( case "AccessDeniedException": case "com.amazonaws.connectcases#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectcases#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.connectcases#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); @@ -2681,13 +1496,19 @@ const de_UpdateTemplateCommandError = async ( case "ValidationException": case "com.amazonaws.connectcases#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.connectcases#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.connectcases#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts b/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts index c3c82cd4a258..5b6a57032034 100644 --- a/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts +++ b/clients/client-connectparticipant/src/protocols/Aws_restJson1.ts @@ -278,7 +278,7 @@ export const de_CompleteAttachmentUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CompleteAttachmentUploadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -287,47 +287,6 @@ export const de_CompleteAttachmentUploadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CompleteAttachmentUploadCommandError - */ -const de_CompleteAttachmentUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectparticipant#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectparticipant#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectparticipant#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.connectparticipant#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectparticipant#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectparticipant#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateParticipantConnectionCommand */ @@ -336,7 +295,7 @@ export const de_CreateParticipantConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateParticipantConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -350,41 +309,6 @@ export const de_CreateParticipantConnectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateParticipantConnectionCommandError - */ -const de_CreateParticipantConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectparticipant#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectparticipant#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectparticipant#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectparticipant#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeViewCommand */ @@ -393,7 +317,7 @@ export const de_DescribeViewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeViewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -406,44 +330,6 @@ export const de_DescribeViewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeViewCommandError - */ -const de_DescribeViewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectparticipant#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectparticipant#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.connectparticipant#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectparticipant#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectparticipant#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisconnectParticipantCommand */ @@ -452,7 +338,7 @@ export const de_DisconnectParticipantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisconnectParticipantCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -461,41 +347,6 @@ export const de_DisconnectParticipantCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisconnectParticipantCommandError - */ -const de_DisconnectParticipantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectparticipant#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectparticipant#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectparticipant#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectparticipant#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAttachmentCommand */ @@ -504,7 +355,7 @@ export const de_GetAttachmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAttachmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -518,41 +369,6 @@ export const de_GetAttachmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAttachmentCommandError - */ -const de_GetAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectparticipant#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectparticipant#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectparticipant#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectparticipant#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTranscriptCommand */ @@ -561,7 +377,7 @@ export const de_GetTranscriptCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTranscriptCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -576,41 +392,6 @@ export const de_GetTranscriptCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTranscriptCommandError - */ -const de_GetTranscriptCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectparticipant#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectparticipant#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectparticipant#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectparticipant#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SendEventCommand */ @@ -619,7 +400,7 @@ export const de_SendEventCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendEventCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -633,44 +414,6 @@ export const de_SendEventCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SendEventCommandError - */ -const de_SendEventCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectparticipant#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.connectparticipant#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectparticipant#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectparticipant#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectparticipant#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SendMessageCommand */ @@ -679,7 +422,7 @@ export const de_SendMessageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -693,41 +436,6 @@ export const de_SendMessageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SendMessageCommandError - */ -const de_SendMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.connectparticipant#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.connectparticipant#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.connectparticipant#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.connectparticipant#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartAttachmentUploadCommand */ @@ -736,7 +444,7 @@ export const de_StartAttachmentUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartAttachmentUploadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -751,12 +459,9 @@ export const de_StartAttachmentUploadCommand = async ( }; /** - * deserializeAws_restJson1StartAttachmentUploadCommandError + * deserialize_Aws_restJson1CommandError */ -const de_StartAttachmentUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -766,6 +471,9 @@ const de_StartAttachmentUploadCommandError = async ( case "AccessDeniedException": case "com.amazonaws.connectparticipant#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.connectparticipant#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.connectparticipant#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); @@ -778,13 +486,16 @@ const de_StartAttachmentUploadCommandError = async ( case "ValidationException": case "com.amazonaws.connectparticipant#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.connectparticipant#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-controltower/src/protocols/Aws_restJson1.ts b/clients/client-controltower/src/protocols/Aws_restJson1.ts index 6c73ce465ce9..62586b27b11e 100644 --- a/clients/client-controltower/src/protocols/Aws_restJson1.ts +++ b/clients/client-controltower/src/protocols/Aws_restJson1.ts @@ -438,7 +438,7 @@ export const de_CreateLandingZoneCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLandingZoneCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -452,44 +452,6 @@ export const de_CreateLandingZoneCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLandingZoneCommandError - */ -const de_CreateLandingZoneCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.controltower#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.controltower#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.controltower#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.controltower#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.controltower#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteLandingZoneCommand */ @@ -498,7 +460,7 @@ export const de_DeleteLandingZoneCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLandingZoneCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -511,47 +473,6 @@ export const de_DeleteLandingZoneCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLandingZoneCommandError - */ -const de_DeleteLandingZoneCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.controltower#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.controltower#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.controltower#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.controltower#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.controltower#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.controltower#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisableControlCommand */ @@ -560,7 +481,7 @@ export const de_DisableControlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableControlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -573,50 +494,6 @@ export const de_DisableControlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisableControlCommandError - */ -const de_DisableControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.controltower#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.controltower#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.controltower#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.controltower#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.controltower#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.controltower#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.controltower#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1EnableControlCommand */ @@ -625,7 +502,7 @@ export const de_EnableControlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableControlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -639,50 +516,6 @@ export const de_EnableControlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1EnableControlCommandError - */ -const de_EnableControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.controltower#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.controltower#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.controltower#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.controltower#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.controltower#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.controltower#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.controltower#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetControlOperationCommand */ @@ -691,7 +524,7 @@ export const de_GetControlOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetControlOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -704,44 +537,6 @@ export const de_GetControlOperationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetControlOperationCommandError - */ -const de_GetControlOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.controltower#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.controltower#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.controltower#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.controltower#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.controltower#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEnabledControlCommand */ @@ -750,7 +545,7 @@ export const de_GetEnabledControlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEnabledControlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -763,44 +558,6 @@ export const de_GetEnabledControlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEnabledControlCommandError - */ -const de_GetEnabledControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.controltower#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.controltower#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.controltower#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.controltower#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.controltower#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLandingZoneCommand */ @@ -809,7 +566,7 @@ export const de_GetLandingZoneCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLandingZoneCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -822,101 +579,25 @@ export const de_GetLandingZoneCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLandingZoneCommandError - */ -const de_GetLandingZoneCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.controltower#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.controltower#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.controltower#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.controltower#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.controltower#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLandingZoneOperationCommand */ export const de_GetLandingZoneOperationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLandingZoneOperationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - operationDetails: (_) => de_LandingZoneOperationDetail(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetLandingZoneOperationCommandError - */ -const de_GetLandingZoneOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.controltower#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.controltower#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.controltower#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.controltower#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.controltower#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + operationDetails: (_) => de_LandingZoneOperationDetail(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -927,7 +608,7 @@ export const de_ListEnabledControlsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEnabledControlsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -941,44 +622,6 @@ export const de_ListEnabledControlsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEnabledControlsCommandError - */ -const de_ListEnabledControlsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.controltower#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.controltower#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.controltower#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.controltower#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.controltower#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListLandingZonesCommand */ @@ -987,7 +630,7 @@ export const de_ListLandingZonesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLandingZonesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1001,41 +644,6 @@ export const de_ListLandingZonesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListLandingZonesCommandError - */ -const de_ListLandingZonesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.controltower#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.controltower#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.controltower#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.controltower#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1044,7 +652,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1057,38 +665,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.controltower#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.controltower#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.controltower#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ResetLandingZoneCommand */ @@ -1097,7 +673,7 @@ export const de_ResetLandingZoneCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ResetLandingZoneCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1110,47 +686,6 @@ export const de_ResetLandingZoneCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ResetLandingZoneCommandError - */ -const de_ResetLandingZoneCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.controltower#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.controltower#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.controltower#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.controltower#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.controltower#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.controltower#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1159,7 +694,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1168,38 +703,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.controltower#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.controltower#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.controltower#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1208,7 +711,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1217,38 +720,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.controltower#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.controltower#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.controltower#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEnabledControlCommand */ @@ -1257,7 +728,7 @@ export const de_UpdateEnabledControlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEnabledControlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1270,50 +741,6 @@ export const de_UpdateEnabledControlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEnabledControlCommandError - */ -const de_UpdateEnabledControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.controltower#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.controltower#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.controltower#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.controltower#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.controltower#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.controltower#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.controltower#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLandingZoneCommand */ @@ -1322,7 +749,7 @@ export const de_UpdateLandingZoneCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLandingZoneCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1336,12 +763,9 @@ export const de_UpdateLandingZoneCommand = async ( }; /** - * deserializeAws_restJson1UpdateLandingZoneCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateLandingZoneCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1357,22 +781,25 @@ const de_UpdateLandingZoneCommandError = async ( case "InternalServerException": case "com.amazonaws.controltower#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.controltower#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.controltower#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.controltower#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.controltower#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.controltower#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts b/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts index e9129feeebdf..fb97cd0ded1a 100644 --- a/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-cost-and-usage-report-service/src/protocols/Aws_json1_1.ts @@ -155,7 +155,7 @@ export const de_DeleteReportDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteReportDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -167,35 +167,6 @@ export const de_DeleteReportDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteReportDefinitionCommandError - */ -const de_DeleteReportDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.costandusagereportservice#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.costandusagereportservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeReportDefinitionsCommand */ @@ -204,7 +175,7 @@ export const de_DescribeReportDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeReportDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -216,32 +187,6 @@ export const de_DescribeReportDefinitionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeReportDefinitionsCommandError - */ -const de_DescribeReportDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.costandusagereportservice#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -250,7 +195,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -262,38 +207,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.costandusagereportservice#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.costandusagereportservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.costandusagereportservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifyReportDefinitionCommand */ @@ -302,7 +215,7 @@ export const de_ModifyReportDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyReportDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -314,35 +227,6 @@ export const de_ModifyReportDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyReportDefinitionCommandError - */ -const de_ModifyReportDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.costandusagereportservice#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.costandusagereportservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutReportDefinitionCommand */ @@ -351,7 +235,7 @@ export const de_PutReportDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutReportDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -363,44 +247,6 @@ export const de_PutReportDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutReportDefinitionCommandError - */ -const de_PutReportDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateReportNameException": - case "com.amazonaws.costandusagereportservice#DuplicateReportNameException": - throw await de_DuplicateReportNameExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.costandusagereportservice#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "ReportLimitReachedException": - case "com.amazonaws.costandusagereportservice#ReportLimitReachedException": - throw await de_ReportLimitReachedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.costandusagereportservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.costandusagereportservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -409,7 +255,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -421,38 +267,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.costandusagereportservice#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.costandusagereportservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.costandusagereportservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -461,7 +275,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -474,12 +288,9 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -489,19 +300,25 @@ const de_UntagResourceCommandError = async ( case "InternalErrorException": case "com.amazonaws.costandusagereportservice#InternalErrorException": throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.costandusagereportservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.costandusagereportservice#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.costandusagereportservice#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "DuplicateReportNameException": + case "com.amazonaws.costandusagereportservice#DuplicateReportNameException": + throw await de_DuplicateReportNameExceptionRes(parsedOutput, context); + case "ReportLimitReachedException": + case "com.amazonaws.costandusagereportservice#ReportLimitReachedException": + throw await de_ReportLimitReachedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts b/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts index 0f7d22ce1108..9c95c974b134 100644 --- a/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts +++ b/clients/client-cost-explorer/src/protocols/Aws_json1_1.ts @@ -727,7 +727,7 @@ export const de_CreateAnomalyMonitorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAnomalyMonitorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -739,32 +739,6 @@ export const de_CreateAnomalyMonitorCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAnomalyMonitorCommandError - */ -const de_CreateAnomalyMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAnomalySubscriptionCommand */ @@ -773,7 +747,7 @@ export const de_CreateAnomalySubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAnomalySubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -785,35 +759,6 @@ export const de_CreateAnomalySubscriptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAnomalySubscriptionCommandError - */ -const de_CreateAnomalySubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnknownMonitorException": - case "com.amazonaws.costexplorer#UnknownMonitorException": - throw await de_UnknownMonitorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateCostCategoryDefinitionCommand */ @@ -822,7 +767,7 @@ export const de_CreateCostCategoryDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCostCategoryDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -834,35 +779,6 @@ export const de_CreateCostCategoryDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCostCategoryDefinitionCommandError - */ -const de_CreateCostCategoryDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.costexplorer#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAnomalyMonitorCommand */ @@ -871,7 +787,7 @@ export const de_DeleteAnomalyMonitorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAnomalyMonitorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -883,35 +799,6 @@ export const de_DeleteAnomalyMonitorCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAnomalyMonitorCommandError - */ -const de_DeleteAnomalyMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnknownMonitorException": - case "com.amazonaws.costexplorer#UnknownMonitorException": - throw await de_UnknownMonitorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAnomalySubscriptionCommand */ @@ -920,7 +807,7 @@ export const de_DeleteAnomalySubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAnomalySubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -932,35 +819,6 @@ export const de_DeleteAnomalySubscriptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAnomalySubscriptionCommandError - */ -const de_DeleteAnomalySubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnknownSubscriptionException": - case "com.amazonaws.costexplorer#UnknownSubscriptionException": - throw await de_UnknownSubscriptionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteCostCategoryDefinitionCommand */ @@ -969,7 +827,7 @@ export const de_DeleteCostCategoryDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCostCategoryDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -981,35 +839,6 @@ export const de_DeleteCostCategoryDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteCostCategoryDefinitionCommandError - */ -const de_DeleteCostCategoryDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.costexplorer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeCostCategoryDefinitionCommand */ @@ -1018,7 +847,7 @@ export const de_DescribeCostCategoryDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCostCategoryDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1030,35 +859,6 @@ export const de_DescribeCostCategoryDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeCostCategoryDefinitionCommandError - */ -const de_DescribeCostCategoryDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.costexplorer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAnomaliesCommand */ @@ -1067,7 +867,7 @@ export const de_GetAnomaliesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAnomaliesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1079,35 +879,6 @@ export const de_GetAnomaliesCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAnomaliesCommandError - */ -const de_GetAnomaliesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAnomalyMonitorsCommand */ @@ -1116,7 +887,7 @@ export const de_GetAnomalyMonitorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAnomalyMonitorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1129,51 +900,39 @@ export const de_GetAnomalyMonitorsCommand = async ( }; /** - * deserializeAws_json1_1GetAnomalyMonitorsCommandError + * deserializeAws_json1_1GetAnomalySubscriptionsCommand */ -const de_GetAnomalyMonitorsCommandError = async ( +export const de_GetAnomalySubscriptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnknownMonitorException": - case "com.amazonaws.costexplorer#UnknownMonitorException": - throw await de_UnknownMonitorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetAnomalySubscriptionsResponse(data, context); + const response: GetAnomalySubscriptionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetAnomalySubscriptionsCommand + * deserializeAws_json1_1GetCostAndUsageCommand */ -export const de_GetAnomalySubscriptionsCommand = async ( +export const de_GetCostAndUsageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetAnomalySubscriptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetAnomalySubscriptionsResponse(data, context); - const response: GetAnomalySubscriptionsCommandOutput = { + contents = _json(data); + const response: GetCostAndUsageCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1181,104 +940,14 @@ export const de_GetAnomalySubscriptionsCommand = async ( }; /** - * deserializeAws_json1_1GetAnomalySubscriptionsCommandError + * deserializeAws_json1_1GetCostAndUsageWithResourcesCommand */ -const de_GetAnomalySubscriptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnknownSubscriptionException": - case "com.amazonaws.costexplorer#UnknownSubscriptionException": - throw await de_UnknownSubscriptionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCostAndUsageCommand - */ -export const de_GetCostAndUsageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetCostAndUsageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetCostAndUsageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetCostAndUsageCommandError - */ -const de_GetCostAndUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BillExpirationException": - case "com.amazonaws.costexplorer#BillExpirationException": - throw await de_BillExpirationExceptionRes(parsedOutput, context); - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RequestChangedException": - case "com.amazonaws.costexplorer#RequestChangedException": - throw await de_RequestChangedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCostAndUsageWithResourcesCommand - */ -export const de_GetCostAndUsageWithResourcesCommand = async ( +export const de_GetCostAndUsageWithResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCostAndUsageWithResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1290,44 +959,6 @@ export const de_GetCostAndUsageWithResourcesCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCostAndUsageWithResourcesCommandError - */ -const de_GetCostAndUsageWithResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BillExpirationException": - case "com.amazonaws.costexplorer#BillExpirationException": - throw await de_BillExpirationExceptionRes(parsedOutput, context); - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RequestChangedException": - case "com.amazonaws.costexplorer#RequestChangedException": - throw await de_RequestChangedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetCostCategoriesCommand */ @@ -1336,7 +967,7 @@ export const de_GetCostCategoriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCostCategoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1348,44 +979,6 @@ export const de_GetCostCategoriesCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCostCategoriesCommandError - */ -const de_GetCostCategoriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BillExpirationException": - case "com.amazonaws.costexplorer#BillExpirationException": - throw await de_BillExpirationExceptionRes(parsedOutput, context); - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RequestChangedException": - case "com.amazonaws.costexplorer#RequestChangedException": - throw await de_RequestChangedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetCostForecastCommand */ @@ -1394,7 +987,7 @@ export const de_GetCostForecastCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCostForecastCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1406,35 +999,6 @@ export const de_GetCostForecastCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCostForecastCommandError - */ -const de_GetCostForecastCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetDimensionValuesCommand */ @@ -1443,7 +1007,7 @@ export const de_GetDimensionValuesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDimensionValuesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1455,44 +1019,6 @@ export const de_GetDimensionValuesCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetDimensionValuesCommandError - */ -const de_GetDimensionValuesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BillExpirationException": - case "com.amazonaws.costexplorer#BillExpirationException": - throw await de_BillExpirationExceptionRes(parsedOutput, context); - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RequestChangedException": - case "com.amazonaws.costexplorer#RequestChangedException": - throw await de_RequestChangedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetReservationCoverageCommand */ @@ -1501,7 +1027,7 @@ export const de_GetReservationCoverageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetReservationCoverageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1513,38 +1039,6 @@ export const de_GetReservationCoverageCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetReservationCoverageCommandError - */ -const de_GetReservationCoverageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetReservationPurchaseRecommendationCommand */ @@ -1553,7 +1047,7 @@ export const de_GetReservationPurchaseRecommendationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetReservationPurchaseRecommendationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1565,38 +1059,6 @@ export const de_GetReservationPurchaseRecommendationCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetReservationPurchaseRecommendationCommandError - */ -const de_GetReservationPurchaseRecommendationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetReservationUtilizationCommand */ @@ -1605,7 +1067,7 @@ export const de_GetReservationUtilizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetReservationUtilizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1617,38 +1079,6 @@ export const de_GetReservationUtilizationCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetReservationUtilizationCommandError - */ -const de_GetReservationUtilizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetRightsizingRecommendationCommand */ @@ -1657,162 +1087,32 @@ export const de_GetRightsizingRecommendationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRightsizingRecommendationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); const response: GetRightsizingRecommendationCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRightsizingRecommendationCommandError - */ -const de_GetRightsizingRecommendationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSavingsPlanPurchaseRecommendationDetailsCommand - */ -export const de_GetSavingsPlanPurchaseRecommendationDetailsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSavingsPlanPurchaseRecommendationDetailsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetSavingsPlanPurchaseRecommendationDetailsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSavingsPlanPurchaseRecommendationDetailsCommandError - */ -const de_GetSavingsPlanPurchaseRecommendationDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSavingsPlansCoverageCommand - */ -export const de_GetSavingsPlansCoverageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSavingsPlansCoverageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetSavingsPlansCoverageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSavingsPlansCoverageCommandError - */ -const de_GetSavingsPlansCoverageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetSavingsPlansPurchaseRecommendationCommand + * deserializeAws_json1_1GetSavingsPlanPurchaseRecommendationDetailsCommand */ -export const de_GetSavingsPlansPurchaseRecommendationCommand = async ( +export const de_GetSavingsPlanPurchaseRecommendationDetailsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetSavingsPlansPurchaseRecommendationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetSavingsPlansPurchaseRecommendationCommandOutput = { + const response: GetSavingsPlanPurchaseRecommendationDetailsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1820,48 +1120,39 @@ export const de_GetSavingsPlansPurchaseRecommendationCommand = async ( }; /** - * deserializeAws_json1_1GetSavingsPlansPurchaseRecommendationCommandError + * deserializeAws_json1_1GetSavingsPlansCoverageCommand */ -const de_GetSavingsPlansPurchaseRecommendationCommandError = async ( +export const de_GetSavingsPlansCoverageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetSavingsPlansCoverageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetSavingsPlansUtilizationCommand + * deserializeAws_json1_1GetSavingsPlansPurchaseRecommendationCommand */ -export const de_GetSavingsPlansUtilizationCommand = async ( +export const de_GetSavingsPlansPurchaseRecommendationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetSavingsPlansUtilizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetSavingsPlansUtilizationCommandOutput = { + const response: GetSavingsPlansPurchaseRecommendationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1869,32 +1160,23 @@ export const de_GetSavingsPlansUtilizationCommand = async ( }; /** - * deserializeAws_json1_1GetSavingsPlansUtilizationCommandError + * deserializeAws_json1_1GetSavingsPlansUtilizationCommand */ -const de_GetSavingsPlansUtilizationCommandError = async ( +export const de_GetSavingsPlansUtilizationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetSavingsPlansUtilizationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1905,7 +1187,7 @@ export const de_GetSavingsPlansUtilizationDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSavingsPlansUtilizationDetailsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1917,38 +1199,6 @@ export const de_GetSavingsPlansUtilizationDetailsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetSavingsPlansUtilizationDetailsCommandError - */ -const de_GetSavingsPlansUtilizationDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetTagsCommand */ @@ -1957,7 +1207,7 @@ export const de_GetTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1969,44 +1219,6 @@ export const de_GetTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetTagsCommandError - */ -const de_GetTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BillExpirationException": - case "com.amazonaws.costexplorer#BillExpirationException": - throw await de_BillExpirationExceptionRes(parsedOutput, context); - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RequestChangedException": - case "com.amazonaws.costexplorer#RequestChangedException": - throw await de_RequestChangedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetUsageForecastCommand */ @@ -2015,7 +1227,7 @@ export const de_GetUsageForecastCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetUsageForecastCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2027,38 +1239,6 @@ export const de_GetUsageForecastCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetUsageForecastCommandError - */ -const de_GetUsageForecastCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnresolvableUsageUnitException": - case "com.amazonaws.costexplorer#UnresolvableUsageUnitException": - throw await de_UnresolvableUsageUnitExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListCostAllocationTagsCommand */ @@ -2067,7 +1247,7 @@ export const de_ListCostAllocationTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListCostAllocationTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2079,35 +1259,6 @@ export const de_ListCostAllocationTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListCostAllocationTagsCommandError - */ -const de_ListCostAllocationTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListCostCategoryDefinitionsCommand */ @@ -2116,7 +1267,7 @@ export const de_ListCostCategoryDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListCostCategoryDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2128,32 +1279,6 @@ export const de_ListCostCategoryDefinitionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListCostCategoryDefinitionsCommandError - */ -const de_ListCostCategoryDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListSavingsPlansPurchaseRecommendationGenerationCommand */ @@ -2162,48 +1287,16 @@ export const de_ListSavingsPlansPurchaseRecommendationGenerationCommand = async context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSavingsPlansPurchaseRecommendationGenerationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListSavingsPlansPurchaseRecommendationGenerationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListSavingsPlansPurchaseRecommendationGenerationCommandError - */ -const de_ListSavingsPlansPurchaseRecommendationGenerationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.costexplorer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + contents = _json(data); + const response: ListSavingsPlansPurchaseRecommendationGenerationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2214,7 +1307,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2226,35 +1319,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.costexplorer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ProvideAnomalyFeedbackCommand */ @@ -2263,7 +1327,7 @@ export const de_ProvideAnomalyFeedbackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ProvideAnomalyFeedbackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2275,32 +1339,6 @@ export const de_ProvideAnomalyFeedbackCommand = async ( return response; }; -/** - * deserializeAws_json1_1ProvideAnomalyFeedbackCommandError - */ -const de_ProvideAnomalyFeedbackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartSavingsPlansPurchaseRecommendationGenerationCommand */ @@ -2309,7 +1347,7 @@ export const de_StartSavingsPlansPurchaseRecommendationGenerationCommand = async context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartSavingsPlansPurchaseRecommendationGenerationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2321,41 +1359,6 @@ export const de_StartSavingsPlansPurchaseRecommendationGenerationCommand = async return response; }; -/** - * deserializeAws_json1_1StartSavingsPlansPurchaseRecommendationGenerationCommandError - */ -const de_StartSavingsPlansPurchaseRecommendationGenerationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DataUnavailableException": - case "com.amazonaws.costexplorer#DataUnavailableException": - throw await de_DataUnavailableExceptionRes(parsedOutput, context); - case "GenerationExistsException": - case "com.amazonaws.costexplorer#GenerationExistsException": - throw await de_GenerationExistsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.costexplorer#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -2364,7 +1367,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2376,38 +1379,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.costexplorer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.costexplorer#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -2416,7 +1387,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2428,35 +1399,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.costexplorer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateAnomalyMonitorCommand */ @@ -2465,7 +1407,7 @@ export const de_UpdateAnomalyMonitorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateAnomalyMonitorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2477,35 +1419,6 @@ export const de_UpdateAnomalyMonitorCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateAnomalyMonitorCommandError - */ -const de_UpdateAnomalyMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnknownMonitorException": - case "com.amazonaws.costexplorer#UnknownMonitorException": - throw await de_UnknownMonitorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateAnomalySubscriptionCommand */ @@ -2514,7 +1427,7 @@ export const de_UpdateAnomalySubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateAnomalySubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2526,38 +1439,6 @@ export const de_UpdateAnomalySubscriptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateAnomalySubscriptionCommandError - */ -const de_UpdateAnomalySubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnknownMonitorException": - case "com.amazonaws.costexplorer#UnknownMonitorException": - throw await de_UnknownMonitorExceptionRes(parsedOutput, context); - case "UnknownSubscriptionException": - case "com.amazonaws.costexplorer#UnknownSubscriptionException": - throw await de_UnknownSubscriptionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateCostAllocationTagsStatusCommand */ @@ -2566,7 +1447,7 @@ export const de_UpdateCostAllocationTagsStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateCostAllocationTagsStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2578,32 +1459,6 @@ export const de_UpdateCostAllocationTagsStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateCostAllocationTagsStatusCommandError - */ -const de_UpdateCostAllocationTagsStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.costexplorer#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateCostCategoryDefinitionCommand */ @@ -2612,7 +1467,7 @@ export const de_UpdateCostCategoryDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateCostCategoryDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2625,12 +1480,9 @@ export const de_UpdateCostCategoryDefinitionCommand = async ( }; /** - * deserializeAws_json1_1UpdateCostCategoryDefinitionCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateCostCategoryDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2640,19 +1492,46 @@ const de_UpdateCostCategoryDefinitionCommandError = async ( case "LimitExceededException": case "com.amazonaws.costexplorer#LimitExceededException": throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.costexplorer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "UnknownMonitorException": + case "com.amazonaws.costexplorer#UnknownMonitorException": + throw await de_UnknownMonitorExceptionRes(parsedOutput, context); case "ServiceQuotaExceededException": case "com.amazonaws.costexplorer#ServiceQuotaExceededException": throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "UnknownSubscriptionException": + case "com.amazonaws.costexplorer#UnknownSubscriptionException": + throw await de_UnknownSubscriptionExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.costexplorer#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.costexplorer#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "BillExpirationException": + case "com.amazonaws.costexplorer#BillExpirationException": + throw await de_BillExpirationExceptionRes(parsedOutput, context); + case "DataUnavailableException": + case "com.amazonaws.costexplorer#DataUnavailableException": + throw await de_DataUnavailableExceptionRes(parsedOutput, context); + case "RequestChangedException": + case "com.amazonaws.costexplorer#RequestChangedException": + throw await de_RequestChangedExceptionRes(parsedOutput, context); + case "UnresolvableUsageUnitException": + case "com.amazonaws.costexplorer#UnresolvableUsageUnitException": + throw await de_UnresolvableUsageUnitExceptionRes(parsedOutput, context); + case "GenerationExistsException": + case "com.amazonaws.costexplorer#GenerationExistsException": + throw await de_GenerationExistsExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.costexplorer#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-cost-optimization-hub/src/protocols/Aws_json1_0.ts b/clients/client-cost-optimization-hub/src/protocols/Aws_json1_0.ts index 346ec1c79b50..430911ccaedc 100644 --- a/clients/client-cost-optimization-hub/src/protocols/Aws_json1_0.ts +++ b/clients/client-cost-optimization-hub/src/protocols/Aws_json1_0.ts @@ -197,7 +197,7 @@ export const de_GetPreferencesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPreferencesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -209,41 +209,6 @@ export const de_GetPreferencesCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetPreferencesCommandError - */ -const de_GetPreferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.costoptimizationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.costoptimizationhub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.costoptimizationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.costoptimizationhub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetRecommendationCommand */ @@ -252,7 +217,7 @@ export const de_GetRecommendationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRecommendationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -264,44 +229,6 @@ export const de_GetRecommendationCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetRecommendationCommandError - */ -const de_GetRecommendationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.costoptimizationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.costoptimizationhub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.costoptimizationhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.costoptimizationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.costoptimizationhub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListEnrollmentStatusesCommand */ @@ -310,7 +237,7 @@ export const de_ListEnrollmentStatusesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListEnrollmentStatusesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -322,41 +249,6 @@ export const de_ListEnrollmentStatusesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListEnrollmentStatusesCommandError - */ -const de_ListEnrollmentStatusesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.costoptimizationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.costoptimizationhub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.costoptimizationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.costoptimizationhub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListRecommendationsCommand */ @@ -365,7 +257,7 @@ export const de_ListRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -377,41 +269,6 @@ export const de_ListRecommendationsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListRecommendationsCommandError - */ -const de_ListRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.costoptimizationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.costoptimizationhub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.costoptimizationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.costoptimizationhub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListRecommendationSummariesCommand */ @@ -420,7 +277,7 @@ export const de_ListRecommendationSummariesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRecommendationSummariesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -432,41 +289,6 @@ export const de_ListRecommendationSummariesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListRecommendationSummariesCommandError - */ -const de_ListRecommendationSummariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.costoptimizationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.costoptimizationhub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.costoptimizationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.costoptimizationhub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateEnrollmentStatusCommand */ @@ -475,7 +297,7 @@ export const de_UpdateEnrollmentStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateEnrollmentStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -487,41 +309,6 @@ export const de_UpdateEnrollmentStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateEnrollmentStatusCommandError - */ -const de_UpdateEnrollmentStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.costoptimizationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.costoptimizationhub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.costoptimizationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.costoptimizationhub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdatePreferencesCommand */ @@ -530,7 +317,7 @@ export const de_UpdatePreferencesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePreferencesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -543,12 +330,9 @@ export const de_UpdatePreferencesCommand = async ( }; /** - * deserializeAws_json1_0UpdatePreferencesCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdatePreferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -567,13 +351,16 @@ const de_UpdatePreferencesCommandError = async ( case "ValidationException": case "com.amazonaws.costoptimizationhub#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.costoptimizationhub#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts b/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts index 2a10298f171e..5f150b2bc72f 100644 --- a/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts +++ b/clients/client-customer-profiles/src/protocols/Aws_restJson1.ts @@ -1416,7 +1416,7 @@ export const de_AddProfileKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AddProfileKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1430,44 +1430,6 @@ export const de_AddProfileKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddProfileKeyCommandError - */ -const de_AddProfileKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCalculatedAttributeDefinitionCommand */ @@ -1476,7 +1438,7 @@ export const de_CreateCalculatedAttributeDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCalculatedAttributeDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1497,44 +1459,6 @@ export const de_CreateCalculatedAttributeDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCalculatedAttributeDefinitionCommandError - */ -const de_CreateCalculatedAttributeDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDomainCommand */ @@ -1543,7 +1467,7 @@ export const de_CreateDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1564,44 +1488,6 @@ export const de_CreateDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDomainCommandError - */ -const de_CreateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateEventStreamCommand */ @@ -1610,7 +1496,7 @@ export const de_CreateEventStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEventStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1624,44 +1510,6 @@ export const de_CreateEventStreamCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEventStreamCommandError - */ -const de_CreateEventStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateIntegrationWorkflowCommand */ @@ -1670,7 +1518,7 @@ export const de_CreateIntegrationWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateIntegrationWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1684,44 +1532,6 @@ export const de_CreateIntegrationWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateIntegrationWorkflowCommandError - */ -const de_CreateIntegrationWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProfileCommand */ @@ -1730,7 +1540,7 @@ export const de_CreateProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1743,44 +1553,6 @@ export const de_CreateProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProfileCommandError - */ -const de_CreateProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteCalculatedAttributeDefinitionCommand */ @@ -1789,7 +1561,7 @@ export const de_DeleteCalculatedAttributeDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCalculatedAttributeDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1798,44 +1570,6 @@ export const de_DeleteCalculatedAttributeDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteCalculatedAttributeDefinitionCommandError - */ -const de_DeleteCalculatedAttributeDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDomainCommand */ @@ -1844,7 +1578,7 @@ export const de_DeleteDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1858,52 +1592,14 @@ export const de_DeleteDomainCommand = async ( }; /** - * deserializeAws_restJson1DeleteDomainCommandError + * deserializeAws_restJson1DeleteEventStreamCommand */ -const de_DeleteDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteEventStreamCommand - */ -export const de_DeleteEventStreamCommand = async ( +export const de_DeleteEventStreamCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEventStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1912,44 +1608,6 @@ export const de_DeleteEventStreamCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEventStreamCommandError - */ -const de_DeleteEventStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteIntegrationCommand */ @@ -1958,7 +1616,7 @@ export const de_DeleteIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1971,44 +1629,6 @@ export const de_DeleteIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteIntegrationCommandError - */ -const de_DeleteIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteProfileCommand */ @@ -2017,7 +1637,7 @@ export const de_DeleteProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2030,44 +1650,6 @@ export const de_DeleteProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteProfileCommandError - */ -const de_DeleteProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteProfileKeyCommand */ @@ -2076,7 +1658,7 @@ export const de_DeleteProfileKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProfileKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2089,44 +1671,6 @@ export const de_DeleteProfileKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteProfileKeyCommandError - */ -const de_DeleteProfileKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteProfileObjectCommand */ @@ -2135,7 +1679,7 @@ export const de_DeleteProfileObjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProfileObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2148,44 +1692,6 @@ export const de_DeleteProfileObjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteProfileObjectCommandError - */ -const de_DeleteProfileObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteProfileObjectTypeCommand */ @@ -2194,7 +1700,7 @@ export const de_DeleteProfileObjectTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProfileObjectTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2208,166 +1714,52 @@ export const de_DeleteProfileObjectTypeCommand = async ( }; /** - * deserializeAws_restJson1DeleteProfileObjectTypeCommandError + * deserializeAws_restJson1DeleteWorkflowCommand */ -const de_DeleteProfileObjectTypeCommandError = async ( +export const de_DeleteWorkflowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteWorkflowCommand + * deserializeAws_restJson1DetectProfileObjectTypeCommand */ -export const de_DeleteWorkflowCommand = async ( +export const de_DetectProfileObjectTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DetectedProfileObjectTypes: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteWorkflowCommandError + * deserializeAws_restJson1GetAutoMergingPreviewCommand */ -const de_DeleteWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DetectProfileObjectTypeCommand - */ -export const de_DetectProfileObjectTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DetectProfileObjectTypeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DetectedProfileObjectTypes: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DetectProfileObjectTypeCommandError - */ -const de_DetectProfileObjectTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAutoMergingPreviewCommand - */ -export const de_GetAutoMergingPreviewCommand = async ( +export const de_GetAutoMergingPreviewCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAutoMergingPreviewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2383,44 +1775,6 @@ export const de_GetAutoMergingPreviewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAutoMergingPreviewCommandError - */ -const de_GetAutoMergingPreviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCalculatedAttributeDefinitionCommand */ @@ -2429,7 +1783,7 @@ export const de_GetCalculatedAttributeDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCalculatedAttributeDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2450,44 +1804,6 @@ export const de_GetCalculatedAttributeDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCalculatedAttributeDefinitionCommandError - */ -const de_GetCalculatedAttributeDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCalculatedAttributeForProfileCommand */ @@ -2496,7 +1812,7 @@ export const de_GetCalculatedAttributeForProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCalculatedAttributeForProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2512,44 +1828,6 @@ export const de_GetCalculatedAttributeForProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCalculatedAttributeForProfileCommandError - */ -const de_GetCalculatedAttributeForProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDomainCommand */ @@ -2558,7 +1836,7 @@ export const de_GetDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2580,44 +1858,6 @@ export const de_GetDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDomainCommandError - */ -const de_GetDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEventStreamCommand */ @@ -2626,7 +1866,7 @@ export const de_GetEventStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEventStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2646,52 +1886,14 @@ export const de_GetEventStreamCommand = async ( }; /** - * deserializeAws_restJson1GetEventStreamCommandError + * deserializeAws_restJson1GetIdentityResolutionJobCommand */ -const de_GetEventStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetIdentityResolutionJobCommand - */ -export const de_GetIdentityResolutionJobCommand = async ( +export const de_GetIdentityResolutionJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIdentityResolutionJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2714,44 +1916,6 @@ export const de_GetIdentityResolutionJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetIdentityResolutionJobCommandError - */ -const de_GetIdentityResolutionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIntegrationCommand */ @@ -2760,7 +1924,7 @@ export const de_GetIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2781,44 +1945,6 @@ export const de_GetIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetIntegrationCommandError - */ -const de_GetIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMatchesCommand */ @@ -2827,7 +1953,7 @@ export const de_GetMatchesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMatchesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2843,44 +1969,6 @@ export const de_GetMatchesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMatchesCommandError - */ -const de_GetMatchesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetProfileObjectTypeCommand */ @@ -2889,7 +1977,7 @@ export const de_GetProfileObjectTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProfileObjectTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2913,44 +2001,6 @@ export const de_GetProfileObjectTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetProfileObjectTypeCommandError - */ -const de_GetProfileObjectTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetProfileObjectTypeTemplateCommand */ @@ -2959,7 +2009,7 @@ export const de_GetProfileObjectTypeTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProfileObjectTypeTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2978,44 +2028,6 @@ export const de_GetProfileObjectTypeTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetProfileObjectTypeTemplateCommandError - */ -const de_GetProfileObjectTypeTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSimilarProfilesCommand */ @@ -3024,7 +2036,7 @@ export const de_GetSimilarProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSimilarProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3042,44 +2054,6 @@ export const de_GetSimilarProfilesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSimilarProfilesCommandError - */ -const de_GetSimilarProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetWorkflowCommand */ @@ -3088,7 +2062,7 @@ export const de_GetWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3109,52 +2083,14 @@ export const de_GetWorkflowCommand = async ( }; /** - * deserializeAws_restJson1GetWorkflowCommandError + * deserializeAws_restJson1GetWorkflowStepsCommand */ -const de_GetWorkflowCommandError = async ( +export const de_GetWorkflowStepsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetWorkflowStepsCommand - */ -export const de_GetWorkflowStepsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkflowStepsCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3170,44 +2106,6 @@ export const de_GetWorkflowStepsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetWorkflowStepsCommandError - */ -const de_GetWorkflowStepsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAccountIntegrationsCommand */ @@ -3216,7 +2114,7 @@ export const de_ListAccountIntegrationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccountIntegrationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3230,44 +2128,6 @@ export const de_ListAccountIntegrationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAccountIntegrationsCommandError - */ -const de_ListAccountIntegrationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCalculatedAttributeDefinitionsCommand */ @@ -3276,7 +2136,7 @@ export const de_ListCalculatedAttributeDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCalculatedAttributeDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3290,44 +2150,6 @@ export const de_ListCalculatedAttributeDefinitionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCalculatedAttributeDefinitionsCommandError - */ -const de_ListCalculatedAttributeDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCalculatedAttributesForProfileCommand */ @@ -3336,7 +2158,7 @@ export const de_ListCalculatedAttributesForProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCalculatedAttributesForProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3350,44 +2172,6 @@ export const de_ListCalculatedAttributesForProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCalculatedAttributesForProfileCommandError - */ -const de_ListCalculatedAttributesForProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDomainsCommand */ @@ -3396,7 +2180,7 @@ export const de_ListDomainsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDomainsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3410,44 +2194,6 @@ export const de_ListDomainsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDomainsCommandError - */ -const de_ListDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEventStreamsCommand */ @@ -3456,7 +2202,7 @@ export const de_ListEventStreamsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEventStreamsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3470,44 +2216,6 @@ export const de_ListEventStreamsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEventStreamsCommandError - */ -const de_ListEventStreamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIdentityResolutionJobsCommand */ @@ -3516,7 +2224,7 @@ export const de_ListIdentityResolutionJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIdentityResolutionJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3530,44 +2238,6 @@ export const de_ListIdentityResolutionJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListIdentityResolutionJobsCommandError - */ -const de_ListIdentityResolutionJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIntegrationsCommand */ @@ -3576,7 +2246,7 @@ export const de_ListIntegrationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIntegrationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3591,52 +2261,14 @@ export const de_ListIntegrationsCommand = async ( }; /** - * deserializeAws_restJson1ListIntegrationsCommandError - */ -const de_ListIntegrationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListProfileObjectsCommand + * deserializeAws_restJson1ListProfileObjectsCommand */ export const de_ListProfileObjectsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProfileObjectsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3650,44 +2282,6 @@ export const de_ListProfileObjectsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListProfileObjectsCommandError - */ -const de_ListProfileObjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProfileObjectTypesCommand */ @@ -3696,7 +2290,7 @@ export const de_ListProfileObjectTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProfileObjectTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3710,44 +2304,6 @@ export const de_ListProfileObjectTypesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListProfileObjectTypesCommandError - */ -const de_ListProfileObjectTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProfileObjectTypeTemplatesCommand */ @@ -3756,7 +2312,7 @@ export const de_ListProfileObjectTypeTemplatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProfileObjectTypeTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3770,44 +2326,6 @@ export const de_ListProfileObjectTypeTemplatesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListProfileObjectTypeTemplatesCommandError - */ -const de_ListProfileObjectTypeTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRuleBasedMatchesCommand */ @@ -3816,7 +2334,7 @@ export const de_ListRuleBasedMatchesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRuleBasedMatchesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3830,44 +2348,6 @@ export const de_ListRuleBasedMatchesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRuleBasedMatchesCommandError - */ -const de_ListRuleBasedMatchesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -3876,7 +2356,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3889,38 +2369,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWorkflowsCommand */ @@ -3929,7 +2377,7 @@ export const de_ListWorkflowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkflowsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3943,44 +2391,6 @@ export const de_ListWorkflowsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListWorkflowsCommandError - */ -const de_ListWorkflowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1MergeProfilesCommand */ @@ -3989,7 +2399,7 @@ export const de_MergeProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MergeProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4003,164 +2413,53 @@ export const de_MergeProfilesCommand = async ( }; /** - * deserializeAws_restJson1MergeProfilesCommandError - */ -const de_MergeProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutIntegrationCommand - */ -export const de_PutIntegrationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutIntegrationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - DomainName: __expectString, - IsUnstructured: __expectBoolean, - LastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - ObjectTypeName: __expectString, - ObjectTypeNames: _json, - Tags: _json, - Uri: __expectString, - WorkflowId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutIntegrationCommandError - */ -const de_PutIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutProfileObjectCommand + * deserializeAws_restJson1PutIntegrationCommand */ -export const de_PutProfileObjectCommand = async ( +export const de_PutIntegrationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutProfileObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ProfileObjectUniqueKey: __expectString, + CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + DomainName: __expectString, + IsUnstructured: __expectBoolean, + LastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + ObjectTypeName: __expectString, + ObjectTypeNames: _json, + Tags: _json, + Uri: __expectString, + WorkflowId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutProfileObjectCommandError + * deserializeAws_restJson1PutProfileObjectCommand */ -const de_PutProfileObjectCommandError = async ( +export const de_PutProfileObjectCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ProfileObjectUniqueKey: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4171,7 +2470,7 @@ export const de_PutProfileObjectTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutProfileObjectTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4195,44 +2494,6 @@ export const de_PutProfileObjectTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutProfileObjectTypeCommandError - */ -const de_PutProfileObjectTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchProfilesCommand */ @@ -4241,7 +2502,7 @@ export const de_SearchProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4255,44 +2516,6 @@ export const de_SearchProfilesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchProfilesCommandError - */ -const de_SearchProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -4301,7 +2524,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4310,38 +2533,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -4350,7 +2541,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4359,38 +2550,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateCalculatedAttributeDefinitionCommand */ @@ -4399,7 +2558,7 @@ export const de_UpdateCalculatedAttributeDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCalculatedAttributeDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4420,44 +2579,6 @@ export const de_UpdateCalculatedAttributeDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateCalculatedAttributeDefinitionCommandError - */ -const de_UpdateCalculatedAttributeDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDomainCommand */ @@ -4466,7 +2587,7 @@ export const de_UpdateDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4487,44 +2608,6 @@ export const de_UpdateDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDomainCommandError - */ -const de_UpdateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.customerprofiles#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.customerprofiles#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.customerprofiles#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.customerprofiles#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.customerprofiles#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateProfileCommand */ @@ -4533,7 +2616,7 @@ export const de_UpdateProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4547,12 +2630,9 @@ export const de_UpdateProfileCommand = async ( }; /** - * deserializeAws_restJson1UpdateProfileCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4580,7 +2660,7 @@ const de_UpdateProfileCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts b/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts index f32706e873db..a35215da1ebf 100644 --- a/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts +++ b/clients/client-data-pipeline/src/protocols/Aws_json1_1.ts @@ -338,7 +338,7 @@ export const de_ActivatePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ActivatePipelineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -350,41 +350,6 @@ export const de_ActivatePipelineCommand = async ( return response; }; -/** - * deserializeAws_json1_1ActivatePipelineCommandError - */ -const de_ActivatePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PipelineDeletedException": - case "com.amazonaws.datapipeline#PipelineDeletedException": - throw await de_PipelineDeletedExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.datapipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddTagsCommand */ @@ -393,7 +358,7 @@ export const de_AddTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -405,41 +370,6 @@ export const de_AddTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddTagsCommandError - */ -const de_AddTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PipelineDeletedException": - case "com.amazonaws.datapipeline#PipelineDeletedException": - throw await de_PipelineDeletedExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.datapipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePipelineCommand */ @@ -448,7 +378,7 @@ export const de_CreatePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePipelineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -460,35 +390,6 @@ export const de_CreatePipelineCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePipelineCommandError - */ -const de_CreatePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeactivatePipelineCommand */ @@ -497,7 +398,7 @@ export const de_DeactivatePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeactivatePipelineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -509,41 +410,6 @@ export const de_DeactivatePipelineCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeactivatePipelineCommandError - */ -const de_DeactivatePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PipelineDeletedException": - case "com.amazonaws.datapipeline#PipelineDeletedException": - throw await de_PipelineDeletedExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.datapipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeletePipelineCommand */ @@ -552,7 +418,7 @@ export const de_DeletePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePipelineCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeletePipelineCommandOutput = { @@ -561,38 +427,6 @@ export const de_DeletePipelineCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeletePipelineCommandError - */ -const de_DeletePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.datapipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeObjectsCommand */ @@ -601,7 +435,7 @@ export const de_DescribeObjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeObjectsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -613,41 +447,6 @@ export const de_DescribeObjectsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeObjectsCommandError - */ -const de_DescribeObjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PipelineDeletedException": - case "com.amazonaws.datapipeline#PipelineDeletedException": - throw await de_PipelineDeletedExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.datapipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribePipelinesCommand */ @@ -656,7 +455,7 @@ export const de_DescribePipelinesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePipelinesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -668,41 +467,6 @@ export const de_DescribePipelinesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribePipelinesCommandError - */ -const de_DescribePipelinesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PipelineDeletedException": - case "com.amazonaws.datapipeline#PipelineDeletedException": - throw await de_PipelineDeletedExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.datapipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1EvaluateExpressionCommand */ @@ -711,7 +475,7 @@ export const de_EvaluateExpressionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EvaluateExpressionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -723,44 +487,6 @@ export const de_EvaluateExpressionCommand = async ( return response; }; -/** - * deserializeAws_json1_1EvaluateExpressionCommandError - */ -const de_EvaluateExpressionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PipelineDeletedException": - case "com.amazonaws.datapipeline#PipelineDeletedException": - throw await de_PipelineDeletedExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.datapipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "TaskNotFoundException": - case "com.amazonaws.datapipeline#TaskNotFoundException": - throw await de_TaskNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetPipelineDefinitionCommand */ @@ -769,7 +495,7 @@ export const de_GetPipelineDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPipelineDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -777,160 +503,24 @@ export const de_GetPipelineDefinitionCommand = async ( const response: GetPipelineDefinitionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetPipelineDefinitionCommandError - */ -const de_GetPipelineDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PipelineDeletedException": - case "com.amazonaws.datapipeline#PipelineDeletedException": - throw await de_PipelineDeletedExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.datapipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListPipelinesCommand - */ -export const de_ListPipelinesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPipelinesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListPipelinesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListPipelinesCommandError - */ -const de_ListPipelinesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PollForTaskCommand - */ -export const de_PollForTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PollForTaskCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PollForTaskCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PollForTaskCommandError - */ -const de_PollForTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TaskNotFoundException": - case "com.amazonaws.datapipeline#TaskNotFoundException": - throw await de_TaskNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }; + return response; }; /** - * deserializeAws_json1_1PutPipelineDefinitionCommand + * deserializeAws_json1_1ListPipelinesCommand */ -export const de_PutPipelineDefinitionCommand = async ( +export const de_ListPipelinesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutPipelineDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutPipelineDefinitionCommandOutput = { + const response: ListPipelinesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -938,54 +528,39 @@ export const de_PutPipelineDefinitionCommand = async ( }; /** - * deserializeAws_json1_1PutPipelineDefinitionCommandError + * deserializeAws_json1_1PollForTaskCommand */ -const de_PutPipelineDefinitionCommandError = async ( +export const de_PollForTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PipelineDeletedException": - case "com.amazonaws.datapipeline#PipelineDeletedException": - throw await de_PipelineDeletedExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.datapipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PollForTaskCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1QueryObjectsCommand + * deserializeAws_json1_1PutPipelineDefinitionCommand */ -export const de_QueryObjectsCommand = async ( +export const de_PutPipelineDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_QueryObjectsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: QueryObjectsCommandOutput = { + const response: PutPipelineDefinitionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -993,38 +568,23 @@ export const de_QueryObjectsCommand = async ( }; /** - * deserializeAws_json1_1QueryObjectsCommandError + * deserializeAws_json1_1QueryObjectsCommand */ -const de_QueryObjectsCommandError = async ( +export const de_QueryObjectsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PipelineDeletedException": - case "com.amazonaws.datapipeline#PipelineDeletedException": - throw await de_PipelineDeletedExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.datapipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: QueryObjectsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1035,7 +595,7 @@ export const de_RemoveTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1047,41 +607,6 @@ export const de_RemoveTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1RemoveTagsCommandError - */ -const de_RemoveTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PipelineDeletedException": - case "com.amazonaws.datapipeline#PipelineDeletedException": - throw await de_PipelineDeletedExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.datapipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ReportTaskProgressCommand */ @@ -1090,7 +615,7 @@ export const de_ReportTaskProgressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ReportTaskProgressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1102,44 +627,6 @@ export const de_ReportTaskProgressCommand = async ( return response; }; -/** - * deserializeAws_json1_1ReportTaskProgressCommandError - */ -const de_ReportTaskProgressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PipelineDeletedException": - case "com.amazonaws.datapipeline#PipelineDeletedException": - throw await de_PipelineDeletedExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.datapipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "TaskNotFoundException": - case "com.amazonaws.datapipeline#TaskNotFoundException": - throw await de_TaskNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ReportTaskRunnerHeartbeatCommand */ @@ -1148,7 +635,7 @@ export const de_ReportTaskRunnerHeartbeatCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ReportTaskRunnerHeartbeatCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1160,35 +647,6 @@ export const de_ReportTaskRunnerHeartbeatCommand = async ( return response; }; -/** - * deserializeAws_json1_1ReportTaskRunnerHeartbeatCommandError - */ -const de_ReportTaskRunnerHeartbeatCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SetStatusCommand */ @@ -1197,7 +655,7 @@ export const de_SetStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetStatusCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SetStatusCommandOutput = { @@ -1206,41 +664,6 @@ export const de_SetStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1SetStatusCommandError - */ -const de_SetStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PipelineDeletedException": - case "com.amazonaws.datapipeline#PipelineDeletedException": - throw await de_PipelineDeletedExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.datapipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SetTaskStatusCommand */ @@ -1249,7 +672,7 @@ export const de_SetTaskStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetTaskStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1261,44 +684,6 @@ export const de_SetTaskStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1SetTaskStatusCommandError - */ -const de_SetTaskStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.datapipeline#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datapipeline#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PipelineDeletedException": - case "com.amazonaws.datapipeline#PipelineDeletedException": - throw await de_PipelineDeletedExceptionRes(parsedOutput, context); - case "PipelineNotFoundException": - case "com.amazonaws.datapipeline#PipelineNotFoundException": - throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); - case "TaskNotFoundException": - case "com.amazonaws.datapipeline#TaskNotFoundException": - throw await de_TaskNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ValidatePipelineDefinitionCommand */ @@ -1307,7 +692,7 @@ export const de_ValidatePipelineDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ValidatePipelineDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1320,12 +705,9 @@ export const de_ValidatePipelineDefinitionCommand = async ( }; /** - * deserializeAws_json1_1ValidatePipelineDefinitionCommandError + * deserialize_Aws_json1_1CommandError */ -const de_ValidatePipelineDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1344,13 +726,16 @@ const de_ValidatePipelineDefinitionCommandError = async ( case "PipelineNotFoundException": case "com.amazonaws.datapipeline#PipelineNotFoundException": throw await de_PipelineNotFoundExceptionRes(parsedOutput, context); + case "TaskNotFoundException": + case "com.amazonaws.datapipeline#TaskNotFoundException": + throw await de_TaskNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts b/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts index 942f08d63485..2f800699240c 100644 --- a/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-database-migration-service/src/protocols/Aws_json1_1.ts @@ -2029,7 +2029,7 @@ export const de_AddTagsToResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsToResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2041,32 +2041,6 @@ export const de_AddTagsToResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddTagsToResourceCommandError - */ -const de_AddTagsToResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ApplyPendingMaintenanceActionCommand */ @@ -2075,7 +2049,7 @@ export const de_ApplyPendingMaintenanceActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ApplyPendingMaintenanceActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2087,32 +2061,6 @@ export const de_ApplyPendingMaintenanceActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1ApplyPendingMaintenanceActionCommandError - */ -const de_ApplyPendingMaintenanceActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchStartRecommendationsCommand */ @@ -2121,7 +2069,7 @@ export const de_BatchStartRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchStartRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2133,38 +2081,6 @@ export const de_BatchStartRecommendationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchStartRecommendationsCommandError - */ -const de_BatchStartRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelReplicationTaskAssessmentRunCommand */ @@ -2173,7 +2089,7 @@ export const de_CancelReplicationTaskAssessmentRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelReplicationTaskAssessmentRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2185,38 +2101,6 @@ export const de_CancelReplicationTaskAssessmentRunCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelReplicationTaskAssessmentRunCommandError - */ -const de_CancelReplicationTaskAssessmentRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDataProviderCommand */ @@ -2225,7 +2109,7 @@ export const de_CreateDataProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDataProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2237,38 +2121,6 @@ export const de_CreateDataProviderCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDataProviderCommandError - */ -const de_CreateDataProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateEndpointCommand */ @@ -2277,7 +2129,7 @@ export const de_CreateEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2290,63 +2142,39 @@ export const de_CreateEndpointCommand = async ( }; /** - * deserializeAws_json1_1CreateEndpointCommandError + * deserializeAws_json1_1CreateEventSubscriptionCommand */ -const de_CreateEndpointCommandError = async ( +export const de_CreateEventSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - case "S3AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#S3AccessDeniedFault": - throw await de_S3AccessDeniedFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateEventSubscriptionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateEventSubscriptionCommand + * deserializeAws_json1_1CreateFleetAdvisorCollectorCommand */ -export const de_CreateEventSubscriptionCommand = async ( +export const de_CreateFleetAdvisorCollectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateEventSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateEventSubscriptionCommandOutput = { + const response: CreateFleetAdvisorCollectorCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2354,72 +2182,39 @@ export const de_CreateEventSubscriptionCommand = async ( }; /** - * deserializeAws_json1_1CreateEventSubscriptionCommandError + * deserializeAws_json1_1CreateInstanceProfileCommand */ -const de_CreateEventSubscriptionCommandError = async ( +export const de_CreateInstanceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "KMSAccessDeniedFault": - case "com.amazonaws.databasemigrationservice#KMSAccessDeniedFault": - throw await de_KMSAccessDeniedFaultRes(parsedOutput, context); - case "KMSDisabledFault": - case "com.amazonaws.databasemigrationservice#KMSDisabledFault": - throw await de_KMSDisabledFaultRes(parsedOutput, context); - case "KMSInvalidStateFault": - case "com.amazonaws.databasemigrationservice#KMSInvalidStateFault": - throw await de_KMSInvalidStateFaultRes(parsedOutput, context); - case "KMSNotFoundFault": - case "com.amazonaws.databasemigrationservice#KMSNotFoundFault": - throw await de_KMSNotFoundFaultRes(parsedOutput, context); - case "KMSThrottlingFault": - case "com.amazonaws.databasemigrationservice#KMSThrottlingFault": - throw await de_KMSThrottlingFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - case "SNSInvalidTopicFault": - case "com.amazonaws.databasemigrationservice#SNSInvalidTopicFault": - throw await de_SNSInvalidTopicFaultRes(parsedOutput, context); - case "SNSNoAuthorizationFault": - case "com.amazonaws.databasemigrationservice#SNSNoAuthorizationFault": - throw await de_SNSNoAuthorizationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateInstanceProfileResponse(data, context); + const response: CreateInstanceProfileCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateFleetAdvisorCollectorCommand + * deserializeAws_json1_1CreateMigrationProjectCommand */ -export const de_CreateFleetAdvisorCollectorCommand = async ( +export const de_CreateMigrationProjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateFleetAdvisorCollectorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: CreateFleetAdvisorCollectorCommandOutput = { + contents = de_CreateMigrationProjectResponse(data, context); + const response: CreateMigrationProjectCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2427,2268 +2222,19 @@ export const de_CreateFleetAdvisorCollectorCommand = async ( }; /** - * deserializeAws_json1_1CreateFleetAdvisorCollectorCommandError + * deserializeAws_json1_1CreateReplicationConfigCommand */ -const de_CreateFleetAdvisorCollectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - case "S3AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#S3AccessDeniedFault": - throw await de_S3AccessDeniedFaultRes(parsedOutput, context); - case "S3ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#S3ResourceNotFoundFault": - throw await de_S3ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateInstanceProfileCommand - */ -export const de_CreateInstanceProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateInstanceProfileCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateInstanceProfileResponse(data, context); - const response: CreateInstanceProfileCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateInstanceProfileCommandError - */ -const de_CreateInstanceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - case "S3AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#S3AccessDeniedFault": - throw await de_S3AccessDeniedFaultRes(parsedOutput, context); - case "S3ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#S3ResourceNotFoundFault": - throw await de_S3ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateMigrationProjectCommand - */ -export const de_CreateMigrationProjectCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateMigrationProjectCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateMigrationProjectResponse(data, context); - const response: CreateMigrationProjectCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateMigrationProjectCommandError - */ -const de_CreateMigrationProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - case "S3AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#S3AccessDeniedFault": - throw await de_S3AccessDeniedFaultRes(parsedOutput, context); - case "S3ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#S3ResourceNotFoundFault": - throw await de_S3ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateReplicationConfigCommand - */ -export const de_CreateReplicationConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateReplicationConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateReplicationConfigResponse(data, context); - const response: CreateReplicationConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateReplicationConfigCommandError - */ -const de_CreateReplicationConfigCommandError = async ( +export const de_CreateReplicationConfigCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.databasemigrationservice#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ReplicationSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.databasemigrationservice#ReplicationSubnetGroupDoesNotCoverEnoughAZs": - throw await de_ReplicationSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateReplicationInstanceCommand - */ -export const de_CreateReplicationInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { if (output.statusCode >= 300) { - return de_CreateReplicationInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateReplicationInstanceResponse(data, context); - const response: CreateReplicationInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateReplicationInstanceCommandError - */ -const de_CreateReplicationInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InsufficientResourceCapacityFault": - case "com.amazonaws.databasemigrationservice#InsufficientResourceCapacityFault": - throw await de_InsufficientResourceCapacityFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.databasemigrationservice#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ReplicationSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.databasemigrationservice#ReplicationSubnetGroupDoesNotCoverEnoughAZs": - throw await de_ReplicationSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - case "StorageQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateReplicationSubnetGroupCommand - */ -export const de_CreateReplicationSubnetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateReplicationSubnetGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateReplicationSubnetGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateReplicationSubnetGroupCommandError - */ -const de_CreateReplicationSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.databasemigrationservice#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "ReplicationSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.databasemigrationservice#ReplicationSubnetGroupDoesNotCoverEnoughAZs": - throw await de_ReplicationSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateReplicationTaskCommand - */ -export const de_CreateReplicationTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateReplicationTaskCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateReplicationTaskResponse(data, context); - const response: CreateReplicationTaskCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateReplicationTaskCommandError - */ -const de_CreateReplicationTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteCertificateCommand - */ -export const de_DeleteCertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteCertificateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteCertificateResponse(data, context); - const response: DeleteCertificateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteCertificateCommandError - */ -const de_DeleteCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteConnectionCommand - */ -export const de_DeleteConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteConnectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteConnectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteConnectionCommandError - */ -const de_DeleteConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDataProviderCommand - */ -export const de_DeleteDataProviderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDataProviderCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteDataProviderResponse(data, context); - const response: DeleteDataProviderCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDataProviderCommandError - */ -const de_DeleteDataProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteEndpointCommand - */ -export const de_DeleteEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteEndpointCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteEndpointCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteEndpointCommandError - */ -const de_DeleteEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteEventSubscriptionCommand - */ -export const de_DeleteEventSubscriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteEventSubscriptionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteEventSubscriptionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteEventSubscriptionCommandError - */ -const de_DeleteEventSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteFleetAdvisorCollectorCommand - */ -export const de_DeleteFleetAdvisorCollectorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteFleetAdvisorCollectorCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteFleetAdvisorCollectorCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteFleetAdvisorCollectorCommandError - */ -const de_DeleteFleetAdvisorCollectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CollectorNotFoundFault": - case "com.amazonaws.databasemigrationservice#CollectorNotFoundFault": - throw await de_CollectorNotFoundFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteFleetAdvisorDatabasesCommand - */ -export const de_DeleteFleetAdvisorDatabasesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteFleetAdvisorDatabasesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteFleetAdvisorDatabasesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteFleetAdvisorDatabasesCommandError - */ -const de_DeleteFleetAdvisorDatabasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidOperationFault": - case "com.amazonaws.databasemigrationservice#InvalidOperationFault": - throw await de_InvalidOperationFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteInstanceProfileCommand - */ -export const de_DeleteInstanceProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteInstanceProfileCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteInstanceProfileResponse(data, context); - const response: DeleteInstanceProfileCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteInstanceProfileCommandError - */ -const de_DeleteInstanceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteMigrationProjectCommand - */ -export const de_DeleteMigrationProjectCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteMigrationProjectCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteMigrationProjectResponse(data, context); - const response: DeleteMigrationProjectCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteMigrationProjectCommandError - */ -const de_DeleteMigrationProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteReplicationConfigCommand - */ -export const de_DeleteReplicationConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteReplicationConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteReplicationConfigResponse(data, context); - const response: DeleteReplicationConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteReplicationConfigCommandError - */ -const de_DeleteReplicationConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteReplicationInstanceCommand - */ -export const de_DeleteReplicationInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteReplicationInstanceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteReplicationInstanceResponse(data, context); - const response: DeleteReplicationInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteReplicationInstanceCommandError - */ -const de_DeleteReplicationInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteReplicationSubnetGroupCommand - */ -export const de_DeleteReplicationSubnetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteReplicationSubnetGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteReplicationSubnetGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteReplicationSubnetGroupCommandError - */ -const de_DeleteReplicationSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteReplicationTaskCommand - */ -export const de_DeleteReplicationTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteReplicationTaskCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteReplicationTaskResponse(data, context); - const response: DeleteReplicationTaskCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteReplicationTaskCommandError - */ -const de_DeleteReplicationTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteReplicationTaskAssessmentRunCommand - */ -export const de_DeleteReplicationTaskAssessmentRunCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteReplicationTaskAssessmentRunCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteReplicationTaskAssessmentRunResponse(data, context); - const response: DeleteReplicationTaskAssessmentRunCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteReplicationTaskAssessmentRunCommandError - */ -const de_DeleteReplicationTaskAssessmentRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAccountAttributesCommand - */ -export const de_DescribeAccountAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAccountAttributesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeAccountAttributesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAccountAttributesCommandError - */ -const de_DescribeAccountAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1DescribeApplicableIndividualAssessmentsCommand - */ -export const de_DescribeApplicableIndividualAssessmentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeApplicableIndividualAssessmentsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeApplicableIndividualAssessmentsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeApplicableIndividualAssessmentsCommandError - */ -const de_DescribeApplicableIndividualAssessmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeCertificatesCommand - */ -export const de_DescribeCertificatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeCertificatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeCertificatesResponse(data, context); - const response: DescribeCertificatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeCertificatesCommandError - */ -const de_DescribeCertificatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeConnectionsCommand - */ -export const de_DescribeConnectionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeConnectionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeConnectionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeConnectionsCommandError - */ -const de_DescribeConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeConversionConfigurationCommand - */ -export const de_DescribeConversionConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeConversionConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeConversionConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeConversionConfigurationCommandError - */ -const de_DescribeConversionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDataProvidersCommand - */ -export const de_DescribeDataProvidersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDataProvidersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeDataProvidersResponse(data, context); - const response: DescribeDataProvidersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeDataProvidersCommandError - */ -const de_DescribeDataProvidersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeEndpointsCommand - */ -export const de_DescribeEndpointsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeEndpointsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeEndpointsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeEndpointsCommandError - */ -const de_DescribeEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeEndpointSettingsCommand - */ -export const de_DescribeEndpointSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeEndpointSettingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeEndpointSettingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeEndpointSettingsCommandError - */ -const de_DescribeEndpointSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1DescribeEndpointTypesCommand - */ -export const de_DescribeEndpointTypesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeEndpointTypesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeEndpointTypesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeEndpointTypesCommandError - */ -const de_DescribeEndpointTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1DescribeEngineVersionsCommand - */ -export const de_DescribeEngineVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeEngineVersionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeEngineVersionsResponse(data, context); - const response: DescribeEngineVersionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeEngineVersionsCommandError - */ -const de_DescribeEngineVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1DescribeEventCategoriesCommand - */ -export const de_DescribeEventCategoriesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeEventCategoriesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeEventCategoriesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeEventCategoriesCommandError - */ -const de_DescribeEventCategoriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1DescribeEventsCommand - */ -export const de_DescribeEventsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeEventsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeEventsResponse(data, context); - const response: DescribeEventsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeEventsCommandError - */ -const de_DescribeEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1DescribeEventSubscriptionsCommand - */ -export const de_DescribeEventSubscriptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeEventSubscriptionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeEventSubscriptionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeEventSubscriptionsCommandError - */ -const de_DescribeEventSubscriptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeExtensionPackAssociationsCommand - */ -export const de_DescribeExtensionPackAssociationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeExtensionPackAssociationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeExtensionPackAssociationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeExtensionPackAssociationsCommandError - */ -const de_DescribeExtensionPackAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1DescribeFleetAdvisorCollectorsCommand - */ -export const de_DescribeFleetAdvisorCollectorsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFleetAdvisorCollectorsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeFleetAdvisorCollectorsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFleetAdvisorCollectorsCommandError - */ -const de_DescribeFleetAdvisorCollectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFleetAdvisorDatabasesCommand - */ -export const de_DescribeFleetAdvisorDatabasesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFleetAdvisorDatabasesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeFleetAdvisorDatabasesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFleetAdvisorDatabasesCommandError - */ -const de_DescribeFleetAdvisorDatabasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFleetAdvisorLsaAnalysisCommand - */ -export const de_DescribeFleetAdvisorLsaAnalysisCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFleetAdvisorLsaAnalysisCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeFleetAdvisorLsaAnalysisCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFleetAdvisorLsaAnalysisCommandError - */ -const de_DescribeFleetAdvisorLsaAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFleetAdvisorSchemaObjectSummaryCommand - */ -export const de_DescribeFleetAdvisorSchemaObjectSummaryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFleetAdvisorSchemaObjectSummaryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeFleetAdvisorSchemaObjectSummaryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFleetAdvisorSchemaObjectSummaryCommandError - */ -const de_DescribeFleetAdvisorSchemaObjectSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFleetAdvisorSchemasCommand - */ -export const de_DescribeFleetAdvisorSchemasCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFleetAdvisorSchemasCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeFleetAdvisorSchemasResponse(data, context); - const response: DescribeFleetAdvisorSchemasCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFleetAdvisorSchemasCommandError - */ -const de_DescribeFleetAdvisorSchemasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeInstanceProfilesCommand - */ -export const de_DescribeInstanceProfilesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeInstanceProfilesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeInstanceProfilesResponse(data, context); - const response: DescribeInstanceProfilesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeInstanceProfilesCommandError - */ -const de_DescribeInstanceProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeMetadataModelAssessmentsCommand - */ -export const de_DescribeMetadataModelAssessmentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeMetadataModelAssessmentsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeMetadataModelAssessmentsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeMetadataModelAssessmentsCommandError - */ -const de_DescribeMetadataModelAssessmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeMetadataModelConversionsCommand - */ -export const de_DescribeMetadataModelConversionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeMetadataModelConversionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeMetadataModelConversionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeMetadataModelConversionsCommandError - */ -const de_DescribeMetadataModelConversionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeMetadataModelExportsAsScriptCommand - */ -export const de_DescribeMetadataModelExportsAsScriptCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeMetadataModelExportsAsScriptCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeMetadataModelExportsAsScriptCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeMetadataModelExportsAsScriptCommandError - */ -const de_DescribeMetadataModelExportsAsScriptCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeMetadataModelExportsToTargetCommand - */ -export const de_DescribeMetadataModelExportsToTargetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeMetadataModelExportsToTargetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeMetadataModelExportsToTargetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeMetadataModelExportsToTargetCommandError - */ -const de_DescribeMetadataModelExportsToTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeMetadataModelImportsCommand - */ -export const de_DescribeMetadataModelImportsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeMetadataModelImportsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeMetadataModelImportsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeMetadataModelImportsCommandError - */ -const de_DescribeMetadataModelImportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeMigrationProjectsCommand - */ -export const de_DescribeMigrationProjectsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeMigrationProjectsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeMigrationProjectsResponse(data, context); - const response: DescribeMigrationProjectsCommandOutput = { + let contents: any = {}; + contents = de_CreateReplicationConfigResponse(data, context); + const response: CreateReplicationConfigCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4696,48 +2242,39 @@ export const de_DescribeMigrationProjectsCommand = async ( }; /** - * deserializeAws_json1_1DescribeMigrationProjectsCommandError + * deserializeAws_json1_1CreateReplicationInstanceCommand */ -const de_DescribeMigrationProjectsCommandError = async ( +export const de_CreateReplicationInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateReplicationInstanceResponse(data, context); + const response: CreateReplicationInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeOrderableReplicationInstancesCommand + * deserializeAws_json1_1CreateReplicationSubnetGroupCommand */ -export const de_DescribeOrderableReplicationInstancesCommand = async ( +export const de_CreateReplicationSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeOrderableReplicationInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeOrderableReplicationInstancesCommandOutput = { + const response: CreateReplicationSubnetGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4745,39 +2282,39 @@ export const de_DescribeOrderableReplicationInstancesCommand = async ( }; /** - * deserializeAws_json1_1DescribeOrderableReplicationInstancesCommandError + * deserializeAws_json1_1CreateReplicationTaskCommand */ -const de_DescribeOrderableReplicationInstancesCommandError = async ( +export const de_CreateReplicationTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateReplicationTaskResponse(data, context); + const response: CreateReplicationTaskCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; }; /** - * deserializeAws_json1_1DescribePendingMaintenanceActionsCommand + * deserializeAws_json1_1DeleteCertificateCommand */ -export const de_DescribePendingMaintenanceActionsCommand = async ( +export const de_DeleteCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribePendingMaintenanceActionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribePendingMaintenanceActionsResponse(data, context); - const response: DescribePendingMaintenanceActionsCommandOutput = { + contents = de_DeleteCertificateResponse(data, context); + const response: DeleteCertificateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4785,45 +2322,39 @@ export const de_DescribePendingMaintenanceActionsCommand = async ( }; /** - * deserializeAws_json1_1DescribePendingMaintenanceActionsCommandError + * deserializeAws_json1_1DeleteConnectionCommand */ -const de_DescribePendingMaintenanceActionsCommandError = async ( +export const de_DeleteConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteConnectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeRecommendationLimitationsCommand + * deserializeAws_json1_1DeleteDataProviderCommand */ -export const de_DescribeRecommendationLimitationsCommand = async ( +export const de_DeleteDataProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeRecommendationLimitationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeRecommendationLimitationsCommandOutput = { + contents = de_DeleteDataProviderResponse(data, context); + const response: DeleteDataProviderCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4831,48 +2362,39 @@ export const de_DescribeRecommendationLimitationsCommand = async ( }; /** - * deserializeAws_json1_1DescribeRecommendationLimitationsCommandError + * deserializeAws_json1_1DeleteEndpointCommand */ -const de_DescribeRecommendationLimitationsCommandError = async ( +export const de_DeleteEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeRecommendationsCommand + * deserializeAws_json1_1DeleteEventSubscriptionCommand */ -export const de_DescribeRecommendationsCommand = async ( +export const de_DeleteEventSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeRecommendationsResponse(data, context); - const response: DescribeRecommendationsCommandOutput = { + contents = _json(data); + const response: DeleteEventSubscriptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4880,48 +2402,36 @@ export const de_DescribeRecommendationsCommand = async ( }; /** - * deserializeAws_json1_1DescribeRecommendationsCommandError + * deserializeAws_json1_1DeleteFleetAdvisorCollectorCommand */ -const de_DescribeRecommendationsCommandError = async ( +export const de_DeleteFleetAdvisorCollectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteFleetAdvisorCollectorCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DescribeRefreshSchemasStatusCommand + * deserializeAws_json1_1DeleteFleetAdvisorDatabasesCommand */ -export const de_DescribeRefreshSchemasStatusCommand = async ( +export const de_DeleteFleetAdvisorDatabasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeRefreshSchemasStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeRefreshSchemasStatusResponse(data, context); - const response: DescribeRefreshSchemasStatusCommandOutput = { + contents = _json(data); + const response: DeleteFleetAdvisorDatabasesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4929,48 +2439,19 @@ export const de_DescribeRefreshSchemasStatusCommand = async ( }; /** - * deserializeAws_json1_1DescribeRefreshSchemasStatusCommandError - */ -const de_DescribeRefreshSchemasStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeReplicationConfigsCommand + * deserializeAws_json1_1DeleteInstanceProfileCommand */ -export const de_DescribeReplicationConfigsCommand = async ( +export const de_DeleteInstanceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeReplicationConfigsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeReplicationConfigsResponse(data, context); - const response: DescribeReplicationConfigsCommandOutput = { + contents = de_DeleteInstanceProfileResponse(data, context); + const response: DeleteInstanceProfileCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4978,45 +2459,39 @@ export const de_DescribeReplicationConfigsCommand = async ( }; /** - * deserializeAws_json1_1DescribeReplicationConfigsCommandError + * deserializeAws_json1_1DeleteMigrationProjectCommand */ -const de_DescribeReplicationConfigsCommandError = async ( +export const de_DeleteMigrationProjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteMigrationProjectResponse(data, context); + const response: DeleteMigrationProjectCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeReplicationInstancesCommand + * deserializeAws_json1_1DeleteReplicationConfigCommand */ -export const de_DescribeReplicationInstancesCommand = async ( +export const de_DeleteReplicationConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeReplicationInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeReplicationInstancesResponse(data, context); - const response: DescribeReplicationInstancesCommandOutput = { + contents = de_DeleteReplicationConfigResponse(data, context); + const response: DeleteReplicationConfigCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5024,45 +2499,39 @@ export const de_DescribeReplicationInstancesCommand = async ( }; /** - * deserializeAws_json1_1DescribeReplicationInstancesCommandError + * deserializeAws_json1_1DeleteReplicationInstanceCommand */ -const de_DescribeReplicationInstancesCommandError = async ( +export const de_DeleteReplicationInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteReplicationInstanceResponse(data, context); + const response: DeleteReplicationInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeReplicationInstanceTaskLogsCommand + * deserializeAws_json1_1DeleteReplicationSubnetGroupCommand */ -export const de_DescribeReplicationInstanceTaskLogsCommand = async ( +export const de_DeleteReplicationSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeReplicationInstanceTaskLogsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeReplicationInstanceTaskLogsCommandOutput = { + const response: DeleteReplicationSubnetGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5070,48 +2539,39 @@ export const de_DescribeReplicationInstanceTaskLogsCommand = async ( }; /** - * deserializeAws_json1_1DescribeReplicationInstanceTaskLogsCommandError + * deserializeAws_json1_1DeleteReplicationTaskCommand */ -const de_DescribeReplicationInstanceTaskLogsCommandError = async ( +export const de_DeleteReplicationTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteReplicationTaskResponse(data, context); + const response: DeleteReplicationTaskCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeReplicationsCommand + * deserializeAws_json1_1DeleteReplicationTaskAssessmentRunCommand */ -export const de_DescribeReplicationsCommand = async ( +export const de_DeleteReplicationTaskAssessmentRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeReplicationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeReplicationsResponse(data, context); - const response: DescribeReplicationsCommandOutput = { + contents = de_DeleteReplicationTaskAssessmentRunResponse(data, context); + const response: DeleteReplicationTaskAssessmentRunCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5119,45 +2579,39 @@ export const de_DescribeReplicationsCommand = async ( }; /** - * deserializeAws_json1_1DescribeReplicationsCommandError + * deserializeAws_json1_1DescribeAccountAttributesCommand */ -const de_DescribeReplicationsCommandError = async ( +export const de_DescribeAccountAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeAccountAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeReplicationSubnetGroupsCommand + * deserializeAws_json1_1DescribeApplicableIndividualAssessmentsCommand */ -export const de_DescribeReplicationSubnetGroupsCommand = async ( +export const de_DescribeApplicableIndividualAssessmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeReplicationSubnetGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeReplicationSubnetGroupsCommandOutput = { + const response: DescribeApplicableIndividualAssessmentsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5165,45 +2619,39 @@ export const de_DescribeReplicationSubnetGroupsCommand = async ( }; /** - * deserializeAws_json1_1DescribeReplicationSubnetGroupsCommandError + * deserializeAws_json1_1DescribeCertificatesCommand */ -const de_DescribeReplicationSubnetGroupsCommandError = async ( +export const de_DescribeCertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeCertificatesResponse(data, context); + const response: DescribeCertificatesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeReplicationTableStatisticsCommand + * deserializeAws_json1_1DescribeConnectionsCommand */ -export const de_DescribeReplicationTableStatisticsCommand = async ( +export const de_DescribeConnectionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeReplicationTableStatisticsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeReplicationTableStatisticsResponse(data, context); - const response: DescribeReplicationTableStatisticsCommandOutput = { + contents = _json(data); + const response: DescribeConnectionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5211,48 +2659,39 @@ export const de_DescribeReplicationTableStatisticsCommand = async ( }; /** - * deserializeAws_json1_1DescribeReplicationTableStatisticsCommandError + * deserializeAws_json1_1DescribeConversionConfigurationCommand */ -const de_DescribeReplicationTableStatisticsCommandError = async ( +export const de_DescribeConversionConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeConversionConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeReplicationTaskAssessmentResultsCommand + * deserializeAws_json1_1DescribeDataProvidersCommand */ -export const de_DescribeReplicationTaskAssessmentResultsCommand = async ( +export const de_DescribeDataProvidersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeReplicationTaskAssessmentResultsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeReplicationTaskAssessmentResultsResponse(data, context); - const response: DescribeReplicationTaskAssessmentResultsCommandOutput = { + contents = de_DescribeDataProvidersResponse(data, context); + const response: DescribeDataProvidersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5260,45 +2699,39 @@ export const de_DescribeReplicationTaskAssessmentResultsCommand = async ( }; /** - * deserializeAws_json1_1DescribeReplicationTaskAssessmentResultsCommandError + * deserializeAws_json1_1DescribeEndpointsCommand */ -const de_DescribeReplicationTaskAssessmentResultsCommandError = async ( +export const de_DescribeEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeEndpointsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeReplicationTaskAssessmentRunsCommand + * deserializeAws_json1_1DescribeEndpointSettingsCommand */ -export const de_DescribeReplicationTaskAssessmentRunsCommand = async ( +export const de_DescribeEndpointSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeReplicationTaskAssessmentRunsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeReplicationTaskAssessmentRunsResponse(data, context); - const response: DescribeReplicationTaskAssessmentRunsCommandOutput = { + contents = _json(data); + const response: DescribeEndpointSettingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5306,45 +2739,39 @@ export const de_DescribeReplicationTaskAssessmentRunsCommand = async ( }; /** - * deserializeAws_json1_1DescribeReplicationTaskAssessmentRunsCommandError + * deserializeAws_json1_1DescribeEndpointTypesCommand */ -const de_DescribeReplicationTaskAssessmentRunsCommandError = async ( +export const de_DescribeEndpointTypesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeEndpointTypesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeReplicationTaskIndividualAssessmentsCommand + * deserializeAws_json1_1DescribeEngineVersionsCommand */ -export const de_DescribeReplicationTaskIndividualAssessmentsCommand = async ( +export const de_DescribeEngineVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeReplicationTaskIndividualAssessmentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeReplicationTaskIndividualAssessmentsResponse(data, context); - const response: DescribeReplicationTaskIndividualAssessmentsCommandOutput = { + contents = de_DescribeEngineVersionsResponse(data, context); + const response: DescribeEngineVersionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5352,45 +2779,39 @@ export const de_DescribeReplicationTaskIndividualAssessmentsCommand = async ( }; /** - * deserializeAws_json1_1DescribeReplicationTaskIndividualAssessmentsCommandError + * deserializeAws_json1_1DescribeEventCategoriesCommand */ -const de_DescribeReplicationTaskIndividualAssessmentsCommandError = async ( +export const de_DescribeEventCategoriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeEventCategoriesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeReplicationTasksCommand + * deserializeAws_json1_1DescribeEventsCommand */ -export const de_DescribeReplicationTasksCommand = async ( +export const de_DescribeEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeReplicationTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeReplicationTasksResponse(data, context); - const response: DescribeReplicationTasksCommandOutput = { + contents = de_DescribeEventsResponse(data, context); + const response: DescribeEventsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5398,45 +2819,39 @@ export const de_DescribeReplicationTasksCommand = async ( }; /** - * deserializeAws_json1_1DescribeReplicationTasksCommandError + * deserializeAws_json1_1DescribeEventSubscriptionsCommand */ -const de_DescribeReplicationTasksCommandError = async ( +export const de_DescribeEventSubscriptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeEventSubscriptionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeSchemasCommand + * deserializeAws_json1_1DescribeExtensionPackAssociationsCommand */ -export const de_DescribeSchemasCommand = async ( +export const de_DescribeExtensionPackAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeSchemasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeSchemasCommandOutput = { + const response: DescribeExtensionPackAssociationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5444,48 +2859,39 @@ export const de_DescribeSchemasCommand = async ( }; /** - * deserializeAws_json1_1DescribeSchemasCommandError + * deserializeAws_json1_1DescribeFleetAdvisorCollectorsCommand */ -const de_DescribeSchemasCommandError = async ( +export const de_DescribeFleetAdvisorCollectorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeFleetAdvisorCollectorsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeTableStatisticsCommand + * deserializeAws_json1_1DescribeFleetAdvisorDatabasesCommand */ -export const de_DescribeTableStatisticsCommand = async ( +export const de_DescribeFleetAdvisorDatabasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeTableStatisticsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeTableStatisticsResponse(data, context); - const response: DescribeTableStatisticsCommandOutput = { + contents = _json(data); + const response: DescribeFleetAdvisorDatabasesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5493,48 +2899,39 @@ export const de_DescribeTableStatisticsCommand = async ( }; /** - * deserializeAws_json1_1DescribeTableStatisticsCommandError + * deserializeAws_json1_1DescribeFleetAdvisorLsaAnalysisCommand */ -const de_DescribeTableStatisticsCommandError = async ( +export const de_DescribeFleetAdvisorLsaAnalysisCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeFleetAdvisorLsaAnalysisCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ExportMetadataModelAssessmentCommand + * deserializeAws_json1_1DescribeFleetAdvisorSchemaObjectSummaryCommand */ -export const de_ExportMetadataModelAssessmentCommand = async ( +export const de_DescribeFleetAdvisorSchemaObjectSummaryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ExportMetadataModelAssessmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ExportMetadataModelAssessmentCommandOutput = { + const response: DescribeFleetAdvisorSchemaObjectSummaryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5542,45 +2939,39 @@ export const de_ExportMetadataModelAssessmentCommand = async ( }; /** - * deserializeAws_json1_1ExportMetadataModelAssessmentCommandError + * deserializeAws_json1_1DescribeFleetAdvisorSchemasCommand */ -const de_ExportMetadataModelAssessmentCommandError = async ( +export const de_DescribeFleetAdvisorSchemasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeFleetAdvisorSchemasResponse(data, context); + const response: DescribeFleetAdvisorSchemasCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ImportCertificateCommand + * deserializeAws_json1_1DescribeInstanceProfilesCommand */ -export const de_ImportCertificateCommand = async ( +export const de_DescribeInstanceProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ImportCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ImportCertificateResponse(data, context); - const response: ImportCertificateCommandOutput = { + contents = de_DescribeInstanceProfilesResponse(data, context); + const response: DescribeInstanceProfilesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5588,51 +2979,59 @@ export const de_ImportCertificateCommand = async ( }; /** - * deserializeAws_json1_1ImportCertificateCommandError + * deserializeAws_json1_1DescribeMetadataModelAssessmentsCommand */ -const de_ImportCertificateCommandError = async ( +export const de_DescribeMetadataModelAssessmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeMetadataModelAssessmentsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidCertificateFault": - case "com.amazonaws.databasemigrationservice#InvalidCertificateFault": - throw await de_InvalidCertificateFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DescribeMetadataModelConversionsCommand + */ +export const de_DescribeMetadataModelConversionsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeMetadataModelConversionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1DescribeMetadataModelExportsAsScriptCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_DescribeMetadataModelExportsAsScriptCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + const response: DescribeMetadataModelExportsAsScriptCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5640,45 +3039,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1DescribeMetadataModelExportsToTargetCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_DescribeMetadataModelExportsToTargetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeMetadataModelExportsToTargetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ModifyConversionConfigurationCommand + * deserializeAws_json1_1DescribeMetadataModelImportsCommand */ -export const de_ModifyConversionConfigurationCommand = async ( +export const de_DescribeMetadataModelImportsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ModifyConversionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ModifyConversionConfigurationCommandOutput = { + const response: DescribeMetadataModelImportsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5686,48 +3079,39 @@ export const de_ModifyConversionConfigurationCommand = async ( }; /** - * deserializeAws_json1_1ModifyConversionConfigurationCommandError + * deserializeAws_json1_1DescribeMigrationProjectsCommand */ -const de_ModifyConversionConfigurationCommandError = async ( +export const de_DescribeMigrationProjectsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeMigrationProjectsResponse(data, context); + const response: DescribeMigrationProjectsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ModifyDataProviderCommand + * deserializeAws_json1_1DescribeOrderableReplicationInstancesCommand */ -export const de_ModifyDataProviderCommand = async ( +export const de_DescribeOrderableReplicationInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ModifyDataProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ModifyDataProviderResponse(data, context); - const response: ModifyDataProviderCommandOutput = { + contents = _json(data); + const response: DescribeOrderableReplicationInstancesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5735,51 +3119,39 @@ export const de_ModifyDataProviderCommand = async ( }; /** - * deserializeAws_json1_1ModifyDataProviderCommandError + * deserializeAws_json1_1DescribePendingMaintenanceActionsCommand */ -const de_ModifyDataProviderCommandError = async ( +export const de_DescribePendingMaintenanceActionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribePendingMaintenanceActionsResponse(data, context); + const response: DescribePendingMaintenanceActionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ModifyEndpointCommand + * deserializeAws_json1_1DescribeRecommendationLimitationsCommand */ -export const de_ModifyEndpointCommand = async ( +export const de_DescribeRecommendationLimitationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ModifyEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ModifyEndpointCommandOutput = { + const response: DescribeRecommendationLimitationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5787,57 +3159,39 @@ export const de_ModifyEndpointCommand = async ( }; /** - * deserializeAws_json1_1ModifyEndpointCommandError + * deserializeAws_json1_1DescribeRecommendationsCommand */ -const de_ModifyEndpointCommandError = async ( +export const de_DescribeRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeRecommendationsResponse(data, context); + const response: DescribeRecommendationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ModifyEventSubscriptionCommand + * deserializeAws_json1_1DescribeRefreshSchemasStatusCommand */ -export const de_ModifyEventSubscriptionCommand = async ( +export const de_DescribeRefreshSchemasStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ModifyEventSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ModifyEventSubscriptionCommandOutput = { + contents = de_DescribeRefreshSchemasStatusResponse(data, context); + const response: DescribeRefreshSchemasStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5845,69 +3199,59 @@ export const de_ModifyEventSubscriptionCommand = async ( }; /** - * deserializeAws_json1_1ModifyEventSubscriptionCommandError + * deserializeAws_json1_1DescribeReplicationConfigsCommand */ -const de_ModifyEventSubscriptionCommandError = async ( +export const de_DescribeReplicationConfigsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeReplicationConfigsResponse(data, context); + const response: DescribeReplicationConfigsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "KMSAccessDeniedFault": - case "com.amazonaws.databasemigrationservice#KMSAccessDeniedFault": - throw await de_KMSAccessDeniedFaultRes(parsedOutput, context); - case "KMSDisabledFault": - case "com.amazonaws.databasemigrationservice#KMSDisabledFault": - throw await de_KMSDisabledFaultRes(parsedOutput, context); - case "KMSInvalidStateFault": - case "com.amazonaws.databasemigrationservice#KMSInvalidStateFault": - throw await de_KMSInvalidStateFaultRes(parsedOutput, context); - case "KMSNotFoundFault": - case "com.amazonaws.databasemigrationservice#KMSNotFoundFault": - throw await de_KMSNotFoundFaultRes(parsedOutput, context); - case "KMSThrottlingFault": - case "com.amazonaws.databasemigrationservice#KMSThrottlingFault": - throw await de_KMSThrottlingFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - case "SNSInvalidTopicFault": - case "com.amazonaws.databasemigrationservice#SNSInvalidTopicFault": - throw await de_SNSInvalidTopicFaultRes(parsedOutput, context); - case "SNSNoAuthorizationFault": - case "com.amazonaws.databasemigrationservice#SNSNoAuthorizationFault": - throw await de_SNSNoAuthorizationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DescribeReplicationInstancesCommand + */ +export const de_DescribeReplicationInstancesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeReplicationInstancesResponse(data, context); + const response: DescribeReplicationInstancesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ModifyInstanceProfileCommand + * deserializeAws_json1_1DescribeReplicationInstanceTaskLogsCommand */ -export const de_ModifyInstanceProfileCommand = async ( +export const de_DescribeReplicationInstanceTaskLogsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ModifyInstanceProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ModifyInstanceProfileResponse(data, context); - const response: ModifyInstanceProfileCommandOutput = { + contents = _json(data); + const response: DescribeReplicationInstanceTaskLogsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5915,60 +3259,39 @@ export const de_ModifyInstanceProfileCommand = async ( }; /** - * deserializeAws_json1_1ModifyInstanceProfileCommandError + * deserializeAws_json1_1DescribeReplicationsCommand */ -const de_ModifyInstanceProfileCommandError = async ( +export const de_DescribeReplicationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "S3AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#S3AccessDeniedFault": - throw await de_S3AccessDeniedFaultRes(parsedOutput, context); - case "S3ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#S3ResourceNotFoundFault": - throw await de_S3ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeReplicationsResponse(data, context); + const response: DescribeReplicationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ModifyMigrationProjectCommand + * deserializeAws_json1_1DescribeReplicationSubnetGroupsCommand */ -export const de_ModifyMigrationProjectCommand = async ( +export const de_DescribeReplicationSubnetGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ModifyMigrationProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ModifyMigrationProjectResponse(data, context); - const response: ModifyMigrationProjectCommandOutput = { + contents = _json(data); + const response: DescribeReplicationSubnetGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5976,57 +3299,39 @@ export const de_ModifyMigrationProjectCommand = async ( }; /** - * deserializeAws_json1_1ModifyMigrationProjectCommandError + * deserializeAws_json1_1DescribeReplicationTableStatisticsCommand */ -const de_ModifyMigrationProjectCommandError = async ( +export const de_DescribeReplicationTableStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "S3AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#S3AccessDeniedFault": - throw await de_S3AccessDeniedFaultRes(parsedOutput, context); - case "S3ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#S3ResourceNotFoundFault": - throw await de_S3ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeReplicationTableStatisticsResponse(data, context); + const response: DescribeReplicationTableStatisticsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ModifyReplicationConfigCommand + * deserializeAws_json1_1DescribeReplicationTaskAssessmentResultsCommand */ -export const de_ModifyReplicationConfigCommand = async ( +export const de_DescribeReplicationTaskAssessmentResultsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ModifyReplicationConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ModifyReplicationConfigResponse(data, context); - const response: ModifyReplicationConfigCommandOutput = { + contents = de_DescribeReplicationTaskAssessmentResultsResponse(data, context); + const response: DescribeReplicationTaskAssessmentResultsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6034,60 +3339,39 @@ export const de_ModifyReplicationConfigCommand = async ( }; /** - * deserializeAws_json1_1ModifyReplicationConfigCommandError + * deserializeAws_json1_1DescribeReplicationTaskAssessmentRunsCommand */ -const de_ModifyReplicationConfigCommandError = async ( +export const de_DescribeReplicationTaskAssessmentRunsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.databasemigrationservice#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ReplicationSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.databasemigrationservice#ReplicationSubnetGroupDoesNotCoverEnoughAZs": - throw await de_ReplicationSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeReplicationTaskAssessmentRunsResponse(data, context); + const response: DescribeReplicationTaskAssessmentRunsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ModifyReplicationInstanceCommand + * deserializeAws_json1_1DescribeReplicationTaskIndividualAssessmentsCommand */ -export const de_ModifyReplicationInstanceCommand = async ( +export const de_DescribeReplicationTaskIndividualAssessmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ModifyReplicationInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ModifyReplicationInstanceResponse(data, context); - const response: ModifyReplicationInstanceCommandOutput = { + contents = de_DescribeReplicationTaskIndividualAssessmentsResponse(data, context); + const response: DescribeReplicationTaskIndividualAssessmentsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6095,63 +3379,39 @@ export const de_ModifyReplicationInstanceCommand = async ( }; /** - * deserializeAws_json1_1ModifyReplicationInstanceCommandError + * deserializeAws_json1_1DescribeReplicationTasksCommand */ -const de_ModifyReplicationInstanceCommandError = async ( +export const de_DescribeReplicationTasksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InsufficientResourceCapacityFault": - case "com.amazonaws.databasemigrationservice#InsufficientResourceCapacityFault": - throw await de_InsufficientResourceCapacityFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "StorageQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - case "UpgradeDependencyFailureFault": - case "com.amazonaws.databasemigrationservice#UpgradeDependencyFailureFault": - throw await de_UpgradeDependencyFailureFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeReplicationTasksResponse(data, context); + const response: DescribeReplicationTasksCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ModifyReplicationSubnetGroupCommand + * deserializeAws_json1_1DescribeSchemasCommand */ -export const de_ModifyReplicationSubnetGroupCommand = async ( +export const de_DescribeSchemasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ModifyReplicationSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ModifyReplicationSubnetGroupCommandOutput = { + const response: DescribeSchemasCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6159,60 +3419,19 @@ export const de_ModifyReplicationSubnetGroupCommand = async ( }; /** - * deserializeAws_json1_1ModifyReplicationSubnetGroupCommandError - */ -const de_ModifyReplicationSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.databasemigrationservice#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "ReplicationSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.databasemigrationservice#ReplicationSubnetGroupDoesNotCoverEnoughAZs": - throw await de_ReplicationSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - case "SubnetAlreadyInUse": - case "com.amazonaws.databasemigrationservice#SubnetAlreadyInUse": - throw await de_SubnetAlreadyInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ModifyReplicationTaskCommand + * deserializeAws_json1_1DescribeTableStatisticsCommand */ -export const de_ModifyReplicationTaskCommand = async ( +export const de_DescribeTableStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ModifyReplicationTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ModifyReplicationTaskResponse(data, context); - const response: ModifyReplicationTaskCommandOutput = { + contents = de_DescribeTableStatisticsResponse(data, context); + const response: DescribeTableStatisticsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6220,54 +3439,39 @@ export const de_ModifyReplicationTaskCommand = async ( }; /** - * deserializeAws_json1_1ModifyReplicationTaskCommandError + * deserializeAws_json1_1ExportMetadataModelAssessmentCommand */ -const de_ModifyReplicationTaskCommandError = async ( +export const de_ExportMetadataModelAssessmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ExportMetadataModelAssessmentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1MoveReplicationTaskCommand + * deserializeAws_json1_1ImportCertificateCommand */ -export const de_MoveReplicationTaskCommand = async ( +export const de_ImportCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_MoveReplicationTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_MoveReplicationTaskResponse(data, context); - const response: MoveReplicationTaskCommandOutput = { + contents = de_ImportCertificateResponse(data, context); + const response: ImportCertificateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6275,57 +3479,39 @@ export const de_MoveReplicationTaskCommand = async ( }; /** - * deserializeAws_json1_1MoveReplicationTaskCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_MoveReplicationTaskCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RebootReplicationInstanceCommand + * deserializeAws_json1_1ModifyConversionConfigurationCommand */ -export const de_RebootReplicationInstanceCommand = async ( +export const de_ModifyConversionConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RebootReplicationInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RebootReplicationInstanceResponse(data, context); - const response: RebootReplicationInstanceCommandOutput = { + contents = _json(data); + const response: ModifyConversionConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6333,48 +3519,39 @@ export const de_RebootReplicationInstanceCommand = async ( }; /** - * deserializeAws_json1_1RebootReplicationInstanceCommandError + * deserializeAws_json1_1ModifyDataProviderCommand */ -const de_RebootReplicationInstanceCommandError = async ( +export const de_ModifyDataProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyDataProviderResponse(data, context); + const response: ModifyDataProviderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RefreshSchemasCommand + * deserializeAws_json1_1ModifyEndpointCommand */ -export const de_RefreshSchemasCommand = async ( +export const de_ModifyEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RefreshSchemasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RefreshSchemasResponse(data, context); - const response: RefreshSchemasCommandOutput = { + contents = _json(data); + const response: ModifyEndpointCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6382,54 +3559,39 @@ export const de_RefreshSchemasCommand = async ( }; /** - * deserializeAws_json1_1RefreshSchemasCommandError + * deserializeAws_json1_1ModifyEventSubscriptionCommand */ -const de_RefreshSchemasCommandError = async ( +export const de_ModifyEventSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ModifyEventSubscriptionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ReloadReplicationTablesCommand + * deserializeAws_json1_1ModifyInstanceProfileCommand */ -export const de_ReloadReplicationTablesCommand = async ( +export const de_ModifyInstanceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ReloadReplicationTablesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ReloadReplicationTablesCommandOutput = { + contents = de_ModifyInstanceProfileResponse(data, context); + const response: ModifyInstanceProfileCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6437,48 +3599,39 @@ export const de_ReloadReplicationTablesCommand = async ( }; /** - * deserializeAws_json1_1ReloadReplicationTablesCommandError + * deserializeAws_json1_1ModifyMigrationProjectCommand */ -const de_ReloadReplicationTablesCommandError = async ( +export const de_ModifyMigrationProjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyMigrationProjectResponse(data, context); + const response: ModifyMigrationProjectCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ReloadTablesCommand + * deserializeAws_json1_1ModifyReplicationConfigCommand */ -export const de_ReloadTablesCommand = async ( +export const de_ModifyReplicationConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ReloadTablesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ReloadTablesCommandOutput = { + contents = de_ModifyReplicationConfigResponse(data, context); + const response: ModifyReplicationConfigCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6486,48 +3639,39 @@ export const de_ReloadTablesCommand = async ( }; /** - * deserializeAws_json1_1ReloadTablesCommandError + * deserializeAws_json1_1ModifyReplicationInstanceCommand */ -const de_ReloadTablesCommandError = async ( +export const de_ModifyReplicationInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyReplicationInstanceResponse(data, context); + const response: ModifyReplicationInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RemoveTagsFromResourceCommand + * deserializeAws_json1_1ModifyReplicationSubnetGroupCommand */ -export const de_RemoveTagsFromResourceCommand = async ( +export const de_ModifyReplicationSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RemoveTagsFromResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: RemoveTagsFromResourceCommandOutput = { + const response: ModifyReplicationSubnetGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6535,45 +3679,39 @@ export const de_RemoveTagsFromResourceCommand = async ( }; /** - * deserializeAws_json1_1RemoveTagsFromResourceCommandError + * deserializeAws_json1_1ModifyReplicationTaskCommand */ -const de_RemoveTagsFromResourceCommandError = async ( +export const de_ModifyReplicationTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyReplicationTaskResponse(data, context); + const response: ModifyReplicationTaskCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RunFleetAdvisorLsaAnalysisCommand + * deserializeAws_json1_1MoveReplicationTaskCommand */ -export const de_RunFleetAdvisorLsaAnalysisCommand = async ( +export const de_MoveReplicationTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RunFleetAdvisorLsaAnalysisCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: RunFleetAdvisorLsaAnalysisCommandOutput = { + contents = de_MoveReplicationTaskResponse(data, context); + const response: MoveReplicationTaskCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6581,48 +3719,39 @@ export const de_RunFleetAdvisorLsaAnalysisCommand = async ( }; /** - * deserializeAws_json1_1RunFleetAdvisorLsaAnalysisCommandError + * deserializeAws_json1_1RebootReplicationInstanceCommand */ -const de_RunFleetAdvisorLsaAnalysisCommandError = async ( +export const de_RebootReplicationInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RebootReplicationInstanceResponse(data, context); + const response: RebootReplicationInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartExtensionPackAssociationCommand + * deserializeAws_json1_1RefreshSchemasCommand */ -export const de_StartExtensionPackAssociationCommand = async ( +export const de_RefreshSchemasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartExtensionPackAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartExtensionPackAssociationCommandOutput = { + contents = de_RefreshSchemasResponse(data, context); + const response: RefreshSchemasCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6630,66 +3759,39 @@ export const de_StartExtensionPackAssociationCommand = async ( }; /** - * deserializeAws_json1_1StartExtensionPackAssociationCommandError + * deserializeAws_json1_1ReloadReplicationTablesCommand */ -const de_StartExtensionPackAssociationCommandError = async ( +export const de_ReloadReplicationTablesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - case "S3AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#S3AccessDeniedFault": - throw await de_S3AccessDeniedFaultRes(parsedOutput, context); - case "S3ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#S3ResourceNotFoundFault": - throw await de_S3ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ReloadReplicationTablesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartMetadataModelAssessmentCommand + * deserializeAws_json1_1ReloadTablesCommand */ -export const de_StartMetadataModelAssessmentCommand = async ( +export const de_ReloadTablesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartMetadataModelAssessmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartMetadataModelAssessmentCommandOutput = { + const response: ReloadTablesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6697,66 +3799,39 @@ export const de_StartMetadataModelAssessmentCommand = async ( }; /** - * deserializeAws_json1_1StartMetadataModelAssessmentCommandError + * deserializeAws_json1_1RemoveTagsFromResourceCommand */ -const de_StartMetadataModelAssessmentCommandError = async ( +export const de_RemoveTagsFromResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - case "S3AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#S3AccessDeniedFault": - throw await de_S3AccessDeniedFaultRes(parsedOutput, context); - case "S3ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#S3ResourceNotFoundFault": - throw await de_S3ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: RemoveTagsFromResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartMetadataModelConversionCommand + * deserializeAws_json1_1RunFleetAdvisorLsaAnalysisCommand */ -export const de_StartMetadataModelConversionCommand = async ( +export const de_RunFleetAdvisorLsaAnalysisCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartMetadataModelConversionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartMetadataModelConversionCommandOutput = { + const response: RunFleetAdvisorLsaAnalysisCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6764,66 +3839,39 @@ export const de_StartMetadataModelConversionCommand = async ( }; /** - * deserializeAws_json1_1StartMetadataModelConversionCommandError + * deserializeAws_json1_1StartExtensionPackAssociationCommand */ -const de_StartMetadataModelConversionCommandError = async ( +export const de_StartExtensionPackAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - case "S3AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#S3AccessDeniedFault": - throw await de_S3AccessDeniedFaultRes(parsedOutput, context); - case "S3ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#S3ResourceNotFoundFault": - throw await de_S3ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartExtensionPackAssociationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartMetadataModelExportAsScriptCommand + * deserializeAws_json1_1StartMetadataModelAssessmentCommand */ -export const de_StartMetadataModelExportAsScriptCommand = async ( +export const de_StartMetadataModelAssessmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartMetadataModelExportAsScriptCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartMetadataModelExportAsScriptCommandOutput = { + const response: StartMetadataModelAssessmentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6831,66 +3879,39 @@ export const de_StartMetadataModelExportAsScriptCommand = async ( }; /** - * deserializeAws_json1_1StartMetadataModelExportAsScriptCommandError + * deserializeAws_json1_1StartMetadataModelConversionCommand */ -const de_StartMetadataModelExportAsScriptCommandError = async ( +export const de_StartMetadataModelConversionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - case "S3AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#S3AccessDeniedFault": - throw await de_S3AccessDeniedFaultRes(parsedOutput, context); - case "S3ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#S3ResourceNotFoundFault": - throw await de_S3ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartMetadataModelConversionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartMetadataModelExportToTargetCommand + * deserializeAws_json1_1StartMetadataModelExportAsScriptCommand */ -export const de_StartMetadataModelExportToTargetCommand = async ( +export const de_StartMetadataModelExportAsScriptCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartMetadataModelExportToTargetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartMetadataModelExportToTargetCommandOutput = { + const response: StartMetadataModelExportAsScriptCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6898,50 +3919,23 @@ export const de_StartMetadataModelExportToTargetCommand = async ( }; /** - * deserializeAws_json1_1StartMetadataModelExportToTargetCommandError + * deserializeAws_json1_1StartMetadataModelExportToTargetCommand */ -const de_StartMetadataModelExportToTargetCommandError = async ( +export const de_StartMetadataModelExportToTargetCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - case "S3AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#S3AccessDeniedFault": - throw await de_S3AccessDeniedFaultRes(parsedOutput, context); - case "S3ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#S3ResourceNotFoundFault": - throw await de_S3ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartMetadataModelExportToTargetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -6952,7 +3946,7 @@ export const de_StartMetadataModelImportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartMetadataModelImportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6964,53 +3958,6 @@ export const de_StartMetadataModelImportCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartMetadataModelImportCommandError - */ -const de_StartMetadataModelImportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - case "S3AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#S3AccessDeniedFault": - throw await de_S3AccessDeniedFaultRes(parsedOutput, context); - case "S3ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#S3ResourceNotFoundFault": - throw await de_S3ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartRecommendationsCommand */ @@ -7019,7 +3966,7 @@ export const de_StartRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartRecommendationsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StartRecommendationsCommandOutput = { @@ -7028,38 +3975,6 @@ export const de_StartRecommendationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartRecommendationsCommandError - */ -const de_StartRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartReplicationCommand */ @@ -7068,7 +3983,7 @@ export const de_StartReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartReplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7080,88 +3995,24 @@ export const de_StartReplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartReplicationCommandError - */ -const de_StartReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartReplicationTaskCommand */ export const de_StartReplicationTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartReplicationTaskCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_StartReplicationTaskResponse(data, context); - const response: StartReplicationTaskCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartReplicationTaskCommandError - */ -const de_StartReplicationTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StartReplicationTaskResponse(data, context); + const response: StartReplicationTaskCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -7172,7 +4023,7 @@ export const de_StartReplicationTaskAssessmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartReplicationTaskAssessmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7184,35 +4035,6 @@ export const de_StartReplicationTaskAssessmentCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartReplicationTaskAssessmentCommandError - */ -const de_StartReplicationTaskAssessmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartReplicationTaskAssessmentRunCommand */ @@ -7221,7 +4043,7 @@ export const de_StartReplicationTaskAssessmentRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartReplicationTaskAssessmentRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7233,65 +4055,6 @@ export const de_StartReplicationTaskAssessmentRunCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartReplicationTaskAssessmentRunCommandError - */ -const de_StartReplicationTaskAssessmentRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSAccessDeniedFault": - case "com.amazonaws.databasemigrationservice#KMSAccessDeniedFault": - throw await de_KMSAccessDeniedFaultRes(parsedOutput, context); - case "KMSDisabledFault": - case "com.amazonaws.databasemigrationservice#KMSDisabledFault": - throw await de_KMSDisabledFaultRes(parsedOutput, context); - case "KMSFault": - case "com.amazonaws.databasemigrationservice#KMSFault": - throw await de_KMSFaultRes(parsedOutput, context); - case "KMSInvalidStateFault": - case "com.amazonaws.databasemigrationservice#KMSInvalidStateFault": - throw await de_KMSInvalidStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "KMSNotFoundFault": - case "com.amazonaws.databasemigrationservice#KMSNotFoundFault": - throw await de_KMSNotFoundFaultRes(parsedOutput, context); - case "ResourceAlreadyExistsFault": - case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": - throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "S3AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#S3AccessDeniedFault": - throw await de_S3AccessDeniedFaultRes(parsedOutput, context); - case "S3ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#S3ResourceNotFoundFault": - throw await de_S3ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopReplicationCommand */ @@ -7300,7 +4063,7 @@ export const de_StopReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopReplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7312,38 +4075,6 @@ export const de_StopReplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopReplicationCommandError - */ -const de_StopReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopReplicationTaskCommand */ @@ -7352,7 +4083,7 @@ export const de_StopReplicationTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopReplicationTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7364,35 +4095,6 @@ export const de_StopReplicationTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopReplicationTaskCommandError - */ -const de_StopReplicationTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TestConnectionCommand */ @@ -7401,7 +4103,7 @@ export const de_TestConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TestConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7413,44 +4115,6 @@ export const de_TestConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1TestConnectionCommandError - */ -const de_TestConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedFault": - case "com.amazonaws.databasemigrationservice#AccessDeniedFault": - throw await de_AccessDeniedFaultRes(parsedOutput, context); - case "InvalidResourceStateFault": - case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "ResourceQuotaExceededFault": - case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": - throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSubscriptionsToEventBridgeCommand */ @@ -7459,7 +4123,7 @@ export const de_UpdateSubscriptionsToEventBridgeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSubscriptionsToEventBridgeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7472,31 +4136,97 @@ export const de_UpdateSubscriptionsToEventBridgeCommand = async ( }; /** - * deserializeAws_json1_1UpdateSubscriptionsToEventBridgeCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateSubscriptionsToEventBridgeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "ResourceNotFoundFault": + case "com.amazonaws.databasemigrationservice#ResourceNotFoundFault": + throw await de_ResourceNotFoundFaultRes(parsedOutput, context); case "AccessDeniedFault": case "com.amazonaws.databasemigrationservice#AccessDeniedFault": throw await de_AccessDeniedFaultRes(parsedOutput, context); case "InvalidResourceStateFault": case "com.amazonaws.databasemigrationservice#InvalidResourceStateFault": throw await de_InvalidResourceStateFaultRes(parsedOutput, context); + case "ResourceAlreadyExistsFault": + case "com.amazonaws.databasemigrationservice#ResourceAlreadyExistsFault": + throw await de_ResourceAlreadyExistsFaultRes(parsedOutput, context); + case "ResourceQuotaExceededFault": + case "com.amazonaws.databasemigrationservice#ResourceQuotaExceededFault": + throw await de_ResourceQuotaExceededFaultRes(parsedOutput, context); + case "KMSKeyNotAccessibleFault": + case "com.amazonaws.databasemigrationservice#KMSKeyNotAccessibleFault": + throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); + case "S3AccessDeniedFault": + case "com.amazonaws.databasemigrationservice#S3AccessDeniedFault": + throw await de_S3AccessDeniedFaultRes(parsedOutput, context); + case "KMSAccessDeniedFault": + case "com.amazonaws.databasemigrationservice#KMSAccessDeniedFault": + throw await de_KMSAccessDeniedFaultRes(parsedOutput, context); + case "KMSDisabledFault": + case "com.amazonaws.databasemigrationservice#KMSDisabledFault": + throw await de_KMSDisabledFaultRes(parsedOutput, context); + case "KMSInvalidStateFault": + case "com.amazonaws.databasemigrationservice#KMSInvalidStateFault": + throw await de_KMSInvalidStateFaultRes(parsedOutput, context); + case "KMSNotFoundFault": + case "com.amazonaws.databasemigrationservice#KMSNotFoundFault": + throw await de_KMSNotFoundFaultRes(parsedOutput, context); + case "KMSThrottlingFault": + case "com.amazonaws.databasemigrationservice#KMSThrottlingFault": + throw await de_KMSThrottlingFaultRes(parsedOutput, context); + case "SNSInvalidTopicFault": + case "com.amazonaws.databasemigrationservice#SNSInvalidTopicFault": + throw await de_SNSInvalidTopicFaultRes(parsedOutput, context); + case "SNSNoAuthorizationFault": + case "com.amazonaws.databasemigrationservice#SNSNoAuthorizationFault": + throw await de_SNSNoAuthorizationFaultRes(parsedOutput, context); + case "S3ResourceNotFoundFault": + case "com.amazonaws.databasemigrationservice#S3ResourceNotFoundFault": + throw await de_S3ResourceNotFoundFaultRes(parsedOutput, context); + case "InvalidSubnet": + case "com.amazonaws.databasemigrationservice#InvalidSubnet": + throw await de_InvalidSubnetRes(parsedOutput, context); + case "ReplicationSubnetGroupDoesNotCoverEnoughAZs": + case "com.amazonaws.databasemigrationservice#ReplicationSubnetGroupDoesNotCoverEnoughAZs": + throw await de_ReplicationSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); + case "InsufficientResourceCapacityFault": + case "com.amazonaws.databasemigrationservice#InsufficientResourceCapacityFault": + throw await de_InsufficientResourceCapacityFaultRes(parsedOutput, context); + case "StorageQuotaExceededFault": + case "com.amazonaws.databasemigrationservice#StorageQuotaExceededFault": + throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); + case "CollectorNotFoundFault": + case "com.amazonaws.databasemigrationservice#CollectorNotFoundFault": + throw await de_CollectorNotFoundFaultRes(parsedOutput, context); + case "InvalidOperationFault": + case "com.amazonaws.databasemigrationservice#InvalidOperationFault": + throw await de_InvalidOperationFaultRes(parsedOutput, context); + case "InvalidCertificateFault": + case "com.amazonaws.databasemigrationservice#InvalidCertificateFault": + throw await de_InvalidCertificateFaultRes(parsedOutput, context); + case "UpgradeDependencyFailureFault": + case "com.amazonaws.databasemigrationservice#UpgradeDependencyFailureFault": + throw await de_UpgradeDependencyFailureFaultRes(parsedOutput, context); + case "SubnetAlreadyInUse": + case "com.amazonaws.databasemigrationservice#SubnetAlreadyInUse": + throw await de_SubnetAlreadyInUseRes(parsedOutput, context); + case "KMSFault": + case "com.amazonaws.databasemigrationservice#KMSFault": + throw await de_KMSFaultRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-databrew/src/protocols/Aws_restJson1.ts b/clients/client-databrew/src/protocols/Aws_restJson1.ts index 136a13802acf..024b9eba5aea 100644 --- a/clients/client-databrew/src/protocols/Aws_restJson1.ts +++ b/clients/client-databrew/src/protocols/Aws_restJson1.ts @@ -1098,7 +1098,7 @@ export const de_BatchDeleteRecipeVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDeleteRecipeVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1112,38 +1112,6 @@ export const de_BatchDeleteRecipeVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDeleteRecipeVersionCommandError - */ -const de_BatchDeleteRecipeVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDatasetCommand */ @@ -1152,7 +1120,7 @@ export const de_CreateDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1165,41 +1133,6 @@ export const de_CreateDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDatasetCommandError - */ -const de_CreateDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.databrew#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.databrew#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProfileJobCommand */ @@ -1208,7 +1141,7 @@ export const de_CreateProfileJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateProfileJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1221,44 +1154,6 @@ export const de_CreateProfileJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProfileJobCommandError - */ -const de_CreateProfileJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.databrew#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.databrew#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProjectCommand */ @@ -1267,7 +1162,7 @@ export const de_CreateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1280,41 +1175,6 @@ export const de_CreateProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProjectCommandError - */ -const de_CreateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.databrew#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.databrew#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRecipeCommand */ @@ -1323,7 +1183,7 @@ export const de_CreateRecipeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRecipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1336,38 +1196,6 @@ export const de_CreateRecipeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRecipeCommandError - */ -const de_CreateRecipeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.databrew#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRecipeJobCommand */ @@ -1376,7 +1204,7 @@ export const de_CreateRecipeJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRecipeJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1389,44 +1217,6 @@ export const de_CreateRecipeJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRecipeJobCommandError - */ -const de_CreateRecipeJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.databrew#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.databrew#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRulesetCommand */ @@ -1435,7 +1225,7 @@ export const de_CreateRulesetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRulesetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1448,38 +1238,6 @@ export const de_CreateRulesetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRulesetCommandError - */ -const de_CreateRulesetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.databrew#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateScheduleCommand */ @@ -1488,7 +1246,7 @@ export const de_CreateScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1501,38 +1259,6 @@ export const de_CreateScheduleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateScheduleCommandError - */ -const de_CreateScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.databrew#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDatasetCommand */ @@ -1541,7 +1267,7 @@ export const de_DeleteDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1555,46 +1281,14 @@ export const de_DeleteDatasetCommand = async ( }; /** - * deserializeAws_restJson1DeleteDatasetCommandError + * deserializeAws_restJson1DeleteJobCommand */ -const de_DeleteDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteJobCommand - */ -export const de_DeleteJobCommand = async ( +export const de_DeleteJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1607,38 +1301,6 @@ export const de_DeleteJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteJobCommandError - */ -const de_DeleteJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteProjectCommand */ @@ -1647,7 +1309,7 @@ export const de_DeleteProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1660,38 +1322,6 @@ export const de_DeleteProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteProjectCommandError - */ -const de_DeleteProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRecipeVersionCommand */ @@ -1700,7 +1330,7 @@ export const de_DeleteRecipeVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRecipeVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1714,38 +1344,6 @@ export const de_DeleteRecipeVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRecipeVersionCommandError - */ -const de_DeleteRecipeVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRulesetCommand */ @@ -1754,7 +1352,7 @@ export const de_DeleteRulesetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRulesetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1767,38 +1365,6 @@ export const de_DeleteRulesetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRulesetCommandError - */ -const de_DeleteRulesetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteScheduleCommand */ @@ -1807,7 +1373,7 @@ export const de_DeleteScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1820,35 +1386,6 @@ export const de_DeleteScheduleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteScheduleCommandError - */ -const de_DeleteScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDatasetCommand */ @@ -1857,7 +1394,7 @@ export const de_DescribeDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1881,35 +1418,6 @@ export const de_DescribeDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDatasetCommandError - */ -const de_DescribeDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeJobCommand */ @@ -1918,7 +1426,7 @@ export const de_DescribeJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1954,35 +1462,6 @@ export const de_DescribeJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeJobCommandError - */ -const de_DescribeJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeJobRunCommand */ @@ -1991,7 +1470,7 @@ export const de_DescribeJobRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2022,35 +1501,6 @@ export const de_DescribeJobRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeJobRunCommandError - */ -const de_DescribeJobRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeProjectCommand */ @@ -2059,7 +1509,7 @@ export const de_DescribeProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2086,43 +1536,14 @@ export const de_DescribeProjectCommand = async ( }; /** - * deserializeAws_restJson1DescribeProjectCommandError + * deserializeAws_restJson1DescribeRecipeCommand */ -const de_DescribeProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeRecipeCommand - */ -export const de_DescribeRecipeCommand = async ( +export const de_DescribeRecipeCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRecipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2147,35 +1568,6 @@ export const de_DescribeRecipeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeRecipeCommandError - */ -const de_DescribeRecipeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeRulesetCommand */ @@ -2184,7 +1576,7 @@ export const de_DescribeRulesetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRulesetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2206,35 +1598,6 @@ export const de_DescribeRulesetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeRulesetCommandError - */ -const de_DescribeRulesetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeScheduleCommand */ @@ -2243,7 +1606,7 @@ export const de_DescribeScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2264,35 +1627,6 @@ export const de_DescribeScheduleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeScheduleCommandError - */ -const de_DescribeScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDatasetsCommand */ @@ -2301,7 +1635,7 @@ export const de_ListDatasetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDatasetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2315,32 +1649,6 @@ export const de_ListDatasetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDatasetsCommandError - */ -const de_ListDatasetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListJobRunsCommand */ @@ -2349,7 +1657,7 @@ export const de_ListJobRunsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobRunsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2363,35 +1671,6 @@ export const de_ListJobRunsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListJobRunsCommandError - */ -const de_ListJobRunsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListJobsCommand */ @@ -2400,7 +1679,7 @@ export const de_ListJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2414,32 +1693,6 @@ export const de_ListJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListJobsCommandError - */ -const de_ListJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProjectsCommand */ @@ -2448,7 +1701,7 @@ export const de_ListProjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProjectsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2462,32 +1715,6 @@ export const de_ListProjectsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListProjectsCommandError - */ -const de_ListProjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRecipesCommand */ @@ -2496,7 +1723,7 @@ export const de_ListRecipesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecipesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2510,32 +1737,6 @@ export const de_ListRecipesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRecipesCommandError - */ -const de_ListRecipesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRecipeVersionsCommand */ @@ -2544,7 +1745,7 @@ export const de_ListRecipeVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecipeVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2558,32 +1759,6 @@ export const de_ListRecipeVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRecipeVersionsCommandError - */ -const de_ListRecipeVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRulesetsCommand */ @@ -2592,7 +1767,7 @@ export const de_ListRulesetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRulesetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2606,35 +1781,6 @@ export const de_ListRulesetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRulesetsCommandError - */ -const de_ListRulesetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSchedulesCommand */ @@ -2643,7 +1789,7 @@ export const de_ListSchedulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSchedulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2657,32 +1803,6 @@ export const de_ListSchedulesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSchedulesCommandError - */ -const de_ListSchedulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -2691,7 +1811,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2704,38 +1824,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.databrew#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PublishRecipeCommand */ @@ -2744,7 +1832,7 @@ export const de_PublishRecipeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PublishRecipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2757,38 +1845,6 @@ export const de_PublishRecipeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PublishRecipeCommandError - */ -const de_PublishRecipeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.databrew#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SendProjectSessionActionCommand */ @@ -2797,7 +1853,7 @@ export const de_SendProjectSessionActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendProjectSessionActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2812,38 +1868,6 @@ export const de_SendProjectSessionActionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SendProjectSessionActionCommandError - */ -const de_SendProjectSessionActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartJobRunCommand */ @@ -2852,7 +1876,7 @@ export const de_StartJobRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartJobRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2865,41 +1889,6 @@ export const de_StartJobRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartJobRunCommandError - */ -const de_StartJobRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.databrew#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartProjectSessionCommand */ @@ -2908,7 +1897,7 @@ export const de_StartProjectSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartProjectSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2917,143 +1906,47 @@ export const de_StartProjectSessionCommand = async ( const doc = take(data, { ClientSessionId: __expectString, Name: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartProjectSessionCommandError - */ -const de_StartProjectSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.databrew#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.databrew#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StopJobRunCommand - */ -export const de_StopJobRunCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopJobRunCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RunId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StopJobRunCommandError - */ -const de_StopJobRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1StopJobRunCommand */ -export const de_TagResourceCommand = async ( +export const de_StopJobRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RunId: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.databrew#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -3064,7 +1957,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3073,38 +1966,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.databrew#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDatasetCommand */ @@ -3113,7 +1974,7 @@ export const de_UpdateDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3126,38 +1987,6 @@ export const de_UpdateDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDatasetCommandError - */ -const de_UpdateDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.databrew#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateProfileJobCommand */ @@ -3166,7 +1995,7 @@ export const de_UpdateProfileJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProfileJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3179,38 +2008,6 @@ export const de_UpdateProfileJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateProfileJobCommandError - */ -const de_UpdateProfileJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.databrew#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateProjectCommand */ @@ -3219,7 +2016,7 @@ export const de_UpdateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3233,35 +2030,6 @@ export const de_UpdateProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateProjectCommandError - */ -const de_UpdateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRecipeCommand */ @@ -3270,7 +2038,7 @@ export const de_UpdateRecipeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRecipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3283,35 +2051,6 @@ export const de_UpdateRecipeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRecipeCommandError - */ -const de_UpdateRecipeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRecipeJobCommand */ @@ -3320,7 +2059,7 @@ export const de_UpdateRecipeJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRecipeJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3333,38 +2072,6 @@ export const de_UpdateRecipeJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRecipeJobCommandError - */ -const de_UpdateRecipeJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.databrew#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRulesetCommand */ @@ -3373,7 +2080,7 @@ export const de_UpdateRulesetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRulesetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3386,35 +2093,6 @@ export const de_UpdateRulesetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRulesetCommandError - */ -const de_UpdateRulesetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.databrew#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.databrew#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateScheduleCommand */ @@ -3423,7 +2101,7 @@ export const de_UpdateScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3437,34 +2115,40 @@ export const de_UpdateScheduleCommand = async ( }; /** - * deserializeAws_restJson1UpdateScheduleCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "ConflictException": + case "com.amazonaws.databrew#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.databrew#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.databrew#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.databrew#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.databrew#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.databrew#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.databrew#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-dataexchange/src/protocols/Aws_restJson1.ts b/clients/client-dataexchange/src/protocols/Aws_restJson1.ts index 71867aeaa4f5..2ce9be748f16 100644 --- a/clients/client-dataexchange/src/protocols/Aws_restJson1.ts +++ b/clients/client-dataexchange/src/protocols/Aws_restJson1.ts @@ -762,7 +762,7 @@ export const de_CancelJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_CancelJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -771,44 +771,6 @@ export const de_CancelJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelJobCommandError - */ -const de_CancelJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.dataexchange#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDataSetCommand */ @@ -817,7 +779,7 @@ export const de_CreateDataSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDataSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -840,44 +802,6 @@ export const de_CreateDataSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDataSetCommandError - */ -const de_CreateDataSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.dataexchange#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceLimitExceededException": - case "com.amazonaws.dataexchange#ServiceLimitExceededException": - throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateEventActionCommand */ @@ -886,7 +810,7 @@ export const de_CreateEventActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateEventActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -904,44 +828,6 @@ export const de_CreateEventActionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEventActionCommandError - */ -const de_CreateEventActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.dataexchange#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceLimitExceededException": - case "com.amazonaws.dataexchange#ServiceLimitExceededException": - throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateJobCommand */ @@ -950,7 +836,7 @@ export const de_CreateJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -970,47 +856,6 @@ export const de_CreateJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateJobCommandError - */ -const de_CreateJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.dataexchange#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.dataexchange#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRevisionCommand */ @@ -1019,7 +864,7 @@ export const de_CreateRevisionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateRevisionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1043,44 +888,6 @@ export const de_CreateRevisionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRevisionCommandError - */ -const de_CreateRevisionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.dataexchange#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAssetCommand */ @@ -1089,7 +896,7 @@ export const de_DeleteAssetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAssetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1098,47 +905,6 @@ export const de_DeleteAssetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAssetCommandError - */ -const de_DeleteAssetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.dataexchange#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.dataexchange#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDataSetCommand */ @@ -1147,7 +913,7 @@ export const de_DeleteDataSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDataSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1156,47 +922,6 @@ export const de_DeleteDataSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDataSetCommandError - */ -const de_DeleteDataSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.dataexchange#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.dataexchange#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteEventActionCommand */ @@ -1205,7 +930,7 @@ export const de_DeleteEventActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteEventActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1215,49 +940,14 @@ export const de_DeleteEventActionCommand = async ( }; /** - * deserializeAws_restJson1DeleteEventActionCommandError + * deserializeAws_restJson1DeleteRevisionCommand */ -const de_DeleteEventActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRevisionCommand - */ -export const de_DeleteRevisionCommand = async ( +export const de_DeleteRevisionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRevisionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1266,47 +956,6 @@ export const de_DeleteRevisionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRevisionCommandError - */ -const de_DeleteRevisionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.dataexchange#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.dataexchange#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAssetCommand */ @@ -1315,7 +964,7 @@ export const de_GetAssetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1337,41 +986,6 @@ export const de_GetAssetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAssetCommandError - */ -const de_GetAssetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDataSetCommand */ @@ -1380,7 +994,7 @@ export const de_GetDataSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1403,41 +1017,6 @@ export const de_GetDataSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDataSetCommandError - */ -const de_GetDataSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEventActionCommand */ @@ -1446,7 +1025,7 @@ export const de_GetEventActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEventActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1464,41 +1043,6 @@ export const de_GetEventActionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEventActionCommandError - */ -const de_GetEventActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetJobCommand */ @@ -1507,7 +1051,7 @@ export const de_GetJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1527,38 +1071,6 @@ export const de_GetJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetJobCommandError - */ -const de_GetJobCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRevisionCommand */ @@ -1567,7 +1079,7 @@ export const de_GetRevisionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRevisionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1592,163 +1104,58 @@ export const de_GetRevisionCommand = async ( }; /** - * deserializeAws_restJson1GetRevisionCommandError + * deserializeAws_restJson1ListDataSetRevisionsCommand */ -const de_GetRevisionCommandError = async ( +export const de_ListDataSetRevisionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Revisions: (_) => de_ListOfRevisionEntry(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListDataSetRevisionsCommand + * deserializeAws_restJson1ListDataSetsCommand */ -export const de_ListDataSetRevisionsCommand = async ( +export const de_ListDataSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataSetRevisionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + DataSets: (_) => de_ListOfDataSetEntry(_, context), NextToken: __expectString, - Revisions: (_) => de_ListOfRevisionEntry(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListDataSetRevisionsCommandError + * deserializeAws_restJson1ListEventActionsCommand */ -const de_ListDataSetRevisionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDataSetsCommand - */ -export const de_ListDataSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataSetsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DataSets: (_) => de_ListOfDataSetEntry(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDataSetsCommandError - */ -const de_ListDataSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListEventActionsCommand - */ -export const de_ListEventActionsCommand = async ( +export const de_ListEventActionsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEventActionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1762,41 +1169,6 @@ export const de_ListEventActionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEventActionsCommandError - */ -const de_ListEventActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListJobsCommand */ @@ -1805,7 +1177,7 @@ export const de_ListJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1819,41 +1191,6 @@ export const de_ListJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListJobsCommandError - */ -const de_ListJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRevisionAssetsCommand */ @@ -1862,7 +1199,7 @@ export const de_ListRevisionAssetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRevisionAssetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1876,41 +1213,6 @@ export const de_ListRevisionAssetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRevisionAssetsCommandError - */ -const de_ListRevisionAssetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1919,7 +1221,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1932,26 +1234,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1RevokeRevisionCommand */ @@ -1960,191 +1242,71 @@ export const de_RevokeRevisionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RevokeRevisionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - Comment: __expectString, - CreatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - DataSetId: __expectString, - Finalized: __expectBoolean, - Id: __expectString, - RevocationComment: __expectString, - Revoked: __expectBoolean, - RevokedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - SourceId: __expectString, - UpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1RevokeRevisionCommandError - */ -const de_RevokeRevisionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.dataexchange#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.dataexchange#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SendApiAssetCommand - */ -export const de_SendApiAssetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendApiAssetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - ResponseHeaders: [ - , - Object.keys(output.headers) - .filter((header) => header.startsWith("")) - .reduce((acc, header) => { - acc[header.substring(0)] = output.headers[header]; - return acc; - }, {} as any), - ], - }); - const data: any = await collectBodyString(output.body, context); - contents.Body = __expectString(data); - return contents; -}; - -/** - * deserializeAws_restJson1SendApiAssetCommandError - */ -const de_SendApiAssetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.dataexchange#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Arn: __expectString, + Comment: __expectString, + CreatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + DataSetId: __expectString, + Finalized: __expectBoolean, + Id: __expectString, + RevocationComment: __expectString, + Revoked: __expectBoolean, + RevokedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + SourceId: __expectString, + UpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SendDataSetNotificationCommand + * deserializeAws_restJson1SendApiAssetCommand */ -export const de_SendDataSetNotificationCommand = async ( +export const de_SendApiAssetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_SendDataSetNotificationCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), + ResponseHeaders: [ + , + Object.keys(output.headers) + .filter((header) => header.startsWith("")) + .reduce((acc, header) => { + acc[header.substring(0)] = output.headers[header]; + return acc; + }, {} as any), + ], }); - await collectBody(output.body, context); + const data: any = await collectBodyString(output.body, context); + contents.Body = __expectString(data); return contents; }; /** - * deserializeAws_restJson1SendDataSetNotificationCommandError + * deserializeAws_restJson1SendDataSetNotificationCommand */ -const de_SendDataSetNotificationCommandError = async ( +export const de_SendDataSetNotificationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.dataexchange#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.dataexchange#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -2155,7 +1317,7 @@ export const de_StartJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2164,47 +1326,6 @@ export const de_StartJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartJobCommandError - */ -const de_StartJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.dataexchange#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.dataexchange#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2213,7 +1334,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2222,26 +1343,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2250,7 +1351,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2259,26 +1360,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1UpdateAssetCommand */ @@ -2287,7 +1368,7 @@ export const de_UpdateAssetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAssetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2309,47 +1390,6 @@ export const de_UpdateAssetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAssetCommandError - */ -const de_UpdateAssetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.dataexchange#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.dataexchange#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDataSetCommand */ @@ -2358,7 +1398,7 @@ export const de_UpdateDataSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDataSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2380,44 +1420,6 @@ export const de_UpdateDataSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDataSetCommandError - */ -const de_UpdateDataSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.dataexchange#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEventActionCommand */ @@ -2426,7 +1428,7 @@ export const de_UpdateEventActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEventActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2444,44 +1446,6 @@ export const de_UpdateEventActionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEventActionCommandError - */ -const de_UpdateEventActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.dataexchange#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.dataexchange#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dataexchange#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.dataexchange#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.dataexchange#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRevisionCommand */ @@ -2490,7 +1454,7 @@ export const de_UpdateRevisionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRevisionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2514,21 +1478,15 @@ export const de_UpdateRevisionCommand = async ( }; /** - * deserializeAws_restJson1UpdateRevisionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateRevisionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.dataexchange#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); case "ConflictException": case "com.amazonaws.dataexchange#ConflictException": throw await de_ConflictExceptionRes(parsedOutput, context); @@ -2544,13 +1502,19 @@ const de_UpdateRevisionCommandError = async ( case "ValidationException": case "com.amazonaws.dataexchange#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.dataexchange#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ServiceLimitExceededException": + case "com.amazonaws.dataexchange#ServiceLimitExceededException": + throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-datasync/src/protocols/Aws_json1_1.ts b/clients/client-datasync/src/protocols/Aws_json1_1.ts index 6a71206e877f..1277b570a579 100644 --- a/clients/client-datasync/src/protocols/Aws_json1_1.ts +++ b/clients/client-datasync/src/protocols/Aws_json1_1.ts @@ -1172,7 +1172,7 @@ export const de_AddStorageSystemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddStorageSystemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1184,35 +1184,6 @@ export const de_AddStorageSystemCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddStorageSystemCommandError - */ -const de_AddStorageSystemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelTaskExecutionCommand */ @@ -1221,7 +1192,7 @@ export const de_CancelTaskExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelTaskExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1233,35 +1204,6 @@ export const de_CancelTaskExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelTaskExecutionCommandError - */ -const de_CancelTaskExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAgentCommand */ @@ -1270,7 +1212,7 @@ export const de_CreateAgentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAgentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1282,35 +1224,6 @@ export const de_CreateAgentCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAgentCommandError - */ -const de_CreateAgentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLocationAzureBlobCommand */ @@ -1319,7 +1232,7 @@ export const de_CreateLocationAzureBlobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLocationAzureBlobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1331,35 +1244,6 @@ export const de_CreateLocationAzureBlobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateLocationAzureBlobCommandError - */ -const de_CreateLocationAzureBlobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLocationEfsCommand */ @@ -1368,7 +1252,7 @@ export const de_CreateLocationEfsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLocationEfsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1380,35 +1264,6 @@ export const de_CreateLocationEfsCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateLocationEfsCommandError - */ -const de_CreateLocationEfsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLocationFsxLustreCommand */ @@ -1417,7 +1272,7 @@ export const de_CreateLocationFsxLustreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLocationFsxLustreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1429,35 +1284,6 @@ export const de_CreateLocationFsxLustreCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateLocationFsxLustreCommandError - */ -const de_CreateLocationFsxLustreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLocationFsxOntapCommand */ @@ -1466,7 +1292,7 @@ export const de_CreateLocationFsxOntapCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLocationFsxOntapCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1478,35 +1304,6 @@ export const de_CreateLocationFsxOntapCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateLocationFsxOntapCommandError - */ -const de_CreateLocationFsxOntapCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLocationFsxOpenZfsCommand */ @@ -1515,7 +1312,7 @@ export const de_CreateLocationFsxOpenZfsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLocationFsxOpenZfsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1527,35 +1324,6 @@ export const de_CreateLocationFsxOpenZfsCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateLocationFsxOpenZfsCommandError - */ -const de_CreateLocationFsxOpenZfsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLocationFsxWindowsCommand */ @@ -1564,7 +1332,7 @@ export const de_CreateLocationFsxWindowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLocationFsxWindowsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1577,48 +1345,39 @@ export const de_CreateLocationFsxWindowsCommand = async ( }; /** - * deserializeAws_json1_1CreateLocationFsxWindowsCommandError + * deserializeAws_json1_1CreateLocationHdfsCommand */ -const de_CreateLocationFsxWindowsCommandError = async ( +export const de_CreateLocationHdfsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateLocationHdfsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateLocationHdfsCommand + * deserializeAws_json1_1CreateLocationNfsCommand */ -export const de_CreateLocationHdfsCommand = async ( +export const de_CreateLocationNfsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateLocationHdfsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateLocationHdfsCommandOutput = { + const response: CreateLocationNfsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1626,92 +1385,14 @@ export const de_CreateLocationHdfsCommand = async ( }; /** - * deserializeAws_json1_1CreateLocationHdfsCommandError + * deserializeAws_json1_1CreateLocationObjectStorageCommand */ -const de_CreateLocationHdfsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateLocationNfsCommand - */ -export const de_CreateLocationNfsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateLocationNfsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateLocationNfsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateLocationNfsCommandError - */ -const de_CreateLocationNfsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateLocationObjectStorageCommand - */ -export const de_CreateLocationObjectStorageCommand = async ( +export const de_CreateLocationObjectStorageCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLocationObjectStorageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1723,35 +1404,6 @@ export const de_CreateLocationObjectStorageCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateLocationObjectStorageCommandError - */ -const de_CreateLocationObjectStorageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLocationS3Command */ @@ -1760,7 +1412,7 @@ export const de_CreateLocationS3Command = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLocationS3CommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1772,35 +1424,6 @@ export const de_CreateLocationS3Command = async ( return response; }; -/** - * deserializeAws_json1_1CreateLocationS3CommandError - */ -const de_CreateLocationS3CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLocationSmbCommand */ @@ -1809,7 +1432,7 @@ export const de_CreateLocationSmbCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLocationSmbCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1821,35 +1444,6 @@ export const de_CreateLocationSmbCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateLocationSmbCommandError - */ -const de_CreateLocationSmbCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTaskCommand */ @@ -1858,7 +1452,7 @@ export const de_CreateTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1870,35 +1464,6 @@ export const de_CreateTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateTaskCommandError - */ -const de_CreateTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAgentCommand */ @@ -1907,7 +1472,7 @@ export const de_DeleteAgentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAgentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1919,35 +1484,6 @@ export const de_DeleteAgentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAgentCommandError - */ -const de_DeleteAgentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteLocationCommand */ @@ -1956,7 +1492,7 @@ export const de_DeleteLocationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLocationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1968,35 +1504,6 @@ export const de_DeleteLocationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteLocationCommandError - */ -const de_DeleteLocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteTaskCommand */ @@ -2005,7 +1512,7 @@ export const de_DeleteTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2017,35 +1524,6 @@ export const de_DeleteTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteTaskCommandError - */ -const de_DeleteTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAgentCommand */ @@ -2054,7 +1532,7 @@ export const de_DescribeAgentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAgentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2067,43 +1545,14 @@ export const de_DescribeAgentCommand = async ( }; /** - * deserializeAws_json1_1DescribeAgentCommandError + * deserializeAws_json1_1DescribeDiscoveryJobCommand */ -const de_DescribeAgentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDiscoveryJobCommand - */ -export const de_DescribeDiscoveryJobCommand = async ( +export const de_DescribeDiscoveryJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDiscoveryJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2115,35 +1564,6 @@ export const de_DescribeDiscoveryJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDiscoveryJobCommandError - */ -const de_DescribeDiscoveryJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLocationAzureBlobCommand */ @@ -2152,7 +1572,7 @@ export const de_DescribeLocationAzureBlobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocationAzureBlobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2164,35 +1584,6 @@ export const de_DescribeLocationAzureBlobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLocationAzureBlobCommandError - */ -const de_DescribeLocationAzureBlobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLocationEfsCommand */ @@ -2201,7 +1592,7 @@ export const de_DescribeLocationEfsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocationEfsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2213,35 +1604,6 @@ export const de_DescribeLocationEfsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLocationEfsCommandError - */ -const de_DescribeLocationEfsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLocationFsxLustreCommand */ @@ -2250,7 +1612,7 @@ export const de_DescribeLocationFsxLustreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocationFsxLustreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2262,35 +1624,6 @@ export const de_DescribeLocationFsxLustreCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLocationFsxLustreCommandError - */ -const de_DescribeLocationFsxLustreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLocationFsxOntapCommand */ @@ -2299,7 +1632,7 @@ export const de_DescribeLocationFsxOntapCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocationFsxOntapCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2311,35 +1644,6 @@ export const de_DescribeLocationFsxOntapCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLocationFsxOntapCommandError - */ -const de_DescribeLocationFsxOntapCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLocationFsxOpenZfsCommand */ @@ -2348,7 +1652,7 @@ export const de_DescribeLocationFsxOpenZfsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocationFsxOpenZfsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2360,35 +1664,6 @@ export const de_DescribeLocationFsxOpenZfsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLocationFsxOpenZfsCommandError - */ -const de_DescribeLocationFsxOpenZfsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLocationFsxWindowsCommand */ @@ -2397,7 +1672,7 @@ export const de_DescribeLocationFsxWindowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocationFsxWindowsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2409,35 +1684,6 @@ export const de_DescribeLocationFsxWindowsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLocationFsxWindowsCommandError - */ -const de_DescribeLocationFsxWindowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLocationHdfsCommand */ @@ -2446,7 +1692,7 @@ export const de_DescribeLocationHdfsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocationHdfsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2458,35 +1704,6 @@ export const de_DescribeLocationHdfsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLocationHdfsCommandError - */ -const de_DescribeLocationHdfsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLocationNfsCommand */ @@ -2495,7 +1712,7 @@ export const de_DescribeLocationNfsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocationNfsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2507,35 +1724,6 @@ export const de_DescribeLocationNfsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLocationNfsCommandError - */ -const de_DescribeLocationNfsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLocationObjectStorageCommand */ @@ -2544,7 +1732,7 @@ export const de_DescribeLocationObjectStorageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocationObjectStorageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2556,35 +1744,6 @@ export const de_DescribeLocationObjectStorageCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLocationObjectStorageCommandError - */ -const de_DescribeLocationObjectStorageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLocationS3Command */ @@ -2593,7 +1752,7 @@ export const de_DescribeLocationS3Command = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocationS3CommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2605,35 +1764,6 @@ export const de_DescribeLocationS3Command = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLocationS3CommandError - */ -const de_DescribeLocationS3CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLocationSmbCommand */ @@ -2642,7 +1772,7 @@ export const de_DescribeLocationSmbCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocationSmbCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2654,35 +1784,6 @@ export const de_DescribeLocationSmbCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLocationSmbCommandError - */ -const de_DescribeLocationSmbCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeStorageSystemCommand */ @@ -2691,7 +1792,7 @@ export const de_DescribeStorageSystemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStorageSystemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2703,35 +1804,6 @@ export const de_DescribeStorageSystemCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeStorageSystemCommandError - */ -const de_DescribeStorageSystemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeStorageSystemResourceMetricsCommand */ @@ -2740,7 +1812,7 @@ export const de_DescribeStorageSystemResourceMetricsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStorageSystemResourceMetricsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2752,35 +1824,6 @@ export const de_DescribeStorageSystemResourceMetricsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeStorageSystemResourceMetricsCommandError - */ -const de_DescribeStorageSystemResourceMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeStorageSystemResourcesCommand */ @@ -2789,7 +1832,7 @@ export const de_DescribeStorageSystemResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStorageSystemResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2801,35 +1844,6 @@ export const de_DescribeStorageSystemResourcesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeStorageSystemResourcesCommandError - */ -const de_DescribeStorageSystemResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTaskCommand */ @@ -2838,7 +1852,7 @@ export const de_DescribeTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2850,35 +1864,6 @@ export const de_DescribeTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTaskCommandError - */ -const de_DescribeTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTaskExecutionCommand */ @@ -2887,7 +1872,7 @@ export const de_DescribeTaskExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTaskExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2899,35 +1884,6 @@ export const de_DescribeTaskExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTaskExecutionCommandError - */ -const de_DescribeTaskExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GenerateRecommendationsCommand */ @@ -2936,7 +1892,7 @@ export const de_GenerateRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GenerateRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2949,48 +1905,39 @@ export const de_GenerateRecommendationsCommand = async ( }; /** - * deserializeAws_json1_1GenerateRecommendationsCommandError + * deserializeAws_json1_1ListAgentsCommand */ -const de_GenerateRecommendationsCommandError = async ( +export const de_ListAgentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListAgentsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListAgentsCommand + * deserializeAws_json1_1ListDiscoveryJobsCommand */ -export const de_ListAgentsCommand = async ( +export const de_ListDiscoveryJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAgentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListAgentsCommandOutput = { + const response: ListDiscoveryJobsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2998,92 +1945,14 @@ export const de_ListAgentsCommand = async ( }; /** - * deserializeAws_json1_1ListAgentsCommandError + * deserializeAws_json1_1ListLocationsCommand */ -const de_ListAgentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDiscoveryJobsCommand - */ -export const de_ListDiscoveryJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDiscoveryJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListDiscoveryJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDiscoveryJobsCommandError - */ -const de_ListDiscoveryJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListLocationsCommand - */ -export const de_ListLocationsCommand = async ( +export const de_ListLocationsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListLocationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3095,35 +1964,6 @@ export const de_ListLocationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListLocationsCommandError - */ -const de_ListLocationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListStorageSystemsCommand */ @@ -3132,7 +1972,7 @@ export const de_ListStorageSystemsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStorageSystemsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3144,35 +1984,6 @@ export const de_ListStorageSystemsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListStorageSystemsCommandError - */ -const de_ListStorageSystemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -3181,7 +1992,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3193,35 +2004,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTaskExecutionsCommand */ @@ -3230,7 +2012,7 @@ export const de_ListTaskExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTaskExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3242,35 +2024,6 @@ export const de_ListTaskExecutionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTaskExecutionsCommandError - */ -const de_ListTaskExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTasksCommand */ @@ -3279,7 +2032,7 @@ export const de_ListTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3291,35 +2044,6 @@ export const de_ListTasksCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTasksCommandError - */ -const de_ListTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RemoveStorageSystemCommand */ @@ -3328,7 +2052,7 @@ export const de_RemoveStorageSystemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveStorageSystemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3340,35 +2064,6 @@ export const de_RemoveStorageSystemCommand = async ( return response; }; -/** - * deserializeAws_json1_1RemoveStorageSystemCommandError - */ -const de_RemoveStorageSystemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartDiscoveryJobCommand */ @@ -3377,7 +2072,7 @@ export const de_StartDiscoveryJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartDiscoveryJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3389,35 +2084,6 @@ export const de_StartDiscoveryJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartDiscoveryJobCommandError - */ -const de_StartDiscoveryJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartTaskExecutionCommand */ @@ -3426,7 +2092,7 @@ export const de_StartTaskExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartTaskExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3438,35 +2104,6 @@ export const de_StartTaskExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartTaskExecutionCommandError - */ -const de_StartTaskExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopDiscoveryJobCommand */ @@ -3475,7 +2112,7 @@ export const de_StopDiscoveryJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopDiscoveryJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3487,35 +2124,6 @@ export const de_StopDiscoveryJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopDiscoveryJobCommandError - */ -const de_StopDiscoveryJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -3524,110 +2132,32 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: TagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UntagResourceCommand - */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UntagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateAgentCommand + * deserializeAws_json1_1UntagResourceCommand */ -export const de_UpdateAgentCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateAgentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateAgentCommandOutput = { + const response: UntagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3635,32 +2165,23 @@ export const de_UpdateAgentCommand = async ( }; /** - * deserializeAws_json1_1UpdateAgentCommandError + * deserializeAws_json1_1UpdateAgentCommand */ -const de_UpdateAgentCommandError = async ( +export const de_UpdateAgentCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateAgentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3671,7 +2192,7 @@ export const de_UpdateDiscoveryJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDiscoveryJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3683,35 +2204,6 @@ export const de_UpdateDiscoveryJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDiscoveryJobCommandError - */ -const de_UpdateDiscoveryJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateLocationAzureBlobCommand */ @@ -3720,7 +2212,7 @@ export const de_UpdateLocationAzureBlobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLocationAzureBlobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3732,35 +2224,6 @@ export const de_UpdateLocationAzureBlobCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateLocationAzureBlobCommandError - */ -const de_UpdateLocationAzureBlobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateLocationHdfsCommand */ @@ -3769,7 +2232,7 @@ export const de_UpdateLocationHdfsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLocationHdfsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3781,35 +2244,6 @@ export const de_UpdateLocationHdfsCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateLocationHdfsCommandError - */ -const de_UpdateLocationHdfsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateLocationNfsCommand */ @@ -3818,7 +2252,7 @@ export const de_UpdateLocationNfsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLocationNfsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3830,35 +2264,6 @@ export const de_UpdateLocationNfsCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateLocationNfsCommandError - */ -const de_UpdateLocationNfsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateLocationObjectStorageCommand */ @@ -3867,7 +2272,7 @@ export const de_UpdateLocationObjectStorageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLocationObjectStorageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3879,35 +2284,6 @@ export const de_UpdateLocationObjectStorageCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateLocationObjectStorageCommandError - */ -const de_UpdateLocationObjectStorageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateLocationSmbCommand */ @@ -3916,7 +2292,7 @@ export const de_UpdateLocationSmbCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLocationSmbCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3928,35 +2304,6 @@ export const de_UpdateLocationSmbCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateLocationSmbCommandError - */ -const de_UpdateLocationSmbCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateStorageSystemCommand */ @@ -3965,7 +2312,7 @@ export const de_UpdateStorageSystemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateStorageSystemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3977,35 +2324,6 @@ export const de_UpdateStorageSystemCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateStorageSystemCommandError - */ -const de_UpdateStorageSystemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateTaskCommand */ @@ -4014,7 +2332,7 @@ export const de_UpdateTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4026,35 +2344,6 @@ export const de_UpdateTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateTaskCommandError - */ -const de_UpdateTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.datasync#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.datasync#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateTaskExecutionCommand */ @@ -4063,7 +2352,7 @@ export const de_UpdateTaskExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTaskExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4076,12 +2365,9 @@ export const de_UpdateTaskExecutionCommand = async ( }; /** - * deserializeAws_json1_1UpdateTaskExecutionCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateTaskExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4100,7 +2386,7 @@ const de_UpdateTaskExecutionCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-datazone/src/protocols/Aws_restJson1.ts b/clients/client-datazone/src/protocols/Aws_restJson1.ts index 5523d8be0980..f5477b168649 100644 --- a/clients/client-datazone/src/protocols/Aws_restJson1.ts +++ b/clients/client-datazone/src/protocols/Aws_restJson1.ts @@ -2602,7 +2602,7 @@ export const de_AcceptPredictionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptPredictionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2617,50 +2617,6 @@ export const de_AcceptPredictionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptPredictionsCommandError - */ -const de_AcceptPredictionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AcceptSubscriptionRequestCommand */ @@ -2669,7 +2625,7 @@ export const de_AcceptSubscriptionRequestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptSubscriptionRequestCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2693,50 +2649,6 @@ export const de_AcceptSubscriptionRequestCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptSubscriptionRequestCommandError - */ -const de_AcceptSubscriptionRequestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelSubscriptionCommand */ @@ -2745,7 +2657,7 @@ export const de_CancelSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2768,50 +2680,6 @@ export const de_CancelSubscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelSubscriptionCommandError - */ -const de_CancelSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAssetCommand */ @@ -2820,7 +2688,7 @@ export const de_CreateAssetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAssetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2850,53 +2718,6 @@ export const de_CreateAssetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAssetCommandError - */ -const de_CreateAssetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAssetRevisionCommand */ @@ -2905,7 +2726,7 @@ export const de_CreateAssetRevisionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAssetRevisionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2935,50 +2756,6 @@ export const de_CreateAssetRevisionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAssetRevisionCommandError - */ -const de_CreateAssetRevisionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAssetTypeCommand */ @@ -2987,7 +2764,7 @@ export const de_CreateAssetTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAssetTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3011,50 +2788,6 @@ export const de_CreateAssetTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAssetTypeCommandError - */ -const de_CreateAssetTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDataSourceCommand */ @@ -3063,7 +2796,7 @@ export const de_CreateDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3096,61 +2829,14 @@ export const de_CreateDataSourceCommand = async ( }; /** - * deserializeAws_restJson1CreateDataSourceCommandError + * deserializeAws_restJson1CreateDomainCommand */ -const de_CreateDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateDomainCommand - */ -export const de_CreateDomainCommand = async ( +export const de_CreateDomainCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3172,53 +2858,6 @@ export const de_CreateDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDomainCommandError - */ -const de_CreateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateEnvironmentCommand */ @@ -3227,7 +2866,7 @@ export const de_CreateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3260,50 +2899,6 @@ export const de_CreateEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEnvironmentCommandError - */ -const de_CreateEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateEnvironmentProfileCommand */ @@ -3312,7 +2907,7 @@ export const de_CreateEnvironmentProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateEnvironmentProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3336,53 +2931,6 @@ export const de_CreateEnvironmentProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEnvironmentProfileCommandError - */ -const de_CreateEnvironmentProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFormTypeCommand */ @@ -3391,7 +2939,7 @@ export const de_CreateFormTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateFormTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3410,50 +2958,6 @@ export const de_CreateFormTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFormTypeCommandError - */ -const de_CreateFormTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateGlossaryCommand */ @@ -3462,7 +2966,7 @@ export const de_CreateGlossaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateGlossaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3480,50 +2984,6 @@ export const de_CreateGlossaryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGlossaryCommandError - */ -const de_CreateGlossaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateGlossaryTermCommand */ @@ -3532,7 +2992,7 @@ export const de_CreateGlossaryTermCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateGlossaryTermCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3553,61 +3013,14 @@ export const de_CreateGlossaryTermCommand = async ( }; /** - * deserializeAws_restJson1CreateGlossaryTermCommandError + * deserializeAws_restJson1CreateGroupProfileCommand */ -const de_CreateGlossaryTermCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateGroupProfileCommand - */ -export const de_CreateGroupProfileCommand = async ( +export const de_CreateGroupProfileCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateGroupProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3623,47 +3036,6 @@ export const de_CreateGroupProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGroupProfileCommandError - */ -const de_CreateGroupProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateListingChangeSetCommand */ @@ -3672,7 +3044,7 @@ export const de_CreateListingChangeSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateListingChangeSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3687,53 +3059,6 @@ export const de_CreateListingChangeSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateListingChangeSetCommandError - */ -const de_CreateListingChangeSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProjectCommand */ @@ -3742,7 +3067,7 @@ export const de_CreateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3764,53 +3089,6 @@ export const de_CreateProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProjectCommandError - */ -const de_CreateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProjectMembershipCommand */ @@ -3819,7 +3097,7 @@ export const de_CreateProjectMembershipCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateProjectMembershipCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3828,47 +3106,6 @@ export const de_CreateProjectMembershipCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProjectMembershipCommandError - */ -const de_CreateProjectMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSubscriptionGrantCommand */ @@ -3877,7 +3114,7 @@ export const de_CreateSubscriptionGrantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSubscriptionGrantCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3900,50 +3137,6 @@ export const de_CreateSubscriptionGrantCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSubscriptionGrantCommandError - */ -const de_CreateSubscriptionGrantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSubscriptionRequestCommand */ @@ -3952,7 +3145,7 @@ export const de_CreateSubscriptionRequestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSubscriptionRequestCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3977,58 +3170,14 @@ export const de_CreateSubscriptionRequestCommand = async ( }; /** - * deserializeAws_restJson1CreateSubscriptionRequestCommandError + * deserializeAws_restJson1CreateSubscriptionTargetCommand */ -const de_CreateSubscriptionRequestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateSubscriptionTargetCommand - */ -export const de_CreateSubscriptionTargetCommand = async ( +export const de_CreateSubscriptionTargetCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSubscriptionTargetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4055,50 +3204,6 @@ export const de_CreateSubscriptionTargetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSubscriptionTargetCommandError - */ -const de_CreateSubscriptionTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateUserProfileCommand */ @@ -4107,7 +3212,7 @@ export const de_CreateUserProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateUserProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4124,47 +3229,6 @@ export const de_CreateUserProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateUserProfileCommandError - */ -const de_CreateUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAssetCommand */ @@ -4173,7 +3237,7 @@ export const de_DeleteAssetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAssetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4182,47 +3246,6 @@ export const de_DeleteAssetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAssetCommandError - */ -const de_DeleteAssetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAssetTypeCommand */ @@ -4231,7 +3254,7 @@ export const de_DeleteAssetTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAssetTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4240,50 +3263,6 @@ export const de_DeleteAssetTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAssetTypeCommandError - */ -const de_DeleteAssetTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDataSourceCommand */ @@ -4292,7 +3271,7 @@ export const de_DeleteDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4323,53 +3302,6 @@ export const de_DeleteDataSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDataSourceCommandError - */ -const de_DeleteDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDomainCommand */ @@ -4378,7 +3310,7 @@ export const de_DeleteDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4392,58 +3324,14 @@ export const de_DeleteDomainCommand = async ( }; /** - * deserializeAws_restJson1DeleteDomainCommandError + * deserializeAws_restJson1DeleteEnvironmentCommand */ -const de_DeleteDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteEnvironmentCommand - */ -export const de_DeleteEnvironmentCommand = async ( +export const de_DeleteEnvironmentCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4452,47 +3340,6 @@ export const de_DeleteEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEnvironmentCommandError - */ -const de_DeleteEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteEnvironmentBlueprintConfigurationCommand */ @@ -4501,7 +3348,7 @@ export const de_DeleteEnvironmentBlueprintConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteEnvironmentBlueprintConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4510,44 +3357,6 @@ export const de_DeleteEnvironmentBlueprintConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEnvironmentBlueprintConfigurationCommandError - */ -const de_DeleteEnvironmentBlueprintConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteEnvironmentProfileCommand */ @@ -4556,7 +3365,7 @@ export const de_DeleteEnvironmentProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteEnvironmentProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4566,55 +3375,31 @@ export const de_DeleteEnvironmentProfileCommand = async ( }; /** - * deserializeAws_restJson1DeleteEnvironmentProfileCommandError + * deserializeAws_restJson1DeleteFormTypeCommand */ -const de_DeleteEnvironmentProfileCommandError = async ( +export const de_DeleteFormTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteFormTypeCommand + * deserializeAws_restJson1DeleteGlossaryCommand */ -export const de_DeleteFormTypeCommand = async ( +export const de_DeleteGlossaryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteFormTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4624,58 +3409,31 @@ export const de_DeleteFormTypeCommand = async ( }; /** - * deserializeAws_restJson1DeleteFormTypeCommandError + * deserializeAws_restJson1DeleteGlossaryTermCommand */ -const de_DeleteFormTypeCommandError = async ( +export const de_DeleteGlossaryTermCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteGlossaryCommand + * deserializeAws_restJson1DeleteListingCommand */ -export const de_DeleteGlossaryCommand = async ( +export const de_DeleteListingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteGlossaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4685,58 +3443,31 @@ export const de_DeleteGlossaryCommand = async ( }; /** - * deserializeAws_restJson1DeleteGlossaryCommandError + * deserializeAws_restJson1DeleteProjectCommand */ -const de_DeleteGlossaryCommandError = async ( +export const de_DeleteProjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteGlossaryTermCommand + * deserializeAws_restJson1DeleteProjectMembershipCommand */ -export const de_DeleteGlossaryTermCommand = async ( +export const de_DeleteProjectMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteGlossaryTermCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4746,1285 +3477,29 @@ export const de_DeleteGlossaryTermCommand = async ( }; /** - * deserializeAws_restJson1DeleteGlossaryTermCommandError + * deserializeAws_restJson1DeleteSubscriptionGrantCommand */ -const de_DeleteGlossaryTermCommandError = async ( +export const de_DeleteSubscriptionGrantCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteListingCommand - */ -export const de_DeleteListingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteListingCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteListingCommandError - */ -const de_DeleteListingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteProjectCommand - */ -export const de_DeleteProjectCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteProjectCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteProjectCommandError - */ -const de_DeleteProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteProjectMembershipCommand - */ -export const de_DeleteProjectMembershipCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteProjectMembershipCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteProjectMembershipCommandError - */ -const de_DeleteProjectMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSubscriptionGrantCommand - */ -export const de_DeleteSubscriptionGrantCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSubscriptionGrantCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - assets: (_) => de_SubscribedAssets(_, context), - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - createdBy: __expectString, - domainId: __expectString, - grantedEntity: (_) => _json(__expectUnion(_)), - id: __expectString, - status: __expectString, - subscriptionId: __expectString, - subscriptionTargetId: __expectString, - updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - updatedBy: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSubscriptionGrantCommandError - */ -const de_DeleteSubscriptionGrantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSubscriptionRequestCommand - */ -export const de_DeleteSubscriptionRequestCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSubscriptionRequestCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSubscriptionRequestCommandError - */ -const de_DeleteSubscriptionRequestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSubscriptionTargetCommand - */ -export const de_DeleteSubscriptionTargetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSubscriptionTargetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSubscriptionTargetCommandError - */ -const de_DeleteSubscriptionTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAssetCommand - */ -export const de_GetAssetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - createdBy: __expectString, - description: __expectString, - domainId: __expectString, - externalIdentifier: __expectString, - firstRevisionCreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - firstRevisionCreatedBy: __expectString, - formsOutput: _json, - glossaryTerms: _json, - id: __expectString, - listing: _json, - name: __expectString, - owningProjectId: __expectString, - readOnlyFormsOutput: _json, - revision: __expectString, - typeIdentifier: __expectString, - typeRevision: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAssetCommandError - */ -const de_GetAssetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAssetTypeCommand - */ -export const de_GetAssetTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssetTypeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - createdBy: __expectString, - description: __expectString, - domainId: __expectString, - formsOutput: _json, - name: __expectString, - originDomainId: __expectString, - originProjectId: __expectString, - owningProjectId: __expectString, - revision: __expectString, - updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - updatedBy: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAssetTypeCommandError - */ -const de_GetAssetTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDataSourceCommand - */ -export const de_GetDataSourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataSourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - assetFormsOutput: _json, - configuration: (_) => _json(__expectUnion(_)), - createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - description: __expectString, - domainId: __expectString, - enableSetting: __expectString, - environmentId: __expectString, - errorMessage: _json, - id: __expectString, - lastRunAssetCount: __expectInt32, - lastRunAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - lastRunErrorMessage: _json, - lastRunStatus: __expectString, - name: __expectString, - projectId: __expectString, - publishOnImport: __expectBoolean, - recommendation: _json, - schedule: _json, - status: __expectString, - type: __expectString, - updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDataSourceCommandError - */ -const de_GetDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDataSourceRunCommand - */ -export const de_GetDataSourceRunCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataSourceRunCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - dataSourceConfigurationSnapshot: __expectString, - dataSourceId: __expectString, - domainId: __expectString, - errorMessage: _json, - id: __expectString, - projectId: __expectString, - runStatisticsForAssets: _json, - startedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - status: __expectString, - stoppedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - type: __expectString, - updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDataSourceRunCommandError - */ -const de_GetDataSourceRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDomainCommand - */ -export const de_GetDomainCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDomainCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - arn: __expectString, - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - description: __expectString, - domainExecutionRole: __expectString, - id: __expectString, - kmsKeyIdentifier: __expectString, - lastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - name: __expectString, - portalUrl: __expectString, - singleSignOn: _json, - status: __expectString, - tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDomainCommandError - */ -const de_GetDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEnvironmentCommand - */ -export const de_GetEnvironmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEnvironmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - awsAccountId: __expectString, - awsAccountRegion: __expectString, - createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - createdBy: __expectString, - deploymentProperties: _json, - description: __expectString, - domainId: __expectString, - environmentActions: _json, - environmentBlueprintId: __expectString, - environmentProfileId: __expectString, - glossaryTerms: _json, - id: __expectString, - lastDeployment: _json, - name: __expectString, - projectId: __expectString, - provider: __expectString, - provisionedResources: _json, - provisioningProperties: (_) => _json(__expectUnion(_)), - status: __expectString, - updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - userParameters: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEnvironmentCommandError - */ -const de_GetEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEnvironmentBlueprintCommand - */ -export const de_GetEnvironmentBlueprintCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEnvironmentBlueprintCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - deploymentProperties: _json, - description: __expectString, - glossaryTerms: _json, - id: __expectString, - name: __expectString, - provider: __expectString, - provisioningProperties: (_) => _json(__expectUnion(_)), - updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - userParameters: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEnvironmentBlueprintCommandError - */ -const de_GetEnvironmentBlueprintCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEnvironmentBlueprintConfigurationCommand - */ -export const de_GetEnvironmentBlueprintConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEnvironmentBlueprintConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - domainId: __expectString, - enabledRegions: _json, - environmentBlueprintId: __expectString, - manageAccessRoleArn: __expectString, - provisioningRoleArn: __expectString, - regionalParameters: _json, - updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEnvironmentBlueprintConfigurationCommandError - */ -const de_GetEnvironmentBlueprintConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEnvironmentProfileCommand - */ -export const de_GetEnvironmentProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEnvironmentProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - awsAccountId: __expectString, - awsAccountRegion: __expectString, - createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - createdBy: __expectString, - description: __expectString, - domainId: __expectString, - environmentBlueprintId: __expectString, - id: __expectString, - name: __expectString, - projectId: __expectString, - updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - userParameters: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEnvironmentProfileCommandError - */ -const de_GetEnvironmentProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFormTypeCommand - */ -export const de_GetFormTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFormTypeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - createdBy: __expectString, - description: __expectString, - domainId: __expectString, - imports: _json, - model: (_) => _json(__expectUnion(_)), - name: __expectString, - originDomainId: __expectString, - originProjectId: __expectString, - owningProjectId: __expectString, - revision: __expectString, - status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFormTypeCommandError - */ -const de_GetFormTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetGlossaryCommand - */ -export const de_GetGlossaryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGlossaryCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - createdBy: __expectString, - description: __expectString, - domainId: __expectString, - id: __expectString, - name: __expectString, - owningProjectId: __expectString, - status: __expectString, - updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - updatedBy: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetGlossaryCommandError - */ -const de_GetGlossaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetGlossaryTermCommand - */ -export const de_GetGlossaryTermCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGlossaryTermCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + assets: (_) => de_SubscribedAssets(_, context), createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), createdBy: __expectString, domainId: __expectString, - glossaryId: __expectString, + grantedEntity: (_) => _json(__expectUnion(_)), id: __expectString, - longDescription: __expectString, - name: __expectString, - shortDescription: __expectString, status: __expectString, - termRelations: _json, + subscriptionId: __expectString, + subscriptionTargetId: __expectString, updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), updatedBy: __expectString, }); @@ -6033,186 +3508,85 @@ export const de_GetGlossaryTermCommand = async ( }; /** - * deserializeAws_restJson1GetGlossaryTermCommandError - */ -const de_GetGlossaryTermCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetGroupProfileCommand + * deserializeAws_restJson1DeleteSubscriptionRequestCommand */ -export const de_GetGroupProfileCommand = async ( +export const de_DeleteSubscriptionRequestCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGroupProfileCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - domainId: __expectString, - groupName: __expectString, - id: __expectString, - status: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1GetGroupProfileCommandError + * deserializeAws_restJson1DeleteSubscriptionTargetCommand */ -const de_GetGroupProfileCommandError = async ( +export const de_DeleteSubscriptionTargetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetIamPortalLoginUrlCommand + * deserializeAws_restJson1GetAssetCommand */ -export const de_GetIamPortalLoginUrlCommand = async ( +export const de_GetAssetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIamPortalLoginUrlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - authCodeUrl: __expectString, - userProfileId: __expectString, + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + createdBy: __expectString, + description: __expectString, + domainId: __expectString, + externalIdentifier: __expectString, + firstRevisionCreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + firstRevisionCreatedBy: __expectString, + formsOutput: _json, + glossaryTerms: _json, + id: __expectString, + listing: _json, + name: __expectString, + owningProjectId: __expectString, + readOnlyFormsOutput: _json, + revision: __expectString, + typeIdentifier: __expectString, + typeRevision: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetIamPortalLoginUrlCommandError - */ -const de_GetIamPortalLoginUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetListingCommand + * deserializeAws_restJson1GetAssetTypeCommand */ -export const de_GetListingCommand = async ( +export const de_GetAssetTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetListingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6223,11 +3597,12 @@ export const de_GetListingCommand = async ( createdBy: __expectString, description: __expectString, domainId: __expectString, - id: __expectString, - item: (_) => de_ListingItem(__expectUnion(_), context), - listingRevision: __expectString, + formsOutput: _json, name: __expectString, - status: __expectString, + originDomainId: __expectString, + originProjectId: __expectString, + owningProjectId: __expectString, + revision: __expectString, updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), updatedBy: __expectString, }); @@ -6236,55 +3611,55 @@ export const de_GetListingCommand = async ( }; /** - * deserializeAws_restJson1GetListingCommandError + * deserializeAws_restJson1GetDataSourceCommand */ -const de_GetListingCommandError = async ( +export const de_GetDataSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + assetFormsOutput: _json, + configuration: (_) => _json(__expectUnion(_)), + createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + description: __expectString, + domainId: __expectString, + enableSetting: __expectString, + environmentId: __expectString, + errorMessage: _json, + id: __expectString, + lastRunAssetCount: __expectInt32, + lastRunAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + lastRunErrorMessage: _json, + lastRunStatus: __expectString, + name: __expectString, + projectId: __expectString, + publishOnImport: __expectBoolean, + recommendation: _json, + schedule: _json, + status: __expectString, + type: __expectString, + updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetProjectCommand + * deserializeAws_restJson1GetDataSourceRunCommand */ -export const de_GetProjectCommand = async ( +export const de_GetDataSourceRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6292,838 +3667,557 @@ export const de_GetProjectCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - createdBy: __expectString, - description: __expectString, + dataSourceConfigurationSnapshot: __expectString, + dataSourceId: __expectString, domainId: __expectString, - failureReasons: _json, - glossaryTerms: _json, + errorMessage: _json, id: __expectString, - lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - name: __expectString, - projectStatus: __expectString, + projectId: __expectString, + runStatisticsForAssets: _json, + startedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + status: __expectString, + stoppedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + type: __expectString, + updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetProjectCommandError - */ -const de_GetProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSubscriptionCommand + * deserializeAws_restJson1GetDomainCommand */ -export const de_GetSubscriptionCommand = async ( +export const de_GetDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + arn: __expectString, createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - createdBy: __expectString, - domainId: __expectString, + description: __expectString, + domainExecutionRole: __expectString, id: __expectString, - retainPermissions: __expectBoolean, + kmsKeyIdentifier: __expectString, + lastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + name: __expectString, + portalUrl: __expectString, + singleSignOn: _json, status: __expectString, - subscribedListing: _json, - subscribedPrincipal: (_) => _json(__expectUnion(_)), - subscriptionRequestId: __expectString, - updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - updatedBy: __expectString, + tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetSubscriptionCommandError - */ -const de_GetSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSubscriptionGrantCommand + * deserializeAws_restJson1GetEnvironmentCommand */ -export const de_GetSubscriptionGrantCommand = async ( +export const de_GetEnvironmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSubscriptionGrantCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - assets: (_) => de_SubscribedAssets(_, context), - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + awsAccountId: __expectString, + awsAccountRegion: __expectString, + createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), createdBy: __expectString, + deploymentProperties: _json, + description: __expectString, domainId: __expectString, - grantedEntity: (_) => _json(__expectUnion(_)), + environmentActions: _json, + environmentBlueprintId: __expectString, + environmentProfileId: __expectString, + glossaryTerms: _json, id: __expectString, + lastDeployment: _json, + name: __expectString, + projectId: __expectString, + provider: __expectString, + provisionedResources: _json, + provisioningProperties: (_) => _json(__expectUnion(_)), status: __expectString, - subscriptionId: __expectString, - subscriptionTargetId: __expectString, - updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - updatedBy: __expectString, + updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + userParameters: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetSubscriptionGrantCommandError - */ -const de_GetSubscriptionGrantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSubscriptionRequestDetailsCommand + * deserializeAws_restJson1GetEnvironmentBlueprintCommand */ -export const de_GetSubscriptionRequestDetailsCommand = async ( +export const de_GetEnvironmentBlueprintCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSubscriptionRequestDetailsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - createdBy: __expectString, - decisionComment: __expectString, - domainId: __expectString, + createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + deploymentProperties: _json, + description: __expectString, + glossaryTerms: _json, id: __expectString, - requestReason: __expectString, - reviewerId: __expectString, - status: __expectString, - subscribedListings: _json, - subscribedPrincipals: _json, - updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - updatedBy: __expectString, + name: __expectString, + provider: __expectString, + provisioningProperties: (_) => _json(__expectUnion(_)), + updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + userParameters: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetSubscriptionRequestDetailsCommandError + * deserializeAws_restJson1GetEnvironmentBlueprintConfigurationCommand */ -const de_GetSubscriptionRequestDetailsCommandError = async ( +export const de_GetEnvironmentBlueprintConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + domainId: __expectString, + enabledRegions: _json, + environmentBlueprintId: __expectString, + manageAccessRoleArn: __expectString, + provisioningRoleArn: __expectString, + regionalParameters: _json, + updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetSubscriptionTargetCommand + * deserializeAws_restJson1GetEnvironmentProfileCommand */ -export const de_GetSubscriptionTargetCommand = async ( +export const de_GetEnvironmentProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSubscriptionTargetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - applicableAssetTypes: _json, - authorizedPrincipals: _json, - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + awsAccountId: __expectString, + awsAccountRegion: __expectString, + createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), createdBy: __expectString, + description: __expectString, domainId: __expectString, - environmentId: __expectString, + environmentBlueprintId: __expectString, id: __expectString, - manageAccessRole: __expectString, name: __expectString, projectId: __expectString, - provider: __expectString, - subscriptionTargetConfig: _json, - type: __expectString, - updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - updatedBy: __expectString, + updatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + userParameters: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetSubscriptionTargetCommandError + * deserializeAws_restJson1GetFormTypeCommand */ -const de_GetSubscriptionTargetCommandError = async ( +export const de_GetFormTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + createdBy: __expectString, + description: __expectString, + domainId: __expectString, + imports: _json, + model: (_) => _json(__expectUnion(_)), + name: __expectString, + originDomainId: __expectString, + originProjectId: __expectString, + owningProjectId: __expectString, + revision: __expectString, + status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetUserProfileCommand + * deserializeAws_restJson1GetGlossaryCommand */ -export const de_GetUserProfileCommand = async ( +export const de_GetGlossaryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUserProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - details: (_) => _json(__expectUnion(_)), + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + createdBy: __expectString, + description: __expectString, domainId: __expectString, id: __expectString, + name: __expectString, + owningProjectId: __expectString, status: __expectString, - type: __expectString, + updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + updatedBy: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetUserProfileCommandError - */ -const de_GetUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAssetRevisionsCommand + * deserializeAws_restJson1GetGlossaryTermCommand */ -export const de_ListAssetRevisionsCommand = async ( +export const de_GetGlossaryTermCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssetRevisionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: (_) => de_AssetRevisions(_, context), - nextToken: __expectString, + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + createdBy: __expectString, + domainId: __expectString, + glossaryId: __expectString, + id: __expectString, + longDescription: __expectString, + name: __expectString, + shortDescription: __expectString, + status: __expectString, + termRelations: _json, + updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + updatedBy: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAssetRevisionsCommandError - */ -const de_ListAssetRevisionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDataSourceRunActivitiesCommand + * deserializeAws_restJson1GetGroupProfileCommand */ -export const de_ListDataSourceRunActivitiesCommand = async ( +export const de_GetGroupProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataSourceRunActivitiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: (_) => de_DataSourceRunActivities(_, context), - nextToken: __expectString, + domainId: __expectString, + groupName: __expectString, + id: __expectString, + status: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListDataSourceRunActivitiesCommandError + * deserializeAws_restJson1GetIamPortalLoginUrlCommand */ -const de_ListDataSourceRunActivitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_GetIamPortalLoginUrlCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + authCodeUrl: __expectString, + userProfileId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListDataSourceRunsCommand + * deserializeAws_restJson1GetListingCommand */ -export const de_ListDataSourceRunsCommand = async ( +export const de_GetListingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataSourceRunsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: (_) => de_DataSourceRunSummaries(_, context), - nextToken: __expectString, + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + createdBy: __expectString, + description: __expectString, + domainId: __expectString, + id: __expectString, + item: (_) => de_ListingItem(__expectUnion(_), context), + listingRevision: __expectString, + name: __expectString, + status: __expectString, + updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + updatedBy: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListDataSourceRunsCommandError + * deserializeAws_restJson1GetProjectCommand */ -const de_ListDataSourceRunsCommandError = async ( +export const de_GetProjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + createdBy: __expectString, + description: __expectString, + domainId: __expectString, + failureReasons: _json, + glossaryTerms: _json, + id: __expectString, + lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + name: __expectString, + projectStatus: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListDataSourcesCommand + * deserializeAws_restJson1GetSubscriptionCommand */ -export const de_ListDataSourcesCommand = async ( +export const de_GetSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataSourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: (_) => de_DataSourceSummaries(_, context), - nextToken: __expectString, + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + createdBy: __expectString, + domainId: __expectString, + id: __expectString, + retainPermissions: __expectBoolean, + status: __expectString, + subscribedListing: _json, + subscribedPrincipal: (_) => _json(__expectUnion(_)), + subscriptionRequestId: __expectString, + updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + updatedBy: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListDataSourcesCommandError + * deserializeAws_restJson1GetSubscriptionGrantCommand */ -const de_ListDataSourcesCommandError = async ( +export const de_GetSubscriptionGrantCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + assets: (_) => de_SubscribedAssets(_, context), + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + createdBy: __expectString, + domainId: __expectString, + grantedEntity: (_) => _json(__expectUnion(_)), + id: __expectString, + status: __expectString, + subscriptionId: __expectString, + subscriptionTargetId: __expectString, + updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + updatedBy: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListDomainsCommand + * deserializeAws_restJson1GetSubscriptionRequestDetailsCommand */ -export const de_ListDomainsCommand = async ( +export const de_GetSubscriptionRequestDetailsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDomainsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: (_) => de_DomainSummaries(_, context), - nextToken: __expectString, + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + createdBy: __expectString, + decisionComment: __expectString, + domainId: __expectString, + id: __expectString, + requestReason: __expectString, + reviewerId: __expectString, + status: __expectString, + subscribedListings: _json, + subscribedPrincipals: _json, + updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + updatedBy: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListDomainsCommandError + * deserializeAws_restJson1GetSubscriptionTargetCommand */ -const de_ListDomainsCommandError = async ( +export const de_GetSubscriptionTargetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + applicableAssetTypes: _json, + authorizedPrincipals: _json, + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + createdBy: __expectString, + domainId: __expectString, + environmentId: __expectString, + id: __expectString, + manageAccessRole: __expectString, + name: __expectString, + projectId: __expectString, + provider: __expectString, + subscriptionTargetConfig: _json, + type: __expectString, + updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + updatedBy: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListEnvironmentBlueprintConfigurationsCommand + * deserializeAws_restJson1GetUserProfileCommand */ -export const de_ListEnvironmentBlueprintConfigurationsCommand = async ( +export const de_GetUserProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEnvironmentBlueprintConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: (_) => de_EnvironmentBlueprintConfigurations(_, context), - nextToken: __expectString, + details: (_) => _json(__expectUnion(_)), + domainId: __expectString, + id: __expectString, + status: __expectString, + type: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListEnvironmentBlueprintConfigurationsCommandError - */ -const de_ListEnvironmentBlueprintConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListEnvironmentBlueprintsCommand + * deserializeAws_restJson1ListAssetRevisionsCommand */ -export const de_ListEnvironmentBlueprintsCommand = async ( +export const de_ListAssetRevisionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEnvironmentBlueprintsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: (_) => de_EnvironmentBlueprintSummaries(_, context), + items: (_) => de_AssetRevisions(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -7131,62 +4225,43 @@ export const de_ListEnvironmentBlueprintsCommand = async ( }; /** - * deserializeAws_restJson1ListEnvironmentBlueprintsCommandError + * deserializeAws_restJson1ListDataSourceRunActivitiesCommand */ -const de_ListEnvironmentBlueprintsCommandError = async ( +export const de_ListDataSourceRunActivitiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: (_) => de_DataSourceRunActivities(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListEnvironmentProfilesCommand + * deserializeAws_restJson1ListDataSourceRunsCommand */ -export const de_ListEnvironmentProfilesCommand = async ( +export const de_ListDataSourceRunsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEnvironmentProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: (_) => de_EnvironmentProfileSummaries(_, context), + items: (_) => de_DataSourceRunSummaries(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -7194,59 +4269,43 @@ export const de_ListEnvironmentProfilesCommand = async ( }; /** - * deserializeAws_restJson1ListEnvironmentProfilesCommandError + * deserializeAws_restJson1ListDataSourcesCommand */ -const de_ListEnvironmentProfilesCommandError = async ( +export const de_ListDataSourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: (_) => de_DataSourceSummaries(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListEnvironmentsCommand + * deserializeAws_restJson1ListDomainsCommand */ -export const de_ListEnvironmentsCommand = async ( +export const de_ListDomainsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEnvironmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: (_) => de_EnvironmentSummaries(_, context), + items: (_) => de_DomainSummaries(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -7254,122 +4313,87 @@ export const de_ListEnvironmentsCommand = async ( }; /** - * deserializeAws_restJson1ListEnvironmentsCommandError + * deserializeAws_restJson1ListEnvironmentBlueprintConfigurationsCommand */ -const de_ListEnvironmentsCommandError = async ( +export const de_ListEnvironmentBlueprintConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: (_) => de_EnvironmentBlueprintConfigurations(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListNotificationsCommand + * deserializeAws_restJson1ListEnvironmentBlueprintsCommand */ -export const de_ListNotificationsCommand = async ( +export const de_ListEnvironmentBlueprintsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNotificationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + items: (_) => de_EnvironmentBlueprintSummaries(_, context), nextToken: __expectString, - notifications: (_) => de_NotificationsList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListNotificationsCommandError + * deserializeAws_restJson1ListEnvironmentProfilesCommand */ -const de_ListNotificationsCommandError = async ( +export const de_ListEnvironmentProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: (_) => de_EnvironmentProfileSummaries(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListProjectMembershipsCommand + * deserializeAws_restJson1ListEnvironmentsCommand */ -export const de_ListProjectMembershipsCommand = async ( +export const de_ListEnvironmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProjectMembershipsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - members: _json, + items: (_) => de_EnvironmentSummaries(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -7377,62 +4401,43 @@ export const de_ListProjectMembershipsCommand = async ( }; /** - * deserializeAws_restJson1ListProjectMembershipsCommandError + * deserializeAws_restJson1ListNotificationsCommand */ -const de_ListProjectMembershipsCommandError = async ( +export const de_ListNotificationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + notifications: (_) => de_NotificationsList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListProjectsCommand + * deserializeAws_restJson1ListProjectMembershipsCommand */ -export const de_ListProjectsCommand = async ( +export const de_ListProjectMembershipsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProjectsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: (_) => de_ProjectSummaries(_, context), + members: _json, nextToken: __expectString, }); Object.assign(contents, doc); @@ -7440,41 +4445,25 @@ export const de_ListProjectsCommand = async ( }; /** - * deserializeAws_restJson1ListProjectsCommandError + * deserializeAws_restJson1ListProjectsCommand */ -const de_ListProjectsCommandError = async ( +export const de_ListProjectsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: (_) => de_ProjectSummaries(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -7485,7 +4474,7 @@ export const de_ListSubscriptionGrantsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSubscriptionGrantsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7499,47 +4488,6 @@ export const de_ListSubscriptionGrantsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSubscriptionGrantsCommandError - */ -const de_ListSubscriptionGrantsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSubscriptionRequestsCommand */ @@ -7548,7 +4496,7 @@ export const de_ListSubscriptionRequestsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSubscriptionRequestsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7562,47 +4510,6 @@ export const de_ListSubscriptionRequestsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSubscriptionRequestsCommandError - */ -const de_ListSubscriptionRequestsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSubscriptionsCommand */ @@ -7611,7 +4518,7 @@ export const de_ListSubscriptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSubscriptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7625,47 +4532,6 @@ export const de_ListSubscriptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSubscriptionsCommandError - */ -const de_ListSubscriptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSubscriptionTargetsCommand */ @@ -7674,7 +4540,7 @@ export const de_ListSubscriptionTargetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSubscriptionTargetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7683,50 +4549,9 @@ export const de_ListSubscriptionTargetsCommand = async ( const doc = take(data, { items: (_) => de_SubscriptionTargets(_, context), nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSubscriptionTargetsCommandError - */ -const de_ListSubscriptionTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + Object.assign(contents, doc); + return contents; }; /** @@ -7737,7 +4562,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7750,47 +4575,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutEnvironmentBlueprintConfigurationCommand */ @@ -7799,7 +4583,7 @@ export const de_PutEnvironmentBlueprintConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutEnvironmentBlueprintConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7819,50 +4603,6 @@ export const de_PutEnvironmentBlueprintConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutEnvironmentBlueprintConfigurationCommandError - */ -const de_PutEnvironmentBlueprintConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RejectPredictionsCommand */ @@ -7871,7 +4611,7 @@ export const de_RejectPredictionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RejectPredictionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7886,47 +4626,6 @@ export const de_RejectPredictionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RejectPredictionsCommandError - */ -const de_RejectPredictionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RejectSubscriptionRequestCommand */ @@ -7935,7 +4634,7 @@ export const de_RejectSubscriptionRequestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RejectSubscriptionRequestCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7959,50 +4658,6 @@ export const de_RejectSubscriptionRequestCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RejectSubscriptionRequestCommandError - */ -const de_RejectSubscriptionRequestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RevokeSubscriptionCommand */ @@ -8011,7 +4666,7 @@ export const de_RevokeSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RevokeSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8034,169 +4689,49 @@ export const de_RevokeSubscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RevokeSubscriptionCommandError - */ -const de_RevokeSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchCommand */ -export const de_SearchCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - items: (_) => de_SearchInventoryResultItems(_, context), - nextToken: __expectString, - totalMatchCount: __expectInt32, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SearchCommandError - */ -const de_SearchCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchGroupProfilesCommand - */ -export const de_SearchGroupProfilesCommand = async ( +export const de_SearchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchGroupProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: _json, + items: (_) => de_SearchInventoryResultItems(_, context), nextToken: __expectString, + totalMatchCount: __expectInt32, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SearchGroupProfilesCommandError + * deserializeAws_restJson1SearchGroupProfilesCommand */ -const de_SearchGroupProfilesCommandError = async ( +export const de_SearchGroupProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -8207,7 +4742,7 @@ export const de_SearchListingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchListingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8222,44 +4757,6 @@ export const de_SearchListingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchListingsCommandError - */ -const de_SearchListingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchTypesCommand */ @@ -8268,7 +4765,7 @@ export const de_SearchTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8283,44 +4780,6 @@ export const de_SearchTypesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchTypesCommandError - */ -const de_SearchTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchUserProfilesCommand */ @@ -8329,7 +4788,7 @@ export const de_SearchUserProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchUserProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8343,47 +4802,6 @@ export const de_SearchUserProfilesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchUserProfilesCommandError - */ -const de_SearchUserProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartDataSourceRunCommand */ @@ -8392,7 +4810,7 @@ export const de_StartDataSourceRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartDataSourceRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8418,119 +4836,14 @@ export const de_StartDataSourceRunCommand = async ( }; /** - * deserializeAws_restJson1StartDataSourceRunCommandError - */ -const de_StartDataSourceRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UntagResourceCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8540,41 +4853,20 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -8585,7 +4877,7 @@ export const de_UpdateDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8617,53 +4909,6 @@ export const de_UpdateDataSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDataSourceCommandError - */ -const de_UpdateDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDomainCommand */ @@ -8672,7 +4917,7 @@ export const de_UpdateDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8690,53 +4935,6 @@ export const de_UpdateDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDomainCommandError - */ -const de_UpdateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEnvironmentCommand */ @@ -8745,7 +4943,7 @@ export const de_UpdateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8778,50 +4976,6 @@ export const de_UpdateEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEnvironmentCommandError - */ -const de_UpdateEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEnvironmentProfileCommand */ @@ -8830,7 +4984,7 @@ export const de_UpdateEnvironmentProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEnvironmentProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8854,53 +5008,6 @@ export const de_UpdateEnvironmentProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEnvironmentProfileCommandError - */ -const de_UpdateEnvironmentProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateGlossaryCommand */ @@ -8909,7 +5016,7 @@ export const de_UpdateGlossaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGlossaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8924,51 +5031,7 @@ export const de_UpdateGlossaryCommand = async ( status: __expectString, }); Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateGlossaryCommandError - */ -const de_UpdateGlossaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return contents; }; /** @@ -8979,7 +5042,7 @@ export const de_UpdateGlossaryTermCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGlossaryTermCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8999,50 +5062,6 @@ export const de_UpdateGlossaryTermCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateGlossaryTermCommandError - */ -const de_UpdateGlossaryTermCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateGroupProfileCommand */ @@ -9051,7 +5070,7 @@ export const de_UpdateGroupProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGroupProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9067,47 +5086,6 @@ export const de_UpdateGroupProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateGroupProfileCommandError - */ -const de_UpdateGroupProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateProjectCommand */ @@ -9116,7 +5094,7 @@ export const de_UpdateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9138,53 +5116,6 @@ export const de_UpdateProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateProjectCommandError - */ -const de_UpdateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.datazone#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSubscriptionGrantStatusCommand */ @@ -9193,7 +5124,7 @@ export const de_UpdateSubscriptionGrantStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSubscriptionGrantStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9216,50 +5147,6 @@ export const de_UpdateSubscriptionGrantStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSubscriptionGrantStatusCommandError - */ -const de_UpdateSubscriptionGrantStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSubscriptionRequestCommand */ @@ -9268,7 +5155,7 @@ export const de_UpdateSubscriptionRequestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSubscriptionRequestCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9292,50 +5179,6 @@ export const de_UpdateSubscriptionRequestCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSubscriptionRequestCommandError - */ -const de_UpdateSubscriptionRequestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSubscriptionTargetCommand */ @@ -9344,7 +5187,7 @@ export const de_UpdateSubscriptionTargetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSubscriptionTargetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9371,50 +5214,6 @@ export const de_UpdateSubscriptionTargetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSubscriptionTargetCommandError - */ -const de_UpdateSubscriptionTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.datazone#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.datazone#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.datazone#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.datazone#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.datazone#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.datazone#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.datazone#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateUserProfileCommand */ @@ -9423,7 +5222,7 @@ export const de_UpdateUserProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9441,12 +5240,9 @@ export const de_UpdateUserProfileCommand = async ( }; /** - * deserializeAws_restJson1UpdateUserProfileCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -9456,6 +5252,9 @@ const de_UpdateUserProfileCommandError = async ( case "AccessDeniedException": case "com.amazonaws.datazone#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.datazone#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.datazone#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); @@ -9471,13 +5270,16 @@ const de_UpdateUserProfileCommandError = async ( case "ValidationException": case "com.amazonaws.datazone#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.datazone#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-dax/src/protocols/Aws_json1_1.ts b/clients/client-dax/src/protocols/Aws_json1_1.ts index b3a658ef0513..cf082e511d67 100644 --- a/clients/client-dax/src/protocols/Aws_json1_1.ts +++ b/clients/client-dax/src/protocols/Aws_json1_1.ts @@ -411,7 +411,7 @@ export const de_CreateClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -423,74 +423,6 @@ export const de_CreateClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateClusterCommandError - */ -const de_CreateClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterAlreadyExistsFault": - case "com.amazonaws.dax#ClusterAlreadyExistsFault": - throw await de_ClusterAlreadyExistsFaultRes(parsedOutput, context); - case "ClusterQuotaForCustomerExceededFault": - case "com.amazonaws.dax#ClusterQuotaForCustomerExceededFault": - throw await de_ClusterQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "InsufficientClusterCapacityFault": - case "com.amazonaws.dax#InsufficientClusterCapacityFault": - throw await de_InsufficientClusterCapacityFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.dax#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterGroupStateFault": - case "com.amazonaws.dax#InvalidParameterGroupStateFault": - throw await de_InvalidParameterGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.dax#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "NodeQuotaForClusterExceededFault": - case "com.amazonaws.dax#NodeQuotaForClusterExceededFault": - throw await de_NodeQuotaForClusterExceededFaultRes(parsedOutput, context); - case "NodeQuotaForCustomerExceededFault": - case "com.amazonaws.dax#NodeQuotaForCustomerExceededFault": - throw await de_NodeQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "ParameterGroupNotFoundFault": - case "com.amazonaws.dax#ParameterGroupNotFoundFault": - throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.dax#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "SubnetGroupNotFoundFault": - case "com.amazonaws.dax#SubnetGroupNotFoundFault": - throw await de_SubnetGroupNotFoundFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.dax#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateParameterGroupCommand */ @@ -499,7 +431,7 @@ export const de_CreateParameterGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -511,47 +443,6 @@ export const de_CreateParameterGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateParameterGroupCommandError - */ -const de_CreateParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterGroupStateFault": - case "com.amazonaws.dax#InvalidParameterGroupStateFault": - throw await de_InvalidParameterGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ParameterGroupAlreadyExistsFault": - case "com.amazonaws.dax#ParameterGroupAlreadyExistsFault": - throw await de_ParameterGroupAlreadyExistsFaultRes(parsedOutput, context); - case "ParameterGroupQuotaExceededFault": - case "com.amazonaws.dax#ParameterGroupQuotaExceededFault": - throw await de_ParameterGroupQuotaExceededFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateSubnetGroupCommand */ @@ -560,7 +451,7 @@ export const de_CreateSubnetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -572,44 +463,6 @@ export const de_CreateSubnetGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateSubnetGroupCommandError - */ -const de_CreateSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidSubnet": - case "com.amazonaws.dax#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "SubnetGroupAlreadyExistsFault": - case "com.amazonaws.dax#SubnetGroupAlreadyExistsFault": - throw await de_SubnetGroupAlreadyExistsFaultRes(parsedOutput, context); - case "SubnetGroupQuotaExceededFault": - case "com.amazonaws.dax#SubnetGroupQuotaExceededFault": - throw await de_SubnetGroupQuotaExceededFaultRes(parsedOutput, context); - case "SubnetQuotaExceededFault": - case "com.amazonaws.dax#SubnetQuotaExceededFault": - throw await de_SubnetQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DecreaseReplicationFactorCommand */ @@ -618,7 +471,7 @@ export const de_DecreaseReplicationFactorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DecreaseReplicationFactorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -630,47 +483,6 @@ export const de_DecreaseReplicationFactorCommand = async ( return response; }; -/** - * deserializeAws_json1_1DecreaseReplicationFactorCommandError - */ -const de_DecreaseReplicationFactorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFoundFault": - case "com.amazonaws.dax#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.dax#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NodeNotFoundFault": - case "com.amazonaws.dax#NodeNotFoundFault": - throw await de_NodeNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteClusterCommand */ @@ -679,7 +491,7 @@ export const de_DeleteClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -691,44 +503,6 @@ export const de_DeleteClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteClusterCommandError - */ -const de_DeleteClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFoundFault": - case "com.amazonaws.dax#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.dax#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteParameterGroupCommand */ @@ -737,7 +511,7 @@ export const de_DeleteParameterGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -749,44 +523,6 @@ export const de_DeleteParameterGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteParameterGroupCommandError - */ -const de_DeleteParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterGroupStateFault": - case "com.amazonaws.dax#InvalidParameterGroupStateFault": - throw await de_InvalidParameterGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ParameterGroupNotFoundFault": - case "com.amazonaws.dax#ParameterGroupNotFoundFault": - throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteSubnetGroupCommand */ @@ -795,7 +531,7 @@ export const de_DeleteSubnetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -808,46 +544,14 @@ export const de_DeleteSubnetGroupCommand = async ( }; /** - * deserializeAws_json1_1DeleteSubnetGroupCommandError + * deserializeAws_json1_1DescribeClustersCommand */ -const de_DeleteSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "SubnetGroupInUseFault": - case "com.amazonaws.dax#SubnetGroupInUseFault": - throw await de_SubnetGroupInUseFaultRes(parsedOutput, context); - case "SubnetGroupNotFoundFault": - case "com.amazonaws.dax#SubnetGroupNotFoundFault": - throw await de_SubnetGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeClustersCommand - */ -export const de_DescribeClustersCommand = async ( +export const de_DescribeClustersCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeClustersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -859,41 +563,6 @@ export const de_DescribeClustersCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeClustersCommandError - */ -const de_DescribeClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFoundFault": - case "com.amazonaws.dax#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeDefaultParametersCommand */ @@ -902,7 +571,7 @@ export const de_DescribeDefaultParametersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDefaultParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -914,38 +583,6 @@ export const de_DescribeDefaultParametersCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDefaultParametersCommandError - */ -const de_DescribeDefaultParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEventsCommand */ @@ -954,7 +591,7 @@ export const de_DescribeEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -966,38 +603,6 @@ export const de_DescribeEventsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEventsCommandError - */ -const de_DescribeEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeParameterGroupsCommand */ @@ -1006,7 +611,7 @@ export const de_DescribeParameterGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeParameterGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1018,41 +623,6 @@ export const de_DescribeParameterGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeParameterGroupsCommandError - */ -const de_DescribeParameterGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ParameterGroupNotFoundFault": - case "com.amazonaws.dax#ParameterGroupNotFoundFault": - throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeParametersCommand */ @@ -1061,7 +631,7 @@ export const de_DescribeParametersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1073,41 +643,6 @@ export const de_DescribeParametersCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeParametersCommandError - */ -const de_DescribeParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ParameterGroupNotFoundFault": - case "com.amazonaws.dax#ParameterGroupNotFoundFault": - throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeSubnetGroupsCommand */ @@ -1116,7 +651,7 @@ export const de_DescribeSubnetGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSubnetGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1128,35 +663,6 @@ export const de_DescribeSubnetGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeSubnetGroupsCommandError - */ -const de_DescribeSubnetGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "SubnetGroupNotFoundFault": - case "com.amazonaws.dax#SubnetGroupNotFoundFault": - throw await de_SubnetGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1IncreaseReplicationFactorCommand */ @@ -1165,7 +671,7 @@ export const de_IncreaseReplicationFactorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_IncreaseReplicationFactorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1177,56 +683,6 @@ export const de_IncreaseReplicationFactorCommand = async ( return response; }; -/** - * deserializeAws_json1_1IncreaseReplicationFactorCommandError - */ -const de_IncreaseReplicationFactorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFoundFault": - case "com.amazonaws.dax#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InsufficientClusterCapacityFault": - case "com.amazonaws.dax#InsufficientClusterCapacityFault": - throw await de_InsufficientClusterCapacityFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.dax#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.dax#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "NodeQuotaForClusterExceededFault": - case "com.amazonaws.dax#NodeQuotaForClusterExceededFault": - throw await de_NodeQuotaForClusterExceededFaultRes(parsedOutput, context); - case "NodeQuotaForCustomerExceededFault": - case "com.amazonaws.dax#NodeQuotaForCustomerExceededFault": - throw await de_NodeQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsCommand */ @@ -1235,134 +691,32 @@ export const de_ListTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); const response: ListTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsCommandError - */ -const de_ListTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFoundFault": - case "com.amazonaws.dax#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidARNFault": - case "com.amazonaws.dax#InvalidARNFault": - throw await de_InvalidARNFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.dax#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RebootNodeCommand - */ -export const de_RebootNodeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RebootNodeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RebootNodeResponse(data, context); - const response: RebootNodeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RebootNodeCommandError - */ -const de_RebootNodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFoundFault": - case "com.amazonaws.dax#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.dax#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NodeNotFoundFault": - case "com.amazonaws.dax#NodeNotFoundFault": - throw await de_NodeNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1RebootNodeCommand */ -export const de_TagResourceCommand = async ( +export const de_RebootNodeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: TagResourceCommandOutput = { + contents = de_RebootNodeResponse(data, context); + const response: RebootNodeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1370,47 +724,23 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFoundFault": - case "com.amazonaws.dax#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidARNFault": - case "com.amazonaws.dax#InvalidARNFault": - throw await de_InvalidARNFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.dax#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.dax#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1421,7 +751,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1433,50 +763,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFoundFault": - case "com.amazonaws.dax#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidARNFault": - case "com.amazonaws.dax#InvalidARNFault": - throw await de_InvalidARNFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.dax#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "TagNotFoundFault": - case "com.amazonaws.dax#TagNotFoundFault": - throw await de_TagNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateClusterCommand */ @@ -1485,7 +771,7 @@ export const de_UpdateClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1497,50 +783,6 @@ export const de_UpdateClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateClusterCommandError - */ -const de_UpdateClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFoundFault": - case "com.amazonaws.dax#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.dax#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterGroupStateFault": - case "com.amazonaws.dax#InvalidParameterGroupStateFault": - throw await de_InvalidParameterGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ParameterGroupNotFoundFault": - case "com.amazonaws.dax#ParameterGroupNotFoundFault": - throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateParameterGroupCommand */ @@ -1549,7 +791,7 @@ export const de_UpdateParameterGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1561,44 +803,6 @@ export const de_UpdateParameterGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateParameterGroupCommandError - */ -const de_UpdateParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.dax#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterGroupStateFault": - case "com.amazonaws.dax#InvalidParameterGroupStateFault": - throw await de_InvalidParameterGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.dax#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ParameterGroupNotFoundFault": - case "com.amazonaws.dax#ParameterGroupNotFoundFault": - throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSubnetGroupCommand */ @@ -1607,7 +811,7 @@ export const de_UpdateSubnetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1620,40 +824,103 @@ export const de_UpdateSubnetGroupCommand = async ( }; /** - * deserializeAws_json1_1UpdateSubnetGroupCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "InvalidSubnet": - case "com.amazonaws.dax#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); + case "ClusterAlreadyExistsFault": + case "com.amazonaws.dax#ClusterAlreadyExistsFault": + throw await de_ClusterAlreadyExistsFaultRes(parsedOutput, context); + case "ClusterQuotaForCustomerExceededFault": + case "com.amazonaws.dax#ClusterQuotaForCustomerExceededFault": + throw await de_ClusterQuotaForCustomerExceededFaultRes(parsedOutput, context); + case "InsufficientClusterCapacityFault": + case "com.amazonaws.dax#InsufficientClusterCapacityFault": + throw await de_InsufficientClusterCapacityFaultRes(parsedOutput, context); + case "InvalidClusterStateFault": + case "com.amazonaws.dax#InvalidClusterStateFault": + throw await de_InvalidClusterStateFaultRes(parsedOutput, context); + case "InvalidParameterCombinationException": + case "com.amazonaws.dax#InvalidParameterCombinationException": + throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); + case "InvalidParameterGroupStateFault": + case "com.amazonaws.dax#InvalidParameterGroupStateFault": + throw await de_InvalidParameterGroupStateFaultRes(parsedOutput, context); + case "InvalidParameterValueException": + case "com.amazonaws.dax#InvalidParameterValueException": + throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); + case "InvalidVPCNetworkStateFault": + case "com.amazonaws.dax#InvalidVPCNetworkStateFault": + throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); + case "NodeQuotaForClusterExceededFault": + case "com.amazonaws.dax#NodeQuotaForClusterExceededFault": + throw await de_NodeQuotaForClusterExceededFaultRes(parsedOutput, context); + case "NodeQuotaForCustomerExceededFault": + case "com.amazonaws.dax#NodeQuotaForCustomerExceededFault": + throw await de_NodeQuotaForCustomerExceededFaultRes(parsedOutput, context); + case "ParameterGroupNotFoundFault": + case "com.amazonaws.dax#ParameterGroupNotFoundFault": + throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); case "ServiceLinkedRoleNotFoundFault": case "com.amazonaws.dax#ServiceLinkedRoleNotFoundFault": throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.dax#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "SubnetGroupNotFoundFault": case "com.amazonaws.dax#SubnetGroupNotFoundFault": throw await de_SubnetGroupNotFoundFaultRes(parsedOutput, context); - case "SubnetInUse": - case "com.amazonaws.dax#SubnetInUse": - throw await de_SubnetInUseRes(parsedOutput, context); + case "TagQuotaPerResourceExceeded": + case "com.amazonaws.dax#TagQuotaPerResourceExceeded": + throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); + case "ParameterGroupAlreadyExistsFault": + case "com.amazonaws.dax#ParameterGroupAlreadyExistsFault": + throw await de_ParameterGroupAlreadyExistsFaultRes(parsedOutput, context); + case "ParameterGroupQuotaExceededFault": + case "com.amazonaws.dax#ParameterGroupQuotaExceededFault": + throw await de_ParameterGroupQuotaExceededFaultRes(parsedOutput, context); + case "InvalidSubnet": + case "com.amazonaws.dax#InvalidSubnet": + throw await de_InvalidSubnetRes(parsedOutput, context); + case "SubnetGroupAlreadyExistsFault": + case "com.amazonaws.dax#SubnetGroupAlreadyExistsFault": + throw await de_SubnetGroupAlreadyExistsFaultRes(parsedOutput, context); + case "SubnetGroupQuotaExceededFault": + case "com.amazonaws.dax#SubnetGroupQuotaExceededFault": + throw await de_SubnetGroupQuotaExceededFaultRes(parsedOutput, context); case "SubnetQuotaExceededFault": case "com.amazonaws.dax#SubnetQuotaExceededFault": throw await de_SubnetQuotaExceededFaultRes(parsedOutput, context); + case "ClusterNotFoundFault": + case "com.amazonaws.dax#ClusterNotFoundFault": + throw await de_ClusterNotFoundFaultRes(parsedOutput, context); + case "NodeNotFoundFault": + case "com.amazonaws.dax#NodeNotFoundFault": + throw await de_NodeNotFoundFaultRes(parsedOutput, context); + case "SubnetGroupInUseFault": + case "com.amazonaws.dax#SubnetGroupInUseFault": + throw await de_SubnetGroupInUseFaultRes(parsedOutput, context); + case "InvalidARNFault": + case "com.amazonaws.dax#InvalidARNFault": + throw await de_InvalidARNFaultRes(parsedOutput, context); + case "TagNotFoundFault": + case "com.amazonaws.dax#TagNotFoundFault": + throw await de_TagNotFoundFaultRes(parsedOutput, context); + case "SubnetInUse": + case "com.amazonaws.dax#SubnetInUse": + throw await de_SubnetInUseRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-detective/src/protocols/Aws_restJson1.ts b/clients/client-detective/src/protocols/Aws_restJson1.ts index a57c03378ea3..96415979094a 100644 --- a/clients/client-detective/src/protocols/Aws_restJson1.ts +++ b/clients/client-detective/src/protocols/Aws_restJson1.ts @@ -785,7 +785,7 @@ export const de_AcceptInvitationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptInvitationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -794,44 +794,6 @@ export const de_AcceptInvitationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptInvitationCommandError - */ -const de_AcceptInvitationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.detective#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetGraphMemberDatasourcesCommand */ @@ -840,7 +802,7 @@ export const de_BatchGetGraphMemberDatasourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetGraphMemberDatasourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -854,41 +816,6 @@ export const de_BatchGetGraphMemberDatasourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetGraphMemberDatasourcesCommandError - */ -const de_BatchGetGraphMemberDatasourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetMembershipDatasourcesCommand */ @@ -897,7 +824,7 @@ export const de_BatchGetMembershipDatasourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetMembershipDatasourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -911,41 +838,6 @@ export const de_BatchGetMembershipDatasourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetMembershipDatasourcesCommandError - */ -const de_BatchGetMembershipDatasourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateGraphCommand */ @@ -954,7 +846,7 @@ export const de_CreateGraphCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateGraphCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -967,41 +859,6 @@ export const de_CreateGraphCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGraphCommandError - */ -const de_CreateGraphCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.detective#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.detective#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMembersCommand */ @@ -1010,7 +867,7 @@ export const de_CreateMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1024,44 +881,6 @@ export const de_CreateMembersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMembersCommandError - */ -const de_CreateMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.detective#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteGraphCommand */ @@ -1070,7 +889,7 @@ export const de_DeleteGraphCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGraphCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1079,41 +898,6 @@ export const de_DeleteGraphCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteGraphCommandError - */ -const de_DeleteGraphCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteMembersCommand */ @@ -1122,7 +906,7 @@ export const de_DeleteMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1136,44 +920,6 @@ export const de_DeleteMembersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteMembersCommandError - */ -const de_DeleteMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.detective#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeOrganizationConfigurationCommand */ @@ -1182,7 +928,7 @@ export const de_DescribeOrganizationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeOrganizationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1196,49 +942,14 @@ export const de_DescribeOrganizationConfigurationCommand = async ( }; /** - * deserializeAws_restJson1DescribeOrganizationConfigurationCommandError + * deserializeAws_restJson1DisableOrganizationAdminAccountCommand */ -const de_DescribeOrganizationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.detective#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisableOrganizationAdminAccountCommand - */ -export const de_DisableOrganizationAdminAccountCommand = async ( +export const de_DisableOrganizationAdminAccountCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableOrganizationAdminAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1247,41 +958,6 @@ export const de_DisableOrganizationAdminAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisableOrganizationAdminAccountCommandError - */ -const de_DisableOrganizationAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.detective#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateMembershipCommand */ @@ -1290,7 +966,7 @@ export const de_DisassociateMembershipCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateMembershipCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1299,44 +975,6 @@ export const de_DisassociateMembershipCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateMembershipCommandError - */ -const de_DisassociateMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.detective#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1EnableOrganizationAdminAccountCommand */ @@ -1345,7 +983,7 @@ export const de_EnableOrganizationAdminAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableOrganizationAdminAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1354,41 +992,6 @@ export const de_EnableOrganizationAdminAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1EnableOrganizationAdminAccountCommandError - */ -const de_EnableOrganizationAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.detective#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetInvestigationCommand */ @@ -1397,7 +1000,7 @@ export const de_GetInvestigationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInvestigationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1419,44 +1022,6 @@ export const de_GetInvestigationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetInvestigationCommandError - */ -const de_GetInvestigationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.detective#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMembersCommand */ @@ -1465,7 +1030,7 @@ export const de_GetMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1479,41 +1044,6 @@ export const de_GetMembersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMembersCommandError - */ -const de_GetMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDatasourcePackagesCommand */ @@ -1522,7 +1052,7 @@ export const de_ListDatasourcePackagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDatasourcePackagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1536,41 +1066,6 @@ export const de_ListDatasourcePackagesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDatasourcePackagesCommandError - */ -const de_ListDatasourcePackagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListGraphsCommand */ @@ -1579,7 +1074,7 @@ export const de_ListGraphsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGraphsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1593,38 +1088,6 @@ export const de_ListGraphsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListGraphsCommandError - */ -const de_ListGraphsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIndicatorsCommand */ @@ -1633,7 +1096,7 @@ export const de_ListIndicatorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIndicatorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1650,52 +1113,14 @@ export const de_ListIndicatorsCommand = async ( }; /** - * deserializeAws_restJson1ListIndicatorsCommandError + * deserializeAws_restJson1ListInvestigationsCommand */ -const de_ListIndicatorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.detective#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListInvestigationsCommand - */ -export const de_ListInvestigationsCommand = async ( +export const de_ListInvestigationsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInvestigationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1709,44 +1134,6 @@ export const de_ListInvestigationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListInvestigationsCommandError - */ -const de_ListInvestigationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.detective#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListInvitationsCommand */ @@ -1755,7 +1142,7 @@ export const de_ListInvitationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInvitationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1769,38 +1156,6 @@ export const de_ListInvitationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListInvitationsCommandError - */ -const de_ListInvitationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListMembersCommand */ @@ -1809,7 +1164,7 @@ export const de_ListMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1823,41 +1178,6 @@ export const de_ListMembersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListMembersCommandError - */ -const de_ListMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListOrganizationAdminAccountsCommand */ @@ -1866,7 +1186,7 @@ export const de_ListOrganizationAdminAccountsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOrganizationAdminAccountsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1880,41 +1200,6 @@ export const de_ListOrganizationAdminAccountsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListOrganizationAdminAccountsCommandError - */ -const de_ListOrganizationAdminAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.detective#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1923,7 +1208,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1936,41 +1221,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RejectInvitationCommand */ @@ -1979,7 +1229,7 @@ export const de_RejectInvitationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RejectInvitationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1988,44 +1238,6 @@ export const de_RejectInvitationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RejectInvitationCommandError - */ -const de_RejectInvitationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.detective#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartInvestigationCommand */ @@ -2034,7 +1246,7 @@ export const de_StartInvestigationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartInvestigationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2047,44 +1259,6 @@ export const de_StartInvestigationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartInvestigationCommandError - */ -const de_StartInvestigationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.detective#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartMonitoringMemberCommand */ @@ -2093,7 +1267,7 @@ export const de_StartMonitoringMemberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartMonitoringMemberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2102,47 +1276,6 @@ export const de_StartMonitoringMemberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartMonitoringMemberCommandError - */ -const de_StartMonitoringMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.detective#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.detective#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2151,7 +1284,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2160,41 +1293,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2203,7 +1301,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2212,41 +1310,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDatasourcePackagesCommand */ @@ -2255,7 +1318,7 @@ export const de_UpdateDatasourcePackagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDatasourcePackagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2264,44 +1327,6 @@ export const de_UpdateDatasourcePackagesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDatasourcePackagesCommandError - */ -const de_UpdateDatasourcePackagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.detective#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateInvestigationStateCommand */ @@ -2310,7 +1335,7 @@ export const de_UpdateInvestigationStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateInvestigationStateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2319,44 +1344,6 @@ export const de_UpdateInvestigationStateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateInvestigationStateCommandError - */ -const de_UpdateInvestigationStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.detective#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.detective#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.detective#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.detective#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.detective#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateOrganizationConfigurationCommand */ @@ -2365,7 +1352,7 @@ export const de_UpdateOrganizationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateOrganizationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2375,12 +1362,9 @@ export const de_UpdateOrganizationConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateOrganizationConfigurationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateOrganizationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2390,22 +1374,31 @@ const de_UpdateOrganizationConfigurationCommandError = async ( case "AccessDeniedException": case "com.amazonaws.detective#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.detective#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.detective#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.detective#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.detective#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.detective#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.detective#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.detective#TooManyRequestsException": + throw await de_TooManyRequestsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-device-farm/src/protocols/Aws_json1_1.ts b/clients/client-device-farm/src/protocols/Aws_json1_1.ts index c07b916ddaa1..4c1d2de2a933 100644 --- a/clients/client-device-farm/src/protocols/Aws_json1_1.ts +++ b/clients/client-device-farm/src/protocols/Aws_json1_1.ts @@ -1371,7 +1371,7 @@ export const de_CreateDevicePoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDevicePoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1383,41 +1383,6 @@ export const de_CreateDevicePoolCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDevicePoolCommandError - */ -const de_CreateDevicePoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateInstanceProfileCommand */ @@ -1426,7 +1391,7 @@ export const de_CreateInstanceProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateInstanceProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1438,41 +1403,6 @@ export const de_CreateInstanceProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateInstanceProfileCommandError - */ -const de_CreateInstanceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateNetworkProfileCommand */ @@ -1481,7 +1411,7 @@ export const de_CreateNetworkProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateNetworkProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1493,41 +1423,6 @@ export const de_CreateNetworkProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateNetworkProfileCommandError - */ -const de_CreateNetworkProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateProjectCommand */ @@ -1536,7 +1431,7 @@ export const de_CreateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1548,44 +1443,6 @@ export const de_CreateProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateProjectCommandError - */ -const de_CreateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - case "TagOperationException": - case "com.amazonaws.devicefarm#TagOperationException": - throw await de_TagOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateRemoteAccessSessionCommand */ @@ -1594,7 +1451,7 @@ export const de_CreateRemoteAccessSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRemoteAccessSessionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1606,41 +1463,6 @@ export const de_CreateRemoteAccessSessionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateRemoteAccessSessionCommandError - */ -const de_CreateRemoteAccessSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTestGridProjectCommand */ @@ -1649,7 +1471,7 @@ export const de_CreateTestGridProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTestGridProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1661,38 +1483,6 @@ export const de_CreateTestGridProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateTestGridProjectCommandError - */ -const de_CreateTestGridProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.devicefarm#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTestGridUrlCommand */ @@ -1701,7 +1491,7 @@ export const de_CreateTestGridUrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTestGridUrlCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1713,38 +1503,6 @@ export const de_CreateTestGridUrlCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateTestGridUrlCommandError - */ -const de_CreateTestGridUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.devicefarm#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateUploadCommand */ @@ -1753,7 +1511,7 @@ export const de_CreateUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateUploadCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1765,41 +1523,6 @@ export const de_CreateUploadCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateUploadCommandError - */ -const de_CreateUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateVPCEConfigurationCommand */ @@ -1808,7 +1531,7 @@ export const de_CreateVPCEConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVPCEConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1821,46 +1544,14 @@ export const de_CreateVPCEConfigurationCommand = async ( }; /** - * deserializeAws_json1_1CreateVPCEConfigurationCommandError + * deserializeAws_json1_1DeleteDevicePoolCommand */ -const de_CreateVPCEConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDevicePoolCommand - */ -export const de_DeleteDevicePoolCommand = async ( +export const de_DeleteDevicePoolCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDevicePoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1872,41 +1563,6 @@ export const de_DeleteDevicePoolCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteDevicePoolCommandError - */ -const de_DeleteDevicePoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteInstanceProfileCommand */ @@ -1915,7 +1571,7 @@ export const de_DeleteInstanceProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteInstanceProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1927,41 +1583,6 @@ export const de_DeleteInstanceProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteInstanceProfileCommandError - */ -const de_DeleteInstanceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteNetworkProfileCommand */ @@ -1970,7 +1591,7 @@ export const de_DeleteNetworkProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNetworkProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1982,41 +1603,6 @@ export const de_DeleteNetworkProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteNetworkProfileCommandError - */ -const de_DeleteNetworkProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteProjectCommand */ @@ -2025,7 +1611,7 @@ export const de_DeleteProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2037,41 +1623,6 @@ export const de_DeleteProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteProjectCommandError - */ -const de_DeleteProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteRemoteAccessSessionCommand */ @@ -2080,7 +1631,7 @@ export const de_DeleteRemoteAccessSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRemoteAccessSessionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2092,41 +1643,6 @@ export const de_DeleteRemoteAccessSessionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteRemoteAccessSessionCommandError - */ -const de_DeleteRemoteAccessSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteRunCommand */ @@ -2135,7 +1651,7 @@ export const de_DeleteRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2147,41 +1663,6 @@ export const de_DeleteRunCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteRunCommandError - */ -const de_DeleteRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteTestGridProjectCommand */ @@ -2190,7 +1671,7 @@ export const de_DeleteTestGridProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTestGridProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2202,41 +1683,6 @@ export const de_DeleteTestGridProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteTestGridProjectCommandError - */ -const de_DeleteTestGridProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "CannotDeleteException": - case "com.amazonaws.devicefarm#CannotDeleteException": - throw await de_CannotDeleteExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.devicefarm#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteUploadCommand */ @@ -2245,7 +1691,7 @@ export const de_DeleteUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteUploadCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2258,49 +1704,14 @@ export const de_DeleteUploadCommand = async ( }; /** - * deserializeAws_json1_1DeleteUploadCommandError + * deserializeAws_json1_1DeleteVPCEConfigurationCommand */ -const de_DeleteUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteVPCEConfigurationCommand - */ -export const de_DeleteVPCEConfigurationCommand = async ( +export const de_DeleteVPCEConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVPCEConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2312,41 +1723,6 @@ export const de_DeleteVPCEConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteVPCEConfigurationCommandError - */ -const de_DeleteVPCEConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.devicefarm#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAccountSettingsCommand */ @@ -2355,7 +1731,7 @@ export const de_GetAccountSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAccountSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2367,41 +1743,6 @@ export const de_GetAccountSettingsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAccountSettingsCommandError - */ -const de_GetAccountSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetDeviceCommand */ @@ -2410,7 +1751,7 @@ export const de_GetDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDeviceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2422,41 +1763,6 @@ export const de_GetDeviceCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetDeviceCommandError - */ -const de_GetDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetDeviceInstanceCommand */ @@ -2465,7 +1771,7 @@ export const de_GetDeviceInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDeviceInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2477,41 +1783,6 @@ export const de_GetDeviceInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetDeviceInstanceCommandError - */ -const de_GetDeviceInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetDevicePoolCommand */ @@ -2520,7 +1791,7 @@ export const de_GetDevicePoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDevicePoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2533,54 +1804,39 @@ export const de_GetDevicePoolCommand = async ( }; /** - * deserializeAws_json1_1GetDevicePoolCommandError + * deserializeAws_json1_1GetDevicePoolCompatibilityCommand */ -const de_GetDevicePoolCommandError = async ( +export const de_GetDevicePoolCompatibilityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetDevicePoolCompatibilityResult(data, context); + const response: GetDevicePoolCompatibilityCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetDevicePoolCompatibilityCommand + * deserializeAws_json1_1GetInstanceProfileCommand */ -export const de_GetDevicePoolCompatibilityCommand = async ( +export const de_GetInstanceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetDevicePoolCompatibilityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetDevicePoolCompatibilityResult(data, context); - const response: GetDevicePoolCompatibilityCommandOutput = { + contents = _json(data); + const response: GetInstanceProfileCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2588,54 +1844,39 @@ export const de_GetDevicePoolCompatibilityCommand = async ( }; /** - * deserializeAws_json1_1GetDevicePoolCompatibilityCommandError + * deserializeAws_json1_1GetJobCommand */ -const de_GetDevicePoolCompatibilityCommandError = async ( +export const de_GetJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetJobResult(data, context); + const response: GetJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetInstanceProfileCommand + * deserializeAws_json1_1GetNetworkProfileCommand */ -export const de_GetInstanceProfileCommand = async ( +export const de_GetNetworkProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetInstanceProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetInstanceProfileCommandOutput = { + const response: GetNetworkProfileCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2643,1371 +1884,19 @@ export const de_GetInstanceProfileCommand = async ( }; /** - * deserializeAws_json1_1GetInstanceProfileCommandError + * deserializeAws_json1_1GetOfferingStatusCommand */ -const de_GetInstanceProfileCommandError = async ( +export const de_GetOfferingStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetJobCommand - */ -export const de_GetJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetJobResult(data, context); - const response: GetJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetJobCommandError - */ -const de_GetJobCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetNetworkProfileCommand - */ -export const de_GetNetworkProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetNetworkProfileCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetNetworkProfileCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetNetworkProfileCommandError - */ -const de_GetNetworkProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetOfferingStatusCommand - */ -export const de_GetOfferingStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetOfferingStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetOfferingStatusResult(data, context); - const response: GetOfferingStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetOfferingStatusCommandError - */ -const de_GetOfferingStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotEligibleException": - case "com.amazonaws.devicefarm#NotEligibleException": - throw await de_NotEligibleExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetProjectCommand - */ -export const de_GetProjectCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetProjectCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetProjectResult(data, context); - const response: GetProjectCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetProjectCommandError - */ -const de_GetProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRemoteAccessSessionCommand - */ -export const de_GetRemoteAccessSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRemoteAccessSessionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetRemoteAccessSessionResult(data, context); - const response: GetRemoteAccessSessionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRemoteAccessSessionCommandError - */ -const de_GetRemoteAccessSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRunCommand - */ -export const de_GetRunCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRunCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetRunResult(data, context); - const response: GetRunCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRunCommandError - */ -const de_GetRunCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSuiteCommand - */ -export const de_GetSuiteCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSuiteCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetSuiteResult(data, context); - const response: GetSuiteCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSuiteCommandError - */ -const de_GetSuiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetTestCommand - */ -export const de_GetTestCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetTestCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetTestResult(data, context); - const response: GetTestCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetTestCommandError - */ -const de_GetTestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetTestGridProjectCommand - */ -export const de_GetTestGridProjectCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetTestGridProjectCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetTestGridProjectResult(data, context); - const response: GetTestGridProjectCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetTestGridProjectCommandError - */ -const de_GetTestGridProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.devicefarm#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetTestGridSessionCommand - */ -export const de_GetTestGridSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetTestGridSessionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetTestGridSessionResult(data, context); - const response: GetTestGridSessionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetTestGridSessionCommandError - */ -const de_GetTestGridSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.devicefarm#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetUploadCommand - */ -export const de_GetUploadCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetUploadCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetUploadResult(data, context); - const response: GetUploadCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetUploadCommandError - */ -const de_GetUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetVPCEConfigurationCommand - */ -export const de_GetVPCEConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetVPCEConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetVPCEConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetVPCEConfigurationCommandError - */ -const de_GetVPCEConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1InstallToRemoteAccessSessionCommand - */ -export const de_InstallToRemoteAccessSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_InstallToRemoteAccessSessionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_InstallToRemoteAccessSessionResult(data, context); - const response: InstallToRemoteAccessSessionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1InstallToRemoteAccessSessionCommandError - */ -const de_InstallToRemoteAccessSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListArtifactsCommand - */ -export const de_ListArtifactsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListArtifactsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListArtifactsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListArtifactsCommandError - */ -const de_ListArtifactsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDeviceInstancesCommand - */ -export const de_ListDeviceInstancesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDeviceInstancesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListDeviceInstancesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDeviceInstancesCommandError - */ -const de_ListDeviceInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDevicePoolsCommand - */ -export const de_ListDevicePoolsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDevicePoolsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListDevicePoolsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDevicePoolsCommandError - */ -const de_ListDevicePoolsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDevicesCommand - */ -export const de_ListDevicesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDevicesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDevicesResult(data, context); - const response: ListDevicesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDevicesCommandError - */ -const de_ListDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListInstanceProfilesCommand - */ -export const de_ListInstanceProfilesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListInstanceProfilesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListInstanceProfilesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListInstanceProfilesCommandError - */ -const de_ListInstanceProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListJobsCommand - */ -export const de_ListJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListJobsResult(data, context); - const response: ListJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListJobsCommandError - */ -const de_ListJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListNetworkProfilesCommand - */ -export const de_ListNetworkProfilesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListNetworkProfilesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListNetworkProfilesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListNetworkProfilesCommandError - */ -const de_ListNetworkProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListOfferingPromotionsCommand - */ -export const de_ListOfferingPromotionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListOfferingPromotionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListOfferingPromotionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListOfferingPromotionsCommandError - */ -const de_ListOfferingPromotionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotEligibleException": - case "com.amazonaws.devicefarm#NotEligibleException": - throw await de_NotEligibleExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListOfferingsCommand - */ -export const de_ListOfferingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListOfferingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListOfferingsResult(data, context); - const response: ListOfferingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListOfferingsCommandError - */ -const de_ListOfferingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotEligibleException": - case "com.amazonaws.devicefarm#NotEligibleException": - throw await de_NotEligibleExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListOfferingTransactionsCommand - */ -export const de_ListOfferingTransactionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListOfferingTransactionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListOfferingTransactionsResult(data, context); - const response: ListOfferingTransactionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListOfferingTransactionsCommandError - */ -const de_ListOfferingTransactionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotEligibleException": - case "com.amazonaws.devicefarm#NotEligibleException": - throw await de_NotEligibleExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListProjectsCommand - */ -export const de_ListProjectsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListProjectsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListProjectsResult(data, context); - const response: ListProjectsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListProjectsCommandError - */ -const de_ListProjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRemoteAccessSessionsCommand - */ -export const de_ListRemoteAccessSessionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListRemoteAccessSessionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListRemoteAccessSessionsResult(data, context); - const response: ListRemoteAccessSessionsCommandOutput = { + contents = de_GetOfferingStatusResult(data, context); + const response: GetOfferingStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4015,54 +1904,19 @@ export const de_ListRemoteAccessSessionsCommand = async ( }; /** - * deserializeAws_json1_1ListRemoteAccessSessionsCommandError - */ -const de_ListRemoteAccessSessionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRunsCommand + * deserializeAws_json1_1GetProjectCommand */ -export const de_ListRunsCommand = async ( +export const de_GetProjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListRunsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListRunsResult(data, context); - const response: ListRunsCommandOutput = { + contents = de_GetProjectResult(data, context); + const response: GetProjectCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4070,54 +1924,19 @@ export const de_ListRunsCommand = async ( }; /** - * deserializeAws_json1_1ListRunsCommandError - */ -const de_ListRunsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListSamplesCommand + * deserializeAws_json1_1GetRemoteAccessSessionCommand */ -export const de_ListSamplesCommand = async ( +export const de_GetRemoteAccessSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSamplesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListSamplesCommandOutput = { + contents = de_GetRemoteAccessSessionResult(data, context); + const response: GetRemoteAccessSessionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4125,54 +1944,19 @@ export const de_ListSamplesCommand = async ( }; /** - * deserializeAws_json1_1ListSamplesCommandError - */ -const de_ListSamplesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListSuitesCommand + * deserializeAws_json1_1GetRunCommand */ -export const de_ListSuitesCommand = async ( +export const de_GetRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSuitesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListSuitesResult(data, context); - const response: ListSuitesCommandOutput = { + contents = de_GetRunResult(data, context); + const response: GetRunCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4180,54 +1964,39 @@ export const de_ListSuitesCommand = async ( }; /** - * deserializeAws_json1_1ListSuitesCommandError + * deserializeAws_json1_1GetSuiteCommand */ -const de_ListSuitesCommandError = async ( +export const de_GetSuiteCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetSuiteResult(data, context); + const response: GetSuiteCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1GetTestCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_GetTestCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_GetTestResult(data, context); + const response: GetTestCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4235,51 +2004,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1GetTestGridProjectCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_GetTestGridProjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TagOperationException": - case "com.amazonaws.devicefarm#TagOperationException": - throw await de_TagOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetTestGridProjectResult(data, context); + const response: GetTestGridProjectCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTestGridProjectsCommand + * deserializeAws_json1_1GetTestGridSessionCommand */ -export const de_ListTestGridProjectsCommand = async ( +export const de_GetTestGridSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTestGridProjectsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListTestGridProjectsResult(data, context); - const response: ListTestGridProjectsCommandOutput = { + contents = de_GetTestGridSessionResult(data, context); + const response: GetTestGridSessionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4287,48 +2044,39 @@ export const de_ListTestGridProjectsCommand = async ( }; /** - * deserializeAws_json1_1ListTestGridProjectsCommandError + * deserializeAws_json1_1GetUploadCommand */ -const de_ListTestGridProjectsCommandError = async ( +export const de_GetUploadCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.devicefarm#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetUploadResult(data, context); + const response: GetUploadCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTestGridSessionActionsCommand + * deserializeAws_json1_1GetVPCEConfigurationCommand */ -export const de_ListTestGridSessionActionsCommand = async ( +export const de_GetVPCEConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTestGridSessionActionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListTestGridSessionActionsResult(data, context); - const response: ListTestGridSessionActionsCommandOutput = { + contents = _json(data); + const response: GetVPCEConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4336,51 +2084,39 @@ export const de_ListTestGridSessionActionsCommand = async ( }; /** - * deserializeAws_json1_1ListTestGridSessionActionsCommandError + * deserializeAws_json1_1InstallToRemoteAccessSessionCommand */ -const de_ListTestGridSessionActionsCommandError = async ( +export const de_InstallToRemoteAccessSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.devicefarm#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_InstallToRemoteAccessSessionResult(data, context); + const response: InstallToRemoteAccessSessionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTestGridSessionArtifactsCommand + * deserializeAws_json1_1ListArtifactsCommand */ -export const de_ListTestGridSessionArtifactsCommand = async ( +export const de_ListArtifactsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTestGridSessionArtifactsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTestGridSessionArtifactsCommandOutput = { + const response: ListArtifactsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4388,51 +2124,19 @@ export const de_ListTestGridSessionArtifactsCommand = async ( }; /** - * deserializeAws_json1_1ListTestGridSessionArtifactsCommandError - */ -const de_ListTestGridSessionArtifactsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.devicefarm#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTestGridSessionsCommand + * deserializeAws_json1_1ListDeviceInstancesCommand */ -export const de_ListTestGridSessionsCommand = async ( +export const de_ListDeviceInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTestGridSessionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListTestGridSessionsResult(data, context); - const response: ListTestGridSessionsCommandOutput = { + contents = _json(data); + const response: ListDeviceInstancesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4440,51 +2144,39 @@ export const de_ListTestGridSessionsCommand = async ( }; /** - * deserializeAws_json1_1ListTestGridSessionsCommandError + * deserializeAws_json1_1ListDevicePoolsCommand */ -const de_ListTestGridSessionsCommandError = async ( +export const de_ListDevicePoolsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.devicefarm#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListDevicePoolsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTestsCommand + * deserializeAws_json1_1ListDevicesCommand */ -export const de_ListTestsCommand = async ( +export const de_ListDevicesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTestsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListTestsResult(data, context); - const response: ListTestsCommandOutput = { + contents = de_ListDevicesResult(data, context); + const response: ListDevicesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4492,54 +2184,39 @@ export const de_ListTestsCommand = async ( }; /** - * deserializeAws_json1_1ListTestsCommandError + * deserializeAws_json1_1ListInstanceProfilesCommand */ -const de_ListTestsCommandError = async ( +export const de_ListInstanceProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListInstanceProfilesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListUniqueProblemsCommand + * deserializeAws_json1_1ListJobsCommand */ -export const de_ListUniqueProblemsCommand = async ( +export const de_ListJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListUniqueProblemsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListUniqueProblemsResult(data, context); - const response: ListUniqueProblemsCommandOutput = { + contents = de_ListJobsResult(data, context); + const response: ListJobsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4547,54 +2224,39 @@ export const de_ListUniqueProblemsCommand = async ( }; /** - * deserializeAws_json1_1ListUniqueProblemsCommandError + * deserializeAws_json1_1ListNetworkProfilesCommand */ -const de_ListUniqueProblemsCommandError = async ( +export const de_ListNetworkProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListNetworkProfilesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListUploadsCommand + * deserializeAws_json1_1ListOfferingPromotionsCommand */ -export const de_ListUploadsCommand = async ( +export const de_ListOfferingPromotionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListUploadsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListUploadsResult(data, context); - const response: ListUploadsCommandOutput = { + contents = _json(data); + const response: ListOfferingPromotionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4602,54 +2264,39 @@ export const de_ListUploadsCommand = async ( }; /** - * deserializeAws_json1_1ListUploadsCommandError + * deserializeAws_json1_1ListOfferingsCommand */ -const de_ListUploadsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_ListOfferingsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListOfferingsResult(data, context); + const response: ListOfferingsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListVPCEConfigurationsCommand + * deserializeAws_json1_1ListOfferingTransactionsCommand */ -export const de_ListVPCEConfigurationsCommand = async ( +export const de_ListOfferingTransactionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListVPCEConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListVPCEConfigurationsCommandOutput = { + contents = de_ListOfferingTransactionsResult(data, context); + const response: ListOfferingTransactionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4657,48 +2304,39 @@ export const de_ListVPCEConfigurationsCommand = async ( }; /** - * deserializeAws_json1_1ListVPCEConfigurationsCommandError + * deserializeAws_json1_1ListProjectsCommand */ -const de_ListVPCEConfigurationsCommandError = async ( +export const de_ListProjectsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListProjectsResult(data, context); + const response: ListProjectsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PurchaseOfferingCommand + * deserializeAws_json1_1ListRemoteAccessSessionsCommand */ -export const de_PurchaseOfferingCommand = async ( +export const de_ListRemoteAccessSessionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PurchaseOfferingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_PurchaseOfferingResult(data, context); - const response: PurchaseOfferingCommandOutput = { + contents = de_ListRemoteAccessSessionsResult(data, context); + const response: ListRemoteAccessSessionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4706,57 +2344,39 @@ export const de_PurchaseOfferingCommand = async ( }; /** - * deserializeAws_json1_1PurchaseOfferingCommandError + * deserializeAws_json1_1ListRunsCommand */ -const de_PurchaseOfferingCommandError = async ( +export const de_ListRunsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotEligibleException": - case "com.amazonaws.devicefarm#NotEligibleException": - throw await de_NotEligibleExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListRunsResult(data, context); + const response: ListRunsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RenewOfferingCommand + * deserializeAws_json1_1ListSamplesCommand */ -export const de_RenewOfferingCommand = async ( +export const de_ListSamplesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RenewOfferingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RenewOfferingResult(data, context); - const response: RenewOfferingCommandOutput = { + contents = _json(data); + const response: ListSamplesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4764,57 +2384,39 @@ export const de_RenewOfferingCommand = async ( }; /** - * deserializeAws_json1_1RenewOfferingCommandError + * deserializeAws_json1_1ListSuitesCommand */ -const de_RenewOfferingCommandError = async ( +export const de_ListSuitesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotEligibleException": - case "com.amazonaws.devicefarm#NotEligibleException": - throw await de_NotEligibleExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListSuitesResult(data, context); + const response: ListSuitesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ScheduleRunCommand + * deserializeAws_json1_1ListTagsForResourceCommand */ -export const de_ScheduleRunCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ScheduleRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ScheduleRunResult(data, context); - const response: ScheduleRunCommandOutput = { + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4822,57 +2424,39 @@ export const de_ScheduleRunCommand = async ( }; /** - * deserializeAws_json1_1ScheduleRunCommandError + * deserializeAws_json1_1ListTestGridProjectsCommand */ -const de_ScheduleRunCommandError = async ( +export const de_ListTestGridProjectsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "IdempotencyException": - case "com.amazonaws.devicefarm#IdempotencyException": - throw await de_IdempotencyExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListTestGridProjectsResult(data, context); + const response: ListTestGridProjectsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopJobCommand + * deserializeAws_json1_1ListTestGridSessionActionsCommand */ -export const de_StopJobCommand = async ( +export const de_ListTestGridSessionActionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StopJobResult(data, context); - const response: StopJobCommandOutput = { + contents = de_ListTestGridSessionActionsResult(data, context); + const response: ListTestGridSessionActionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4880,54 +2464,59 @@ export const de_StopJobCommand = async ( }; /** - * deserializeAws_json1_1StopJobCommandError + * deserializeAws_json1_1ListTestGridSessionArtifactsCommand */ -const de_StopJobCommandError = async ( +export const de_ListTestGridSessionArtifactsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTestGridSessionArtifactsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1ListTestGridSessionsCommand + */ +export const de_ListTestGridSessionsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListTestGridSessionsResult(data, context); + const response: ListTestGridSessionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopRemoteAccessSessionCommand + * deserializeAws_json1_1ListTestsCommand */ -export const de_StopRemoteAccessSessionCommand = async ( +export const de_ListTestsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopRemoteAccessSessionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StopRemoteAccessSessionResult(data, context); - const response: StopRemoteAccessSessionCommandOutput = { + contents = de_ListTestsResult(data, context); + const response: ListTestsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4935,54 +2524,39 @@ export const de_StopRemoteAccessSessionCommand = async ( }; /** - * deserializeAws_json1_1StopRemoteAccessSessionCommandError + * deserializeAws_json1_1ListUniqueProblemsCommand */ -const de_StopRemoteAccessSessionCommandError = async ( +export const de_ListUniqueProblemsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListUniqueProblemsResult(data, context); + const response: ListUniqueProblemsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopRunCommand + * deserializeAws_json1_1ListUploadsCommand */ -export const de_StopRunCommand = async ( +export const de_ListUploadsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StopRunResult(data, context); - const response: StopRunCommandOutput = { + contents = de_ListUploadsResult(data, context); + const response: ListUploadsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4990,54 +2564,39 @@ export const de_StopRunCommand = async ( }; /** - * deserializeAws_json1_1StopRunCommandError + * deserializeAws_json1_1ListVPCEConfigurationsCommand */ -const de_StopRunCommandError = async ( +export const de_ListVPCEConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListVPCEConfigurationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1PurchaseOfferingCommand */ -export const de_TagResourceCommand = async ( +export const de_PurchaseOfferingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: TagResourceCommandOutput = { + contents = de_PurchaseOfferingResult(data, context); + const response: PurchaseOfferingCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5045,57 +2604,39 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1RenewOfferingCommand */ -const de_TagResourceCommandError = async ( +export const de_RenewOfferingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TagOperationException": - case "com.amazonaws.devicefarm#TagOperationException": - throw await de_TagOperationExceptionRes(parsedOutput, context); - case "TagPolicyException": - case "com.amazonaws.devicefarm#TagPolicyException": - throw await de_TagPolicyExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.devicefarm#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RenewOfferingResult(data, context); + const response: RenewOfferingCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UntagResourceCommand + * deserializeAws_json1_1ScheduleRunCommand */ -export const de_UntagResourceCommand = async ( +export const de_ScheduleRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: UntagResourceCommandOutput = { + contents = de_ScheduleRunResult(data, context); + const response: ScheduleRunCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5103,51 +2644,39 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserializeAws_json1_1StopJobCommand */ -const de_UntagResourceCommandError = async ( +export const de_StopJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TagOperationException": - case "com.amazonaws.devicefarm#TagOperationException": - throw await de_TagOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StopJobResult(data, context); + const response: StopJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateDeviceInstanceCommand + * deserializeAws_json1_1StopRemoteAccessSessionCommand */ -export const de_UpdateDeviceInstanceCommand = async ( +export const de_StopRemoteAccessSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateDeviceInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: UpdateDeviceInstanceCommandOutput = { + contents = de_StopRemoteAccessSessionResult(data, context); + const response: StopRemoteAccessSessionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5155,54 +2684,59 @@ export const de_UpdateDeviceInstanceCommand = async ( }; /** - * deserializeAws_json1_1UpdateDeviceInstanceCommandError + * deserializeAws_json1_1StopRunCommand */ -const de_UpdateDeviceInstanceCommandError = async ( +export const de_StopRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StopRunResult(data, context); + const response: StopRunCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1TagResourceCommand + */ +export const de_TagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateDevicePoolCommand + * deserializeAws_json1_1UntagResourceCommand */ -export const de_UpdateDevicePoolCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateDevicePoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateDevicePoolCommandOutput = { + const response: UntagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5210,54 +2744,39 @@ export const de_UpdateDevicePoolCommand = async ( }; /** - * deserializeAws_json1_1UpdateDevicePoolCommandError + * deserializeAws_json1_1UpdateDeviceInstanceCommand */ -const de_UpdateDevicePoolCommandError = async ( +export const de_UpdateDeviceInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateDeviceInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateInstanceProfileCommand + * deserializeAws_json1_1UpdateDevicePoolCommand */ -export const de_UpdateInstanceProfileCommand = async ( +export const de_UpdateDevicePoolCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateInstanceProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateInstanceProfileCommandOutput = { + const response: UpdateDevicePoolCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5265,38 +2784,23 @@ export const de_UpdateInstanceProfileCommand = async ( }; /** - * deserializeAws_json1_1UpdateInstanceProfileCommandError + * deserializeAws_json1_1UpdateInstanceProfileCommand */ -const de_UpdateInstanceProfileCommandError = async ( +export const de_UpdateInstanceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateInstanceProfileCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -5307,7 +2811,7 @@ export const de_UpdateNetworkProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateNetworkProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5319,41 +2823,6 @@ export const de_UpdateNetworkProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateNetworkProfileCommandError - */ -const de_UpdateNetworkProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateProjectCommand */ @@ -5362,7 +2831,7 @@ export const de_UpdateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5374,41 +2843,6 @@ export const de_UpdateProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateProjectCommandError - */ -const de_UpdateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateTestGridProjectCommand */ @@ -5417,7 +2851,7 @@ export const de_UpdateTestGridProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTestGridProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5429,41 +2863,6 @@ export const de_UpdateTestGridProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateTestGridProjectCommandError - */ -const de_UpdateTestGridProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.devicefarm#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateUploadCommand */ @@ -5472,7 +2871,7 @@ export const de_UpdateUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateUploadCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5484,41 +2883,6 @@ export const de_UpdateUploadCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateUploadCommandError - */ -const de_UpdateUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ArgumentException": - case "com.amazonaws.devicefarm#ArgumentException": - throw await de_ArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.devicefarm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.devicefarm#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceAccountException": - case "com.amazonaws.devicefarm#ServiceAccountException": - throw await de_ServiceAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateVPCEConfigurationCommand */ @@ -5527,7 +2891,7 @@ export const de_UpdateVPCEConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateVPCEConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5540,12 +2904,9 @@ export const de_UpdateVPCEConfigurationCommand = async ( }; /** - * deserializeAws_json1_1UpdateVPCEConfigurationCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateVPCEConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5555,22 +2916,46 @@ const de_UpdateVPCEConfigurationCommandError = async ( case "ArgumentException": case "com.amazonaws.devicefarm#ArgumentException": throw await de_ArgumentExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.devicefarm#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.devicefarm#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "NotFoundException": case "com.amazonaws.devicefarm#NotFoundException": throw await de_NotFoundExceptionRes(parsedOutput, context); case "ServiceAccountException": case "com.amazonaws.devicefarm#ServiceAccountException": throw await de_ServiceAccountExceptionRes(parsedOutput, context); + case "TagOperationException": + case "com.amazonaws.devicefarm#TagOperationException": + throw await de_TagOperationExceptionRes(parsedOutput, context); + case "InternalServiceException": + case "com.amazonaws.devicefarm#InternalServiceException": + throw await de_InternalServiceExceptionRes(parsedOutput, context); + case "CannotDeleteException": + case "com.amazonaws.devicefarm#CannotDeleteException": + throw await de_CannotDeleteExceptionRes(parsedOutput, context); + case "InvalidOperationException": + case "com.amazonaws.devicefarm#InvalidOperationException": + throw await de_InvalidOperationExceptionRes(parsedOutput, context); + case "NotEligibleException": + case "com.amazonaws.devicefarm#NotEligibleException": + throw await de_NotEligibleExceptionRes(parsedOutput, context); + case "IdempotencyException": + case "com.amazonaws.devicefarm#IdempotencyException": + throw await de_IdempotencyExceptionRes(parsedOutput, context); + case "TagPolicyException": + case "com.amazonaws.devicefarm#TagPolicyException": + throw await de_TagPolicyExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.devicefarm#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-devops-guru/src/protocols/Aws_restJson1.ts b/clients/client-devops-guru/src/protocols/Aws_restJson1.ts index 96cd3ceb82f4..f1e1fc483ee4 100644 --- a/clients/client-devops-guru/src/protocols/Aws_restJson1.ts +++ b/clients/client-devops-guru/src/protocols/Aws_restJson1.ts @@ -893,7 +893,7 @@ export const de_AddNotificationChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AddNotificationChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -906,50 +906,6 @@ export const de_AddNotificationChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddNotificationChannelCommandError - */ -const de_AddNotificationChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.devopsguru#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.devopsguru#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteInsightCommand */ @@ -958,7 +914,7 @@ export const de_DeleteInsightCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteInsightCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -967,47 +923,6 @@ export const de_DeleteInsightCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteInsightCommandError - */ -const de_DeleteInsightCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.devopsguru#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAccountHealthCommand */ @@ -1016,7 +931,7 @@ export const de_DescribeAccountHealthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAccountHealthCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1033,41 +948,6 @@ export const de_DescribeAccountHealthCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAccountHealthCommandError - */ -const de_DescribeAccountHealthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAccountOverviewCommand */ @@ -1076,7 +956,7 @@ export const de_DescribeAccountOverviewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAccountOverviewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1091,41 +971,6 @@ export const de_DescribeAccountOverviewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAccountOverviewCommandError - */ -const de_DescribeAccountOverviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAnomalyCommand */ @@ -1134,7 +979,7 @@ export const de_DescribeAnomalyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAnomalyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1148,44 +993,6 @@ export const de_DescribeAnomalyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAnomalyCommandError - */ -const de_DescribeAnomalyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeEventSourcesConfigCommand */ @@ -1194,7 +1001,7 @@ export const de_DescribeEventSourcesConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeEventSourcesConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1207,41 +1014,6 @@ export const de_DescribeEventSourcesConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeEventSourcesConfigCommandError - */ -const de_DescribeEventSourcesConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeFeedbackCommand */ @@ -1250,7 +1022,7 @@ export const de_DescribeFeedbackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFeedbackCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1263,44 +1035,6 @@ export const de_DescribeFeedbackCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeFeedbackCommandError - */ -const de_DescribeFeedbackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeInsightCommand */ @@ -1309,7 +1043,7 @@ export const de_DescribeInsightCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeInsightCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1324,52 +1058,14 @@ export const de_DescribeInsightCommand = async ( }; /** - * deserializeAws_restJson1DescribeInsightCommandError + * deserializeAws_restJson1DescribeOrganizationHealthCommand */ -const de_DescribeInsightCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeOrganizationHealthCommand - */ -export const de_DescribeOrganizationHealthCommand = async ( +export const de_DescribeOrganizationHealthCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeOrganizationHealthCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1385,41 +1081,6 @@ export const de_DescribeOrganizationHealthCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeOrganizationHealthCommandError - */ -const de_DescribeOrganizationHealthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeOrganizationOverviewCommand */ @@ -1428,7 +1089,7 @@ export const de_DescribeOrganizationOverviewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeOrganizationOverviewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1442,41 +1103,6 @@ export const de_DescribeOrganizationOverviewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeOrganizationOverviewCommandError - */ -const de_DescribeOrganizationOverviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeOrganizationResourceCollectionHealthCommand */ @@ -1485,7 +1111,7 @@ export const de_DescribeOrganizationResourceCollectionHealthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeOrganizationResourceCollectionHealthCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1502,41 +1128,6 @@ export const de_DescribeOrganizationResourceCollectionHealthCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeOrganizationResourceCollectionHealthCommandError - */ -const de_DescribeOrganizationResourceCollectionHealthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeResourceCollectionHealthCommand */ @@ -1545,7 +1136,7 @@ export const de_DescribeResourceCollectionHealthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeResourceCollectionHealthCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1561,41 +1152,6 @@ export const de_DescribeResourceCollectionHealthCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeResourceCollectionHealthCommandError - */ -const de_DescribeResourceCollectionHealthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeServiceIntegrationCommand */ @@ -1604,7 +1160,7 @@ export const de_DescribeServiceIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeServiceIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1617,44 +1173,6 @@ export const de_DescribeServiceIntegrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeServiceIntegrationCommandError - */ -const de_DescribeServiceIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCostEstimationCommand */ @@ -1663,7 +1181,7 @@ export const de_GetCostEstimationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCostEstimationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1681,44 +1199,6 @@ export const de_GetCostEstimationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCostEstimationCommandError - */ -const de_GetCostEstimationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetResourceCollectionCommand */ @@ -1727,178 +1207,64 @@ export const de_GetResourceCollectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourceCollectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - ResourceCollection: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetResourceCollectionCommandError - */ -const de_GetResourceCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAnomaliesForInsightCommand - */ -export const de_ListAnomaliesForInsightCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnomaliesForInsightCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - ProactiveAnomalies: (_) => de_ProactiveAnomalies(_, context), - ReactiveAnomalies: (_) => de_ReactiveAnomalies(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAnomaliesForInsightCommandError - */ -const de_ListAnomaliesForInsightCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + NextToken: __expectString, + ResourceCollection: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListAnomalousLogGroupsCommand + * deserializeAws_restJson1ListAnomaliesForInsightCommand */ -export const de_ListAnomalousLogGroupsCommand = async ( +export const de_ListAnomaliesForInsightCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnomalousLogGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AnomalousLogGroups: (_) => de_AnomalousLogGroups(_, context), - InsightId: __expectString, NextToken: __expectString, + ProactiveAnomalies: (_) => de_ProactiveAnomalies(_, context), + ReactiveAnomalies: (_) => de_ReactiveAnomalies(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAnomalousLogGroupsCommandError + * deserializeAws_restJson1ListAnomalousLogGroupsCommand */ -const de_ListAnomalousLogGroupsCommandError = async ( +export const de_ListAnomalousLogGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AnomalousLogGroups: (_) => de_AnomalousLogGroups(_, context), + InsightId: __expectString, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1909,7 +1275,7 @@ export const de_ListEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1923,44 +1289,6 @@ export const de_ListEventsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEventsCommandError - */ -const de_ListEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListInsightsCommand */ @@ -1969,7 +1297,7 @@ export const de_ListInsightsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInsightsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1984,41 +1312,6 @@ export const de_ListInsightsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListInsightsCommandError - */ -const de_ListInsightsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListMonitoredResourcesCommand */ @@ -2027,7 +1320,7 @@ export const de_ListMonitoredResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMonitoredResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2041,41 +1334,6 @@ export const de_ListMonitoredResourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListMonitoredResourcesCommandError - */ -const de_ListMonitoredResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListNotificationChannelsCommand */ @@ -2084,7 +1342,7 @@ export const de_ListNotificationChannelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNotificationChannelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2098,41 +1356,6 @@ export const de_ListNotificationChannelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListNotificationChannelsCommandError - */ -const de_ListNotificationChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListOrganizationInsightsCommand */ @@ -2141,7 +1364,7 @@ export const de_ListOrganizationInsightsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOrganizationInsightsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2156,41 +1379,6 @@ export const de_ListOrganizationInsightsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListOrganizationInsightsCommandError - */ -const de_ListOrganizationInsightsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRecommendationsCommand */ @@ -2199,7 +1387,7 @@ export const de_ListRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2209,46 +1397,8 @@ export const de_ListRecommendationsCommand = async ( NextToken: __expectString, Recommendations: _json, }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListRecommendationsCommandError - */ -const de_ListRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Object.assign(contents, doc); + return contents; }; /** @@ -2259,7 +1409,7 @@ export const de_PutFeedbackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutFeedbackCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2268,47 +1418,6 @@ export const de_PutFeedbackCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutFeedbackCommandError - */ -const de_PutFeedbackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.devopsguru#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RemoveNotificationChannelCommand */ @@ -2317,7 +1426,7 @@ export const de_RemoveNotificationChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveNotificationChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2326,47 +1435,6 @@ export const de_RemoveNotificationChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RemoveNotificationChannelCommandError - */ -const de_RemoveNotificationChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.devopsguru#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchInsightsCommand */ @@ -2375,7 +1443,7 @@ export const de_SearchInsightsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchInsightsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2390,41 +1458,6 @@ export const de_SearchInsightsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchInsightsCommandError - */ -const de_SearchInsightsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchOrganizationInsightsCommand */ @@ -2433,7 +1466,7 @@ export const de_SearchOrganizationInsightsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchOrganizationInsightsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2448,41 +1481,6 @@ export const de_SearchOrganizationInsightsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchOrganizationInsightsCommandError - */ -const de_SearchOrganizationInsightsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartCostEstimationCommand */ @@ -2491,7 +1489,7 @@ export const de_StartCostEstimationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartCostEstimationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2500,47 +1498,6 @@ export const de_StartCostEstimationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartCostEstimationCommandError - */ -const de_StartCostEstimationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.devopsguru#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.devopsguru#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEventSourcesConfigCommand */ @@ -2549,7 +1506,7 @@ export const de_UpdateEventSourcesConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEventSourcesConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2558,41 +1515,6 @@ export const de_UpdateEventSourcesConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEventSourcesConfigCommandError - */ -const de_UpdateEventSourcesConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateResourceCollectionCommand */ @@ -2601,7 +1523,7 @@ export const de_UpdateResourceCollectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateResourceCollectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2610,44 +1532,6 @@ export const de_UpdateResourceCollectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateResourceCollectionCommandError - */ -const de_UpdateResourceCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.devopsguru#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.devopsguru#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.devopsguru#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.devopsguru#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.devopsguru#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateServiceIntegrationCommand */ @@ -2656,7 +1540,7 @@ export const de_UpdateServiceIntegrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateServiceIntegrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2666,12 +1550,9 @@ export const de_UpdateServiceIntegrationCommand = async ( }; /** - * deserializeAws_restJson1UpdateServiceIntegrationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateServiceIntegrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2687,6 +1568,12 @@ const de_UpdateServiceIntegrationCommandError = async ( case "InternalServerException": case "com.amazonaws.devopsguru#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.devopsguru#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.devopsguru#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.devopsguru#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -2699,7 +1586,7 @@ const de_UpdateServiceIntegrationCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-direct-connect/src/protocols/Aws_json1_1.ts b/clients/client-direct-connect/src/protocols/Aws_json1_1.ts index faf486a729ab..e7e80b2c3c43 100644 --- a/clients/client-direct-connect/src/protocols/Aws_json1_1.ts +++ b/clients/client-direct-connect/src/protocols/Aws_json1_1.ts @@ -1132,7 +1132,7 @@ export const de_AcceptDirectConnectGatewayAssociationProposalCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptDirectConnectGatewayAssociationProposalCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1144,35 +1144,6 @@ export const de_AcceptDirectConnectGatewayAssociationProposalCommand = async ( return response; }; -/** - * deserializeAws_json1_1AcceptDirectConnectGatewayAssociationProposalCommandError - */ -const de_AcceptDirectConnectGatewayAssociationProposalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AllocateConnectionOnInterconnectCommand */ @@ -1181,7 +1152,7 @@ export const de_AllocateConnectionOnInterconnectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AllocateConnectionOnInterconnectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1193,35 +1164,6 @@ export const de_AllocateConnectionOnInterconnectCommand = async ( return response; }; -/** - * deserializeAws_json1_1AllocateConnectionOnInterconnectCommandError - */ -const de_AllocateConnectionOnInterconnectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AllocateHostedConnectionCommand */ @@ -1230,7 +1172,7 @@ export const de_AllocateHostedConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AllocateHostedConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1242,41 +1184,6 @@ export const de_AllocateHostedConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1AllocateHostedConnectionCommandError - */ -const de_AllocateHostedConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - case "DuplicateTagKeysException": - case "com.amazonaws.directconnect#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.directconnect#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AllocatePrivateVirtualInterfaceCommand */ @@ -1285,7 +1192,7 @@ export const de_AllocatePrivateVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AllocatePrivateVirtualInterfaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1297,41 +1204,6 @@ export const de_AllocatePrivateVirtualInterfaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1AllocatePrivateVirtualInterfaceCommandError - */ -const de_AllocatePrivateVirtualInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - case "DuplicateTagKeysException": - case "com.amazonaws.directconnect#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.directconnect#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AllocatePublicVirtualInterfaceCommand */ @@ -1340,7 +1212,7 @@ export const de_AllocatePublicVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AllocatePublicVirtualInterfaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1352,41 +1224,6 @@ export const de_AllocatePublicVirtualInterfaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1AllocatePublicVirtualInterfaceCommandError - */ -const de_AllocatePublicVirtualInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - case "DuplicateTagKeysException": - case "com.amazonaws.directconnect#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.directconnect#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AllocateTransitVirtualInterfaceCommand */ @@ -1395,7 +1232,7 @@ export const de_AllocateTransitVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AllocateTransitVirtualInterfaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1407,41 +1244,6 @@ export const de_AllocateTransitVirtualInterfaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1AllocateTransitVirtualInterfaceCommandError - */ -const de_AllocateTransitVirtualInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - case "DuplicateTagKeysException": - case "com.amazonaws.directconnect#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.directconnect#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateConnectionWithLagCommand */ @@ -1450,7 +1252,7 @@ export const de_AssociateConnectionWithLagCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateConnectionWithLagCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1462,35 +1264,6 @@ export const de_AssociateConnectionWithLagCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateConnectionWithLagCommandError - */ -const de_AssociateConnectionWithLagCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateHostedConnectionCommand */ @@ -1499,7 +1272,7 @@ export const de_AssociateHostedConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateHostedConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1512,48 +1285,39 @@ export const de_AssociateHostedConnectionCommand = async ( }; /** - * deserializeAws_json1_1AssociateHostedConnectionCommandError + * deserializeAws_json1_1AssociateMacSecKeyCommand */ -const de_AssociateHostedConnectionCommandError = async ( +export const de_AssociateMacSecKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: AssociateMacSecKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1AssociateMacSecKeyCommand + * deserializeAws_json1_1AssociateVirtualInterfaceCommand */ -export const de_AssociateMacSecKeyCommand = async ( +export const de_AssociateVirtualInterfaceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AssociateMacSecKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: AssociateMacSecKeyCommandOutput = { + const response: AssociateVirtualInterfaceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1561,92 +1325,14 @@ export const de_AssociateMacSecKeyCommand = async ( }; /** - * deserializeAws_json1_1AssociateMacSecKeyCommandError + * deserializeAws_json1_1ConfirmConnectionCommand */ -const de_AssociateMacSecKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1AssociateVirtualInterfaceCommand - */ -export const de_AssociateVirtualInterfaceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_AssociateVirtualInterfaceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: AssociateVirtualInterfaceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1AssociateVirtualInterfaceCommandError - */ -const de_AssociateVirtualInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ConfirmConnectionCommand - */ -export const de_ConfirmConnectionCommand = async ( +export const de_ConfirmConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ConfirmConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1658,35 +1344,6 @@ export const de_ConfirmConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1ConfirmConnectionCommandError - */ -const de_ConfirmConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ConfirmCustomerAgreementCommand */ @@ -1695,7 +1352,7 @@ export const de_ConfirmCustomerAgreementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ConfirmCustomerAgreementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1707,35 +1364,6 @@ export const de_ConfirmCustomerAgreementCommand = async ( return response; }; -/** - * deserializeAws_json1_1ConfirmCustomerAgreementCommandError - */ -const de_ConfirmCustomerAgreementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ConfirmPrivateVirtualInterfaceCommand */ @@ -1744,7 +1372,7 @@ export const de_ConfirmPrivateVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ConfirmPrivateVirtualInterfaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1756,35 +1384,6 @@ export const de_ConfirmPrivateVirtualInterfaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ConfirmPrivateVirtualInterfaceCommandError - */ -const de_ConfirmPrivateVirtualInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ConfirmPublicVirtualInterfaceCommand */ @@ -1793,7 +1392,7 @@ export const de_ConfirmPublicVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ConfirmPublicVirtualInterfaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1805,35 +1404,6 @@ export const de_ConfirmPublicVirtualInterfaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ConfirmPublicVirtualInterfaceCommandError - */ -const de_ConfirmPublicVirtualInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ConfirmTransitVirtualInterfaceCommand */ @@ -1842,7 +1412,7 @@ export const de_ConfirmTransitVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ConfirmTransitVirtualInterfaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1854,35 +1424,6 @@ export const de_ConfirmTransitVirtualInterfaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ConfirmTransitVirtualInterfaceCommandError - */ -const de_ConfirmTransitVirtualInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateBGPPeerCommand */ @@ -1891,7 +1432,7 @@ export const de_CreateBGPPeerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBGPPeerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1903,35 +1444,6 @@ export const de_CreateBGPPeerCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateBGPPeerCommandError - */ -const de_CreateBGPPeerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateConnectionCommand */ @@ -1940,7 +1452,7 @@ export const de_CreateConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1952,41 +1464,6 @@ export const de_CreateConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateConnectionCommandError - */ -const de_CreateConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - case "DuplicateTagKeysException": - case "com.amazonaws.directconnect#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.directconnect#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDirectConnectGatewayCommand */ @@ -1995,7 +1472,7 @@ export const de_CreateDirectConnectGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDirectConnectGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2008,43 +1485,14 @@ export const de_CreateDirectConnectGatewayCommand = async ( }; /** - * deserializeAws_json1_1CreateDirectConnectGatewayCommandError + * deserializeAws_json1_1CreateDirectConnectGatewayAssociationCommand */ -const de_CreateDirectConnectGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateDirectConnectGatewayAssociationCommand - */ -export const de_CreateDirectConnectGatewayAssociationCommand = async ( +export const de_CreateDirectConnectGatewayAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDirectConnectGatewayAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2056,35 +1504,6 @@ export const de_CreateDirectConnectGatewayAssociationCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDirectConnectGatewayAssociationCommandError - */ -const de_CreateDirectConnectGatewayAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDirectConnectGatewayAssociationProposalCommand */ @@ -2093,7 +1512,7 @@ export const de_CreateDirectConnectGatewayAssociationProposalCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDirectConnectGatewayAssociationProposalCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2105,35 +1524,6 @@ export const de_CreateDirectConnectGatewayAssociationProposalCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDirectConnectGatewayAssociationProposalCommandError - */ -const de_CreateDirectConnectGatewayAssociationProposalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateInterconnectCommand */ @@ -2142,7 +1532,7 @@ export const de_CreateInterconnectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateInterconnectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2154,41 +1544,6 @@ export const de_CreateInterconnectCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateInterconnectCommandError - */ -const de_CreateInterconnectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - case "DuplicateTagKeysException": - case "com.amazonaws.directconnect#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.directconnect#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLagCommand */ @@ -2197,7 +1552,7 @@ export const de_CreateLagCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLagCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2209,41 +1564,6 @@ export const de_CreateLagCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateLagCommandError - */ -const de_CreateLagCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - case "DuplicateTagKeysException": - case "com.amazonaws.directconnect#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.directconnect#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePrivateVirtualInterfaceCommand */ @@ -2252,7 +1572,7 @@ export const de_CreatePrivateVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePrivateVirtualInterfaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2264,41 +1584,6 @@ export const de_CreatePrivateVirtualInterfaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePrivateVirtualInterfaceCommandError - */ -const de_CreatePrivateVirtualInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - case "DuplicateTagKeysException": - case "com.amazonaws.directconnect#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.directconnect#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePublicVirtualInterfaceCommand */ @@ -2307,7 +1592,7 @@ export const de_CreatePublicVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePublicVirtualInterfaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2319,41 +1604,6 @@ export const de_CreatePublicVirtualInterfaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePublicVirtualInterfaceCommandError - */ -const de_CreatePublicVirtualInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - case "DuplicateTagKeysException": - case "com.amazonaws.directconnect#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.directconnect#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTransitVirtualInterfaceCommand */ @@ -2362,116 +1612,32 @@ export const de_CreateTransitVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTransitVirtualInterfaceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateTransitVirtualInterfaceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateTransitVirtualInterfaceCommandError - */ -const de_CreateTransitVirtualInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - case "DuplicateTagKeysException": - case "com.amazonaws.directconnect#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.directconnect#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteBGPPeerCommand - */ -export const de_DeleteBGPPeerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteBGPPeerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteBGPPeerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteBGPPeerCommandError - */ -const de_DeleteBGPPeerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateTransitVirtualInterfaceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteConnectionCommand + * deserializeAws_json1_1DeleteBGPPeerCommand */ -export const de_DeleteConnectionCommand = async ( +export const de_DeleteBGPPeerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_Connection(data, context); - const response: DeleteConnectionCommandOutput = { + contents = _json(data); + const response: DeleteBGPPeerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2479,32 +1645,23 @@ export const de_DeleteConnectionCommand = async ( }; /** - * deserializeAws_json1_1DeleteConnectionCommandError + * deserializeAws_json1_1DeleteConnectionCommand */ -const de_DeleteConnectionCommandError = async ( +export const de_DeleteConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_Connection(data, context); + const response: DeleteConnectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2515,7 +1672,7 @@ export const de_DeleteDirectConnectGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDirectConnectGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2527,35 +1684,6 @@ export const de_DeleteDirectConnectGatewayCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteDirectConnectGatewayCommandError - */ -const de_DeleteDirectConnectGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteDirectConnectGatewayAssociationCommand */ @@ -2564,7 +1692,7 @@ export const de_DeleteDirectConnectGatewayAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDirectConnectGatewayAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2576,35 +1704,6 @@ export const de_DeleteDirectConnectGatewayAssociationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteDirectConnectGatewayAssociationCommandError - */ -const de_DeleteDirectConnectGatewayAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteDirectConnectGatewayAssociationProposalCommand */ @@ -2613,7 +1712,7 @@ export const de_DeleteDirectConnectGatewayAssociationProposalCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDirectConnectGatewayAssociationProposalCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2625,35 +1724,6 @@ export const de_DeleteDirectConnectGatewayAssociationProposalCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteDirectConnectGatewayAssociationProposalCommandError - */ -const de_DeleteDirectConnectGatewayAssociationProposalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteInterconnectCommand */ @@ -2662,7 +1732,7 @@ export const de_DeleteInterconnectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteInterconnectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2674,35 +1744,6 @@ export const de_DeleteInterconnectCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteInterconnectCommandError - */ -const de_DeleteInterconnectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteLagCommand */ @@ -2711,7 +1752,7 @@ export const de_DeleteLagCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLagCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2723,35 +1764,6 @@ export const de_DeleteLagCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteLagCommandError - */ -const de_DeleteLagCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteVirtualInterfaceCommand */ @@ -2760,7 +1772,7 @@ export const de_DeleteVirtualInterfaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVirtualInterfaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2772,35 +1784,6 @@ export const de_DeleteVirtualInterfaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteVirtualInterfaceCommandError - */ -const de_DeleteVirtualInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeConnectionLoaCommand */ @@ -2809,7 +1792,7 @@ export const de_DescribeConnectionLoaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConnectionLoaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2821,35 +1804,6 @@ export const de_DescribeConnectionLoaCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeConnectionLoaCommandError - */ -const de_DescribeConnectionLoaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeConnectionsCommand */ @@ -2858,7 +1812,7 @@ export const de_DescribeConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2867,36 +1821,7 @@ export const de_DescribeConnectionsCommand = async ( $metadata: deserializeMetadata(output), ...contents, }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeConnectionsCommandError - */ -const de_DescribeConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** @@ -2907,7 +1832,7 @@ export const de_DescribeConnectionsOnInterconnectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConnectionsOnInterconnectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2919,35 +1844,6 @@ export const de_DescribeConnectionsOnInterconnectCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeConnectionsOnInterconnectCommandError - */ -const de_DescribeConnectionsOnInterconnectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeCustomerMetadataCommand */ @@ -2956,7 +1852,7 @@ export const de_DescribeCustomerMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCustomerMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2968,35 +1864,6 @@ export const de_DescribeCustomerMetadataCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeCustomerMetadataCommandError - */ -const de_DescribeCustomerMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeDirectConnectGatewayAssociationProposalsCommand */ @@ -3005,7 +1872,7 @@ export const de_DescribeDirectConnectGatewayAssociationProposalsCommand = async context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDirectConnectGatewayAssociationProposalsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3017,35 +1884,6 @@ export const de_DescribeDirectConnectGatewayAssociationProposalsCommand = async return response; }; -/** - * deserializeAws_json1_1DescribeDirectConnectGatewayAssociationProposalsCommandError - */ -const de_DescribeDirectConnectGatewayAssociationProposalsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeDirectConnectGatewayAssociationsCommand */ @@ -3054,7 +1892,7 @@ export const de_DescribeDirectConnectGatewayAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDirectConnectGatewayAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3066,35 +1904,6 @@ export const de_DescribeDirectConnectGatewayAssociationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDirectConnectGatewayAssociationsCommandError - */ -const de_DescribeDirectConnectGatewayAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeDirectConnectGatewayAttachmentsCommand */ @@ -3103,7 +1912,7 @@ export const de_DescribeDirectConnectGatewayAttachmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDirectConnectGatewayAttachmentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3115,35 +1924,6 @@ export const de_DescribeDirectConnectGatewayAttachmentsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDirectConnectGatewayAttachmentsCommandError - */ -const de_DescribeDirectConnectGatewayAttachmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeDirectConnectGatewaysCommand */ @@ -3152,7 +1932,7 @@ export const de_DescribeDirectConnectGatewaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDirectConnectGatewaysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3164,35 +1944,6 @@ export const de_DescribeDirectConnectGatewaysCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDirectConnectGatewaysCommandError - */ -const de_DescribeDirectConnectGatewaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeHostedConnectionsCommand */ @@ -3201,7 +1952,7 @@ export const de_DescribeHostedConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeHostedConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3213,35 +1964,6 @@ export const de_DescribeHostedConnectionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeHostedConnectionsCommandError - */ -const de_DescribeHostedConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeInterconnectLoaCommand */ @@ -3250,7 +1972,7 @@ export const de_DescribeInterconnectLoaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInterconnectLoaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3258,102 +1980,24 @@ export const de_DescribeInterconnectLoaCommand = async ( const response: DescribeInterconnectLoaCommandOutput = { $metadata: deserializeMetadata(output), ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeInterconnectLoaCommandError - */ -const de_DescribeInterconnectLoaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeInterconnectsCommand - */ -export const de_DescribeInterconnectsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeInterconnectsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_Interconnects(data, context); - const response: DescribeInterconnectsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeInterconnectsCommandError - */ -const de_DescribeInterconnectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }; + return response; }; /** - * deserializeAws_json1_1DescribeLagsCommand + * deserializeAws_json1_1DescribeInterconnectsCommand */ -export const de_DescribeLagsCommand = async ( +export const de_DescribeInterconnectsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeLagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_Lags(data, context); - const response: DescribeLagsCommandOutput = { + contents = de_Interconnects(data, context); + const response: DescribeInterconnectsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3361,32 +2005,23 @@ export const de_DescribeLagsCommand = async ( }; /** - * deserializeAws_json1_1DescribeLagsCommandError + * deserializeAws_json1_1DescribeLagsCommand */ -const de_DescribeLagsCommandError = async ( +export const de_DescribeLagsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_Lags(data, context); + const response: DescribeLagsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3397,7 +2032,7 @@ export const de_DescribeLoaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLoaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3409,35 +2044,6 @@ export const de_DescribeLoaCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLoaCommandError - */ -const de_DescribeLoaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLocationsCommand */ @@ -3446,7 +2052,7 @@ export const de_DescribeLocationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3458,35 +2064,6 @@ export const de_DescribeLocationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLocationsCommandError - */ -const de_DescribeLocationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeRouterConfigurationCommand */ @@ -3495,7 +2072,7 @@ export const de_DescribeRouterConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRouterConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3507,35 +2084,6 @@ export const de_DescribeRouterConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeRouterConfigurationCommandError - */ -const de_DescribeRouterConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTagsCommand */ @@ -3544,7 +2092,7 @@ export const de_DescribeTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3556,35 +2104,6 @@ export const de_DescribeTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTagsCommandError - */ -const de_DescribeTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeVirtualGatewaysCommand */ @@ -3593,7 +2112,7 @@ export const de_DescribeVirtualGatewaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVirtualGatewaysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3605,35 +2124,6 @@ export const de_DescribeVirtualGatewaysCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeVirtualGatewaysCommandError - */ -const de_DescribeVirtualGatewaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeVirtualInterfacesCommand */ @@ -3642,7 +2132,7 @@ export const de_DescribeVirtualInterfacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVirtualInterfacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3654,35 +2144,6 @@ export const de_DescribeVirtualInterfacesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeVirtualInterfacesCommandError - */ -const de_DescribeVirtualInterfacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisassociateConnectionFromLagCommand */ @@ -3691,7 +2152,7 @@ export const de_DisassociateConnectionFromLagCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateConnectionFromLagCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3703,35 +2164,6 @@ export const de_DisassociateConnectionFromLagCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateConnectionFromLagCommandError - */ -const de_DisassociateConnectionFromLagCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisassociateMacSecKeyCommand */ @@ -3740,45 +2172,16 @@ export const de_DisassociateMacSecKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateMacSecKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DisassociateMacSecKeyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisassociateMacSecKeyCommandError - */ -const de_DisassociateMacSecKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + let contents: any = {}; + contents = _json(data); + const response: DisassociateMacSecKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3789,7 +2192,7 @@ export const de_ListVirtualInterfaceTestHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListVirtualInterfaceTestHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3801,35 +2204,6 @@ export const de_ListVirtualInterfaceTestHistoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListVirtualInterfaceTestHistoryCommandError - */ -const de_ListVirtualInterfaceTestHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartBgpFailoverTestCommand */ @@ -3838,7 +2212,7 @@ export const de_StartBgpFailoverTestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartBgpFailoverTestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3850,35 +2224,6 @@ export const de_StartBgpFailoverTestCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartBgpFailoverTestCommandError - */ -const de_StartBgpFailoverTestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopBgpFailoverTestCommand */ @@ -3887,7 +2232,7 @@ export const de_StopBgpFailoverTestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopBgpFailoverTestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3899,35 +2244,6 @@ export const de_StopBgpFailoverTestCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopBgpFailoverTestCommandError - */ -const de_StopBgpFailoverTestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -3936,7 +2252,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3948,41 +2264,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - case "DuplicateTagKeysException": - case "com.amazonaws.directconnect#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.directconnect#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -3991,7 +2272,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4003,35 +2284,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateConnectionCommand */ @@ -4040,7 +2292,7 @@ export const de_UpdateConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4052,35 +2304,6 @@ export const de_UpdateConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateConnectionCommandError - */ -const de_UpdateConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDirectConnectGatewayCommand */ @@ -4089,7 +2312,7 @@ export const de_UpdateDirectConnectGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDirectConnectGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4101,35 +2324,6 @@ export const de_UpdateDirectConnectGatewayCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDirectConnectGatewayCommandError - */ -const de_UpdateDirectConnectGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDirectConnectGatewayAssociationCommand */ @@ -4138,7 +2332,7 @@ export const de_UpdateDirectConnectGatewayAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDirectConnectGatewayAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4150,35 +2344,6 @@ export const de_UpdateDirectConnectGatewayAssociationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDirectConnectGatewayAssociationCommandError - */ -const de_UpdateDirectConnectGatewayAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateLagCommand */ @@ -4187,7 +2352,7 @@ export const de_UpdateLagCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLagCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4199,35 +2364,6 @@ export const de_UpdateLagCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateLagCommandError - */ -const de_UpdateLagCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectConnectClientException": - case "com.amazonaws.directconnect#DirectConnectClientException": - throw await de_DirectConnectClientExceptionRes(parsedOutput, context); - case "DirectConnectServerException": - case "com.amazonaws.directconnect#DirectConnectServerException": - throw await de_DirectConnectServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateVirtualInterfaceAttributesCommand */ @@ -4236,7 +2372,7 @@ export const de_UpdateVirtualInterfaceAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateVirtualInterfaceAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4249,12 +2385,9 @@ export const de_UpdateVirtualInterfaceAttributesCommand = async ( }; /** - * deserializeAws_json1_1UpdateVirtualInterfaceAttributesCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateVirtualInterfaceAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4267,13 +2400,19 @@ const de_UpdateVirtualInterfaceAttributesCommandError = async ( case "DirectConnectServerException": case "com.amazonaws.directconnect#DirectConnectServerException": throw await de_DirectConnectServerExceptionRes(parsedOutput, context); + case "DuplicateTagKeysException": + case "com.amazonaws.directconnect#DuplicateTagKeysException": + throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.directconnect#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-directory-service/src/protocols/Aws_json1_1.ts b/clients/client-directory-service/src/protocols/Aws_json1_1.ts index 2abc39ba448e..55904155da14 100644 --- a/clients/client-directory-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-directory-service/src/protocols/Aws_json1_1.ts @@ -1208,7 +1208,7 @@ export const de_AcceptSharedDirectoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptSharedDirectoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1220,44 +1220,6 @@ export const de_AcceptSharedDirectoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1AcceptSharedDirectoryCommandError - */ -const de_AcceptSharedDirectoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryAlreadySharedException": - case "com.amazonaws.directoryservice#DirectoryAlreadySharedException": - throw await de_DirectoryAlreadySharedExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddIpRoutesCommand */ @@ -1266,7 +1228,7 @@ export const de_AddIpRoutesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddIpRoutesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1278,50 +1240,6 @@ export const de_AddIpRoutesCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddIpRoutesCommandError - */ -const de_AddIpRoutesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EntityAlreadyExistsException": - case "com.amazonaws.directoryservice#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "IpRouteLimitExceededException": - case "com.amazonaws.directoryservice#IpRouteLimitExceededException": - throw await de_IpRouteLimitExceededExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddRegionCommand */ @@ -1330,7 +1248,7 @@ export const de_AddRegionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddRegionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1342,59 +1260,6 @@ export const de_AddRegionCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddRegionCommandError - */ -const de_AddRegionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.directoryservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryAlreadyInRegionException": - case "com.amazonaws.directoryservice#DirectoryAlreadyInRegionException": - throw await de_DirectoryAlreadyInRegionExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RegionLimitExceededException": - case "com.amazonaws.directoryservice#RegionLimitExceededException": - throw await de_RegionLimitExceededExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddTagsToResourceCommand */ @@ -1403,7 +1268,7 @@ export const de_AddTagsToResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsToResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1415,44 +1280,6 @@ export const de_AddTagsToResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddTagsToResourceCommandError - */ -const de_AddTagsToResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TagLimitExceededException": - case "com.amazonaws.directoryservice#TagLimitExceededException": - throw await de_TagLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelSchemaExtensionCommand */ @@ -1461,7 +1288,7 @@ export const de_CancelSchemaExtensionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelSchemaExtensionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1474,51 +1301,39 @@ export const de_CancelSchemaExtensionCommand = async ( }; /** - * deserializeAws_json1_1CancelSchemaExtensionCommandError + * deserializeAws_json1_1ConnectDirectoryCommand */ -const de_CancelSchemaExtensionCommandError = async ( +export const de_ConnectDirectoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ConnectDirectoryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ConnectDirectoryCommand + * deserializeAws_json1_1CreateAliasCommand */ -export const de_ConnectDirectoryCommand = async ( +export const de_CreateAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ConnectDirectoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ConnectDirectoryCommandOutput = { + const response: CreateAliasCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1526,54 +1341,39 @@ export const de_ConnectDirectoryCommand = async ( }; /** - * deserializeAws_json1_1ConnectDirectoryCommandError + * deserializeAws_json1_1CreateComputerCommand */ -const de_ConnectDirectoryCommandError = async ( +export const de_CreateComputerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryLimitExceededException": - case "com.amazonaws.directoryservice#DirectoryLimitExceededException": - throw await de_DirectoryLimitExceededExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateComputerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateAliasCommand + * deserializeAws_json1_1CreateConditionalForwarderCommand */ -export const de_CreateAliasCommand = async ( +export const de_CreateConditionalForwarderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateAliasCommandOutput = { + const response: CreateConditionalForwarderCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1581,57 +1381,39 @@ export const de_CreateAliasCommand = async ( }; /** - * deserializeAws_json1_1CreateAliasCommandError + * deserializeAws_json1_1CreateDirectoryCommand */ -const de_CreateAliasCommandError = async ( +export const de_CreateDirectoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityAlreadyExistsException": - case "com.amazonaws.directoryservice#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateDirectoryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateComputerCommand + * deserializeAws_json1_1CreateLogSubscriptionCommand */ -export const de_CreateComputerCommand = async ( +export const de_CreateLogSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateComputerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateComputerCommandOutput = { + const response: CreateLogSubscriptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1639,66 +1421,39 @@ export const de_CreateComputerCommand = async ( }; /** - * deserializeAws_json1_1CreateComputerCommandError + * deserializeAws_json1_1CreateMicrosoftADCommand */ -const de_CreateComputerCommandError = async ( +export const de_CreateMicrosoftADCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthenticationFailedException": - case "com.amazonaws.directoryservice#AuthenticationFailedException": - throw await de_AuthenticationFailedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EntityAlreadyExistsException": - case "com.amazonaws.directoryservice#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateMicrosoftADCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateConditionalForwarderCommand + * deserializeAws_json1_1CreateSnapshotCommand */ -export const de_CreateConditionalForwarderCommand = async ( +export const de_CreateSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateConditionalForwarderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateConditionalForwarderCommandOutput = { + const response: CreateSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1706,63 +1461,39 @@ export const de_CreateConditionalForwarderCommand = async ( }; /** - * deserializeAws_json1_1CreateConditionalForwarderCommandError + * deserializeAws_json1_1CreateTrustCommand */ -const de_CreateConditionalForwarderCommandError = async ( +export const de_CreateTrustCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EntityAlreadyExistsException": - case "com.amazonaws.directoryservice#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateTrustCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateDirectoryCommand + * deserializeAws_json1_1DeleteConditionalForwarderCommand */ -export const de_CreateDirectoryCommand = async ( +export const de_DeleteConditionalForwarderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDirectoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateDirectoryCommandOutput = { + const response: DeleteConditionalForwarderCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1770,54 +1501,39 @@ export const de_CreateDirectoryCommand = async ( }; /** - * deserializeAws_json1_1CreateDirectoryCommandError + * deserializeAws_json1_1DeleteDirectoryCommand */ -const de_CreateDirectoryCommandError = async ( +export const de_DeleteDirectoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryLimitExceededException": - case "com.amazonaws.directoryservice#DirectoryLimitExceededException": - throw await de_DirectoryLimitExceededExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteDirectoryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateLogSubscriptionCommand + * deserializeAws_json1_1DeleteLogSubscriptionCommand */ -export const de_CreateLogSubscriptionCommand = async ( +export const de_DeleteLogSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateLogSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateLogSubscriptionCommandOutput = { + const response: DeleteLogSubscriptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1825,60 +1541,39 @@ export const de_CreateLogSubscriptionCommand = async ( }; /** - * deserializeAws_json1_1CreateLogSubscriptionCommandError + * deserializeAws_json1_1DeleteSnapshotCommand */ -const de_CreateLogSubscriptionCommandError = async ( +export const de_DeleteSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityAlreadyExistsException": - case "com.amazonaws.directoryservice#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InsufficientPermissionsException": - case "com.amazonaws.directoryservice#InsufficientPermissionsException": - throw await de_InsufficientPermissionsExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateMicrosoftADCommand + * deserializeAws_json1_1DeleteTrustCommand */ -export const de_CreateMicrosoftADCommand = async ( +export const de_DeleteTrustCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateMicrosoftADCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateMicrosoftADCommandOutput = { + const response: DeleteTrustCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1886,57 +1581,39 @@ export const de_CreateMicrosoftADCommand = async ( }; /** - * deserializeAws_json1_1CreateMicrosoftADCommandError + * deserializeAws_json1_1DeregisterCertificateCommand */ -const de_CreateMicrosoftADCommandError = async ( +export const de_DeregisterCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryLimitExceededException": - case "com.amazonaws.directoryservice#DirectoryLimitExceededException": - throw await de_DirectoryLimitExceededExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeregisterCertificateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateSnapshotCommand + * deserializeAws_json1_1DeregisterEventTopicCommand */ -export const de_CreateSnapshotCommand = async ( +export const de_DeregisterEventTopicCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateSnapshotCommandOutput = { + const response: DeregisterEventTopicCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1944,57 +1621,59 @@ export const de_CreateSnapshotCommand = async ( }; /** - * deserializeAws_json1_1CreateSnapshotCommandError + * deserializeAws_json1_1DescribeCertificateCommand */ -const de_CreateSnapshotCommandError = async ( +export const de_DescribeCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeCertificateResult(data, context); + const response: DescribeCertificateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "SnapshotLimitExceededException": - case "com.amazonaws.directoryservice#SnapshotLimitExceededException": - throw await de_SnapshotLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DescribeClientAuthenticationSettingsCommand + */ +export const de_DescribeClientAuthenticationSettingsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeClientAuthenticationSettingsResult(data, context); + const response: DescribeClientAuthenticationSettingsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateTrustCommand + * deserializeAws_json1_1DescribeConditionalForwardersCommand */ -export const de_CreateTrustCommand = async ( +export const de_DescribeConditionalForwardersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateTrustCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateTrustCommandOutput = { + const response: DescribeConditionalForwardersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2002,60 +1681,39 @@ export const de_CreateTrustCommand = async ( }; /** - * deserializeAws_json1_1CreateTrustCommandError + * deserializeAws_json1_1DescribeDirectoriesCommand */ -const de_CreateTrustCommandError = async ( +export const de_DescribeDirectoriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityAlreadyExistsException": - case "com.amazonaws.directoryservice#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDirectoriesResult(data, context); + const response: DescribeDirectoriesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteConditionalForwarderCommand + * deserializeAws_json1_1DescribeDomainControllersCommand */ -export const de_DeleteConditionalForwarderCommand = async ( +export const de_DescribeDomainControllersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteConditionalForwarderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteConditionalForwarderCommandOutput = { + contents = de_DescribeDomainControllersResult(data, context); + const response: DescribeDomainControllersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2063,60 +1721,39 @@ export const de_DeleteConditionalForwarderCommand = async ( }; /** - * deserializeAws_json1_1DeleteConditionalForwarderCommandError + * deserializeAws_json1_1DescribeEventTopicsCommand */ -const de_DeleteConditionalForwarderCommandError = async ( +export const de_DescribeEventTopicsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeEventTopicsResult(data, context); + const response: DescribeEventTopicsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteDirectoryCommand + * deserializeAws_json1_1DescribeLDAPSSettingsCommand */ -export const de_DeleteDirectoryCommand = async ( +export const de_DescribeLDAPSSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDirectoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteDirectoryCommandOutput = { + contents = de_DescribeLDAPSSettingsResult(data, context); + const response: DescribeLDAPSSettingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2124,51 +1761,39 @@ export const de_DeleteDirectoryCommand = async ( }; /** - * deserializeAws_json1_1DeleteDirectoryCommandError + * deserializeAws_json1_1DescribeRegionsCommand */ -const de_DeleteDirectoryCommandError = async ( +export const de_DescribeRegionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeRegionsResult(data, context); + const response: DescribeRegionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteLogSubscriptionCommand + * deserializeAws_json1_1DescribeSettingsCommand */ -export const de_DeleteLogSubscriptionCommand = async ( +export const de_DescribeSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteLogSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteLogSubscriptionCommandOutput = { + contents = de_DescribeSettingsResult(data, context); + const response: DescribeSettingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2176,54 +1801,39 @@ export const de_DeleteLogSubscriptionCommand = async ( }; /** - * deserializeAws_json1_1DeleteLogSubscriptionCommandError + * deserializeAws_json1_1DescribeSharedDirectoriesCommand */ -const de_DeleteLogSubscriptionCommandError = async ( +export const de_DescribeSharedDirectoriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeSharedDirectoriesResult(data, context); + const response: DescribeSharedDirectoriesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteSnapshotCommand + * deserializeAws_json1_1DescribeSnapshotsCommand */ -export const de_DeleteSnapshotCommand = async ( +export const de_DescribeSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteSnapshotCommandOutput = { + contents = de_DescribeSnapshotsResult(data, context); + const response: DescribeSnapshotsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2231,54 +1841,39 @@ export const de_DeleteSnapshotCommand = async ( }; /** - * deserializeAws_json1_1DeleteSnapshotCommandError + * deserializeAws_json1_1DescribeTrustsCommand */ -const de_DeleteSnapshotCommandError = async ( +export const de_DescribeTrustsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeTrustsResult(data, context); + const response: DescribeTrustsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteTrustCommand + * deserializeAws_json1_1DescribeUpdateDirectoryCommand */ -export const de_DeleteTrustCommand = async ( +export const de_DescribeUpdateDirectoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteTrustCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteTrustCommandOutput = { + contents = de_DescribeUpdateDirectoryResult(data, context); + const response: DescribeUpdateDirectoryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2286,57 +1881,39 @@ export const de_DeleteTrustCommand = async ( }; /** - * deserializeAws_json1_1DeleteTrustCommandError + * deserializeAws_json1_1DisableClientAuthenticationCommand */ -const de_DeleteTrustCommandError = async ( +export const de_DisableClientAuthenticationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisableClientAuthenticationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeregisterCertificateCommand + * deserializeAws_json1_1DisableLDAPSCommand */ -export const de_DeregisterCertificateCommand = async ( +export const de_DisableLDAPSCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeregisterCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeregisterCertificateCommandOutput = { + const response: DisableLDAPSCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2344,66 +1921,39 @@ export const de_DeregisterCertificateCommand = async ( }; /** - * deserializeAws_json1_1DeregisterCertificateCommandError + * deserializeAws_json1_1DisableRadiusCommand */ -const de_DeregisterCertificateCommandError = async ( +export const de_DisableRadiusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateDoesNotExistException": - case "com.amazonaws.directoryservice#CertificateDoesNotExistException": - throw await de_CertificateDoesNotExistExceptionRes(parsedOutput, context); - case "CertificateInUseException": - case "com.amazonaws.directoryservice#CertificateInUseException": - throw await de_CertificateInUseExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisableRadiusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeregisterEventTopicCommand + * deserializeAws_json1_1DisableSsoCommand */ -export const de_DeregisterEventTopicCommand = async ( +export const de_DisableSsoCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeregisterEventTopicCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeregisterEventTopicCommandOutput = { + const response: DisableSsoCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2411,54 +1961,39 @@ export const de_DeregisterEventTopicCommand = async ( }; /** - * deserializeAws_json1_1DeregisterEventTopicCommandError + * deserializeAws_json1_1EnableClientAuthenticationCommand */ -const de_DeregisterEventTopicCommandError = async ( +export const de_EnableClientAuthenticationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: EnableClientAuthenticationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeCertificateCommand + * deserializeAws_json1_1EnableLDAPSCommand */ -export const de_DescribeCertificateCommand = async ( +export const de_EnableLDAPSCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeCertificateResult(data, context); - const response: DescribeCertificateCommandOutput = { + contents = _json(data); + const response: EnableLDAPSCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2466,60 +2001,19 @@ export const de_DescribeCertificateCommand = async ( }; /** - * deserializeAws_json1_1DescribeCertificateCommandError + * deserializeAws_json1_1EnableRadiusCommand */ -const de_DescribeCertificateCommandError = async ( +export const de_EnableRadiusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateDoesNotExistException": - case "com.amazonaws.directoryservice#CertificateDoesNotExistException": - throw await de_CertificateDoesNotExistExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeClientAuthenticationSettingsCommand - */ -export const de_DescribeClientAuthenticationSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeClientAuthenticationSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeClientAuthenticationSettingsResult(data, context); - const response: DescribeClientAuthenticationSettingsCommandOutput = { + contents = _json(data); + const response: EnableRadiusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2527,60 +2021,19 @@ export const de_DescribeClientAuthenticationSettingsCommand = async ( }; /** - * deserializeAws_json1_1DescribeClientAuthenticationSettingsCommandError - */ -const de_DescribeClientAuthenticationSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.directoryservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeConditionalForwardersCommand + * deserializeAws_json1_1EnableSsoCommand */ -export const de_DescribeConditionalForwardersCommand = async ( +export const de_EnableSsoCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeConditionalForwardersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeConditionalForwardersCommandOutput = { + const response: EnableSsoCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2588,60 +2041,19 @@ export const de_DescribeConditionalForwardersCommand = async ( }; /** - * deserializeAws_json1_1DescribeConditionalForwardersCommandError - */ -const de_DescribeConditionalForwardersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDirectoriesCommand + * deserializeAws_json1_1GetDirectoryLimitsCommand */ -export const de_DescribeDirectoriesCommand = async ( +export const de_GetDirectoryLimitsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDirectoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDirectoriesResult(data, context); - const response: DescribeDirectoriesCommandOutput = { + contents = _json(data); + const response: GetDirectoryLimitsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2649,57 +2061,39 @@ export const de_DescribeDirectoriesCommand = async ( }; /** - * deserializeAws_json1_1DescribeDirectoriesCommandError + * deserializeAws_json1_1GetSnapshotLimitsCommand */ -const de_DescribeDirectoriesCommandError = async ( +export const de_GetSnapshotLimitsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.directoryservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetSnapshotLimitsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeDomainControllersCommand + * deserializeAws_json1_1ListCertificatesCommand */ -export const de_DescribeDomainControllersCommand = async ( +export const de_ListCertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDomainControllersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDomainControllersResult(data, context); - const response: DescribeDomainControllersCommandOutput = { + contents = de_ListCertificatesResult(data, context); + const response: ListCertificatesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2707,60 +2101,39 @@ export const de_DescribeDomainControllersCommand = async ( }; /** - * deserializeAws_json1_1DescribeDomainControllersCommandError + * deserializeAws_json1_1ListIpRoutesCommand */ -const de_DescribeDomainControllersCommandError = async ( +export const de_ListIpRoutesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.directoryservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListIpRoutesResult(data, context); + const response: ListIpRoutesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeEventTopicsCommand + * deserializeAws_json1_1ListLogSubscriptionsCommand */ -export const de_DescribeEventTopicsCommand = async ( +export const de_ListLogSubscriptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventTopicsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEventTopicsResult(data, context); - const response: DescribeEventTopicsCommandOutput = { + contents = de_ListLogSubscriptionsResult(data, context); + const response: ListLogSubscriptionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2768,1424 +2141,39 @@ export const de_DescribeEventTopicsCommand = async ( }; /** - * deserializeAws_json1_1DescribeEventTopicsCommandError + * deserializeAws_json1_1ListSchemaExtensionsCommand */ -const de_DescribeEventTopicsCommandError = async ( +export const de_ListSchemaExtensionsCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeLDAPSSettingsCommand - */ -export const de_DescribeLDAPSSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeLDAPSSettingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeLDAPSSettingsResult(data, context); - const response: DescribeLDAPSSettingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeLDAPSSettingsCommandError - */ -const de_DescribeLDAPSSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.directoryservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeRegionsCommand - */ -export const de_DescribeRegionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeRegionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeRegionsResult(data, context); - const response: DescribeRegionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeRegionsCommandError - */ -const de_DescribeRegionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.directoryservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.directoryservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeSettingsCommand - */ -export const de_DescribeSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeSettingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeSettingsResult(data, context); - const response: DescribeSettingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeSettingsCommandError - */ -const de_DescribeSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.directoryservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeSharedDirectoriesCommand - */ -export const de_DescribeSharedDirectoriesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeSharedDirectoriesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeSharedDirectoriesResult(data, context); - const response: DescribeSharedDirectoriesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeSharedDirectoriesCommandError - */ -const de_DescribeSharedDirectoriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.directoryservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeSnapshotsCommand - */ -export const de_DescribeSnapshotsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeSnapshotsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeSnapshotsResult(data, context); - const response: DescribeSnapshotsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeSnapshotsCommandError - */ -const de_DescribeSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.directoryservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeTrustsCommand - */ -export const de_DescribeTrustsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeTrustsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeTrustsResult(data, context); - const response: DescribeTrustsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeTrustsCommandError - */ -const de_DescribeTrustsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.directoryservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeUpdateDirectoryCommand - */ -export const de_DescribeUpdateDirectoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeUpdateDirectoryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeUpdateDirectoryResult(data, context); - const response: DescribeUpdateDirectoryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeUpdateDirectoryCommandError - */ -const de_DescribeUpdateDirectoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.directoryservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.directoryservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisableClientAuthenticationCommand - */ -export const de_DisableClientAuthenticationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisableClientAuthenticationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DisableClientAuthenticationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisableClientAuthenticationCommandError - */ -const de_DisableClientAuthenticationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.directoryservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidClientAuthStatusException": - case "com.amazonaws.directoryservice#InvalidClientAuthStatusException": - throw await de_InvalidClientAuthStatusExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisableLDAPSCommand - */ -export const de_DisableLDAPSCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisableLDAPSCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DisableLDAPSCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisableLDAPSCommandError - */ -const de_DisableLDAPSCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "InvalidLDAPSStatusException": - case "com.amazonaws.directoryservice#InvalidLDAPSStatusException": - throw await de_InvalidLDAPSStatusExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisableRadiusCommand - */ -export const de_DisableRadiusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisableRadiusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DisableRadiusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisableRadiusCommandError - */ -const de_DisableRadiusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisableSsoCommand - */ -export const de_DisableSsoCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisableSsoCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DisableSsoCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisableSsoCommandError - */ -const de_DisableSsoCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthenticationFailedException": - case "com.amazonaws.directoryservice#AuthenticationFailedException": - throw await de_AuthenticationFailedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InsufficientPermissionsException": - case "com.amazonaws.directoryservice#InsufficientPermissionsException": - throw await de_InsufficientPermissionsExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1EnableClientAuthenticationCommand - */ -export const de_EnableClientAuthenticationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_EnableClientAuthenticationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: EnableClientAuthenticationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1EnableClientAuthenticationCommandError - */ -const de_EnableClientAuthenticationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.directoryservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidClientAuthStatusException": - case "com.amazonaws.directoryservice#InvalidClientAuthStatusException": - throw await de_InvalidClientAuthStatusExceptionRes(parsedOutput, context); - case "NoAvailableCertificateException": - case "com.amazonaws.directoryservice#NoAvailableCertificateException": - throw await de_NoAvailableCertificateExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1EnableLDAPSCommand - */ -export const de_EnableLDAPSCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_EnableLDAPSCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: EnableLDAPSCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1EnableLDAPSCommandError - */ -const de_EnableLDAPSCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "InvalidLDAPSStatusException": - case "com.amazonaws.directoryservice#InvalidLDAPSStatusException": - throw await de_InvalidLDAPSStatusExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NoAvailableCertificateException": - case "com.amazonaws.directoryservice#NoAvailableCertificateException": - throw await de_NoAvailableCertificateExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1EnableRadiusCommand - */ -export const de_EnableRadiusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_EnableRadiusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: EnableRadiusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1EnableRadiusCommandError - */ -const de_EnableRadiusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityAlreadyExistsException": - case "com.amazonaws.directoryservice#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1EnableSsoCommand - */ -export const de_EnableSsoCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_EnableSsoCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: EnableSsoCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1EnableSsoCommandError - */ -const de_EnableSsoCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthenticationFailedException": - case "com.amazonaws.directoryservice#AuthenticationFailedException": - throw await de_AuthenticationFailedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InsufficientPermissionsException": - case "com.amazonaws.directoryservice#InsufficientPermissionsException": - throw await de_InsufficientPermissionsExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDirectoryLimitsCommand - */ -export const de_GetDirectoryLimitsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDirectoryLimitsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetDirectoryLimitsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDirectoryLimitsCommandError - */ -const de_GetDirectoryLimitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSnapshotLimitsCommand - */ -export const de_GetSnapshotLimitsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSnapshotLimitsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetSnapshotLimitsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSnapshotLimitsCommandError - */ -const de_GetSnapshotLimitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListCertificatesCommand - */ -export const de_ListCertificatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListCertificatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListCertificatesResult(data, context); - const response: ListCertificatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListCertificatesCommandError - */ -const de_ListCertificatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.directoryservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListIpRoutesCommand - */ -export const de_ListIpRoutesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListIpRoutesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListIpRoutesResult(data, context); - const response: ListIpRoutesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListIpRoutesCommandError - */ -const de_ListIpRoutesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.directoryservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListLogSubscriptionsCommand - */ -export const de_ListLogSubscriptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListLogSubscriptionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListLogSubscriptionsResult(data, context); - const response: ListLogSubscriptionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListLogSubscriptionsCommandError - */ -const de_ListLogSubscriptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.directoryservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListSchemaExtensionsCommand - */ -export const de_ListSchemaExtensionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSchemaExtensionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListSchemaExtensionsResult(data, context); - const response: ListSchemaExtensionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListSchemaExtensionsCommandError - */ -const de_ListSchemaExtensionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.directoryservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.directoryservice#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RegisterCertificateCommand - */ -export const de_RegisterCertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RegisterCertificateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: RegisterCertificateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RegisterCertificateCommandError - */ -const de_RegisterCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateAlreadyExistsException": - case "com.amazonaws.directoryservice#CertificateAlreadyExistsException": - throw await de_CertificateAlreadyExistsExceptionRes(parsedOutput, context); - case "CertificateLimitExceededException": - case "com.amazonaws.directoryservice#CertificateLimitExceededException": - throw await de_CertificateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "InvalidCertificateException": - case "com.amazonaws.directoryservice#InvalidCertificateException": - throw await de_InvalidCertificateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListSchemaExtensionsResult(data, context); + const response: ListSchemaExtensionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RegisterEventTopicCommand + * deserializeAws_json1_1ListTagsForResourceCommand */ -export const de_RegisterEventTopicCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RegisterEventTopicCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: RegisterEventTopicCommandOutput = { + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4193,54 +2181,39 @@ export const de_RegisterEventTopicCommand = async ( }; /** - * deserializeAws_json1_1RegisterEventTopicCommandError + * deserializeAws_json1_1RegisterCertificateCommand */ -const de_RegisterEventTopicCommandError = async ( +export const de_RegisterCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: RegisterCertificateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RejectSharedDirectoryCommand + * deserializeAws_json1_1RegisterEventTopicCommand */ -export const de_RejectSharedDirectoryCommand = async ( +export const de_RegisterEventTopicCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RejectSharedDirectoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: RejectSharedDirectoryCommandOutput = { + const response: RegisterEventTopicCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4248,41 +2221,23 @@ export const de_RejectSharedDirectoryCommand = async ( }; /** - * deserializeAws_json1_1RejectSharedDirectoryCommandError + * deserializeAws_json1_1RejectSharedDirectoryCommand */ -const de_RejectSharedDirectoryCommandError = async ( +export const de_RejectSharedDirectoryCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryAlreadySharedException": - case "com.amazonaws.directoryservice#DirectoryAlreadySharedException": - throw await de_DirectoryAlreadySharedExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: RejectSharedDirectoryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -4293,7 +2248,7 @@ export const de_RemoveIpRoutesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveIpRoutesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4305,44 +2260,6 @@ export const de_RemoveIpRoutesCommand = async ( return response; }; -/** - * deserializeAws_json1_1RemoveIpRoutesCommandError - */ -const de_RemoveIpRoutesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RemoveRegionCommand */ @@ -4351,7 +2268,7 @@ export const de_RemoveRegionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveRegionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4363,47 +2280,6 @@ export const de_RemoveRegionCommand = async ( return response; }; -/** - * deserializeAws_json1_1RemoveRegionCommandError - */ -const de_RemoveRegionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.directoryservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RemoveTagsFromResourceCommand */ @@ -4412,7 +2288,7 @@ export const de_RemoveTagsFromResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveTagsFromResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4424,41 +2300,6 @@ export const de_RemoveTagsFromResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1RemoveTagsFromResourceCommandError - */ -const de_RemoveTagsFromResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ResetUserPasswordCommand */ @@ -4467,60 +2308,16 @@ export const de_ResetUserPasswordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResetUserPasswordCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ResetUserPasswordCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ResetUserPasswordCommandError - */ -const de_ResetUserPasswordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidPasswordException": - case "com.amazonaws.directoryservice#InvalidPasswordException": - throw await de_InvalidPasswordExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - case "UserDoesNotExistException": - case "com.amazonaws.directoryservice#UserDoesNotExistException": - throw await de_UserDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ResetUserPasswordCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -4531,7 +2328,7 @@ export const de_RestoreFromSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreFromSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4543,41 +2340,6 @@ export const de_RestoreFromSnapshotCommand = async ( return response; }; -/** - * deserializeAws_json1_1RestoreFromSnapshotCommandError - */ -const de_RestoreFromSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ShareDirectoryCommand */ @@ -4586,7 +2348,7 @@ export const de_ShareDirectoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ShareDirectoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4598,59 +2360,6 @@ export const de_ShareDirectoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1ShareDirectoryCommandError - */ -const de_ShareDirectoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.directoryservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryAlreadySharedException": - case "com.amazonaws.directoryservice#DirectoryAlreadySharedException": - throw await de_DirectoryAlreadySharedExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTargetException": - case "com.amazonaws.directoryservice#InvalidTargetException": - throw await de_InvalidTargetExceptionRes(parsedOutput, context); - case "OrganizationsException": - case "com.amazonaws.directoryservice#OrganizationsException": - throw await de_OrganizationsExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ShareLimitExceededException": - case "com.amazonaws.directoryservice#ShareLimitExceededException": - throw await de_ShareLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartSchemaExtensionCommand */ @@ -4659,7 +2368,7 @@ export const de_StartSchemaExtensionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartSchemaExtensionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4671,47 +2380,6 @@ export const de_StartSchemaExtensionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartSchemaExtensionCommandError - */ -const de_StartSchemaExtensionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "SnapshotLimitExceededException": - case "com.amazonaws.directoryservice#SnapshotLimitExceededException": - throw await de_SnapshotLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UnshareDirectoryCommand */ @@ -4720,7 +2388,7 @@ export const de_UnshareDirectoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UnshareDirectoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4732,44 +2400,6 @@ export const de_UnshareDirectoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1UnshareDirectoryCommandError - */ -const de_UnshareDirectoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryNotSharedException": - case "com.amazonaws.directoryservice#DirectoryNotSharedException": - throw await de_DirectoryNotSharedExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidTargetException": - case "com.amazonaws.directoryservice#InvalidTargetException": - throw await de_InvalidTargetExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateConditionalForwarderCommand */ @@ -4778,7 +2408,7 @@ export const de_UpdateConditionalForwarderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateConditionalForwarderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4790,47 +2420,6 @@ export const de_UpdateConditionalForwarderCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateConditionalForwarderCommandError - */ -const de_UpdateConditionalForwarderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDirectorySetupCommand */ @@ -4839,66 +2428,16 @@ export const de_UpdateDirectorySetupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDirectorySetupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateDirectorySetupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateDirectorySetupCommandError - */ -const de_UpdateDirectorySetupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.directoryservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "DirectoryInDesiredStateException": - case "com.amazonaws.directoryservice#DirectoryInDesiredStateException": - throw await de_DirectoryInDesiredStateExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "SnapshotLimitExceededException": - case "com.amazonaws.directoryservice#SnapshotLimitExceededException": - throw await de_SnapshotLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateDirectorySetupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -4909,7 +2448,7 @@ export const de_UpdateNumberOfDomainControllersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateNumberOfDomainControllersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4921,50 +2460,6 @@ export const de_UpdateNumberOfDomainControllersCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateNumberOfDomainControllersCommandError - */ -const de_UpdateNumberOfDomainControllersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "DomainControllerLimitExceededException": - case "com.amazonaws.directoryservice#DomainControllerLimitExceededException": - throw await de_DomainControllerLimitExceededExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateRadiusCommand */ @@ -4973,7 +2468,7 @@ export const de_UpdateRadiusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRadiusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4985,41 +2480,6 @@ export const de_UpdateRadiusCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateRadiusCommandError - */ -const de_UpdateRadiusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSettingsCommand */ @@ -5028,7 +2488,7 @@ export const de_UpdateSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5040,53 +2500,6 @@ export const de_UpdateSettingsCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSettingsCommandError - */ -const de_UpdateSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "DirectoryDoesNotExistException": - case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": - throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.directoryservice#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "IncompatibleSettingsException": - case "com.amazonaws.directoryservice#IncompatibleSettingsException": - throw await de_IncompatibleSettingsExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.directoryservice#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - case "UnsupportedSettingsException": - case "com.amazonaws.directoryservice#UnsupportedSettingsException": - throw await de_UnsupportedSettingsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateTrustCommand */ @@ -5095,7 +2508,7 @@ export const de_UpdateTrustCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTrustCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5107,41 +2520,6 @@ export const de_UpdateTrustCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateTrustCommandError - */ -const de_UpdateTrustCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.directoryservice#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "EntityDoesNotExistException": - case "com.amazonaws.directoryservice#EntityDoesNotExistException": - throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.directoryservice#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.directoryservice#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1VerifyTrustCommand */ @@ -5150,7 +2528,7 @@ export const de_VerifyTrustCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_VerifyTrustCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5163,12 +2541,9 @@ export const de_VerifyTrustCommand = async ( }; /** - * deserializeAws_json1_1VerifyTrustCommandError + * deserialize_Aws_json1_1CommandError */ -const de_VerifyTrustCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5178,6 +2553,9 @@ const de_VerifyTrustCommandError = async ( case "ClientException": case "com.amazonaws.directoryservice#ClientException": throw await de_ClientExceptionRes(parsedOutput, context); + case "DirectoryAlreadySharedException": + case "com.amazonaws.directoryservice#DirectoryAlreadySharedException": + throw await de_DirectoryAlreadySharedExceptionRes(parsedOutput, context); case "EntityDoesNotExistException": case "com.amazonaws.directoryservice#EntityDoesNotExistException": throw await de_EntityDoesNotExistExceptionRes(parsedOutput, context); @@ -5187,16 +2565,109 @@ const de_VerifyTrustCommandError = async ( case "ServiceException": case "com.amazonaws.directoryservice#ServiceException": throw await de_ServiceExceptionRes(parsedOutput, context); + case "DirectoryUnavailableException": + case "com.amazonaws.directoryservice#DirectoryUnavailableException": + throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); + case "EntityAlreadyExistsException": + case "com.amazonaws.directoryservice#EntityAlreadyExistsException": + throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); + case "IpRouteLimitExceededException": + case "com.amazonaws.directoryservice#IpRouteLimitExceededException": + throw await de_IpRouteLimitExceededExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.directoryservice#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "DirectoryAlreadyInRegionException": + case "com.amazonaws.directoryservice#DirectoryAlreadyInRegionException": + throw await de_DirectoryAlreadyInRegionExceptionRes(parsedOutput, context); + case "DirectoryDoesNotExistException": + case "com.amazonaws.directoryservice#DirectoryDoesNotExistException": + throw await de_DirectoryDoesNotExistExceptionRes(parsedOutput, context); + case "RegionLimitExceededException": + case "com.amazonaws.directoryservice#RegionLimitExceededException": + throw await de_RegionLimitExceededExceptionRes(parsedOutput, context); case "UnsupportedOperationException": case "com.amazonaws.directoryservice#UnsupportedOperationException": throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); + case "TagLimitExceededException": + case "com.amazonaws.directoryservice#TagLimitExceededException": + throw await de_TagLimitExceededExceptionRes(parsedOutput, context); + case "DirectoryLimitExceededException": + case "com.amazonaws.directoryservice#DirectoryLimitExceededException": + throw await de_DirectoryLimitExceededExceptionRes(parsedOutput, context); + case "AuthenticationFailedException": + case "com.amazonaws.directoryservice#AuthenticationFailedException": + throw await de_AuthenticationFailedExceptionRes(parsedOutput, context); + case "InsufficientPermissionsException": + case "com.amazonaws.directoryservice#InsufficientPermissionsException": + throw await de_InsufficientPermissionsExceptionRes(parsedOutput, context); + case "SnapshotLimitExceededException": + case "com.amazonaws.directoryservice#SnapshotLimitExceededException": + throw await de_SnapshotLimitExceededExceptionRes(parsedOutput, context); + case "CertificateDoesNotExistException": + case "com.amazonaws.directoryservice#CertificateDoesNotExistException": + throw await de_CertificateDoesNotExistExceptionRes(parsedOutput, context); + case "CertificateInUseException": + case "com.amazonaws.directoryservice#CertificateInUseException": + throw await de_CertificateInUseExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.directoryservice#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "InvalidClientAuthStatusException": + case "com.amazonaws.directoryservice#InvalidClientAuthStatusException": + throw await de_InvalidClientAuthStatusExceptionRes(parsedOutput, context); + case "InvalidLDAPSStatusException": + case "com.amazonaws.directoryservice#InvalidLDAPSStatusException": + throw await de_InvalidLDAPSStatusExceptionRes(parsedOutput, context); + case "NoAvailableCertificateException": + case "com.amazonaws.directoryservice#NoAvailableCertificateException": + throw await de_NoAvailableCertificateExceptionRes(parsedOutput, context); + case "CertificateAlreadyExistsException": + case "com.amazonaws.directoryservice#CertificateAlreadyExistsException": + throw await de_CertificateAlreadyExistsExceptionRes(parsedOutput, context); + case "CertificateLimitExceededException": + case "com.amazonaws.directoryservice#CertificateLimitExceededException": + throw await de_CertificateLimitExceededExceptionRes(parsedOutput, context); + case "InvalidCertificateException": + case "com.amazonaws.directoryservice#InvalidCertificateException": + throw await de_InvalidCertificateExceptionRes(parsedOutput, context); + case "InvalidPasswordException": + case "com.amazonaws.directoryservice#InvalidPasswordException": + throw await de_InvalidPasswordExceptionRes(parsedOutput, context); + case "UserDoesNotExistException": + case "com.amazonaws.directoryservice#UserDoesNotExistException": + throw await de_UserDoesNotExistExceptionRes(parsedOutput, context); + case "InvalidTargetException": + case "com.amazonaws.directoryservice#InvalidTargetException": + throw await de_InvalidTargetExceptionRes(parsedOutput, context); + case "OrganizationsException": + case "com.amazonaws.directoryservice#OrganizationsException": + throw await de_OrganizationsExceptionRes(parsedOutput, context); + case "ShareLimitExceededException": + case "com.amazonaws.directoryservice#ShareLimitExceededException": + throw await de_ShareLimitExceededExceptionRes(parsedOutput, context); + case "DirectoryNotSharedException": + case "com.amazonaws.directoryservice#DirectoryNotSharedException": + throw await de_DirectoryNotSharedExceptionRes(parsedOutput, context); + case "DirectoryInDesiredStateException": + case "com.amazonaws.directoryservice#DirectoryInDesiredStateException": + throw await de_DirectoryInDesiredStateExceptionRes(parsedOutput, context); + case "DomainControllerLimitExceededException": + case "com.amazonaws.directoryservice#DomainControllerLimitExceededException": + throw await de_DomainControllerLimitExceededExceptionRes(parsedOutput, context); + case "IncompatibleSettingsException": + case "com.amazonaws.directoryservice#IncompatibleSettingsException": + throw await de_IncompatibleSettingsExceptionRes(parsedOutput, context); + case "UnsupportedSettingsException": + case "com.amazonaws.directoryservice#UnsupportedSettingsException": + throw await de_UnsupportedSettingsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-dlm/src/protocols/Aws_restJson1.ts b/clients/client-dlm/src/protocols/Aws_restJson1.ts index b4cb70b52107..72313cb495d3 100644 --- a/clients/client-dlm/src/protocols/Aws_restJson1.ts +++ b/clients/client-dlm/src/protocols/Aws_restJson1.ts @@ -269,7 +269,7 @@ export const de_CreateLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -282,38 +282,6 @@ export const de_CreateLifecyclePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLifecyclePolicyCommandError - */ -const de_CreateLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dlm#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.dlm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dlm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteLifecyclePolicyCommand */ @@ -322,7 +290,7 @@ export const de_DeleteLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -331,38 +299,6 @@ export const de_DeleteLifecyclePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLifecyclePolicyCommandError - */ -const de_DeleteLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dlm#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dlm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dlm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLifecyclePoliciesCommand */ @@ -371,7 +307,7 @@ export const de_GetLifecyclePoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLifecyclePoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -384,41 +320,6 @@ export const de_GetLifecyclePoliciesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLifecyclePoliciesCommandError - */ -const de_GetLifecyclePoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dlm#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.dlm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dlm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dlm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLifecyclePolicyCommand */ @@ -427,7 +328,7 @@ export const de_GetLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -440,38 +341,6 @@ export const de_GetLifecyclePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLifecyclePolicyCommandError - */ -const de_GetLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dlm#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dlm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dlm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -480,7 +349,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -493,38 +362,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dlm#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.dlm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dlm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -533,7 +370,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -542,38 +379,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dlm#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.dlm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dlm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -582,7 +387,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -591,38 +396,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.dlm#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.dlm#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dlm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLifecyclePolicyCommand */ @@ -631,7 +404,7 @@ export const de_UpdateLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -641,12 +414,9 @@ export const de_UpdateLifecyclePolicyCommand = async ( }; /** - * deserializeAws_restJson1UpdateLifecyclePolicyCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -671,7 +441,7 @@ const de_UpdateLifecyclePolicyCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-docdb-elastic/src/protocols/Aws_restJson1.ts b/clients/client-docdb-elastic/src/protocols/Aws_restJson1.ts index 144cabc79908..5a9a8f356543 100644 --- a/clients/client-docdb-elastic/src/protocols/Aws_restJson1.ts +++ b/clients/client-docdb-elastic/src/protocols/Aws_restJson1.ts @@ -347,7 +347,7 @@ export const de_CreateClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -360,47 +360,6 @@ export const de_CreateClusterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateClusterCommandError - */ -const de_CreateClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.docdbelastic#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.docdbelastic#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.docdbelastic#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.docdbelastic#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.docdbelastic#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.docdbelastic#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateClusterSnapshotCommand */ @@ -409,7 +368,7 @@ export const de_CreateClusterSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateClusterSnapshotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -422,50 +381,6 @@ export const de_CreateClusterSnapshotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateClusterSnapshotCommandError - */ -const de_CreateClusterSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.docdbelastic#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.docdbelastic#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.docdbelastic#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.docdbelastic#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.docdbelastic#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.docdbelastic#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.docdbelastic#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteClusterCommand */ @@ -474,7 +389,7 @@ export const de_DeleteClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -487,47 +402,6 @@ export const de_DeleteClusterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteClusterCommandError - */ -const de_DeleteClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.docdbelastic#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.docdbelastic#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.docdbelastic#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.docdbelastic#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.docdbelastic#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.docdbelastic#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteClusterSnapshotCommand */ @@ -536,7 +410,7 @@ export const de_DeleteClusterSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteClusterSnapshotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -549,47 +423,6 @@ export const de_DeleteClusterSnapshotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteClusterSnapshotCommandError - */ -const de_DeleteClusterSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.docdbelastic#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.docdbelastic#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.docdbelastic#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.docdbelastic#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.docdbelastic#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.docdbelastic#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetClusterCommand */ @@ -598,7 +431,7 @@ export const de_GetClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -611,44 +444,6 @@ export const de_GetClusterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetClusterCommandError - */ -const de_GetClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.docdbelastic#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.docdbelastic#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.docdbelastic#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.docdbelastic#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.docdbelastic#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetClusterSnapshotCommand */ @@ -657,7 +452,7 @@ export const de_GetClusterSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetClusterSnapshotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -670,44 +465,6 @@ export const de_GetClusterSnapshotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetClusterSnapshotCommandError - */ -const de_GetClusterSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.docdbelastic#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.docdbelastic#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.docdbelastic#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.docdbelastic#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.docdbelastic#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListClustersCommand */ @@ -716,7 +473,7 @@ export const de_ListClustersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListClustersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -730,41 +487,6 @@ export const de_ListClustersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListClustersCommandError - */ -const de_ListClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.docdbelastic#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.docdbelastic#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.docdbelastic#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.docdbelastic#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListClusterSnapshotsCommand */ @@ -773,7 +495,7 @@ export const de_ListClusterSnapshotsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListClusterSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -787,41 +509,6 @@ export const de_ListClusterSnapshotsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListClusterSnapshotsCommandError - */ -const de_ListClusterSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.docdbelastic#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.docdbelastic#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.docdbelastic#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.docdbelastic#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -830,7 +517,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -843,41 +530,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.docdbelastic#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.docdbelastic#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.docdbelastic#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.docdbelastic#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RestoreClusterFromSnapshotCommand */ @@ -886,7 +538,7 @@ export const de_RestoreClusterFromSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RestoreClusterFromSnapshotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -899,50 +551,6 @@ export const de_RestoreClusterFromSnapshotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RestoreClusterFromSnapshotCommandError - */ -const de_RestoreClusterFromSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.docdbelastic#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.docdbelastic#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.docdbelastic#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.docdbelastic#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.docdbelastic#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.docdbelastic#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.docdbelastic#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -951,7 +559,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -960,41 +568,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.docdbelastic#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.docdbelastic#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.docdbelastic#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.docdbelastic#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1003,7 +576,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1012,41 +585,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.docdbelastic#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.docdbelastic#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.docdbelastic#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.docdbelastic#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateClusterCommand */ @@ -1055,7 +593,7 @@ export const de_UpdateClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1069,12 +607,9 @@ export const de_UpdateClusterCommand = async ( }; /** - * deserializeAws_restJson1UpdateClusterCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1090,22 +625,25 @@ const de_UpdateClusterCommandError = async ( case "InternalServerException": case "com.amazonaws.docdbelastic#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.docdbelastic#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.docdbelastic#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.docdbelastic#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.docdbelastic#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.docdbelastic#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-docdb/src/protocols/Aws_query.ts b/clients/client-docdb/src/protocols/Aws_query.ts index 6e0f91ef7353..1c0e5d937c2b 100644 --- a/clients/client-docdb/src/protocols/Aws_query.ts +++ b/clients/client-docdb/src/protocols/Aws_query.ts @@ -1298,7 +1298,7 @@ export const de_AddSourceIdentifierToSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddSourceIdentifierToSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1310,35 +1310,6 @@ export const de_AddSourceIdentifierToSubscriptionCommand = async ( return response; }; -/** - * deserializeAws_queryAddSourceIdentifierToSubscriptionCommandError - */ -const de_AddSourceIdentifierToSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "SourceNotFound": - case "com.amazonaws.docdb#SourceNotFoundFault": - throw await de_SourceNotFoundFaultRes(parsedOutput, context); - case "SubscriptionNotFound": - case "com.amazonaws.docdb#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAddTagsToResourceCommand */ @@ -1347,7 +1318,7 @@ export const de_AddTagsToResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsToResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AddTagsToResourceCommandOutput = { @@ -1356,38 +1327,6 @@ export const de_AddTagsToResourceCommand = async ( return response; }; -/** - * deserializeAws_queryAddTagsToResourceCommandError - */ -const de_AddTagsToResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.docdb#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.docdb#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotNotFound": - case "com.amazonaws.docdb#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryApplyPendingMaintenanceActionCommand */ @@ -1396,7 +1335,7 @@ export const de_ApplyPendingMaintenanceActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ApplyPendingMaintenanceActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1408,38 +1347,6 @@ export const de_ApplyPendingMaintenanceActionCommand = async ( return response; }; -/** - * deserializeAws_queryApplyPendingMaintenanceActionCommandError - */ -const de_ApplyPendingMaintenanceActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidDBClusterStateFault": - case "com.amazonaws.docdb#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.docdb#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.docdb#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCopyDBClusterParameterGroupCommand */ @@ -1448,7 +1355,7 @@ export const de_CopyDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopyDBClusterParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1460,38 +1367,6 @@ export const de_CopyDBClusterParameterGroupCommand = async ( return response; }; -/** - * deserializeAws_queryCopyDBClusterParameterGroupCommandError - */ -const de_CopyDBClusterParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupAlreadyExists": - case "com.amazonaws.docdb#DBParameterGroupAlreadyExistsFault": - throw await de_DBParameterGroupAlreadyExistsFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.docdb#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBParameterGroupQuotaExceeded": - case "com.amazonaws.docdb#DBParameterGroupQuotaExceededFault": - throw await de_DBParameterGroupQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCopyDBClusterSnapshotCommand */ @@ -1500,7 +1375,7 @@ export const de_CopyDBClusterSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopyDBClusterSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1512,47 +1387,6 @@ export const de_CopyDBClusterSnapshotCommand = async ( return response; }; -/** - * deserializeAws_queryCopyDBClusterSnapshotCommandError - */ -const de_CopyDBClusterSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterSnapshotAlreadyExistsFault": - case "com.amazonaws.docdb#DBClusterSnapshotAlreadyExistsFault": - throw await de_DBClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.docdb#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.docdb#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.docdb#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.docdb#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "SnapshotQuotaExceeded": - case "com.amazonaws.docdb#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateDBClusterCommand */ @@ -1561,7 +1395,7 @@ export const de_CreateDBClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDBClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1573,80 +1407,6 @@ export const de_CreateDBClusterCommand = async ( return response; }; -/** - * deserializeAws_queryCreateDBClusterCommandError - */ -const de_CreateDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterAlreadyExistsFault": - case "com.amazonaws.docdb#DBClusterAlreadyExistsFault": - throw await de_DBClusterAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.docdb#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterParameterGroupNotFound": - case "com.amazonaws.docdb#DBClusterParameterGroupNotFoundFault": - throw await de_DBClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBClusterQuotaExceededFault": - case "com.amazonaws.docdb#DBClusterQuotaExceededFault": - throw await de_DBClusterQuotaExceededFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.docdb#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.docdb#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.docdb#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "GlobalClusterNotFoundFault": - case "com.amazonaws.docdb#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - case "InsufficientStorageClusterCapacity": - case "com.amazonaws.docdb#InsufficientStorageClusterCapacityFault": - throw await de_InsufficientStorageClusterCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.docdb#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.docdb#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "InvalidDBSubnetGroupStateFault": - case "com.amazonaws.docdb#InvalidDBSubnetGroupStateFault": - throw await de_InvalidDBSubnetGroupStateFaultRes(parsedOutput, context); - case "InvalidGlobalClusterStateFault": - case "com.amazonaws.docdb#InvalidGlobalClusterStateFault": - throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.docdb#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.docdb#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.docdb#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.docdb#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateDBClusterParameterGroupCommand */ @@ -1655,7 +1415,7 @@ export const de_CreateDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDBClusterParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1667,35 +1427,6 @@ export const de_CreateDBClusterParameterGroupCommand = async ( return response; }; -/** - * deserializeAws_queryCreateDBClusterParameterGroupCommandError - */ -const de_CreateDBClusterParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupAlreadyExists": - case "com.amazonaws.docdb#DBParameterGroupAlreadyExistsFault": - throw await de_DBParameterGroupAlreadyExistsFaultRes(parsedOutput, context); - case "DBParameterGroupQuotaExceeded": - case "com.amazonaws.docdb#DBParameterGroupQuotaExceededFault": - throw await de_DBParameterGroupQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateDBClusterSnapshotCommand */ @@ -1704,7 +1435,7 @@ export const de_CreateDBClusterSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDBClusterSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1717,52 +1448,14 @@ export const de_CreateDBClusterSnapshotCommand = async ( }; /** - * deserializeAws_queryCreateDBClusterSnapshotCommandError - */ -const de_CreateDBClusterSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.docdb#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterSnapshotAlreadyExistsFault": - case "com.amazonaws.docdb#DBClusterSnapshotAlreadyExistsFault": - throw await de_DBClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.docdb#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.docdb#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "SnapshotQuotaExceeded": - case "com.amazonaws.docdb#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryCreateDBInstanceCommand + * deserializeAws_queryCreateDBInstanceCommand */ export const de_CreateDBInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDBInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1774,74 +1467,6 @@ export const de_CreateDBInstanceCommand = async ( return response; }; -/** - * deserializeAws_queryCreateDBInstanceCommandError - */ -const de_CreateDBInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationNotFound": - case "com.amazonaws.docdb#AuthorizationNotFoundFault": - throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.docdb#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceAlreadyExists": - case "com.amazonaws.docdb#DBInstanceAlreadyExistsFault": - throw await de_DBInstanceAlreadyExistsFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.docdb#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBSecurityGroupNotFound": - case "com.amazonaws.docdb#DBSecurityGroupNotFoundFault": - throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.docdb#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.docdb#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InstanceQuotaExceeded": - case "com.amazonaws.docdb#InstanceQuotaExceededFault": - throw await de_InstanceQuotaExceededFaultRes(parsedOutput, context); - case "InsufficientDBInstanceCapacity": - case "com.amazonaws.docdb#InsufficientDBInstanceCapacityFault": - throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.docdb#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.docdb#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.docdb#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.docdb#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.docdb#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - case "StorageTypeNotSupported": - case "com.amazonaws.docdb#StorageTypeNotSupportedFault": - throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateDBSubnetGroupCommand */ @@ -1850,7 +1475,7 @@ export const de_CreateDBSubnetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDBSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1862,44 +1487,6 @@ export const de_CreateDBSubnetGroupCommand = async ( return response; }; -/** - * deserializeAws_queryCreateDBSubnetGroupCommandError - */ -const de_CreateDBSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSubnetGroupAlreadyExists": - case "com.amazonaws.docdb#DBSubnetGroupAlreadyExistsFault": - throw await de_DBSubnetGroupAlreadyExistsFaultRes(parsedOutput, context); - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.docdb#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupQuotaExceeded": - case "com.amazonaws.docdb#DBSubnetGroupQuotaExceededFault": - throw await de_DBSubnetGroupQuotaExceededFaultRes(parsedOutput, context); - case "DBSubnetQuotaExceededFault": - case "com.amazonaws.docdb#DBSubnetQuotaExceededFault": - throw await de_DBSubnetQuotaExceededFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.docdb#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateEventSubscriptionCommand */ @@ -1908,7 +1495,7 @@ export const de_CreateEventSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEventSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1920,50 +1507,6 @@ export const de_CreateEventSubscriptionCommand = async ( return response; }; -/** - * deserializeAws_queryCreateEventSubscriptionCommandError - */ -const de_CreateEventSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EventSubscriptionQuotaExceeded": - case "com.amazonaws.docdb#EventSubscriptionQuotaExceededFault": - throw await de_EventSubscriptionQuotaExceededFaultRes(parsedOutput, context); - case "SNSInvalidTopic": - case "com.amazonaws.docdb#SNSInvalidTopicFault": - throw await de_SNSInvalidTopicFaultRes(parsedOutput, context); - case "SNSNoAuthorization": - case "com.amazonaws.docdb#SNSNoAuthorizationFault": - throw await de_SNSNoAuthorizationFaultRes(parsedOutput, context); - case "SNSTopicArnNotFound": - case "com.amazonaws.docdb#SNSTopicArnNotFoundFault": - throw await de_SNSTopicArnNotFoundFaultRes(parsedOutput, context); - case "SourceNotFound": - case "com.amazonaws.docdb#SourceNotFoundFault": - throw await de_SourceNotFoundFaultRes(parsedOutput, context); - case "SubscriptionAlreadyExist": - case "com.amazonaws.docdb#SubscriptionAlreadyExistFault": - throw await de_SubscriptionAlreadyExistFaultRes(parsedOutput, context); - case "SubscriptionCategoryNotFound": - case "com.amazonaws.docdb#SubscriptionCategoryNotFoundFault": - throw await de_SubscriptionCategoryNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateGlobalClusterCommand */ @@ -1972,7 +1515,7 @@ export const de_CreateGlobalClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateGlobalClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1984,41 +1527,6 @@ export const de_CreateGlobalClusterCommand = async ( return response; }; -/** - * deserializeAws_queryCreateGlobalClusterCommandError - */ -const de_CreateGlobalClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.docdb#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "GlobalClusterAlreadyExistsFault": - case "com.amazonaws.docdb#GlobalClusterAlreadyExistsFault": - throw await de_GlobalClusterAlreadyExistsFaultRes(parsedOutput, context); - case "GlobalClusterQuotaExceededFault": - case "com.amazonaws.docdb#GlobalClusterQuotaExceededFault": - throw await de_GlobalClusterQuotaExceededFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.docdb#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteDBClusterCommand */ @@ -2027,7 +1535,7 @@ export const de_DeleteDBClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2039,44 +1547,6 @@ export const de_DeleteDBClusterCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteDBClusterCommandError - */ -const de_DeleteDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.docdb#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterSnapshotAlreadyExistsFault": - case "com.amazonaws.docdb#DBClusterSnapshotAlreadyExistsFault": - throw await de_DBClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.docdb#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.docdb#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "SnapshotQuotaExceeded": - case "com.amazonaws.docdb#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteDBClusterParameterGroupCommand */ @@ -2085,7 +1555,7 @@ export const de_DeleteDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBClusterParameterGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteDBClusterParameterGroupCommandOutput = { @@ -2095,43 +1565,14 @@ export const de_DeleteDBClusterParameterGroupCommand = async ( }; /** - * deserializeAws_queryDeleteDBClusterParameterGroupCommandError + * deserializeAws_queryDeleteDBClusterSnapshotCommand */ -const de_DeleteDBClusterParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.docdb#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBParameterGroupState": - case "com.amazonaws.docdb#InvalidDBParameterGroupStateFault": - throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteDBClusterSnapshotCommand - */ -export const de_DeleteDBClusterSnapshotCommand = async ( +export const de_DeleteDBClusterSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBClusterSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2143,35 +1584,6 @@ export const de_DeleteDBClusterSnapshotCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteDBClusterSnapshotCommandError - */ -const de_DeleteDBClusterSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.docdb#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.docdb#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteDBInstanceCommand */ @@ -2180,7 +1592,7 @@ export const de_DeleteDBInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2192,44 +1604,6 @@ export const de_DeleteDBInstanceCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteDBInstanceCommandError - */ -const de_DeleteDBInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.docdb#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotAlreadyExists": - case "com.amazonaws.docdb#DBSnapshotAlreadyExistsFault": - throw await de_DBSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.docdb#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.docdb#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "SnapshotQuotaExceeded": - case "com.amazonaws.docdb#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteDBSubnetGroupCommand */ @@ -2238,7 +1612,7 @@ export const de_DeleteDBSubnetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteDBSubnetGroupCommandOutput = { @@ -2247,38 +1621,6 @@ export const de_DeleteDBSubnetGroupCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteDBSubnetGroupCommandError - */ -const de_DeleteDBSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.docdb#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBSubnetGroupStateFault": - case "com.amazonaws.docdb#InvalidDBSubnetGroupStateFault": - throw await de_InvalidDBSubnetGroupStateFaultRes(parsedOutput, context); - case "InvalidDBSubnetStateFault": - case "com.amazonaws.docdb#InvalidDBSubnetStateFault": - throw await de_InvalidDBSubnetStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteEventSubscriptionCommand */ @@ -2287,7 +1629,7 @@ export const de_DeleteEventSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEventSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2299,35 +1641,6 @@ export const de_DeleteEventSubscriptionCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteEventSubscriptionCommandError - */ -const de_DeleteEventSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidEventSubscriptionState": - case "com.amazonaws.docdb#InvalidEventSubscriptionStateFault": - throw await de_InvalidEventSubscriptionStateFaultRes(parsedOutput, context); - case "SubscriptionNotFound": - case "com.amazonaws.docdb#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteGlobalClusterCommand */ @@ -2336,7 +1649,7 @@ export const de_DeleteGlobalClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteGlobalClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2348,35 +1661,6 @@ export const de_DeleteGlobalClusterCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteGlobalClusterCommandError - */ -const de_DeleteGlobalClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalClusterNotFoundFault": - case "com.amazonaws.docdb#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidGlobalClusterStateFault": - case "com.amazonaws.docdb#InvalidGlobalClusterStateFault": - throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeCertificatesCommand */ @@ -2385,7 +1669,7 @@ export const de_DescribeCertificatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCertificatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2397,32 +1681,6 @@ export const de_DescribeCertificatesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeCertificatesCommandError - */ -const de_DescribeCertificatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateNotFound": - case "com.amazonaws.docdb#CertificateNotFoundFault": - throw await de_CertificateNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeDBClusterParameterGroupsCommand */ @@ -2431,7 +1689,7 @@ export const de_DescribeDBClusterParameterGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterParameterGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2443,32 +1701,6 @@ export const de_DescribeDBClusterParameterGroupsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeDBClusterParameterGroupsCommandError - */ -const de_DescribeDBClusterParameterGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.docdb#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeDBClusterParametersCommand */ @@ -2477,7 +1709,7 @@ export const de_DescribeDBClusterParametersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2489,32 +1721,6 @@ export const de_DescribeDBClusterParametersCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeDBClusterParametersCommandError - */ -const de_DescribeDBClusterParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.docdb#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeDBClustersCommand */ @@ -2523,7 +1729,7 @@ export const de_DescribeDBClustersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClustersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2536,40 +1742,14 @@ export const de_DescribeDBClustersCommand = async ( }; /** - * deserializeAws_queryDescribeDBClustersCommandError + * deserializeAws_queryDescribeDBClusterSnapshotAttributesCommand */ -const de_DescribeDBClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.docdb#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeDBClusterSnapshotAttributesCommand - */ -export const de_DescribeDBClusterSnapshotAttributesCommand = async ( +export const de_DescribeDBClusterSnapshotAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterSnapshotAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2581,32 +1761,6 @@ export const de_DescribeDBClusterSnapshotAttributesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeDBClusterSnapshotAttributesCommandError - */ -const de_DescribeDBClusterSnapshotAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.docdb#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeDBClusterSnapshotsCommand */ @@ -2615,7 +1769,7 @@ export const de_DescribeDBClusterSnapshotsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2627,32 +1781,6 @@ export const de_DescribeDBClusterSnapshotsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeDBClusterSnapshotsCommandError - */ -const de_DescribeDBClusterSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.docdb#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeDBEngineVersionsCommand */ @@ -2661,7 +1789,7 @@ export const de_DescribeDBEngineVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBEngineVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2673,26 +1801,6 @@ export const de_DescribeDBEngineVersionsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeDBEngineVersionsCommandError - */ -const de_DescribeDBEngineVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeDBInstancesCommand */ @@ -2701,7 +1809,7 @@ export const de_DescribeDBInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2713,32 +1821,6 @@ export const de_DescribeDBInstancesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeDBInstancesCommandError - */ -const de_DescribeDBInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.docdb#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeDBSubnetGroupsCommand */ @@ -2747,7 +1829,7 @@ export const de_DescribeDBSubnetGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBSubnetGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2759,32 +1841,6 @@ export const de_DescribeDBSubnetGroupsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeDBSubnetGroupsCommandError - */ -const de_DescribeDBSubnetGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.docdb#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeEngineDefaultClusterParametersCommand */ @@ -2793,7 +1849,7 @@ export const de_DescribeEngineDefaultClusterParametersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEngineDefaultClusterParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2808,26 +1864,6 @@ export const de_DescribeEngineDefaultClusterParametersCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeEngineDefaultClusterParametersCommandError - */ -const de_DescribeEngineDefaultClusterParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeEventCategoriesCommand */ @@ -2836,7 +1872,7 @@ export const de_DescribeEventCategoriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventCategoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2848,26 +1884,6 @@ export const de_DescribeEventCategoriesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeEventCategoriesCommandError - */ -const de_DescribeEventCategoriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeEventsCommand */ @@ -2876,7 +1892,7 @@ export const de_DescribeEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2888,26 +1904,6 @@ export const de_DescribeEventsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeEventsCommandError - */ -const de_DescribeEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeEventSubscriptionsCommand */ @@ -2916,7 +1912,7 @@ export const de_DescribeEventSubscriptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventSubscriptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2928,32 +1924,6 @@ export const de_DescribeEventSubscriptionsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeEventSubscriptionsCommandError - */ -const de_DescribeEventSubscriptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "SubscriptionNotFound": - case "com.amazonaws.docdb#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeGlobalClustersCommand */ @@ -2962,7 +1932,7 @@ export const de_DescribeGlobalClustersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeGlobalClustersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2974,32 +1944,6 @@ export const de_DescribeGlobalClustersCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeGlobalClustersCommandError - */ -const de_DescribeGlobalClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalClusterNotFoundFault": - case "com.amazonaws.docdb#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeOrderableDBInstanceOptionsCommand */ @@ -3008,7 +1952,7 @@ export const de_DescribeOrderableDBInstanceOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeOrderableDBInstanceOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3020,26 +1964,6 @@ export const de_DescribeOrderableDBInstanceOptionsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeOrderableDBInstanceOptionsCommandError - */ -const de_DescribeOrderableDBInstanceOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribePendingMaintenanceActionsCommand */ @@ -3048,7 +1972,7 @@ export const de_DescribePendingMaintenanceActionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePendingMaintenanceActionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3060,32 +1984,6 @@ export const de_DescribePendingMaintenanceActionsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribePendingMaintenanceActionsCommandError - */ -const de_DescribePendingMaintenanceActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.docdb#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryFailoverDBClusterCommand */ @@ -3094,7 +1992,7 @@ export const de_FailoverDBClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_FailoverDBClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3107,46 +2005,14 @@ export const de_FailoverDBClusterCommand = async ( }; /** - * deserializeAws_queryFailoverDBClusterCommandError + * deserializeAws_queryListTagsForResourceCommand */ -const de_FailoverDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.docdb#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.docdb#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.docdb#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3158,38 +2024,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_queryListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.docdb#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.docdb#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotNotFound": - case "com.amazonaws.docdb#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryModifyDBClusterCommand */ @@ -3198,7 +2032,7 @@ export const de_ModifyDBClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyDBClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3210,62 +2044,6 @@ export const de_ModifyDBClusterCommand = async ( return response; }; -/** - * deserializeAws_queryModifyDBClusterCommandError - */ -const de_ModifyDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterAlreadyExistsFault": - case "com.amazonaws.docdb#DBClusterAlreadyExistsFault": - throw await de_DBClusterAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.docdb#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterParameterGroupNotFound": - case "com.amazonaws.docdb#DBClusterParameterGroupNotFoundFault": - throw await de_DBClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.docdb#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.docdb#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.docdb#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "InvalidDBSecurityGroupState": - case "com.amazonaws.docdb#InvalidDBSecurityGroupStateFault": - throw await de_InvalidDBSecurityGroupStateFaultRes(parsedOutput, context); - case "InvalidDBSubnetGroupStateFault": - case "com.amazonaws.docdb#InvalidDBSubnetGroupStateFault": - throw await de_InvalidDBSubnetGroupStateFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.docdb#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.docdb#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.docdb#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryModifyDBClusterParameterGroupCommand */ @@ -3274,7 +2052,7 @@ export const de_ModifyDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyDBClusterParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3286,35 +2064,6 @@ export const de_ModifyDBClusterParameterGroupCommand = async ( return response; }; -/** - * deserializeAws_queryModifyDBClusterParameterGroupCommandError - */ -const de_ModifyDBClusterParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.docdb#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBParameterGroupState": - case "com.amazonaws.docdb#InvalidDBParameterGroupStateFault": - throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryModifyDBClusterSnapshotAttributeCommand */ @@ -3323,7 +2072,7 @@ export const de_ModifyDBClusterSnapshotAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyDBClusterSnapshotAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3335,38 +2084,6 @@ export const de_ModifyDBClusterSnapshotAttributeCommand = async ( return response; }; -/** - * deserializeAws_queryModifyDBClusterSnapshotAttributeCommandError - */ -const de_ModifyDBClusterSnapshotAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.docdb#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.docdb#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "SharedSnapshotQuotaExceeded": - case "com.amazonaws.docdb#SharedSnapshotQuotaExceededFault": - throw await de_SharedSnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryModifyDBInstanceCommand */ @@ -3375,7 +2092,7 @@ export const de_ModifyDBInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyDBInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3388,81 +2105,39 @@ export const de_ModifyDBInstanceCommand = async ( }; /** - * deserializeAws_queryModifyDBInstanceCommandError + * deserializeAws_queryModifyDBSubnetGroupCommand */ -const de_ModifyDBInstanceCommandError = async ( +export const de_ModifyDBSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationNotFound": - case "com.amazonaws.docdb#AuthorizationNotFoundFault": - throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); - case "CertificateNotFound": - case "com.amazonaws.docdb#CertificateNotFoundFault": - throw await de_CertificateNotFoundFaultRes(parsedOutput, context); - case "DBInstanceAlreadyExists": - case "com.amazonaws.docdb#DBInstanceAlreadyExistsFault": - throw await de_DBInstanceAlreadyExistsFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.docdb#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.docdb#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBSecurityGroupNotFound": - case "com.amazonaws.docdb#DBSecurityGroupNotFoundFault": - throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "DBUpgradeDependencyFailure": - case "com.amazonaws.docdb#DBUpgradeDependencyFailureFault": - throw await de_DBUpgradeDependencyFailureFaultRes(parsedOutput, context); - case "InsufficientDBInstanceCapacity": - case "com.amazonaws.docdb#InsufficientDBInstanceCapacityFault": - throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.docdb#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "InvalidDBSecurityGroupState": - case "com.amazonaws.docdb#InvalidDBSecurityGroupStateFault": - throw await de_InvalidDBSecurityGroupStateFaultRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.docdb#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.docdb#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - case "StorageTypeNotSupported": - case "com.amazonaws.docdb#StorageTypeNotSupportedFault": - throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyDBSubnetGroupResult(data.ModifyDBSubnetGroupResult, context); + const response: ModifyDBSubnetGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryModifyDBSubnetGroupCommand + * deserializeAws_queryModifyEventSubscriptionCommand */ -export const de_ModifyDBSubnetGroupCommand = async ( +export const de_ModifyEventSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ModifyDBSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ModifyDBSubnetGroupResult(data.ModifyDBSubnetGroupResult, context); - const response: ModifyDBSubnetGroupCommandOutput = { + contents = de_ModifyEventSubscriptionResult(data.ModifyEventSubscriptionResult, context); + const response: ModifyEventSubscriptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3470,113 +2145,14 @@ export const de_ModifyDBSubnetGroupCommand = async ( }; /** - * deserializeAws_queryModifyDBSubnetGroupCommandError + * deserializeAws_queryModifyGlobalClusterCommand */ -const de_ModifyDBSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.docdb#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.docdb#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "DBSubnetQuotaExceededFault": - case "com.amazonaws.docdb#DBSubnetQuotaExceededFault": - throw await de_DBSubnetQuotaExceededFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.docdb#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "SubnetAlreadyInUse": - case "com.amazonaws.docdb#SubnetAlreadyInUse": - throw await de_SubnetAlreadyInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyEventSubscriptionCommand - */ -export const de_ModifyEventSubscriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyEventSubscriptionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyEventSubscriptionResult(data.ModifyEventSubscriptionResult, context); - const response: ModifyEventSubscriptionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyEventSubscriptionCommandError - */ -const de_ModifyEventSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EventSubscriptionQuotaExceeded": - case "com.amazonaws.docdb#EventSubscriptionQuotaExceededFault": - throw await de_EventSubscriptionQuotaExceededFaultRes(parsedOutput, context); - case "SNSInvalidTopic": - case "com.amazonaws.docdb#SNSInvalidTopicFault": - throw await de_SNSInvalidTopicFaultRes(parsedOutput, context); - case "SNSNoAuthorization": - case "com.amazonaws.docdb#SNSNoAuthorizationFault": - throw await de_SNSNoAuthorizationFaultRes(parsedOutput, context); - case "SNSTopicArnNotFound": - case "com.amazonaws.docdb#SNSTopicArnNotFoundFault": - throw await de_SNSTopicArnNotFoundFaultRes(parsedOutput, context); - case "SubscriptionCategoryNotFound": - case "com.amazonaws.docdb#SubscriptionCategoryNotFoundFault": - throw await de_SubscriptionCategoryNotFoundFaultRes(parsedOutput, context); - case "SubscriptionNotFound": - case "com.amazonaws.docdb#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyGlobalClusterCommand - */ -export const de_ModifyGlobalClusterCommand = async ( +export const de_ModifyGlobalClusterCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyGlobalClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3588,35 +2164,6 @@ export const de_ModifyGlobalClusterCommand = async ( return response; }; -/** - * deserializeAws_queryModifyGlobalClusterCommandError - */ -const de_ModifyGlobalClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalClusterNotFoundFault": - case "com.amazonaws.docdb#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidGlobalClusterStateFault": - case "com.amazonaws.docdb#InvalidGlobalClusterStateFault": - throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryRebootDBInstanceCommand */ @@ -3625,7 +2172,7 @@ export const de_RebootDBInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RebootDBInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3637,35 +2184,6 @@ export const de_RebootDBInstanceCommand = async ( return response; }; -/** - * deserializeAws_queryRebootDBInstanceCommandError - */ -const de_RebootDBInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.docdb#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.docdb#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryRemoveFromGlobalClusterCommand */ @@ -3674,7 +2192,7 @@ export const de_RemoveFromGlobalClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveFromGlobalClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3686,38 +2204,6 @@ export const de_RemoveFromGlobalClusterCommand = async ( return response; }; -/** - * deserializeAws_queryRemoveFromGlobalClusterCommandError - */ -const de_RemoveFromGlobalClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.docdb#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "GlobalClusterNotFoundFault": - case "com.amazonaws.docdb#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidGlobalClusterStateFault": - case "com.amazonaws.docdb#InvalidGlobalClusterStateFault": - throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryRemoveSourceIdentifierFromSubscriptionCommand */ @@ -3726,7 +2212,7 @@ export const de_RemoveSourceIdentifierFromSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveSourceIdentifierFromSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3741,35 +2227,6 @@ export const de_RemoveSourceIdentifierFromSubscriptionCommand = async ( return response; }; -/** - * deserializeAws_queryRemoveSourceIdentifierFromSubscriptionCommandError - */ -const de_RemoveSourceIdentifierFromSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "SourceNotFound": - case "com.amazonaws.docdb#SourceNotFoundFault": - throw await de_SourceNotFoundFaultRes(parsedOutput, context); - case "SubscriptionNotFound": - case "com.amazonaws.docdb#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryRemoveTagsFromResourceCommand */ @@ -3778,7 +2235,7 @@ export const de_RemoveTagsFromResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveTagsFromResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RemoveTagsFromResourceCommandOutput = { @@ -3787,38 +2244,6 @@ export const de_RemoveTagsFromResourceCommand = async ( return response; }; -/** - * deserializeAws_queryRemoveTagsFromResourceCommandError - */ -const de_RemoveTagsFromResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.docdb#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.docdb#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotNotFound": - case "com.amazonaws.docdb#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryResetDBClusterParameterGroupCommand */ @@ -3827,7 +2252,7 @@ export const de_ResetDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResetDBClusterParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3839,35 +2264,6 @@ export const de_ResetDBClusterParameterGroupCommand = async ( return response; }; -/** - * deserializeAws_queryResetDBClusterParameterGroupCommandError - */ -const de_ResetDBClusterParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.docdb#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBParameterGroupState": - case "com.amazonaws.docdb#InvalidDBParameterGroupStateFault": - throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryRestoreDBClusterFromSnapshotCommand */ @@ -3876,7 +2272,7 @@ export const de_RestoreDBClusterFromSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreDBClusterFromSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3889,79 +2285,14 @@ export const de_RestoreDBClusterFromSnapshotCommand = async ( }; /** - * deserializeAws_queryRestoreDBClusterFromSnapshotCommandError + * deserializeAws_queryRestoreDBClusterToPointInTimeCommand */ -const de_RestoreDBClusterFromSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterAlreadyExistsFault": - case "com.amazonaws.docdb#DBClusterAlreadyExistsFault": - throw await de_DBClusterAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterQuotaExceededFault": - case "com.amazonaws.docdb#DBClusterQuotaExceededFault": - throw await de_DBClusterQuotaExceededFaultRes(parsedOutput, context); - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.docdb#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotNotFound": - case "com.amazonaws.docdb#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.docdb#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InsufficientDBClusterCapacityFault": - case "com.amazonaws.docdb#InsufficientDBClusterCapacityFault": - throw await de_InsufficientDBClusterCapacityFaultRes(parsedOutput, context); - case "InsufficientStorageClusterCapacity": - case "com.amazonaws.docdb#InsufficientStorageClusterCapacityFault": - throw await de_InsufficientStorageClusterCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.docdb#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidDBSnapshotState": - case "com.amazonaws.docdb#InvalidDBSnapshotStateFault": - throw await de_InvalidDBSnapshotStateFaultRes(parsedOutput, context); - case "InvalidRestoreFault": - case "com.amazonaws.docdb#InvalidRestoreFault": - throw await de_InvalidRestoreFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.docdb#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.docdb#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.docdb#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.docdb#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRestoreDBClusterToPointInTimeCommand - */ -export const de_RestoreDBClusterToPointInTimeCommand = async ( +export const de_RestoreDBClusterToPointInTimeCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreDBClusterToPointInTimeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3973,74 +2304,6 @@ export const de_RestoreDBClusterToPointInTimeCommand = async ( return response; }; -/** - * deserializeAws_queryRestoreDBClusterToPointInTimeCommandError - */ -const de_RestoreDBClusterToPointInTimeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterAlreadyExistsFault": - case "com.amazonaws.docdb#DBClusterAlreadyExistsFault": - throw await de_DBClusterAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.docdb#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterQuotaExceededFault": - case "com.amazonaws.docdb#DBClusterQuotaExceededFault": - throw await de_DBClusterQuotaExceededFaultRes(parsedOutput, context); - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.docdb#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.docdb#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InsufficientDBClusterCapacityFault": - case "com.amazonaws.docdb#InsufficientDBClusterCapacityFault": - throw await de_InsufficientDBClusterCapacityFaultRes(parsedOutput, context); - case "InsufficientStorageClusterCapacity": - case "com.amazonaws.docdb#InsufficientStorageClusterCapacityFault": - throw await de_InsufficientStorageClusterCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.docdb#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.docdb#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBSnapshotState": - case "com.amazonaws.docdb#InvalidDBSnapshotStateFault": - throw await de_InvalidDBSnapshotStateFaultRes(parsedOutput, context); - case "InvalidRestoreFault": - case "com.amazonaws.docdb#InvalidRestoreFault": - throw await de_InvalidRestoreFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.docdb#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.docdb#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.docdb#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.docdb#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryStartDBClusterCommand */ @@ -4049,7 +2312,7 @@ export const de_StartDBClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartDBClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4061,38 +2324,6 @@ export const de_StartDBClusterCommand = async ( return response; }; -/** - * deserializeAws_queryStartDBClusterCommandError - */ -const de_StartDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.docdb#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.docdb#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.docdb#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryStopDBClusterCommand */ @@ -4101,7 +2332,7 @@ export const de_StopDBClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopDBClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4114,34 +2345,193 @@ export const de_StopDBClusterCommand = async ( }; /** - * deserializeAws_queryStopDBClusterCommandError + * deserialize_Aws_queryCommandError */ -const de_StopDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { + case "SourceNotFound": + case "com.amazonaws.docdb#SourceNotFoundFault": + throw await de_SourceNotFoundFaultRes(parsedOutput, context); + case "SubscriptionNotFound": + case "com.amazonaws.docdb#SubscriptionNotFoundFault": + throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); case "DBClusterNotFoundFault": case "com.amazonaws.docdb#DBClusterNotFoundFault": throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); + case "DBInstanceNotFound": + case "com.amazonaws.docdb#DBInstanceNotFoundFault": + throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); + case "DBSnapshotNotFound": + case "com.amazonaws.docdb#DBSnapshotNotFoundFault": + throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); case "InvalidDBClusterStateFault": case "com.amazonaws.docdb#InvalidDBClusterStateFault": throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); case "InvalidDBInstanceState": case "com.amazonaws.docdb#InvalidDBInstanceStateFault": throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); + case "ResourceNotFoundFault": + case "com.amazonaws.docdb#ResourceNotFoundFault": + throw await de_ResourceNotFoundFaultRes(parsedOutput, context); + case "DBParameterGroupAlreadyExists": + case "com.amazonaws.docdb#DBParameterGroupAlreadyExistsFault": + throw await de_DBParameterGroupAlreadyExistsFaultRes(parsedOutput, context); + case "DBParameterGroupNotFound": + case "com.amazonaws.docdb#DBParameterGroupNotFoundFault": + throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); + case "DBParameterGroupQuotaExceeded": + case "com.amazonaws.docdb#DBParameterGroupQuotaExceededFault": + throw await de_DBParameterGroupQuotaExceededFaultRes(parsedOutput, context); + case "DBClusterSnapshotAlreadyExistsFault": + case "com.amazonaws.docdb#DBClusterSnapshotAlreadyExistsFault": + throw await de_DBClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); + case "DBClusterSnapshotNotFoundFault": + case "com.amazonaws.docdb#DBClusterSnapshotNotFoundFault": + throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); + case "InvalidDBClusterSnapshotStateFault": + case "com.amazonaws.docdb#InvalidDBClusterSnapshotStateFault": + throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); + case "KMSKeyNotAccessibleFault": + case "com.amazonaws.docdb#KMSKeyNotAccessibleFault": + throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); + case "SnapshotQuotaExceeded": + case "com.amazonaws.docdb#SnapshotQuotaExceededFault": + throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); + case "DBClusterAlreadyExistsFault": + case "com.amazonaws.docdb#DBClusterAlreadyExistsFault": + throw await de_DBClusterAlreadyExistsFaultRes(parsedOutput, context); + case "DBClusterParameterGroupNotFound": + case "com.amazonaws.docdb#DBClusterParameterGroupNotFoundFault": + throw await de_DBClusterParameterGroupNotFoundFaultRes(parsedOutput, context); + case "DBClusterQuotaExceededFault": + case "com.amazonaws.docdb#DBClusterQuotaExceededFault": + throw await de_DBClusterQuotaExceededFaultRes(parsedOutput, context); + case "DBSubnetGroupDoesNotCoverEnoughAZs": + case "com.amazonaws.docdb#DBSubnetGroupDoesNotCoverEnoughAZs": + throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); + case "DBSubnetGroupNotFoundFault": + case "com.amazonaws.docdb#DBSubnetGroupNotFoundFault": + throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); + case "GlobalClusterNotFoundFault": + case "com.amazonaws.docdb#GlobalClusterNotFoundFault": + throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); + case "InsufficientStorageClusterCapacity": + case "com.amazonaws.docdb#InsufficientStorageClusterCapacityFault": + throw await de_InsufficientStorageClusterCapacityFaultRes(parsedOutput, context); + case "InvalidDBSubnetGroupStateFault": + case "com.amazonaws.docdb#InvalidDBSubnetGroupStateFault": + throw await de_InvalidDBSubnetGroupStateFaultRes(parsedOutput, context); + case "InvalidGlobalClusterStateFault": + case "com.amazonaws.docdb#InvalidGlobalClusterStateFault": + throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); + case "InvalidSubnet": + case "com.amazonaws.docdb#InvalidSubnet": + throw await de_InvalidSubnetRes(parsedOutput, context); + case "InvalidVPCNetworkStateFault": + case "com.amazonaws.docdb#InvalidVPCNetworkStateFault": + throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); + case "StorageQuotaExceeded": + case "com.amazonaws.docdb#StorageQuotaExceededFault": + throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); + case "AuthorizationNotFound": + case "com.amazonaws.docdb#AuthorizationNotFoundFault": + throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); + case "DBInstanceAlreadyExists": + case "com.amazonaws.docdb#DBInstanceAlreadyExistsFault": + throw await de_DBInstanceAlreadyExistsFaultRes(parsedOutput, context); + case "DBSecurityGroupNotFound": + case "com.amazonaws.docdb#DBSecurityGroupNotFoundFault": + throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); + case "InstanceQuotaExceeded": + case "com.amazonaws.docdb#InstanceQuotaExceededFault": + throw await de_InstanceQuotaExceededFaultRes(parsedOutput, context); + case "InsufficientDBInstanceCapacity": + case "com.amazonaws.docdb#InsufficientDBInstanceCapacityFault": + throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); + case "StorageTypeNotSupported": + case "com.amazonaws.docdb#StorageTypeNotSupportedFault": + throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); + case "DBSubnetGroupAlreadyExists": + case "com.amazonaws.docdb#DBSubnetGroupAlreadyExistsFault": + throw await de_DBSubnetGroupAlreadyExistsFaultRes(parsedOutput, context); + case "DBSubnetGroupQuotaExceeded": + case "com.amazonaws.docdb#DBSubnetGroupQuotaExceededFault": + throw await de_DBSubnetGroupQuotaExceededFaultRes(parsedOutput, context); + case "DBSubnetQuotaExceededFault": + case "com.amazonaws.docdb#DBSubnetQuotaExceededFault": + throw await de_DBSubnetQuotaExceededFaultRes(parsedOutput, context); + case "EventSubscriptionQuotaExceeded": + case "com.amazonaws.docdb#EventSubscriptionQuotaExceededFault": + throw await de_EventSubscriptionQuotaExceededFaultRes(parsedOutput, context); + case "SNSInvalidTopic": + case "com.amazonaws.docdb#SNSInvalidTopicFault": + throw await de_SNSInvalidTopicFaultRes(parsedOutput, context); + case "SNSNoAuthorization": + case "com.amazonaws.docdb#SNSNoAuthorizationFault": + throw await de_SNSNoAuthorizationFaultRes(parsedOutput, context); + case "SNSTopicArnNotFound": + case "com.amazonaws.docdb#SNSTopicArnNotFoundFault": + throw await de_SNSTopicArnNotFoundFaultRes(parsedOutput, context); + case "SubscriptionAlreadyExist": + case "com.amazonaws.docdb#SubscriptionAlreadyExistFault": + throw await de_SubscriptionAlreadyExistFaultRes(parsedOutput, context); + case "SubscriptionCategoryNotFound": + case "com.amazonaws.docdb#SubscriptionCategoryNotFoundFault": + throw await de_SubscriptionCategoryNotFoundFaultRes(parsedOutput, context); + case "GlobalClusterAlreadyExistsFault": + case "com.amazonaws.docdb#GlobalClusterAlreadyExistsFault": + throw await de_GlobalClusterAlreadyExistsFaultRes(parsedOutput, context); + case "GlobalClusterQuotaExceededFault": + case "com.amazonaws.docdb#GlobalClusterQuotaExceededFault": + throw await de_GlobalClusterQuotaExceededFaultRes(parsedOutput, context); + case "InvalidDBParameterGroupState": + case "com.amazonaws.docdb#InvalidDBParameterGroupStateFault": + throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); + case "DBSnapshotAlreadyExists": + case "com.amazonaws.docdb#DBSnapshotAlreadyExistsFault": + throw await de_DBSnapshotAlreadyExistsFaultRes(parsedOutput, context); + case "InvalidDBSubnetStateFault": + case "com.amazonaws.docdb#InvalidDBSubnetStateFault": + throw await de_InvalidDBSubnetStateFaultRes(parsedOutput, context); + case "InvalidEventSubscriptionState": + case "com.amazonaws.docdb#InvalidEventSubscriptionStateFault": + throw await de_InvalidEventSubscriptionStateFaultRes(parsedOutput, context); + case "CertificateNotFound": + case "com.amazonaws.docdb#CertificateNotFoundFault": + throw await de_CertificateNotFoundFaultRes(parsedOutput, context); + case "InvalidDBSecurityGroupState": + case "com.amazonaws.docdb#InvalidDBSecurityGroupStateFault": + throw await de_InvalidDBSecurityGroupStateFaultRes(parsedOutput, context); + case "SharedSnapshotQuotaExceeded": + case "com.amazonaws.docdb#SharedSnapshotQuotaExceededFault": + throw await de_SharedSnapshotQuotaExceededFaultRes(parsedOutput, context); + case "DBUpgradeDependencyFailure": + case "com.amazonaws.docdb#DBUpgradeDependencyFailureFault": + throw await de_DBUpgradeDependencyFailureFaultRes(parsedOutput, context); + case "SubnetAlreadyInUse": + case "com.amazonaws.docdb#SubnetAlreadyInUse": + throw await de_SubnetAlreadyInUseRes(parsedOutput, context); + case "InsufficientDBClusterCapacityFault": + case "com.amazonaws.docdb#InsufficientDBClusterCapacityFault": + throw await de_InsufficientDBClusterCapacityFaultRes(parsedOutput, context); + case "InvalidDBSnapshotState": + case "com.amazonaws.docdb#InvalidDBSnapshotStateFault": + throw await de_InvalidDBSnapshotStateFaultRes(parsedOutput, context); + case "InvalidRestoreFault": + case "com.amazonaws.docdb#InvalidRestoreFault": + throw await de_InvalidRestoreFaultRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody: parsedBody.Error, errorCode, - }); + }) as never; } }; diff --git a/clients/client-drs/src/protocols/Aws_restJson1.ts b/clients/client-drs/src/protocols/Aws_restJson1.ts index 737f5636047c..9717c4b3230c 100644 --- a/clients/client-drs/src/protocols/Aws_restJson1.ts +++ b/clients/client-drs/src/protocols/Aws_restJson1.ts @@ -1422,7 +1422,7 @@ export const de_AssociateSourceNetworkStackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_AssociateSourceNetworkStackCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1435,50 +1435,6 @@ export const de_AssociateSourceNetworkStackCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateSourceNetworkStackCommandError - */ -const de_AssociateSourceNetworkStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.drs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateExtendedSourceServerCommand */ @@ -1487,7 +1443,7 @@ export const de_CreateExtendedSourceServerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateExtendedSourceServerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1500,50 +1456,6 @@ export const de_CreateExtendedSourceServerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateExtendedSourceServerCommandError - */ -const de_CreateExtendedSourceServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.drs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLaunchConfigurationTemplateCommand */ @@ -1552,7 +1464,7 @@ export const de_CreateLaunchConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateLaunchConfigurationTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1565,47 +1477,6 @@ export const de_CreateLaunchConfigurationTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLaunchConfigurationTemplateCommandError - */ -const de_CreateLaunchConfigurationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.drs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateReplicationConfigurationTemplateCommand */ @@ -1614,7 +1485,7 @@ export const de_CreateReplicationConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateReplicationConfigurationTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1643,47 +1514,6 @@ export const de_CreateReplicationConfigurationTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateReplicationConfigurationTemplateCommandError - */ -const de_CreateReplicationConfigurationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.drs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSourceNetworkCommand */ @@ -1692,7 +1522,7 @@ export const de_CreateSourceNetworkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSourceNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1706,58 +1536,31 @@ export const de_CreateSourceNetworkCommand = async ( }; /** - * deserializeAws_restJson1CreateSourceNetworkCommandError + * deserializeAws_restJson1DeleteJobCommand */ -const de_CreateSourceNetworkCommandError = async ( +export const de_DeleteJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.drs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteJobCommand + * deserializeAws_restJson1DeleteLaunchActionCommand */ -export const de_DeleteJobCommand = async ( +export const de_DeleteLaunchActionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1767,52 +1570,31 @@ export const de_DeleteJobCommand = async ( }; /** - * deserializeAws_restJson1DeleteJobCommandError + * deserializeAws_restJson1DeleteLaunchConfigurationTemplateCommand */ -const de_DeleteJobCommandError = async ( +export const de_DeleteLaunchConfigurationTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteLaunchActionCommand + * deserializeAws_restJson1DeleteRecoveryInstanceCommand */ -export const de_DeleteLaunchActionCommand = async ( +export const de_DeleteRecoveryInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteLaunchActionCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1822,1183 +1604,48 @@ export const de_DeleteLaunchActionCommand = async ( }; /** - * deserializeAws_restJson1DeleteLaunchActionCommandError + * deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommand */ -const de_DeleteLaunchActionCommandError = async ( +export const de_DeleteReplicationConfigurationTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteLaunchConfigurationTemplateCommand - */ -export const de_DeleteLaunchConfigurationTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteLaunchConfigurationTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteLaunchConfigurationTemplateCommandError - */ -const de_DeleteLaunchConfigurationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRecoveryInstanceCommand - */ -export const de_DeleteRecoveryInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRecoveryInstanceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRecoveryInstanceCommandError - */ -const de_DeleteRecoveryInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommand - */ -export const de_DeleteReplicationConfigurationTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteReplicationConfigurationTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommandError - */ -const de_DeleteReplicationConfigurationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSourceNetworkCommand - */ -export const de_DeleteSourceNetworkCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSourceNetworkCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSourceNetworkCommandError - */ -const de_DeleteSourceNetworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSourceServerCommand - */ -export const de_DeleteSourceServerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSourceServerCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSourceServerCommandError - */ -const de_DeleteSourceServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeJobLogItemsCommand - */ -export const de_DescribeJobLogItemsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobLogItemsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - items: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeJobLogItemsCommandError - */ -const de_DescribeJobLogItemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeJobsCommand - */ -export const de_DescribeJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - items: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeJobsCommandError - */ -const de_DescribeJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeLaunchConfigurationTemplatesCommand - */ -export const de_DescribeLaunchConfigurationTemplatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeLaunchConfigurationTemplatesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - items: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeLaunchConfigurationTemplatesCommandError - */ -const de_DescribeLaunchConfigurationTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeRecoveryInstancesCommand - */ -export const de_DescribeRecoveryInstancesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRecoveryInstancesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - items: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeRecoveryInstancesCommandError - */ -const de_DescribeRecoveryInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeRecoverySnapshotsCommand - */ -export const de_DescribeRecoverySnapshotsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRecoverySnapshotsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - items: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeRecoverySnapshotsCommandError - */ -const de_DescribeRecoverySnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommand - */ -export const de_DescribeReplicationConfigurationTemplatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeReplicationConfigurationTemplatesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - items: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommandError - */ -const de_DescribeReplicationConfigurationTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeSourceNetworksCommand - */ -export const de_DescribeSourceNetworksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSourceNetworksCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - items: (_) => de_SourceNetworksList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeSourceNetworksCommandError - */ -const de_DescribeSourceNetworksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeSourceServersCommand - */ -export const de_DescribeSourceServersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSourceServersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - items: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeSourceServersCommandError - */ -const de_DescribeSourceServersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisconnectRecoveryInstanceCommand - */ -export const de_DisconnectRecoveryInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisconnectRecoveryInstanceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisconnectRecoveryInstanceCommandError - */ -const de_DisconnectRecoveryInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisconnectSourceServerCommand - */ -export const de_DisconnectSourceServerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisconnectSourceServerCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - agentVersion: __expectString, - arn: __expectString, - dataReplicationInfo: _json, - lastLaunchResult: __expectString, - lifeCycle: _json, - recoveryInstanceId: __expectString, - replicationDirection: __expectString, - reversedDirectionSourceServerArn: __expectString, - sourceCloudProperties: _json, - sourceNetworkID: __expectString, - sourceProperties: _json, - sourceServerID: __expectString, - stagingArea: _json, - tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DisconnectSourceServerCommandError - */ -const de_DisconnectSourceServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ExportSourceNetworkCfnTemplateCommand - */ -export const de_ExportSourceNetworkCfnTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExportSourceNetworkCfnTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - s3DestinationUrl: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ExportSourceNetworkCfnTemplateCommandError - */ -const de_ExportSourceNetworkCfnTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFailbackReplicationConfigurationCommand - */ -export const de_GetFailbackReplicationConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFailbackReplicationConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - bandwidthThrottling: __expectLong, - name: __expectString, - recoveryInstanceID: __expectString, - usePrivateIP: __expectBoolean, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFailbackReplicationConfigurationCommandError - */ -const de_GetFailbackReplicationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetLaunchConfigurationCommand - */ -export const de_GetLaunchConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLaunchConfigurationCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - copyPrivateIp: __expectBoolean, - copyTags: __expectBoolean, - ec2LaunchTemplateID: __expectString, - launchDisposition: __expectString, - launchIntoInstanceProperties: _json, - licensing: _json, - name: __expectString, - postLaunchEnabled: __expectBoolean, - sourceServerID: __expectString, - targetInstanceTypeRightSizingMethod: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1GetLaunchConfigurationCommandError - */ -const de_GetLaunchConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetReplicationConfigurationCommand + * deserializeAws_restJson1DeleteSourceNetworkCommand */ -export const de_GetReplicationConfigurationCommand = async ( +export const de_DeleteSourceNetworkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReplicationConfigurationCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - associateDefaultSecurityGroup: __expectBoolean, - autoReplicateNewDisks: __expectBoolean, - bandwidthThrottling: __expectLong, - createPublicIP: __expectBoolean, - dataPlaneRouting: __expectString, - defaultLargeStagingDiskType: __expectString, - ebsEncryption: __expectString, - ebsEncryptionKeyArn: __expectString, - name: __expectString, - pitPolicy: _json, - replicatedDisks: _json, - replicationServerInstanceType: __expectString, - replicationServersSecurityGroupsIDs: _json, - sourceServerID: __expectString, - stagingAreaSubnetId: __expectString, - stagingAreaTags: _json, - useDedicatedReplicationServer: __expectBoolean, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1GetReplicationConfigurationCommandError - */ -const de_GetReplicationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1InitializeServiceCommand + * deserializeAws_restJson1DeleteSourceServerCommand */ -export const de_InitializeServiceCommand = async ( +export const de_DeleteSourceServerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_InitializeServiceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3008,49 +1655,14 @@ export const de_InitializeServiceCommand = async ( }; /** - * deserializeAws_restJson1InitializeServiceCommandError - */ -const de_InitializeServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListExtensibleSourceServersCommand + * deserializeAws_restJson1DescribeJobLogItemsCommand */ -export const de_ListExtensibleSourceServersCommand = async ( +export const de_DescribeJobLogItemsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListExtensibleSourceServersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3065,52 +1677,14 @@ export const de_ListExtensibleSourceServersCommand = async ( }; /** - * deserializeAws_restJson1ListExtensibleSourceServersCommandError - */ -const de_ListExtensibleSourceServersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListLaunchActionsCommand + * deserializeAws_restJson1DescribeJobsCommand */ -export const de_ListLaunchActionsCommand = async ( +export const de_DescribeJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLaunchActionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3125,59 +1699,43 @@ export const de_ListLaunchActionsCommand = async ( }; /** - * deserializeAws_restJson1ListLaunchActionsCommandError + * deserializeAws_restJson1DescribeLaunchConfigurationTemplatesCommand */ -const de_ListLaunchActionsCommandError = async ( +export const de_DescribeLaunchConfigurationTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.drs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListStagingAccountsCommand + * deserializeAws_restJson1DescribeRecoveryInstancesCommand */ -export const de_ListStagingAccountsCommand = async ( +export const de_DescribeRecoveryInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStagingAccountsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - accounts: _json, + items: _json, nextToken: __expectString, }); Object.assign(contents, doc); @@ -3185,184 +1743,119 @@ export const de_ListStagingAccountsCommand = async ( }; /** - * deserializeAws_restJson1ListStagingAccountsCommandError + * deserializeAws_restJson1DescribeRecoverySnapshotsCommand */ -const de_ListStagingAccountsCommandError = async ( +export const de_DescribeRecoverySnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_DescribeReplicationConfigurationTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + items: _json, + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1DescribeSourceNetworksCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_DescribeSourceNetworksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: (_) => de_SourceNetworksList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutLaunchActionCommand + * deserializeAws_restJson1DescribeSourceServersCommand */ -export const de_PutLaunchActionCommand = async ( +export const de_DescribeSourceServersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutLaunchActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - actionCode: __expectString, - actionId: __expectString, - actionVersion: __expectString, - active: __expectBoolean, - category: __expectString, - description: __expectString, - name: __expectString, - optional: __expectBoolean, - order: __expectInt32, - parameters: _json, - resourceId: __expectString, - type: __expectString, + items: _json, + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutLaunchActionCommandError + * deserializeAws_restJson1DisconnectRecoveryInstanceCommand */ -const de_PutLaunchActionCommandError = async ( +export const de_DisconnectRecoveryInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1RetryDataReplicationCommand + * deserializeAws_restJson1DisconnectSourceServerCommand */ -export const de_RetryDataReplicationCommand = async ( +export const de_DisconnectSourceServerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RetryDataReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3389,470 +1882,359 @@ export const de_RetryDataReplicationCommand = async ( }; /** - * deserializeAws_restJson1RetryDataReplicationCommandError - */ -const de_RetryDataReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ReverseReplicationCommand + * deserializeAws_restJson1ExportSourceNetworkCfnTemplateCommand */ -export const de_ReverseReplicationCommand = async ( +export const de_ExportSourceNetworkCfnTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ReverseReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - reversedDirectionSourceServerArn: __expectString, + s3DestinationUrl: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ReverseReplicationCommandError + * deserializeAws_restJson1GetFailbackReplicationConfigurationCommand */ -const de_ReverseReplicationCommandError = async ( +export const de_GetFailbackReplicationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + bandwidthThrottling: __expectLong, + name: __expectString, + recoveryInstanceID: __expectString, + usePrivateIP: __expectBoolean, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartFailbackLaunchCommand + * deserializeAws_restJson1GetLaunchConfigurationCommand */ -export const de_StartFailbackLaunchCommand = async ( +export const de_GetLaunchConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartFailbackLaunchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - job: _json, + copyPrivateIp: __expectBoolean, + copyTags: __expectBoolean, + ec2LaunchTemplateID: __expectString, + launchDisposition: __expectString, + launchIntoInstanceProperties: _json, + licensing: _json, + name: __expectString, + postLaunchEnabled: __expectBoolean, + sourceServerID: __expectString, + targetInstanceTypeRightSizingMethod: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartFailbackLaunchCommandError + * deserializeAws_restJson1GetReplicationConfigurationCommand */ -const de_StartFailbackLaunchCommandError = async ( +export const de_GetReplicationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.drs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + associateDefaultSecurityGroup: __expectBoolean, + autoReplicateNewDisks: __expectBoolean, + bandwidthThrottling: __expectLong, + createPublicIP: __expectBoolean, + dataPlaneRouting: __expectString, + defaultLargeStagingDiskType: __expectString, + ebsEncryption: __expectString, + ebsEncryptionKeyArn: __expectString, + name: __expectString, + pitPolicy: _json, + replicatedDisks: _json, + replicationServerInstanceType: __expectString, + replicationServersSecurityGroupsIDs: _json, + sourceServerID: __expectString, + stagingAreaSubnetId: __expectString, + stagingAreaTags: _json, + useDedicatedReplicationServer: __expectBoolean, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartRecoveryCommand + * deserializeAws_restJson1InitializeServiceCommand */ -export const de_StartRecoveryCommand = async ( +export const de_InitializeServiceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartRecoveryCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - job: _json, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1StartRecoveryCommandError + * deserializeAws_restJson1ListExtensibleSourceServersCommand */ -const de_StartRecoveryCommandError = async ( +export const de_ListExtensibleSourceServersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.drs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartReplicationCommand + * deserializeAws_restJson1ListLaunchActionsCommand */ -export const de_StartReplicationCommand = async ( +export const de_ListLaunchActionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - sourceServer: _json, + items: _json, + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartReplicationCommandError + * deserializeAws_restJson1ListStagingAccountsCommand */ -const de_StartReplicationCommandError = async ( +export const de_ListStagingAccountsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + accounts: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartSourceNetworkRecoveryCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_StartSourceNetworkRecoveryCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartSourceNetworkRecoveryCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - job: _json, + tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartSourceNetworkRecoveryCommandError + * deserializeAws_restJson1PutLaunchActionCommand */ -const de_StartSourceNetworkRecoveryCommandError = async ( +export const de_PutLaunchActionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.drs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + actionCode: __expectString, + actionId: __expectString, + actionVersion: __expectString, + active: __expectBoolean, + category: __expectString, + description: __expectString, + name: __expectString, + optional: __expectBoolean, + order: __expectInt32, + parameters: _json, + resourceId: __expectString, + type: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartSourceNetworkReplicationCommand + * deserializeAws_restJson1RetryDataReplicationCommand */ -export const de_StartSourceNetworkReplicationCommand = async ( +export const de_RetryDataReplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartSourceNetworkReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - sourceNetwork: (_) => de_SourceNetwork(_, context), + agentVersion: __expectString, + arn: __expectString, + dataReplicationInfo: _json, + lastLaunchResult: __expectString, + lifeCycle: _json, + recoveryInstanceId: __expectString, + replicationDirection: __expectString, + reversedDirectionSourceServerArn: __expectString, + sourceCloudProperties: _json, + sourceNetworkID: __expectString, + sourceProperties: _json, + sourceServerID: __expectString, + stagingArea: _json, + tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartSourceNetworkReplicationCommandError + * deserializeAws_restJson1ReverseReplicationCommand */ -const de_StartSourceNetworkReplicationCommandError = async ( +export const de_ReverseReplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + reversedDirectionSourceServerArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StopFailbackCommand + * deserializeAws_restJson1StartFailbackLaunchCommand */ -export const de_StopFailbackCommand = async ( +export const de_StartFailbackLaunchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopFailbackCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + job: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StopFailbackCommandError + * deserializeAws_restJson1StartRecoveryCommand */ -const de_StopFailbackCommandError = async ( +export const de_StartRecoveryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + job: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StopReplicationCommand + * deserializeAws_restJson1StartReplicationCommand */ -export const de_StopReplicationCommand = async ( +export const de_StartReplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3866,52 +2248,35 @@ export const de_StopReplicationCommand = async ( }; /** - * deserializeAws_restJson1StopReplicationCommandError + * deserializeAws_restJson1StartSourceNetworkRecoveryCommand */ -const de_StopReplicationCommandError = async ( +export const de_StartSourceNetworkRecoveryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + job: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StopSourceNetworkReplicationCommand + * deserializeAws_restJson1StartSourceNetworkReplicationCommand */ -export const de_StopSourceNetworkReplicationCommand = async ( +export const de_StartSourceNetworkReplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopSourceNetworkReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3925,55 +2290,14 @@ export const de_StopSourceNetworkReplicationCommand = async ( }; /** - * deserializeAws_restJson1StopSourceNetworkReplicationCommandError - */ -const de_StopSourceNetworkReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1StopFailbackCommand */ -export const de_TagResourceCommand = async ( +export const de_StopFailbackCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3983,155 +2307,100 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1StopReplicationCommand */ -const de_TagResourceCommandError = async ( +export const de_StopReplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + sourceServer: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TerminateRecoveryInstancesCommand + * deserializeAws_restJson1StopSourceNetworkReplicationCommand */ -export const de_TerminateRecoveryInstancesCommand = async ( +export const de_StopSourceNetworkReplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TerminateRecoveryInstancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - job: _json, + sourceNetwork: (_) => de_SourceNetwork(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TerminateRecoveryInstancesCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_TerminateRecoveryInstancesCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.drs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1TerminateRecoveryInstancesCommand */ -export const de_UntagResourceCommand = async ( +export const de_TerminateRecoveryInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + job: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -4142,7 +2411,7 @@ export const de_UpdateFailbackReplicationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFailbackReplicationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4151,44 +2420,6 @@ export const de_UpdateFailbackReplicationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFailbackReplicationConfigurationCommandError - */ -const de_UpdateFailbackReplicationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLaunchConfigurationCommand */ @@ -4197,7 +2428,7 @@ export const de_UpdateLaunchConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLaunchConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4219,47 +2450,6 @@ export const de_UpdateLaunchConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLaunchConfigurationCommandError - */ -const de_UpdateLaunchConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLaunchConfigurationTemplateCommand */ @@ -4268,7 +2458,7 @@ export const de_UpdateLaunchConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLaunchConfigurationTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4281,47 +2471,6 @@ export const de_UpdateLaunchConfigurationTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLaunchConfigurationTemplateCommandError - */ -const de_UpdateLaunchConfigurationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateReplicationConfigurationCommand */ @@ -4330,7 +2479,7 @@ export const de_UpdateReplicationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateReplicationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4359,50 +2508,6 @@ export const de_UpdateReplicationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateReplicationConfigurationCommandError - */ -const de_UpdateReplicationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.drs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.drs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.drs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.drs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.drs#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.drs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommand */ @@ -4411,7 +2516,7 @@ export const de_UpdateReplicationConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateReplicationConfigurationTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4441,27 +2546,27 @@ export const de_UpdateReplicationConfigurationTemplateCommand = async ( }; /** - * deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateReplicationConfigurationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.drs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.drs#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.drs#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.drs#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.drs#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.drs#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -4471,13 +2576,16 @@ const de_UpdateReplicationConfigurationTemplateCommandError = async ( case "ValidationException": case "com.amazonaws.drs#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.drs#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts b/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts index ef3cabb6b6af..2639e39035d5 100644 --- a/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts +++ b/clients/client-dynamodb-streams/src/protocols/Aws_json1_0.ts @@ -104,7 +104,7 @@ export const de_DescribeStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStreamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -116,35 +116,6 @@ export const de_DescribeStreamCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeStreamCommandError - */ -const de_DescribeStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodbstreams#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodbstreams#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetRecordsCommand */ @@ -153,7 +124,7 @@ export const de_GetRecordsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRecordsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -165,44 +136,6 @@ export const de_GetRecordsCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetRecordsCommandError - */ -const de_GetRecordsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExpiredIteratorException": - case "com.amazonaws.dynamodbstreams#ExpiredIteratorException": - throw await de_ExpiredIteratorExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodbstreams#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodbstreams#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodbstreams#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TrimmedDataAccessException": - case "com.amazonaws.dynamodbstreams#TrimmedDataAccessException": - throw await de_TrimmedDataAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetShardIteratorCommand */ @@ -211,7 +144,7 @@ export const de_GetShardIteratorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetShardIteratorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -223,38 +156,6 @@ export const de_GetShardIteratorCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetShardIteratorCommandError - */ -const de_GetShardIteratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodbstreams#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodbstreams#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TrimmedDataAccessException": - case "com.amazonaws.dynamodbstreams#TrimmedDataAccessException": - throw await de_TrimmedDataAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListStreamsCommand */ @@ -263,7 +164,7 @@ export const de_ListStreamsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStreamsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -276,12 +177,9 @@ export const de_ListStreamsCommand = async ( }; /** - * deserializeAws_json1_0ListStreamsCommandError + * deserialize_Aws_json1_0CommandError */ -const de_ListStreamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -294,13 +192,22 @@ const de_ListStreamsCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.dynamodbstreams#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ExpiredIteratorException": + case "com.amazonaws.dynamodbstreams#ExpiredIteratorException": + throw await de_ExpiredIteratorExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.dynamodbstreams#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "TrimmedDataAccessException": + case "com.amazonaws.dynamodbstreams#TrimmedDataAccessException": + throw await de_TrimmedDataAccessExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-dynamodb/src/protocols/Aws_json1_0.ts b/clients/client-dynamodb/src/protocols/Aws_json1_0.ts index c6af5a715484..3e11586e84c1 100644 --- a/clients/client-dynamodb/src/protocols/Aws_json1_0.ts +++ b/clients/client-dynamodb/src/protocols/Aws_json1_0.ts @@ -1057,7 +1057,7 @@ export const de_BatchExecuteStatementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchExecuteStatementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1069,35 +1069,6 @@ export const de_BatchExecuteStatementCommand = async ( return response; }; -/** - * deserializeAws_json1_0BatchExecuteStatementCommandError - */ -const de_BatchExecuteStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "RequestLimitExceeded": - case "com.amazonaws.dynamodb#RequestLimitExceeded": - throw await de_RequestLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0BatchGetItemCommand */ @@ -1106,7 +1077,7 @@ export const de_BatchGetItemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetItemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1118,44 +1089,6 @@ export const de_BatchGetItemCommand = async ( return response; }; -/** - * deserializeAws_json1_0BatchGetItemCommandError - */ -const de_BatchGetItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.dynamodb#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "RequestLimitExceeded": - case "com.amazonaws.dynamodb#RequestLimitExceeded": - throw await de_RequestLimitExceededRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0BatchWriteItemCommand */ @@ -1164,7 +1097,7 @@ export const de_BatchWriteItemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchWriteItemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1176,47 +1109,6 @@ export const de_BatchWriteItemCommand = async ( return response; }; -/** - * deserializeAws_json1_0BatchWriteItemCommandError - */ -const de_BatchWriteItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ItemCollectionSizeLimitExceededException": - case "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException": - throw await de_ItemCollectionSizeLimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.dynamodb#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "RequestLimitExceeded": - case "com.amazonaws.dynamodb#RequestLimitExceeded": - throw await de_RequestLimitExceededRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateBackupCommand */ @@ -1225,7 +1117,7 @@ export const de_CreateBackupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBackupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1237,50 +1129,6 @@ export const de_CreateBackupCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateBackupCommandError - */ -const de_CreateBackupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BackupInUseException": - case "com.amazonaws.dynamodb#BackupInUseException": - throw await de_BackupInUseExceptionRes(parsedOutput, context); - case "ContinuousBackupsUnavailableException": - case "com.amazonaws.dynamodb#ContinuousBackupsUnavailableException": - throw await de_ContinuousBackupsUnavailableExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TableInUseException": - case "com.amazonaws.dynamodb#TableInUseException": - throw await de_TableInUseExceptionRes(parsedOutput, context); - case "TableNotFoundException": - case "com.amazonaws.dynamodb#TableNotFoundException": - throw await de_TableNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateGlobalTableCommand */ @@ -1289,7 +1137,7 @@ export const de_CreateGlobalTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateGlobalTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1301,44 +1149,6 @@ export const de_CreateGlobalTableCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateGlobalTableCommandError - */ -const de_CreateGlobalTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalTableAlreadyExistsException": - case "com.amazonaws.dynamodb#GlobalTableAlreadyExistsException": - throw await de_GlobalTableAlreadyExistsExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TableNotFoundException": - case "com.amazonaws.dynamodb#TableNotFoundException": - throw await de_TableNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateTableCommand */ @@ -1347,7 +1157,7 @@ export const de_CreateTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1359,41 +1169,6 @@ export const de_CreateTableCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateTableCommandError - */ -const de_CreateTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.dynamodb#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteBackupCommand */ @@ -1402,7 +1177,7 @@ export const de_DeleteBackupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteBackupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1414,44 +1189,6 @@ export const de_DeleteBackupCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteBackupCommandError - */ -const de_DeleteBackupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BackupInUseException": - case "com.amazonaws.dynamodb#BackupInUseException": - throw await de_BackupInUseExceptionRes(parsedOutput, context); - case "BackupNotFoundException": - case "com.amazonaws.dynamodb#BackupNotFoundException": - throw await de_BackupNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteItemCommand */ @@ -1460,7 +1197,7 @@ export const de_DeleteItemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteItemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1473,61 +1210,14 @@ export const de_DeleteItemCommand = async ( }; /** - * deserializeAws_json1_0DeleteItemCommandError + * deserializeAws_json1_0DeleteTableCommand */ -const de_DeleteItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConditionalCheckFailedException": - case "com.amazonaws.dynamodb#ConditionalCheckFailedException": - throw await de_ConditionalCheckFailedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ItemCollectionSizeLimitExceededException": - case "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException": - throw await de_ItemCollectionSizeLimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.dynamodb#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "RequestLimitExceeded": - case "com.amazonaws.dynamodb#RequestLimitExceeded": - throw await de_RequestLimitExceededRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TransactionConflictException": - case "com.amazonaws.dynamodb#TransactionConflictException": - throw await de_TransactionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteTableCommand - */ -export const de_DeleteTableCommand = async ( +export const de_DeleteTableCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1539,44 +1229,6 @@ export const de_DeleteTableCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteTableCommandError - */ -const de_DeleteTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.dynamodb#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeBackupCommand */ @@ -1585,7 +1237,7 @@ export const de_DescribeBackupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBackupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1597,38 +1249,6 @@ export const de_DescribeBackupCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeBackupCommandError - */ -const de_DescribeBackupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BackupNotFoundException": - case "com.amazonaws.dynamodb#BackupNotFoundException": - throw await de_BackupNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeContinuousBackupsCommand */ @@ -1637,7 +1257,7 @@ export const de_DescribeContinuousBackupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeContinuousBackupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1649,38 +1269,6 @@ export const de_DescribeContinuousBackupsCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeContinuousBackupsCommandError - */ -const de_DescribeContinuousBackupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "TableNotFoundException": - case "com.amazonaws.dynamodb#TableNotFoundException": - throw await de_TableNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeContributorInsightsCommand */ @@ -1689,7 +1277,7 @@ export const de_DescribeContributorInsightsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeContributorInsightsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1701,35 +1289,6 @@ export const de_DescribeContributorInsightsCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeContributorInsightsCommandError - */ -const de_DescribeContributorInsightsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeEndpointsCommand */ @@ -1738,7 +1297,7 @@ export const de_DescribeEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1750,26 +1309,6 @@ export const de_DescribeEndpointsCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeEndpointsCommandError - */ -const de_DescribeEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_0DescribeExportCommand */ @@ -1778,7 +1317,7 @@ export const de_DescribeExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeExportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1790,38 +1329,6 @@ export const de_DescribeExportCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeExportCommandError - */ -const de_DescribeExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExportNotFoundException": - case "com.amazonaws.dynamodb#ExportNotFoundException": - throw await de_ExportNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeGlobalTableCommand */ @@ -1830,7 +1337,7 @@ export const de_DescribeGlobalTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeGlobalTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1842,38 +1349,6 @@ export const de_DescribeGlobalTableCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeGlobalTableCommandError - */ -const de_DescribeGlobalTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalTableNotFoundException": - case "com.amazonaws.dynamodb#GlobalTableNotFoundException": - throw await de_GlobalTableNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeGlobalTableSettingsCommand */ @@ -1882,7 +1357,7 @@ export const de_DescribeGlobalTableSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeGlobalTableSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1894,38 +1369,6 @@ export const de_DescribeGlobalTableSettingsCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeGlobalTableSettingsCommandError - */ -const de_DescribeGlobalTableSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalTableNotFoundException": - case "com.amazonaws.dynamodb#GlobalTableNotFoundException": - throw await de_GlobalTableNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeImportCommand */ @@ -1934,7 +1377,7 @@ export const de_DescribeImportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeImportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1947,40 +1390,14 @@ export const de_DescribeImportCommand = async ( }; /** - * deserializeAws_json1_0DescribeImportCommandError + * deserializeAws_json1_0DescribeKinesisStreamingDestinationCommand */ -const de_DescribeImportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImportNotFoundException": - case "com.amazonaws.dynamodb#ImportNotFoundException": - throw await de_ImportNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeKinesisStreamingDestinationCommand - */ -export const de_DescribeKinesisStreamingDestinationCommand = async ( +export const de_DescribeKinesisStreamingDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeKinesisStreamingDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1992,38 +1409,6 @@ export const de_DescribeKinesisStreamingDestinationCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeKinesisStreamingDestinationCommandError - */ -const de_DescribeKinesisStreamingDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeLimitsCommand */ @@ -2032,7 +1417,7 @@ export const de_DescribeLimitsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLimitsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2044,35 +1429,6 @@ export const de_DescribeLimitsCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeLimitsCommandError - */ -const de_DescribeLimitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeTableCommand */ @@ -2081,7 +1437,7 @@ export const de_DescribeTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2093,38 +1449,6 @@ export const de_DescribeTableCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeTableCommandError - */ -const de_DescribeTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeTableReplicaAutoScalingCommand */ @@ -2133,7 +1457,7 @@ export const de_DescribeTableReplicaAutoScalingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTableReplicaAutoScalingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2145,35 +1469,6 @@ export const de_DescribeTableReplicaAutoScalingCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeTableReplicaAutoScalingCommandError - */ -const de_DescribeTableReplicaAutoScalingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeTimeToLiveCommand */ @@ -2182,7 +1477,7 @@ export const de_DescribeTimeToLiveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTimeToLiveCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2194,38 +1489,6 @@ export const de_DescribeTimeToLiveCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeTimeToLiveCommandError - */ -const de_DescribeTimeToLiveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DisableKinesisStreamingDestinationCommand */ @@ -2234,7 +1497,7 @@ export const de_DisableKinesisStreamingDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableKinesisStreamingDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2246,44 +1509,6 @@ export const de_DisableKinesisStreamingDestinationCommand = async ( return response; }; -/** - * deserializeAws_json1_0DisableKinesisStreamingDestinationCommandError - */ -const de_DisableKinesisStreamingDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.dynamodb#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0EnableKinesisStreamingDestinationCommand */ @@ -2292,7 +1517,7 @@ export const de_EnableKinesisStreamingDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableKinesisStreamingDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2305,57 +1530,39 @@ export const de_EnableKinesisStreamingDestinationCommand = async ( }; /** - * deserializeAws_json1_0EnableKinesisStreamingDestinationCommandError + * deserializeAws_json1_0ExecuteStatementCommand */ -const de_EnableKinesisStreamingDestinationCommandError = async ( +export const de_ExecuteStatementCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.dynamodb#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ExecuteStatementOutput(data, context); + const response: ExecuteStatementCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ExecuteStatementCommand + * deserializeAws_json1_0ExecuteTransactionCommand */ -export const de_ExecuteStatementCommand = async ( +export const de_ExecuteTransactionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ExecuteStatementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ExecuteStatementOutput(data, context); - const response: ExecuteStatementCommandOutput = { + contents = de_ExecuteTransactionOutput(data, context); + const response: ExecuteTransactionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2363,125 +1570,14 @@ export const de_ExecuteStatementCommand = async ( }; /** - * deserializeAws_json1_0ExecuteStatementCommandError + * deserializeAws_json1_0ExportTableToPointInTimeCommand */ -const de_ExecuteStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConditionalCheckFailedException": - case "com.amazonaws.dynamodb#ConditionalCheckFailedException": - throw await de_ConditionalCheckFailedExceptionRes(parsedOutput, context); - case "DuplicateItemException": - case "com.amazonaws.dynamodb#DuplicateItemException": - throw await de_DuplicateItemExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ItemCollectionSizeLimitExceededException": - case "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException": - throw await de_ItemCollectionSizeLimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.dynamodb#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "RequestLimitExceeded": - case "com.amazonaws.dynamodb#RequestLimitExceeded": - throw await de_RequestLimitExceededRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TransactionConflictException": - case "com.amazonaws.dynamodb#TransactionConflictException": - throw await de_TransactionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ExecuteTransactionCommand - */ -export const de_ExecuteTransactionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ExecuteTransactionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ExecuteTransactionOutput(data, context); - const response: ExecuteTransactionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ExecuteTransactionCommandError - */ -const de_ExecuteTransactionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.dynamodb#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.dynamodb#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "RequestLimitExceeded": - case "com.amazonaws.dynamodb#RequestLimitExceeded": - throw await de_RequestLimitExceededRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TransactionCanceledException": - case "com.amazonaws.dynamodb#TransactionCanceledException": - throw await de_TransactionCanceledExceptionRes(parsedOutput, context); - case "TransactionInProgressException": - case "com.amazonaws.dynamodb#TransactionInProgressException": - throw await de_TransactionInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ExportTableToPointInTimeCommand - */ -export const de_ExportTableToPointInTimeCommand = async ( +export const de_ExportTableToPointInTimeCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExportTableToPointInTimeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2493,47 +1589,6 @@ export const de_ExportTableToPointInTimeCommand = async ( return response; }; -/** - * deserializeAws_json1_0ExportTableToPointInTimeCommandError - */ -const de_ExportTableToPointInTimeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExportConflictException": - case "com.amazonaws.dynamodb#ExportConflictException": - throw await de_ExportConflictExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidExportTimeException": - case "com.amazonaws.dynamodb#InvalidExportTimeException": - throw await de_InvalidExportTimeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PointInTimeRecoveryUnavailableException": - case "com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException": - throw await de_PointInTimeRecoveryUnavailableExceptionRes(parsedOutput, context); - case "TableNotFoundException": - case "com.amazonaws.dynamodb#TableNotFoundException": - throw await de_TableNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetItemCommand */ @@ -2542,7 +1597,7 @@ export const de_GetItemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetItemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2554,44 +1609,6 @@ export const de_GetItemCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetItemCommandError - */ -const de_GetItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.dynamodb#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "RequestLimitExceeded": - case "com.amazonaws.dynamodb#RequestLimitExceeded": - throw await de_RequestLimitExceededRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ImportTableCommand */ @@ -2600,7 +1617,7 @@ export const de_ImportTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2612,38 +1629,6 @@ export const de_ImportTableCommand = async ( return response; }; -/** - * deserializeAws_json1_0ImportTableCommandError - */ -const de_ImportTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImportConflictException": - case "com.amazonaws.dynamodb#ImportConflictException": - throw await de_ImportConflictExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.dynamodb#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListBackupsCommand */ @@ -2652,7 +1637,7 @@ export const de_ListBackupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListBackupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2664,35 +1649,6 @@ export const de_ListBackupsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListBackupsCommandError - */ -const de_ListBackupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListContributorInsightsCommand */ @@ -2701,7 +1657,7 @@ export const de_ListContributorInsightsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListContributorInsightsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2713,35 +1669,6 @@ export const de_ListContributorInsightsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListContributorInsightsCommandError - */ -const de_ListContributorInsightsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListExportsCommand */ @@ -2750,7 +1677,7 @@ export const de_ListExportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListExportsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2763,43 +1690,14 @@ export const de_ListExportsCommand = async ( }; /** - * deserializeAws_json1_0ListExportsCommandError + * deserializeAws_json1_0ListGlobalTablesCommand */ -const de_ListExportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListGlobalTablesCommand - */ -export const de_ListGlobalTablesCommand = async ( +export const de_ListGlobalTablesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListGlobalTablesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2811,35 +1709,6 @@ export const de_ListGlobalTablesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListGlobalTablesCommandError - */ -const de_ListGlobalTablesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListImportsCommand */ @@ -2848,7 +1717,7 @@ export const de_ListImportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListImportsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2860,32 +1729,6 @@ export const de_ListImportsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListImportsCommandError - */ -const de_ListImportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListTablesCommand */ @@ -2894,7 +1737,7 @@ export const de_ListTablesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTablesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2906,35 +1749,6 @@ export const de_ListTablesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListTablesCommandError - */ -const de_ListTablesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListTagsOfResourceCommand */ @@ -2943,7 +1757,7 @@ export const de_ListTagsOfResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsOfResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2955,38 +1769,6 @@ export const de_ListTagsOfResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListTagsOfResourceCommandError - */ -const de_ListTagsOfResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0PutItemCommand */ @@ -2995,7 +1777,7 @@ export const de_PutItemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutItemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3007,59 +1789,12 @@ export const de_PutItemCommand = async ( return response; }; -/** - * deserializeAws_json1_0PutItemCommandError - */ -const de_PutItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConditionalCheckFailedException": - case "com.amazonaws.dynamodb#ConditionalCheckFailedException": - throw await de_ConditionalCheckFailedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ItemCollectionSizeLimitExceededException": - case "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException": - throw await de_ItemCollectionSizeLimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.dynamodb#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "RequestLimitExceeded": - case "com.amazonaws.dynamodb#RequestLimitExceeded": - throw await de_RequestLimitExceededRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TransactionConflictException": - case "com.amazonaws.dynamodb#TransactionConflictException": - throw await de_TransactionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0QueryCommand */ export const de_QueryCommand = async (output: __HttpResponse, context: __SerdeContext): Promise => { if (output.statusCode >= 300) { - return de_QueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3071,41 +1806,6 @@ export const de_QueryCommand = async (output: __HttpResponse, context: __SerdeCo return response; }; -/** - * deserializeAws_json1_0QueryCommandError - */ -const de_QueryCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.dynamodb#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "RequestLimitExceeded": - case "com.amazonaws.dynamodb#RequestLimitExceeded": - throw await de_RequestLimitExceededRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0RestoreTableFromBackupCommand */ @@ -3114,7 +1814,7 @@ export const de_RestoreTableFromBackupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreTableFromBackupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3126,50 +1826,6 @@ export const de_RestoreTableFromBackupCommand = async ( return response; }; -/** - * deserializeAws_json1_0RestoreTableFromBackupCommandError - */ -const de_RestoreTableFromBackupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BackupInUseException": - case "com.amazonaws.dynamodb#BackupInUseException": - throw await de_BackupInUseExceptionRes(parsedOutput, context); - case "BackupNotFoundException": - case "com.amazonaws.dynamodb#BackupNotFoundException": - throw await de_BackupNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TableAlreadyExistsException": - case "com.amazonaws.dynamodb#TableAlreadyExistsException": - throw await de_TableAlreadyExistsExceptionRes(parsedOutput, context); - case "TableInUseException": - case "com.amazonaws.dynamodb#TableInUseException": - throw await de_TableInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0RestoreTableToPointInTimeCommand */ @@ -3178,7 +1834,7 @@ export const de_RestoreTableToPointInTimeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreTableToPointInTimeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3191,58 +1847,11 @@ export const de_RestoreTableToPointInTimeCommand = async ( }; /** - * deserializeAws_json1_0RestoreTableToPointInTimeCommandError - */ -const de_RestoreTableToPointInTimeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "InvalidRestoreTimeException": - case "com.amazonaws.dynamodb#InvalidRestoreTimeException": - throw await de_InvalidRestoreTimeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PointInTimeRecoveryUnavailableException": - case "com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException": - throw await de_PointInTimeRecoveryUnavailableExceptionRes(parsedOutput, context); - case "TableAlreadyExistsException": - case "com.amazonaws.dynamodb#TableAlreadyExistsException": - throw await de_TableAlreadyExistsExceptionRes(parsedOutput, context); - case "TableInUseException": - case "com.amazonaws.dynamodb#TableInUseException": - throw await de_TableInUseExceptionRes(parsedOutput, context); - case "TableNotFoundException": - case "com.amazonaws.dynamodb#TableNotFoundException": - throw await de_TableNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ScanCommand + * deserializeAws_json1_0ScanCommand */ export const de_ScanCommand = async (output: __HttpResponse, context: __SerdeContext): Promise => { if (output.statusCode >= 300) { - return de_ScanCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3254,41 +1863,6 @@ export const de_ScanCommand = async (output: __HttpResponse, context: __SerdeCon return response; }; -/** - * deserializeAws_json1_0ScanCommandError - */ -const de_ScanCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.dynamodb#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "RequestLimitExceeded": - case "com.amazonaws.dynamodb#RequestLimitExceeded": - throw await de_RequestLimitExceededRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TagResourceCommand */ @@ -3297,7 +1871,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: TagResourceCommandOutput = { @@ -3306,44 +1880,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.dynamodb#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TransactGetItemsCommand */ @@ -3352,7 +1888,7 @@ export const de_TransactGetItemsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TransactGetItemsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3364,47 +1900,6 @@ export const de_TransactGetItemsCommand = async ( return response; }; -/** - * deserializeAws_json1_0TransactGetItemsCommandError - */ -const de_TransactGetItemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.dynamodb#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "RequestLimitExceeded": - case "com.amazonaws.dynamodb#RequestLimitExceeded": - throw await de_RequestLimitExceededRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TransactionCanceledException": - case "com.amazonaws.dynamodb#TransactionCanceledException": - throw await de_TransactionCanceledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TransactWriteItemsCommand */ @@ -3413,7 +1908,7 @@ export const de_TransactWriteItemsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TransactWriteItemsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3425,53 +1920,6 @@ export const de_TransactWriteItemsCommand = async ( return response; }; -/** - * deserializeAws_json1_0TransactWriteItemsCommandError - */ -const de_TransactWriteItemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.dynamodb#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.dynamodb#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "RequestLimitExceeded": - case "com.amazonaws.dynamodb#RequestLimitExceeded": - throw await de_RequestLimitExceededRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TransactionCanceledException": - case "com.amazonaws.dynamodb#TransactionCanceledException": - throw await de_TransactionCanceledExceptionRes(parsedOutput, context); - case "TransactionInProgressException": - case "com.amazonaws.dynamodb#TransactionInProgressException": - throw await de_TransactionInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UntagResourceCommand */ @@ -3480,7 +1928,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UntagResourceCommandOutput = { @@ -3489,44 +1937,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.dynamodb#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateContinuousBackupsCommand */ @@ -3535,7 +1945,7 @@ export const de_UpdateContinuousBackupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateContinuousBackupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3547,41 +1957,6 @@ export const de_UpdateContinuousBackupsCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateContinuousBackupsCommandError - */ -const de_UpdateContinuousBackupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContinuousBackupsUnavailableException": - case "com.amazonaws.dynamodb#ContinuousBackupsUnavailableException": - throw await de_ContinuousBackupsUnavailableExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "TableNotFoundException": - case "com.amazonaws.dynamodb#TableNotFoundException": - throw await de_TableNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateContributorInsightsCommand */ @@ -3590,7 +1965,7 @@ export const de_UpdateContributorInsightsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateContributorInsightsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3602,35 +1977,6 @@ export const de_UpdateContributorInsightsCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateContributorInsightsCommandError - */ -const de_UpdateContributorInsightsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateGlobalTableCommand */ @@ -3639,137 +1985,32 @@ export const de_UpdateGlobalTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateGlobalTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateGlobalTableOutput(data, context); - const response: UpdateGlobalTableCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0UpdateGlobalTableCommandError - */ -const de_UpdateGlobalTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalTableNotFoundException": - case "com.amazonaws.dynamodb#GlobalTableNotFoundException": - throw await de_GlobalTableNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ReplicaAlreadyExistsException": - case "com.amazonaws.dynamodb#ReplicaAlreadyExistsException": - throw await de_ReplicaAlreadyExistsExceptionRes(parsedOutput, context); - case "ReplicaNotFoundException": - case "com.amazonaws.dynamodb#ReplicaNotFoundException": - throw await de_ReplicaNotFoundExceptionRes(parsedOutput, context); - case "TableNotFoundException": - case "com.amazonaws.dynamodb#TableNotFoundException": - throw await de_TableNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0UpdateGlobalTableSettingsCommand - */ -export const de_UpdateGlobalTableSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateGlobalTableSettingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateGlobalTableSettingsOutput(data, context); - const response: UpdateGlobalTableSettingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0UpdateGlobalTableSettingsCommandError - */ -const de_UpdateGlobalTableSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalTableNotFoundException": - case "com.amazonaws.dynamodb#GlobalTableNotFoundException": - throw await de_GlobalTableNotFoundExceptionRes(parsedOutput, context); - case "IndexNotFoundException": - case "com.amazonaws.dynamodb#IndexNotFoundException": - throw await de_IndexNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ReplicaNotFoundException": - case "com.amazonaws.dynamodb#ReplicaNotFoundException": - throw await de_ReplicaNotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.dynamodb#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + let contents: any = {}; + contents = de_UpdateGlobalTableOutput(data, context); + const response: UpdateGlobalTableCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0UpdateItemCommand + * deserializeAws_json1_0UpdateGlobalTableSettingsCommand */ -export const de_UpdateItemCommand = async ( +export const de_UpdateGlobalTableSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateItemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateItemOutput(data, context); - const response: UpdateItemCommandOutput = { + contents = de_UpdateGlobalTableSettingsOutput(data, context); + const response: UpdateGlobalTableSettingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3777,50 +2018,23 @@ export const de_UpdateItemCommand = async ( }; /** - * deserializeAws_json1_0UpdateItemCommandError + * deserializeAws_json1_0UpdateItemCommand */ -const de_UpdateItemCommandError = async ( +export const de_UpdateItemCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConditionalCheckFailedException": - case "com.amazonaws.dynamodb#ConditionalCheckFailedException": - throw await de_ConditionalCheckFailedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ItemCollectionSizeLimitExceededException": - case "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException": - throw await de_ItemCollectionSizeLimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.dynamodb#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "RequestLimitExceeded": - case "com.amazonaws.dynamodb#RequestLimitExceeded": - throw await de_RequestLimitExceededRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TransactionConflictException": - case "com.amazonaws.dynamodb#TransactionConflictException": - throw await de_TransactionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateItemOutput(data, context); + const response: UpdateItemCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3831,7 +2045,7 @@ export const de_UpdateKinesisStreamingDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateKinesisStreamingDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3843,44 +2057,6 @@ export const de_UpdateKinesisStreamingDestinationCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateKinesisStreamingDestinationCommandError - */ -const de_UpdateKinesisStreamingDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.dynamodb#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateTableCommand */ @@ -3889,7 +2065,7 @@ export const de_UpdateTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3901,44 +2077,6 @@ export const de_UpdateTableCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateTableCommandError - */ -const de_UpdateTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.dynamodb#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.dynamodb#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateTableReplicaAutoScalingCommand */ @@ -3947,7 +2085,7 @@ export const de_UpdateTableReplicaAutoScalingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTableReplicaAutoScalingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3959,41 +2097,6 @@ export const de_UpdateTableReplicaAutoScalingCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateTableReplicaAutoScalingCommandError - */ -const de_UpdateTableReplicaAutoScalingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.dynamodb#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.dynamodb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.dynamodb#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateTimeToLiveCommand */ @@ -4002,7 +2105,7 @@ export const de_UpdateTimeToLiveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTimeToLiveCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4015,12 +2118,9 @@ export const de_UpdateTimeToLiveCommand = async ( }; /** - * deserializeAws_json1_0UpdateTimeToLiveCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateTimeToLiveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4030,25 +2130,106 @@ const de_UpdateTimeToLiveCommandError = async ( case "InternalServerError": case "com.amazonaws.dynamodb#InternalServerError": throw await de_InternalServerErrorRes(parsedOutput, context); + case "RequestLimitExceeded": + case "com.amazonaws.dynamodb#RequestLimitExceeded": + throw await de_RequestLimitExceededRes(parsedOutput, context); case "InvalidEndpointException": case "com.amazonaws.dynamodb#InvalidEndpointException": throw await de_InvalidEndpointExceptionRes(parsedOutput, context); + case "ProvisionedThroughputExceededException": + case "com.amazonaws.dynamodb#ProvisionedThroughputExceededException": + throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.dynamodb#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ItemCollectionSizeLimitExceededException": + case "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException": + throw await de_ItemCollectionSizeLimitExceededExceptionRes(parsedOutput, context); + case "BackupInUseException": + case "com.amazonaws.dynamodb#BackupInUseException": + throw await de_BackupInUseExceptionRes(parsedOutput, context); + case "ContinuousBackupsUnavailableException": + case "com.amazonaws.dynamodb#ContinuousBackupsUnavailableException": + throw await de_ContinuousBackupsUnavailableExceptionRes(parsedOutput, context); case "LimitExceededException": case "com.amazonaws.dynamodb#LimitExceededException": throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "TableInUseException": + case "com.amazonaws.dynamodb#TableInUseException": + throw await de_TableInUseExceptionRes(parsedOutput, context); + case "TableNotFoundException": + case "com.amazonaws.dynamodb#TableNotFoundException": + throw await de_TableNotFoundExceptionRes(parsedOutput, context); + case "GlobalTableAlreadyExistsException": + case "com.amazonaws.dynamodb#GlobalTableAlreadyExistsException": + throw await de_GlobalTableAlreadyExistsExceptionRes(parsedOutput, context); case "ResourceInUseException": case "com.amazonaws.dynamodb#ResourceInUseException": throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.dynamodb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "BackupNotFoundException": + case "com.amazonaws.dynamodb#BackupNotFoundException": + throw await de_BackupNotFoundExceptionRes(parsedOutput, context); + case "ConditionalCheckFailedException": + case "com.amazonaws.dynamodb#ConditionalCheckFailedException": + throw await de_ConditionalCheckFailedExceptionRes(parsedOutput, context); + case "TransactionConflictException": + case "com.amazonaws.dynamodb#TransactionConflictException": + throw await de_TransactionConflictExceptionRes(parsedOutput, context); + case "ExportNotFoundException": + case "com.amazonaws.dynamodb#ExportNotFoundException": + throw await de_ExportNotFoundExceptionRes(parsedOutput, context); + case "GlobalTableNotFoundException": + case "com.amazonaws.dynamodb#GlobalTableNotFoundException": + throw await de_GlobalTableNotFoundExceptionRes(parsedOutput, context); + case "ImportNotFoundException": + case "com.amazonaws.dynamodb#ImportNotFoundException": + throw await de_ImportNotFoundExceptionRes(parsedOutput, context); + case "DuplicateItemException": + case "com.amazonaws.dynamodb#DuplicateItemException": + throw await de_DuplicateItemExceptionRes(parsedOutput, context); + case "IdempotentParameterMismatchException": + case "com.amazonaws.dynamodb#IdempotentParameterMismatchException": + throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); + case "TransactionCanceledException": + case "com.amazonaws.dynamodb#TransactionCanceledException": + throw await de_TransactionCanceledExceptionRes(parsedOutput, context); + case "TransactionInProgressException": + case "com.amazonaws.dynamodb#TransactionInProgressException": + throw await de_TransactionInProgressExceptionRes(parsedOutput, context); + case "ExportConflictException": + case "com.amazonaws.dynamodb#ExportConflictException": + throw await de_ExportConflictExceptionRes(parsedOutput, context); + case "InvalidExportTimeException": + case "com.amazonaws.dynamodb#InvalidExportTimeException": + throw await de_InvalidExportTimeExceptionRes(parsedOutput, context); + case "PointInTimeRecoveryUnavailableException": + case "com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException": + throw await de_PointInTimeRecoveryUnavailableExceptionRes(parsedOutput, context); + case "ImportConflictException": + case "com.amazonaws.dynamodb#ImportConflictException": + throw await de_ImportConflictExceptionRes(parsedOutput, context); + case "TableAlreadyExistsException": + case "com.amazonaws.dynamodb#TableAlreadyExistsException": + throw await de_TableAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidRestoreTimeException": + case "com.amazonaws.dynamodb#InvalidRestoreTimeException": + throw await de_InvalidRestoreTimeExceptionRes(parsedOutput, context); + case "ReplicaAlreadyExistsException": + case "com.amazonaws.dynamodb#ReplicaAlreadyExistsException": + throw await de_ReplicaAlreadyExistsExceptionRes(parsedOutput, context); + case "ReplicaNotFoundException": + case "com.amazonaws.dynamodb#ReplicaNotFoundException": + throw await de_ReplicaNotFoundExceptionRes(parsedOutput, context); + case "IndexNotFoundException": + case "com.amazonaws.dynamodb#IndexNotFoundException": + throw await de_IndexNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-ebs/src/protocols/Aws_restJson1.ts b/clients/client-ebs/src/protocols/Aws_restJson1.ts index 4e577d3e3f3d..89b93f70c027 100644 --- a/clients/client-ebs/src/protocols/Aws_restJson1.ts +++ b/clients/client-ebs/src/protocols/Aws_restJson1.ts @@ -194,7 +194,7 @@ export const de_CompleteSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CompleteSnapshotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -207,47 +207,6 @@ export const de_CompleteSnapshotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CompleteSnapshotCommandError - */ -const de_CompleteSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ebs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ebs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestThrottledException": - case "com.amazonaws.ebs#RequestThrottledException": - throw await de_RequestThrottledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ebs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ebs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ebs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSnapshotBlockCommand */ @@ -256,7 +215,7 @@ export const de_GetSnapshotBlockCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSnapshotBlockCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -270,47 +229,6 @@ export const de_GetSnapshotBlockCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSnapshotBlockCommandError - */ -const de_GetSnapshotBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ebs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ebs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestThrottledException": - case "com.amazonaws.ebs#RequestThrottledException": - throw await de_RequestThrottledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ebs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ebs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ebs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListChangedBlocksCommand */ @@ -319,7 +237,7 @@ export const de_ListChangedBlocksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChangedBlocksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -336,47 +254,6 @@ export const de_ListChangedBlocksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListChangedBlocksCommandError - */ -const de_ListChangedBlocksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ebs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ebs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestThrottledException": - case "com.amazonaws.ebs#RequestThrottledException": - throw await de_RequestThrottledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ebs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ebs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ebs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSnapshotBlocksCommand */ @@ -385,7 +262,7 @@ export const de_ListSnapshotBlocksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSnapshotBlocksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -402,47 +279,6 @@ export const de_ListSnapshotBlocksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSnapshotBlocksCommandError - */ -const de_ListSnapshotBlocksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ebs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ebs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestThrottledException": - case "com.amazonaws.ebs#RequestThrottledException": - throw await de_RequestThrottledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ebs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ebs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ebs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutSnapshotBlockCommand */ @@ -451,7 +287,7 @@ export const de_PutSnapshotBlockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_PutSnapshotBlockCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -462,47 +298,6 @@ export const de_PutSnapshotBlockCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutSnapshotBlockCommandError - */ -const de_PutSnapshotBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ebs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ebs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestThrottledException": - case "com.amazonaws.ebs#RequestThrottledException": - throw await de_RequestThrottledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ebs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ebs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ebs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartSnapshotCommand */ @@ -511,7 +306,7 @@ export const de_StartSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_StartSnapshotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -535,12 +330,9 @@ export const de_StartSnapshotCommand = async ( }; /** - * deserializeAws_restJson1StartSnapshotCommandError + * deserialize_Aws_restJson1CommandError */ -const de_StartSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -550,12 +342,6 @@ const de_StartSnapshotCommandError = async ( case "AccessDeniedException": case "com.amazonaws.ebs#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentLimitExceededException": - case "com.amazonaws.ebs#ConcurrentLimitExceededException": - throw await de_ConcurrentLimitExceededExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ebs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.ebs#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); @@ -571,13 +357,19 @@ const de_StartSnapshotCommandError = async ( case "ValidationException": case "com.amazonaws.ebs#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConcurrentLimitExceededException": + case "com.amazonaws.ebs#ConcurrentLimitExceededException": + throw await de_ConcurrentLimitExceededExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.ebs#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts b/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts index 4e84307da3f2..7b6c622705fc 100644 --- a/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts +++ b/clients/client-ec2-instance-connect/src/protocols/Aws_json1_1.ts @@ -69,7 +69,7 @@ export const de_SendSerialConsoleSSHPublicKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendSerialConsoleSSHPublicKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -81,62 +81,6 @@ export const de_SendSerialConsoleSSHPublicKeyCommand = async ( return response; }; -/** - * deserializeAws_json1_1SendSerialConsoleSSHPublicKeyCommandError - */ -const de_SendSerialConsoleSSHPublicKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthException": - case "com.amazonaws.ec2instanceconnect#AuthException": - throw await de_AuthExceptionRes(parsedOutput, context); - case "EC2InstanceNotFoundException": - case "com.amazonaws.ec2instanceconnect#EC2InstanceNotFoundException": - throw await de_EC2InstanceNotFoundExceptionRes(parsedOutput, context); - case "EC2InstanceStateInvalidException": - case "com.amazonaws.ec2instanceconnect#EC2InstanceStateInvalidException": - throw await de_EC2InstanceStateInvalidExceptionRes(parsedOutput, context); - case "EC2InstanceTypeInvalidException": - case "com.amazonaws.ec2instanceconnect#EC2InstanceTypeInvalidException": - throw await de_EC2InstanceTypeInvalidExceptionRes(parsedOutput, context); - case "EC2InstanceUnavailableException": - case "com.amazonaws.ec2instanceconnect#EC2InstanceUnavailableException": - throw await de_EC2InstanceUnavailableExceptionRes(parsedOutput, context); - case "InvalidArgsException": - case "com.amazonaws.ec2instanceconnect#InvalidArgsException": - throw await de_InvalidArgsExceptionRes(parsedOutput, context); - case "SerialConsoleAccessDisabledException": - case "com.amazonaws.ec2instanceconnect#SerialConsoleAccessDisabledException": - throw await de_SerialConsoleAccessDisabledExceptionRes(parsedOutput, context); - case "SerialConsoleSessionLimitExceededException": - case "com.amazonaws.ec2instanceconnect#SerialConsoleSessionLimitExceededException": - throw await de_SerialConsoleSessionLimitExceededExceptionRes(parsedOutput, context); - case "SerialConsoleSessionUnavailableException": - case "com.amazonaws.ec2instanceconnect#SerialConsoleSessionUnavailableException": - throw await de_SerialConsoleSessionUnavailableExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.ec2instanceconnect#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ec2instanceconnect#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SendSSHPublicKeyCommand */ @@ -145,7 +89,7 @@ export const de_SendSSHPublicKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendSSHPublicKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -158,12 +102,9 @@ export const de_SendSSHPublicKeyCommand = async ( }; /** - * deserializeAws_json1_1SendSSHPublicKeyCommandError + * deserialize_Aws_json1_1CommandError */ -const de_SendSSHPublicKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -179,12 +120,24 @@ const de_SendSSHPublicKeyCommandError = async ( case "EC2InstanceStateInvalidException": case "com.amazonaws.ec2instanceconnect#EC2InstanceStateInvalidException": throw await de_EC2InstanceStateInvalidExceptionRes(parsedOutput, context); + case "EC2InstanceTypeInvalidException": + case "com.amazonaws.ec2instanceconnect#EC2InstanceTypeInvalidException": + throw await de_EC2InstanceTypeInvalidExceptionRes(parsedOutput, context); case "EC2InstanceUnavailableException": case "com.amazonaws.ec2instanceconnect#EC2InstanceUnavailableException": throw await de_EC2InstanceUnavailableExceptionRes(parsedOutput, context); case "InvalidArgsException": case "com.amazonaws.ec2instanceconnect#InvalidArgsException": throw await de_InvalidArgsExceptionRes(parsedOutput, context); + case "SerialConsoleAccessDisabledException": + case "com.amazonaws.ec2instanceconnect#SerialConsoleAccessDisabledException": + throw await de_SerialConsoleAccessDisabledExceptionRes(parsedOutput, context); + case "SerialConsoleSessionLimitExceededException": + case "com.amazonaws.ec2instanceconnect#SerialConsoleSessionLimitExceededException": + throw await de_SerialConsoleSessionLimitExceededExceptionRes(parsedOutput, context); + case "SerialConsoleSessionUnavailableException": + case "com.amazonaws.ec2instanceconnect#SerialConsoleSessionUnavailableException": + throw await de_SerialConsoleSessionUnavailableExceptionRes(parsedOutput, context); case "ServiceException": case "com.amazonaws.ec2instanceconnect#ServiceException": throw await de_ServiceExceptionRes(parsedOutput, context); @@ -197,7 +150,7 @@ const de_SendSSHPublicKeyCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-ec2/src/protocols/Aws_ec2.ts b/clients/client-ec2/src/protocols/Aws_ec2.ts index 2a3bb1dcc313..c78496c605b8 100644 --- a/clients/client-ec2/src/protocols/Aws_ec2.ts +++ b/clients/client-ec2/src/protocols/Aws_ec2.ts @@ -14508,7 +14508,7 @@ export const de_AcceptAddressTransferCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptAddressTransferCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14520,26 +14520,6 @@ export const de_AcceptAddressTransferCommand = async ( return response; }; -/** - * deserializeAws_ec2AcceptAddressTransferCommandError - */ -const de_AcceptAddressTransferCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AcceptReservedInstancesExchangeQuoteCommand */ @@ -14548,7 +14528,7 @@ export const de_AcceptReservedInstancesExchangeQuoteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptReservedInstancesExchangeQuoteCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14560,26 +14540,6 @@ export const de_AcceptReservedInstancesExchangeQuoteCommand = async ( return response; }; -/** - * deserializeAws_ec2AcceptReservedInstancesExchangeQuoteCommandError - */ -const de_AcceptReservedInstancesExchangeQuoteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AcceptTransitGatewayMulticastDomainAssociationsCommand */ @@ -14588,7 +14548,7 @@ export const de_AcceptTransitGatewayMulticastDomainAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptTransitGatewayMulticastDomainAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14600,26 +14560,6 @@ export const de_AcceptTransitGatewayMulticastDomainAssociationsCommand = async ( return response; }; -/** - * deserializeAws_ec2AcceptTransitGatewayMulticastDomainAssociationsCommandError - */ -const de_AcceptTransitGatewayMulticastDomainAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AcceptTransitGatewayPeeringAttachmentCommand */ @@ -14628,7 +14568,7 @@ export const de_AcceptTransitGatewayPeeringAttachmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptTransitGatewayPeeringAttachmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14640,26 +14580,6 @@ export const de_AcceptTransitGatewayPeeringAttachmentCommand = async ( return response; }; -/** - * deserializeAws_ec2AcceptTransitGatewayPeeringAttachmentCommandError - */ -const de_AcceptTransitGatewayPeeringAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AcceptTransitGatewayVpcAttachmentCommand */ @@ -14668,7 +14588,7 @@ export const de_AcceptTransitGatewayVpcAttachmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptTransitGatewayVpcAttachmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14680,26 +14600,6 @@ export const de_AcceptTransitGatewayVpcAttachmentCommand = async ( return response; }; -/** - * deserializeAws_ec2AcceptTransitGatewayVpcAttachmentCommandError - */ -const de_AcceptTransitGatewayVpcAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AcceptVpcEndpointConnectionsCommand */ @@ -14708,7 +14608,7 @@ export const de_AcceptVpcEndpointConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptVpcEndpointConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14720,26 +14620,6 @@ export const de_AcceptVpcEndpointConnectionsCommand = async ( return response; }; -/** - * deserializeAws_ec2AcceptVpcEndpointConnectionsCommandError - */ -const de_AcceptVpcEndpointConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AcceptVpcPeeringConnectionCommand */ @@ -14748,7 +14628,7 @@ export const de_AcceptVpcPeeringConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptVpcPeeringConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14760,26 +14640,6 @@ export const de_AcceptVpcPeeringConnectionCommand = async ( return response; }; -/** - * deserializeAws_ec2AcceptVpcPeeringConnectionCommandError - */ -const de_AcceptVpcPeeringConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AdvertiseByoipCidrCommand */ @@ -14788,7 +14648,7 @@ export const de_AdvertiseByoipCidrCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AdvertiseByoipCidrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14800,26 +14660,6 @@ export const de_AdvertiseByoipCidrCommand = async ( return response; }; -/** - * deserializeAws_ec2AdvertiseByoipCidrCommandError - */ -const de_AdvertiseByoipCidrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AllocateAddressCommand */ @@ -14828,7 +14668,7 @@ export const de_AllocateAddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AllocateAddressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14840,26 +14680,6 @@ export const de_AllocateAddressCommand = async ( return response; }; -/** - * deserializeAws_ec2AllocateAddressCommandError - */ -const de_AllocateAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AllocateHostsCommand */ @@ -14868,7 +14688,7 @@ export const de_AllocateHostsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AllocateHostsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14880,26 +14700,6 @@ export const de_AllocateHostsCommand = async ( return response; }; -/** - * deserializeAws_ec2AllocateHostsCommandError - */ -const de_AllocateHostsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AllocateIpamPoolCidrCommand */ @@ -14908,7 +14708,7 @@ export const de_AllocateIpamPoolCidrCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AllocateIpamPoolCidrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14920,26 +14720,6 @@ export const de_AllocateIpamPoolCidrCommand = async ( return response; }; -/** - * deserializeAws_ec2AllocateIpamPoolCidrCommandError - */ -const de_AllocateIpamPoolCidrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ApplySecurityGroupsToClientVpnTargetNetworkCommand */ @@ -14948,7 +14728,7 @@ export const de_ApplySecurityGroupsToClientVpnTargetNetworkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ApplySecurityGroupsToClientVpnTargetNetworkCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14960,26 +14740,6 @@ export const de_ApplySecurityGroupsToClientVpnTargetNetworkCommand = async ( return response; }; -/** - * deserializeAws_ec2ApplySecurityGroupsToClientVpnTargetNetworkCommandError - */ -const de_ApplySecurityGroupsToClientVpnTargetNetworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssignIpv6AddressesCommand */ @@ -14988,7 +14748,7 @@ export const de_AssignIpv6AddressesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssignIpv6AddressesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15000,26 +14760,6 @@ export const de_AssignIpv6AddressesCommand = async ( return response; }; -/** - * deserializeAws_ec2AssignIpv6AddressesCommandError - */ -const de_AssignIpv6AddressesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssignPrivateIpAddressesCommand */ @@ -15028,7 +14768,7 @@ export const de_AssignPrivateIpAddressesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssignPrivateIpAddressesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15040,26 +14780,6 @@ export const de_AssignPrivateIpAddressesCommand = async ( return response; }; -/** - * deserializeAws_ec2AssignPrivateIpAddressesCommandError - */ -const de_AssignPrivateIpAddressesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssignPrivateNatGatewayAddressCommand */ @@ -15068,7 +14788,7 @@ export const de_AssignPrivateNatGatewayAddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssignPrivateNatGatewayAddressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15081,34 +14801,14 @@ export const de_AssignPrivateNatGatewayAddressCommand = async ( }; /** - * deserializeAws_ec2AssignPrivateNatGatewayAddressCommandError + * deserializeAws_ec2AssociateAddressCommand */ -const de_AssignPrivateNatGatewayAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2AssociateAddressCommand - */ -export const de_AssociateAddressCommand = async ( +export const de_AssociateAddressCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateAddressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15120,26 +14820,6 @@ export const de_AssociateAddressCommand = async ( return response; }; -/** - * deserializeAws_ec2AssociateAddressCommandError - */ -const de_AssociateAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssociateClientVpnTargetNetworkCommand */ @@ -15148,7 +14828,7 @@ export const de_AssociateClientVpnTargetNetworkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateClientVpnTargetNetworkCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15160,26 +14840,6 @@ export const de_AssociateClientVpnTargetNetworkCommand = async ( return response; }; -/** - * deserializeAws_ec2AssociateClientVpnTargetNetworkCommandError - */ -const de_AssociateClientVpnTargetNetworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssociateDhcpOptionsCommand */ @@ -15188,7 +14848,7 @@ export const de_AssociateDhcpOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateDhcpOptionsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AssociateDhcpOptionsCommandOutput = { @@ -15197,26 +14857,6 @@ export const de_AssociateDhcpOptionsCommand = async ( return response; }; -/** - * deserializeAws_ec2AssociateDhcpOptionsCommandError - */ -const de_AssociateDhcpOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssociateEnclaveCertificateIamRoleCommand */ @@ -15225,7 +14865,7 @@ export const de_AssociateEnclaveCertificateIamRoleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateEnclaveCertificateIamRoleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15237,26 +14877,6 @@ export const de_AssociateEnclaveCertificateIamRoleCommand = async ( return response; }; -/** - * deserializeAws_ec2AssociateEnclaveCertificateIamRoleCommandError - */ -const de_AssociateEnclaveCertificateIamRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssociateIamInstanceProfileCommand */ @@ -15265,7 +14885,7 @@ export const de_AssociateIamInstanceProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateIamInstanceProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15277,26 +14897,6 @@ export const de_AssociateIamInstanceProfileCommand = async ( return response; }; -/** - * deserializeAws_ec2AssociateIamInstanceProfileCommandError - */ -const de_AssociateIamInstanceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssociateInstanceEventWindowCommand */ @@ -15305,7 +14905,7 @@ export const de_AssociateInstanceEventWindowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateInstanceEventWindowCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15317,26 +14917,6 @@ export const de_AssociateInstanceEventWindowCommand = async ( return response; }; -/** - * deserializeAws_ec2AssociateInstanceEventWindowCommandError - */ -const de_AssociateInstanceEventWindowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssociateIpamByoasnCommand */ @@ -15345,7 +14925,7 @@ export const de_AssociateIpamByoasnCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateIpamByoasnCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15357,26 +14937,6 @@ export const de_AssociateIpamByoasnCommand = async ( return response; }; -/** - * deserializeAws_ec2AssociateIpamByoasnCommandError - */ -const de_AssociateIpamByoasnCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssociateIpamResourceDiscoveryCommand */ @@ -15385,7 +14945,7 @@ export const de_AssociateIpamResourceDiscoveryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateIpamResourceDiscoveryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15397,26 +14957,6 @@ export const de_AssociateIpamResourceDiscoveryCommand = async ( return response; }; -/** - * deserializeAws_ec2AssociateIpamResourceDiscoveryCommandError - */ -const de_AssociateIpamResourceDiscoveryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssociateNatGatewayAddressCommand */ @@ -15425,7 +14965,7 @@ export const de_AssociateNatGatewayAddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateNatGatewayAddressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15437,26 +14977,6 @@ export const de_AssociateNatGatewayAddressCommand = async ( return response; }; -/** - * deserializeAws_ec2AssociateNatGatewayAddressCommandError - */ -const de_AssociateNatGatewayAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssociateRouteTableCommand */ @@ -15465,7 +14985,7 @@ export const de_AssociateRouteTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateRouteTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15477,26 +14997,6 @@ export const de_AssociateRouteTableCommand = async ( return response; }; -/** - * deserializeAws_ec2AssociateRouteTableCommandError - */ -const de_AssociateRouteTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssociateSubnetCidrBlockCommand */ @@ -15505,7 +15005,7 @@ export const de_AssociateSubnetCidrBlockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateSubnetCidrBlockCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15517,26 +15017,6 @@ export const de_AssociateSubnetCidrBlockCommand = async ( return response; }; -/** - * deserializeAws_ec2AssociateSubnetCidrBlockCommandError - */ -const de_AssociateSubnetCidrBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssociateTransitGatewayMulticastDomainCommand */ @@ -15545,7 +15025,7 @@ export const de_AssociateTransitGatewayMulticastDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateTransitGatewayMulticastDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15557,26 +15037,6 @@ export const de_AssociateTransitGatewayMulticastDomainCommand = async ( return response; }; -/** - * deserializeAws_ec2AssociateTransitGatewayMulticastDomainCommandError - */ -const de_AssociateTransitGatewayMulticastDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssociateTransitGatewayPolicyTableCommand */ @@ -15585,7 +15045,7 @@ export const de_AssociateTransitGatewayPolicyTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateTransitGatewayPolicyTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15597,26 +15057,6 @@ export const de_AssociateTransitGatewayPolicyTableCommand = async ( return response; }; -/** - * deserializeAws_ec2AssociateTransitGatewayPolicyTableCommandError - */ -const de_AssociateTransitGatewayPolicyTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssociateTransitGatewayRouteTableCommand */ @@ -15625,7 +15065,7 @@ export const de_AssociateTransitGatewayRouteTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateTransitGatewayRouteTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15638,34 +15078,14 @@ export const de_AssociateTransitGatewayRouteTableCommand = async ( }; /** - * deserializeAws_ec2AssociateTransitGatewayRouteTableCommandError + * deserializeAws_ec2AssociateTrunkInterfaceCommand */ -const de_AssociateTransitGatewayRouteTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2AssociateTrunkInterfaceCommand - */ -export const de_AssociateTrunkInterfaceCommand = async ( +export const de_AssociateTrunkInterfaceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateTrunkInterfaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15677,26 +15097,6 @@ export const de_AssociateTrunkInterfaceCommand = async ( return response; }; -/** - * deserializeAws_ec2AssociateTrunkInterfaceCommandError - */ -const de_AssociateTrunkInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AssociateVpcCidrBlockCommand */ @@ -15705,7 +15105,7 @@ export const de_AssociateVpcCidrBlockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateVpcCidrBlockCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15717,26 +15117,6 @@ export const de_AssociateVpcCidrBlockCommand = async ( return response; }; -/** - * deserializeAws_ec2AssociateVpcCidrBlockCommandError - */ -const de_AssociateVpcCidrBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AttachClassicLinkVpcCommand */ @@ -15745,7 +15125,7 @@ export const de_AttachClassicLinkVpcCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachClassicLinkVpcCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15757,26 +15137,6 @@ export const de_AttachClassicLinkVpcCommand = async ( return response; }; -/** - * deserializeAws_ec2AttachClassicLinkVpcCommandError - */ -const de_AttachClassicLinkVpcCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AttachInternetGatewayCommand */ @@ -15785,7 +15145,7 @@ export const de_AttachInternetGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachInternetGatewayCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AttachInternetGatewayCommandOutput = { @@ -15794,26 +15154,6 @@ export const de_AttachInternetGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2AttachInternetGatewayCommandError - */ -const de_AttachInternetGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AttachNetworkInterfaceCommand */ @@ -15822,7 +15162,7 @@ export const de_AttachNetworkInterfaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachNetworkInterfaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15834,26 +15174,6 @@ export const de_AttachNetworkInterfaceCommand = async ( return response; }; -/** - * deserializeAws_ec2AttachNetworkInterfaceCommandError - */ -const de_AttachNetworkInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AttachVerifiedAccessTrustProviderCommand */ @@ -15862,7 +15182,7 @@ export const de_AttachVerifiedAccessTrustProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachVerifiedAccessTrustProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15874,26 +15194,6 @@ export const de_AttachVerifiedAccessTrustProviderCommand = async ( return response; }; -/** - * deserializeAws_ec2AttachVerifiedAccessTrustProviderCommandError - */ -const de_AttachVerifiedAccessTrustProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AttachVolumeCommand */ @@ -15902,7 +15202,7 @@ export const de_AttachVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachVolumeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15914,26 +15214,6 @@ export const de_AttachVolumeCommand = async ( return response; }; -/** - * deserializeAws_ec2AttachVolumeCommandError - */ -const de_AttachVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AttachVpnGatewayCommand */ @@ -15942,7 +15222,7 @@ export const de_AttachVpnGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachVpnGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15954,26 +15234,6 @@ export const de_AttachVpnGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2AttachVpnGatewayCommandError - */ -const de_AttachVpnGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AuthorizeClientVpnIngressCommand */ @@ -15982,7 +15242,7 @@ export const de_AuthorizeClientVpnIngressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AuthorizeClientVpnIngressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15994,26 +15254,6 @@ export const de_AuthorizeClientVpnIngressCommand = async ( return response; }; -/** - * deserializeAws_ec2AuthorizeClientVpnIngressCommandError - */ -const de_AuthorizeClientVpnIngressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AuthorizeSecurityGroupEgressCommand */ @@ -16022,7 +15262,7 @@ export const de_AuthorizeSecurityGroupEgressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AuthorizeSecurityGroupEgressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16034,26 +15274,6 @@ export const de_AuthorizeSecurityGroupEgressCommand = async ( return response; }; -/** - * deserializeAws_ec2AuthorizeSecurityGroupEgressCommandError - */ -const de_AuthorizeSecurityGroupEgressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2AuthorizeSecurityGroupIngressCommand */ @@ -16062,7 +15282,7 @@ export const de_AuthorizeSecurityGroupIngressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AuthorizeSecurityGroupIngressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16074,26 +15294,6 @@ export const de_AuthorizeSecurityGroupIngressCommand = async ( return response; }; -/** - * deserializeAws_ec2AuthorizeSecurityGroupIngressCommandError - */ -const de_AuthorizeSecurityGroupIngressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2BundleInstanceCommand */ @@ -16102,7 +15302,7 @@ export const de_BundleInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BundleInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16114,26 +15314,6 @@ export const de_BundleInstanceCommand = async ( return response; }; -/** - * deserializeAws_ec2BundleInstanceCommandError - */ -const de_BundleInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CancelBundleTaskCommand */ @@ -16142,7 +15322,7 @@ export const de_CancelBundleTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelBundleTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16154,26 +15334,6 @@ export const de_CancelBundleTaskCommand = async ( return response; }; -/** - * deserializeAws_ec2CancelBundleTaskCommandError - */ -const de_CancelBundleTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CancelCapacityReservationCommand */ @@ -16182,7 +15342,7 @@ export const de_CancelCapacityReservationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelCapacityReservationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16195,34 +15355,14 @@ export const de_CancelCapacityReservationCommand = async ( }; /** - * deserializeAws_ec2CancelCapacityReservationCommandError + * deserializeAws_ec2CancelCapacityReservationFleetsCommand */ -const de_CancelCapacityReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2CancelCapacityReservationFleetsCommand - */ -export const de_CancelCapacityReservationFleetsCommand = async ( +export const de_CancelCapacityReservationFleetsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelCapacityReservationFleetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16234,26 +15374,6 @@ export const de_CancelCapacityReservationFleetsCommand = async ( return response; }; -/** - * deserializeAws_ec2CancelCapacityReservationFleetsCommandError - */ -const de_CancelCapacityReservationFleetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CancelConversionTaskCommand */ @@ -16262,7 +15382,7 @@ export const de_CancelConversionTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelConversionTaskCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CancelConversionTaskCommandOutput = { @@ -16271,26 +15391,6 @@ export const de_CancelConversionTaskCommand = async ( return response; }; -/** - * deserializeAws_ec2CancelConversionTaskCommandError - */ -const de_CancelConversionTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CancelExportTaskCommand */ @@ -16299,7 +15399,7 @@ export const de_CancelExportTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelExportTaskCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CancelExportTaskCommandOutput = { @@ -16308,26 +15408,6 @@ export const de_CancelExportTaskCommand = async ( return response; }; -/** - * deserializeAws_ec2CancelExportTaskCommandError - */ -const de_CancelExportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CancelImageLaunchPermissionCommand */ @@ -16336,7 +15416,7 @@ export const de_CancelImageLaunchPermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelImageLaunchPermissionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16348,26 +15428,6 @@ export const de_CancelImageLaunchPermissionCommand = async ( return response; }; -/** - * deserializeAws_ec2CancelImageLaunchPermissionCommandError - */ -const de_CancelImageLaunchPermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CancelImportTaskCommand */ @@ -16376,7 +15436,7 @@ export const de_CancelImportTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelImportTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16388,26 +15448,6 @@ export const de_CancelImportTaskCommand = async ( return response; }; -/** - * deserializeAws_ec2CancelImportTaskCommandError - */ -const de_CancelImportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CancelReservedInstancesListingCommand */ @@ -16416,7 +15456,7 @@ export const de_CancelReservedInstancesListingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelReservedInstancesListingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16428,26 +15468,6 @@ export const de_CancelReservedInstancesListingCommand = async ( return response; }; -/** - * deserializeAws_ec2CancelReservedInstancesListingCommandError - */ -const de_CancelReservedInstancesListingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CancelSpotFleetRequestsCommand */ @@ -16456,7 +15476,7 @@ export const de_CancelSpotFleetRequestsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelSpotFleetRequestsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16468,26 +15488,6 @@ export const de_CancelSpotFleetRequestsCommand = async ( return response; }; -/** - * deserializeAws_ec2CancelSpotFleetRequestsCommandError - */ -const de_CancelSpotFleetRequestsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CancelSpotInstanceRequestsCommand */ @@ -16496,7 +15496,7 @@ export const de_CancelSpotInstanceRequestsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelSpotInstanceRequestsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16508,26 +15508,6 @@ export const de_CancelSpotInstanceRequestsCommand = async ( return response; }; -/** - * deserializeAws_ec2CancelSpotInstanceRequestsCommandError - */ -const de_CancelSpotInstanceRequestsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ConfirmProductInstanceCommand */ @@ -16536,7 +15516,7 @@ export const de_ConfirmProductInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ConfirmProductInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16548,26 +15528,6 @@ export const de_ConfirmProductInstanceCommand = async ( return response; }; -/** - * deserializeAws_ec2ConfirmProductInstanceCommandError - */ -const de_ConfirmProductInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CopyFpgaImageCommand */ @@ -16576,7 +15536,7 @@ export const de_CopyFpgaImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopyFpgaImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16588,26 +15548,6 @@ export const de_CopyFpgaImageCommand = async ( return response; }; -/** - * deserializeAws_ec2CopyFpgaImageCommandError - */ -const de_CopyFpgaImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CopyImageCommand */ @@ -16616,7 +15556,7 @@ export const de_CopyImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopyImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16628,26 +15568,6 @@ export const de_CopyImageCommand = async ( return response; }; -/** - * deserializeAws_ec2CopyImageCommandError - */ -const de_CopyImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CopySnapshotCommand */ @@ -16656,7 +15576,7 @@ export const de_CopySnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopySnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16668,26 +15588,6 @@ export const de_CopySnapshotCommand = async ( return response; }; -/** - * deserializeAws_ec2CopySnapshotCommandError - */ -const de_CopySnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateCapacityReservationCommand */ @@ -16696,7 +15596,7 @@ export const de_CreateCapacityReservationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCapacityReservationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16708,26 +15608,6 @@ export const de_CreateCapacityReservationCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateCapacityReservationCommandError - */ -const de_CreateCapacityReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateCapacityReservationFleetCommand */ @@ -16736,7 +15616,7 @@ export const de_CreateCapacityReservationFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCapacityReservationFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16749,34 +15629,14 @@ export const de_CreateCapacityReservationFleetCommand = async ( }; /** - * deserializeAws_ec2CreateCapacityReservationFleetCommandError + * deserializeAws_ec2CreateCarrierGatewayCommand */ -const de_CreateCapacityReservationFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2CreateCarrierGatewayCommand - */ -export const de_CreateCarrierGatewayCommand = async ( +export const de_CreateCarrierGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCarrierGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16788,26 +15648,6 @@ export const de_CreateCarrierGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateCarrierGatewayCommandError - */ -const de_CreateCarrierGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateClientVpnEndpointCommand */ @@ -16816,7 +15656,7 @@ export const de_CreateClientVpnEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateClientVpnEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16828,26 +15668,6 @@ export const de_CreateClientVpnEndpointCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateClientVpnEndpointCommandError - */ -const de_CreateClientVpnEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateClientVpnRouteCommand */ @@ -16856,7 +15676,7 @@ export const de_CreateClientVpnRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateClientVpnRouteCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16868,26 +15688,6 @@ export const de_CreateClientVpnRouteCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateClientVpnRouteCommandError - */ -const de_CreateClientVpnRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateCoipCidrCommand */ @@ -16896,7 +15696,7 @@ export const de_CreateCoipCidrCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCoipCidrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16908,26 +15708,6 @@ export const de_CreateCoipCidrCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateCoipCidrCommandError - */ -const de_CreateCoipCidrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateCoipPoolCommand */ @@ -16936,7 +15716,7 @@ export const de_CreateCoipPoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCoipPoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16948,26 +15728,6 @@ export const de_CreateCoipPoolCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateCoipPoolCommandError - */ -const de_CreateCoipPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateCustomerGatewayCommand */ @@ -16976,7 +15736,7 @@ export const de_CreateCustomerGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCustomerGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16988,26 +15748,6 @@ export const de_CreateCustomerGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateCustomerGatewayCommandError - */ -const de_CreateCustomerGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateDefaultSubnetCommand */ @@ -17016,7 +15756,7 @@ export const de_CreateDefaultSubnetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDefaultSubnetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17028,26 +15768,6 @@ export const de_CreateDefaultSubnetCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateDefaultSubnetCommandError - */ -const de_CreateDefaultSubnetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateDefaultVpcCommand */ @@ -17056,7 +15776,7 @@ export const de_CreateDefaultVpcCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDefaultVpcCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17068,26 +15788,6 @@ export const de_CreateDefaultVpcCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateDefaultVpcCommandError - */ -const de_CreateDefaultVpcCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateDhcpOptionsCommand */ @@ -17096,7 +15796,7 @@ export const de_CreateDhcpOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDhcpOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17108,26 +15808,6 @@ export const de_CreateDhcpOptionsCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateDhcpOptionsCommandError - */ -const de_CreateDhcpOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateEgressOnlyInternetGatewayCommand */ @@ -17136,7 +15816,7 @@ export const de_CreateEgressOnlyInternetGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEgressOnlyInternetGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17148,26 +15828,6 @@ export const de_CreateEgressOnlyInternetGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateEgressOnlyInternetGatewayCommandError - */ -const de_CreateEgressOnlyInternetGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateFleetCommand */ @@ -17176,7 +15836,7 @@ export const de_CreateFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17188,26 +15848,6 @@ export const de_CreateFleetCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateFleetCommandError - */ -const de_CreateFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateFlowLogsCommand */ @@ -17216,7 +15856,7 @@ export const de_CreateFlowLogsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFlowLogsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17228,26 +15868,6 @@ export const de_CreateFlowLogsCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateFlowLogsCommandError - */ -const de_CreateFlowLogsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateFpgaImageCommand */ @@ -17256,7 +15876,7 @@ export const de_CreateFpgaImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFpgaImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17268,26 +15888,6 @@ export const de_CreateFpgaImageCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateFpgaImageCommandError - */ -const de_CreateFpgaImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateImageCommand */ @@ -17296,7 +15896,7 @@ export const de_CreateImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17309,34 +15909,14 @@ export const de_CreateImageCommand = async ( }; /** - * deserializeAws_ec2CreateImageCommandError + * deserializeAws_ec2CreateInstanceConnectEndpointCommand */ -const de_CreateImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2CreateInstanceConnectEndpointCommand - */ -export const de_CreateInstanceConnectEndpointCommand = async ( +export const de_CreateInstanceConnectEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateInstanceConnectEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17348,26 +15928,6 @@ export const de_CreateInstanceConnectEndpointCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateInstanceConnectEndpointCommandError - */ -const de_CreateInstanceConnectEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateInstanceEventWindowCommand */ @@ -17376,7 +15936,7 @@ export const de_CreateInstanceEventWindowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateInstanceEventWindowCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17388,26 +15948,6 @@ export const de_CreateInstanceEventWindowCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateInstanceEventWindowCommandError - */ -const de_CreateInstanceEventWindowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateInstanceExportTaskCommand */ @@ -17416,7 +15956,7 @@ export const de_CreateInstanceExportTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateInstanceExportTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17428,26 +15968,6 @@ export const de_CreateInstanceExportTaskCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateInstanceExportTaskCommandError - */ -const de_CreateInstanceExportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateInternetGatewayCommand */ @@ -17456,7 +15976,7 @@ export const de_CreateInternetGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateInternetGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17468,26 +15988,6 @@ export const de_CreateInternetGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateInternetGatewayCommandError - */ -const de_CreateInternetGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateIpamCommand */ @@ -17496,7 +15996,7 @@ export const de_CreateIpamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateIpamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17508,26 +16008,6 @@ export const de_CreateIpamCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateIpamCommandError - */ -const de_CreateIpamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateIpamPoolCommand */ @@ -17536,7 +16016,7 @@ export const de_CreateIpamPoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateIpamPoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17548,26 +16028,6 @@ export const de_CreateIpamPoolCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateIpamPoolCommandError - */ -const de_CreateIpamPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateIpamResourceDiscoveryCommand */ @@ -17576,7 +16036,7 @@ export const de_CreateIpamResourceDiscoveryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateIpamResourceDiscoveryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17588,26 +16048,6 @@ export const de_CreateIpamResourceDiscoveryCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateIpamResourceDiscoveryCommandError - */ -const de_CreateIpamResourceDiscoveryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateIpamScopeCommand */ @@ -17616,7 +16056,7 @@ export const de_CreateIpamScopeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateIpamScopeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17628,26 +16068,6 @@ export const de_CreateIpamScopeCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateIpamScopeCommandError - */ -const de_CreateIpamScopeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateKeyPairCommand */ @@ -17656,7 +16076,7 @@ export const de_CreateKeyPairCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateKeyPairCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17668,26 +16088,6 @@ export const de_CreateKeyPairCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateKeyPairCommandError - */ -const de_CreateKeyPairCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateLaunchTemplateCommand */ @@ -17696,7 +16096,7 @@ export const de_CreateLaunchTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLaunchTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17708,26 +16108,6 @@ export const de_CreateLaunchTemplateCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateLaunchTemplateCommandError - */ -const de_CreateLaunchTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateLaunchTemplateVersionCommand */ @@ -17736,7 +16116,7 @@ export const de_CreateLaunchTemplateVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLaunchTemplateVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17748,26 +16128,6 @@ export const de_CreateLaunchTemplateVersionCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateLaunchTemplateVersionCommandError - */ -const de_CreateLaunchTemplateVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateLocalGatewayRouteCommand */ @@ -17776,7 +16136,7 @@ export const de_CreateLocalGatewayRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLocalGatewayRouteCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17788,26 +16148,6 @@ export const de_CreateLocalGatewayRouteCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateLocalGatewayRouteCommandError - */ -const de_CreateLocalGatewayRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateLocalGatewayRouteTableCommand */ @@ -17816,7 +16156,7 @@ export const de_CreateLocalGatewayRouteTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLocalGatewayRouteTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17828,26 +16168,6 @@ export const de_CreateLocalGatewayRouteTableCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateLocalGatewayRouteTableCommandError - */ -const de_CreateLocalGatewayRouteTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationCommand */ @@ -17856,7 +16176,7 @@ export const de_CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationComm context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17869,34 +16189,14 @@ export const de_CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationComm }; /** - * deserializeAws_ec2CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationCommandError + * deserializeAws_ec2CreateLocalGatewayRouteTableVpcAssociationCommand */ -const de_CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2CreateLocalGatewayRouteTableVpcAssociationCommand - */ -export const de_CreateLocalGatewayRouteTableVpcAssociationCommand = async ( +export const de_CreateLocalGatewayRouteTableVpcAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLocalGatewayRouteTableVpcAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17908,26 +16208,6 @@ export const de_CreateLocalGatewayRouteTableVpcAssociationCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateLocalGatewayRouteTableVpcAssociationCommandError - */ -const de_CreateLocalGatewayRouteTableVpcAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateManagedPrefixListCommand */ @@ -17936,7 +16216,7 @@ export const de_CreateManagedPrefixListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateManagedPrefixListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17948,26 +16228,6 @@ export const de_CreateManagedPrefixListCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateManagedPrefixListCommandError - */ -const de_CreateManagedPrefixListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateNatGatewayCommand */ @@ -17976,7 +16236,7 @@ export const de_CreateNatGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateNatGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17988,26 +16248,6 @@ export const de_CreateNatGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateNatGatewayCommandError - */ -const de_CreateNatGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateNetworkAclCommand */ @@ -18016,7 +16256,7 @@ export const de_CreateNetworkAclCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateNetworkAclCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18028,26 +16268,6 @@ export const de_CreateNetworkAclCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateNetworkAclCommandError - */ -const de_CreateNetworkAclCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateNetworkAclEntryCommand */ @@ -18056,7 +16276,7 @@ export const de_CreateNetworkAclEntryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateNetworkAclEntryCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateNetworkAclEntryCommandOutput = { @@ -18065,26 +16285,6 @@ export const de_CreateNetworkAclEntryCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateNetworkAclEntryCommandError - */ -const de_CreateNetworkAclEntryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateNetworkInsightsAccessScopeCommand */ @@ -18093,7 +16293,7 @@ export const de_CreateNetworkInsightsAccessScopeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateNetworkInsightsAccessScopeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18105,26 +16305,6 @@ export const de_CreateNetworkInsightsAccessScopeCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateNetworkInsightsAccessScopeCommandError - */ -const de_CreateNetworkInsightsAccessScopeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateNetworkInsightsPathCommand */ @@ -18133,7 +16313,7 @@ export const de_CreateNetworkInsightsPathCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateNetworkInsightsPathCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18145,26 +16325,6 @@ export const de_CreateNetworkInsightsPathCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateNetworkInsightsPathCommandError - */ -const de_CreateNetworkInsightsPathCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateNetworkInterfaceCommand */ @@ -18173,7 +16333,7 @@ export const de_CreateNetworkInterfaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateNetworkInterfaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18185,26 +16345,6 @@ export const de_CreateNetworkInterfaceCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateNetworkInterfaceCommandError - */ -const de_CreateNetworkInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateNetworkInterfacePermissionCommand */ @@ -18213,7 +16353,7 @@ export const de_CreateNetworkInterfacePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateNetworkInterfacePermissionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18225,26 +16365,6 @@ export const de_CreateNetworkInterfacePermissionCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateNetworkInterfacePermissionCommandError - */ -const de_CreateNetworkInterfacePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreatePlacementGroupCommand */ @@ -18253,7 +16373,7 @@ export const de_CreatePlacementGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePlacementGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18265,26 +16385,6 @@ export const de_CreatePlacementGroupCommand = async ( return response; }; -/** - * deserializeAws_ec2CreatePlacementGroupCommandError - */ -const de_CreatePlacementGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreatePublicIpv4PoolCommand */ @@ -18293,7 +16393,7 @@ export const de_CreatePublicIpv4PoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePublicIpv4PoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18305,26 +16405,6 @@ export const de_CreatePublicIpv4PoolCommand = async ( return response; }; -/** - * deserializeAws_ec2CreatePublicIpv4PoolCommandError - */ -const de_CreatePublicIpv4PoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateReplaceRootVolumeTaskCommand */ @@ -18333,7 +16413,7 @@ export const de_CreateReplaceRootVolumeTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateReplaceRootVolumeTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18345,26 +16425,6 @@ export const de_CreateReplaceRootVolumeTaskCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateReplaceRootVolumeTaskCommandError - */ -const de_CreateReplaceRootVolumeTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateReservedInstancesListingCommand */ @@ -18373,7 +16433,7 @@ export const de_CreateReservedInstancesListingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateReservedInstancesListingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18385,26 +16445,6 @@ export const de_CreateReservedInstancesListingCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateReservedInstancesListingCommandError - */ -const de_CreateReservedInstancesListingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateRestoreImageTaskCommand */ @@ -18413,7 +16453,7 @@ export const de_CreateRestoreImageTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRestoreImageTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18426,34 +16466,14 @@ export const de_CreateRestoreImageTaskCommand = async ( }; /** - * deserializeAws_ec2CreateRestoreImageTaskCommandError + * deserializeAws_ec2CreateRouteCommand */ -const de_CreateRestoreImageTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2CreateRouteCommand - */ -export const de_CreateRouteCommand = async ( +export const de_CreateRouteCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRouteCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18465,26 +16485,6 @@ export const de_CreateRouteCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateRouteCommandError - */ -const de_CreateRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateRouteTableCommand */ @@ -18493,7 +16493,7 @@ export const de_CreateRouteTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRouteTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18505,26 +16505,6 @@ export const de_CreateRouteTableCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateRouteTableCommandError - */ -const de_CreateRouteTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateSecurityGroupCommand */ @@ -18533,7 +16513,7 @@ export const de_CreateSecurityGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSecurityGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18545,26 +16525,6 @@ export const de_CreateSecurityGroupCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateSecurityGroupCommandError - */ -const de_CreateSecurityGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateSnapshotCommand */ @@ -18573,7 +16533,7 @@ export const de_CreateSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18585,26 +16545,6 @@ export const de_CreateSnapshotCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateSnapshotCommandError - */ -const de_CreateSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateSnapshotsCommand */ @@ -18613,7 +16553,7 @@ export const de_CreateSnapshotsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18625,26 +16565,6 @@ export const de_CreateSnapshotsCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateSnapshotsCommandError - */ -const de_CreateSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateSpotDatafeedSubscriptionCommand */ @@ -18653,7 +16573,7 @@ export const de_CreateSpotDatafeedSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSpotDatafeedSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18665,26 +16585,6 @@ export const de_CreateSpotDatafeedSubscriptionCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateSpotDatafeedSubscriptionCommandError - */ -const de_CreateSpotDatafeedSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateStoreImageTaskCommand */ @@ -18693,7 +16593,7 @@ export const de_CreateStoreImageTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateStoreImageTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18705,26 +16605,6 @@ export const de_CreateStoreImageTaskCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateStoreImageTaskCommandError - */ -const de_CreateStoreImageTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateSubnetCommand */ @@ -18733,7 +16613,7 @@ export const de_CreateSubnetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSubnetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18745,26 +16625,6 @@ export const de_CreateSubnetCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateSubnetCommandError - */ -const de_CreateSubnetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateSubnetCidrReservationCommand */ @@ -18773,7 +16633,7 @@ export const de_CreateSubnetCidrReservationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSubnetCidrReservationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18785,26 +16645,6 @@ export const de_CreateSubnetCidrReservationCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateSubnetCidrReservationCommandError - */ -const de_CreateSubnetCidrReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateTagsCommand */ @@ -18813,7 +16653,7 @@ export const de_CreateTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTagsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateTagsCommandOutput = { @@ -18822,26 +16662,6 @@ export const de_CreateTagsCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateTagsCommandError - */ -const de_CreateTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateTrafficMirrorFilterCommand */ @@ -18850,7 +16670,7 @@ export const de_CreateTrafficMirrorFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTrafficMirrorFilterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18862,26 +16682,6 @@ export const de_CreateTrafficMirrorFilterCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateTrafficMirrorFilterCommandError - */ -const de_CreateTrafficMirrorFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateTrafficMirrorFilterRuleCommand */ @@ -18890,7 +16690,7 @@ export const de_CreateTrafficMirrorFilterRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTrafficMirrorFilterRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18902,26 +16702,6 @@ export const de_CreateTrafficMirrorFilterRuleCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateTrafficMirrorFilterRuleCommandError - */ -const de_CreateTrafficMirrorFilterRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateTrafficMirrorSessionCommand */ @@ -18930,7 +16710,7 @@ export const de_CreateTrafficMirrorSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTrafficMirrorSessionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18942,26 +16722,6 @@ export const de_CreateTrafficMirrorSessionCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateTrafficMirrorSessionCommandError - */ -const de_CreateTrafficMirrorSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateTrafficMirrorTargetCommand */ @@ -18970,7 +16730,7 @@ export const de_CreateTrafficMirrorTargetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTrafficMirrorTargetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18983,34 +16743,14 @@ export const de_CreateTrafficMirrorTargetCommand = async ( }; /** - * deserializeAws_ec2CreateTrafficMirrorTargetCommandError + * deserializeAws_ec2CreateTransitGatewayCommand */ -const de_CreateTrafficMirrorTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2CreateTransitGatewayCommand - */ -export const de_CreateTransitGatewayCommand = async ( +export const de_CreateTransitGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTransitGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19022,26 +16762,6 @@ export const de_CreateTransitGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateTransitGatewayCommandError - */ -const de_CreateTransitGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateTransitGatewayConnectCommand */ @@ -19050,7 +16770,7 @@ export const de_CreateTransitGatewayConnectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTransitGatewayConnectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19062,26 +16782,6 @@ export const de_CreateTransitGatewayConnectCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateTransitGatewayConnectCommandError - */ -const de_CreateTransitGatewayConnectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateTransitGatewayConnectPeerCommand */ @@ -19090,7 +16790,7 @@ export const de_CreateTransitGatewayConnectPeerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTransitGatewayConnectPeerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19102,26 +16802,6 @@ export const de_CreateTransitGatewayConnectPeerCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateTransitGatewayConnectPeerCommandError - */ -const de_CreateTransitGatewayConnectPeerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateTransitGatewayMulticastDomainCommand */ @@ -19130,7 +16810,7 @@ export const de_CreateTransitGatewayMulticastDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTransitGatewayMulticastDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19142,26 +16822,6 @@ export const de_CreateTransitGatewayMulticastDomainCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateTransitGatewayMulticastDomainCommandError - */ -const de_CreateTransitGatewayMulticastDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateTransitGatewayPeeringAttachmentCommand */ @@ -19170,7 +16830,7 @@ export const de_CreateTransitGatewayPeeringAttachmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTransitGatewayPeeringAttachmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19182,26 +16842,6 @@ export const de_CreateTransitGatewayPeeringAttachmentCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateTransitGatewayPeeringAttachmentCommandError - */ -const de_CreateTransitGatewayPeeringAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateTransitGatewayPolicyTableCommand */ @@ -19210,7 +16850,7 @@ export const de_CreateTransitGatewayPolicyTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTransitGatewayPolicyTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19222,26 +16862,6 @@ export const de_CreateTransitGatewayPolicyTableCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateTransitGatewayPolicyTableCommandError - */ -const de_CreateTransitGatewayPolicyTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateTransitGatewayPrefixListReferenceCommand */ @@ -19250,7 +16870,7 @@ export const de_CreateTransitGatewayPrefixListReferenceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTransitGatewayPrefixListReferenceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19262,26 +16882,6 @@ export const de_CreateTransitGatewayPrefixListReferenceCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateTransitGatewayPrefixListReferenceCommandError - */ -const de_CreateTransitGatewayPrefixListReferenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateTransitGatewayRouteCommand */ @@ -19290,7 +16890,7 @@ export const de_CreateTransitGatewayRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTransitGatewayRouteCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19302,26 +16902,6 @@ export const de_CreateTransitGatewayRouteCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateTransitGatewayRouteCommandError - */ -const de_CreateTransitGatewayRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateTransitGatewayRouteTableCommand */ @@ -19330,7 +16910,7 @@ export const de_CreateTransitGatewayRouteTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTransitGatewayRouteTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19342,26 +16922,6 @@ export const de_CreateTransitGatewayRouteTableCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateTransitGatewayRouteTableCommandError - */ -const de_CreateTransitGatewayRouteTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateTransitGatewayRouteTableAnnouncementCommand */ @@ -19370,7 +16930,7 @@ export const de_CreateTransitGatewayRouteTableAnnouncementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTransitGatewayRouteTableAnnouncementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19382,26 +16942,6 @@ export const de_CreateTransitGatewayRouteTableAnnouncementCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateTransitGatewayRouteTableAnnouncementCommandError - */ -const de_CreateTransitGatewayRouteTableAnnouncementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateTransitGatewayVpcAttachmentCommand */ @@ -19410,7 +16950,7 @@ export const de_CreateTransitGatewayVpcAttachmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTransitGatewayVpcAttachmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19422,26 +16962,6 @@ export const de_CreateTransitGatewayVpcAttachmentCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateTransitGatewayVpcAttachmentCommandError - */ -const de_CreateTransitGatewayVpcAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateVerifiedAccessEndpointCommand */ @@ -19450,7 +16970,7 @@ export const de_CreateVerifiedAccessEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVerifiedAccessEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19462,26 +16982,6 @@ export const de_CreateVerifiedAccessEndpointCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateVerifiedAccessEndpointCommandError - */ -const de_CreateVerifiedAccessEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateVerifiedAccessGroupCommand */ @@ -19490,7 +16990,7 @@ export const de_CreateVerifiedAccessGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVerifiedAccessGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19502,26 +17002,6 @@ export const de_CreateVerifiedAccessGroupCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateVerifiedAccessGroupCommandError - */ -const de_CreateVerifiedAccessGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateVerifiedAccessInstanceCommand */ @@ -19530,7 +17010,7 @@ export const de_CreateVerifiedAccessInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVerifiedAccessInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19543,34 +17023,14 @@ export const de_CreateVerifiedAccessInstanceCommand = async ( }; /** - * deserializeAws_ec2CreateVerifiedAccessInstanceCommandError + * deserializeAws_ec2CreateVerifiedAccessTrustProviderCommand */ -const de_CreateVerifiedAccessInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2CreateVerifiedAccessTrustProviderCommand - */ -export const de_CreateVerifiedAccessTrustProviderCommand = async ( +export const de_CreateVerifiedAccessTrustProviderCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVerifiedAccessTrustProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19582,26 +17042,6 @@ export const de_CreateVerifiedAccessTrustProviderCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateVerifiedAccessTrustProviderCommandError - */ -const de_CreateVerifiedAccessTrustProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateVolumeCommand */ @@ -19610,7 +17050,7 @@ export const de_CreateVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVolumeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19622,26 +17062,6 @@ export const de_CreateVolumeCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateVolumeCommandError - */ -const de_CreateVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateVpcCommand */ @@ -19650,7 +17070,7 @@ export const de_CreateVpcCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVpcCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19662,26 +17082,6 @@ export const de_CreateVpcCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateVpcCommandError - */ -const de_CreateVpcCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateVpcEndpointCommand */ @@ -19690,7 +17090,7 @@ export const de_CreateVpcEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVpcEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19702,26 +17102,6 @@ export const de_CreateVpcEndpointCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateVpcEndpointCommandError - */ -const de_CreateVpcEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateVpcEndpointConnectionNotificationCommand */ @@ -19730,7 +17110,7 @@ export const de_CreateVpcEndpointConnectionNotificationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVpcEndpointConnectionNotificationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19742,26 +17122,6 @@ export const de_CreateVpcEndpointConnectionNotificationCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateVpcEndpointConnectionNotificationCommandError - */ -const de_CreateVpcEndpointConnectionNotificationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateVpcEndpointServiceConfigurationCommand */ @@ -19770,7 +17130,7 @@ export const de_CreateVpcEndpointServiceConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVpcEndpointServiceConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19782,26 +17142,6 @@ export const de_CreateVpcEndpointServiceConfigurationCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateVpcEndpointServiceConfigurationCommandError - */ -const de_CreateVpcEndpointServiceConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateVpcPeeringConnectionCommand */ @@ -19810,7 +17150,7 @@ export const de_CreateVpcPeeringConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVpcPeeringConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19822,26 +17162,6 @@ export const de_CreateVpcPeeringConnectionCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateVpcPeeringConnectionCommandError - */ -const de_CreateVpcPeeringConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateVpnConnectionCommand */ @@ -19850,7 +17170,7 @@ export const de_CreateVpnConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVpnConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19862,26 +17182,6 @@ export const de_CreateVpnConnectionCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateVpnConnectionCommandError - */ -const de_CreateVpnConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateVpnConnectionRouteCommand */ @@ -19890,7 +17190,7 @@ export const de_CreateVpnConnectionRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVpnConnectionRouteCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateVpnConnectionRouteCommandOutput = { @@ -19899,26 +17199,6 @@ export const de_CreateVpnConnectionRouteCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateVpnConnectionRouteCommandError - */ -const de_CreateVpnConnectionRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2CreateVpnGatewayCommand */ @@ -19927,7 +17207,7 @@ export const de_CreateVpnGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVpnGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19939,26 +17219,6 @@ export const de_CreateVpnGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2CreateVpnGatewayCommandError - */ -const de_CreateVpnGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteCarrierGatewayCommand */ @@ -19967,7 +17227,7 @@ export const de_DeleteCarrierGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCarrierGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19979,26 +17239,6 @@ export const de_DeleteCarrierGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteCarrierGatewayCommandError - */ -const de_DeleteCarrierGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteClientVpnEndpointCommand */ @@ -20007,7 +17247,7 @@ export const de_DeleteClientVpnEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteClientVpnEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20019,26 +17259,6 @@ export const de_DeleteClientVpnEndpointCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteClientVpnEndpointCommandError - */ -const de_DeleteClientVpnEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteClientVpnRouteCommand */ @@ -20047,7 +17267,7 @@ export const de_DeleteClientVpnRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteClientVpnRouteCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20059,26 +17279,6 @@ export const de_DeleteClientVpnRouteCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteClientVpnRouteCommandError - */ -const de_DeleteClientVpnRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteCoipCidrCommand */ @@ -20087,7 +17287,7 @@ export const de_DeleteCoipCidrCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCoipCidrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20100,34 +17300,14 @@ export const de_DeleteCoipCidrCommand = async ( }; /** - * deserializeAws_ec2DeleteCoipCidrCommandError + * deserializeAws_ec2DeleteCoipPoolCommand */ -const de_DeleteCoipCidrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DeleteCoipPoolCommand - */ -export const de_DeleteCoipPoolCommand = async ( +export const de_DeleteCoipPoolCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCoipPoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20139,26 +17319,6 @@ export const de_DeleteCoipPoolCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteCoipPoolCommandError - */ -const de_DeleteCoipPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteCustomerGatewayCommand */ @@ -20167,7 +17327,7 @@ export const de_DeleteCustomerGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCustomerGatewayCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteCustomerGatewayCommandOutput = { @@ -20176,26 +17336,6 @@ export const de_DeleteCustomerGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteCustomerGatewayCommandError - */ -const de_DeleteCustomerGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteDhcpOptionsCommand */ @@ -20204,7 +17344,7 @@ export const de_DeleteDhcpOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDhcpOptionsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteDhcpOptionsCommandOutput = { @@ -20213,26 +17353,6 @@ export const de_DeleteDhcpOptionsCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteDhcpOptionsCommandError - */ -const de_DeleteDhcpOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteEgressOnlyInternetGatewayCommand */ @@ -20241,7 +17361,7 @@ export const de_DeleteEgressOnlyInternetGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEgressOnlyInternetGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20253,26 +17373,6 @@ export const de_DeleteEgressOnlyInternetGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteEgressOnlyInternetGatewayCommandError - */ -const de_DeleteEgressOnlyInternetGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteFleetsCommand */ @@ -20281,7 +17381,7 @@ export const de_DeleteFleetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteFleetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20293,26 +17393,6 @@ export const de_DeleteFleetsCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteFleetsCommandError - */ -const de_DeleteFleetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteFlowLogsCommand */ @@ -20321,7 +17401,7 @@ export const de_DeleteFlowLogsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteFlowLogsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20333,26 +17413,6 @@ export const de_DeleteFlowLogsCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteFlowLogsCommandError - */ -const de_DeleteFlowLogsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteFpgaImageCommand */ @@ -20361,7 +17421,7 @@ export const de_DeleteFpgaImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteFpgaImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20373,26 +17433,6 @@ export const de_DeleteFpgaImageCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteFpgaImageCommandError - */ -const de_DeleteFpgaImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteInstanceConnectEndpointCommand */ @@ -20401,7 +17441,7 @@ export const de_DeleteInstanceConnectEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteInstanceConnectEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20413,26 +17453,6 @@ export const de_DeleteInstanceConnectEndpointCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteInstanceConnectEndpointCommandError - */ -const de_DeleteInstanceConnectEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteInstanceEventWindowCommand */ @@ -20441,7 +17461,7 @@ export const de_DeleteInstanceEventWindowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteInstanceEventWindowCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20453,26 +17473,6 @@ export const de_DeleteInstanceEventWindowCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteInstanceEventWindowCommandError - */ -const de_DeleteInstanceEventWindowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteInternetGatewayCommand */ @@ -20481,7 +17481,7 @@ export const de_DeleteInternetGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteInternetGatewayCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteInternetGatewayCommandOutput = { @@ -20490,26 +17490,6 @@ export const de_DeleteInternetGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteInternetGatewayCommandError - */ -const de_DeleteInternetGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteIpamCommand */ @@ -20518,7 +17498,7 @@ export const de_DeleteIpamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteIpamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20530,26 +17510,6 @@ export const de_DeleteIpamCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteIpamCommandError - */ -const de_DeleteIpamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteIpamPoolCommand */ @@ -20558,7 +17518,7 @@ export const de_DeleteIpamPoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteIpamPoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20570,26 +17530,6 @@ export const de_DeleteIpamPoolCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteIpamPoolCommandError - */ -const de_DeleteIpamPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteIpamResourceDiscoveryCommand */ @@ -20598,7 +17538,7 @@ export const de_DeleteIpamResourceDiscoveryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteIpamResourceDiscoveryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20610,26 +17550,6 @@ export const de_DeleteIpamResourceDiscoveryCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteIpamResourceDiscoveryCommandError - */ -const de_DeleteIpamResourceDiscoveryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteIpamScopeCommand */ @@ -20638,7 +17558,7 @@ export const de_DeleteIpamScopeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteIpamScopeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20651,34 +17571,14 @@ export const de_DeleteIpamScopeCommand = async ( }; /** - * deserializeAws_ec2DeleteIpamScopeCommandError + * deserializeAws_ec2DeleteKeyPairCommand */ -const de_DeleteIpamScopeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DeleteKeyPairCommand - */ -export const de_DeleteKeyPairCommand = async ( +export const de_DeleteKeyPairCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteKeyPairCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20690,26 +17590,6 @@ export const de_DeleteKeyPairCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteKeyPairCommandError - */ -const de_DeleteKeyPairCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteLaunchTemplateCommand */ @@ -20718,7 +17598,7 @@ export const de_DeleteLaunchTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLaunchTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20730,26 +17610,6 @@ export const de_DeleteLaunchTemplateCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteLaunchTemplateCommandError - */ -const de_DeleteLaunchTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteLaunchTemplateVersionsCommand */ @@ -20758,7 +17618,7 @@ export const de_DeleteLaunchTemplateVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLaunchTemplateVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20770,26 +17630,6 @@ export const de_DeleteLaunchTemplateVersionsCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteLaunchTemplateVersionsCommandError - */ -const de_DeleteLaunchTemplateVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteLocalGatewayRouteCommand */ @@ -20798,7 +17638,7 @@ export const de_DeleteLocalGatewayRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLocalGatewayRouteCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20810,26 +17650,6 @@ export const de_DeleteLocalGatewayRouteCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteLocalGatewayRouteCommandError - */ -const de_DeleteLocalGatewayRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteLocalGatewayRouteTableCommand */ @@ -20838,7 +17658,7 @@ export const de_DeleteLocalGatewayRouteTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLocalGatewayRouteTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20850,26 +17670,6 @@ export const de_DeleteLocalGatewayRouteTableCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteLocalGatewayRouteTableCommandError - */ -const de_DeleteLocalGatewayRouteTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationCommand */ @@ -20878,7 +17678,7 @@ export const de_DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationComm context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20890,26 +17690,6 @@ export const de_DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationComm return response; }; -/** - * deserializeAws_ec2DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationCommandError - */ -const de_DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteLocalGatewayRouteTableVpcAssociationCommand */ @@ -20918,7 +17698,7 @@ export const de_DeleteLocalGatewayRouteTableVpcAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLocalGatewayRouteTableVpcAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20930,26 +17710,6 @@ export const de_DeleteLocalGatewayRouteTableVpcAssociationCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteLocalGatewayRouteTableVpcAssociationCommandError - */ -const de_DeleteLocalGatewayRouteTableVpcAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteManagedPrefixListCommand */ @@ -20958,7 +17718,7 @@ export const de_DeleteManagedPrefixListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteManagedPrefixListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20970,26 +17730,6 @@ export const de_DeleteManagedPrefixListCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteManagedPrefixListCommandError - */ -const de_DeleteManagedPrefixListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteNatGatewayCommand */ @@ -20998,7 +17738,7 @@ export const de_DeleteNatGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNatGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -21010,26 +17750,6 @@ export const de_DeleteNatGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteNatGatewayCommandError - */ -const de_DeleteNatGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteNetworkAclCommand */ @@ -21038,7 +17758,7 @@ export const de_DeleteNetworkAclCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNetworkAclCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteNetworkAclCommandOutput = { @@ -21047,26 +17767,6 @@ export const de_DeleteNetworkAclCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteNetworkAclCommandError - */ -const de_DeleteNetworkAclCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteNetworkAclEntryCommand */ @@ -21075,7 +17775,7 @@ export const de_DeleteNetworkAclEntryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNetworkAclEntryCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteNetworkAclEntryCommandOutput = { @@ -21084,26 +17784,6 @@ export const de_DeleteNetworkAclEntryCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteNetworkAclEntryCommandError - */ -const de_DeleteNetworkAclEntryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteNetworkInsightsAccessScopeCommand */ @@ -21112,7 +17792,7 @@ export const de_DeleteNetworkInsightsAccessScopeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNetworkInsightsAccessScopeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -21124,26 +17804,6 @@ export const de_DeleteNetworkInsightsAccessScopeCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteNetworkInsightsAccessScopeCommandError - */ -const de_DeleteNetworkInsightsAccessScopeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteNetworkInsightsAccessScopeAnalysisCommand */ @@ -21152,7 +17812,7 @@ export const de_DeleteNetworkInsightsAccessScopeAnalysisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNetworkInsightsAccessScopeAnalysisCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -21164,26 +17824,6 @@ export const de_DeleteNetworkInsightsAccessScopeAnalysisCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteNetworkInsightsAccessScopeAnalysisCommandError - */ -const de_DeleteNetworkInsightsAccessScopeAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteNetworkInsightsAnalysisCommand */ @@ -21192,7 +17832,7 @@ export const de_DeleteNetworkInsightsAnalysisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNetworkInsightsAnalysisCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -21205,34 +17845,14 @@ export const de_DeleteNetworkInsightsAnalysisCommand = async ( }; /** - * deserializeAws_ec2DeleteNetworkInsightsAnalysisCommandError + * deserializeAws_ec2DeleteNetworkInsightsPathCommand */ -const de_DeleteNetworkInsightsAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DeleteNetworkInsightsPathCommand - */ -export const de_DeleteNetworkInsightsPathCommand = async ( +export const de_DeleteNetworkInsightsPathCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNetworkInsightsPathCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -21244,26 +17864,6 @@ export const de_DeleteNetworkInsightsPathCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteNetworkInsightsPathCommandError - */ -const de_DeleteNetworkInsightsPathCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteNetworkInterfaceCommand */ @@ -21272,7 +17872,7 @@ export const de_DeleteNetworkInterfaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNetworkInterfaceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteNetworkInterfaceCommandOutput = { @@ -21281,26 +17881,6 @@ export const de_DeleteNetworkInterfaceCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteNetworkInterfaceCommandError - */ -const de_DeleteNetworkInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteNetworkInterfacePermissionCommand */ @@ -21309,7 +17889,7 @@ export const de_DeleteNetworkInterfacePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNetworkInterfacePermissionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -21321,26 +17901,6 @@ export const de_DeleteNetworkInterfacePermissionCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteNetworkInterfacePermissionCommandError - */ -const de_DeleteNetworkInterfacePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeletePlacementGroupCommand */ @@ -21349,7 +17909,7 @@ export const de_DeletePlacementGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePlacementGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeletePlacementGroupCommandOutput = { @@ -21358,26 +17918,6 @@ export const de_DeletePlacementGroupCommand = async ( return response; }; -/** - * deserializeAws_ec2DeletePlacementGroupCommandError - */ -const de_DeletePlacementGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeletePublicIpv4PoolCommand */ @@ -21386,7 +17926,7 @@ export const de_DeletePublicIpv4PoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePublicIpv4PoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -21398,26 +17938,6 @@ export const de_DeletePublicIpv4PoolCommand = async ( return response; }; -/** - * deserializeAws_ec2DeletePublicIpv4PoolCommandError - */ -const de_DeletePublicIpv4PoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteQueuedReservedInstancesCommand */ @@ -21426,7 +17946,7 @@ export const de_DeleteQueuedReservedInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteQueuedReservedInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -21438,26 +17958,6 @@ export const de_DeleteQueuedReservedInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteQueuedReservedInstancesCommandError - */ -const de_DeleteQueuedReservedInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteRouteCommand */ @@ -21466,7 +17966,7 @@ export const de_DeleteRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRouteCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteRouteCommandOutput = { @@ -21475,26 +17975,6 @@ export const de_DeleteRouteCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteRouteCommandError - */ -const de_DeleteRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteRouteTableCommand */ @@ -21503,7 +17983,7 @@ export const de_DeleteRouteTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRouteTableCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteRouteTableCommandOutput = { @@ -21512,26 +17992,6 @@ export const de_DeleteRouteTableCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteRouteTableCommandError - */ -const de_DeleteRouteTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteSecurityGroupCommand */ @@ -21540,7 +18000,7 @@ export const de_DeleteSecurityGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSecurityGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteSecurityGroupCommandOutput = { @@ -21549,26 +18009,6 @@ export const de_DeleteSecurityGroupCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteSecurityGroupCommandError - */ -const de_DeleteSecurityGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteSnapshotCommand */ @@ -21577,7 +18017,7 @@ export const de_DeleteSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSnapshotCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteSnapshotCommandOutput = { @@ -21586,26 +18026,6 @@ export const de_DeleteSnapshotCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteSnapshotCommandError - */ -const de_DeleteSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteSpotDatafeedSubscriptionCommand */ @@ -21614,7 +18034,7 @@ export const de_DeleteSpotDatafeedSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSpotDatafeedSubscriptionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteSpotDatafeedSubscriptionCommandOutput = { @@ -21623,26 +18043,6 @@ export const de_DeleteSpotDatafeedSubscriptionCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteSpotDatafeedSubscriptionCommandError - */ -const de_DeleteSpotDatafeedSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteSubnetCommand */ @@ -21651,7 +18051,7 @@ export const de_DeleteSubnetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSubnetCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteSubnetCommandOutput = { @@ -21660,26 +18060,6 @@ export const de_DeleteSubnetCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteSubnetCommandError - */ -const de_DeleteSubnetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteSubnetCidrReservationCommand */ @@ -21688,7 +18068,7 @@ export const de_DeleteSubnetCidrReservationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSubnetCidrReservationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -21700,26 +18080,6 @@ export const de_DeleteSubnetCidrReservationCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteSubnetCidrReservationCommandError - */ -const de_DeleteSubnetCidrReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteTagsCommand */ @@ -21728,7 +18088,7 @@ export const de_DeleteTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTagsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteTagsCommandOutput = { @@ -21738,34 +18098,14 @@ export const de_DeleteTagsCommand = async ( }; /** - * deserializeAws_ec2DeleteTagsCommandError + * deserializeAws_ec2DeleteTrafficMirrorFilterCommand */ -const de_DeleteTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DeleteTrafficMirrorFilterCommand - */ -export const de_DeleteTrafficMirrorFilterCommand = async ( +export const de_DeleteTrafficMirrorFilterCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTrafficMirrorFilterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -21777,26 +18117,6 @@ export const de_DeleteTrafficMirrorFilterCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteTrafficMirrorFilterCommandError - */ -const de_DeleteTrafficMirrorFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteTrafficMirrorFilterRuleCommand */ @@ -21805,7 +18125,7 @@ export const de_DeleteTrafficMirrorFilterRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTrafficMirrorFilterRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -21817,26 +18137,6 @@ export const de_DeleteTrafficMirrorFilterRuleCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteTrafficMirrorFilterRuleCommandError - */ -const de_DeleteTrafficMirrorFilterRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteTrafficMirrorSessionCommand */ @@ -21845,7 +18145,7 @@ export const de_DeleteTrafficMirrorSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTrafficMirrorSessionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -21857,26 +18157,6 @@ export const de_DeleteTrafficMirrorSessionCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteTrafficMirrorSessionCommandError - */ -const de_DeleteTrafficMirrorSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteTrafficMirrorTargetCommand */ @@ -21885,7 +18165,7 @@ export const de_DeleteTrafficMirrorTargetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTrafficMirrorTargetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -21897,26 +18177,6 @@ export const de_DeleteTrafficMirrorTargetCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteTrafficMirrorTargetCommandError - */ -const de_DeleteTrafficMirrorTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteTransitGatewayCommand */ @@ -21925,7 +18185,7 @@ export const de_DeleteTransitGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTransitGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -21937,26 +18197,6 @@ export const de_DeleteTransitGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteTransitGatewayCommandError - */ -const de_DeleteTransitGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteTransitGatewayConnectCommand */ @@ -21965,7 +18205,7 @@ export const de_DeleteTransitGatewayConnectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTransitGatewayConnectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -21977,26 +18217,6 @@ export const de_DeleteTransitGatewayConnectCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteTransitGatewayConnectCommandError - */ -const de_DeleteTransitGatewayConnectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteTransitGatewayConnectPeerCommand */ @@ -22005,7 +18225,7 @@ export const de_DeleteTransitGatewayConnectPeerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTransitGatewayConnectPeerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22017,26 +18237,6 @@ export const de_DeleteTransitGatewayConnectPeerCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteTransitGatewayConnectPeerCommandError - */ -const de_DeleteTransitGatewayConnectPeerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteTransitGatewayMulticastDomainCommand */ @@ -22045,7 +18245,7 @@ export const de_DeleteTransitGatewayMulticastDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTransitGatewayMulticastDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22057,26 +18257,6 @@ export const de_DeleteTransitGatewayMulticastDomainCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteTransitGatewayMulticastDomainCommandError - */ -const de_DeleteTransitGatewayMulticastDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteTransitGatewayPeeringAttachmentCommand */ @@ -22085,7 +18265,7 @@ export const de_DeleteTransitGatewayPeeringAttachmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTransitGatewayPeeringAttachmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22097,26 +18277,6 @@ export const de_DeleteTransitGatewayPeeringAttachmentCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteTransitGatewayPeeringAttachmentCommandError - */ -const de_DeleteTransitGatewayPeeringAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteTransitGatewayPolicyTableCommand */ @@ -22125,7 +18285,7 @@ export const de_DeleteTransitGatewayPolicyTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTransitGatewayPolicyTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22137,26 +18297,6 @@ export const de_DeleteTransitGatewayPolicyTableCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteTransitGatewayPolicyTableCommandError - */ -const de_DeleteTransitGatewayPolicyTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteTransitGatewayPrefixListReferenceCommand */ @@ -22165,7 +18305,7 @@ export const de_DeleteTransitGatewayPrefixListReferenceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTransitGatewayPrefixListReferenceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22177,26 +18317,6 @@ export const de_DeleteTransitGatewayPrefixListReferenceCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteTransitGatewayPrefixListReferenceCommandError - */ -const de_DeleteTransitGatewayPrefixListReferenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteTransitGatewayRouteCommand */ @@ -22205,7 +18325,7 @@ export const de_DeleteTransitGatewayRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTransitGatewayRouteCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22217,26 +18337,6 @@ export const de_DeleteTransitGatewayRouteCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteTransitGatewayRouteCommandError - */ -const de_DeleteTransitGatewayRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteTransitGatewayRouteTableCommand */ @@ -22245,7 +18345,7 @@ export const de_DeleteTransitGatewayRouteTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTransitGatewayRouteTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22257,26 +18357,6 @@ export const de_DeleteTransitGatewayRouteTableCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteTransitGatewayRouteTableCommandError - */ -const de_DeleteTransitGatewayRouteTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteTransitGatewayRouteTableAnnouncementCommand */ @@ -22285,7 +18365,7 @@ export const de_DeleteTransitGatewayRouteTableAnnouncementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTransitGatewayRouteTableAnnouncementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22298,34 +18378,14 @@ export const de_DeleteTransitGatewayRouteTableAnnouncementCommand = async ( }; /** - * deserializeAws_ec2DeleteTransitGatewayRouteTableAnnouncementCommandError + * deserializeAws_ec2DeleteTransitGatewayVpcAttachmentCommand */ -const de_DeleteTransitGatewayRouteTableAnnouncementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DeleteTransitGatewayVpcAttachmentCommand - */ -export const de_DeleteTransitGatewayVpcAttachmentCommand = async ( +export const de_DeleteTransitGatewayVpcAttachmentCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTransitGatewayVpcAttachmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22337,26 +18397,6 @@ export const de_DeleteTransitGatewayVpcAttachmentCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteTransitGatewayVpcAttachmentCommandError - */ -const de_DeleteTransitGatewayVpcAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteVerifiedAccessEndpointCommand */ @@ -22365,7 +18405,7 @@ export const de_DeleteVerifiedAccessEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVerifiedAccessEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22377,26 +18417,6 @@ export const de_DeleteVerifiedAccessEndpointCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteVerifiedAccessEndpointCommandError - */ -const de_DeleteVerifiedAccessEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteVerifiedAccessGroupCommand */ @@ -22405,7 +18425,7 @@ export const de_DeleteVerifiedAccessGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVerifiedAccessGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22417,26 +18437,6 @@ export const de_DeleteVerifiedAccessGroupCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteVerifiedAccessGroupCommandError - */ -const de_DeleteVerifiedAccessGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteVerifiedAccessInstanceCommand */ @@ -22445,7 +18445,7 @@ export const de_DeleteVerifiedAccessInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVerifiedAccessInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22457,26 +18457,6 @@ export const de_DeleteVerifiedAccessInstanceCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteVerifiedAccessInstanceCommandError - */ -const de_DeleteVerifiedAccessInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteVerifiedAccessTrustProviderCommand */ @@ -22485,7 +18465,7 @@ export const de_DeleteVerifiedAccessTrustProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVerifiedAccessTrustProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22497,26 +18477,6 @@ export const de_DeleteVerifiedAccessTrustProviderCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteVerifiedAccessTrustProviderCommandError - */ -const de_DeleteVerifiedAccessTrustProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteVolumeCommand */ @@ -22525,7 +18485,7 @@ export const de_DeleteVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVolumeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteVolumeCommandOutput = { @@ -22534,26 +18494,6 @@ export const de_DeleteVolumeCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteVolumeCommandError - */ -const de_DeleteVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteVpcCommand */ @@ -22562,7 +18502,7 @@ export const de_DeleteVpcCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVpcCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteVpcCommandOutput = { @@ -22571,26 +18511,6 @@ export const de_DeleteVpcCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteVpcCommandError - */ -const de_DeleteVpcCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteVpcEndpointConnectionNotificationsCommand */ @@ -22599,7 +18519,7 @@ export const de_DeleteVpcEndpointConnectionNotificationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVpcEndpointConnectionNotificationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22611,26 +18531,6 @@ export const de_DeleteVpcEndpointConnectionNotificationsCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteVpcEndpointConnectionNotificationsCommandError - */ -const de_DeleteVpcEndpointConnectionNotificationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteVpcEndpointsCommand */ @@ -22639,7 +18539,7 @@ export const de_DeleteVpcEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVpcEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22651,26 +18551,6 @@ export const de_DeleteVpcEndpointsCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteVpcEndpointsCommandError - */ -const de_DeleteVpcEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteVpcEndpointServiceConfigurationsCommand */ @@ -22679,7 +18559,7 @@ export const de_DeleteVpcEndpointServiceConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVpcEndpointServiceConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22691,26 +18571,6 @@ export const de_DeleteVpcEndpointServiceConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteVpcEndpointServiceConfigurationsCommandError - */ -const de_DeleteVpcEndpointServiceConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteVpcPeeringConnectionCommand */ @@ -22719,7 +18579,7 @@ export const de_DeleteVpcPeeringConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVpcPeeringConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22731,26 +18591,6 @@ export const de_DeleteVpcPeeringConnectionCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteVpcPeeringConnectionCommandError - */ -const de_DeleteVpcPeeringConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteVpnConnectionCommand */ @@ -22759,7 +18599,7 @@ export const de_DeleteVpnConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVpnConnectionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteVpnConnectionCommandOutput = { @@ -22768,26 +18608,6 @@ export const de_DeleteVpnConnectionCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteVpnConnectionCommandError - */ -const de_DeleteVpnConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteVpnConnectionRouteCommand */ @@ -22796,7 +18616,7 @@ export const de_DeleteVpnConnectionRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVpnConnectionRouteCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteVpnConnectionRouteCommandOutput = { @@ -22805,26 +18625,6 @@ export const de_DeleteVpnConnectionRouteCommand = async ( return response; }; -/** - * deserializeAws_ec2DeleteVpnConnectionRouteCommandError - */ -const de_DeleteVpnConnectionRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeleteVpnGatewayCommand */ @@ -22833,7 +18633,7 @@ export const de_DeleteVpnGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVpnGatewayCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteVpnGatewayCommandOutput = { @@ -22843,34 +18643,14 @@ export const de_DeleteVpnGatewayCommand = async ( }; /** - * deserializeAws_ec2DeleteVpnGatewayCommandError + * deserializeAws_ec2DeprovisionByoipCidrCommand */ -const de_DeleteVpnGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DeprovisionByoipCidrCommand - */ -export const de_DeprovisionByoipCidrCommand = async ( +export const de_DeprovisionByoipCidrCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeprovisionByoipCidrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22882,26 +18662,6 @@ export const de_DeprovisionByoipCidrCommand = async ( return response; }; -/** - * deserializeAws_ec2DeprovisionByoipCidrCommandError - */ -const de_DeprovisionByoipCidrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeprovisionIpamByoasnCommand */ @@ -22910,7 +18670,7 @@ export const de_DeprovisionIpamByoasnCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeprovisionIpamByoasnCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22922,26 +18682,6 @@ export const de_DeprovisionIpamByoasnCommand = async ( return response; }; -/** - * deserializeAws_ec2DeprovisionIpamByoasnCommandError - */ -const de_DeprovisionIpamByoasnCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeprovisionIpamPoolCidrCommand */ @@ -22950,7 +18690,7 @@ export const de_DeprovisionIpamPoolCidrCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeprovisionIpamPoolCidrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -22962,26 +18702,6 @@ export const de_DeprovisionIpamPoolCidrCommand = async ( return response; }; -/** - * deserializeAws_ec2DeprovisionIpamPoolCidrCommandError - */ -const de_DeprovisionIpamPoolCidrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeprovisionPublicIpv4PoolCidrCommand */ @@ -22990,7 +18710,7 @@ export const de_DeprovisionPublicIpv4PoolCidrCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeprovisionPublicIpv4PoolCidrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23002,26 +18722,6 @@ export const de_DeprovisionPublicIpv4PoolCidrCommand = async ( return response; }; -/** - * deserializeAws_ec2DeprovisionPublicIpv4PoolCidrCommandError - */ -const de_DeprovisionPublicIpv4PoolCidrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeregisterImageCommand */ @@ -23030,7 +18730,7 @@ export const de_DeregisterImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterImageCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeregisterImageCommandOutput = { @@ -23039,26 +18739,6 @@ export const de_DeregisterImageCommand = async ( return response; }; -/** - * deserializeAws_ec2DeregisterImageCommandError - */ -const de_DeregisterImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeregisterInstanceEventNotificationAttributesCommand */ @@ -23067,7 +18747,7 @@ export const de_DeregisterInstanceEventNotificationAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterInstanceEventNotificationAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23079,26 +18759,6 @@ export const de_DeregisterInstanceEventNotificationAttributesCommand = async ( return response; }; -/** - * deserializeAws_ec2DeregisterInstanceEventNotificationAttributesCommandError - */ -const de_DeregisterInstanceEventNotificationAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeregisterTransitGatewayMulticastGroupMembersCommand */ @@ -23107,7 +18767,7 @@ export const de_DeregisterTransitGatewayMulticastGroupMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterTransitGatewayMulticastGroupMembersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23119,26 +18779,6 @@ export const de_DeregisterTransitGatewayMulticastGroupMembersCommand = async ( return response; }; -/** - * deserializeAws_ec2DeregisterTransitGatewayMulticastGroupMembersCommandError - */ -const de_DeregisterTransitGatewayMulticastGroupMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DeregisterTransitGatewayMulticastGroupSourcesCommand */ @@ -23147,7 +18787,7 @@ export const de_DeregisterTransitGatewayMulticastGroupSourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterTransitGatewayMulticastGroupSourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23159,26 +18799,6 @@ export const de_DeregisterTransitGatewayMulticastGroupSourcesCommand = async ( return response; }; -/** - * deserializeAws_ec2DeregisterTransitGatewayMulticastGroupSourcesCommandError - */ -const de_DeregisterTransitGatewayMulticastGroupSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeAccountAttributesCommand */ @@ -23187,7 +18807,7 @@ export const de_DescribeAccountAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAccountAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23199,26 +18819,6 @@ export const de_DescribeAccountAttributesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeAccountAttributesCommandError - */ -const de_DescribeAccountAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeAddressesCommand */ @@ -23227,7 +18827,7 @@ export const de_DescribeAddressesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAddressesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23239,26 +18839,6 @@ export const de_DescribeAddressesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeAddressesCommandError - */ -const de_DescribeAddressesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeAddressesAttributeCommand */ @@ -23267,7 +18847,7 @@ export const de_DescribeAddressesAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAddressesAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23279,26 +18859,6 @@ export const de_DescribeAddressesAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeAddressesAttributeCommandError - */ -const de_DescribeAddressesAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeAddressTransfersCommand */ @@ -23307,7 +18867,7 @@ export const de_DescribeAddressTransfersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAddressTransfersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23319,26 +18879,6 @@ export const de_DescribeAddressTransfersCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeAddressTransfersCommandError - */ -const de_DescribeAddressTransfersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeAggregateIdFormatCommand */ @@ -23347,7 +18887,7 @@ export const de_DescribeAggregateIdFormatCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAggregateIdFormatCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23359,26 +18899,6 @@ export const de_DescribeAggregateIdFormatCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeAggregateIdFormatCommandError - */ -const de_DescribeAggregateIdFormatCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeAvailabilityZonesCommand */ @@ -23387,7 +18907,7 @@ export const de_DescribeAvailabilityZonesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAvailabilityZonesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23400,34 +18920,14 @@ export const de_DescribeAvailabilityZonesCommand = async ( }; /** - * deserializeAws_ec2DescribeAvailabilityZonesCommandError + * deserializeAws_ec2DescribeAwsNetworkPerformanceMetricSubscriptionsCommand */ -const de_DescribeAvailabilityZonesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DescribeAwsNetworkPerformanceMetricSubscriptionsCommand - */ -export const de_DescribeAwsNetworkPerformanceMetricSubscriptionsCommand = async ( +export const de_DescribeAwsNetworkPerformanceMetricSubscriptionsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAwsNetworkPerformanceMetricSubscriptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23439,26 +18939,6 @@ export const de_DescribeAwsNetworkPerformanceMetricSubscriptionsCommand = async return response; }; -/** - * deserializeAws_ec2DescribeAwsNetworkPerformanceMetricSubscriptionsCommandError - */ -const de_DescribeAwsNetworkPerformanceMetricSubscriptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeBundleTasksCommand */ @@ -23467,7 +18947,7 @@ export const de_DescribeBundleTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBundleTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23479,26 +18959,6 @@ export const de_DescribeBundleTasksCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeBundleTasksCommandError - */ -const de_DescribeBundleTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeByoipCidrsCommand */ @@ -23507,7 +18967,7 @@ export const de_DescribeByoipCidrsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeByoipCidrsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23519,26 +18979,6 @@ export const de_DescribeByoipCidrsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeByoipCidrsCommandError - */ -const de_DescribeByoipCidrsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeCapacityBlockOfferingsCommand */ @@ -23547,7 +18987,7 @@ export const de_DescribeCapacityBlockOfferingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCapacityBlockOfferingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23559,26 +18999,6 @@ export const de_DescribeCapacityBlockOfferingsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeCapacityBlockOfferingsCommandError - */ -const de_DescribeCapacityBlockOfferingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeCapacityReservationFleetsCommand */ @@ -23587,7 +19007,7 @@ export const de_DescribeCapacityReservationFleetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCapacityReservationFleetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23599,26 +19019,6 @@ export const de_DescribeCapacityReservationFleetsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeCapacityReservationFleetsCommandError - */ -const de_DescribeCapacityReservationFleetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeCapacityReservationsCommand */ @@ -23627,7 +19027,7 @@ export const de_DescribeCapacityReservationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCapacityReservationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23639,26 +19039,6 @@ export const de_DescribeCapacityReservationsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeCapacityReservationsCommandError - */ -const de_DescribeCapacityReservationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeCarrierGatewaysCommand */ @@ -23667,7 +19047,7 @@ export const de_DescribeCarrierGatewaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCarrierGatewaysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23679,26 +19059,6 @@ export const de_DescribeCarrierGatewaysCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeCarrierGatewaysCommandError - */ -const de_DescribeCarrierGatewaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeClassicLinkInstancesCommand */ @@ -23707,7 +19067,7 @@ export const de_DescribeClassicLinkInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeClassicLinkInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23719,26 +19079,6 @@ export const de_DescribeClassicLinkInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeClassicLinkInstancesCommandError - */ -const de_DescribeClassicLinkInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeClientVpnAuthorizationRulesCommand */ @@ -23747,7 +19087,7 @@ export const de_DescribeClientVpnAuthorizationRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeClientVpnAuthorizationRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23759,26 +19099,6 @@ export const de_DescribeClientVpnAuthorizationRulesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeClientVpnAuthorizationRulesCommandError - */ -const de_DescribeClientVpnAuthorizationRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeClientVpnConnectionsCommand */ @@ -23787,7 +19107,7 @@ export const de_DescribeClientVpnConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeClientVpnConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23799,26 +19119,6 @@ export const de_DescribeClientVpnConnectionsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeClientVpnConnectionsCommandError - */ -const de_DescribeClientVpnConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeClientVpnEndpointsCommand */ @@ -23827,7 +19127,7 @@ export const de_DescribeClientVpnEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeClientVpnEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23839,26 +19139,6 @@ export const de_DescribeClientVpnEndpointsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeClientVpnEndpointsCommandError - */ -const de_DescribeClientVpnEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeClientVpnRoutesCommand */ @@ -23867,7 +19147,7 @@ export const de_DescribeClientVpnRoutesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeClientVpnRoutesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23879,26 +19159,6 @@ export const de_DescribeClientVpnRoutesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeClientVpnRoutesCommandError - */ -const de_DescribeClientVpnRoutesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeClientVpnTargetNetworksCommand */ @@ -23907,7 +19167,7 @@ export const de_DescribeClientVpnTargetNetworksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeClientVpnTargetNetworksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23919,26 +19179,6 @@ export const de_DescribeClientVpnTargetNetworksCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeClientVpnTargetNetworksCommandError - */ -const de_DescribeClientVpnTargetNetworksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeCoipPoolsCommand */ @@ -23947,7 +19187,7 @@ export const de_DescribeCoipPoolsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCoipPoolsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23960,34 +19200,14 @@ export const de_DescribeCoipPoolsCommand = async ( }; /** - * deserializeAws_ec2DescribeCoipPoolsCommandError + * deserializeAws_ec2DescribeConversionTasksCommand */ -const de_DescribeCoipPoolsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DescribeConversionTasksCommand - */ -export const de_DescribeConversionTasksCommand = async ( +export const de_DescribeConversionTasksCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConversionTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -23999,26 +19219,6 @@ export const de_DescribeConversionTasksCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeConversionTasksCommandError - */ -const de_DescribeConversionTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeCustomerGatewaysCommand */ @@ -24027,7 +19227,7 @@ export const de_DescribeCustomerGatewaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCustomerGatewaysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24039,26 +19239,6 @@ export const de_DescribeCustomerGatewaysCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeCustomerGatewaysCommandError - */ -const de_DescribeCustomerGatewaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeDhcpOptionsCommand */ @@ -24067,7 +19247,7 @@ export const de_DescribeDhcpOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDhcpOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24079,26 +19259,6 @@ export const de_DescribeDhcpOptionsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeDhcpOptionsCommandError - */ -const de_DescribeDhcpOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeEgressOnlyInternetGatewaysCommand */ @@ -24107,7 +19267,7 @@ export const de_DescribeEgressOnlyInternetGatewaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEgressOnlyInternetGatewaysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24119,26 +19279,6 @@ export const de_DescribeEgressOnlyInternetGatewaysCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeEgressOnlyInternetGatewaysCommandError - */ -const de_DescribeEgressOnlyInternetGatewaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeElasticGpusCommand */ @@ -24147,7 +19287,7 @@ export const de_DescribeElasticGpusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeElasticGpusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24159,26 +19299,6 @@ export const de_DescribeElasticGpusCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeElasticGpusCommandError - */ -const de_DescribeElasticGpusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeExportImageTasksCommand */ @@ -24187,7 +19307,7 @@ export const de_DescribeExportImageTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeExportImageTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24199,26 +19319,6 @@ export const de_DescribeExportImageTasksCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeExportImageTasksCommandError - */ -const de_DescribeExportImageTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeExportTasksCommand */ @@ -24227,7 +19327,7 @@ export const de_DescribeExportTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeExportTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24239,26 +19339,6 @@ export const de_DescribeExportTasksCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeExportTasksCommandError - */ -const de_DescribeExportTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeFastLaunchImagesCommand */ @@ -24267,7 +19347,7 @@ export const de_DescribeFastLaunchImagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFastLaunchImagesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24279,26 +19359,6 @@ export const de_DescribeFastLaunchImagesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeFastLaunchImagesCommandError - */ -const de_DescribeFastLaunchImagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeFastSnapshotRestoresCommand */ @@ -24307,7 +19367,7 @@ export const de_DescribeFastSnapshotRestoresCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFastSnapshotRestoresCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24319,26 +19379,6 @@ export const de_DescribeFastSnapshotRestoresCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeFastSnapshotRestoresCommandError - */ -const de_DescribeFastSnapshotRestoresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeFleetHistoryCommand */ @@ -24347,7 +19387,7 @@ export const de_DescribeFleetHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFleetHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24359,26 +19399,6 @@ export const de_DescribeFleetHistoryCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeFleetHistoryCommandError - */ -const de_DescribeFleetHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeFleetInstancesCommand */ @@ -24387,7 +19407,7 @@ export const de_DescribeFleetInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFleetInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24399,26 +19419,6 @@ export const de_DescribeFleetInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeFleetInstancesCommandError - */ -const de_DescribeFleetInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeFleetsCommand */ @@ -24427,7 +19427,7 @@ export const de_DescribeFleetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFleetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24439,26 +19439,6 @@ export const de_DescribeFleetsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeFleetsCommandError - */ -const de_DescribeFleetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeFlowLogsCommand */ @@ -24467,7 +19447,7 @@ export const de_DescribeFlowLogsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFlowLogsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24479,26 +19459,6 @@ export const de_DescribeFlowLogsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeFlowLogsCommandError - */ -const de_DescribeFlowLogsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeFpgaImageAttributeCommand */ @@ -24507,7 +19467,7 @@ export const de_DescribeFpgaImageAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFpgaImageAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24520,34 +19480,14 @@ export const de_DescribeFpgaImageAttributeCommand = async ( }; /** - * deserializeAws_ec2DescribeFpgaImageAttributeCommandError + * deserializeAws_ec2DescribeFpgaImagesCommand */ -const de_DescribeFpgaImageAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DescribeFpgaImagesCommand - */ -export const de_DescribeFpgaImagesCommand = async ( +export const de_DescribeFpgaImagesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFpgaImagesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24559,26 +19499,6 @@ export const de_DescribeFpgaImagesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeFpgaImagesCommandError - */ -const de_DescribeFpgaImagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeHostReservationOfferingsCommand */ @@ -24587,7 +19507,7 @@ export const de_DescribeHostReservationOfferingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeHostReservationOfferingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24599,26 +19519,6 @@ export const de_DescribeHostReservationOfferingsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeHostReservationOfferingsCommandError - */ -const de_DescribeHostReservationOfferingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeHostReservationsCommand */ @@ -24627,7 +19527,7 @@ export const de_DescribeHostReservationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeHostReservationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24639,26 +19539,6 @@ export const de_DescribeHostReservationsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeHostReservationsCommandError - */ -const de_DescribeHostReservationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeHostsCommand */ @@ -24667,7 +19547,7 @@ export const de_DescribeHostsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeHostsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24679,26 +19559,6 @@ export const de_DescribeHostsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeHostsCommandError - */ -const de_DescribeHostsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeIamInstanceProfileAssociationsCommand */ @@ -24707,7 +19567,7 @@ export const de_DescribeIamInstanceProfileAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeIamInstanceProfileAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24719,26 +19579,6 @@ export const de_DescribeIamInstanceProfileAssociationsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeIamInstanceProfileAssociationsCommandError - */ -const de_DescribeIamInstanceProfileAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeIdentityIdFormatCommand */ @@ -24747,7 +19587,7 @@ export const de_DescribeIdentityIdFormatCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeIdentityIdFormatCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24759,26 +19599,6 @@ export const de_DescribeIdentityIdFormatCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeIdentityIdFormatCommandError - */ -const de_DescribeIdentityIdFormatCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeIdFormatCommand */ @@ -24787,7 +19607,7 @@ export const de_DescribeIdFormatCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeIdFormatCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24799,26 +19619,6 @@ export const de_DescribeIdFormatCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeIdFormatCommandError - */ -const de_DescribeIdFormatCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeImageAttributeCommand */ @@ -24827,7 +19627,7 @@ export const de_DescribeImageAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeImageAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24839,26 +19639,6 @@ export const de_DescribeImageAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeImageAttributeCommandError - */ -const de_DescribeImageAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeImagesCommand */ @@ -24867,7 +19647,7 @@ export const de_DescribeImagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeImagesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24879,26 +19659,6 @@ export const de_DescribeImagesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeImagesCommandError - */ -const de_DescribeImagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeImportImageTasksCommand */ @@ -24907,7 +19667,7 @@ export const de_DescribeImportImageTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeImportImageTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24919,26 +19679,6 @@ export const de_DescribeImportImageTasksCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeImportImageTasksCommandError - */ -const de_DescribeImportImageTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeImportSnapshotTasksCommand */ @@ -24947,7 +19687,7 @@ export const de_DescribeImportSnapshotTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeImportSnapshotTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24959,26 +19699,6 @@ export const de_DescribeImportSnapshotTasksCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeImportSnapshotTasksCommandError - */ -const de_DescribeImportSnapshotTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeInstanceAttributeCommand */ @@ -24987,7 +19707,7 @@ export const de_DescribeInstanceAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstanceAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -24999,26 +19719,6 @@ export const de_DescribeInstanceAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeInstanceAttributeCommandError - */ -const de_DescribeInstanceAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeInstanceConnectEndpointsCommand */ @@ -25027,7 +19727,7 @@ export const de_DescribeInstanceConnectEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstanceConnectEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25039,26 +19739,6 @@ export const de_DescribeInstanceConnectEndpointsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeInstanceConnectEndpointsCommandError - */ -const de_DescribeInstanceConnectEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeInstanceCreditSpecificationsCommand */ @@ -25067,7 +19747,7 @@ export const de_DescribeInstanceCreditSpecificationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstanceCreditSpecificationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25080,34 +19760,14 @@ export const de_DescribeInstanceCreditSpecificationsCommand = async ( }; /** - * deserializeAws_ec2DescribeInstanceCreditSpecificationsCommandError + * deserializeAws_ec2DescribeInstanceEventNotificationAttributesCommand */ -const de_DescribeInstanceCreditSpecificationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DescribeInstanceEventNotificationAttributesCommand - */ -export const de_DescribeInstanceEventNotificationAttributesCommand = async ( +export const de_DescribeInstanceEventNotificationAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstanceEventNotificationAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25119,26 +19779,6 @@ export const de_DescribeInstanceEventNotificationAttributesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeInstanceEventNotificationAttributesCommandError - */ -const de_DescribeInstanceEventNotificationAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeInstanceEventWindowsCommand */ @@ -25147,7 +19787,7 @@ export const de_DescribeInstanceEventWindowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstanceEventWindowsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25159,26 +19799,6 @@ export const de_DescribeInstanceEventWindowsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeInstanceEventWindowsCommandError - */ -const de_DescribeInstanceEventWindowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeInstancesCommand */ @@ -25187,7 +19807,7 @@ export const de_DescribeInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25199,26 +19819,6 @@ export const de_DescribeInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeInstancesCommandError - */ -const de_DescribeInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeInstanceStatusCommand */ @@ -25227,7 +19827,7 @@ export const de_DescribeInstanceStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstanceStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25239,26 +19839,6 @@ export const de_DescribeInstanceStatusCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeInstanceStatusCommandError - */ -const de_DescribeInstanceStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeInstanceTopologyCommand */ @@ -25267,7 +19847,7 @@ export const de_DescribeInstanceTopologyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstanceTopologyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25279,26 +19859,6 @@ export const de_DescribeInstanceTopologyCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeInstanceTopologyCommandError - */ -const de_DescribeInstanceTopologyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeInstanceTypeOfferingsCommand */ @@ -25307,7 +19867,7 @@ export const de_DescribeInstanceTypeOfferingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstanceTypeOfferingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25319,26 +19879,6 @@ export const de_DescribeInstanceTypeOfferingsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeInstanceTypeOfferingsCommandError - */ -const de_DescribeInstanceTypeOfferingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeInstanceTypesCommand */ @@ -25347,7 +19887,7 @@ export const de_DescribeInstanceTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstanceTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25359,26 +19899,6 @@ export const de_DescribeInstanceTypesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeInstanceTypesCommandError - */ -const de_DescribeInstanceTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeInternetGatewaysCommand */ @@ -25387,7 +19907,7 @@ export const de_DescribeInternetGatewaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInternetGatewaysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25399,26 +19919,6 @@ export const de_DescribeInternetGatewaysCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeInternetGatewaysCommandError - */ -const de_DescribeInternetGatewaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeIpamByoasnCommand */ @@ -25427,7 +19927,7 @@ export const de_DescribeIpamByoasnCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeIpamByoasnCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25439,26 +19939,6 @@ export const de_DescribeIpamByoasnCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeIpamByoasnCommandError - */ -const de_DescribeIpamByoasnCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeIpamPoolsCommand */ @@ -25467,7 +19947,7 @@ export const de_DescribeIpamPoolsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeIpamPoolsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25479,26 +19959,6 @@ export const de_DescribeIpamPoolsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeIpamPoolsCommandError - */ -const de_DescribeIpamPoolsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeIpamResourceDiscoveriesCommand */ @@ -25507,7 +19967,7 @@ export const de_DescribeIpamResourceDiscoveriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeIpamResourceDiscoveriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25519,26 +19979,6 @@ export const de_DescribeIpamResourceDiscoveriesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeIpamResourceDiscoveriesCommandError - */ -const de_DescribeIpamResourceDiscoveriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeIpamResourceDiscoveryAssociationsCommand */ @@ -25547,7 +19987,7 @@ export const de_DescribeIpamResourceDiscoveryAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeIpamResourceDiscoveryAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25559,26 +19999,6 @@ export const de_DescribeIpamResourceDiscoveryAssociationsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeIpamResourceDiscoveryAssociationsCommandError - */ -const de_DescribeIpamResourceDiscoveryAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeIpamsCommand */ @@ -25587,7 +20007,7 @@ export const de_DescribeIpamsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeIpamsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25599,26 +20019,6 @@ export const de_DescribeIpamsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeIpamsCommandError - */ -const de_DescribeIpamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeIpamScopesCommand */ @@ -25627,7 +20027,7 @@ export const de_DescribeIpamScopesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeIpamScopesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25640,34 +20040,14 @@ export const de_DescribeIpamScopesCommand = async ( }; /** - * deserializeAws_ec2DescribeIpamScopesCommandError + * deserializeAws_ec2DescribeIpv6PoolsCommand */ -const de_DescribeIpamScopesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DescribeIpv6PoolsCommand - */ -export const de_DescribeIpv6PoolsCommand = async ( +export const de_DescribeIpv6PoolsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeIpv6PoolsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25679,26 +20059,6 @@ export const de_DescribeIpv6PoolsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeIpv6PoolsCommandError - */ -const de_DescribeIpv6PoolsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeKeyPairsCommand */ @@ -25707,7 +20067,7 @@ export const de_DescribeKeyPairsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeKeyPairsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25719,26 +20079,6 @@ export const de_DescribeKeyPairsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeKeyPairsCommandError - */ -const de_DescribeKeyPairsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeLaunchTemplatesCommand */ @@ -25747,7 +20087,7 @@ export const de_DescribeLaunchTemplatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLaunchTemplatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25759,26 +20099,6 @@ export const de_DescribeLaunchTemplatesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeLaunchTemplatesCommandError - */ -const de_DescribeLaunchTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeLaunchTemplateVersionsCommand */ @@ -25787,7 +20107,7 @@ export const de_DescribeLaunchTemplateVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLaunchTemplateVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25799,26 +20119,6 @@ export const de_DescribeLaunchTemplateVersionsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeLaunchTemplateVersionsCommandError - */ -const de_DescribeLaunchTemplateVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeLocalGatewayRouteTablesCommand */ @@ -25827,7 +20127,7 @@ export const de_DescribeLocalGatewayRouteTablesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocalGatewayRouteTablesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25839,26 +20139,6 @@ export const de_DescribeLocalGatewayRouteTablesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeLocalGatewayRouteTablesCommandError - */ -const de_DescribeLocalGatewayRouteTablesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsCommand */ @@ -25867,7 +20147,7 @@ export const de_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsC context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25879,26 +20159,6 @@ export const de_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsC return response; }; -/** - * deserializeAws_ec2DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsCommandError - */ -const de_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeLocalGatewayRouteTableVpcAssociationsCommand */ @@ -25907,7 +20167,7 @@ export const de_DescribeLocalGatewayRouteTableVpcAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocalGatewayRouteTableVpcAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25919,26 +20179,6 @@ export const de_DescribeLocalGatewayRouteTableVpcAssociationsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeLocalGatewayRouteTableVpcAssociationsCommandError - */ -const de_DescribeLocalGatewayRouteTableVpcAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeLocalGatewaysCommand */ @@ -25947,7 +20187,7 @@ export const de_DescribeLocalGatewaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocalGatewaysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25959,26 +20199,6 @@ export const de_DescribeLocalGatewaysCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeLocalGatewaysCommandError - */ -const de_DescribeLocalGatewaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeLocalGatewayVirtualInterfaceGroupsCommand */ @@ -25987,7 +20207,7 @@ export const de_DescribeLocalGatewayVirtualInterfaceGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocalGatewayVirtualInterfaceGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -25999,26 +20219,6 @@ export const de_DescribeLocalGatewayVirtualInterfaceGroupsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeLocalGatewayVirtualInterfaceGroupsCommandError - */ -const de_DescribeLocalGatewayVirtualInterfaceGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeLocalGatewayVirtualInterfacesCommand */ @@ -26027,7 +20227,7 @@ export const de_DescribeLocalGatewayVirtualInterfacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLocalGatewayVirtualInterfacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26039,26 +20239,6 @@ export const de_DescribeLocalGatewayVirtualInterfacesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeLocalGatewayVirtualInterfacesCommandError - */ -const de_DescribeLocalGatewayVirtualInterfacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeLockedSnapshotsCommand */ @@ -26067,7 +20247,7 @@ export const de_DescribeLockedSnapshotsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLockedSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26079,26 +20259,6 @@ export const de_DescribeLockedSnapshotsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeLockedSnapshotsCommandError - */ -const de_DescribeLockedSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeManagedPrefixListsCommand */ @@ -26107,7 +20267,7 @@ export const de_DescribeManagedPrefixListsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeManagedPrefixListsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26119,26 +20279,6 @@ export const de_DescribeManagedPrefixListsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeManagedPrefixListsCommandError - */ -const de_DescribeManagedPrefixListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeMovingAddressesCommand */ @@ -26147,7 +20287,7 @@ export const de_DescribeMovingAddressesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeMovingAddressesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26159,26 +20299,6 @@ export const de_DescribeMovingAddressesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeMovingAddressesCommandError - */ -const de_DescribeMovingAddressesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeNatGatewaysCommand */ @@ -26187,7 +20307,7 @@ export const de_DescribeNatGatewaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNatGatewaysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26200,34 +20320,14 @@ export const de_DescribeNatGatewaysCommand = async ( }; /** - * deserializeAws_ec2DescribeNatGatewaysCommandError + * deserializeAws_ec2DescribeNetworkAclsCommand */ -const de_DescribeNatGatewaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DescribeNetworkAclsCommand - */ -export const de_DescribeNetworkAclsCommand = async ( +export const de_DescribeNetworkAclsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNetworkAclsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26239,26 +20339,6 @@ export const de_DescribeNetworkAclsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeNetworkAclsCommandError - */ -const de_DescribeNetworkAclsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeNetworkInsightsAccessScopeAnalysesCommand */ @@ -26267,7 +20347,7 @@ export const de_DescribeNetworkInsightsAccessScopeAnalysesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNetworkInsightsAccessScopeAnalysesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26279,26 +20359,6 @@ export const de_DescribeNetworkInsightsAccessScopeAnalysesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeNetworkInsightsAccessScopeAnalysesCommandError - */ -const de_DescribeNetworkInsightsAccessScopeAnalysesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeNetworkInsightsAccessScopesCommand */ @@ -26307,7 +20367,7 @@ export const de_DescribeNetworkInsightsAccessScopesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNetworkInsightsAccessScopesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26319,26 +20379,6 @@ export const de_DescribeNetworkInsightsAccessScopesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeNetworkInsightsAccessScopesCommandError - */ -const de_DescribeNetworkInsightsAccessScopesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeNetworkInsightsAnalysesCommand */ @@ -26347,7 +20387,7 @@ export const de_DescribeNetworkInsightsAnalysesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNetworkInsightsAnalysesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26359,26 +20399,6 @@ export const de_DescribeNetworkInsightsAnalysesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeNetworkInsightsAnalysesCommandError - */ -const de_DescribeNetworkInsightsAnalysesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeNetworkInsightsPathsCommand */ @@ -26387,7 +20407,7 @@ export const de_DescribeNetworkInsightsPathsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNetworkInsightsPathsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26399,26 +20419,6 @@ export const de_DescribeNetworkInsightsPathsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeNetworkInsightsPathsCommandError - */ -const de_DescribeNetworkInsightsPathsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeNetworkInterfaceAttributeCommand */ @@ -26427,7 +20427,7 @@ export const de_DescribeNetworkInterfaceAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNetworkInterfaceAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26439,26 +20439,6 @@ export const de_DescribeNetworkInterfaceAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeNetworkInterfaceAttributeCommandError - */ -const de_DescribeNetworkInterfaceAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeNetworkInterfacePermissionsCommand */ @@ -26467,7 +20447,7 @@ export const de_DescribeNetworkInterfacePermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNetworkInterfacePermissionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26479,26 +20459,6 @@ export const de_DescribeNetworkInterfacePermissionsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeNetworkInterfacePermissionsCommandError - */ -const de_DescribeNetworkInterfacePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeNetworkInterfacesCommand */ @@ -26507,7 +20467,7 @@ export const de_DescribeNetworkInterfacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNetworkInterfacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26519,26 +20479,6 @@ export const de_DescribeNetworkInterfacesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeNetworkInterfacesCommandError - */ -const de_DescribeNetworkInterfacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribePlacementGroupsCommand */ @@ -26547,7 +20487,7 @@ export const de_DescribePlacementGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePlacementGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26559,26 +20499,6 @@ export const de_DescribePlacementGroupsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribePlacementGroupsCommandError - */ -const de_DescribePlacementGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribePrefixListsCommand */ @@ -26587,7 +20507,7 @@ export const de_DescribePrefixListsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePrefixListsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26599,26 +20519,6 @@ export const de_DescribePrefixListsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribePrefixListsCommandError - */ -const de_DescribePrefixListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribePrincipalIdFormatCommand */ @@ -26627,7 +20527,7 @@ export const de_DescribePrincipalIdFormatCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePrincipalIdFormatCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26639,26 +20539,6 @@ export const de_DescribePrincipalIdFormatCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribePrincipalIdFormatCommandError - */ -const de_DescribePrincipalIdFormatCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribePublicIpv4PoolsCommand */ @@ -26667,7 +20547,7 @@ export const de_DescribePublicIpv4PoolsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePublicIpv4PoolsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26679,26 +20559,6 @@ export const de_DescribePublicIpv4PoolsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribePublicIpv4PoolsCommandError - */ -const de_DescribePublicIpv4PoolsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeRegionsCommand */ @@ -26707,7 +20567,7 @@ export const de_DescribeRegionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRegionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26719,26 +20579,6 @@ export const de_DescribeRegionsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeRegionsCommandError - */ -const de_DescribeRegionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeReplaceRootVolumeTasksCommand */ @@ -26747,7 +20587,7 @@ export const de_DescribeReplaceRootVolumeTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeReplaceRootVolumeTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26760,34 +20600,14 @@ export const de_DescribeReplaceRootVolumeTasksCommand = async ( }; /** - * deserializeAws_ec2DescribeReplaceRootVolumeTasksCommandError + * deserializeAws_ec2DescribeReservedInstancesCommand */ -const de_DescribeReplaceRootVolumeTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DescribeReservedInstancesCommand - */ -export const de_DescribeReservedInstancesCommand = async ( +export const de_DescribeReservedInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeReservedInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26799,26 +20619,6 @@ export const de_DescribeReservedInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeReservedInstancesCommandError - */ -const de_DescribeReservedInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeReservedInstancesListingsCommand */ @@ -26827,7 +20627,7 @@ export const de_DescribeReservedInstancesListingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeReservedInstancesListingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26839,26 +20639,6 @@ export const de_DescribeReservedInstancesListingsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeReservedInstancesListingsCommandError - */ -const de_DescribeReservedInstancesListingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeReservedInstancesModificationsCommand */ @@ -26867,7 +20647,7 @@ export const de_DescribeReservedInstancesModificationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeReservedInstancesModificationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26879,26 +20659,6 @@ export const de_DescribeReservedInstancesModificationsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeReservedInstancesModificationsCommandError - */ -const de_DescribeReservedInstancesModificationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeReservedInstancesOfferingsCommand */ @@ -26907,7 +20667,7 @@ export const de_DescribeReservedInstancesOfferingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeReservedInstancesOfferingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26919,26 +20679,6 @@ export const de_DescribeReservedInstancesOfferingsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeReservedInstancesOfferingsCommandError - */ -const de_DescribeReservedInstancesOfferingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeRouteTablesCommand */ @@ -26947,7 +20687,7 @@ export const de_DescribeRouteTablesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRouteTablesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26959,26 +20699,6 @@ export const de_DescribeRouteTablesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeRouteTablesCommandError - */ -const de_DescribeRouteTablesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeScheduledInstanceAvailabilityCommand */ @@ -26987,7 +20707,7 @@ export const de_DescribeScheduledInstanceAvailabilityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeScheduledInstanceAvailabilityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -26999,26 +20719,6 @@ export const de_DescribeScheduledInstanceAvailabilityCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeScheduledInstanceAvailabilityCommandError - */ -const de_DescribeScheduledInstanceAvailabilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeScheduledInstancesCommand */ @@ -27027,7 +20727,7 @@ export const de_DescribeScheduledInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeScheduledInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27039,26 +20739,6 @@ export const de_DescribeScheduledInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeScheduledInstancesCommandError - */ -const de_DescribeScheduledInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeSecurityGroupReferencesCommand */ @@ -27067,7 +20747,7 @@ export const de_DescribeSecurityGroupReferencesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSecurityGroupReferencesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27079,26 +20759,6 @@ export const de_DescribeSecurityGroupReferencesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeSecurityGroupReferencesCommandError - */ -const de_DescribeSecurityGroupReferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeSecurityGroupRulesCommand */ @@ -27107,7 +20767,7 @@ export const de_DescribeSecurityGroupRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSecurityGroupRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27119,26 +20779,6 @@ export const de_DescribeSecurityGroupRulesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeSecurityGroupRulesCommandError - */ -const de_DescribeSecurityGroupRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeSecurityGroupsCommand */ @@ -27147,7 +20787,7 @@ export const de_DescribeSecurityGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSecurityGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27159,26 +20799,6 @@ export const de_DescribeSecurityGroupsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeSecurityGroupsCommandError - */ -const de_DescribeSecurityGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeSnapshotAttributeCommand */ @@ -27187,7 +20807,7 @@ export const de_DescribeSnapshotAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSnapshotAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27199,26 +20819,6 @@ export const de_DescribeSnapshotAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeSnapshotAttributeCommandError - */ -const de_DescribeSnapshotAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeSnapshotsCommand */ @@ -27227,7 +20827,7 @@ export const de_DescribeSnapshotsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27239,26 +20839,6 @@ export const de_DescribeSnapshotsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeSnapshotsCommandError - */ -const de_DescribeSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeSnapshotTierStatusCommand */ @@ -27267,7 +20847,7 @@ export const de_DescribeSnapshotTierStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSnapshotTierStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27279,26 +20859,6 @@ export const de_DescribeSnapshotTierStatusCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeSnapshotTierStatusCommandError - */ -const de_DescribeSnapshotTierStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeSpotDatafeedSubscriptionCommand */ @@ -27307,7 +20867,7 @@ export const de_DescribeSpotDatafeedSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSpotDatafeedSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27320,34 +20880,14 @@ export const de_DescribeSpotDatafeedSubscriptionCommand = async ( }; /** - * deserializeAws_ec2DescribeSpotDatafeedSubscriptionCommandError + * deserializeAws_ec2DescribeSpotFleetInstancesCommand */ -const de_DescribeSpotDatafeedSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DescribeSpotFleetInstancesCommand - */ -export const de_DescribeSpotFleetInstancesCommand = async ( +export const de_DescribeSpotFleetInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSpotFleetInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27359,26 +20899,6 @@ export const de_DescribeSpotFleetInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeSpotFleetInstancesCommandError - */ -const de_DescribeSpotFleetInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeSpotFleetRequestHistoryCommand */ @@ -27387,7 +20907,7 @@ export const de_DescribeSpotFleetRequestHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSpotFleetRequestHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27399,26 +20919,6 @@ export const de_DescribeSpotFleetRequestHistoryCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeSpotFleetRequestHistoryCommandError - */ -const de_DescribeSpotFleetRequestHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeSpotFleetRequestsCommand */ @@ -27427,7 +20927,7 @@ export const de_DescribeSpotFleetRequestsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSpotFleetRequestsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27439,26 +20939,6 @@ export const de_DescribeSpotFleetRequestsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeSpotFleetRequestsCommandError - */ -const de_DescribeSpotFleetRequestsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeSpotInstanceRequestsCommand */ @@ -27467,7 +20947,7 @@ export const de_DescribeSpotInstanceRequestsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSpotInstanceRequestsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27479,26 +20959,6 @@ export const de_DescribeSpotInstanceRequestsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeSpotInstanceRequestsCommandError - */ -const de_DescribeSpotInstanceRequestsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeSpotPriceHistoryCommand */ @@ -27507,7 +20967,7 @@ export const de_DescribeSpotPriceHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSpotPriceHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27519,26 +20979,6 @@ export const de_DescribeSpotPriceHistoryCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeSpotPriceHistoryCommandError - */ -const de_DescribeSpotPriceHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeStaleSecurityGroupsCommand */ @@ -27547,7 +20987,7 @@ export const de_DescribeStaleSecurityGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStaleSecurityGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27559,26 +20999,6 @@ export const de_DescribeStaleSecurityGroupsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeStaleSecurityGroupsCommandError - */ -const de_DescribeStaleSecurityGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeStoreImageTasksCommand */ @@ -27587,7 +21007,7 @@ export const de_DescribeStoreImageTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStoreImageTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27599,26 +21019,6 @@ export const de_DescribeStoreImageTasksCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeStoreImageTasksCommandError - */ -const de_DescribeStoreImageTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeSubnetsCommand */ @@ -27627,7 +21027,7 @@ export const de_DescribeSubnetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSubnetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27639,26 +21039,6 @@ export const de_DescribeSubnetsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeSubnetsCommandError - */ -const de_DescribeSubnetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeTagsCommand */ @@ -27667,7 +21047,7 @@ export const de_DescribeTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27679,26 +21059,6 @@ export const de_DescribeTagsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeTagsCommandError - */ -const de_DescribeTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeTrafficMirrorFiltersCommand */ @@ -27707,7 +21067,7 @@ export const de_DescribeTrafficMirrorFiltersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrafficMirrorFiltersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27719,26 +21079,6 @@ export const de_DescribeTrafficMirrorFiltersCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeTrafficMirrorFiltersCommandError - */ -const de_DescribeTrafficMirrorFiltersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeTrafficMirrorSessionsCommand */ @@ -27747,7 +21087,7 @@ export const de_DescribeTrafficMirrorSessionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrafficMirrorSessionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27759,26 +21099,6 @@ export const de_DescribeTrafficMirrorSessionsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeTrafficMirrorSessionsCommandError - */ -const de_DescribeTrafficMirrorSessionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeTrafficMirrorTargetsCommand */ @@ -27787,7 +21107,7 @@ export const de_DescribeTrafficMirrorTargetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrafficMirrorTargetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27799,26 +21119,6 @@ export const de_DescribeTrafficMirrorTargetsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeTrafficMirrorTargetsCommandError - */ -const de_DescribeTrafficMirrorTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeTransitGatewayAttachmentsCommand */ @@ -27827,7 +21127,7 @@ export const de_DescribeTransitGatewayAttachmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTransitGatewayAttachmentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27839,26 +21139,6 @@ export const de_DescribeTransitGatewayAttachmentsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeTransitGatewayAttachmentsCommandError - */ -const de_DescribeTransitGatewayAttachmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeTransitGatewayConnectPeersCommand */ @@ -27867,7 +21147,7 @@ export const de_DescribeTransitGatewayConnectPeersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTransitGatewayConnectPeersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27880,34 +21160,14 @@ export const de_DescribeTransitGatewayConnectPeersCommand = async ( }; /** - * deserializeAws_ec2DescribeTransitGatewayConnectPeersCommandError + * deserializeAws_ec2DescribeTransitGatewayConnectsCommand */ -const de_DescribeTransitGatewayConnectPeersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DescribeTransitGatewayConnectsCommand - */ -export const de_DescribeTransitGatewayConnectsCommand = async ( +export const de_DescribeTransitGatewayConnectsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTransitGatewayConnectsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27919,26 +21179,6 @@ export const de_DescribeTransitGatewayConnectsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeTransitGatewayConnectsCommandError - */ -const de_DescribeTransitGatewayConnectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeTransitGatewayMulticastDomainsCommand */ @@ -27947,7 +21187,7 @@ export const de_DescribeTransitGatewayMulticastDomainsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTransitGatewayMulticastDomainsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27959,26 +21199,6 @@ export const de_DescribeTransitGatewayMulticastDomainsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeTransitGatewayMulticastDomainsCommandError - */ -const de_DescribeTransitGatewayMulticastDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeTransitGatewayPeeringAttachmentsCommand */ @@ -27987,7 +21207,7 @@ export const de_DescribeTransitGatewayPeeringAttachmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTransitGatewayPeeringAttachmentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -27999,26 +21219,6 @@ export const de_DescribeTransitGatewayPeeringAttachmentsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeTransitGatewayPeeringAttachmentsCommandError - */ -const de_DescribeTransitGatewayPeeringAttachmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeTransitGatewayPolicyTablesCommand */ @@ -28027,7 +21227,7 @@ export const de_DescribeTransitGatewayPolicyTablesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTransitGatewayPolicyTablesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28039,26 +21239,6 @@ export const de_DescribeTransitGatewayPolicyTablesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeTransitGatewayPolicyTablesCommandError - */ -const de_DescribeTransitGatewayPolicyTablesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeTransitGatewayRouteTableAnnouncementsCommand */ @@ -28067,7 +21247,7 @@ export const de_DescribeTransitGatewayRouteTableAnnouncementsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTransitGatewayRouteTableAnnouncementsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28079,26 +21259,6 @@ export const de_DescribeTransitGatewayRouteTableAnnouncementsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeTransitGatewayRouteTableAnnouncementsCommandError - */ -const de_DescribeTransitGatewayRouteTableAnnouncementsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeTransitGatewayRouteTablesCommand */ @@ -28107,7 +21267,7 @@ export const de_DescribeTransitGatewayRouteTablesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTransitGatewayRouteTablesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28119,26 +21279,6 @@ export const de_DescribeTransitGatewayRouteTablesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeTransitGatewayRouteTablesCommandError - */ -const de_DescribeTransitGatewayRouteTablesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeTransitGatewaysCommand */ @@ -28147,7 +21287,7 @@ export const de_DescribeTransitGatewaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTransitGatewaysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28159,26 +21299,6 @@ export const de_DescribeTransitGatewaysCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeTransitGatewaysCommandError - */ -const de_DescribeTransitGatewaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeTransitGatewayVpcAttachmentsCommand */ @@ -28187,7 +21307,7 @@ export const de_DescribeTransitGatewayVpcAttachmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTransitGatewayVpcAttachmentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28199,26 +21319,6 @@ export const de_DescribeTransitGatewayVpcAttachmentsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeTransitGatewayVpcAttachmentsCommandError - */ -const de_DescribeTransitGatewayVpcAttachmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeTrunkInterfaceAssociationsCommand */ @@ -28227,7 +21327,7 @@ export const de_DescribeTrunkInterfaceAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrunkInterfaceAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28239,26 +21339,6 @@ export const de_DescribeTrunkInterfaceAssociationsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeTrunkInterfaceAssociationsCommandError - */ -const de_DescribeTrunkInterfaceAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVerifiedAccessEndpointsCommand */ @@ -28267,7 +21347,7 @@ export const de_DescribeVerifiedAccessEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVerifiedAccessEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28279,26 +21359,6 @@ export const de_DescribeVerifiedAccessEndpointsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVerifiedAccessEndpointsCommandError - */ -const de_DescribeVerifiedAccessEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVerifiedAccessGroupsCommand */ @@ -28307,7 +21367,7 @@ export const de_DescribeVerifiedAccessGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVerifiedAccessGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28319,26 +21379,6 @@ export const de_DescribeVerifiedAccessGroupsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVerifiedAccessGroupsCommandError - */ -const de_DescribeVerifiedAccessGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVerifiedAccessInstanceLoggingConfigurationsCommand */ @@ -28347,7 +21387,7 @@ export const de_DescribeVerifiedAccessInstanceLoggingConfigurationsCommand = asy context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVerifiedAccessInstanceLoggingConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28359,26 +21399,6 @@ export const de_DescribeVerifiedAccessInstanceLoggingConfigurationsCommand = asy return response; }; -/** - * deserializeAws_ec2DescribeVerifiedAccessInstanceLoggingConfigurationsCommandError - */ -const de_DescribeVerifiedAccessInstanceLoggingConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVerifiedAccessInstancesCommand */ @@ -28387,7 +21407,7 @@ export const de_DescribeVerifiedAccessInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVerifiedAccessInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28399,26 +21419,6 @@ export const de_DescribeVerifiedAccessInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVerifiedAccessInstancesCommandError - */ -const de_DescribeVerifiedAccessInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVerifiedAccessTrustProvidersCommand */ @@ -28427,7 +21427,7 @@ export const de_DescribeVerifiedAccessTrustProvidersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVerifiedAccessTrustProvidersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28440,34 +21440,14 @@ export const de_DescribeVerifiedAccessTrustProvidersCommand = async ( }; /** - * deserializeAws_ec2DescribeVerifiedAccessTrustProvidersCommandError + * deserializeAws_ec2DescribeVolumeAttributeCommand */ -const de_DescribeVerifiedAccessTrustProvidersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DescribeVolumeAttributeCommand - */ -export const de_DescribeVolumeAttributeCommand = async ( +export const de_DescribeVolumeAttributeCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVolumeAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28479,26 +21459,6 @@ export const de_DescribeVolumeAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVolumeAttributeCommandError - */ -const de_DescribeVolumeAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVolumesCommand */ @@ -28507,7 +21467,7 @@ export const de_DescribeVolumesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVolumesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28519,26 +21479,6 @@ export const de_DescribeVolumesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVolumesCommandError - */ -const de_DescribeVolumesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVolumesModificationsCommand */ @@ -28547,7 +21487,7 @@ export const de_DescribeVolumesModificationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVolumesModificationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28559,26 +21499,6 @@ export const de_DescribeVolumesModificationsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVolumesModificationsCommandError - */ -const de_DescribeVolumesModificationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVolumeStatusCommand */ @@ -28587,7 +21507,7 @@ export const de_DescribeVolumeStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVolumeStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28599,26 +21519,6 @@ export const de_DescribeVolumeStatusCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVolumeStatusCommandError - */ -const de_DescribeVolumeStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVpcAttributeCommand */ @@ -28627,7 +21527,7 @@ export const de_DescribeVpcAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpcAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28639,26 +21539,6 @@ export const de_DescribeVpcAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVpcAttributeCommandError - */ -const de_DescribeVpcAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVpcClassicLinkCommand */ @@ -28667,7 +21547,7 @@ export const de_DescribeVpcClassicLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpcClassicLinkCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28679,26 +21559,6 @@ export const de_DescribeVpcClassicLinkCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVpcClassicLinkCommandError - */ -const de_DescribeVpcClassicLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVpcClassicLinkDnsSupportCommand */ @@ -28707,7 +21567,7 @@ export const de_DescribeVpcClassicLinkDnsSupportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpcClassicLinkDnsSupportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28719,26 +21579,6 @@ export const de_DescribeVpcClassicLinkDnsSupportCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVpcClassicLinkDnsSupportCommandError - */ -const de_DescribeVpcClassicLinkDnsSupportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVpcEndpointConnectionNotificationsCommand */ @@ -28747,7 +21587,7 @@ export const de_DescribeVpcEndpointConnectionNotificationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpcEndpointConnectionNotificationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28759,26 +21599,6 @@ export const de_DescribeVpcEndpointConnectionNotificationsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVpcEndpointConnectionNotificationsCommandError - */ -const de_DescribeVpcEndpointConnectionNotificationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVpcEndpointConnectionsCommand */ @@ -28787,7 +21607,7 @@ export const de_DescribeVpcEndpointConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpcEndpointConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28799,26 +21619,6 @@ export const de_DescribeVpcEndpointConnectionsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVpcEndpointConnectionsCommandError - */ -const de_DescribeVpcEndpointConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVpcEndpointsCommand */ @@ -28827,7 +21627,7 @@ export const de_DescribeVpcEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpcEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28839,26 +21639,6 @@ export const de_DescribeVpcEndpointsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVpcEndpointsCommandError - */ -const de_DescribeVpcEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVpcEndpointServiceConfigurationsCommand */ @@ -28867,7 +21647,7 @@ export const de_DescribeVpcEndpointServiceConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpcEndpointServiceConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28879,26 +21659,6 @@ export const de_DescribeVpcEndpointServiceConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVpcEndpointServiceConfigurationsCommandError - */ -const de_DescribeVpcEndpointServiceConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVpcEndpointServicePermissionsCommand */ @@ -28907,7 +21667,7 @@ export const de_DescribeVpcEndpointServicePermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpcEndpointServicePermissionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28919,26 +21679,6 @@ export const de_DescribeVpcEndpointServicePermissionsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVpcEndpointServicePermissionsCommandError - */ -const de_DescribeVpcEndpointServicePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVpcEndpointServicesCommand */ @@ -28947,7 +21687,7 @@ export const de_DescribeVpcEndpointServicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpcEndpointServicesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -28959,26 +21699,6 @@ export const de_DescribeVpcEndpointServicesCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVpcEndpointServicesCommandError - */ -const de_DescribeVpcEndpointServicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVpcPeeringConnectionsCommand */ @@ -28987,7 +21707,7 @@ export const de_DescribeVpcPeeringConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpcPeeringConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29000,34 +21720,14 @@ export const de_DescribeVpcPeeringConnectionsCommand = async ( }; /** - * deserializeAws_ec2DescribeVpcPeeringConnectionsCommandError + * deserializeAws_ec2DescribeVpcsCommand */ -const de_DescribeVpcPeeringConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DescribeVpcsCommand - */ -export const de_DescribeVpcsCommand = async ( +export const de_DescribeVpcsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpcsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29039,26 +21739,6 @@ export const de_DescribeVpcsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVpcsCommandError - */ -const de_DescribeVpcsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVpnConnectionsCommand */ @@ -29067,7 +21747,7 @@ export const de_DescribeVpnConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpnConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29079,26 +21759,6 @@ export const de_DescribeVpnConnectionsCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVpnConnectionsCommandError - */ -const de_DescribeVpnConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DescribeVpnGatewaysCommand */ @@ -29107,7 +21767,7 @@ export const de_DescribeVpnGatewaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpnGatewaysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29119,26 +21779,6 @@ export const de_DescribeVpnGatewaysCommand = async ( return response; }; -/** - * deserializeAws_ec2DescribeVpnGatewaysCommandError - */ -const de_DescribeVpnGatewaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DetachClassicLinkVpcCommand */ @@ -29147,7 +21787,7 @@ export const de_DetachClassicLinkVpcCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetachClassicLinkVpcCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29159,26 +21799,6 @@ export const de_DetachClassicLinkVpcCommand = async ( return response; }; -/** - * deserializeAws_ec2DetachClassicLinkVpcCommandError - */ -const de_DetachClassicLinkVpcCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DetachInternetGatewayCommand */ @@ -29187,7 +21807,7 @@ export const de_DetachInternetGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetachInternetGatewayCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DetachInternetGatewayCommandOutput = { @@ -29196,26 +21816,6 @@ export const de_DetachInternetGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2DetachInternetGatewayCommandError - */ -const de_DetachInternetGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DetachNetworkInterfaceCommand */ @@ -29224,7 +21824,7 @@ export const de_DetachNetworkInterfaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetachNetworkInterfaceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DetachNetworkInterfaceCommandOutput = { @@ -29233,26 +21833,6 @@ export const de_DetachNetworkInterfaceCommand = async ( return response; }; -/** - * deserializeAws_ec2DetachNetworkInterfaceCommandError - */ -const de_DetachNetworkInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DetachVerifiedAccessTrustProviderCommand */ @@ -29261,7 +21841,7 @@ export const de_DetachVerifiedAccessTrustProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetachVerifiedAccessTrustProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29273,26 +21853,6 @@ export const de_DetachVerifiedAccessTrustProviderCommand = async ( return response; }; -/** - * deserializeAws_ec2DetachVerifiedAccessTrustProviderCommandError - */ -const de_DetachVerifiedAccessTrustProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DetachVolumeCommand */ @@ -29301,7 +21861,7 @@ export const de_DetachVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetachVolumeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29313,26 +21873,6 @@ export const de_DetachVolumeCommand = async ( return response; }; -/** - * deserializeAws_ec2DetachVolumeCommandError - */ -const de_DetachVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DetachVpnGatewayCommand */ @@ -29341,7 +21881,7 @@ export const de_DetachVpnGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetachVpnGatewayCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DetachVpnGatewayCommandOutput = { @@ -29350,26 +21890,6 @@ export const de_DetachVpnGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2DetachVpnGatewayCommandError - */ -const de_DetachVpnGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisableAddressTransferCommand */ @@ -29378,7 +21898,7 @@ export const de_DisableAddressTransferCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableAddressTransferCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29390,26 +21910,6 @@ export const de_DisableAddressTransferCommand = async ( return response; }; -/** - * deserializeAws_ec2DisableAddressTransferCommandError - */ -const de_DisableAddressTransferCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisableAwsNetworkPerformanceMetricSubscriptionCommand */ @@ -29418,7 +21918,7 @@ export const de_DisableAwsNetworkPerformanceMetricSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableAwsNetworkPerformanceMetricSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29430,26 +21930,6 @@ export const de_DisableAwsNetworkPerformanceMetricSubscriptionCommand = async ( return response; }; -/** - * deserializeAws_ec2DisableAwsNetworkPerformanceMetricSubscriptionCommandError - */ -const de_DisableAwsNetworkPerformanceMetricSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisableEbsEncryptionByDefaultCommand */ @@ -29458,7 +21938,7 @@ export const de_DisableEbsEncryptionByDefaultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableEbsEncryptionByDefaultCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29470,26 +21950,6 @@ export const de_DisableEbsEncryptionByDefaultCommand = async ( return response; }; -/** - * deserializeAws_ec2DisableEbsEncryptionByDefaultCommandError - */ -const de_DisableEbsEncryptionByDefaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisableFastLaunchCommand */ @@ -29498,7 +21958,7 @@ export const de_DisableFastLaunchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableFastLaunchCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29510,26 +21970,6 @@ export const de_DisableFastLaunchCommand = async ( return response; }; -/** - * deserializeAws_ec2DisableFastLaunchCommandError - */ -const de_DisableFastLaunchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisableFastSnapshotRestoresCommand */ @@ -29538,7 +21978,7 @@ export const de_DisableFastSnapshotRestoresCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableFastSnapshotRestoresCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29551,34 +21991,14 @@ export const de_DisableFastSnapshotRestoresCommand = async ( }; /** - * deserializeAws_ec2DisableFastSnapshotRestoresCommandError + * deserializeAws_ec2DisableImageCommand */ -const de_DisableFastSnapshotRestoresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DisableImageCommand - */ -export const de_DisableImageCommand = async ( +export const de_DisableImageCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29590,26 +22010,6 @@ export const de_DisableImageCommand = async ( return response; }; -/** - * deserializeAws_ec2DisableImageCommandError - */ -const de_DisableImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisableImageBlockPublicAccessCommand */ @@ -29618,7 +22018,7 @@ export const de_DisableImageBlockPublicAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableImageBlockPublicAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29630,26 +22030,6 @@ export const de_DisableImageBlockPublicAccessCommand = async ( return response; }; -/** - * deserializeAws_ec2DisableImageBlockPublicAccessCommandError - */ -const de_DisableImageBlockPublicAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisableImageDeprecationCommand */ @@ -29658,7 +22038,7 @@ export const de_DisableImageDeprecationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableImageDeprecationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29670,26 +22050,6 @@ export const de_DisableImageDeprecationCommand = async ( return response; }; -/** - * deserializeAws_ec2DisableImageDeprecationCommandError - */ -const de_DisableImageDeprecationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisableIpamOrganizationAdminAccountCommand */ @@ -29698,7 +22058,7 @@ export const de_DisableIpamOrganizationAdminAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableIpamOrganizationAdminAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29710,26 +22070,6 @@ export const de_DisableIpamOrganizationAdminAccountCommand = async ( return response; }; -/** - * deserializeAws_ec2DisableIpamOrganizationAdminAccountCommandError - */ -const de_DisableIpamOrganizationAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisableSerialConsoleAccessCommand */ @@ -29738,7 +22078,7 @@ export const de_DisableSerialConsoleAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableSerialConsoleAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29750,26 +22090,6 @@ export const de_DisableSerialConsoleAccessCommand = async ( return response; }; -/** - * deserializeAws_ec2DisableSerialConsoleAccessCommandError - */ -const de_DisableSerialConsoleAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisableSnapshotBlockPublicAccessCommand */ @@ -29778,7 +22098,7 @@ export const de_DisableSnapshotBlockPublicAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableSnapshotBlockPublicAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29790,26 +22110,6 @@ export const de_DisableSnapshotBlockPublicAccessCommand = async ( return response; }; -/** - * deserializeAws_ec2DisableSnapshotBlockPublicAccessCommandError - */ -const de_DisableSnapshotBlockPublicAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisableTransitGatewayRouteTablePropagationCommand */ @@ -29818,7 +22118,7 @@ export const de_DisableTransitGatewayRouteTablePropagationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableTransitGatewayRouteTablePropagationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29830,26 +22130,6 @@ export const de_DisableTransitGatewayRouteTablePropagationCommand = async ( return response; }; -/** - * deserializeAws_ec2DisableTransitGatewayRouteTablePropagationCommandError - */ -const de_DisableTransitGatewayRouteTablePropagationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisableVgwRoutePropagationCommand */ @@ -29858,7 +22138,7 @@ export const de_DisableVgwRoutePropagationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableVgwRoutePropagationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DisableVgwRoutePropagationCommandOutput = { @@ -29867,26 +22147,6 @@ export const de_DisableVgwRoutePropagationCommand = async ( return response; }; -/** - * deserializeAws_ec2DisableVgwRoutePropagationCommandError - */ -const de_DisableVgwRoutePropagationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisableVpcClassicLinkCommand */ @@ -29895,7 +22155,7 @@ export const de_DisableVpcClassicLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableVpcClassicLinkCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29907,26 +22167,6 @@ export const de_DisableVpcClassicLinkCommand = async ( return response; }; -/** - * deserializeAws_ec2DisableVpcClassicLinkCommandError - */ -const de_DisableVpcClassicLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisableVpcClassicLinkDnsSupportCommand */ @@ -29935,7 +22175,7 @@ export const de_DisableVpcClassicLinkDnsSupportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableVpcClassicLinkDnsSupportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -29947,26 +22187,6 @@ export const de_DisableVpcClassicLinkDnsSupportCommand = async ( return response; }; -/** - * deserializeAws_ec2DisableVpcClassicLinkDnsSupportCommandError - */ -const de_DisableVpcClassicLinkDnsSupportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisassociateAddressCommand */ @@ -29975,7 +22195,7 @@ export const de_DisassociateAddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateAddressCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DisassociateAddressCommandOutput = { @@ -29984,26 +22204,6 @@ export const de_DisassociateAddressCommand = async ( return response; }; -/** - * deserializeAws_ec2DisassociateAddressCommandError - */ -const de_DisassociateAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisassociateClientVpnTargetNetworkCommand */ @@ -30012,7 +22212,7 @@ export const de_DisassociateClientVpnTargetNetworkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateClientVpnTargetNetworkCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30024,26 +22224,6 @@ export const de_DisassociateClientVpnTargetNetworkCommand = async ( return response; }; -/** - * deserializeAws_ec2DisassociateClientVpnTargetNetworkCommandError - */ -const de_DisassociateClientVpnTargetNetworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisassociateEnclaveCertificateIamRoleCommand */ @@ -30052,7 +22232,7 @@ export const de_DisassociateEnclaveCertificateIamRoleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateEnclaveCertificateIamRoleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30064,26 +22244,6 @@ export const de_DisassociateEnclaveCertificateIamRoleCommand = async ( return response; }; -/** - * deserializeAws_ec2DisassociateEnclaveCertificateIamRoleCommandError - */ -const de_DisassociateEnclaveCertificateIamRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisassociateIamInstanceProfileCommand */ @@ -30092,7 +22252,7 @@ export const de_DisassociateIamInstanceProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateIamInstanceProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30105,34 +22265,14 @@ export const de_DisassociateIamInstanceProfileCommand = async ( }; /** - * deserializeAws_ec2DisassociateIamInstanceProfileCommandError + * deserializeAws_ec2DisassociateInstanceEventWindowCommand */ -const de_DisassociateIamInstanceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2DisassociateInstanceEventWindowCommand - */ -export const de_DisassociateInstanceEventWindowCommand = async ( +export const de_DisassociateInstanceEventWindowCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateInstanceEventWindowCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30144,26 +22284,6 @@ export const de_DisassociateInstanceEventWindowCommand = async ( return response; }; -/** - * deserializeAws_ec2DisassociateInstanceEventWindowCommandError - */ -const de_DisassociateInstanceEventWindowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisassociateIpamByoasnCommand */ @@ -30172,7 +22292,7 @@ export const de_DisassociateIpamByoasnCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateIpamByoasnCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30184,26 +22304,6 @@ export const de_DisassociateIpamByoasnCommand = async ( return response; }; -/** - * deserializeAws_ec2DisassociateIpamByoasnCommandError - */ -const de_DisassociateIpamByoasnCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisassociateIpamResourceDiscoveryCommand */ @@ -30212,7 +22312,7 @@ export const de_DisassociateIpamResourceDiscoveryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateIpamResourceDiscoveryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30224,26 +22324,6 @@ export const de_DisassociateIpamResourceDiscoveryCommand = async ( return response; }; -/** - * deserializeAws_ec2DisassociateIpamResourceDiscoveryCommandError - */ -const de_DisassociateIpamResourceDiscoveryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisassociateNatGatewayAddressCommand */ @@ -30252,7 +22332,7 @@ export const de_DisassociateNatGatewayAddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateNatGatewayAddressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30264,26 +22344,6 @@ export const de_DisassociateNatGatewayAddressCommand = async ( return response; }; -/** - * deserializeAws_ec2DisassociateNatGatewayAddressCommandError - */ -const de_DisassociateNatGatewayAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisassociateRouteTableCommand */ @@ -30292,7 +22352,7 @@ export const de_DisassociateRouteTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateRouteTableCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DisassociateRouteTableCommandOutput = { @@ -30301,26 +22361,6 @@ export const de_DisassociateRouteTableCommand = async ( return response; }; -/** - * deserializeAws_ec2DisassociateRouteTableCommandError - */ -const de_DisassociateRouteTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisassociateSubnetCidrBlockCommand */ @@ -30329,7 +22369,7 @@ export const de_DisassociateSubnetCidrBlockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateSubnetCidrBlockCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30341,26 +22381,6 @@ export const de_DisassociateSubnetCidrBlockCommand = async ( return response; }; -/** - * deserializeAws_ec2DisassociateSubnetCidrBlockCommandError - */ -const de_DisassociateSubnetCidrBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisassociateTransitGatewayMulticastDomainCommand */ @@ -30369,7 +22389,7 @@ export const de_DisassociateTransitGatewayMulticastDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateTransitGatewayMulticastDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30381,26 +22401,6 @@ export const de_DisassociateTransitGatewayMulticastDomainCommand = async ( return response; }; -/** - * deserializeAws_ec2DisassociateTransitGatewayMulticastDomainCommandError - */ -const de_DisassociateTransitGatewayMulticastDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisassociateTransitGatewayPolicyTableCommand */ @@ -30409,7 +22409,7 @@ export const de_DisassociateTransitGatewayPolicyTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateTransitGatewayPolicyTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30421,26 +22421,6 @@ export const de_DisassociateTransitGatewayPolicyTableCommand = async ( return response; }; -/** - * deserializeAws_ec2DisassociateTransitGatewayPolicyTableCommandError - */ -const de_DisassociateTransitGatewayPolicyTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisassociateTransitGatewayRouteTableCommand */ @@ -30449,7 +22429,7 @@ export const de_DisassociateTransitGatewayRouteTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateTransitGatewayRouteTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30461,26 +22441,6 @@ export const de_DisassociateTransitGatewayRouteTableCommand = async ( return response; }; -/** - * deserializeAws_ec2DisassociateTransitGatewayRouteTableCommandError - */ -const de_DisassociateTransitGatewayRouteTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisassociateTrunkInterfaceCommand */ @@ -30489,7 +22449,7 @@ export const de_DisassociateTrunkInterfaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateTrunkInterfaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30501,26 +22461,6 @@ export const de_DisassociateTrunkInterfaceCommand = async ( return response; }; -/** - * deserializeAws_ec2DisassociateTrunkInterfaceCommandError - */ -const de_DisassociateTrunkInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2DisassociateVpcCidrBlockCommand */ @@ -30529,7 +22469,7 @@ export const de_DisassociateVpcCidrBlockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateVpcCidrBlockCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30541,26 +22481,6 @@ export const de_DisassociateVpcCidrBlockCommand = async ( return response; }; -/** - * deserializeAws_ec2DisassociateVpcCidrBlockCommandError - */ -const de_DisassociateVpcCidrBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EnableAddressTransferCommand */ @@ -30569,7 +22489,7 @@ export const de_EnableAddressTransferCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableAddressTransferCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30581,26 +22501,6 @@ export const de_EnableAddressTransferCommand = async ( return response; }; -/** - * deserializeAws_ec2EnableAddressTransferCommandError - */ -const de_EnableAddressTransferCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EnableAwsNetworkPerformanceMetricSubscriptionCommand */ @@ -30609,7 +22509,7 @@ export const de_EnableAwsNetworkPerformanceMetricSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableAwsNetworkPerformanceMetricSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30621,26 +22521,6 @@ export const de_EnableAwsNetworkPerformanceMetricSubscriptionCommand = async ( return response; }; -/** - * deserializeAws_ec2EnableAwsNetworkPerformanceMetricSubscriptionCommandError - */ -const de_EnableAwsNetworkPerformanceMetricSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EnableEbsEncryptionByDefaultCommand */ @@ -30649,7 +22529,7 @@ export const de_EnableEbsEncryptionByDefaultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableEbsEncryptionByDefaultCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30661,26 +22541,6 @@ export const de_EnableEbsEncryptionByDefaultCommand = async ( return response; }; -/** - * deserializeAws_ec2EnableEbsEncryptionByDefaultCommandError - */ -const de_EnableEbsEncryptionByDefaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EnableFastLaunchCommand */ @@ -30689,7 +22549,7 @@ export const de_EnableFastLaunchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableFastLaunchCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30701,26 +22561,6 @@ export const de_EnableFastLaunchCommand = async ( return response; }; -/** - * deserializeAws_ec2EnableFastLaunchCommandError - */ -const de_EnableFastLaunchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EnableFastSnapshotRestoresCommand */ @@ -30729,7 +22569,7 @@ export const de_EnableFastSnapshotRestoresCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableFastSnapshotRestoresCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30741,26 +22581,6 @@ export const de_EnableFastSnapshotRestoresCommand = async ( return response; }; -/** - * deserializeAws_ec2EnableFastSnapshotRestoresCommandError - */ -const de_EnableFastSnapshotRestoresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EnableImageCommand */ @@ -30769,7 +22589,7 @@ export const de_EnableImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30781,26 +22601,6 @@ export const de_EnableImageCommand = async ( return response; }; -/** - * deserializeAws_ec2EnableImageCommandError - */ -const de_EnableImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EnableImageBlockPublicAccessCommand */ @@ -30809,7 +22609,7 @@ export const de_EnableImageBlockPublicAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableImageBlockPublicAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30821,26 +22621,6 @@ export const de_EnableImageBlockPublicAccessCommand = async ( return response; }; -/** - * deserializeAws_ec2EnableImageBlockPublicAccessCommandError - */ -const de_EnableImageBlockPublicAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EnableImageDeprecationCommand */ @@ -30849,7 +22629,7 @@ export const de_EnableImageDeprecationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableImageDeprecationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30861,26 +22641,6 @@ export const de_EnableImageDeprecationCommand = async ( return response; }; -/** - * deserializeAws_ec2EnableImageDeprecationCommandError - */ -const de_EnableImageDeprecationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EnableIpamOrganizationAdminAccountCommand */ @@ -30889,7 +22649,7 @@ export const de_EnableIpamOrganizationAdminAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableIpamOrganizationAdminAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30901,26 +22661,6 @@ export const de_EnableIpamOrganizationAdminAccountCommand = async ( return response; }; -/** - * deserializeAws_ec2EnableIpamOrganizationAdminAccountCommandError - */ -const de_EnableIpamOrganizationAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EnableReachabilityAnalyzerOrganizationSharingCommand */ @@ -30929,7 +22669,7 @@ export const de_EnableReachabilityAnalyzerOrganizationSharingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableReachabilityAnalyzerOrganizationSharingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30941,26 +22681,6 @@ export const de_EnableReachabilityAnalyzerOrganizationSharingCommand = async ( return response; }; -/** - * deserializeAws_ec2EnableReachabilityAnalyzerOrganizationSharingCommandError - */ -const de_EnableReachabilityAnalyzerOrganizationSharingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EnableSerialConsoleAccessCommand */ @@ -30969,7 +22689,7 @@ export const de_EnableSerialConsoleAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableSerialConsoleAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -30981,26 +22701,6 @@ export const de_EnableSerialConsoleAccessCommand = async ( return response; }; -/** - * deserializeAws_ec2EnableSerialConsoleAccessCommandError - */ -const de_EnableSerialConsoleAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EnableSnapshotBlockPublicAccessCommand */ @@ -31009,7 +22709,7 @@ export const de_EnableSnapshotBlockPublicAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableSnapshotBlockPublicAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31021,26 +22721,6 @@ export const de_EnableSnapshotBlockPublicAccessCommand = async ( return response; }; -/** - * deserializeAws_ec2EnableSnapshotBlockPublicAccessCommandError - */ -const de_EnableSnapshotBlockPublicAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EnableTransitGatewayRouteTablePropagationCommand */ @@ -31049,7 +22729,7 @@ export const de_EnableTransitGatewayRouteTablePropagationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableTransitGatewayRouteTablePropagationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31061,98 +22741,38 @@ export const de_EnableTransitGatewayRouteTablePropagationCommand = async ( return response; }; -/** - * deserializeAws_ec2EnableTransitGatewayRouteTablePropagationCommandError - */ -const de_EnableTransitGatewayRouteTablePropagationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EnableVgwRoutePropagationCommand */ export const de_EnableVgwRoutePropagationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_EnableVgwRoutePropagationCommandError(output, context); - } - await collectBody(output.body, context); - const response: EnableVgwRoutePropagationCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_ec2EnableVgwRoutePropagationCommandError - */ -const de_EnableVgwRoutePropagationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - -/** - * deserializeAws_ec2EnableVolumeIOCommand - */ -export const de_EnableVolumeIOCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_EnableVolumeIOCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: EnableVolumeIOCommandOutput = { + const response: EnableVgwRoutePropagationCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_ec2EnableVolumeIOCommandError + * deserializeAws_ec2EnableVolumeIOCommand */ -const de_EnableVolumeIOCommandError = async ( +export const de_EnableVolumeIOCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: EnableVolumeIOCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); + return response; }; /** @@ -31163,7 +22783,7 @@ export const de_EnableVpcClassicLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableVpcClassicLinkCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31175,26 +22795,6 @@ export const de_EnableVpcClassicLinkCommand = async ( return response; }; -/** - * deserializeAws_ec2EnableVpcClassicLinkCommandError - */ -const de_EnableVpcClassicLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EnableVpcClassicLinkDnsSupportCommand */ @@ -31203,7 +22803,7 @@ export const de_EnableVpcClassicLinkDnsSupportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableVpcClassicLinkDnsSupportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31215,26 +22815,6 @@ export const de_EnableVpcClassicLinkDnsSupportCommand = async ( return response; }; -/** - * deserializeAws_ec2EnableVpcClassicLinkDnsSupportCommandError - */ -const de_EnableVpcClassicLinkDnsSupportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ExportClientVpnClientCertificateRevocationListCommand */ @@ -31243,7 +22823,7 @@ export const de_ExportClientVpnClientCertificateRevocationListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExportClientVpnClientCertificateRevocationListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31255,26 +22835,6 @@ export const de_ExportClientVpnClientCertificateRevocationListCommand = async ( return response; }; -/** - * deserializeAws_ec2ExportClientVpnClientCertificateRevocationListCommandError - */ -const de_ExportClientVpnClientCertificateRevocationListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ExportClientVpnClientConfigurationCommand */ @@ -31283,7 +22843,7 @@ export const de_ExportClientVpnClientConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExportClientVpnClientConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31295,26 +22855,6 @@ export const de_ExportClientVpnClientConfigurationCommand = async ( return response; }; -/** - * deserializeAws_ec2ExportClientVpnClientConfigurationCommandError - */ -const de_ExportClientVpnClientConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ExportImageCommand */ @@ -31323,7 +22863,7 @@ export const de_ExportImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExportImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31335,26 +22875,6 @@ export const de_ExportImageCommand = async ( return response; }; -/** - * deserializeAws_ec2ExportImageCommandError - */ -const de_ExportImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ExportTransitGatewayRoutesCommand */ @@ -31363,7 +22883,7 @@ export const de_ExportTransitGatewayRoutesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExportTransitGatewayRoutesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31375,26 +22895,6 @@ export const de_ExportTransitGatewayRoutesCommand = async ( return response; }; -/** - * deserializeAws_ec2ExportTransitGatewayRoutesCommandError - */ -const de_ExportTransitGatewayRoutesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetAssociatedEnclaveCertificateIamRolesCommand */ @@ -31403,7 +22903,7 @@ export const de_GetAssociatedEnclaveCertificateIamRolesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAssociatedEnclaveCertificateIamRolesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31415,26 +22915,6 @@ export const de_GetAssociatedEnclaveCertificateIamRolesCommand = async ( return response; }; -/** - * deserializeAws_ec2GetAssociatedEnclaveCertificateIamRolesCommandError - */ -const de_GetAssociatedEnclaveCertificateIamRolesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetAssociatedIpv6PoolCidrsCommand */ @@ -31443,7 +22923,7 @@ export const de_GetAssociatedIpv6PoolCidrsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAssociatedIpv6PoolCidrsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31455,26 +22935,6 @@ export const de_GetAssociatedIpv6PoolCidrsCommand = async ( return response; }; -/** - * deserializeAws_ec2GetAssociatedIpv6PoolCidrsCommandError - */ -const de_GetAssociatedIpv6PoolCidrsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetAwsNetworkPerformanceDataCommand */ @@ -31483,7 +22943,7 @@ export const de_GetAwsNetworkPerformanceDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAwsNetworkPerformanceDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31495,26 +22955,6 @@ export const de_GetAwsNetworkPerformanceDataCommand = async ( return response; }; -/** - * deserializeAws_ec2GetAwsNetworkPerformanceDataCommandError - */ -const de_GetAwsNetworkPerformanceDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetCapacityReservationUsageCommand */ @@ -31523,7 +22963,7 @@ export const de_GetCapacityReservationUsageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCapacityReservationUsageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31535,26 +22975,6 @@ export const de_GetCapacityReservationUsageCommand = async ( return response; }; -/** - * deserializeAws_ec2GetCapacityReservationUsageCommandError - */ -const de_GetCapacityReservationUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetCoipPoolUsageCommand */ @@ -31563,7 +22983,7 @@ export const de_GetCoipPoolUsageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCoipPoolUsageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31575,26 +22995,6 @@ export const de_GetCoipPoolUsageCommand = async ( return response; }; -/** - * deserializeAws_ec2GetCoipPoolUsageCommandError - */ -const de_GetCoipPoolUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetConsoleOutputCommand */ @@ -31603,7 +23003,7 @@ export const de_GetConsoleOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetConsoleOutputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31615,26 +23015,6 @@ export const de_GetConsoleOutputCommand = async ( return response; }; -/** - * deserializeAws_ec2GetConsoleOutputCommandError - */ -const de_GetConsoleOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetConsoleScreenshotCommand */ @@ -31643,7 +23023,7 @@ export const de_GetConsoleScreenshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetConsoleScreenshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31655,26 +23035,6 @@ export const de_GetConsoleScreenshotCommand = async ( return response; }; -/** - * deserializeAws_ec2GetConsoleScreenshotCommandError - */ -const de_GetConsoleScreenshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetDefaultCreditSpecificationCommand */ @@ -31683,7 +23043,7 @@ export const de_GetDefaultCreditSpecificationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDefaultCreditSpecificationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31695,26 +23055,6 @@ export const de_GetDefaultCreditSpecificationCommand = async ( return response; }; -/** - * deserializeAws_ec2GetDefaultCreditSpecificationCommandError - */ -const de_GetDefaultCreditSpecificationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetEbsDefaultKmsKeyIdCommand */ @@ -31723,7 +23063,7 @@ export const de_GetEbsDefaultKmsKeyIdCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetEbsDefaultKmsKeyIdCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31735,26 +23075,6 @@ export const de_GetEbsDefaultKmsKeyIdCommand = async ( return response; }; -/** - * deserializeAws_ec2GetEbsDefaultKmsKeyIdCommandError - */ -const de_GetEbsDefaultKmsKeyIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetEbsEncryptionByDefaultCommand */ @@ -31763,7 +23083,7 @@ export const de_GetEbsEncryptionByDefaultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetEbsEncryptionByDefaultCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31775,26 +23095,6 @@ export const de_GetEbsEncryptionByDefaultCommand = async ( return response; }; -/** - * deserializeAws_ec2GetEbsEncryptionByDefaultCommandError - */ -const de_GetEbsEncryptionByDefaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetFlowLogsIntegrationTemplateCommand */ @@ -31803,7 +23103,7 @@ export const de_GetFlowLogsIntegrationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetFlowLogsIntegrationTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31815,26 +23115,6 @@ export const de_GetFlowLogsIntegrationTemplateCommand = async ( return response; }; -/** - * deserializeAws_ec2GetFlowLogsIntegrationTemplateCommandError - */ -const de_GetFlowLogsIntegrationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetGroupsForCapacityReservationCommand */ @@ -31843,7 +23123,7 @@ export const de_GetGroupsForCapacityReservationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetGroupsForCapacityReservationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31855,26 +23135,6 @@ export const de_GetGroupsForCapacityReservationCommand = async ( return response; }; -/** - * deserializeAws_ec2GetGroupsForCapacityReservationCommandError - */ -const de_GetGroupsForCapacityReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetHostReservationPurchasePreviewCommand */ @@ -31883,7 +23143,7 @@ export const de_GetHostReservationPurchasePreviewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetHostReservationPurchasePreviewCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31895,26 +23155,6 @@ export const de_GetHostReservationPurchasePreviewCommand = async ( return response; }; -/** - * deserializeAws_ec2GetHostReservationPurchasePreviewCommandError - */ -const de_GetHostReservationPurchasePreviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetImageBlockPublicAccessStateCommand */ @@ -31923,7 +23163,7 @@ export const de_GetImageBlockPublicAccessStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetImageBlockPublicAccessStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31935,26 +23175,6 @@ export const de_GetImageBlockPublicAccessStateCommand = async ( return response; }; -/** - * deserializeAws_ec2GetImageBlockPublicAccessStateCommandError - */ -const de_GetImageBlockPublicAccessStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetInstanceTypesFromInstanceRequirementsCommand */ @@ -31963,7 +23183,7 @@ export const de_GetInstanceTypesFromInstanceRequirementsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetInstanceTypesFromInstanceRequirementsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -31975,26 +23195,6 @@ export const de_GetInstanceTypesFromInstanceRequirementsCommand = async ( return response; }; -/** - * deserializeAws_ec2GetInstanceTypesFromInstanceRequirementsCommandError - */ -const de_GetInstanceTypesFromInstanceRequirementsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetInstanceUefiDataCommand */ @@ -32003,7 +23203,7 @@ export const de_GetInstanceUefiDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetInstanceUefiDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32015,26 +23215,6 @@ export const de_GetInstanceUefiDataCommand = async ( return response; }; -/** - * deserializeAws_ec2GetInstanceUefiDataCommandError - */ -const de_GetInstanceUefiDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetIpamAddressHistoryCommand */ @@ -32043,7 +23223,7 @@ export const de_GetIpamAddressHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetIpamAddressHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32055,26 +23235,6 @@ export const de_GetIpamAddressHistoryCommand = async ( return response; }; -/** - * deserializeAws_ec2GetIpamAddressHistoryCommandError - */ -const de_GetIpamAddressHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetIpamDiscoveredAccountsCommand */ @@ -32083,7 +23243,7 @@ export const de_GetIpamDiscoveredAccountsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetIpamDiscoveredAccountsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32095,26 +23255,6 @@ export const de_GetIpamDiscoveredAccountsCommand = async ( return response; }; -/** - * deserializeAws_ec2GetIpamDiscoveredAccountsCommandError - */ -const de_GetIpamDiscoveredAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetIpamDiscoveredPublicAddressesCommand */ @@ -32123,7 +23263,7 @@ export const de_GetIpamDiscoveredPublicAddressesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetIpamDiscoveredPublicAddressesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32135,26 +23275,6 @@ export const de_GetIpamDiscoveredPublicAddressesCommand = async ( return response; }; -/** - * deserializeAws_ec2GetIpamDiscoveredPublicAddressesCommandError - */ -const de_GetIpamDiscoveredPublicAddressesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetIpamDiscoveredResourceCidrsCommand */ @@ -32163,7 +23283,7 @@ export const de_GetIpamDiscoveredResourceCidrsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetIpamDiscoveredResourceCidrsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32175,26 +23295,6 @@ export const de_GetIpamDiscoveredResourceCidrsCommand = async ( return response; }; -/** - * deserializeAws_ec2GetIpamDiscoveredResourceCidrsCommandError - */ -const de_GetIpamDiscoveredResourceCidrsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetIpamPoolAllocationsCommand */ @@ -32203,36 +23303,16 @@ export const de_GetIpamPoolAllocationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetIpamPoolAllocationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_GetIpamPoolAllocationsResult(data, context); const response: GetIpamPoolAllocationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_ec2GetIpamPoolAllocationsCommandError - */ -const de_GetIpamPoolAllocationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -32243,7 +23323,7 @@ export const de_GetIpamPoolCidrsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetIpamPoolCidrsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32255,26 +23335,6 @@ export const de_GetIpamPoolCidrsCommand = async ( return response; }; -/** - * deserializeAws_ec2GetIpamPoolCidrsCommandError - */ -const de_GetIpamPoolCidrsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetIpamResourceCidrsCommand */ @@ -32283,7 +23343,7 @@ export const de_GetIpamResourceCidrsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetIpamResourceCidrsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32295,26 +23355,6 @@ export const de_GetIpamResourceCidrsCommand = async ( return response; }; -/** - * deserializeAws_ec2GetIpamResourceCidrsCommandError - */ -const de_GetIpamResourceCidrsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetLaunchTemplateDataCommand */ @@ -32323,7 +23363,7 @@ export const de_GetLaunchTemplateDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetLaunchTemplateDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32335,26 +23375,6 @@ export const de_GetLaunchTemplateDataCommand = async ( return response; }; -/** - * deserializeAws_ec2GetLaunchTemplateDataCommandError - */ -const de_GetLaunchTemplateDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetManagedPrefixListAssociationsCommand */ @@ -32363,7 +23383,7 @@ export const de_GetManagedPrefixListAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetManagedPrefixListAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32375,26 +23395,6 @@ export const de_GetManagedPrefixListAssociationsCommand = async ( return response; }; -/** - * deserializeAws_ec2GetManagedPrefixListAssociationsCommandError - */ -const de_GetManagedPrefixListAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetManagedPrefixListEntriesCommand */ @@ -32403,7 +23403,7 @@ export const de_GetManagedPrefixListEntriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetManagedPrefixListEntriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32415,26 +23415,6 @@ export const de_GetManagedPrefixListEntriesCommand = async ( return response; }; -/** - * deserializeAws_ec2GetManagedPrefixListEntriesCommandError - */ -const de_GetManagedPrefixListEntriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetNetworkInsightsAccessScopeAnalysisFindingsCommand */ @@ -32443,7 +23423,7 @@ export const de_GetNetworkInsightsAccessScopeAnalysisFindingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetNetworkInsightsAccessScopeAnalysisFindingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32455,26 +23435,6 @@ export const de_GetNetworkInsightsAccessScopeAnalysisFindingsCommand = async ( return response; }; -/** - * deserializeAws_ec2GetNetworkInsightsAccessScopeAnalysisFindingsCommandError - */ -const de_GetNetworkInsightsAccessScopeAnalysisFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetNetworkInsightsAccessScopeContentCommand */ @@ -32483,7 +23443,7 @@ export const de_GetNetworkInsightsAccessScopeContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetNetworkInsightsAccessScopeContentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32495,26 +23455,6 @@ export const de_GetNetworkInsightsAccessScopeContentCommand = async ( return response; }; -/** - * deserializeAws_ec2GetNetworkInsightsAccessScopeContentCommandError - */ -const de_GetNetworkInsightsAccessScopeContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetPasswordDataCommand */ @@ -32523,7 +23463,7 @@ export const de_GetPasswordDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPasswordDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32535,26 +23475,6 @@ export const de_GetPasswordDataCommand = async ( return response; }; -/** - * deserializeAws_ec2GetPasswordDataCommandError - */ -const de_GetPasswordDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetReservedInstancesExchangeQuoteCommand */ @@ -32563,7 +23483,7 @@ export const de_GetReservedInstancesExchangeQuoteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetReservedInstancesExchangeQuoteCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32575,26 +23495,6 @@ export const de_GetReservedInstancesExchangeQuoteCommand = async ( return response; }; -/** - * deserializeAws_ec2GetReservedInstancesExchangeQuoteCommandError - */ -const de_GetReservedInstancesExchangeQuoteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetSecurityGroupsForVpcCommand */ @@ -32603,7 +23503,7 @@ export const de_GetSecurityGroupsForVpcCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSecurityGroupsForVpcCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32615,26 +23515,6 @@ export const de_GetSecurityGroupsForVpcCommand = async ( return response; }; -/** - * deserializeAws_ec2GetSecurityGroupsForVpcCommandError - */ -const de_GetSecurityGroupsForVpcCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetSerialConsoleAccessStatusCommand */ @@ -32643,7 +23523,7 @@ export const de_GetSerialConsoleAccessStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSerialConsoleAccessStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32655,26 +23535,6 @@ export const de_GetSerialConsoleAccessStatusCommand = async ( return response; }; -/** - * deserializeAws_ec2GetSerialConsoleAccessStatusCommandError - */ -const de_GetSerialConsoleAccessStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetSnapshotBlockPublicAccessStateCommand */ @@ -32683,7 +23543,7 @@ export const de_GetSnapshotBlockPublicAccessStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSnapshotBlockPublicAccessStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32695,26 +23555,6 @@ export const de_GetSnapshotBlockPublicAccessStateCommand = async ( return response; }; -/** - * deserializeAws_ec2GetSnapshotBlockPublicAccessStateCommandError - */ -const de_GetSnapshotBlockPublicAccessStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetSpotPlacementScoresCommand */ @@ -32723,7 +23563,7 @@ export const de_GetSpotPlacementScoresCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSpotPlacementScoresCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32735,26 +23575,6 @@ export const de_GetSpotPlacementScoresCommand = async ( return response; }; -/** - * deserializeAws_ec2GetSpotPlacementScoresCommandError - */ -const de_GetSpotPlacementScoresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetSubnetCidrReservationsCommand */ @@ -32763,7 +23583,7 @@ export const de_GetSubnetCidrReservationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSubnetCidrReservationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32775,26 +23595,6 @@ export const de_GetSubnetCidrReservationsCommand = async ( return response; }; -/** - * deserializeAws_ec2GetSubnetCidrReservationsCommandError - */ -const de_GetSubnetCidrReservationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetTransitGatewayAttachmentPropagationsCommand */ @@ -32803,7 +23603,7 @@ export const de_GetTransitGatewayAttachmentPropagationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTransitGatewayAttachmentPropagationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32815,26 +23615,6 @@ export const de_GetTransitGatewayAttachmentPropagationsCommand = async ( return response; }; -/** - * deserializeAws_ec2GetTransitGatewayAttachmentPropagationsCommandError - */ -const de_GetTransitGatewayAttachmentPropagationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetTransitGatewayMulticastDomainAssociationsCommand */ @@ -32843,7 +23623,7 @@ export const de_GetTransitGatewayMulticastDomainAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTransitGatewayMulticastDomainAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32855,26 +23635,6 @@ export const de_GetTransitGatewayMulticastDomainAssociationsCommand = async ( return response; }; -/** - * deserializeAws_ec2GetTransitGatewayMulticastDomainAssociationsCommandError - */ -const de_GetTransitGatewayMulticastDomainAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetTransitGatewayPolicyTableAssociationsCommand */ @@ -32883,7 +23643,7 @@ export const de_GetTransitGatewayPolicyTableAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTransitGatewayPolicyTableAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32895,26 +23655,6 @@ export const de_GetTransitGatewayPolicyTableAssociationsCommand = async ( return response; }; -/** - * deserializeAws_ec2GetTransitGatewayPolicyTableAssociationsCommandError - */ -const de_GetTransitGatewayPolicyTableAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetTransitGatewayPolicyTableEntriesCommand */ @@ -32923,7 +23663,7 @@ export const de_GetTransitGatewayPolicyTableEntriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTransitGatewayPolicyTableEntriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32935,26 +23675,6 @@ export const de_GetTransitGatewayPolicyTableEntriesCommand = async ( return response; }; -/** - * deserializeAws_ec2GetTransitGatewayPolicyTableEntriesCommandError - */ -const de_GetTransitGatewayPolicyTableEntriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetTransitGatewayPrefixListReferencesCommand */ @@ -32963,7 +23683,7 @@ export const de_GetTransitGatewayPrefixListReferencesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTransitGatewayPrefixListReferencesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -32975,26 +23695,6 @@ export const de_GetTransitGatewayPrefixListReferencesCommand = async ( return response; }; -/** - * deserializeAws_ec2GetTransitGatewayPrefixListReferencesCommandError - */ -const de_GetTransitGatewayPrefixListReferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetTransitGatewayRouteTableAssociationsCommand */ @@ -33003,7 +23703,7 @@ export const de_GetTransitGatewayRouteTableAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTransitGatewayRouteTableAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33015,26 +23715,6 @@ export const de_GetTransitGatewayRouteTableAssociationsCommand = async ( return response; }; -/** - * deserializeAws_ec2GetTransitGatewayRouteTableAssociationsCommandError - */ -const de_GetTransitGatewayRouteTableAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetTransitGatewayRouteTablePropagationsCommand */ @@ -33043,7 +23723,7 @@ export const de_GetTransitGatewayRouteTablePropagationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTransitGatewayRouteTablePropagationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33055,26 +23735,6 @@ export const de_GetTransitGatewayRouteTablePropagationsCommand = async ( return response; }; -/** - * deserializeAws_ec2GetTransitGatewayRouteTablePropagationsCommandError - */ -const de_GetTransitGatewayRouteTablePropagationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetVerifiedAccessEndpointPolicyCommand */ @@ -33083,7 +23743,7 @@ export const de_GetVerifiedAccessEndpointPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetVerifiedAccessEndpointPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33095,26 +23755,6 @@ export const de_GetVerifiedAccessEndpointPolicyCommand = async ( return response; }; -/** - * deserializeAws_ec2GetVerifiedAccessEndpointPolicyCommandError - */ -const de_GetVerifiedAccessEndpointPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetVerifiedAccessGroupPolicyCommand */ @@ -33123,7 +23763,7 @@ export const de_GetVerifiedAccessGroupPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetVerifiedAccessGroupPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33135,26 +23775,6 @@ export const de_GetVerifiedAccessGroupPolicyCommand = async ( return response; }; -/** - * deserializeAws_ec2GetVerifiedAccessGroupPolicyCommandError - */ -const de_GetVerifiedAccessGroupPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetVpnConnectionDeviceSampleConfigurationCommand */ @@ -33163,7 +23783,7 @@ export const de_GetVpnConnectionDeviceSampleConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetVpnConnectionDeviceSampleConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33175,26 +23795,6 @@ export const de_GetVpnConnectionDeviceSampleConfigurationCommand = async ( return response; }; -/** - * deserializeAws_ec2GetVpnConnectionDeviceSampleConfigurationCommandError - */ -const de_GetVpnConnectionDeviceSampleConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetVpnConnectionDeviceTypesCommand */ @@ -33203,7 +23803,7 @@ export const de_GetVpnConnectionDeviceTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetVpnConnectionDeviceTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33215,26 +23815,6 @@ export const de_GetVpnConnectionDeviceTypesCommand = async ( return response; }; -/** - * deserializeAws_ec2GetVpnConnectionDeviceTypesCommandError - */ -const de_GetVpnConnectionDeviceTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GetVpnTunnelReplacementStatusCommand */ @@ -33243,7 +23823,7 @@ export const de_GetVpnTunnelReplacementStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetVpnTunnelReplacementStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33255,26 +23835,6 @@ export const de_GetVpnTunnelReplacementStatusCommand = async ( return response; }; -/** - * deserializeAws_ec2GetVpnTunnelReplacementStatusCommandError - */ -const de_GetVpnTunnelReplacementStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ImportClientVpnClientCertificateRevocationListCommand */ @@ -33283,7 +23843,7 @@ export const de_ImportClientVpnClientCertificateRevocationListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportClientVpnClientCertificateRevocationListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33295,26 +23855,6 @@ export const de_ImportClientVpnClientCertificateRevocationListCommand = async ( return response; }; -/** - * deserializeAws_ec2ImportClientVpnClientCertificateRevocationListCommandError - */ -const de_ImportClientVpnClientCertificateRevocationListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ImportImageCommand */ @@ -33323,36 +23863,16 @@ export const de_ImportImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_ImportImageResult(data, context); const response: ImportImageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_ec2ImportImageCommandError - */ -const de_ImportImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -33363,7 +23883,7 @@ export const de_ImportInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33375,26 +23895,6 @@ export const de_ImportInstanceCommand = async ( return response; }; -/** - * deserializeAws_ec2ImportInstanceCommandError - */ -const de_ImportInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ImportKeyPairCommand */ @@ -33403,7 +23903,7 @@ export const de_ImportKeyPairCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportKeyPairCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33415,26 +23915,6 @@ export const de_ImportKeyPairCommand = async ( return response; }; -/** - * deserializeAws_ec2ImportKeyPairCommandError - */ -const de_ImportKeyPairCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ImportSnapshotCommand */ @@ -33443,7 +23923,7 @@ export const de_ImportSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33455,26 +23935,6 @@ export const de_ImportSnapshotCommand = async ( return response; }; -/** - * deserializeAws_ec2ImportSnapshotCommandError - */ -const de_ImportSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ImportVolumeCommand */ @@ -33483,7 +23943,7 @@ export const de_ImportVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportVolumeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33495,26 +23955,6 @@ export const de_ImportVolumeCommand = async ( return response; }; -/** - * deserializeAws_ec2ImportVolumeCommandError - */ -const de_ImportVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ListImagesInRecycleBinCommand */ @@ -33523,7 +23963,7 @@ export const de_ListImagesInRecycleBinCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListImagesInRecycleBinCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33535,26 +23975,6 @@ export const de_ListImagesInRecycleBinCommand = async ( return response; }; -/** - * deserializeAws_ec2ListImagesInRecycleBinCommandError - */ -const de_ListImagesInRecycleBinCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ListSnapshotsInRecycleBinCommand */ @@ -33563,7 +23983,7 @@ export const de_ListSnapshotsInRecycleBinCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSnapshotsInRecycleBinCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33575,26 +23995,6 @@ export const de_ListSnapshotsInRecycleBinCommand = async ( return response; }; -/** - * deserializeAws_ec2ListSnapshotsInRecycleBinCommandError - */ -const de_ListSnapshotsInRecycleBinCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2LockSnapshotCommand */ @@ -33603,7 +24003,7 @@ export const de_LockSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_LockSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33615,26 +24015,6 @@ export const de_LockSnapshotCommand = async ( return response; }; -/** - * deserializeAws_ec2LockSnapshotCommandError - */ -const de_LockSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyAddressAttributeCommand */ @@ -33643,7 +24023,7 @@ export const de_ModifyAddressAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyAddressAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33655,26 +24035,6 @@ export const de_ModifyAddressAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyAddressAttributeCommandError - */ -const de_ModifyAddressAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyAvailabilityZoneGroupCommand */ @@ -33683,7 +24043,7 @@ export const de_ModifyAvailabilityZoneGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyAvailabilityZoneGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33695,26 +24055,6 @@ export const de_ModifyAvailabilityZoneGroupCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyAvailabilityZoneGroupCommandError - */ -const de_ModifyAvailabilityZoneGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyCapacityReservationCommand */ @@ -33723,7 +24063,7 @@ export const de_ModifyCapacityReservationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyCapacityReservationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33735,26 +24075,6 @@ export const de_ModifyCapacityReservationCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyCapacityReservationCommandError - */ -const de_ModifyCapacityReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyCapacityReservationFleetCommand */ @@ -33763,7 +24083,7 @@ export const de_ModifyCapacityReservationFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyCapacityReservationFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33775,26 +24095,6 @@ export const de_ModifyCapacityReservationFleetCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyCapacityReservationFleetCommandError - */ -const de_ModifyCapacityReservationFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyClientVpnEndpointCommand */ @@ -33803,7 +24103,7 @@ export const de_ModifyClientVpnEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyClientVpnEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33815,26 +24115,6 @@ export const de_ModifyClientVpnEndpointCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyClientVpnEndpointCommandError - */ -const de_ModifyClientVpnEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyDefaultCreditSpecificationCommand */ @@ -33843,7 +24123,7 @@ export const de_ModifyDefaultCreditSpecificationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyDefaultCreditSpecificationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33855,26 +24135,6 @@ export const de_ModifyDefaultCreditSpecificationCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyDefaultCreditSpecificationCommandError - */ -const de_ModifyDefaultCreditSpecificationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyEbsDefaultKmsKeyIdCommand */ @@ -33883,7 +24143,7 @@ export const de_ModifyEbsDefaultKmsKeyIdCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyEbsDefaultKmsKeyIdCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33895,26 +24155,6 @@ export const de_ModifyEbsDefaultKmsKeyIdCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyEbsDefaultKmsKeyIdCommandError - */ -const de_ModifyEbsDefaultKmsKeyIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyFleetCommand */ @@ -33923,7 +24163,7 @@ export const de_ModifyFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33935,26 +24175,6 @@ export const de_ModifyFleetCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyFleetCommandError - */ -const de_ModifyFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyFpgaImageAttributeCommand */ @@ -33963,7 +24183,7 @@ export const de_ModifyFpgaImageAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyFpgaImageAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -33975,26 +24195,6 @@ export const de_ModifyFpgaImageAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyFpgaImageAttributeCommandError - */ -const de_ModifyFpgaImageAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyHostsCommand */ @@ -34003,7 +24203,7 @@ export const de_ModifyHostsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyHostsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34015,26 +24215,6 @@ export const de_ModifyHostsCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyHostsCommandError - */ -const de_ModifyHostsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyIdentityIdFormatCommand */ @@ -34043,7 +24223,7 @@ export const de_ModifyIdentityIdFormatCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyIdentityIdFormatCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ModifyIdentityIdFormatCommandOutput = { @@ -34052,26 +24232,6 @@ export const de_ModifyIdentityIdFormatCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyIdentityIdFormatCommandError - */ -const de_ModifyIdentityIdFormatCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyIdFormatCommand */ @@ -34080,7 +24240,7 @@ export const de_ModifyIdFormatCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyIdFormatCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ModifyIdFormatCommandOutput = { @@ -34089,26 +24249,6 @@ export const de_ModifyIdFormatCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyIdFormatCommandError - */ -const de_ModifyIdFormatCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyImageAttributeCommand */ @@ -34117,7 +24257,7 @@ export const de_ModifyImageAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyImageAttributeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ModifyImageAttributeCommandOutput = { @@ -34126,26 +24266,6 @@ export const de_ModifyImageAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyImageAttributeCommandError - */ -const de_ModifyImageAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyInstanceAttributeCommand */ @@ -34154,7 +24274,7 @@ export const de_ModifyInstanceAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyInstanceAttributeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ModifyInstanceAttributeCommandOutput = { @@ -34163,26 +24283,6 @@ export const de_ModifyInstanceAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyInstanceAttributeCommandError - */ -const de_ModifyInstanceAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyInstanceCapacityReservationAttributesCommand */ @@ -34191,7 +24291,7 @@ export const de_ModifyInstanceCapacityReservationAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyInstanceCapacityReservationAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34203,26 +24303,6 @@ export const de_ModifyInstanceCapacityReservationAttributesCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyInstanceCapacityReservationAttributesCommandError - */ -const de_ModifyInstanceCapacityReservationAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyInstanceCreditSpecificationCommand */ @@ -34231,7 +24311,7 @@ export const de_ModifyInstanceCreditSpecificationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyInstanceCreditSpecificationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34243,26 +24323,6 @@ export const de_ModifyInstanceCreditSpecificationCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyInstanceCreditSpecificationCommandError - */ -const de_ModifyInstanceCreditSpecificationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyInstanceEventStartTimeCommand */ @@ -34271,7 +24331,7 @@ export const de_ModifyInstanceEventStartTimeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyInstanceEventStartTimeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34283,26 +24343,6 @@ export const de_ModifyInstanceEventStartTimeCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyInstanceEventStartTimeCommandError - */ -const de_ModifyInstanceEventStartTimeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyInstanceEventWindowCommand */ @@ -34311,7 +24351,7 @@ export const de_ModifyInstanceEventWindowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyInstanceEventWindowCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34323,26 +24363,6 @@ export const de_ModifyInstanceEventWindowCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyInstanceEventWindowCommandError - */ -const de_ModifyInstanceEventWindowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyInstanceMaintenanceOptionsCommand */ @@ -34351,7 +24371,7 @@ export const de_ModifyInstanceMaintenanceOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyInstanceMaintenanceOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34363,26 +24383,6 @@ export const de_ModifyInstanceMaintenanceOptionsCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyInstanceMaintenanceOptionsCommandError - */ -const de_ModifyInstanceMaintenanceOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyInstanceMetadataOptionsCommand */ @@ -34391,7 +24391,7 @@ export const de_ModifyInstanceMetadataOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyInstanceMetadataOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34403,26 +24403,6 @@ export const de_ModifyInstanceMetadataOptionsCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyInstanceMetadataOptionsCommandError - */ -const de_ModifyInstanceMetadataOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyInstancePlacementCommand */ @@ -34431,36 +24411,16 @@ export const de_ModifyInstancePlacementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyInstancePlacementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_ModifyInstancePlacementResult(data, context); const response: ModifyInstancePlacementCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_ec2ModifyInstancePlacementCommandError - */ -const de_ModifyInstancePlacementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -34471,7 +24431,7 @@ export const de_ModifyIpamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyIpamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34483,26 +24443,6 @@ export const de_ModifyIpamCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyIpamCommandError - */ -const de_ModifyIpamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyIpamPoolCommand */ @@ -34511,7 +24451,7 @@ export const de_ModifyIpamPoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyIpamPoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34523,26 +24463,6 @@ export const de_ModifyIpamPoolCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyIpamPoolCommandError - */ -const de_ModifyIpamPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyIpamResourceCidrCommand */ @@ -34551,7 +24471,7 @@ export const de_ModifyIpamResourceCidrCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyIpamResourceCidrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34563,26 +24483,6 @@ export const de_ModifyIpamResourceCidrCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyIpamResourceCidrCommandError - */ -const de_ModifyIpamResourceCidrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyIpamResourceDiscoveryCommand */ @@ -34591,7 +24491,7 @@ export const de_ModifyIpamResourceDiscoveryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyIpamResourceDiscoveryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34603,26 +24503,6 @@ export const de_ModifyIpamResourceDiscoveryCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyIpamResourceDiscoveryCommandError - */ -const de_ModifyIpamResourceDiscoveryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyIpamScopeCommand */ @@ -34631,7 +24511,7 @@ export const de_ModifyIpamScopeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyIpamScopeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34643,26 +24523,6 @@ export const de_ModifyIpamScopeCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyIpamScopeCommandError - */ -const de_ModifyIpamScopeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyLaunchTemplateCommand */ @@ -34671,7 +24531,7 @@ export const de_ModifyLaunchTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyLaunchTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34683,26 +24543,6 @@ export const de_ModifyLaunchTemplateCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyLaunchTemplateCommandError - */ -const de_ModifyLaunchTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyLocalGatewayRouteCommand */ @@ -34711,7 +24551,7 @@ export const de_ModifyLocalGatewayRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyLocalGatewayRouteCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34723,26 +24563,6 @@ export const de_ModifyLocalGatewayRouteCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyLocalGatewayRouteCommandError - */ -const de_ModifyLocalGatewayRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyManagedPrefixListCommand */ @@ -34751,7 +24571,7 @@ export const de_ModifyManagedPrefixListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyManagedPrefixListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34763,26 +24583,6 @@ export const de_ModifyManagedPrefixListCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyManagedPrefixListCommandError - */ -const de_ModifyManagedPrefixListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyNetworkInterfaceAttributeCommand */ @@ -34791,7 +24591,7 @@ export const de_ModifyNetworkInterfaceAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyNetworkInterfaceAttributeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ModifyNetworkInterfaceAttributeCommandOutput = { @@ -34800,26 +24600,6 @@ export const de_ModifyNetworkInterfaceAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyNetworkInterfaceAttributeCommandError - */ -const de_ModifyNetworkInterfaceAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyPrivateDnsNameOptionsCommand */ @@ -34828,7 +24608,7 @@ export const de_ModifyPrivateDnsNameOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyPrivateDnsNameOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34840,26 +24620,6 @@ export const de_ModifyPrivateDnsNameOptionsCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyPrivateDnsNameOptionsCommandError - */ -const de_ModifyPrivateDnsNameOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyReservedInstancesCommand */ @@ -34868,7 +24628,7 @@ export const de_ModifyReservedInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyReservedInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34880,26 +24640,6 @@ export const de_ModifyReservedInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyReservedInstancesCommandError - */ -const de_ModifyReservedInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifySecurityGroupRulesCommand */ @@ -34908,7 +24648,7 @@ export const de_ModifySecurityGroupRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifySecurityGroupRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34920,26 +24660,6 @@ export const de_ModifySecurityGroupRulesCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifySecurityGroupRulesCommandError - */ -const de_ModifySecurityGroupRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifySnapshotAttributeCommand */ @@ -34948,7 +24668,7 @@ export const de_ModifySnapshotAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifySnapshotAttributeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ModifySnapshotAttributeCommandOutput = { @@ -34957,26 +24677,6 @@ export const de_ModifySnapshotAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifySnapshotAttributeCommandError - */ -const de_ModifySnapshotAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifySnapshotTierCommand */ @@ -34985,7 +24685,7 @@ export const de_ModifySnapshotTierCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifySnapshotTierCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -34997,26 +24697,6 @@ export const de_ModifySnapshotTierCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifySnapshotTierCommandError - */ -const de_ModifySnapshotTierCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifySpotFleetRequestCommand */ @@ -35025,7 +24705,7 @@ export const de_ModifySpotFleetRequestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifySpotFleetRequestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35037,26 +24717,6 @@ export const de_ModifySpotFleetRequestCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifySpotFleetRequestCommandError - */ -const de_ModifySpotFleetRequestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifySubnetAttributeCommand */ @@ -35065,7 +24725,7 @@ export const de_ModifySubnetAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifySubnetAttributeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ModifySubnetAttributeCommandOutput = { @@ -35074,26 +24734,6 @@ export const de_ModifySubnetAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifySubnetAttributeCommandError - */ -const de_ModifySubnetAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyTrafficMirrorFilterNetworkServicesCommand */ @@ -35102,7 +24742,7 @@ export const de_ModifyTrafficMirrorFilterNetworkServicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyTrafficMirrorFilterNetworkServicesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35114,26 +24754,6 @@ export const de_ModifyTrafficMirrorFilterNetworkServicesCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyTrafficMirrorFilterNetworkServicesCommandError - */ -const de_ModifyTrafficMirrorFilterNetworkServicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyTrafficMirrorFilterRuleCommand */ @@ -35142,7 +24762,7 @@ export const de_ModifyTrafficMirrorFilterRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyTrafficMirrorFilterRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35154,26 +24774,6 @@ export const de_ModifyTrafficMirrorFilterRuleCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyTrafficMirrorFilterRuleCommandError - */ -const de_ModifyTrafficMirrorFilterRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyTrafficMirrorSessionCommand */ @@ -35182,7 +24782,7 @@ export const de_ModifyTrafficMirrorSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyTrafficMirrorSessionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35194,26 +24794,6 @@ export const de_ModifyTrafficMirrorSessionCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyTrafficMirrorSessionCommandError - */ -const de_ModifyTrafficMirrorSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyTransitGatewayCommand */ @@ -35222,7 +24802,7 @@ export const de_ModifyTransitGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyTransitGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35234,26 +24814,6 @@ export const de_ModifyTransitGatewayCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyTransitGatewayCommandError - */ -const de_ModifyTransitGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyTransitGatewayPrefixListReferenceCommand */ @@ -35262,7 +24822,7 @@ export const de_ModifyTransitGatewayPrefixListReferenceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyTransitGatewayPrefixListReferenceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35274,26 +24834,6 @@ export const de_ModifyTransitGatewayPrefixListReferenceCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyTransitGatewayPrefixListReferenceCommandError - */ -const de_ModifyTransitGatewayPrefixListReferenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyTransitGatewayVpcAttachmentCommand */ @@ -35302,7 +24842,7 @@ export const de_ModifyTransitGatewayVpcAttachmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyTransitGatewayVpcAttachmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35314,26 +24854,6 @@ export const de_ModifyTransitGatewayVpcAttachmentCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyTransitGatewayVpcAttachmentCommandError - */ -const de_ModifyTransitGatewayVpcAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVerifiedAccessEndpointCommand */ @@ -35342,7 +24862,7 @@ export const de_ModifyVerifiedAccessEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVerifiedAccessEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35354,26 +24874,6 @@ export const de_ModifyVerifiedAccessEndpointCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVerifiedAccessEndpointCommandError - */ -const de_ModifyVerifiedAccessEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVerifiedAccessEndpointPolicyCommand */ @@ -35382,7 +24882,7 @@ export const de_ModifyVerifiedAccessEndpointPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVerifiedAccessEndpointPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35394,26 +24894,6 @@ export const de_ModifyVerifiedAccessEndpointPolicyCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVerifiedAccessEndpointPolicyCommandError - */ -const de_ModifyVerifiedAccessEndpointPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVerifiedAccessGroupCommand */ @@ -35422,7 +24902,7 @@ export const de_ModifyVerifiedAccessGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVerifiedAccessGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35434,26 +24914,6 @@ export const de_ModifyVerifiedAccessGroupCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVerifiedAccessGroupCommandError - */ -const de_ModifyVerifiedAccessGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVerifiedAccessGroupPolicyCommand */ @@ -35462,7 +24922,7 @@ export const de_ModifyVerifiedAccessGroupPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVerifiedAccessGroupPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35474,26 +24934,6 @@ export const de_ModifyVerifiedAccessGroupPolicyCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVerifiedAccessGroupPolicyCommandError - */ -const de_ModifyVerifiedAccessGroupPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVerifiedAccessInstanceCommand */ @@ -35502,7 +24942,7 @@ export const de_ModifyVerifiedAccessInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVerifiedAccessInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35514,26 +24954,6 @@ export const de_ModifyVerifiedAccessInstanceCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVerifiedAccessInstanceCommandError - */ -const de_ModifyVerifiedAccessInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVerifiedAccessInstanceLoggingConfigurationCommand */ @@ -35542,36 +24962,16 @@ export const de_ModifyVerifiedAccessInstanceLoggingConfigurationCommand = async context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVerifiedAccessInstanceLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_ModifyVerifiedAccessInstanceLoggingConfigurationResult(data, context); const response: ModifyVerifiedAccessInstanceLoggingConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_ec2ModifyVerifiedAccessInstanceLoggingConfigurationCommandError - */ -const de_ModifyVerifiedAccessInstanceLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -35582,7 +24982,7 @@ export const de_ModifyVerifiedAccessTrustProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVerifiedAccessTrustProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35594,26 +24994,6 @@ export const de_ModifyVerifiedAccessTrustProviderCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVerifiedAccessTrustProviderCommandError - */ -const de_ModifyVerifiedAccessTrustProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVolumeCommand */ @@ -35622,7 +25002,7 @@ export const de_ModifyVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVolumeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35634,26 +25014,6 @@ export const de_ModifyVolumeCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVolumeCommandError - */ -const de_ModifyVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVolumeAttributeCommand */ @@ -35662,7 +25022,7 @@ export const de_ModifyVolumeAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVolumeAttributeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ModifyVolumeAttributeCommandOutput = { @@ -35671,26 +25031,6 @@ export const de_ModifyVolumeAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVolumeAttributeCommandError - */ -const de_ModifyVolumeAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVpcAttributeCommand */ @@ -35699,7 +25039,7 @@ export const de_ModifyVpcAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVpcAttributeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ModifyVpcAttributeCommandOutput = { @@ -35708,26 +25048,6 @@ export const de_ModifyVpcAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVpcAttributeCommandError - */ -const de_ModifyVpcAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVpcEndpointCommand */ @@ -35736,7 +25056,7 @@ export const de_ModifyVpcEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVpcEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35748,26 +25068,6 @@ export const de_ModifyVpcEndpointCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVpcEndpointCommandError - */ -const de_ModifyVpcEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVpcEndpointConnectionNotificationCommand */ @@ -35776,7 +25076,7 @@ export const de_ModifyVpcEndpointConnectionNotificationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVpcEndpointConnectionNotificationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35788,26 +25088,6 @@ export const de_ModifyVpcEndpointConnectionNotificationCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVpcEndpointConnectionNotificationCommandError - */ -const de_ModifyVpcEndpointConnectionNotificationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVpcEndpointServiceConfigurationCommand */ @@ -35816,7 +25096,7 @@ export const de_ModifyVpcEndpointServiceConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVpcEndpointServiceConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35828,26 +25108,6 @@ export const de_ModifyVpcEndpointServiceConfigurationCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVpcEndpointServiceConfigurationCommandError - */ -const de_ModifyVpcEndpointServiceConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVpcEndpointServicePayerResponsibilityCommand */ @@ -35856,7 +25116,7 @@ export const de_ModifyVpcEndpointServicePayerResponsibilityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVpcEndpointServicePayerResponsibilityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35868,26 +25128,6 @@ export const de_ModifyVpcEndpointServicePayerResponsibilityCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVpcEndpointServicePayerResponsibilityCommandError - */ -const de_ModifyVpcEndpointServicePayerResponsibilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVpcEndpointServicePermissionsCommand */ @@ -35896,7 +25136,7 @@ export const de_ModifyVpcEndpointServicePermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVpcEndpointServicePermissionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35908,26 +25148,6 @@ export const de_ModifyVpcEndpointServicePermissionsCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVpcEndpointServicePermissionsCommandError - */ -const de_ModifyVpcEndpointServicePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVpcPeeringConnectionOptionsCommand */ @@ -35936,7 +25156,7 @@ export const de_ModifyVpcPeeringConnectionOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVpcPeeringConnectionOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35948,26 +25168,6 @@ export const de_ModifyVpcPeeringConnectionOptionsCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVpcPeeringConnectionOptionsCommandError - */ -const de_ModifyVpcPeeringConnectionOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVpcTenancyCommand */ @@ -35976,7 +25176,7 @@ export const de_ModifyVpcTenancyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVpcTenancyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -35988,26 +25188,6 @@ export const de_ModifyVpcTenancyCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVpcTenancyCommandError - */ -const de_ModifyVpcTenancyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVpnConnectionCommand */ @@ -36016,7 +25196,7 @@ export const de_ModifyVpnConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVpnConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36028,26 +25208,6 @@ export const de_ModifyVpnConnectionCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVpnConnectionCommandError - */ -const de_ModifyVpnConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVpnConnectionOptionsCommand */ @@ -36056,7 +25216,7 @@ export const de_ModifyVpnConnectionOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVpnConnectionOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36068,26 +25228,6 @@ export const de_ModifyVpnConnectionOptionsCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVpnConnectionOptionsCommandError - */ -const de_ModifyVpnConnectionOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVpnTunnelCertificateCommand */ @@ -36096,7 +25236,7 @@ export const de_ModifyVpnTunnelCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVpnTunnelCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36108,26 +25248,6 @@ export const de_ModifyVpnTunnelCertificateCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVpnTunnelCertificateCommandError - */ -const de_ModifyVpnTunnelCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ModifyVpnTunnelOptionsCommand */ @@ -36136,7 +25256,7 @@ export const de_ModifyVpnTunnelOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyVpnTunnelOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36148,26 +25268,6 @@ export const de_ModifyVpnTunnelOptionsCommand = async ( return response; }; -/** - * deserializeAws_ec2ModifyVpnTunnelOptionsCommandError - */ -const de_ModifyVpnTunnelOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2MonitorInstancesCommand */ @@ -36176,7 +25276,7 @@ export const de_MonitorInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_MonitorInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36188,26 +25288,6 @@ export const de_MonitorInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2MonitorInstancesCommandError - */ -const de_MonitorInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2MoveAddressToVpcCommand */ @@ -36216,7 +25296,7 @@ export const de_MoveAddressToVpcCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_MoveAddressToVpcCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36228,26 +25308,6 @@ export const de_MoveAddressToVpcCommand = async ( return response; }; -/** - * deserializeAws_ec2MoveAddressToVpcCommandError - */ -const de_MoveAddressToVpcCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2MoveByoipCidrToIpamCommand */ @@ -36256,7 +25316,7 @@ export const de_MoveByoipCidrToIpamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_MoveByoipCidrToIpamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36268,26 +25328,6 @@ export const de_MoveByoipCidrToIpamCommand = async ( return response; }; -/** - * deserializeAws_ec2MoveByoipCidrToIpamCommandError - */ -const de_MoveByoipCidrToIpamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ProvisionByoipCidrCommand */ @@ -36296,7 +25336,7 @@ export const de_ProvisionByoipCidrCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ProvisionByoipCidrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36308,26 +25348,6 @@ export const de_ProvisionByoipCidrCommand = async ( return response; }; -/** - * deserializeAws_ec2ProvisionByoipCidrCommandError - */ -const de_ProvisionByoipCidrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ProvisionIpamByoasnCommand */ @@ -36336,7 +25356,7 @@ export const de_ProvisionIpamByoasnCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ProvisionIpamByoasnCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36348,26 +25368,6 @@ export const de_ProvisionIpamByoasnCommand = async ( return response; }; -/** - * deserializeAws_ec2ProvisionIpamByoasnCommandError - */ -const de_ProvisionIpamByoasnCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ProvisionIpamPoolCidrCommand */ @@ -36376,7 +25376,7 @@ export const de_ProvisionIpamPoolCidrCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ProvisionIpamPoolCidrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36388,26 +25388,6 @@ export const de_ProvisionIpamPoolCidrCommand = async ( return response; }; -/** - * deserializeAws_ec2ProvisionIpamPoolCidrCommandError - */ -const de_ProvisionIpamPoolCidrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ProvisionPublicIpv4PoolCidrCommand */ @@ -36416,7 +25396,7 @@ export const de_ProvisionPublicIpv4PoolCidrCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ProvisionPublicIpv4PoolCidrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36428,26 +25408,6 @@ export const de_ProvisionPublicIpv4PoolCidrCommand = async ( return response; }; -/** - * deserializeAws_ec2ProvisionPublicIpv4PoolCidrCommandError - */ -const de_ProvisionPublicIpv4PoolCidrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2PurchaseCapacityBlockCommand */ @@ -36456,7 +25416,7 @@ export const de_PurchaseCapacityBlockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PurchaseCapacityBlockCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36468,26 +25428,6 @@ export const de_PurchaseCapacityBlockCommand = async ( return response; }; -/** - * deserializeAws_ec2PurchaseCapacityBlockCommandError - */ -const de_PurchaseCapacityBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2PurchaseHostReservationCommand */ @@ -36496,7 +25436,7 @@ export const de_PurchaseHostReservationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PurchaseHostReservationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36508,26 +25448,6 @@ export const de_PurchaseHostReservationCommand = async ( return response; }; -/** - * deserializeAws_ec2PurchaseHostReservationCommandError - */ -const de_PurchaseHostReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2PurchaseReservedInstancesOfferingCommand */ @@ -36536,7 +25456,7 @@ export const de_PurchaseReservedInstancesOfferingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PurchaseReservedInstancesOfferingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36548,26 +25468,6 @@ export const de_PurchaseReservedInstancesOfferingCommand = async ( return response; }; -/** - * deserializeAws_ec2PurchaseReservedInstancesOfferingCommandError - */ -const de_PurchaseReservedInstancesOfferingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2PurchaseScheduledInstancesCommand */ @@ -36576,7 +25476,7 @@ export const de_PurchaseScheduledInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PurchaseScheduledInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36588,26 +25488,6 @@ export const de_PurchaseScheduledInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2PurchaseScheduledInstancesCommandError - */ -const de_PurchaseScheduledInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RebootInstancesCommand */ @@ -36616,7 +25496,7 @@ export const de_RebootInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RebootInstancesCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RebootInstancesCommandOutput = { @@ -36625,26 +25505,6 @@ export const de_RebootInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2RebootInstancesCommandError - */ -const de_RebootInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RegisterImageCommand */ @@ -36653,36 +25513,16 @@ export const de_RegisterImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_RegisterImageResult(data, context); const response: RegisterImageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_ec2RegisterImageCommandError - */ -const de_RegisterImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -36693,7 +25533,7 @@ export const de_RegisterInstanceEventNotificationAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterInstanceEventNotificationAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36705,26 +25545,6 @@ export const de_RegisterInstanceEventNotificationAttributesCommand = async ( return response; }; -/** - * deserializeAws_ec2RegisterInstanceEventNotificationAttributesCommandError - */ -const de_RegisterInstanceEventNotificationAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RegisterTransitGatewayMulticastGroupMembersCommand */ @@ -36733,7 +25553,7 @@ export const de_RegisterTransitGatewayMulticastGroupMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterTransitGatewayMulticastGroupMembersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36745,26 +25565,6 @@ export const de_RegisterTransitGatewayMulticastGroupMembersCommand = async ( return response; }; -/** - * deserializeAws_ec2RegisterTransitGatewayMulticastGroupMembersCommandError - */ -const de_RegisterTransitGatewayMulticastGroupMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RegisterTransitGatewayMulticastGroupSourcesCommand */ @@ -36773,7 +25573,7 @@ export const de_RegisterTransitGatewayMulticastGroupSourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterTransitGatewayMulticastGroupSourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36785,26 +25585,6 @@ export const de_RegisterTransitGatewayMulticastGroupSourcesCommand = async ( return response; }; -/** - * deserializeAws_ec2RegisterTransitGatewayMulticastGroupSourcesCommandError - */ -const de_RegisterTransitGatewayMulticastGroupSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RejectTransitGatewayMulticastDomainAssociationsCommand */ @@ -36813,7 +25593,7 @@ export const de_RejectTransitGatewayMulticastDomainAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RejectTransitGatewayMulticastDomainAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36825,26 +25605,6 @@ export const de_RejectTransitGatewayMulticastDomainAssociationsCommand = async ( return response; }; -/** - * deserializeAws_ec2RejectTransitGatewayMulticastDomainAssociationsCommandError - */ -const de_RejectTransitGatewayMulticastDomainAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RejectTransitGatewayPeeringAttachmentCommand */ @@ -36853,7 +25613,7 @@ export const de_RejectTransitGatewayPeeringAttachmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RejectTransitGatewayPeeringAttachmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36865,26 +25625,6 @@ export const de_RejectTransitGatewayPeeringAttachmentCommand = async ( return response; }; -/** - * deserializeAws_ec2RejectTransitGatewayPeeringAttachmentCommandError - */ -const de_RejectTransitGatewayPeeringAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RejectTransitGatewayVpcAttachmentCommand */ @@ -36893,7 +25633,7 @@ export const de_RejectTransitGatewayVpcAttachmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RejectTransitGatewayVpcAttachmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36905,26 +25645,6 @@ export const de_RejectTransitGatewayVpcAttachmentCommand = async ( return response; }; -/** - * deserializeAws_ec2RejectTransitGatewayVpcAttachmentCommandError - */ -const de_RejectTransitGatewayVpcAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RejectVpcEndpointConnectionsCommand */ @@ -36933,7 +25653,7 @@ export const de_RejectVpcEndpointConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RejectVpcEndpointConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36945,26 +25665,6 @@ export const de_RejectVpcEndpointConnectionsCommand = async ( return response; }; -/** - * deserializeAws_ec2RejectVpcEndpointConnectionsCommandError - */ -const de_RejectVpcEndpointConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RejectVpcPeeringConnectionCommand */ @@ -36973,7 +25673,7 @@ export const de_RejectVpcPeeringConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RejectVpcPeeringConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -36985,26 +25685,6 @@ export const de_RejectVpcPeeringConnectionCommand = async ( return response; }; -/** - * deserializeAws_ec2RejectVpcPeeringConnectionCommandError - */ -const de_RejectVpcPeeringConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ReleaseAddressCommand */ @@ -37013,7 +25693,7 @@ export const de_ReleaseAddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ReleaseAddressCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ReleaseAddressCommandOutput = { @@ -37022,26 +25702,6 @@ export const de_ReleaseAddressCommand = async ( return response; }; -/** - * deserializeAws_ec2ReleaseAddressCommandError - */ -const de_ReleaseAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ReleaseHostsCommand */ @@ -37050,7 +25710,7 @@ export const de_ReleaseHostsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ReleaseHostsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37062,26 +25722,6 @@ export const de_ReleaseHostsCommand = async ( return response; }; -/** - * deserializeAws_ec2ReleaseHostsCommandError - */ -const de_ReleaseHostsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ReleaseIpamPoolAllocationCommand */ @@ -37090,7 +25730,7 @@ export const de_ReleaseIpamPoolAllocationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ReleaseIpamPoolAllocationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37102,26 +25742,6 @@ export const de_ReleaseIpamPoolAllocationCommand = async ( return response; }; -/** - * deserializeAws_ec2ReleaseIpamPoolAllocationCommandError - */ -const de_ReleaseIpamPoolAllocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ReplaceIamInstanceProfileAssociationCommand */ @@ -37130,7 +25750,7 @@ export const de_ReplaceIamInstanceProfileAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ReplaceIamInstanceProfileAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37142,26 +25762,6 @@ export const de_ReplaceIamInstanceProfileAssociationCommand = async ( return response; }; -/** - * deserializeAws_ec2ReplaceIamInstanceProfileAssociationCommandError - */ -const de_ReplaceIamInstanceProfileAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ReplaceNetworkAclAssociationCommand */ @@ -37170,7 +25770,7 @@ export const de_ReplaceNetworkAclAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ReplaceNetworkAclAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37182,26 +25782,6 @@ export const de_ReplaceNetworkAclAssociationCommand = async ( return response; }; -/** - * deserializeAws_ec2ReplaceNetworkAclAssociationCommandError - */ -const de_ReplaceNetworkAclAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ReplaceNetworkAclEntryCommand */ @@ -37210,7 +25790,7 @@ export const de_ReplaceNetworkAclEntryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ReplaceNetworkAclEntryCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ReplaceNetworkAclEntryCommandOutput = { @@ -37219,26 +25799,6 @@ export const de_ReplaceNetworkAclEntryCommand = async ( return response; }; -/** - * deserializeAws_ec2ReplaceNetworkAclEntryCommandError - */ -const de_ReplaceNetworkAclEntryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ReplaceRouteCommand */ @@ -37247,7 +25807,7 @@ export const de_ReplaceRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ReplaceRouteCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ReplaceRouteCommandOutput = { @@ -37256,26 +25816,6 @@ export const de_ReplaceRouteCommand = async ( return response; }; -/** - * deserializeAws_ec2ReplaceRouteCommandError - */ -const de_ReplaceRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ReplaceRouteTableAssociationCommand */ @@ -37284,7 +25824,7 @@ export const de_ReplaceRouteTableAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ReplaceRouteTableAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37296,26 +25836,6 @@ export const de_ReplaceRouteTableAssociationCommand = async ( return response; }; -/** - * deserializeAws_ec2ReplaceRouteTableAssociationCommandError - */ -const de_ReplaceRouteTableAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ReplaceTransitGatewayRouteCommand */ @@ -37324,7 +25844,7 @@ export const de_ReplaceTransitGatewayRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ReplaceTransitGatewayRouteCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37336,26 +25856,6 @@ export const de_ReplaceTransitGatewayRouteCommand = async ( return response; }; -/** - * deserializeAws_ec2ReplaceTransitGatewayRouteCommandError - */ -const de_ReplaceTransitGatewayRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ReplaceVpnTunnelCommand */ @@ -37364,7 +25864,7 @@ export const de_ReplaceVpnTunnelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ReplaceVpnTunnelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37376,26 +25876,6 @@ export const de_ReplaceVpnTunnelCommand = async ( return response; }; -/** - * deserializeAws_ec2ReplaceVpnTunnelCommandError - */ -const de_ReplaceVpnTunnelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ReportInstanceStatusCommand */ @@ -37404,7 +25884,7 @@ export const de_ReportInstanceStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ReportInstanceStatusCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ReportInstanceStatusCommandOutput = { @@ -37413,26 +25893,6 @@ export const de_ReportInstanceStatusCommand = async ( return response; }; -/** - * deserializeAws_ec2ReportInstanceStatusCommandError - */ -const de_ReportInstanceStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RequestSpotFleetCommand */ @@ -37441,7 +25901,7 @@ export const de_RequestSpotFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RequestSpotFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37453,26 +25913,6 @@ export const de_RequestSpotFleetCommand = async ( return response; }; -/** - * deserializeAws_ec2RequestSpotFleetCommandError - */ -const de_RequestSpotFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RequestSpotInstancesCommand */ @@ -37481,7 +25921,7 @@ export const de_RequestSpotInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RequestSpotInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37493,26 +25933,6 @@ export const de_RequestSpotInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2RequestSpotInstancesCommandError - */ -const de_RequestSpotInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ResetAddressAttributeCommand */ @@ -37521,7 +25941,7 @@ export const de_ResetAddressAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResetAddressAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37533,26 +25953,6 @@ export const de_ResetAddressAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2ResetAddressAttributeCommandError - */ -const de_ResetAddressAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ResetEbsDefaultKmsKeyIdCommand */ @@ -37561,7 +25961,7 @@ export const de_ResetEbsDefaultKmsKeyIdCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResetEbsDefaultKmsKeyIdCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37573,26 +25973,6 @@ export const de_ResetEbsDefaultKmsKeyIdCommand = async ( return response; }; -/** - * deserializeAws_ec2ResetEbsDefaultKmsKeyIdCommandError - */ -const de_ResetEbsDefaultKmsKeyIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ResetFpgaImageAttributeCommand */ @@ -37601,7 +25981,7 @@ export const de_ResetFpgaImageAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResetFpgaImageAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37613,26 +25993,6 @@ export const de_ResetFpgaImageAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2ResetFpgaImageAttributeCommandError - */ -const de_ResetFpgaImageAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ResetImageAttributeCommand */ @@ -37641,7 +26001,7 @@ export const de_ResetImageAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResetImageAttributeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ResetImageAttributeCommandOutput = { @@ -37650,26 +26010,6 @@ export const de_ResetImageAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2ResetImageAttributeCommandError - */ -const de_ResetImageAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ResetInstanceAttributeCommand */ @@ -37678,7 +26018,7 @@ export const de_ResetInstanceAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResetInstanceAttributeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ResetInstanceAttributeCommandOutput = { @@ -37687,26 +26027,6 @@ export const de_ResetInstanceAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2ResetInstanceAttributeCommandError - */ -const de_ResetInstanceAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ResetNetworkInterfaceAttributeCommand */ @@ -37715,7 +26035,7 @@ export const de_ResetNetworkInterfaceAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResetNetworkInterfaceAttributeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ResetNetworkInterfaceAttributeCommandOutput = { @@ -37724,26 +26044,6 @@ export const de_ResetNetworkInterfaceAttributeCommand = async ( return response; }; -/** - * deserializeAws_ec2ResetNetworkInterfaceAttributeCommandError - */ -const de_ResetNetworkInterfaceAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2ResetSnapshotAttributeCommand */ @@ -37752,33 +26052,13 @@ export const de_ResetSnapshotAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResetSnapshotAttributeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: ResetSnapshotAttributeCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_ec2ResetSnapshotAttributeCommandError - */ -const de_ResetSnapshotAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); + const response: ResetSnapshotAttributeCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** @@ -37789,7 +26069,7 @@ export const de_RestoreAddressToClassicCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreAddressToClassicCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37801,26 +26081,6 @@ export const de_RestoreAddressToClassicCommand = async ( return response; }; -/** - * deserializeAws_ec2RestoreAddressToClassicCommandError - */ -const de_RestoreAddressToClassicCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RestoreImageFromRecycleBinCommand */ @@ -37829,7 +26089,7 @@ export const de_RestoreImageFromRecycleBinCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreImageFromRecycleBinCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37841,26 +26101,6 @@ export const de_RestoreImageFromRecycleBinCommand = async ( return response; }; -/** - * deserializeAws_ec2RestoreImageFromRecycleBinCommandError - */ -const de_RestoreImageFromRecycleBinCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RestoreManagedPrefixListVersionCommand */ @@ -37869,7 +26109,7 @@ export const de_RestoreManagedPrefixListVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreManagedPrefixListVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37881,26 +26121,6 @@ export const de_RestoreManagedPrefixListVersionCommand = async ( return response; }; -/** - * deserializeAws_ec2RestoreManagedPrefixListVersionCommandError - */ -const de_RestoreManagedPrefixListVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RestoreSnapshotFromRecycleBinCommand */ @@ -37909,7 +26129,7 @@ export const de_RestoreSnapshotFromRecycleBinCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreSnapshotFromRecycleBinCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37921,26 +26141,6 @@ export const de_RestoreSnapshotFromRecycleBinCommand = async ( return response; }; -/** - * deserializeAws_ec2RestoreSnapshotFromRecycleBinCommandError - */ -const de_RestoreSnapshotFromRecycleBinCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RestoreSnapshotTierCommand */ @@ -37949,7 +26149,7 @@ export const de_RestoreSnapshotTierCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreSnapshotTierCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -37961,26 +26161,6 @@ export const de_RestoreSnapshotTierCommand = async ( return response; }; -/** - * deserializeAws_ec2RestoreSnapshotTierCommandError - */ -const de_RestoreSnapshotTierCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RevokeClientVpnIngressCommand */ @@ -37989,7 +26169,7 @@ export const de_RevokeClientVpnIngressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RevokeClientVpnIngressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38001,26 +26181,6 @@ export const de_RevokeClientVpnIngressCommand = async ( return response; }; -/** - * deserializeAws_ec2RevokeClientVpnIngressCommandError - */ -const de_RevokeClientVpnIngressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RevokeSecurityGroupEgressCommand */ @@ -38029,7 +26189,7 @@ export const de_RevokeSecurityGroupEgressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RevokeSecurityGroupEgressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38041,26 +26201,6 @@ export const de_RevokeSecurityGroupEgressCommand = async ( return response; }; -/** - * deserializeAws_ec2RevokeSecurityGroupEgressCommandError - */ -const de_RevokeSecurityGroupEgressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RevokeSecurityGroupIngressCommand */ @@ -38069,7 +26209,7 @@ export const de_RevokeSecurityGroupIngressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RevokeSecurityGroupIngressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38081,26 +26221,6 @@ export const de_RevokeSecurityGroupIngressCommand = async ( return response; }; -/** - * deserializeAws_ec2RevokeSecurityGroupIngressCommandError - */ -const de_RevokeSecurityGroupIngressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RunInstancesCommand */ @@ -38109,7 +26229,7 @@ export const de_RunInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RunInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38121,26 +26241,6 @@ export const de_RunInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2RunInstancesCommandError - */ -const de_RunInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RunScheduledInstancesCommand */ @@ -38149,7 +26249,7 @@ export const de_RunScheduledInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RunScheduledInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38161,26 +26261,6 @@ export const de_RunScheduledInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2RunScheduledInstancesCommandError - */ -const de_RunScheduledInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2SearchLocalGatewayRoutesCommand */ @@ -38189,7 +26269,7 @@ export const de_SearchLocalGatewayRoutesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchLocalGatewayRoutesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38201,26 +26281,6 @@ export const de_SearchLocalGatewayRoutesCommand = async ( return response; }; -/** - * deserializeAws_ec2SearchLocalGatewayRoutesCommandError - */ -const de_SearchLocalGatewayRoutesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2SearchTransitGatewayMulticastGroupsCommand */ @@ -38229,7 +26289,7 @@ export const de_SearchTransitGatewayMulticastGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchTransitGatewayMulticastGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38241,26 +26301,6 @@ export const de_SearchTransitGatewayMulticastGroupsCommand = async ( return response; }; -/** - * deserializeAws_ec2SearchTransitGatewayMulticastGroupsCommandError - */ -const de_SearchTransitGatewayMulticastGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2SearchTransitGatewayRoutesCommand */ @@ -38269,7 +26309,7 @@ export const de_SearchTransitGatewayRoutesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchTransitGatewayRoutesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38281,26 +26321,6 @@ export const de_SearchTransitGatewayRoutesCommand = async ( return response; }; -/** - * deserializeAws_ec2SearchTransitGatewayRoutesCommandError - */ -const de_SearchTransitGatewayRoutesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2SendDiagnosticInterruptCommand */ @@ -38309,7 +26329,7 @@ export const de_SendDiagnosticInterruptCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendDiagnosticInterruptCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SendDiagnosticInterruptCommandOutput = { @@ -38318,26 +26338,6 @@ export const de_SendDiagnosticInterruptCommand = async ( return response; }; -/** - * deserializeAws_ec2SendDiagnosticInterruptCommandError - */ -const de_SendDiagnosticInterruptCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2StartInstancesCommand */ @@ -38346,7 +26346,7 @@ export const de_StartInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38358,26 +26358,6 @@ export const de_StartInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2StartInstancesCommandError - */ -const de_StartInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2StartNetworkInsightsAccessScopeAnalysisCommand */ @@ -38386,7 +26366,7 @@ export const de_StartNetworkInsightsAccessScopeAnalysisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartNetworkInsightsAccessScopeAnalysisCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38398,26 +26378,6 @@ export const de_StartNetworkInsightsAccessScopeAnalysisCommand = async ( return response; }; -/** - * deserializeAws_ec2StartNetworkInsightsAccessScopeAnalysisCommandError - */ -const de_StartNetworkInsightsAccessScopeAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2StartNetworkInsightsAnalysisCommand */ @@ -38426,7 +26386,7 @@ export const de_StartNetworkInsightsAnalysisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartNetworkInsightsAnalysisCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38438,26 +26398,6 @@ export const de_StartNetworkInsightsAnalysisCommand = async ( return response; }; -/** - * deserializeAws_ec2StartNetworkInsightsAnalysisCommandError - */ -const de_StartNetworkInsightsAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2StartVpcEndpointServicePrivateDnsVerificationCommand */ @@ -38466,7 +26406,7 @@ export const de_StartVpcEndpointServicePrivateDnsVerificationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartVpcEndpointServicePrivateDnsVerificationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38478,26 +26418,6 @@ export const de_StartVpcEndpointServicePrivateDnsVerificationCommand = async ( return response; }; -/** - * deserializeAws_ec2StartVpcEndpointServicePrivateDnsVerificationCommandError - */ -const de_StartVpcEndpointServicePrivateDnsVerificationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2StopInstancesCommand */ @@ -38506,7 +26426,7 @@ export const de_StopInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38518,26 +26438,6 @@ export const de_StopInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2StopInstancesCommandError - */ -const de_StopInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2TerminateClientVpnConnectionsCommand */ @@ -38546,7 +26446,7 @@ export const de_TerminateClientVpnConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TerminateClientVpnConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38558,26 +26458,6 @@ export const de_TerminateClientVpnConnectionsCommand = async ( return response; }; -/** - * deserializeAws_ec2TerminateClientVpnConnectionsCommandError - */ -const de_TerminateClientVpnConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2TerminateInstancesCommand */ @@ -38586,7 +26466,7 @@ export const de_TerminateInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TerminateInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38598,26 +26478,6 @@ export const de_TerminateInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2TerminateInstancesCommandError - */ -const de_TerminateInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2UnassignIpv6AddressesCommand */ @@ -38626,7 +26486,7 @@ export const de_UnassignIpv6AddressesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UnassignIpv6AddressesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38638,26 +26498,6 @@ export const de_UnassignIpv6AddressesCommand = async ( return response; }; -/** - * deserializeAws_ec2UnassignIpv6AddressesCommandError - */ -const de_UnassignIpv6AddressesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2UnassignPrivateIpAddressesCommand */ @@ -38666,7 +26506,7 @@ export const de_UnassignPrivateIpAddressesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UnassignPrivateIpAddressesCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UnassignPrivateIpAddressesCommandOutput = { @@ -38675,26 +26515,6 @@ export const de_UnassignPrivateIpAddressesCommand = async ( return response; }; -/** - * deserializeAws_ec2UnassignPrivateIpAddressesCommandError - */ -const de_UnassignPrivateIpAddressesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2UnassignPrivateNatGatewayAddressCommand */ @@ -38703,7 +26523,7 @@ export const de_UnassignPrivateNatGatewayAddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UnassignPrivateNatGatewayAddressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38715,26 +26535,6 @@ export const de_UnassignPrivateNatGatewayAddressCommand = async ( return response; }; -/** - * deserializeAws_ec2UnassignPrivateNatGatewayAddressCommandError - */ -const de_UnassignPrivateNatGatewayAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2UnlockSnapshotCommand */ @@ -38743,7 +26543,7 @@ export const de_UnlockSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UnlockSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38755,26 +26555,6 @@ export const de_UnlockSnapshotCommand = async ( return response; }; -/** - * deserializeAws_ec2UnlockSnapshotCommandError - */ -const de_UnlockSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2UnmonitorInstancesCommand */ @@ -38783,7 +26563,7 @@ export const de_UnmonitorInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UnmonitorInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38795,26 +26575,6 @@ export const de_UnmonitorInstancesCommand = async ( return response; }; -/** - * deserializeAws_ec2UnmonitorInstancesCommandError - */ -const de_UnmonitorInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2UpdateSecurityGroupRuleDescriptionsEgressCommand */ @@ -38823,7 +26583,7 @@ export const de_UpdateSecurityGroupRuleDescriptionsEgressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSecurityGroupRuleDescriptionsEgressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38835,26 +26595,6 @@ export const de_UpdateSecurityGroupRuleDescriptionsEgressCommand = async ( return response; }; -/** - * deserializeAws_ec2UpdateSecurityGroupRuleDescriptionsEgressCommandError - */ -const de_UpdateSecurityGroupRuleDescriptionsEgressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2UpdateSecurityGroupRuleDescriptionsIngressCommand */ @@ -38863,7 +26603,7 @@ export const de_UpdateSecurityGroupRuleDescriptionsIngressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSecurityGroupRuleDescriptionsIngressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38875,26 +26615,6 @@ export const de_UpdateSecurityGroupRuleDescriptionsIngressCommand = async ( return response; }; -/** - * deserializeAws_ec2UpdateSecurityGroupRuleDescriptionsIngressCommandError - */ -const de_UpdateSecurityGroupRuleDescriptionsIngressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2WithdrawByoipCidrCommand */ @@ -38903,7 +26623,7 @@ export const de_WithdrawByoipCidrCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_WithdrawByoipCidrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -38916,12 +26636,9 @@ export const de_WithdrawByoipCidrCommand = async ( }; /** - * deserializeAws_ec2WithdrawByoipCidrCommandError + * deserialize_Aws_ec2CommandError */ -const de_WithdrawByoipCidrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -38932,7 +26649,7 @@ const de_WithdrawByoipCidrCommandError = async ( output, parsedBody: parsedBody.Errors.Error, errorCode, - }); + }) as never; }; /** diff --git a/clients/client-ecr-public/src/protocols/Aws_json1_1.ts b/clients/client-ecr-public/src/protocols/Aws_json1_1.ts index 258b4a1bc6b2..85cc1d050a8b 100644 --- a/clients/client-ecr-public/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecr-public/src/protocols/Aws_json1_1.ts @@ -453,7 +453,7 @@ export const de_BatchCheckLayerAvailabilityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchCheckLayerAvailabilityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -465,44 +465,6 @@ export const de_BatchCheckLayerAvailabilityCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchCheckLayerAvailabilityCommandError - */ -const de_BatchCheckLayerAvailabilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RegistryNotFoundException": - case "com.amazonaws.ecrpublic#RegistryNotFoundException": - throw await de_RegistryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDeleteImageCommand */ @@ -511,7 +473,7 @@ export const de_BatchDeleteImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDeleteImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -523,41 +485,6 @@ export const de_BatchDeleteImageCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDeleteImageCommandError - */ -const de_BatchDeleteImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CompleteLayerUploadCommand */ @@ -566,7 +493,7 @@ export const de_CompleteLayerUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CompleteLayerUploadCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -578,59 +505,6 @@ export const de_CompleteLayerUploadCommand = async ( return response; }; -/** - * deserializeAws_json1_1CompleteLayerUploadCommandError - */ -const de_CompleteLayerUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EmptyUploadException": - case "com.amazonaws.ecrpublic#EmptyUploadException": - throw await de_EmptyUploadExceptionRes(parsedOutput, context); - case "InvalidLayerException": - case "com.amazonaws.ecrpublic#InvalidLayerException": - throw await de_InvalidLayerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LayerAlreadyExistsException": - case "com.amazonaws.ecrpublic#LayerAlreadyExistsException": - throw await de_LayerAlreadyExistsExceptionRes(parsedOutput, context); - case "LayerPartTooSmallException": - case "com.amazonaws.ecrpublic#LayerPartTooSmallException": - throw await de_LayerPartTooSmallExceptionRes(parsedOutput, context); - case "RegistryNotFoundException": - case "com.amazonaws.ecrpublic#RegistryNotFoundException": - throw await de_RegistryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - case "UploadNotFoundException": - case "com.amazonaws.ecrpublic#UploadNotFoundException": - throw await de_UploadNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateRepositoryCommand */ @@ -639,7 +513,7 @@ export const de_CreateRepositoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRepositoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -651,50 +525,6 @@ export const de_CreateRepositoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateRepositoryCommandError - */ -const de_CreateRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.ecrpublic#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecrpublic#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RepositoryAlreadyExistsException": - case "com.amazonaws.ecrpublic#RepositoryAlreadyExistsException": - throw await de_RepositoryAlreadyExistsExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.ecrpublic#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteRepositoryCommand */ @@ -703,7 +533,7 @@ export const de_DeleteRepositoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRepositoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -715,44 +545,6 @@ export const de_DeleteRepositoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteRepositoryCommandError - */ -const de_DeleteRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotEmptyException": - case "com.amazonaws.ecrpublic#RepositoryNotEmptyException": - throw await de_RepositoryNotEmptyExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteRepositoryPolicyCommand */ @@ -761,7 +553,7 @@ export const de_DeleteRepositoryPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRepositoryPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -774,57 +566,39 @@ export const de_DeleteRepositoryPolicyCommand = async ( }; /** - * deserializeAws_json1_1DeleteRepositoryPolicyCommandError + * deserializeAws_json1_1DescribeImagesCommand */ -const de_DeleteRepositoryPolicyCommandError = async ( +export const de_DescribeImagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryPolicyNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryPolicyNotFoundException": - throw await de_RepositoryPolicyNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeImagesResponse(data, context); + const response: DescribeImagesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeImagesCommand + * deserializeAws_json1_1DescribeImageTagsCommand */ -export const de_DescribeImagesCommand = async ( +export const de_DescribeImageTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeImagesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeImagesResponse(data, context); - const response: DescribeImagesCommandOutput = { + contents = de_DescribeImageTagsResponse(data, context); + const response: DescribeImageTagsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -832,107 +606,14 @@ export const de_DescribeImagesCommand = async ( }; /** - * deserializeAws_json1_1DescribeImagesCommandError + * deserializeAws_json1_1DescribeRegistriesCommand */ -const de_DescribeImagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImageNotFoundException": - case "com.amazonaws.ecrpublic#ImageNotFoundException": - throw await de_ImageNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeImageTagsCommand - */ -export const de_DescribeImageTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeImageTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeImageTagsResponse(data, context); - const response: DescribeImageTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeImageTagsCommandError - */ -const de_DescribeImageTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeRegistriesCommand - */ -export const de_DescribeRegistriesCommand = async ( +export const de_DescribeRegistriesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRegistriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -944,38 +625,6 @@ export const de_DescribeRegistriesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeRegistriesCommandError - */ -const de_DescribeRegistriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeRepositoriesCommand */ @@ -984,7 +633,7 @@ export const de_DescribeRepositoriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRepositoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -996,41 +645,6 @@ export const de_DescribeRepositoriesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeRepositoriesCommandError - */ -const de_DescribeRepositoriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAuthorizationTokenCommand */ @@ -1039,7 +653,7 @@ export const de_GetAuthorizationTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAuthorizationTokenCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1051,38 +665,6 @@ export const de_GetAuthorizationTokenCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAuthorizationTokenCommandError - */ -const de_GetAuthorizationTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetRegistryCatalogDataCommand */ @@ -1091,7 +673,7 @@ export const de_GetRegistryCatalogDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRegistryCatalogDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1103,35 +685,6 @@ export const de_GetRegistryCatalogDataCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetRegistryCatalogDataCommandError - */ -const de_GetRegistryCatalogDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetRepositoryCatalogDataCommand */ @@ -1140,7 +693,7 @@ export const de_GetRepositoryCatalogDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRepositoryCatalogDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1152,44 +705,6 @@ export const de_GetRepositoryCatalogDataCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetRepositoryCatalogDataCommandError - */ -const de_GetRepositoryCatalogDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryCatalogDataNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryCatalogDataNotFoundException": - throw await de_RepositoryCatalogDataNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetRepositoryPolicyCommand */ @@ -1198,7 +713,7 @@ export const de_GetRepositoryPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRepositoryPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1210,44 +725,6 @@ export const de_GetRepositoryPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetRepositoryPolicyCommandError - */ -const de_GetRepositoryPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryPolicyNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryPolicyNotFoundException": - throw await de_RepositoryPolicyNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1InitiateLayerUploadCommand */ @@ -1256,7 +733,7 @@ export const de_InitiateLayerUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_InitiateLayerUploadCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1269,188 +746,19 @@ export const de_InitiateLayerUploadCommand = async ( }; /** - * deserializeAws_json1_1InitiateLayerUploadCommandError - */ -const de_InitiateLayerUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RegistryNotFoundException": - case "com.amazonaws.ecrpublic#RegistryNotFoundException": - throw await de_RegistryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutImageCommand - */ -export const de_PutImageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutImageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutImageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutImageCommandError - */ -const de_PutImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImageAlreadyExistsException": - case "com.amazonaws.ecrpublic#ImageAlreadyExistsException": - throw await de_ImageAlreadyExistsExceptionRes(parsedOutput, context); - case "ImageDigestDoesNotMatchException": - case "com.amazonaws.ecrpublic#ImageDigestDoesNotMatchException": - throw await de_ImageDigestDoesNotMatchExceptionRes(parsedOutput, context); - case "ImageTagAlreadyExistsException": - case "com.amazonaws.ecrpublic#ImageTagAlreadyExistsException": - throw await de_ImageTagAlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LayersNotFoundException": - case "com.amazonaws.ecrpublic#LayersNotFoundException": - throw await de_LayersNotFoundExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecrpublic#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ReferencedImagesNotFoundException": - case "com.amazonaws.ecrpublic#ReferencedImagesNotFoundException": - throw await de_ReferencedImagesNotFoundExceptionRes(parsedOutput, context); - case "RegistryNotFoundException": - case "com.amazonaws.ecrpublic#RegistryNotFoundException": - throw await de_RegistryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutRegistryCatalogDataCommand + * deserializeAws_json1_1ListTagsForResourceCommand */ -export const de_PutRegistryCatalogDataCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutRegistryCatalogDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutRegistryCatalogDataCommandOutput = { + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1458,51 +766,39 @@ export const de_PutRegistryCatalogDataCommand = async ( }; /** - * deserializeAws_json1_1PutRegistryCatalogDataCommandError + * deserializeAws_json1_1PutImageCommand */ -const de_PutRegistryCatalogDataCommandError = async ( +export const de_PutImageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutImageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutRepositoryCatalogDataCommand + * deserializeAws_json1_1PutRegistryCatalogDataCommand */ -export const de_PutRepositoryCatalogDataCommand = async ( +export const de_PutRegistryCatalogDataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutRepositoryCatalogDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutRepositoryCatalogDataCommandOutput = { + const response: PutRegistryCatalogDataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1510,38 +806,23 @@ export const de_PutRepositoryCatalogDataCommand = async ( }; /** - * deserializeAws_json1_1PutRepositoryCatalogDataCommandError + * deserializeAws_json1_1PutRepositoryCatalogDataCommand */ -const de_PutRepositoryCatalogDataCommandError = async ( +export const de_PutRepositoryCatalogDataCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutRepositoryCatalogDataCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1552,7 +833,7 @@ export const de_SetRepositoryPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetRepositoryPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1564,41 +845,6 @@ export const de_SetRepositoryPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1SetRepositoryPolicyCommandError - */ -const de_SetRepositoryPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -1607,7 +853,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1619,47 +865,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.ecrpublic#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.ecrpublic#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -1668,7 +873,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1680,47 +885,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecrpublic#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.ecrpublic#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecrpublic#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecrpublic#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.ecrpublic#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "UnsupportedCommandException": - case "com.amazonaws.ecrpublic#UnsupportedCommandException": - throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UploadLayerPartCommand */ @@ -1729,7 +893,7 @@ export const de_UploadLayerPartCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UploadLayerPartCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1742,27 +906,18 @@ export const de_UploadLayerPartCommand = async ( }; /** - * deserializeAws_json1_1UploadLayerPartCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UploadLayerPartCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "InvalidLayerPartException": - case "com.amazonaws.ecrpublic#InvalidLayerPartException": - throw await de_InvalidLayerPartExceptionRes(parsedOutput, context); case "InvalidParameterException": case "com.amazonaws.ecrpublic#InvalidParameterException": throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecrpublic#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); case "RegistryNotFoundException": case "com.amazonaws.ecrpublic#RegistryNotFoundException": throw await de_RegistryNotFoundExceptionRes(parsedOutput, context); @@ -1775,16 +930,70 @@ const de_UploadLayerPartCommandError = async ( case "UnsupportedCommandException": case "com.amazonaws.ecrpublic#UnsupportedCommandException": throw await de_UnsupportedCommandExceptionRes(parsedOutput, context); + case "EmptyUploadException": + case "com.amazonaws.ecrpublic#EmptyUploadException": + throw await de_EmptyUploadExceptionRes(parsedOutput, context); + case "InvalidLayerException": + case "com.amazonaws.ecrpublic#InvalidLayerException": + throw await de_InvalidLayerExceptionRes(parsedOutput, context); + case "LayerAlreadyExistsException": + case "com.amazonaws.ecrpublic#LayerAlreadyExistsException": + throw await de_LayerAlreadyExistsExceptionRes(parsedOutput, context); + case "LayerPartTooSmallException": + case "com.amazonaws.ecrpublic#LayerPartTooSmallException": + throw await de_LayerPartTooSmallExceptionRes(parsedOutput, context); case "UploadNotFoundException": case "com.amazonaws.ecrpublic#UploadNotFoundException": throw await de_UploadNotFoundExceptionRes(parsedOutput, context); + case "InvalidTagParameterException": + case "com.amazonaws.ecrpublic#InvalidTagParameterException": + throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.ecrpublic#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "RepositoryAlreadyExistsException": + case "com.amazonaws.ecrpublic#RepositoryAlreadyExistsException": + throw await de_RepositoryAlreadyExistsExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.ecrpublic#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "RepositoryNotEmptyException": + case "com.amazonaws.ecrpublic#RepositoryNotEmptyException": + throw await de_RepositoryNotEmptyExceptionRes(parsedOutput, context); + case "RepositoryPolicyNotFoundException": + case "com.amazonaws.ecrpublic#RepositoryPolicyNotFoundException": + throw await de_RepositoryPolicyNotFoundExceptionRes(parsedOutput, context); + case "ImageNotFoundException": + case "com.amazonaws.ecrpublic#ImageNotFoundException": + throw await de_ImageNotFoundExceptionRes(parsedOutput, context); + case "RepositoryCatalogDataNotFoundException": + case "com.amazonaws.ecrpublic#RepositoryCatalogDataNotFoundException": + throw await de_RepositoryCatalogDataNotFoundExceptionRes(parsedOutput, context); + case "ImageAlreadyExistsException": + case "com.amazonaws.ecrpublic#ImageAlreadyExistsException": + throw await de_ImageAlreadyExistsExceptionRes(parsedOutput, context); + case "ImageDigestDoesNotMatchException": + case "com.amazonaws.ecrpublic#ImageDigestDoesNotMatchException": + throw await de_ImageDigestDoesNotMatchExceptionRes(parsedOutput, context); + case "ImageTagAlreadyExistsException": + case "com.amazonaws.ecrpublic#ImageTagAlreadyExistsException": + throw await de_ImageTagAlreadyExistsExceptionRes(parsedOutput, context); + case "LayersNotFoundException": + case "com.amazonaws.ecrpublic#LayersNotFoundException": + throw await de_LayersNotFoundExceptionRes(parsedOutput, context); + case "ReferencedImagesNotFoundException": + case "com.amazonaws.ecrpublic#ReferencedImagesNotFoundException": + throw await de_ReferencedImagesNotFoundExceptionRes(parsedOutput, context); + case "InvalidLayerPartException": + case "com.amazonaws.ecrpublic#InvalidLayerPartException": + throw await de_InvalidLayerPartExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-ecr/src/protocols/Aws_json1_1.ts b/clients/client-ecr/src/protocols/Aws_json1_1.ts index 5e2ea5520e0d..6369422944b8 100644 --- a/clients/client-ecr/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecr/src/protocols/Aws_json1_1.ts @@ -838,7 +838,7 @@ export const de_BatchCheckLayerAvailabilityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchCheckLayerAvailabilityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -850,38 +850,6 @@ export const de_BatchCheckLayerAvailabilityCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchCheckLayerAvailabilityCommandError - */ -const de_BatchCheckLayerAvailabilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDeleteImageCommand */ @@ -890,7 +858,7 @@ export const de_BatchDeleteImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDeleteImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -902,38 +870,6 @@ export const de_BatchDeleteImageCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDeleteImageCommandError - */ -const de_BatchDeleteImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetImageCommand */ @@ -942,7 +878,7 @@ export const de_BatchGetImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -954,44 +890,6 @@ export const de_BatchGetImageCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetImageCommandError - */ -const de_BatchGetImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecr#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnableToGetUpstreamImageException": - case "com.amazonaws.ecr#UnableToGetUpstreamImageException": - throw await de_UnableToGetUpstreamImageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetRepositoryScanningConfigurationCommand */ @@ -1000,7 +898,7 @@ export const de_BatchGetRepositoryScanningConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetRepositoryScanningConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1012,41 +910,6 @@ export const de_BatchGetRepositoryScanningConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetRepositoryScanningConfigurationCommandError - */ -const de_BatchGetRepositoryScanningConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CompleteLayerUploadCommand */ @@ -1055,7 +918,7 @@ export const de_CompleteLayerUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CompleteLayerUploadCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1068,69 +931,39 @@ export const de_CompleteLayerUploadCommand = async ( }; /** - * deserializeAws_json1_1CompleteLayerUploadCommandError + * deserializeAws_json1_1CreatePullThroughCacheRuleCommand */ -const de_CompleteLayerUploadCommandError = async ( +export const de_CreatePullThroughCacheRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EmptyUploadException": - case "com.amazonaws.ecr#EmptyUploadException": - throw await de_EmptyUploadExceptionRes(parsedOutput, context); - case "InvalidLayerException": - case "com.amazonaws.ecr#InvalidLayerException": - throw await de_InvalidLayerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.ecr#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "LayerAlreadyExistsException": - case "com.amazonaws.ecr#LayerAlreadyExistsException": - throw await de_LayerAlreadyExistsExceptionRes(parsedOutput, context); - case "LayerPartTooSmallException": - case "com.amazonaws.ecr#LayerPartTooSmallException": - throw await de_LayerPartTooSmallExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UploadNotFoundException": - case "com.amazonaws.ecr#UploadNotFoundException": - throw await de_UploadNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreatePullThroughCacheRuleResponse(data, context); + const response: CreatePullThroughCacheRuleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreatePullThroughCacheRuleCommand + * deserializeAws_json1_1CreateRepositoryCommand */ -export const de_CreatePullThroughCacheRuleCommand = async ( +export const de_CreateRepositoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreatePullThroughCacheRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreatePullThroughCacheRuleResponse(data, context); - const response: CreatePullThroughCacheRuleCommandOutput = { + contents = de_CreateRepositoryResponse(data, context); + const response: CreateRepositoryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1138,69 +971,39 @@ export const de_CreatePullThroughCacheRuleCommand = async ( }; /** - * deserializeAws_json1_1CreatePullThroughCacheRuleCommandError + * deserializeAws_json1_1DeleteLifecyclePolicyCommand */ -const de_CreatePullThroughCacheRuleCommandError = async ( +export const de_DeleteLifecyclePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecr#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PullThroughCacheRuleAlreadyExistsException": - case "com.amazonaws.ecr#PullThroughCacheRuleAlreadyExistsException": - throw await de_PullThroughCacheRuleAlreadyExistsExceptionRes(parsedOutput, context); - case "SecretNotFoundException": - case "com.amazonaws.ecr#SecretNotFoundException": - throw await de_SecretNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnableToAccessSecretException": - case "com.amazonaws.ecr#UnableToAccessSecretException": - throw await de_UnableToAccessSecretExceptionRes(parsedOutput, context); - case "UnableToDecryptSecretValueException": - case "com.amazonaws.ecr#UnableToDecryptSecretValueException": - throw await de_UnableToDecryptSecretValueExceptionRes(parsedOutput, context); - case "UnsupportedUpstreamRegistryException": - case "com.amazonaws.ecr#UnsupportedUpstreamRegistryException": - throw await de_UnsupportedUpstreamRegistryExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteLifecyclePolicyResponse(data, context); + const response: DeleteLifecyclePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateRepositoryCommand + * deserializeAws_json1_1DeletePullThroughCacheRuleCommand */ -export const de_CreateRepositoryCommand = async ( +export const de_DeletePullThroughCacheRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateRepositoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateRepositoryResponse(data, context); - const response: CreateRepositoryCommandOutput = { + contents = de_DeletePullThroughCacheRuleResponse(data, context); + const response: DeletePullThroughCacheRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1208,63 +1011,39 @@ export const de_CreateRepositoryCommand = async ( }; /** - * deserializeAws_json1_1CreateRepositoryCommandError + * deserializeAws_json1_1DeleteRegistryPolicyCommand */ -const de_CreateRepositoryCommandError = async ( +export const de_DeleteRegistryPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.ecr#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.ecr#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecr#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RepositoryAlreadyExistsException": - case "com.amazonaws.ecr#RepositoryAlreadyExistsException": - throw await de_RepositoryAlreadyExistsExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.ecr#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteRegistryPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteLifecyclePolicyCommand + * deserializeAws_json1_1DeleteRepositoryCommand */ -export const de_DeleteLifecyclePolicyCommand = async ( +export const de_DeleteRepositoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteLifecyclePolicyResponse(data, context); - const response: DeleteLifecyclePolicyCommandOutput = { + contents = de_DeleteRepositoryResponse(data, context); + const response: DeleteRepositoryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1272,57 +1051,39 @@ export const de_DeleteLifecyclePolicyCommand = async ( }; /** - * deserializeAws_json1_1DeleteLifecyclePolicyCommandError + * deserializeAws_json1_1DeleteRepositoryPolicyCommand */ -const de_DeleteLifecyclePolicyCommandError = async ( +export const de_DeleteRepositoryPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LifecyclePolicyNotFoundException": - case "com.amazonaws.ecr#LifecyclePolicyNotFoundException": - throw await de_LifecyclePolicyNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteRepositoryPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeletePullThroughCacheRuleCommand + * deserializeAws_json1_1DescribeImageReplicationStatusCommand */ -export const de_DeletePullThroughCacheRuleCommand = async ( +export const de_DescribeImageReplicationStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeletePullThroughCacheRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeletePullThroughCacheRuleResponse(data, context); - const response: DeletePullThroughCacheRuleCommandOutput = { + contents = _json(data); + const response: DescribeImageReplicationStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1330,54 +1091,39 @@ export const de_DeletePullThroughCacheRuleCommand = async ( }; /** - * deserializeAws_json1_1DeletePullThroughCacheRuleCommandError + * deserializeAws_json1_1DescribeImagesCommand */ -const de_DeletePullThroughCacheRuleCommandError = async ( +export const de_DescribeImagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "PullThroughCacheRuleNotFoundException": - case "com.amazonaws.ecr#PullThroughCacheRuleNotFoundException": - throw await de_PullThroughCacheRuleNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeImagesResponse(data, context); + const response: DescribeImagesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRegistryPolicyCommand + * deserializeAws_json1_1DescribeImageScanFindingsCommand */ -export const de_DeleteRegistryPolicyCommand = async ( +export const de_DescribeImageScanFindingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRegistryPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteRegistryPolicyCommandOutput = { + contents = de_DescribeImageScanFindingsResponse(data, context); + const response: DescribeImageScanFindingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1385,54 +1131,39 @@ export const de_DeleteRegistryPolicyCommand = async ( }; /** - * deserializeAws_json1_1DeleteRegistryPolicyCommandError + * deserializeAws_json1_1DescribePullThroughCacheRulesCommand */ -const de_DeleteRegistryPolicyCommandError = async ( +export const de_DescribePullThroughCacheRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RegistryPolicyNotFoundException": - case "com.amazonaws.ecr#RegistryPolicyNotFoundException": - throw await de_RegistryPolicyNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribePullThroughCacheRulesResponse(data, context); + const response: DescribePullThroughCacheRulesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRepositoryCommand + * deserializeAws_json1_1DescribeRegistryCommand */ -export const de_DeleteRepositoryCommand = async ( +export const de_DescribeRegistryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRepositoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteRepositoryResponse(data, context); - const response: DeleteRepositoryCommandOutput = { + contents = _json(data); + const response: DescribeRegistryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1440,57 +1171,39 @@ export const de_DeleteRepositoryCommand = async ( }; /** - * deserializeAws_json1_1DeleteRepositoryCommandError + * deserializeAws_json1_1DescribeRepositoriesCommand */ -const de_DeleteRepositoryCommandError = async ( +export const de_DescribeRepositoriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.ecr#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "RepositoryNotEmptyException": - case "com.amazonaws.ecr#RepositoryNotEmptyException": - throw await de_RepositoryNotEmptyExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeRepositoriesResponse(data, context); + const response: DescribeRepositoriesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRepositoryPolicyCommand + * deserializeAws_json1_1GetAuthorizationTokenCommand */ -export const de_DeleteRepositoryPolicyCommand = async ( +export const de_GetAuthorizationTokenCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRepositoryPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteRepositoryPolicyCommandOutput = { + contents = de_GetAuthorizationTokenResponse(data, context); + const response: GetAuthorizationTokenCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1498,54 +1211,39 @@ export const de_DeleteRepositoryPolicyCommand = async ( }; /** - * deserializeAws_json1_1DeleteRepositoryPolicyCommandError + * deserializeAws_json1_1GetDownloadUrlForLayerCommand */ -const de_DeleteRepositoryPolicyCommandError = async ( +export const de_GetDownloadUrlForLayerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryPolicyNotFoundException": - case "com.amazonaws.ecr#RepositoryPolicyNotFoundException": - throw await de_RepositoryPolicyNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetDownloadUrlForLayerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeImageReplicationStatusCommand + * deserializeAws_json1_1GetLifecyclePolicyCommand */ -export const de_DescribeImageReplicationStatusCommand = async ( +export const de_GetLifecyclePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeImageReplicationStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeImageReplicationStatusCommandOutput = { + contents = de_GetLifecyclePolicyResponse(data, context); + const response: GetLifecyclePolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1553,57 +1251,39 @@ export const de_DescribeImageReplicationStatusCommand = async ( }; /** - * deserializeAws_json1_1DescribeImageReplicationStatusCommandError + * deserializeAws_json1_1GetLifecyclePolicyPreviewCommand */ -const de_DescribeImageReplicationStatusCommandError = async ( +export const de_GetLifecyclePolicyPreviewCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImageNotFoundException": - case "com.amazonaws.ecr#ImageNotFoundException": - throw await de_ImageNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetLifecyclePolicyPreviewResponse(data, context); + const response: GetLifecyclePolicyPreviewCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeImagesCommand + * deserializeAws_json1_1GetRegistryPolicyCommand */ -export const de_DescribeImagesCommand = async ( +export const de_GetRegistryPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeImagesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeImagesResponse(data, context); - const response: DescribeImagesCommandOutput = { + contents = _json(data); + const response: GetRegistryPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1611,54 +1291,39 @@ export const de_DescribeImagesCommand = async ( }; /** - * deserializeAws_json1_1DescribeImagesCommandError + * deserializeAws_json1_1GetRegistryScanningConfigurationCommand */ -const de_DescribeImagesCommandError = async ( +export const de_GetRegistryScanningConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImageNotFoundException": - case "com.amazonaws.ecr#ImageNotFoundException": - throw await de_ImageNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetRegistryScanningConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeImageScanFindingsCommand + * deserializeAws_json1_1GetRepositoryPolicyCommand */ -export const de_DescribeImageScanFindingsCommand = async ( +export const de_GetRepositoryPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeImageScanFindingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeImageScanFindingsResponse(data, context); - const response: DescribeImageScanFindingsCommandOutput = { + contents = _json(data); + const response: GetRepositoryPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1666,60 +1331,39 @@ export const de_DescribeImageScanFindingsCommand = async ( }; /** - * deserializeAws_json1_1DescribeImageScanFindingsCommandError + * deserializeAws_json1_1InitiateLayerUploadCommand */ -const de_DescribeImageScanFindingsCommandError = async ( +export const de_InitiateLayerUploadCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImageNotFoundException": - case "com.amazonaws.ecr#ImageNotFoundException": - throw await de_ImageNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ScanNotFoundException": - case "com.amazonaws.ecr#ScanNotFoundException": - throw await de_ScanNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: InitiateLayerUploadCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribePullThroughCacheRulesCommand + * deserializeAws_json1_1ListImagesCommand */ -export const de_DescribePullThroughCacheRulesCommand = async ( +export const de_ListImagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribePullThroughCacheRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribePullThroughCacheRulesResponse(data, context); - const response: DescribePullThroughCacheRulesCommandOutput = { + contents = _json(data); + const response: ListImagesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1727,54 +1371,39 @@ export const de_DescribePullThroughCacheRulesCommand = async ( }; /** - * deserializeAws_json1_1DescribePullThroughCacheRulesCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_DescribePullThroughCacheRulesCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "PullThroughCacheRuleNotFoundException": - case "com.amazonaws.ecr#PullThroughCacheRuleNotFoundException": - throw await de_PullThroughCacheRuleNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeRegistryCommand + * deserializeAws_json1_1PutImageCommand */ -export const de_DescribeRegistryCommand = async ( +export const de_PutImageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeRegistryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeRegistryCommandOutput = { + const response: PutImageCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1782,51 +1411,39 @@ export const de_DescribeRegistryCommand = async ( }; /** - * deserializeAws_json1_1DescribeRegistryCommandError + * deserializeAws_json1_1PutImageScanningConfigurationCommand */ -const de_DescribeRegistryCommandError = async ( +export const de_PutImageScanningConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } -}; + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutImageScanningConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; /** - * deserializeAws_json1_1DescribeRepositoriesCommand + * deserializeAws_json1_1PutImageTagMutabilityCommand */ -export const de_DescribeRepositoriesCommand = async ( +export const de_PutImageTagMutabilityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeRepositoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeRepositoriesResponse(data, context); - const response: DescribeRepositoriesCommandOutput = { + contents = _json(data); + const response: PutImageTagMutabilityCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1834,51 +1451,39 @@ export const de_DescribeRepositoriesCommand = async ( }; /** - * deserializeAws_json1_1DescribeRepositoriesCommandError + * deserializeAws_json1_1PutLifecyclePolicyCommand */ -const de_DescribeRepositoriesCommandError = async ( +export const de_PutLifecyclePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutLifecyclePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetAuthorizationTokenCommand + * deserializeAws_json1_1PutRegistryPolicyCommand */ -export const de_GetAuthorizationTokenCommand = async ( +export const de_PutRegistryPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetAuthorizationTokenCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetAuthorizationTokenResponse(data, context); - const response: GetAuthorizationTokenCommandOutput = { + contents = _json(data); + const response: PutRegistryPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1886,48 +1491,39 @@ export const de_GetAuthorizationTokenCommand = async ( }; /** - * deserializeAws_json1_1GetAuthorizationTokenCommandError + * deserializeAws_json1_1PutRegistryScanningConfigurationCommand */ -const de_GetAuthorizationTokenCommandError = async ( +export const de_PutRegistryScanningConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutRegistryScanningConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetDownloadUrlForLayerCommand + * deserializeAws_json1_1PutReplicationConfigurationCommand */ -export const de_GetDownloadUrlForLayerCommand = async ( +export const de_PutReplicationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetDownloadUrlForLayerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetDownloadUrlForLayerCommandOutput = { + const response: PutReplicationConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1935,60 +1531,39 @@ export const de_GetDownloadUrlForLayerCommand = async ( }; /** - * deserializeAws_json1_1GetDownloadUrlForLayerCommandError + * deserializeAws_json1_1SetRepositoryPolicyCommand */ -const de_GetDownloadUrlForLayerCommandError = async ( +export const de_SetRepositoryPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LayerInaccessibleException": - case "com.amazonaws.ecr#LayerInaccessibleException": - throw await de_LayerInaccessibleExceptionRes(parsedOutput, context); - case "LayersNotFoundException": - case "com.amazonaws.ecr#LayersNotFoundException": - throw await de_LayersNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnableToGetUpstreamLayerException": - case "com.amazonaws.ecr#UnableToGetUpstreamLayerException": - throw await de_UnableToGetUpstreamLayerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: SetRepositoryPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetLifecyclePolicyCommand + * deserializeAws_json1_1StartImageScanCommand */ -export const de_GetLifecyclePolicyCommand = async ( +export const de_StartImageScanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetLifecyclePolicyResponse(data, context); - const response: GetLifecyclePolicyCommandOutput = { + contents = _json(data); + const response: StartImageScanCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1996,57 +1571,39 @@ export const de_GetLifecyclePolicyCommand = async ( }; /** - * deserializeAws_json1_1GetLifecyclePolicyCommandError + * deserializeAws_json1_1StartLifecyclePolicyPreviewCommand */ -const de_GetLifecyclePolicyCommandError = async ( +export const de_StartLifecyclePolicyPreviewCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LifecyclePolicyNotFoundException": - case "com.amazonaws.ecr#LifecyclePolicyNotFoundException": - throw await de_LifecyclePolicyNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartLifecyclePolicyPreviewCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetLifecyclePolicyPreviewCommand + * deserializeAws_json1_1TagResourceCommand */ -export const de_GetLifecyclePolicyPreviewCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetLifecyclePolicyPreviewCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetLifecyclePolicyPreviewResponse(data, context); - const response: GetLifecyclePolicyPreviewCommandOutput = { + contents = _json(data); + const response: TagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2054,57 +1611,39 @@ export const de_GetLifecyclePolicyPreviewCommand = async ( }; /** - * deserializeAws_json1_1GetLifecyclePolicyPreviewCommandError + * deserializeAws_json1_1UntagResourceCommand */ -const de_GetLifecyclePolicyPreviewCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LifecyclePolicyPreviewNotFoundException": - case "com.amazonaws.ecr#LifecyclePolicyPreviewNotFoundException": - throw await de_LifecyclePolicyPreviewNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetRegistryPolicyCommand + * deserializeAws_json1_1UpdatePullThroughCacheRuleCommand */ -export const de_GetRegistryPolicyCommand = async ( +export const de_UpdatePullThroughCacheRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRegistryPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetRegistryPolicyCommandOutput = { + contents = de_UpdatePullThroughCacheRuleResponse(data, context); + const response: UpdatePullThroughCacheRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2112,1063 +1651,14 @@ export const de_GetRegistryPolicyCommand = async ( }; /** - * deserializeAws_json1_1GetRegistryPolicyCommandError - */ -const de_GetRegistryPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RegistryPolicyNotFoundException": - case "com.amazonaws.ecr#RegistryPolicyNotFoundException": - throw await de_RegistryPolicyNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRegistryScanningConfigurationCommand - */ -export const de_GetRegistryScanningConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRegistryScanningConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetRegistryScanningConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRegistryScanningConfigurationCommandError - */ -const de_GetRegistryScanningConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRepositoryPolicyCommand - */ -export const de_GetRepositoryPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRepositoryPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetRepositoryPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRepositoryPolicyCommandError - */ -const de_GetRepositoryPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "RepositoryPolicyNotFoundException": - case "com.amazonaws.ecr#RepositoryPolicyNotFoundException": - throw await de_RepositoryPolicyNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1InitiateLayerUploadCommand - */ -export const de_InitiateLayerUploadCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_InitiateLayerUploadCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: InitiateLayerUploadCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1InitiateLayerUploadCommandError - */ -const de_InitiateLayerUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.ecr#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListImagesCommand - */ -export const de_ListImagesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListImagesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListImagesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListImagesCommandError - */ -const de_ListImagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutImageCommand - */ -export const de_PutImageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutImageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutImageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutImageCommandError - */ -const de_PutImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImageAlreadyExistsException": - case "com.amazonaws.ecr#ImageAlreadyExistsException": - throw await de_ImageAlreadyExistsExceptionRes(parsedOutput, context); - case "ImageDigestDoesNotMatchException": - case "com.amazonaws.ecr#ImageDigestDoesNotMatchException": - throw await de_ImageDigestDoesNotMatchExceptionRes(parsedOutput, context); - case "ImageTagAlreadyExistsException": - case "com.amazonaws.ecr#ImageTagAlreadyExistsException": - throw await de_ImageTagAlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.ecr#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "LayersNotFoundException": - case "com.amazonaws.ecr#LayersNotFoundException": - throw await de_LayersNotFoundExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecr#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ReferencedImagesNotFoundException": - case "com.amazonaws.ecr#ReferencedImagesNotFoundException": - throw await de_ReferencedImagesNotFoundExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutImageScanningConfigurationCommand - */ -export const de_PutImageScanningConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutImageScanningConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutImageScanningConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutImageScanningConfigurationCommandError - */ -const de_PutImageScanningConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutImageTagMutabilityCommand - */ -export const de_PutImageTagMutabilityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutImageTagMutabilityCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutImageTagMutabilityCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutImageTagMutabilityCommandError - */ -const de_PutImageTagMutabilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutLifecyclePolicyCommand - */ -export const de_PutLifecyclePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutLifecyclePolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutLifecyclePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutLifecyclePolicyCommandError - */ -const de_PutLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutRegistryPolicyCommand - */ -export const de_PutRegistryPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutRegistryPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutRegistryPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutRegistryPolicyCommandError - */ -const de_PutRegistryPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutRegistryScanningConfigurationCommand - */ -export const de_PutRegistryScanningConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutRegistryScanningConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutRegistryScanningConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutRegistryScanningConfigurationCommandError - */ -const de_PutRegistryScanningConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutReplicationConfigurationCommand - */ -export const de_PutReplicationConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutReplicationConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutReplicationConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutReplicationConfigurationCommandError - */ -const de_PutReplicationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1SetRepositoryPolicyCommand - */ -export const de_SetRepositoryPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SetRepositoryPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: SetRepositoryPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1SetRepositoryPolicyCommandError - */ -const de_SetRepositoryPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartImageScanCommand - */ -export const de_StartImageScanCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartImageScanCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartImageScanCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartImageScanCommandError - */ -const de_StartImageScanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ImageNotFoundException": - case "com.amazonaws.ecr#ImageNotFoundException": - throw await de_ImageNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecr#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedImageTypeException": - case "com.amazonaws.ecr#UnsupportedImageTypeException": - throw await de_UnsupportedImageTypeExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartLifecyclePolicyPreviewCommand - */ -export const de_StartLifecyclePolicyPreviewCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartLifecyclePolicyPreviewCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartLifecyclePolicyPreviewCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartLifecyclePolicyPreviewCommandError - */ -const de_StartLifecyclePolicyPreviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LifecyclePolicyNotFoundException": - case "com.amazonaws.ecr#LifecyclePolicyNotFoundException": - throw await de_LifecyclePolicyNotFoundExceptionRes(parsedOutput, context); - case "LifecyclePolicyPreviewInProgressException": - case "com.amazonaws.ecr#LifecyclePolicyPreviewInProgressException": - throw await de_LifecyclePolicyPreviewInProgressExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: TagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.ecr#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.ecr#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UntagResourceCommand - */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UntagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidTagParameterException": - case "com.amazonaws.ecr#InvalidTagParameterException": - throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.ecr#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdatePullThroughCacheRuleCommand - */ -export const de_UpdatePullThroughCacheRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdatePullThroughCacheRuleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdatePullThroughCacheRuleResponse(data, context); - const response: UpdatePullThroughCacheRuleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdatePullThroughCacheRuleCommandError - */ -const de_UpdatePullThroughCacheRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "PullThroughCacheRuleNotFoundException": - case "com.amazonaws.ecr#PullThroughCacheRuleNotFoundException": - throw await de_PullThroughCacheRuleNotFoundExceptionRes(parsedOutput, context); - case "SecretNotFoundException": - case "com.amazonaws.ecr#SecretNotFoundException": - throw await de_SecretNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnableToAccessSecretException": - case "com.amazonaws.ecr#UnableToAccessSecretException": - throw await de_UnableToAccessSecretExceptionRes(parsedOutput, context); - case "UnableToDecryptSecretValueException": - case "com.amazonaws.ecr#UnableToDecryptSecretValueException": - throw await de_UnableToDecryptSecretValueExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ecr#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UploadLayerPartCommand + * deserializeAws_json1_1UploadLayerPartCommand */ export const de_UploadLayerPartCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UploadLayerPartCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3180,50 +1670,6 @@ export const de_UploadLayerPartCommand = async ( return response; }; -/** - * deserializeAws_json1_1UploadLayerPartCommandError - */ -const de_UploadLayerPartCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLayerPartException": - case "com.amazonaws.ecr#InvalidLayerPartException": - throw await de_InvalidLayerPartExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecr#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "KmsException": - case "com.amazonaws.ecr#KmsException": - throw await de_KmsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecr#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RepositoryNotFoundException": - case "com.amazonaws.ecr#RepositoryNotFoundException": - throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecr#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UploadNotFoundException": - case "com.amazonaws.ecr#UploadNotFoundException": - throw await de_UploadNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ValidatePullThroughCacheRuleCommand */ @@ -3232,7 +1678,7 @@ export const de_ValidatePullThroughCacheRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ValidatePullThroughCacheRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3245,12 +1691,9 @@ export const de_ValidatePullThroughCacheRuleCommand = async ( }; /** - * deserializeAws_json1_1ValidatePullThroughCacheRuleCommandError + * deserialize_Aws_json1_1CommandError */ -const de_ValidatePullThroughCacheRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3260,22 +1703,124 @@ const de_ValidatePullThroughCacheRuleCommandError = async ( case "InvalidParameterException": case "com.amazonaws.ecr#InvalidParameterException": throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "PullThroughCacheRuleNotFoundException": - case "com.amazonaws.ecr#PullThroughCacheRuleNotFoundException": - throw await de_PullThroughCacheRuleNotFoundExceptionRes(parsedOutput, context); + case "RepositoryNotFoundException": + case "com.amazonaws.ecr#RepositoryNotFoundException": + throw await de_RepositoryNotFoundExceptionRes(parsedOutput, context); case "ServerException": case "com.amazonaws.ecr#ServerException": throw await de_ServerExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.ecr#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "UnableToGetUpstreamImageException": + case "com.amazonaws.ecr#UnableToGetUpstreamImageException": + throw await de_UnableToGetUpstreamImageExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.ecr#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "EmptyUploadException": + case "com.amazonaws.ecr#EmptyUploadException": + throw await de_EmptyUploadExceptionRes(parsedOutput, context); + case "InvalidLayerException": + case "com.amazonaws.ecr#InvalidLayerException": + throw await de_InvalidLayerExceptionRes(parsedOutput, context); + case "KmsException": + case "com.amazonaws.ecr#KmsException": + throw await de_KmsExceptionRes(parsedOutput, context); + case "LayerAlreadyExistsException": + case "com.amazonaws.ecr#LayerAlreadyExistsException": + throw await de_LayerAlreadyExistsExceptionRes(parsedOutput, context); + case "LayerPartTooSmallException": + case "com.amazonaws.ecr#LayerPartTooSmallException": + throw await de_LayerPartTooSmallExceptionRes(parsedOutput, context); + case "UploadNotFoundException": + case "com.amazonaws.ecr#UploadNotFoundException": + throw await de_UploadNotFoundExceptionRes(parsedOutput, context); + case "PullThroughCacheRuleAlreadyExistsException": + case "com.amazonaws.ecr#PullThroughCacheRuleAlreadyExistsException": + throw await de_PullThroughCacheRuleAlreadyExistsExceptionRes(parsedOutput, context); + case "SecretNotFoundException": + case "com.amazonaws.ecr#SecretNotFoundException": + throw await de_SecretNotFoundExceptionRes(parsedOutput, context); + case "UnableToAccessSecretException": + case "com.amazonaws.ecr#UnableToAccessSecretException": + throw await de_UnableToAccessSecretExceptionRes(parsedOutput, context); + case "UnableToDecryptSecretValueException": + case "com.amazonaws.ecr#UnableToDecryptSecretValueException": + throw await de_UnableToDecryptSecretValueExceptionRes(parsedOutput, context); + case "UnsupportedUpstreamRegistryException": + case "com.amazonaws.ecr#UnsupportedUpstreamRegistryException": + throw await de_UnsupportedUpstreamRegistryExceptionRes(parsedOutput, context); + case "InvalidTagParameterException": + case "com.amazonaws.ecr#InvalidTagParameterException": + throw await de_InvalidTagParameterExceptionRes(parsedOutput, context); + case "RepositoryAlreadyExistsException": + case "com.amazonaws.ecr#RepositoryAlreadyExistsException": + throw await de_RepositoryAlreadyExistsExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.ecr#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "LifecyclePolicyNotFoundException": + case "com.amazonaws.ecr#LifecyclePolicyNotFoundException": + throw await de_LifecyclePolicyNotFoundExceptionRes(parsedOutput, context); + case "PullThroughCacheRuleNotFoundException": + case "com.amazonaws.ecr#PullThroughCacheRuleNotFoundException": + throw await de_PullThroughCacheRuleNotFoundExceptionRes(parsedOutput, context); + case "RegistryPolicyNotFoundException": + case "com.amazonaws.ecr#RegistryPolicyNotFoundException": + throw await de_RegistryPolicyNotFoundExceptionRes(parsedOutput, context); + case "RepositoryNotEmptyException": + case "com.amazonaws.ecr#RepositoryNotEmptyException": + throw await de_RepositoryNotEmptyExceptionRes(parsedOutput, context); + case "RepositoryPolicyNotFoundException": + case "com.amazonaws.ecr#RepositoryPolicyNotFoundException": + throw await de_RepositoryPolicyNotFoundExceptionRes(parsedOutput, context); + case "ImageNotFoundException": + case "com.amazonaws.ecr#ImageNotFoundException": + throw await de_ImageNotFoundExceptionRes(parsedOutput, context); + case "ScanNotFoundException": + case "com.amazonaws.ecr#ScanNotFoundException": + throw await de_ScanNotFoundExceptionRes(parsedOutput, context); + case "LayerInaccessibleException": + case "com.amazonaws.ecr#LayerInaccessibleException": + throw await de_LayerInaccessibleExceptionRes(parsedOutput, context); + case "LayersNotFoundException": + case "com.amazonaws.ecr#LayersNotFoundException": + throw await de_LayersNotFoundExceptionRes(parsedOutput, context); + case "UnableToGetUpstreamLayerException": + case "com.amazonaws.ecr#UnableToGetUpstreamLayerException": + throw await de_UnableToGetUpstreamLayerExceptionRes(parsedOutput, context); + case "LifecyclePolicyPreviewNotFoundException": + case "com.amazonaws.ecr#LifecyclePolicyPreviewNotFoundException": + throw await de_LifecyclePolicyPreviewNotFoundExceptionRes(parsedOutput, context); + case "ImageAlreadyExistsException": + case "com.amazonaws.ecr#ImageAlreadyExistsException": + throw await de_ImageAlreadyExistsExceptionRes(parsedOutput, context); + case "ImageDigestDoesNotMatchException": + case "com.amazonaws.ecr#ImageDigestDoesNotMatchException": + throw await de_ImageDigestDoesNotMatchExceptionRes(parsedOutput, context); + case "ImageTagAlreadyExistsException": + case "com.amazonaws.ecr#ImageTagAlreadyExistsException": + throw await de_ImageTagAlreadyExistsExceptionRes(parsedOutput, context); + case "ReferencedImagesNotFoundException": + case "com.amazonaws.ecr#ReferencedImagesNotFoundException": + throw await de_ReferencedImagesNotFoundExceptionRes(parsedOutput, context); + case "UnsupportedImageTypeException": + case "com.amazonaws.ecr#UnsupportedImageTypeException": + throw await de_UnsupportedImageTypeExceptionRes(parsedOutput, context); + case "LifecyclePolicyPreviewInProgressException": + case "com.amazonaws.ecr#LifecyclePolicyPreviewInProgressException": + throw await de_LifecyclePolicyPreviewInProgressExceptionRes(parsedOutput, context); + case "InvalidLayerPartException": + case "com.amazonaws.ecr#InvalidLayerPartException": + throw await de_InvalidLayerPartExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-ecs/src/protocols/Aws_json1_1.ts b/clients/client-ecs/src/protocols/Aws_json1_1.ts index 85c7fa29372a..d246a218cedb 100644 --- a/clients/client-ecs/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecs/src/protocols/Aws_json1_1.ts @@ -1110,7 +1110,7 @@ export const de_CreateCapacityProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCapacityProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1122,44 +1122,6 @@ export const de_CreateCapacityProviderCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCapacityProviderCommandError - */ -const de_CreateCapacityProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.ecs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UpdateInProgressException": - case "com.amazonaws.ecs#UpdateInProgressException": - throw await de_UpdateInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateClusterCommand */ @@ -1168,7 +1130,7 @@ export const de_CreateClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1180,41 +1142,6 @@ export const de_CreateClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateClusterCommandError - */ -const de_CreateClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NamespaceNotFoundException": - case "com.amazonaws.ecs#NamespaceNotFoundException": - throw await de_NamespaceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateServiceCommand */ @@ -1223,7 +1150,7 @@ export const de_CreateServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1235,56 +1162,6 @@ export const de_CreateServiceCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateServiceCommandError - */ -const de_CreateServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ecs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NamespaceNotFoundException": - case "com.amazonaws.ecs#NamespaceNotFoundException": - throw await de_NamespaceNotFoundExceptionRes(parsedOutput, context); - case "PlatformTaskDefinitionIncompatibilityException": - case "com.amazonaws.ecs#PlatformTaskDefinitionIncompatibilityException": - throw await de_PlatformTaskDefinitionIncompatibilityExceptionRes(parsedOutput, context); - case "PlatformUnknownException": - case "com.amazonaws.ecs#PlatformUnknownException": - throw await de_PlatformUnknownExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedFeatureException": - case "com.amazonaws.ecs#UnsupportedFeatureException": - throw await de_UnsupportedFeatureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTaskSetCommand */ @@ -1293,7 +1170,7 @@ export const de_CreateTaskSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTaskSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1305,62 +1182,6 @@ export const de_CreateTaskSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateTaskSetCommandError - */ -const de_CreateTaskSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ecs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NamespaceNotFoundException": - case "com.amazonaws.ecs#NamespaceNotFoundException": - throw await de_NamespaceNotFoundExceptionRes(parsedOutput, context); - case "PlatformTaskDefinitionIncompatibilityException": - case "com.amazonaws.ecs#PlatformTaskDefinitionIncompatibilityException": - throw await de_PlatformTaskDefinitionIncompatibilityExceptionRes(parsedOutput, context); - case "PlatformUnknownException": - case "com.amazonaws.ecs#PlatformUnknownException": - throw await de_PlatformUnknownExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceNotActiveException": - case "com.amazonaws.ecs#ServiceNotActiveException": - throw await de_ServiceNotActiveExceptionRes(parsedOutput, context); - case "ServiceNotFoundException": - case "com.amazonaws.ecs#ServiceNotFoundException": - throw await de_ServiceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedFeatureException": - case "com.amazonaws.ecs#UnsupportedFeatureException": - throw await de_UnsupportedFeatureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAccountSettingCommand */ @@ -1369,7 +1190,7 @@ export const de_DeleteAccountSettingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAccountSettingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1381,38 +1202,6 @@ export const de_DeleteAccountSettingCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAccountSettingCommandError - */ -const de_DeleteAccountSettingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAttributesCommand */ @@ -1421,7 +1210,7 @@ export const de_DeleteAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1433,38 +1222,6 @@ export const de_DeleteAttributesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAttributesCommandError - */ -const de_DeleteAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "TargetNotFoundException": - case "com.amazonaws.ecs#TargetNotFoundException": - throw await de_TargetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteCapacityProviderCommand */ @@ -1473,7 +1230,7 @@ export const de_DeleteCapacityProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCapacityProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1485,38 +1242,6 @@ export const de_DeleteCapacityProviderCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteCapacityProviderCommandError - */ -const de_DeleteCapacityProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteClusterCommand */ @@ -1525,7 +1250,7 @@ export const de_DeleteClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1538,61 +1263,14 @@ export const de_DeleteClusterCommand = async ( }; /** - * deserializeAws_json1_1DeleteClusterCommandError + * deserializeAws_json1_1DeleteServiceCommand */ -const de_DeleteClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterContainsContainerInstancesException": - case "com.amazonaws.ecs#ClusterContainsContainerInstancesException": - throw await de_ClusterContainsContainerInstancesExceptionRes(parsedOutput, context); - case "ClusterContainsServicesException": - case "com.amazonaws.ecs#ClusterContainsServicesException": - throw await de_ClusterContainsServicesExceptionRes(parsedOutput, context); - case "ClusterContainsTasksException": - case "com.amazonaws.ecs#ClusterContainsTasksException": - throw await de_ClusterContainsTasksExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UpdateInProgressException": - case "com.amazonaws.ecs#UpdateInProgressException": - throw await de_UpdateInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteServiceCommand - */ -export const de_DeleteServiceCommand = async ( +export const de_DeleteServiceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1604,44 +1282,6 @@ export const de_DeleteServiceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteServiceCommandError - */ -const de_DeleteServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceNotFoundException": - case "com.amazonaws.ecs#ServiceNotFoundException": - throw await de_ServiceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteTaskDefinitionsCommand */ @@ -1650,7 +1290,7 @@ export const de_DeleteTaskDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTaskDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1662,41 +1302,6 @@ export const de_DeleteTaskDefinitionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteTaskDefinitionsCommandError - */ -const de_DeleteTaskDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ecs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteTaskSetCommand */ @@ -1705,7 +1310,7 @@ export const de_DeleteTaskSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTaskSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1717,56 +1322,6 @@ export const de_DeleteTaskSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteTaskSetCommandError - */ -const de_DeleteTaskSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ecs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceNotActiveException": - case "com.amazonaws.ecs#ServiceNotActiveException": - throw await de_ServiceNotActiveExceptionRes(parsedOutput, context); - case "ServiceNotFoundException": - case "com.amazonaws.ecs#ServiceNotFoundException": - throw await de_ServiceNotFoundExceptionRes(parsedOutput, context); - case "TaskSetNotFoundException": - case "com.amazonaws.ecs#TaskSetNotFoundException": - throw await de_TaskSetNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedFeatureException": - case "com.amazonaws.ecs#UnsupportedFeatureException": - throw await de_UnsupportedFeatureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeregisterContainerInstanceCommand */ @@ -1775,7 +1330,7 @@ export const de_DeregisterContainerInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterContainerInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1787,41 +1342,6 @@ export const de_DeregisterContainerInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeregisterContainerInstanceCommandError - */ -const de_DeregisterContainerInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeregisterTaskDefinitionCommand */ @@ -1830,7 +1350,7 @@ export const de_DeregisterTaskDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterTaskDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1842,38 +1362,6 @@ export const de_DeregisterTaskDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeregisterTaskDefinitionCommandError - */ -const de_DeregisterTaskDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeCapacityProvidersCommand */ @@ -1882,7 +1370,7 @@ export const de_DescribeCapacityProvidersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCapacityProvidersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1894,38 +1382,6 @@ export const de_DescribeCapacityProvidersCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeCapacityProvidersCommandError - */ -const de_DescribeCapacityProvidersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeClustersCommand */ @@ -1934,7 +1390,7 @@ export const de_DescribeClustersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeClustersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1947,46 +1403,14 @@ export const de_DescribeClustersCommand = async ( }; /** - * deserializeAws_json1_1DescribeClustersCommandError + * deserializeAws_json1_1DescribeContainerInstancesCommand */ -const de_DescribeClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeContainerInstancesCommand - */ -export const de_DescribeContainerInstancesCommand = async ( +export const de_DescribeContainerInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeContainerInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1998,41 +1422,6 @@ export const de_DescribeContainerInstancesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeContainerInstancesCommandError - */ -const de_DescribeContainerInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeServicesCommand */ @@ -2041,7 +1430,7 @@ export const de_DescribeServicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeServicesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2053,41 +1442,6 @@ export const de_DescribeServicesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeServicesCommandError - */ -const de_DescribeServicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTaskDefinitionCommand */ @@ -2096,7 +1450,7 @@ export const de_DescribeTaskDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTaskDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2108,38 +1462,6 @@ export const de_DescribeTaskDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTaskDefinitionCommandError - */ -const de_DescribeTaskDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTasksCommand */ @@ -2148,7 +1470,7 @@ export const de_DescribeTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2160,41 +1482,6 @@ export const de_DescribeTasksCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTasksCommandError - */ -const de_DescribeTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTaskSetsCommand */ @@ -2203,7 +1490,7 @@ export const de_DescribeTaskSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTaskSetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2216,66 +1503,39 @@ export const de_DescribeTaskSetsCommand = async ( }; /** - * deserializeAws_json1_1DescribeTaskSetsCommandError + * deserializeAws_json1_1DiscoverPollEndpointCommand */ -const de_DescribeTaskSetsCommandError = async ( +export const de_DiscoverPollEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ecs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceNotActiveException": - case "com.amazonaws.ecs#ServiceNotActiveException": - throw await de_ServiceNotActiveExceptionRes(parsedOutput, context); - case "ServiceNotFoundException": - case "com.amazonaws.ecs#ServiceNotFoundException": - throw await de_ServiceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedFeatureException": - case "com.amazonaws.ecs#UnsupportedFeatureException": - throw await de_UnsupportedFeatureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DiscoverPollEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DiscoverPollEndpointCommand + * deserializeAws_json1_1ExecuteCommandCommand */ -export const de_DiscoverPollEndpointCommand = async ( +export const de_ExecuteCommandCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DiscoverPollEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DiscoverPollEndpointCommandOutput = { + const response: ExecuteCommandCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2283,48 +1543,39 @@ export const de_DiscoverPollEndpointCommand = async ( }; /** - * deserializeAws_json1_1DiscoverPollEndpointCommandError + * deserializeAws_json1_1GetTaskProtectionCommand */ -const de_DiscoverPollEndpointCommandError = async ( +export const de_GetTaskProtectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetTaskProtectionResponse(data, context); + const response: GetTaskProtectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ExecuteCommandCommand + * deserializeAws_json1_1ListAccountSettingsCommand */ -export const de_ExecuteCommandCommand = async ( +export const de_ListAccountSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ExecuteCommandCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ExecuteCommandCommandOutput = { + const response: ListAccountSettingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2332,171 +1583,14 @@ export const de_ExecuteCommandCommand = async ( }; /** - * deserializeAws_json1_1ExecuteCommandCommandError + * deserializeAws_json1_1ListAttributesCommand */ -const de_ExecuteCommandCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ecs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "TargetNotConnectedException": - case "com.amazonaws.ecs#TargetNotConnectedException": - throw await de_TargetNotConnectedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetTaskProtectionCommand - */ -export const de_GetTaskProtectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetTaskProtectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetTaskProtectionResponse(data, context); - const response: GetTaskProtectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetTaskProtectionCommandError - */ -const de_GetTaskProtectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ecs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ecs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedFeatureException": - case "com.amazonaws.ecs#UnsupportedFeatureException": - throw await de_UnsupportedFeatureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAccountSettingsCommand - */ -export const de_ListAccountSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAccountSettingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListAccountSettingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAccountSettingsCommandError - */ -const de_ListAccountSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAttributesCommand - */ -export const de_ListAttributesCommand = async ( +export const de_ListAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2508,35 +1602,6 @@ export const de_ListAttributesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAttributesCommandError - */ -const de_ListAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListClustersCommand */ @@ -2545,7 +1610,7 @@ export const de_ListClustersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListClustersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2557,38 +1622,6 @@ export const de_ListClustersCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListClustersCommandError - */ -const de_ListClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListContainerInstancesCommand */ @@ -2597,7 +1630,7 @@ export const de_ListContainerInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListContainerInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2609,41 +1642,6 @@ export const de_ListContainerInstancesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListContainerInstancesCommandError - */ -const de_ListContainerInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListServicesCommand */ @@ -2652,7 +1650,7 @@ export const de_ListServicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListServicesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2664,41 +1662,6 @@ export const de_ListServicesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListServicesCommandError - */ -const de_ListServicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListServicesByNamespaceCommand */ @@ -2707,122 +1670,32 @@ export const de_ListServicesByNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListServicesByNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); const response: ListServicesByNamespaceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListServicesByNamespaceCommandError - */ -const de_ListServicesByNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NamespaceNotFoundException": - case "com.amazonaws.ecs#NamespaceNotFoundException": - throw await de_NamespaceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTaskDefinitionFamiliesCommand + * deserializeAws_json1_1ListTagsForResourceCommand */ -export const de_ListTaskDefinitionFamiliesCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTaskDefinitionFamiliesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTaskDefinitionFamiliesCommandOutput = { + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2830,35 +1703,23 @@ export const de_ListTaskDefinitionFamiliesCommand = async ( }; /** - * deserializeAws_json1_1ListTaskDefinitionFamiliesCommandError + * deserializeAws_json1_1ListTaskDefinitionFamiliesCommand */ -const de_ListTaskDefinitionFamiliesCommandError = async ( +export const de_ListTaskDefinitionFamiliesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTaskDefinitionFamiliesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2869,7 +1730,7 @@ export const de_ListTaskDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTaskDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2881,38 +1742,6 @@ export const de_ListTaskDefinitionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTaskDefinitionsCommandError - */ -const de_ListTaskDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTasksCommand */ @@ -2921,7 +1750,7 @@ export const de_ListTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2933,44 +1762,6 @@ export const de_ListTasksCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTasksCommandError - */ -const de_ListTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceNotFoundException": - case "com.amazonaws.ecs#ServiceNotFoundException": - throw await de_ServiceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutAccountSettingCommand */ @@ -2979,7 +1770,7 @@ export const de_PutAccountSettingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutAccountSettingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2991,38 +1782,6 @@ export const de_PutAccountSettingCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutAccountSettingCommandError - */ -const de_PutAccountSettingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutAccountSettingDefaultCommand */ @@ -3031,7 +1790,7 @@ export const de_PutAccountSettingDefaultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutAccountSettingDefaultCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3043,38 +1802,6 @@ export const de_PutAccountSettingDefaultCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutAccountSettingDefaultCommandError - */ -const de_PutAccountSettingDefaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutAttributesCommand */ @@ -3083,7 +1810,7 @@ export const de_PutAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3092,119 +1819,23 @@ export const de_PutAttributesCommand = async ( $metadata: deserializeMetadata(output), ...contents, }; - return response; -}; - -/** - * deserializeAws_json1_1PutAttributesCommandError - */ -const de_PutAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AttributeLimitExceededException": - case "com.amazonaws.ecs#AttributeLimitExceededException": - throw await de_AttributeLimitExceededExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "TargetNotFoundException": - case "com.amazonaws.ecs#TargetNotFoundException": - throw await de_TargetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutClusterCapacityProvidersCommand - */ -export const de_PutClusterCapacityProvidersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutClusterCapacityProvidersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutClusterCapacityProvidersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutClusterCapacityProvidersCommandError - */ -const de_PutClusterCapacityProvidersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.ecs#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UpdateInProgressException": - case "com.amazonaws.ecs#UpdateInProgressException": - throw await de_UpdateInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1RegisterContainerInstanceCommand + * deserializeAws_json1_1PutClusterCapacityProvidersCommand */ -export const de_RegisterContainerInstanceCommand = async ( +export const de_PutClusterCapacityProvidersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RegisterContainerInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RegisterContainerInstanceResponse(data, context); - const response: RegisterContainerInstanceCommandOutput = { + contents = _json(data); + const response: PutClusterCapacityProvidersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3212,35 +1843,23 @@ export const de_RegisterContainerInstanceCommand = async ( }; /** - * deserializeAws_json1_1RegisterContainerInstanceCommandError + * deserializeAws_json1_1RegisterContainerInstanceCommand */ -const de_RegisterContainerInstanceCommandError = async ( +export const de_RegisterContainerInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RegisterContainerInstanceResponse(data, context); + const response: RegisterContainerInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3251,7 +1870,7 @@ export const de_RegisterTaskDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterTaskDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3263,38 +1882,6 @@ export const de_RegisterTaskDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1RegisterTaskDefinitionCommandError - */ -const de_RegisterTaskDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RunTaskCommand */ @@ -3303,7 +1890,7 @@ export const de_RunTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RunTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3315,59 +1902,6 @@ export const de_RunTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_1RunTaskCommandError - */ -const de_RunTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ecs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BlockedException": - case "com.amazonaws.ecs#BlockedException": - throw await de_BlockedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ecs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "PlatformTaskDefinitionIncompatibilityException": - case "com.amazonaws.ecs#PlatformTaskDefinitionIncompatibilityException": - throw await de_PlatformTaskDefinitionIncompatibilityExceptionRes(parsedOutput, context); - case "PlatformUnknownException": - case "com.amazonaws.ecs#PlatformUnknownException": - throw await de_PlatformUnknownExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedFeatureException": - case "com.amazonaws.ecs#UnsupportedFeatureException": - throw await de_UnsupportedFeatureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartTaskCommand */ @@ -3376,7 +1910,7 @@ export const de_StartTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3388,44 +1922,6 @@ export const de_StartTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartTaskCommandError - */ -const de_StartTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedFeatureException": - case "com.amazonaws.ecs#UnsupportedFeatureException": - throw await de_UnsupportedFeatureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopTaskCommand */ @@ -3434,7 +1930,7 @@ export const de_StopTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3446,41 +1942,6 @@ export const de_StopTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopTaskCommandError - */ -const de_StopTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SubmitAttachmentStateChangesCommand */ @@ -3489,7 +1950,7 @@ export const de_SubmitAttachmentStateChangesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SubmitAttachmentStateChangesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3501,41 +1962,6 @@ export const de_SubmitAttachmentStateChangesCommand = async ( return response; }; -/** - * deserializeAws_json1_1SubmitAttachmentStateChangesCommandError - */ -const de_SubmitAttachmentStateChangesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ecs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SubmitContainerStateChangeCommand */ @@ -3544,48 +1970,16 @@ export const de_SubmitContainerStateChangeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SubmitContainerStateChangeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: SubmitContainerStateChangeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1SubmitContainerStateChangeCommandError - */ -const de_SubmitContainerStateChangeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ecs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + contents = _json(data); + const response: SubmitContainerStateChangeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3596,7 +1990,7 @@ export const de_SubmitTaskStateChangeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SubmitTaskStateChangeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3608,41 +2002,6 @@ export const de_SubmitTaskStateChangeCommand = async ( return response; }; -/** - * deserializeAws_json1_1SubmitTaskStateChangeCommandError - */ -const de_SubmitTaskStateChangeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ecs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -3651,7 +2010,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3663,44 +2022,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ecs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -3709,7 +2030,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3721,44 +2042,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ecs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateCapacityProviderCommand */ @@ -3767,7 +2050,7 @@ export const de_UpdateCapacityProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateCapacityProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3779,38 +2062,6 @@ export const de_UpdateCapacityProviderCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateCapacityProviderCommandError - */ -const de_UpdateCapacityProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateClusterCommand */ @@ -3819,7 +2070,7 @@ export const de_UpdateClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3831,44 +2082,6 @@ export const de_UpdateClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateClusterCommandError - */ -const de_UpdateClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NamespaceNotFoundException": - case "com.amazonaws.ecs#NamespaceNotFoundException": - throw await de_NamespaceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateClusterSettingsCommand */ @@ -3877,7 +2090,7 @@ export const de_UpdateClusterSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateClusterSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3889,103 +2102,24 @@ export const de_UpdateClusterSettingsCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateClusterSettingsCommandError - */ -const de_UpdateClusterSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateContainerAgentCommand */ export const de_UpdateContainerAgentCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateContainerAgentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateContainerAgentResponse(data, context); - const response: UpdateContainerAgentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateContainerAgentCommandError - */ -const de_UpdateContainerAgentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingVersionException": - case "com.amazonaws.ecs#MissingVersionException": - throw await de_MissingVersionExceptionRes(parsedOutput, context); - case "NoUpdateAvailableException": - case "com.amazonaws.ecs#NoUpdateAvailableException": - throw await de_NoUpdateAvailableExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UpdateInProgressException": - case "com.amazonaws.ecs#UpdateInProgressException": - throw await de_UpdateInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateContainerAgentResponse(data, context); + const response: UpdateContainerAgentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3996,7 +2130,7 @@ export const de_UpdateContainerInstancesStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateContainerInstancesStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4008,41 +2142,6 @@ export const de_UpdateContainerInstancesStateCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateContainerInstancesStateCommandError - */ -const de_UpdateContainerInstancesStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateServiceCommand */ @@ -4051,7 +2150,7 @@ export const de_UpdateServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4063,62 +2162,6 @@ export const de_UpdateServiceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateServiceCommandError - */ -const de_UpdateServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ecs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NamespaceNotFoundException": - case "com.amazonaws.ecs#NamespaceNotFoundException": - throw await de_NamespaceNotFoundExceptionRes(parsedOutput, context); - case "PlatformTaskDefinitionIncompatibilityException": - case "com.amazonaws.ecs#PlatformTaskDefinitionIncompatibilityException": - throw await de_PlatformTaskDefinitionIncompatibilityExceptionRes(parsedOutput, context); - case "PlatformUnknownException": - case "com.amazonaws.ecs#PlatformUnknownException": - throw await de_PlatformUnknownExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceNotActiveException": - case "com.amazonaws.ecs#ServiceNotActiveException": - throw await de_ServiceNotActiveExceptionRes(parsedOutput, context); - case "ServiceNotFoundException": - case "com.amazonaws.ecs#ServiceNotFoundException": - throw await de_ServiceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedFeatureException": - case "com.amazonaws.ecs#UnsupportedFeatureException": - throw await de_UnsupportedFeatureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateServicePrimaryTaskSetCommand */ @@ -4127,7 +2170,7 @@ export const de_UpdateServicePrimaryTaskSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateServicePrimaryTaskSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4139,56 +2182,6 @@ export const de_UpdateServicePrimaryTaskSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateServicePrimaryTaskSetCommandError - */ -const de_UpdateServicePrimaryTaskSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ecs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceNotActiveException": - case "com.amazonaws.ecs#ServiceNotActiveException": - throw await de_ServiceNotActiveExceptionRes(parsedOutput, context); - case "ServiceNotFoundException": - case "com.amazonaws.ecs#ServiceNotFoundException": - throw await de_ServiceNotFoundExceptionRes(parsedOutput, context); - case "TaskSetNotFoundException": - case "com.amazonaws.ecs#TaskSetNotFoundException": - throw await de_TaskSetNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedFeatureException": - case "com.amazonaws.ecs#UnsupportedFeatureException": - throw await de_UnsupportedFeatureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateTaskProtectionCommand */ @@ -4197,7 +2190,7 @@ export const de_UpdateTaskProtectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTaskProtectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4209,50 +2202,6 @@ export const de_UpdateTaskProtectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateTaskProtectionCommandError - */ -const de_UpdateTaskProtectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ecs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.ecs#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ecs#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ecs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.ecs#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedFeatureException": - case "com.amazonaws.ecs#UnsupportedFeatureException": - throw await de_UnsupportedFeatureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateTaskSetCommand */ @@ -4261,7 +2210,7 @@ export const de_UpdateTaskSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTaskSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4274,52 +2223,100 @@ export const de_UpdateTaskSetCommand = async ( }; /** - * deserializeAws_json1_1UpdateTaskSetCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateTaskSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ecs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); case "ClientException": case "com.amazonaws.ecs#ClientException": throw await de_ClientExceptionRes(parsedOutput, context); - case "ClusterNotFoundException": - case "com.amazonaws.ecs#ClusterNotFoundException": - throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); case "InvalidParameterException": case "com.amazonaws.ecs#InvalidParameterException": throw await de_InvalidParameterExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.ecs#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "ServerException": case "com.amazonaws.ecs#ServerException": throw await de_ServerExceptionRes(parsedOutput, context); + case "UpdateInProgressException": + case "com.amazonaws.ecs#UpdateInProgressException": + throw await de_UpdateInProgressExceptionRes(parsedOutput, context); + case "NamespaceNotFoundException": + case "com.amazonaws.ecs#NamespaceNotFoundException": + throw await de_NamespaceNotFoundExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.ecs#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ClusterNotFoundException": + case "com.amazonaws.ecs#ClusterNotFoundException": + throw await de_ClusterNotFoundExceptionRes(parsedOutput, context); + case "PlatformTaskDefinitionIncompatibilityException": + case "com.amazonaws.ecs#PlatformTaskDefinitionIncompatibilityException": + throw await de_PlatformTaskDefinitionIncompatibilityExceptionRes(parsedOutput, context); + case "PlatformUnknownException": + case "com.amazonaws.ecs#PlatformUnknownException": + throw await de_PlatformUnknownExceptionRes(parsedOutput, context); + case "UnsupportedFeatureException": + case "com.amazonaws.ecs#UnsupportedFeatureException": + throw await de_UnsupportedFeatureExceptionRes(parsedOutput, context); case "ServiceNotActiveException": case "com.amazonaws.ecs#ServiceNotActiveException": throw await de_ServiceNotActiveExceptionRes(parsedOutput, context); case "ServiceNotFoundException": case "com.amazonaws.ecs#ServiceNotFoundException": throw await de_ServiceNotFoundExceptionRes(parsedOutput, context); + case "TargetNotFoundException": + case "com.amazonaws.ecs#TargetNotFoundException": + throw await de_TargetNotFoundExceptionRes(parsedOutput, context); + case "ClusterContainsContainerInstancesException": + case "com.amazonaws.ecs#ClusterContainsContainerInstancesException": + throw await de_ClusterContainsContainerInstancesExceptionRes(parsedOutput, context); + case "ClusterContainsServicesException": + case "com.amazonaws.ecs#ClusterContainsServicesException": + throw await de_ClusterContainsServicesExceptionRes(parsedOutput, context); + case "ClusterContainsTasksException": + case "com.amazonaws.ecs#ClusterContainsTasksException": + throw await de_ClusterContainsTasksExceptionRes(parsedOutput, context); case "TaskSetNotFoundException": case "com.amazonaws.ecs#TaskSetNotFoundException": throw await de_TaskSetNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedFeatureException": - case "com.amazonaws.ecs#UnsupportedFeatureException": - throw await de_UnsupportedFeatureExceptionRes(parsedOutput, context); + case "TargetNotConnectedException": + case "com.amazonaws.ecs#TargetNotConnectedException": + throw await de_TargetNotConnectedExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.ecs#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "AttributeLimitExceededException": + case "com.amazonaws.ecs#AttributeLimitExceededException": + throw await de_AttributeLimitExceededExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.ecs#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); + case "BlockedException": + case "com.amazonaws.ecs#BlockedException": + throw await de_BlockedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.ecs#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "MissingVersionException": + case "com.amazonaws.ecs#MissingVersionException": + throw await de_MissingVersionExceptionRes(parsedOutput, context); + case "NoUpdateAvailableException": + case "com.amazonaws.ecs#NoUpdateAvailableException": + throw await de_NoUpdateAvailableExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-efs/src/protocols/Aws_restJson1.ts b/clients/client-efs/src/protocols/Aws_restJson1.ts index 3b1fd3c5fc31..dd1fe820da0c 100644 --- a/clients/client-efs/src/protocols/Aws_restJson1.ts +++ b/clients/client-efs/src/protocols/Aws_restJson1.ts @@ -816,7 +816,7 @@ export const de_CreateAccessPointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAccessPointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -838,50 +838,6 @@ export const de_CreateAccessPointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAccessPointCommandError - */ -const de_CreateAccessPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessPointAlreadyExists": - case "com.amazonaws.efs#AccessPointAlreadyExists": - throw await de_AccessPointAlreadyExistsRes(parsedOutput, context); - case "AccessPointLimitExceeded": - case "com.amazonaws.efs#AccessPointLimitExceeded": - throw await de_AccessPointLimitExceededRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncorrectFileSystemLifeCycleState": - case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState": - throw await de_IncorrectFileSystemLifeCycleStateRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.efs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFileSystemCommand */ @@ -890,7 +846,7 @@ export const de_CreateFileSystemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateFileSystemCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -920,50 +876,6 @@ export const de_CreateFileSystemCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFileSystemCommandError - */ -const de_CreateFileSystemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemAlreadyExists": - case "com.amazonaws.efs#FileSystemAlreadyExists": - throw await de_FileSystemAlreadyExistsRes(parsedOutput, context); - case "FileSystemLimitExceeded": - case "com.amazonaws.efs#FileSystemLimitExceeded": - throw await de_FileSystemLimitExceededRes(parsedOutput, context); - case "InsufficientThroughputCapacity": - case "com.amazonaws.efs#InsufficientThroughputCapacity": - throw await de_InsufficientThroughputCapacityRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ThroughputLimitExceeded": - case "com.amazonaws.efs#ThroughputLimitExceeded": - throw await de_ThroughputLimitExceededRes(parsedOutput, context); - case "UnsupportedAvailabilityZone": - case "com.amazonaws.efs#UnsupportedAvailabilityZone": - throw await de_UnsupportedAvailabilityZoneRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMountTargetCommand */ @@ -972,7 +884,7 @@ export const de_CreateMountTargetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMountTargetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -994,68 +906,6 @@ export const de_CreateMountTargetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMountTargetCommandError - */ -const de_CreateMountTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AvailabilityZonesMismatch": - case "com.amazonaws.efs#AvailabilityZonesMismatch": - throw await de_AvailabilityZonesMismatchRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncorrectFileSystemLifeCycleState": - case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState": - throw await de_IncorrectFileSystemLifeCycleStateRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "IpAddressInUse": - case "com.amazonaws.efs#IpAddressInUse": - throw await de_IpAddressInUseRes(parsedOutput, context); - case "MountTargetConflict": - case "com.amazonaws.efs#MountTargetConflict": - throw await de_MountTargetConflictRes(parsedOutput, context); - case "NetworkInterfaceLimitExceeded": - case "com.amazonaws.efs#NetworkInterfaceLimitExceeded": - throw await de_NetworkInterfaceLimitExceededRes(parsedOutput, context); - case "NoFreeAddressesInSubnet": - case "com.amazonaws.efs#NoFreeAddressesInSubnet": - throw await de_NoFreeAddressesInSubnetRes(parsedOutput, context); - case "SecurityGroupLimitExceeded": - case "com.amazonaws.efs#SecurityGroupLimitExceeded": - throw await de_SecurityGroupLimitExceededRes(parsedOutput, context); - case "SecurityGroupNotFound": - case "com.amazonaws.efs#SecurityGroupNotFound": - throw await de_SecurityGroupNotFoundRes(parsedOutput, context); - case "SubnetNotFound": - case "com.amazonaws.efs#SubnetNotFound": - throw await de_SubnetNotFoundRes(parsedOutput, context); - case "UnsupportedAvailabilityZone": - case "com.amazonaws.efs#UnsupportedAvailabilityZone": - throw await de_UnsupportedAvailabilityZoneRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateReplicationConfigurationCommand */ @@ -1064,7 +914,7 @@ export const de_CreateReplicationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateReplicationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1082,62 +932,6 @@ export const de_CreateReplicationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateReplicationConfigurationCommandError - */ -const de_CreateReplicationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.efs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "FileSystemLimitExceeded": - case "com.amazonaws.efs#FileSystemLimitExceeded": - throw await de_FileSystemLimitExceededRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncorrectFileSystemLifeCycleState": - case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState": - throw await de_IncorrectFileSystemLifeCycleStateRes(parsedOutput, context); - case "InsufficientThroughputCapacity": - case "com.amazonaws.efs#InsufficientThroughputCapacity": - throw await de_InsufficientThroughputCapacityRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ReplicationNotFound": - case "com.amazonaws.efs#ReplicationNotFound": - throw await de_ReplicationNotFoundRes(parsedOutput, context); - case "ThroughputLimitExceeded": - case "com.amazonaws.efs#ThroughputLimitExceeded": - throw await de_ThroughputLimitExceededRes(parsedOutput, context); - case "UnsupportedAvailabilityZone": - case "com.amazonaws.efs#UnsupportedAvailabilityZone": - throw await de_UnsupportedAvailabilityZoneRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.efs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateTagsCommand */ @@ -1146,7 +940,7 @@ export const de_CreateTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_CreateTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1155,38 +949,6 @@ export const de_CreateTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTagsCommandError - */ -const de_CreateTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAccessPointCommand */ @@ -1195,7 +957,7 @@ export const de_DeleteAccessPointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAccessPointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1204,38 +966,6 @@ export const de_DeleteAccessPointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAccessPointCommandError - */ -const de_DeleteAccessPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessPointNotFound": - case "com.amazonaws.efs#AccessPointNotFound": - throw await de_AccessPointNotFoundRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteFileSystemCommand */ @@ -1244,7 +974,7 @@ export const de_DeleteFileSystemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteFileSystemCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1254,49 +984,14 @@ export const de_DeleteFileSystemCommand = async ( }; /** - * deserializeAws_restJson1DeleteFileSystemCommandError + * deserializeAws_restJson1DeleteFileSystemPolicyCommand */ -const de_DeleteFileSystemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemInUse": - case "com.amazonaws.efs#FileSystemInUse": - throw await de_FileSystemInUseRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteFileSystemPolicyCommand - */ -export const de_DeleteFileSystemPolicyCommand = async ( +export const de_DeleteFileSystemPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFileSystemPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1305,41 +1000,6 @@ export const de_DeleteFileSystemPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteFileSystemPolicyCommandError - */ -const de_DeleteFileSystemPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncorrectFileSystemLifeCycleState": - case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState": - throw await de_IncorrectFileSystemLifeCycleStateRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteMountTargetCommand */ @@ -1348,7 +1008,7 @@ export const de_DeleteMountTargetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteMountTargetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1357,41 +1017,6 @@ export const de_DeleteMountTargetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteMountTargetCommandError - */ -const de_DeleteMountTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "DependencyTimeout": - case "com.amazonaws.efs#DependencyTimeout": - throw await de_DependencyTimeoutRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "MountTargetNotFound": - case "com.amazonaws.efs#MountTargetNotFound": - throw await de_MountTargetNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteReplicationConfigurationCommand */ @@ -1400,7 +1025,7 @@ export const de_DeleteReplicationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteReplicationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1409,41 +1034,6 @@ export const de_DeleteReplicationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteReplicationConfigurationCommandError - */ -const de_DeleteReplicationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ReplicationNotFound": - case "com.amazonaws.efs#ReplicationNotFound": - throw await de_ReplicationNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteTagsCommand */ @@ -1452,7 +1042,7 @@ export const de_DeleteTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1461,38 +1051,6 @@ export const de_DeleteTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteTagsCommandError - */ -const de_DeleteTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAccessPointsCommand */ @@ -1501,7 +1059,7 @@ export const de_DescribeAccessPointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAccessPointsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1515,41 +1073,6 @@ export const de_DescribeAccessPointsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAccessPointsCommandError - */ -const de_DescribeAccessPointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessPointNotFound": - case "com.amazonaws.efs#AccessPointNotFound": - throw await de_AccessPointNotFoundRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAccountPreferencesCommand */ @@ -1558,7 +1081,7 @@ export const de_DescribeAccountPreferencesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAccountPreferencesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1572,32 +1095,6 @@ export const de_DescribeAccountPreferencesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAccountPreferencesCommandError - */ -const de_DescribeAccountPreferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeBackupPolicyCommand */ @@ -1606,7 +1103,7 @@ export const de_DescribeBackupPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBackupPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1619,44 +1116,6 @@ export const de_DescribeBackupPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeBackupPolicyCommandError - */ -const de_DescribeBackupPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "PolicyNotFound": - case "com.amazonaws.efs#PolicyNotFound": - throw await de_PolicyNotFoundRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.efs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeFileSystemPolicyCommand */ @@ -1665,7 +1124,7 @@ export const de_DescribeFileSystemPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFileSystemPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1680,49 +1139,14 @@ export const de_DescribeFileSystemPolicyCommand = async ( }; /** - * deserializeAws_restJson1DescribeFileSystemPolicyCommandError + * deserializeAws_restJson1DescribeFileSystemsCommand */ -const de_DescribeFileSystemPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "PolicyNotFound": - case "com.amazonaws.efs#PolicyNotFound": - throw await de_PolicyNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeFileSystemsCommand - */ -export const de_DescribeFileSystemsCommand = async ( +export const de_DescribeFileSystemsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFileSystemsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1737,38 +1161,6 @@ export const de_DescribeFileSystemsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeFileSystemsCommandError - */ -const de_DescribeFileSystemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeLifecycleConfigurationCommand */ @@ -1777,7 +1169,7 @@ export const de_DescribeLifecycleConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeLifecycleConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1790,38 +1182,6 @@ export const de_DescribeLifecycleConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeLifecycleConfigurationCommandError - */ -const de_DescribeLifecycleConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeMountTargetsCommand */ @@ -1830,7 +1190,7 @@ export const de_DescribeMountTargetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeMountTargetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1845,44 +1205,6 @@ export const de_DescribeMountTargetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeMountTargetsCommandError - */ -const de_DescribeMountTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessPointNotFound": - case "com.amazonaws.efs#AccessPointNotFound": - throw await de_AccessPointNotFoundRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "MountTargetNotFound": - case "com.amazonaws.efs#MountTargetNotFound": - throw await de_MountTargetNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeMountTargetSecurityGroupsCommand */ @@ -1891,7 +1213,7 @@ export const de_DescribeMountTargetSecurityGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeMountTargetSecurityGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1904,41 +1226,6 @@ export const de_DescribeMountTargetSecurityGroupsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeMountTargetSecurityGroupsCommandError - */ -const de_DescribeMountTargetSecurityGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "IncorrectMountTargetState": - case "com.amazonaws.efs#IncorrectMountTargetState": - throw await de_IncorrectMountTargetStateRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "MountTargetNotFound": - case "com.amazonaws.efs#MountTargetNotFound": - throw await de_MountTargetNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeReplicationConfigurationsCommand */ @@ -1947,7 +1234,7 @@ export const de_DescribeReplicationConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeReplicationConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1961,44 +1248,6 @@ export const de_DescribeReplicationConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeReplicationConfigurationsCommandError - */ -const de_DescribeReplicationConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ReplicationNotFound": - case "com.amazonaws.efs#ReplicationNotFound": - throw await de_ReplicationNotFoundRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.efs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeTagsCommand */ @@ -2007,7 +1256,7 @@ export const de_DescribeTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2022,38 +1271,6 @@ export const de_DescribeTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeTagsCommandError - */ -const de_DescribeTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -2062,7 +1279,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2076,41 +1293,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessPointNotFound": - case "com.amazonaws.efs#AccessPointNotFound": - throw await de_AccessPointNotFoundRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ModifyMountTargetSecurityGroupsCommand */ @@ -2119,7 +1301,7 @@ export const de_ModifyMountTargetSecurityGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_ModifyMountTargetSecurityGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2128,47 +1310,6 @@ export const de_ModifyMountTargetSecurityGroupsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ModifyMountTargetSecurityGroupsCommandError - */ -const de_ModifyMountTargetSecurityGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "IncorrectMountTargetState": - case "com.amazonaws.efs#IncorrectMountTargetState": - throw await de_IncorrectMountTargetStateRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "MountTargetNotFound": - case "com.amazonaws.efs#MountTargetNotFound": - throw await de_MountTargetNotFoundRes(parsedOutput, context); - case "SecurityGroupLimitExceeded": - case "com.amazonaws.efs#SecurityGroupLimitExceeded": - throw await de_SecurityGroupLimitExceededRes(parsedOutput, context); - case "SecurityGroupNotFound": - case "com.amazonaws.efs#SecurityGroupNotFound": - throw await de_SecurityGroupNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutAccountPreferencesCommand */ @@ -2177,273 +1318,98 @@ export const de_PutAccountPreferencesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAccountPreferencesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ResourceIdPreference: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutAccountPreferencesCommandError - */ -const de_PutAccountPreferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutBackupPolicyCommand - */ -export const de_PutBackupPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBackupPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BackupPolicy: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutBackupPolicyCommandError - */ -const de_PutBackupPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncorrectFileSystemLifeCycleState": - case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState": - throw await de_IncorrectFileSystemLifeCycleStateRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.efs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutFileSystemPolicyCommand - */ -export const de_PutFileSystemPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutFileSystemPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - FileSystemId: __expectString, - Policy: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutFileSystemPolicyCommandError - */ -const de_PutFileSystemPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncorrectFileSystemLifeCycleState": - case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState": - throw await de_IncorrectFileSystemLifeCycleStateRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPolicyException": - case "com.amazonaws.efs#InvalidPolicyException": - throw await de_InvalidPolicyExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const doc = take(data, { + ResourceIdPreference: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutLifecycleConfigurationCommand + * deserializeAws_restJson1PutBackupPolicyCommand */ -export const de_PutLifecycleConfigurationCommand = async ( +export const de_PutBackupPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutLifecycleConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - LifecyclePolicies: _json, + BackupPolicy: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutLifecycleConfigurationCommandError + * deserializeAws_restJson1PutFileSystemPolicyCommand */ -const de_PutLifecycleConfigurationCommandError = async ( +export const de_PutFileSystemPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncorrectFileSystemLifeCycleState": - case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState": - throw await de_IncorrectFileSystemLifeCycleStateRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + FileSystemId: __expectString, + Policy: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1PutLifecycleConfigurationCommand */ -export const de_TagResourceCommand = async ( +export const de_PutLifecycleConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LifecyclePolicies: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessPointNotFound": - case "com.amazonaws.efs#AccessPointNotFound": - throw await de_AccessPointNotFoundRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -2454,7 +1420,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2463,41 +1429,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessPointNotFound": - case "com.amazonaws.efs#AccessPointNotFound": - throw await de_AccessPointNotFoundRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFileSystemCommand */ @@ -2506,7 +1437,7 @@ export const de_UpdateFileSystemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateFileSystemCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2536,50 +1467,6 @@ export const de_UpdateFileSystemCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFileSystemCommandError - */ -const de_UpdateFileSystemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.efs#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.efs#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncorrectFileSystemLifeCycleState": - case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState": - throw await de_IncorrectFileSystemLifeCycleStateRes(parsedOutput, context); - case "InsufficientThroughputCapacity": - case "com.amazonaws.efs#InsufficientThroughputCapacity": - throw await de_InsufficientThroughputCapacityRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.efs#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ThroughputLimitExceeded": - case "com.amazonaws.efs#ThroughputLimitExceeded": - throw await de_ThroughputLimitExceededRes(parsedOutput, context); - case "TooManyRequests": - case "com.amazonaws.efs#TooManyRequests": - throw await de_TooManyRequestsRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFileSystemProtectionCommand */ @@ -2588,7 +1475,7 @@ export const de_UpdateFileSystemProtectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFileSystemProtectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2602,18 +1489,21 @@ export const de_UpdateFileSystemProtectionCommand = async ( }; /** - * deserializeAws_restJson1UpdateFileSystemProtectionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateFileSystemProtectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AccessPointAlreadyExists": + case "com.amazonaws.efs#AccessPointAlreadyExists": + throw await de_AccessPointAlreadyExistsRes(parsedOutput, context); + case "AccessPointLimitExceeded": + case "com.amazonaws.efs#AccessPointLimitExceeded": + throw await de_AccessPointLimitExceededRes(parsedOutput, context); case "BadRequest": case "com.amazonaws.efs#BadRequest": throw await de_BadRequestRes(parsedOutput, context); @@ -2623,28 +1513,94 @@ const de_UpdateFileSystemProtectionCommandError = async ( case "IncorrectFileSystemLifeCycleState": case "com.amazonaws.efs#IncorrectFileSystemLifeCycleState": throw await de_IncorrectFileSystemLifeCycleStateRes(parsedOutput, context); - case "InsufficientThroughputCapacity": - case "com.amazonaws.efs#InsufficientThroughputCapacity": - throw await de_InsufficientThroughputCapacityRes(parsedOutput, context); case "InternalServerError": case "com.amazonaws.efs#InternalServerError": throw await de_InternalServerErrorRes(parsedOutput, context); - case "ReplicationAlreadyExists": - case "com.amazonaws.efs#ReplicationAlreadyExists": - throw await de_ReplicationAlreadyExistsRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.efs#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "FileSystemAlreadyExists": + case "com.amazonaws.efs#FileSystemAlreadyExists": + throw await de_FileSystemAlreadyExistsRes(parsedOutput, context); + case "FileSystemLimitExceeded": + case "com.amazonaws.efs#FileSystemLimitExceeded": + throw await de_FileSystemLimitExceededRes(parsedOutput, context); + case "InsufficientThroughputCapacity": + case "com.amazonaws.efs#InsufficientThroughputCapacity": + throw await de_InsufficientThroughputCapacityRes(parsedOutput, context); case "ThroughputLimitExceeded": case "com.amazonaws.efs#ThroughputLimitExceeded": throw await de_ThroughputLimitExceededRes(parsedOutput, context); + case "UnsupportedAvailabilityZone": + case "com.amazonaws.efs#UnsupportedAvailabilityZone": + throw await de_UnsupportedAvailabilityZoneRes(parsedOutput, context); + case "AvailabilityZonesMismatch": + case "com.amazonaws.efs#AvailabilityZonesMismatch": + throw await de_AvailabilityZonesMismatchRes(parsedOutput, context); + case "IpAddressInUse": + case "com.amazonaws.efs#IpAddressInUse": + throw await de_IpAddressInUseRes(parsedOutput, context); + case "MountTargetConflict": + case "com.amazonaws.efs#MountTargetConflict": + throw await de_MountTargetConflictRes(parsedOutput, context); + case "NetworkInterfaceLimitExceeded": + case "com.amazonaws.efs#NetworkInterfaceLimitExceeded": + throw await de_NetworkInterfaceLimitExceededRes(parsedOutput, context); + case "NoFreeAddressesInSubnet": + case "com.amazonaws.efs#NoFreeAddressesInSubnet": + throw await de_NoFreeAddressesInSubnetRes(parsedOutput, context); + case "SecurityGroupLimitExceeded": + case "com.amazonaws.efs#SecurityGroupLimitExceeded": + throw await de_SecurityGroupLimitExceededRes(parsedOutput, context); + case "SecurityGroupNotFound": + case "com.amazonaws.efs#SecurityGroupNotFound": + throw await de_SecurityGroupNotFoundRes(parsedOutput, context); + case "SubnetNotFound": + case "com.amazonaws.efs#SubnetNotFound": + throw await de_SubnetNotFoundRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.efs#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ReplicationNotFound": + case "com.amazonaws.efs#ReplicationNotFound": + throw await de_ReplicationNotFoundRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.efs#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "AccessPointNotFound": + case "com.amazonaws.efs#AccessPointNotFound": + throw await de_AccessPointNotFoundRes(parsedOutput, context); + case "FileSystemInUse": + case "com.amazonaws.efs#FileSystemInUse": + throw await de_FileSystemInUseRes(parsedOutput, context); + case "DependencyTimeout": + case "com.amazonaws.efs#DependencyTimeout": + throw await de_DependencyTimeoutRes(parsedOutput, context); + case "MountTargetNotFound": + case "com.amazonaws.efs#MountTargetNotFound": + throw await de_MountTargetNotFoundRes(parsedOutput, context); + case "PolicyNotFound": + case "com.amazonaws.efs#PolicyNotFound": + throw await de_PolicyNotFoundRes(parsedOutput, context); + case "IncorrectMountTargetState": + case "com.amazonaws.efs#IncorrectMountTargetState": + throw await de_IncorrectMountTargetStateRes(parsedOutput, context); + case "InvalidPolicyException": + case "com.amazonaws.efs#InvalidPolicyException": + throw await de_InvalidPolicyExceptionRes(parsedOutput, context); case "TooManyRequests": case "com.amazonaws.efs#TooManyRequests": throw await de_TooManyRequestsRes(parsedOutput, context); + case "ReplicationAlreadyExists": + case "com.amazonaws.efs#ReplicationAlreadyExists": + throw await de_ReplicationAlreadyExistsRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-eks-auth/src/protocols/Aws_restJson1.ts b/clients/client-eks-auth/src/protocols/Aws_restJson1.ts index 83050e71c556..43ae1e8a75fd 100644 --- a/clients/client-eks-auth/src/protocols/Aws_restJson1.ts +++ b/clients/client-eks-auth/src/protocols/Aws_restJson1.ts @@ -70,7 +70,7 @@ export const de_AssumeRoleForPodIdentityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssumeRoleForPodIdentityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -88,12 +88,9 @@ export const de_AssumeRoleForPodIdentityCommand = async ( }; /** - * deserializeAws_restJson1AssumeRoleForPodIdentityCommandError + * deserialize_Aws_restJson1CommandError */ -const de_AssumeRoleForPodIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -133,7 +130,7 @@ const de_AssumeRoleForPodIdentityCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-eks/src/protocols/Aws_restJson1.ts b/clients/client-eks/src/protocols/Aws_restJson1.ts index 9e031af828a5..0a7c0d5299f2 100644 --- a/clients/client-eks/src/protocols/Aws_restJson1.ts +++ b/clients/client-eks/src/protocols/Aws_restJson1.ts @@ -1467,7 +1467,7 @@ export const de_AssociateAccessPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateAccessPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1482,41 +1482,6 @@ export const de_AssociateAccessPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateAccessPolicyCommandError - */ -const de_AssociateAccessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateEncryptionConfigCommand */ @@ -1525,7 +1490,7 @@ export const de_AssociateEncryptionConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateEncryptionConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1538,47 +1503,6 @@ export const de_AssociateEncryptionConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateEncryptionConfigCommandError - */ -const de_AssociateEncryptionConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateIdentityProviderConfigCommand */ @@ -1587,7 +1511,7 @@ export const de_AssociateIdentityProviderConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateIdentityProviderConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1601,47 +1525,6 @@ export const de_AssociateIdentityProviderConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateIdentityProviderConfigCommandError - */ -const de_AssociateIdentityProviderConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAccessEntryCommand */ @@ -1650,7 +1533,7 @@ export const de_CreateAccessEntryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAccessEntryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1663,47 +1546,6 @@ export const de_CreateAccessEntryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAccessEntryCommandError - */ -const de_CreateAccessEntryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.eks#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAddonCommand */ @@ -1712,7 +1554,7 @@ export const de_CreateAddonCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAddonCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1726,1048 +1568,262 @@ export const de_CreateAddonCommand = async ( }; /** - * deserializeAws_restJson1CreateAddonCommandError + * deserializeAws_restJson1CreateClusterCommand */ -const de_CreateAddonCommandError = async ( +export const de_CreateClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + cluster: (_) => de_Cluster(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateClusterCommand + * deserializeAws_restJson1CreateEksAnywhereSubscriptionCommand */ -export const de_CreateClusterCommand = async ( +export const de_CreateEksAnywhereSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - cluster: (_) => de_Cluster(_, context), + subscription: (_) => de_EksAnywhereSubscription(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateClusterCommandError + * deserializeAws_restJson1CreateFargateProfileCommand */ -const de_CreateClusterCommandError = async ( +export const de_CreateFargateProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.eks#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.eks#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnsupportedAvailabilityZoneException": - case "com.amazonaws.eks#UnsupportedAvailabilityZoneException": - throw await de_UnsupportedAvailabilityZoneExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + fargateProfile: (_) => de_FargateProfile(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateEksAnywhereSubscriptionCommand + * deserializeAws_restJson1CreateNodegroupCommand */ -export const de_CreateEksAnywhereSubscriptionCommand = async ( +export const de_CreateNodegroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEksAnywhereSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - subscription: (_) => de_EksAnywhereSubscription(_, context), + nodegroup: (_) => de_Nodegroup(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateEksAnywhereSubscriptionCommandError + * deserializeAws_restJson1CreatePodIdentityAssociationCommand */ -const de_CreateEksAnywhereSubscriptionCommandError = async ( +export const de_CreatePodIdentityAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.eks#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.eks#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateFargateProfileCommand - */ -export const de_CreateFargateProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFargateProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - fargateProfile: (_) => de_FargateProfile(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateFargateProfileCommandError - */ -const de_CreateFargateProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.eks#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "UnsupportedAvailabilityZoneException": - case "com.amazonaws.eks#UnsupportedAvailabilityZoneException": - throw await de_UnsupportedAvailabilityZoneExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateNodegroupCommand - */ -export const de_CreateNodegroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateNodegroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nodegroup: (_) => de_Nodegroup(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateNodegroupCommandError - */ -const de_CreateNodegroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.eks#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.eks#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreatePodIdentityAssociationCommand - */ -export const de_CreatePodIdentityAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePodIdentityAssociationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - association: (_) => de_PodIdentityAssociation(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreatePodIdentityAssociationCommandError - */ -const de_CreatePodIdentityAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.eks#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAccessEntryCommand - */ -export const de_DeleteAccessEntryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAccessEntryCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteAccessEntryCommandError - */ -const de_DeleteAccessEntryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAddonCommand - */ -export const de_DeleteAddonCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAddonCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - addon: (_) => de_Addon(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteAddonCommandError - */ -const de_DeleteAddonCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteClusterCommand - */ -export const de_DeleteClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteClusterCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - cluster: (_) => de_Cluster(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteClusterCommandError - */ -const de_DeleteClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.eks#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteEksAnywhereSubscriptionCommand - */ -export const de_DeleteEksAnywhereSubscriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEksAnywhereSubscriptionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - subscription: (_) => de_EksAnywhereSubscription(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteEksAnywhereSubscriptionCommandError - */ -const de_DeleteEksAnywhereSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteFargateProfileCommand - */ -export const de_DeleteFargateProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFargateProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - fargateProfile: (_) => de_FargateProfile(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteFargateProfileCommandError - */ -const de_DeleteFargateProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteNodegroupCommand - */ -export const de_DeleteNodegroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteNodegroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nodegroup: (_) => de_Nodegroup(_, context), + association: (_) => de_PodIdentityAssociation(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteNodegroupCommandError - */ -const de_DeleteNodegroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.eks#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePodIdentityAssociationCommand + * deserializeAws_restJson1DeleteAccessEntryCommand */ -export const de_DeletePodIdentityAssociationCommand = async ( +export const de_DeleteAccessEntryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePodIdentityAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - association: (_) => de_PodIdentityAssociation(_, context), - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1DeletePodIdentityAssociationCommandError - */ -const de_DeletePodIdentityAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeregisterClusterCommand + * deserializeAws_restJson1DeleteAddonCommand */ -export const de_DeregisterClusterCommand = async ( +export const de_DeleteAddonCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeregisterClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - cluster: (_) => de_Cluster(_, context), + addon: (_) => de_Addon(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeregisterClusterCommandError - */ -const de_DeregisterClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.eks#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.eks#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAccessEntryCommand + * deserializeAws_restJson1DeleteClusterCommand */ -export const de_DescribeAccessEntryCommand = async ( +export const de_DeleteClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAccessEntryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - accessEntry: (_) => de_AccessEntry(_, context), + cluster: (_) => de_Cluster(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeAccessEntryCommandError - */ -const de_DescribeAccessEntryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAddonCommand + * deserializeAws_restJson1DeleteEksAnywhereSubscriptionCommand */ -export const de_DescribeAddonCommand = async ( +export const de_DeleteEksAnywhereSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAddonCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - addon: (_) => de_Addon(_, context), + subscription: (_) => de_EksAnywhereSubscription(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeAddonCommandError - */ -const de_DescribeAddonCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAddonConfigurationCommand + * deserializeAws_restJson1DeleteFargateProfileCommand */ -export const de_DescribeAddonConfigurationCommand = async ( +export const de_DeleteFargateProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAddonConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - addonName: __expectString, - addonVersion: __expectString, - configurationSchema: __expectString, + fargateProfile: (_) => de_FargateProfile(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeAddonConfigurationCommandError - */ -const de_DescribeAddonConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAddonVersionsCommand + * deserializeAws_restJson1DeleteNodegroupCommand */ -export const de_DescribeAddonVersionsCommand = async ( +export const de_DeleteNodegroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAddonVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - addons: _json, - nextToken: __expectString, + nodegroup: (_) => de_Nodegroup(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeAddonVersionsCommandError + * deserializeAws_restJson1DeletePodIdentityAssociationCommand */ -const de_DescribeAddonVersionsCommandError = async ( +export const de_DeletePodIdentityAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + association: (_) => de_PodIdentityAssociation(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeClusterCommand + * deserializeAws_restJson1DeregisterClusterCommand */ -export const de_DescribeClusterCommand = async ( +export const de_DeregisterClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2781,265 +1837,195 @@ export const de_DescribeClusterCommand = async ( }; /** - * deserializeAws_restJson1DescribeClusterCommandError + * deserializeAws_restJson1DescribeAccessEntryCommand */ -const de_DescribeClusterCommandError = async ( +export const de_DescribeAccessEntryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.eks#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + accessEntry: (_) => de_AccessEntry(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeEksAnywhereSubscriptionCommand + * deserializeAws_restJson1DescribeAddonCommand */ -export const de_DescribeEksAnywhereSubscriptionCommand = async ( +export const de_DescribeAddonCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeEksAnywhereSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - subscription: (_) => de_EksAnywhereSubscription(_, context), + addon: (_) => de_Addon(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeEksAnywhereSubscriptionCommandError + * deserializeAws_restJson1DescribeAddonConfigurationCommand */ -const de_DescribeEksAnywhereSubscriptionCommandError = async ( +export const de_DescribeAddonConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.eks#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + addonName: __expectString, + addonVersion: __expectString, + configurationSchema: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeFargateProfileCommand + * deserializeAws_restJson1DescribeAddonVersionsCommand */ -export const de_DescribeFargateProfileCommand = async ( +export const de_DescribeAddonVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFargateProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - fargateProfile: (_) => de_FargateProfile(_, context), + addons: _json, + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeFargateProfileCommandError + * deserializeAws_restJson1DescribeClusterCommand */ -const de_DescribeFargateProfileCommandError = async ( +export const de_DescribeClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + cluster: (_) => de_Cluster(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeIdentityProviderConfigCommand + * deserializeAws_restJson1DescribeEksAnywhereSubscriptionCommand */ -export const de_DescribeIdentityProviderConfigCommand = async ( +export const de_DescribeEksAnywhereSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeIdentityProviderConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - identityProviderConfig: _json, + subscription: (_) => de_EksAnywhereSubscription(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeIdentityProviderConfigCommandError + * deserializeAws_restJson1DescribeFargateProfileCommand */ -const de_DescribeIdentityProviderConfigCommandError = async ( +export const de_DescribeFargateProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.eks#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + fargateProfile: (_) => de_FargateProfile(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeInsightCommand + * deserializeAws_restJson1DescribeIdentityProviderConfigCommand */ -export const de_DescribeInsightCommand = async ( +export const de_DescribeIdentityProviderConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeInsightCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - insight: (_) => de_Insight(_, context), + identityProviderConfig: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeInsightCommandError + * deserializeAws_restJson1DescribeInsightCommand */ -const de_DescribeInsightCommandError = async ( +export const de_DescribeInsightCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + insight: (_) => de_Insight(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3050,7 +2036,7 @@ export const de_DescribeNodegroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeNodegroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3063,44 +2049,6 @@ export const de_DescribeNodegroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeNodegroupCommandError - */ -const de_DescribeNodegroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.eks#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribePodIdentityAssociationCommand */ @@ -3109,7 +2057,7 @@ export const de_DescribePodIdentityAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePodIdentityAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3122,41 +2070,6 @@ export const de_DescribePodIdentityAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribePodIdentityAssociationCommandError - */ -const de_DescribePodIdentityAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeUpdateCommand */ @@ -3165,7 +2078,7 @@ export const de_DescribeUpdateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeUpdateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3178,41 +2091,6 @@ export const de_DescribeUpdateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeUpdateCommandError - */ -const de_DescribeUpdateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateAccessPolicyCommand */ @@ -3221,7 +2099,7 @@ export const de_DisassociateAccessPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateAccessPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3230,38 +2108,6 @@ export const de_DisassociateAccessPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateAccessPolicyCommandError - */ -const de_DisassociateAccessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateIdentityProviderConfigCommand */ @@ -3270,7 +2116,7 @@ export const de_DisassociateIdentityProviderConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateIdentityProviderConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3283,47 +2129,6 @@ export const de_DisassociateIdentityProviderConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateIdentityProviderConfigCommandError - */ -const de_DisassociateIdentityProviderConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAccessEntriesCommand */ @@ -3332,7 +2137,7 @@ export const de_ListAccessEntriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccessEntriesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3340,45 +2145,10 @@ export const de_ListAccessEntriesCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { accessEntries: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAccessEntriesCommandError - */ -const de_ListAccessEntriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3389,7 +2159,7 @@ export const de_ListAccessPoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccessPoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3403,32 +2173,6 @@ export const de_ListAccessPoliciesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAccessPoliciesCommandError - */ -const de_ListAccessPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAddonsCommand */ @@ -3437,7 +2181,7 @@ export const de_ListAddonsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAddonsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3451,44 +2195,6 @@ export const de_ListAddonsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAddonsCommandError - */ -const de_ListAddonsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssociatedAccessPoliciesCommand */ @@ -3497,7 +2203,7 @@ export const de_ListAssociatedAccessPoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssociatedAccessPoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3513,38 +2219,6 @@ export const de_ListAssociatedAccessPoliciesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssociatedAccessPoliciesCommandError - */ -const de_ListAssociatedAccessPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListClustersCommand */ @@ -3553,7 +2227,7 @@ export const de_ListClustersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListClustersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3567,41 +2241,6 @@ export const de_ListClustersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListClustersCommandError - */ -const de_ListClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.eks#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEksAnywhereSubscriptionsCommand */ @@ -3610,7 +2249,7 @@ export const de_ListEksAnywhereSubscriptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEksAnywhereSubscriptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3624,41 +2263,6 @@ export const de_ListEksAnywhereSubscriptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEksAnywhereSubscriptionsCommandError - */ -const de_ListEksAnywhereSubscriptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.eks#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListFargateProfilesCommand */ @@ -3667,7 +2271,7 @@ export const de_ListFargateProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFargateProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3681,41 +2285,6 @@ export const de_ListFargateProfilesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFargateProfilesCommandError - */ -const de_ListFargateProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIdentityProviderConfigsCommand */ @@ -3724,7 +2293,7 @@ export const de_ListIdentityProviderConfigsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIdentityProviderConfigsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3738,44 +2307,6 @@ export const de_ListIdentityProviderConfigsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListIdentityProviderConfigsCommandError - */ -const de_ListIdentityProviderConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.eks#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListInsightsCommand */ @@ -3784,7 +2315,7 @@ export const de_ListInsightsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInsightsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3794,43 +2325,8 @@ export const de_ListInsightsCommand = async ( insights: (_) => de_InsightSummaries(_, context), nextToken: __expectString, }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListInsightsCommandError - */ -const de_ListInsightsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Object.assign(contents, doc); + return contents; }; /** @@ -3841,7 +2337,7 @@ export const de_ListNodegroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNodegroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3855,44 +2351,6 @@ export const de_ListNodegroupsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListNodegroupsCommandError - */ -const de_ListNodegroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.eks#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPodIdentityAssociationsCommand */ @@ -3901,7 +2359,7 @@ export const de_ListPodIdentityAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPodIdentityAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3915,41 +2373,6 @@ export const de_ListPodIdentityAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListPodIdentityAssociationsCommandError - */ -const de_ListPodIdentityAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -3958,7 +2381,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3971,35 +2394,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.eks#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.eks#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListUpdatesCommand */ @@ -4008,7 +2402,7 @@ export const de_ListUpdatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUpdatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4022,41 +2416,6 @@ export const de_ListUpdatesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListUpdatesCommandError - */ -const de_ListUpdatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RegisterClusterCommand */ @@ -4065,7 +2424,7 @@ export const de_RegisterClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4078,53 +2437,6 @@ export const de_RegisterClusterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RegisterClusterCommandError - */ -const de_RegisterClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.eks#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.eks#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourcePropagationDelayException": - case "com.amazonaws.eks#ResourcePropagationDelayException": - throw await de_ResourcePropagationDelayExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.eks#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -4133,7 +2445,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4142,35 +2454,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.eks#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.eks#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -4179,7 +2462,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4188,35 +2471,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.eks#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.eks#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAccessEntryCommand */ @@ -4225,7 +2479,7 @@ export const de_UpdateAccessEntryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAccessEntryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4235,42 +2489,7 @@ export const de_UpdateAccessEntryCommand = async ( accessEntry: (_) => de_AccessEntry(_, context), }); Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateAccessEntryCommandError - */ -const de_UpdateAccessEntryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return contents; }; /** @@ -4281,7 +2500,7 @@ export const de_UpdateAddonCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAddonCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4294,47 +2513,6 @@ export const de_UpdateAddonCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAddonCommandError - */ -const de_UpdateAddonCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateClusterConfigCommand */ @@ -4343,7 +2521,7 @@ export const de_UpdateClusterConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateClusterConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4356,47 +2534,6 @@ export const de_UpdateClusterConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateClusterConfigCommandError - */ -const de_UpdateClusterConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateClusterVersionCommand */ @@ -4405,7 +2542,7 @@ export const de_UpdateClusterVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateClusterVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4418,47 +2555,6 @@ export const de_UpdateClusterVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateClusterVersionCommandError - */ -const de_UpdateClusterVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEksAnywhereSubscriptionCommand */ @@ -4467,7 +2563,7 @@ export const de_UpdateEksAnywhereSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEksAnywhereSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4480,44 +2576,6 @@ export const de_UpdateEksAnywhereSubscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEksAnywhereSubscriptionCommandError - */ -const de_UpdateEksAnywhereSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateNodegroupConfigCommand */ @@ -4526,7 +2584,7 @@ export const de_UpdateNodegroupConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateNodegroupConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4539,47 +2597,6 @@ export const de_UpdateNodegroupConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateNodegroupConfigCommandError - */ -const de_UpdateNodegroupConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateNodegroupVersionCommand */ @@ -4588,7 +2605,7 @@ export const de_UpdateNodegroupVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateNodegroupVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4601,47 +2618,6 @@ export const de_UpdateNodegroupVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateNodegroupVersionCommandError - */ -const de_UpdateNodegroupVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.eks#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.eks#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.eks#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.eks#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerException": - case "com.amazonaws.eks#ServerException": - throw await de_ServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePodIdentityAssociationCommand */ @@ -4650,7 +2626,7 @@ export const de_UpdatePodIdentityAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePodIdentityAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4664,12 +2640,9 @@ export const de_UpdatePodIdentityAssociationCommand = async ( }; /** - * deserializeAws_restJson1UpdatePodIdentityAssociationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdatePodIdentityAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4688,13 +2661,40 @@ const de_UpdatePodIdentityAssociationCommandError = async ( case "ServerException": case "com.amazonaws.eks#ServerException": throw await de_ServerExceptionRes(parsedOutput, context); + case "ClientException": + case "com.amazonaws.eks#ClientException": + throw await de_ClientExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.eks#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); + case "ResourceLimitExceededException": + case "com.amazonaws.eks#ResourceLimitExceededException": + throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.eks#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "UnsupportedAvailabilityZoneException": + case "com.amazonaws.eks#UnsupportedAvailabilityZoneException": + throw await de_UnsupportedAvailabilityZoneExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.eks#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "BadRequestException": + case "com.amazonaws.eks#BadRequestException": + throw await de_BadRequestExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.eks#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); + case "ResourcePropagationDelayException": + case "com.amazonaws.eks#ResourcePropagationDelayException": + throw await de_ResourcePropagationDelayExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts b/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts index 1ea3b85195f3..36766df60198 100644 --- a/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts +++ b/clients/client-elastic-beanstalk/src/protocols/Aws_query.ts @@ -1139,7 +1139,7 @@ export const de_AbortEnvironmentUpdateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AbortEnvironmentUpdateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AbortEnvironmentUpdateCommandOutput = { @@ -1148,32 +1148,6 @@ export const de_AbortEnvironmentUpdateCommand = async ( return response; }; -/** - * deserializeAws_queryAbortEnvironmentUpdateCommandError - */ -const de_AbortEnvironmentUpdateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryApplyEnvironmentManagedActionCommand */ @@ -1182,7 +1156,7 @@ export const de_ApplyEnvironmentManagedActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ApplyEnvironmentManagedActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1194,35 +1168,6 @@ export const de_ApplyEnvironmentManagedActionCommand = async ( return response; }; -/** - * deserializeAws_queryApplyEnvironmentManagedActionCommandError - */ -const de_ApplyEnvironmentManagedActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ElasticBeanstalkServiceException": - case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException": - throw await de_ElasticBeanstalkServiceExceptionRes(parsedOutput, context); - case "ManagedActionInvalidStateException": - case "com.amazonaws.elasticbeanstalk#ManagedActionInvalidStateException": - throw await de_ManagedActionInvalidStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAssociateEnvironmentOperationsRoleCommand */ @@ -1231,7 +1176,7 @@ export const de_AssociateEnvironmentOperationsRoleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateEnvironmentOperationsRoleCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AssociateEnvironmentOperationsRoleCommandOutput = { @@ -1240,32 +1185,6 @@ export const de_AssociateEnvironmentOperationsRoleCommand = async ( return response; }; -/** - * deserializeAws_queryAssociateEnvironmentOperationsRoleCommandError - */ -const de_AssociateEnvironmentOperationsRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCheckDNSAvailabilityCommand */ @@ -1274,7 +1193,7 @@ export const de_CheckDNSAvailabilityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CheckDNSAvailabilityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1286,26 +1205,6 @@ export const de_CheckDNSAvailabilityCommand = async ( return response; }; -/** - * deserializeAws_queryCheckDNSAvailabilityCommandError - */ -const de_CheckDNSAvailabilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryComposeEnvironmentsCommand */ @@ -1314,7 +1213,7 @@ export const de_ComposeEnvironmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ComposeEnvironmentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1326,35 +1225,6 @@ export const de_ComposeEnvironmentsCommand = async ( return response; }; -/** - * deserializeAws_queryComposeEnvironmentsCommandError - */ -const de_ComposeEnvironmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - case "TooManyEnvironmentsException": - case "com.amazonaws.elasticbeanstalk#TooManyEnvironmentsException": - throw await de_TooManyEnvironmentsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateApplicationCommand */ @@ -1363,7 +1233,7 @@ export const de_CreateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1375,32 +1245,6 @@ export const de_CreateApplicationCommand = async ( return response; }; -/** - * deserializeAws_queryCreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "TooManyApplicationsException": - case "com.amazonaws.elasticbeanstalk#TooManyApplicationsException": - throw await de_TooManyApplicationsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateApplicationVersionCommand */ @@ -1409,7 +1253,7 @@ export const de_CreateApplicationVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateApplicationVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1421,44 +1265,6 @@ export const de_CreateApplicationVersionCommand = async ( return response; }; -/** - * deserializeAws_queryCreateApplicationVersionCommandError - */ -const de_CreateApplicationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeBuildNotInServiceRegionException": - case "com.amazonaws.elasticbeanstalk#CodeBuildNotInServiceRegionException": - throw await de_CodeBuildNotInServiceRegionExceptionRes(parsedOutput, context); - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - case "S3LocationNotInServiceRegionException": - case "com.amazonaws.elasticbeanstalk#S3LocationNotInServiceRegionException": - throw await de_S3LocationNotInServiceRegionExceptionRes(parsedOutput, context); - case "TooManyApplicationVersionsException": - case "com.amazonaws.elasticbeanstalk#TooManyApplicationVersionsException": - throw await de_TooManyApplicationVersionsExceptionRes(parsedOutput, context); - case "TooManyApplicationsException": - case "com.amazonaws.elasticbeanstalk#TooManyApplicationsException": - throw await de_TooManyApplicationsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateConfigurationTemplateCommand */ @@ -1467,7 +1273,7 @@ export const de_CreateConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateConfigurationTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1479,38 +1285,6 @@ export const de_CreateConfigurationTemplateCommand = async ( return response; }; -/** - * deserializeAws_queryCreateConfigurationTemplateCommandError - */ -const de_CreateConfigurationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - case "TooManyBucketsException": - case "com.amazonaws.elasticbeanstalk#TooManyBucketsException": - throw await de_TooManyBucketsExceptionRes(parsedOutput, context); - case "TooManyConfigurationTemplatesException": - case "com.amazonaws.elasticbeanstalk#TooManyConfigurationTemplatesException": - throw await de_TooManyConfigurationTemplatesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateEnvironmentCommand */ @@ -1519,7 +1293,7 @@ export const de_CreateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1532,48 +1306,39 @@ export const de_CreateEnvironmentCommand = async ( }; /** - * deserializeAws_queryCreateEnvironmentCommandError + * deserializeAws_queryCreatePlatformVersionCommand */ -const de_CreateEnvironmentCommandError = async ( +export const de_CreatePlatformVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - case "TooManyEnvironmentsException": - case "com.amazonaws.elasticbeanstalk#TooManyEnvironmentsException": - throw await de_TooManyEnvironmentsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreatePlatformVersionResult(data.CreatePlatformVersionResult, context); + const response: CreatePlatformVersionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreatePlatformVersionCommand + * deserializeAws_queryCreateStorageLocationCommand */ -export const de_CreatePlatformVersionCommand = async ( +export const de_CreateStorageLocationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreatePlatformVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreatePlatformVersionResult(data.CreatePlatformVersionResult, context); - const response: CreatePlatformVersionCommandOutput = { + contents = de_CreateStorageLocationResultMessage(data.CreateStorageLocationResult, context); + const response: CreateStorageLocationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1581,98 +1346,14 @@ export const de_CreatePlatformVersionCommand = async ( }; /** - * deserializeAws_queryCreatePlatformVersionCommandError + * deserializeAws_queryDeleteApplicationCommand */ -const de_CreatePlatformVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ElasticBeanstalkServiceException": - case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException": - throw await de_ElasticBeanstalkServiceExceptionRes(parsedOutput, context); - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - case "TooManyPlatformsException": - case "com.amazonaws.elasticbeanstalk#TooManyPlatformsException": - throw await de_TooManyPlatformsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryCreateStorageLocationCommand - */ -export const de_CreateStorageLocationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateStorageLocationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateStorageLocationResultMessage(data.CreateStorageLocationResult, context); - const response: CreateStorageLocationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryCreateStorageLocationCommandError - */ -const de_CreateStorageLocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - case "S3SubscriptionRequiredException": - case "com.amazonaws.elasticbeanstalk#S3SubscriptionRequiredException": - throw await de_S3SubscriptionRequiredExceptionRes(parsedOutput, context); - case "TooManyBucketsException": - case "com.amazonaws.elasticbeanstalk#TooManyBucketsException": - throw await de_TooManyBucketsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteApplicationCommand - */ -export const de_DeleteApplicationCommand = async ( +export const de_DeleteApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteApplicationCommandOutput = { @@ -1681,32 +1362,6 @@ export const de_DeleteApplicationCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteApplicationCommandError - */ -const de_DeleteApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationInProgressFailure": - case "com.amazonaws.elasticbeanstalk#OperationInProgressException": - throw await de_OperationInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteApplicationVersionCommand */ @@ -1715,7 +1370,7 @@ export const de_DeleteApplicationVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationVersionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteApplicationVersionCommandOutput = { @@ -1724,41 +1379,6 @@ export const de_DeleteApplicationVersionCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteApplicationVersionCommandError - */ -const de_DeleteApplicationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - case "OperationInProgressFailure": - case "com.amazonaws.elasticbeanstalk#OperationInProgressException": - throw await de_OperationInProgressExceptionRes(parsedOutput, context); - case "S3LocationNotInServiceRegionException": - case "com.amazonaws.elasticbeanstalk#S3LocationNotInServiceRegionException": - throw await de_S3LocationNotInServiceRegionExceptionRes(parsedOutput, context); - case "SourceBundleDeletionFailure": - case "com.amazonaws.elasticbeanstalk#SourceBundleDeletionException": - throw await de_SourceBundleDeletionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteConfigurationTemplateCommand */ @@ -1767,7 +1387,7 @@ export const de_DeleteConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteConfigurationTemplateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteConfigurationTemplateCommandOutput = { @@ -1776,32 +1396,6 @@ export const de_DeleteConfigurationTemplateCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteConfigurationTemplateCommandError - */ -const de_DeleteConfigurationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationInProgressFailure": - case "com.amazonaws.elasticbeanstalk#OperationInProgressException": - throw await de_OperationInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteEnvironmentConfigurationCommand */ @@ -1810,7 +1404,7 @@ export const de_DeleteEnvironmentConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEnvironmentConfigurationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteEnvironmentConfigurationCommandOutput = { @@ -1819,26 +1413,6 @@ export const de_DeleteEnvironmentConfigurationCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteEnvironmentConfigurationCommandError - */ -const de_DeleteEnvironmentConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDeletePlatformVersionCommand */ @@ -1847,7 +1421,7 @@ export const de_DeletePlatformVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePlatformVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1859,41 +1433,6 @@ export const de_DeletePlatformVersionCommand = async ( return response; }; -/** - * deserializeAws_queryDeletePlatformVersionCommandError - */ -const de_DeletePlatformVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ElasticBeanstalkServiceException": - case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException": - throw await de_ElasticBeanstalkServiceExceptionRes(parsedOutput, context); - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - case "OperationInProgressFailure": - case "com.amazonaws.elasticbeanstalk#OperationInProgressException": - throw await de_OperationInProgressExceptionRes(parsedOutput, context); - case "PlatformVersionStillReferencedException": - case "com.amazonaws.elasticbeanstalk#PlatformVersionStillReferencedException": - throw await de_PlatformVersionStillReferencedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeAccountAttributesCommand */ @@ -1902,7 +1441,7 @@ export const de_DescribeAccountAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAccountAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1914,32 +1453,6 @@ export const de_DescribeAccountAttributesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeAccountAttributesCommandError - */ -const de_DescribeAccountAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeApplicationsCommand */ @@ -1948,7 +1461,7 @@ export const de_DescribeApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeApplicationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1960,26 +1473,6 @@ export const de_DescribeApplicationsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeApplicationsCommandError - */ -const de_DescribeApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeApplicationVersionsCommand */ @@ -1988,7 +1481,7 @@ export const de_DescribeApplicationVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeApplicationVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2000,26 +1493,6 @@ export const de_DescribeApplicationVersionsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeApplicationVersionsCommandError - */ -const de_DescribeApplicationVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeConfigurationOptionsCommand */ @@ -2028,7 +1501,7 @@ export const de_DescribeConfigurationOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConfigurationOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2040,32 +1513,6 @@ export const de_DescribeConfigurationOptionsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeConfigurationOptionsCommandError - */ -const de_DescribeConfigurationOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "TooManyBucketsException": - case "com.amazonaws.elasticbeanstalk#TooManyBucketsException": - throw await de_TooManyBucketsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeConfigurationSettingsCommand */ @@ -2074,7 +1521,7 @@ export const de_DescribeConfigurationSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConfigurationSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2086,32 +1533,6 @@ export const de_DescribeConfigurationSettingsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeConfigurationSettingsCommandError - */ -const de_DescribeConfigurationSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "TooManyBucketsException": - case "com.amazonaws.elasticbeanstalk#TooManyBucketsException": - throw await de_TooManyBucketsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeEnvironmentHealthCommand */ @@ -2120,7 +1541,7 @@ export const de_DescribeEnvironmentHealthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEnvironmentHealthCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2132,35 +1553,6 @@ export const de_DescribeEnvironmentHealthCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeEnvironmentHealthCommandError - */ -const de_DescribeEnvironmentHealthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ElasticBeanstalkServiceException": - case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException": - throw await de_ElasticBeanstalkServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.elasticbeanstalk#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeEnvironmentManagedActionHistoryCommand */ @@ -2169,7 +1561,7 @@ export const de_DescribeEnvironmentManagedActionHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEnvironmentManagedActionHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2184,32 +1576,6 @@ export const de_DescribeEnvironmentManagedActionHistoryCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeEnvironmentManagedActionHistoryCommandError - */ -const de_DescribeEnvironmentManagedActionHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ElasticBeanstalkServiceException": - case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException": - throw await de_ElasticBeanstalkServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeEnvironmentManagedActionsCommand */ @@ -2218,104 +1584,32 @@ export const de_DescribeEnvironmentManagedActionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEnvironmentManagedActionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_DescribeEnvironmentManagedActionsResult(data.DescribeEnvironmentManagedActionsResult, context); - const response: DescribeEnvironmentManagedActionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeEnvironmentManagedActionsCommandError - */ -const de_DescribeEnvironmentManagedActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ElasticBeanstalkServiceException": - case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException": - throw await de_ElasticBeanstalkServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeEnvironmentResourcesCommand - */ -export const de_DescribeEnvironmentResourcesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeEnvironmentResourcesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_EnvironmentResourceDescriptionsMessage(data.DescribeEnvironmentResourcesResult, context); - const response: DescribeEnvironmentResourcesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeEnvironmentResourcesCommandError - */ -const de_DescribeEnvironmentResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + const response: DescribeEnvironmentManagedActionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeEnvironmentsCommand + * deserializeAws_queryDescribeEnvironmentResourcesCommand */ -export const de_DescribeEnvironmentsCommand = async ( +export const de_DescribeEnvironmentResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEnvironmentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_EnvironmentDescriptionsMessage(data.DescribeEnvironmentsResult, context); - const response: DescribeEnvironmentsCommandOutput = { + contents = de_EnvironmentResourceDescriptionsMessage(data.DescribeEnvironmentResourcesResult, context); + const response: DescribeEnvironmentResourcesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2323,23 +1617,23 @@ export const de_DescribeEnvironmentsCommand = async ( }; /** - * deserializeAws_queryDescribeEnvironmentsCommandError + * deserializeAws_queryDescribeEnvironmentsCommand */ -const de_DescribeEnvironmentsCommandError = async ( +export const de_DescribeEnvironmentsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EnvironmentDescriptionsMessage(data.DescribeEnvironmentsResult, context); + const response: DescribeEnvironmentsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** @@ -2350,7 +1644,7 @@ export const de_DescribeEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2362,26 +1656,6 @@ export const de_DescribeEventsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeEventsCommandError - */ -const de_DescribeEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeInstancesHealthCommand */ @@ -2390,7 +1664,7 @@ export const de_DescribeInstancesHealthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstancesHealthCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2402,35 +1676,6 @@ export const de_DescribeInstancesHealthCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeInstancesHealthCommandError - */ -const de_DescribeInstancesHealthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ElasticBeanstalkServiceException": - case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException": - throw await de_ElasticBeanstalkServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.elasticbeanstalk#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribePlatformVersionCommand */ @@ -2439,7 +1684,7 @@ export const de_DescribePlatformVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePlatformVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2451,35 +1696,6 @@ export const de_DescribePlatformVersionCommand = async ( return response; }; -/** - * deserializeAws_queryDescribePlatformVersionCommandError - */ -const de_DescribePlatformVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ElasticBeanstalkServiceException": - case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException": - throw await de_ElasticBeanstalkServiceExceptionRes(parsedOutput, context); - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDisassociateEnvironmentOperationsRoleCommand */ @@ -2488,7 +1704,7 @@ export const de_DisassociateEnvironmentOperationsRoleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateEnvironmentOperationsRoleCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DisassociateEnvironmentOperationsRoleCommandOutput = { @@ -2497,32 +1713,6 @@ export const de_DisassociateEnvironmentOperationsRoleCommand = async ( return response; }; -/** - * deserializeAws_queryDisassociateEnvironmentOperationsRoleCommandError - */ -const de_DisassociateEnvironmentOperationsRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryListAvailableSolutionStacksCommand */ @@ -2531,7 +1721,7 @@ export const de_ListAvailableSolutionStacksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAvailableSolutionStacksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2543,26 +1733,6 @@ export const de_ListAvailableSolutionStacksCommand = async ( return response; }; -/** - * deserializeAws_queryListAvailableSolutionStacksCommandError - */ -const de_ListAvailableSolutionStacksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListPlatformBranchesCommand */ @@ -2571,7 +1741,7 @@ export const de_ListPlatformBranchesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPlatformBranchesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2583,26 +1753,6 @@ export const de_ListPlatformBranchesCommand = async ( return response; }; -/** - * deserializeAws_queryListPlatformBranchesCommandError - */ -const de_ListPlatformBranchesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListPlatformVersionsCommand */ @@ -2611,7 +1761,7 @@ export const de_ListPlatformVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPlatformVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2623,35 +1773,6 @@ export const de_ListPlatformVersionsCommand = async ( return response; }; -/** - * deserializeAws_queryListPlatformVersionsCommandError - */ -const de_ListPlatformVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ElasticBeanstalkServiceException": - case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException": - throw await de_ElasticBeanstalkServiceExceptionRes(parsedOutput, context); - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryListTagsForResourceCommand */ @@ -2660,7 +1781,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2672,38 +1793,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_queryListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticbeanstalk#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceTypeNotSupportedException": - case "com.amazonaws.elasticbeanstalk#ResourceTypeNotSupportedException": - throw await de_ResourceTypeNotSupportedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryRebuildEnvironmentCommand */ @@ -2712,7 +1801,7 @@ export const de_RebuildEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RebuildEnvironmentCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RebuildEnvironmentCommandOutput = { @@ -2721,32 +1810,6 @@ export const de_RebuildEnvironmentCommand = async ( return response; }; -/** - * deserializeAws_queryRebuildEnvironmentCommandError - */ -const de_RebuildEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryRequestEnvironmentInfoCommand */ @@ -2755,7 +1818,7 @@ export const de_RequestEnvironmentInfoCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RequestEnvironmentInfoCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RequestEnvironmentInfoCommandOutput = { @@ -2764,26 +1827,6 @@ export const de_RequestEnvironmentInfoCommand = async ( return response; }; -/** - * deserializeAws_queryRequestEnvironmentInfoCommandError - */ -const de_RequestEnvironmentInfoCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryRestartAppServerCommand */ @@ -2791,34 +1834,14 @@ export const de_RestartAppServerCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - if (output.statusCode >= 300) { - return de_RestartAppServerCommandError(output, context); - } - await collectBody(output.body, context); - const response: RestartAppServerCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryRestartAppServerCommandError - */ -const de_RestartAppServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: RestartAppServerCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** @@ -2829,7 +1852,7 @@ export const de_RetrieveEnvironmentInfoCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RetrieveEnvironmentInfoCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2841,26 +1864,6 @@ export const de_RetrieveEnvironmentInfoCommand = async ( return response; }; -/** - * deserializeAws_queryRetrieveEnvironmentInfoCommandError - */ -const de_RetrieveEnvironmentInfoCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_querySwapEnvironmentCNAMEsCommand */ @@ -2869,7 +1872,7 @@ export const de_SwapEnvironmentCNAMEsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SwapEnvironmentCNAMEsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SwapEnvironmentCNAMEsCommandOutput = { @@ -2878,26 +1881,6 @@ export const de_SwapEnvironmentCNAMEsCommand = async ( return response; }; -/** - * deserializeAws_querySwapEnvironmentCNAMEsCommandError - */ -const de_SwapEnvironmentCNAMEsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryTerminateEnvironmentCommand */ @@ -2906,7 +1889,7 @@ export const de_TerminateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TerminateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2918,32 +1901,6 @@ export const de_TerminateEnvironmentCommand = async ( return response; }; -/** - * deserializeAws_queryTerminateEnvironmentCommandError - */ -const de_TerminateEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateApplicationCommand */ @@ -2952,7 +1909,7 @@ export const de_UpdateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2964,26 +1921,6 @@ export const de_UpdateApplicationCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateApplicationCommandError - */ -const de_UpdateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryUpdateApplicationResourceLifecycleCommand */ @@ -2992,7 +1929,7 @@ export const de_UpdateApplicationResourceLifecycleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateApplicationResourceLifecycleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3004,32 +1941,6 @@ export const de_UpdateApplicationResourceLifecycleCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateApplicationResourceLifecycleCommandError - */ -const de_UpdateApplicationResourceLifecycleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateApplicationVersionCommand */ @@ -3038,7 +1949,7 @@ export const de_UpdateApplicationVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateApplicationVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3050,26 +1961,6 @@ export const de_UpdateApplicationVersionCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateApplicationVersionCommandError - */ -const de_UpdateApplicationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryUpdateConfigurationTemplateCommand */ @@ -3078,7 +1969,7 @@ export const de_UpdateConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateConfigurationTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3090,35 +1981,6 @@ export const de_UpdateConfigurationTemplateCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateConfigurationTemplateCommandError - */ -const de_UpdateConfigurationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - case "TooManyBucketsException": - case "com.amazonaws.elasticbeanstalk#TooManyBucketsException": - throw await de_TooManyBucketsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateEnvironmentCommand */ @@ -3127,7 +1989,7 @@ export const de_UpdateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3139,35 +2001,6 @@ export const de_UpdateEnvironmentCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateEnvironmentCommandError - */ -const de_UpdateEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - case "TooManyBucketsException": - case "com.amazonaws.elasticbeanstalk#TooManyBucketsException": - throw await de_TooManyBucketsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateTagsForResourceCommand */ @@ -3176,7 +2009,7 @@ export const de_UpdateTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateTagsForResourceCommandOutput = { @@ -3185,44 +2018,6 @@ export const de_UpdateTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateTagsForResourceCommandError - */ -const de_UpdateTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientPrivilegesException": - case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": - throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); - case "OperationInProgressFailure": - case "com.amazonaws.elasticbeanstalk#OperationInProgressException": - throw await de_OperationInProgressExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticbeanstalk#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceTypeNotSupportedException": - case "com.amazonaws.elasticbeanstalk#ResourceTypeNotSupportedException": - throw await de_ResourceTypeNotSupportedExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.elasticbeanstalk#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryValidateConfigurationSettingsCommand */ @@ -3231,7 +2026,7 @@ export const de_ValidateConfigurationSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ValidateConfigurationSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3244,12 +2039,9 @@ export const de_ValidateConfigurationSettingsCommand = async ( }; /** - * deserializeAws_queryValidateConfigurationSettingsCommandError + * deserialize_Aws_queryCommandError */ -const de_ValidateConfigurationSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3259,16 +2051,67 @@ const de_ValidateConfigurationSettingsCommandError = async ( case "InsufficientPrivilegesException": case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException": throw await de_InsufficientPrivilegesExceptionRes(parsedOutput, context); + case "ElasticBeanstalkServiceException": + case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException": + throw await de_ElasticBeanstalkServiceExceptionRes(parsedOutput, context); + case "ManagedActionInvalidStateException": + case "com.amazonaws.elasticbeanstalk#ManagedActionInvalidStateException": + throw await de_ManagedActionInvalidStateExceptionRes(parsedOutput, context); + case "TooManyEnvironmentsException": + case "com.amazonaws.elasticbeanstalk#TooManyEnvironmentsException": + throw await de_TooManyEnvironmentsExceptionRes(parsedOutput, context); + case "TooManyApplicationsException": + case "com.amazonaws.elasticbeanstalk#TooManyApplicationsException": + throw await de_TooManyApplicationsExceptionRes(parsedOutput, context); + case "CodeBuildNotInServiceRegionException": + case "com.amazonaws.elasticbeanstalk#CodeBuildNotInServiceRegionException": + throw await de_CodeBuildNotInServiceRegionExceptionRes(parsedOutput, context); + case "S3LocationNotInServiceRegionException": + case "com.amazonaws.elasticbeanstalk#S3LocationNotInServiceRegionException": + throw await de_S3LocationNotInServiceRegionExceptionRes(parsedOutput, context); + case "TooManyApplicationVersionsException": + case "com.amazonaws.elasticbeanstalk#TooManyApplicationVersionsException": + throw await de_TooManyApplicationVersionsExceptionRes(parsedOutput, context); case "TooManyBucketsException": case "com.amazonaws.elasticbeanstalk#TooManyBucketsException": throw await de_TooManyBucketsExceptionRes(parsedOutput, context); + case "TooManyConfigurationTemplatesException": + case "com.amazonaws.elasticbeanstalk#TooManyConfigurationTemplatesException": + throw await de_TooManyConfigurationTemplatesExceptionRes(parsedOutput, context); + case "TooManyPlatformsException": + case "com.amazonaws.elasticbeanstalk#TooManyPlatformsException": + throw await de_TooManyPlatformsExceptionRes(parsedOutput, context); + case "S3SubscriptionRequiredException": + case "com.amazonaws.elasticbeanstalk#S3SubscriptionRequiredException": + throw await de_S3SubscriptionRequiredExceptionRes(parsedOutput, context); + case "OperationInProgressFailure": + case "com.amazonaws.elasticbeanstalk#OperationInProgressException": + throw await de_OperationInProgressExceptionRes(parsedOutput, context); + case "SourceBundleDeletionFailure": + case "com.amazonaws.elasticbeanstalk#SourceBundleDeletionException": + throw await de_SourceBundleDeletionExceptionRes(parsedOutput, context); + case "PlatformVersionStillReferencedException": + case "com.amazonaws.elasticbeanstalk#PlatformVersionStillReferencedException": + throw await de_PlatformVersionStillReferencedExceptionRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.elasticbeanstalk#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.elasticbeanstalk#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ResourceTypeNotSupportedException": + case "com.amazonaws.elasticbeanstalk#ResourceTypeNotSupportedException": + throw await de_ResourceTypeNotSupportedExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.elasticbeanstalk#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody: parsedBody.Error, errorCode, - }); + }) as never; } }; diff --git a/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts b/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts index 9021099e6fb2..90316aeb7843 100644 --- a/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts +++ b/clients/client-elastic-inference/src/protocols/Aws_restJson1.ts @@ -176,7 +176,7 @@ export const de_DescribeAcceleratorOfferingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAcceleratorOfferingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -189,38 +189,6 @@ export const de_DescribeAcceleratorOfferingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAcceleratorOfferingsCommandError - */ -const de_DescribeAcceleratorOfferingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.elasticinference#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.elasticinference#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticinference#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAcceleratorsCommand */ @@ -229,7 +197,7 @@ export const de_DescribeAcceleratorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAcceleratorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -243,38 +211,6 @@ export const de_DescribeAcceleratorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAcceleratorsCommandError - */ -const de_DescribeAcceleratorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.elasticinference#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.elasticinference#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticinference#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAcceleratorTypesCommand */ @@ -283,7 +219,7 @@ export const de_DescribeAcceleratorTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAcceleratorTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -296,32 +232,6 @@ export const de_DescribeAcceleratorTypesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAcceleratorTypesCommandError - */ -const de_DescribeAcceleratorTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.elasticinference#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -330,7 +240,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -343,38 +253,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.elasticinference#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.elasticinference#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticinference#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -383,7 +261,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -392,38 +270,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.elasticinference#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.elasticinference#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticinference#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -432,7 +278,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -442,12 +288,9 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -469,7 +312,7 @@ const de_UntagResourceCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts b/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts index dbaa31fef3bc..cb8352fd0e3f 100644 --- a/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts +++ b/clients/client-elastic-load-balancing-v2/src/protocols/Aws_query.ts @@ -1064,7 +1064,7 @@ export const de_AddListenerCertificatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddListenerCertificatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1076,38 +1076,6 @@ export const de_AddListenerCertificatesCommand = async ( return response; }; -/** - * deserializeAws_queryAddListenerCertificatesCommandError - */ -const de_AddListenerCertificatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateNotFound": - case "com.amazonaws.elasticloadbalancingv2#CertificateNotFoundException": - throw await de_CertificateNotFoundExceptionRes(parsedOutput, context); - case "ListenerNotFound": - case "com.amazonaws.elasticloadbalancingv2#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - case "TooManyCertificates": - case "com.amazonaws.elasticloadbalancingv2#TooManyCertificatesException": - throw await de_TooManyCertificatesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAddTagsCommand */ @@ -1116,7 +1084,7 @@ export const de_AddTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1128,50 +1096,6 @@ export const de_AddTagsCommand = async ( return response; }; -/** - * deserializeAws_queryAddTagsCommandError - */ -const de_AddTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateTagKeys": - case "com.amazonaws.elasticloadbalancingv2#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "ListenerNotFound": - case "com.amazonaws.elasticloadbalancingv2#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException": - throw await de_LoadBalancerNotFoundExceptionRes(parsedOutput, context); - case "RuleNotFound": - case "com.amazonaws.elasticloadbalancingv2#RuleNotFoundException": - throw await de_RuleNotFoundExceptionRes(parsedOutput, context); - case "TargetGroupNotFound": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException": - throw await de_TargetGroupNotFoundExceptionRes(parsedOutput, context); - case "TooManyTags": - case "com.amazonaws.elasticloadbalancingv2#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "TrustStoreNotFound": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotFoundException": - throw await de_TrustStoreNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAddTrustStoreRevocationsCommand */ @@ -1180,7 +1104,7 @@ export const de_AddTrustStoreRevocationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTrustStoreRevocationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1192,41 +1116,6 @@ export const de_AddTrustStoreRevocationsCommand = async ( return response; }; -/** - * deserializeAws_queryAddTrustStoreRevocationsCommandError - */ -const de_AddTrustStoreRevocationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRevocationContent": - case "com.amazonaws.elasticloadbalancingv2#InvalidRevocationContentException": - throw await de_InvalidRevocationContentExceptionRes(parsedOutput, context); - case "RevocationContentNotFound": - case "com.amazonaws.elasticloadbalancingv2#RevocationContentNotFoundException": - throw await de_RevocationContentNotFoundExceptionRes(parsedOutput, context); - case "TooManyTrustStoreRevocationEntries": - case "com.amazonaws.elasticloadbalancingv2#TooManyTrustStoreRevocationEntriesException": - throw await de_TooManyTrustStoreRevocationEntriesExceptionRes(parsedOutput, context); - case "TrustStoreNotFound": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotFoundException": - throw await de_TrustStoreNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateListenerCommand */ @@ -1235,7 +1124,7 @@ export const de_CreateListenerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateListenerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1247,89 +1136,6 @@ export const de_CreateListenerCommand = async ( return response; }; -/** - * deserializeAws_queryCreateListenerCommandError - */ -const de_CreateListenerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ALPNPolicyNotFound": - case "com.amazonaws.elasticloadbalancingv2#ALPNPolicyNotSupportedException": - throw await de_ALPNPolicyNotSupportedExceptionRes(parsedOutput, context); - case "CertificateNotFound": - case "com.amazonaws.elasticloadbalancingv2#CertificateNotFoundException": - throw await de_CertificateNotFoundExceptionRes(parsedOutput, context); - case "DuplicateListener": - case "com.amazonaws.elasticloadbalancingv2#DuplicateListenerException": - throw await de_DuplicateListenerExceptionRes(parsedOutput, context); - case "IncompatibleProtocols": - case "com.amazonaws.elasticloadbalancingv2#IncompatibleProtocolsException": - throw await de_IncompatibleProtocolsExceptionRes(parsedOutput, context); - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancingv2#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "InvalidLoadBalancerAction": - case "com.amazonaws.elasticloadbalancingv2#InvalidLoadBalancerActionException": - throw await de_InvalidLoadBalancerActionExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException": - throw await de_LoadBalancerNotFoundExceptionRes(parsedOutput, context); - case "SSLPolicyNotFound": - case "com.amazonaws.elasticloadbalancingv2#SSLPolicyNotFoundException": - throw await de_SSLPolicyNotFoundExceptionRes(parsedOutput, context); - case "TargetGroupAssociationLimit": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupAssociationLimitException": - throw await de_TargetGroupAssociationLimitExceptionRes(parsedOutput, context); - case "TargetGroupNotFound": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException": - throw await de_TargetGroupNotFoundExceptionRes(parsedOutput, context); - case "TooManyActions": - case "com.amazonaws.elasticloadbalancingv2#TooManyActionsException": - throw await de_TooManyActionsExceptionRes(parsedOutput, context); - case "TooManyCertificates": - case "com.amazonaws.elasticloadbalancingv2#TooManyCertificatesException": - throw await de_TooManyCertificatesExceptionRes(parsedOutput, context); - case "TooManyListeners": - case "com.amazonaws.elasticloadbalancingv2#TooManyListenersException": - throw await de_TooManyListenersExceptionRes(parsedOutput, context); - case "TooManyRegistrationsForTargetId": - case "com.amazonaws.elasticloadbalancingv2#TooManyRegistrationsForTargetIdException": - throw await de_TooManyRegistrationsForTargetIdExceptionRes(parsedOutput, context); - case "TooManyTags": - case "com.amazonaws.elasticloadbalancingv2#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "TooManyTargets": - case "com.amazonaws.elasticloadbalancingv2#TooManyTargetsException": - throw await de_TooManyTargetsExceptionRes(parsedOutput, context); - case "TooManyUniqueTargetGroupsPerLoadBalancer": - case "com.amazonaws.elasticloadbalancingv2#TooManyUniqueTargetGroupsPerLoadBalancerException": - throw await de_TooManyUniqueTargetGroupsPerLoadBalancerExceptionRes(parsedOutput, context); - case "TrustStoreNotFound": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotFoundException": - throw await de_TrustStoreNotFoundExceptionRes(parsedOutput, context); - case "TrustStoreNotReady": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotReadyException": - throw await de_TrustStoreNotReadyExceptionRes(parsedOutput, context); - case "UnsupportedProtocol": - case "com.amazonaws.elasticloadbalancingv2#UnsupportedProtocolException": - throw await de_UnsupportedProtocolExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateLoadBalancerCommand */ @@ -1338,7 +1144,7 @@ export const de_CreateLoadBalancerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLoadBalancerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1350,68 +1156,6 @@ export const de_CreateLoadBalancerCommand = async ( return response; }; -/** - * deserializeAws_queryCreateLoadBalancerCommandError - */ -const de_CreateLoadBalancerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AllocationIdNotFound": - case "com.amazonaws.elasticloadbalancingv2#AllocationIdNotFoundException": - throw await de_AllocationIdNotFoundExceptionRes(parsedOutput, context); - case "AvailabilityZoneNotSupported": - case "com.amazonaws.elasticloadbalancingv2#AvailabilityZoneNotSupportedException": - throw await de_AvailabilityZoneNotSupportedExceptionRes(parsedOutput, context); - case "DuplicateLoadBalancerName": - case "com.amazonaws.elasticloadbalancingv2#DuplicateLoadBalancerNameException": - throw await de_DuplicateLoadBalancerNameExceptionRes(parsedOutput, context); - case "DuplicateTagKeys": - case "com.amazonaws.elasticloadbalancingv2#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancingv2#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "InvalidScheme": - case "com.amazonaws.elasticloadbalancingv2#InvalidSchemeException": - throw await de_InvalidSchemeExceptionRes(parsedOutput, context); - case "InvalidSecurityGroup": - case "com.amazonaws.elasticloadbalancingv2#InvalidSecurityGroupException": - throw await de_InvalidSecurityGroupExceptionRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.elasticloadbalancingv2#InvalidSubnetException": - throw await de_InvalidSubnetExceptionRes(parsedOutput, context); - case "OperationNotPermitted": - case "com.amazonaws.elasticloadbalancingv2#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.elasticloadbalancingv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "SubnetNotFound": - case "com.amazonaws.elasticloadbalancingv2#SubnetNotFoundException": - throw await de_SubnetNotFoundExceptionRes(parsedOutput, context); - case "TooManyLoadBalancers": - case "com.amazonaws.elasticloadbalancingv2#TooManyLoadBalancersException": - throw await de_TooManyLoadBalancersExceptionRes(parsedOutput, context); - case "TooManyTags": - case "com.amazonaws.elasticloadbalancingv2#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateRuleCommand */ @@ -1420,7 +1164,7 @@ export const de_CreateRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1433,82 +1177,14 @@ export const de_CreateRuleCommand = async ( }; /** - * deserializeAws_queryCreateRuleCommandError + * deserializeAws_queryCreateTargetGroupCommand */ -const de_CreateRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IncompatibleProtocols": - case "com.amazonaws.elasticloadbalancingv2#IncompatibleProtocolsException": - throw await de_IncompatibleProtocolsExceptionRes(parsedOutput, context); - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancingv2#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "InvalidLoadBalancerAction": - case "com.amazonaws.elasticloadbalancingv2#InvalidLoadBalancerActionException": - throw await de_InvalidLoadBalancerActionExceptionRes(parsedOutput, context); - case "ListenerNotFound": - case "com.amazonaws.elasticloadbalancingv2#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - case "PriorityInUse": - case "com.amazonaws.elasticloadbalancingv2#PriorityInUseException": - throw await de_PriorityInUseExceptionRes(parsedOutput, context); - case "TargetGroupAssociationLimit": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupAssociationLimitException": - throw await de_TargetGroupAssociationLimitExceptionRes(parsedOutput, context); - case "TargetGroupNotFound": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException": - throw await de_TargetGroupNotFoundExceptionRes(parsedOutput, context); - case "TooManyActions": - case "com.amazonaws.elasticloadbalancingv2#TooManyActionsException": - throw await de_TooManyActionsExceptionRes(parsedOutput, context); - case "TooManyRegistrationsForTargetId": - case "com.amazonaws.elasticloadbalancingv2#TooManyRegistrationsForTargetIdException": - throw await de_TooManyRegistrationsForTargetIdExceptionRes(parsedOutput, context); - case "TooManyRules": - case "com.amazonaws.elasticloadbalancingv2#TooManyRulesException": - throw await de_TooManyRulesExceptionRes(parsedOutput, context); - case "TooManyTags": - case "com.amazonaws.elasticloadbalancingv2#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "TooManyTargetGroups": - case "com.amazonaws.elasticloadbalancingv2#TooManyTargetGroupsException": - throw await de_TooManyTargetGroupsExceptionRes(parsedOutput, context); - case "TooManyTargets": - case "com.amazonaws.elasticloadbalancingv2#TooManyTargetsException": - throw await de_TooManyTargetsExceptionRes(parsedOutput, context); - case "TooManyUniqueTargetGroupsPerLoadBalancer": - case "com.amazonaws.elasticloadbalancingv2#TooManyUniqueTargetGroupsPerLoadBalancerException": - throw await de_TooManyUniqueTargetGroupsPerLoadBalancerExceptionRes(parsedOutput, context); - case "UnsupportedProtocol": - case "com.amazonaws.elasticloadbalancingv2#UnsupportedProtocolException": - throw await de_UnsupportedProtocolExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryCreateTargetGroupCommand - */ -export const de_CreateTargetGroupCommand = async ( +export const de_CreateTargetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTargetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1520,41 +1196,6 @@ export const de_CreateTargetGroupCommand = async ( return response; }; -/** - * deserializeAws_queryCreateTargetGroupCommandError - */ -const de_CreateTargetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateTargetGroupName": - case "com.amazonaws.elasticloadbalancingv2#DuplicateTargetGroupNameException": - throw await de_DuplicateTargetGroupNameExceptionRes(parsedOutput, context); - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancingv2#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "TooManyTags": - case "com.amazonaws.elasticloadbalancingv2#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "TooManyTargetGroups": - case "com.amazonaws.elasticloadbalancingv2#TooManyTargetGroupsException": - throw await de_TooManyTargetGroupsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateTrustStoreCommand */ @@ -1563,7 +1204,7 @@ export const de_CreateTrustStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTrustStoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1575,47 +1216,6 @@ export const de_CreateTrustStoreCommand = async ( return response; }; -/** - * deserializeAws_queryCreateTrustStoreCommandError - */ -const de_CreateTrustStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CaCertificatesBundleNotFound": - case "com.amazonaws.elasticloadbalancingv2#CaCertificatesBundleNotFoundException": - throw await de_CaCertificatesBundleNotFoundExceptionRes(parsedOutput, context); - case "DuplicateTagKeys": - case "com.amazonaws.elasticloadbalancingv2#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "DuplicateTrustStoreName": - case "com.amazonaws.elasticloadbalancingv2#DuplicateTrustStoreNameException": - throw await de_DuplicateTrustStoreNameExceptionRes(parsedOutput, context); - case "InvalidCaCertificatesBundle": - case "com.amazonaws.elasticloadbalancingv2#InvalidCaCertificatesBundleException": - throw await de_InvalidCaCertificatesBundleExceptionRes(parsedOutput, context); - case "TooManyTags": - case "com.amazonaws.elasticloadbalancingv2#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "TooManyTrustStores": - case "com.amazonaws.elasticloadbalancingv2#TooManyTrustStoresException": - throw await de_TooManyTrustStoresExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteListenerCommand */ @@ -1624,7 +1224,7 @@ export const de_DeleteListenerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteListenerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1636,35 +1236,6 @@ export const de_DeleteListenerCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteListenerCommandError - */ -const de_DeleteListenerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ListenerNotFound": - case "com.amazonaws.elasticloadbalancingv2#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.elasticloadbalancingv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteLoadBalancerCommand */ @@ -1673,7 +1244,7 @@ export const de_DeleteLoadBalancerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLoadBalancerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1685,38 +1256,6 @@ export const de_DeleteLoadBalancerCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteLoadBalancerCommandError - */ -const de_DeleteLoadBalancerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException": - throw await de_LoadBalancerNotFoundExceptionRes(parsedOutput, context); - case "OperationNotPermitted": - case "com.amazonaws.elasticloadbalancingv2#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.elasticloadbalancingv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteRuleCommand */ @@ -1725,7 +1264,7 @@ export const de_DeleteRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1737,35 +1276,6 @@ export const de_DeleteRuleCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteRuleCommandError - */ -const de_DeleteRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermitted": - case "com.amazonaws.elasticloadbalancingv2#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "RuleNotFound": - case "com.amazonaws.elasticloadbalancingv2#RuleNotFoundException": - throw await de_RuleNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteTargetGroupCommand */ @@ -1774,7 +1284,7 @@ export const de_DeleteTargetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTargetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1786,32 +1296,6 @@ export const de_DeleteTargetGroupCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteTargetGroupCommandError - */ -const de_DeleteTargetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.elasticloadbalancingv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteTrustStoreCommand */ @@ -1820,7 +1304,7 @@ export const de_DeleteTrustStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTrustStoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1833,83 +1317,25 @@ export const de_DeleteTrustStoreCommand = async ( }; /** - * deserializeAws_queryDeleteTrustStoreCommandError + * deserializeAws_queryDeregisterTargetsCommand */ -const de_DeleteTrustStoreCommandError = async ( +export const de_DeregisterTargetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "TrustStoreInUse": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreInUseException": - throw await de_TrustStoreInUseExceptionRes(parsedOutput, context); - case "TrustStoreNotFound": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotFoundException": - throw await de_TrustStoreNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeregisterTargetsCommand - */ -export const de_DeregisterTargetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeregisterTargetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeregisterTargetsOutput(data.DeregisterTargetsResult, context); - const response: DeregisterTargetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeregisterTargetsOutput(data.DeregisterTargetsResult, context); + const response: DeregisterTargetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; return response; }; -/** - * deserializeAws_queryDeregisterTargetsCommandError - */ -const de_DeregisterTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidTarget": - case "com.amazonaws.elasticloadbalancingv2#InvalidTargetException": - throw await de_InvalidTargetExceptionRes(parsedOutput, context); - case "TargetGroupNotFound": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException": - throw await de_TargetGroupNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeAccountLimitsCommand */ @@ -1918,7 +1344,7 @@ export const de_DescribeAccountLimitsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAccountLimitsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1930,26 +1356,6 @@ export const de_DescribeAccountLimitsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeAccountLimitsCommandError - */ -const de_DescribeAccountLimitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeListenerCertificatesCommand */ @@ -1958,7 +1364,7 @@ export const de_DescribeListenerCertificatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeListenerCertificatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1970,32 +1376,6 @@ export const de_DescribeListenerCertificatesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeListenerCertificatesCommandError - */ -const de_DescribeListenerCertificatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ListenerNotFound": - case "com.amazonaws.elasticloadbalancingv2#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeListenersCommand */ @@ -2004,7 +1384,7 @@ export const de_DescribeListenersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeListenersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2016,38 +1396,6 @@ export const de_DescribeListenersCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeListenersCommandError - */ -const de_DescribeListenersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ListenerNotFound": - case "com.amazonaws.elasticloadbalancingv2#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException": - throw await de_LoadBalancerNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedProtocol": - case "com.amazonaws.elasticloadbalancingv2#UnsupportedProtocolException": - throw await de_UnsupportedProtocolExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeLoadBalancerAttributesCommand */ @@ -2056,7 +1404,7 @@ export const de_DescribeLoadBalancerAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLoadBalancerAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2068,32 +1416,6 @@ export const de_DescribeLoadBalancerAttributesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeLoadBalancerAttributesCommandError - */ -const de_DescribeLoadBalancerAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException": - throw await de_LoadBalancerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeLoadBalancersCommand */ @@ -2102,7 +1424,7 @@ export const de_DescribeLoadBalancersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLoadBalancersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2114,32 +1436,6 @@ export const de_DescribeLoadBalancersCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeLoadBalancersCommandError - */ -const de_DescribeLoadBalancersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException": - throw await de_LoadBalancerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeRulesCommand */ @@ -2148,7 +1444,7 @@ export const de_DescribeRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2160,38 +1456,6 @@ export const de_DescribeRulesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeRulesCommandError - */ -const de_DescribeRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ListenerNotFound": - case "com.amazonaws.elasticloadbalancingv2#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - case "RuleNotFound": - case "com.amazonaws.elasticloadbalancingv2#RuleNotFoundException": - throw await de_RuleNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedProtocol": - case "com.amazonaws.elasticloadbalancingv2#UnsupportedProtocolException": - throw await de_UnsupportedProtocolExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeSSLPoliciesCommand */ @@ -2200,7 +1464,7 @@ export const de_DescribeSSLPoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSSLPoliciesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2213,45 +1477,39 @@ export const de_DescribeSSLPoliciesCommand = async ( }; /** - * deserializeAws_queryDescribeSSLPoliciesCommandError + * deserializeAws_queryDescribeTagsCommand */ -const de_DescribeSSLPoliciesCommandError = async ( +export const de_DescribeTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "SSLPolicyNotFound": - case "com.amazonaws.elasticloadbalancingv2#SSLPolicyNotFoundException": - throw await de_SSLPolicyNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeTagsOutput(data.DescribeTagsResult, context); + const response: DescribeTagsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeTagsCommand + * deserializeAws_queryDescribeTargetGroupAttributesCommand */ -export const de_DescribeTagsCommand = async ( +export const de_DescribeTargetGroupAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeTagsOutput(data.DescribeTagsResult, context); - const response: DescribeTagsCommandOutput = { + contents = de_DescribeTargetGroupAttributesOutput(data.DescribeTargetGroupAttributesResult, context); + const response: DescribeTargetGroupAttributesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2259,98 +1517,14 @@ export const de_DescribeTagsCommand = async ( }; /** - * deserializeAws_queryDescribeTagsCommandError + * deserializeAws_queryDescribeTargetGroupsCommand */ -const de_DescribeTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ListenerNotFound": - case "com.amazonaws.elasticloadbalancingv2#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException": - throw await de_LoadBalancerNotFoundExceptionRes(parsedOutput, context); - case "RuleNotFound": - case "com.amazonaws.elasticloadbalancingv2#RuleNotFoundException": - throw await de_RuleNotFoundExceptionRes(parsedOutput, context); - case "TargetGroupNotFound": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException": - throw await de_TargetGroupNotFoundExceptionRes(parsedOutput, context); - case "TrustStoreNotFound": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotFoundException": - throw await de_TrustStoreNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeTargetGroupAttributesCommand - */ -export const de_DescribeTargetGroupAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeTargetGroupAttributesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeTargetGroupAttributesOutput(data.DescribeTargetGroupAttributesResult, context); - const response: DescribeTargetGroupAttributesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeTargetGroupAttributesCommandError - */ -const de_DescribeTargetGroupAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "TargetGroupNotFound": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException": - throw await de_TargetGroupNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeTargetGroupsCommand - */ -export const de_DescribeTargetGroupsCommand = async ( +export const de_DescribeTargetGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTargetGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2362,35 +1536,6 @@ export const de_DescribeTargetGroupsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeTargetGroupsCommandError - */ -const de_DescribeTargetGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException": - throw await de_LoadBalancerNotFoundExceptionRes(parsedOutput, context); - case "TargetGroupNotFound": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException": - throw await de_TargetGroupNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeTargetHealthCommand */ @@ -2399,7 +1544,7 @@ export const de_DescribeTargetHealthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTargetHealthCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2411,38 +1556,6 @@ export const de_DescribeTargetHealthCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeTargetHealthCommandError - */ -const de_DescribeTargetHealthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "HealthUnavailable": - case "com.amazonaws.elasticloadbalancingv2#HealthUnavailableException": - throw await de_HealthUnavailableExceptionRes(parsedOutput, context); - case "InvalidTarget": - case "com.amazonaws.elasticloadbalancingv2#InvalidTargetException": - throw await de_InvalidTargetExceptionRes(parsedOutput, context); - case "TargetGroupNotFound": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException": - throw await de_TargetGroupNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeTrustStoreAssociationsCommand */ @@ -2451,7 +1564,7 @@ export const de_DescribeTrustStoreAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrustStoreAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2463,32 +1576,6 @@ export const de_DescribeTrustStoreAssociationsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeTrustStoreAssociationsCommandError - */ -const de_DescribeTrustStoreAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "TrustStoreNotFound": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotFoundException": - throw await de_TrustStoreNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeTrustStoreRevocationsCommand */ @@ -2497,7 +1584,7 @@ export const de_DescribeTrustStoreRevocationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrustStoreRevocationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2509,35 +1596,6 @@ export const de_DescribeTrustStoreRevocationsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeTrustStoreRevocationsCommandError - */ -const de_DescribeTrustStoreRevocationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RevocationIdNotFound": - case "com.amazonaws.elasticloadbalancingv2#RevocationIdNotFoundException": - throw await de_RevocationIdNotFoundExceptionRes(parsedOutput, context); - case "TrustStoreNotFound": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotFoundException": - throw await de_TrustStoreNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeTrustStoresCommand */ @@ -2546,427 +1604,12 @@ export const de_DescribeTrustStoresCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrustStoresCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeTrustStoresOutput(data.DescribeTrustStoresResult, context); - const response: DescribeTrustStoresCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeTrustStoresCommandError - */ -const de_DescribeTrustStoresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "TrustStoreNotFound": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotFoundException": - throw await de_TrustStoreNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetTrustStoreCaCertificatesBundleCommand - */ -export const de_GetTrustStoreCaCertificatesBundleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetTrustStoreCaCertificatesBundleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetTrustStoreCaCertificatesBundleOutput(data.GetTrustStoreCaCertificatesBundleResult, context); - const response: GetTrustStoreCaCertificatesBundleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetTrustStoreCaCertificatesBundleCommandError - */ -const de_GetTrustStoreCaCertificatesBundleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "TrustStoreNotFound": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotFoundException": - throw await de_TrustStoreNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetTrustStoreRevocationContentCommand - */ -export const de_GetTrustStoreRevocationContentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetTrustStoreRevocationContentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetTrustStoreRevocationContentOutput(data.GetTrustStoreRevocationContentResult, context); - const response: GetTrustStoreRevocationContentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetTrustStoreRevocationContentCommandError - */ -const de_GetTrustStoreRevocationContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RevocationIdNotFound": - case "com.amazonaws.elasticloadbalancingv2#RevocationIdNotFoundException": - throw await de_RevocationIdNotFoundExceptionRes(parsedOutput, context); - case "TrustStoreNotFound": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotFoundException": - throw await de_TrustStoreNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyListenerCommand - */ -export const de_ModifyListenerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyListenerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyListenerOutput(data.ModifyListenerResult, context); - const response: ModifyListenerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyListenerCommandError - */ -const de_ModifyListenerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ALPNPolicyNotFound": - case "com.amazonaws.elasticloadbalancingv2#ALPNPolicyNotSupportedException": - throw await de_ALPNPolicyNotSupportedExceptionRes(parsedOutput, context); - case "CertificateNotFound": - case "com.amazonaws.elasticloadbalancingv2#CertificateNotFoundException": - throw await de_CertificateNotFoundExceptionRes(parsedOutput, context); - case "DuplicateListener": - case "com.amazonaws.elasticloadbalancingv2#DuplicateListenerException": - throw await de_DuplicateListenerExceptionRes(parsedOutput, context); - case "IncompatibleProtocols": - case "com.amazonaws.elasticloadbalancingv2#IncompatibleProtocolsException": - throw await de_IncompatibleProtocolsExceptionRes(parsedOutput, context); - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancingv2#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "InvalidLoadBalancerAction": - case "com.amazonaws.elasticloadbalancingv2#InvalidLoadBalancerActionException": - throw await de_InvalidLoadBalancerActionExceptionRes(parsedOutput, context); - case "ListenerNotFound": - case "com.amazonaws.elasticloadbalancingv2#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - case "SSLPolicyNotFound": - case "com.amazonaws.elasticloadbalancingv2#SSLPolicyNotFoundException": - throw await de_SSLPolicyNotFoundExceptionRes(parsedOutput, context); - case "TargetGroupAssociationLimit": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupAssociationLimitException": - throw await de_TargetGroupAssociationLimitExceptionRes(parsedOutput, context); - case "TargetGroupNotFound": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException": - throw await de_TargetGroupNotFoundExceptionRes(parsedOutput, context); - case "TooManyActions": - case "com.amazonaws.elasticloadbalancingv2#TooManyActionsException": - throw await de_TooManyActionsExceptionRes(parsedOutput, context); - case "TooManyCertificates": - case "com.amazonaws.elasticloadbalancingv2#TooManyCertificatesException": - throw await de_TooManyCertificatesExceptionRes(parsedOutput, context); - case "TooManyListeners": - case "com.amazonaws.elasticloadbalancingv2#TooManyListenersException": - throw await de_TooManyListenersExceptionRes(parsedOutput, context); - case "TooManyRegistrationsForTargetId": - case "com.amazonaws.elasticloadbalancingv2#TooManyRegistrationsForTargetIdException": - throw await de_TooManyRegistrationsForTargetIdExceptionRes(parsedOutput, context); - case "TooManyTargets": - case "com.amazonaws.elasticloadbalancingv2#TooManyTargetsException": - throw await de_TooManyTargetsExceptionRes(parsedOutput, context); - case "TooManyUniqueTargetGroupsPerLoadBalancer": - case "com.amazonaws.elasticloadbalancingv2#TooManyUniqueTargetGroupsPerLoadBalancerException": - throw await de_TooManyUniqueTargetGroupsPerLoadBalancerExceptionRes(parsedOutput, context); - case "TrustStoreNotFound": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotFoundException": - throw await de_TrustStoreNotFoundExceptionRes(parsedOutput, context); - case "TrustStoreNotReady": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotReadyException": - throw await de_TrustStoreNotReadyExceptionRes(parsedOutput, context); - case "UnsupportedProtocol": - case "com.amazonaws.elasticloadbalancingv2#UnsupportedProtocolException": - throw await de_UnsupportedProtocolExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyLoadBalancerAttributesCommand - */ -export const de_ModifyLoadBalancerAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyLoadBalancerAttributesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyLoadBalancerAttributesOutput(data.ModifyLoadBalancerAttributesResult, context); - const response: ModifyLoadBalancerAttributesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyLoadBalancerAttributesCommandError - */ -const de_ModifyLoadBalancerAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancingv2#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException": - throw await de_LoadBalancerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyRuleCommand - */ -export const de_ModifyRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyRuleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyRuleOutput(data.ModifyRuleResult, context); - const response: ModifyRuleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyRuleCommandError - */ -const de_ModifyRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IncompatibleProtocols": - case "com.amazonaws.elasticloadbalancingv2#IncompatibleProtocolsException": - throw await de_IncompatibleProtocolsExceptionRes(parsedOutput, context); - case "InvalidLoadBalancerAction": - case "com.amazonaws.elasticloadbalancingv2#InvalidLoadBalancerActionException": - throw await de_InvalidLoadBalancerActionExceptionRes(parsedOutput, context); - case "OperationNotPermitted": - case "com.amazonaws.elasticloadbalancingv2#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "RuleNotFound": - case "com.amazonaws.elasticloadbalancingv2#RuleNotFoundException": - throw await de_RuleNotFoundExceptionRes(parsedOutput, context); - case "TargetGroupAssociationLimit": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupAssociationLimitException": - throw await de_TargetGroupAssociationLimitExceptionRes(parsedOutput, context); - case "TargetGroupNotFound": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException": - throw await de_TargetGroupNotFoundExceptionRes(parsedOutput, context); - case "TooManyActions": - case "com.amazonaws.elasticloadbalancingv2#TooManyActionsException": - throw await de_TooManyActionsExceptionRes(parsedOutput, context); - case "TooManyRegistrationsForTargetId": - case "com.amazonaws.elasticloadbalancingv2#TooManyRegistrationsForTargetIdException": - throw await de_TooManyRegistrationsForTargetIdExceptionRes(parsedOutput, context); - case "TooManyTargets": - case "com.amazonaws.elasticloadbalancingv2#TooManyTargetsException": - throw await de_TooManyTargetsExceptionRes(parsedOutput, context); - case "TooManyUniqueTargetGroupsPerLoadBalancer": - case "com.amazonaws.elasticloadbalancingv2#TooManyUniqueTargetGroupsPerLoadBalancerException": - throw await de_TooManyUniqueTargetGroupsPerLoadBalancerExceptionRes(parsedOutput, context); - case "UnsupportedProtocol": - case "com.amazonaws.elasticloadbalancingv2#UnsupportedProtocolException": - throw await de_UnsupportedProtocolExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyTargetGroupCommand - */ -export const de_ModifyTargetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyTargetGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyTargetGroupOutput(data.ModifyTargetGroupResult, context); - const response: ModifyTargetGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyTargetGroupCommandError - */ -const de_ModifyTargetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancingv2#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "TargetGroupNotFound": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException": - throw await de_TargetGroupNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyTargetGroupAttributesCommand - */ -export const de_ModifyTargetGroupAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyTargetGroupAttributesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyTargetGroupAttributesOutput(data.ModifyTargetGroupAttributesResult, context); - const response: ModifyTargetGroupAttributesCommandOutput = { + contents = de_DescribeTrustStoresOutput(data.DescribeTrustStoresResult, context); + const response: DescribeTrustStoresCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2974,48 +1617,39 @@ export const de_ModifyTargetGroupAttributesCommand = async ( }; /** - * deserializeAws_queryModifyTargetGroupAttributesCommandError + * deserializeAws_queryGetTrustStoreCaCertificatesBundleCommand */ -const de_ModifyTargetGroupAttributesCommandError = async ( +export const de_GetTrustStoreCaCertificatesBundleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancingv2#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "TargetGroupNotFound": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException": - throw await de_TargetGroupNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetTrustStoreCaCertificatesBundleOutput(data.GetTrustStoreCaCertificatesBundleResult, context); + const response: GetTrustStoreCaCertificatesBundleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryModifyTrustStoreCommand + * deserializeAws_queryGetTrustStoreRevocationContentCommand */ -export const de_ModifyTrustStoreCommand = async ( +export const de_GetTrustStoreRevocationContentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ModifyTrustStoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ModifyTrustStoreOutput(data.ModifyTrustStoreResult, context); - const response: ModifyTrustStoreCommandOutput = { + contents = de_GetTrustStoreRevocationContentOutput(data.GetTrustStoreRevocationContentResult, context); + const response: GetTrustStoreRevocationContentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3023,51 +1657,39 @@ export const de_ModifyTrustStoreCommand = async ( }; /** - * deserializeAws_queryModifyTrustStoreCommandError + * deserializeAws_queryModifyListenerCommand */ -const de_ModifyTrustStoreCommandError = async ( +export const de_ModifyListenerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CaCertificatesBundleNotFound": - case "com.amazonaws.elasticloadbalancingv2#CaCertificatesBundleNotFoundException": - throw await de_CaCertificatesBundleNotFoundExceptionRes(parsedOutput, context); - case "InvalidCaCertificatesBundle": - case "com.amazonaws.elasticloadbalancingv2#InvalidCaCertificatesBundleException": - throw await de_InvalidCaCertificatesBundleExceptionRes(parsedOutput, context); - case "TrustStoreNotFound": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotFoundException": - throw await de_TrustStoreNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyListenerOutput(data.ModifyListenerResult, context); + const response: ModifyListenerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryRegisterTargetsCommand + * deserializeAws_queryModifyLoadBalancerAttributesCommand */ -export const de_RegisterTargetsCommand = async ( +export const de_ModifyLoadBalancerAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RegisterTargetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RegisterTargetsOutput(data.RegisterTargetsResult, context); - const response: RegisterTargetsCommandOutput = { + contents = de_ModifyLoadBalancerAttributesOutput(data.ModifyLoadBalancerAttributesResult, context); + const response: ModifyLoadBalancerAttributesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3075,54 +1697,39 @@ export const de_RegisterTargetsCommand = async ( }; /** - * deserializeAws_queryRegisterTargetsCommandError + * deserializeAws_queryModifyRuleCommand */ -const de_RegisterTargetsCommandError = async ( +export const de_ModifyRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidTarget": - case "com.amazonaws.elasticloadbalancingv2#InvalidTargetException": - throw await de_InvalidTargetExceptionRes(parsedOutput, context); - case "TargetGroupNotFound": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException": - throw await de_TargetGroupNotFoundExceptionRes(parsedOutput, context); - case "TooManyRegistrationsForTargetId": - case "com.amazonaws.elasticloadbalancingv2#TooManyRegistrationsForTargetIdException": - throw await de_TooManyRegistrationsForTargetIdExceptionRes(parsedOutput, context); - case "TooManyTargets": - case "com.amazonaws.elasticloadbalancingv2#TooManyTargetsException": - throw await de_TooManyTargetsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyRuleOutput(data.ModifyRuleResult, context); + const response: ModifyRuleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryRemoveListenerCertificatesCommand + * deserializeAws_queryModifyTargetGroupCommand */ -export const de_RemoveListenerCertificatesCommand = async ( +export const de_ModifyTargetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RemoveListenerCertificatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RemoveListenerCertificatesOutput(data.RemoveListenerCertificatesResult, context); - const response: RemoveListenerCertificatesCommandOutput = { + contents = de_ModifyTargetGroupOutput(data.ModifyTargetGroupResult, context); + const response: ModifyTargetGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3130,48 +1737,39 @@ export const de_RemoveListenerCertificatesCommand = async ( }; /** - * deserializeAws_queryRemoveListenerCertificatesCommandError + * deserializeAws_queryModifyTargetGroupAttributesCommand */ -const de_RemoveListenerCertificatesCommandError = async ( +export const de_ModifyTargetGroupAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ListenerNotFound": - case "com.amazonaws.elasticloadbalancingv2#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - case "OperationNotPermitted": - case "com.amazonaws.elasticloadbalancingv2#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyTargetGroupAttributesOutput(data.ModifyTargetGroupAttributesResult, context); + const response: ModifyTargetGroupAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryRemoveTagsCommand + * deserializeAws_queryModifyTrustStoreCommand */ -export const de_RemoveTagsCommand = async ( +export const de_ModifyTrustStoreCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RemoveTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RemoveTagsOutput(data.RemoveTagsResult, context); - const response: RemoveTagsCommandOutput = { + contents = de_ModifyTrustStoreOutput(data.ModifyTrustStoreResult, context); + const response: ModifyTrustStoreCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3179,60 +1777,39 @@ export const de_RemoveTagsCommand = async ( }; /** - * deserializeAws_queryRemoveTagsCommandError + * deserializeAws_queryRegisterTargetsCommand */ -const de_RemoveTagsCommandError = async ( +export const de_RegisterTargetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ListenerNotFound": - case "com.amazonaws.elasticloadbalancingv2#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException": - throw await de_LoadBalancerNotFoundExceptionRes(parsedOutput, context); - case "RuleNotFound": - case "com.amazonaws.elasticloadbalancingv2#RuleNotFoundException": - throw await de_RuleNotFoundExceptionRes(parsedOutput, context); - case "TargetGroupNotFound": - case "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException": - throw await de_TargetGroupNotFoundExceptionRes(parsedOutput, context); - case "TooManyTags": - case "com.amazonaws.elasticloadbalancingv2#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "TrustStoreNotFound": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotFoundException": - throw await de_TrustStoreNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RegisterTargetsOutput(data.RegisterTargetsResult, context); + const response: RegisterTargetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryRemoveTrustStoreRevocationsCommand + * deserializeAws_queryRemoveListenerCertificatesCommand */ -export const de_RemoveTrustStoreRevocationsCommand = async ( +export const de_RemoveListenerCertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RemoveTrustStoreRevocationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RemoveTrustStoreRevocationsOutput(data.RemoveTrustStoreRevocationsResult, context); - const response: RemoveTrustStoreRevocationsCommandOutput = { + contents = de_RemoveListenerCertificatesOutput(data.RemoveListenerCertificatesResult, context); + const response: RemoveListenerCertificatesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3240,48 +1817,39 @@ export const de_RemoveTrustStoreRevocationsCommand = async ( }; /** - * deserializeAws_queryRemoveTrustStoreRevocationsCommandError + * deserializeAws_queryRemoveTagsCommand */ -const de_RemoveTrustStoreRevocationsCommandError = async ( +export const de_RemoveTagsCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RevocationIdNotFound": - case "com.amazonaws.elasticloadbalancingv2#RevocationIdNotFoundException": - throw await de_RevocationIdNotFoundExceptionRes(parsedOutput, context); - case "TrustStoreNotFound": - case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotFoundException": - throw await de_TrustStoreNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RemoveTagsOutput(data.RemoveTagsResult, context); + const response: RemoveTagsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_querySetIpAddressTypeCommand + * deserializeAws_queryRemoveTrustStoreRevocationsCommand */ -export const de_SetIpAddressTypeCommand = async ( +export const de_RemoveTrustStoreRevocationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetIpAddressTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_SetIpAddressTypeOutput(data.SetIpAddressTypeResult, context); - const response: SetIpAddressTypeCommandOutput = { + contents = de_RemoveTrustStoreRevocationsOutput(data.RemoveTrustStoreRevocationsResult, context); + const response: RemoveTrustStoreRevocationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3289,35 +1857,23 @@ export const de_SetIpAddressTypeCommand = async ( }; /** - * deserializeAws_querySetIpAddressTypeCommandError + * deserializeAws_querySetIpAddressTypeCommand */ -const de_SetIpAddressTypeCommandError = async ( +export const de_SetIpAddressTypeCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancingv2#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.elasticloadbalancingv2#InvalidSubnetException": - throw await de_InvalidSubnetExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException": - throw await de_LoadBalancerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SetIpAddressTypeOutput(data.SetIpAddressTypeResult, context); + const response: SetIpAddressTypeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3328,7 +1884,7 @@ export const de_SetRulePrioritiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetRulePrioritiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3340,38 +1896,6 @@ export const de_SetRulePrioritiesCommand = async ( return response; }; -/** - * deserializeAws_querySetRulePrioritiesCommandError - */ -const de_SetRulePrioritiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermitted": - case "com.amazonaws.elasticloadbalancingv2#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "PriorityInUse": - case "com.amazonaws.elasticloadbalancingv2#PriorityInUseException": - throw await de_PriorityInUseExceptionRes(parsedOutput, context); - case "RuleNotFound": - case "com.amazonaws.elasticloadbalancingv2#RuleNotFoundException": - throw await de_RuleNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySetSecurityGroupsCommand */ @@ -3380,7 +1904,7 @@ export const de_SetSecurityGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetSecurityGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3392,38 +1916,6 @@ export const de_SetSecurityGroupsCommand = async ( return response; }; -/** - * deserializeAws_querySetSecurityGroupsCommandError - */ -const de_SetSecurityGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancingv2#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "InvalidSecurityGroup": - case "com.amazonaws.elasticloadbalancingv2#InvalidSecurityGroupException": - throw await de_InvalidSecurityGroupExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException": - throw await de_LoadBalancerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySetSubnetsCommand */ @@ -3432,7 +1924,7 @@ export const de_SetSubnetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetSubnetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3445,43 +1937,166 @@ export const de_SetSubnetsCommand = async ( }; /** - * deserializeAws_querySetSubnetsCommandError + * deserialize_Aws_queryCommandError */ -const de_SetSubnetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { + case "CertificateNotFound": + case "com.amazonaws.elasticloadbalancingv2#CertificateNotFoundException": + throw await de_CertificateNotFoundExceptionRes(parsedOutput, context); + case "ListenerNotFound": + case "com.amazonaws.elasticloadbalancingv2#ListenerNotFoundException": + throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); + case "TooManyCertificates": + case "com.amazonaws.elasticloadbalancingv2#TooManyCertificatesException": + throw await de_TooManyCertificatesExceptionRes(parsedOutput, context); + case "DuplicateTagKeys": + case "com.amazonaws.elasticloadbalancingv2#DuplicateTagKeysException": + throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); + case "LoadBalancerNotFound": + case "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException": + throw await de_LoadBalancerNotFoundExceptionRes(parsedOutput, context); + case "RuleNotFound": + case "com.amazonaws.elasticloadbalancingv2#RuleNotFoundException": + throw await de_RuleNotFoundExceptionRes(parsedOutput, context); + case "TargetGroupNotFound": + case "com.amazonaws.elasticloadbalancingv2#TargetGroupNotFoundException": + throw await de_TargetGroupNotFoundExceptionRes(parsedOutput, context); + case "TooManyTags": + case "com.amazonaws.elasticloadbalancingv2#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "TrustStoreNotFound": + case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotFoundException": + throw await de_TrustStoreNotFoundExceptionRes(parsedOutput, context); + case "InvalidRevocationContent": + case "com.amazonaws.elasticloadbalancingv2#InvalidRevocationContentException": + throw await de_InvalidRevocationContentExceptionRes(parsedOutput, context); + case "RevocationContentNotFound": + case "com.amazonaws.elasticloadbalancingv2#RevocationContentNotFoundException": + throw await de_RevocationContentNotFoundExceptionRes(parsedOutput, context); + case "TooManyTrustStoreRevocationEntries": + case "com.amazonaws.elasticloadbalancingv2#TooManyTrustStoreRevocationEntriesException": + throw await de_TooManyTrustStoreRevocationEntriesExceptionRes(parsedOutput, context); + case "ALPNPolicyNotFound": + case "com.amazonaws.elasticloadbalancingv2#ALPNPolicyNotSupportedException": + throw await de_ALPNPolicyNotSupportedExceptionRes(parsedOutput, context); + case "DuplicateListener": + case "com.amazonaws.elasticloadbalancingv2#DuplicateListenerException": + throw await de_DuplicateListenerExceptionRes(parsedOutput, context); + case "IncompatibleProtocols": + case "com.amazonaws.elasticloadbalancingv2#IncompatibleProtocolsException": + throw await de_IncompatibleProtocolsExceptionRes(parsedOutput, context); + case "InvalidConfigurationRequest": + case "com.amazonaws.elasticloadbalancingv2#InvalidConfigurationRequestException": + throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); + case "InvalidLoadBalancerAction": + case "com.amazonaws.elasticloadbalancingv2#InvalidLoadBalancerActionException": + throw await de_InvalidLoadBalancerActionExceptionRes(parsedOutput, context); + case "SSLPolicyNotFound": + case "com.amazonaws.elasticloadbalancingv2#SSLPolicyNotFoundException": + throw await de_SSLPolicyNotFoundExceptionRes(parsedOutput, context); + case "TargetGroupAssociationLimit": + case "com.amazonaws.elasticloadbalancingv2#TargetGroupAssociationLimitException": + throw await de_TargetGroupAssociationLimitExceptionRes(parsedOutput, context); + case "TooManyActions": + case "com.amazonaws.elasticloadbalancingv2#TooManyActionsException": + throw await de_TooManyActionsExceptionRes(parsedOutput, context); + case "TooManyListeners": + case "com.amazonaws.elasticloadbalancingv2#TooManyListenersException": + throw await de_TooManyListenersExceptionRes(parsedOutput, context); + case "TooManyRegistrationsForTargetId": + case "com.amazonaws.elasticloadbalancingv2#TooManyRegistrationsForTargetIdException": + throw await de_TooManyRegistrationsForTargetIdExceptionRes(parsedOutput, context); + case "TooManyTargets": + case "com.amazonaws.elasticloadbalancingv2#TooManyTargetsException": + throw await de_TooManyTargetsExceptionRes(parsedOutput, context); + case "TooManyUniqueTargetGroupsPerLoadBalancer": + case "com.amazonaws.elasticloadbalancingv2#TooManyUniqueTargetGroupsPerLoadBalancerException": + throw await de_TooManyUniqueTargetGroupsPerLoadBalancerExceptionRes(parsedOutput, context); + case "TrustStoreNotReady": + case "com.amazonaws.elasticloadbalancingv2#TrustStoreNotReadyException": + throw await de_TrustStoreNotReadyExceptionRes(parsedOutput, context); + case "UnsupportedProtocol": + case "com.amazonaws.elasticloadbalancingv2#UnsupportedProtocolException": + throw await de_UnsupportedProtocolExceptionRes(parsedOutput, context); case "AllocationIdNotFound": case "com.amazonaws.elasticloadbalancingv2#AllocationIdNotFoundException": throw await de_AllocationIdNotFoundExceptionRes(parsedOutput, context); case "AvailabilityZoneNotSupported": case "com.amazonaws.elasticloadbalancingv2#AvailabilityZoneNotSupportedException": throw await de_AvailabilityZoneNotSupportedExceptionRes(parsedOutput, context); - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancingv2#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); + case "DuplicateLoadBalancerName": + case "com.amazonaws.elasticloadbalancingv2#DuplicateLoadBalancerNameException": + throw await de_DuplicateLoadBalancerNameExceptionRes(parsedOutput, context); + case "InvalidScheme": + case "com.amazonaws.elasticloadbalancingv2#InvalidSchemeException": + throw await de_InvalidSchemeExceptionRes(parsedOutput, context); + case "InvalidSecurityGroup": + case "com.amazonaws.elasticloadbalancingv2#InvalidSecurityGroupException": + throw await de_InvalidSecurityGroupExceptionRes(parsedOutput, context); case "InvalidSubnet": case "com.amazonaws.elasticloadbalancingv2#InvalidSubnetException": throw await de_InvalidSubnetExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancingv2#LoadBalancerNotFoundException": - throw await de_LoadBalancerNotFoundExceptionRes(parsedOutput, context); + case "OperationNotPermitted": + case "com.amazonaws.elasticloadbalancingv2#OperationNotPermittedException": + throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); + case "ResourceInUse": + case "com.amazonaws.elasticloadbalancingv2#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); case "SubnetNotFound": case "com.amazonaws.elasticloadbalancingv2#SubnetNotFoundException": throw await de_SubnetNotFoundExceptionRes(parsedOutput, context); + case "TooManyLoadBalancers": + case "com.amazonaws.elasticloadbalancingv2#TooManyLoadBalancersException": + throw await de_TooManyLoadBalancersExceptionRes(parsedOutput, context); + case "PriorityInUse": + case "com.amazonaws.elasticloadbalancingv2#PriorityInUseException": + throw await de_PriorityInUseExceptionRes(parsedOutput, context); + case "TooManyRules": + case "com.amazonaws.elasticloadbalancingv2#TooManyRulesException": + throw await de_TooManyRulesExceptionRes(parsedOutput, context); + case "TooManyTargetGroups": + case "com.amazonaws.elasticloadbalancingv2#TooManyTargetGroupsException": + throw await de_TooManyTargetGroupsExceptionRes(parsedOutput, context); + case "DuplicateTargetGroupName": + case "com.amazonaws.elasticloadbalancingv2#DuplicateTargetGroupNameException": + throw await de_DuplicateTargetGroupNameExceptionRes(parsedOutput, context); + case "CaCertificatesBundleNotFound": + case "com.amazonaws.elasticloadbalancingv2#CaCertificatesBundleNotFoundException": + throw await de_CaCertificatesBundleNotFoundExceptionRes(parsedOutput, context); + case "DuplicateTrustStoreName": + case "com.amazonaws.elasticloadbalancingv2#DuplicateTrustStoreNameException": + throw await de_DuplicateTrustStoreNameExceptionRes(parsedOutput, context); + case "InvalidCaCertificatesBundle": + case "com.amazonaws.elasticloadbalancingv2#InvalidCaCertificatesBundleException": + throw await de_InvalidCaCertificatesBundleExceptionRes(parsedOutput, context); + case "TooManyTrustStores": + case "com.amazonaws.elasticloadbalancingv2#TooManyTrustStoresException": + throw await de_TooManyTrustStoresExceptionRes(parsedOutput, context); + case "TrustStoreInUse": + case "com.amazonaws.elasticloadbalancingv2#TrustStoreInUseException": + throw await de_TrustStoreInUseExceptionRes(parsedOutput, context); + case "InvalidTarget": + case "com.amazonaws.elasticloadbalancingv2#InvalidTargetException": + throw await de_InvalidTargetExceptionRes(parsedOutput, context); + case "HealthUnavailable": + case "com.amazonaws.elasticloadbalancingv2#HealthUnavailableException": + throw await de_HealthUnavailableExceptionRes(parsedOutput, context); + case "RevocationIdNotFound": + case "com.amazonaws.elasticloadbalancingv2#RevocationIdNotFoundException": + throw await de_RevocationIdNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody: parsedBody.Error, errorCode, - }); + }) as never; } }; diff --git a/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts b/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts index 210d0ffb67e4..385c24c53f11 100644 --- a/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts +++ b/clients/client-elastic-load-balancing/src/protocols/Aws_query.ts @@ -734,7 +734,7 @@ export const de_AddTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -746,38 +746,6 @@ export const de_AddTagsCommand = async ( return response; }; -/** - * deserializeAws_queryAddTagsCommandError - */ -const de_AddTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateTagKeys": - case "com.amazonaws.elasticloadbalancing#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - case "TooManyTags": - case "com.amazonaws.elasticloadbalancing#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryApplySecurityGroupsToLoadBalancerCommand */ @@ -786,7 +754,7 @@ export const de_ApplySecurityGroupsToLoadBalancerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ApplySecurityGroupsToLoadBalancerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -798,38 +766,6 @@ export const de_ApplySecurityGroupsToLoadBalancerCommand = async ( return response; }; -/** - * deserializeAws_queryApplySecurityGroupsToLoadBalancerCommandError - */ -const de_ApplySecurityGroupsToLoadBalancerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancing#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "InvalidSecurityGroup": - case "com.amazonaws.elasticloadbalancing#InvalidSecurityGroupException": - throw await de_InvalidSecurityGroupExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAttachLoadBalancerToSubnetsCommand */ @@ -838,7 +774,7 @@ export const de_AttachLoadBalancerToSubnetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachLoadBalancerToSubnetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -850,41 +786,6 @@ export const de_AttachLoadBalancerToSubnetsCommand = async ( return response; }; -/** - * deserializeAws_queryAttachLoadBalancerToSubnetsCommandError - */ -const de_AttachLoadBalancerToSubnetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancing#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.elasticloadbalancing#InvalidSubnetException": - throw await de_InvalidSubnetExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - case "SubnetNotFound": - case "com.amazonaws.elasticloadbalancing#SubnetNotFoundException": - throw await de_SubnetNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryConfigureHealthCheckCommand */ @@ -893,7 +794,7 @@ export const de_ConfigureHealthCheckCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ConfigureHealthCheckCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -905,32 +806,6 @@ export const de_ConfigureHealthCheckCommand = async ( return response; }; -/** - * deserializeAws_queryConfigureHealthCheckCommandError - */ -const de_ConfigureHealthCheckCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateAppCookieStickinessPolicyCommand */ @@ -939,7 +814,7 @@ export const de_CreateAppCookieStickinessPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAppCookieStickinessPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -951,41 +826,6 @@ export const de_CreateAppCookieStickinessPolicyCommand = async ( return response; }; -/** - * deserializeAws_queryCreateAppCookieStickinessPolicyCommandError - */ -const de_CreateAppCookieStickinessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicatePolicyName": - case "com.amazonaws.elasticloadbalancing#DuplicatePolicyNameException": - throw await de_DuplicatePolicyNameExceptionRes(parsedOutput, context); - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancing#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - case "TooManyPolicies": - case "com.amazonaws.elasticloadbalancing#TooManyPoliciesException": - throw await de_TooManyPoliciesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateLBCookieStickinessPolicyCommand */ @@ -994,7 +834,7 @@ export const de_CreateLBCookieStickinessPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLBCookieStickinessPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1006,41 +846,6 @@ export const de_CreateLBCookieStickinessPolicyCommand = async ( return response; }; -/** - * deserializeAws_queryCreateLBCookieStickinessPolicyCommandError - */ -const de_CreateLBCookieStickinessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicatePolicyName": - case "com.amazonaws.elasticloadbalancing#DuplicatePolicyNameException": - throw await de_DuplicatePolicyNameExceptionRes(parsedOutput, context); - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancing#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - case "TooManyPolicies": - case "com.amazonaws.elasticloadbalancing#TooManyPoliciesException": - throw await de_TooManyPoliciesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateLoadBalancerCommand */ @@ -1049,7 +854,7 @@ export const de_CreateLoadBalancerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLoadBalancerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1061,65 +866,6 @@ export const de_CreateLoadBalancerCommand = async ( return response; }; -/** - * deserializeAws_queryCreateLoadBalancerCommandError - */ -const de_CreateLoadBalancerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateNotFound": - case "com.amazonaws.elasticloadbalancing#CertificateNotFoundException": - throw await de_CertificateNotFoundExceptionRes(parsedOutput, context); - case "DuplicateLoadBalancerName": - case "com.amazonaws.elasticloadbalancing#DuplicateAccessPointNameException": - throw await de_DuplicateAccessPointNameExceptionRes(parsedOutput, context); - case "DuplicateTagKeys": - case "com.amazonaws.elasticloadbalancing#DuplicateTagKeysException": - throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancing#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "InvalidScheme": - case "com.amazonaws.elasticloadbalancing#InvalidSchemeException": - throw await de_InvalidSchemeExceptionRes(parsedOutput, context); - case "InvalidSecurityGroup": - case "com.amazonaws.elasticloadbalancing#InvalidSecurityGroupException": - throw await de_InvalidSecurityGroupExceptionRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.elasticloadbalancing#InvalidSubnetException": - throw await de_InvalidSubnetExceptionRes(parsedOutput, context); - case "OperationNotPermitted": - case "com.amazonaws.elasticloadbalancing#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "SubnetNotFound": - case "com.amazonaws.elasticloadbalancing#SubnetNotFoundException": - throw await de_SubnetNotFoundExceptionRes(parsedOutput, context); - case "TooManyLoadBalancers": - case "com.amazonaws.elasticloadbalancing#TooManyAccessPointsException": - throw await de_TooManyAccessPointsExceptionRes(parsedOutput, context); - case "TooManyTags": - case "com.amazonaws.elasticloadbalancing#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "UnsupportedProtocol": - case "com.amazonaws.elasticloadbalancing#UnsupportedProtocolException": - throw await de_UnsupportedProtocolExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateLoadBalancerListenersCommand */ @@ -1128,7 +874,7 @@ export const de_CreateLoadBalancerListenersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLoadBalancerListenersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1140,44 +886,6 @@ export const de_CreateLoadBalancerListenersCommand = async ( return response; }; -/** - * deserializeAws_queryCreateLoadBalancerListenersCommandError - */ -const de_CreateLoadBalancerListenersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateNotFound": - case "com.amazonaws.elasticloadbalancing#CertificateNotFoundException": - throw await de_CertificateNotFoundExceptionRes(parsedOutput, context); - case "DuplicateListener": - case "com.amazonaws.elasticloadbalancing#DuplicateListenerException": - throw await de_DuplicateListenerExceptionRes(parsedOutput, context); - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancing#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedProtocol": - case "com.amazonaws.elasticloadbalancing#UnsupportedProtocolException": - throw await de_UnsupportedProtocolExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateLoadBalancerPolicyCommand */ @@ -1186,7 +894,7 @@ export const de_CreateLoadBalancerPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLoadBalancerPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1198,44 +906,6 @@ export const de_CreateLoadBalancerPolicyCommand = async ( return response; }; -/** - * deserializeAws_queryCreateLoadBalancerPolicyCommandError - */ -const de_CreateLoadBalancerPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicatePolicyName": - case "com.amazonaws.elasticloadbalancing#DuplicatePolicyNameException": - throw await de_DuplicatePolicyNameExceptionRes(parsedOutput, context); - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancing#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - case "PolicyTypeNotFound": - case "com.amazonaws.elasticloadbalancing#PolicyTypeNotFoundException": - throw await de_PolicyTypeNotFoundExceptionRes(parsedOutput, context); - case "TooManyPolicies": - case "com.amazonaws.elasticloadbalancing#TooManyPoliciesException": - throw await de_TooManyPoliciesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteLoadBalancerCommand */ @@ -1244,7 +914,7 @@ export const de_DeleteLoadBalancerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLoadBalancerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1256,26 +926,6 @@ export const de_DeleteLoadBalancerCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteLoadBalancerCommandError - */ -const de_DeleteLoadBalancerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDeleteLoadBalancerListenersCommand */ @@ -1284,7 +934,7 @@ export const de_DeleteLoadBalancerListenersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLoadBalancerListenersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1296,32 +946,6 @@ export const de_DeleteLoadBalancerListenersCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteLoadBalancerListenersCommandError - */ -const de_DeleteLoadBalancerListenersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteLoadBalancerPolicyCommand */ @@ -1330,7 +954,7 @@ export const de_DeleteLoadBalancerPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLoadBalancerPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1342,82 +966,24 @@ export const de_DeleteLoadBalancerPolicyCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteLoadBalancerPolicyCommandError - */ -const de_DeleteLoadBalancerPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancing#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeregisterInstancesFromLoadBalancerCommand */ export const de_DeregisterInstancesFromLoadBalancerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeregisterInstancesFromLoadBalancerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeregisterEndPointsOutput(data.DeregisterInstancesFromLoadBalancerResult, context); - const response: DeregisterInstancesFromLoadBalancerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDeregisterInstancesFromLoadBalancerCommandError - */ -const de_DeregisterInstancesFromLoadBalancerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInstance": - case "com.amazonaws.elasticloadbalancing#InvalidEndPointException": - throw await de_InvalidEndPointExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeregisterEndPointsOutput(data.DeregisterInstancesFromLoadBalancerResult, context); + const response: DeregisterInstancesFromLoadBalancerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1428,7 +994,7 @@ export const de_DescribeAccountLimitsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAccountLimitsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1440,26 +1006,6 @@ export const de_DescribeAccountLimitsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeAccountLimitsCommandError - */ -const de_DescribeAccountLimitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeInstanceHealthCommand */ @@ -1468,7 +1014,7 @@ export const de_DescribeInstanceHealthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstanceHealthCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1480,35 +1026,6 @@ export const de_DescribeInstanceHealthCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeInstanceHealthCommandError - */ -const de_DescribeInstanceHealthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInstance": - case "com.amazonaws.elasticloadbalancing#InvalidEndPointException": - throw await de_InvalidEndPointExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeLoadBalancerAttributesCommand */ @@ -1517,7 +1034,7 @@ export const de_DescribeLoadBalancerAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLoadBalancerAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1529,35 +1046,6 @@ export const de_DescribeLoadBalancerAttributesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeLoadBalancerAttributesCommandError - */ -const de_DescribeLoadBalancerAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LoadBalancerAttributeNotFound": - case "com.amazonaws.elasticloadbalancing#LoadBalancerAttributeNotFoundException": - throw await de_LoadBalancerAttributeNotFoundExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeLoadBalancerPoliciesCommand */ @@ -1566,7 +1054,7 @@ export const de_DescribeLoadBalancerPoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLoadBalancerPoliciesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1578,35 +1066,6 @@ export const de_DescribeLoadBalancerPoliciesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeLoadBalancerPoliciesCommandError - */ -const de_DescribeLoadBalancerPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - case "PolicyNotFound": - case "com.amazonaws.elasticloadbalancing#PolicyNotFoundException": - throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeLoadBalancerPolicyTypesCommand */ @@ -1615,7 +1074,7 @@ export const de_DescribeLoadBalancerPolicyTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLoadBalancerPolicyTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1627,32 +1086,6 @@ export const de_DescribeLoadBalancerPolicyTypesCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeLoadBalancerPolicyTypesCommandError - */ -const de_DescribeLoadBalancerPolicyTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "PolicyTypeNotFound": - case "com.amazonaws.elasticloadbalancing#PolicyTypeNotFoundException": - throw await de_PolicyTypeNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeLoadBalancersCommand */ @@ -1661,7 +1094,7 @@ export const de_DescribeLoadBalancersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLoadBalancersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1673,35 +1106,6 @@ export const de_DescribeLoadBalancersCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeLoadBalancersCommandError - */ -const de_DescribeLoadBalancersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyThrottle": - case "com.amazonaws.elasticloadbalancing#DependencyThrottleException": - throw await de_DependencyThrottleExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeTagsCommand */ @@ -1710,7 +1114,7 @@ export const de_DescribeTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1722,32 +1126,6 @@ export const de_DescribeTagsCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeTagsCommandError - */ -const de_DescribeTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDetachLoadBalancerFromSubnetsCommand */ @@ -1756,7 +1134,7 @@ export const de_DetachLoadBalancerFromSubnetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetachLoadBalancerFromSubnetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1764,102 +1142,24 @@ export const de_DetachLoadBalancerFromSubnetsCommand = async ( const response: DetachLoadBalancerFromSubnetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDetachLoadBalancerFromSubnetsCommandError - */ -const de_DetachLoadBalancerFromSubnetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancing#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDisableAvailabilityZonesForLoadBalancerCommand - */ -export const de_DisableAvailabilityZonesForLoadBalancerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisableAvailabilityZonesForLoadBalancerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RemoveAvailabilityZonesOutput(data.DisableAvailabilityZonesForLoadBalancerResult, context); - const response: DisableAvailabilityZonesForLoadBalancerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDisableAvailabilityZonesForLoadBalancerCommandError - */ -const de_DisableAvailabilityZonesForLoadBalancerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancing#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + }; + return response; }; /** - * deserializeAws_queryEnableAvailabilityZonesForLoadBalancerCommand + * deserializeAws_queryDisableAvailabilityZonesForLoadBalancerCommand */ -export const de_EnableAvailabilityZonesForLoadBalancerCommand = async ( +export const de_DisableAvailabilityZonesForLoadBalancerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_EnableAvailabilityZonesForLoadBalancerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_AddAvailabilityZonesOutput(data.EnableAvailabilityZonesForLoadBalancerResult, context); - const response: EnableAvailabilityZonesForLoadBalancerCommandOutput = { + contents = de_RemoveAvailabilityZonesOutput(data.DisableAvailabilityZonesForLoadBalancerResult, context); + const response: DisableAvailabilityZonesForLoadBalancerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1867,29 +1167,23 @@ export const de_EnableAvailabilityZonesForLoadBalancerCommand = async ( }; /** - * deserializeAws_queryEnableAvailabilityZonesForLoadBalancerCommandError + * deserializeAws_queryEnableAvailabilityZonesForLoadBalancerCommand */ -const de_EnableAvailabilityZonesForLoadBalancerCommandError = async ( +export const de_EnableAvailabilityZonesForLoadBalancerCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_AddAvailabilityZonesOutput(data.EnableAvailabilityZonesForLoadBalancerResult, context); + const response: EnableAvailabilityZonesForLoadBalancerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1900,7 +1194,7 @@ export const de_ModifyLoadBalancerAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyLoadBalancerAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1912,38 +1206,6 @@ export const de_ModifyLoadBalancerAttributesCommand = async ( return response; }; -/** - * deserializeAws_queryModifyLoadBalancerAttributesCommandError - */ -const de_ModifyLoadBalancerAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancing#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "LoadBalancerAttributeNotFound": - case "com.amazonaws.elasticloadbalancing#LoadBalancerAttributeNotFoundException": - throw await de_LoadBalancerAttributeNotFoundExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryRegisterInstancesWithLoadBalancerCommand */ @@ -1952,7 +1214,7 @@ export const de_RegisterInstancesWithLoadBalancerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterInstancesWithLoadBalancerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1964,35 +1226,6 @@ export const de_RegisterInstancesWithLoadBalancerCommand = async ( return response; }; -/** - * deserializeAws_queryRegisterInstancesWithLoadBalancerCommandError - */ -const de_RegisterInstancesWithLoadBalancerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInstance": - case "com.amazonaws.elasticloadbalancing#InvalidEndPointException": - throw await de_InvalidEndPointExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryRemoveTagsCommand */ @@ -2001,7 +1234,7 @@ export const de_RemoveTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2013,32 +1246,6 @@ export const de_RemoveTagsCommand = async ( return response; }; -/** - * deserializeAws_queryRemoveTagsCommandError - */ -const de_RemoveTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySetLoadBalancerListenerSSLCertificateCommand */ @@ -2047,7 +1254,7 @@ export const de_SetLoadBalancerListenerSSLCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetLoadBalancerListenerSSLCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2059,44 +1266,6 @@ export const de_SetLoadBalancerListenerSSLCertificateCommand = async ( return response; }; -/** - * deserializeAws_querySetLoadBalancerListenerSSLCertificateCommandError - */ -const de_SetLoadBalancerListenerSSLCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateNotFound": - case "com.amazonaws.elasticloadbalancing#CertificateNotFoundException": - throw await de_CertificateNotFoundExceptionRes(parsedOutput, context); - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancing#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "ListenerNotFound": - case "com.amazonaws.elasticloadbalancing#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedProtocol": - case "com.amazonaws.elasticloadbalancing#UnsupportedProtocolException": - throw await de_UnsupportedProtocolExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySetLoadBalancerPoliciesForBackendServerCommand */ @@ -2105,7 +1274,7 @@ export const de_SetLoadBalancerPoliciesForBackendServerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetLoadBalancerPoliciesForBackendServerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2120,38 +1289,6 @@ export const de_SetLoadBalancerPoliciesForBackendServerCommand = async ( return response; }; -/** - * deserializeAws_querySetLoadBalancerPoliciesForBackendServerCommandError - */ -const de_SetLoadBalancerPoliciesForBackendServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancing#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "LoadBalancerNotFound": - case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": - throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); - case "PolicyNotFound": - case "com.amazonaws.elasticloadbalancing#PolicyNotFoundException": - throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySetLoadBalancerPoliciesOfListenerCommand */ @@ -2160,7 +1297,7 @@ export const de_SetLoadBalancerPoliciesOfListenerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetLoadBalancerPoliciesOfListenerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2173,37 +1310,88 @@ export const de_SetLoadBalancerPoliciesOfListenerCommand = async ( }; /** - * deserializeAws_querySetLoadBalancerPoliciesOfListenerCommandError + * deserialize_Aws_queryCommandError */ -const de_SetLoadBalancerPoliciesOfListenerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { - case "InvalidConfigurationRequest": - case "com.amazonaws.elasticloadbalancing#InvalidConfigurationRequestException": - throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); - case "ListenerNotFound": - case "com.amazonaws.elasticloadbalancing#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); + case "DuplicateTagKeys": + case "com.amazonaws.elasticloadbalancing#DuplicateTagKeysException": + throw await de_DuplicateTagKeysExceptionRes(parsedOutput, context); case "LoadBalancerNotFound": case "com.amazonaws.elasticloadbalancing#AccessPointNotFoundException": throw await de_AccessPointNotFoundExceptionRes(parsedOutput, context); + case "TooManyTags": + case "com.amazonaws.elasticloadbalancing#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "InvalidConfigurationRequest": + case "com.amazonaws.elasticloadbalancing#InvalidConfigurationRequestException": + throw await de_InvalidConfigurationRequestExceptionRes(parsedOutput, context); + case "InvalidSecurityGroup": + case "com.amazonaws.elasticloadbalancing#InvalidSecurityGroupException": + throw await de_InvalidSecurityGroupExceptionRes(parsedOutput, context); + case "InvalidSubnet": + case "com.amazonaws.elasticloadbalancing#InvalidSubnetException": + throw await de_InvalidSubnetExceptionRes(parsedOutput, context); + case "SubnetNotFound": + case "com.amazonaws.elasticloadbalancing#SubnetNotFoundException": + throw await de_SubnetNotFoundExceptionRes(parsedOutput, context); + case "DuplicatePolicyName": + case "com.amazonaws.elasticloadbalancing#DuplicatePolicyNameException": + throw await de_DuplicatePolicyNameExceptionRes(parsedOutput, context); + case "TooManyPolicies": + case "com.amazonaws.elasticloadbalancing#TooManyPoliciesException": + throw await de_TooManyPoliciesExceptionRes(parsedOutput, context); + case "CertificateNotFound": + case "com.amazonaws.elasticloadbalancing#CertificateNotFoundException": + throw await de_CertificateNotFoundExceptionRes(parsedOutput, context); + case "DuplicateLoadBalancerName": + case "com.amazonaws.elasticloadbalancing#DuplicateAccessPointNameException": + throw await de_DuplicateAccessPointNameExceptionRes(parsedOutput, context); + case "InvalidScheme": + case "com.amazonaws.elasticloadbalancing#InvalidSchemeException": + throw await de_InvalidSchemeExceptionRes(parsedOutput, context); + case "OperationNotPermitted": + case "com.amazonaws.elasticloadbalancing#OperationNotPermittedException": + throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); + case "TooManyLoadBalancers": + case "com.amazonaws.elasticloadbalancing#TooManyAccessPointsException": + throw await de_TooManyAccessPointsExceptionRes(parsedOutput, context); + case "UnsupportedProtocol": + case "com.amazonaws.elasticloadbalancing#UnsupportedProtocolException": + throw await de_UnsupportedProtocolExceptionRes(parsedOutput, context); + case "DuplicateListener": + case "com.amazonaws.elasticloadbalancing#DuplicateListenerException": + throw await de_DuplicateListenerExceptionRes(parsedOutput, context); + case "PolicyTypeNotFound": + case "com.amazonaws.elasticloadbalancing#PolicyTypeNotFoundException": + throw await de_PolicyTypeNotFoundExceptionRes(parsedOutput, context); + case "InvalidInstance": + case "com.amazonaws.elasticloadbalancing#InvalidEndPointException": + throw await de_InvalidEndPointExceptionRes(parsedOutput, context); + case "LoadBalancerAttributeNotFound": + case "com.amazonaws.elasticloadbalancing#LoadBalancerAttributeNotFoundException": + throw await de_LoadBalancerAttributeNotFoundExceptionRes(parsedOutput, context); case "PolicyNotFound": case "com.amazonaws.elasticloadbalancing#PolicyNotFoundException": throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); + case "DependencyThrottle": + case "com.amazonaws.elasticloadbalancing#DependencyThrottleException": + throw await de_DependencyThrottleExceptionRes(parsedOutput, context); + case "ListenerNotFound": + case "com.amazonaws.elasticloadbalancing#ListenerNotFoundException": + throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody: parsedBody.Error, errorCode, - }); + }) as never; } }; diff --git a/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts b/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts index 92d021f6475f..8b1f3ef8b41a 100644 --- a/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts +++ b/clients/client-elastic-transcoder/src/protocols/Aws_restJson1.ts @@ -445,7 +445,7 @@ export const de_CancelJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CancelJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -454,47 +454,6 @@ export const de_CancelJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelJobCommandError - */ -const de_CancelJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.elastictranscoder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elastictranscoder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateJobCommand */ @@ -503,7 +462,7 @@ export const de_CreateJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -516,47 +475,6 @@ export const de_CreateJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateJobCommandError - */ -const de_CreateJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.elastictranscoder#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elastictranscoder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePipelineCommand */ @@ -565,7 +483,7 @@ export const de_CreatePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreatePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -579,47 +497,6 @@ export const de_CreatePipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePipelineCommandError - */ -const de_CreatePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.elastictranscoder#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elastictranscoder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePresetCommand */ @@ -628,7 +505,7 @@ export const de_CreatePresetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreatePresetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -642,44 +519,6 @@ export const de_CreatePresetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePresetCommandError - */ -const de_CreatePresetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.elastictranscoder#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePipelineCommand */ @@ -688,7 +527,7 @@ export const de_DeletePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeletePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -697,47 +536,6 @@ export const de_DeletePipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePipelineCommandError - */ -const de_DeletePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.elastictranscoder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elastictranscoder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePresetCommand */ @@ -746,7 +544,7 @@ export const de_DeletePresetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeletePresetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -755,44 +553,6 @@ export const de_DeletePresetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePresetCommandError - */ -const de_DeletePresetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elastictranscoder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListJobsByPipelineCommand */ @@ -801,7 +561,7 @@ export const de_ListJobsByPipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobsByPipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -815,44 +575,6 @@ export const de_ListJobsByPipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListJobsByPipelineCommandError - */ -const de_ListJobsByPipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elastictranscoder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListJobsByStatusCommand */ @@ -861,7 +583,7 @@ export const de_ListJobsByStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobsByStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -875,44 +597,6 @@ export const de_ListJobsByStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListJobsByStatusCommandError - */ -const de_ListJobsByStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elastictranscoder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPipelinesCommand */ @@ -921,7 +605,7 @@ export const de_ListPipelinesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPipelinesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -931,43 +615,8 @@ export const de_ListPipelinesCommand = async ( NextPageToken: __expectString, Pipelines: _json, }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPipelinesCommandError - */ -const de_ListPipelinesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Object.assign(contents, doc); + return contents; }; /** @@ -978,7 +627,7 @@ export const de_ListPresetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPresetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -992,41 +641,6 @@ export const de_ListPresetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListPresetsCommandError - */ -const de_ListPresetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ReadJobCommand */ @@ -1035,7 +649,7 @@ export const de_ReadJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ReadJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1048,44 +662,6 @@ export const de_ReadJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ReadJobCommandError - */ -const de_ReadJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elastictranscoder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ReadPipelineCommand */ @@ -1094,7 +670,7 @@ export const de_ReadPipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ReadPipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1108,44 +684,6 @@ export const de_ReadPipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ReadPipelineCommandError - */ -const de_ReadPipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elastictranscoder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ReadPresetCommand */ @@ -1154,7 +692,7 @@ export const de_ReadPresetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ReadPresetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1167,44 +705,6 @@ export const de_ReadPresetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ReadPresetCommandError - */ -const de_ReadPresetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elastictranscoder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TestRoleCommand */ @@ -1213,7 +713,7 @@ export const de_TestRoleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TestRoleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1227,44 +727,6 @@ export const de_TestRoleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TestRoleCommandError - */ -const de_TestRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elastictranscoder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePipelineCommand */ @@ -1273,7 +735,7 @@ export const de_UpdatePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1287,47 +749,6 @@ export const de_UpdatePipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePipelineCommandError - */ -const de_UpdatePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.elastictranscoder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elastictranscoder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePipelineNotificationsCommand */ @@ -1336,7 +757,7 @@ export const de_UpdatePipelineNotificationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePipelineNotificationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1349,47 +770,6 @@ export const de_UpdatePipelineNotificationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePipelineNotificationsCommandError - */ -const de_UpdatePipelineNotificationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elastictranscoder#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleVersionException": - case "com.amazonaws.elastictranscoder#IncompatibleVersionException": - throw await de_IncompatibleVersionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.elastictranscoder#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.elastictranscoder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elastictranscoder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elastictranscoder#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePipelineStatusCommand */ @@ -1398,7 +778,7 @@ export const de_UpdatePipelineStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePipelineStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1412,12 +792,9 @@ export const de_UpdatePipelineStatusCommand = async ( }; /** - * deserializeAws_restJson1UpdatePipelineStatusCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdatePipelineStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1442,13 +819,16 @@ const de_UpdatePipelineStatusCommandError = async ( case "ValidationException": case "com.amazonaws.elastictranscoder#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.elastictranscoder#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-elasticache/src/protocols/Aws_query.ts b/clients/client-elasticache/src/protocols/Aws_query.ts index 121679cb0364..066540a7a610 100644 --- a/clients/client-elasticache/src/protocols/Aws_query.ts +++ b/clients/client-elasticache/src/protocols/Aws_query.ts @@ -1831,7 +1831,7 @@ export const de_AddTagsToResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsToResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1843,77 +1843,6 @@ export const de_AddTagsToResourceCommand = async ( return response; }; -/** - * deserializeAws_queryAddTagsToResourceCommandError - */ -const de_AddTagsToResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheClusterNotFound": - case "com.amazonaws.elasticache#CacheClusterNotFoundFault": - throw await de_CacheClusterNotFoundFaultRes(parsedOutput, context); - case "CacheParameterGroupNotFound": - case "com.amazonaws.elasticache#CacheParameterGroupNotFoundFault": - throw await de_CacheParameterGroupNotFoundFaultRes(parsedOutput, context); - case "CacheSecurityGroupNotFound": - case "com.amazonaws.elasticache#CacheSecurityGroupNotFoundFault": - throw await de_CacheSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "CacheSubnetGroupNotFoundFault": - case "com.amazonaws.elasticache#CacheSubnetGroupNotFoundFault": - throw await de_CacheSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidARN": - case "com.amazonaws.elasticache#InvalidARNFault": - throw await de_InvalidARNFaultRes(parsedOutput, context); - case "InvalidReplicationGroupState": - case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": - throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidServerlessCacheSnapshotStateFault": - case "com.amazonaws.elasticache#InvalidServerlessCacheSnapshotStateFault": - throw await de_InvalidServerlessCacheSnapshotStateFaultRes(parsedOutput, context); - case "InvalidServerlessCacheStateFault": - case "com.amazonaws.elasticache#InvalidServerlessCacheStateFault": - throw await de_InvalidServerlessCacheStateFaultRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "ReservedCacheNodeNotFound": - case "com.amazonaws.elasticache#ReservedCacheNodeNotFoundFault": - throw await de_ReservedCacheNodeNotFoundFaultRes(parsedOutput, context); - case "ServerlessCacheNotFoundFault": - case "com.amazonaws.elasticache#ServerlessCacheNotFoundFault": - throw await de_ServerlessCacheNotFoundFaultRes(parsedOutput, context); - case "ServerlessCacheSnapshotNotFoundFault": - case "com.amazonaws.elasticache#ServerlessCacheSnapshotNotFoundFault": - throw await de_ServerlessCacheSnapshotNotFoundFaultRes(parsedOutput, context); - case "SnapshotNotFoundFault": - case "com.amazonaws.elasticache#SnapshotNotFoundFault": - throw await de_SnapshotNotFoundFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.elasticache#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - case "UserGroupNotFound": - case "com.amazonaws.elasticache#UserGroupNotFoundFault": - throw await de_UserGroupNotFoundFaultRes(parsedOutput, context); - case "UserNotFound": - case "com.amazonaws.elasticache#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAuthorizeCacheSecurityGroupIngressCommand */ @@ -1922,7 +1851,7 @@ export const de_AuthorizeCacheSecurityGroupIngressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AuthorizeCacheSecurityGroupIngressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1934,44 +1863,6 @@ export const de_AuthorizeCacheSecurityGroupIngressCommand = async ( return response; }; -/** - * deserializeAws_queryAuthorizeCacheSecurityGroupIngressCommandError - */ -const de_AuthorizeCacheSecurityGroupIngressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationAlreadyExists": - case "com.amazonaws.elasticache#AuthorizationAlreadyExistsFault": - throw await de_AuthorizationAlreadyExistsFaultRes(parsedOutput, context); - case "CacheSecurityGroupNotFound": - case "com.amazonaws.elasticache#CacheSecurityGroupNotFoundFault": - throw await de_CacheSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidCacheSecurityGroupState": - case "com.amazonaws.elasticache#InvalidCacheSecurityGroupStateFault": - throw await de_InvalidCacheSecurityGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryBatchApplyUpdateActionCommand */ @@ -1980,7 +1871,7 @@ export const de_BatchApplyUpdateActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchApplyUpdateActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1992,35 +1883,6 @@ export const de_BatchApplyUpdateActionCommand = async ( return response; }; -/** - * deserializeAws_queryBatchApplyUpdateActionCommandError - */ -const de_BatchApplyUpdateActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceUpdateNotFoundFault": - case "com.amazonaws.elasticache#ServiceUpdateNotFoundFault": - throw await de_ServiceUpdateNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryBatchStopUpdateActionCommand */ @@ -2029,7 +1891,7 @@ export const de_BatchStopUpdateActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchStopUpdateActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2041,35 +1903,6 @@ export const de_BatchStopUpdateActionCommand = async ( return response; }; -/** - * deserializeAws_queryBatchStopUpdateActionCommandError - */ -const de_BatchStopUpdateActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceUpdateNotFoundFault": - case "com.amazonaws.elasticache#ServiceUpdateNotFoundFault": - throw await de_ServiceUpdateNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCompleteMigrationCommand */ @@ -2078,7 +1911,7 @@ export const de_CompleteMigrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CompleteMigrationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2090,38 +1923,6 @@ export const de_CompleteMigrationCommand = async ( return response; }; -/** - * deserializeAws_queryCompleteMigrationCommandError - */ -const de_CompleteMigrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidReplicationGroupState": - case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": - throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "ReplicationGroupNotUnderMigrationFault": - case "com.amazonaws.elasticache#ReplicationGroupNotUnderMigrationFault": - throw await de_ReplicationGroupNotUnderMigrationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCopyServerlessCacheSnapshotCommand */ @@ -2130,7 +1931,7 @@ export const de_CopyServerlessCacheSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopyServerlessCacheSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2143,66 +1944,39 @@ export const de_CopyServerlessCacheSnapshotCommand = async ( }; /** - * deserializeAws_queryCopyServerlessCacheSnapshotCommandError + * deserializeAws_queryCopySnapshotCommand */ -const de_CopyServerlessCacheSnapshotCommandError = async ( +export const de_CopySnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidServerlessCacheSnapshotStateFault": - case "com.amazonaws.elasticache#InvalidServerlessCacheSnapshotStateFault": - throw await de_InvalidServerlessCacheSnapshotStateFaultRes(parsedOutput, context); - case "ServerlessCacheSnapshotAlreadyExistsFault": - case "com.amazonaws.elasticache#ServerlessCacheSnapshotAlreadyExistsFault": - throw await de_ServerlessCacheSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "ServerlessCacheSnapshotNotFoundFault": - case "com.amazonaws.elasticache#ServerlessCacheSnapshotNotFoundFault": - throw await de_ServerlessCacheSnapshotNotFoundFaultRes(parsedOutput, context); - case "ServerlessCacheSnapshotQuotaExceededFault": - case "com.amazonaws.elasticache#ServerlessCacheSnapshotQuotaExceededFault": - throw await de_ServerlessCacheSnapshotQuotaExceededFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.elasticache#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CopySnapshotResult(data.CopySnapshotResult, context); + const response: CopySnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCopySnapshotCommand + * deserializeAws_queryCreateCacheClusterCommand */ -export const de_CopySnapshotCommand = async ( +export const de_CreateCacheClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CopySnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CopySnapshotResult(data.CopySnapshotResult, context); - const response: CopySnapshotCommandOutput = { + contents = de_CreateCacheClusterResult(data.CreateCacheClusterResult, context); + const response: CreateCacheClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2210,63 +1984,39 @@ export const de_CopySnapshotCommand = async ( }; /** - * deserializeAws_queryCopySnapshotCommandError + * deserializeAws_queryCreateCacheParameterGroupCommand */ -const de_CopySnapshotCommandError = async ( +export const de_CreateCacheParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidSnapshotState": - case "com.amazonaws.elasticache#InvalidSnapshotStateFault": - throw await de_InvalidSnapshotStateFaultRes(parsedOutput, context); - case "SnapshotAlreadyExistsFault": - case "com.amazonaws.elasticache#SnapshotAlreadyExistsFault": - throw await de_SnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "SnapshotNotFoundFault": - case "com.amazonaws.elasticache#SnapshotNotFoundFault": - throw await de_SnapshotNotFoundFaultRes(parsedOutput, context); - case "SnapshotQuotaExceededFault": - case "com.amazonaws.elasticache#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.elasticache#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateCacheParameterGroupResult(data.CreateCacheParameterGroupResult, context); + const response: CreateCacheParameterGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateCacheClusterCommand + * deserializeAws_queryCreateCacheSecurityGroupCommand */ -export const de_CreateCacheClusterCommand = async ( +export const de_CreateCacheSecurityGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateCacheClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateCacheClusterResult(data.CreateCacheClusterResult, context); - const response: CreateCacheClusterCommandOutput = { + contents = de_CreateCacheSecurityGroupResult(data.CreateCacheSecurityGroupResult, context); + const response: CreateCacheSecurityGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2274,84 +2024,39 @@ export const de_CreateCacheClusterCommand = async ( }; /** - * deserializeAws_queryCreateCacheClusterCommandError + * deserializeAws_queryCreateCacheSubnetGroupCommand */ -const de_CreateCacheClusterCommandError = async ( +export const de_CreateCacheSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheClusterAlreadyExists": - case "com.amazonaws.elasticache#CacheClusterAlreadyExistsFault": - throw await de_CacheClusterAlreadyExistsFaultRes(parsedOutput, context); - case "CacheParameterGroupNotFound": - case "com.amazonaws.elasticache#CacheParameterGroupNotFoundFault": - throw await de_CacheParameterGroupNotFoundFaultRes(parsedOutput, context); - case "CacheSecurityGroupNotFound": - case "com.amazonaws.elasticache#CacheSecurityGroupNotFoundFault": - throw await de_CacheSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "CacheSubnetGroupNotFoundFault": - case "com.amazonaws.elasticache#CacheSubnetGroupNotFoundFault": - throw await de_CacheSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "ClusterQuotaForCustomerExceeded": - case "com.amazonaws.elasticache#ClusterQuotaForCustomerExceededFault": - throw await de_ClusterQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "InsufficientCacheClusterCapacity": - case "com.amazonaws.elasticache#InsufficientCacheClusterCapacityFault": - throw await de_InsufficientCacheClusterCapacityFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidReplicationGroupState": - case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": - throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.elasticache#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "NodeQuotaForClusterExceeded": - case "com.amazonaws.elasticache#NodeQuotaForClusterExceededFault": - throw await de_NodeQuotaForClusterExceededFaultRes(parsedOutput, context); - case "NodeQuotaForCustomerExceeded": - case "com.amazonaws.elasticache#NodeQuotaForCustomerExceededFault": - throw await de_NodeQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.elasticache#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateCacheSubnetGroupResult(data.CreateCacheSubnetGroupResult, context); + const response: CreateCacheSubnetGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateCacheParameterGroupCommand + * deserializeAws_queryCreateGlobalReplicationGroupCommand */ -export const de_CreateCacheParameterGroupCommand = async ( +export const de_CreateGlobalReplicationGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateCacheParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateCacheParameterGroupResult(data.CreateCacheParameterGroupResult, context); - const response: CreateCacheParameterGroupCommandOutput = { + contents = de_CreateGlobalReplicationGroupResult(data.CreateGlobalReplicationGroupResult, context); + const response: CreateGlobalReplicationGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2359,60 +2064,39 @@ export const de_CreateCacheParameterGroupCommand = async ( }; /** - * deserializeAws_queryCreateCacheParameterGroupCommandError + * deserializeAws_queryCreateReplicationGroupCommand */ -const de_CreateCacheParameterGroupCommandError = async ( +export const de_CreateReplicationGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheParameterGroupAlreadyExists": - case "com.amazonaws.elasticache#CacheParameterGroupAlreadyExistsFault": - throw await de_CacheParameterGroupAlreadyExistsFaultRes(parsedOutput, context); - case "CacheParameterGroupQuotaExceeded": - case "com.amazonaws.elasticache#CacheParameterGroupQuotaExceededFault": - throw await de_CacheParameterGroupQuotaExceededFaultRes(parsedOutput, context); - case "InvalidCacheParameterGroupState": - case "com.amazonaws.elasticache#InvalidCacheParameterGroupStateFault": - throw await de_InvalidCacheParameterGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.elasticache#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateReplicationGroupResult(data.CreateReplicationGroupResult, context); + const response: CreateReplicationGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateCacheSecurityGroupCommand + * deserializeAws_queryCreateServerlessCacheCommand */ -export const de_CreateCacheSecurityGroupCommand = async ( +export const de_CreateServerlessCacheCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateCacheSecurityGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateCacheSecurityGroupResult(data.CreateCacheSecurityGroupResult, context); - const response: CreateCacheSecurityGroupCommandOutput = { + contents = de_CreateServerlessCacheResponse(data.CreateServerlessCacheResult, context); + const response: CreateServerlessCacheCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2420,57 +2104,39 @@ export const de_CreateCacheSecurityGroupCommand = async ( }; /** - * deserializeAws_queryCreateCacheSecurityGroupCommandError + * deserializeAws_queryCreateServerlessCacheSnapshotCommand */ -const de_CreateCacheSecurityGroupCommandError = async ( +export const de_CreateServerlessCacheSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheSecurityGroupAlreadyExists": - case "com.amazonaws.elasticache#CacheSecurityGroupAlreadyExistsFault": - throw await de_CacheSecurityGroupAlreadyExistsFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "QuotaExceeded.CacheSecurityGroup": - case "com.amazonaws.elasticache#CacheSecurityGroupQuotaExceededFault": - throw await de_CacheSecurityGroupQuotaExceededFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.elasticache#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateServerlessCacheSnapshotResponse(data.CreateServerlessCacheSnapshotResult, context); + const response: CreateServerlessCacheSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateCacheSubnetGroupCommand + * deserializeAws_queryCreateSnapshotCommand */ -export const de_CreateCacheSubnetGroupCommand = async ( +export const de_CreateSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateCacheSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateCacheSubnetGroupResult(data.CreateCacheSubnetGroupResult, context); - const response: CreateCacheSubnetGroupCommandOutput = { + contents = de_CreateSnapshotResult(data.CreateSnapshotResult, context); + const response: CreateSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2478,60 +2144,39 @@ export const de_CreateCacheSubnetGroupCommand = async ( }; /** - * deserializeAws_queryCreateCacheSubnetGroupCommandError + * deserializeAws_queryCreateUserCommand */ -const de_CreateCacheSubnetGroupCommandError = async ( +export const de_CreateUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_User(data.CreateUserResult, context); + const response: CreateUserCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheSubnetGroupAlreadyExists": - case "com.amazonaws.elasticache#CacheSubnetGroupAlreadyExistsFault": - throw await de_CacheSubnetGroupAlreadyExistsFaultRes(parsedOutput, context); - case "CacheSubnetGroupQuotaExceeded": - case "com.amazonaws.elasticache#CacheSubnetGroupQuotaExceededFault": - throw await de_CacheSubnetGroupQuotaExceededFaultRes(parsedOutput, context); - case "CacheSubnetQuotaExceededFault": - case "com.amazonaws.elasticache#CacheSubnetQuotaExceededFault": - throw await de_CacheSubnetQuotaExceededFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.elasticache#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "SubnetNotAllowedFault": - case "com.amazonaws.elasticache#SubnetNotAllowedFault": - throw await de_SubnetNotAllowedFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.elasticache#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + return response; }; /** - * deserializeAws_queryCreateGlobalReplicationGroupCommand + * deserializeAws_queryCreateUserGroupCommand */ -export const de_CreateGlobalReplicationGroupCommand = async ( +export const de_CreateUserGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateGlobalReplicationGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateGlobalReplicationGroupResult(data.CreateGlobalReplicationGroupResult, context); - const response: CreateGlobalReplicationGroupCommandOutput = { + contents = de_UserGroup(data.CreateUserGroupResult, context); + const response: CreateUserGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2539,57 +2184,42 @@ export const de_CreateGlobalReplicationGroupCommand = async ( }; /** - * deserializeAws_queryCreateGlobalReplicationGroupCommandError + * deserializeAws_queryDecreaseNodeGroupsInGlobalReplicationGroupCommand */ -const de_CreateGlobalReplicationGroupCommandError = async ( +export const de_DecreaseNodeGroupsInGlobalReplicationGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalReplicationGroupAlreadyExistsFault": - case "com.amazonaws.elasticache#GlobalReplicationGroupAlreadyExistsFault": - throw await de_GlobalReplicationGroupAlreadyExistsFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidReplicationGroupState": - case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": - throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DecreaseNodeGroupsInGlobalReplicationGroupResult( + data.DecreaseNodeGroupsInGlobalReplicationGroupResult, + context + ); + const response: DecreaseNodeGroupsInGlobalReplicationGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateReplicationGroupCommand + * deserializeAws_queryDecreaseReplicaCountCommand */ -export const de_CreateReplicationGroupCommand = async ( +export const de_DecreaseReplicaCountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateReplicationGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateReplicationGroupResult(data.CreateReplicationGroupResult, context); - const response: CreateReplicationGroupCommandOutput = { + contents = de_DecreaseReplicaCountResult(data.DecreaseReplicaCountResult, context); + const response: DecreaseReplicaCountCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2597,242 +2227,110 @@ export const de_CreateReplicationGroupCommand = async ( }; /** - * deserializeAws_queryCreateReplicationGroupCommandError + * deserializeAws_queryDeleteCacheClusterCommand */ -const de_CreateReplicationGroupCommandError = async ( +export const de_DeleteCacheClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheClusterNotFound": - case "com.amazonaws.elasticache#CacheClusterNotFoundFault": - throw await de_CacheClusterNotFoundFaultRes(parsedOutput, context); - case "CacheParameterGroupNotFound": - case "com.amazonaws.elasticache#CacheParameterGroupNotFoundFault": - throw await de_CacheParameterGroupNotFoundFaultRes(parsedOutput, context); - case "CacheSecurityGroupNotFound": - case "com.amazonaws.elasticache#CacheSecurityGroupNotFoundFault": - throw await de_CacheSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "CacheSubnetGroupNotFoundFault": - case "com.amazonaws.elasticache#CacheSubnetGroupNotFoundFault": - throw await de_CacheSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "ClusterQuotaForCustomerExceeded": - case "com.amazonaws.elasticache#ClusterQuotaForCustomerExceededFault": - throw await de_ClusterQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "GlobalReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#GlobalReplicationGroupNotFoundFault": - throw await de_GlobalReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "InsufficientCacheClusterCapacity": - case "com.amazonaws.elasticache#InsufficientCacheClusterCapacityFault": - throw await de_InsufficientCacheClusterCapacityFaultRes(parsedOutput, context); - case "InvalidCacheClusterState": - case "com.amazonaws.elasticache#InvalidCacheClusterStateFault": - throw await de_InvalidCacheClusterStateFaultRes(parsedOutput, context); - case "InvalidGlobalReplicationGroupState": - case "com.amazonaws.elasticache#InvalidGlobalReplicationGroupStateFault": - throw await de_InvalidGlobalReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidUserGroupState": - case "com.amazonaws.elasticache#InvalidUserGroupStateFault": - throw await de_InvalidUserGroupStateFaultRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.elasticache#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "NodeGroupsPerReplicationGroupQuotaExceeded": - case "com.amazonaws.elasticache#NodeGroupsPerReplicationGroupQuotaExceededFault": - throw await de_NodeGroupsPerReplicationGroupQuotaExceededFaultRes(parsedOutput, context); - case "NodeQuotaForClusterExceeded": - case "com.amazonaws.elasticache#NodeQuotaForClusterExceededFault": - throw await de_NodeQuotaForClusterExceededFaultRes(parsedOutput, context); - case "NodeQuotaForCustomerExceeded": - case "com.amazonaws.elasticache#NodeQuotaForCustomerExceededFault": - throw await de_NodeQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "ReplicationGroupAlreadyExists": - case "com.amazonaws.elasticache#ReplicationGroupAlreadyExistsFault": - throw await de_ReplicationGroupAlreadyExistsFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.elasticache#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - case "UserGroupNotFound": - case "com.amazonaws.elasticache#UserGroupNotFoundFault": - throw await de_UserGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteCacheClusterResult(data.DeleteCacheClusterResult, context); + const response: DeleteCacheClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateServerlessCacheCommand + * deserializeAws_queryDeleteCacheParameterGroupCommand */ -export const de_CreateServerlessCacheCommand = async ( +export const de_DeleteCacheParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateServerlessCacheCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateServerlessCacheResponse(data.CreateServerlessCacheResult, context); - const response: CreateServerlessCacheCommandOutput = { + await collectBody(output.body, context); + const response: DeleteCacheParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_queryCreateServerlessCacheCommandError + * deserializeAws_queryDeleteCacheSecurityGroupCommand */ -const de_CreateServerlessCacheCommandError = async ( +export const de_DeleteCacheSecurityGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidCredentialsException": - case "com.amazonaws.elasticache#InvalidCredentialsException": - throw await de_InvalidCredentialsExceptionRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidServerlessCacheStateFault": - case "com.amazonaws.elasticache#InvalidServerlessCacheStateFault": - throw await de_InvalidServerlessCacheStateFaultRes(parsedOutput, context); - case "InvalidUserGroupState": - case "com.amazonaws.elasticache#InvalidUserGroupStateFault": - throw await de_InvalidUserGroupStateFaultRes(parsedOutput, context); - case "ServerlessCacheAlreadyExistsFault": - case "com.amazonaws.elasticache#ServerlessCacheAlreadyExistsFault": - throw await de_ServerlessCacheAlreadyExistsFaultRes(parsedOutput, context); - case "ServerlessCacheNotFoundFault": - case "com.amazonaws.elasticache#ServerlessCacheNotFoundFault": - throw await de_ServerlessCacheNotFoundFaultRes(parsedOutput, context); - case "ServerlessCacheQuotaForCustomerExceededFault": - case "com.amazonaws.elasticache#ServerlessCacheQuotaForCustomerExceededFault": - throw await de_ServerlessCacheQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.elasticache#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - case "UserGroupNotFound": - case "com.amazonaws.elasticache#UserGroupNotFoundFault": - throw await de_UserGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteCacheSecurityGroupCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateServerlessCacheSnapshotCommand + * deserializeAws_queryDeleteCacheSubnetGroupCommand */ -export const de_CreateServerlessCacheSnapshotCommand = async ( +export const de_DeleteCacheSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateServerlessCacheSnapshotCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateServerlessCacheSnapshotResponse(data.CreateServerlessCacheSnapshotResult, context); - const response: CreateServerlessCacheSnapshotCommandOutput = { + await collectBody(output.body, context); + const response: DeleteCacheSubnetGroupCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_queryCreateServerlessCacheSnapshotCommandError + * deserializeAws_queryDeleteGlobalReplicationGroupCommand */ -const de_CreateServerlessCacheSnapshotCommandError = async ( +export const de_DeleteGlobalReplicationGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidServerlessCacheStateFault": - case "com.amazonaws.elasticache#InvalidServerlessCacheStateFault": - throw await de_InvalidServerlessCacheStateFaultRes(parsedOutput, context); - case "ServerlessCacheNotFoundFault": - case "com.amazonaws.elasticache#ServerlessCacheNotFoundFault": - throw await de_ServerlessCacheNotFoundFaultRes(parsedOutput, context); - case "ServerlessCacheSnapshotAlreadyExistsFault": - case "com.amazonaws.elasticache#ServerlessCacheSnapshotAlreadyExistsFault": - throw await de_ServerlessCacheSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "ServerlessCacheSnapshotQuotaExceededFault": - case "com.amazonaws.elasticache#ServerlessCacheSnapshotQuotaExceededFault": - throw await de_ServerlessCacheSnapshotQuotaExceededFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.elasticache#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteGlobalReplicationGroupResult(data.DeleteGlobalReplicationGroupResult, context); + const response: DeleteGlobalReplicationGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateSnapshotCommand + * deserializeAws_queryDeleteReplicationGroupCommand */ -export const de_CreateSnapshotCommand = async ( +export const de_DeleteReplicationGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateSnapshotResult(data.CreateSnapshotResult, context); - const response: CreateSnapshotCommandOutput = { + contents = de_DeleteReplicationGroupResult(data.DeleteReplicationGroupResult, context); + const response: DeleteReplicationGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2840,72 +2338,39 @@ export const de_CreateSnapshotCommand = async ( }; /** - * deserializeAws_queryCreateSnapshotCommandError + * deserializeAws_queryDeleteServerlessCacheCommand */ -const de_CreateSnapshotCommandError = async ( +export const de_DeleteServerlessCacheCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheClusterNotFound": - case "com.amazonaws.elasticache#CacheClusterNotFoundFault": - throw await de_CacheClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidCacheClusterState": - case "com.amazonaws.elasticache#InvalidCacheClusterStateFault": - throw await de_InvalidCacheClusterStateFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidReplicationGroupState": - case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": - throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "SnapshotAlreadyExistsFault": - case "com.amazonaws.elasticache#SnapshotAlreadyExistsFault": - throw await de_SnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "SnapshotFeatureNotSupportedFault": - case "com.amazonaws.elasticache#SnapshotFeatureNotSupportedFault": - throw await de_SnapshotFeatureNotSupportedFaultRes(parsedOutput, context); - case "SnapshotQuotaExceededFault": - case "com.amazonaws.elasticache#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.elasticache#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteServerlessCacheResponse(data.DeleteServerlessCacheResult, context); + const response: DeleteServerlessCacheCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateUserCommand + * deserializeAws_queryDeleteServerlessCacheSnapshotCommand */ -export const de_CreateUserCommand = async ( +export const de_DeleteServerlessCacheSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_User(data.CreateUserResult, context); - const response: CreateUserCommandOutput = { + contents = de_DeleteServerlessCacheSnapshotResponse(data.DeleteServerlessCacheSnapshotResult, context); + const response: DeleteServerlessCacheSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2913,63 +2378,39 @@ export const de_CreateUserCommand = async ( }; /** - * deserializeAws_queryCreateUserCommandError + * deserializeAws_queryDeleteSnapshotCommand */ -const de_CreateUserCommandError = async ( +export const de_DeleteSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateUserName": - case "com.amazonaws.elasticache#DuplicateUserNameFault": - throw await de_DuplicateUserNameFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.elasticache#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - case "UserAlreadyExists": - case "com.amazonaws.elasticache#UserAlreadyExistsFault": - throw await de_UserAlreadyExistsFaultRes(parsedOutput, context); - case "UserQuotaExceeded": - case "com.amazonaws.elasticache#UserQuotaExceededFault": - throw await de_UserQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteSnapshotResult(data.DeleteSnapshotResult, context); + const response: DeleteSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateUserGroupCommand + * deserializeAws_queryDeleteUserCommand */ -export const de_CreateUserGroupCommand = async ( +export const de_DeleteUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateUserGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UserGroup(data.CreateUserGroupResult, context); - const response: CreateUserGroupCommandOutput = { + contents = de_User(data.DeleteUserResult, context); + const response: DeleteUserCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2977,69 +2418,39 @@ export const de_CreateUserGroupCommand = async ( }; /** - * deserializeAws_queryCreateUserGroupCommandError + * deserializeAws_queryDeleteUserGroupCommand */ -const de_CreateUserGroupCommandError = async ( +export const de_DeleteUserGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DefaultUserRequired": - case "com.amazonaws.elasticache#DefaultUserRequired": - throw await de_DefaultUserRequiredRes(parsedOutput, context); - case "DuplicateUserName": - case "com.amazonaws.elasticache#DuplicateUserNameFault": - throw await de_DuplicateUserNameFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.elasticache#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - case "UserGroupAlreadyExists": - case "com.amazonaws.elasticache#UserGroupAlreadyExistsFault": - throw await de_UserGroupAlreadyExistsFaultRes(parsedOutput, context); - case "UserGroupQuotaExceeded": - case "com.amazonaws.elasticache#UserGroupQuotaExceededFault": - throw await de_UserGroupQuotaExceededFaultRes(parsedOutput, context); - case "UserNotFound": - case "com.amazonaws.elasticache#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UserGroup(data.DeleteUserGroupResult, context); + const response: DeleteUserGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDecreaseNodeGroupsInGlobalReplicationGroupCommand + * deserializeAws_queryDescribeCacheClustersCommand */ -export const de_DecreaseNodeGroupsInGlobalReplicationGroupCommand = async ( +export const de_DescribeCacheClustersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DecreaseNodeGroupsInGlobalReplicationGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DecreaseNodeGroupsInGlobalReplicationGroupResult( - data.DecreaseNodeGroupsInGlobalReplicationGroupResult, - context - ); - const response: DecreaseNodeGroupsInGlobalReplicationGroupCommandOutput = { + contents = de_CacheClusterMessage(data.DescribeCacheClustersResult, context); + const response: DescribeCacheClustersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3047,54 +2458,39 @@ export const de_DecreaseNodeGroupsInGlobalReplicationGroupCommand = async ( }; /** - * deserializeAws_queryDecreaseNodeGroupsInGlobalReplicationGroupCommandError + * deserializeAws_queryDescribeCacheEngineVersionsCommand */ -const de_DecreaseNodeGroupsInGlobalReplicationGroupCommandError = async ( +export const de_DescribeCacheEngineVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CacheEngineVersionMessage(data.DescribeCacheEngineVersionsResult, context); + const response: DescribeCacheEngineVersionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#GlobalReplicationGroupNotFoundFault": - throw await de_GlobalReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidGlobalReplicationGroupState": - case "com.amazonaws.elasticache#InvalidGlobalReplicationGroupStateFault": - throw await de_InvalidGlobalReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + return response; }; /** - * deserializeAws_queryDecreaseReplicaCountCommand + * deserializeAws_queryDescribeCacheParameterGroupsCommand */ -export const de_DecreaseReplicaCountCommand = async ( +export const de_DescribeCacheParameterGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DecreaseReplicaCountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DecreaseReplicaCountResult(data.DecreaseReplicaCountResult, context); - const response: DecreaseReplicaCountCommandOutput = { + contents = de_CacheParameterGroupsMessage(data.DescribeCacheParameterGroupsResult, context); + const response: DescribeCacheParameterGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3102,78 +2498,39 @@ export const de_DecreaseReplicaCountCommand = async ( }; /** - * deserializeAws_queryDecreaseReplicaCountCommandError + * deserializeAws_queryDescribeCacheParametersCommand */ -const de_DecreaseReplicaCountCommandError = async ( +export const de_DescribeCacheParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterQuotaForCustomerExceeded": - case "com.amazonaws.elasticache#ClusterQuotaForCustomerExceededFault": - throw await de_ClusterQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "InsufficientCacheClusterCapacity": - case "com.amazonaws.elasticache#InsufficientCacheClusterCapacityFault": - throw await de_InsufficientCacheClusterCapacityFaultRes(parsedOutput, context); - case "InvalidCacheClusterState": - case "com.amazonaws.elasticache#InvalidCacheClusterStateFault": - throw await de_InvalidCacheClusterStateFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidReplicationGroupState": - case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": - throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.elasticache#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "NoOperationFault": - case "com.amazonaws.elasticache#NoOperationFault": - throw await de_NoOperationFaultRes(parsedOutput, context); - case "NodeGroupsPerReplicationGroupQuotaExceeded": - case "com.amazonaws.elasticache#NodeGroupsPerReplicationGroupQuotaExceededFault": - throw await de_NodeGroupsPerReplicationGroupQuotaExceededFaultRes(parsedOutput, context); - case "NodeQuotaForCustomerExceeded": - case "com.amazonaws.elasticache#NodeQuotaForCustomerExceededFault": - throw await de_NodeQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CacheParameterGroupDetails(data.DescribeCacheParametersResult, context); + const response: DescribeCacheParametersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteCacheClusterCommand + * deserializeAws_queryDescribeCacheSecurityGroupsCommand */ -export const de_DeleteCacheClusterCommand = async ( +export const de_DescribeCacheSecurityGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteCacheClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteCacheClusterResult(data.DeleteCacheClusterResult, context); - const response: DeleteCacheClusterCommandOutput = { + contents = de_CacheSecurityGroupMessage(data.DescribeCacheSecurityGroupsResult, context); + const response: DescribeCacheSecurityGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3181,213 +2538,139 @@ export const de_DeleteCacheClusterCommand = async ( }; /** - * deserializeAws_queryDeleteCacheClusterCommandError + * deserializeAws_queryDescribeCacheSubnetGroupsCommand */ -const de_DeleteCacheClusterCommandError = async ( +export const de_DescribeCacheSubnetGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheClusterNotFound": - case "com.amazonaws.elasticache#CacheClusterNotFoundFault": - throw await de_CacheClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidCacheClusterState": - case "com.amazonaws.elasticache#InvalidCacheClusterStateFault": - throw await de_InvalidCacheClusterStateFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "SnapshotAlreadyExistsFault": - case "com.amazonaws.elasticache#SnapshotAlreadyExistsFault": - throw await de_SnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "SnapshotFeatureNotSupportedFault": - case "com.amazonaws.elasticache#SnapshotFeatureNotSupportedFault": - throw await de_SnapshotFeatureNotSupportedFaultRes(parsedOutput, context); - case "SnapshotQuotaExceededFault": - case "com.amazonaws.elasticache#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CacheSubnetGroupMessage(data.DescribeCacheSubnetGroupsResult, context); + const response: DescribeCacheSubnetGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteCacheParameterGroupCommand + * deserializeAws_queryDescribeEngineDefaultParametersCommand */ -export const de_DeleteCacheParameterGroupCommand = async ( +export const de_DescribeEngineDefaultParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteCacheParameterGroupCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteCacheParameterGroupCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeEngineDefaultParametersResult(data.DescribeEngineDefaultParametersResult, context); + const response: DescribeEngineDefaultParametersCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteCacheParameterGroupCommandError + * deserializeAws_queryDescribeEventsCommand */ -const de_DeleteCacheParameterGroupCommandError = async ( +export const de_DescribeEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheParameterGroupNotFound": - case "com.amazonaws.elasticache#CacheParameterGroupNotFoundFault": - throw await de_CacheParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidCacheParameterGroupState": - case "com.amazonaws.elasticache#InvalidCacheParameterGroupStateFault": - throw await de_InvalidCacheParameterGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EventsMessage(data.DescribeEventsResult, context); + const response: DescribeEventsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteCacheSecurityGroupCommand + * deserializeAws_queryDescribeGlobalReplicationGroupsCommand */ -export const de_DeleteCacheSecurityGroupCommand = async ( +export const de_DescribeGlobalReplicationGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteCacheSecurityGroupCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteCacheSecurityGroupCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeGlobalReplicationGroupsResult(data.DescribeGlobalReplicationGroupsResult, context); + const response: DescribeGlobalReplicationGroupsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteCacheSecurityGroupCommandError + * deserializeAws_queryDescribeReplicationGroupsCommand */ -const de_DeleteCacheSecurityGroupCommandError = async ( +export const de_DescribeReplicationGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheSecurityGroupNotFound": - case "com.amazonaws.elasticache#CacheSecurityGroupNotFoundFault": - throw await de_CacheSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidCacheSecurityGroupState": - case "com.amazonaws.elasticache#InvalidCacheSecurityGroupStateFault": - throw await de_InvalidCacheSecurityGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ReplicationGroupMessage(data.DescribeReplicationGroupsResult, context); + const response: DescribeReplicationGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteCacheSubnetGroupCommand + * deserializeAws_queryDescribeReservedCacheNodesCommand */ -export const de_DeleteCacheSubnetGroupCommand = async ( +export const de_DescribeReservedCacheNodesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteCacheSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteCacheSubnetGroupCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ReservedCacheNodeMessage(data.DescribeReservedCacheNodesResult, context); + const response: DescribeReservedCacheNodesCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteCacheSubnetGroupCommandError - */ -const de_DeleteCacheSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheSubnetGroupInUse": - case "com.amazonaws.elasticache#CacheSubnetGroupInUse": - throw await de_CacheSubnetGroupInUseRes(parsedOutput, context); - case "CacheSubnetGroupNotFoundFault": - case "com.amazonaws.elasticache#CacheSubnetGroupNotFoundFault": - throw await de_CacheSubnetGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteGlobalReplicationGroupCommand + * deserializeAws_queryDescribeReservedCacheNodesOfferingsCommand */ -export const de_DeleteGlobalReplicationGroupCommand = async ( +export const de_DescribeReservedCacheNodesOfferingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteGlobalReplicationGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteGlobalReplicationGroupResult(data.DeleteGlobalReplicationGroupResult, context); - const response: DeleteGlobalReplicationGroupCommandOutput = { + contents = de_ReservedCacheNodesOfferingMessage(data.DescribeReservedCacheNodesOfferingsResult, context); + const response: DescribeReservedCacheNodesOfferingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3395,51 +2678,39 @@ export const de_DeleteGlobalReplicationGroupCommand = async ( }; /** - * deserializeAws_queryDeleteGlobalReplicationGroupCommandError + * deserializeAws_queryDescribeServerlessCachesCommand */ -const de_DeleteGlobalReplicationGroupCommandError = async ( +export const de_DescribeServerlessCachesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#GlobalReplicationGroupNotFoundFault": - throw await de_GlobalReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidGlobalReplicationGroupState": - case "com.amazonaws.elasticache#InvalidGlobalReplicationGroupStateFault": - throw await de_InvalidGlobalReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeServerlessCachesResponse(data.DescribeServerlessCachesResult, context); + const response: DescribeServerlessCachesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteReplicationGroupCommand + * deserializeAws_queryDescribeServerlessCacheSnapshotsCommand */ -export const de_DeleteReplicationGroupCommand = async ( +export const de_DescribeServerlessCacheSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteReplicationGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteReplicationGroupResult(data.DeleteReplicationGroupResult, context); - const response: DeleteReplicationGroupCommandOutput = { + contents = de_DescribeServerlessCacheSnapshotsResponse(data.DescribeServerlessCacheSnapshotsResult, context); + const response: DescribeServerlessCacheSnapshotsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3447,63 +2718,39 @@ export const de_DeleteReplicationGroupCommand = async ( }; /** - * deserializeAws_queryDeleteReplicationGroupCommandError + * deserializeAws_queryDescribeServiceUpdatesCommand */ -const de_DeleteReplicationGroupCommandError = async ( +export const de_DescribeServiceUpdatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidReplicationGroupState": - case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": - throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "SnapshotAlreadyExistsFault": - case "com.amazonaws.elasticache#SnapshotAlreadyExistsFault": - throw await de_SnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "SnapshotFeatureNotSupportedFault": - case "com.amazonaws.elasticache#SnapshotFeatureNotSupportedFault": - throw await de_SnapshotFeatureNotSupportedFaultRes(parsedOutput, context); - case "SnapshotQuotaExceededFault": - case "com.amazonaws.elasticache#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ServiceUpdatesMessage(data.DescribeServiceUpdatesResult, context); + const response: DescribeServiceUpdatesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteServerlessCacheCommand + * deserializeAws_queryDescribeSnapshotsCommand */ -export const de_DeleteServerlessCacheCommand = async ( +export const de_DescribeSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteServerlessCacheCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteServerlessCacheResponse(data.DeleteServerlessCacheResult, context); - const response: DeleteServerlessCacheCommandOutput = { + contents = de_DescribeSnapshotsListMessage(data.DescribeSnapshotsResult, context); + const response: DescribeSnapshotsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3511,63 +2758,39 @@ export const de_DeleteServerlessCacheCommand = async ( }; /** - * deserializeAws_queryDeleteServerlessCacheCommandError + * deserializeAws_queryDescribeUpdateActionsCommand */ -const de_DeleteServerlessCacheCommandError = async ( +export const de_DescribeUpdateActionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidCredentialsException": - case "com.amazonaws.elasticache#InvalidCredentialsException": - throw await de_InvalidCredentialsExceptionRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidServerlessCacheStateFault": - case "com.amazonaws.elasticache#InvalidServerlessCacheStateFault": - throw await de_InvalidServerlessCacheStateFaultRes(parsedOutput, context); - case "ServerlessCacheNotFoundFault": - case "com.amazonaws.elasticache#ServerlessCacheNotFoundFault": - throw await de_ServerlessCacheNotFoundFaultRes(parsedOutput, context); - case "ServerlessCacheSnapshotAlreadyExistsFault": - case "com.amazonaws.elasticache#ServerlessCacheSnapshotAlreadyExistsFault": - throw await de_ServerlessCacheSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateActionsMessage(data.DescribeUpdateActionsResult, context); + const response: DescribeUpdateActionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteServerlessCacheSnapshotCommand + * deserializeAws_queryDescribeUserGroupsCommand */ -export const de_DeleteServerlessCacheSnapshotCommand = async ( +export const de_DescribeUserGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteServerlessCacheSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteServerlessCacheSnapshotResponse(data.DeleteServerlessCacheSnapshotResult, context); - const response: DeleteServerlessCacheSnapshotCommandOutput = { + contents = de_DescribeUserGroupsResult(data.DescribeUserGroupsResult, context); + const response: DescribeUserGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3575,54 +2798,39 @@ export const de_DeleteServerlessCacheSnapshotCommand = async ( }; /** - * deserializeAws_queryDeleteServerlessCacheSnapshotCommandError + * deserializeAws_queryDescribeUsersCommand */ -const de_DeleteServerlessCacheSnapshotCommandError = async ( +export const de_DescribeUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidServerlessCacheSnapshotStateFault": - case "com.amazonaws.elasticache#InvalidServerlessCacheSnapshotStateFault": - throw await de_InvalidServerlessCacheSnapshotStateFaultRes(parsedOutput, context); - case "ServerlessCacheSnapshotNotFoundFault": - case "com.amazonaws.elasticache#ServerlessCacheSnapshotNotFoundFault": - throw await de_ServerlessCacheSnapshotNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeUsersResult(data.DescribeUsersResult, context); + const response: DescribeUsersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteSnapshotCommand + * deserializeAws_queryDisassociateGlobalReplicationGroupCommand */ -export const de_DeleteSnapshotCommand = async ( +export const de_DisassociateGlobalReplicationGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteSnapshotResult(data.DeleteSnapshotResult, context); - const response: DeleteSnapshotCommandOutput = { + contents = de_DisassociateGlobalReplicationGroupResult(data.DisassociateGlobalReplicationGroupResult, context); + const response: DisassociateGlobalReplicationGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3630,54 +2838,19 @@ export const de_DeleteSnapshotCommand = async ( }; /** - * deserializeAws_queryDeleteSnapshotCommandError + * deserializeAws_queryExportServerlessCacheSnapshotCommand */ -const de_DeleteSnapshotCommandError = async ( +export const de_ExportServerlessCacheSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidSnapshotState": - case "com.amazonaws.elasticache#InvalidSnapshotStateFault": - throw await de_InvalidSnapshotStateFaultRes(parsedOutput, context); - case "SnapshotNotFoundFault": - case "com.amazonaws.elasticache#SnapshotNotFoundFault": - throw await de_SnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteUserCommand - */ -export const de_DeleteUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_User(data.DeleteUserResult, context); - const response: DeleteUserCommandOutput = { + contents = de_ExportServerlessCacheSnapshotResponse(data.ExportServerlessCacheSnapshotResult, context); + const response: ExportServerlessCacheSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3685,57 +2858,19 @@ export const de_DeleteUserCommand = async ( }; /** - * deserializeAws_queryDeleteUserCommandError - */ -const de_DeleteUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DefaultUserAssociatedToUserGroup": - case "com.amazonaws.elasticache#DefaultUserAssociatedToUserGroupFault": - throw await de_DefaultUserAssociatedToUserGroupFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidUserState": - case "com.amazonaws.elasticache#InvalidUserStateFault": - throw await de_InvalidUserStateFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "UserNotFound": - case "com.amazonaws.elasticache#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteUserGroupCommand + * deserializeAws_queryFailoverGlobalReplicationGroupCommand */ -export const de_DeleteUserGroupCommand = async ( +export const de_FailoverGlobalReplicationGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteUserGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UserGroup(data.DeleteUserGroupResult, context); - const response: DeleteUserGroupCommandOutput = { + contents = de_FailoverGlobalReplicationGroupResult(data.FailoverGlobalReplicationGroupResult, context); + const response: FailoverGlobalReplicationGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3743,54 +2878,42 @@ export const de_DeleteUserGroupCommand = async ( }; /** - * deserializeAws_queryDeleteUserGroupCommandError + * deserializeAws_queryIncreaseNodeGroupsInGlobalReplicationGroupCommand */ -const de_DeleteUserGroupCommandError = async ( +export const de_IncreaseNodeGroupsInGlobalReplicationGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidUserGroupState": - case "com.amazonaws.elasticache#InvalidUserGroupStateFault": - throw await de_InvalidUserGroupStateFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "UserGroupNotFound": - case "com.amazonaws.elasticache#UserGroupNotFoundFault": - throw await de_UserGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_IncreaseNodeGroupsInGlobalReplicationGroupResult( + data.IncreaseNodeGroupsInGlobalReplicationGroupResult, + context + ); + const response: IncreaseNodeGroupsInGlobalReplicationGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeCacheClustersCommand + * deserializeAws_queryIncreaseReplicaCountCommand */ -export const de_DescribeCacheClustersCommand = async ( +export const de_IncreaseReplicaCountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeCacheClustersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CacheClusterMessage(data.DescribeCacheClustersResult, context); - const response: DescribeCacheClustersCommandOutput = { + contents = de_IncreaseReplicaCountResult(data.IncreaseReplicaCountResult, context); + const response: IncreaseReplicaCountCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3798,51 +2921,39 @@ export const de_DescribeCacheClustersCommand = async ( }; /** - * deserializeAws_queryDescribeCacheClustersCommandError + * deserializeAws_queryListAllowedNodeTypeModificationsCommand */ -const de_DescribeCacheClustersCommandError = async ( +export const de_ListAllowedNodeTypeModificationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheClusterNotFound": - case "com.amazonaws.elasticache#CacheClusterNotFoundFault": - throw await de_CacheClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_AllowedNodeTypeModificationsMessage(data.ListAllowedNodeTypeModificationsResult, context); + const response: ListAllowedNodeTypeModificationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeCacheEngineVersionsCommand + * deserializeAws_queryListTagsForResourceCommand */ -export const de_DescribeCacheEngineVersionsCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeCacheEngineVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CacheEngineVersionMessage(data.DescribeCacheEngineVersionsResult, context); - const response: DescribeCacheEngineVersionsCommandOutput = { + contents = de_TagListMessage(data.ListTagsForResourceResult, context); + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3850,39 +2961,39 @@ export const de_DescribeCacheEngineVersionsCommand = async ( }; /** - * deserializeAws_queryDescribeCacheEngineVersionsCommandError + * deserializeAws_queryModifyCacheClusterCommand */ -const de_DescribeCacheEngineVersionsCommandError = async ( +export const de_ModifyCacheClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyCacheClusterResult(data.ModifyCacheClusterResult, context); + const response: ModifyCacheClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** - * deserializeAws_queryDescribeCacheParameterGroupsCommand + * deserializeAws_queryModifyCacheParameterGroupCommand */ -export const de_DescribeCacheParameterGroupsCommand = async ( +export const de_ModifyCacheParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeCacheParameterGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CacheParameterGroupsMessage(data.DescribeCacheParameterGroupsResult, context); - const response: DescribeCacheParameterGroupsCommandOutput = { + contents = de_CacheParameterGroupNameMessage(data.ModifyCacheParameterGroupResult, context); + const response: ModifyCacheParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3890,51 +3001,39 @@ export const de_DescribeCacheParameterGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeCacheParameterGroupsCommandError + * deserializeAws_queryModifyCacheSubnetGroupCommand */ -const de_DescribeCacheParameterGroupsCommandError = async ( +export const de_ModifyCacheSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheParameterGroupNotFound": - case "com.amazonaws.elasticache#CacheParameterGroupNotFoundFault": - throw await de_CacheParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyCacheSubnetGroupResult(data.ModifyCacheSubnetGroupResult, context); + const response: ModifyCacheSubnetGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeCacheParametersCommand + * deserializeAws_queryModifyGlobalReplicationGroupCommand */ -export const de_DescribeCacheParametersCommand = async ( +export const de_ModifyGlobalReplicationGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeCacheParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CacheParameterGroupDetails(data.DescribeCacheParametersResult, context); - const response: DescribeCacheParametersCommandOutput = { + contents = de_ModifyGlobalReplicationGroupResult(data.ModifyGlobalReplicationGroupResult, context); + const response: ModifyGlobalReplicationGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3942,51 +3041,19 @@ export const de_DescribeCacheParametersCommand = async ( }; /** - * deserializeAws_queryDescribeCacheParametersCommandError - */ -const de_DescribeCacheParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheParameterGroupNotFound": - case "com.amazonaws.elasticache#CacheParameterGroupNotFoundFault": - throw await de_CacheParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeCacheSecurityGroupsCommand + * deserializeAws_queryModifyReplicationGroupCommand */ -export const de_DescribeCacheSecurityGroupsCommand = async ( +export const de_ModifyReplicationGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeCacheSecurityGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CacheSecurityGroupMessage(data.DescribeCacheSecurityGroupsResult, context); - const response: DescribeCacheSecurityGroupsCommandOutput = { + contents = de_ModifyReplicationGroupResult(data.ModifyReplicationGroupResult, context); + const response: ModifyReplicationGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3994,51 +3061,22 @@ export const de_DescribeCacheSecurityGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeCacheSecurityGroupsCommandError - */ -const de_DescribeCacheSecurityGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheSecurityGroupNotFound": - case "com.amazonaws.elasticache#CacheSecurityGroupNotFoundFault": - throw await de_CacheSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeCacheSubnetGroupsCommand + * deserializeAws_queryModifyReplicationGroupShardConfigurationCommand */ -export const de_DescribeCacheSubnetGroupsCommand = async ( +export const de_ModifyReplicationGroupShardConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeCacheSubnetGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CacheSubnetGroupMessage(data.DescribeCacheSubnetGroupsResult, context); - const response: DescribeCacheSubnetGroupsCommandOutput = { + contents = de_ModifyReplicationGroupShardConfigurationResult( + data.ModifyReplicationGroupShardConfigurationResult, + context + ); + const response: ModifyReplicationGroupShardConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4046,45 +3084,39 @@ export const de_DescribeCacheSubnetGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeCacheSubnetGroupsCommandError + * deserializeAws_queryModifyServerlessCacheCommand */ -const de_DescribeCacheSubnetGroupsCommandError = async ( +export const de_ModifyServerlessCacheCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheSubnetGroupNotFoundFault": - case "com.amazonaws.elasticache#CacheSubnetGroupNotFoundFault": - throw await de_CacheSubnetGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyServerlessCacheResponse(data.ModifyServerlessCacheResult, context); + const response: ModifyServerlessCacheCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeEngineDefaultParametersCommand + * deserializeAws_queryModifyUserCommand */ -export const de_DescribeEngineDefaultParametersCommand = async ( +export const de_ModifyUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEngineDefaultParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEngineDefaultParametersResult(data.DescribeEngineDefaultParametersResult, context); - const response: DescribeEngineDefaultParametersCommandOutput = { + contents = de_User(data.ModifyUserResult, context); + const response: ModifyUserCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4092,48 +3124,39 @@ export const de_DescribeEngineDefaultParametersCommand = async ( }; /** - * deserializeAws_queryDescribeEngineDefaultParametersCommandError + * deserializeAws_queryModifyUserGroupCommand */ -const de_DescribeEngineDefaultParametersCommandError = async ( +export const de_ModifyUserGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UserGroup(data.ModifyUserGroupResult, context); + const response: ModifyUserGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeEventsCommand + * deserializeAws_queryPurchaseReservedCacheNodesOfferingCommand */ -export const de_DescribeEventsCommand = async ( +export const de_PurchaseReservedCacheNodesOfferingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_EventsMessage(data.DescribeEventsResult, context); - const response: DescribeEventsCommandOutput = { + contents = de_PurchaseReservedCacheNodesOfferingResult(data.PurchaseReservedCacheNodesOfferingResult, context); + const response: PurchaseReservedCacheNodesOfferingCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4141,48 +3164,42 @@ export const de_DescribeEventsCommand = async ( }; /** - * deserializeAws_queryDescribeEventsCommandError + * deserializeAws_queryRebalanceSlotsInGlobalReplicationGroupCommand */ -const de_DescribeEventsCommandError = async ( +export const de_RebalanceSlotsInGlobalReplicationGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RebalanceSlotsInGlobalReplicationGroupResult( + data.RebalanceSlotsInGlobalReplicationGroupResult, + context + ); + const response: RebalanceSlotsInGlobalReplicationGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeGlobalReplicationGroupsCommand + * deserializeAws_queryRebootCacheClusterCommand */ -export const de_DescribeGlobalReplicationGroupsCommand = async ( +export const de_RebootCacheClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeGlobalReplicationGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeGlobalReplicationGroupsResult(data.DescribeGlobalReplicationGroupsResult, context); - const response: DescribeGlobalReplicationGroupsCommandOutput = { + contents = de_RebootCacheClusterResult(data.RebootCacheClusterResult, context); + const response: RebootCacheClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4190,51 +3207,39 @@ export const de_DescribeGlobalReplicationGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeGlobalReplicationGroupsCommandError + * deserializeAws_queryRemoveTagsFromResourceCommand */ -const de_DescribeGlobalReplicationGroupsCommandError = async ( +export const de_RemoveTagsFromResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#GlobalReplicationGroupNotFoundFault": - throw await de_GlobalReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_TagListMessage(data.RemoveTagsFromResourceResult, context); + const response: RemoveTagsFromResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeReplicationGroupsCommand + * deserializeAws_queryResetCacheParameterGroupCommand */ -export const de_DescribeReplicationGroupsCommand = async ( +export const de_ResetCacheParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeReplicationGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ReplicationGroupMessage(data.DescribeReplicationGroupsResult, context); - const response: DescribeReplicationGroupsCommandOutput = { + contents = de_CacheParameterGroupNameMessage(data.ResetCacheParameterGroupResult, context); + const response: ResetCacheParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4242,51 +3247,19 @@ export const de_DescribeReplicationGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeReplicationGroupsCommandError + * deserializeAws_queryRevokeCacheSecurityGroupIngressCommand */ -const de_DescribeReplicationGroupsCommandError = async ( +export const de_RevokeCacheSecurityGroupIngressCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeReservedCacheNodesCommand - */ -export const de_DescribeReservedCacheNodesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeReservedCacheNodesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ReservedCacheNodeMessage(data.DescribeReservedCacheNodesResult, context); - const response: DescribeReservedCacheNodesCommandOutput = { + contents = de_RevokeCacheSecurityGroupIngressResult(data.RevokeCacheSecurityGroupIngressResult, context); + const response: RevokeCacheSecurityGroupIngressCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4294,51 +3267,19 @@ export const de_DescribeReservedCacheNodesCommand = async ( }; /** - * deserializeAws_queryDescribeReservedCacheNodesCommandError - */ -const de_DescribeReservedCacheNodesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ReservedCacheNodeNotFound": - case "com.amazonaws.elasticache#ReservedCacheNodeNotFoundFault": - throw await de_ReservedCacheNodeNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeReservedCacheNodesOfferingsCommand + * deserializeAws_queryStartMigrationCommand */ -export const de_DescribeReservedCacheNodesOfferingsCommand = async ( +export const de_StartMigrationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeReservedCacheNodesOfferingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ReservedCacheNodesOfferingMessage(data.DescribeReservedCacheNodesOfferingsResult, context); - const response: DescribeReservedCacheNodesOfferingsCommandOutput = { + contents = de_StartMigrationResponse(data.StartMigrationResult, context); + const response: StartMigrationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4346,51 +3287,19 @@ export const de_DescribeReservedCacheNodesOfferingsCommand = async ( }; /** - * deserializeAws_queryDescribeReservedCacheNodesOfferingsCommandError - */ -const de_DescribeReservedCacheNodesOfferingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ReservedCacheNodesOfferingNotFound": - case "com.amazonaws.elasticache#ReservedCacheNodesOfferingNotFoundFault": - throw await de_ReservedCacheNodesOfferingNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeServerlessCachesCommand + * deserializeAws_queryTestFailoverCommand */ -export const de_DescribeServerlessCachesCommand = async ( +export const de_TestFailoverCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeServerlessCachesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeServerlessCachesResponse(data.DescribeServerlessCachesResult, context); - const response: DescribeServerlessCachesCommandOutput = { + contents = de_TestFailoverResult(data.TestFailoverResult, context); + const response: TestFailoverCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4398,51 +3307,19 @@ export const de_DescribeServerlessCachesCommand = async ( }; /** - * deserializeAws_queryDescribeServerlessCachesCommandError - */ -const de_DescribeServerlessCachesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServerlessCacheNotFoundFault": - case "com.amazonaws.elasticache#ServerlessCacheNotFoundFault": - throw await de_ServerlessCacheNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeServerlessCacheSnapshotsCommand + * deserializeAws_queryTestMigrationCommand */ -export const de_DescribeServerlessCacheSnapshotsCommand = async ( +export const de_TestMigrationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeServerlessCacheSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeServerlessCacheSnapshotsResponse(data.DescribeServerlessCacheSnapshotsResult, context); - const response: DescribeServerlessCacheSnapshotsCommandOutput = { + contents = de_TestMigrationResponse(data.TestMigrationResult, context); + const response: TestMigrationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4450,73 +3327,69 @@ export const de_DescribeServerlessCacheSnapshotsCommand = async ( }; /** - * deserializeAws_queryDescribeServerlessCacheSnapshotsCommandError + * deserialize_Aws_queryCommandError */ -const de_DescribeServerlessCacheSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); + case "CacheClusterNotFound": + case "com.amazonaws.elasticache#CacheClusterNotFoundFault": + throw await de_CacheClusterNotFoundFaultRes(parsedOutput, context); + case "CacheParameterGroupNotFound": + case "com.amazonaws.elasticache#CacheParameterGroupNotFoundFault": + throw await de_CacheParameterGroupNotFoundFaultRes(parsedOutput, context); + case "CacheSecurityGroupNotFound": + case "com.amazonaws.elasticache#CacheSecurityGroupNotFoundFault": + throw await de_CacheSecurityGroupNotFoundFaultRes(parsedOutput, context); + case "CacheSubnetGroupNotFoundFault": + case "com.amazonaws.elasticache#CacheSubnetGroupNotFoundFault": + throw await de_CacheSubnetGroupNotFoundFaultRes(parsedOutput, context); + case "InvalidARN": + case "com.amazonaws.elasticache#InvalidARNFault": + throw await de_InvalidARNFaultRes(parsedOutput, context); + case "InvalidReplicationGroupState": + case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": + throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); + case "InvalidServerlessCacheSnapshotStateFault": + case "com.amazonaws.elasticache#InvalidServerlessCacheSnapshotStateFault": + throw await de_InvalidServerlessCacheSnapshotStateFaultRes(parsedOutput, context); + case "InvalidServerlessCacheStateFault": + case "com.amazonaws.elasticache#InvalidServerlessCacheStateFault": + throw await de_InvalidServerlessCacheStateFaultRes(parsedOutput, context); + case "ReplicationGroupNotFoundFault": + case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": + throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); + case "ReservedCacheNodeNotFound": + case "com.amazonaws.elasticache#ReservedCacheNodeNotFoundFault": + throw await de_ReservedCacheNodeNotFoundFaultRes(parsedOutput, context); case "ServerlessCacheNotFoundFault": case "com.amazonaws.elasticache#ServerlessCacheNotFoundFault": throw await de_ServerlessCacheNotFoundFaultRes(parsedOutput, context); case "ServerlessCacheSnapshotNotFoundFault": case "com.amazonaws.elasticache#ServerlessCacheSnapshotNotFoundFault": throw await de_ServerlessCacheSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeServiceUpdatesCommand - */ -export const de_DescribeServiceUpdatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeServiceUpdatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ServiceUpdatesMessage(data.DescribeServiceUpdatesResult, context); - const response: DescribeServiceUpdatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeServiceUpdatesCommandError - */ -const de_DescribeServiceUpdatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { + case "SnapshotNotFoundFault": + case "com.amazonaws.elasticache#SnapshotNotFoundFault": + throw await de_SnapshotNotFoundFaultRes(parsedOutput, context); + case "TagQuotaPerResourceExceeded": + case "com.amazonaws.elasticache#TagQuotaPerResourceExceeded": + throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); + case "UserGroupNotFound": + case "com.amazonaws.elasticache#UserGroupNotFoundFault": + throw await de_UserGroupNotFoundFaultRes(parsedOutput, context); + case "UserNotFound": + case "com.amazonaws.elasticache#UserNotFoundFault": + throw await de_UserNotFoundFaultRes(parsedOutput, context); + case "AuthorizationAlreadyExists": + case "com.amazonaws.elasticache#AuthorizationAlreadyExistsFault": + throw await de_AuthorizationAlreadyExistsFaultRes(parsedOutput, context); + case "InvalidCacheSecurityGroupState": + case "com.amazonaws.elasticache#InvalidCacheSecurityGroupStateFault": + throw await de_InvalidCacheSecurityGroupStateFaultRes(parsedOutput, context); case "InvalidParameterCombination": case "com.amazonaws.elasticache#InvalidParameterCombinationException": throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); @@ -4526,1753 +3399,168 @@ const de_DescribeServiceUpdatesCommandError = async ( case "ServiceUpdateNotFoundFault": case "com.amazonaws.elasticache#ServiceUpdateNotFoundFault": throw await de_ServiceUpdateNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeSnapshotsCommand - */ -export const de_DescribeSnapshotsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeSnapshotsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeSnapshotsListMessage(data.DescribeSnapshotsResult, context); - const response: DescribeSnapshotsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeSnapshotsCommandError - */ -const de_DescribeSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheClusterNotFound": - case "com.amazonaws.elasticache#CacheClusterNotFoundFault": - throw await de_CacheClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "SnapshotNotFoundFault": - case "com.amazonaws.elasticache#SnapshotNotFoundFault": - throw await de_SnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeUpdateActionsCommand - */ -export const de_DescribeUpdateActionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeUpdateActionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateActionsMessage(data.DescribeUpdateActionsResult, context); - const response: DescribeUpdateActionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeUpdateActionsCommandError - */ -const de_DescribeUpdateActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeUserGroupsCommand - */ -export const de_DescribeUserGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeUserGroupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeUserGroupsResult(data.DescribeUserGroupsResult, context); - const response: DescribeUserGroupsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeUserGroupsCommandError - */ -const de_DescribeUserGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "UserGroupNotFound": - case "com.amazonaws.elasticache#UserGroupNotFoundFault": - throw await de_UserGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeUsersCommand - */ -export const de_DescribeUsersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeUsersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeUsersResult(data.DescribeUsersResult, context); - const response: DescribeUsersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeUsersCommandError - */ -const de_DescribeUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "UserNotFound": - case "com.amazonaws.elasticache#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDisassociateGlobalReplicationGroupCommand - */ -export const de_DisassociateGlobalReplicationGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisassociateGlobalReplicationGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DisassociateGlobalReplicationGroupResult(data.DisassociateGlobalReplicationGroupResult, context); - const response: DisassociateGlobalReplicationGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDisassociateGlobalReplicationGroupCommandError - */ -const de_DisassociateGlobalReplicationGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#GlobalReplicationGroupNotFoundFault": - throw await de_GlobalReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidGlobalReplicationGroupState": - case "com.amazonaws.elasticache#InvalidGlobalReplicationGroupStateFault": - throw await de_InvalidGlobalReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryExportServerlessCacheSnapshotCommand - */ -export const de_ExportServerlessCacheSnapshotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ExportServerlessCacheSnapshotCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ExportServerlessCacheSnapshotResponse(data.ExportServerlessCacheSnapshotResult, context); - const response: ExportServerlessCacheSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryExportServerlessCacheSnapshotCommandError - */ -const de_ExportServerlessCacheSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidServerlessCacheSnapshotStateFault": - case "com.amazonaws.elasticache#InvalidServerlessCacheSnapshotStateFault": - throw await de_InvalidServerlessCacheSnapshotStateFaultRes(parsedOutput, context); - case "ServerlessCacheSnapshotNotFoundFault": - case "com.amazonaws.elasticache#ServerlessCacheSnapshotNotFoundFault": - throw await de_ServerlessCacheSnapshotNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryFailoverGlobalReplicationGroupCommand - */ -export const de_FailoverGlobalReplicationGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_FailoverGlobalReplicationGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_FailoverGlobalReplicationGroupResult(data.FailoverGlobalReplicationGroupResult, context); - const response: FailoverGlobalReplicationGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryFailoverGlobalReplicationGroupCommandError - */ -const de_FailoverGlobalReplicationGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#GlobalReplicationGroupNotFoundFault": - throw await de_GlobalReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidGlobalReplicationGroupState": - case "com.amazonaws.elasticache#InvalidGlobalReplicationGroupStateFault": - throw await de_InvalidGlobalReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryIncreaseNodeGroupsInGlobalReplicationGroupCommand - */ -export const de_IncreaseNodeGroupsInGlobalReplicationGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_IncreaseNodeGroupsInGlobalReplicationGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_IncreaseNodeGroupsInGlobalReplicationGroupResult( - data.IncreaseNodeGroupsInGlobalReplicationGroupResult, - context - ); - const response: IncreaseNodeGroupsInGlobalReplicationGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryIncreaseNodeGroupsInGlobalReplicationGroupCommandError - */ -const de_IncreaseNodeGroupsInGlobalReplicationGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#GlobalReplicationGroupNotFoundFault": - throw await de_GlobalReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidGlobalReplicationGroupState": - case "com.amazonaws.elasticache#InvalidGlobalReplicationGroupStateFault": - throw await de_InvalidGlobalReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryIncreaseReplicaCountCommand - */ -export const de_IncreaseReplicaCountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_IncreaseReplicaCountCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_IncreaseReplicaCountResult(data.IncreaseReplicaCountResult, context); - const response: IncreaseReplicaCountCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryIncreaseReplicaCountCommandError - */ -const de_IncreaseReplicaCountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterQuotaForCustomerExceeded": - case "com.amazonaws.elasticache#ClusterQuotaForCustomerExceededFault": - throw await de_ClusterQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "InsufficientCacheClusterCapacity": - case "com.amazonaws.elasticache#InsufficientCacheClusterCapacityFault": - throw await de_InsufficientCacheClusterCapacityFaultRes(parsedOutput, context); - case "InvalidCacheClusterState": - case "com.amazonaws.elasticache#InvalidCacheClusterStateFault": - throw await de_InvalidCacheClusterStateFaultRes(parsedOutput, context); - case "InvalidKMSKeyFault": - case "com.amazonaws.elasticache#InvalidKMSKeyFault": - throw await de_InvalidKMSKeyFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidReplicationGroupState": - case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": - throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.elasticache#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "NoOperationFault": - case "com.amazonaws.elasticache#NoOperationFault": - throw await de_NoOperationFaultRes(parsedOutput, context); - case "NodeGroupsPerReplicationGroupQuotaExceeded": - case "com.amazonaws.elasticache#NodeGroupsPerReplicationGroupQuotaExceededFault": - throw await de_NodeGroupsPerReplicationGroupQuotaExceededFaultRes(parsedOutput, context); - case "NodeQuotaForCustomerExceeded": - case "com.amazonaws.elasticache#NodeQuotaForCustomerExceededFault": - throw await de_NodeQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListAllowedNodeTypeModificationsCommand - */ -export const de_ListAllowedNodeTypeModificationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAllowedNodeTypeModificationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_AllowedNodeTypeModificationsMessage(data.ListAllowedNodeTypeModificationsResult, context); - const response: ListAllowedNodeTypeModificationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListAllowedNodeTypeModificationsCommandError - */ -const de_ListAllowedNodeTypeModificationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheClusterNotFound": - case "com.amazonaws.elasticache#CacheClusterNotFoundFault": - throw await de_CacheClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_TagListMessage(data.ListTagsForResourceResult, context); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheClusterNotFound": - case "com.amazonaws.elasticache#CacheClusterNotFoundFault": - throw await de_CacheClusterNotFoundFaultRes(parsedOutput, context); - case "CacheParameterGroupNotFound": - case "com.amazonaws.elasticache#CacheParameterGroupNotFoundFault": - throw await de_CacheParameterGroupNotFoundFaultRes(parsedOutput, context); - case "CacheSecurityGroupNotFound": - case "com.amazonaws.elasticache#CacheSecurityGroupNotFoundFault": - throw await de_CacheSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "CacheSubnetGroupNotFoundFault": - case "com.amazonaws.elasticache#CacheSubnetGroupNotFoundFault": - throw await de_CacheSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidARN": - case "com.amazonaws.elasticache#InvalidARNFault": - throw await de_InvalidARNFaultRes(parsedOutput, context); - case "InvalidReplicationGroupState": - case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": - throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidServerlessCacheSnapshotStateFault": - case "com.amazonaws.elasticache#InvalidServerlessCacheSnapshotStateFault": - throw await de_InvalidServerlessCacheSnapshotStateFaultRes(parsedOutput, context); - case "InvalidServerlessCacheStateFault": - case "com.amazonaws.elasticache#InvalidServerlessCacheStateFault": - throw await de_InvalidServerlessCacheStateFaultRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "ReservedCacheNodeNotFound": - case "com.amazonaws.elasticache#ReservedCacheNodeNotFoundFault": - throw await de_ReservedCacheNodeNotFoundFaultRes(parsedOutput, context); - case "ServerlessCacheNotFoundFault": - case "com.amazonaws.elasticache#ServerlessCacheNotFoundFault": - throw await de_ServerlessCacheNotFoundFaultRes(parsedOutput, context); - case "ServerlessCacheSnapshotNotFoundFault": - case "com.amazonaws.elasticache#ServerlessCacheSnapshotNotFoundFault": - throw await de_ServerlessCacheSnapshotNotFoundFaultRes(parsedOutput, context); - case "SnapshotNotFoundFault": - case "com.amazonaws.elasticache#SnapshotNotFoundFault": - throw await de_SnapshotNotFoundFaultRes(parsedOutput, context); - case "UserGroupNotFound": - case "com.amazonaws.elasticache#UserGroupNotFoundFault": - throw await de_UserGroupNotFoundFaultRes(parsedOutput, context); - case "UserNotFound": - case "com.amazonaws.elasticache#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyCacheClusterCommand - */ -export const de_ModifyCacheClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyCacheClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyCacheClusterResult(data.ModifyCacheClusterResult, context); - const response: ModifyCacheClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyCacheClusterCommandError - */ -const de_ModifyCacheClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheClusterNotFound": - case "com.amazonaws.elasticache#CacheClusterNotFoundFault": - throw await de_CacheClusterNotFoundFaultRes(parsedOutput, context); - case "CacheParameterGroupNotFound": - case "com.amazonaws.elasticache#CacheParameterGroupNotFoundFault": - throw await de_CacheParameterGroupNotFoundFaultRes(parsedOutput, context); - case "CacheSecurityGroupNotFound": - case "com.amazonaws.elasticache#CacheSecurityGroupNotFoundFault": - throw await de_CacheSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "InsufficientCacheClusterCapacity": - case "com.amazonaws.elasticache#InsufficientCacheClusterCapacityFault": - throw await de_InsufficientCacheClusterCapacityFaultRes(parsedOutput, context); - case "InvalidCacheClusterState": - case "com.amazonaws.elasticache#InvalidCacheClusterStateFault": - throw await de_InvalidCacheClusterStateFaultRes(parsedOutput, context); - case "InvalidCacheSecurityGroupState": - case "com.amazonaws.elasticache#InvalidCacheSecurityGroupStateFault": - throw await de_InvalidCacheSecurityGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.elasticache#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "NodeQuotaForClusterExceeded": - case "com.amazonaws.elasticache#NodeQuotaForClusterExceededFault": - throw await de_NodeQuotaForClusterExceededFaultRes(parsedOutput, context); - case "NodeQuotaForCustomerExceeded": - case "com.amazonaws.elasticache#NodeQuotaForCustomerExceededFault": - throw await de_NodeQuotaForCustomerExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyCacheParameterGroupCommand - */ -export const de_ModifyCacheParameterGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyCacheParameterGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CacheParameterGroupNameMessage(data.ModifyCacheParameterGroupResult, context); - const response: ModifyCacheParameterGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyCacheParameterGroupCommandError - */ -const de_ModifyCacheParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheParameterGroupNotFound": - case "com.amazonaws.elasticache#CacheParameterGroupNotFoundFault": - throw await de_CacheParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidCacheParameterGroupState": - case "com.amazonaws.elasticache#InvalidCacheParameterGroupStateFault": - throw await de_InvalidCacheParameterGroupStateFaultRes(parsedOutput, context); - case "InvalidGlobalReplicationGroupState": - case "com.amazonaws.elasticache#InvalidGlobalReplicationGroupStateFault": - throw await de_InvalidGlobalReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyCacheSubnetGroupCommand - */ -export const de_ModifyCacheSubnetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyCacheSubnetGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyCacheSubnetGroupResult(data.ModifyCacheSubnetGroupResult, context); - const response: ModifyCacheSubnetGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyCacheSubnetGroupCommandError - */ -const de_ModifyCacheSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheSubnetGroupNotFoundFault": - case "com.amazonaws.elasticache#CacheSubnetGroupNotFoundFault": - throw await de_CacheSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "CacheSubnetQuotaExceededFault": - case "com.amazonaws.elasticache#CacheSubnetQuotaExceededFault": - throw await de_CacheSubnetQuotaExceededFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.elasticache#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "SubnetInUse": - case "com.amazonaws.elasticache#SubnetInUse": - throw await de_SubnetInUseRes(parsedOutput, context); - case "SubnetNotAllowedFault": - case "com.amazonaws.elasticache#SubnetNotAllowedFault": - throw await de_SubnetNotAllowedFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyGlobalReplicationGroupCommand - */ -export const de_ModifyGlobalReplicationGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyGlobalReplicationGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyGlobalReplicationGroupResult(data.ModifyGlobalReplicationGroupResult, context); - const response: ModifyGlobalReplicationGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyGlobalReplicationGroupCommandError - */ -const de_ModifyGlobalReplicationGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#GlobalReplicationGroupNotFoundFault": - throw await de_GlobalReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidGlobalReplicationGroupState": - case "com.amazonaws.elasticache#InvalidGlobalReplicationGroupStateFault": - throw await de_InvalidGlobalReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyReplicationGroupCommand - */ -export const de_ModifyReplicationGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyReplicationGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyReplicationGroupResult(data.ModifyReplicationGroupResult, context); - const response: ModifyReplicationGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyReplicationGroupCommandError - */ -const de_ModifyReplicationGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheClusterNotFound": - case "com.amazonaws.elasticache#CacheClusterNotFoundFault": - throw await de_CacheClusterNotFoundFaultRes(parsedOutput, context); - case "CacheParameterGroupNotFound": - case "com.amazonaws.elasticache#CacheParameterGroupNotFoundFault": - throw await de_CacheParameterGroupNotFoundFaultRes(parsedOutput, context); - case "CacheSecurityGroupNotFound": - case "com.amazonaws.elasticache#CacheSecurityGroupNotFoundFault": - throw await de_CacheSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "InsufficientCacheClusterCapacity": - case "com.amazonaws.elasticache#InsufficientCacheClusterCapacityFault": - throw await de_InsufficientCacheClusterCapacityFaultRes(parsedOutput, context); - case "InvalidCacheClusterState": - case "com.amazonaws.elasticache#InvalidCacheClusterStateFault": - throw await de_InvalidCacheClusterStateFaultRes(parsedOutput, context); - case "InvalidCacheSecurityGroupState": - case "com.amazonaws.elasticache#InvalidCacheSecurityGroupStateFault": - throw await de_InvalidCacheSecurityGroupStateFaultRes(parsedOutput, context); - case "InvalidKMSKeyFault": - case "com.amazonaws.elasticache#InvalidKMSKeyFault": - throw await de_InvalidKMSKeyFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidReplicationGroupState": - case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": - throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidUserGroupState": - case "com.amazonaws.elasticache#InvalidUserGroupStateFault": - throw await de_InvalidUserGroupStateFaultRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.elasticache#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "NodeQuotaForClusterExceeded": - case "com.amazonaws.elasticache#NodeQuotaForClusterExceededFault": - throw await de_NodeQuotaForClusterExceededFaultRes(parsedOutput, context); - case "NodeQuotaForCustomerExceeded": - case "com.amazonaws.elasticache#NodeQuotaForCustomerExceededFault": - throw await de_NodeQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "UserGroupNotFound": - case "com.amazonaws.elasticache#UserGroupNotFoundFault": - throw await de_UserGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyReplicationGroupShardConfigurationCommand - */ -export const de_ModifyReplicationGroupShardConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyReplicationGroupShardConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyReplicationGroupShardConfigurationResult( - data.ModifyReplicationGroupShardConfigurationResult, - context - ); - const response: ModifyReplicationGroupShardConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyReplicationGroupShardConfigurationCommandError - */ -const de_ModifyReplicationGroupShardConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientCacheClusterCapacity": - case "com.amazonaws.elasticache#InsufficientCacheClusterCapacityFault": - throw await de_InsufficientCacheClusterCapacityFaultRes(parsedOutput, context); - case "InvalidCacheClusterState": - case "com.amazonaws.elasticache#InvalidCacheClusterStateFault": - throw await de_InvalidCacheClusterStateFaultRes(parsedOutput, context); - case "InvalidKMSKeyFault": - case "com.amazonaws.elasticache#InvalidKMSKeyFault": - throw await de_InvalidKMSKeyFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidReplicationGroupState": - case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": - throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.elasticache#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "NodeGroupsPerReplicationGroupQuotaExceeded": - case "com.amazonaws.elasticache#NodeGroupsPerReplicationGroupQuotaExceededFault": - throw await de_NodeGroupsPerReplicationGroupQuotaExceededFaultRes(parsedOutput, context); - case "NodeQuotaForCustomerExceeded": - case "com.amazonaws.elasticache#NodeQuotaForCustomerExceededFault": - throw await de_NodeQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyServerlessCacheCommand - */ -export const de_ModifyServerlessCacheCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyServerlessCacheCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyServerlessCacheResponse(data.ModifyServerlessCacheResult, context); - const response: ModifyServerlessCacheCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyServerlessCacheCommandError - */ -const de_ModifyServerlessCacheCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidCredentialsException": - case "com.amazonaws.elasticache#InvalidCredentialsException": - throw await de_InvalidCredentialsExceptionRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidServerlessCacheStateFault": - case "com.amazonaws.elasticache#InvalidServerlessCacheStateFault": - throw await de_InvalidServerlessCacheStateFaultRes(parsedOutput, context); - case "InvalidUserGroupState": - case "com.amazonaws.elasticache#InvalidUserGroupStateFault": - throw await de_InvalidUserGroupStateFaultRes(parsedOutput, context); - case "ServerlessCacheNotFoundFault": - case "com.amazonaws.elasticache#ServerlessCacheNotFoundFault": - throw await de_ServerlessCacheNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "UserGroupNotFound": - case "com.amazonaws.elasticache#UserGroupNotFoundFault": - throw await de_UserGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyUserCommand - */ -export const de_ModifyUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyUserCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_User(data.ModifyUserResult, context); - const response: ModifyUserCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyUserCommandError - */ -const de_ModifyUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidUserState": - case "com.amazonaws.elasticache#InvalidUserStateFault": - throw await de_InvalidUserStateFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "UserNotFound": - case "com.amazonaws.elasticache#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyUserGroupCommand - */ -export const de_ModifyUserGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyUserGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UserGroup(data.ModifyUserGroupResult, context); - const response: ModifyUserGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyUserGroupCommandError - */ -const de_ModifyUserGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DefaultUserRequired": - case "com.amazonaws.elasticache#DefaultUserRequired": - throw await de_DefaultUserRequiredRes(parsedOutput, context); - case "DuplicateUserName": - case "com.amazonaws.elasticache#DuplicateUserNameFault": - throw await de_DuplicateUserNameFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidUserGroupState": - case "com.amazonaws.elasticache#InvalidUserGroupStateFault": - throw await de_InvalidUserGroupStateFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "UserGroupNotFound": - case "com.amazonaws.elasticache#UserGroupNotFoundFault": - throw await de_UserGroupNotFoundFaultRes(parsedOutput, context); - case "UserNotFound": - case "com.amazonaws.elasticache#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPurchaseReservedCacheNodesOfferingCommand - */ -export const de_PurchaseReservedCacheNodesOfferingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PurchaseReservedCacheNodesOfferingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PurchaseReservedCacheNodesOfferingResult(data.PurchaseReservedCacheNodesOfferingResult, context); - const response: PurchaseReservedCacheNodesOfferingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryPurchaseReservedCacheNodesOfferingCommandError - */ -const de_PurchaseReservedCacheNodesOfferingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ReservedCacheNodeAlreadyExists": - case "com.amazonaws.elasticache#ReservedCacheNodeAlreadyExistsFault": - throw await de_ReservedCacheNodeAlreadyExistsFaultRes(parsedOutput, context); - case "ReservedCacheNodeQuotaExceeded": - case "com.amazonaws.elasticache#ReservedCacheNodeQuotaExceededFault": - throw await de_ReservedCacheNodeQuotaExceededFaultRes(parsedOutput, context); - case "ReservedCacheNodesOfferingNotFound": - case "com.amazonaws.elasticache#ReservedCacheNodesOfferingNotFoundFault": - throw await de_ReservedCacheNodesOfferingNotFoundFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.elasticache#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRebalanceSlotsInGlobalReplicationGroupCommand - */ -export const de_RebalanceSlotsInGlobalReplicationGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RebalanceSlotsInGlobalReplicationGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RebalanceSlotsInGlobalReplicationGroupResult( - data.RebalanceSlotsInGlobalReplicationGroupResult, - context - ); - const response: RebalanceSlotsInGlobalReplicationGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRebalanceSlotsInGlobalReplicationGroupCommandError - */ -const de_RebalanceSlotsInGlobalReplicationGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#GlobalReplicationGroupNotFoundFault": - throw await de_GlobalReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidGlobalReplicationGroupState": - case "com.amazonaws.elasticache#InvalidGlobalReplicationGroupStateFault": - throw await de_InvalidGlobalReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRebootCacheClusterCommand - */ -export const de_RebootCacheClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RebootCacheClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RebootCacheClusterResult(data.RebootCacheClusterResult, context); - const response: RebootCacheClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRebootCacheClusterCommandError - */ -const de_RebootCacheClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheClusterNotFound": - case "com.amazonaws.elasticache#CacheClusterNotFoundFault": - throw await de_CacheClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidCacheClusterState": - case "com.amazonaws.elasticache#InvalidCacheClusterStateFault": - throw await de_InvalidCacheClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRemoveTagsFromResourceCommand - */ -export const de_RemoveTagsFromResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveTagsFromResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_TagListMessage(data.RemoveTagsFromResourceResult, context); - const response: RemoveTagsFromResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRemoveTagsFromResourceCommandError - */ -const de_RemoveTagsFromResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheClusterNotFound": - case "com.amazonaws.elasticache#CacheClusterNotFoundFault": - throw await de_CacheClusterNotFoundFaultRes(parsedOutput, context); - case "CacheParameterGroupNotFound": - case "com.amazonaws.elasticache#CacheParameterGroupNotFoundFault": - throw await de_CacheParameterGroupNotFoundFaultRes(parsedOutput, context); - case "CacheSecurityGroupNotFound": - case "com.amazonaws.elasticache#CacheSecurityGroupNotFoundFault": - throw await de_CacheSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "CacheSubnetGroupNotFoundFault": - case "com.amazonaws.elasticache#CacheSubnetGroupNotFoundFault": - throw await de_CacheSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidARN": - case "com.amazonaws.elasticache#InvalidARNFault": - throw await de_InvalidARNFaultRes(parsedOutput, context); - case "InvalidReplicationGroupState": - case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": - throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidServerlessCacheSnapshotStateFault": - case "com.amazonaws.elasticache#InvalidServerlessCacheSnapshotStateFault": - throw await de_InvalidServerlessCacheSnapshotStateFaultRes(parsedOutput, context); - case "InvalidServerlessCacheStateFault": - case "com.amazonaws.elasticache#InvalidServerlessCacheStateFault": - throw await de_InvalidServerlessCacheStateFaultRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - case "ReservedCacheNodeNotFound": - case "com.amazonaws.elasticache#ReservedCacheNodeNotFoundFault": - throw await de_ReservedCacheNodeNotFoundFaultRes(parsedOutput, context); - case "ServerlessCacheNotFoundFault": - case "com.amazonaws.elasticache#ServerlessCacheNotFoundFault": - throw await de_ServerlessCacheNotFoundFaultRes(parsedOutput, context); - case "ServerlessCacheSnapshotNotFoundFault": - case "com.amazonaws.elasticache#ServerlessCacheSnapshotNotFoundFault": - throw await de_ServerlessCacheSnapshotNotFoundFaultRes(parsedOutput, context); - case "SnapshotNotFoundFault": - case "com.amazonaws.elasticache#SnapshotNotFoundFault": - throw await de_SnapshotNotFoundFaultRes(parsedOutput, context); - case "TagNotFound": - case "com.amazonaws.elasticache#TagNotFoundFault": - throw await de_TagNotFoundFaultRes(parsedOutput, context); - case "UserGroupNotFound": - case "com.amazonaws.elasticache#UserGroupNotFoundFault": - throw await de_UserGroupNotFoundFaultRes(parsedOutput, context); - case "UserNotFound": - case "com.amazonaws.elasticache#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryResetCacheParameterGroupCommand - */ -export const de_ResetCacheParameterGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ResetCacheParameterGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CacheParameterGroupNameMessage(data.ResetCacheParameterGroupResult, context); - const response: ResetCacheParameterGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryResetCacheParameterGroupCommandError - */ -const de_ResetCacheParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CacheParameterGroupNotFound": - case "com.amazonaws.elasticache#CacheParameterGroupNotFoundFault": - throw await de_CacheParameterGroupNotFoundFaultRes(parsedOutput, context); + case "ReplicationGroupNotUnderMigrationFault": + case "com.amazonaws.elasticache#ReplicationGroupNotUnderMigrationFault": + throw await de_ReplicationGroupNotUnderMigrationFaultRes(parsedOutput, context); + case "ServerlessCacheSnapshotAlreadyExistsFault": + case "com.amazonaws.elasticache#ServerlessCacheSnapshotAlreadyExistsFault": + throw await de_ServerlessCacheSnapshotAlreadyExistsFaultRes(parsedOutput, context); + case "ServerlessCacheSnapshotQuotaExceededFault": + case "com.amazonaws.elasticache#ServerlessCacheSnapshotQuotaExceededFault": + throw await de_ServerlessCacheSnapshotQuotaExceededFaultRes(parsedOutput, context); + case "ServiceLinkedRoleNotFoundFault": + case "com.amazonaws.elasticache#ServiceLinkedRoleNotFoundFault": + throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); + case "InvalidSnapshotState": + case "com.amazonaws.elasticache#InvalidSnapshotStateFault": + throw await de_InvalidSnapshotStateFaultRes(parsedOutput, context); + case "SnapshotAlreadyExistsFault": + case "com.amazonaws.elasticache#SnapshotAlreadyExistsFault": + throw await de_SnapshotAlreadyExistsFaultRes(parsedOutput, context); + case "SnapshotQuotaExceededFault": + case "com.amazonaws.elasticache#SnapshotQuotaExceededFault": + throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); + case "CacheClusterAlreadyExists": + case "com.amazonaws.elasticache#CacheClusterAlreadyExistsFault": + throw await de_CacheClusterAlreadyExistsFaultRes(parsedOutput, context); + case "ClusterQuotaForCustomerExceeded": + case "com.amazonaws.elasticache#ClusterQuotaForCustomerExceededFault": + throw await de_ClusterQuotaForCustomerExceededFaultRes(parsedOutput, context); + case "InsufficientCacheClusterCapacity": + case "com.amazonaws.elasticache#InsufficientCacheClusterCapacityFault": + throw await de_InsufficientCacheClusterCapacityFaultRes(parsedOutput, context); + case "InvalidVPCNetworkStateFault": + case "com.amazonaws.elasticache#InvalidVPCNetworkStateFault": + throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); + case "NodeQuotaForClusterExceeded": + case "com.amazonaws.elasticache#NodeQuotaForClusterExceededFault": + throw await de_NodeQuotaForClusterExceededFaultRes(parsedOutput, context); + case "NodeQuotaForCustomerExceeded": + case "com.amazonaws.elasticache#NodeQuotaForCustomerExceededFault": + throw await de_NodeQuotaForCustomerExceededFaultRes(parsedOutput, context); + case "CacheParameterGroupAlreadyExists": + case "com.amazonaws.elasticache#CacheParameterGroupAlreadyExistsFault": + throw await de_CacheParameterGroupAlreadyExistsFaultRes(parsedOutput, context); + case "CacheParameterGroupQuotaExceeded": + case "com.amazonaws.elasticache#CacheParameterGroupQuotaExceededFault": + throw await de_CacheParameterGroupQuotaExceededFaultRes(parsedOutput, context); case "InvalidCacheParameterGroupState": case "com.amazonaws.elasticache#InvalidCacheParameterGroupStateFault": throw await de_InvalidCacheParameterGroupStateFaultRes(parsedOutput, context); - case "InvalidGlobalReplicationGroupState": - case "com.amazonaws.elasticache#InvalidGlobalReplicationGroupStateFault": - throw await de_InvalidGlobalReplicationGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRevokeCacheSecurityGroupIngressCommand - */ -export const de_RevokeCacheSecurityGroupIngressCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RevokeCacheSecurityGroupIngressCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RevokeCacheSecurityGroupIngressResult(data.RevokeCacheSecurityGroupIngressResult, context); - const response: RevokeCacheSecurityGroupIngressCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRevokeCacheSecurityGroupIngressCommandError - */ -const de_RevokeCacheSecurityGroupIngressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { + case "CacheSecurityGroupAlreadyExists": + case "com.amazonaws.elasticache#CacheSecurityGroupAlreadyExistsFault": + throw await de_CacheSecurityGroupAlreadyExistsFaultRes(parsedOutput, context); + case "QuotaExceeded.CacheSecurityGroup": + case "com.amazonaws.elasticache#CacheSecurityGroupQuotaExceededFault": + throw await de_CacheSecurityGroupQuotaExceededFaultRes(parsedOutput, context); + case "CacheSubnetGroupAlreadyExists": + case "com.amazonaws.elasticache#CacheSubnetGroupAlreadyExistsFault": + throw await de_CacheSubnetGroupAlreadyExistsFaultRes(parsedOutput, context); + case "CacheSubnetGroupQuotaExceeded": + case "com.amazonaws.elasticache#CacheSubnetGroupQuotaExceededFault": + throw await de_CacheSubnetGroupQuotaExceededFaultRes(parsedOutput, context); + case "CacheSubnetQuotaExceededFault": + case "com.amazonaws.elasticache#CacheSubnetQuotaExceededFault": + throw await de_CacheSubnetQuotaExceededFaultRes(parsedOutput, context); + case "InvalidSubnet": + case "com.amazonaws.elasticache#InvalidSubnet": + throw await de_InvalidSubnetRes(parsedOutput, context); + case "SubnetNotAllowedFault": + case "com.amazonaws.elasticache#SubnetNotAllowedFault": + throw await de_SubnetNotAllowedFaultRes(parsedOutput, context); + case "GlobalReplicationGroupAlreadyExistsFault": + case "com.amazonaws.elasticache#GlobalReplicationGroupAlreadyExistsFault": + throw await de_GlobalReplicationGroupAlreadyExistsFaultRes(parsedOutput, context); + case "GlobalReplicationGroupNotFoundFault": + case "com.amazonaws.elasticache#GlobalReplicationGroupNotFoundFault": + throw await de_GlobalReplicationGroupNotFoundFaultRes(parsedOutput, context); + case "InvalidCacheClusterState": + case "com.amazonaws.elasticache#InvalidCacheClusterStateFault": + throw await de_InvalidCacheClusterStateFaultRes(parsedOutput, context); + case "InvalidGlobalReplicationGroupState": + case "com.amazonaws.elasticache#InvalidGlobalReplicationGroupStateFault": + throw await de_InvalidGlobalReplicationGroupStateFaultRes(parsedOutput, context); + case "InvalidUserGroupState": + case "com.amazonaws.elasticache#InvalidUserGroupStateFault": + throw await de_InvalidUserGroupStateFaultRes(parsedOutput, context); + case "NodeGroupsPerReplicationGroupQuotaExceeded": + case "com.amazonaws.elasticache#NodeGroupsPerReplicationGroupQuotaExceededFault": + throw await de_NodeGroupsPerReplicationGroupQuotaExceededFaultRes(parsedOutput, context); + case "ReplicationGroupAlreadyExists": + case "com.amazonaws.elasticache#ReplicationGroupAlreadyExistsFault": + throw await de_ReplicationGroupAlreadyExistsFaultRes(parsedOutput, context); + case "InvalidCredentialsException": + case "com.amazonaws.elasticache#InvalidCredentialsException": + throw await de_InvalidCredentialsExceptionRes(parsedOutput, context); + case "ServerlessCacheAlreadyExistsFault": + case "com.amazonaws.elasticache#ServerlessCacheAlreadyExistsFault": + throw await de_ServerlessCacheAlreadyExistsFaultRes(parsedOutput, context); + case "ServerlessCacheQuotaForCustomerExceededFault": + case "com.amazonaws.elasticache#ServerlessCacheQuotaForCustomerExceededFault": + throw await de_ServerlessCacheQuotaForCustomerExceededFaultRes(parsedOutput, context); + case "SnapshotFeatureNotSupportedFault": + case "com.amazonaws.elasticache#SnapshotFeatureNotSupportedFault": + throw await de_SnapshotFeatureNotSupportedFaultRes(parsedOutput, context); + case "DuplicateUserName": + case "com.amazonaws.elasticache#DuplicateUserNameFault": + throw await de_DuplicateUserNameFaultRes(parsedOutput, context); + case "UserAlreadyExists": + case "com.amazonaws.elasticache#UserAlreadyExistsFault": + throw await de_UserAlreadyExistsFaultRes(parsedOutput, context); + case "UserQuotaExceeded": + case "com.amazonaws.elasticache#UserQuotaExceededFault": + throw await de_UserQuotaExceededFaultRes(parsedOutput, context); + case "DefaultUserRequired": + case "com.amazonaws.elasticache#DefaultUserRequired": + throw await de_DefaultUserRequiredRes(parsedOutput, context); + case "UserGroupAlreadyExists": + case "com.amazonaws.elasticache#UserGroupAlreadyExistsFault": + throw await de_UserGroupAlreadyExistsFaultRes(parsedOutput, context); + case "UserGroupQuotaExceeded": + case "com.amazonaws.elasticache#UserGroupQuotaExceededFault": + throw await de_UserGroupQuotaExceededFaultRes(parsedOutput, context); + case "NoOperationFault": + case "com.amazonaws.elasticache#NoOperationFault": + throw await de_NoOperationFaultRes(parsedOutput, context); + case "CacheSubnetGroupInUse": + case "com.amazonaws.elasticache#CacheSubnetGroupInUse": + throw await de_CacheSubnetGroupInUseRes(parsedOutput, context); + case "DefaultUserAssociatedToUserGroup": + case "com.amazonaws.elasticache#DefaultUserAssociatedToUserGroupFault": + throw await de_DefaultUserAssociatedToUserGroupFaultRes(parsedOutput, context); + case "InvalidUserState": + case "com.amazonaws.elasticache#InvalidUserStateFault": + throw await de_InvalidUserStateFaultRes(parsedOutput, context); + case "ReservedCacheNodesOfferingNotFound": + case "com.amazonaws.elasticache#ReservedCacheNodesOfferingNotFoundFault": + throw await de_ReservedCacheNodesOfferingNotFoundFaultRes(parsedOutput, context); + case "InvalidKMSKeyFault": + case "com.amazonaws.elasticache#InvalidKMSKeyFault": + throw await de_InvalidKMSKeyFaultRes(parsedOutput, context); + case "SubnetInUse": + case "com.amazonaws.elasticache#SubnetInUse": + throw await de_SubnetInUseRes(parsedOutput, context); + case "ReservedCacheNodeAlreadyExists": + case "com.amazonaws.elasticache#ReservedCacheNodeAlreadyExistsFault": + throw await de_ReservedCacheNodeAlreadyExistsFaultRes(parsedOutput, context); + case "ReservedCacheNodeQuotaExceeded": + case "com.amazonaws.elasticache#ReservedCacheNodeQuotaExceededFault": + throw await de_ReservedCacheNodeQuotaExceededFaultRes(parsedOutput, context); + case "TagNotFound": + case "com.amazonaws.elasticache#TagNotFoundFault": + throw await de_TagNotFoundFaultRes(parsedOutput, context); case "AuthorizationNotFound": case "com.amazonaws.elasticache#AuthorizationNotFoundFault": throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); - case "CacheSecurityGroupNotFound": - case "com.amazonaws.elasticache#CacheSecurityGroupNotFoundFault": - throw await de_CacheSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidCacheSecurityGroupState": - case "com.amazonaws.elasticache#InvalidCacheSecurityGroupStateFault": - throw await de_InvalidCacheSecurityGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryStartMigrationCommand - */ -export const de_StartMigrationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartMigrationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_StartMigrationResponse(data.StartMigrationResult, context); - const response: StartMigrationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryStartMigrationCommandError - */ -const de_StartMigrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidReplicationGroupState": - case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": - throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); case "ReplicationGroupAlreadyUnderMigrationFault": case "com.amazonaws.elasticache#ReplicationGroupAlreadyUnderMigrationFault": throw await de_ReplicationGroupAlreadyUnderMigrationFaultRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryTestFailoverCommand - */ -export const de_TestFailoverCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TestFailoverCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_TestFailoverResult(data.TestFailoverResult, context); - const response: TestFailoverCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryTestFailoverCommandError - */ -const de_TestFailoverCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { case "APICallRateForCustomerExceeded": case "com.amazonaws.elasticache#APICallRateForCustomerExceededFault": throw await de_APICallRateForCustomerExceededFaultRes(parsedOutput, context); - case "InvalidCacheClusterState": - case "com.amazonaws.elasticache#InvalidCacheClusterStateFault": - throw await de_InvalidCacheClusterStateFaultRes(parsedOutput, context); - case "InvalidKMSKeyFault": - case "com.amazonaws.elasticache#InvalidKMSKeyFault": - throw await de_InvalidKMSKeyFaultRes(parsedOutput, context); - case "InvalidParameterCombination": - case "com.amazonaws.elasticache#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidReplicationGroupState": - case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": - throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); case "NodeGroupNotFoundFault": case "com.amazonaws.elasticache#NodeGroupNotFoundFault": throw await de_NodeGroupNotFoundFaultRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); case "TestFailoverNotAvailableFault": case "com.amazonaws.elasticache#TestFailoverNotAvailableFault": throw await de_TestFailoverNotAvailableFaultRes(parsedOutput, context); @@ -6282,62 +3570,7 @@ const de_TestFailoverCommandError = async ( output, parsedBody: parsedBody.Error, errorCode, - }); - } -}; - -/** - * deserializeAws_queryTestMigrationCommand - */ -export const de_TestMigrationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TestMigrationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_TestMigrationResponse(data.TestMigrationResult, context); - const response: TestMigrationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryTestMigrationCommandError - */ -const de_TestMigrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValue": - case "com.amazonaws.elasticache#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidReplicationGroupState": - case "com.amazonaws.elasticache#InvalidReplicationGroupStateFault": - throw await de_InvalidReplicationGroupStateFaultRes(parsedOutput, context); - case "ReplicationGroupAlreadyUnderMigrationFault": - case "com.amazonaws.elasticache#ReplicationGroupAlreadyUnderMigrationFault": - throw await de_ReplicationGroupAlreadyUnderMigrationFaultRes(parsedOutput, context); - case "ReplicationGroupNotFoundFault": - case "com.amazonaws.elasticache#ReplicationGroupNotFoundFault": - throw await de_ReplicationGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + }) as never; } }; diff --git a/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts b/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts index 9be5125c3c4a..7b549dea493e 100644 --- a/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts +++ b/clients/client-elasticsearch-service/src/protocols/Aws_restJson1.ts @@ -1317,7 +1317,7 @@ export const de_AcceptInboundCrossClusterSearchConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptInboundCrossClusterSearchConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1330,38 +1330,6 @@ export const de_AcceptInboundCrossClusterSearchConnectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptInboundCrossClusterSearchConnectionCommandError - */ -const de_AcceptInboundCrossClusterSearchConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.elasticsearchservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AddTagsCommand */ @@ -1370,7 +1338,7 @@ export const de_AddTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AddTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1379,41 +1347,6 @@ export const de_AddTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddTagsCommandError - */ -const de_AddTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.elasticsearchservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociatePackageCommand */ @@ -1422,7 +1355,7 @@ export const de_AssociatePackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociatePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1435,47 +1368,6 @@ export const de_AssociatePackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociatePackageCommandError - */ -const de_AssociatePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elasticsearchservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.elasticsearchservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AuthorizeVpcEndpointAccessCommand */ @@ -1484,7 +1376,7 @@ export const de_AuthorizeVpcEndpointAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AuthorizeVpcEndpointAccessCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1497,47 +1389,6 @@ export const de_AuthorizeVpcEndpointAccessCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AuthorizeVpcEndpointAccessCommandError - */ -const de_AuthorizeVpcEndpointAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.elasticsearchservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelElasticsearchServiceSoftwareUpdateCommand */ @@ -1546,7 +1397,7 @@ export const de_CancelElasticsearchServiceSoftwareUpdateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelElasticsearchServiceSoftwareUpdateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1559,41 +1410,6 @@ export const de_CancelElasticsearchServiceSoftwareUpdateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelElasticsearchServiceSoftwareUpdateCommandError - */ -const de_CancelElasticsearchServiceSoftwareUpdateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateElasticsearchDomainCommand */ @@ -1602,7 +1418,7 @@ export const de_CreateElasticsearchDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateElasticsearchDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1615,50 +1431,6 @@ export const de_CreateElasticsearchDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateElasticsearchDomainCommandError - */ -const de_CreateElasticsearchDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidTypeException": - case "com.amazonaws.elasticsearchservice#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.elasticsearchservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.elasticsearchservice#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateOutboundCrossClusterSearchConnectionCommand */ @@ -1667,7 +1439,7 @@ export const de_CreateOutboundCrossClusterSearchConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateOutboundCrossClusterSearchConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1684,41 +1456,6 @@ export const de_CreateOutboundCrossClusterSearchConnectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateOutboundCrossClusterSearchConnectionCommandError - */ -const de_CreateOutboundCrossClusterSearchConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.elasticsearchservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.elasticsearchservice#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePackageCommand */ @@ -1727,7 +1464,7 @@ export const de_CreatePackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1741,58 +1478,14 @@ export const de_CreatePackageCommand = async ( }; /** - * deserializeAws_restJson1CreatePackageCommandError + * deserializeAws_restJson1CreateVpcEndpointCommand */ -const de_CreatePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elasticsearchservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidTypeException": - case "com.amazonaws.elasticsearchservice#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.elasticsearchservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.elasticsearchservice#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateVpcEndpointCommand - */ -export const de_CreateVpcEndpointCommand = async ( +export const de_CreateVpcEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateVpcEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1805,47 +1498,6 @@ export const de_CreateVpcEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateVpcEndpointCommandError - */ -const de_CreateVpcEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.elasticsearchservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.elasticsearchservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteElasticsearchDomainCommand */ @@ -1854,7 +1506,7 @@ export const de_DeleteElasticsearchDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteElasticsearchDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1867,41 +1519,6 @@ export const de_DeleteElasticsearchDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteElasticsearchDomainCommandError - */ -const de_DeleteElasticsearchDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteElasticsearchServiceRoleCommand */ @@ -1910,7 +1527,7 @@ export const de_DeleteElasticsearchServiceRoleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteElasticsearchServiceRoleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1919,38 +1536,6 @@ export const de_DeleteElasticsearchServiceRoleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteElasticsearchServiceRoleCommandError - */ -const de_DeleteElasticsearchServiceRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteInboundCrossClusterSearchConnectionCommand */ @@ -1959,7 +1544,7 @@ export const de_DeleteInboundCrossClusterSearchConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteInboundCrossClusterSearchConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1972,35 +1557,6 @@ export const de_DeleteInboundCrossClusterSearchConnectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteInboundCrossClusterSearchConnectionCommandError - */ -const de_DeleteInboundCrossClusterSearchConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteOutboundCrossClusterSearchConnectionCommand */ @@ -2009,7 +1565,7 @@ export const de_DeleteOutboundCrossClusterSearchConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteOutboundCrossClusterSearchConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2022,35 +1578,6 @@ export const de_DeleteOutboundCrossClusterSearchConnectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteOutboundCrossClusterSearchConnectionCommandError - */ -const de_DeleteOutboundCrossClusterSearchConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePackageCommand */ @@ -2059,7 +1586,7 @@ export const de_DeletePackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2072,47 +1599,6 @@ export const de_DeletePackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePackageCommandError - */ -const de_DeletePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elasticsearchservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.elasticsearchservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteVpcEndpointCommand */ @@ -2121,7 +1607,7 @@ export const de_DeleteVpcEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteVpcEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2134,41 +1620,6 @@ export const de_DeleteVpcEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteVpcEndpointCommandError - */ -const de_DeleteVpcEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDomainAutoTunesCommand */ @@ -2177,7 +1628,7 @@ export const de_DescribeDomainAutoTunesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDomainAutoTunesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2192,49 +1643,14 @@ export const de_DescribeDomainAutoTunesCommand = async ( }; /** - * deserializeAws_restJson1DescribeDomainAutoTunesCommandError + * deserializeAws_restJson1DescribeDomainChangeProgressCommand */ -const de_DescribeDomainAutoTunesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDomainChangeProgressCommand - */ -export const de_DescribeDomainChangeProgressCommand = async ( +export const de_DescribeDomainChangeProgressCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDomainChangeProgressCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2247,41 +1663,6 @@ export const de_DescribeDomainChangeProgressCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDomainChangeProgressCommandError - */ -const de_DescribeDomainChangeProgressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeElasticsearchDomainCommand */ @@ -2290,7 +1671,7 @@ export const de_DescribeElasticsearchDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeElasticsearchDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2303,41 +1684,6 @@ export const de_DescribeElasticsearchDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeElasticsearchDomainCommandError - */ -const de_DescribeElasticsearchDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeElasticsearchDomainConfigCommand */ @@ -2346,7 +1692,7 @@ export const de_DescribeElasticsearchDomainConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeElasticsearchDomainConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2359,41 +1705,6 @@ export const de_DescribeElasticsearchDomainConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeElasticsearchDomainConfigCommandError - */ -const de_DescribeElasticsearchDomainConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeElasticsearchDomainsCommand */ @@ -2402,7 +1713,7 @@ export const de_DescribeElasticsearchDomainsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeElasticsearchDomainsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2415,38 +1726,6 @@ export const de_DescribeElasticsearchDomainsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeElasticsearchDomainsCommandError - */ -const de_DescribeElasticsearchDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeElasticsearchInstanceTypeLimitsCommand */ @@ -2455,7 +1734,7 @@ export const de_DescribeElasticsearchInstanceTypeLimitsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeElasticsearchInstanceTypeLimitsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2468,47 +1747,6 @@ export const de_DescribeElasticsearchInstanceTypeLimitsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeElasticsearchInstanceTypeLimitsCommandError - */ -const de_DescribeElasticsearchInstanceTypeLimitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidTypeException": - case "com.amazonaws.elasticsearchservice#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.elasticsearchservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeInboundCrossClusterSearchConnectionsCommand */ @@ -2517,7 +1755,7 @@ export const de_DescribeInboundCrossClusterSearchConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeInboundCrossClusterSearchConnectionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2531,35 +1769,6 @@ export const de_DescribeInboundCrossClusterSearchConnectionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeInboundCrossClusterSearchConnectionsCommandError - */ -const de_DescribeInboundCrossClusterSearchConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.elasticsearchservice#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeOutboundCrossClusterSearchConnectionsCommand */ @@ -2568,7 +1777,7 @@ export const de_DescribeOutboundCrossClusterSearchConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeOutboundCrossClusterSearchConnectionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2582,35 +1791,6 @@ export const de_DescribeOutboundCrossClusterSearchConnectionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeOutboundCrossClusterSearchConnectionsCommandError - */ -const de_DescribeOutboundCrossClusterSearchConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.elasticsearchservice#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribePackagesCommand */ @@ -2619,7 +1799,7 @@ export const de_DescribePackagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePackagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2634,52 +1814,14 @@ export const de_DescribePackagesCommand = async ( }; /** - * deserializeAws_restJson1DescribePackagesCommandError + * deserializeAws_restJson1DescribeReservedElasticsearchInstanceOfferingsCommand */ -const de_DescribePackagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elasticsearchservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeReservedElasticsearchInstanceOfferingsCommand - */ -export const de_DescribeReservedElasticsearchInstanceOfferingsCommand = async ( +export const de_DescribeReservedElasticsearchInstanceOfferingsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeReservedElasticsearchInstanceOfferingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2693,41 +1835,6 @@ export const de_DescribeReservedElasticsearchInstanceOfferingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeReservedElasticsearchInstanceOfferingsCommandError - */ -const de_DescribeReservedElasticsearchInstanceOfferingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeReservedElasticsearchInstancesCommand */ @@ -2736,7 +1843,7 @@ export const de_DescribeReservedElasticsearchInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeReservedElasticsearchInstancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2750,41 +1857,6 @@ export const de_DescribeReservedElasticsearchInstancesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeReservedElasticsearchInstancesCommandError - */ -const de_DescribeReservedElasticsearchInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeVpcEndpointsCommand */ @@ -2793,7 +1865,7 @@ export const de_DescribeVpcEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeVpcEndpointsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2807,41 +1879,6 @@ export const de_DescribeVpcEndpointsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeVpcEndpointsCommandError - */ -const de_DescribeVpcEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DissociatePackageCommand */ @@ -2850,7 +1887,7 @@ export const de_DissociatePackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DissociatePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2863,47 +1900,6 @@ export const de_DissociatePackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DissociatePackageCommandError - */ -const de_DissociatePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elasticsearchservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.elasticsearchservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCompatibleElasticsearchVersionsCommand */ @@ -2912,7 +1908,7 @@ export const de_GetCompatibleElasticsearchVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCompatibleElasticsearchVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2925,44 +1921,6 @@ export const de_GetCompatibleElasticsearchVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCompatibleElasticsearchVersionsCommandError - */ -const de_GetCompatibleElasticsearchVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPackageVersionHistoryCommand */ @@ -2971,7 +1929,7 @@ export const de_GetPackageVersionHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPackageVersionHistoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2987,173 +1945,59 @@ export const de_GetPackageVersionHistoryCommand = async ( }; /** - * deserializeAws_restJson1GetPackageVersionHistoryCommandError + * deserializeAws_restJson1GetUpgradeHistoryCommand */ -const de_GetPackageVersionHistoryCommandError = async ( +export const de_GetUpgradeHistoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elasticsearchservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + UpgradeHistories: (_) => de_UpgradeHistoryList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetUpgradeHistoryCommand + * deserializeAws_restJson1GetUpgradeStatusCommand */ -export const de_GetUpgradeHistoryCommand = async ( +export const de_GetUpgradeStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUpgradeHistoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - UpgradeHistories: (_) => de_UpgradeHistoryList(_, context), + StepStatus: __expectString, + UpgradeName: __expectString, + UpgradeStep: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetUpgradeHistoryCommandError + * deserializeAws_restJson1ListDomainNamesCommand */ -const de_GetUpgradeHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetUpgradeStatusCommand - */ -export const de_GetUpgradeStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUpgradeStatusCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - StepStatus: __expectString, - UpgradeName: __expectString, - UpgradeStep: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetUpgradeStatusCommandError - */ -const de_GetUpgradeStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDomainNamesCommand - */ -export const de_ListDomainNamesCommand = async ( +export const de_ListDomainNamesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDomainNamesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3166,35 +2010,6 @@ export const de_ListDomainNamesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDomainNamesCommandError - */ -const de_ListDomainNamesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDomainsForPackageCommand */ @@ -3203,7 +2018,7 @@ export const de_ListDomainsForPackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDomainsForPackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3217,44 +2032,6 @@ export const de_ListDomainsForPackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDomainsForPackageCommandError - */ -const de_ListDomainsForPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elasticsearchservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListElasticsearchInstanceTypesCommand */ @@ -3263,7 +2040,7 @@ export const de_ListElasticsearchInstanceTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListElasticsearchInstanceTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3277,41 +2054,6 @@ export const de_ListElasticsearchInstanceTypesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListElasticsearchInstanceTypesCommandError - */ -const de_ListElasticsearchInstanceTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListElasticsearchVersionsCommand */ @@ -3320,7 +2062,7 @@ export const de_ListElasticsearchVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListElasticsearchVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3334,41 +2076,6 @@ export const de_ListElasticsearchVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListElasticsearchVersionsCommandError - */ -const de_ListElasticsearchVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPackagesForDomainCommand */ @@ -3377,7 +2084,7 @@ export const de_ListPackagesForDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPackagesForDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3391,44 +2098,6 @@ export const de_ListPackagesForDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListPackagesForDomainCommandError - */ -const de_ListPackagesForDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elasticsearchservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsCommand */ @@ -3437,7 +2106,7 @@ export const de_ListTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3450,41 +2119,6 @@ export const de_ListTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsCommandError - */ -const de_ListTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListVpcEndpointAccessCommand */ @@ -3493,7 +2127,7 @@ export const de_ListVpcEndpointAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVpcEndpointAccessCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3507,41 +2141,6 @@ export const de_ListVpcEndpointAccessCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListVpcEndpointAccessCommandError - */ -const de_ListVpcEndpointAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListVpcEndpointsCommand */ @@ -3550,7 +2149,7 @@ export const de_ListVpcEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVpcEndpointsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3564,38 +2163,6 @@ export const de_ListVpcEndpointsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListVpcEndpointsCommandError - */ -const de_ListVpcEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListVpcEndpointsForDomainCommand */ @@ -3604,7 +2171,7 @@ export const de_ListVpcEndpointsForDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVpcEndpointsForDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3618,41 +2185,6 @@ export const de_ListVpcEndpointsForDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListVpcEndpointsForDomainCommandError - */ -const de_ListVpcEndpointsForDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PurchaseReservedElasticsearchInstanceOfferingCommand */ @@ -3661,7 +2193,7 @@ export const de_PurchaseReservedElasticsearchInstanceOfferingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PurchaseReservedElasticsearchInstanceOfferingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3675,144 +2207,42 @@ export const de_PurchaseReservedElasticsearchInstanceOfferingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PurchaseReservedElasticsearchInstanceOfferingCommandError - */ -const de_PurchaseReservedElasticsearchInstanceOfferingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.elasticsearchservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.elasticsearchservice#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RejectInboundCrossClusterSearchConnectionCommand */ -export const de_RejectInboundCrossClusterSearchConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RejectInboundCrossClusterSearchConnectionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CrossClusterSearchConnection: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1RejectInboundCrossClusterSearchConnectionCommandError - */ -const de_RejectInboundCrossClusterSearchConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RemoveTagsCommand - */ -export const de_RemoveTagsCommand = async ( +export const de_RejectInboundCrossClusterSearchConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CrossClusterSearchConnection: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RemoveTagsCommandError + * deserializeAws_restJson1RemoveTagsCommand */ -const de_RemoveTagsCommandError = async ( +export const de_RemoveTagsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -3823,7 +2253,7 @@ export const de_RevokeVpcEndpointAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RevokeVpcEndpointAccessCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3832,44 +2262,6 @@ export const de_RevokeVpcEndpointAccessCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RevokeVpcEndpointAccessCommandError - */ -const de_RevokeVpcEndpointAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartElasticsearchServiceSoftwareUpdateCommand */ @@ -3878,7 +2270,7 @@ export const de_StartElasticsearchServiceSoftwareUpdateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartElasticsearchServiceSoftwareUpdateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3891,41 +2283,6 @@ export const de_StartElasticsearchServiceSoftwareUpdateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartElasticsearchServiceSoftwareUpdateCommandError - */ -const de_StartElasticsearchServiceSoftwareUpdateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateElasticsearchDomainConfigCommand */ @@ -3934,7 +2291,7 @@ export const de_UpdateElasticsearchDomainConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateElasticsearchDomainConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3948,47 +2305,6 @@ export const de_UpdateElasticsearchDomainConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateElasticsearchDomainConfigCommandError - */ -const de_UpdateElasticsearchDomainConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidTypeException": - case "com.amazonaws.elasticsearchservice#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.elasticsearchservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePackageCommand */ @@ -3997,7 +2313,7 @@ export const de_UpdatePackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4010,47 +2326,6 @@ export const de_UpdatePackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePackageCommandError - */ -const de_UpdatePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.elasticsearchservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.elasticsearchservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVpcEndpointCommand */ @@ -4059,7 +2334,7 @@ export const de_UpdateVpcEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVpcEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4072,47 +2347,6 @@ export const de_UpdateVpcEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateVpcEndpointCommandError - */ -const de_UpdateVpcEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.elasticsearchservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.elasticsearchservice#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.elasticsearchservice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpgradeElasticsearchDomainCommand */ @@ -4121,7 +2355,7 @@ export const de_UpgradeElasticsearchDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpgradeElasticsearchDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4138,43 +2372,55 @@ export const de_UpgradeElasticsearchDomainCommand = async ( }; /** - * deserializeAws_restJson1UpgradeElasticsearchDomainCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpgradeElasticsearchDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "BaseException": - case "com.amazonaws.elasticsearchservice#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); case "DisabledOperationException": case "com.amazonaws.elasticsearchservice#DisabledOperationException": throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.elasticsearchservice#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.elasticsearchservice#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.elasticsearchservice#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.elasticsearchservice#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "BaseException": + case "com.amazonaws.elasticsearchservice#BaseException": + throw await de_BaseExceptionRes(parsedOutput, context); + case "InternalException": + case "com.amazonaws.elasticsearchservice#InternalException": + throw await de_InternalExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.elasticsearchservice#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.elasticsearchservice#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.elasticsearchservice#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InvalidTypeException": + case "com.amazonaws.elasticsearchservice#InvalidTypeException": + throw await de_InvalidTypeExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.elasticsearchservice#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidPaginationTokenException": + case "com.amazonaws.elasticsearchservice#InvalidPaginationTokenException": + throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-emr-containers/src/protocols/Aws_restJson1.ts b/clients/client-emr-containers/src/protocols/Aws_restJson1.ts index 7dd17b444603..7f2ca6a309c8 100644 --- a/clients/client-emr-containers/src/protocols/Aws_restJson1.ts +++ b/clients/client-emr-containers/src/protocols/Aws_restJson1.ts @@ -542,7 +542,7 @@ export const de_CancelJobRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelJobRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -556,35 +556,6 @@ export const de_CancelJobRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelJobRunCommandError - */ -const de_CancelJobRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateJobTemplateCommand */ @@ -593,7 +564,7 @@ export const de_CreateJobTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateJobTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -609,38 +580,6 @@ export const de_CreateJobTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateJobTemplateCommandError - */ -const de_CreateJobTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrcontainers#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateManagedEndpointCommand */ @@ -649,7 +588,7 @@ export const de_CreateManagedEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateManagedEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -665,38 +604,6 @@ export const de_CreateManagedEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateManagedEndpointCommandError - */ -const de_CreateManagedEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrcontainers#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateVirtualClusterCommand */ @@ -705,7 +612,7 @@ export const de_CreateVirtualClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateVirtualClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -720,38 +627,6 @@ export const de_CreateVirtualClusterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateVirtualClusterCommandError - */ -const de_CreateVirtualClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrcontainers#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteJobTemplateCommand */ @@ -760,7 +635,7 @@ export const de_DeleteJobTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteJobTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -773,35 +648,6 @@ export const de_DeleteJobTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteJobTemplateCommandError - */ -const de_DeleteJobTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteManagedEndpointCommand */ @@ -810,7 +656,7 @@ export const de_DeleteManagedEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteManagedEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -824,35 +670,6 @@ export const de_DeleteManagedEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteManagedEndpointCommandError - */ -const de_DeleteManagedEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteVirtualClusterCommand */ @@ -861,7 +678,7 @@ export const de_DeleteVirtualClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteVirtualClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -874,35 +691,6 @@ export const de_DeleteVirtualClusterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteVirtualClusterCommandError - */ -const de_DeleteVirtualClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeJobRunCommand */ @@ -911,7 +699,7 @@ export const de_DescribeJobRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -924,38 +712,6 @@ export const de_DescribeJobRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeJobRunCommandError - */ -const de_DescribeJobRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrcontainers#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeJobTemplateCommand */ @@ -964,7 +720,7 @@ export const de_DescribeJobTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -977,38 +733,6 @@ export const de_DescribeJobTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeJobTemplateCommandError - */ -const de_DescribeJobTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrcontainers#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeManagedEndpointCommand */ @@ -1017,160 +741,61 @@ export const de_DescribeManagedEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeManagedEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - endpoint: (_) => de_Endpoint(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeManagedEndpointCommandError - */ -const de_DescribeManagedEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrcontainers#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeVirtualClusterCommand - */ -export const de_DescribeVirtualClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeVirtualClusterCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - virtualCluster: (_) => de_VirtualCluster(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeVirtualClusterCommandError - */ -const de_DescribeVirtualClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrcontainers#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const doc = take(data, { + endpoint: (_) => de_Endpoint(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetManagedEndpointSessionCredentialsCommand + * deserializeAws_restJson1DescribeVirtualClusterCommand */ -export const de_GetManagedEndpointSessionCredentialsCommand = async ( +export const de_DescribeVirtualClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetManagedEndpointSessionCredentialsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - credentials: (_) => _json(__expectUnion(_)), - expiresAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - id: __expectString, + virtualCluster: (_) => de_VirtualCluster(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetManagedEndpointSessionCredentialsCommandError + * deserializeAws_restJson1GetManagedEndpointSessionCredentialsCommand */ -const de_GetManagedEndpointSessionCredentialsCommandError = async ( +export const de_GetManagedEndpointSessionCredentialsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestThrottledException": - case "com.amazonaws.emrcontainers#RequestThrottledException": - throw await de_RequestThrottledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrcontainers#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + credentials: (_) => _json(__expectUnion(_)), + expiresAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + id: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1181,7 +806,7 @@ export const de_ListJobRunsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobRunsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1195,35 +820,6 @@ export const de_ListJobRunsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListJobRunsCommandError - */ -const de_ListJobRunsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListJobTemplatesCommand */ @@ -1232,7 +828,7 @@ export const de_ListJobTemplatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1246,35 +842,6 @@ export const de_ListJobTemplatesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListJobTemplatesCommandError - */ -const de_ListJobTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListManagedEndpointsCommand */ @@ -1283,7 +850,7 @@ export const de_ListManagedEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListManagedEndpointsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1297,35 +864,6 @@ export const de_ListManagedEndpointsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListManagedEndpointsCommandError - */ -const de_ListManagedEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1334,7 +872,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1347,38 +885,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrcontainers#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListVirtualClustersCommand */ @@ -1387,7 +893,7 @@ export const de_ListVirtualClustersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVirtualClustersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1401,35 +907,6 @@ export const de_ListVirtualClustersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListVirtualClustersCommandError - */ -const de_ListVirtualClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartJobRunCommand */ @@ -1438,7 +915,7 @@ export const de_StartJobRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartJobRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1454,38 +931,6 @@ export const de_StartJobRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartJobRunCommandError - */ -const de_StartJobRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrcontainers#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1494,7 +939,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1503,38 +948,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrcontainers#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrcontainers#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrcontainers#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1543,7 +956,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1553,12 +966,9 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1568,19 +978,22 @@ const de_UntagResourceCommandError = async ( case "InternalServerException": case "com.amazonaws.emrcontainers#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrcontainers#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.emrcontainers#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.emrcontainers#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "RequestThrottledException": + case "com.amazonaws.emrcontainers#RequestThrottledException": + throw await de_RequestThrottledExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts b/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts index 87e41c5b9e3b..e01f39c7311c 100644 --- a/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts +++ b/clients/client-emr-serverless/src/protocols/Aws_restJson1.ts @@ -406,7 +406,7 @@ export const de_CancelJobRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelJobRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -420,38 +420,6 @@ export const de_CancelJobRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelJobRunCommandError - */ -const de_CancelJobRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateApplicationCommand */ @@ -460,7 +428,7 @@ export const de_CreateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -475,41 +443,6 @@ export const de_CreateApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.emrserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.emrserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteApplicationCommand */ @@ -518,7 +451,7 @@ export const de_DeleteApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -527,38 +460,6 @@ export const de_DeleteApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteApplicationCommandError - */ -const de_DeleteApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetApplicationCommand */ @@ -567,7 +468,7 @@ export const de_GetApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -580,38 +481,6 @@ export const de_GetApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetApplicationCommandError - */ -const de_GetApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDashboardForJobRunCommand */ @@ -620,7 +489,7 @@ export const de_GetDashboardForJobRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDashboardForJobRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -633,38 +502,6 @@ export const de_GetDashboardForJobRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDashboardForJobRunCommandError - */ -const de_GetDashboardForJobRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetJobRunCommand */ @@ -673,7 +510,7 @@ export const de_GetJobRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJobRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -686,38 +523,6 @@ export const de_GetJobRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetJobRunCommandError - */ -const de_GetJobRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationsCommand */ @@ -726,7 +531,7 @@ export const de_ListApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -740,35 +545,6 @@ export const de_ListApplicationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationsCommandError - */ -const de_ListApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListJobRunsCommand */ @@ -777,7 +553,7 @@ export const de_ListJobRunsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobRunsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -791,35 +567,6 @@ export const de_ListJobRunsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListJobRunsCommandError - */ -const de_ListJobRunsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -828,7 +575,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -841,38 +588,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartApplicationCommand */ @@ -881,7 +596,7 @@ export const de_StartApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -890,41 +605,6 @@ export const de_StartApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartApplicationCommandError - */ -const de_StartApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.emrserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartJobRunCommand */ @@ -933,7 +613,7 @@ export const de_StartJobRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartJobRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -948,41 +628,6 @@ export const de_StartJobRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartJobRunCommandError - */ -const de_StartJobRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.emrserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.emrserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopApplicationCommand */ @@ -991,7 +636,7 @@ export const de_StopApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1000,38 +645,6 @@ export const de_StopApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopApplicationCommandError - */ -const de_StopApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1040,7 +653,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1049,38 +662,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1089,7 +670,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1098,38 +679,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emrserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.emrserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.emrserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateApplicationCommand */ @@ -1138,7 +687,7 @@ export const de_UpdateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1152,12 +701,9 @@ export const de_UpdateApplicationCommand = async ( }; /** - * deserializeAws_restJson1UpdateApplicationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1173,13 +719,19 @@ const de_UpdateApplicationCommandError = async ( case "ValidationException": case "com.amazonaws.emrserverless#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.emrserverless#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.emrserverless#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-emr/src/protocols/Aws_json1_1.ts b/clients/client-emr/src/protocols/Aws_json1_1.ts index 87ee8ce466ea..b488d1219928 100644 --- a/clients/client-emr/src/protocols/Aws_json1_1.ts +++ b/clients/client-emr/src/protocols/Aws_json1_1.ts @@ -1068,7 +1068,7 @@ export const de_AddInstanceFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddInstanceFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1080,35 +1080,6 @@ export const de_AddInstanceFleetCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddInstanceFleetCommandError - */ -const de_AddInstanceFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddInstanceGroupsCommand */ @@ -1117,7 +1088,7 @@ export const de_AddInstanceGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddInstanceGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1129,32 +1100,6 @@ export const de_AddInstanceGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddInstanceGroupsCommandError - */ -const de_AddInstanceGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddJobFlowStepsCommand */ @@ -1163,7 +1108,7 @@ export const de_AddJobFlowStepsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddJobFlowStepsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1175,32 +1120,6 @@ export const de_AddJobFlowStepsCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddJobFlowStepsCommandError - */ -const de_AddJobFlowStepsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddTagsCommand */ @@ -1209,7 +1128,7 @@ export const de_AddTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1221,35 +1140,6 @@ export const de_AddTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddTagsCommandError - */ -const de_AddTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelStepsCommand */ @@ -1258,7 +1148,7 @@ export const de_CancelStepsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelStepsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1270,35 +1160,6 @@ export const de_CancelStepsCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelStepsCommandError - */ -const de_CancelStepsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateSecurityConfigurationCommand */ @@ -1307,7 +1168,7 @@ export const de_CreateSecurityConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSecurityConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1319,35 +1180,6 @@ export const de_CreateSecurityConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateSecurityConfigurationCommandError - */ -const de_CreateSecurityConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateStudioCommand */ @@ -1356,7 +1188,7 @@ export const de_CreateStudioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateStudioCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1368,35 +1200,6 @@ export const de_CreateStudioCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateStudioCommandError - */ -const de_CreateStudioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateStudioSessionMappingCommand */ @@ -1405,7 +1208,7 @@ export const de_CreateStudioSessionMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateStudioSessionMappingCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateStudioSessionMappingCommandOutput = { @@ -1414,35 +1217,6 @@ export const de_CreateStudioSessionMappingCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateStudioSessionMappingCommandError - */ -const de_CreateStudioSessionMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteSecurityConfigurationCommand */ @@ -1451,7 +1225,7 @@ export const de_DeleteSecurityConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSecurityConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1463,35 +1237,6 @@ export const de_DeleteSecurityConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteSecurityConfigurationCommandError - */ -const de_DeleteSecurityConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteStudioCommand */ @@ -1500,7 +1245,7 @@ export const de_DeleteStudioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteStudioCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteStudioCommandOutput = { @@ -1509,35 +1254,6 @@ export const de_DeleteStudioCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteStudioCommandError - */ -const de_DeleteStudioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteStudioSessionMappingCommand */ @@ -1546,7 +1262,7 @@ export const de_DeleteStudioSessionMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteStudioSessionMappingCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteStudioSessionMappingCommandOutput = { @@ -1556,43 +1272,14 @@ export const de_DeleteStudioSessionMappingCommand = async ( }; /** - * deserializeAws_json1_1DeleteStudioSessionMappingCommandError + * deserializeAws_json1_1DescribeClusterCommand */ -const de_DeleteStudioSessionMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeClusterCommand - */ -export const de_DescribeClusterCommand = async ( +export const de_DescribeClusterCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1604,35 +1291,6 @@ export const de_DescribeClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeClusterCommandError - */ -const de_DescribeClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeJobFlowsCommand */ @@ -1641,7 +1299,7 @@ export const de_DescribeJobFlowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeJobFlowsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1653,32 +1311,6 @@ export const de_DescribeJobFlowsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeJobFlowsCommandError - */ -const de_DescribeJobFlowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeNotebookExecutionCommand */ @@ -1687,7 +1319,7 @@ export const de_DescribeNotebookExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNotebookExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1699,35 +1331,6 @@ export const de_DescribeNotebookExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeNotebookExecutionCommandError - */ -const de_DescribeNotebookExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeReleaseLabelCommand */ @@ -1736,7 +1339,7 @@ export const de_DescribeReleaseLabelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeReleaseLabelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1748,35 +1351,6 @@ export const de_DescribeReleaseLabelCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeReleaseLabelCommandError - */ -const de_DescribeReleaseLabelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeSecurityConfigurationCommand */ @@ -1785,7 +1359,7 @@ export const de_DescribeSecurityConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSecurityConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1797,35 +1371,6 @@ export const de_DescribeSecurityConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeSecurityConfigurationCommandError - */ -const de_DescribeSecurityConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeStepCommand */ @@ -1834,7 +1379,7 @@ export const de_DescribeStepCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStepCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1846,35 +1391,6 @@ export const de_DescribeStepCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeStepCommandError - */ -const de_DescribeStepCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeStudioCommand */ @@ -1883,7 +1399,7 @@ export const de_DescribeStudioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStudioCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1895,35 +1411,6 @@ export const de_DescribeStudioCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeStudioCommandError - */ -const de_DescribeStudioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAutoTerminationPolicyCommand */ @@ -1932,7 +1419,7 @@ export const de_GetAutoTerminationPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAutoTerminationPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1944,26 +1431,6 @@ export const de_GetAutoTerminationPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAutoTerminationPolicyCommandError - */ -const de_GetAutoTerminationPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1GetBlockPublicAccessConfigurationCommand */ @@ -1972,7 +1439,7 @@ export const de_GetBlockPublicAccessConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetBlockPublicAccessConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1984,35 +1451,6 @@ export const de_GetBlockPublicAccessConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetBlockPublicAccessConfigurationCommandError - */ -const de_GetBlockPublicAccessConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetClusterSessionCredentialsCommand */ @@ -2021,7 +1459,7 @@ export const de_GetClusterSessionCredentialsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetClusterSessionCredentialsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2034,43 +1472,14 @@ export const de_GetClusterSessionCredentialsCommand = async ( }; /** - * deserializeAws_json1_1GetClusterSessionCredentialsCommandError + * deserializeAws_json1_1GetManagedScalingPolicyCommand */ -const de_GetClusterSessionCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetManagedScalingPolicyCommand - */ -export const de_GetManagedScalingPolicyCommand = async ( +export const de_GetManagedScalingPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetManagedScalingPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2082,26 +1491,6 @@ export const de_GetManagedScalingPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetManagedScalingPolicyCommandError - */ -const de_GetManagedScalingPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1GetStudioSessionMappingCommand */ @@ -2110,7 +1499,7 @@ export const de_GetStudioSessionMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetStudioSessionMappingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2122,35 +1511,6 @@ export const de_GetStudioSessionMappingCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetStudioSessionMappingCommandError - */ -const de_GetStudioSessionMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListBootstrapActionsCommand */ @@ -2159,7 +1519,7 @@ export const de_ListBootstrapActionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListBootstrapActionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2171,35 +1531,6 @@ export const de_ListBootstrapActionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListBootstrapActionsCommandError - */ -const de_ListBootstrapActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListClustersCommand */ @@ -2208,7 +1539,7 @@ export const de_ListClustersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListClustersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2220,35 +1551,6 @@ export const de_ListClustersCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListClustersCommandError - */ -const de_ListClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListInstanceFleetsCommand */ @@ -2257,7 +1559,7 @@ export const de_ListInstanceFleetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListInstanceFleetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2269,35 +1571,6 @@ export const de_ListInstanceFleetsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListInstanceFleetsCommandError - */ -const de_ListInstanceFleetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListInstanceGroupsCommand */ @@ -2306,7 +1579,7 @@ export const de_ListInstanceGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListInstanceGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2318,35 +1591,6 @@ export const de_ListInstanceGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListInstanceGroupsCommandError - */ -const de_ListInstanceGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListInstancesCommand */ @@ -2355,7 +1599,7 @@ export const de_ListInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2367,35 +1611,6 @@ export const de_ListInstancesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListInstancesCommandError - */ -const de_ListInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListNotebookExecutionsCommand */ @@ -2404,7 +1619,7 @@ export const de_ListNotebookExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListNotebookExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2416,35 +1631,6 @@ export const de_ListNotebookExecutionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListNotebookExecutionsCommandError - */ -const de_ListNotebookExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListReleaseLabelsCommand */ @@ -2453,7 +1639,7 @@ export const de_ListReleaseLabelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListReleaseLabelsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2465,35 +1651,6 @@ export const de_ListReleaseLabelsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListReleaseLabelsCommandError - */ -const de_ListReleaseLabelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListSecurityConfigurationsCommand */ @@ -2502,7 +1659,7 @@ export const de_ListSecurityConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSecurityConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2514,35 +1671,6 @@ export const de_ListSecurityConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSecurityConfigurationsCommandError - */ -const de_ListSecurityConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListStepsCommand */ @@ -2551,110 +1679,32 @@ export const de_ListStepsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStepsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_ListStepsOutput(data, context); - const response: ListStepsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListStepsCommandError - */ -const de_ListStepsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListStudiosCommand - */ -export const de_ListStudiosCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListStudiosCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListStudiosOutput(data, context); - const response: ListStudiosCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListStudiosCommandError - */ -const de_ListStudiosCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const response: ListStepsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListStudioSessionMappingsCommand + * deserializeAws_json1_1ListStudiosCommand */ -export const de_ListStudioSessionMappingsCommand = async ( +export const de_ListStudiosCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListStudioSessionMappingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListStudioSessionMappingsOutput(data, context); - const response: ListStudioSessionMappingsCommandOutput = { + contents = de_ListStudiosOutput(data, context); + const response: ListStudiosCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2662,32 +1712,23 @@ export const de_ListStudioSessionMappingsCommand = async ( }; /** - * deserializeAws_json1_1ListStudioSessionMappingsCommandError + * deserializeAws_json1_1ListStudioSessionMappingsCommand */ -const de_ListStudioSessionMappingsCommandError = async ( +export const de_ListStudioSessionMappingsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListStudioSessionMappingsOutput(data, context); + const response: ListStudioSessionMappingsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2698,7 +1739,7 @@ export const de_ListSupportedInstanceTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSupportedInstanceTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2710,35 +1751,6 @@ export const de_ListSupportedInstanceTypesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSupportedInstanceTypesCommandError - */ -const de_ListSupportedInstanceTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifyClusterCommand */ @@ -2747,7 +1759,7 @@ export const de_ModifyClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2759,35 +1771,6 @@ export const de_ModifyClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyClusterCommandError - */ -const de_ModifyClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifyInstanceFleetCommand */ @@ -2796,7 +1779,7 @@ export const de_ModifyInstanceFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyInstanceFleetCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ModifyInstanceFleetCommandOutput = { @@ -2805,35 +1788,6 @@ export const de_ModifyInstanceFleetCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyInstanceFleetCommandError - */ -const de_ModifyInstanceFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifyInstanceGroupsCommand */ @@ -2842,7 +1796,7 @@ export const de_ModifyInstanceGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyInstanceGroupsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ModifyInstanceGroupsCommandOutput = { @@ -2851,32 +1805,6 @@ export const de_ModifyInstanceGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyInstanceGroupsCommandError - */ -const de_ModifyInstanceGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutAutoScalingPolicyCommand */ @@ -2885,7 +1813,7 @@ export const de_PutAutoScalingPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutAutoScalingPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2897,26 +1825,6 @@ export const de_PutAutoScalingPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutAutoScalingPolicyCommandError - */ -const de_PutAutoScalingPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1PutAutoTerminationPolicyCommand */ @@ -2925,7 +1833,7 @@ export const de_PutAutoTerminationPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutAutoTerminationPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2937,26 +1845,6 @@ export const de_PutAutoTerminationPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutAutoTerminationPolicyCommandError - */ -const de_PutAutoTerminationPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1PutBlockPublicAccessConfigurationCommand */ @@ -2965,7 +1853,7 @@ export const de_PutBlockPublicAccessConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutBlockPublicAccessConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2977,35 +1865,6 @@ export const de_PutBlockPublicAccessConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutBlockPublicAccessConfigurationCommandError - */ -const de_PutBlockPublicAccessConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutManagedScalingPolicyCommand */ @@ -3014,7 +1873,7 @@ export const de_PutManagedScalingPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutManagedScalingPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3026,26 +1885,6 @@ export const de_PutManagedScalingPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutManagedScalingPolicyCommandError - */ -const de_PutManagedScalingPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1RemoveAutoScalingPolicyCommand */ @@ -3054,7 +1893,7 @@ export const de_RemoveAutoScalingPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveAutoScalingPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3063,83 +1902,23 @@ export const de_RemoveAutoScalingPolicyCommand = async ( $metadata: deserializeMetadata(output), ...contents, }; - return response; -}; - -/** - * deserializeAws_json1_1RemoveAutoScalingPolicyCommandError - */ -const de_RemoveAutoScalingPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1RemoveAutoTerminationPolicyCommand - */ -export const de_RemoveAutoTerminationPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveAutoTerminationPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: RemoveAutoTerminationPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RemoveAutoTerminationPolicyCommandError - */ -const de_RemoveAutoTerminationPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; }; /** - * deserializeAws_json1_1RemoveManagedScalingPolicyCommand + * deserializeAws_json1_1RemoveAutoTerminationPolicyCommand */ -export const de_RemoveManagedScalingPolicyCommand = async ( +export const de_RemoveAutoTerminationPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RemoveManagedScalingPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: RemoveManagedScalingPolicyCommandOutput = { + const response: RemoveAutoTerminationPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3147,23 +1926,23 @@ export const de_RemoveManagedScalingPolicyCommand = async ( }; /** - * deserializeAws_json1_1RemoveManagedScalingPolicyCommandError + * deserializeAws_json1_1RemoveManagedScalingPolicyCommand */ -const de_RemoveManagedScalingPolicyCommandError = async ( +export const de_RemoveManagedScalingPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: RemoveManagedScalingPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; }; /** @@ -3174,7 +1953,7 @@ export const de_RemoveTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3186,35 +1965,6 @@ export const de_RemoveTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1RemoveTagsCommandError - */ -const de_RemoveTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RunJobFlowCommand */ @@ -3223,7 +1973,7 @@ export const de_RunJobFlowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RunJobFlowCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3235,32 +1985,6 @@ export const de_RunJobFlowCommand = async ( return response; }; -/** - * deserializeAws_json1_1RunJobFlowCommandError - */ -const de_RunJobFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SetKeepJobFlowAliveWhenNoStepsCommand */ @@ -3269,7 +1993,7 @@ export const de_SetKeepJobFlowAliveWhenNoStepsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetKeepJobFlowAliveWhenNoStepsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SetKeepJobFlowAliveWhenNoStepsCommandOutput = { @@ -3278,32 +2002,6 @@ export const de_SetKeepJobFlowAliveWhenNoStepsCommand = async ( return response; }; -/** - * deserializeAws_json1_1SetKeepJobFlowAliveWhenNoStepsCommandError - */ -const de_SetKeepJobFlowAliveWhenNoStepsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SetTerminationProtectionCommand */ @@ -3312,7 +2010,7 @@ export const de_SetTerminationProtectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetTerminationProtectionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SetTerminationProtectionCommandOutput = { @@ -3321,32 +2019,6 @@ export const de_SetTerminationProtectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1SetTerminationProtectionCommandError - */ -const de_SetTerminationProtectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SetVisibleToAllUsersCommand */ @@ -3355,7 +2027,7 @@ export const de_SetVisibleToAllUsersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetVisibleToAllUsersCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SetVisibleToAllUsersCommandOutput = { @@ -3364,32 +2036,6 @@ export const de_SetVisibleToAllUsersCommand = async ( return response; }; -/** - * deserializeAws_json1_1SetVisibleToAllUsersCommandError - */ -const de_SetVisibleToAllUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartNotebookExecutionCommand */ @@ -3398,7 +2044,7 @@ export const de_StartNotebookExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartNotebookExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3410,35 +2056,6 @@ export const de_StartNotebookExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartNotebookExecutionCommandError - */ -const de_StartNotebookExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopNotebookExecutionCommand */ @@ -3447,7 +2064,7 @@ export const de_StopNotebookExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopNotebookExecutionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopNotebookExecutionCommandOutput = { @@ -3456,35 +2073,6 @@ export const de_StopNotebookExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopNotebookExecutionCommandError - */ -const de_StopNotebookExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TerminateJobFlowsCommand */ @@ -3493,7 +2081,7 @@ export const de_TerminateJobFlowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TerminateJobFlowsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: TerminateJobFlowsCommandOutput = { @@ -3502,32 +2090,6 @@ export const de_TerminateJobFlowsCommand = async ( return response; }; -/** - * deserializeAws_json1_1TerminateJobFlowsCommandError - */ -const de_TerminateJobFlowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateStudioCommand */ @@ -3536,7 +2098,7 @@ export const de_UpdateStudioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateStudioCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateStudioCommandOutput = { @@ -3545,35 +2107,6 @@ export const de_UpdateStudioCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateStudioCommandError - */ -const de_UpdateStudioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.emr#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.emr#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateStudioSessionMappingCommand */ @@ -3582,7 +2115,7 @@ export const de_UpdateStudioSessionMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateStudioSessionMappingCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateStudioSessionMappingCommandOutput = { @@ -3592,31 +2125,31 @@ export const de_UpdateStudioSessionMappingCommand = async ( }; /** - * deserializeAws_json1_1UpdateStudioSessionMappingCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateStudioSessionMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.emr#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.emr#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); case "InvalidRequestException": case "com.amazonaws.emr#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "InternalServerError": + case "com.amazonaws.emr#InternalServerError": + throw await de_InternalServerErrorRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-entityresolution/src/protocols/Aws_restJson1.ts b/clients/client-entityresolution/src/protocols/Aws_restJson1.ts index fe1db67a8148..fbdf9a792211 100644 --- a/clients/client-entityresolution/src/protocols/Aws_restJson1.ts +++ b/clients/client-entityresolution/src/protocols/Aws_restJson1.ts @@ -675,7 +675,7 @@ export const de_CreateIdMappingWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateIdMappingWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -694,47 +694,6 @@ export const de_CreateIdMappingWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateIdMappingWorkflowCommandError - */ -const de_CreateIdMappingWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.entityresolution#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ExceedsLimitException": - case "com.amazonaws.entityresolution#ExceedsLimitException": - throw await de_ExceedsLimitExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMatchingWorkflowCommand */ @@ -743,7 +702,7 @@ export const de_CreateMatchingWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMatchingWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -763,47 +722,6 @@ export const de_CreateMatchingWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMatchingWorkflowCommandError - */ -const de_CreateMatchingWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.entityresolution#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ExceedsLimitException": - case "com.amazonaws.entityresolution#ExceedsLimitException": - throw await de_ExceedsLimitExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSchemaMappingCommand */ @@ -812,7 +730,7 @@ export const de_CreateSchemaMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSchemaMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -828,47 +746,6 @@ export const de_CreateSchemaMappingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSchemaMappingCommandError - */ -const de_CreateSchemaMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.entityresolution#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ExceedsLimitException": - case "com.amazonaws.entityresolution#ExceedsLimitException": - throw await de_ExceedsLimitExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteIdMappingWorkflowCommand */ @@ -877,7 +754,7 @@ export const de_DeleteIdMappingWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteIdMappingWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -890,41 +767,6 @@ export const de_DeleteIdMappingWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteIdMappingWorkflowCommandError - */ -const de_DeleteIdMappingWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteMatchingWorkflowCommand */ @@ -933,7 +775,7 @@ export const de_DeleteMatchingWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMatchingWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -946,41 +788,6 @@ export const de_DeleteMatchingWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteMatchingWorkflowCommandError - */ -const de_DeleteMatchingWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSchemaMappingCommand */ @@ -989,7 +796,7 @@ export const de_DeleteSchemaMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSchemaMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1002,44 +809,6 @@ export const de_DeleteSchemaMappingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSchemaMappingCommandError - */ -const de_DeleteSchemaMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.entityresolution#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIdMappingJobCommand */ @@ -1048,7 +817,7 @@ export const de_GetIdMappingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIdMappingJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1066,44 +835,6 @@ export const de_GetIdMappingJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetIdMappingJobCommandError - */ -const de_GetIdMappingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIdMappingWorkflowCommand */ @@ -1112,7 +843,7 @@ export const de_GetIdMappingWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIdMappingWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1135,52 +866,14 @@ export const de_GetIdMappingWorkflowCommand = async ( }; /** - * deserializeAws_restJson1GetIdMappingWorkflowCommandError + * deserializeAws_restJson1GetMatchIdCommand */ -const de_GetIdMappingWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMatchIdCommand - */ -export const de_GetMatchIdCommand = async ( +export const de_GetMatchIdCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMatchIdCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1193,44 +886,6 @@ export const de_GetMatchIdCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMatchIdCommandError - */ -const de_GetMatchIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMatchingJobCommand */ @@ -1239,7 +894,7 @@ export const de_GetMatchingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMatchingJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1257,44 +912,6 @@ export const de_GetMatchingJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMatchingJobCommandError - */ -const de_GetMatchingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMatchingWorkflowCommand */ @@ -1303,7 +920,7 @@ export const de_GetMatchingWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMatchingWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1326,44 +943,6 @@ export const de_GetMatchingWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMatchingWorkflowCommandError - */ -const de_GetMatchingWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetProviderServiceCommand */ @@ -1372,7 +951,7 @@ export const de_GetProviderServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProviderServiceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1394,44 +973,6 @@ export const de_GetProviderServiceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetProviderServiceCommandError - */ -const de_GetProviderServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSchemaMappingCommand */ @@ -1440,7 +981,7 @@ export const de_GetSchemaMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSchemaMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1460,44 +1001,6 @@ export const de_GetSchemaMappingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSchemaMappingCommandError - */ -const de_GetSchemaMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIdMappingJobsCommand */ @@ -1506,7 +1009,7 @@ export const de_ListIdMappingJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIdMappingJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1520,44 +1023,6 @@ export const de_ListIdMappingJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListIdMappingJobsCommandError - */ -const de_ListIdMappingJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIdMappingWorkflowsCommand */ @@ -1566,7 +1031,7 @@ export const de_ListIdMappingWorkflowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIdMappingWorkflowsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1580,41 +1045,6 @@ export const de_ListIdMappingWorkflowsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListIdMappingWorkflowsCommandError - */ -const de_ListIdMappingWorkflowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListMatchingJobsCommand */ @@ -1623,7 +1053,7 @@ export const de_ListMatchingJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMatchingJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1637,44 +1067,6 @@ export const de_ListMatchingJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListMatchingJobsCommandError - */ -const de_ListMatchingJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListMatchingWorkflowsCommand */ @@ -1683,7 +1075,7 @@ export const de_ListMatchingWorkflowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMatchingWorkflowsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1697,41 +1089,6 @@ export const de_ListMatchingWorkflowsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListMatchingWorkflowsCommandError - */ -const de_ListMatchingWorkflowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProviderServicesCommand */ @@ -1740,7 +1097,7 @@ export const de_ListProviderServicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProviderServicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1754,41 +1111,6 @@ export const de_ListProviderServicesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListProviderServicesCommandError - */ -const de_ListProviderServicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSchemaMappingsCommand */ @@ -1797,53 +1119,18 @@ export const de_ListSchemaMappingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSchemaMappingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - schemaList: (_) => de_SchemaMappingList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSchemaMappingsCommandError - */ -const de_ListSchemaMappingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + schemaList: (_) => de_SchemaMappingList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1854,7 +1141,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1867,38 +1154,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartIdMappingJobCommand */ @@ -1907,7 +1162,7 @@ export const de_StartIdMappingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartIdMappingJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1920,50 +1175,6 @@ export const de_StartIdMappingJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartIdMappingJobCommandError - */ -const de_StartIdMappingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.entityresolution#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ExceedsLimitException": - case "com.amazonaws.entityresolution#ExceedsLimitException": - throw await de_ExceedsLimitExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartMatchingJobCommand */ @@ -1972,7 +1183,7 @@ export const de_StartMatchingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartMatchingJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1985,50 +1196,6 @@ export const de_StartMatchingJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartMatchingJobCommandError - */ -const de_StartMatchingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.entityresolution#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ExceedsLimitException": - case "com.amazonaws.entityresolution#ExceedsLimitException": - throw await de_ExceedsLimitExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2037,7 +1204,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2046,38 +1213,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2086,7 +1221,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2095,35 +1230,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateIdMappingWorkflowCommand */ @@ -2132,7 +1238,7 @@ export const de_UpdateIdMappingWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIdMappingWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2151,44 +1257,6 @@ export const de_UpdateIdMappingWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateIdMappingWorkflowCommandError - */ -const de_UpdateIdMappingWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMatchingWorkflowCommand */ @@ -2197,7 +1265,7 @@ export const de_UpdateMatchingWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMatchingWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2216,44 +1284,6 @@ export const de_UpdateMatchingWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateMatchingWorkflowCommandError - */ -const de_UpdateMatchingWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.entityresolution#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.entityresolution#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.entityresolution#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.entityresolution#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSchemaMappingCommand */ @@ -2262,7 +1292,7 @@ export const de_UpdateSchemaMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSchemaMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2279,12 +1309,9 @@ export const de_UpdateSchemaMappingCommand = async ( }; /** - * deserializeAws_restJson1UpdateSchemaMappingCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateSchemaMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2297,25 +1324,28 @@ const de_UpdateSchemaMappingCommandError = async ( case "ConflictException": case "com.amazonaws.entityresolution#ConflictException": throw await de_ConflictExceptionRes(parsedOutput, context); + case "ExceedsLimitException": + case "com.amazonaws.entityresolution#ExceedsLimitException": + throw await de_ExceedsLimitExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.entityresolution#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.entityresolution#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.entityresolution#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.entityresolution#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.entityresolution#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-eventbridge/src/protocols/Aws_json1_1.ts b/clients/client-eventbridge/src/protocols/Aws_json1_1.ts index f95351a5fb9b..ff2887c11038 100644 --- a/clients/client-eventbridge/src/protocols/Aws_json1_1.ts +++ b/clients/client-eventbridge/src/protocols/Aws_json1_1.ts @@ -1007,7 +1007,7 @@ export const de_ActivateEventSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ActivateEventSourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ActivateEventSourceCommandOutput = { @@ -1016,44 +1016,6 @@ export const de_ActivateEventSourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ActivateEventSourceCommandError - */ -const de_ActivateEventSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.eventbridge#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.eventbridge#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelReplayCommand */ @@ -1062,7 +1024,7 @@ export const de_CancelReplayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelReplayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1074,41 +1036,6 @@ export const de_CancelReplayCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelReplayCommandError - */ -const de_CancelReplayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "IllegalStatusException": - case "com.amazonaws.eventbridge#IllegalStatusException": - throw await de_IllegalStatusExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateApiDestinationCommand */ @@ -1117,7 +1044,7 @@ export const de_CreateApiDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateApiDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1129,41 +1056,6 @@ export const de_CreateApiDestinationCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateApiDestinationCommandError - */ -const de_CreateApiDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.eventbridge#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.eventbridge#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateArchiveCommand */ @@ -1172,7 +1064,7 @@ export const de_CreateArchiveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateArchiveCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1184,47 +1076,6 @@ export const de_CreateArchiveCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateArchiveCommandError - */ -const de_CreateArchiveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidEventPatternException": - case "com.amazonaws.eventbridge#InvalidEventPatternException": - throw await de_InvalidEventPatternExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.eventbridge#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.eventbridge#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateConnectionCommand */ @@ -1233,7 +1084,7 @@ export const de_CreateConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1245,38 +1096,6 @@ export const de_CreateConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateConnectionCommandError - */ -const de_CreateConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.eventbridge#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.eventbridge#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateEndpointCommand */ @@ -1285,7 +1104,7 @@ export const de_CreateEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1297,38 +1116,6 @@ export const de_CreateEndpointCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateEndpointCommandError - */ -const de_CreateEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.eventbridge#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.eventbridge#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateEventBusCommand */ @@ -1337,7 +1124,7 @@ export const de_CreateEventBusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEventBusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1349,50 +1136,6 @@ export const de_CreateEventBusCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateEventBusCommandError - */ -const de_CreateEventBusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.eventbridge#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.eventbridge#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.eventbridge#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.eventbridge#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePartnerEventSourceCommand */ @@ -1401,7 +1144,7 @@ export const de_CreatePartnerEventSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePartnerEventSourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1413,44 +1156,6 @@ export const de_CreatePartnerEventSourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePartnerEventSourceCommandError - */ -const de_CreatePartnerEventSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.eventbridge#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.eventbridge#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.eventbridge#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeactivateEventSourceCommand */ @@ -1459,7 +1164,7 @@ export const de_DeactivateEventSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeactivateEventSourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeactivateEventSourceCommandOutput = { @@ -1468,44 +1173,6 @@ export const de_DeactivateEventSourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeactivateEventSourceCommandError - */ -const de_DeactivateEventSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.eventbridge#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.eventbridge#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeauthorizeConnectionCommand */ @@ -1514,7 +1181,7 @@ export const de_DeauthorizeConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeauthorizeConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1526,38 +1193,6 @@ export const de_DeauthorizeConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeauthorizeConnectionCommandError - */ -const de_DeauthorizeConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApiDestinationCommand */ @@ -1566,7 +1201,7 @@ export const de_DeleteApiDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApiDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1575,159 +1210,23 @@ export const de_DeleteApiDestinationCommand = async ( $metadata: deserializeMetadata(output), ...contents, }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteApiDestinationCommandError - */ -const de_DeleteApiDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteArchiveCommand - */ -export const de_DeleteArchiveCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteArchiveCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteArchiveCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteArchiveCommandError - */ -const de_DeleteArchiveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteConnectionCommand - */ -export const de_DeleteConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteConnectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteConnectionResponse(data, context); - const response: DeleteConnectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteConnectionCommandError - */ -const de_DeleteConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1DeleteEndpointCommand + * deserializeAws_json1_1DeleteArchiveCommand */ -export const de_DeleteEndpointCommand = async ( +export const de_DeleteArchiveCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteEndpointCommandOutput = { + const response: DeleteArchiveCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1735,81 +1234,60 @@ export const de_DeleteEndpointCommand = async ( }; /** - * deserializeAws_json1_1DeleteEndpointCommandError + * deserializeAws_json1_1DeleteConnectionCommand */ -const de_DeleteEndpointCommandError = async ( +export const de_DeleteConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteConnectionResponse(data, context); + const response: DeleteConnectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteEventBusCommand + * deserializeAws_json1_1DeleteEndpointCommand */ -export const de_DeleteEventBusCommand = async ( +export const de_DeleteEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteEventBusCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteEventBusCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteEndpointCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1DeleteEventBusCommandError + * deserializeAws_json1_1DeleteEventBusCommand */ -const de_DeleteEventBusCommandError = async ( +export const de_DeleteEventBusCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteEventBusCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** @@ -1820,7 +1298,7 @@ export const de_DeletePartnerEventSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePartnerEventSourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeletePartnerEventSourceCommandOutput = { @@ -1829,38 +1307,6 @@ export const de_DeletePartnerEventSourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeletePartnerEventSourceCommandError - */ -const de_DeletePartnerEventSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.eventbridge#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteRuleCommand */ @@ -1869,7 +1315,7 @@ export const de_DeleteRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRuleCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteRuleCommandOutput = { @@ -1878,41 +1324,6 @@ export const de_DeleteRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteRuleCommandError - */ -const de_DeleteRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.eventbridge#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeApiDestinationCommand */ @@ -1921,7 +1332,7 @@ export const de_DescribeApiDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeApiDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1933,35 +1344,6 @@ export const de_DescribeApiDestinationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeApiDestinationCommandError - */ -const de_DescribeApiDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeArchiveCommand */ @@ -1970,7 +1352,7 @@ export const de_DescribeArchiveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeArchiveCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1982,38 +1364,6 @@ export const de_DescribeArchiveCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeArchiveCommandError - */ -const de_DescribeArchiveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.eventbridge#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeConnectionCommand */ @@ -2022,7 +1372,7 @@ export const de_DescribeConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2034,35 +1384,6 @@ export const de_DescribeConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeConnectionCommandError - */ -const de_DescribeConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEndpointCommand */ @@ -2071,45 +1392,16 @@ export const de_DescribeEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEndpointResponse(data, context); - const response: DescribeEndpointCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeEndpointCommandError - */ -const de_DescribeEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + contents = de_DescribeEndpointResponse(data, context); + const response: DescribeEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2120,7 +1412,7 @@ export const de_DescribeEventBusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventBusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2132,35 +1424,6 @@ export const de_DescribeEventBusCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEventBusCommandError - */ -const de_DescribeEventBusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEventSourceCommand */ @@ -2169,7 +1432,7 @@ export const de_DescribeEventSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventSourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2181,38 +1444,6 @@ export const de_DescribeEventSourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEventSourceCommandError - */ -const de_DescribeEventSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.eventbridge#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribePartnerEventSourceCommand */ @@ -2221,7 +1452,7 @@ export const de_DescribePartnerEventSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePartnerEventSourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2233,38 +1464,6 @@ export const de_DescribePartnerEventSourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribePartnerEventSourceCommandError - */ -const de_DescribePartnerEventSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.eventbridge#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeReplayCommand */ @@ -2273,7 +1472,7 @@ export const de_DescribeReplayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeReplayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2285,35 +1484,6 @@ export const de_DescribeReplayCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeReplayCommandError - */ -const de_DescribeReplayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeRuleCommand */ @@ -2322,7 +1492,7 @@ export const de_DescribeRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2334,35 +1504,6 @@ export const de_DescribeRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeRuleCommandError - */ -const de_DescribeRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisableRuleCommand */ @@ -2371,7 +1512,7 @@ export const de_DisableRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableRuleCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DisableRuleCommandOutput = { @@ -2380,41 +1521,6 @@ export const de_DisableRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisableRuleCommandError - */ -const de_DisableRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.eventbridge#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1EnableRuleCommand */ @@ -2423,7 +1529,7 @@ export const de_EnableRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableRuleCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: EnableRuleCommandOutput = { @@ -2432,41 +1538,6 @@ export const de_EnableRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1EnableRuleCommandError - */ -const de_EnableRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.eventbridge#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListApiDestinationsCommand */ @@ -2475,7 +1546,7 @@ export const de_ListApiDestinationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListApiDestinationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2487,32 +1558,6 @@ export const de_ListApiDestinationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListApiDestinationsCommandError - */ -const de_ListApiDestinationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListArchivesCommand */ @@ -2521,7 +1566,7 @@ export const de_ListArchivesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListArchivesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2530,36 +1575,7 @@ export const de_ListArchivesCommand = async ( $metadata: deserializeMetadata(output), ...contents, }; - return response; -}; - -/** - * deserializeAws_json1_1ListArchivesCommandError - */ -const de_ListArchivesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** @@ -2570,7 +1586,7 @@ export const de_ListConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2582,32 +1598,6 @@ export const de_ListConnectionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListConnectionsCommandError - */ -const de_ListConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListEndpointsCommand */ @@ -2616,7 +1606,7 @@ export const de_ListEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2628,32 +1618,6 @@ export const de_ListEndpointsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListEndpointsCommandError - */ -const de_ListEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListEventBusesCommand */ @@ -2662,7 +1626,7 @@ export const de_ListEventBusesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListEventBusesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2674,32 +1638,6 @@ export const de_ListEventBusesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListEventBusesCommandError - */ -const de_ListEventBusesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListEventSourcesCommand */ @@ -2708,7 +1646,7 @@ export const de_ListEventSourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListEventSourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2720,35 +1658,6 @@ export const de_ListEventSourcesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListEventSourcesCommandError - */ -const de_ListEventSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.eventbridge#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPartnerEventSourceAccountsCommand */ @@ -2757,7 +1666,7 @@ export const de_ListPartnerEventSourceAccountsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPartnerEventSourceAccountsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2769,38 +1678,6 @@ export const de_ListPartnerEventSourceAccountsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPartnerEventSourceAccountsCommandError - */ -const de_ListPartnerEventSourceAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.eventbridge#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPartnerEventSourcesCommand */ @@ -2809,7 +1686,7 @@ export const de_ListPartnerEventSourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPartnerEventSourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2821,35 +1698,6 @@ export const de_ListPartnerEventSourcesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPartnerEventSourcesCommandError - */ -const de_ListPartnerEventSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.eventbridge#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListReplaysCommand */ @@ -2858,7 +1706,7 @@ export const de_ListReplaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListReplaysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2870,32 +1718,6 @@ export const de_ListReplaysCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListReplaysCommandError - */ -const de_ListReplaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListRuleNamesByTargetCommand */ @@ -2904,7 +1726,7 @@ export const de_ListRuleNamesByTargetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRuleNamesByTargetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2916,35 +1738,6 @@ export const de_ListRuleNamesByTargetCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListRuleNamesByTargetCommandError - */ -const de_ListRuleNamesByTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListRulesCommand */ @@ -2953,7 +1746,7 @@ export const de_ListRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2965,35 +1758,6 @@ export const de_ListRulesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListRulesCommandError - */ -const de_ListRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -3002,45 +1766,16 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3051,7 +1786,7 @@ export const de_ListTargetsByRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTargetsByRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3063,35 +1798,6 @@ export const de_ListTargetsByRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTargetsByRuleCommandError - */ -const de_ListTargetsByRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutEventsCommand */ @@ -3100,7 +1806,7 @@ export const de_PutEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3112,32 +1818,6 @@ export const de_PutEventsCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutEventsCommandError - */ -const de_PutEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutPartnerEventsCommand */ @@ -3146,7 +1826,7 @@ export const de_PutPartnerEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutPartnerEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3158,35 +1838,6 @@ export const de_PutPartnerEventsCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutPartnerEventsCommandError - */ -const de_PutPartnerEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.eventbridge#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutPermissionCommand */ @@ -3195,7 +1846,7 @@ export const de_PutPermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutPermissionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutPermissionCommandOutput = { @@ -3204,44 +1855,6 @@ export const de_PutPermissionCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutPermissionCommandError - */ -const de_PutPermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.eventbridge#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "PolicyLengthExceededException": - case "com.amazonaws.eventbridge#PolicyLengthExceededException": - throw await de_PolicyLengthExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutRuleCommand */ @@ -3250,7 +1863,7 @@ export const de_PutRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3262,47 +1875,6 @@ export const de_PutRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutRuleCommandError - */ -const de_PutRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidEventPatternException": - case "com.amazonaws.eventbridge#InvalidEventPatternException": - throw await de_InvalidEventPatternExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.eventbridge#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.eventbridge#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutTargetsCommand */ @@ -3311,7 +1883,7 @@ export const de_PutTargetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutTargetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3323,44 +1895,6 @@ export const de_PutTargetsCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutTargetsCommandError - */ -const de_PutTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.eventbridge#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.eventbridge#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RemovePermissionCommand */ @@ -3369,7 +1903,7 @@ export const de_RemovePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemovePermissionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RemovePermissionCommandOutput = { @@ -3378,41 +1912,6 @@ export const de_RemovePermissionCommand = async ( return response; }; -/** - * deserializeAws_json1_1RemovePermissionCommandError - */ -const de_RemovePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "OperationDisabledException": - case "com.amazonaws.eventbridge#OperationDisabledException": - throw await de_OperationDisabledExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RemoveTargetsCommand */ @@ -3421,51 +1920,16 @@ export const de_RemoveTargetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveTargetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: RemoveTargetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RemoveTargetsCommandError - */ -const de_RemoveTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.eventbridge#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const response: RemoveTargetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3476,7 +1940,7 @@ export const de_StartReplayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartReplayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3488,44 +1952,6 @@ export const de_StartReplayCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartReplayCommandError - */ -const de_StartReplayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidEventPatternException": - case "com.amazonaws.eventbridge#InvalidEventPatternException": - throw await de_InvalidEventPatternExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.eventbridge#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.eventbridge#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -3534,7 +1960,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3546,41 +1972,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.eventbridge#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TestEventPatternCommand */ @@ -3589,7 +1980,7 @@ export const de_TestEventPatternCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TestEventPatternCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3601,35 +1992,6 @@ export const de_TestEventPatternCommand = async ( return response; }; -/** - * deserializeAws_json1_1TestEventPatternCommandError - */ -const de_TestEventPatternCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidEventPatternException": - case "com.amazonaws.eventbridge#InvalidEventPatternException": - throw await de_InvalidEventPatternExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -3638,7 +2000,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3650,41 +2012,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ManagedRuleException": - case "com.amazonaws.eventbridge#ManagedRuleException": - throw await de_ManagedRuleExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateApiDestinationCommand */ @@ -3693,7 +2020,7 @@ export const de_UpdateApiDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateApiDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3705,41 +2032,6 @@ export const de_UpdateApiDestinationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateApiDestinationCommandError - */ -const de_UpdateApiDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.eventbridge#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateArchiveCommand */ @@ -3748,7 +2040,7 @@ export const de_UpdateArchiveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateArchiveCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3760,44 +2052,6 @@ export const de_UpdateArchiveCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateArchiveCommandError - */ -const de_UpdateArchiveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidEventPatternException": - case "com.amazonaws.eventbridge#InvalidEventPatternException": - throw await de_InvalidEventPatternExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.eventbridge#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateConnectionCommand */ @@ -3806,7 +2060,7 @@ export const de_UpdateConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3818,41 +2072,6 @@ export const de_UpdateConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateConnectionCommandError - */ -const de_UpdateConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.eventbridge#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.eventbridge#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.eventbridge#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.eventbridge#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateEndpointCommand */ @@ -3861,7 +2080,7 @@ export const de_UpdateEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3874,12 +2093,9 @@ export const de_UpdateEndpointCommand = async ( }; /** - * deserializeAws_json1_1UpdateEndpointCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3892,16 +2108,40 @@ const de_UpdateEndpointCommandError = async ( case "InternalException": case "com.amazonaws.eventbridge#InternalException": throw await de_InternalExceptionRes(parsedOutput, context); + case "InvalidStateException": + case "com.amazonaws.eventbridge#InvalidStateException": + throw await de_InvalidStateExceptionRes(parsedOutput, context); + case "OperationDisabledException": + case "com.amazonaws.eventbridge#OperationDisabledException": + throw await de_OperationDisabledExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.eventbridge#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "IllegalStatusException": + case "com.amazonaws.eventbridge#IllegalStatusException": + throw await de_IllegalStatusExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.eventbridge#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.eventbridge#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidEventPatternException": + case "com.amazonaws.eventbridge#InvalidEventPatternException": + throw await de_InvalidEventPatternExceptionRes(parsedOutput, context); + case "ManagedRuleException": + case "com.amazonaws.eventbridge#ManagedRuleException": + throw await de_ManagedRuleExceptionRes(parsedOutput, context); + case "PolicyLengthExceededException": + case "com.amazonaws.eventbridge#PolicyLengthExceededException": + throw await de_PolicyLengthExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-evidently/src/protocols/Aws_restJson1.ts b/clients/client-evidently/src/protocols/Aws_restJson1.ts index 1fe84b28df90..cf7f24101fda 100644 --- a/clients/client-evidently/src/protocols/Aws_restJson1.ts +++ b/clients/client-evidently/src/protocols/Aws_restJson1.ts @@ -1008,7 +1008,7 @@ export const de_BatchEvaluateFeatureCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchEvaluateFeatureCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1021,41 +1021,6 @@ export const de_BatchEvaluateFeatureCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchEvaluateFeatureCommandError - */ -const de_BatchEvaluateFeatureCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateExperimentCommand */ @@ -1064,7 +1029,7 @@ export const de_CreateExperimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateExperimentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1077,44 +1042,6 @@ export const de_CreateExperimentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateExperimentCommandError - */ -const de_CreateExperimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.evidently#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFeatureCommand */ @@ -1123,7 +1050,7 @@ export const de_CreateFeatureCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFeatureCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1136,44 +1063,6 @@ export const de_CreateFeatureCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFeatureCommandError - */ -const de_CreateFeatureCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.evidently#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLaunchCommand */ @@ -1182,7 +1071,7 @@ export const de_CreateLaunchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLaunchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1195,44 +1084,6 @@ export const de_CreateLaunchCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLaunchCommandError - */ -const de_CreateLaunchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.evidently#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProjectCommand */ @@ -1241,7 +1092,7 @@ export const de_CreateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1254,41 +1105,6 @@ export const de_CreateProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProjectCommandError - */ -const de_CreateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.evidently#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSegmentCommand */ @@ -1297,7 +1113,7 @@ export const de_CreateSegmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSegmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1311,49 +1127,31 @@ export const de_CreateSegmentCommand = async ( }; /** - * deserializeAws_restJson1CreateSegmentCommandError + * deserializeAws_restJson1DeleteExperimentCommand */ -const de_CreateSegmentCommandError = async ( +export const de_DeleteExperimentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.evidently#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteExperimentCommand + * deserializeAws_restJson1DeleteFeatureCommand */ -export const de_DeleteExperimentCommand = async ( +export const de_DeleteFeatureCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteExperimentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1363,55 +1161,31 @@ export const de_DeleteExperimentCommand = async ( }; /** - * deserializeAws_restJson1DeleteExperimentCommandError + * deserializeAws_restJson1DeleteLaunchCommand */ -const de_DeleteExperimentCommandError = async ( +export const de_DeleteLaunchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.evidently#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.evidently#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteFeatureCommand + * deserializeAws_restJson1DeleteProjectCommand */ -export const de_DeleteFeatureCommand = async ( +export const de_DeleteProjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFeatureCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1421,1338 +1195,449 @@ export const de_DeleteFeatureCommand = async ( }; /** - * deserializeAws_restJson1DeleteFeatureCommandError - */ -const de_DeleteFeatureCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteLaunchCommand - */ -export const de_DeleteLaunchCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLaunchCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteLaunchCommandError - */ -const de_DeleteLaunchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteProjectCommand - */ -export const de_DeleteProjectCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProjectCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteProjectCommandError - */ -const de_DeleteProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSegmentCommand + * deserializeAws_restJson1DeleteSegmentCommand */ export const de_DeleteSegmentCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSegmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSegmentCommandError - */ -const de_DeleteSegmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1EvaluateFeatureCommand - */ -export const de_EvaluateFeatureCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EvaluateFeatureCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - details: (_) => new __LazyJsonString(_), - reason: __expectString, - value: (_) => de_VariableValue(__expectUnion(_), context), - variation: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1EvaluateFeatureCommandError - */ -const de_EvaluateFeatureCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetExperimentCommand - */ -export const de_GetExperimentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetExperimentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - experiment: (_) => de_Experiment(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetExperimentCommandError - */ -const de_GetExperimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetExperimentResultsCommand - */ -export const de_GetExperimentResultsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetExperimentResultsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - details: __expectString, - reports: (_) => de_ExperimentReportList(_, context), - resultsData: (_) => de_ExperimentResultsDataList(_, context), - timestamps: (_) => de_TimestampList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetExperimentResultsCommandError - */ -const de_GetExperimentResultsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFeatureCommand - */ -export const de_GetFeatureCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFeatureCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - feature: (_) => de_Feature(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFeatureCommandError - */ -const de_GetFeatureCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetLaunchCommand - */ -export const de_GetLaunchCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLaunchCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - launch: (_) => de_Launch(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetLaunchCommandError - */ -const de_GetLaunchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetProjectCommand - */ -export const de_GetProjectCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProjectCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - project: (_) => de_Project(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetProjectCommandError - */ -const de_GetProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSegmentCommand - */ -export const de_GetSegmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSegmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - segment: (_) => de_Segment(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSegmentCommandError - */ -const de_GetSegmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListExperimentsCommand - */ -export const de_ListExperimentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListExperimentsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - experiments: (_) => de_ExperimentList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListExperimentsCommandError - */ -const de_ListExperimentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListFeaturesCommand + * deserializeAws_restJson1EvaluateFeatureCommand */ -export const de_ListFeaturesCommand = async ( +export const de_EvaluateFeatureCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFeaturesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - features: (_) => de_FeatureSummariesList(_, context), - nextToken: __expectString, + details: (_) => new __LazyJsonString(_), + reason: __expectString, + value: (_) => de_VariableValue(__expectUnion(_), context), + variation: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListFeaturesCommandError - */ -const de_ListFeaturesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListLaunchesCommand + * deserializeAws_restJson1GetExperimentCommand */ -export const de_ListLaunchesCommand = async ( +export const de_GetExperimentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLaunchesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - launches: (_) => de_LaunchesList(_, context), - nextToken: __expectString, + experiment: (_) => de_Experiment(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListLaunchesCommandError - */ -const de_ListLaunchesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListProjectsCommand + * deserializeAws_restJson1GetExperimentResultsCommand */ -export const de_ListProjectsCommand = async ( +export const de_GetExperimentResultsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProjectsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - projects: (_) => de_ProjectSummariesList(_, context), + details: __expectString, + reports: (_) => de_ExperimentReportList(_, context), + resultsData: (_) => de_ExperimentResultsDataList(_, context), + timestamps: (_) => de_TimestampList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListProjectsCommandError - */ -const de_ListProjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSegmentReferencesCommand + * deserializeAws_restJson1GetFeatureCommand */ -export const de_ListSegmentReferencesCommand = async ( +export const de_GetFeatureCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSegmentReferencesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - referencedBy: _json, + feature: (_) => de_Feature(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSegmentReferencesCommandError - */ -const de_ListSegmentReferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSegmentsCommand + * deserializeAws_restJson1GetLaunchCommand */ -export const de_ListSegmentsCommand = async ( +export const de_GetLaunchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSegmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - segments: (_) => de_SegmentList(_, context), + launch: (_) => de_Launch(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSegmentsCommandError + * deserializeAws_restJson1GetProjectCommand */ -const de_ListSegmentsCommandError = async ( +export const de_GetProjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + project: (_) => de_Project(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1GetSegmentCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_GetSegmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + segment: (_) => de_Segment(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListExperimentsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListExperimentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + experiments: (_) => de_ExperimentList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutProjectEventsCommand + * deserializeAws_restJson1ListFeaturesCommand */ -export const de_PutProjectEventsCommand = async ( +export const de_ListFeaturesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutProjectEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - eventResults: _json, - failedEventCount: __expectInt32, + features: (_) => de_FeatureSummariesList(_, context), + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutProjectEventsCommandError + * deserializeAws_restJson1ListLaunchesCommand */ -const de_PutProjectEventsCommandError = async ( +export const de_ListLaunchesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + launches: (_) => de_LaunchesList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartExperimentCommand + * deserializeAws_restJson1ListProjectsCommand */ -export const de_StartExperimentCommand = async ( +export const de_ListProjectsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartExperimentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - startedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + nextToken: __expectString, + projects: (_) => de_ProjectSummariesList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartExperimentCommandError + * deserializeAws_restJson1ListSegmentReferencesCommand */ -const de_StartExperimentCommandError = async ( +export const de_ListSegmentReferencesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.evidently#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + referencedBy: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartLaunchCommand + * deserializeAws_restJson1ListSegmentsCommand */ -export const de_StartLaunchCommand = async ( +export const de_ListSegmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartLaunchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - launch: (_) => de_Launch(_, context), + nextToken: __expectString, + segments: (_) => de_SegmentList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartLaunchCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_StartLaunchCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.evidently#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StopExperimentCommand + * deserializeAws_restJson1PutProjectEventsCommand */ -export const de_StopExperimentCommand = async ( +export const de_PutProjectEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopExperimentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - endedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + eventResults: _json, + failedEventCount: __expectInt32, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StopExperimentCommandError + * deserializeAws_restJson1StartExperimentCommand */ -const de_StopExperimentCommandError = async ( +export const de_StartExperimentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.evidently#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + startedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StopLaunchCommand + * deserializeAws_restJson1StartLaunchCommand */ -export const de_StopLaunchCommand = async ( +export const de_StartLaunchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopLaunchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - endedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + launch: (_) => de_Launch(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StopLaunchCommandError + * deserializeAws_restJson1StopExperimentCommand */ -const de_StopLaunchCommandError = async ( +export const de_StopExperimentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + endedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1StopLaunchCommand */ -export const de_TagResourceCommand = async ( +export const de_StopLaunchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + endedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -2763,7 +1648,7 @@ export const de_TestSegmentPatternCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TestSegmentPatternCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2776,38 +1661,6 @@ export const de_TestSegmentPatternCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TestSegmentPatternCommandError - */ -const de_TestSegmentPatternCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.evidently#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2816,7 +1669,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2825,38 +1678,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateExperimentCommand */ @@ -2865,7 +1686,7 @@ export const de_UpdateExperimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateExperimentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2878,41 +1699,6 @@ export const de_UpdateExperimentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateExperimentCommandError - */ -const de_UpdateExperimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFeatureCommand */ @@ -2921,7 +1707,7 @@ export const de_UpdateFeatureCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFeatureCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2934,44 +1720,6 @@ export const de_UpdateFeatureCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFeatureCommandError - */ -const de_UpdateFeatureCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.evidently#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLaunchCommand */ @@ -2980,7 +1728,7 @@ export const de_UpdateLaunchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLaunchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2993,41 +1741,6 @@ export const de_UpdateLaunchCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLaunchCommandError - */ -const de_UpdateLaunchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateProjectCommand */ @@ -3036,7 +1749,7 @@ export const de_UpdateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3049,44 +1762,6 @@ export const de_UpdateProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateProjectCommandError - */ -const de_UpdateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.evidently#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.evidently#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.evidently#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.evidently#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateProjectDataDeliveryCommand */ @@ -3095,7 +1770,7 @@ export const de_UpdateProjectDataDeliveryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProjectDataDeliveryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3109,12 +1784,9 @@ export const de_UpdateProjectDataDeliveryCommand = async ( }; /** - * deserializeAws_restJson1UpdateProjectDataDeliveryCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateProjectDataDeliveryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3124,25 +1796,34 @@ const de_UpdateProjectDataDeliveryCommandError = async ( case "AccessDeniedException": case "com.amazonaws.evidently#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.evidently#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.evidently#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.evidently#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.evidently#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.evidently#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.evidently#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.evidently#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.evidently#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.evidently#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-finspace-data/src/protocols/Aws_restJson1.ts b/clients/client-finspace-data/src/protocols/Aws_restJson1.ts index 20ced8349c92..ebfa1766fea5 100644 --- a/clients/client-finspace-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-finspace-data/src/protocols/Aws_restJson1.ts @@ -783,7 +783,7 @@ export const de_AssociateUserToPermissionGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateUserToPermissionGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -795,47 +795,6 @@ export const de_AssociateUserToPermissionGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateUserToPermissionGroupCommandError - */ -const de_AssociateUserToPermissionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateChangesetCommand */ @@ -844,7 +803,7 @@ export const de_CreateChangesetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateChangesetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -858,50 +817,6 @@ export const de_CreateChangesetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateChangesetCommandError - */ -const de_CreateChangesetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspacedata#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDatasetCommand */ @@ -910,7 +825,7 @@ export const de_CreateDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -923,50 +838,6 @@ export const de_CreateDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDatasetCommandError - */ -const de_CreateDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspacedata#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDataViewCommand */ @@ -975,7 +846,7 @@ export const de_CreateDataViewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDataViewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -989,47 +860,6 @@ export const de_CreateDataViewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDataViewCommandError - */ -const de_CreateDataViewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspacedata#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePermissionGroupCommand */ @@ -1038,7 +868,7 @@ export const de_CreatePermissionGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePermissionGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1051,47 +881,6 @@ export const de_CreatePermissionGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePermissionGroupCommandError - */ -const de_CreatePermissionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspacedata#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateUserCommand */ @@ -1100,7 +889,7 @@ export const de_CreateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1114,185 +903,56 @@ export const de_CreateUserCommand = async ( }; /** - * deserializeAws_restJson1CreateUserCommandError + * deserializeAws_restJson1DeleteDatasetCommand */ -const de_CreateUserCommandError = async ( +export const de_DeleteDatasetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspacedata#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + datasetId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteDatasetCommand + * deserializeAws_restJson1DeletePermissionGroupCommand */ -export const de_DeleteDatasetCommand = async ( +export const de_DeletePermissionGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - datasetId: __expectString, + permissionGroupId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteDatasetCommandError + * deserializeAws_restJson1DisableUserCommand */ -const de_DeleteDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspacedata#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePermissionGroupCommand - */ -export const de_DeletePermissionGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePermissionGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - permissionGroupId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeletePermissionGroupCommandError - */ -const de_DeletePermissionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspacedata#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisableUserCommand - */ -export const de_DisableUserCommand = async ( +export const de_DisableUserCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1305,47 +965,6 @@ export const de_DisableUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisableUserCommandError - */ -const de_DisableUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateUserFromPermissionGroupCommand */ @@ -1354,7 +973,7 @@ export const de_DisassociateUserFromPermissionGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateUserFromPermissionGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1366,47 +985,6 @@ export const de_DisassociateUserFromPermissionGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateUserFromPermissionGroupCommandError - */ -const de_DisassociateUserFromPermissionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1EnableUserCommand */ @@ -1415,7 +993,7 @@ export const de_EnableUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1428,50 +1006,6 @@ export const de_EnableUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1EnableUserCommandError - */ -const de_EnableUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspacedata#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetChangesetCommand */ @@ -1480,7 +1014,7 @@ export const de_GetChangesetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChangesetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1505,47 +1039,6 @@ export const de_GetChangesetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetChangesetCommandError - */ -const de_GetChangesetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDatasetCommand */ @@ -1554,7 +1047,7 @@ export const de_GetDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1577,55 +1070,14 @@ export const de_GetDatasetCommand = async ( }; /** - * deserializeAws_restJson1GetDatasetCommandError + * deserializeAws_restJson1GetDataViewCommand */ -const de_GetDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDataViewCommand - */ -export const de_GetDataViewCommand = async ( +export const de_GetDataViewCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataViewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1649,44 +1101,6 @@ export const de_GetDataViewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDataViewCommandError - */ -const de_GetDataViewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetExternalDataViewAccessDetailsCommand */ @@ -1695,7 +1109,7 @@ export const de_GetExternalDataViewAccessDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetExternalDataViewAccessDetailsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1709,44 +1123,6 @@ export const de_GetExternalDataViewAccessDetailsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetExternalDataViewAccessDetailsCommandError - */ -const de_GetExternalDataViewAccessDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPermissionGroupCommand */ @@ -1755,7 +1131,7 @@ export const de_GetPermissionGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPermissionGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1768,44 +1144,6 @@ export const de_GetPermissionGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetPermissionGroupCommandError - */ -const de_GetPermissionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetProgrammaticAccessCredentialsCommand */ @@ -1814,7 +1152,7 @@ export const de_GetProgrammaticAccessCredentialsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProgrammaticAccessCredentialsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1828,41 +1166,6 @@ export const de_GetProgrammaticAccessCredentialsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetProgrammaticAccessCredentialsCommandError - */ -const de_GetProgrammaticAccessCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetUserCommand */ @@ -1871,7 +1174,7 @@ export const de_GetUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1896,44 +1199,6 @@ export const de_GetUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetUserCommandError - */ -const de_GetUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetWorkingLocationCommand */ @@ -1942,7 +1207,7 @@ export const de_GetWorkingLocationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkingLocationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1957,41 +1222,6 @@ export const de_GetWorkingLocationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetWorkingLocationCommandError - */ -const de_GetWorkingLocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListChangesetsCommand */ @@ -2000,7 +1230,7 @@ export const de_ListChangesetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChangesetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2014,47 +1244,6 @@ export const de_ListChangesetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListChangesetsCommandError - */ -const de_ListChangesetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDatasetsCommand */ @@ -2063,7 +1252,7 @@ export const de_ListDatasetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDatasetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2077,44 +1266,6 @@ export const de_ListDatasetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDatasetsCommandError - */ -const de_ListDatasetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDataViewsCommand */ @@ -2123,184 +1274,29 @@ export const de_ListDataViewsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataViewsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - dataViews: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDataViewsCommandError - */ -const de_ListDataViewsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPermissionGroupsCommand - */ -export const de_ListPermissionGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPermissionGroupsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - permissionGroups: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPermissionGroupsCommandError - */ -const de_ListPermissionGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPermissionGroupsByUserCommand - */ -export const de_ListPermissionGroupsByUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPermissionGroupsByUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - permissionGroups: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPermissionGroupsByUserCommandError - */ -const de_ListPermissionGroupsByUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + dataViews: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListUsersCommand + * deserializeAws_restJson1ListPermissionGroupsCommand */ -export const de_ListUsersCommand = async ( +export const de_ListPermissionGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUsersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2308,56 +1304,43 @@ export const de_ListUsersCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - users: _json, + permissionGroups: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListUsersCommandError + * deserializeAws_restJson1ListPermissionGroupsByUserCommand */ -const de_ListUsersCommandError = async ( +export const de_ListPermissionGroupsByUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + permissionGroups: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListUsersByPermissionGroupCommand + * deserializeAws_restJson1ListUsersCommand */ -export const de_ListUsersByPermissionGroupCommand = async ( +export const de_ListUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUsersByPermissionGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2372,41 +1355,25 @@ export const de_ListUsersByPermissionGroupCommand = async ( }; /** - * deserializeAws_restJson1ListUsersByPermissionGroupCommandError + * deserializeAws_restJson1ListUsersByPermissionGroupCommand */ -const de_ListUsersByPermissionGroupCommandError = async ( +export const de_ListUsersByPermissionGroupCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + users: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2417,7 +1384,7 @@ export const de_ResetUserPasswordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ResetUserPasswordCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2431,47 +1398,6 @@ export const de_ResetUserPasswordCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ResetUserPasswordCommandError - */ -const de_ResetUserPasswordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateChangesetCommand */ @@ -2480,7 +1406,7 @@ export const de_UpdateChangesetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChangesetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2494,47 +1420,6 @@ export const de_UpdateChangesetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateChangesetCommandError - */ -const de_UpdateChangesetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDatasetCommand */ @@ -2543,7 +1428,7 @@ export const de_UpdateDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2556,47 +1441,6 @@ export const de_UpdateDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDatasetCommandError - */ -const de_UpdateDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePermissionGroupCommand */ @@ -2605,7 +1449,7 @@ export const de_UpdatePermissionGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePermissionGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2618,47 +1462,6 @@ export const de_UpdatePermissionGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePermissionGroupCommandError - */ -const de_UpdatePermissionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspacedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspacedata#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspacedata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspacedata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspacedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspacedata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateUserCommand */ @@ -2667,7 +1470,7 @@ export const de_UpdateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2681,12 +1484,9 @@ export const de_UpdateUserCommand = async ( }; /** - * deserializeAws_restJson1UpdateUserCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2711,13 +1511,16 @@ const de_UpdateUserCommandError = async ( case "ValidationException": case "com.amazonaws.finspacedata#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.finspacedata#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-finspace/src/protocols/Aws_restJson1.ts b/clients/client-finspace/src/protocols/Aws_restJson1.ts index 2b5850a61744..aed8e4ed1fc3 100644 --- a/clients/client-finspace/src/protocols/Aws_restJson1.ts +++ b/clients/client-finspace/src/protocols/Aws_restJson1.ts @@ -1256,7 +1256,7 @@ export const de_CreateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1271,47 +1271,6 @@ export const de_CreateEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEnvironmentCommandError - */ -const de_CreateEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.finspace#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateKxChangesetCommand */ @@ -1320,7 +1279,7 @@ export const de_CreateKxChangesetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateKxChangesetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1340,50 +1299,6 @@ export const de_CreateKxChangesetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateKxChangesetCommandError - */ -const de_CreateKxChangesetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateKxClusterCommand */ @@ -1392,7 +1307,7 @@ export const de_CreateKxClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateKxClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1428,50 +1343,6 @@ export const de_CreateKxClusterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateKxClusterCommandError - */ -const de_CreateKxClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateKxDatabaseCommand */ @@ -1480,7 +1351,7 @@ export const de_CreateKxDatabaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateKxDatabaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1498,53 +1369,6 @@ export const de_CreateKxDatabaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateKxDatabaseCommandError - */ -const de_CreateKxDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.finspace#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateKxDataviewCommand */ @@ -1553,7 +1377,7 @@ export const de_CreateKxDataviewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateKxDataviewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1577,53 +1401,6 @@ export const de_CreateKxDataviewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateKxDataviewCommandError - */ -const de_CreateKxDataviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.finspace#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateKxEnvironmentCommand */ @@ -1632,7 +1409,7 @@ export const de_CreateKxEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateKxEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1651,50 +1428,6 @@ export const de_CreateKxEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateKxEnvironmentCommandError - */ -const de_CreateKxEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.finspace#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateKxScalingGroupCommand */ @@ -1703,7 +1436,7 @@ export const de_CreateKxScalingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateKxScalingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1723,58 +1456,14 @@ export const de_CreateKxScalingGroupCommand = async ( }; /** - * deserializeAws_restJson1CreateKxScalingGroupCommandError + * deserializeAws_restJson1CreateKxUserCommand */ -const de_CreateKxScalingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateKxUserCommand - */ -export const de_CreateKxUserCommand = async ( +export const de_CreateKxUserCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateKxUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1790,53 +1479,6 @@ export const de_CreateKxUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateKxUserCommandError - */ -const de_CreateKxUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.finspace#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateKxVolumeCommand */ @@ -1845,7 +1487,7 @@ export const de_CreateKxVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateKxVolumeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1868,53 +1510,6 @@ export const de_CreateKxVolumeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateKxVolumeCommandError - */ -const de_CreateKxVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.finspace#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteEnvironmentCommand */ @@ -1923,7 +1518,7 @@ export const de_DeleteEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1932,44 +1527,6 @@ export const de_DeleteEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEnvironmentCommandError - */ -const de_DeleteEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteKxClusterCommand */ @@ -1978,7 +1535,7 @@ export const de_DeleteKxClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteKxClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1988,58 +1545,31 @@ export const de_DeleteKxClusterCommand = async ( }; /** - * deserializeAws_restJson1DeleteKxClusterCommandError + * deserializeAws_restJson1DeleteKxDatabaseCommand */ -const de_DeleteKxClusterCommandError = async ( +export const de_DeleteKxDatabaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteKxDatabaseCommand + * deserializeAws_restJson1DeleteKxDataviewCommand */ -export const de_DeleteKxDatabaseCommand = async ( +export const de_DeleteKxDataviewCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteKxDatabaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2049,55 +1579,31 @@ export const de_DeleteKxDatabaseCommand = async ( }; /** - * deserializeAws_restJson1DeleteKxDatabaseCommandError + * deserializeAws_restJson1DeleteKxEnvironmentCommand */ -const de_DeleteKxDatabaseCommandError = async ( +export const de_DeleteKxEnvironmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteKxDataviewCommand + * deserializeAws_restJson1DeleteKxScalingGroupCommand */ -export const de_DeleteKxDataviewCommand = async ( +export const de_DeleteKxScalingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteKxDataviewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2106,166 +1612,6 @@ export const de_DeleteKxDataviewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteKxDataviewCommandError - */ -const de_DeleteKxDataviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteKxEnvironmentCommand - */ -export const de_DeleteKxEnvironmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteKxEnvironmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteKxEnvironmentCommandError - */ -const de_DeleteKxEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteKxScalingGroupCommand - */ -export const de_DeleteKxScalingGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteKxScalingGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteKxScalingGroupCommandError - */ -const de_DeleteKxScalingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteKxUserCommand */ @@ -2274,7 +1620,7 @@ export const de_DeleteKxUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteKxUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2283,47 +1629,6 @@ export const de_DeleteKxUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteKxUserCommandError - */ -const de_DeleteKxUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteKxVolumeCommand */ @@ -2332,7 +1637,7 @@ export const de_DeleteKxVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteKxVolumeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2341,50 +1646,6 @@ export const de_DeleteKxVolumeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteKxVolumeCommandError - */ -const de_DeleteKxVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEnvironmentCommand */ @@ -2393,7 +1654,7 @@ export const de_GetEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2407,1239 +1668,323 @@ export const de_GetEnvironmentCommand = async ( }; /** - * deserializeAws_restJson1GetEnvironmentCommandError - */ -const de_GetEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetKxChangesetCommand + * deserializeAws_restJson1GetKxChangesetCommand */ export const de_GetKxChangesetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetKxChangesetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - activeFromTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - changeRequests: _json, - changesetId: __expectString, - createdTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - databaseName: __expectString, - environmentId: __expectString, - errorInfo: _json, - lastModifiedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetKxChangesetCommandError - */ -const de_GetKxChangesetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetKxClusterCommand - */ -export const de_GetKxClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetKxClusterCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - autoScalingConfiguration: (_) => de_AutoScalingConfiguration(_, context), - availabilityZoneId: __expectString, - azMode: __expectString, - cacheStorageConfigurations: _json, - capacityConfiguration: _json, - clusterDescription: __expectString, - clusterName: __expectString, - clusterType: __expectString, - code: _json, - commandLineArguments: _json, - createdTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - databases: _json, - executionRole: __expectString, - initializationScript: __expectString, - lastModifiedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - releaseLabel: __expectString, - savedownStorageConfiguration: _json, - scalingGroupConfiguration: (_) => de_KxScalingGroupConfiguration(_, context), - status: __expectString, - statusReason: __expectString, - tickerplantLogConfiguration: _json, - volumes: _json, - vpcConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetKxClusterCommandError - */ -const de_GetKxClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetKxConnectionStringCommand - */ -export const de_GetKxConnectionStringCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetKxConnectionStringCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - signedConnectionString: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetKxConnectionStringCommandError - */ -const de_GetKxConnectionStringCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetKxDatabaseCommand - */ -export const de_GetKxDatabaseCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetKxDatabaseCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - createdTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - databaseArn: __expectString, - databaseName: __expectString, - description: __expectString, - environmentId: __expectString, - lastCompletedChangesetId: __expectString, - lastModifiedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - numBytes: __expectLong, - numChangesets: __expectInt32, - numFiles: __expectInt32, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetKxDatabaseCommandError - */ -const de_GetKxDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetKxDataviewCommand - */ -export const de_GetKxDataviewCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetKxDataviewCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - activeVersions: (_) => de_KxDataviewActiveVersionList(_, context), - autoUpdate: __expectBoolean, - availabilityZoneId: __expectString, - azMode: __expectString, - changesetId: __expectString, - createdTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - databaseName: __expectString, - dataviewName: __expectString, - description: __expectString, - environmentId: __expectString, - lastModifiedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - segmentConfigurations: _json, - status: __expectString, - statusReason: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetKxDataviewCommandError - */ -const de_GetKxDataviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetKxEnvironmentCommand - */ -export const de_GetKxEnvironmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetKxEnvironmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - availabilityZoneIds: _json, - awsAccountId: __expectString, - certificateAuthorityArn: __expectString, - creationTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - customDNSConfiguration: _json, - dedicatedServiceAccountId: __expectString, - description: __expectString, - dnsStatus: __expectString, - environmentArn: __expectString, - environmentId: __expectString, - errorMessage: __expectString, - kmsKeyId: __expectString, - name: __expectString, - status: __expectString, - tgwStatus: __expectString, - transitGatewayConfiguration: _json, - updateTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetKxEnvironmentCommandError - */ -const de_GetKxEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetKxScalingGroupCommand - */ -export const de_GetKxScalingGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetKxScalingGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - availabilityZoneId: __expectString, - clusters: _json, - createdTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - hostType: __expectString, - lastModifiedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - scalingGroupArn: __expectString, - scalingGroupName: __expectString, - status: __expectString, - statusReason: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetKxScalingGroupCommandError - */ -const de_GetKxScalingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetKxUserCommand - */ -export const de_GetKxUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetKxUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - environmentId: __expectString, - iamRole: __expectString, - userArn: __expectString, - userName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetKxUserCommandError - */ -const de_GetKxUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetKxVolumeCommand - */ -export const de_GetKxVolumeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetKxVolumeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - attachedClusters: _json, - availabilityZoneIds: _json, - azMode: __expectString, - createdTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - description: __expectString, - environmentId: __expectString, - lastModifiedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - nas1Configuration: _json, - status: __expectString, - statusReason: __expectString, - volumeArn: __expectString, - volumeName: __expectString, - volumeType: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetKxVolumeCommandError - */ -const de_GetKxVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListEnvironmentsCommand - */ -export const de_ListEnvironmentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEnvironmentsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - environments: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListEnvironmentsCommandError - */ -const de_ListEnvironmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListKxChangesetsCommand - */ -export const de_ListKxChangesetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKxChangesetsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - kxChangesets: (_) => de_KxChangesets(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListKxChangesetsCommandError - */ -const de_ListKxChangesetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListKxClusterNodesCommand - */ -export const de_ListKxClusterNodesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKxClusterNodesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - nodes: (_) => de_KxNodeSummaries(_, context), + activeFromTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + changeRequests: _json, + changesetId: __expectString, + createdTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + databaseName: __expectString, + environmentId: __expectString, + errorInfo: _json, + lastModifiedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + status: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListKxClusterNodesCommandError - */ -const de_ListKxClusterNodesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListKxClustersCommand + * deserializeAws_restJson1GetKxClusterCommand */ -export const de_ListKxClustersCommand = async ( +export const de_GetKxClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKxClustersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - kxClusterSummaries: (_) => de_KxClusters(_, context), - nextToken: __expectString, + autoScalingConfiguration: (_) => de_AutoScalingConfiguration(_, context), + availabilityZoneId: __expectString, + azMode: __expectString, + cacheStorageConfigurations: _json, + capacityConfiguration: _json, + clusterDescription: __expectString, + clusterName: __expectString, + clusterType: __expectString, + code: _json, + commandLineArguments: _json, + createdTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + databases: _json, + executionRole: __expectString, + initializationScript: __expectString, + lastModifiedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + releaseLabel: __expectString, + savedownStorageConfiguration: _json, + scalingGroupConfiguration: (_) => de_KxScalingGroupConfiguration(_, context), + status: __expectString, + statusReason: __expectString, + tickerplantLogConfiguration: _json, + volumes: _json, + vpcConfiguration: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListKxClustersCommandError - */ -const de_ListKxClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListKxDatabasesCommand + * deserializeAws_restJson1GetKxConnectionStringCommand */ -export const de_ListKxDatabasesCommand = async ( +export const de_GetKxConnectionStringCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKxDatabasesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - kxDatabases: (_) => de_KxDatabases(_, context), - nextToken: __expectString, + signedConnectionString: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListKxDatabasesCommandError + * deserializeAws_restJson1GetKxDatabaseCommand */ -const de_ListKxDatabasesCommandError = async ( +export const de_GetKxDatabaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + createdTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + databaseArn: __expectString, + databaseName: __expectString, + description: __expectString, + environmentId: __expectString, + lastCompletedChangesetId: __expectString, + lastModifiedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + numBytes: __expectLong, + numChangesets: __expectInt32, + numFiles: __expectInt32, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListKxDataviewsCommand + * deserializeAws_restJson1GetKxDataviewCommand */ -export const de_ListKxDataviewsCommand = async ( +export const de_GetKxDataviewCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKxDataviewsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - kxDataviews: (_) => de_KxDataviews(_, context), - nextToken: __expectString, + activeVersions: (_) => de_KxDataviewActiveVersionList(_, context), + autoUpdate: __expectBoolean, + availabilityZoneId: __expectString, + azMode: __expectString, + changesetId: __expectString, + createdTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + databaseName: __expectString, + dataviewName: __expectString, + description: __expectString, + environmentId: __expectString, + lastModifiedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + segmentConfigurations: _json, + status: __expectString, + statusReason: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListKxDataviewsCommandError + * deserializeAws_restJson1GetKxEnvironmentCommand */ -const de_ListKxDataviewsCommandError = async ( +export const de_GetKxEnvironmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + availabilityZoneIds: _json, + awsAccountId: __expectString, + certificateAuthorityArn: __expectString, + creationTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + customDNSConfiguration: _json, + dedicatedServiceAccountId: __expectString, + description: __expectString, + dnsStatus: __expectString, + environmentArn: __expectString, + environmentId: __expectString, + errorMessage: __expectString, + kmsKeyId: __expectString, + name: __expectString, + status: __expectString, + tgwStatus: __expectString, + transitGatewayConfiguration: _json, + updateTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListKxEnvironmentsCommand + * deserializeAws_restJson1GetKxScalingGroupCommand */ -export const de_ListKxEnvironmentsCommand = async ( +export const de_GetKxScalingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKxEnvironmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - environments: (_) => de_KxEnvironmentList(_, context), - nextToken: __expectString, + availabilityZoneId: __expectString, + clusters: _json, + createdTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + hostType: __expectString, + lastModifiedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + scalingGroupArn: __expectString, + scalingGroupName: __expectString, + status: __expectString, + statusReason: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListKxEnvironmentsCommandError - */ -const de_ListKxEnvironmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListKxScalingGroupsCommand + * deserializeAws_restJson1GetKxUserCommand */ -export const de_ListKxScalingGroupsCommand = async ( +export const de_GetKxUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKxScalingGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - scalingGroups: (_) => de_KxScalingGroupList(_, context), + environmentId: __expectString, + iamRole: __expectString, + userArn: __expectString, + userName: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListKxScalingGroupsCommandError + * deserializeAws_restJson1GetKxVolumeCommand */ -const de_ListKxScalingGroupsCommandError = async ( +export const de_GetKxVolumeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + attachedClusters: _json, + availabilityZoneIds: _json, + azMode: __expectString, + createdTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + description: __expectString, + environmentId: __expectString, + lastModifiedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + nas1Configuration: _json, + status: __expectString, + statusReason: __expectString, + volumeArn: __expectString, + volumeName: __expectString, + volumeType: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListKxUsersCommand + * deserializeAws_restJson1ListEnvironmentsCommand */ -export const de_ListKxUsersCommand = async ( +export const de_ListEnvironmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKxUsersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + environments: _json, nextToken: __expectString, - users: (_) => de_KxUserList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListKxUsersCommandError - */ -const de_ListKxUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListKxVolumesCommand + * deserializeAws_restJson1ListKxChangesetsCommand */ -export const de_ListKxVolumesCommand = async ( +export const de_ListKxChangesetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKxVolumesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - kxVolumeSummaries: (_) => de_KxVolumes(_, context), + kxChangesets: (_) => de_KxChangesets(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -3647,329 +1992,228 @@ export const de_ListKxVolumesCommand = async ( }; /** - * deserializeAws_restJson1ListKxVolumesCommandError - */ -const de_ListKxVolumesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListKxClusterNodesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListKxClusterNodesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + nextToken: __expectString, + nodes: (_) => de_KxNodeSummaries(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListKxClustersCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListKxClustersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.finspace#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + kxClusterSummaries: (_) => de_KxClusters(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListKxDatabasesCommand */ -export const de_TagResourceCommand = async ( +export const de_ListKxDatabasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + kxDatabases: (_) => de_KxDatabases(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1ListKxDataviewsCommand */ -const de_TagResourceCommandError = async ( +export const de_ListKxDataviewsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.finspace#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + kxDataviews: (_) => de_KxDataviews(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1ListKxEnvironmentsCommand */ -export const de_UntagResourceCommand = async ( +export const de_ListKxEnvironmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + environments: (_) => de_KxEnvironmentList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1ListKxScalingGroupsCommand */ -const de_UntagResourceCommandError = async ( +export const de_ListKxScalingGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.finspace#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + scalingGroups: (_) => de_KxScalingGroupList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateEnvironmentCommand + * deserializeAws_restJson1ListKxUsersCommand */ -export const de_UpdateEnvironmentCommand = async ( +export const de_ListKxUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - environment: _json, + nextToken: __expectString, + users: (_) => de_KxUserList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateEnvironmentCommandError + * deserializeAws_restJson1ListKxVolumesCommand */ -const de_UpdateEnvironmentCommandError = async ( +export const de_ListKxVolumesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + kxVolumeSummaries: (_) => de_KxVolumes(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateKxClusterCodeConfigurationCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_UpdateKxClusterCodeConfigurationCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateKxClusterCodeConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateKxClusterCodeConfigurationCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_UpdateKxClusterCodeConfigurationCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateKxClusterDatabasesCommand + * deserializeAws_restJson1UntagResourceCommand */ -export const de_UpdateKxClusterDatabasesCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateKxClusterDatabasesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3979,47 +2223,58 @@ export const de_UpdateKxClusterDatabasesCommand = async ( }; /** - * deserializeAws_restJson1UpdateKxClusterDatabasesCommandError + * deserializeAws_restJson1UpdateEnvironmentCommand */ -const de_UpdateKxClusterDatabasesCommandError = async ( +export const de_UpdateEnvironmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + environment: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateKxClusterCodeConfigurationCommand + */ +export const de_UpdateKxClusterCodeConfigurationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateKxClusterDatabasesCommand + */ +export const de_UpdateKxClusterDatabasesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -4030,7 +2285,7 @@ export const de_UpdateKxDatabaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateKxDatabaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4046,47 +2301,6 @@ export const de_UpdateKxDatabaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateKxDatabaseCommandError - */ -const de_UpdateKxDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateKxDataviewCommand */ @@ -4095,7 +2309,7 @@ export const de_UpdateKxDataviewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateKxDataviewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4120,50 +2334,6 @@ export const de_UpdateKxDataviewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateKxDataviewCommandError - */ -const de_UpdateKxDataviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.finspace#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateKxEnvironmentCommand */ @@ -4172,7 +2342,7 @@ export const de_UpdateKxEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateKxEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4200,47 +2370,6 @@ export const de_UpdateKxEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateKxEnvironmentCommandError - */ -const de_UpdateKxEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateKxEnvironmentNetworkCommand */ @@ -4249,7 +2378,7 @@ export const de_UpdateKxEnvironmentNetworkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateKxEnvironmentNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4277,47 +2406,6 @@ export const de_UpdateKxEnvironmentNetworkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateKxEnvironmentNetworkCommandError - */ -const de_UpdateKxEnvironmentNetworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateKxUserCommand */ @@ -4326,7 +2414,7 @@ export const de_UpdateKxUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateKxUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4342,50 +2430,6 @@ export const de_UpdateKxUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateKxUserCommandError - */ -const de_UpdateKxUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.finspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.finspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.finspace#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.finspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.finspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateKxVolumeCommand */ @@ -4394,7 +2438,7 @@ export const de_UpdateKxVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateKxVolumeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4420,12 +2464,9 @@ export const de_UpdateKxVolumeCommand = async ( }; /** - * deserializeAws_restJson1UpdateKxVolumeCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateKxVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4435,31 +2476,40 @@ const de_UpdateKxVolumeCommandError = async ( case "AccessDeniedException": case "com.amazonaws.finspace#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.finspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.finspace#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "LimitExceededException": case "com.amazonaws.finspace#LimitExceededException": throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.finspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.finspace#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.finspace#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.finspace#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.finspace#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.finspace#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.finspace#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.finspace#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-firehose/src/protocols/Aws_json1_1.ts b/clients/client-firehose/src/protocols/Aws_json1_1.ts index 2e7226954d95..3b75283defc2 100644 --- a/clients/client-firehose/src/protocols/Aws_json1_1.ts +++ b/clients/client-firehose/src/protocols/Aws_json1_1.ts @@ -316,7 +316,7 @@ export const de_CreateDeliveryStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDeliveryStreamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -328,41 +328,6 @@ export const de_CreateDeliveryStreamCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDeliveryStreamCommandError - */ -const de_CreateDeliveryStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.firehose#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidKMSResourceException": - case "com.amazonaws.firehose#InvalidKMSResourceException": - throw await de_InvalidKMSResourceExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.firehose#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.firehose#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteDeliveryStreamCommand */ @@ -371,7 +336,7 @@ export const de_DeleteDeliveryStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDeliveryStreamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -383,35 +348,6 @@ export const de_DeleteDeliveryStreamCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteDeliveryStreamCommandError - */ -const de_DeleteDeliveryStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUseException": - case "com.amazonaws.firehose#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.firehose#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeDeliveryStreamCommand */ @@ -420,7 +356,7 @@ export const de_DescribeDeliveryStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDeliveryStreamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -432,32 +368,6 @@ export const de_DescribeDeliveryStreamCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDeliveryStreamCommandError - */ -const de_DescribeDeliveryStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.firehose#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListDeliveryStreamsCommand */ @@ -466,7 +376,7 @@ export const de_ListDeliveryStreamsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListDeliveryStreamsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -478,26 +388,6 @@ export const de_ListDeliveryStreamsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListDeliveryStreamsCommandError - */ -const de_ListDeliveryStreamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListTagsForDeliveryStreamCommand */ @@ -506,7 +396,7 @@ export const de_ListTagsForDeliveryStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForDeliveryStreamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -518,38 +408,6 @@ export const de_ListTagsForDeliveryStreamCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForDeliveryStreamCommandError - */ -const de_ListTagsForDeliveryStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.firehose#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.firehose#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.firehose#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutRecordCommand */ @@ -558,7 +416,7 @@ export const de_PutRecordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutRecordCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -570,44 +428,6 @@ export const de_PutRecordCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutRecordCommandError - */ -const de_PutRecordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.firehose#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidKMSResourceException": - case "com.amazonaws.firehose#InvalidKMSResourceException": - throw await de_InvalidKMSResourceExceptionRes(parsedOutput, context); - case "InvalidSourceException": - case "com.amazonaws.firehose#InvalidSourceException": - throw await de_InvalidSourceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.firehose#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.firehose#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutRecordBatchCommand */ @@ -616,7 +436,7 @@ export const de_PutRecordBatchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutRecordBatchCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -628,44 +448,6 @@ export const de_PutRecordBatchCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutRecordBatchCommandError - */ -const de_PutRecordBatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.firehose#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidKMSResourceException": - case "com.amazonaws.firehose#InvalidKMSResourceException": - throw await de_InvalidKMSResourceExceptionRes(parsedOutput, context); - case "InvalidSourceException": - case "com.amazonaws.firehose#InvalidSourceException": - throw await de_InvalidSourceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.firehose#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.firehose#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartDeliveryStreamEncryptionCommand */ @@ -674,7 +456,7 @@ export const de_StartDeliveryStreamEncryptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartDeliveryStreamEncryptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -686,44 +468,6 @@ export const de_StartDeliveryStreamEncryptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartDeliveryStreamEncryptionCommandError - */ -const de_StartDeliveryStreamEncryptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.firehose#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidKMSResourceException": - case "com.amazonaws.firehose#InvalidKMSResourceException": - throw await de_InvalidKMSResourceExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.firehose#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.firehose#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.firehose#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopDeliveryStreamEncryptionCommand */ @@ -732,7 +476,7 @@ export const de_StopDeliveryStreamEncryptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopDeliveryStreamEncryptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -744,41 +488,6 @@ export const de_StopDeliveryStreamEncryptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopDeliveryStreamEncryptionCommandError - */ -const de_StopDeliveryStreamEncryptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.firehose#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.firehose#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.firehose#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.firehose#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagDeliveryStreamCommand */ @@ -787,7 +496,7 @@ export const de_TagDeliveryStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagDeliveryStreamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -799,41 +508,6 @@ export const de_TagDeliveryStreamCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagDeliveryStreamCommandError - */ -const de_TagDeliveryStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.firehose#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.firehose#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.firehose#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.firehose#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagDeliveryStreamCommand */ @@ -842,7 +516,7 @@ export const de_UntagDeliveryStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagDeliveryStreamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -854,41 +528,6 @@ export const de_UntagDeliveryStreamCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagDeliveryStreamCommandError - */ -const de_UntagDeliveryStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.firehose#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.firehose#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.firehose#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.firehose#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDestinationCommand */ @@ -897,7 +536,7 @@ export const de_UpdateDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -910,37 +549,46 @@ export const de_UpdateDestinationCommand = async ( }; /** - * deserializeAws_json1_1UpdateDestinationCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.firehose#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); case "InvalidArgumentException": case "com.amazonaws.firehose#InvalidArgumentException": throw await de_InvalidArgumentExceptionRes(parsedOutput, context); + case "InvalidKMSResourceException": + case "com.amazonaws.firehose#InvalidKMSResourceException": + throw await de_InvalidKMSResourceExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.firehose#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "ResourceInUseException": case "com.amazonaws.firehose#ResourceInUseException": throw await de_ResourceInUseExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.firehose#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "InvalidSourceException": + case "com.amazonaws.firehose#InvalidSourceException": + throw await de_InvalidSourceExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.firehose#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.firehose#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-fis/src/protocols/Aws_restJson1.ts b/clients/client-fis/src/protocols/Aws_restJson1.ts index 2282de882261..8b0ea2a5a2cb 100644 --- a/clients/client-fis/src/protocols/Aws_restJson1.ts +++ b/clients/client-fis/src/protocols/Aws_restJson1.ts @@ -605,7 +605,7 @@ export const de_CreateExperimentTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateExperimentTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -618,41 +618,6 @@ export const de_CreateExperimentTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateExperimentTemplateCommandError - */ -const de_CreateExperimentTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.fis#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.fis#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateTargetAccountConfigurationCommand */ @@ -661,7 +626,7 @@ export const de_CreateTargetAccountConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTargetAccountConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -674,41 +639,6 @@ export const de_CreateTargetAccountConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTargetAccountConfigurationCommandError - */ -const de_CreateTargetAccountConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.fis#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.fis#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteExperimentTemplateCommand */ @@ -717,7 +647,7 @@ export const de_DeleteExperimentTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteExperimentTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -730,35 +660,6 @@ export const de_DeleteExperimentTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteExperimentTemplateCommandError - */ -const de_DeleteExperimentTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteTargetAccountConfigurationCommand */ @@ -767,7 +668,7 @@ export const de_DeleteTargetAccountConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTargetAccountConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -780,35 +681,6 @@ export const de_DeleteTargetAccountConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteTargetAccountConfigurationCommandError - */ -const de_DeleteTargetAccountConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetActionCommand */ @@ -817,7 +689,7 @@ export const de_GetActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -830,35 +702,6 @@ export const de_GetActionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetActionCommandError - */ -const de_GetActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetExperimentCommand */ @@ -867,7 +710,7 @@ export const de_GetExperimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetExperimentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -880,35 +723,6 @@ export const de_GetExperimentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetExperimentCommandError - */ -const de_GetExperimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetExperimentTargetAccountConfigurationCommand */ @@ -917,7 +731,7 @@ export const de_GetExperimentTargetAccountConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetExperimentTargetAccountConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -930,35 +744,6 @@ export const de_GetExperimentTargetAccountConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetExperimentTargetAccountConfigurationCommandError - */ -const de_GetExperimentTargetAccountConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetExperimentTemplateCommand */ @@ -967,7 +752,7 @@ export const de_GetExperimentTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetExperimentTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -980,35 +765,6 @@ export const de_GetExperimentTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetExperimentTemplateCommandError - */ -const de_GetExperimentTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTargetAccountConfigurationCommand */ @@ -1017,7 +773,7 @@ export const de_GetTargetAccountConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTargetAccountConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1030,35 +786,6 @@ export const de_GetTargetAccountConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTargetAccountConfigurationCommandError - */ -const de_GetTargetAccountConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTargetResourceTypeCommand */ @@ -1067,7 +794,7 @@ export const de_GetTargetResourceTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTargetResourceTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1080,35 +807,6 @@ export const de_GetTargetResourceTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTargetResourceTypeCommandError - */ -const de_GetTargetResourceTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListActionsCommand */ @@ -1117,7 +815,7 @@ export const de_ListActionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListActionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1131,32 +829,6 @@ export const de_ListActionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListActionsCommandError - */ -const de_ListActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListExperimentResolvedTargetsCommand */ @@ -1165,7 +837,7 @@ export const de_ListExperimentResolvedTargetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListExperimentResolvedTargetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1179,35 +851,6 @@ export const de_ListExperimentResolvedTargetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListExperimentResolvedTargetsCommandError - */ -const de_ListExperimentResolvedTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListExperimentsCommand */ @@ -1216,7 +859,7 @@ export const de_ListExperimentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListExperimentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1230,32 +873,6 @@ export const de_ListExperimentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListExperimentsCommandError - */ -const de_ListExperimentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListExperimentTargetAccountConfigurationsCommand */ @@ -1264,7 +881,7 @@ export const de_ListExperimentTargetAccountConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListExperimentTargetAccountConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1278,35 +895,6 @@ export const de_ListExperimentTargetAccountConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListExperimentTargetAccountConfigurationsCommandError - */ -const de_ListExperimentTargetAccountConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListExperimentTemplatesCommand */ @@ -1315,7 +903,7 @@ export const de_ListExperimentTemplatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListExperimentTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1329,32 +917,6 @@ export const de_ListExperimentTemplatesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListExperimentTemplatesCommandError - */ -const de_ListExperimentTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1363,7 +925,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1376,26 +938,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListTargetAccountConfigurationsCommand */ @@ -1404,7 +946,7 @@ export const de_ListTargetAccountConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTargetAccountConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1418,35 +960,6 @@ export const de_ListTargetAccountConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTargetAccountConfigurationsCommandError - */ -const de_ListTargetAccountConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTargetResourceTypesCommand */ @@ -1455,7 +968,7 @@ export const de_ListTargetResourceTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTargetResourceTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1469,32 +982,6 @@ export const de_ListTargetResourceTypesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTargetResourceTypesCommandError - */ -const de_ListTargetResourceTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartExperimentCommand */ @@ -1503,7 +990,7 @@ export const de_StartExperimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartExperimentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1516,41 +1003,6 @@ export const de_StartExperimentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartExperimentCommandError - */ -const de_StartExperimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.fis#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.fis#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopExperimentCommand */ @@ -1559,7 +1011,7 @@ export const de_StopExperimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopExperimentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1572,35 +1024,6 @@ export const de_StopExperimentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopExperimentCommandError - */ -const de_StopExperimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1609,7 +1032,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1618,26 +1041,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1646,7 +1049,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1655,26 +1058,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1UpdateExperimentTemplateCommand */ @@ -1683,7 +1066,7 @@ export const de_UpdateExperimentTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateExperimentTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1696,38 +1079,6 @@ export const de_UpdateExperimentTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateExperimentTemplateCommandError - */ -const de_UpdateExperimentTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.fis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.fis#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.fis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTargetAccountConfigurationCommand */ @@ -1736,7 +1087,7 @@ export const de_UpdateTargetAccountConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTargetAccountConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1750,21 +1101,24 @@ export const de_UpdateTargetAccountConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateTargetAccountConfigurationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateTargetAccountConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "ConflictException": + case "com.amazonaws.fis#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.fis#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.fis#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.fis#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); @@ -1774,7 +1128,7 @@ const de_UpdateTargetAccountConfigurationCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-fms/src/protocols/Aws_json1_1.ts b/clients/client-fms/src/protocols/Aws_json1_1.ts index 6b34098052e7..09a503956a33 100644 --- a/clients/client-fms/src/protocols/Aws_json1_1.ts +++ b/clients/client-fms/src/protocols/Aws_json1_1.ts @@ -762,7 +762,7 @@ export const de_AssociateAdminAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateAdminAccountCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AssociateAdminAccountCommandOutput = { @@ -771,44 +771,6 @@ export const de_AssociateAdminAccountCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateAdminAccountCommandError - */ -const de_AssociateAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.fms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateThirdPartyFirewallCommand */ @@ -817,7 +779,7 @@ export const de_AssociateThirdPartyFirewallCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateThirdPartyFirewallCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -829,41 +791,6 @@ export const de_AssociateThirdPartyFirewallCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateThirdPartyFirewallCommandError - */ -const de_AssociateThirdPartyFirewallCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchAssociateResourceCommand */ @@ -872,7 +799,7 @@ export const de_BatchAssociateResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchAssociateResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -884,44 +811,6 @@ export const de_BatchAssociateResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchAssociateResourceCommandError - */ -const de_BatchAssociateResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.fms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDisassociateResourceCommand */ @@ -930,7 +819,7 @@ export const de_BatchDisassociateResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDisassociateResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -942,41 +831,6 @@ export const de_BatchDisassociateResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDisassociateResourceCommandError - */ -const de_BatchDisassociateResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAppsListCommand */ @@ -985,7 +839,7 @@ export const de_DeleteAppsListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAppsListCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteAppsListCommandOutput = { @@ -994,38 +848,6 @@ export const de_DeleteAppsListCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAppsListCommandError - */ -const de_DeleteAppsListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteNotificationChannelCommand */ @@ -1034,7 +856,7 @@ export const de_DeleteNotificationChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNotificationChannelCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteNotificationChannelCommandOutput = { @@ -1043,38 +865,6 @@ export const de_DeleteNotificationChannelCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteNotificationChannelCommandError - */ -const de_DeleteNotificationChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeletePolicyCommand */ @@ -1083,7 +873,7 @@ export const de_DeletePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeletePolicyCommandOutput = { @@ -1092,44 +882,6 @@ export const de_DeletePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeletePolicyCommandError - */ -const de_DeletePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.fms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteProtocolsListCommand */ @@ -1138,7 +890,7 @@ export const de_DeleteProtocolsListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteProtocolsListCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteProtocolsListCommandOutput = { @@ -1147,38 +899,6 @@ export const de_DeleteProtocolsListCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteProtocolsListCommandError - */ -const de_DeleteProtocolsListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteResourceSetCommand */ @@ -1187,7 +907,7 @@ export const de_DeleteResourceSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteResourceSetCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteResourceSetCommandOutput = { @@ -1196,41 +916,6 @@ export const de_DeleteResourceSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteResourceSetCommandError - */ -const de_DeleteResourceSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisassociateAdminAccountCommand */ @@ -1239,7 +924,7 @@ export const de_DisassociateAdminAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateAdminAccountCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DisassociateAdminAccountCommandOutput = { @@ -1248,38 +933,6 @@ export const de_DisassociateAdminAccountCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateAdminAccountCommandError - */ -const de_DisassociateAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisassociateThirdPartyFirewallCommand */ @@ -1288,7 +941,7 @@ export const de_DisassociateThirdPartyFirewallCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateThirdPartyFirewallCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1300,41 +953,6 @@ export const de_DisassociateThirdPartyFirewallCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateThirdPartyFirewallCommandError - */ -const de_DisassociateThirdPartyFirewallCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAdminAccountCommand */ @@ -1343,7 +961,7 @@ export const de_GetAdminAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAdminAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1355,38 +973,6 @@ export const de_GetAdminAccountCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAdminAccountCommandError - */ -const de_GetAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAdminScopeCommand */ @@ -1395,7 +981,7 @@ export const de_GetAdminScopeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAdminScopeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1407,44 +993,6 @@ export const de_GetAdminScopeCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAdminScopeCommandError - */ -const de_GetAdminScopeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.fms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAppsListCommand */ @@ -1453,7 +1001,7 @@ export const de_GetAppsListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAppsListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1465,38 +1013,6 @@ export const de_GetAppsListCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAppsListCommandError - */ -const de_GetAppsListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetComplianceDetailCommand */ @@ -1505,7 +1021,7 @@ export const de_GetComplianceDetailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetComplianceDetailCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1517,41 +1033,6 @@ export const de_GetComplianceDetailCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetComplianceDetailCommandError - */ -const de_GetComplianceDetailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetNotificationChannelCommand */ @@ -1560,7 +1041,7 @@ export const de_GetNotificationChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetNotificationChannelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1572,38 +1053,6 @@ export const de_GetNotificationChannelCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetNotificationChannelCommandError - */ -const de_GetNotificationChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetPolicyCommand */ @@ -1612,7 +1061,7 @@ export const de_GetPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1624,91 +1073,24 @@ export const de_GetPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetPolicyCommandError - */ -const de_GetPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidTypeException": - case "com.amazonaws.fms#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetProtectionStatusCommand */ export const de_GetProtectionStatusCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetProtectionStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetProtectionStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetProtectionStatusCommandError - */ -const de_GetProtectionStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetProtectionStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1719,7 +1101,7 @@ export const de_GetProtocolsListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetProtocolsListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1731,38 +1113,6 @@ export const de_GetProtocolsListCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetProtocolsListCommandError - */ -const de_GetProtocolsListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetResourceSetCommand */ @@ -1771,7 +1121,7 @@ export const de_GetResourceSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetResourceSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1783,41 +1133,6 @@ export const de_GetResourceSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetResourceSetCommandError - */ -const de_GetResourceSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetThirdPartyFirewallAssociationStatusCommand */ @@ -1826,7 +1141,7 @@ export const de_GetThirdPartyFirewallAssociationStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetThirdPartyFirewallAssociationStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1838,41 +1153,6 @@ export const de_GetThirdPartyFirewallAssociationStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetThirdPartyFirewallAssociationStatusCommandError - */ -const de_GetThirdPartyFirewallAssociationStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetViolationDetailsCommand */ @@ -1881,7 +1161,7 @@ export const de_GetViolationDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetViolationDetailsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1893,38 +1173,6 @@ export const de_GetViolationDetailsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetViolationDetailsCommandError - */ -const de_GetViolationDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAdminAccountsForOrganizationCommand */ @@ -1933,7 +1181,7 @@ export const de_ListAdminAccountsForOrganizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAdminAccountsForOrganizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1945,41 +1193,6 @@ export const de_ListAdminAccountsForOrganizationCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAdminAccountsForOrganizationCommandError - */ -const de_ListAdminAccountsForOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.fms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAdminsManagingAccountCommand */ @@ -1988,7 +1201,7 @@ export const de_ListAdminsManagingAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAdminsManagingAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2000,38 +1213,6 @@ export const de_ListAdminsManagingAccountCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAdminsManagingAccountCommandError - */ -const de_ListAdminsManagingAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAppsListsCommand */ @@ -2040,7 +1221,7 @@ export const de_ListAppsListsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAppsListsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2052,41 +1233,6 @@ export const de_ListAppsListsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAppsListsCommandError - */ -const de_ListAppsListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.fms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListComplianceStatusCommand */ @@ -2095,45 +1241,16 @@ export const de_ListComplianceStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListComplianceStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_ListComplianceStatusResponse(data, context); const response: ListComplianceStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListComplianceStatusCommandError - */ -const de_ListComplianceStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2144,7 +1261,7 @@ export const de_ListDiscoveredResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListDiscoveredResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2156,38 +1273,6 @@ export const de_ListDiscoveredResourcesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListDiscoveredResourcesCommandError - */ -const de_ListDiscoveredResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListMemberAccountsCommand */ @@ -2196,7 +1281,7 @@ export const de_ListMemberAccountsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListMemberAccountsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2208,35 +1293,6 @@ export const de_ListMemberAccountsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListMemberAccountsCommandError - */ -const de_ListMemberAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPoliciesCommand */ @@ -2245,7 +1301,7 @@ export const de_ListPoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPoliciesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2257,41 +1313,6 @@ export const de_ListPoliciesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPoliciesCommandError - */ -const de_ListPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.fms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListProtocolsListsCommand */ @@ -2300,7 +1321,7 @@ export const de_ListProtocolsListsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListProtocolsListsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2312,38 +1333,6 @@ export const de_ListProtocolsListsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListProtocolsListsCommandError - */ -const de_ListProtocolsListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListResourceSetResourcesCommand */ @@ -2352,7 +1341,7 @@ export const de_ListResourceSetResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListResourceSetResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2364,41 +1353,6 @@ export const de_ListResourceSetResourcesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListResourceSetResourcesCommandError - */ -const de_ListResourceSetResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListResourceSetsCommand */ @@ -2407,7 +1361,7 @@ export const de_ListResourceSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListResourceSetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2419,38 +1373,6 @@ export const de_ListResourceSetsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListResourceSetsCommandError - */ -const de_ListResourceSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -2459,7 +1381,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2471,94 +1393,24 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListThirdPartyFirewallFirewallPoliciesCommand */ export const de_ListThirdPartyFirewallFirewallPoliciesCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListThirdPartyFirewallFirewallPoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListThirdPartyFirewallFirewallPoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListThirdPartyFirewallFirewallPoliciesCommandError - */ -const de_ListThirdPartyFirewallFirewallPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListThirdPartyFirewallFirewallPoliciesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2569,7 +1421,7 @@ export const de_PutAdminAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutAdminAccountCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutAdminAccountCommandOutput = { @@ -2578,41 +1430,6 @@ export const de_PutAdminAccountCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutAdminAccountCommandError - */ -const de_PutAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.fms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutAppsListCommand */ @@ -2621,7 +1438,7 @@ export const de_PutAppsListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutAppsListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2633,44 +1450,6 @@ export const de_PutAppsListCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutAppsListCommandError - */ -const de_PutAppsListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.fms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutNotificationChannelCommand */ @@ -2679,7 +1458,7 @@ export const de_PutNotificationChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutNotificationChannelCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutNotificationChannelCommandOutput = { @@ -2688,38 +1467,6 @@ export const de_PutNotificationChannelCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutNotificationChannelCommandError - */ -const de_PutNotificationChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutPolicyCommand */ @@ -2728,7 +1475,7 @@ export const de_PutPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2740,47 +1487,6 @@ export const de_PutPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutPolicyCommandError - */ -const de_PutPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidTypeException": - case "com.amazonaws.fms#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.fms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutProtocolsListCommand */ @@ -2789,7 +1495,7 @@ export const de_PutProtocolsListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutProtocolsListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2801,44 +1507,6 @@ export const de_PutProtocolsListCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutProtocolsListCommandError - */ -const de_PutProtocolsListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.fms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutResourceSetCommand */ @@ -2847,7 +1515,7 @@ export const de_PutResourceSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutResourceSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2859,41 +1527,6 @@ export const de_PutResourceSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutResourceSetCommandError - */ -const de_PutResourceSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.fms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -2902,7 +1535,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2914,44 +1547,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.fms#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.fms#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.fms#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.fms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.fms#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -2960,7 +1555,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2973,12 +1568,9 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2994,16 +1586,22 @@ const de_UntagResourceCommandError = async ( case "InvalidOperationException": case "com.amazonaws.fms#InvalidOperationException": throw await de_InvalidOperationExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.fms#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.fms#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "InvalidTypeException": + case "com.amazonaws.fms#InvalidTypeException": + throw await de_InvalidTypeExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-forecast/src/protocols/Aws_json1_1.ts b/clients/client-forecast/src/protocols/Aws_json1_1.ts index 7c784e0ef1d8..64f6909b84ae 100644 --- a/clients/client-forecast/src/protocols/Aws_json1_1.ts +++ b/clients/client-forecast/src/protocols/Aws_json1_1.ts @@ -1182,7 +1182,7 @@ export const de_CreateAutoPredictorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAutoPredictorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1194,44 +1194,6 @@ export const de_CreateAutoPredictorCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAutoPredictorCommandError - */ -const de_CreateAutoPredictorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.forecast#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDatasetCommand */ @@ -1240,7 +1202,7 @@ export const de_CreateDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDatasetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1252,38 +1214,6 @@ export const de_CreateDatasetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDatasetCommandError - */ -const de_CreateDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.forecast#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDatasetGroupCommand */ @@ -1292,7 +1222,7 @@ export const de_CreateDatasetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDatasetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1304,44 +1234,6 @@ export const de_CreateDatasetGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDatasetGroupCommandError - */ -const de_CreateDatasetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.forecast#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDatasetImportJobCommand */ @@ -1350,7 +1242,7 @@ export const de_CreateDatasetImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDatasetImportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1362,44 +1254,6 @@ export const de_CreateDatasetImportJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDatasetImportJobCommandError - */ -const de_CreateDatasetImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.forecast#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateExplainabilityCommand */ @@ -1408,7 +1262,7 @@ export const de_CreateExplainabilityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateExplainabilityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1420,44 +1274,6 @@ export const de_CreateExplainabilityCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateExplainabilityCommandError - */ -const de_CreateExplainabilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.forecast#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateExplainabilityExportCommand */ @@ -1466,7 +1282,7 @@ export const de_CreateExplainabilityExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateExplainabilityExportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1478,44 +1294,6 @@ export const de_CreateExplainabilityExportCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateExplainabilityExportCommandError - */ -const de_CreateExplainabilityExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.forecast#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateForecastCommand */ @@ -1524,7 +1302,7 @@ export const de_CreateForecastCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateForecastCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1537,57 +1315,39 @@ export const de_CreateForecastCommand = async ( }; /** - * deserializeAws_json1_1CreateForecastCommandError + * deserializeAws_json1_1CreateForecastExportJobCommand */ -const de_CreateForecastCommandError = async ( +export const de_CreateForecastExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.forecast#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateForecastExportJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateForecastExportJobCommand + * deserializeAws_json1_1CreateMonitorCommand */ -export const de_CreateForecastExportJobCommand = async ( +export const de_CreateMonitorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateForecastExportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateForecastExportJobCommandOutput = { + const response: CreateMonitorCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1595,110 +1355,14 @@ export const de_CreateForecastExportJobCommand = async ( }; /** - * deserializeAws_json1_1CreateForecastExportJobCommandError + * deserializeAws_json1_1CreatePredictorCommand */ -const de_CreateForecastExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.forecast#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateMonitorCommand - */ -export const de_CreateMonitorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateMonitorCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateMonitorCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateMonitorCommandError - */ -const de_CreateMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.forecast#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreatePredictorCommand - */ -export const de_CreatePredictorCommand = async ( +export const de_CreatePredictorCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePredictorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1710,44 +1374,6 @@ export const de_CreatePredictorCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePredictorCommandError - */ -const de_CreatePredictorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.forecast#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePredictorBacktestExportJobCommand */ @@ -1756,7 +1382,7 @@ export const de_CreatePredictorBacktestExportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePredictorBacktestExportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1768,44 +1394,6 @@ export const de_CreatePredictorBacktestExportJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePredictorBacktestExportJobCommandError - */ -const de_CreatePredictorBacktestExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.forecast#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateWhatIfAnalysisCommand */ @@ -1814,7 +1402,7 @@ export const de_CreateWhatIfAnalysisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateWhatIfAnalysisCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1826,44 +1414,6 @@ export const de_CreateWhatIfAnalysisCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateWhatIfAnalysisCommandError - */ -const de_CreateWhatIfAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.forecast#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateWhatIfForecastCommand */ @@ -1872,7 +1422,7 @@ export const de_CreateWhatIfForecastCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateWhatIfForecastCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1884,44 +1434,6 @@ export const de_CreateWhatIfForecastCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateWhatIfForecastCommandError - */ -const de_CreateWhatIfForecastCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.forecast#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateWhatIfForecastExportCommand */ @@ -1930,7 +1442,7 @@ export const de_CreateWhatIfForecastExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateWhatIfForecastExportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1943,1429 +1455,257 @@ export const de_CreateWhatIfForecastExportCommand = async ( }; /** - * deserializeAws_json1_1CreateWhatIfForecastExportCommandError + * deserializeAws_json1_1DeleteDatasetCommand */ -const de_CreateWhatIfForecastExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.forecast#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDatasetCommand - */ -export const de_DeleteDatasetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDatasetCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteDatasetCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDatasetCommandError - */ -const de_DeleteDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDatasetGroupCommand - */ -export const de_DeleteDatasetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDatasetGroupCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteDatasetGroupCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDatasetGroupCommandError - */ -const de_DeleteDatasetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDatasetImportJobCommand - */ -export const de_DeleteDatasetImportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDatasetImportJobCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteDatasetImportJobCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDatasetImportJobCommandError - */ -const de_DeleteDatasetImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteExplainabilityCommand - */ -export const de_DeleteExplainabilityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteExplainabilityCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteExplainabilityCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteExplainabilityCommandError - */ -const de_DeleteExplainabilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteExplainabilityExportCommand - */ -export const de_DeleteExplainabilityExportCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteExplainabilityExportCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteExplainabilityExportCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteExplainabilityExportCommandError - */ -const de_DeleteExplainabilityExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteForecastCommand - */ -export const de_DeleteForecastCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteForecastCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteForecastCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteForecastCommandError - */ -const de_DeleteForecastCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteForecastExportJobCommand - */ -export const de_DeleteForecastExportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteForecastExportJobCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteForecastExportJobCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteForecastExportJobCommandError - */ -const de_DeleteForecastExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteMonitorCommand - */ -export const de_DeleteMonitorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteMonitorCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteMonitorCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteMonitorCommandError - */ -const de_DeleteMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeletePredictorCommand - */ -export const de_DeletePredictorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeletePredictorCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeletePredictorCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeletePredictorCommandError - */ -const de_DeletePredictorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeletePredictorBacktestExportJobCommand - */ -export const de_DeletePredictorBacktestExportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeletePredictorBacktestExportJobCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeletePredictorBacktestExportJobCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeletePredictorBacktestExportJobCommandError - */ -const de_DeletePredictorBacktestExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteResourceTreeCommand - */ -export const de_DeleteResourceTreeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteResourceTreeCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteResourceTreeCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteResourceTreeCommandError - */ -const de_DeleteResourceTreeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteWhatIfAnalysisCommand - */ -export const de_DeleteWhatIfAnalysisCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteWhatIfAnalysisCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteWhatIfAnalysisCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteWhatIfAnalysisCommandError - */ -const de_DeleteWhatIfAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteWhatIfForecastCommand - */ -export const de_DeleteWhatIfForecastCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteWhatIfForecastCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteWhatIfForecastCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteWhatIfForecastCommandError - */ -const de_DeleteWhatIfForecastCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteWhatIfForecastExportCommand - */ -export const de_DeleteWhatIfForecastExportCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteWhatIfForecastExportCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteWhatIfForecastExportCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteWhatIfForecastExportCommandError - */ -const de_DeleteWhatIfForecastExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAutoPredictorCommand - */ -export const de_DescribeAutoPredictorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAutoPredictorCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeAutoPredictorResponse(data, context); - const response: DescribeAutoPredictorCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAutoPredictorCommandError - */ -const de_DescribeAutoPredictorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDatasetCommand - */ -export const de_DescribeDatasetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDatasetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeDatasetResponse(data, context); - const response: DescribeDatasetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeDatasetCommandError - */ -const de_DescribeDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDatasetGroupCommand - */ -export const de_DescribeDatasetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDatasetGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeDatasetGroupResponse(data, context); - const response: DescribeDatasetGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeDatasetGroupCommandError - */ -const de_DescribeDatasetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDatasetImportJobCommand - */ -export const de_DescribeDatasetImportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDatasetImportJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeDatasetImportJobResponse(data, context); - const response: DescribeDatasetImportJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeDatasetImportJobCommandError - */ -const de_DescribeDatasetImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeExplainabilityCommand - */ -export const de_DescribeExplainabilityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeExplainabilityCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeExplainabilityResponse(data, context); - const response: DescribeExplainabilityCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeExplainabilityCommandError - */ -const de_DescribeExplainabilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeExplainabilityExportCommand - */ -export const de_DescribeExplainabilityExportCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeExplainabilityExportCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeExplainabilityExportResponse(data, context); - const response: DescribeExplainabilityExportCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeExplainabilityExportCommandError - */ -const de_DescribeExplainabilityExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeForecastCommand - */ -export const de_DescribeForecastCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeForecastCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeForecastResponse(data, context); - const response: DescribeForecastCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeForecastCommandError - */ -const de_DescribeForecastCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeForecastExportJobCommand - */ -export const de_DescribeForecastExportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeForecastExportJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeForecastExportJobResponse(data, context); - const response: DescribeForecastExportJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeForecastExportJobCommandError - */ -const de_DescribeForecastExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_DeleteDatasetCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteDatasetCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DescribeMonitorCommand + * deserializeAws_json1_1DeleteDatasetGroupCommand */ -export const de_DescribeMonitorCommand = async ( +export const de_DeleteDatasetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeMonitorCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeMonitorResponse(data, context); - const response: DescribeMonitorCommandOutput = { + await collectBody(output.body, context); + const response: DeleteDatasetGroupCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1DescribeMonitorCommandError + * deserializeAws_json1_1DeleteDatasetImportJobCommand */ -const de_DescribeMonitorCommandError = async ( +export const de_DeleteDatasetImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteDatasetImportJobCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DescribePredictorCommand + * deserializeAws_json1_1DeleteExplainabilityCommand */ -export const de_DescribePredictorCommand = async ( +export const de_DeleteExplainabilityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribePredictorCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribePredictorResponse(data, context); - const response: DescribePredictorCommandOutput = { + await collectBody(output.body, context); + const response: DeleteExplainabilityCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1DescribePredictorCommandError + * deserializeAws_json1_1DeleteExplainabilityExportCommand */ -const de_DescribePredictorCommandError = async ( +export const de_DeleteExplainabilityExportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteExplainabilityExportCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DescribePredictorBacktestExportJobCommand + * deserializeAws_json1_1DeleteForecastCommand */ -export const de_DescribePredictorBacktestExportJobCommand = async ( +export const de_DeleteForecastCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribePredictorBacktestExportJobCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribePredictorBacktestExportJobResponse(data, context); - const response: DescribePredictorBacktestExportJobCommandOutput = { + await collectBody(output.body, context); + const response: DeleteForecastCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1DescribePredictorBacktestExportJobCommandError + * deserializeAws_json1_1DeleteForecastExportJobCommand */ -const de_DescribePredictorBacktestExportJobCommandError = async ( +export const de_DeleteForecastExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteForecastExportJobCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DescribeWhatIfAnalysisCommand + * deserializeAws_json1_1DeleteMonitorCommand */ -export const de_DescribeWhatIfAnalysisCommand = async ( +export const de_DeleteMonitorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeWhatIfAnalysisCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeWhatIfAnalysisResponse(data, context); - const response: DescribeWhatIfAnalysisCommandOutput = { + await collectBody(output.body, context); + const response: DeleteMonitorCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1DescribeWhatIfAnalysisCommandError + * deserializeAws_json1_1DeletePredictorCommand */ -const de_DescribeWhatIfAnalysisCommandError = async ( +export const de_DeletePredictorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeletePredictorCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DescribeWhatIfForecastCommand + * deserializeAws_json1_1DeletePredictorBacktestExportJobCommand */ -export const de_DescribeWhatIfForecastCommand = async ( +export const de_DeletePredictorBacktestExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeWhatIfForecastCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeWhatIfForecastResponse(data, context); - const response: DescribeWhatIfForecastCommandOutput = { + await collectBody(output.body, context); + const response: DeletePredictorBacktestExportJobCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1DescribeWhatIfForecastCommandError + * deserializeAws_json1_1DeleteResourceTreeCommand */ -const de_DescribeWhatIfForecastCommandError = async ( +export const de_DeleteResourceTreeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteResourceTreeCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DescribeWhatIfForecastExportCommand + * deserializeAws_json1_1DeleteWhatIfAnalysisCommand */ -export const de_DescribeWhatIfForecastExportCommand = async ( +export const de_DeleteWhatIfAnalysisCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeWhatIfForecastExportCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeWhatIfForecastExportResponse(data, context); - const response: DescribeWhatIfForecastExportCommandOutput = { + await collectBody(output.body, context); + const response: DeleteWhatIfAnalysisCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1DescribeWhatIfForecastExportCommandError + * deserializeAws_json1_1DeleteWhatIfForecastCommand */ -const de_DescribeWhatIfForecastExportCommandError = async ( +export const de_DeleteWhatIfForecastCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeleteWhatIfForecastCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DeleteWhatIfForecastExportCommand + */ +export const de_DeleteWhatIfForecastExportCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteWhatIfForecastExportCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1GetAccuracyMetricsCommand + * deserializeAws_json1_1DescribeAutoPredictorCommand */ -export const de_GetAccuracyMetricsCommand = async ( +export const de_DescribeAutoPredictorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetAccuracyMetricsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetAccuracyMetricsResponse(data, context); - const response: GetAccuracyMetricsCommandOutput = { + contents = de_DescribeAutoPredictorResponse(data, context); + const response: DescribeAutoPredictorCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3373,51 +1713,39 @@ export const de_GetAccuracyMetricsCommand = async ( }; /** - * deserializeAws_json1_1GetAccuracyMetricsCommandError + * deserializeAws_json1_1DescribeDatasetCommand */ -const de_GetAccuracyMetricsCommandError = async ( +export const de_DescribeDatasetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDatasetResponse(data, context); + const response: DescribeDatasetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListDatasetGroupsCommand + * deserializeAws_json1_1DescribeDatasetGroupCommand */ -export const de_ListDatasetGroupsCommand = async ( +export const de_DescribeDatasetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDatasetGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListDatasetGroupsResponse(data, context); - const response: ListDatasetGroupsCommandOutput = { + contents = de_DescribeDatasetGroupResponse(data, context); + const response: DescribeDatasetGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3425,45 +1753,39 @@ export const de_ListDatasetGroupsCommand = async ( }; /** - * deserializeAws_json1_1ListDatasetGroupsCommandError + * deserializeAws_json1_1DescribeDatasetImportJobCommand */ -const de_ListDatasetGroupsCommandError = async ( +export const de_DescribeDatasetImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.forecast#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDatasetImportJobResponse(data, context); + const response: DescribeDatasetImportJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListDatasetImportJobsCommand + * deserializeAws_json1_1DescribeExplainabilityCommand */ -export const de_ListDatasetImportJobsCommand = async ( +export const de_DescribeExplainabilityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDatasetImportJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListDatasetImportJobsResponse(data, context); - const response: ListDatasetImportJobsCommandOutput = { + contents = de_DescribeExplainabilityResponse(data, context); + const response: DescribeExplainabilityCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3471,48 +1793,39 @@ export const de_ListDatasetImportJobsCommand = async ( }; /** - * deserializeAws_json1_1ListDatasetImportJobsCommandError + * deserializeAws_json1_1DescribeExplainabilityExportCommand */ -const de_ListDatasetImportJobsCommandError = async ( +export const de_DescribeExplainabilityExportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.forecast#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeExplainabilityExportResponse(data, context); + const response: DescribeExplainabilityExportCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListDatasetsCommand + * deserializeAws_json1_1DescribeForecastCommand */ -export const de_ListDatasetsCommand = async ( +export const de_DescribeForecastCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDatasetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListDatasetsResponse(data, context); - const response: ListDatasetsCommandOutput = { + contents = de_DescribeForecastResponse(data, context); + const response: DescribeForecastCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3520,45 +1833,39 @@ export const de_ListDatasetsCommand = async ( }; /** - * deserializeAws_json1_1ListDatasetsCommandError + * deserializeAws_json1_1DescribeForecastExportJobCommand */ -const de_ListDatasetsCommandError = async ( +export const de_DescribeForecastExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.forecast#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeForecastExportJobResponse(data, context); + const response: DescribeForecastExportJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListExplainabilitiesCommand + * deserializeAws_json1_1DescribeMonitorCommand */ -export const de_ListExplainabilitiesCommand = async ( +export const de_DescribeMonitorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListExplainabilitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListExplainabilitiesResponse(data, context); - const response: ListExplainabilitiesCommandOutput = { + contents = de_DescribeMonitorResponse(data, context); + const response: DescribeMonitorCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3566,48 +1873,39 @@ export const de_ListExplainabilitiesCommand = async ( }; /** - * deserializeAws_json1_1ListExplainabilitiesCommandError + * deserializeAws_json1_1DescribePredictorCommand */ -const de_ListExplainabilitiesCommandError = async ( +export const de_DescribePredictorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.forecast#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribePredictorResponse(data, context); + const response: DescribePredictorCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListExplainabilityExportsCommand + * deserializeAws_json1_1DescribePredictorBacktestExportJobCommand */ -export const de_ListExplainabilityExportsCommand = async ( +export const de_DescribePredictorBacktestExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListExplainabilityExportsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListExplainabilityExportsResponse(data, context); - const response: ListExplainabilityExportsCommandOutput = { + contents = de_DescribePredictorBacktestExportJobResponse(data, context); + const response: DescribePredictorBacktestExportJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3615,48 +1913,39 @@ export const de_ListExplainabilityExportsCommand = async ( }; /** - * deserializeAws_json1_1ListExplainabilityExportsCommandError + * deserializeAws_json1_1DescribeWhatIfAnalysisCommand */ -const de_ListExplainabilityExportsCommandError = async ( +export const de_DescribeWhatIfAnalysisCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.forecast#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeWhatIfAnalysisResponse(data, context); + const response: DescribeWhatIfAnalysisCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListForecastExportJobsCommand + * deserializeAws_json1_1DescribeWhatIfForecastCommand */ -export const de_ListForecastExportJobsCommand = async ( +export const de_DescribeWhatIfForecastCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListForecastExportJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListForecastExportJobsResponse(data, context); - const response: ListForecastExportJobsCommandOutput = { + contents = de_DescribeWhatIfForecastResponse(data, context); + const response: DescribeWhatIfForecastCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3664,48 +1953,39 @@ export const de_ListForecastExportJobsCommand = async ( }; /** - * deserializeAws_json1_1ListForecastExportJobsCommandError + * deserializeAws_json1_1DescribeWhatIfForecastExportCommand */ -const de_ListForecastExportJobsCommandError = async ( +export const de_DescribeWhatIfForecastExportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.forecast#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeWhatIfForecastExportResponse(data, context); + const response: DescribeWhatIfForecastExportCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListForecastsCommand + * deserializeAws_json1_1GetAccuracyMetricsCommand */ -export const de_ListForecastsCommand = async ( +export const de_GetAccuracyMetricsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListForecastsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListForecastsResponse(data, context); - const response: ListForecastsCommandOutput = { + contents = de_GetAccuracyMetricsResponse(data, context); + const response: GetAccuracyMetricsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3713,48 +1993,39 @@ export const de_ListForecastsCommand = async ( }; /** - * deserializeAws_json1_1ListForecastsCommandError + * deserializeAws_json1_1ListDatasetGroupsCommand */ -const de_ListForecastsCommandError = async ( +export const de_ListDatasetGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.forecast#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDatasetGroupsResponse(data, context); + const response: ListDatasetGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListMonitorEvaluationsCommand + * deserializeAws_json1_1ListDatasetImportJobsCommand */ -export const de_ListMonitorEvaluationsCommand = async ( +export const de_ListDatasetImportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListMonitorEvaluationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListMonitorEvaluationsResponse(data, context); - const response: ListMonitorEvaluationsCommandOutput = { + contents = de_ListDatasetImportJobsResponse(data, context); + const response: ListDatasetImportJobsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3762,51 +2033,39 @@ export const de_ListMonitorEvaluationsCommand = async ( }; /** - * deserializeAws_json1_1ListMonitorEvaluationsCommandError + * deserializeAws_json1_1ListDatasetsCommand */ -const de_ListMonitorEvaluationsCommandError = async ( +export const de_ListDatasetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.forecast#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDatasetsResponse(data, context); + const response: ListDatasetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListMonitorsCommand + * deserializeAws_json1_1ListExplainabilitiesCommand */ -export const de_ListMonitorsCommand = async ( +export const de_ListExplainabilitiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListMonitorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListMonitorsResponse(data, context); - const response: ListMonitorsCommandOutput = { + contents = de_ListExplainabilitiesResponse(data, context); + const response: ListExplainabilitiesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3814,48 +2073,39 @@ export const de_ListMonitorsCommand = async ( }; /** - * deserializeAws_json1_1ListMonitorsCommandError + * deserializeAws_json1_1ListExplainabilityExportsCommand */ -const de_ListMonitorsCommandError = async ( +export const de_ListExplainabilityExportsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.forecast#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListExplainabilityExportsResponse(data, context); + const response: ListExplainabilityExportsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListPredictorBacktestExportJobsCommand + * deserializeAws_json1_1ListForecastExportJobsCommand */ -export const de_ListPredictorBacktestExportJobsCommand = async ( +export const de_ListForecastExportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListPredictorBacktestExportJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListPredictorBacktestExportJobsResponse(data, context); - const response: ListPredictorBacktestExportJobsCommandOutput = { + contents = de_ListForecastExportJobsResponse(data, context); + const response: ListForecastExportJobsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3863,48 +2113,39 @@ export const de_ListPredictorBacktestExportJobsCommand = async ( }; /** - * deserializeAws_json1_1ListPredictorBacktestExportJobsCommandError + * deserializeAws_json1_1ListForecastsCommand */ -const de_ListPredictorBacktestExportJobsCommandError = async ( +export const de_ListForecastsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.forecast#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListForecastsResponse(data, context); + const response: ListForecastsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListPredictorsCommand + * deserializeAws_json1_1ListMonitorEvaluationsCommand */ -export const de_ListPredictorsCommand = async ( +export const de_ListMonitorEvaluationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListPredictorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListPredictorsResponse(data, context); - const response: ListPredictorsCommandOutput = { + contents = de_ListMonitorEvaluationsResponse(data, context); + const response: ListMonitorEvaluationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3912,48 +2153,59 @@ export const de_ListPredictorsCommand = async ( }; /** - * deserializeAws_json1_1ListPredictorsCommandError + * deserializeAws_json1_1ListMonitorsCommand */ -const de_ListPredictorsCommandError = async ( +export const de_ListMonitorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListMonitorsResponse(data, context); + const response: ListMonitorsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.forecast#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1ListPredictorBacktestExportJobsCommand + */ +export const de_ListPredictorBacktestExportJobsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListPredictorBacktestExportJobsResponse(data, context); + const response: ListPredictorBacktestExportJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1ListPredictorsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListPredictorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_ListPredictorsResponse(data, context); + const response: ListPredictorsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3961,32 +2213,23 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3997,7 +2240,7 @@ export const de_ListWhatIfAnalysesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListWhatIfAnalysesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4009,35 +2252,6 @@ export const de_ListWhatIfAnalysesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListWhatIfAnalysesCommandError - */ -const de_ListWhatIfAnalysesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.forecast#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListWhatIfForecastExportsCommand */ @@ -4046,7 +2260,7 @@ export const de_ListWhatIfForecastExportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListWhatIfForecastExportsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4058,35 +2272,6 @@ export const de_ListWhatIfForecastExportsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListWhatIfForecastExportsCommandError - */ -const de_ListWhatIfForecastExportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.forecast#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListWhatIfForecastsCommand */ @@ -4095,7 +2280,7 @@ export const de_ListWhatIfForecastsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListWhatIfForecastsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4107,35 +2292,6 @@ export const de_ListWhatIfForecastsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListWhatIfForecastsCommandError - */ -const de_ListWhatIfForecastsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.forecast#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ResumeResourceCommand */ @@ -4144,7 +2300,7 @@ export const de_ResumeResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResumeResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ResumeResourceCommandOutput = { @@ -4153,41 +2309,6 @@ export const de_ResumeResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ResumeResourceCommandError - */ -const de_ResumeResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecast#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopResourceCommand */ @@ -4196,7 +2317,7 @@ export const de_StopResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopResourceCommandOutput = { @@ -4205,38 +2326,6 @@ export const de_StopResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopResourceCommandError - */ -const de_StopResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -4245,7 +2334,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4257,38 +2346,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecast#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -4297,7 +2354,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4309,35 +2366,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecast#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecast#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDatasetGroupCommand */ @@ -4346,7 +2374,7 @@ export const de_UpdateDatasetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDatasetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4359,12 +2387,9 @@ export const de_UpdateDatasetGroupCommand = async ( }; /** - * deserializeAws_json1_1UpdateDatasetGroupCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateDatasetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4374,19 +2399,28 @@ const de_UpdateDatasetGroupCommandError = async ( case "InvalidInputException": case "com.amazonaws.forecast#InvalidInputException": throw await de_InvalidInputExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.forecast#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.forecast#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); case "ResourceInUseException": case "com.amazonaws.forecast#ResourceInUseException": throw await de_ResourceInUseExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.forecast#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.forecast#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-forecastquery/src/protocols/Aws_json1_1.ts b/clients/client-forecastquery/src/protocols/Aws_json1_1.ts index fde686c3d128..abf81bb5a39c 100644 --- a/clients/client-forecastquery/src/protocols/Aws_json1_1.ts +++ b/clients/client-forecastquery/src/protocols/Aws_json1_1.ts @@ -70,7 +70,7 @@ export const de_QueryForecastCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_QueryForecastCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -82,44 +82,6 @@ export const de_QueryForecastCommand = async ( return response; }; -/** - * deserializeAws_json1_1QueryForecastCommandError - */ -const de_QueryForecastCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.forecastquery#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.forecastquery#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.forecastquery#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.forecastquery#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.forecastquery#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1QueryWhatIfForecastCommand */ @@ -128,7 +90,7 @@ export const de_QueryWhatIfForecastCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_QueryWhatIfForecastCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -141,12 +103,9 @@ export const de_QueryWhatIfForecastCommand = async ( }; /** - * deserializeAws_json1_1QueryWhatIfForecastCommandError + * deserialize_Aws_json1_1CommandError */ -const de_QueryWhatIfForecastCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -174,7 +133,7 @@ const de_QueryWhatIfForecastCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-frauddetector/src/protocols/Aws_json1_1.ts b/clients/client-frauddetector/src/protocols/Aws_json1_1.ts index 8b7f12e0ba2c..16072e2b2135 100644 --- a/clients/client-frauddetector/src/protocols/Aws_json1_1.ts +++ b/clients/client-frauddetector/src/protocols/Aws_json1_1.ts @@ -1242,7 +1242,7 @@ export const de_BatchCreateVariableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchCreateVariableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1254,41 +1254,6 @@ export const de_BatchCreateVariableCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchCreateVariableCommandError - */ -const de_BatchCreateVariableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetVariableCommand */ @@ -1297,7 +1262,7 @@ export const de_BatchGetVariableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetVariableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1309,41 +1274,6 @@ export const de_BatchGetVariableCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetVariableCommandError - */ -const de_BatchGetVariableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelBatchImportJobCommand */ @@ -1352,7 +1282,7 @@ export const de_CancelBatchImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelBatchImportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1364,44 +1294,6 @@ export const de_CancelBatchImportJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelBatchImportJobCommandError - */ -const de_CancelBatchImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelBatchPredictionJobCommand */ @@ -1410,7 +1302,7 @@ export const de_CancelBatchPredictionJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelBatchPredictionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1422,44 +1314,6 @@ export const de_CancelBatchPredictionJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelBatchPredictionJobCommandError - */ -const de_CancelBatchPredictionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateBatchImportJobCommand */ @@ -1468,7 +1322,7 @@ export const de_CreateBatchImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBatchImportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1480,44 +1334,6 @@ export const de_CreateBatchImportJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateBatchImportJobCommandError - */ -const de_CreateBatchImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateBatchPredictionJobCommand */ @@ -1526,7 +1342,7 @@ export const de_CreateBatchPredictionJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBatchPredictionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1538,44 +1354,6 @@ export const de_CreateBatchPredictionJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateBatchPredictionJobCommandError - */ -const de_CreateBatchPredictionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDetectorVersionCommand */ @@ -1584,7 +1362,7 @@ export const de_CreateDetectorVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDetectorVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1597,57 +1375,39 @@ export const de_CreateDetectorVersionCommand = async ( }; /** - * deserializeAws_json1_1CreateDetectorVersionCommandError + * deserializeAws_json1_1CreateListCommand */ -const de_CreateDetectorVersionCommandError = async ( +export const de_CreateListCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateListCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateListCommand + * deserializeAws_json1_1CreateModelCommand */ -export const de_CreateListCommand = async ( +export const de_CreateModelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateListCommandOutput = { + const response: CreateModelCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1655,104 +1415,14 @@ export const de_CreateListCommand = async ( }; /** - * deserializeAws_json1_1CreateListCommandError + * deserializeAws_json1_1CreateModelVersionCommand */ -const de_CreateListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateModelCommand - */ -export const de_CreateModelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateModelCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateModelCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateModelCommandError - */ -const de_CreateModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateModelVersionCommand - */ -export const de_CreateModelVersionCommand = async ( +export const de_CreateModelVersionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateModelVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1764,44 +1434,6 @@ export const de_CreateModelVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateModelVersionCommandError - */ -const de_CreateModelVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateRuleCommand */ @@ -1810,7 +1442,7 @@ export const de_CreateRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1822,41 +1454,6 @@ export const de_CreateRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateRuleCommandError - */ -const de_CreateRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateVariableCommand */ @@ -1865,7 +1462,7 @@ export const de_CreateVariableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVariableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1877,41 +1474,6 @@ export const de_CreateVariableCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateVariableCommandError - */ -const de_CreateVariableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteBatchImportJobCommand */ @@ -1920,7 +1482,7 @@ export const de_DeleteBatchImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteBatchImportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1932,41 +1494,6 @@ export const de_DeleteBatchImportJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteBatchImportJobCommandError - */ -const de_DeleteBatchImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteBatchPredictionJobCommand */ @@ -1975,7 +1502,7 @@ export const de_DeleteBatchPredictionJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteBatchPredictionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1987,41 +1514,6 @@ export const de_DeleteBatchPredictionJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteBatchPredictionJobCommandError - */ -const de_DeleteBatchPredictionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteDetectorCommand */ @@ -2030,7 +1522,7 @@ export const de_DeleteDetectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDetectorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2043,52 +1535,14 @@ export const de_DeleteDetectorCommand = async ( }; /** - * deserializeAws_json1_1DeleteDetectorCommandError + * deserializeAws_json1_1DeleteDetectorVersionCommand */ -const de_DeleteDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDetectorVersionCommand - */ -export const de_DeleteDetectorVersionCommand = async ( +export const de_DeleteDetectorVersionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDetectorVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2100,47 +1554,6 @@ export const de_DeleteDetectorVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteDetectorVersionCommandError - */ -const de_DeleteDetectorVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteEntityTypeCommand */ @@ -2149,7 +1562,7 @@ export const de_DeleteEntityTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEntityTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2161,44 +1574,6 @@ export const de_DeleteEntityTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteEntityTypeCommandError - */ -const de_DeleteEntityTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteEventCommand */ @@ -2207,7 +1582,7 @@ export const de_DeleteEventCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEventCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2219,41 +1594,6 @@ export const de_DeleteEventCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteEventCommandError - */ -const de_DeleteEventCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteEventsByEventTypeCommand */ @@ -2262,7 +1602,7 @@ export const de_DeleteEventsByEventTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEventsByEventTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2274,47 +1614,6 @@ export const de_DeleteEventsByEventTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteEventsByEventTypeCommandError - */ -const de_DeleteEventsByEventTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteEventTypeCommand */ @@ -2323,7 +1622,7 @@ export const de_DeleteEventTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEventTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2335,44 +1634,6 @@ export const de_DeleteEventTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteEventTypeCommandError - */ -const de_DeleteEventTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteExternalModelCommand */ @@ -2381,7 +1642,7 @@ export const de_DeleteExternalModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteExternalModelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2394,57 +1655,39 @@ export const de_DeleteExternalModelCommand = async ( }; /** - * deserializeAws_json1_1DeleteExternalModelCommandError + * deserializeAws_json1_1DeleteLabelCommand */ -const de_DeleteExternalModelCommandError = async ( +export const de_DeleteLabelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteLabelCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteLabelCommand + * deserializeAws_json1_1DeleteListCommand */ -export const de_DeleteLabelCommand = async ( +export const de_DeleteListCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteLabelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteLabelCommandOutput = { + const response: DeleteListCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2452,54 +1695,39 @@ export const de_DeleteLabelCommand = async ( }; /** - * deserializeAws_json1_1DeleteLabelCommandError + * deserializeAws_json1_1DeleteModelCommand */ -const de_DeleteLabelCommandError = async ( +export const de_DeleteModelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteModelCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteListCommand + * deserializeAws_json1_1DeleteModelVersionCommand */ -export const de_DeleteListCommand = async ( +export const de_DeleteModelVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteListCommandOutput = { + const response: DeleteModelVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2507,57 +1735,39 @@ export const de_DeleteListCommand = async ( }; /** - * deserializeAws_json1_1DeleteListCommandError + * deserializeAws_json1_1DeleteOutcomeCommand */ -const de_DeleteListCommandError = async ( +export const de_DeleteOutcomeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteOutcomeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteModelCommand + * deserializeAws_json1_1DeleteRuleCommand */ -export const de_DeleteModelCommand = async ( +export const de_DeleteRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteModelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteModelCommandOutput = { + const response: DeleteRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2565,57 +1775,39 @@ export const de_DeleteModelCommand = async ( }; /** - * deserializeAws_json1_1DeleteModelCommandError + * deserializeAws_json1_1DeleteVariableCommand */ -const de_DeleteModelCommandError = async ( +export const de_DeleteVariableCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteVariableCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteModelVersionCommand + * deserializeAws_json1_1DescribeDetectorCommand */ -export const de_DeleteModelVersionCommand = async ( +export const de_DescribeDetectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteModelVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteModelVersionCommandOutput = { + const response: DescribeDetectorCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2623,57 +1815,39 @@ export const de_DeleteModelVersionCommand = async ( }; /** - * deserializeAws_json1_1DeleteModelVersionCommandError + * deserializeAws_json1_1DescribeModelVersionsCommand */ -const de_DeleteModelVersionCommandError = async ( +export const de_DescribeModelVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeModelVersionsResult(data, context); + const response: DescribeModelVersionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteOutcomeCommand + * deserializeAws_json1_1GetBatchImportJobsCommand */ -export const de_DeleteOutcomeCommand = async ( +export const de_GetBatchImportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteOutcomeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteOutcomeCommandOutput = { + const response: GetBatchImportJobsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2681,57 +1855,39 @@ export const de_DeleteOutcomeCommand = async ( }; /** - * deserializeAws_json1_1DeleteOutcomeCommandError + * deserializeAws_json1_1GetBatchPredictionJobsCommand */ -const de_DeleteOutcomeCommandError = async ( +export const de_GetBatchPredictionJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetBatchPredictionJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRuleCommand + * deserializeAws_json1_1GetDeleteEventsByEventTypeStatusCommand */ -export const de_DeleteRuleCommand = async ( +export const de_GetDeleteEventsByEventTypeStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRuleCommandOutput = { + const response: GetDeleteEventsByEventTypeStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2739,1449 +1895,39 @@ export const de_DeleteRuleCommand = async ( }; /** - * deserializeAws_json1_1DeleteRuleCommandError + * deserializeAws_json1_1GetDetectorsCommand */ -const de_DeleteRuleCommandError = async ( +export const de_GetDetectorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetDetectorsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteVariableCommand - */ -export const de_DeleteVariableCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteVariableCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteVariableCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteVariableCommandError - */ -const de_DeleteVariableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDetectorCommand - */ -export const de_DescribeDetectorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDetectorCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeDetectorCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeDetectorCommandError - */ -const de_DescribeDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeModelVersionsCommand - */ -export const de_DescribeModelVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeModelVersionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeModelVersionsResult(data, context); - const response: DescribeModelVersionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeModelVersionsCommandError - */ -const de_DescribeModelVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetBatchImportJobsCommand - */ -export const de_GetBatchImportJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetBatchImportJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetBatchImportJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetBatchImportJobsCommandError - */ -const de_GetBatchImportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetBatchPredictionJobsCommand - */ -export const de_GetBatchPredictionJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetBatchPredictionJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetBatchPredictionJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetBatchPredictionJobsCommandError - */ -const de_GetBatchPredictionJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDeleteEventsByEventTypeStatusCommand - */ -export const de_GetDeleteEventsByEventTypeStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDeleteEventsByEventTypeStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetDeleteEventsByEventTypeStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDeleteEventsByEventTypeStatusCommandError - */ -const de_GetDeleteEventsByEventTypeStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDetectorsCommand - */ -export const de_GetDetectorsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDetectorsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetDetectorsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDetectorsCommandError - */ -const de_GetDetectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDetectorVersionCommand - */ -export const de_GetDetectorVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDetectorVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetDetectorVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDetectorVersionCommandError - */ -const de_GetDetectorVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetEntityTypesCommand - */ -export const de_GetEntityTypesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetEntityTypesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetEntityTypesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetEntityTypesCommandError - */ -const de_GetEntityTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetEventCommand - */ -export const de_GetEventCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetEventCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetEventCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetEventCommandError - */ -const de_GetEventCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetEventPredictionCommand - */ -export const de_GetEventPredictionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetEventPredictionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetEventPredictionResult(data, context); - const response: GetEventPredictionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetEventPredictionCommandError - */ -const de_GetEventPredictionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.frauddetector#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetEventPredictionMetadataCommand - */ -export const de_GetEventPredictionMetadataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetEventPredictionMetadataCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetEventPredictionMetadataResult(data, context); - const response: GetEventPredictionMetadataCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetEventPredictionMetadataCommandError - */ -const de_GetEventPredictionMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetEventTypesCommand - */ -export const de_GetEventTypesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetEventTypesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetEventTypesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetEventTypesCommandError - */ -const de_GetEventTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetExternalModelsCommand - */ -export const de_GetExternalModelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetExternalModelsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetExternalModelsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetExternalModelsCommandError - */ -const de_GetExternalModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetKMSEncryptionKeyCommand - */ -export const de_GetKMSEncryptionKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetKMSEncryptionKeyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetKMSEncryptionKeyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetKMSEncryptionKeyCommandError - */ -const de_GetKMSEncryptionKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLabelsCommand - */ -export const de_GetLabelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLabelsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetLabelsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetLabelsCommandError - */ -const de_GetLabelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetListElementsCommand - */ -export const de_GetListElementsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetListElementsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetListElementsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetListElementsCommandError - */ -const de_GetListElementsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetListsMetadataCommand - */ -export const de_GetListsMetadataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetListsMetadataCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetListsMetadataCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetListsMetadataCommandError - */ -const de_GetListsMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetModelsCommand - */ -export const de_GetModelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetModelsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetModelsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetModelsCommandError - */ -const de_GetModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetModelVersionCommand - */ -export const de_GetModelVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetModelVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetModelVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetModelVersionCommandError - */ -const de_GetModelVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetOutcomesCommand - */ -export const de_GetOutcomesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetOutcomesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetOutcomesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetOutcomesCommandError - */ -const de_GetOutcomesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRulesCommand - */ -export const de_GetRulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRulesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetRulesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRulesCommandError - */ -const de_GetRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetVariablesCommand - */ -export const de_GetVariablesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetVariablesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetVariablesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetVariablesCommandError - */ -const de_GetVariablesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListEventPredictionsCommand - */ -export const de_ListEventPredictionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListEventPredictionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListEventPredictionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListEventPredictionsCommandError - */ -const de_ListEventPredictionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1GetDetectorVersionCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_GetDetectorVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + const response: GetDetectorVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4189,54 +1935,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1GetEntityTypesCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_GetEntityTypesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetEntityTypesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutDetectorCommand + * deserializeAws_json1_1GetEventCommand */ -export const de_PutDetectorCommand = async ( +export const de_GetEventCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutDetectorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutDetectorCommandOutput = { + const response: GetEventCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4244,57 +1975,39 @@ export const de_PutDetectorCommand = async ( }; /** - * deserializeAws_json1_1PutDetectorCommandError + * deserializeAws_json1_1GetEventPredictionCommand */ -const de_PutDetectorCommandError = async ( +export const de_GetEventPredictionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetEventPredictionResult(data, context); + const response: GetEventPredictionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutEntityTypeCommand + * deserializeAws_json1_1GetEventPredictionMetadataCommand */ -export const de_PutEntityTypeCommand = async ( +export const de_GetEventPredictionMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutEntityTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: PutEntityTypeCommandOutput = { + contents = de_GetEventPredictionMetadataResult(data, context); + const response: GetEventPredictionMetadataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4302,57 +2015,39 @@ export const de_PutEntityTypeCommand = async ( }; /** - * deserializeAws_json1_1PutEntityTypeCommandError + * deserializeAws_json1_1GetEventTypesCommand */ -const de_PutEntityTypeCommandError = async ( +export const de_GetEventTypesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetEventTypesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutEventTypeCommand + * deserializeAws_json1_1GetExternalModelsCommand */ -export const de_PutEventTypeCommand = async ( +export const de_GetExternalModelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutEventTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutEventTypeCommandOutput = { + const response: GetExternalModelsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4360,57 +2055,39 @@ export const de_PutEventTypeCommand = async ( }; /** - * deserializeAws_json1_1PutEventTypeCommandError + * deserializeAws_json1_1GetKMSEncryptionKeyCommand */ -const de_PutEventTypeCommandError = async ( +export const de_GetKMSEncryptionKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetKMSEncryptionKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutExternalModelCommand + * deserializeAws_json1_1GetLabelsCommand */ -export const de_PutExternalModelCommand = async ( +export const de_GetLabelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutExternalModelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutExternalModelCommandOutput = { + const response: GetLabelsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4418,57 +2095,39 @@ export const de_PutExternalModelCommand = async ( }; /** - * deserializeAws_json1_1PutExternalModelCommandError + * deserializeAws_json1_1GetListElementsCommand */ -const de_PutExternalModelCommandError = async ( +export const de_GetListElementsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetListElementsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutKMSEncryptionKeyCommand + * deserializeAws_json1_1GetListsMetadataCommand */ -export const de_PutKMSEncryptionKeyCommand = async ( +export const de_GetListsMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutKMSEncryptionKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutKMSEncryptionKeyCommandOutput = { + const response: GetListsMetadataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4476,60 +2135,39 @@ export const de_PutKMSEncryptionKeyCommand = async ( }; /** - * deserializeAws_json1_1PutKMSEncryptionKeyCommandError + * deserializeAws_json1_1GetModelsCommand */ -const de_PutKMSEncryptionKeyCommandError = async ( +export const de_GetModelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetModelsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutLabelCommand + * deserializeAws_json1_1GetModelVersionCommand */ -export const de_PutLabelCommand = async ( +export const de_GetModelVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutLabelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutLabelCommandOutput = { + const response: GetModelVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4537,57 +2175,39 @@ export const de_PutLabelCommand = async ( }; /** - * deserializeAws_json1_1PutLabelCommandError + * deserializeAws_json1_1GetOutcomesCommand */ -const de_PutLabelCommandError = async ( +export const de_GetOutcomesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetOutcomesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutOutcomeCommand + * deserializeAws_json1_1GetRulesCommand */ -export const de_PutOutcomeCommand = async ( +export const de_GetRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutOutcomeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutOutcomeCommandOutput = { + const response: GetRulesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4595,57 +2215,39 @@ export const de_PutOutcomeCommand = async ( }; /** - * deserializeAws_json1_1PutOutcomeCommandError + * deserializeAws_json1_1GetVariablesCommand */ -const de_PutOutcomeCommandError = async ( +export const de_GetVariablesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetVariablesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SendEventCommand + * deserializeAws_json1_1ListEventPredictionsCommand */ -export const de_SendEventCommand = async ( +export const de_ListEventPredictionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SendEventCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: SendEventCommandOutput = { + const response: ListEventPredictionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4653,60 +2255,39 @@ export const de_SendEventCommand = async ( }; /** - * deserializeAws_json1_1SendEventCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_SendEventCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1PutDetectorCommand */ -export const de_TagResourceCommand = async ( +export const de_PutDetectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: PutDetectorCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4714,54 +2295,59 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1PutEntityTypeCommand */ -const de_TagResourceCommandError = async ( +export const de_PutEntityTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutEntityTypeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1PutEventTypeCommand + */ +export const de_PutEventTypeCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutEventTypeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UntagResourceCommand + * deserializeAws_json1_1PutExternalModelCommand */ -export const de_UntagResourceCommand = async ( +export const de_PutExternalModelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UntagResourceCommandOutput = { + const response: PutExternalModelCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4769,54 +2355,39 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserializeAws_json1_1PutKMSEncryptionKeyCommand */ -const de_UntagResourceCommandError = async ( +export const de_PutKMSEncryptionKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutKMSEncryptionKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateDetectorVersionCommand + * deserializeAws_json1_1PutLabelCommand */ -export const de_UpdateDetectorVersionCommand = async ( +export const de_PutLabelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateDetectorVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateDetectorVersionCommandOutput = { + const response: PutLabelCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4824,60 +2395,39 @@ export const de_UpdateDetectorVersionCommand = async ( }; /** - * deserializeAws_json1_1UpdateDetectorVersionCommandError + * deserializeAws_json1_1PutOutcomeCommand */ -const de_UpdateDetectorVersionCommandError = async ( +export const de_PutOutcomeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutOutcomeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateDetectorVersionMetadataCommand + * deserializeAws_json1_1SendEventCommand */ -export const de_UpdateDetectorVersionMetadataCommand = async ( +export const de_SendEventCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateDetectorVersionMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateDetectorVersionMetadataCommandOutput = { + const response: SendEventCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4885,57 +2435,39 @@ export const de_UpdateDetectorVersionMetadataCommand = async ( }; /** - * deserializeAws_json1_1UpdateDetectorVersionMetadataCommandError + * deserializeAws_json1_1TagResourceCommand */ -const de_UpdateDetectorVersionMetadataCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateDetectorVersionStatusCommand + * deserializeAws_json1_1UntagResourceCommand */ -export const de_UpdateDetectorVersionStatusCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateDetectorVersionStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateDetectorVersionStatusCommandOutput = { + const response: UntagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4943,60 +2475,39 @@ export const de_UpdateDetectorVersionStatusCommand = async ( }; /** - * deserializeAws_json1_1UpdateDetectorVersionStatusCommandError + * deserializeAws_json1_1UpdateDetectorVersionCommand */ -const de_UpdateDetectorVersionStatusCommandError = async ( +export const de_UpdateDetectorVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateDetectorVersionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateEventLabelCommand + * deserializeAws_json1_1UpdateDetectorVersionMetadataCommand */ -export const de_UpdateEventLabelCommand = async ( +export const de_UpdateDetectorVersionMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateEventLabelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateEventLabelCommandOutput = { + const response: UpdateDetectorVersionMetadataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5004,60 +2515,39 @@ export const de_UpdateEventLabelCommand = async ( }; /** - * deserializeAws_json1_1UpdateEventLabelCommandError + * deserializeAws_json1_1UpdateDetectorVersionStatusCommand */ -const de_UpdateEventLabelCommandError = async ( +export const de_UpdateDetectorVersionStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateDetectorVersionStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateListCommand + * deserializeAws_json1_1UpdateEventLabelCommand */ -export const de_UpdateListCommand = async ( +export const de_UpdateEventLabelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateListCommandOutput = { + const response: UpdateEventLabelCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5065,44 +2555,23 @@ export const de_UpdateListCommand = async ( }; /** - * deserializeAws_json1_1UpdateListCommandError + * deserializeAws_json1_1UpdateListCommand */ -const de_UpdateListCommandError = async ( +export const de_UpdateListCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateListCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -5113,7 +2582,7 @@ export const de_UpdateModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateModelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5125,47 +2594,6 @@ export const de_UpdateModelCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateModelCommandError - */ -const de_UpdateModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateModelVersionCommand */ @@ -5174,7 +2602,7 @@ export const de_UpdateModelVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateModelVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5186,47 +2614,6 @@ export const de_UpdateModelVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateModelVersionCommandError - */ -const de_UpdateModelVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateModelVersionStatusCommand */ @@ -5235,7 +2622,7 @@ export const de_UpdateModelVersionStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateModelVersionStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5247,47 +2634,6 @@ export const de_UpdateModelVersionStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateModelVersionStatusCommandError - */ -const de_UpdateModelVersionStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateRuleMetadataCommand */ @@ -5296,7 +2642,7 @@ export const de_UpdateRuleMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRuleMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5308,47 +2654,6 @@ export const de_UpdateRuleMetadataCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateRuleMetadataCommandError - */ -const de_UpdateRuleMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateRuleVersionCommand */ @@ -5357,7 +2662,7 @@ export const de_UpdateRuleVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRuleVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5369,47 +2674,6 @@ export const de_UpdateRuleVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateRuleVersionCommandError - */ -const de_UpdateRuleVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.frauddetector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.frauddetector#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.frauddetector#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.frauddetector#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateVariableCommand */ @@ -5418,7 +2682,7 @@ export const de_UpdateVariableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateVariableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5431,12 +2695,9 @@ export const de_UpdateVariableCommand = async ( }; /** - * deserializeAws_json1_1UpdateVariableCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateVariableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5446,28 +2707,31 @@ const de_UpdateVariableCommandError = async ( case "AccessDeniedException": case "com.amazonaws.frauddetector#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.frauddetector#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.frauddetector#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.frauddetector#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.frauddetector#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.frauddetector#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.frauddetector#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.frauddetector#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ResourceUnavailableException": + case "com.amazonaws.frauddetector#ResourceUnavailableException": + throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-freetier/src/protocols/Aws_json1_0.ts b/clients/client-freetier/src/protocols/Aws_json1_0.ts index 976e43b6a932..13b2467c416c 100644 --- a/clients/client-freetier/src/protocols/Aws_json1_0.ts +++ b/clients/client-freetier/src/protocols/Aws_json1_0.ts @@ -51,7 +51,7 @@ export const de_GetFreeTierUsageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetFreeTierUsageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -64,12 +64,9 @@ export const de_GetFreeTierUsageCommand = async ( }; /** - * deserializeAws_json1_0GetFreeTierUsageCommandError + * deserialize_Aws_json1_0CommandError */ -const de_GetFreeTierUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -91,7 +88,7 @@ const de_GetFreeTierUsageCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-fsx/src/protocols/Aws_json1_1.ts b/clients/client-fsx/src/protocols/Aws_json1_1.ts index e6e08a8b0ad9..5b972ad82986 100644 --- a/clients/client-fsx/src/protocols/Aws_json1_1.ts +++ b/clients/client-fsx/src/protocols/Aws_json1_1.ts @@ -915,7 +915,7 @@ export const de_AssociateFileSystemAliasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateFileSystemAliasesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -927,38 +927,6 @@ export const de_AssociateFileSystemAliasesCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateFileSystemAliasesCommandError - */ -const de_AssociateFileSystemAliasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelDataRepositoryTaskCommand */ @@ -967,7 +935,7 @@ export const de_CancelDataRepositoryTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelDataRepositoryTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -979,44 +947,6 @@ export const de_CancelDataRepositoryTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelDataRepositoryTaskCommandError - */ -const de_CancelDataRepositoryTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "DataRepositoryTaskEnded": - case "com.amazonaws.fsx#DataRepositoryTaskEnded": - throw await de_DataRepositoryTaskEndedRes(parsedOutput, context); - case "DataRepositoryTaskNotFound": - case "com.amazonaws.fsx#DataRepositoryTaskNotFound": - throw await de_DataRepositoryTaskNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.fsx#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CopyBackupCommand */ @@ -1025,7 +955,7 @@ export const de_CopyBackupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopyBackupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1037,62 +967,6 @@ export const de_CopyBackupCommand = async ( return response; }; -/** - * deserializeAws_json1_1CopyBackupCommandError - */ -const de_CopyBackupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BackupNotFound": - case "com.amazonaws.fsx#BackupNotFound": - throw await de_BackupNotFoundRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "IncompatibleRegionForMultiAZ": - case "com.amazonaws.fsx#IncompatibleRegionForMultiAZ": - throw await de_IncompatibleRegionForMultiAZRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDestinationKmsKey": - case "com.amazonaws.fsx#InvalidDestinationKmsKey": - throw await de_InvalidDestinationKmsKeyRes(parsedOutput, context); - case "InvalidRegion": - case "com.amazonaws.fsx#InvalidRegion": - throw await de_InvalidRegionRes(parsedOutput, context); - case "InvalidSourceKmsKey": - case "com.amazonaws.fsx#InvalidSourceKmsKey": - throw await de_InvalidSourceKmsKeyRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - case "SourceBackupUnavailable": - case "com.amazonaws.fsx#SourceBackupUnavailable": - throw await de_SourceBackupUnavailableRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.fsx#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CopySnapshotAndUpdateVolumeCommand */ @@ -1101,7 +975,7 @@ export const de_CopySnapshotAndUpdateVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopySnapshotAndUpdateVolumeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1113,41 +987,6 @@ export const de_CopySnapshotAndUpdateVolumeCommand = async ( return response; }; -/** - * deserializeAws_json1_1CopySnapshotAndUpdateVolumeCommandError - */ -const de_CopySnapshotAndUpdateVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateBackupCommand */ @@ -1156,7 +995,7 @@ export const de_CreateBackupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBackupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1168,53 +1007,6 @@ export const de_CreateBackupCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateBackupCommandError - */ -const de_CreateBackupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BackupInProgress": - case "com.amazonaws.fsx#BackupInProgress": - throw await de_BackupInProgressRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.fsx#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - case "VolumeNotFound": - case "com.amazonaws.fsx#VolumeNotFound": - throw await de_VolumeNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDataRepositoryAssociationCommand */ @@ -1223,7 +1015,7 @@ export const de_CreateDataRepositoryAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDataRepositoryAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1236,60 +1028,39 @@ export const de_CreateDataRepositoryAssociationCommand = async ( }; /** - * deserializeAws_json1_1CreateDataRepositoryAssociationCommandError + * deserializeAws_json1_1CreateDataRepositoryTaskCommand */ -const de_CreateDataRepositoryAssociationCommandError = async ( +export const de_CreateDataRepositoryTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.fsx#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateDataRepositoryTaskResponse(data, context); + const response: CreateDataRepositoryTaskCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateDataRepositoryTaskCommand + * deserializeAws_json1_1CreateFileCacheCommand */ -export const de_CreateDataRepositoryTaskCommand = async ( +export const de_CreateFileCacheCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDataRepositoryTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDataRepositoryTaskResponse(data, context); - const response: CreateDataRepositoryTaskCommandOutput = { + contents = de_CreateFileCacheResponse(data, context); + const response: CreateFileCacheCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1297,1042 +1068,19 @@ export const de_CreateDataRepositoryTaskCommand = async ( }; /** - * deserializeAws_json1_1CreateDataRepositoryTaskCommandError + * deserializeAws_json1_1CreateFileSystemCommand */ -const de_CreateDataRepositoryTaskCommandError = async ( +export const de_CreateFileSystemCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "DataRepositoryTaskExecuting": - case "com.amazonaws.fsx#DataRepositoryTaskExecuting": - throw await de_DataRepositoryTaskExecutingRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.fsx#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateFileCacheCommand - */ -export const de_CreateFileCacheCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateFileCacheCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateFileCacheResponse(data, context); - const response: CreateFileCacheCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateFileCacheCommandError - */ -const de_CreateFileCacheCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidNetworkSettings": - case "com.amazonaws.fsx#InvalidNetworkSettings": - throw await de_InvalidNetworkSettingsRes(parsedOutput, context); - case "InvalidPerUnitStorageThroughput": - case "com.amazonaws.fsx#InvalidPerUnitStorageThroughput": - throw await de_InvalidPerUnitStorageThroughputRes(parsedOutput, context); - case "MissingFileCacheConfiguration": - case "com.amazonaws.fsx#MissingFileCacheConfiguration": - throw await de_MissingFileCacheConfigurationRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateFileSystemCommand - */ -export const de_CreateFileSystemCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateFileSystemCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateFileSystemResponse(data, context); - const response: CreateFileSystemCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateFileSystemCommandError - */ -const de_CreateFileSystemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActiveDirectoryError": - case "com.amazonaws.fsx#ActiveDirectoryError": - throw await de_ActiveDirectoryErrorRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidExportPath": - case "com.amazonaws.fsx#InvalidExportPath": - throw await de_InvalidExportPathRes(parsedOutput, context); - case "InvalidImportPath": - case "com.amazonaws.fsx#InvalidImportPath": - throw await de_InvalidImportPathRes(parsedOutput, context); - case "InvalidNetworkSettings": - case "com.amazonaws.fsx#InvalidNetworkSettings": - throw await de_InvalidNetworkSettingsRes(parsedOutput, context); - case "InvalidPerUnitStorageThroughput": - case "com.amazonaws.fsx#InvalidPerUnitStorageThroughput": - throw await de_InvalidPerUnitStorageThroughputRes(parsedOutput, context); - case "MissingFileSystemConfiguration": - case "com.amazonaws.fsx#MissingFileSystemConfiguration": - throw await de_MissingFileSystemConfigurationRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateFileSystemFromBackupCommand - */ -export const de_CreateFileSystemFromBackupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateFileSystemFromBackupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateFileSystemFromBackupResponse(data, context); - const response: CreateFileSystemFromBackupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateFileSystemFromBackupCommandError - */ -const de_CreateFileSystemFromBackupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActiveDirectoryError": - case "com.amazonaws.fsx#ActiveDirectoryError": - throw await de_ActiveDirectoryErrorRes(parsedOutput, context); - case "BackupNotFound": - case "com.amazonaws.fsx#BackupNotFound": - throw await de_BackupNotFoundRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidNetworkSettings": - case "com.amazonaws.fsx#InvalidNetworkSettings": - throw await de_InvalidNetworkSettingsRes(parsedOutput, context); - case "InvalidPerUnitStorageThroughput": - case "com.amazonaws.fsx#InvalidPerUnitStorageThroughput": - throw await de_InvalidPerUnitStorageThroughputRes(parsedOutput, context); - case "MissingFileSystemConfiguration": - case "com.amazonaws.fsx#MissingFileSystemConfiguration": - throw await de_MissingFileSystemConfigurationRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateSnapshotCommand - */ -export const de_CreateSnapshotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateSnapshotCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateSnapshotResponse(data, context); - const response: CreateSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateSnapshotCommandError - */ -const de_CreateSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - case "VolumeNotFound": - case "com.amazonaws.fsx#VolumeNotFound": - throw await de_VolumeNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateStorageVirtualMachineCommand - */ -export const de_CreateStorageVirtualMachineCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateStorageVirtualMachineCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateStorageVirtualMachineResponse(data, context); - const response: CreateStorageVirtualMachineCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateStorageVirtualMachineCommandError - */ -const de_CreateStorageVirtualMachineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActiveDirectoryError": - case "com.amazonaws.fsx#ActiveDirectoryError": - throw await de_ActiveDirectoryErrorRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.fsx#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateVolumeCommand - */ -export const de_CreateVolumeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateVolumeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateVolumeResponse(data, context); - const response: CreateVolumeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateVolumeCommandError - */ -const de_CreateVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "MissingVolumeConfiguration": - case "com.amazonaws.fsx#MissingVolumeConfiguration": - throw await de_MissingVolumeConfigurationRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - case "StorageVirtualMachineNotFound": - case "com.amazonaws.fsx#StorageVirtualMachineNotFound": - throw await de_StorageVirtualMachineNotFoundRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.fsx#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateVolumeFromBackupCommand - */ -export const de_CreateVolumeFromBackupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateVolumeFromBackupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateVolumeFromBackupResponse(data, context); - const response: CreateVolumeFromBackupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateVolumeFromBackupCommandError - */ -const de_CreateVolumeFromBackupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BackupNotFound": - case "com.amazonaws.fsx#BackupNotFound": - throw await de_BackupNotFoundRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "MissingVolumeConfiguration": - case "com.amazonaws.fsx#MissingVolumeConfiguration": - throw await de_MissingVolumeConfigurationRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - case "StorageVirtualMachineNotFound": - case "com.amazonaws.fsx#StorageVirtualMachineNotFound": - throw await de_StorageVirtualMachineNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteBackupCommand - */ -export const de_DeleteBackupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteBackupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteBackupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteBackupCommandError - */ -const de_DeleteBackupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BackupBeingCopied": - case "com.amazonaws.fsx#BackupBeingCopied": - throw await de_BackupBeingCopiedRes(parsedOutput, context); - case "BackupInProgress": - case "com.amazonaws.fsx#BackupInProgress": - throw await de_BackupInProgressRes(parsedOutput, context); - case "BackupNotFound": - case "com.amazonaws.fsx#BackupNotFound": - throw await de_BackupNotFoundRes(parsedOutput, context); - case "BackupRestoring": - case "com.amazonaws.fsx#BackupRestoring": - throw await de_BackupRestoringRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDataRepositoryAssociationCommand - */ -export const de_DeleteDataRepositoryAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDataRepositoryAssociationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteDataRepositoryAssociationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDataRepositoryAssociationCommandError - */ -const de_DeleteDataRepositoryAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "DataRepositoryAssociationNotFound": - case "com.amazonaws.fsx#DataRepositoryAssociationNotFound": - throw await de_DataRepositoryAssociationNotFoundRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteFileCacheCommand - */ -export const de_DeleteFileCacheCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteFileCacheCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteFileCacheCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteFileCacheCommandError - */ -const de_DeleteFileCacheCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileCacheNotFound": - case "com.amazonaws.fsx#FileCacheNotFound": - throw await de_FileCacheNotFoundRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteFileSystemCommand - */ -export const de_DeleteFileSystemCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteFileSystemCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteFileSystemCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteFileSystemCommandError - */ -const de_DeleteFileSystemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteSnapshotCommand - */ -export const de_DeleteSnapshotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteSnapshotCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteSnapshotCommandError - */ -const de_DeleteSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "SnapshotNotFound": - case "com.amazonaws.fsx#SnapshotNotFound": - throw await de_SnapshotNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteStorageVirtualMachineCommand - */ -export const de_DeleteStorageVirtualMachineCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteStorageVirtualMachineCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteStorageVirtualMachineCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteStorageVirtualMachineCommandError - */ -const de_DeleteStorageVirtualMachineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "StorageVirtualMachineNotFound": - case "com.amazonaws.fsx#StorageVirtualMachineNotFound": - throw await de_StorageVirtualMachineNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteVolumeCommand - */ -export const de_DeleteVolumeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteVolumeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteVolumeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteVolumeCommandError - */ -const de_DeleteVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - case "VolumeNotFound": - case "com.amazonaws.fsx#VolumeNotFound": - throw await de_VolumeNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeBackupsCommand - */ -export const de_DescribeBackupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeBackupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeBackupsResponse(data, context); - const response: DescribeBackupsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeBackupsCommandError - */ -const de_DescribeBackupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BackupNotFound": - case "com.amazonaws.fsx#BackupNotFound": - throw await de_BackupNotFoundRes(parsedOutput, context); - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "VolumeNotFound": - case "com.amazonaws.fsx#VolumeNotFound": - throw await de_VolumeNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDataRepositoryAssociationsCommand - */ -export const de_DescribeDataRepositoryAssociationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDataRepositoryAssociationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeDataRepositoryAssociationsResponse(data, context); - const response: DescribeDataRepositoryAssociationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeDataRepositoryAssociationsCommandError - */ -const de_DescribeDataRepositoryAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "DataRepositoryAssociationNotFound": - case "com.amazonaws.fsx#DataRepositoryAssociationNotFound": - throw await de_DataRepositoryAssociationNotFoundRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDataRepositoryType": - case "com.amazonaws.fsx#InvalidDataRepositoryType": - throw await de_InvalidDataRepositoryTypeRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDataRepositoryTasksCommand - */ -export const de_DescribeDataRepositoryTasksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDataRepositoryTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDataRepositoryTasksResponse(data, context); - const response: DescribeDataRepositoryTasksCommandOutput = { + contents = de_CreateFileSystemResponse(data, context); + const response: CreateFileSystemCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2340,54 +1088,19 @@ export const de_DescribeDataRepositoryTasksCommand = async ( }; /** - * deserializeAws_json1_1DescribeDataRepositoryTasksCommandError - */ -const de_DescribeDataRepositoryTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "DataRepositoryTaskNotFound": - case "com.amazonaws.fsx#DataRepositoryTaskNotFound": - throw await de_DataRepositoryTaskNotFoundRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFileCachesCommand + * deserializeAws_json1_1CreateFileSystemFromBackupCommand */ -export const de_DescribeFileCachesCommand = async ( +export const de_CreateFileSystemFromBackupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeFileCachesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeFileCachesResponse(data, context); - const response: DescribeFileCachesCommandOutput = { + contents = de_CreateFileSystemFromBackupResponse(data, context); + const response: CreateFileSystemFromBackupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2395,51 +1108,19 @@ export const de_DescribeFileCachesCommand = async ( }; /** - * deserializeAws_json1_1DescribeFileCachesCommandError - */ -const de_DescribeFileCachesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileCacheNotFound": - case "com.amazonaws.fsx#FileCacheNotFound": - throw await de_FileCacheNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFileSystemAliasesCommand + * deserializeAws_json1_1CreateSnapshotCommand */ -export const de_DescribeFileSystemAliasesCommand = async ( +export const de_CreateSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeFileSystemAliasesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeFileSystemAliasesCommandOutput = { + contents = de_CreateSnapshotResponse(data, context); + const response: CreateSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2447,51 +1128,39 @@ export const de_DescribeFileSystemAliasesCommand = async ( }; /** - * deserializeAws_json1_1DescribeFileSystemAliasesCommandError + * deserializeAws_json1_1CreateStorageVirtualMachineCommand */ -const de_DescribeFileSystemAliasesCommandError = async ( +export const de_CreateStorageVirtualMachineCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateStorageVirtualMachineResponse(data, context); + const response: CreateStorageVirtualMachineCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeFileSystemsCommand + * deserializeAws_json1_1CreateVolumeCommand */ -export const de_DescribeFileSystemsCommand = async ( +export const de_CreateVolumeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeFileSystemsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeFileSystemsResponse(data, context); - const response: DescribeFileSystemsCommandOutput = { + contents = de_CreateVolumeResponse(data, context); + const response: CreateVolumeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2499,51 +1168,39 @@ export const de_DescribeFileSystemsCommand = async ( }; /** - * deserializeAws_json1_1DescribeFileSystemsCommandError + * deserializeAws_json1_1CreateVolumeFromBackupCommand */ -const de_DescribeFileSystemsCommandError = async ( +export const de_CreateVolumeFromBackupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateVolumeFromBackupResponse(data, context); + const response: CreateVolumeFromBackupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeSharedVpcConfigurationCommand + * deserializeAws_json1_1DeleteBackupCommand */ -export const de_DescribeSharedVpcConfigurationCommand = async ( +export const de_DeleteBackupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeSharedVpcConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeSharedVpcConfigurationCommandOutput = { + const response: DeleteBackupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2551,48 +1208,39 @@ export const de_DescribeSharedVpcConfigurationCommand = async ( }; /** - * deserializeAws_json1_1DescribeSharedVpcConfigurationCommandError + * deserializeAws_json1_1DeleteDataRepositoryAssociationCommand */ -const de_DescribeSharedVpcConfigurationCommandError = async ( +export const de_DeleteDataRepositoryAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteDataRepositoryAssociationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeSnapshotsCommand + * deserializeAws_json1_1DeleteFileCacheCommand */ -export const de_DescribeSnapshotsCommand = async ( +export const de_DeleteFileCacheCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeSnapshotsResponse(data, context); - const response: DescribeSnapshotsCommandOutput = { + contents = _json(data); + const response: DeleteFileCacheCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2600,51 +1248,39 @@ export const de_DescribeSnapshotsCommand = async ( }; /** - * deserializeAws_json1_1DescribeSnapshotsCommandError + * deserializeAws_json1_1DeleteFileSystemCommand */ -const de_DescribeSnapshotsCommandError = async ( +export const de_DeleteFileSystemCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "SnapshotNotFound": - case "com.amazonaws.fsx#SnapshotNotFound": - throw await de_SnapshotNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteFileSystemCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeStorageVirtualMachinesCommand + * deserializeAws_json1_1DeleteSnapshotCommand */ -export const de_DescribeStorageVirtualMachinesCommand = async ( +export const de_DeleteSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeStorageVirtualMachinesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeStorageVirtualMachinesResponse(data, context); - const response: DescribeStorageVirtualMachinesCommandOutput = { + contents = _json(data); + const response: DeleteSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2652,51 +1288,19 @@ export const de_DescribeStorageVirtualMachinesCommand = async ( }; /** - * deserializeAws_json1_1DescribeStorageVirtualMachinesCommandError - */ -const de_DescribeStorageVirtualMachinesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "StorageVirtualMachineNotFound": - case "com.amazonaws.fsx#StorageVirtualMachineNotFound": - throw await de_StorageVirtualMachineNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeVolumesCommand + * deserializeAws_json1_1DeleteStorageVirtualMachineCommand */ -export const de_DescribeVolumesCommand = async ( +export const de_DeleteStorageVirtualMachineCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeVolumesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeVolumesResponse(data, context); - const response: DescribeVolumesCommandOutput = { + contents = _json(data); + const response: DeleteStorageVirtualMachineCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2704,51 +1308,39 @@ export const de_DescribeVolumesCommand = async ( }; /** - * deserializeAws_json1_1DescribeVolumesCommandError + * deserializeAws_json1_1DeleteVolumeCommand */ -const de_DescribeVolumesCommandError = async ( +export const de_DeleteVolumeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "VolumeNotFound": - case "com.amazonaws.fsx#VolumeNotFound": - throw await de_VolumeNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteVolumeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisassociateFileSystemAliasesCommand + * deserializeAws_json1_1DescribeBackupsCommand */ -export const de_DisassociateFileSystemAliasesCommand = async ( +export const de_DescribeBackupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateFileSystemAliasesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DisassociateFileSystemAliasesCommandOutput = { + contents = de_DescribeBackupsResponse(data, context); + const response: DescribeBackupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2756,51 +1348,39 @@ export const de_DisassociateFileSystemAliasesCommand = async ( }; /** - * deserializeAws_json1_1DisassociateFileSystemAliasesCommandError + * deserializeAws_json1_1DescribeDataRepositoryAssociationsCommand */ -const de_DisassociateFileSystemAliasesCommandError = async ( +export const de_DescribeDataRepositoryAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDataRepositoryAssociationsResponse(data, context); + const response: DescribeDataRepositoryAssociationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1DescribeDataRepositoryTasksCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_DescribeDataRepositoryTasksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_DescribeDataRepositoryTasksResponse(data, context); + const response: DescribeDataRepositoryTasksCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2808,57 +1388,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1DescribeFileCachesCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_DescribeFileCachesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "NotServiceResourceError": - case "com.amazonaws.fsx#NotServiceResourceError": - throw await de_NotServiceResourceErrorRes(parsedOutput, context); - case "ResourceDoesNotSupportTagging": - case "com.amazonaws.fsx#ResourceDoesNotSupportTagging": - throw await de_ResourceDoesNotSupportTaggingRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.fsx#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeFileCachesResponse(data, context); + const response: DescribeFileCachesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ReleaseFileSystemNfsV3LocksCommand + * deserializeAws_json1_1DescribeFileSystemAliasesCommand */ -export const de_ReleaseFileSystemNfsV3LocksCommand = async ( +export const de_DescribeFileSystemAliasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ReleaseFileSystemNfsV3LocksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ReleaseFileSystemNfsV3LocksResponse(data, context); - const response: ReleaseFileSystemNfsV3LocksCommandOutput = { + contents = _json(data); + const response: DescribeFileSystemAliasesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2866,57 +1428,39 @@ export const de_ReleaseFileSystemNfsV3LocksCommand = async ( }; /** - * deserializeAws_json1_1ReleaseFileSystemNfsV3LocksCommandError + * deserializeAws_json1_1DescribeFileSystemsCommand */ -const de_ReleaseFileSystemNfsV3LocksCommandError = async ( +export const de_DescribeFileSystemsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeFileSystemsResponse(data, context); + const response: DescribeFileSystemsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RestoreVolumeFromSnapshotCommand + * deserializeAws_json1_1DescribeSharedVpcConfigurationCommand */ -export const de_RestoreVolumeFromSnapshotCommand = async ( +export const de_DescribeSharedVpcConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RestoreVolumeFromSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RestoreVolumeFromSnapshotResponse(data, context); - const response: RestoreVolumeFromSnapshotCommandOutput = { + contents = _json(data); + const response: DescribeSharedVpcConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2924,51 +1468,39 @@ export const de_RestoreVolumeFromSnapshotCommand = async ( }; /** - * deserializeAws_json1_1RestoreVolumeFromSnapshotCommandError + * deserializeAws_json1_1DescribeSnapshotsCommand */ -const de_RestoreVolumeFromSnapshotCommandError = async ( +export const de_DescribeSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "VolumeNotFound": - case "com.amazonaws.fsx#VolumeNotFound": - throw await de_VolumeNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeSnapshotsResponse(data, context); + const response: DescribeSnapshotsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartMisconfiguredStateRecoveryCommand + * deserializeAws_json1_1DescribeStorageVirtualMachinesCommand */ -export const de_StartMisconfiguredStateRecoveryCommand = async ( +export const de_DescribeStorageVirtualMachinesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartMisconfiguredStateRecoveryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StartMisconfiguredStateRecoveryResponse(data, context); - const response: StartMisconfiguredStateRecoveryCommandOutput = { + contents = de_DescribeStorageVirtualMachinesResponse(data, context); + const response: DescribeStorageVirtualMachinesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2976,51 +1508,39 @@ export const de_StartMisconfiguredStateRecoveryCommand = async ( }; /** - * deserializeAws_json1_1StartMisconfiguredStateRecoveryCommandError + * deserializeAws_json1_1DescribeVolumesCommand */ -const de_StartMisconfiguredStateRecoveryCommandError = async ( +export const de_DescribeVolumesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeVolumesResponse(data, context); + const response: DescribeVolumesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1DisassociateFileSystemAliasesCommand */ -export const de_TagResourceCommand = async ( +export const de_DisassociateFileSystemAliasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: DisassociateFileSystemAliasesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3028,57 +1548,39 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "NotServiceResourceError": - case "com.amazonaws.fsx#NotServiceResourceError": - throw await de_NotServiceResourceErrorRes(parsedOutput, context); - case "ResourceDoesNotSupportTagging": - case "com.amazonaws.fsx#ResourceDoesNotSupportTagging": - throw await de_ResourceDoesNotSupportTaggingRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.fsx#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UntagResourceCommand + * deserializeAws_json1_1ReleaseFileSystemNfsV3LocksCommand */ -export const de_UntagResourceCommand = async ( +export const de_ReleaseFileSystemNfsV3LocksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: UntagResourceCommandOutput = { + contents = de_ReleaseFileSystemNfsV3LocksResponse(data, context); + const response: ReleaseFileSystemNfsV3LocksCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3086,57 +1588,39 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserializeAws_json1_1RestoreVolumeFromSnapshotCommand */ -const de_UntagResourceCommandError = async ( +export const de_RestoreVolumeFromSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "NotServiceResourceError": - case "com.amazonaws.fsx#NotServiceResourceError": - throw await de_NotServiceResourceErrorRes(parsedOutput, context); - case "ResourceDoesNotSupportTagging": - case "com.amazonaws.fsx#ResourceDoesNotSupportTagging": - throw await de_ResourceDoesNotSupportTaggingRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.fsx#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RestoreVolumeFromSnapshotResponse(data, context); + const response: RestoreVolumeFromSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateDataRepositoryAssociationCommand + * deserializeAws_json1_1StartMisconfiguredStateRecoveryCommand */ -export const de_UpdateDataRepositoryAssociationCommand = async ( +export const de_StartMisconfiguredStateRecoveryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateDataRepositoryAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateDataRepositoryAssociationResponse(data, context); - const response: UpdateDataRepositoryAssociationCommandOutput = { + contents = de_StartMisconfiguredStateRecoveryResponse(data, context); + const response: StartMisconfiguredStateRecoveryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3144,57 +1628,39 @@ export const de_UpdateDataRepositoryAssociationCommand = async ( }; /** - * deserializeAws_json1_1UpdateDataRepositoryAssociationCommandError + * deserializeAws_json1_1TagResourceCommand */ -const de_UpdateDataRepositoryAssociationCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "DataRepositoryAssociationNotFound": - case "com.amazonaws.fsx#DataRepositoryAssociationNotFound": - throw await de_DataRepositoryAssociationNotFoundRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateFileCacheCommand + * deserializeAws_json1_1UntagResourceCommand */ -export const de_UpdateFileCacheCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateFileCacheCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateFileCacheResponse(data, context); - const response: UpdateFileCacheCommandOutput = { + contents = _json(data); + const response: UntagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3202,63 +1668,39 @@ export const de_UpdateFileCacheCommand = async ( }; /** - * deserializeAws_json1_1UpdateFileCacheCommandError + * deserializeAws_json1_1UpdateDataRepositoryAssociationCommand */ -const de_UpdateFileCacheCommandError = async ( +export const de_UpdateDataRepositoryAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileCacheNotFound": - case "com.amazonaws.fsx#FileCacheNotFound": - throw await de_FileCacheNotFoundRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "MissingFileCacheConfiguration": - case "com.amazonaws.fsx#MissingFileCacheConfiguration": - throw await de_MissingFileCacheConfigurationRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.fsx#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateDataRepositoryAssociationResponse(data, context); + const response: UpdateDataRepositoryAssociationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateFileSystemCommand + * deserializeAws_json1_1UpdateFileCacheCommand */ -export const de_UpdateFileSystemCommand = async ( +export const de_UpdateFileCacheCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateFileSystemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateFileSystemResponse(data, context); - const response: UpdateFileSystemCommandOutput = { + contents = de_UpdateFileCacheResponse(data, context); + const response: UpdateFileCacheCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3266,50 +1708,23 @@ export const de_UpdateFileSystemCommand = async ( }; /** - * deserializeAws_json1_1UpdateFileSystemCommandError + * deserializeAws_json1_1UpdateFileSystemCommand */ -const de_UpdateFileSystemCommandError = async ( +export const de_UpdateFileSystemCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "FileSystemNotFound": - case "com.amazonaws.fsx#FileSystemNotFound": - throw await de_FileSystemNotFoundRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidNetworkSettings": - case "com.amazonaws.fsx#InvalidNetworkSettings": - throw await de_InvalidNetworkSettingsRes(parsedOutput, context); - case "MissingFileSystemConfiguration": - case "com.amazonaws.fsx#MissingFileSystemConfiguration": - throw await de_MissingFileSystemConfigurationRes(parsedOutput, context); - case "ServiceLimitExceeded": - case "com.amazonaws.fsx#ServiceLimitExceeded": - throw await de_ServiceLimitExceededRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.fsx#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateFileSystemResponse(data, context); + const response: UpdateFileSystemCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3320,7 +1735,7 @@ export const de_UpdateSharedVpcConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSharedVpcConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3332,38 +1747,6 @@ export const de_UpdateSharedVpcConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSharedVpcConfigurationCommandError - */ -const de_UpdateSharedVpcConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSnapshotCommand */ @@ -3372,7 +1755,7 @@ export const de_UpdateSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3384,38 +1767,6 @@ export const de_UpdateSnapshotCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSnapshotCommandError - */ -const de_UpdateSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "SnapshotNotFound": - case "com.amazonaws.fsx#SnapshotNotFound": - throw await de_SnapshotNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateStorageVirtualMachineCommand */ @@ -3424,7 +1775,7 @@ export const de_UpdateStorageVirtualMachineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateStorageVirtualMachineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3436,44 +1787,6 @@ export const de_UpdateStorageVirtualMachineCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateStorageVirtualMachineCommandError - */ -const de_UpdateStorageVirtualMachineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequest": - case "com.amazonaws.fsx#BadRequest": - throw await de_BadRequestRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.fsx#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "StorageVirtualMachineNotFound": - case "com.amazonaws.fsx#StorageVirtualMachineNotFound": - throw await de_StorageVirtualMachineNotFoundRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.fsx#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateVolumeCommand */ @@ -3482,7 +1795,7 @@ export const de_UpdateVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateVolumeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3495,12 +1808,9 @@ export const de_UpdateVolumeCommand = async ( }; /** - * deserializeAws_json1_1UpdateVolumeCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3510,25 +1820,115 @@ const de_UpdateVolumeCommandError = async ( case "BadRequest": case "com.amazonaws.fsx#BadRequest": throw await de_BadRequestRes(parsedOutput, context); - case "IncompatibleParameterError": - case "com.amazonaws.fsx#IncompatibleParameterError": - throw await de_IncompatibleParameterErrorRes(parsedOutput, context); + case "FileSystemNotFound": + case "com.amazonaws.fsx#FileSystemNotFound": + throw await de_FileSystemNotFoundRes(parsedOutput, context); case "InternalServerError": case "com.amazonaws.fsx#InternalServerError": throw await de_InternalServerErrorRes(parsedOutput, context); - case "MissingVolumeConfiguration": - case "com.amazonaws.fsx#MissingVolumeConfiguration": - throw await de_MissingVolumeConfigurationRes(parsedOutput, context); + case "DataRepositoryTaskEnded": + case "com.amazonaws.fsx#DataRepositoryTaskEnded": + throw await de_DataRepositoryTaskEndedRes(parsedOutput, context); + case "DataRepositoryTaskNotFound": + case "com.amazonaws.fsx#DataRepositoryTaskNotFound": + throw await de_DataRepositoryTaskNotFoundRes(parsedOutput, context); + case "UnsupportedOperation": + case "com.amazonaws.fsx#UnsupportedOperation": + throw await de_UnsupportedOperationRes(parsedOutput, context); + case "BackupNotFound": + case "com.amazonaws.fsx#BackupNotFound": + throw await de_BackupNotFoundRes(parsedOutput, context); + case "IncompatibleParameterError": + case "com.amazonaws.fsx#IncompatibleParameterError": + throw await de_IncompatibleParameterErrorRes(parsedOutput, context); + case "IncompatibleRegionForMultiAZ": + case "com.amazonaws.fsx#IncompatibleRegionForMultiAZ": + throw await de_IncompatibleRegionForMultiAZRes(parsedOutput, context); + case "InvalidDestinationKmsKey": + case "com.amazonaws.fsx#InvalidDestinationKmsKey": + throw await de_InvalidDestinationKmsKeyRes(parsedOutput, context); + case "InvalidRegion": + case "com.amazonaws.fsx#InvalidRegion": + throw await de_InvalidRegionRes(parsedOutput, context); + case "InvalidSourceKmsKey": + case "com.amazonaws.fsx#InvalidSourceKmsKey": + throw await de_InvalidSourceKmsKeyRes(parsedOutput, context); + case "ServiceLimitExceeded": + case "com.amazonaws.fsx#ServiceLimitExceeded": + throw await de_ServiceLimitExceededRes(parsedOutput, context); + case "SourceBackupUnavailable": + case "com.amazonaws.fsx#SourceBackupUnavailable": + throw await de_SourceBackupUnavailableRes(parsedOutput, context); + case "BackupInProgress": + case "com.amazonaws.fsx#BackupInProgress": + throw await de_BackupInProgressRes(parsedOutput, context); case "VolumeNotFound": case "com.amazonaws.fsx#VolumeNotFound": throw await de_VolumeNotFoundRes(parsedOutput, context); + case "DataRepositoryTaskExecuting": + case "com.amazonaws.fsx#DataRepositoryTaskExecuting": + throw await de_DataRepositoryTaskExecutingRes(parsedOutput, context); + case "InvalidNetworkSettings": + case "com.amazonaws.fsx#InvalidNetworkSettings": + throw await de_InvalidNetworkSettingsRes(parsedOutput, context); + case "InvalidPerUnitStorageThroughput": + case "com.amazonaws.fsx#InvalidPerUnitStorageThroughput": + throw await de_InvalidPerUnitStorageThroughputRes(parsedOutput, context); + case "MissingFileCacheConfiguration": + case "com.amazonaws.fsx#MissingFileCacheConfiguration": + throw await de_MissingFileCacheConfigurationRes(parsedOutput, context); + case "ActiveDirectoryError": + case "com.amazonaws.fsx#ActiveDirectoryError": + throw await de_ActiveDirectoryErrorRes(parsedOutput, context); + case "InvalidExportPath": + case "com.amazonaws.fsx#InvalidExportPath": + throw await de_InvalidExportPathRes(parsedOutput, context); + case "InvalidImportPath": + case "com.amazonaws.fsx#InvalidImportPath": + throw await de_InvalidImportPathRes(parsedOutput, context); + case "MissingFileSystemConfiguration": + case "com.amazonaws.fsx#MissingFileSystemConfiguration": + throw await de_MissingFileSystemConfigurationRes(parsedOutput, context); + case "MissingVolumeConfiguration": + case "com.amazonaws.fsx#MissingVolumeConfiguration": + throw await de_MissingVolumeConfigurationRes(parsedOutput, context); + case "StorageVirtualMachineNotFound": + case "com.amazonaws.fsx#StorageVirtualMachineNotFound": + throw await de_StorageVirtualMachineNotFoundRes(parsedOutput, context); + case "BackupBeingCopied": + case "com.amazonaws.fsx#BackupBeingCopied": + throw await de_BackupBeingCopiedRes(parsedOutput, context); + case "BackupRestoring": + case "com.amazonaws.fsx#BackupRestoring": + throw await de_BackupRestoringRes(parsedOutput, context); + case "DataRepositoryAssociationNotFound": + case "com.amazonaws.fsx#DataRepositoryAssociationNotFound": + throw await de_DataRepositoryAssociationNotFoundRes(parsedOutput, context); + case "FileCacheNotFound": + case "com.amazonaws.fsx#FileCacheNotFound": + throw await de_FileCacheNotFoundRes(parsedOutput, context); + case "SnapshotNotFound": + case "com.amazonaws.fsx#SnapshotNotFound": + throw await de_SnapshotNotFoundRes(parsedOutput, context); + case "InvalidDataRepositoryType": + case "com.amazonaws.fsx#InvalidDataRepositoryType": + throw await de_InvalidDataRepositoryTypeRes(parsedOutput, context); + case "NotServiceResourceError": + case "com.amazonaws.fsx#NotServiceResourceError": + throw await de_NotServiceResourceErrorRes(parsedOutput, context); + case "ResourceDoesNotSupportTagging": + case "com.amazonaws.fsx#ResourceDoesNotSupportTagging": + throw await de_ResourceDoesNotSupportTaggingRes(parsedOutput, context); + case "ResourceNotFound": + case "com.amazonaws.fsx#ResourceNotFound": + throw await de_ResourceNotFoundRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-gamelift/src/protocols/Aws_json1_1.ts b/clients/client-gamelift/src/protocols/Aws_json1_1.ts index b492dc413e74..de2f3b0b0e52 100644 --- a/clients/client-gamelift/src/protocols/Aws_json1_1.ts +++ b/clients/client-gamelift/src/protocols/Aws_json1_1.ts @@ -1889,7 +1889,7 @@ export const de_AcceptMatchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptMatchCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1901,41 +1901,6 @@ export const de_AcceptMatchCommand = async ( return response; }; -/** - * deserializeAws_json1_1AcceptMatchCommandError - */ -const de_AcceptMatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ClaimGameServerCommand */ @@ -1944,7 +1909,7 @@ export const de_ClaimGameServerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ClaimGameServerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1956,47 +1921,6 @@ export const de_ClaimGameServerCommand = async ( return response; }; -/** - * deserializeAws_json1_1ClaimGameServerCommandError - */ -const de_ClaimGameServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.gamelift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OutOfCapacityException": - case "com.amazonaws.gamelift#OutOfCapacityException": - throw await de_OutOfCapacityExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAliasCommand */ @@ -2005,7 +1929,7 @@ export const de_CreateAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2017,47 +1941,6 @@ export const de_CreateAliasCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAliasCommandError - */ -const de_CreateAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.gamelift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.gamelift#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateBuildCommand */ @@ -2066,7 +1949,7 @@ export const de_CreateBuildCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBuildCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2078,44 +1961,6 @@ export const de_CreateBuildCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateBuildCommandError - */ -const de_CreateBuildCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.gamelift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateFleetCommand */ @@ -2124,7 +1969,7 @@ export const de_CreateFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2136,53 +1981,6 @@ export const de_CreateFleetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateFleetCommandError - */ -const de_CreateFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.gamelift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.gamelift#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateFleetLocationsCommand */ @@ -2191,7 +1989,7 @@ export const de_CreateFleetLocationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFleetLocationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2204,66 +2002,39 @@ export const de_CreateFleetLocationsCommand = async ( }; /** - * deserializeAws_json1_1CreateFleetLocationsCommandError + * deserializeAws_json1_1CreateGameServerGroupCommand */ -const de_CreateFleetLocationsCommandError = async ( +export const de_CreateGameServerGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.gamelift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidFleetStatusException": - case "com.amazonaws.gamelift#InvalidFleetStatusException": - throw await de_InvalidFleetStatusExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.gamelift#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateGameServerGroupOutput(data, context); + const response: CreateGameServerGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateGameServerGroupCommand + * deserializeAws_json1_1CreateGameSessionCommand */ -export const de_CreateGameServerGroupCommand = async ( +export const de_CreateGameSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateGameServerGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateGameServerGroupOutput(data, context); - const response: CreateGameServerGroupCommandOutput = { + contents = de_CreateGameSessionOutput(data, context); + const response: CreateGameSessionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2271,2845 +2042,19 @@ export const de_CreateGameServerGroupCommand = async ( }; /** - * deserializeAws_json1_1CreateGameServerGroupCommandError + * deserializeAws_json1_1CreateGameSessionQueueCommand */ -const de_CreateGameServerGroupCommandError = async ( +export const de_CreateGameSessionQueueCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.gamelift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.gamelift#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateGameSessionCommand - */ -export const de_CreateGameSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateGameSessionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateGameSessionOutput(data, context); - const response: CreateGameSessionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateGameSessionCommandError - */ -const de_CreateGameSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.gamelift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "FleetCapacityExceededException": - case "com.amazonaws.gamelift#FleetCapacityExceededException": - throw await de_FleetCapacityExceededExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.gamelift#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidFleetStatusException": - case "com.amazonaws.gamelift#InvalidFleetStatusException": - throw await de_InvalidFleetStatusExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.gamelift#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TerminalRoutingStrategyException": - case "com.amazonaws.gamelift#TerminalRoutingStrategyException": - throw await de_TerminalRoutingStrategyExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateGameSessionQueueCommand - */ -export const de_CreateGameSessionQueueCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateGameSessionQueueCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateGameSessionQueueCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateGameSessionQueueCommandError - */ -const de_CreateGameSessionQueueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.gamelift#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateLocationCommand - */ -export const de_CreateLocationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateLocationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateLocationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateLocationCommandError - */ -const de_CreateLocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.gamelift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.gamelift#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateMatchmakingConfigurationCommand - */ -export const de_CreateMatchmakingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateMatchmakingConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateMatchmakingConfigurationOutput(data, context); - const response: CreateMatchmakingConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateMatchmakingConfigurationCommandError - */ -const de_CreateMatchmakingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.gamelift#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateMatchmakingRuleSetCommand - */ -export const de_CreateMatchmakingRuleSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateMatchmakingRuleSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateMatchmakingRuleSetOutput(data, context); - const response: CreateMatchmakingRuleSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateMatchmakingRuleSetCommandError - */ -const de_CreateMatchmakingRuleSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.gamelift#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreatePlayerSessionCommand - */ -export const de_CreatePlayerSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreatePlayerSessionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreatePlayerSessionOutput(data, context); - const response: CreatePlayerSessionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreatePlayerSessionCommandError - */ -const de_CreatePlayerSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GameSessionFullException": - case "com.amazonaws.gamelift#GameSessionFullException": - throw await de_GameSessionFullExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidGameSessionStatusException": - case "com.amazonaws.gamelift#InvalidGameSessionStatusException": - throw await de_InvalidGameSessionStatusExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TerminalRoutingStrategyException": - case "com.amazonaws.gamelift#TerminalRoutingStrategyException": - throw await de_TerminalRoutingStrategyExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreatePlayerSessionsCommand - */ -export const de_CreatePlayerSessionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreatePlayerSessionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreatePlayerSessionsOutput(data, context); - const response: CreatePlayerSessionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreatePlayerSessionsCommandError - */ -const de_CreatePlayerSessionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GameSessionFullException": - case "com.amazonaws.gamelift#GameSessionFullException": - throw await de_GameSessionFullExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidGameSessionStatusException": - case "com.amazonaws.gamelift#InvalidGameSessionStatusException": - throw await de_InvalidGameSessionStatusExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TerminalRoutingStrategyException": - case "com.amazonaws.gamelift#TerminalRoutingStrategyException": - throw await de_TerminalRoutingStrategyExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateScriptCommand - */ -export const de_CreateScriptCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateScriptCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateScriptOutput(data, context); - const response: CreateScriptCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateScriptCommandError - */ -const de_CreateScriptCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.gamelift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateVpcPeeringAuthorizationCommand - */ -export const de_CreateVpcPeeringAuthorizationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateVpcPeeringAuthorizationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateVpcPeeringAuthorizationOutput(data, context); - const response: CreateVpcPeeringAuthorizationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateVpcPeeringAuthorizationCommandError - */ -const de_CreateVpcPeeringAuthorizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateVpcPeeringConnectionCommand - */ -export const de_CreateVpcPeeringConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateVpcPeeringConnectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateVpcPeeringConnectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateVpcPeeringConnectionCommandError - */ -const de_CreateVpcPeeringConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteAliasCommand - */ -export const de_DeleteAliasCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteAliasCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteAliasCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteAliasCommandError - */ -const de_DeleteAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteBuildCommand - */ -export const de_DeleteBuildCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteBuildCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteBuildCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteBuildCommandError - */ -const de_DeleteBuildCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteFleetCommand - */ -export const de_DeleteFleetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteFleetCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteFleetCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteFleetCommandError - */ -const de_DeleteFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidFleetStatusException": - case "com.amazonaws.gamelift#InvalidFleetStatusException": - throw await de_InvalidFleetStatusExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteFleetLocationsCommand - */ -export const de_DeleteFleetLocationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteFleetLocationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteFleetLocationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteFleetLocationsCommandError - */ -const de_DeleteFleetLocationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteGameServerGroupCommand - */ -export const de_DeleteGameServerGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteGameServerGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteGameServerGroupOutput(data, context); - const response: DeleteGameServerGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteGameServerGroupCommandError - */ -const de_DeleteGameServerGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteGameSessionQueueCommand - */ -export const de_DeleteGameSessionQueueCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteGameSessionQueueCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteGameSessionQueueCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteGameSessionQueueCommandError - */ -const de_DeleteGameSessionQueueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteLocationCommand - */ -export const de_DeleteLocationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteLocationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteLocationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteLocationCommandError - */ -const de_DeleteLocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteMatchmakingConfigurationCommand - */ -export const de_DeleteMatchmakingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteMatchmakingConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteMatchmakingConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteMatchmakingConfigurationCommandError - */ -const de_DeleteMatchmakingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteMatchmakingRuleSetCommand - */ -export const de_DeleteMatchmakingRuleSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteMatchmakingRuleSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteMatchmakingRuleSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteMatchmakingRuleSetCommandError - */ -const de_DeleteMatchmakingRuleSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteScalingPolicyCommand - */ -export const de_DeleteScalingPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteScalingPolicyCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteScalingPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteScalingPolicyCommandError - */ -const de_DeleteScalingPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteScriptCommand - */ -export const de_DeleteScriptCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteScriptCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteScriptCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteScriptCommandError - */ -const de_DeleteScriptCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteVpcPeeringAuthorizationCommand - */ -export const de_DeleteVpcPeeringAuthorizationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteVpcPeeringAuthorizationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteVpcPeeringAuthorizationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteVpcPeeringAuthorizationCommandError - */ -const de_DeleteVpcPeeringAuthorizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteVpcPeeringConnectionCommand - */ -export const de_DeleteVpcPeeringConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteVpcPeeringConnectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteVpcPeeringConnectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteVpcPeeringConnectionCommandError - */ -const de_DeleteVpcPeeringConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeregisterComputeCommand - */ -export const de_DeregisterComputeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeregisterComputeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeregisterComputeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeregisterComputeCommandError - */ -const de_DeregisterComputeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeregisterGameServerCommand - */ -export const de_DeregisterGameServerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeregisterGameServerCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeregisterGameServerCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeregisterGameServerCommandError - */ -const de_DeregisterGameServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAliasCommand - */ -export const de_DescribeAliasCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAliasCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeAliasOutput(data, context); - const response: DescribeAliasCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAliasCommandError - */ -const de_DescribeAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeBuildCommand - */ -export const de_DescribeBuildCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeBuildCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeBuildOutput(data, context); - const response: DescribeBuildCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeBuildCommandError - */ -const de_DescribeBuildCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeComputeCommand - */ -export const de_DescribeComputeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeComputeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeComputeOutput(data, context); - const response: DescribeComputeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeComputeCommandError - */ -const de_DescribeComputeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeEC2InstanceLimitsCommand - */ -export const de_DescribeEC2InstanceLimitsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeEC2InstanceLimitsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeEC2InstanceLimitsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeEC2InstanceLimitsCommandError - */ -const de_DescribeEC2InstanceLimitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFleetAttributesCommand - */ -export const de_DescribeFleetAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFleetAttributesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeFleetAttributesOutput(data, context); - const response: DescribeFleetAttributesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFleetAttributesCommandError - */ -const de_DescribeFleetAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFleetCapacityCommand - */ -export const de_DescribeFleetCapacityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFleetCapacityCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeFleetCapacityCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFleetCapacityCommandError - */ -const de_DescribeFleetCapacityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFleetEventsCommand - */ -export const de_DescribeFleetEventsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFleetEventsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeFleetEventsOutput(data, context); - const response: DescribeFleetEventsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFleetEventsCommandError - */ -const de_DescribeFleetEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFleetLocationAttributesCommand - */ -export const de_DescribeFleetLocationAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFleetLocationAttributesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeFleetLocationAttributesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFleetLocationAttributesCommandError - */ -const de_DescribeFleetLocationAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFleetLocationCapacityCommand - */ -export const de_DescribeFleetLocationCapacityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFleetLocationCapacityCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeFleetLocationCapacityCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFleetLocationCapacityCommandError - */ -const de_DescribeFleetLocationCapacityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFleetLocationUtilizationCommand - */ -export const de_DescribeFleetLocationUtilizationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFleetLocationUtilizationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeFleetLocationUtilizationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFleetLocationUtilizationCommandError - */ -const de_DescribeFleetLocationUtilizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFleetPortSettingsCommand - */ -export const de_DescribeFleetPortSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFleetPortSettingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeFleetPortSettingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFleetPortSettingsCommandError - */ -const de_DescribeFleetPortSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFleetUtilizationCommand - */ -export const de_DescribeFleetUtilizationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFleetUtilizationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeFleetUtilizationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFleetUtilizationCommandError - */ -const de_DescribeFleetUtilizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeGameServerCommand - */ -export const de_DescribeGameServerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeGameServerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeGameServerOutput(data, context); - const response: DescribeGameServerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeGameServerCommandError - */ -const de_DescribeGameServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeGameServerGroupCommand - */ -export const de_DescribeGameServerGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeGameServerGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeGameServerGroupOutput(data, context); - const response: DescribeGameServerGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeGameServerGroupCommandError - */ -const de_DescribeGameServerGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeGameServerInstancesCommand - */ -export const de_DescribeGameServerInstancesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeGameServerInstancesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeGameServerInstancesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeGameServerInstancesCommandError - */ -const de_DescribeGameServerInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeGameSessionDetailsCommand - */ -export const de_DescribeGameSessionDetailsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeGameSessionDetailsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeGameSessionDetailsOutput(data, context); - const response: DescribeGameSessionDetailsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeGameSessionDetailsCommandError - */ -const de_DescribeGameSessionDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TerminalRoutingStrategyException": - case "com.amazonaws.gamelift#TerminalRoutingStrategyException": - throw await de_TerminalRoutingStrategyExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeGameSessionPlacementCommand - */ -export const de_DescribeGameSessionPlacementCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeGameSessionPlacementCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeGameSessionPlacementOutput(data, context); - const response: DescribeGameSessionPlacementCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeGameSessionPlacementCommandError - */ -const de_DescribeGameSessionPlacementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeGameSessionQueuesCommand - */ -export const de_DescribeGameSessionQueuesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeGameSessionQueuesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeGameSessionQueuesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeGameSessionQueuesCommandError - */ -const de_DescribeGameSessionQueuesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeGameSessionsCommand - */ -export const de_DescribeGameSessionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeGameSessionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeGameSessionsOutput(data, context); - const response: DescribeGameSessionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeGameSessionsCommandError - */ -const de_DescribeGameSessionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TerminalRoutingStrategyException": - case "com.amazonaws.gamelift#TerminalRoutingStrategyException": - throw await de_TerminalRoutingStrategyExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeInstancesCommand - */ -export const de_DescribeInstancesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeInstancesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeInstancesOutput(data, context); - const response: DescribeInstancesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeInstancesCommandError - */ -const de_DescribeInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeMatchmakingCommand - */ -export const de_DescribeMatchmakingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeMatchmakingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeMatchmakingOutput(data, context); - const response: DescribeMatchmakingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeMatchmakingCommandError - */ -const de_DescribeMatchmakingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeMatchmakingConfigurationsCommand - */ -export const de_DescribeMatchmakingConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeMatchmakingConfigurationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeMatchmakingConfigurationsOutput(data, context); - const response: DescribeMatchmakingConfigurationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeMatchmakingConfigurationsCommandError - */ -const de_DescribeMatchmakingConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeMatchmakingRuleSetsCommand - */ -export const de_DescribeMatchmakingRuleSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeMatchmakingRuleSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeMatchmakingRuleSetsOutput(data, context); - const response: DescribeMatchmakingRuleSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeMatchmakingRuleSetsCommandError - */ -const de_DescribeMatchmakingRuleSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribePlayerSessionsCommand - */ -export const de_DescribePlayerSessionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribePlayerSessionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribePlayerSessionsOutput(data, context); - const response: DescribePlayerSessionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribePlayerSessionsCommandError - */ -const de_DescribePlayerSessionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeRuntimeConfigurationCommand - */ -export const de_DescribeRuntimeConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeRuntimeConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeRuntimeConfigurationCommandOutput = { + const response: CreateGameSessionQueueCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5117,54 +2062,39 @@ export const de_DescribeRuntimeConfigurationCommand = async ( }; /** - * deserializeAws_json1_1DescribeRuntimeConfigurationCommandError + * deserializeAws_json1_1CreateLocationCommand */ -const de_DescribeRuntimeConfigurationCommandError = async ( +export const de_CreateLocationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateLocationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeScalingPoliciesCommand + * deserializeAws_json1_1CreateMatchmakingConfigurationCommand */ -export const de_DescribeScalingPoliciesCommand = async ( +export const de_CreateMatchmakingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeScalingPoliciesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeScalingPoliciesOutput(data, context); - const response: DescribeScalingPoliciesCommandOutput = { + contents = de_CreateMatchmakingConfigurationOutput(data, context); + const response: CreateMatchmakingConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5172,57 +2102,39 @@ export const de_DescribeScalingPoliciesCommand = async ( }; /** - * deserializeAws_json1_1DescribeScalingPoliciesCommandError + * deserializeAws_json1_1CreateMatchmakingRuleSetCommand */ -const de_DescribeScalingPoliciesCommandError = async ( +export const de_CreateMatchmakingRuleSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateMatchmakingRuleSetOutput(data, context); + const response: CreateMatchmakingRuleSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeScriptCommand + * deserializeAws_json1_1CreatePlayerSessionCommand */ -export const de_DescribeScriptCommand = async ( +export const de_CreatePlayerSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeScriptCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeScriptOutput(data, context); - const response: DescribeScriptCommandOutput = { + contents = de_CreatePlayerSessionOutput(data, context); + const response: CreatePlayerSessionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5230,54 +2142,39 @@ export const de_DescribeScriptCommand = async ( }; /** - * deserializeAws_json1_1DescribeScriptCommandError + * deserializeAws_json1_1CreatePlayerSessionsCommand */ -const de_DescribeScriptCommandError = async ( +export const de_CreatePlayerSessionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreatePlayerSessionsOutput(data, context); + const response: CreatePlayerSessionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeVpcPeeringAuthorizationsCommand + * deserializeAws_json1_1CreateScriptCommand */ -export const de_DescribeVpcPeeringAuthorizationsCommand = async ( +export const de_CreateScriptCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpcPeeringAuthorizationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeVpcPeeringAuthorizationsOutput(data, context); - const response: DescribeVpcPeeringAuthorizationsCommandOutput = { + contents = de_CreateScriptOutput(data, context); + const response: CreateScriptCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5285,51 +2182,39 @@ export const de_DescribeVpcPeeringAuthorizationsCommand = async ( }; /** - * deserializeAws_json1_1DescribeVpcPeeringAuthorizationsCommandError + * deserializeAws_json1_1CreateVpcPeeringAuthorizationCommand */ -const de_DescribeVpcPeeringAuthorizationsCommandError = async ( +export const de_CreateVpcPeeringAuthorizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateVpcPeeringAuthorizationOutput(data, context); + const response: CreateVpcPeeringAuthorizationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeVpcPeeringConnectionsCommand + * deserializeAws_json1_1CreateVpcPeeringConnectionCommand */ -export const de_DescribeVpcPeeringConnectionsCommand = async ( +export const de_CreateVpcPeeringConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeVpcPeeringConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeVpcPeeringConnectionsCommandOutput = { + const response: CreateVpcPeeringConnectionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5337,109 +2222,90 @@ export const de_DescribeVpcPeeringConnectionsCommand = async ( }; /** - * deserializeAws_json1_1DescribeVpcPeeringConnectionsCommandError + * deserializeAws_json1_1DeleteAliasCommand */ -const de_DescribeVpcPeeringConnectionsCommandError = async ( +export const de_DeleteAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeleteAliasCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DeleteBuildCommand + */ +export const de_DeleteBuildCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteBuildCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1GetComputeAccessCommand + * deserializeAws_json1_1DeleteFleetCommand */ -export const de_GetComputeAccessCommand = async ( +export const de_DeleteFleetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetComputeAccessCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetComputeAccessCommandOutput = { + await collectBody(output.body, context); + const response: DeleteFleetCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1GetComputeAccessCommandError + * deserializeAws_json1_1DeleteFleetLocationsCommand */ -const de_GetComputeAccessCommandError = async ( +export const de_DeleteFleetLocationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteFleetLocationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetComputeAuthTokenCommand + * deserializeAws_json1_1DeleteGameServerGroupCommand */ -export const de_GetComputeAuthTokenCommand = async ( +export const de_DeleteGameServerGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetComputeAuthTokenCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetComputeAuthTokenOutput(data, context); - const response: GetComputeAuthTokenCommandOutput = { + contents = de_DeleteGameServerGroupOutput(data, context); + const response: DeleteGameServerGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5447,54 +2313,39 @@ export const de_GetComputeAuthTokenCommand = async ( }; /** - * deserializeAws_json1_1GetComputeAuthTokenCommandError + * deserializeAws_json1_1DeleteGameSessionQueueCommand */ -const de_GetComputeAuthTokenCommandError = async ( +export const de_DeleteGameSessionQueueCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteGameSessionQueueCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetGameSessionLogUrlCommand + * deserializeAws_json1_1DeleteLocationCommand */ -export const de_GetGameSessionLogUrlCommand = async ( +export const de_DeleteLocationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetGameSessionLogUrlCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetGameSessionLogUrlCommandOutput = { + const response: DeleteLocationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5502,54 +2353,39 @@ export const de_GetGameSessionLogUrlCommand = async ( }; /** - * deserializeAws_json1_1GetGameSessionLogUrlCommandError + * deserializeAws_json1_1DeleteMatchmakingConfigurationCommand */ -const de_GetGameSessionLogUrlCommandError = async ( +export const de_DeleteMatchmakingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteMatchmakingConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetInstanceAccessCommand + * deserializeAws_json1_1DeleteMatchmakingRuleSetCommand */ -export const de_GetInstanceAccessCommand = async ( +export const de_DeleteMatchmakingRuleSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetInstanceAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetInstanceAccessCommandOutput = { + const response: DeleteMatchmakingRuleSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5557,54 +2393,53 @@ export const de_GetInstanceAccessCommand = async ( }; /** - * deserializeAws_json1_1GetInstanceAccessCommandError + * deserializeAws_json1_1DeleteScalingPolicyCommand */ -const de_GetInstanceAccessCommandError = async ( +export const de_DeleteScalingPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeleteScalingPolicyCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DeleteScriptCommand + */ +export const de_DeleteScriptCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteScriptCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListAliasesCommand + * deserializeAws_json1_1DeleteVpcPeeringAuthorizationCommand */ -export const de_ListAliasesCommand = async ( +export const de_DeleteVpcPeeringAuthorizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAliasesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListAliasesOutput(data, context); - const response: ListAliasesCommandOutput = { + contents = _json(data); + const response: DeleteVpcPeeringAuthorizationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5612,51 +2447,39 @@ export const de_ListAliasesCommand = async ( }; /** - * deserializeAws_json1_1ListAliasesCommandError + * deserializeAws_json1_1DeleteVpcPeeringConnectionCommand */ -const de_ListAliasesCommandError = async ( +export const de_DeleteVpcPeeringConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteVpcPeeringConnectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListBuildsCommand + * deserializeAws_json1_1DeregisterComputeCommand */ -export const de_ListBuildsCommand = async ( +export const de_DeregisterComputeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListBuildsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListBuildsOutput(data, context); - const response: ListBuildsCommandOutput = { + contents = _json(data); + const response: DeregisterComputeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5664,51 +2487,36 @@ export const de_ListBuildsCommand = async ( }; /** - * deserializeAws_json1_1ListBuildsCommandError + * deserializeAws_json1_1DeregisterGameServerCommand */ -const de_ListBuildsCommandError = async ( +export const de_DeregisterGameServerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeregisterGameServerCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListComputeCommand + * deserializeAws_json1_1DescribeAliasCommand */ -export const de_ListComputeCommand = async ( +export const de_DescribeAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListComputeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListComputeOutput(data, context); - const response: ListComputeCommandOutput = { + contents = de_DescribeAliasOutput(data, context); + const response: DescribeAliasCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5716,51 +2524,39 @@ export const de_ListComputeCommand = async ( }; /** - * deserializeAws_json1_1ListComputeCommandError + * deserializeAws_json1_1DescribeBuildCommand */ -const de_ListComputeCommandError = async ( +export const de_DescribeBuildCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeBuildOutput(data, context); + const response: DescribeBuildCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListFleetsCommand + * deserializeAws_json1_1DescribeComputeCommand */ -export const de_ListFleetsCommand = async ( +export const de_DescribeComputeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListFleetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListFleetsCommandOutput = { + contents = de_DescribeComputeOutput(data, context); + const response: DescribeComputeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5768,54 +2564,39 @@ export const de_ListFleetsCommand = async ( }; /** - * deserializeAws_json1_1ListFleetsCommandError + * deserializeAws_json1_1DescribeEC2InstanceLimitsCommand */ -const de_ListFleetsCommandError = async ( +export const de_DescribeEC2InstanceLimitsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeEC2InstanceLimitsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListGameServerGroupsCommand + * deserializeAws_json1_1DescribeFleetAttributesCommand */ -export const de_ListGameServerGroupsCommand = async ( +export const de_DescribeFleetAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListGameServerGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListGameServerGroupsOutput(data, context); - const response: ListGameServerGroupsCommandOutput = { + contents = de_DescribeFleetAttributesOutput(data, context); + const response: DescribeFleetAttributesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5823,51 +2604,39 @@ export const de_ListGameServerGroupsCommand = async ( }; /** - * deserializeAws_json1_1ListGameServerGroupsCommandError + * deserializeAws_json1_1DescribeFleetCapacityCommand */ -const de_ListGameServerGroupsCommandError = async ( +export const de_DescribeFleetCapacityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeFleetCapacityCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListGameServersCommand + * deserializeAws_json1_1DescribeFleetEventsCommand */ -export const de_ListGameServersCommand = async ( +export const de_DescribeFleetEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListGameServersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListGameServersOutput(data, context); - const response: ListGameServersCommandOutput = { + contents = de_DescribeFleetEventsOutput(data, context); + const response: DescribeFleetEventsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5875,51 +2644,39 @@ export const de_ListGameServersCommand = async ( }; /** - * deserializeAws_json1_1ListGameServersCommandError + * deserializeAws_json1_1DescribeFleetLocationAttributesCommand */ -const de_ListGameServersCommandError = async ( +export const de_DescribeFleetLocationAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeFleetLocationAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListLocationsCommand + * deserializeAws_json1_1DescribeFleetLocationCapacityCommand */ -export const de_ListLocationsCommand = async ( +export const de_DescribeFleetLocationCapacityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListLocationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListLocationsCommandOutput = { + const response: DescribeFleetLocationCapacityCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5927,51 +2684,39 @@ export const de_ListLocationsCommand = async ( }; /** - * deserializeAws_json1_1ListLocationsCommandError + * deserializeAws_json1_1DescribeFleetLocationUtilizationCommand */ -const de_ListLocationsCommandError = async ( +export const de_DescribeFleetLocationUtilizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeFleetLocationUtilizationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListScriptsCommand + * deserializeAws_json1_1DescribeFleetPortSettingsCommand */ -export const de_ListScriptsCommand = async ( +export const de_DescribeFleetPortSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListScriptsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListScriptsOutput(data, context); - const response: ListScriptsCommandOutput = { + contents = _json(data); + const response: DescribeFleetPortSettingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5979,51 +2724,39 @@ export const de_ListScriptsCommand = async ( }; /** - * deserializeAws_json1_1ListScriptsCommandError + * deserializeAws_json1_1DescribeFleetUtilizationCommand */ -const de_ListScriptsCommandError = async ( +export const de_DescribeFleetUtilizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeFleetUtilizationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1DescribeGameServerCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_DescribeGameServerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_DescribeGameServerOutput(data, context); + const response: DescribeGameServerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6031,54 +2764,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1DescribeGameServerGroupCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_DescribeGameServerGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeGameServerGroupOutput(data, context); + const response: DescribeGameServerGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutScalingPolicyCommand + * deserializeAws_json1_1DescribeGameServerInstancesCommand */ -export const de_PutScalingPolicyCommand = async ( +export const de_DescribeGameServerInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutScalingPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutScalingPolicyCommandOutput = { + const response: DescribeGameServerInstancesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6086,54 +2804,39 @@ export const de_PutScalingPolicyCommand = async ( }; /** - * deserializeAws_json1_1PutScalingPolicyCommandError + * deserializeAws_json1_1DescribeGameSessionDetailsCommand */ -const de_PutScalingPolicyCommandError = async ( +export const de_DescribeGameSessionDetailsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeGameSessionDetailsOutput(data, context); + const response: DescribeGameSessionDetailsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RegisterComputeCommand + * deserializeAws_json1_1DescribeGameSessionPlacementCommand */ -export const de_RegisterComputeCommand = async ( +export const de_DescribeGameSessionPlacementCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RegisterComputeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RegisterComputeOutput(data, context); - const response: RegisterComputeCommandOutput = { + contents = de_DescribeGameSessionPlacementOutput(data, context); + const response: DescribeGameSessionPlacementCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6141,57 +2844,59 @@ export const de_RegisterComputeCommand = async ( }; /** - * deserializeAws_json1_1RegisterComputeCommandError + * deserializeAws_json1_1DescribeGameSessionQueuesCommand */ -const de_RegisterComputeCommandError = async ( +export const de_DescribeGameSessionQueuesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeGameSessionQueuesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.gamelift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.gamelift#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DescribeGameSessionsCommand + */ +export const de_DescribeGameSessionsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeGameSessionsOutput(data, context); + const response: DescribeGameSessionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RegisterGameServerCommand + * deserializeAws_json1_1DescribeInstancesCommand */ -export const de_RegisterGameServerCommand = async ( +export const de_DescribeInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RegisterGameServerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RegisterGameServerOutput(data, context); - const response: RegisterGameServerCommandOutput = { + contents = de_DescribeInstancesOutput(data, context); + const response: DescribeInstancesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6199,57 +2904,59 @@ export const de_RegisterGameServerCommand = async ( }; /** - * deserializeAws_json1_1RegisterGameServerCommandError + * deserializeAws_json1_1DescribeMatchmakingCommand */ -const de_RegisterGameServerCommandError = async ( +export const de_DescribeMatchmakingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeMatchmakingOutput(data, context); + const response: DescribeMatchmakingCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.gamelift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.gamelift#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DescribeMatchmakingConfigurationsCommand + */ +export const de_DescribeMatchmakingConfigurationsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeMatchmakingConfigurationsOutput(data, context); + const response: DescribeMatchmakingConfigurationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RequestUploadCredentialsCommand + * deserializeAws_json1_1DescribeMatchmakingRuleSetsCommand */ -export const de_RequestUploadCredentialsCommand = async ( +export const de_DescribeMatchmakingRuleSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RequestUploadCredentialsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: RequestUploadCredentialsCommandOutput = { + contents = de_DescribeMatchmakingRuleSetsOutput(data, context); + const response: DescribeMatchmakingRuleSetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6257,54 +2964,39 @@ export const de_RequestUploadCredentialsCommand = async ( }; /** - * deserializeAws_json1_1RequestUploadCredentialsCommandError + * deserializeAws_json1_1DescribePlayerSessionsCommand */ -const de_RequestUploadCredentialsCommandError = async ( +export const de_DescribePlayerSessionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribePlayerSessionsOutput(data, context); + const response: DescribePlayerSessionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ResolveAliasCommand + * deserializeAws_json1_1DescribeRuntimeConfigurationCommand */ -export const de_ResolveAliasCommand = async ( +export const de_DescribeRuntimeConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ResolveAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ResolveAliasCommandOutput = { + const response: DescribeRuntimeConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6312,57 +3004,39 @@ export const de_ResolveAliasCommand = async ( }; /** - * deserializeAws_json1_1ResolveAliasCommandError + * deserializeAws_json1_1DescribeScalingPoliciesCommand */ -const de_ResolveAliasCommandError = async ( +export const de_DescribeScalingPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TerminalRoutingStrategyException": - case "com.amazonaws.gamelift#TerminalRoutingStrategyException": - throw await de_TerminalRoutingStrategyExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeScalingPoliciesOutput(data, context); + const response: DescribeScalingPoliciesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ResumeGameServerGroupCommand + * deserializeAws_json1_1DescribeScriptCommand */ -export const de_ResumeGameServerGroupCommand = async ( +export const de_DescribeScriptCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ResumeGameServerGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ResumeGameServerGroupOutput(data, context); - const response: ResumeGameServerGroupCommandOutput = { + contents = de_DescribeScriptOutput(data, context); + const response: DescribeScriptCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6370,54 +3044,39 @@ export const de_ResumeGameServerGroupCommand = async ( }; /** - * deserializeAws_json1_1ResumeGameServerGroupCommandError + * deserializeAws_json1_1DescribeVpcPeeringAuthorizationsCommand */ -const de_ResumeGameServerGroupCommandError = async ( +export const de_DescribeVpcPeeringAuthorizationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeVpcPeeringAuthorizationsOutput(data, context); + const response: DescribeVpcPeeringAuthorizationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SearchGameSessionsCommand + * deserializeAws_json1_1DescribeVpcPeeringConnectionsCommand */ -export const de_SearchGameSessionsCommand = async ( +export const de_DescribeVpcPeeringConnectionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SearchGameSessionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_SearchGameSessionsOutput(data, context); - const response: SearchGameSessionsCommandOutput = { + contents = _json(data); + const response: DescribeVpcPeeringConnectionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6425,60 +3084,39 @@ export const de_SearchGameSessionsCommand = async ( }; /** - * deserializeAws_json1_1SearchGameSessionsCommandError + * deserializeAws_json1_1GetComputeAccessCommand */ -const de_SearchGameSessionsCommandError = async ( +export const de_GetComputeAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TerminalRoutingStrategyException": - case "com.amazonaws.gamelift#TerminalRoutingStrategyException": - throw await de_TerminalRoutingStrategyExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetComputeAccessCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartFleetActionsCommand + * deserializeAws_json1_1GetComputeAuthTokenCommand */ -export const de_StartFleetActionsCommand = async ( +export const de_GetComputeAuthTokenCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartFleetActionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartFleetActionsCommandOutput = { + contents = de_GetComputeAuthTokenOutput(data, context); + const response: GetComputeAuthTokenCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6486,57 +3124,39 @@ export const de_StartFleetActionsCommand = async ( }; /** - * deserializeAws_json1_1StartFleetActionsCommandError + * deserializeAws_json1_1GetGameSessionLogUrlCommand */ -const de_StartFleetActionsCommandError = async ( +export const de_GetGameSessionLogUrlCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetGameSessionLogUrlCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartGameSessionPlacementCommand + * deserializeAws_json1_1GetInstanceAccessCommand */ -export const de_StartGameSessionPlacementCommand = async ( +export const de_GetInstanceAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartGameSessionPlacementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StartGameSessionPlacementOutput(data, context); - const response: StartGameSessionPlacementCommandOutput = { + contents = _json(data); + const response: GetInstanceAccessCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6544,54 +3164,39 @@ export const de_StartGameSessionPlacementCommand = async ( }; /** - * deserializeAws_json1_1StartGameSessionPlacementCommandError + * deserializeAws_json1_1ListAliasesCommand */ -const de_StartGameSessionPlacementCommandError = async ( +export const de_ListAliasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListAliasesOutput(data, context); + const response: ListAliasesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartMatchBackfillCommand + * deserializeAws_json1_1ListBuildsCommand */ -export const de_StartMatchBackfillCommand = async ( +export const de_ListBuildsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartMatchBackfillCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StartMatchBackfillOutput(data, context); - const response: StartMatchBackfillCommandOutput = { + contents = de_ListBuildsOutput(data, context); + const response: ListBuildsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6599,54 +3204,39 @@ export const de_StartMatchBackfillCommand = async ( }; /** - * deserializeAws_json1_1StartMatchBackfillCommandError + * deserializeAws_json1_1ListComputeCommand */ -const de_StartMatchBackfillCommandError = async ( +export const de_ListComputeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListComputeOutput(data, context); + const response: ListComputeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartMatchmakingCommand + * deserializeAws_json1_1ListFleetsCommand */ -export const de_StartMatchmakingCommand = async ( +export const de_ListFleetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartMatchmakingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StartMatchmakingOutput(data, context); - const response: StartMatchmakingCommandOutput = { + contents = _json(data); + const response: ListFleetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6654,54 +3244,59 @@ export const de_StartMatchmakingCommand = async ( }; /** - * deserializeAws_json1_1StartMatchmakingCommandError + * deserializeAws_json1_1ListGameServerGroupsCommand */ -const de_StartMatchmakingCommandError = async ( +export const de_ListGameServerGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListGameServerGroupsOutput(data, context); + const response: ListGameServerGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1ListGameServersCommand + */ +export const de_ListGameServersCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListGameServersOutput(data, context); + const response: ListGameServersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopFleetActionsCommand + * deserializeAws_json1_1ListLocationsCommand */ -export const de_StopFleetActionsCommand = async ( +export const de_ListLocationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopFleetActionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopFleetActionsCommandOutput = { + const response: ListLocationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6709,57 +3304,39 @@ export const de_StopFleetActionsCommand = async ( }; /** - * deserializeAws_json1_1StopFleetActionsCommandError + * deserializeAws_json1_1ListScriptsCommand */ -const de_StopFleetActionsCommandError = async ( +export const de_ListScriptsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListScriptsOutput(data, context); + const response: ListScriptsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopGameSessionPlacementCommand + * deserializeAws_json1_1ListTagsForResourceCommand */ -export const de_StopGameSessionPlacementCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopGameSessionPlacementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StopGameSessionPlacementOutput(data, context); - const response: StopGameSessionPlacementCommandOutput = { + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6767,54 +3344,39 @@ export const de_StopGameSessionPlacementCommand = async ( }; /** - * deserializeAws_json1_1StopGameSessionPlacementCommandError + * deserializeAws_json1_1PutScalingPolicyCommand */ -const de_StopGameSessionPlacementCommandError = async ( +export const de_PutScalingPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutScalingPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopMatchmakingCommand + * deserializeAws_json1_1RegisterComputeCommand */ -export const de_StopMatchmakingCommand = async ( +export const de_RegisterComputeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopMatchmakingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StopMatchmakingCommandOutput = { + contents = de_RegisterComputeOutput(data, context); + const response: RegisterComputeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6822,54 +3384,39 @@ export const de_StopMatchmakingCommand = async ( }; /** - * deserializeAws_json1_1StopMatchmakingCommandError + * deserializeAws_json1_1RegisterGameServerCommand */ -const de_StopMatchmakingCommandError = async ( +export const de_RegisterGameServerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RegisterGameServerOutput(data, context); + const response: RegisterGameServerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SuspendGameServerGroupCommand + * deserializeAws_json1_1RequestUploadCredentialsCommand */ -export const de_SuspendGameServerGroupCommand = async ( +export const de_RequestUploadCredentialsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SuspendGameServerGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_SuspendGameServerGroupOutput(data, context); - const response: SuspendGameServerGroupCommandOutput = { + contents = _json(data); + const response: RequestUploadCredentialsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6877,54 +3424,39 @@ export const de_SuspendGameServerGroupCommand = async ( }; /** - * deserializeAws_json1_1SuspendGameServerGroupCommandError + * deserializeAws_json1_1ResolveAliasCommand */ -const de_SuspendGameServerGroupCommandError = async ( +export const de_ResolveAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ResolveAliasCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1ResumeGameServerGroupCommand */ -export const de_TagResourceCommand = async ( +export const de_ResumeGameServerGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: TagResourceCommandOutput = { + contents = de_ResumeGameServerGroupOutput(data, context); + const response: ResumeGameServerGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6932,54 +3464,39 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1SearchGameSessionsCommand */ -const de_TagResourceCommandError = async ( +export const de_SearchGameSessionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SearchGameSessionsOutput(data, context); + const response: SearchGameSessionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UntagResourceCommand + * deserializeAws_json1_1StartFleetActionsCommand */ -export const de_UntagResourceCommand = async ( +export const de_StartFleetActionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UntagResourceCommandOutput = { + const response: StartFleetActionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6987,54 +3504,39 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserializeAws_json1_1StartGameSessionPlacementCommand */ -const de_UntagResourceCommandError = async ( +export const de_StartGameSessionPlacementCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TaggingFailedException": - case "com.amazonaws.gamelift#TaggingFailedException": - throw await de_TaggingFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StartGameSessionPlacementOutput(data, context); + const response: StartGameSessionPlacementCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateAliasCommand + * deserializeAws_json1_1StartMatchBackfillCommand */ -export const de_UpdateAliasCommand = async ( +export const de_StartMatchBackfillCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateAliasOutput(data, context); - const response: UpdateAliasCommandOutput = { + contents = de_StartMatchBackfillOutput(data, context); + const response: StartMatchBackfillCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7042,54 +3544,59 @@ export const de_UpdateAliasCommand = async ( }; /** - * deserializeAws_json1_1UpdateAliasCommandError + * deserializeAws_json1_1StartMatchmakingCommand */ -const de_UpdateAliasCommandError = async ( +export const de_StartMatchmakingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StartMatchmakingOutput(data, context); + const response: StartMatchmakingCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1StopFleetActionsCommand + */ +export const de_StopFleetActionsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StopFleetActionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateBuildCommand + * deserializeAws_json1_1StopGameSessionPlacementCommand */ -export const de_UpdateBuildCommand = async ( +export const de_StopGameSessionPlacementCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateBuildCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateBuildOutput(data, context); - const response: UpdateBuildCommandOutput = { + contents = de_StopGameSessionPlacementOutput(data, context); + const response: StopGameSessionPlacementCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7097,54 +3604,39 @@ export const de_UpdateBuildCommand = async ( }; /** - * deserializeAws_json1_1UpdateBuildCommandError + * deserializeAws_json1_1StopMatchmakingCommand */ -const de_UpdateBuildCommandError = async ( +export const de_StopMatchmakingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StopMatchmakingCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateFleetAttributesCommand + * deserializeAws_json1_1SuspendGameServerGroupCommand */ -export const de_UpdateFleetAttributesCommand = async ( +export const de_SuspendGameServerGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateFleetAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: UpdateFleetAttributesCommandOutput = { + contents = de_SuspendGameServerGroupOutput(data, context); + const response: SuspendGameServerGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7152,63 +3644,39 @@ export const de_UpdateFleetAttributesCommand = async ( }; /** - * deserializeAws_json1_1UpdateFleetAttributesCommandError + * deserializeAws_json1_1TagResourceCommand */ -const de_UpdateFleetAttributesCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.gamelift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidFleetStatusException": - case "com.amazonaws.gamelift#InvalidFleetStatusException": - throw await de_InvalidFleetStatusExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.gamelift#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateFleetCapacityCommand + * deserializeAws_json1_1UntagResourceCommand */ -export const de_UpdateFleetCapacityCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateFleetCapacityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateFleetCapacityCommandOutput = { + const response: UntagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7216,66 +3684,39 @@ export const de_UpdateFleetCapacityCommand = async ( }; /** - * deserializeAws_json1_1UpdateFleetCapacityCommandError + * deserializeAws_json1_1UpdateAliasCommand */ -const de_UpdateFleetCapacityCommandError = async ( +export const de_UpdateAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.gamelift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidFleetStatusException": - case "com.amazonaws.gamelift#InvalidFleetStatusException": - throw await de_InvalidFleetStatusExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.gamelift#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateAliasOutput(data, context); + const response: UpdateAliasCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateFleetPortSettingsCommand + * deserializeAws_json1_1UpdateBuildCommand */ -export const de_UpdateFleetPortSettingsCommand = async ( +export const de_UpdateBuildCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateFleetPortSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: UpdateFleetPortSettingsCommandOutput = { + contents = de_UpdateBuildOutput(data, context); + const response: UpdateBuildCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7283,63 +3724,39 @@ export const de_UpdateFleetPortSettingsCommand = async ( }; /** - * deserializeAws_json1_1UpdateFleetPortSettingsCommandError + * deserializeAws_json1_1UpdateFleetAttributesCommand */ -const de_UpdateFleetPortSettingsCommandError = async ( +export const de_UpdateFleetAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.gamelift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidFleetStatusException": - case "com.amazonaws.gamelift#InvalidFleetStatusException": - throw await de_InvalidFleetStatusExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.gamelift#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateFleetAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateGameServerCommand + * deserializeAws_json1_1UpdateFleetCapacityCommand */ -export const de_UpdateGameServerCommand = async ( +export const de_UpdateFleetCapacityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateGameServerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateGameServerOutput(data, context); - const response: UpdateGameServerCommandOutput = { + contents = _json(data); + const response: UpdateFleetCapacityCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7347,54 +3764,39 @@ export const de_UpdateGameServerCommand = async ( }; /** - * deserializeAws_json1_1UpdateGameServerCommandError + * deserializeAws_json1_1UpdateFleetPortSettingsCommand */ -const de_UpdateGameServerCommandError = async ( +export const de_UpdateFleetPortSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateFleetPortSettingsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateGameServerGroupCommand + * deserializeAws_json1_1UpdateGameServerCommand */ -export const de_UpdateGameServerGroupCommand = async ( +export const de_UpdateGameServerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateGameServerGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateGameServerGroupOutput(data, context); - const response: UpdateGameServerGroupCommandOutput = { + contents = de_UpdateGameServerOutput(data, context); + const response: UpdateGameServerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7402,38 +3804,23 @@ export const de_UpdateGameServerGroupCommand = async ( }; /** - * deserializeAws_json1_1UpdateGameServerGroupCommandError + * deserializeAws_json1_1UpdateGameServerGroupCommand */ -const de_UpdateGameServerGroupCommandError = async ( +export const de_UpdateGameServerGroupCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateGameServerGroupOutput(data, context); + const response: UpdateGameServerGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -7444,7 +3831,7 @@ export const de_UpdateGameSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateGameSessionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7456,47 +3843,6 @@ export const de_UpdateGameSessionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateGameSessionCommandError - */ -const de_UpdateGameSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.gamelift#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidGameSessionStatusException": - case "com.amazonaws.gamelift#InvalidGameSessionStatusException": - throw await de_InvalidGameSessionStatusExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateGameSessionQueueCommand */ @@ -7505,7 +3851,7 @@ export const de_UpdateGameSessionQueueCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateGameSessionQueueCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7517,41 +3863,6 @@ export const de_UpdateGameSessionQueueCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateGameSessionQueueCommandError - */ -const de_UpdateGameSessionQueueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateMatchmakingConfigurationCommand */ @@ -7560,7 +3871,7 @@ export const de_UpdateMatchmakingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateMatchmakingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7572,41 +3883,6 @@ export const de_UpdateMatchmakingConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateMatchmakingConfigurationCommandError - */ -const de_UpdateMatchmakingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedRegionException": - case "com.amazonaws.gamelift#UnsupportedRegionException": - throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateRuntimeConfigurationCommand */ @@ -7615,7 +3891,7 @@ export const de_UpdateRuntimeConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRuntimeConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7627,44 +3903,6 @@ export const de_UpdateRuntimeConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateRuntimeConfigurationCommandError - */ -const de_UpdateRuntimeConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidFleetStatusException": - case "com.amazonaws.gamelift#InvalidFleetStatusException": - throw await de_InvalidFleetStatusExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateScriptCommand */ @@ -7673,7 +3911,7 @@ export const de_UpdateScriptCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateScriptCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7685,41 +3923,6 @@ export const de_UpdateScriptCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateScriptCommandError - */ -const de_UpdateScriptCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.gamelift#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.gamelift#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.gamelift#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.gamelift#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ValidateMatchmakingRuleSetCommand */ @@ -7728,7 +3931,7 @@ export const de_ValidateMatchmakingRuleSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ValidateMatchmakingRuleSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7741,12 +3944,9 @@ export const de_ValidateMatchmakingRuleSetCommand = async ( }; /** - * deserializeAws_json1_1ValidateMatchmakingRuleSetCommandError + * deserialize_Aws_json1_1CommandError */ -const de_ValidateMatchmakingRuleSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -7759,16 +3959,52 @@ const de_ValidateMatchmakingRuleSetCommandError = async ( case "InvalidRequestException": case "com.amazonaws.gamelift#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.gamelift#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); case "UnsupportedRegionException": case "com.amazonaws.gamelift#UnsupportedRegionException": throw await de_UnsupportedRegionExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.gamelift#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "OutOfCapacityException": + case "com.amazonaws.gamelift#OutOfCapacityException": + throw await de_OutOfCapacityExceptionRes(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.gamelift#UnauthorizedException": + throw await de_UnauthorizedExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.gamelift#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "TaggingFailedException": + case "com.amazonaws.gamelift#TaggingFailedException": + throw await de_TaggingFailedExceptionRes(parsedOutput, context); + case "InvalidFleetStatusException": + case "com.amazonaws.gamelift#InvalidFleetStatusException": + throw await de_InvalidFleetStatusExceptionRes(parsedOutput, context); + case "FleetCapacityExceededException": + case "com.amazonaws.gamelift#FleetCapacityExceededException": + throw await de_FleetCapacityExceededExceptionRes(parsedOutput, context); + case "IdempotentParameterMismatchException": + case "com.amazonaws.gamelift#IdempotentParameterMismatchException": + throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); + case "TerminalRoutingStrategyException": + case "com.amazonaws.gamelift#TerminalRoutingStrategyException": + throw await de_TerminalRoutingStrategyExceptionRes(parsedOutput, context); + case "GameSessionFullException": + case "com.amazonaws.gamelift#GameSessionFullException": + throw await de_GameSessionFullExceptionRes(parsedOutput, context); + case "InvalidGameSessionStatusException": + case "com.amazonaws.gamelift#InvalidGameSessionStatusException": + throw await de_InvalidGameSessionStatusExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-glacier/src/protocols/Aws_restJson1.ts b/clients/client-glacier/src/protocols/Aws_restJson1.ts index d38a84c46278..d65706e1ed99 100644 --- a/clients/client-glacier/src/protocols/Aws_restJson1.ts +++ b/clients/client-glacier/src/protocols/Aws_restJson1.ts @@ -808,7 +808,7 @@ export const de_AbortMultipartUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_AbortMultipartUploadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -817,41 +817,6 @@ export const de_AbortMultipartUploadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AbortMultipartUploadCommandError - */ -const de_AbortMultipartUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AbortVaultLockCommand */ @@ -860,7 +825,7 @@ export const de_AbortVaultLockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_AbortVaultLockCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -869,41 +834,6 @@ export const de_AbortVaultLockCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AbortVaultLockCommandError - */ -const de_AbortVaultLockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AddTagsToVaultCommand */ @@ -912,7 +842,7 @@ export const de_AddTagsToVaultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_AddTagsToVaultCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -921,44 +851,6 @@ export const de_AddTagsToVaultCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddTagsToVaultCommandError - */ -const de_AddTagsToVaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.glacier#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CompleteMultipartUploadCommand */ @@ -967,7 +859,7 @@ export const de_CompleteMultipartUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CompleteMultipartUploadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -979,41 +871,6 @@ export const de_CompleteMultipartUploadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CompleteMultipartUploadCommandError - */ -const de_CompleteMultipartUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CompleteVaultLockCommand */ @@ -1022,7 +879,7 @@ export const de_CompleteVaultLockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_CompleteVaultLockCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1031,41 +888,6 @@ export const de_CompleteVaultLockCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CompleteVaultLockCommandError - */ -const de_CompleteVaultLockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateVaultCommand */ @@ -1074,7 +896,7 @@ export const de_CreateVaultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateVaultCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1085,49 +907,31 @@ export const de_CreateVaultCommand = async ( }; /** - * deserializeAws_restJson1CreateVaultCommandError + * deserializeAws_restJson1DeleteArchiveCommand */ -const de_CreateVaultCommandError = async ( +export const de_DeleteArchiveCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.glacier#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteArchiveCommand + * deserializeAws_restJson1DeleteVaultCommand */ -export const de_DeleteArchiveCommand = async ( +export const de_DeleteVaultCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteArchiveCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1137,49 +941,31 @@ export const de_DeleteArchiveCommand = async ( }; /** - * deserializeAws_restJson1DeleteArchiveCommandError + * deserializeAws_restJson1DeleteVaultAccessPolicyCommand */ -const de_DeleteArchiveCommandError = async ( +export const de_DeleteVaultAccessPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteVaultCommand + * deserializeAws_restJson1DeleteVaultNotificationsCommand */ -export const de_DeleteVaultCommand = async ( +export const de_DeleteVaultNotificationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVaultCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1189,153 +975,14 @@ export const de_DeleteVaultCommand = async ( }; /** - * deserializeAws_restJson1DeleteVaultCommandError + * deserializeAws_restJson1DescribeJobCommand */ -const de_DeleteVaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVaultAccessPolicyCommand - */ -export const de_DeleteVaultAccessPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVaultAccessPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVaultAccessPolicyCommandError - */ -const de_DeleteVaultAccessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVaultNotificationsCommand - */ -export const de_DeleteVaultNotificationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVaultNotificationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVaultNotificationsCommandError - */ -const de_DeleteVaultNotificationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeJobCommand - */ -export const de_DescribeJobCommand = async ( +export const de_DescribeJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1368,41 +1015,6 @@ export const de_DescribeJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeJobCommandError - */ -const de_DescribeJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeVaultCommand */ @@ -1411,7 +1023,7 @@ export const de_DescribeVaultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeVaultCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1429,41 +1041,6 @@ export const de_DescribeVaultCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeVaultCommandError - */ -const de_DescribeVaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDataRetrievalPolicyCommand */ @@ -1472,7 +1049,7 @@ export const de_GetDataRetrievalPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataRetrievalPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1485,38 +1062,6 @@ export const de_GetDataRetrievalPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDataRetrievalPolicyCommandError - */ -const de_GetDataRetrievalPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetJobOutputCommand */ @@ -1525,7 +1070,7 @@ export const de_GetJobOutputCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJobOutputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1544,41 +1089,6 @@ export const de_GetJobOutputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetJobOutputCommandError - */ -const de_GetJobOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetVaultAccessPolicyCommand */ @@ -1587,7 +1097,7 @@ export const de_GetVaultAccessPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVaultAccessPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1597,41 +1107,6 @@ export const de_GetVaultAccessPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetVaultAccessPolicyCommandError - */ -const de_GetVaultAccessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetVaultLockCommand */ @@ -1640,7 +1115,7 @@ export const de_GetVaultLockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVaultLockCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1656,41 +1131,6 @@ export const de_GetVaultLockCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetVaultLockCommandError - */ -const de_GetVaultLockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetVaultNotificationsCommand */ @@ -1699,164 +1139,53 @@ export const de_GetVaultNotificationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVaultNotificationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.vaultNotificationConfig = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetVaultNotificationsCommandError - */ -const de_GetVaultNotificationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1InitiateJobCommand - */ -export const de_InitiateJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_InitiateJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - [_lo]: [, output.headers[_lo]], - [_jI]: [, output.headers[_xaji]], - [_jOP]: [, output.headers[_xajop]], - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1InitiateJobCommandError - */ -const de_InitiateJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientCapacityException": - case "com.amazonaws.glacier#InsufficientCapacityException": - throw await de_InsufficientCapacityExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "PolicyEnforcedException": - case "com.amazonaws.glacier#PolicyEnforcedException": - throw await de_PolicyEnforcedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + contents.vaultNotificationConfig = _json(data); + return contents; }; /** - * deserializeAws_restJson1InitiateMultipartUploadCommand + * deserializeAws_restJson1InitiateJobCommand */ -export const de_InitiateMultipartUploadCommand = async ( +export const de_InitiateJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_InitiateMultipartUploadCommandError(output, context); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), [_lo]: [, output.headers[_lo]], - [_uI]: [, output.headers[_xamui]], + [_jI]: [, output.headers[_xaji]], + [_jOP]: [, output.headers[_xajop]], }); await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1InitiateMultipartUploadCommandError + * deserializeAws_restJson1InitiateMultipartUploadCommand */ -const de_InitiateMultipartUploadCommandError = async ( +export const de_InitiateMultipartUploadCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_lo]: [, output.headers[_lo]], + [_uI]: [, output.headers[_xamui]], + }); + await collectBody(output.body, context); + return contents; }; /** @@ -1867,7 +1196,7 @@ export const de_InitiateVaultLockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_InitiateVaultLockCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1877,41 +1206,6 @@ export const de_InitiateVaultLockCommand = async ( return contents; }; -/** - * deserializeAws_restJson1InitiateVaultLockCommandError - */ -const de_InitiateVaultLockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListJobsCommand */ @@ -1920,7 +1214,7 @@ export const de_ListJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1934,41 +1228,6 @@ export const de_ListJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListJobsCommandError - */ -const de_ListJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListMultipartUploadsCommand */ @@ -1977,7 +1236,7 @@ export const de_ListMultipartUploadsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMultipartUploadsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1991,41 +1250,6 @@ export const de_ListMultipartUploadsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListMultipartUploadsCommandError - */ -const de_ListMultipartUploadsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPartsCommand */ @@ -2034,7 +1258,7 @@ export const de_ListPartsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPartsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2053,41 +1277,6 @@ export const de_ListPartsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListPartsCommandError - */ -const de_ListPartsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProvisionedCapacityCommand */ @@ -2096,7 +1285,7 @@ export const de_ListProvisionedCapacityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProvisionedCapacityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2110,148 +1299,46 @@ export const de_ListProvisionedCapacityCommand = async ( }; /** - * deserializeAws_restJson1ListProvisionedCapacityCommandError - */ -const de_ListProvisionedCapacityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForVaultCommand - */ -export const de_ListTagsForVaultCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForVaultCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForVaultCommandError - */ -const de_ListTagsForVaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListVaultsCommand + * deserializeAws_restJson1ListTagsForVaultCommand */ -export const de_ListVaultsCommand = async ( +export const de_ListTagsForVaultCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVaultsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Marker: __expectString, - VaultList: _json, + Tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListVaultsCommandError + * deserializeAws_restJson1ListVaultsCommand */ -const de_ListVaultsCommandError = async ( +export const de_ListVaultsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Marker: __expectString, + VaultList: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2262,7 +1349,7 @@ export const de_PurchaseProvisionedCapacityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_PurchaseProvisionedCapacityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2272,41 +1359,6 @@ export const de_PurchaseProvisionedCapacityCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PurchaseProvisionedCapacityCommandError - */ -const de_PurchaseProvisionedCapacityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.glacier#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RemoveTagsFromVaultCommand */ @@ -2315,7 +1367,7 @@ export const de_RemoveTagsFromVaultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_RemoveTagsFromVaultCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2324,41 +1376,6 @@ export const de_RemoveTagsFromVaultCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RemoveTagsFromVaultCommandError - */ -const de_RemoveTagsFromVaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SetDataRetrievalPolicyCommand */ @@ -2367,7 +1384,7 @@ export const de_SetDataRetrievalPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_SetDataRetrievalPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2376,38 +1393,6 @@ export const de_SetDataRetrievalPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SetDataRetrievalPolicyCommandError - */ -const de_SetDataRetrievalPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SetVaultAccessPolicyCommand */ @@ -2416,7 +1401,7 @@ export const de_SetVaultAccessPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_SetVaultAccessPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2425,41 +1410,6 @@ export const de_SetVaultAccessPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SetVaultAccessPolicyCommandError - */ -const de_SetVaultAccessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SetVaultNotificationsCommand */ @@ -2468,7 +1418,7 @@ export const de_SetVaultNotificationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_SetVaultNotificationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2477,41 +1427,6 @@ export const de_SetVaultNotificationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SetVaultNotificationsCommandError - */ -const de_SetVaultNotificationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UploadArchiveCommand */ @@ -2520,7 +1435,7 @@ export const de_UploadArchiveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_UploadArchiveCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2532,44 +1447,6 @@ export const de_UploadArchiveCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UploadArchiveCommandError - */ -const de_UploadArchiveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.glacier#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "MissingParameterValueException": - case "com.amazonaws.glacier#MissingParameterValueException": - throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.glacier#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.glacier#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.glacier#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UploadMultipartPartCommand */ @@ -2578,7 +1455,7 @@ export const de_UploadMultipartPartCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UploadMultipartPartCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2589,12 +1466,9 @@ export const de_UploadMultipartPartCommand = async ( }; /** - * deserializeAws_restJson1UploadMultipartPartCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UploadMultipartPartCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2607,22 +1481,31 @@ const de_UploadMultipartPartCommandError = async ( case "MissingParameterValueException": case "com.amazonaws.glacier#MissingParameterValueException": throw await de_MissingParameterValueExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.glacier#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.glacier#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ServiceUnavailableException": case "com.amazonaws.glacier#ServiceUnavailableException": throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.glacier#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "InsufficientCapacityException": + case "com.amazonaws.glacier#InsufficientCapacityException": + throw await de_InsufficientCapacityExceptionRes(parsedOutput, context); + case "PolicyEnforcedException": + case "com.amazonaws.glacier#PolicyEnforcedException": + throw await de_PolicyEnforcedExceptionRes(parsedOutput, context); + case "RequestTimeoutException": + case "com.amazonaws.glacier#RequestTimeoutException": + throw await de_RequestTimeoutExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts b/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts index c93912d9778b..d29150911a7d 100644 --- a/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts +++ b/clients/client-global-accelerator/src/protocols/Aws_json1_1.ts @@ -1047,7 +1047,7 @@ export const de_AddCustomRoutingEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddCustomRoutingEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1059,50 +1059,6 @@ export const de_AddCustomRoutingEndpointsCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddCustomRoutingEndpointsCommandError - */ -const de_AddCustomRoutingEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.globalaccelerator#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "EndpointAlreadyExistsException": - case "com.amazonaws.globalaccelerator#EndpointAlreadyExistsException": - throw await de_EndpointAlreadyExistsExceptionRes(parsedOutput, context); - case "EndpointGroupNotFoundException": - case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": - throw await de_EndpointGroupNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.globalaccelerator#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddEndpointsCommand */ @@ -1111,7 +1067,7 @@ export const de_AddEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1123,47 +1079,6 @@ export const de_AddEndpointsCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddEndpointsCommandError - */ -const de_AddEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EndpointGroupNotFoundException": - case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": - throw await de_EndpointGroupNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.globalaccelerator#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TransactionInProgressException": - case "com.amazonaws.globalaccelerator#TransactionInProgressException": - throw await de_TransactionInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AdvertiseByoipCidrCommand */ @@ -1172,7 +1087,7 @@ export const de_AdvertiseByoipCidrCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AdvertiseByoipCidrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1184,44 +1099,6 @@ export const de_AdvertiseByoipCidrCommand = async ( return response; }; -/** - * deserializeAws_json1_1AdvertiseByoipCidrCommandError - */ -const de_AdvertiseByoipCidrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ByoipCidrNotFoundException": - case "com.amazonaws.globalaccelerator#ByoipCidrNotFoundException": - throw await de_ByoipCidrNotFoundExceptionRes(parsedOutput, context); - case "IncorrectCidrStateException": - case "com.amazonaws.globalaccelerator#IncorrectCidrStateException": - throw await de_IncorrectCidrStateExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AllowCustomRoutingTrafficCommand */ @@ -1230,7 +1107,7 @@ export const de_AllowCustomRoutingTrafficCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AllowCustomRoutingTrafficCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AllowCustomRoutingTrafficCommandOutput = { @@ -1239,38 +1116,6 @@ export const de_AllowCustomRoutingTrafficCommand = async ( return response; }; -/** - * deserializeAws_json1_1AllowCustomRoutingTrafficCommandError - */ -const de_AllowCustomRoutingTrafficCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EndpointGroupNotFoundException": - case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": - throw await de_EndpointGroupNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAcceleratorCommand */ @@ -1279,7 +1124,7 @@ export const de_CreateAcceleratorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAcceleratorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1291,38 +1136,6 @@ export const de_CreateAcceleratorCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAcceleratorCommandError - */ -const de_CreateAcceleratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.globalaccelerator#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateCrossAccountAttachmentCommand */ @@ -1331,7 +1144,7 @@ export const de_CreateCrossAccountAttachmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCrossAccountAttachmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1343,44 +1156,6 @@ export const de_CreateCrossAccountAttachmentCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCrossAccountAttachmentCommandError - */ -const de_CreateCrossAccountAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.globalaccelerator#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TransactionInProgressException": - case "com.amazonaws.globalaccelerator#TransactionInProgressException": - throw await de_TransactionInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateCustomRoutingAcceleratorCommand */ @@ -1389,7 +1164,7 @@ export const de_CreateCustomRoutingAcceleratorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCustomRoutingAcceleratorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1402,54 +1177,39 @@ export const de_CreateCustomRoutingAcceleratorCommand = async ( }; /** - * deserializeAws_json1_1CreateCustomRoutingAcceleratorCommandError + * deserializeAws_json1_1CreateCustomRoutingEndpointGroupCommand */ -const de_CreateCustomRoutingAcceleratorCommandError = async ( +export const de_CreateCustomRoutingEndpointGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.globalaccelerator#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateCustomRoutingEndpointGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateCustomRoutingEndpointGroupCommand + * deserializeAws_json1_1CreateCustomRoutingListenerCommand */ -export const de_CreateCustomRoutingEndpointGroupCommand = async ( +export const de_CreateCustomRoutingListenerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateCustomRoutingEndpointGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateCustomRoutingEndpointGroupCommandOutput = { + const response: CreateCustomRoutingListenerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1457,119 +1217,14 @@ export const de_CreateCustomRoutingEndpointGroupCommand = async ( }; /** - * deserializeAws_json1_1CreateCustomRoutingEndpointGroupCommandError + * deserializeAws_json1_1CreateEndpointGroupCommand */ -const de_CreateCustomRoutingEndpointGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EndpointGroupAlreadyExistsException": - case "com.amazonaws.globalaccelerator#EndpointGroupAlreadyExistsException": - throw await de_EndpointGroupAlreadyExistsExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidPortRangeException": - case "com.amazonaws.globalaccelerator#InvalidPortRangeException": - throw await de_InvalidPortRangeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.globalaccelerator#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ListenerNotFoundException": - case "com.amazonaws.globalaccelerator#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateCustomRoutingListenerCommand - */ -export const de_CreateCustomRoutingListenerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateCustomRoutingListenerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateCustomRoutingListenerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateCustomRoutingListenerCommandError - */ -const de_CreateCustomRoutingListenerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidPortRangeException": - case "com.amazonaws.globalaccelerator#InvalidPortRangeException": - throw await de_InvalidPortRangeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.globalaccelerator#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateEndpointGroupCommand - */ -export const de_CreateEndpointGroupCommand = async ( +export const de_CreateEndpointGroupCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEndpointGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1581,50 +1236,6 @@ export const de_CreateEndpointGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateEndpointGroupCommandError - */ -const de_CreateEndpointGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EndpointGroupAlreadyExistsException": - case "com.amazonaws.globalaccelerator#EndpointGroupAlreadyExistsException": - throw await de_EndpointGroupAlreadyExistsExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.globalaccelerator#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ListenerNotFoundException": - case "com.amazonaws.globalaccelerator#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateListenerCommand */ @@ -1633,7 +1244,7 @@ export const de_CreateListenerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateListenerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1645,44 +1256,6 @@ export const de_CreateListenerCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateListenerCommandError - */ -const de_CreateListenerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidPortRangeException": - case "com.amazonaws.globalaccelerator#InvalidPortRangeException": - throw await de_InvalidPortRangeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.globalaccelerator#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAcceleratorCommand */ @@ -1691,7 +1264,7 @@ export const de_DeleteAcceleratorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAcceleratorCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteAcceleratorCommandOutput = { @@ -1700,44 +1273,6 @@ export const de_DeleteAcceleratorCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAcceleratorCommandError - */ -const de_DeleteAcceleratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotDisabledException": - case "com.amazonaws.globalaccelerator#AcceleratorNotDisabledException": - throw await de_AcceleratorNotDisabledExceptionRes(parsedOutput, context); - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "AssociatedListenerFoundException": - case "com.amazonaws.globalaccelerator#AssociatedListenerFoundException": - throw await de_AssociatedListenerFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteCrossAccountAttachmentCommand */ @@ -1746,7 +1281,7 @@ export const de_DeleteCrossAccountAttachmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCrossAccountAttachmentCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteCrossAccountAttachmentCommandOutput = { @@ -1756,1268 +1291,121 @@ export const de_DeleteCrossAccountAttachmentCommand = async ( }; /** - * deserializeAws_json1_1DeleteCrossAccountAttachmentCommandError + * deserializeAws_json1_1DeleteCustomRoutingAcceleratorCommand */ -const de_DeleteCrossAccountAttachmentCommandError = async ( +export const de_DeleteCustomRoutingAcceleratorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AttachmentNotFoundException": - case "com.amazonaws.globalaccelerator#AttachmentNotFoundException": - throw await de_AttachmentNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "TransactionInProgressException": - case "com.amazonaws.globalaccelerator#TransactionInProgressException": - throw await de_TransactionInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteCustomRoutingAcceleratorCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteCustomRoutingAcceleratorCommand + * deserializeAws_json1_1DeleteCustomRoutingEndpointGroupCommand */ -export const de_DeleteCustomRoutingAcceleratorCommand = async ( +export const de_DeleteCustomRoutingEndpointGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteCustomRoutingAcceleratorCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteCustomRoutingAcceleratorCommandOutput = { + const response: DeleteCustomRoutingEndpointGroupCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteCustomRoutingAcceleratorCommandError + * deserializeAws_json1_1DeleteCustomRoutingListenerCommand */ -const de_DeleteCustomRoutingAcceleratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotDisabledException": - case "com.amazonaws.globalaccelerator#AcceleratorNotDisabledException": - throw await de_AcceleratorNotDisabledExceptionRes(parsedOutput, context); - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "AssociatedListenerFoundException": - case "com.amazonaws.globalaccelerator#AssociatedListenerFoundException": - throw await de_AssociatedListenerFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteCustomRoutingEndpointGroupCommand - */ -export const de_DeleteCustomRoutingEndpointGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteCustomRoutingEndpointGroupCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteCustomRoutingEndpointGroupCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteCustomRoutingEndpointGroupCommandError - */ -const de_DeleteCustomRoutingEndpointGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EndpointGroupNotFoundException": - case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": - throw await de_EndpointGroupNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteCustomRoutingListenerCommand - */ -export const de_DeleteCustomRoutingListenerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteCustomRoutingListenerCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteCustomRoutingListenerCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteCustomRoutingListenerCommandError - */ -const de_DeleteCustomRoutingListenerCommandError = async ( +export const de_DeleteCustomRoutingListenerCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AssociatedEndpointGroupFoundException": - case "com.amazonaws.globalaccelerator#AssociatedEndpointGroupFoundException": - throw await de_AssociatedEndpointGroupFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ListenerNotFoundException": - case "com.amazonaws.globalaccelerator#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteEndpointGroupCommand - */ -export const de_DeleteEndpointGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteEndpointGroupCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteEndpointGroupCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteEndpointGroupCommandError - */ -const de_DeleteEndpointGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EndpointGroupNotFoundException": - case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": - throw await de_EndpointGroupNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteListenerCommand - */ -export const de_DeleteListenerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteListenerCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteListenerCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteListenerCommandError - */ -const de_DeleteListenerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AssociatedEndpointGroupFoundException": - case "com.amazonaws.globalaccelerator#AssociatedEndpointGroupFoundException": - throw await de_AssociatedEndpointGroupFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ListenerNotFoundException": - case "com.amazonaws.globalaccelerator#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DenyCustomRoutingTrafficCommand - */ -export const de_DenyCustomRoutingTrafficCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { if (output.statusCode >= 300) { - return de_DenyCustomRoutingTrafficCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DenyCustomRoutingTrafficCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DenyCustomRoutingTrafficCommandError - */ -const de_DenyCustomRoutingTrafficCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EndpointGroupNotFoundException": - case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": - throw await de_EndpointGroupNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeprovisionByoipCidrCommand - */ -export const de_DeprovisionByoipCidrCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeprovisionByoipCidrCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeprovisionByoipCidrResponse(data, context); - const response: DeprovisionByoipCidrCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeprovisionByoipCidrCommandError - */ -const de_DeprovisionByoipCidrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ByoipCidrNotFoundException": - case "com.amazonaws.globalaccelerator#ByoipCidrNotFoundException": - throw await de_ByoipCidrNotFoundExceptionRes(parsedOutput, context); - case "IncorrectCidrStateException": - case "com.amazonaws.globalaccelerator#IncorrectCidrStateException": - throw await de_IncorrectCidrStateExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAcceleratorCommand - */ -export const de_DescribeAcceleratorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAcceleratorCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeAcceleratorResponse(data, context); - const response: DescribeAcceleratorCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAcceleratorCommandError - */ -const de_DescribeAcceleratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAcceleratorAttributesCommand - */ -export const de_DescribeAcceleratorAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAcceleratorAttributesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeAcceleratorAttributesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAcceleratorAttributesCommandError - */ -const de_DescribeAcceleratorAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeCrossAccountAttachmentCommand - */ -export const de_DescribeCrossAccountAttachmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeCrossAccountAttachmentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeCrossAccountAttachmentResponse(data, context); - const response: DescribeCrossAccountAttachmentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeCrossAccountAttachmentCommandError - */ -const de_DescribeCrossAccountAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AttachmentNotFoundException": - case "com.amazonaws.globalaccelerator#AttachmentNotFoundException": - throw await de_AttachmentNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeCustomRoutingAcceleratorCommand - */ -export const de_DescribeCustomRoutingAcceleratorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeCustomRoutingAcceleratorCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeCustomRoutingAcceleratorResponse(data, context); - const response: DescribeCustomRoutingAcceleratorCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeCustomRoutingAcceleratorCommandError - */ -const de_DescribeCustomRoutingAcceleratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeCustomRoutingAcceleratorAttributesCommand - */ -export const de_DescribeCustomRoutingAcceleratorAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeCustomRoutingAcceleratorAttributesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeCustomRoutingAcceleratorAttributesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeCustomRoutingAcceleratorAttributesCommandError - */ -const de_DescribeCustomRoutingAcceleratorAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeCustomRoutingEndpointGroupCommand - */ -export const de_DescribeCustomRoutingEndpointGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeCustomRoutingEndpointGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeCustomRoutingEndpointGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeCustomRoutingEndpointGroupCommandError - */ -const de_DescribeCustomRoutingEndpointGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EndpointGroupNotFoundException": - case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": - throw await de_EndpointGroupNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeCustomRoutingListenerCommand - */ -export const de_DescribeCustomRoutingListenerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeCustomRoutingListenerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeCustomRoutingListenerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeCustomRoutingListenerCommandError - */ -const de_DescribeCustomRoutingListenerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ListenerNotFoundException": - case "com.amazonaws.globalaccelerator#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeEndpointGroupCommand - */ -export const de_DescribeEndpointGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeEndpointGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeEndpointGroupResponse(data, context); - const response: DescribeEndpointGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeEndpointGroupCommandError - */ -const de_DescribeEndpointGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EndpointGroupNotFoundException": - case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": - throw await de_EndpointGroupNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeListenerCommand - */ -export const de_DescribeListenerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeListenerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeListenerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeListenerCommandError - */ -const de_DescribeListenerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ListenerNotFoundException": - case "com.amazonaws.globalaccelerator#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAcceleratorsCommand - */ -export const de_ListAcceleratorsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAcceleratorsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListAcceleratorsResponse(data, context); - const response: ListAcceleratorsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAcceleratorsCommandError - */ -const de_ListAcceleratorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.globalaccelerator#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListByoipCidrsCommand - */ -export const de_ListByoipCidrsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListByoipCidrsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListByoipCidrsResponse(data, context); - const response: ListByoipCidrsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListByoipCidrsCommandError - */ -const de_ListByoipCidrsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.globalaccelerator#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListCrossAccountAttachmentsCommand - */ -export const de_ListCrossAccountAttachmentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListCrossAccountAttachmentsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListCrossAccountAttachmentsResponse(data, context); - const response: ListCrossAccountAttachmentsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListCrossAccountAttachmentsCommandError - */ -const de_ListCrossAccountAttachmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.globalaccelerator#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListCrossAccountResourceAccountsCommand - */ -export const de_ListCrossAccountResourceAccountsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListCrossAccountResourceAccountsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListCrossAccountResourceAccountsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListCrossAccountResourceAccountsCommandError - */ -const de_ListCrossAccountResourceAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListCrossAccountResourcesCommand - */ -export const de_ListCrossAccountResourcesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListCrossAccountResourcesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListCrossAccountResourcesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListCrossAccountResourcesCommandError - */ -const de_ListCrossAccountResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.globalaccelerator#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListCustomRoutingAcceleratorsCommand - */ -export const de_ListCustomRoutingAcceleratorsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListCustomRoutingAcceleratorsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListCustomRoutingAcceleratorsResponse(data, context); - const response: ListCustomRoutingAcceleratorsCommandOutput = { + await collectBody(output.body, context); + const response: DeleteCustomRoutingListenerCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1ListCustomRoutingAcceleratorsCommandError + * deserializeAws_json1_1DeleteEndpointGroupCommand */ -const de_ListCustomRoutingAcceleratorsCommandError = async ( +export const de_DeleteEndpointGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.globalaccelerator#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteEndpointGroupCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListCustomRoutingEndpointGroupsCommand + * deserializeAws_json1_1DeleteListenerCommand */ -export const de_ListCustomRoutingEndpointGroupsCommand = async ( +export const de_DeleteListenerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListCustomRoutingEndpointGroupsCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListCustomRoutingEndpointGroupsCommandOutput = { + await collectBody(output.body, context); + const response: DeleteListenerCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1ListCustomRoutingEndpointGroupsCommandError + * deserializeAws_json1_1DenyCustomRoutingTrafficCommand */ -const de_ListCustomRoutingEndpointGroupsCommandError = async ( +export const de_DenyCustomRoutingTrafficCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.globalaccelerator#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ListenerNotFoundException": - case "com.amazonaws.globalaccelerator#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DenyCustomRoutingTrafficCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListCustomRoutingListenersCommand + * deserializeAws_json1_1DeprovisionByoipCidrCommand */ -export const de_ListCustomRoutingListenersCommand = async ( +export const de_DeprovisionByoipCidrCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListCustomRoutingListenersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListCustomRoutingListenersCommandOutput = { + contents = de_DeprovisionByoipCidrResponse(data, context); + const response: DeprovisionByoipCidrCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3025,54 +1413,39 @@ export const de_ListCustomRoutingListenersCommand = async ( }; /** - * deserializeAws_json1_1ListCustomRoutingListenersCommandError + * deserializeAws_json1_1DescribeAcceleratorCommand */ -const de_ListCustomRoutingListenersCommandError = async ( +export const de_DescribeAcceleratorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.globalaccelerator#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeAcceleratorResponse(data, context); + const response: DescribeAcceleratorCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListCustomRoutingPortMappingsCommand + * deserializeAws_json1_1DescribeAcceleratorAttributesCommand */ -export const de_ListCustomRoutingPortMappingsCommand = async ( +export const de_DescribeAcceleratorAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListCustomRoutingPortMappingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListCustomRoutingPortMappingsCommandOutput = { + const response: DescribeAcceleratorAttributesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3080,57 +1453,19 @@ export const de_ListCustomRoutingPortMappingsCommand = async ( }; /** - * deserializeAws_json1_1ListCustomRoutingPortMappingsCommandError - */ -const de_ListCustomRoutingPortMappingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "EndpointGroupNotFoundException": - case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": - throw await de_EndpointGroupNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.globalaccelerator#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListCustomRoutingPortMappingsByDestinationCommand + * deserializeAws_json1_1DescribeCrossAccountAttachmentCommand */ -export const de_ListCustomRoutingPortMappingsByDestinationCommand = async ( +export const de_DescribeCrossAccountAttachmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListCustomRoutingPortMappingsByDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListCustomRoutingPortMappingsByDestinationCommandOutput = { + contents = de_DescribeCrossAccountAttachmentResponse(data, context); + const response: DescribeCrossAccountAttachmentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3138,54 +1473,39 @@ export const de_ListCustomRoutingPortMappingsByDestinationCommand = async ( }; /** - * deserializeAws_json1_1ListCustomRoutingPortMappingsByDestinationCommandError + * deserializeAws_json1_1DescribeCustomRoutingAcceleratorCommand */ -const de_ListCustomRoutingPortMappingsByDestinationCommandError = async ( +export const de_DescribeCustomRoutingAcceleratorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EndpointNotFoundException": - case "com.amazonaws.globalaccelerator#EndpointNotFoundException": - throw await de_EndpointNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.globalaccelerator#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeCustomRoutingAcceleratorResponse(data, context); + const response: DescribeCustomRoutingAcceleratorCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListEndpointGroupsCommand + * deserializeAws_json1_1DescribeCustomRoutingAcceleratorAttributesCommand */ -export const de_ListEndpointGroupsCommand = async ( +export const de_DescribeCustomRoutingAcceleratorAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListEndpointGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListEndpointGroupsResponse(data, context); - const response: ListEndpointGroupsCommandOutput = { + contents = _json(data); + const response: DescribeCustomRoutingAcceleratorAttributesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3193,54 +1513,39 @@ export const de_ListEndpointGroupsCommand = async ( }; /** - * deserializeAws_json1_1ListEndpointGroupsCommandError + * deserializeAws_json1_1DescribeCustomRoutingEndpointGroupCommand */ -const de_ListEndpointGroupsCommandError = async ( +export const de_DescribeCustomRoutingEndpointGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.globalaccelerator#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ListenerNotFoundException": - case "com.amazonaws.globalaccelerator#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeCustomRoutingEndpointGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListListenersCommand + * deserializeAws_json1_1DescribeCustomRoutingListenerCommand */ -export const de_ListListenersCommand = async ( +export const de_DescribeCustomRoutingListenerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListListenersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListListenersCommandOutput = { + const response: DescribeCustomRoutingListenerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3248,54 +1553,39 @@ export const de_ListListenersCommand = async ( }; /** - * deserializeAws_json1_1ListListenersCommandError + * deserializeAws_json1_1DescribeEndpointGroupCommand */ -const de_ListListenersCommandError = async ( +export const de_DescribeEndpointGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.globalaccelerator#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeEndpointGroupResponse(data, context); + const response: DescribeEndpointGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1DescribeListenerCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_DescribeListenerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + const response: DescribeListenerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3303,51 +1593,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1ListAcceleratorsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListAcceleratorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListAcceleratorsResponse(data, context); + const response: ListAcceleratorsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ProvisionByoipCidrCommand + * deserializeAws_json1_1ListByoipCidrsCommand */ -export const de_ProvisionByoipCidrCommand = async ( +export const de_ListByoipCidrsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ProvisionByoipCidrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ProvisionByoipCidrResponse(data, context); - const response: ProvisionByoipCidrCommandOutput = { + contents = de_ListByoipCidrsResponse(data, context); + const response: ListByoipCidrsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3355,170 +1633,119 @@ export const de_ProvisionByoipCidrCommand = async ( }; /** - * deserializeAws_json1_1ProvisionByoipCidrCommandError + * deserializeAws_json1_1ListCrossAccountAttachmentsCommand */ -const de_ProvisionByoipCidrCommandError = async ( +export const de_ListCrossAccountAttachmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncorrectCidrStateException": - case "com.amazonaws.globalaccelerator#IncorrectCidrStateException": - throw await de_IncorrectCidrStateExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.globalaccelerator#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListCrossAccountAttachmentsResponse(data, context); + const response: ListCrossAccountAttachmentsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RemoveCustomRoutingEndpointsCommand + * deserializeAws_json1_1ListCrossAccountResourceAccountsCommand */ -export const de_RemoveCustomRoutingEndpointsCommand = async ( +export const de_ListCrossAccountResourceAccountsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RemoveCustomRoutingEndpointsCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: RemoveCustomRoutingEndpointsCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListCrossAccountResourceAccountsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1RemoveCustomRoutingEndpointsCommandError + * deserializeAws_json1_1ListCrossAccountResourcesCommand */ -const de_RemoveCustomRoutingEndpointsCommandError = async ( +export const de_ListCrossAccountResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.globalaccelerator#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "EndpointGroupNotFoundException": - case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": - throw await de_EndpointGroupNotFoundExceptionRes(parsedOutput, context); - case "EndpointNotFoundException": - case "com.amazonaws.globalaccelerator#EndpointNotFoundException": - throw await de_EndpointNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListCrossAccountResourcesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RemoveEndpointsCommand + * deserializeAws_json1_1ListCustomRoutingAcceleratorsCommand */ -export const de_RemoveEndpointsCommand = async ( +export const de_ListCustomRoutingAcceleratorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RemoveEndpointsCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: RemoveEndpointsCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListCustomRoutingAcceleratorsResponse(data, context); + const response: ListCustomRoutingAcceleratorsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1RemoveEndpointsCommandError + * deserializeAws_json1_1ListCustomRoutingEndpointGroupsCommand */ -const de_RemoveEndpointsCommandError = async ( +export const de_ListCustomRoutingEndpointGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EndpointGroupNotFoundException": - case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": - throw await de_EndpointGroupNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "TransactionInProgressException": - case "com.amazonaws.globalaccelerator#TransactionInProgressException": - throw await de_TransactionInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListCustomRoutingEndpointGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1ListCustomRoutingListenersCommand */ -export const de_TagResourceCommand = async ( +export const de_ListCustomRoutingListenersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: ListCustomRoutingListenersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3526,51 +1753,39 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1ListCustomRoutingPortMappingsCommand */ -const de_TagResourceCommandError = async ( +export const de_ListCustomRoutingPortMappingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListCustomRoutingPortMappingsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UntagResourceCommand + * deserializeAws_json1_1ListCustomRoutingPortMappingsByDestinationCommand */ -export const de_UntagResourceCommand = async ( +export const de_ListCustomRoutingPortMappingsByDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UntagResourceCommandOutput = { + const response: ListCustomRoutingPortMappingsByDestinationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3578,51 +1793,39 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserializeAws_json1_1ListEndpointGroupsCommand */ -const de_UntagResourceCommandError = async ( +export const de_ListEndpointGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListEndpointGroupsResponse(data, context); + const response: ListEndpointGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateAcceleratorCommand + * deserializeAws_json1_1ListListenersCommand */ -export const de_UpdateAcceleratorCommand = async ( +export const de_ListListenersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateAcceleratorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateAcceleratorResponse(data, context); - const response: UpdateAcceleratorCommandOutput = { + contents = _json(data); + const response: ListListenersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3630,54 +1833,39 @@ export const de_UpdateAcceleratorCommand = async ( }; /** - * deserializeAws_json1_1UpdateAcceleratorCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_UpdateAcceleratorCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateAcceleratorAttributesCommand + * deserializeAws_json1_1ProvisionByoipCidrCommand */ -export const de_UpdateAcceleratorAttributesCommand = async ( +export const de_ProvisionByoipCidrCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateAcceleratorAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: UpdateAcceleratorAttributesCommandOutput = { + contents = de_ProvisionByoipCidrResponse(data, context); + const response: ProvisionByoipCidrCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3685,54 +1873,53 @@ export const de_UpdateAcceleratorAttributesCommand = async ( }; /** - * deserializeAws_json1_1UpdateAcceleratorAttributesCommandError + * deserializeAws_json1_1RemoveCustomRoutingEndpointsCommand */ -const de_UpdateAcceleratorAttributesCommandError = async ( +export const de_RemoveCustomRoutingEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: RemoveCustomRoutingEndpointsCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1RemoveEndpointsCommand + */ +export const de_RemoveEndpointsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: RemoveEndpointsCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1UpdateCrossAccountAttachmentCommand + * deserializeAws_json1_1TagResourceCommand */ -export const de_UpdateCrossAccountAttachmentCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateCrossAccountAttachmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateCrossAccountAttachmentResponse(data, context); - const response: UpdateCrossAccountAttachmentCommandOutput = { + contents = _json(data); + const response: TagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3740,60 +1927,59 @@ export const de_UpdateCrossAccountAttachmentCommand = async ( }; /** - * deserializeAws_json1_1UpdateCrossAccountAttachmentCommandError + * deserializeAws_json1_1UntagResourceCommand */ -const de_UpdateCrossAccountAttachmentCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AttachmentNotFoundException": - case "com.amazonaws.globalaccelerator#AttachmentNotFoundException": - throw await de_AttachmentNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.globalaccelerator#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TransactionInProgressException": - case "com.amazonaws.globalaccelerator#TransactionInProgressException": - throw await de_TransactionInProgressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1UpdateAcceleratorCommand + */ +export const de_UpdateAcceleratorCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateAcceleratorResponse(data, context); + const response: UpdateAcceleratorCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateCustomRoutingAcceleratorCommand + * deserializeAws_json1_1UpdateAcceleratorAttributesCommand */ -export const de_UpdateCustomRoutingAcceleratorCommand = async ( +export const de_UpdateAcceleratorAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateCustomRoutingAcceleratorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateCustomRoutingAcceleratorResponse(data, context); - const response: UpdateCustomRoutingAcceleratorCommandOutput = { + contents = _json(data); + const response: UpdateAcceleratorAttributesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3801,51 +1987,39 @@ export const de_UpdateCustomRoutingAcceleratorCommand = async ( }; /** - * deserializeAws_json1_1UpdateCustomRoutingAcceleratorCommandError + * deserializeAws_json1_1UpdateCrossAccountAttachmentCommand */ -const de_UpdateCustomRoutingAcceleratorCommandError = async ( +export const de_UpdateCrossAccountAttachmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateCrossAccountAttachmentResponse(data, context); + const response: UpdateCrossAccountAttachmentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateCustomRoutingAcceleratorAttributesCommand + * deserializeAws_json1_1UpdateCustomRoutingAcceleratorCommand */ -export const de_UpdateCustomRoutingAcceleratorAttributesCommand = async ( +export const de_UpdateCustomRoutingAcceleratorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateCustomRoutingAcceleratorAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: UpdateCustomRoutingAcceleratorAttributesCommandOutput = { + contents = de_UpdateCustomRoutingAcceleratorResponse(data, context); + const response: UpdateCustomRoutingAcceleratorCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3853,38 +2027,23 @@ export const de_UpdateCustomRoutingAcceleratorAttributesCommand = async ( }; /** - * deserializeAws_json1_1UpdateCustomRoutingAcceleratorAttributesCommandError + * deserializeAws_json1_1UpdateCustomRoutingAcceleratorAttributesCommand */ -const de_UpdateCustomRoutingAcceleratorAttributesCommandError = async ( +export const de_UpdateCustomRoutingAcceleratorAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AcceleratorNotFoundException": - case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": - throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateCustomRoutingAcceleratorAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3895,7 +2054,7 @@ export const de_UpdateCustomRoutingListenerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateCustomRoutingListenerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3907,44 +2066,6 @@ export const de_UpdateCustomRoutingListenerCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateCustomRoutingListenerCommandError - */ -const de_UpdateCustomRoutingListenerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidPortRangeException": - case "com.amazonaws.globalaccelerator#InvalidPortRangeException": - throw await de_InvalidPortRangeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.globalaccelerator#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ListenerNotFoundException": - case "com.amazonaws.globalaccelerator#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateEndpointGroupCommand */ @@ -3953,7 +2074,7 @@ export const de_UpdateEndpointGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateEndpointGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3965,44 +2086,6 @@ export const de_UpdateEndpointGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateEndpointGroupCommandError - */ -const de_UpdateEndpointGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.globalaccelerator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EndpointGroupNotFoundException": - case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": - throw await de_EndpointGroupNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.globalaccelerator#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateListenerCommand */ @@ -4011,7 +2094,7 @@ export const de_UpdateListenerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateListenerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4023,44 +2106,6 @@ export const de_UpdateListenerCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateListenerCommandError - */ -const de_UpdateListenerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.globalaccelerator#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.globalaccelerator#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidPortRangeException": - case "com.amazonaws.globalaccelerator#InvalidPortRangeException": - throw await de_InvalidPortRangeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.globalaccelerator#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ListenerNotFoundException": - case "com.amazonaws.globalaccelerator#ListenerNotFoundException": - throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1WithdrawByoipCidrCommand */ @@ -4069,7 +2114,7 @@ export const de_WithdrawByoipCidrCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_WithdrawByoipCidrCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4082,12 +2127,9 @@ export const de_WithdrawByoipCidrCommand = async ( }; /** - * deserializeAws_json1_1WithdrawByoipCidrCommandError + * deserialize_Aws_json1_1CommandError */ -const de_WithdrawByoipCidrCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4097,25 +2139,70 @@ const de_WithdrawByoipCidrCommandError = async ( case "AccessDeniedException": case "com.amazonaws.globalaccelerator#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ByoipCidrNotFoundException": - case "com.amazonaws.globalaccelerator#ByoipCidrNotFoundException": - throw await de_ByoipCidrNotFoundExceptionRes(parsedOutput, context); - case "IncorrectCidrStateException": - case "com.amazonaws.globalaccelerator#IncorrectCidrStateException": - throw await de_IncorrectCidrStateExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.globalaccelerator#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "EndpointAlreadyExistsException": + case "com.amazonaws.globalaccelerator#EndpointAlreadyExistsException": + throw await de_EndpointAlreadyExistsExceptionRes(parsedOutput, context); + case "EndpointGroupNotFoundException": + case "com.amazonaws.globalaccelerator#EndpointGroupNotFoundException": + throw await de_EndpointGroupNotFoundExceptionRes(parsedOutput, context); case "InternalServiceErrorException": case "com.amazonaws.globalaccelerator#InternalServiceErrorException": throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); case "InvalidArgumentException": case "com.amazonaws.globalaccelerator#InvalidArgumentException": throw await de_InvalidArgumentExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.globalaccelerator#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "TransactionInProgressException": + case "com.amazonaws.globalaccelerator#TransactionInProgressException": + throw await de_TransactionInProgressExceptionRes(parsedOutput, context); + case "ByoipCidrNotFoundException": + case "com.amazonaws.globalaccelerator#ByoipCidrNotFoundException": + throw await de_ByoipCidrNotFoundExceptionRes(parsedOutput, context); + case "IncorrectCidrStateException": + case "com.amazonaws.globalaccelerator#IncorrectCidrStateException": + throw await de_IncorrectCidrStateExceptionRes(parsedOutput, context); + case "AcceleratorNotFoundException": + case "com.amazonaws.globalaccelerator#AcceleratorNotFoundException": + throw await de_AcceleratorNotFoundExceptionRes(parsedOutput, context); + case "EndpointGroupAlreadyExistsException": + case "com.amazonaws.globalaccelerator#EndpointGroupAlreadyExistsException": + throw await de_EndpointGroupAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidPortRangeException": + case "com.amazonaws.globalaccelerator#InvalidPortRangeException": + throw await de_InvalidPortRangeExceptionRes(parsedOutput, context); + case "ListenerNotFoundException": + case "com.amazonaws.globalaccelerator#ListenerNotFoundException": + throw await de_ListenerNotFoundExceptionRes(parsedOutput, context); + case "AcceleratorNotDisabledException": + case "com.amazonaws.globalaccelerator#AcceleratorNotDisabledException": + throw await de_AcceleratorNotDisabledExceptionRes(parsedOutput, context); + case "AssociatedListenerFoundException": + case "com.amazonaws.globalaccelerator#AssociatedListenerFoundException": + throw await de_AssociatedListenerFoundExceptionRes(parsedOutput, context); + case "AttachmentNotFoundException": + case "com.amazonaws.globalaccelerator#AttachmentNotFoundException": + throw await de_AttachmentNotFoundExceptionRes(parsedOutput, context); + case "AssociatedEndpointGroupFoundException": + case "com.amazonaws.globalaccelerator#AssociatedEndpointGroupFoundException": + throw await de_AssociatedEndpointGroupFoundExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.globalaccelerator#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "EndpointNotFoundException": + case "com.amazonaws.globalaccelerator#EndpointNotFoundException": + throw await de_EndpointNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-glue/src/protocols/Aws_json1_1.ts b/clients/client-glue/src/protocols/Aws_json1_1.ts index 44c21667a442..ba58c84e57e5 100644 --- a/clients/client-glue/src/protocols/Aws_json1_1.ts +++ b/clients/client-glue/src/protocols/Aws_json1_1.ts @@ -3862,7 +3862,7 @@ export const de_BatchCreatePartitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchCreatePartitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3874,50 +3874,6 @@ export const de_BatchCreatePartitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchCreatePartitionCommandError - */ -const de_BatchCreatePartitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDeleteConnectionCommand */ @@ -3926,7 +3882,7 @@ export const de_BatchDeleteConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDeleteConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3938,35 +3894,6 @@ export const de_BatchDeleteConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDeleteConnectionCommandError - */ -const de_BatchDeleteConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDeletePartitionCommand */ @@ -3975,7 +3902,7 @@ export const de_BatchDeletePartitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDeletePartitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3987,41 +3914,6 @@ export const de_BatchDeletePartitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDeletePartitionCommandError - */ -const de_BatchDeletePartitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDeleteTableCommand */ @@ -4030,7 +3922,7 @@ export const de_BatchDeleteTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDeleteTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4042,47 +3934,6 @@ export const de_BatchDeleteTableCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDeleteTableCommandError - */ -const de_BatchDeleteTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.glue#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDeleteTableVersionCommand */ @@ -4091,7 +3942,7 @@ export const de_BatchDeleteTableVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDeleteTableVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4103,41 +3954,6 @@ export const de_BatchDeleteTableVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDeleteTableVersionCommandError - */ -const de_BatchDeleteTableVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetBlueprintsCommand */ @@ -4146,7 +3962,7 @@ export const de_BatchGetBlueprintsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetBlueprintsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4158,38 +3974,6 @@ export const de_BatchGetBlueprintsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetBlueprintsCommandError - */ -const de_BatchGetBlueprintsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetCrawlersCommand */ @@ -4198,7 +3982,7 @@ export const de_BatchGetCrawlersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetCrawlersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4210,35 +3994,6 @@ export const de_BatchGetCrawlersCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetCrawlersCommandError - */ -const de_BatchGetCrawlersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetCustomEntityTypesCommand */ @@ -4247,7 +4002,7 @@ export const de_BatchGetCustomEntityTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetCustomEntityTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4259,38 +4014,6 @@ export const de_BatchGetCustomEntityTypesCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetCustomEntityTypesCommandError - */ -const de_BatchGetCustomEntityTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetDataQualityResultCommand */ @@ -4299,7 +4022,7 @@ export const de_BatchGetDataQualityResultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetDataQualityResultCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4312,46 +4035,14 @@ export const de_BatchGetDataQualityResultCommand = async ( }; /** - * deserializeAws_json1_1BatchGetDataQualityResultCommandError + * deserializeAws_json1_1BatchGetDevEndpointsCommand */ -const de_BatchGetDataQualityResultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1BatchGetDevEndpointsCommand - */ -export const de_BatchGetDevEndpointsCommand = async ( +export const de_BatchGetDevEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetDevEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4363,41 +4054,6 @@ export const de_BatchGetDevEndpointsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetDevEndpointsCommandError - */ -const de_BatchGetDevEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetJobsCommand */ @@ -4406,7 +4062,7 @@ export const de_BatchGetJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4418,38 +4074,6 @@ export const de_BatchGetJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetJobsCommandError - */ -const de_BatchGetJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetPartitionCommand */ @@ -4458,7 +4082,7 @@ export const de_BatchGetPartitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetPartitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4470,53 +4094,6 @@ export const de_BatchGetPartitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetPartitionCommandError - */ -const de_BatchGetPartitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "FederationSourceException": - case "com.amazonaws.glue#FederationSourceException": - throw await de_FederationSourceExceptionRes(parsedOutput, context); - case "FederationSourceRetryableException": - case "com.amazonaws.glue#FederationSourceRetryableException": - throw await de_FederationSourceRetryableExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.glue#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetTableOptimizerCommand */ @@ -4525,7 +4102,7 @@ export const de_BatchGetTableOptimizerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetTableOptimizerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4537,32 +4114,6 @@ export const de_BatchGetTableOptimizerCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetTableOptimizerCommandError - */ -const de_BatchGetTableOptimizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetTriggersCommand */ @@ -4571,7 +4122,7 @@ export const de_BatchGetTriggersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetTriggersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4583,38 +4134,6 @@ export const de_BatchGetTriggersCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetTriggersCommandError - */ -const de_BatchGetTriggersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetWorkflowsCommand */ @@ -4623,7 +4142,7 @@ export const de_BatchGetWorkflowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetWorkflowsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4635,38 +4154,6 @@ export const de_BatchGetWorkflowsCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetWorkflowsCommandError - */ -const de_BatchGetWorkflowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchStopJobRunCommand */ @@ -4675,7 +4162,7 @@ export const de_BatchStopJobRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchStopJobRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4687,38 +4174,6 @@ export const de_BatchStopJobRunCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchStopJobRunCommandError - */ -const de_BatchStopJobRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchUpdatePartitionCommand */ @@ -4727,7 +4182,7 @@ export const de_BatchUpdatePartitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchUpdatePartitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4740,52 +4195,14 @@ export const de_BatchUpdatePartitionCommand = async ( }; /** - * deserializeAws_json1_1BatchUpdatePartitionCommandError + * deserializeAws_json1_1CancelDataQualityRuleRecommendationRunCommand */ -const de_BatchUpdatePartitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CancelDataQualityRuleRecommendationRunCommand - */ -export const de_CancelDataQualityRuleRecommendationRunCommand = async ( +export const de_CancelDataQualityRuleRecommendationRunCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelDataQualityRuleRecommendationRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4797,41 +4214,6 @@ export const de_CancelDataQualityRuleRecommendationRunCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelDataQualityRuleRecommendationRunCommandError - */ -const de_CancelDataQualityRuleRecommendationRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelDataQualityRulesetEvaluationRunCommand */ @@ -4840,7 +4222,7 @@ export const de_CancelDataQualityRulesetEvaluationRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelDataQualityRulesetEvaluationRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4852,41 +4234,6 @@ export const de_CancelDataQualityRulesetEvaluationRunCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelDataQualityRulesetEvaluationRunCommandError - */ -const de_CancelDataQualityRulesetEvaluationRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelMLTaskRunCommand */ @@ -4895,7 +4242,7 @@ export const de_CancelMLTaskRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelMLTaskRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4907,41 +4254,6 @@ export const de_CancelMLTaskRunCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelMLTaskRunCommandError - */ -const de_CancelMLTaskRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelStatementCommand */ @@ -4950,7 +4262,7 @@ export const de_CancelStatementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelStatementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4962,47 +4274,6 @@ export const de_CancelStatementCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelStatementCommandError - */ -const de_CancelStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "IllegalSessionStateException": - case "com.amazonaws.glue#IllegalSessionStateException": - throw await de_IllegalSessionStateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CheckSchemaVersionValidityCommand */ @@ -5011,7 +4282,7 @@ export const de_CheckSchemaVersionValidityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CheckSchemaVersionValidityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5023,38 +4294,6 @@ export const de_CheckSchemaVersionValidityCommand = async ( return response; }; -/** - * deserializeAws_json1_1CheckSchemaVersionValidityCommandError - */ -const de_CheckSchemaVersionValidityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateBlueprintCommand */ @@ -5063,7 +4302,7 @@ export const de_CreateBlueprintCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBlueprintCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5075,44 +4314,6 @@ export const de_CreateBlueprintCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateBlueprintCommandError - */ -const de_CreateBlueprintCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateClassifierCommand */ @@ -5121,7 +4322,7 @@ export const de_CreateClassifierCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateClassifierCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5133,38 +4334,6 @@ export const de_CreateClassifierCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateClassifierCommandError - */ -const de_CreateClassifierCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateConnectionCommand */ @@ -5173,7 +4342,7 @@ export const de_CreateConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5186,52 +4355,14 @@ export const de_CreateConnectionCommand = async ( }; /** - * deserializeAws_json1_1CreateConnectionCommandError - */ -const de_CreateConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateCrawlerCommand + * deserializeAws_json1_1CreateCrawlerCommand */ export const de_CreateCrawlerCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCrawlerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5243,41 +4374,6 @@ export const de_CreateCrawlerCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCrawlerCommandError - */ -const de_CreateCrawlerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateCustomEntityTypeCommand */ @@ -5286,7 +4382,7 @@ export const de_CreateCustomEntityTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCustomEntityTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5298,50 +4394,6 @@ export const de_CreateCustomEntityTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCustomEntityTypeCommandError - */ -const de_CreateCustomEntityTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.glue#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDatabaseCommand */ @@ -5350,7 +4402,7 @@ export const de_CreateDatabaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDatabaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5362,53 +4414,6 @@ export const de_CreateDatabaseCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDatabaseCommandError - */ -const de_CreateDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "FederatedResourceAlreadyExistsException": - case "com.amazonaws.glue#FederatedResourceAlreadyExistsException": - throw await de_FederatedResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDataQualityRulesetCommand */ @@ -5417,7 +4422,7 @@ export const de_CreateDataQualityRulesetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDataQualityRulesetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5429,44 +4434,6 @@ export const de_CreateDataQualityRulesetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDataQualityRulesetCommandError - */ -const de_CreateDataQualityRulesetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDevEndpointCommand */ @@ -5475,7 +4442,7 @@ export const de_CreateDevEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDevEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5488,66 +4455,39 @@ export const de_CreateDevEndpointCommand = async ( }; /** - * deserializeAws_json1_1CreateDevEndpointCommandError + * deserializeAws_json1_1CreateJobCommand */ -const de_CreateDevEndpointCommandError = async ( +export const de_CreateJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.glue#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.glue#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateJobCommand + * deserializeAws_json1_1CreateMLTransformCommand */ -export const de_CreateJobCommand = async ( +export const de_CreateMLTransformCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateJobCommandOutput = { + const response: CreateMLTransformCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5555,122 +4495,14 @@ export const de_CreateJobCommand = async ( }; /** - * deserializeAws_json1_1CreateJobCommandError + * deserializeAws_json1_1CreatePartitionCommand */ -const de_CreateJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.glue#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateMLTransformCommand - */ -export const de_CreateMLTransformCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateMLTransformCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateMLTransformCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateMLTransformCommandError - */ -const de_CreateMLTransformCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.glue#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreatePartitionCommand - */ -export const de_CreatePartitionCommand = async ( +export const de_CreatePartitionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePartitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5682,5284 +4514,40 @@ export const de_CreatePartitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePartitionCommandError - */ -const de_CreatePartitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePartitionIndexCommand */ export const de_CreatePartitionIndexCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreatePartitionIndexCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreatePartitionIndexCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreatePartitionIndexCommandError - */ -const de_CreatePartitionIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateRegistryCommand - */ -export const de_CreateRegistryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateRegistryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateRegistryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateRegistryCommandError - */ -const de_CreateRegistryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateSchemaCommand - */ -export const de_CreateSchemaCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateSchemaCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateSchemaCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateSchemaCommandError - */ -const de_CreateSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateScriptCommand - */ -export const de_CreateScriptCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateScriptCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateScriptCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateScriptCommandError - */ -const de_CreateScriptCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateSecurityConfigurationCommand - */ -export const de_CreateSecurityConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateSecurityConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateSecurityConfigurationResponse(data, context); - const response: CreateSecurityConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateSecurityConfigurationCommandError - */ -const de_CreateSecurityConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateSessionCommand - */ -export const de_CreateSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateSessionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateSessionResponse(data, context); - const response: CreateSessionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateSessionCommandError - */ -const de_CreateSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.glue#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.glue#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateTableCommand - */ -export const de_CreateTableCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateTableCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateTableCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateTableCommandError - */ -const de_CreateTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.glue#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateTableOptimizerCommand - */ -export const de_CreateTableOptimizerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateTableOptimizerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateTableOptimizerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateTableOptimizerCommandError - */ -const de_CreateTableOptimizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateTriggerCommand - */ -export const de_CreateTriggerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateTriggerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateTriggerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateTriggerCommandError - */ -const de_CreateTriggerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.glue#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateUserDefinedFunctionCommand - */ -export const de_CreateUserDefinedFunctionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateUserDefinedFunctionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateUserDefinedFunctionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateUserDefinedFunctionCommandError - */ -const de_CreateUserDefinedFunctionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateWorkflowCommand - */ -export const de_CreateWorkflowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateWorkflowCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateWorkflowCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateWorkflowCommandError - */ -const de_CreateWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteBlueprintCommand - */ -export const de_DeleteBlueprintCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteBlueprintCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteBlueprintCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteBlueprintCommandError - */ -const de_DeleteBlueprintCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteClassifierCommand - */ -export const de_DeleteClassifierCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteClassifierCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteClassifierCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteClassifierCommandError - */ -const de_DeleteClassifierCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteColumnStatisticsForPartitionCommand - */ -export const de_DeleteColumnStatisticsForPartitionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteColumnStatisticsForPartitionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteColumnStatisticsForPartitionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteColumnStatisticsForPartitionCommandError - */ -const de_DeleteColumnStatisticsForPartitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteColumnStatisticsForTableCommand - */ -export const de_DeleteColumnStatisticsForTableCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteColumnStatisticsForTableCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteColumnStatisticsForTableCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteColumnStatisticsForTableCommandError - */ -const de_DeleteColumnStatisticsForTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteConnectionCommand - */ -export const de_DeleteConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteConnectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteConnectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteConnectionCommandError - */ -const de_DeleteConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteCrawlerCommand - */ -export const de_DeleteCrawlerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteCrawlerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteCrawlerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteCrawlerCommandError - */ -const de_DeleteCrawlerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CrawlerRunningException": - case "com.amazonaws.glue#CrawlerRunningException": - throw await de_CrawlerRunningExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "SchedulerTransitioningException": - case "com.amazonaws.glue#SchedulerTransitioningException": - throw await de_SchedulerTransitioningExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteCustomEntityTypeCommand - */ -export const de_DeleteCustomEntityTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteCustomEntityTypeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteCustomEntityTypeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteCustomEntityTypeCommandError - */ -const de_DeleteCustomEntityTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDatabaseCommand - */ -export const de_DeleteDatabaseCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDatabaseCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteDatabaseCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDatabaseCommandError - */ -const de_DeleteDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDataQualityRulesetCommand - */ -export const de_DeleteDataQualityRulesetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDataQualityRulesetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteDataQualityRulesetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDataQualityRulesetCommandError - */ -const de_DeleteDataQualityRulesetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDevEndpointCommand - */ -export const de_DeleteDevEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDevEndpointCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteDevEndpointCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDevEndpointCommandError - */ -const de_DeleteDevEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteJobCommand - */ -export const de_DeleteJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteJobCommandError - */ -const de_DeleteJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteMLTransformCommand - */ -export const de_DeleteMLTransformCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteMLTransformCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteMLTransformCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteMLTransformCommandError - */ -const de_DeleteMLTransformCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeletePartitionCommand - */ -export const de_DeletePartitionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeletePartitionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeletePartitionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeletePartitionCommandError - */ -const de_DeletePartitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeletePartitionIndexCommand - */ -export const de_DeletePartitionIndexCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeletePartitionIndexCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeletePartitionIndexCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeletePartitionIndexCommandError - */ -const de_DeletePartitionIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.glue#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteRegistryCommand - */ -export const de_DeleteRegistryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteRegistryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteRegistryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteRegistryCommandError - */ -const de_DeleteRegistryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteResourcePolicyCommand - */ -export const de_DeleteResourcePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteResourcePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConditionCheckFailureException": - case "com.amazonaws.glue#ConditionCheckFailureException": - throw await de_ConditionCheckFailureExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteSchemaCommand - */ -export const de_DeleteSchemaCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteSchemaCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteSchemaCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteSchemaCommandError - */ -const de_DeleteSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteSchemaVersionsCommand - */ -export const de_DeleteSchemaVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteSchemaVersionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteSchemaVersionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteSchemaVersionsCommandError - */ -const de_DeleteSchemaVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteSecurityConfigurationCommand - */ -export const de_DeleteSecurityConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteSecurityConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteSecurityConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteSecurityConfigurationCommandError - */ -const de_DeleteSecurityConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteSessionCommand - */ -export const de_DeleteSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteSessionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteSessionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteSessionCommandError - */ -const de_DeleteSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "IllegalSessionStateException": - case "com.amazonaws.glue#IllegalSessionStateException": - throw await de_IllegalSessionStateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteTableCommand - */ -export const de_DeleteTableCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteTableCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteTableCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteTableCommandError - */ -const de_DeleteTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.glue#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteTableOptimizerCommand - */ -export const de_DeleteTableOptimizerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteTableOptimizerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteTableOptimizerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteTableOptimizerCommandError - */ -const de_DeleteTableOptimizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteTableVersionCommand - */ -export const de_DeleteTableVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteTableVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteTableVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteTableVersionCommandError - */ -const de_DeleteTableVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteTriggerCommand - */ -export const de_DeleteTriggerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteTriggerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteTriggerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteTriggerCommandError - */ -const de_DeleteTriggerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteUserDefinedFunctionCommand - */ -export const de_DeleteUserDefinedFunctionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteUserDefinedFunctionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteUserDefinedFunctionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteUserDefinedFunctionCommandError - */ -const de_DeleteUserDefinedFunctionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteWorkflowCommand - */ -export const de_DeleteWorkflowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteWorkflowCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteWorkflowCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteWorkflowCommandError - */ -const de_DeleteWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetBlueprintCommand - */ -export const de_GetBlueprintCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetBlueprintCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetBlueprintResponse(data, context); - const response: GetBlueprintCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetBlueprintCommandError - */ -const de_GetBlueprintCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetBlueprintRunCommand - */ -export const de_GetBlueprintRunCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetBlueprintRunCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetBlueprintRunResponse(data, context); - const response: GetBlueprintRunCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetBlueprintRunCommandError - */ -const de_GetBlueprintRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetBlueprintRunsCommand - */ -export const de_GetBlueprintRunsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetBlueprintRunsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetBlueprintRunsResponse(data, context); - const response: GetBlueprintRunsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetBlueprintRunsCommandError - */ -const de_GetBlueprintRunsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCatalogImportStatusCommand - */ -export const de_GetCatalogImportStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetCatalogImportStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetCatalogImportStatusResponse(data, context); - const response: GetCatalogImportStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetCatalogImportStatusCommandError - */ -const de_GetCatalogImportStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetClassifierCommand - */ -export const de_GetClassifierCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetClassifierCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetClassifierResponse(data, context); - const response: GetClassifierCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetClassifierCommandError - */ -const de_GetClassifierCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetClassifiersCommand - */ -export const de_GetClassifiersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetClassifiersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetClassifiersResponse(data, context); - const response: GetClassifiersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetClassifiersCommandError - */ -const de_GetClassifiersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetColumnStatisticsForPartitionCommand - */ -export const de_GetColumnStatisticsForPartitionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetColumnStatisticsForPartitionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetColumnStatisticsForPartitionResponse(data, context); - const response: GetColumnStatisticsForPartitionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetColumnStatisticsForPartitionCommandError - */ -const de_GetColumnStatisticsForPartitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetColumnStatisticsForTableCommand - */ -export const de_GetColumnStatisticsForTableCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetColumnStatisticsForTableCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetColumnStatisticsForTableResponse(data, context); - const response: GetColumnStatisticsForTableCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetColumnStatisticsForTableCommandError - */ -const de_GetColumnStatisticsForTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetColumnStatisticsTaskRunCommand - */ -export const de_GetColumnStatisticsTaskRunCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetColumnStatisticsTaskRunCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetColumnStatisticsTaskRunResponse(data, context); - const response: GetColumnStatisticsTaskRunCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetColumnStatisticsTaskRunCommandError - */ -const de_GetColumnStatisticsTaskRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetColumnStatisticsTaskRunsCommand - */ -export const de_GetColumnStatisticsTaskRunsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetColumnStatisticsTaskRunsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetColumnStatisticsTaskRunsResponse(data, context); - const response: GetColumnStatisticsTaskRunsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetColumnStatisticsTaskRunsCommandError - */ -const de_GetColumnStatisticsTaskRunsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetConnectionCommand - */ -export const de_GetConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetConnectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetConnectionResponse(data, context); - const response: GetConnectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetConnectionCommandError - */ -const de_GetConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetConnectionsCommand - */ -export const de_GetConnectionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetConnectionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetConnectionsResponse(data, context); - const response: GetConnectionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetConnectionsCommandError - */ -const de_GetConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCrawlerCommand - */ -export const de_GetCrawlerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetCrawlerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetCrawlerResponse(data, context); - const response: GetCrawlerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetCrawlerCommandError - */ -const de_GetCrawlerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCrawlerMetricsCommand - */ -export const de_GetCrawlerMetricsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetCrawlerMetricsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetCrawlerMetricsResponse(data, context); - const response: GetCrawlerMetricsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetCrawlerMetricsCommandError - */ -const de_GetCrawlerMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCrawlersCommand - */ -export const de_GetCrawlersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetCrawlersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetCrawlersResponse(data, context); - const response: GetCrawlersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetCrawlersCommandError - */ -const de_GetCrawlersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCustomEntityTypeCommand - */ -export const de_GetCustomEntityTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetCustomEntityTypeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetCustomEntityTypeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetCustomEntityTypeCommandError - */ -const de_GetCustomEntityTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDatabaseCommand - */ -export const de_GetDatabaseCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDatabaseCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDatabaseResponse(data, context); - const response: GetDatabaseCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDatabaseCommandError - */ -const de_GetDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "FederationSourceException": - case "com.amazonaws.glue#FederationSourceException": - throw await de_FederationSourceExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDatabasesCommand - */ -export const de_GetDatabasesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDatabasesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDatabasesResponse(data, context); - const response: GetDatabasesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDatabasesCommandError - */ -const de_GetDatabasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDataCatalogEncryptionSettingsCommand - */ -export const de_GetDataCatalogEncryptionSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDataCatalogEncryptionSettingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetDataCatalogEncryptionSettingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDataCatalogEncryptionSettingsCommandError - */ -const de_GetDataCatalogEncryptionSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDataflowGraphCommand - */ -export const de_GetDataflowGraphCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDataflowGraphCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetDataflowGraphCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDataflowGraphCommandError - */ -const de_GetDataflowGraphCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDataQualityResultCommand - */ -export const de_GetDataQualityResultCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDataQualityResultCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDataQualityResultResponse(data, context); - const response: GetDataQualityResultCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDataQualityResultCommandError - */ -const de_GetDataQualityResultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDataQualityRuleRecommendationRunCommand - */ -export const de_GetDataQualityRuleRecommendationRunCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDataQualityRuleRecommendationRunCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDataQualityRuleRecommendationRunResponse(data, context); - const response: GetDataQualityRuleRecommendationRunCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDataQualityRuleRecommendationRunCommandError - */ -const de_GetDataQualityRuleRecommendationRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDataQualityRulesetCommand - */ -export const de_GetDataQualityRulesetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDataQualityRulesetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDataQualityRulesetResponse(data, context); - const response: GetDataQualityRulesetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDataQualityRulesetCommandError - */ -const de_GetDataQualityRulesetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDataQualityRulesetEvaluationRunCommand - */ -export const de_GetDataQualityRulesetEvaluationRunCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDataQualityRulesetEvaluationRunCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDataQualityRulesetEvaluationRunResponse(data, context); - const response: GetDataQualityRulesetEvaluationRunCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDataQualityRulesetEvaluationRunCommandError - */ -const de_GetDataQualityRulesetEvaluationRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDevEndpointCommand - */ -export const de_GetDevEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDevEndpointCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDevEndpointResponse(data, context); - const response: GetDevEndpointCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDevEndpointCommandError - */ -const de_GetDevEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDevEndpointsCommand - */ -export const de_GetDevEndpointsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDevEndpointsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDevEndpointsResponse(data, context); - const response: GetDevEndpointsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDevEndpointsCommandError - */ -const de_GetDevEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetJobCommand - */ -export const de_GetJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetJobResponse(data, context); - const response: GetJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetJobCommandError - */ -const de_GetJobCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetJobBookmarkCommand - */ -export const de_GetJobBookmarkCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetJobBookmarkCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetJobBookmarkCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetJobBookmarkCommandError - */ -const de_GetJobBookmarkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.glue#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetJobRunCommand - */ -export const de_GetJobRunCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetJobRunCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetJobRunResponse(data, context); - const response: GetJobRunCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetJobRunCommandError - */ -const de_GetJobRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetJobRunsCommand - */ -export const de_GetJobRunsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetJobRunsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetJobRunsResponse(data, context); - const response: GetJobRunsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetJobRunsCommandError - */ -const de_GetJobRunsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetJobsCommand - */ -export const de_GetJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetJobsResponse(data, context); - const response: GetJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetJobsCommandError - */ -const de_GetJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetMappingCommand - */ -export const de_GetMappingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetMappingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetMappingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetMappingCommandError - */ -const de_GetMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetMLTaskRunCommand - */ -export const de_GetMLTaskRunCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetMLTaskRunCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetMLTaskRunResponse(data, context); - const response: GetMLTaskRunCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetMLTaskRunCommandError - */ -const de_GetMLTaskRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetMLTaskRunsCommand - */ -export const de_GetMLTaskRunsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetMLTaskRunsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetMLTaskRunsResponse(data, context); - const response: GetMLTaskRunsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetMLTaskRunsCommandError - */ -const de_GetMLTaskRunsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetMLTransformCommand - */ -export const de_GetMLTransformCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetMLTransformCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetMLTransformResponse(data, context); - const response: GetMLTransformCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetMLTransformCommandError - */ -const de_GetMLTransformCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetMLTransformsCommand - */ -export const de_GetMLTransformsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetMLTransformsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetMLTransformsResponse(data, context); - const response: GetMLTransformsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetMLTransformsCommandError - */ -const de_GetMLTransformsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetPartitionCommand - */ -export const de_GetPartitionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetPartitionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetPartitionResponse(data, context); - const response: GetPartitionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetPartitionCommandError - */ -const de_GetPartitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "FederationSourceException": - case "com.amazonaws.glue#FederationSourceException": - throw await de_FederationSourceExceptionRes(parsedOutput, context); - case "FederationSourceRetryableException": - case "com.amazonaws.glue#FederationSourceRetryableException": - throw await de_FederationSourceRetryableExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetPartitionIndexesCommand - */ -export const de_GetPartitionIndexesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetPartitionIndexesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetPartitionIndexesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetPartitionIndexesCommandError - */ -const de_GetPartitionIndexesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.glue#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetPartitionsCommand - */ -export const de_GetPartitionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetPartitionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetPartitionsResponse(data, context); - const response: GetPartitionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetPartitionsCommandError - */ -const de_GetPartitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "FederationSourceException": - case "com.amazonaws.glue#FederationSourceException": - throw await de_FederationSourceExceptionRes(parsedOutput, context); - case "FederationSourceRetryableException": - case "com.amazonaws.glue#FederationSourceRetryableException": - throw await de_FederationSourceRetryableExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.glue#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.glue#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetPlanCommand - */ -export const de_GetPlanCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetPlanCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetPlanCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetPlanCommandError - */ -const de_GetPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRegistryCommand - */ -export const de_GetRegistryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRegistryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetRegistryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRegistryCommandError - */ -const de_GetRegistryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetResourcePoliciesCommand - */ -export const de_GetResourcePoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetResourcePoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetResourcePoliciesResponse(data, context); - const response: GetResourcePoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetResourcePoliciesCommandError - */ -const de_GetResourcePoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetResourcePolicyCommand - */ -export const de_GetResourcePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetResourcePolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetResourcePolicyResponse(data, context); - const response: GetResourcePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetResourcePolicyCommandError - */ -const de_GetResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSchemaCommand - */ -export const de_GetSchemaCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSchemaCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetSchemaCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSchemaCommandError - */ -const de_GetSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSchemaByDefinitionCommand - */ -export const de_GetSchemaByDefinitionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSchemaByDefinitionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetSchemaByDefinitionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSchemaByDefinitionCommandError - */ -const de_GetSchemaByDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSchemaVersionCommand - */ -export const de_GetSchemaVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSchemaVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetSchemaVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSchemaVersionCommandError - */ -const de_GetSchemaVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSchemaVersionsDiffCommand - */ -export const de_GetSchemaVersionsDiffCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSchemaVersionsDiffCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetSchemaVersionsDiffCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSchemaVersionsDiffCommandError - */ -const de_GetSchemaVersionsDiffCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSecurityConfigurationCommand - */ -export const de_GetSecurityConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSecurityConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetSecurityConfigurationResponse(data, context); - const response: GetSecurityConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSecurityConfigurationCommandError - */ -const de_GetSecurityConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSecurityConfigurationsCommand - */ -export const de_GetSecurityConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSecurityConfigurationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetSecurityConfigurationsResponse(data, context); - const response: GetSecurityConfigurationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSecurityConfigurationsCommandError - */ -const de_GetSecurityConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSessionCommand - */ -export const de_GetSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSessionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetSessionResponse(data, context); - const response: GetSessionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSessionCommandError - */ -const de_GetSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetStatementCommand - */ -export const de_GetStatementCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetStatementCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetStatementResponse(data, context); - const response: GetStatementCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetStatementCommandError - */ -const de_GetStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "IllegalSessionStateException": - case "com.amazonaws.glue#IllegalSessionStateException": - throw await de_IllegalSessionStateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetTableCommand - */ -export const de_GetTableCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetTableCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetTableResponse(data, context); - const response: GetTableCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetTableCommandError - */ -const de_GetTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "FederationSourceException": - case "com.amazonaws.glue#FederationSourceException": - throw await de_FederationSourceExceptionRes(parsedOutput, context); - case "FederationSourceRetryableException": - case "com.amazonaws.glue#FederationSourceRetryableException": - throw await de_FederationSourceRetryableExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.glue#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetTableOptimizerCommand - */ -export const de_GetTableOptimizerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetTableOptimizerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetTableOptimizerResponse(data, context); - const response: GetTableOptimizerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetTableOptimizerCommandError - */ -const de_GetTableOptimizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetTablesCommand - */ -export const de_GetTablesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetTablesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetTablesResponse(data, context); - const response: GetTablesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetTablesCommandError - */ -const de_GetTablesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "FederationSourceException": - case "com.amazonaws.glue#FederationSourceException": - throw await de_FederationSourceExceptionRes(parsedOutput, context); - case "FederationSourceRetryableException": - case "com.amazonaws.glue#FederationSourceRetryableException": - throw await de_FederationSourceRetryableExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetTableVersionCommand - */ -export const de_GetTableVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetTableVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetTableVersionResponse(data, context); - const response: GetTableVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetTableVersionCommandError - */ -const de_GetTableVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetTableVersionsCommand - */ -export const de_GetTableVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetTableVersionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetTableVersionsResponse(data, context); - const response: GetTableVersionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetTableVersionsCommandError - */ -const de_GetTableVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreatePartitionIndexCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetTagsCommand + * deserializeAws_json1_1CreateRegistryCommand */ -export const de_GetTagsCommand = async ( +export const de_CreateRegistryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetTagsCommandOutput = { + const response: CreateRegistryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -10967,54 +4555,39 @@ export const de_GetTagsCommand = async ( }; /** - * deserializeAws_json1_1GetTagsCommandError + * deserializeAws_json1_1CreateSchemaCommand */ -const de_GetTagsCommandError = async ( +export const de_CreateSchemaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateSchemaCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetTriggerCommand + * deserializeAws_json1_1CreateScriptCommand */ -export const de_GetTriggerCommand = async ( +export const de_CreateScriptCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetTriggerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetTriggerCommandOutput = { + const response: CreateScriptCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11022,54 +4595,39 @@ export const de_GetTriggerCommand = async ( }; /** - * deserializeAws_json1_1GetTriggerCommandError + * deserializeAws_json1_1CreateSecurityConfigurationCommand */ -const de_GetTriggerCommandError = async ( +export const de_CreateSecurityConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateSecurityConfigurationResponse(data, context); + const response: CreateSecurityConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetTriggersCommand + * deserializeAws_json1_1CreateSessionCommand */ -export const de_GetTriggersCommand = async ( +export const de_CreateSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetTriggersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetTriggersCommandOutput = { + contents = de_CreateSessionResponse(data, context); + const response: CreateSessionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11077,54 +4635,39 @@ export const de_GetTriggersCommand = async ( }; /** - * deserializeAws_json1_1GetTriggersCommandError + * deserializeAws_json1_1CreateTableCommand */ -const de_GetTriggersCommandError = async ( +export const de_CreateTableCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateTableCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetUnfilteredPartitionMetadataCommand + * deserializeAws_json1_1CreateTableOptimizerCommand */ -export const de_GetUnfilteredPartitionMetadataCommand = async ( +export const de_CreateTableOptimizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetUnfilteredPartitionMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetUnfilteredPartitionMetadataResponse(data, context); - const response: GetUnfilteredPartitionMetadataCommandOutput = { + contents = _json(data); + const response: CreateTableOptimizerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11132,66 +4675,39 @@ export const de_GetUnfilteredPartitionMetadataCommand = async ( }; /** - * deserializeAws_json1_1GetUnfilteredPartitionMetadataCommandError + * deserializeAws_json1_1CreateTriggerCommand */ -const de_GetUnfilteredPartitionMetadataCommandError = async ( +export const de_CreateTriggerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "FederationSourceException": - case "com.amazonaws.glue#FederationSourceException": - throw await de_FederationSourceExceptionRes(parsedOutput, context); - case "FederationSourceRetryableException": - case "com.amazonaws.glue#FederationSourceRetryableException": - throw await de_FederationSourceRetryableExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "PermissionTypeMismatchException": - case "com.amazonaws.glue#PermissionTypeMismatchException": - throw await de_PermissionTypeMismatchExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateTriggerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetUnfilteredPartitionsMetadataCommand + * deserializeAws_json1_1CreateUserDefinedFunctionCommand */ -export const de_GetUnfilteredPartitionsMetadataCommand = async ( +export const de_CreateUserDefinedFunctionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetUnfilteredPartitionsMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetUnfilteredPartitionsMetadataResponse(data, context); - const response: GetUnfilteredPartitionsMetadataCommandOutput = { + contents = _json(data); + const response: CreateUserDefinedFunctionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11199,66 +4715,39 @@ export const de_GetUnfilteredPartitionsMetadataCommand = async ( }; /** - * deserializeAws_json1_1GetUnfilteredPartitionsMetadataCommandError + * deserializeAws_json1_1CreateWorkflowCommand */ -const de_GetUnfilteredPartitionsMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "FederationSourceException": - case "com.amazonaws.glue#FederationSourceException": - throw await de_FederationSourceExceptionRes(parsedOutput, context); - case "FederationSourceRetryableException": - case "com.amazonaws.glue#FederationSourceRetryableException": - throw await de_FederationSourceRetryableExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "PermissionTypeMismatchException": - case "com.amazonaws.glue#PermissionTypeMismatchException": - throw await de_PermissionTypeMismatchExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_CreateWorkflowCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateWorkflowCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetUnfilteredTableMetadataCommand + * deserializeAws_json1_1DeleteBlueprintCommand */ -export const de_GetUnfilteredTableMetadataCommand = async ( +export const de_DeleteBlueprintCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetUnfilteredTableMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetUnfilteredTableMetadataResponse(data, context); - const response: GetUnfilteredTableMetadataCommandOutput = { + contents = _json(data); + const response: DeleteBlueprintCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11266,66 +4755,39 @@ export const de_GetUnfilteredTableMetadataCommand = async ( }; /** - * deserializeAws_json1_1GetUnfilteredTableMetadataCommandError + * deserializeAws_json1_1DeleteClassifierCommand */ -const de_GetUnfilteredTableMetadataCommandError = async ( +export const de_DeleteClassifierCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "FederationSourceException": - case "com.amazonaws.glue#FederationSourceException": - throw await de_FederationSourceExceptionRes(parsedOutput, context); - case "FederationSourceRetryableException": - case "com.amazonaws.glue#FederationSourceRetryableException": - throw await de_FederationSourceRetryableExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "PermissionTypeMismatchException": - case "com.amazonaws.glue#PermissionTypeMismatchException": - throw await de_PermissionTypeMismatchExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteClassifierCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetUserDefinedFunctionCommand + * deserializeAws_json1_1DeleteColumnStatisticsForPartitionCommand */ -export const de_GetUserDefinedFunctionCommand = async ( +export const de_DeleteColumnStatisticsForPartitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetUserDefinedFunctionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetUserDefinedFunctionResponse(data, context); - const response: GetUserDefinedFunctionCommandOutput = { + contents = _json(data); + const response: DeleteColumnStatisticsForPartitionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11333,57 +4795,39 @@ export const de_GetUserDefinedFunctionCommand = async ( }; /** - * deserializeAws_json1_1GetUserDefinedFunctionCommandError + * deserializeAws_json1_1DeleteColumnStatisticsForTableCommand */ -const de_GetUserDefinedFunctionCommandError = async ( +export const de_DeleteColumnStatisticsForTableCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteColumnStatisticsForTableCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetUserDefinedFunctionsCommand + * deserializeAws_json1_1DeleteConnectionCommand */ -export const de_GetUserDefinedFunctionsCommand = async ( +export const de_DeleteConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetUserDefinedFunctionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetUserDefinedFunctionsResponse(data, context); - const response: GetUserDefinedFunctionsCommandOutput = { + contents = _json(data); + const response: DeleteConnectionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11391,57 +4835,39 @@ export const de_GetUserDefinedFunctionsCommand = async ( }; /** - * deserializeAws_json1_1GetUserDefinedFunctionsCommandError + * deserializeAws_json1_1DeleteCrawlerCommand */ -const de_GetUserDefinedFunctionsCommandError = async ( +export const de_DeleteCrawlerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteCrawlerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetWorkflowCommand + * deserializeAws_json1_1DeleteCustomEntityTypeCommand */ -export const de_GetWorkflowCommand = async ( +export const de_DeleteCustomEntityTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetWorkflowCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetWorkflowResponse(data, context); - const response: GetWorkflowCommandOutput = { + contents = _json(data); + const response: DeleteCustomEntityTypeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11449,54 +4875,39 @@ export const de_GetWorkflowCommand = async ( }; /** - * deserializeAws_json1_1GetWorkflowCommandError + * deserializeAws_json1_1DeleteDatabaseCommand */ -const de_GetWorkflowCommandError = async ( +export const de_DeleteDatabaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteDatabaseCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetWorkflowRunCommand + * deserializeAws_json1_1DeleteDataQualityRulesetCommand */ -export const de_GetWorkflowRunCommand = async ( +export const de_DeleteDataQualityRulesetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetWorkflowRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetWorkflowRunResponse(data, context); - const response: GetWorkflowRunCommandOutput = { + contents = _json(data); + const response: DeleteDataQualityRulesetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11504,54 +4915,39 @@ export const de_GetWorkflowRunCommand = async ( }; /** - * deserializeAws_json1_1GetWorkflowRunCommandError + * deserializeAws_json1_1DeleteDevEndpointCommand */ -const de_GetWorkflowRunCommandError = async ( +export const de_DeleteDevEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteDevEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetWorkflowRunPropertiesCommand + * deserializeAws_json1_1DeleteJobCommand */ -export const de_GetWorkflowRunPropertiesCommand = async ( +export const de_DeleteJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetWorkflowRunPropertiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetWorkflowRunPropertiesCommandOutput = { + const response: DeleteJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11559,54 +4955,39 @@ export const de_GetWorkflowRunPropertiesCommand = async ( }; /** - * deserializeAws_json1_1GetWorkflowRunPropertiesCommandError + * deserializeAws_json1_1DeleteMLTransformCommand */ -const de_GetWorkflowRunPropertiesCommandError = async ( +export const de_DeleteMLTransformCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteMLTransformCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetWorkflowRunsCommand + * deserializeAws_json1_1DeletePartitionCommand */ -export const de_GetWorkflowRunsCommand = async ( +export const de_DeletePartitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetWorkflowRunsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetWorkflowRunsResponse(data, context); - const response: GetWorkflowRunsCommandOutput = { + contents = _json(data); + const response: DeletePartitionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11614,54 +4995,39 @@ export const de_GetWorkflowRunsCommand = async ( }; /** - * deserializeAws_json1_1GetWorkflowRunsCommandError + * deserializeAws_json1_1DeletePartitionIndexCommand */ -const de_GetWorkflowRunsCommandError = async ( +export const de_DeletePartitionIndexCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeletePartitionIndexCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ImportCatalogToGlueCommand + * deserializeAws_json1_1DeleteRegistryCommand */ -export const de_ImportCatalogToGlueCommand = async ( +export const de_DeleteRegistryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ImportCatalogToGlueCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ImportCatalogToGlueCommandOutput = { + const response: DeleteRegistryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11669,48 +5035,39 @@ export const de_ImportCatalogToGlueCommand = async ( }; /** - * deserializeAws_json1_1ImportCatalogToGlueCommandError + * deserializeAws_json1_1DeleteResourcePolicyCommand */ -const de_ImportCatalogToGlueCommandError = async ( +export const de_DeleteResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteResourcePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListBlueprintsCommand + * deserializeAws_json1_1DeleteSchemaCommand */ -export const de_ListBlueprintsCommand = async ( +export const de_DeleteSchemaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListBlueprintsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListBlueprintsCommandOutput = { + const response: DeleteSchemaCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11718,51 +5075,39 @@ export const de_ListBlueprintsCommand = async ( }; /** - * deserializeAws_json1_1ListBlueprintsCommandError + * deserializeAws_json1_1DeleteSchemaVersionsCommand */ -const de_ListBlueprintsCommandError = async ( +export const de_DeleteSchemaVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteSchemaVersionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListColumnStatisticsTaskRunsCommand + * deserializeAws_json1_1DeleteSecurityConfigurationCommand */ -export const de_ListColumnStatisticsTaskRunsCommand = async ( +export const de_DeleteSecurityConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListColumnStatisticsTaskRunsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListColumnStatisticsTaskRunsCommandOutput = { + const response: DeleteSecurityConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11770,45 +5115,39 @@ export const de_ListColumnStatisticsTaskRunsCommand = async ( }; /** - * deserializeAws_json1_1ListColumnStatisticsTaskRunsCommandError + * deserializeAws_json1_1DeleteSessionCommand */ -const de_ListColumnStatisticsTaskRunsCommandError = async ( +export const de_DeleteSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteSessionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListCrawlersCommand + * deserializeAws_json1_1DeleteTableCommand */ -export const de_ListCrawlersCommand = async ( +export const de_DeleteTableCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListCrawlersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListCrawlersCommandOutput = { + const response: DeleteTableCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11816,45 +5155,39 @@ export const de_ListCrawlersCommand = async ( }; /** - * deserializeAws_json1_1ListCrawlersCommandError + * deserializeAws_json1_1DeleteTableOptimizerCommand */ -const de_ListCrawlersCommandError = async ( +export const de_DeleteTableOptimizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteTableOptimizerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListCrawlsCommand + * deserializeAws_json1_1DeleteTableVersionCommand */ -export const de_ListCrawlsCommand = async ( +export const de_DeleteTableVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListCrawlsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListCrawlsResponse(data, context); - const response: ListCrawlsCommandOutput = { + contents = _json(data); + const response: DeleteTableVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11862,51 +5195,39 @@ export const de_ListCrawlsCommand = async ( }; /** - * deserializeAws_json1_1ListCrawlsCommandError + * deserializeAws_json1_1DeleteTriggerCommand */ -const de_ListCrawlsCommandError = async ( +export const de_DeleteTriggerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteTriggerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListCustomEntityTypesCommand + * deserializeAws_json1_1DeleteUserDefinedFunctionCommand */ -export const de_ListCustomEntityTypesCommand = async ( +export const de_DeleteUserDefinedFunctionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListCustomEntityTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListCustomEntityTypesCommandOutput = { + const response: DeleteUserDefinedFunctionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11914,51 +5235,39 @@ export const de_ListCustomEntityTypesCommand = async ( }; /** - * deserializeAws_json1_1ListCustomEntityTypesCommandError + * deserializeAws_json1_1DeleteWorkflowCommand */ -const de_ListCustomEntityTypesCommandError = async ( +export const de_DeleteWorkflowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteWorkflowCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListDataQualityResultsCommand + * deserializeAws_json1_1GetBlueprintCommand */ -export const de_ListDataQualityResultsCommand = async ( +export const de_GetBlueprintCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDataQualityResultsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListDataQualityResultsResponse(data, context); - const response: ListDataQualityResultsCommandOutput = { + contents = de_GetBlueprintResponse(data, context); + const response: GetBlueprintCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11966,51 +5275,39 @@ export const de_ListDataQualityResultsCommand = async ( }; /** - * deserializeAws_json1_1ListDataQualityResultsCommandError + * deserializeAws_json1_1GetBlueprintRunCommand */ -const de_ListDataQualityResultsCommandError = async ( +export const de_GetBlueprintRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetBlueprintRunResponse(data, context); + const response: GetBlueprintRunCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListDataQualityRuleRecommendationRunsCommand + * deserializeAws_json1_1GetBlueprintRunsCommand */ -export const de_ListDataQualityRuleRecommendationRunsCommand = async ( +export const de_GetBlueprintRunsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDataQualityRuleRecommendationRunsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListDataQualityRuleRecommendationRunsResponse(data, context); - const response: ListDataQualityRuleRecommendationRunsCommandOutput = { + contents = de_GetBlueprintRunsResponse(data, context); + const response: GetBlueprintRunsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12018,51 +5315,39 @@ export const de_ListDataQualityRuleRecommendationRunsCommand = async ( }; /** - * deserializeAws_json1_1ListDataQualityRuleRecommendationRunsCommandError + * deserializeAws_json1_1GetCatalogImportStatusCommand */ -const de_ListDataQualityRuleRecommendationRunsCommandError = async ( +export const de_GetCatalogImportStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetCatalogImportStatusResponse(data, context); + const response: GetCatalogImportStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListDataQualityRulesetEvaluationRunsCommand + * deserializeAws_json1_1GetClassifierCommand */ -export const de_ListDataQualityRulesetEvaluationRunsCommand = async ( +export const de_GetClassifierCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDataQualityRulesetEvaluationRunsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListDataQualityRulesetEvaluationRunsResponse(data, context); - const response: ListDataQualityRulesetEvaluationRunsCommandOutput = { + contents = de_GetClassifierResponse(data, context); + const response: GetClassifierCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12070,51 +5355,39 @@ export const de_ListDataQualityRulesetEvaluationRunsCommand = async ( }; /** - * deserializeAws_json1_1ListDataQualityRulesetEvaluationRunsCommandError + * deserializeAws_json1_1GetClassifiersCommand */ -const de_ListDataQualityRulesetEvaluationRunsCommandError = async ( +export const de_GetClassifiersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetClassifiersResponse(data, context); + const response: GetClassifiersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListDataQualityRulesetsCommand + * deserializeAws_json1_1GetColumnStatisticsForPartitionCommand */ -export const de_ListDataQualityRulesetsCommand = async ( +export const de_GetColumnStatisticsForPartitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDataQualityRulesetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListDataQualityRulesetsResponse(data, context); - const response: ListDataQualityRulesetsCommandOutput = { + contents = de_GetColumnStatisticsForPartitionResponse(data, context); + const response: GetColumnStatisticsForPartitionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12122,54 +5395,39 @@ export const de_ListDataQualityRulesetsCommand = async ( }; /** - * deserializeAws_json1_1ListDataQualityRulesetsCommandError + * deserializeAws_json1_1GetColumnStatisticsForTableCommand */ -const de_ListDataQualityRulesetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_GetColumnStatisticsForTableCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetColumnStatisticsForTableResponse(data, context); + const response: GetColumnStatisticsForTableCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListDevEndpointsCommand + * deserializeAws_json1_1GetColumnStatisticsTaskRunCommand */ -export const de_ListDevEndpointsCommand = async ( +export const de_GetColumnStatisticsTaskRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDevEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListDevEndpointsCommandOutput = { + contents = de_GetColumnStatisticsTaskRunResponse(data, context); + const response: GetColumnStatisticsTaskRunCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12177,54 +5435,39 @@ export const de_ListDevEndpointsCommand = async ( }; /** - * deserializeAws_json1_1ListDevEndpointsCommandError + * deserializeAws_json1_1GetColumnStatisticsTaskRunsCommand */ -const de_ListDevEndpointsCommandError = async ( +export const de_GetColumnStatisticsTaskRunsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetColumnStatisticsTaskRunsResponse(data, context); + const response: GetColumnStatisticsTaskRunsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListJobsCommand + * deserializeAws_json1_1GetConnectionCommand */ -export const de_ListJobsCommand = async ( +export const de_GetConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListJobsCommandOutput = { + contents = de_GetConnectionResponse(data, context); + const response: GetConnectionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12232,54 +5475,39 @@ export const de_ListJobsCommand = async ( }; /** - * deserializeAws_json1_1ListJobsCommandError + * deserializeAws_json1_1GetConnectionsCommand */ -const de_ListJobsCommandError = async ( +export const de_GetConnectionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetConnectionsResponse(data, context); + const response: GetConnectionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListMLTransformsCommand + * deserializeAws_json1_1GetCrawlerCommand */ -export const de_ListMLTransformsCommand = async ( +export const de_GetCrawlerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListMLTransformsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListMLTransformsCommandOutput = { + contents = de_GetCrawlerResponse(data, context); + const response: GetCrawlerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12287,54 +5515,59 @@ export const de_ListMLTransformsCommand = async ( }; /** - * deserializeAws_json1_1ListMLTransformsCommandError + * deserializeAws_json1_1GetCrawlerMetricsCommand */ -const de_ListMLTransformsCommandError = async ( +export const de_GetCrawlerMetricsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetCrawlerMetricsResponse(data, context); + const response: GetCrawlerMetricsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1GetCrawlersCommand + */ +export const de_GetCrawlersCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetCrawlersResponse(data, context); + const response: GetCrawlersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListRegistriesCommand + * deserializeAws_json1_1GetCustomEntityTypeCommand */ -export const de_ListRegistriesCommand = async ( +export const de_GetCustomEntityTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListRegistriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListRegistriesCommandOutput = { + const response: GetCustomEntityTypeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12342,51 +5575,39 @@ export const de_ListRegistriesCommand = async ( }; /** - * deserializeAws_json1_1ListRegistriesCommandError + * deserializeAws_json1_1GetDatabaseCommand */ -const de_ListRegistriesCommandError = async ( +export const de_GetDatabaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetDatabaseResponse(data, context); + const response: GetDatabaseCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListSchemasCommand + * deserializeAws_json1_1GetDatabasesCommand */ -export const de_ListSchemasCommand = async ( +export const de_GetDatabasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSchemasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListSchemasCommandOutput = { + contents = de_GetDatabasesResponse(data, context); + const response: GetDatabasesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12394,54 +5615,39 @@ export const de_ListSchemasCommand = async ( }; /** - * deserializeAws_json1_1ListSchemasCommandError + * deserializeAws_json1_1GetDataCatalogEncryptionSettingsCommand */ -const de_ListSchemasCommandError = async ( +export const de_GetDataCatalogEncryptionSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetDataCatalogEncryptionSettingsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListSchemaVersionsCommand + * deserializeAws_json1_1GetDataflowGraphCommand */ -export const de_ListSchemaVersionsCommand = async ( +export const de_GetDataflowGraphCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSchemaVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListSchemaVersionsCommandOutput = { + const response: GetDataflowGraphCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12449,54 +5655,39 @@ export const de_ListSchemaVersionsCommand = async ( }; /** - * deserializeAws_json1_1ListSchemaVersionsCommandError + * deserializeAws_json1_1GetDataQualityResultCommand */ -const de_ListSchemaVersionsCommandError = async ( +export const de_GetDataQualityResultCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetDataQualityResultResponse(data, context); + const response: GetDataQualityResultCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListSessionsCommand + * deserializeAws_json1_1GetDataQualityRuleRecommendationRunCommand */ -export const de_ListSessionsCommand = async ( +export const de_GetDataQualityRuleRecommendationRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSessionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListSessionsResponse(data, context); - const response: ListSessionsCommandOutput = { + contents = de_GetDataQualityRuleRecommendationRunResponse(data, context); + const response: GetDataQualityRuleRecommendationRunCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12504,54 +5695,39 @@ export const de_ListSessionsCommand = async ( }; /** - * deserializeAws_json1_1ListSessionsCommandError + * deserializeAws_json1_1GetDataQualityRulesetCommand */ -const de_ListSessionsCommandError = async ( +export const de_GetDataQualityRulesetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetDataQualityRulesetResponse(data, context); + const response: GetDataQualityRulesetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListStatementsCommand + * deserializeAws_json1_1GetDataQualityRulesetEvaluationRunCommand */ -export const de_ListStatementsCommand = async ( +export const de_GetDataQualityRulesetEvaluationRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListStatementsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListStatementsResponse(data, context); - const response: ListStatementsCommandOutput = { + contents = de_GetDataQualityRulesetEvaluationRunResponse(data, context); + const response: GetDataQualityRulesetEvaluationRunCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12559,60 +5735,39 @@ export const de_ListStatementsCommand = async ( }; /** - * deserializeAws_json1_1ListStatementsCommandError + * deserializeAws_json1_1GetDevEndpointCommand */ -const de_ListStatementsCommandError = async ( +export const de_GetDevEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "IllegalSessionStateException": - case "com.amazonaws.glue#IllegalSessionStateException": - throw await de_IllegalSessionStateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetDevEndpointResponse(data, context); + const response: GetDevEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTableOptimizerRunsCommand + * deserializeAws_json1_1GetDevEndpointsCommand */ -export const de_ListTableOptimizerRunsCommand = async ( +export const de_GetDevEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTableOptimizerRunsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListTableOptimizerRunsResponse(data, context); - const response: ListTableOptimizerRunsCommandOutput = { + contents = de_GetDevEndpointsResponse(data, context); + const response: GetDevEndpointsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12620,54 +5775,39 @@ export const de_ListTableOptimizerRunsCommand = async ( }; /** - * deserializeAws_json1_1ListTableOptimizerRunsCommandError + * deserializeAws_json1_1GetJobCommand */ -const de_ListTableOptimizerRunsCommandError = async ( +export const de_GetJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetJobResponse(data, context); + const response: GetJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTriggersCommand + * deserializeAws_json1_1GetJobBookmarkCommand */ -export const de_ListTriggersCommand = async ( +export const de_GetJobBookmarkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTriggersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTriggersCommandOutput = { + const response: GetJobBookmarkCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12675,54 +5815,79 @@ export const de_ListTriggersCommand = async ( }; /** - * deserializeAws_json1_1ListTriggersCommandError + * deserializeAws_json1_1GetJobRunCommand */ -const de_ListTriggersCommandError = async ( +export const de_GetJobRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetJobRunResponse(data, context); + const response: GetJobRunCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1GetJobRunsCommand + */ +export const de_GetJobRunsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetJobRunsResponse(data, context); + const response: GetJobRunsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1GetJobsCommand + */ +export const de_GetJobsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetJobsResponse(data, context); + const response: GetJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListWorkflowsCommand + * deserializeAws_json1_1GetMappingCommand */ -export const de_ListWorkflowsCommand = async ( +export const de_GetMappingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListWorkflowsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListWorkflowsCommandOutput = { + const response: GetMappingCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12730,51 +5895,39 @@ export const de_ListWorkflowsCommand = async ( }; /** - * deserializeAws_json1_1ListWorkflowsCommandError + * deserializeAws_json1_1GetMLTaskRunCommand */ -const de_ListWorkflowsCommandError = async ( +export const de_GetMLTaskRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetMLTaskRunResponse(data, context); + const response: GetMLTaskRunCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutDataCatalogEncryptionSettingsCommand + * deserializeAws_json1_1GetMLTaskRunsCommand */ -export const de_PutDataCatalogEncryptionSettingsCommand = async ( +export const de_GetMLTaskRunsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutDataCatalogEncryptionSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: PutDataCatalogEncryptionSettingsCommandOutput = { + contents = de_GetMLTaskRunsResponse(data, context); + const response: GetMLTaskRunsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12782,51 +5935,39 @@ export const de_PutDataCatalogEncryptionSettingsCommand = async ( }; /** - * deserializeAws_json1_1PutDataCatalogEncryptionSettingsCommandError + * deserializeAws_json1_1GetMLTransformCommand */ -const de_PutDataCatalogEncryptionSettingsCommandError = async ( +export const de_GetMLTransformCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetMLTransformResponse(data, context); + const response: GetMLTransformCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutResourcePolicyCommand + * deserializeAws_json1_1GetMLTransformsCommand */ -export const de_PutResourcePolicyCommand = async ( +export const de_GetMLTransformsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: PutResourcePolicyCommandOutput = { + contents = de_GetMLTransformsResponse(data, context); + const response: GetMLTransformsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12834,57 +5975,39 @@ export const de_PutResourcePolicyCommand = async ( }; /** - * deserializeAws_json1_1PutResourcePolicyCommandError + * deserializeAws_json1_1GetPartitionCommand */ -const de_PutResourcePolicyCommandError = async ( +export const de_GetPartitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConditionCheckFailureException": - case "com.amazonaws.glue#ConditionCheckFailureException": - throw await de_ConditionCheckFailureExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetPartitionResponse(data, context); + const response: GetPartitionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutSchemaVersionMetadataCommand + * deserializeAws_json1_1GetPartitionIndexesCommand */ -export const de_PutSchemaVersionMetadataCommand = async ( +export const de_GetPartitionIndexesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutSchemaVersionMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutSchemaVersionMetadataCommandOutput = { + const response: GetPartitionIndexesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12892,57 +6015,39 @@ export const de_PutSchemaVersionMetadataCommand = async ( }; /** - * deserializeAws_json1_1PutSchemaVersionMetadataCommandError + * deserializeAws_json1_1GetPartitionsCommand */ -const de_PutSchemaVersionMetadataCommandError = async ( +export const de_GetPartitionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetPartitionsResponse(data, context); + const response: GetPartitionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutWorkflowRunPropertiesCommand + * deserializeAws_json1_1GetPlanCommand */ -export const de_PutWorkflowRunPropertiesCommand = async ( +export const de_GetPlanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutWorkflowRunPropertiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutWorkflowRunPropertiesCommandOutput = { + const response: GetPlanCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12950,63 +6055,39 @@ export const de_PutWorkflowRunPropertiesCommand = async ( }; /** - * deserializeAws_json1_1PutWorkflowRunPropertiesCommandError + * deserializeAws_json1_1GetRegistryCommand */ -const de_PutWorkflowRunPropertiesCommandError = async ( +export const de_GetRegistryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetRegistryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1QuerySchemaVersionMetadataCommand + * deserializeAws_json1_1GetResourcePoliciesCommand */ -export const de_QuerySchemaVersionMetadataCommand = async ( +export const de_GetResourcePoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_QuerySchemaVersionMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: QuerySchemaVersionMetadataCommandOutput = { + contents = de_GetResourcePoliciesResponse(data, context); + const response: GetResourcePoliciesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13014,51 +6095,39 @@ export const de_QuerySchemaVersionMetadataCommand = async ( }; /** - * deserializeAws_json1_1QuerySchemaVersionMetadataCommandError + * deserializeAws_json1_1GetResourcePolicyCommand */ -const de_QuerySchemaVersionMetadataCommandError = async ( +export const de_GetResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetResourcePolicyResponse(data, context); + const response: GetResourcePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RegisterSchemaVersionCommand + * deserializeAws_json1_1GetSchemaCommand */ -export const de_RegisterSchemaVersionCommand = async ( +export const de_GetSchemaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RegisterSchemaVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: RegisterSchemaVersionCommandOutput = { + const response: GetSchemaCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13066,60 +6135,39 @@ export const de_RegisterSchemaVersionCommand = async ( }; /** - * deserializeAws_json1_1RegisterSchemaVersionCommandError + * deserializeAws_json1_1GetSchemaByDefinitionCommand */ -const de_RegisterSchemaVersionCommandError = async ( +export const de_GetSchemaByDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetSchemaByDefinitionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RemoveSchemaVersionMetadataCommand + * deserializeAws_json1_1GetSchemaVersionCommand */ -export const de_RemoveSchemaVersionMetadataCommand = async ( +export const de_GetSchemaVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RemoveSchemaVersionMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: RemoveSchemaVersionMetadataCommandOutput = { + const response: GetSchemaVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13127,51 +6175,39 @@ export const de_RemoveSchemaVersionMetadataCommand = async ( }; /** - * deserializeAws_json1_1RemoveSchemaVersionMetadataCommandError + * deserializeAws_json1_1GetSchemaVersionsDiffCommand */ -const de_RemoveSchemaVersionMetadataCommandError = async ( +export const de_GetSchemaVersionsDiffCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetSchemaVersionsDiffCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ResetJobBookmarkCommand + * deserializeAws_json1_1GetSecurityConfigurationCommand */ -export const de_ResetJobBookmarkCommand = async ( +export const de_GetSecurityConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ResetJobBookmarkCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ResetJobBookmarkCommandOutput = { + contents = de_GetSecurityConfigurationResponse(data, context); + const response: GetSecurityConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13179,54 +6215,39 @@ export const de_ResetJobBookmarkCommand = async ( }; /** - * deserializeAws_json1_1ResetJobBookmarkCommandError + * deserializeAws_json1_1GetSecurityConfigurationsCommand */ -const de_ResetJobBookmarkCommandError = async ( +export const de_GetSecurityConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetSecurityConfigurationsResponse(data, context); + const response: GetSecurityConfigurationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ResumeWorkflowRunCommand + * deserializeAws_json1_1GetSessionCommand */ -export const de_ResumeWorkflowRunCommand = async ( +export const de_GetSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ResumeWorkflowRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ResumeWorkflowRunCommandOutput = { + contents = de_GetSessionResponse(data, context); + const response: GetSessionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13234,60 +6255,59 @@ export const de_ResumeWorkflowRunCommand = async ( }; /** - * deserializeAws_json1_1ResumeWorkflowRunCommandError + * deserializeAws_json1_1GetStatementCommand */ -const de_ResumeWorkflowRunCommandError = async ( +export const de_GetStatementCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetStatementResponse(data, context); + const response: GetStatementCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentRunsExceededException": - case "com.amazonaws.glue#ConcurrentRunsExceededException": - throw await de_ConcurrentRunsExceededExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "IllegalWorkflowStateException": - case "com.amazonaws.glue#IllegalWorkflowStateException": - throw await de_IllegalWorkflowStateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1GetTableCommand + */ +export const de_GetTableCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetTableResponse(data, context); + const response: GetTableCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RunStatementCommand + * deserializeAws_json1_1GetTableOptimizerCommand */ -export const de_RunStatementCommand = async ( +export const de_GetTableOptimizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RunStatementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: RunStatementCommandOutput = { + contents = de_GetTableOptimizerResponse(data, context); + const response: GetTableOptimizerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13295,66 +6315,39 @@ export const de_RunStatementCommand = async ( }; /** - * deserializeAws_json1_1RunStatementCommandError + * deserializeAws_json1_1GetTablesCommand */ -const de_RunStatementCommandError = async ( +export const de_GetTablesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "IllegalSessionStateException": - case "com.amazonaws.glue#IllegalSessionStateException": - throw await de_IllegalSessionStateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.glue#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetTablesResponse(data, context); + const response: GetTablesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SearchTablesCommand + * deserializeAws_json1_1GetTableVersionCommand */ -export const de_SearchTablesCommand = async ( +export const de_GetTableVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SearchTablesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_SearchTablesResponse(data, context); - const response: SearchTablesCommandOutput = { + contents = de_GetTableVersionResponse(data, context); + const response: GetTableVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13362,51 +6355,39 @@ export const de_SearchTablesCommand = async ( }; /** - * deserializeAws_json1_1SearchTablesCommandError + * deserializeAws_json1_1GetTableVersionsCommand */ -const de_SearchTablesCommandError = async ( +export const de_GetTableVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetTableVersionsResponse(data, context); + const response: GetTableVersionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartBlueprintRunCommand + * deserializeAws_json1_1GetTagsCommand */ -export const de_StartBlueprintRunCommand = async ( +export const de_GetTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartBlueprintRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartBlueprintRunCommandOutput = { + const response: GetTagsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13414,60 +6395,39 @@ export const de_StartBlueprintRunCommand = async ( }; /** - * deserializeAws_json1_1StartBlueprintRunCommandError + * deserializeAws_json1_1GetTriggerCommand */ -const de_StartBlueprintRunCommandError = async ( +export const de_GetTriggerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "IllegalBlueprintStateException": - case "com.amazonaws.glue#IllegalBlueprintStateException": - throw await de_IllegalBlueprintStateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetTriggerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartColumnStatisticsTaskRunCommand + * deserializeAws_json1_1GetTriggersCommand */ -export const de_StartColumnStatisticsTaskRunCommand = async ( +export const de_GetTriggersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartColumnStatisticsTaskRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartColumnStatisticsTaskRunCommandOutput = { + const response: GetTriggersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13475,60 +6435,39 @@ export const de_StartColumnStatisticsTaskRunCommand = async ( }; /** - * deserializeAws_json1_1StartColumnStatisticsTaskRunCommandError + * deserializeAws_json1_1GetUnfilteredPartitionMetadataCommand */ -const de_StartColumnStatisticsTaskRunCommandError = async ( +export const de_GetUnfilteredPartitionMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ColumnStatisticsTaskRunningException": - case "com.amazonaws.glue#ColumnStatisticsTaskRunningException": - throw await de_ColumnStatisticsTaskRunningExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetUnfilteredPartitionMetadataResponse(data, context); + const response: GetUnfilteredPartitionMetadataCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartCrawlerCommand + * deserializeAws_json1_1GetUnfilteredPartitionsMetadataCommand */ -export const de_StartCrawlerCommand = async ( +export const de_GetUnfilteredPartitionsMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartCrawlerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartCrawlerCommandOutput = { + contents = de_GetUnfilteredPartitionsMetadataResponse(data, context); + const response: GetUnfilteredPartitionsMetadataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13536,51 +6475,59 @@ export const de_StartCrawlerCommand = async ( }; /** - * deserializeAws_json1_1StartCrawlerCommandError + * deserializeAws_json1_1GetUnfilteredTableMetadataCommand */ -const de_StartCrawlerCommandError = async ( +export const de_GetUnfilteredTableMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetUnfilteredTableMetadataResponse(data, context); + const response: GetUnfilteredTableMetadataCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CrawlerRunningException": - case "com.amazonaws.glue#CrawlerRunningException": - throw await de_CrawlerRunningExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1GetUserDefinedFunctionCommand + */ +export const de_GetUserDefinedFunctionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetUserDefinedFunctionResponse(data, context); + const response: GetUserDefinedFunctionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartCrawlerScheduleCommand + * deserializeAws_json1_1GetUserDefinedFunctionsCommand */ -export const de_StartCrawlerScheduleCommand = async ( +export const de_GetUserDefinedFunctionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartCrawlerScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartCrawlerScheduleCommandOutput = { + contents = de_GetUserDefinedFunctionsResponse(data, context); + const response: GetUserDefinedFunctionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13588,57 +6535,59 @@ export const de_StartCrawlerScheduleCommand = async ( }; /** - * deserializeAws_json1_1StartCrawlerScheduleCommandError + * deserializeAws_json1_1GetWorkflowCommand */ -const de_StartCrawlerScheduleCommandError = async ( +export const de_GetWorkflowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetWorkflowResponse(data, context); + const response: GetWorkflowCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "NoScheduleException": - case "com.amazonaws.glue#NoScheduleException": - throw await de_NoScheduleExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "SchedulerRunningException": - case "com.amazonaws.glue#SchedulerRunningException": - throw await de_SchedulerRunningExceptionRes(parsedOutput, context); - case "SchedulerTransitioningException": - case "com.amazonaws.glue#SchedulerTransitioningException": - throw await de_SchedulerTransitioningExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1GetWorkflowRunCommand + */ +export const de_GetWorkflowRunCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetWorkflowRunResponse(data, context); + const response: GetWorkflowRunCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartDataQualityRuleRecommendationRunCommand + * deserializeAws_json1_1GetWorkflowRunPropertiesCommand */ -export const de_StartDataQualityRuleRecommendationRunCommand = async ( +export const de_GetWorkflowRunPropertiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartDataQualityRuleRecommendationRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartDataQualityRuleRecommendationRunCommandOutput = { + const response: GetWorkflowRunPropertiesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13646,54 +6595,39 @@ export const de_StartDataQualityRuleRecommendationRunCommand = async ( }; /** - * deserializeAws_json1_1StartDataQualityRuleRecommendationRunCommandError + * deserializeAws_json1_1GetWorkflowRunsCommand */ -const de_StartDataQualityRuleRecommendationRunCommandError = async ( +export const de_GetWorkflowRunsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.glue#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetWorkflowRunsResponse(data, context); + const response: GetWorkflowRunsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartDataQualityRulesetEvaluationRunCommand + * deserializeAws_json1_1ImportCatalogToGlueCommand */ -export const de_StartDataQualityRulesetEvaluationRunCommand = async ( +export const de_ImportCatalogToGlueCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartDataQualityRulesetEvaluationRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartDataQualityRulesetEvaluationRunCommandOutput = { + const response: ImportCatalogToGlueCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13701,57 +6635,39 @@ export const de_StartDataQualityRulesetEvaluationRunCommand = async ( }; /** - * deserializeAws_json1_1StartDataQualityRulesetEvaluationRunCommandError + * deserializeAws_json1_1ListBlueprintsCommand */ -const de_StartDataQualityRulesetEvaluationRunCommandError = async ( +export const de_ListBlueprintsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.glue#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListBlueprintsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartExportLabelsTaskRunCommand + * deserializeAws_json1_1ListColumnStatisticsTaskRunsCommand */ -export const de_StartExportLabelsTaskRunCommand = async ( +export const de_ListColumnStatisticsTaskRunsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartExportLabelsTaskRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartExportLabelsTaskRunCommandOutput = { + const response: ListColumnStatisticsTaskRunsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13759,54 +6675,39 @@ export const de_StartExportLabelsTaskRunCommand = async ( }; /** - * deserializeAws_json1_1StartExportLabelsTaskRunCommandError + * deserializeAws_json1_1ListCrawlersCommand */ -const de_StartExportLabelsTaskRunCommandError = async ( +export const de_ListCrawlersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListCrawlersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartImportLabelsTaskRunCommand + * deserializeAws_json1_1ListCrawlsCommand */ -export const de_StartImportLabelsTaskRunCommand = async ( +export const de_ListCrawlsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartImportLabelsTaskRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartImportLabelsTaskRunCommandOutput = { + contents = de_ListCrawlsResponse(data, context); + const response: ListCrawlsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13814,57 +6715,39 @@ export const de_StartImportLabelsTaskRunCommand = async ( }; /** - * deserializeAws_json1_1StartImportLabelsTaskRunCommandError + * deserializeAws_json1_1ListCustomEntityTypesCommand */ -const de_StartImportLabelsTaskRunCommandError = async ( +export const de_ListCustomEntityTypesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListCustomEntityTypesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartJobRunCommand + * deserializeAws_json1_1ListDataQualityResultsCommand */ -export const de_StartJobRunCommand = async ( +export const de_ListDataQualityResultsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartJobRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartJobRunCommandOutput = { + contents = de_ListDataQualityResultsResponse(data, context); + const response: ListDataQualityResultsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13872,60 +6755,39 @@ export const de_StartJobRunCommand = async ( }; /** - * deserializeAws_json1_1StartJobRunCommandError + * deserializeAws_json1_1ListDataQualityRuleRecommendationRunsCommand */ -const de_StartJobRunCommandError = async ( +export const de_ListDataQualityRuleRecommendationRunsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentRunsExceededException": - case "com.amazonaws.glue#ConcurrentRunsExceededException": - throw await de_ConcurrentRunsExceededExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDataQualityRuleRecommendationRunsResponse(data, context); + const response: ListDataQualityRuleRecommendationRunsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartMLEvaluationTaskRunCommand + * deserializeAws_json1_1ListDataQualityRulesetEvaluationRunsCommand */ -export const de_StartMLEvaluationTaskRunCommand = async ( +export const de_ListDataQualityRulesetEvaluationRunsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartMLEvaluationTaskRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartMLEvaluationTaskRunCommandOutput = { + contents = de_ListDataQualityRulesetEvaluationRunsResponse(data, context); + const response: ListDataQualityRulesetEvaluationRunsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13933,60 +6795,39 @@ export const de_StartMLEvaluationTaskRunCommand = async ( }; /** - * deserializeAws_json1_1StartMLEvaluationTaskRunCommandError + * deserializeAws_json1_1ListDataQualityRulesetsCommand */ -const de_StartMLEvaluationTaskRunCommandError = async ( +export const de_ListDataQualityRulesetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentRunsExceededException": - case "com.amazonaws.glue#ConcurrentRunsExceededException": - throw await de_ConcurrentRunsExceededExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "MLTransformNotReadyException": - case "com.amazonaws.glue#MLTransformNotReadyException": - throw await de_MLTransformNotReadyExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDataQualityRulesetsResponse(data, context); + const response: ListDataQualityRulesetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartMLLabelingSetGenerationTaskRunCommand + * deserializeAws_json1_1ListDevEndpointsCommand */ -export const de_StartMLLabelingSetGenerationTaskRunCommand = async ( +export const de_ListDevEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartMLLabelingSetGenerationTaskRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartMLLabelingSetGenerationTaskRunCommandOutput = { + const response: ListDevEndpointsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -13994,57 +6835,39 @@ export const de_StartMLLabelingSetGenerationTaskRunCommand = async ( }; /** - * deserializeAws_json1_1StartMLLabelingSetGenerationTaskRunCommandError + * deserializeAws_json1_1ListJobsCommand */ -const de_StartMLLabelingSetGenerationTaskRunCommandError = async ( +export const de_ListJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentRunsExceededException": - case "com.amazonaws.glue#ConcurrentRunsExceededException": - throw await de_ConcurrentRunsExceededExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartTriggerCommand + * deserializeAws_json1_1ListMLTransformsCommand */ -export const de_StartTriggerCommand = async ( +export const de_ListMLTransformsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartTriggerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartTriggerCommandOutput = { + const response: ListMLTransformsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14052,60 +6875,39 @@ export const de_StartTriggerCommand = async ( }; /** - * deserializeAws_json1_1StartTriggerCommandError + * deserializeAws_json1_1ListRegistriesCommand */ -const de_StartTriggerCommandError = async ( +export const de_ListRegistriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentRunsExceededException": - case "com.amazonaws.glue#ConcurrentRunsExceededException": - throw await de_ConcurrentRunsExceededExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListRegistriesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartWorkflowRunCommand + * deserializeAws_json1_1ListSchemasCommand */ -export const de_StartWorkflowRunCommand = async ( +export const de_ListSchemasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartWorkflowRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartWorkflowRunCommandOutput = { + const response: ListSchemasCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14113,60 +6915,39 @@ export const de_StartWorkflowRunCommand = async ( }; /** - * deserializeAws_json1_1StartWorkflowRunCommandError + * deserializeAws_json1_1ListSchemaVersionsCommand */ -const de_StartWorkflowRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentRunsExceededException": - case "com.amazonaws.glue#ConcurrentRunsExceededException": - throw await de_ConcurrentRunsExceededExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_ListSchemaVersionsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListSchemaVersionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopColumnStatisticsTaskRunCommand + * deserializeAws_json1_1ListSessionsCommand */ -export const de_StopColumnStatisticsTaskRunCommand = async ( +export const de_ListSessionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopColumnStatisticsTaskRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StopColumnStatisticsTaskRunCommandOutput = { + contents = de_ListSessionsResponse(data, context); + const response: ListSessionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14174,54 +6955,39 @@ export const de_StopColumnStatisticsTaskRunCommand = async ( }; /** - * deserializeAws_json1_1StopColumnStatisticsTaskRunCommandError + * deserializeAws_json1_1ListStatementsCommand */ -const de_StopColumnStatisticsTaskRunCommandError = async ( +export const de_ListStatementsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ColumnStatisticsTaskNotRunningException": - case "com.amazonaws.glue#ColumnStatisticsTaskNotRunningException": - throw await de_ColumnStatisticsTaskNotRunningExceptionRes(parsedOutput, context); - case "ColumnStatisticsTaskStoppingException": - case "com.amazonaws.glue#ColumnStatisticsTaskStoppingException": - throw await de_ColumnStatisticsTaskStoppingExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListStatementsResponse(data, context); + const response: ListStatementsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopCrawlerCommand + * deserializeAws_json1_1ListTableOptimizerRunsCommand */ -export const de_StopCrawlerCommand = async ( +export const de_ListTableOptimizerRunsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopCrawlerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StopCrawlerCommandOutput = { + contents = de_ListTableOptimizerRunsResponse(data, context); + const response: ListTableOptimizerRunsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14229,54 +6995,39 @@ export const de_StopCrawlerCommand = async ( }; /** - * deserializeAws_json1_1StopCrawlerCommandError + * deserializeAws_json1_1ListTriggersCommand */ -const de_StopCrawlerCommandError = async ( +export const de_ListTriggersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CrawlerNotRunningException": - case "com.amazonaws.glue#CrawlerNotRunningException": - throw await de_CrawlerNotRunningExceptionRes(parsedOutput, context); - case "CrawlerStoppingException": - case "com.amazonaws.glue#CrawlerStoppingException": - throw await de_CrawlerStoppingExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTriggersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopCrawlerScheduleCommand + * deserializeAws_json1_1ListWorkflowsCommand */ -export const de_StopCrawlerScheduleCommand = async ( +export const de_ListWorkflowsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopCrawlerScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopCrawlerScheduleCommandOutput = { + const response: ListWorkflowsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14284,54 +7035,39 @@ export const de_StopCrawlerScheduleCommand = async ( }; /** - * deserializeAws_json1_1StopCrawlerScheduleCommandError + * deserializeAws_json1_1PutDataCatalogEncryptionSettingsCommand */ -const de_StopCrawlerScheduleCommandError = async ( +export const de_PutDataCatalogEncryptionSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "SchedulerNotRunningException": - case "com.amazonaws.glue#SchedulerNotRunningException": - throw await de_SchedulerNotRunningExceptionRes(parsedOutput, context); - case "SchedulerTransitioningException": - case "com.amazonaws.glue#SchedulerTransitioningException": - throw await de_SchedulerTransitioningExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutDataCatalogEncryptionSettingsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopSessionCommand + * deserializeAws_json1_1PutResourcePolicyCommand */ -export const de_StopSessionCommand = async ( +export const de_PutResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopSessionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopSessionCommandOutput = { + const response: PutResourcePolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14339,60 +7075,39 @@ export const de_StopSessionCommand = async ( }; /** - * deserializeAws_json1_1StopSessionCommandError + * deserializeAws_json1_1PutSchemaVersionMetadataCommand */ -const de_StopSessionCommandError = async ( +export const de_PutSchemaVersionMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "IllegalSessionStateException": - case "com.amazonaws.glue#IllegalSessionStateException": - throw await de_IllegalSessionStateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutSchemaVersionMetadataCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopTriggerCommand + * deserializeAws_json1_1PutWorkflowRunPropertiesCommand */ -export const de_StopTriggerCommand = async ( +export const de_PutWorkflowRunPropertiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopTriggerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopTriggerCommandOutput = { + const response: PutWorkflowRunPropertiesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14400,57 +7115,59 @@ export const de_StopTriggerCommand = async ( }; /** - * deserializeAws_json1_1StopTriggerCommandError + * deserializeAws_json1_1QuerySchemaVersionMetadataCommand */ -const de_StopTriggerCommandError = async ( +export const de_QuerySchemaVersionMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: QuerySchemaVersionMetadataCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1RegisterSchemaVersionCommand + */ +export const de_RegisterSchemaVersionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: RegisterSchemaVersionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopWorkflowRunCommand + * deserializeAws_json1_1RemoveSchemaVersionMetadataCommand */ -export const de_StopWorkflowRunCommand = async ( +export const de_RemoveSchemaVersionMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopWorkflowRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopWorkflowRunCommandOutput = { + const response: RemoveSchemaVersionMetadataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14458,57 +7175,39 @@ export const de_StopWorkflowRunCommand = async ( }; /** - * deserializeAws_json1_1StopWorkflowRunCommandError + * deserializeAws_json1_1ResetJobBookmarkCommand */ -const de_StopWorkflowRunCommandError = async ( +export const de_ResetJobBookmarkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "IllegalWorkflowStateException": - case "com.amazonaws.glue#IllegalWorkflowStateException": - throw await de_IllegalWorkflowStateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ResetJobBookmarkCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1ResumeWorkflowRunCommand */ -export const de_TagResourceCommand = async ( +export const de_ResumeWorkflowRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: ResumeWorkflowRunCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14516,54 +7215,59 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1RunStatementCommand */ -const de_TagResourceCommandError = async ( +export const de_RunStatementCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: RunStatementCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1SearchTablesCommand + */ +export const de_SearchTablesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SearchTablesResponse(data, context); + const response: SearchTablesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UntagResourceCommand + * deserializeAws_json1_1StartBlueprintRunCommand */ -export const de_UntagResourceCommand = async ( +export const de_StartBlueprintRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UntagResourceCommandOutput = { + const response: StartBlueprintRunCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14571,54 +7275,39 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserializeAws_json1_1StartColumnStatisticsTaskRunCommand */ -const de_UntagResourceCommandError = async ( +export const de_StartColumnStatisticsTaskRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartColumnStatisticsTaskRunCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateBlueprintCommand + * deserializeAws_json1_1StartCrawlerCommand */ -export const de_UpdateBlueprintCommand = async ( +export const de_StartCrawlerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateBlueprintCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateBlueprintCommandOutput = { + const response: StartCrawlerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14626,60 +7315,39 @@ export const de_UpdateBlueprintCommand = async ( }; /** - * deserializeAws_json1_1UpdateBlueprintCommandError + * deserializeAws_json1_1StartCrawlerScheduleCommand */ -const de_UpdateBlueprintCommandError = async ( +export const de_StartCrawlerScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "IllegalBlueprintStateException": - case "com.amazonaws.glue#IllegalBlueprintStateException": - throw await de_IllegalBlueprintStateExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartCrawlerScheduleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateClassifierCommand + * deserializeAws_json1_1StartDataQualityRuleRecommendationRunCommand */ -export const de_UpdateClassifierCommand = async ( +export const de_StartDataQualityRuleRecommendationRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateClassifierCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateClassifierCommandOutput = { + const response: StartDataQualityRuleRecommendationRunCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14687,54 +7355,39 @@ export const de_UpdateClassifierCommand = async ( }; /** - * deserializeAws_json1_1UpdateClassifierCommandError + * deserializeAws_json1_1StartDataQualityRulesetEvaluationRunCommand */ -const de_UpdateClassifierCommandError = async ( +export const de_StartDataQualityRulesetEvaluationRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "VersionMismatchException": - case "com.amazonaws.glue#VersionMismatchException": - throw await de_VersionMismatchExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartDataQualityRulesetEvaluationRunCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateColumnStatisticsForPartitionCommand + * deserializeAws_json1_1StartExportLabelsTaskRunCommand */ -export const de_UpdateColumnStatisticsForPartitionCommand = async ( +export const de_StartExportLabelsTaskRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateColumnStatisticsForPartitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateColumnStatisticsForPartitionResponse(data, context); - const response: UpdateColumnStatisticsForPartitionCommandOutput = { + contents = _json(data); + const response: StartExportLabelsTaskRunCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14742,57 +7395,39 @@ export const de_UpdateColumnStatisticsForPartitionCommand = async ( }; /** - * deserializeAws_json1_1UpdateColumnStatisticsForPartitionCommandError + * deserializeAws_json1_1StartImportLabelsTaskRunCommand */ -const de_UpdateColumnStatisticsForPartitionCommandError = async ( +export const de_StartImportLabelsTaskRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartImportLabelsTaskRunCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateColumnStatisticsForTableCommand + * deserializeAws_json1_1StartJobRunCommand */ -export const de_UpdateColumnStatisticsForTableCommand = async ( +export const de_StartJobRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateColumnStatisticsForTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateColumnStatisticsForTableResponse(data, context); - const response: UpdateColumnStatisticsForTableCommandOutput = { + contents = _json(data); + const response: StartJobRunCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14800,57 +7435,39 @@ export const de_UpdateColumnStatisticsForTableCommand = async ( }; /** - * deserializeAws_json1_1UpdateColumnStatisticsForTableCommandError + * deserializeAws_json1_1StartMLEvaluationTaskRunCommand */ -const de_UpdateColumnStatisticsForTableCommandError = async ( +export const de_StartMLEvaluationTaskRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartMLEvaluationTaskRunCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateConnectionCommand + * deserializeAws_json1_1StartMLLabelingSetGenerationTaskRunCommand */ -export const de_UpdateConnectionCommand = async ( +export const de_StartMLLabelingSetGenerationTaskRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateConnectionCommandOutput = { + const response: StartMLLabelingSetGenerationTaskRunCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14858,54 +7475,39 @@ export const de_UpdateConnectionCommand = async ( }; /** - * deserializeAws_json1_1UpdateConnectionCommandError + * deserializeAws_json1_1StartTriggerCommand */ -const de_UpdateConnectionCommandError = async ( +export const de_StartTriggerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartTriggerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateCrawlerCommand + * deserializeAws_json1_1StartWorkflowRunCommand */ -export const de_UpdateCrawlerCommand = async ( +export const de_StartWorkflowRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateCrawlerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateCrawlerCommandOutput = { + const response: StartWorkflowRunCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14913,57 +7515,39 @@ export const de_UpdateCrawlerCommand = async ( }; /** - * deserializeAws_json1_1UpdateCrawlerCommandError + * deserializeAws_json1_1StopColumnStatisticsTaskRunCommand */ -const de_UpdateCrawlerCommandError = async ( +export const de_StopColumnStatisticsTaskRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CrawlerRunningException": - case "com.amazonaws.glue#CrawlerRunningException": - throw await de_CrawlerRunningExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "VersionMismatchException": - case "com.amazonaws.glue#VersionMismatchException": - throw await de_VersionMismatchExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StopColumnStatisticsTaskRunCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateCrawlerScheduleCommand + * deserializeAws_json1_1StopCrawlerCommand */ -export const de_UpdateCrawlerScheduleCommand = async ( +export const de_StopCrawlerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateCrawlerScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateCrawlerScheduleCommandOutput = { + const response: StopCrawlerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -14971,57 +7555,59 @@ export const de_UpdateCrawlerScheduleCommand = async ( }; /** - * deserializeAws_json1_1UpdateCrawlerScheduleCommandError + * deserializeAws_json1_1StopCrawlerScheduleCommand */ -const de_UpdateCrawlerScheduleCommandError = async ( +export const de_StopCrawlerScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StopCrawlerScheduleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "SchedulerTransitioningException": - case "com.amazonaws.glue#SchedulerTransitioningException": - throw await de_SchedulerTransitioningExceptionRes(parsedOutput, context); - case "VersionMismatchException": - case "com.amazonaws.glue#VersionMismatchException": - throw await de_VersionMismatchExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1StopSessionCommand + */ +export const de_StopSessionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StopSessionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateDatabaseCommand + * deserializeAws_json1_1StopTriggerCommand */ -export const de_UpdateDatabaseCommand = async ( +export const de_StopTriggerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateDatabaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateDatabaseCommandOutput = { + const response: StopTriggerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -15029,60 +7615,39 @@ export const de_UpdateDatabaseCommand = async ( }; /** - * deserializeAws_json1_1UpdateDatabaseCommandError + * deserializeAws_json1_1StopWorkflowRunCommand */ -const de_UpdateDatabaseCommandError = async ( +export const de_StopWorkflowRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StopWorkflowRunCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateDataQualityRulesetCommand + * deserializeAws_json1_1TagResourceCommand */ -export const de_UpdateDataQualityRulesetCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateDataQualityRulesetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateDataQualityRulesetCommandOutput = { + const response: TagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -15090,63 +7655,39 @@ export const de_UpdateDataQualityRulesetCommand = async ( }; /** - * deserializeAws_json1_1UpdateDataQualityRulesetCommandError + * deserializeAws_json1_1UntagResourceCommand */ -const de_UpdateDataQualityRulesetCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.glue#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateDevEndpointCommand + * deserializeAws_json1_1UpdateBlueprintCommand */ -export const de_UpdateDevEndpointCommand = async ( +export const de_UpdateBlueprintCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateDevEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateDevEndpointCommandOutput = { + const response: UpdateBlueprintCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -15154,57 +7695,39 @@ export const de_UpdateDevEndpointCommand = async ( }; /** - * deserializeAws_json1_1UpdateDevEndpointCommandError + * deserializeAws_json1_1UpdateClassifierCommand */ -const de_UpdateDevEndpointCommandError = async ( +export const de_UpdateClassifierCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.glue#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateClassifierCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateJobCommand + * deserializeAws_json1_1UpdateColumnStatisticsForPartitionCommand */ -export const de_UpdateJobCommand = async ( +export const de_UpdateColumnStatisticsForPartitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: UpdateJobCommandOutput = { + contents = de_UpdateColumnStatisticsForPartitionResponse(data, context); + const response: UpdateColumnStatisticsForPartitionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -15212,57 +7735,39 @@ export const de_UpdateJobCommand = async ( }; /** - * deserializeAws_json1_1UpdateJobCommandError + * deserializeAws_json1_1UpdateColumnStatisticsForTableCommand */ -const de_UpdateJobCommandError = async ( +export const de_UpdateColumnStatisticsForTableCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateColumnStatisticsForTableResponse(data, context); + const response: UpdateColumnStatisticsForTableCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateJobFromSourceControlCommand + * deserializeAws_json1_1UpdateConnectionCommand */ -export const de_UpdateJobFromSourceControlCommand = async ( +export const de_UpdateConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateJobFromSourceControlCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateJobFromSourceControlCommandOutput = { + const response: UpdateConnectionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -15270,63 +7775,39 @@ export const de_UpdateJobFromSourceControlCommand = async ( }; /** - * deserializeAws_json1_1UpdateJobFromSourceControlCommandError + * deserializeAws_json1_1UpdateCrawlerCommand */ -const de_UpdateJobFromSourceControlCommandError = async ( +export const de_UpdateCrawlerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.glue#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateCrawlerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateMLTransformCommand + * deserializeAws_json1_1UpdateCrawlerScheduleCommand */ -export const de_UpdateMLTransformCommand = async ( +export const de_UpdateCrawlerScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateMLTransformCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateMLTransformCommandOutput = { + const response: UpdateCrawlerScheduleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -15334,57 +7815,39 @@ export const de_UpdateMLTransformCommand = async ( }; /** - * deserializeAws_json1_1UpdateMLTransformCommandError + * deserializeAws_json1_1UpdateDatabaseCommand */ -const de_UpdateMLTransformCommandError = async ( +export const de_UpdateDatabaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateDatabaseCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdatePartitionCommand + * deserializeAws_json1_1UpdateDataQualityRulesetCommand */ -export const de_UpdatePartitionCommand = async ( +export const de_UpdateDataQualityRulesetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdatePartitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdatePartitionCommandOutput = { + const response: UpdateDataQualityRulesetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -15392,57 +7855,39 @@ export const de_UpdatePartitionCommand = async ( }; /** - * deserializeAws_json1_1UpdatePartitionCommandError + * deserializeAws_json1_1UpdateDevEndpointCommand */ -const de_UpdatePartitionCommandError = async ( +export const de_UpdateDevEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateDevEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateRegistryCommand + * deserializeAws_json1_1UpdateJobCommand */ -export const de_UpdateRegistryCommand = async ( +export const de_UpdateJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateRegistryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateRegistryCommandOutput = { + const response: UpdateJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -15450,57 +7895,39 @@ export const de_UpdateRegistryCommand = async ( }; /** - * deserializeAws_json1_1UpdateRegistryCommandError + * deserializeAws_json1_1UpdateJobFromSourceControlCommand */ -const de_UpdateRegistryCommandError = async ( +export const de_UpdateJobFromSourceControlCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateJobFromSourceControlCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateSchemaCommand + * deserializeAws_json1_1UpdateMLTransformCommand */ -export const de_UpdateSchemaCommand = async ( +export const de_UpdateMLTransformCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateSchemaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateSchemaCommandOutput = { + const response: UpdateMLTransformCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -15508,57 +7935,39 @@ export const de_UpdateSchemaCommand = async ( }; /** - * deserializeAws_json1_1UpdateSchemaCommandError + * deserializeAws_json1_1UpdatePartitionCommand */ -const de_UpdateSchemaCommandError = async ( +export const de_UpdatePartitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdatePartitionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateSourceControlFromJobCommand + * deserializeAws_json1_1UpdateRegistryCommand */ -export const de_UpdateSourceControlFromJobCommand = async ( +export const de_UpdateRegistryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateSourceControlFromJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateSourceControlFromJobCommandOutput = { + const response: UpdateRegistryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -15566,63 +7975,39 @@ export const de_UpdateSourceControlFromJobCommand = async ( }; /** - * deserializeAws_json1_1UpdateSourceControlFromJobCommandError + * deserializeAws_json1_1UpdateSchemaCommand */ -const de_UpdateSourceControlFromJobCommandError = async ( +export const de_UpdateSchemaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AlreadyExistsException": - case "com.amazonaws.glue#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.glue#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateSchemaCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateTableCommand + * deserializeAws_json1_1UpdateSourceControlFromJobCommand */ -export const de_UpdateTableCommand = async ( +export const de_UpdateSourceControlFromJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateTableCommandOutput = { + const response: UpdateSourceControlFromJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -15630,50 +8015,23 @@ export const de_UpdateTableCommand = async ( }; /** - * deserializeAws_json1_1UpdateTableCommandError + * deserializeAws_json1_1UpdateTableCommand */ -const de_UpdateTableCommandError = async ( +export const de_UpdateTableCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.glue#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.glue#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateTableCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -15684,7 +8042,7 @@ export const de_UpdateTableOptimizerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTableOptimizerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15696,41 +8054,6 @@ export const de_UpdateTableOptimizerCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateTableOptimizerCommandError - */ -const de_UpdateTableOptimizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.glue#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateTriggerCommand */ @@ -15739,7 +8062,7 @@ export const de_UpdateTriggerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTriggerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15751,44 +8074,6 @@ export const de_UpdateTriggerCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateTriggerCommandError - */ -const de_UpdateTriggerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateUserDefinedFunctionCommand */ @@ -15797,7 +8082,7 @@ export const de_UpdateUserDefinedFunctionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateUserDefinedFunctionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15809,44 +8094,6 @@ export const de_UpdateUserDefinedFunctionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateUserDefinedFunctionCommandError - */ -const de_UpdateUserDefinedFunctionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.glue#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.glue#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.glue#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.glue#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.glue#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateWorkflowCommand */ @@ -15855,7 +8102,7 @@ export const de_UpdateWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateWorkflowCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15868,24 +8115,24 @@ export const de_UpdateWorkflowCommand = async ( }; /** - * deserializeAws_json1_1UpdateWorkflowCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.glue#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "AlreadyExistsException": + case "com.amazonaws.glue#AlreadyExistsException": + throw await de_AlreadyExistsExceptionRes(parsedOutput, context); case "EntityNotFoundException": case "com.amazonaws.glue#EntityNotFoundException": throw await de_EntityNotFoundExceptionRes(parsedOutput, context); + case "GlueEncryptionException": + case "com.amazonaws.glue#GlueEncryptionException": + throw await de_GlueEncryptionExceptionRes(parsedOutput, context); case "InternalServiceException": case "com.amazonaws.glue#InternalServiceException": throw await de_InternalServiceExceptionRes(parsedOutput, context); @@ -15895,13 +8142,100 @@ const de_UpdateWorkflowCommandError = async ( case "OperationTimeoutException": case "com.amazonaws.glue#OperationTimeoutException": throw await de_OperationTimeoutExceptionRes(parsedOutput, context); + case "ResourceNumberLimitExceededException": + case "com.amazonaws.glue#ResourceNumberLimitExceededException": + throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); + case "ResourceNotReadyException": + case "com.amazonaws.glue#ResourceNotReadyException": + throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.glue#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "FederationSourceException": + case "com.amazonaws.glue#FederationSourceException": + throw await de_FederationSourceExceptionRes(parsedOutput, context); + case "FederationSourceRetryableException": + case "com.amazonaws.glue#FederationSourceRetryableException": + throw await de_FederationSourceRetryableExceptionRes(parsedOutput, context); + case "InvalidStateException": + case "com.amazonaws.glue#InvalidStateException": + throw await de_InvalidStateExceptionRes(parsedOutput, context); + case "IllegalSessionStateException": + case "com.amazonaws.glue#IllegalSessionStateException": + throw await de_IllegalSessionStateExceptionRes(parsedOutput, context); + case "IdempotentParameterMismatchException": + case "com.amazonaws.glue#IdempotentParameterMismatchException": + throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.glue#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "FederatedResourceAlreadyExistsException": + case "com.amazonaws.glue#FederatedResourceAlreadyExistsException": + throw await de_FederatedResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.glue#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "CrawlerRunningException": + case "com.amazonaws.glue#CrawlerRunningException": + throw await de_CrawlerRunningExceptionRes(parsedOutput, context); + case "SchedulerTransitioningException": + case "com.amazonaws.glue#SchedulerTransitioningException": + throw await de_SchedulerTransitioningExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.glue#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ConditionCheckFailureException": + case "com.amazonaws.glue#ConditionCheckFailureException": + throw await de_ConditionCheckFailureExceptionRes(parsedOutput, context); + case "PermissionTypeMismatchException": + case "com.amazonaws.glue#PermissionTypeMismatchException": + throw await de_PermissionTypeMismatchExceptionRes(parsedOutput, context); + case "ConcurrentRunsExceededException": + case "com.amazonaws.glue#ConcurrentRunsExceededException": + throw await de_ConcurrentRunsExceededExceptionRes(parsedOutput, context); + case "IllegalWorkflowStateException": + case "com.amazonaws.glue#IllegalWorkflowStateException": + throw await de_IllegalWorkflowStateExceptionRes(parsedOutput, context); + case "IllegalBlueprintStateException": + case "com.amazonaws.glue#IllegalBlueprintStateException": + throw await de_IllegalBlueprintStateExceptionRes(parsedOutput, context); + case "ColumnStatisticsTaskRunningException": + case "com.amazonaws.glue#ColumnStatisticsTaskRunningException": + throw await de_ColumnStatisticsTaskRunningExceptionRes(parsedOutput, context); + case "NoScheduleException": + case "com.amazonaws.glue#NoScheduleException": + throw await de_NoScheduleExceptionRes(parsedOutput, context); + case "SchedulerRunningException": + case "com.amazonaws.glue#SchedulerRunningException": + throw await de_SchedulerRunningExceptionRes(parsedOutput, context); + case "MLTransformNotReadyException": + case "com.amazonaws.glue#MLTransformNotReadyException": + throw await de_MLTransformNotReadyExceptionRes(parsedOutput, context); + case "ColumnStatisticsTaskNotRunningException": + case "com.amazonaws.glue#ColumnStatisticsTaskNotRunningException": + throw await de_ColumnStatisticsTaskNotRunningExceptionRes(parsedOutput, context); + case "ColumnStatisticsTaskStoppingException": + case "com.amazonaws.glue#ColumnStatisticsTaskStoppingException": + throw await de_ColumnStatisticsTaskStoppingExceptionRes(parsedOutput, context); + case "CrawlerNotRunningException": + case "com.amazonaws.glue#CrawlerNotRunningException": + throw await de_CrawlerNotRunningExceptionRes(parsedOutput, context); + case "CrawlerStoppingException": + case "com.amazonaws.glue#CrawlerStoppingException": + throw await de_CrawlerStoppingExceptionRes(parsedOutput, context); + case "SchedulerNotRunningException": + case "com.amazonaws.glue#SchedulerNotRunningException": + throw await de_SchedulerNotRunningExceptionRes(parsedOutput, context); + case "VersionMismatchException": + case "com.amazonaws.glue#VersionMismatchException": + throw await de_VersionMismatchExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-grafana/src/protocols/Aws_restJson1.ts b/clients/client-grafana/src/protocols/Aws_restJson1.ts index a8f55ab3a81a..8e3eaf76b3fb 100644 --- a/clients/client-grafana/src/protocols/Aws_restJson1.ts +++ b/clients/client-grafana/src/protocols/Aws_restJson1.ts @@ -509,7 +509,7 @@ export const de_AssociateLicenseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_AssociateLicenseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -522,44 +522,6 @@ export const de_AssociateLicenseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateLicenseCommandError - */ -const de_AssociateLicenseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWorkspaceCommand */ @@ -568,7 +530,7 @@ export const de_CreateWorkspaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateWorkspaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -581,47 +543,6 @@ export const de_CreateWorkspaceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWorkspaceCommandError - */ -const de_CreateWorkspaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.grafana#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.grafana#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWorkspaceApiKeyCommand */ @@ -630,7 +551,7 @@ export const de_CreateWorkspaceApiKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWorkspaceApiKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -645,50 +566,6 @@ export const de_CreateWorkspaceApiKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWorkspaceApiKeyCommandError - */ -const de_CreateWorkspaceApiKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.grafana#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.grafana#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteWorkspaceCommand */ @@ -697,7 +574,7 @@ export const de_DeleteWorkspaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteWorkspaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -710,47 +587,6 @@ export const de_DeleteWorkspaceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteWorkspaceCommandError - */ -const de_DeleteWorkspaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.grafana#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteWorkspaceApiKeyCommand */ @@ -759,7 +595,7 @@ export const de_DeleteWorkspaceApiKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteWorkspaceApiKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -773,47 +609,6 @@ export const de_DeleteWorkspaceApiKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteWorkspaceApiKeyCommandError - */ -const de_DeleteWorkspaceApiKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.grafana#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeWorkspaceCommand */ @@ -822,7 +617,7 @@ export const de_DescribeWorkspaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeWorkspaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -835,44 +630,6 @@ export const de_DescribeWorkspaceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeWorkspaceCommandError - */ -const de_DescribeWorkspaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeWorkspaceAuthenticationCommand */ @@ -881,7 +638,7 @@ export const de_DescribeWorkspaceAuthenticationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeWorkspaceAuthenticationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -894,44 +651,6 @@ export const de_DescribeWorkspaceAuthenticationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeWorkspaceAuthenticationCommandError - */ -const de_DescribeWorkspaceAuthenticationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeWorkspaceConfigurationCommand */ @@ -940,7 +659,7 @@ export const de_DescribeWorkspaceConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeWorkspaceConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -954,41 +673,6 @@ export const de_DescribeWorkspaceConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeWorkspaceConfigurationCommandError - */ -const de_DescribeWorkspaceConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateLicenseCommand */ @@ -997,7 +681,7 @@ export const de_DisassociateLicenseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DisassociateLicenseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1010,44 +694,6 @@ export const de_DisassociateLicenseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateLicenseCommandError - */ -const de_DisassociateLicenseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPermissionsCommand */ @@ -1056,284 +702,100 @@ export const de_ListPermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - permissions: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPermissionsCommandError - */ -const de_ListPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListVersionsCommand - */ -export const de_ListVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVersionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - grafanaVersions: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListVersionsCommandError - */ -const de_ListVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + nextToken: __expectString, + permissions: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListWorkspacesCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_ListWorkspacesCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkspacesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - workspaces: (_) => de_WorkspaceList(_, context), + tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListWorkspacesCommandError + * deserializeAws_restJson1ListVersionsCommand */ -const de_ListWorkspacesCommandError = async ( +export const de_ListVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + grafanaVersions: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListWorkspacesCommand */ -export const de_TagResourceCommand = async ( +export const de_ListWorkspacesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + workspaces: (_) => de_WorkspaceList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -1344,7 +806,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1353,44 +815,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePermissionsCommand */ @@ -1399,7 +823,7 @@ export const de_UpdatePermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1412,44 +836,6 @@ export const de_UpdatePermissionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePermissionsCommandError - */ -const de_UpdatePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWorkspaceCommand */ @@ -1458,7 +844,7 @@ export const de_UpdateWorkspaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateWorkspaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1471,47 +857,6 @@ export const de_UpdateWorkspaceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateWorkspaceCommandError - */ -const de_UpdateWorkspaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.grafana#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWorkspaceAuthenticationCommand */ @@ -1520,7 +865,7 @@ export const de_UpdateWorkspaceAuthenticationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateWorkspaceAuthenticationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1533,47 +878,6 @@ export const de_UpdateWorkspaceAuthenticationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateWorkspaceAuthenticationCommandError - */ -const de_UpdateWorkspaceAuthenticationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.grafana#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.grafana#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.grafana#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.grafana#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.grafana#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.grafana#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWorkspaceConfigurationCommand */ @@ -1582,7 +886,7 @@ export const de_UpdateWorkspaceConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateWorkspaceConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1592,12 +896,9 @@ export const de_UpdateWorkspaceConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateWorkspaceConfigurationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateWorkspaceConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1607,9 +908,6 @@ const de_UpdateWorkspaceConfigurationCommandError = async ( case "AccessDeniedException": case "com.amazonaws.grafana#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.grafana#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.grafana#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); @@ -1622,13 +920,19 @@ const de_UpdateWorkspaceConfigurationCommandError = async ( case "ValidationException": case "com.amazonaws.grafana#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.grafana#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.grafana#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-greengrass/src/protocols/Aws_restJson1.ts b/clients/client-greengrass/src/protocols/Aws_restJson1.ts index 399e471e474e..c581fc144bf1 100644 --- a/clients/client-greengrass/src/protocols/Aws_restJson1.ts +++ b/clients/client-greengrass/src/protocols/Aws_restJson1.ts @@ -2252,7 +2252,7 @@ export const de_AssociateRoleToGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateRoleToGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2265,35 +2265,6 @@ export const de_AssociateRoleToGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateRoleToGroupCommandError - */ -const de_AssociateRoleToGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.greengrass#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateServiceRoleToAccountCommand */ @@ -2302,7 +2273,7 @@ export const de_AssociateServiceRoleToAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateServiceRoleToAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2315,35 +2286,6 @@ export const de_AssociateServiceRoleToAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateServiceRoleToAccountCommandError - */ -const de_AssociateServiceRoleToAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.greengrass#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConnectorDefinitionCommand */ @@ -2352,7 +2294,7 @@ export const de_CreateConnectorDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConnectorDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2371,32 +2313,6 @@ export const de_CreateConnectorDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConnectorDefinitionCommandError - */ -const de_CreateConnectorDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConnectorDefinitionVersionCommand */ @@ -2405,7 +2321,7 @@ export const de_CreateConnectorDefinitionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConnectorDefinitionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2421,32 +2337,6 @@ export const de_CreateConnectorDefinitionVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConnectorDefinitionVersionCommandError - */ -const de_CreateConnectorDefinitionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCoreDefinitionCommand */ @@ -2455,7 +2345,7 @@ export const de_CreateCoreDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCoreDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2474,32 +2364,6 @@ export const de_CreateCoreDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCoreDefinitionCommandError - */ -const de_CreateCoreDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCoreDefinitionVersionCommand */ @@ -2508,7 +2372,7 @@ export const de_CreateCoreDefinitionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCoreDefinitionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2524,32 +2388,6 @@ export const de_CreateCoreDefinitionVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCoreDefinitionVersionCommandError - */ -const de_CreateCoreDefinitionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDeploymentCommand */ @@ -2558,7 +2396,7 @@ export const de_CreateDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2572,32 +2410,6 @@ export const de_CreateDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDeploymentCommandError - */ -const de_CreateDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDeviceDefinitionCommand */ @@ -2606,7 +2418,7 @@ export const de_CreateDeviceDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDeviceDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2625,32 +2437,6 @@ export const de_CreateDeviceDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDeviceDefinitionCommandError - */ -const de_CreateDeviceDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDeviceDefinitionVersionCommand */ @@ -2659,7 +2445,7 @@ export const de_CreateDeviceDefinitionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDeviceDefinitionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2675,32 +2461,6 @@ export const de_CreateDeviceDefinitionVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDeviceDefinitionVersionCommandError - */ -const de_CreateDeviceDefinitionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFunctionDefinitionCommand */ @@ -2709,7 +2469,7 @@ export const de_CreateFunctionDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFunctionDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2728,32 +2488,6 @@ export const de_CreateFunctionDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFunctionDefinitionCommandError - */ -const de_CreateFunctionDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFunctionDefinitionVersionCommand */ @@ -2762,7 +2496,7 @@ export const de_CreateFunctionDefinitionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFunctionDefinitionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2779,40 +2513,14 @@ export const de_CreateFunctionDefinitionVersionCommand = async ( }; /** - * deserializeAws_restJson1CreateFunctionDefinitionVersionCommandError + * deserializeAws_restJson1CreateGroupCommand */ -const de_CreateFunctionDefinitionVersionCommandError = async ( +export const de_CreateGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateGroupCommand - */ -export const de_CreateGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateGroupCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2831,32 +2539,6 @@ export const de_CreateGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGroupCommandError - */ -const de_CreateGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateGroupCertificateAuthorityCommand */ @@ -2865,7 +2547,7 @@ export const de_CreateGroupCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateGroupCertificateAuthorityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2878,35 +2560,6 @@ export const de_CreateGroupCertificateAuthorityCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGroupCertificateAuthorityCommandError - */ -const de_CreateGroupCertificateAuthorityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.greengrass#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateGroupVersionCommand */ @@ -2915,7 +2568,7 @@ export const de_CreateGroupVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateGroupVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2931,32 +2584,6 @@ export const de_CreateGroupVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGroupVersionCommandError - */ -const de_CreateGroupVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLoggerDefinitionCommand */ @@ -2965,7 +2592,7 @@ export const de_CreateLoggerDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLoggerDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2984,32 +2611,6 @@ export const de_CreateLoggerDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLoggerDefinitionCommandError - */ -const de_CreateLoggerDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLoggerDefinitionVersionCommand */ @@ -3018,7 +2619,7 @@ export const de_CreateLoggerDefinitionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLoggerDefinitionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3034,32 +2635,6 @@ export const de_CreateLoggerDefinitionVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLoggerDefinitionVersionCommandError - */ -const de_CreateLoggerDefinitionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateResourceDefinitionCommand */ @@ -3068,7 +2643,7 @@ export const de_CreateResourceDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateResourceDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3087,32 +2662,6 @@ export const de_CreateResourceDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateResourceDefinitionCommandError - */ -const de_CreateResourceDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateResourceDefinitionVersionCommand */ @@ -3121,7 +2670,7 @@ export const de_CreateResourceDefinitionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateResourceDefinitionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3137,32 +2686,6 @@ export const de_CreateResourceDefinitionVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateResourceDefinitionVersionCommandError - */ -const de_CreateResourceDefinitionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSoftwareUpdateJobCommand */ @@ -3171,7 +2694,7 @@ export const de_CreateSoftwareUpdateJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSoftwareUpdateJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3186,35 +2709,6 @@ export const de_CreateSoftwareUpdateJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSoftwareUpdateJobCommandError - */ -const de_CreateSoftwareUpdateJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.greengrass#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSubscriptionDefinitionCommand */ @@ -3223,7 +2717,7 @@ export const de_CreateSubscriptionDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSubscriptionDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3242,32 +2736,6 @@ export const de_CreateSubscriptionDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSubscriptionDefinitionCommandError - */ -const de_CreateSubscriptionDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSubscriptionDefinitionVersionCommand */ @@ -3276,7 +2744,7 @@ export const de_CreateSubscriptionDefinitionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSubscriptionDefinitionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3293,40 +2761,31 @@ export const de_CreateSubscriptionDefinitionVersionCommand = async ( }; /** - * deserializeAws_restJson1CreateSubscriptionDefinitionVersionCommandError + * deserializeAws_restJson1DeleteConnectorDefinitionCommand */ -const de_CreateSubscriptionDefinitionVersionCommandError = async ( +export const de_DeleteConnectorDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteConnectorDefinitionCommand + * deserializeAws_restJson1DeleteCoreDefinitionCommand */ -export const de_DeleteConnectorDefinitionCommand = async ( +export const de_DeleteCoreDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConnectorDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3336,83 +2795,14 @@ export const de_DeleteConnectorDefinitionCommand = async ( }; /** - * deserializeAws_restJson1DeleteConnectorDefinitionCommandError - */ -const de_DeleteConnectorDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteCoreDefinitionCommand - */ -export const de_DeleteCoreDefinitionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCoreDefinitionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteCoreDefinitionCommandError - */ -const de_DeleteCoreDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDeviceDefinitionCommand + * deserializeAws_restJson1DeleteDeviceDefinitionCommand */ export const de_DeleteDeviceDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDeviceDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3421,32 +2811,6 @@ export const de_DeleteDeviceDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDeviceDefinitionCommandError - */ -const de_DeleteDeviceDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteFunctionDefinitionCommand */ @@ -3455,7 +2819,7 @@ export const de_DeleteFunctionDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFunctionDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3464,32 +2828,6 @@ export const de_DeleteFunctionDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteFunctionDefinitionCommandError - */ -const de_DeleteFunctionDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteGroupCommand */ @@ -3498,7 +2836,7 @@ export const de_DeleteGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3507,32 +2845,6 @@ export const de_DeleteGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteGroupCommandError - */ -const de_DeleteGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteLoggerDefinitionCommand */ @@ -3541,7 +2853,7 @@ export const de_DeleteLoggerDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLoggerDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3550,32 +2862,6 @@ export const de_DeleteLoggerDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLoggerDefinitionCommandError - */ -const de_DeleteLoggerDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteResourceDefinitionCommand */ @@ -3584,7 +2870,7 @@ export const de_DeleteResourceDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteResourceDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3593,32 +2879,6 @@ export const de_DeleteResourceDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteResourceDefinitionCommandError - */ -const de_DeleteResourceDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSubscriptionDefinitionCommand */ @@ -3627,7 +2887,7 @@ export const de_DeleteSubscriptionDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSubscriptionDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3636,32 +2896,6 @@ export const de_DeleteSubscriptionDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSubscriptionDefinitionCommandError - */ -const de_DeleteSubscriptionDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateRoleFromGroupCommand */ @@ -3670,7 +2904,7 @@ export const de_DisassociateRoleFromGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateRoleFromGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3683,35 +2917,6 @@ export const de_DisassociateRoleFromGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateRoleFromGroupCommandError - */ -const de_DisassociateRoleFromGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.greengrass#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateServiceRoleFromAccountCommand */ @@ -3720,7 +2925,7 @@ export const de_DisassociateServiceRoleFromAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateServiceRoleFromAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3733,32 +2938,6 @@ export const de_DisassociateServiceRoleFromAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateServiceRoleFromAccountCommandError - */ -const de_DisassociateServiceRoleFromAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.greengrass#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAssociatedRoleCommand */ @@ -3767,7 +2946,7 @@ export const de_GetAssociatedRoleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssociatedRoleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3781,35 +2960,6 @@ export const de_GetAssociatedRoleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAssociatedRoleCommandError - */ -const de_GetAssociatedRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.greengrass#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBulkDeploymentStatusCommand */ @@ -3818,7 +2968,7 @@ export const de_GetBulkDeploymentStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBulkDeploymentStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3836,32 +2986,6 @@ export const de_GetBulkDeploymentStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBulkDeploymentStatusCommandError - */ -const de_GetBulkDeploymentStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConnectivityInfoCommand */ @@ -3870,7 +2994,7 @@ export const de_GetConnectivityInfoCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConnectivityInfoCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3884,35 +3008,6 @@ export const de_GetConnectivityInfoCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetConnectivityInfoCommandError - */ -const de_GetConnectivityInfoCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.greengrass#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConnectorDefinitionCommand */ @@ -3921,7 +3016,7 @@ export const de_GetConnectorDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConnectorDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3941,32 +3036,6 @@ export const de_GetConnectorDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetConnectorDefinitionCommandError - */ -const de_GetConnectorDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConnectorDefinitionVersionCommand */ @@ -3975,7 +3044,7 @@ export const de_GetConnectorDefinitionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConnectorDefinitionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3993,32 +3062,6 @@ export const de_GetConnectorDefinitionVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetConnectorDefinitionVersionCommandError - */ -const de_GetConnectorDefinitionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCoreDefinitionCommand */ @@ -4027,7 +3070,7 @@ export const de_GetCoreDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCoreDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4040,37 +3083,11 @@ export const de_GetCoreDefinitionCommand = async ( LastUpdatedTimestamp: __expectString, LatestVersion: __expectString, LatestVersionArn: __expectString, - Name: __expectString, - tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetCoreDefinitionCommandError - */ -const de_GetCoreDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Name: __expectString, + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4081,7 +3098,7 @@ export const de_GetCoreDefinitionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCoreDefinitionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4099,32 +3116,6 @@ export const de_GetCoreDefinitionVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCoreDefinitionVersionCommandError - */ -const de_GetCoreDefinitionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDeploymentStatusCommand */ @@ -4133,7 +3124,7 @@ export const de_GetDeploymentStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeploymentStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4150,32 +3141,6 @@ export const de_GetDeploymentStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeploymentStatusCommandError - */ -const de_GetDeploymentStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDeviceDefinitionCommand */ @@ -4184,7 +3149,7 @@ export const de_GetDeviceDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeviceDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4204,32 +3169,6 @@ export const de_GetDeviceDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeviceDefinitionCommandError - */ -const de_GetDeviceDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDeviceDefinitionVersionCommand */ @@ -4238,7 +3177,7 @@ export const de_GetDeviceDefinitionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeviceDefinitionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4256,32 +3195,6 @@ export const de_GetDeviceDefinitionVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeviceDefinitionVersionCommandError - */ -const de_GetDeviceDefinitionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetFunctionDefinitionCommand */ @@ -4290,7 +3203,7 @@ export const de_GetFunctionDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFunctionDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4310,32 +3223,6 @@ export const de_GetFunctionDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetFunctionDefinitionCommandError - */ -const de_GetFunctionDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetFunctionDefinitionVersionCommand */ @@ -4344,7 +3231,7 @@ export const de_GetFunctionDefinitionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFunctionDefinitionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4362,32 +3249,6 @@ export const de_GetFunctionDefinitionVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetFunctionDefinitionVersionCommandError - */ -const de_GetFunctionDefinitionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGroupCommand */ @@ -4396,7 +3257,7 @@ export const de_GetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4416,32 +3277,6 @@ export const de_GetGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetGroupCommandError - */ -const de_GetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGroupCertificateAuthorityCommand */ @@ -4450,7 +3285,7 @@ export const de_GetGroupCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGroupCertificateAuthorityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4465,35 +3300,6 @@ export const de_GetGroupCertificateAuthorityCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetGroupCertificateAuthorityCommandError - */ -const de_GetGroupCertificateAuthorityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.greengrass#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGroupCertificateConfigurationCommand */ @@ -4502,7 +3308,7 @@ export const de_GetGroupCertificateConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGroupCertificateConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4517,84 +3323,29 @@ export const de_GetGroupCertificateConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetGroupCertificateConfigurationCommandError - */ -const de_GetGroupCertificateConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.greengrass#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGroupVersionCommand */ export const de_GetGroupVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGroupVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - CreationTimestamp: __expectString, - Definition: _json, - Id: __expectString, - Version: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetGroupVersionCommandError - */ -const de_GetGroupVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + CreationTimestamp: __expectString, + Definition: _json, + Id: __expectString, + Version: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4605,7 +3356,7 @@ export const de_GetLoggerDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLoggerDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4625,32 +3376,6 @@ export const de_GetLoggerDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLoggerDefinitionCommandError - */ -const de_GetLoggerDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLoggerDefinitionVersionCommand */ @@ -4659,7 +3384,7 @@ export const de_GetLoggerDefinitionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLoggerDefinitionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4676,32 +3401,6 @@ export const de_GetLoggerDefinitionVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLoggerDefinitionVersionCommandError - */ -const de_GetLoggerDefinitionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetResourceDefinitionCommand */ @@ -4710,7 +3409,7 @@ export const de_GetResourceDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourceDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4730,32 +3429,6 @@ export const de_GetResourceDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetResourceDefinitionCommandError - */ -const de_GetResourceDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetResourceDefinitionVersionCommand */ @@ -4764,7 +3437,7 @@ export const de_GetResourceDefinitionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourceDefinitionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4781,32 +3454,6 @@ export const de_GetResourceDefinitionVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetResourceDefinitionVersionCommandError - */ -const de_GetResourceDefinitionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetServiceRoleForAccountCommand */ @@ -4815,7 +3462,7 @@ export const de_GetServiceRoleForAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetServiceRoleForAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4829,32 +3476,6 @@ export const de_GetServiceRoleForAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetServiceRoleForAccountCommandError - */ -const de_GetServiceRoleForAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.greengrass#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSubscriptionDefinitionCommand */ @@ -4863,7 +3484,7 @@ export const de_GetSubscriptionDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSubscriptionDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4883,32 +3504,6 @@ export const de_GetSubscriptionDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSubscriptionDefinitionCommandError - */ -const de_GetSubscriptionDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSubscriptionDefinitionVersionCommand */ @@ -4917,7 +3512,7 @@ export const de_GetSubscriptionDefinitionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSubscriptionDefinitionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4935,32 +3530,6 @@ export const de_GetSubscriptionDefinitionVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSubscriptionDefinitionVersionCommandError - */ -const de_GetSubscriptionDefinitionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetThingRuntimeConfigurationCommand */ @@ -4969,7 +3538,7 @@ export const de_GetThingRuntimeConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetThingRuntimeConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4982,35 +3551,6 @@ export const de_GetThingRuntimeConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetThingRuntimeConfigurationCommandError - */ -const de_GetThingRuntimeConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.greengrass#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListBulkDeploymentDetailedReportsCommand */ @@ -5019,7 +3559,7 @@ export const de_ListBulkDeploymentDetailedReportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBulkDeploymentDetailedReportsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5033,32 +3573,6 @@ export const de_ListBulkDeploymentDetailedReportsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListBulkDeploymentDetailedReportsCommandError - */ -const de_ListBulkDeploymentDetailedReportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListBulkDeploymentsCommand */ @@ -5067,44 +3581,18 @@ export const de_ListBulkDeploymentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBulkDeploymentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BulkDeployments: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListBulkDeploymentsCommandError - */ -const de_ListBulkDeploymentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + BulkDeployments: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -5115,7 +3603,7 @@ export const de_ListConnectorDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConnectorDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5129,26 +3617,6 @@ export const de_ListConnectorDefinitionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListConnectorDefinitionsCommandError - */ -const de_ListConnectorDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListConnectorDefinitionVersionsCommand */ @@ -5157,7 +3625,7 @@ export const de_ListConnectorDefinitionVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConnectorDefinitionVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5171,32 +3639,6 @@ export const de_ListConnectorDefinitionVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListConnectorDefinitionVersionsCommandError - */ -const de_ListConnectorDefinitionVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCoreDefinitionsCommand */ @@ -5205,7 +3647,7 @@ export const de_ListCoreDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCoreDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5219,26 +3661,6 @@ export const de_ListCoreDefinitionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCoreDefinitionsCommandError - */ -const de_ListCoreDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListCoreDefinitionVersionsCommand */ @@ -5247,7 +3669,7 @@ export const de_ListCoreDefinitionVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCoreDefinitionVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5261,32 +3683,6 @@ export const de_ListCoreDefinitionVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCoreDefinitionVersionsCommandError - */ -const de_ListCoreDefinitionVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDeploymentsCommand */ @@ -5295,7 +3691,7 @@ export const de_ListDeploymentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeploymentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5309,32 +3705,6 @@ export const de_ListDeploymentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDeploymentsCommandError - */ -const de_ListDeploymentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDeviceDefinitionsCommand */ @@ -5343,7 +3713,7 @@ export const de_ListDeviceDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeviceDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5357,26 +3727,6 @@ export const de_ListDeviceDefinitionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDeviceDefinitionsCommandError - */ -const de_ListDeviceDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListDeviceDefinitionVersionsCommand */ @@ -5385,7 +3735,7 @@ export const de_ListDeviceDefinitionVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeviceDefinitionVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5399,32 +3749,6 @@ export const de_ListDeviceDefinitionVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDeviceDefinitionVersionsCommandError - */ -const de_ListDeviceDefinitionVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListFunctionDefinitionsCommand */ @@ -5433,7 +3757,7 @@ export const de_ListFunctionDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFunctionDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5447,26 +3771,6 @@ export const de_ListFunctionDefinitionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFunctionDefinitionsCommandError - */ -const de_ListFunctionDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListFunctionDefinitionVersionsCommand */ @@ -5475,7 +3779,7 @@ export const de_ListFunctionDefinitionVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFunctionDefinitionVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5489,32 +3793,6 @@ export const de_ListFunctionDefinitionVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFunctionDefinitionVersionsCommandError - */ -const de_ListFunctionDefinitionVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListGroupCertificateAuthoritiesCommand */ @@ -5523,7 +3801,7 @@ export const de_ListGroupCertificateAuthoritiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGroupCertificateAuthoritiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5536,35 +3814,6 @@ export const de_ListGroupCertificateAuthoritiesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListGroupCertificateAuthoritiesCommandError - */ -const de_ListGroupCertificateAuthoritiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.greengrass#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListGroupsCommand */ @@ -5573,7 +3822,7 @@ export const de_ListGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5587,26 +3836,6 @@ export const de_ListGroupsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListGroupsCommandError - */ -const de_ListGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListGroupVersionsCommand */ @@ -5615,7 +3844,7 @@ export const de_ListGroupVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGroupVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5629,32 +3858,6 @@ export const de_ListGroupVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListGroupVersionsCommandError - */ -const de_ListGroupVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListLoggerDefinitionsCommand */ @@ -5663,38 +3866,18 @@ export const de_ListLoggerDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLoggerDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Definitions: (_) => de___listOfDefinitionInformation(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListLoggerDefinitionsCommandError - */ -const de_ListLoggerDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Definitions: (_) => de___listOfDefinitionInformation(_, context), + NextToken: __expectString, }); + Object.assign(contents, doc); + return contents; }; /** @@ -5705,7 +3888,7 @@ export const de_ListLoggerDefinitionVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLoggerDefinitionVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5719,32 +3902,6 @@ export const de_ListLoggerDefinitionVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListLoggerDefinitionVersionsCommandError - */ -const de_ListLoggerDefinitionVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListResourceDefinitionsCommand */ @@ -5753,7 +3910,7 @@ export const de_ListResourceDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResourceDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5767,26 +3924,6 @@ export const de_ListResourceDefinitionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListResourceDefinitionsCommandError - */ -const de_ListResourceDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListResourceDefinitionVersionsCommand */ @@ -5795,7 +3932,7 @@ export const de_ListResourceDefinitionVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResourceDefinitionVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5809,32 +3946,6 @@ export const de_ListResourceDefinitionVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListResourceDefinitionVersionsCommandError - */ -const de_ListResourceDefinitionVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSubscriptionDefinitionsCommand */ @@ -5843,7 +3954,7 @@ export const de_ListSubscriptionDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSubscriptionDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5857,26 +3968,6 @@ export const de_ListSubscriptionDefinitionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSubscriptionDefinitionsCommandError - */ -const de_ListSubscriptionDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListSubscriptionDefinitionVersionsCommand */ @@ -5885,7 +3976,7 @@ export const de_ListSubscriptionDefinitionVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSubscriptionDefinitionVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5899,32 +3990,6 @@ export const de_ListSubscriptionDefinitionVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSubscriptionDefinitionVersionsCommandError - */ -const de_ListSubscriptionDefinitionVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -5933,7 +3998,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5946,32 +4011,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ResetDeploymentsCommand */ @@ -5980,7 +4019,7 @@ export const de_ResetDeploymentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ResetDeploymentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5994,32 +4033,6 @@ export const de_ResetDeploymentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ResetDeploymentsCommandError - */ -const de_ResetDeploymentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartBulkDeploymentCommand */ @@ -6028,7 +4041,7 @@ export const de_StartBulkDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartBulkDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6042,32 +4055,6 @@ export const de_StartBulkDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartBulkDeploymentCommandError - */ -const de_StartBulkDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopBulkDeploymentCommand */ @@ -6076,7 +4063,7 @@ export const de_StopBulkDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopBulkDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6085,32 +4072,6 @@ export const de_StopBulkDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopBulkDeploymentCommandError - */ -const de_StopBulkDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -6119,82 +4080,30 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UntagResourceCommand - */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UntagResourceCommand + */ +export const de_UntagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -6205,7 +4114,7 @@ export const de_UpdateConnectivityInfoCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConnectivityInfoCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6219,35 +4128,6 @@ export const de_UpdateConnectivityInfoCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateConnectivityInfoCommandError - */ -const de_UpdateConnectivityInfoCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.greengrass#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConnectorDefinitionCommand */ @@ -6256,7 +4136,7 @@ export const de_UpdateConnectorDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConnectorDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6265,32 +4145,6 @@ export const de_UpdateConnectorDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateConnectorDefinitionCommandError - */ -const de_UpdateConnectorDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateCoreDefinitionCommand */ @@ -6299,7 +4153,7 @@ export const de_UpdateCoreDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCoreDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6308,32 +4162,6 @@ export const de_UpdateCoreDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateCoreDefinitionCommandError - */ -const de_UpdateCoreDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDeviceDefinitionCommand */ @@ -6342,7 +4170,7 @@ export const de_UpdateDeviceDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDeviceDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6351,32 +4179,6 @@ export const de_UpdateDeviceDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDeviceDefinitionCommandError - */ -const de_UpdateDeviceDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFunctionDefinitionCommand */ @@ -6385,7 +4187,7 @@ export const de_UpdateFunctionDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFunctionDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6394,32 +4196,6 @@ export const de_UpdateFunctionDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFunctionDefinitionCommandError - */ -const de_UpdateFunctionDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateGroupCommand */ @@ -6428,7 +4204,7 @@ export const de_UpdateGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6437,32 +4213,6 @@ export const de_UpdateGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateGroupCommandError - */ -const de_UpdateGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateGroupCertificateConfigurationCommand */ @@ -6471,7 +4221,7 @@ export const de_UpdateGroupCertificateConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGroupCertificateConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6486,35 +4236,6 @@ export const de_UpdateGroupCertificateConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateGroupCertificateConfigurationCommandError - */ -const de_UpdateGroupCertificateConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.greengrass#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLoggerDefinitionCommand */ @@ -6523,7 +4244,7 @@ export const de_UpdateLoggerDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLoggerDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6532,32 +4253,6 @@ export const de_UpdateLoggerDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLoggerDefinitionCommandError - */ -const de_UpdateLoggerDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateResourceDefinitionCommand */ @@ -6566,7 +4261,7 @@ export const de_UpdateResourceDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateResourceDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6575,32 +4270,6 @@ export const de_UpdateResourceDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateResourceDefinitionCommandError - */ -const de_UpdateResourceDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSubscriptionDefinitionCommand */ @@ -6609,7 +4278,7 @@ export const de_UpdateSubscriptionDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSubscriptionDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6618,32 +4287,6 @@ export const de_UpdateSubscriptionDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSubscriptionDefinitionCommandError - */ -const de_UpdateSubscriptionDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.greengrass#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateThingRuntimeConfigurationCommand */ @@ -6652,7 +4295,7 @@ export const de_UpdateThingRuntimeConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateThingRuntimeConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6662,12 +4305,9 @@ export const de_UpdateThingRuntimeConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateThingRuntimeConfigurationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateThingRuntimeConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -6686,7 +4326,7 @@ const de_UpdateThingRuntimeConfigurationCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts b/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts index 9677a144c715..a6378bbc5345 100644 --- a/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts +++ b/clients/client-greengrassv2/src/protocols/Aws_restJson1.ts @@ -731,7 +731,7 @@ export const de_AssociateServiceRoleToAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateServiceRoleToAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -744,35 +744,6 @@ export const de_AssociateServiceRoleToAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateServiceRoleToAccountCommandError - */ -const de_AssociateServiceRoleToAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchAssociateClientDeviceWithCoreDeviceCommand */ @@ -781,7 +752,7 @@ export const de_BatchAssociateClientDeviceWithCoreDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchAssociateClientDeviceWithCoreDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -794,44 +765,6 @@ export const de_BatchAssociateClientDeviceWithCoreDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchAssociateClientDeviceWithCoreDeviceCommandError - */ -const de_BatchAssociateClientDeviceWithCoreDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDisassociateClientDeviceFromCoreDeviceCommand */ @@ -840,7 +773,7 @@ export const de_BatchDisassociateClientDeviceFromCoreDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDisassociateClientDeviceFromCoreDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -853,44 +786,6 @@ export const de_BatchDisassociateClientDeviceFromCoreDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDisassociateClientDeviceFromCoreDeviceCommandError - */ -const de_BatchDisassociateClientDeviceFromCoreDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelDeploymentCommand */ @@ -899,7 +794,7 @@ export const de_CancelDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -912,47 +807,6 @@ export const de_CancelDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelDeploymentCommandError - */ -const de_CancelDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.greengrassv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateComponentVersionCommand */ @@ -961,7 +815,7 @@ export const de_CreateComponentVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateComponentVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -978,50 +832,6 @@ export const de_CreateComponentVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateComponentVersionCommandError - */ -const de_CreateComponentVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.greengrassv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestAlreadyInProgressException": - case "com.amazonaws.greengrassv2#RequestAlreadyInProgressException": - throw await de_RequestAlreadyInProgressExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.greengrassv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDeploymentCommand */ @@ -1030,7 +840,7 @@ export const de_CreateDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1045,50 +855,6 @@ export const de_CreateDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDeploymentCommandError - */ -const de_CreateDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.greengrassv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestAlreadyInProgressException": - case "com.amazonaws.greengrassv2#RequestAlreadyInProgressException": - throw await de_RequestAlreadyInProgressExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteComponentCommand */ @@ -1097,7 +863,7 @@ export const de_DeleteComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1106,47 +872,6 @@ export const de_DeleteComponentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteComponentCommandError - */ -const de_DeleteComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.greengrassv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteCoreDeviceCommand */ @@ -1155,7 +880,7 @@ export const de_DeleteCoreDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteCoreDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1164,47 +889,6 @@ export const de_DeleteCoreDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteCoreDeviceCommandError - */ -const de_DeleteCoreDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.greengrassv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDeploymentCommand */ @@ -1213,7 +897,7 @@ export const de_DeleteDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1222,47 +906,6 @@ export const de_DeleteDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDeploymentCommandError - */ -const de_DeleteDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.greengrassv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeComponentCommand */ @@ -1271,7 +914,7 @@ export const de_DescribeComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1292,44 +935,6 @@ export const de_DescribeComponentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeComponentCommandError - */ -const de_DescribeComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateServiceRoleFromAccountCommand */ @@ -1338,7 +943,7 @@ export const de_DisassociateServiceRoleFromAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateServiceRoleFromAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1351,32 +956,6 @@ export const de_DisassociateServiceRoleFromAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateServiceRoleFromAccountCommandError - */ -const de_DisassociateServiceRoleFromAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetComponentCommand */ @@ -1385,7 +964,7 @@ export const de_GetComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1400,44 +979,6 @@ export const de_GetComponentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetComponentCommandError - */ -const de_GetComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetComponentVersionArtifactCommand */ @@ -1446,7 +987,7 @@ export const de_GetComponentVersionArtifactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetComponentVersionArtifactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1459,93 +1000,26 @@ export const de_GetComponentVersionArtifactCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetComponentVersionArtifactCommandError - */ -const de_GetComponentVersionArtifactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetConnectivityInfoCommand - */ -export const de_GetConnectivityInfoCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConnectivityInfoCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - connectivityInfo: [, (_) => de_connectivityInfoList(_, context), `ConnectivityInfo`], - message: [, __expectString, `Message`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetConnectivityInfoCommandError - */ -const de_GetConnectivityInfoCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +/** + * deserializeAws_restJson1GetConnectivityInfoCommand + */ +export const de_GetConnectivityInfoCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + connectivityInfo: [, (_) => de_connectivityInfoList(_, context), `ConnectivityInfo`], + message: [, __expectString, `Message`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1556,7 +1030,7 @@ export const de_GetCoreDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCoreDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1575,44 +1049,6 @@ export const de_GetCoreDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCoreDeviceCommandError - */ -const de_GetCoreDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDeploymentCommand */ @@ -1621,7 +1057,7 @@ export const de_GetDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1647,44 +1083,6 @@ export const de_GetDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeploymentCommandError - */ -const de_GetDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetServiceRoleForAccountCommand */ @@ -1693,7 +1091,7 @@ export const de_GetServiceRoleForAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetServiceRoleForAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1707,32 +1105,6 @@ export const de_GetServiceRoleForAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetServiceRoleForAccountCommandError - */ -const de_GetServiceRoleForAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListClientDevicesAssociatedWithCoreDeviceCommand */ @@ -1741,7 +1113,7 @@ export const de_ListClientDevicesAssociatedWithCoreDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListClientDevicesAssociatedWithCoreDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1755,44 +1127,6 @@ export const de_ListClientDevicesAssociatedWithCoreDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListClientDevicesAssociatedWithCoreDeviceCommandError - */ -const de_ListClientDevicesAssociatedWithCoreDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListComponentsCommand */ @@ -1801,7 +1135,7 @@ export const de_ListComponentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListComponentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1815,44 +1149,6 @@ export const de_ListComponentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListComponentsCommandError - */ -const de_ListComponentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListComponentVersionsCommand */ @@ -1861,7 +1157,7 @@ export const de_ListComponentVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListComponentVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1875,44 +1171,6 @@ export const de_ListComponentVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListComponentVersionsCommandError - */ -const de_ListComponentVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCoreDevicesCommand */ @@ -1921,53 +1179,18 @@ export const de_ListCoreDevicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCoreDevicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - coreDevices: (_) => de_CoreDevicesList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListCoreDevicesCommandError - */ -const de_ListCoreDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + coreDevices: (_) => de_CoreDevicesList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1978,7 +1201,7 @@ export const de_ListDeploymentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeploymentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1992,41 +1215,6 @@ export const de_ListDeploymentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDeploymentsCommandError - */ -const de_ListDeploymentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEffectiveDeploymentsCommand */ @@ -2035,7 +1223,7 @@ export const de_ListEffectiveDeploymentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEffectiveDeploymentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2049,44 +1237,6 @@ export const de_ListEffectiveDeploymentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEffectiveDeploymentsCommandError - */ -const de_ListEffectiveDeploymentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListInstalledComponentsCommand */ @@ -2095,7 +1245,7 @@ export const de_ListInstalledComponentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInstalledComponentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2109,44 +1259,6 @@ export const de_ListInstalledComponentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListInstalledComponentsCommandError - */ -const de_ListInstalledComponentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -2155,7 +1267,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2168,38 +1280,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ResolveComponentCandidatesCommand */ @@ -2208,7 +1288,7 @@ export const de_ResolveComponentCandidatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ResolveComponentCandidatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2221,47 +1301,6 @@ export const de_ResolveComponentCandidatesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ResolveComponentCandidatesCommandError - */ -const de_ResolveComponentCandidatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.greengrassv2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.greengrassv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.greengrassv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2270,7 +1309,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2279,38 +1318,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2319,7 +1326,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2328,38 +1335,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.greengrassv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.greengrassv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.greengrassv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConnectivityInfoCommand */ @@ -2368,7 +1343,7 @@ export const de_UpdateConnectivityInfoCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConnectivityInfoCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2383,12 +1358,9 @@ export const de_UpdateConnectivityInfoCommand = async ( }; /** - * deserializeAws_restJson1UpdateConnectivityInfoCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateConnectivityInfoCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2401,13 +1373,31 @@ const de_UpdateConnectivityInfoCommandError = async ( case "ValidationException": case "com.amazonaws.greengrassv2#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.greengrassv2#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.greengrassv2#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.greengrassv2#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.greengrassv2#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "RequestAlreadyInProgressException": + case "com.amazonaws.greengrassv2#RequestAlreadyInProgressException": + throw await de_RequestAlreadyInProgressExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.greengrassv2#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-groundstation/src/protocols/Aws_restJson1.ts b/clients/client-groundstation/src/protocols/Aws_restJson1.ts index e86b51551e45..621c61c54051 100644 --- a/clients/client-groundstation/src/protocols/Aws_restJson1.ts +++ b/clients/client-groundstation/src/protocols/Aws_restJson1.ts @@ -845,7 +845,7 @@ export const de_CancelContactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -858,38 +858,6 @@ export const de_CancelContactCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelContactCommandError - */ -const de_CancelContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConfigCommand */ @@ -898,7 +866,7 @@ export const de_CreateConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -913,41 +881,6 @@ export const de_CreateConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConfigCommandError - */ -const de_CreateConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.groundstation#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDataflowEndpointGroupCommand */ @@ -956,7 +889,7 @@ export const de_CreateDataflowEndpointGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDataflowEndpointGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -969,38 +902,6 @@ export const de_CreateDataflowEndpointGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDataflowEndpointGroupCommandError - */ -const de_CreateDataflowEndpointGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateEphemerisCommand */ @@ -1009,7 +910,7 @@ export const de_CreateEphemerisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEphemerisCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1022,38 +923,6 @@ export const de_CreateEphemerisCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEphemerisCommandError - */ -const de_CreateEphemerisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMissionProfileCommand */ @@ -1062,7 +931,7 @@ export const de_CreateMissionProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMissionProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1075,38 +944,6 @@ export const de_CreateMissionProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMissionProfileCommandError - */ -const de_CreateMissionProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteConfigCommand */ @@ -1115,7 +952,7 @@ export const de_DeleteConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1130,38 +967,6 @@ export const de_DeleteConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteConfigCommandError - */ -const de_DeleteConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDataflowEndpointGroupCommand */ @@ -1170,7 +975,7 @@ export const de_DeleteDataflowEndpointGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDataflowEndpointGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1183,38 +988,6 @@ export const de_DeleteDataflowEndpointGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDataflowEndpointGroupCommandError - */ -const de_DeleteDataflowEndpointGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteEphemerisCommand */ @@ -1223,7 +996,7 @@ export const de_DeleteEphemerisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEphemerisCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1236,38 +1009,6 @@ export const de_DeleteEphemerisCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEphemerisCommandError - */ -const de_DeleteEphemerisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteMissionProfileCommand */ @@ -1276,7 +1017,7 @@ export const de_DeleteMissionProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMissionProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1290,46 +1031,14 @@ export const de_DeleteMissionProfileCommand = async ( }; /** - * deserializeAws_restJson1DeleteMissionProfileCommandError + * deserializeAws_restJson1DescribeContactCommand */ -const de_DeleteMissionProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeContactCommand - */ -export const de_DescribeContactCommand = async ( +export const de_DescribeContactCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1355,38 +1064,6 @@ export const de_DescribeContactCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeContactCommandError - */ -const de_DescribeContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeEphemerisCommand */ @@ -1395,7 +1072,7 @@ export const de_DescribeEphemerisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeEphemerisCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1417,38 +1094,6 @@ export const de_DescribeEphemerisCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeEphemerisCommandError - */ -const de_DescribeEphemerisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAgentConfigurationCommand */ @@ -1457,7 +1102,7 @@ export const de_GetAgentConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAgentConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1471,38 +1116,6 @@ export const de_GetAgentConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAgentConfigurationCommandError - */ -const de_GetAgentConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConfigCommand */ @@ -1511,7 +1124,7 @@ export const de_GetConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1529,38 +1142,6 @@ export const de_GetConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetConfigCommandError - */ -const de_GetConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDataflowEndpointGroupCommand */ @@ -1569,7 +1150,7 @@ export const de_GetDataflowEndpointGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataflowEndpointGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1587,38 +1168,6 @@ export const de_GetDataflowEndpointGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDataflowEndpointGroupCommandError - */ -const de_GetDataflowEndpointGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMinuteUsageCommand */ @@ -1627,7 +1176,7 @@ export const de_GetMinuteUsageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMinuteUsageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1644,38 +1193,6 @@ export const de_GetMinuteUsageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMinuteUsageCommandError - */ -const de_GetMinuteUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMissionProfileCommand */ @@ -1684,7 +1201,7 @@ export const de_GetMissionProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMissionProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1708,38 +1225,6 @@ export const de_GetMissionProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMissionProfileCommandError - */ -const de_GetMissionProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSatelliteCommand */ @@ -1748,7 +1233,7 @@ export const de_GetSatelliteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSatelliteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1765,38 +1250,6 @@ export const de_GetSatelliteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSatelliteCommandError - */ -const de_GetSatelliteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListConfigsCommand */ @@ -1805,7 +1258,7 @@ export const de_ListConfigsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConfigsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1819,38 +1272,6 @@ export const de_ListConfigsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListConfigsCommandError - */ -const de_ListConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListContactsCommand */ @@ -1859,7 +1280,7 @@ export const de_ListContactsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListContactsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1873,38 +1294,6 @@ export const de_ListContactsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListContactsCommandError - */ -const de_ListContactsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDataflowEndpointGroupsCommand */ @@ -1913,7 +1302,7 @@ export const de_ListDataflowEndpointGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataflowEndpointGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1927,38 +1316,6 @@ export const de_ListDataflowEndpointGroupsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDataflowEndpointGroupsCommandError - */ -const de_ListDataflowEndpointGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEphemeridesCommand */ @@ -1967,7 +1324,7 @@ export const de_ListEphemeridesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEphemeridesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1981,38 +1338,6 @@ export const de_ListEphemeridesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEphemeridesCommandError - */ -const de_ListEphemeridesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListGroundStationsCommand */ @@ -2021,7 +1346,7 @@ export const de_ListGroundStationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGroundStationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2035,38 +1360,6 @@ export const de_ListGroundStationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListGroundStationsCommandError - */ -const de_ListGroundStationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListMissionProfilesCommand */ @@ -2075,157 +1368,61 @@ export const de_ListMissionProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMissionProfilesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - missionProfileList: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListMissionProfilesCommandError - */ -const de_ListMissionProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSatellitesCommand - */ -export const de_ListSatellitesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSatellitesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - satellites: (_) => de_SatelliteList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSatellitesCommandError - */ -const de_ListSatellitesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + missionProfileList: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListSatellitesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListSatellitesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + nextToken: __expectString, + satellites: (_) => de_SatelliteList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2236,7 +1433,7 @@ export const de_RegisterAgentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterAgentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2249,38 +1446,6 @@ export const de_RegisterAgentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RegisterAgentCommandError - */ -const de_RegisterAgentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ReserveContactCommand */ @@ -2289,7 +1454,7 @@ export const de_ReserveContactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ReserveContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2302,38 +1467,6 @@ export const de_ReserveContactCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ReserveContactCommandError - */ -const de_ReserveContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2342,7 +1475,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2351,38 +1484,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2391,7 +1492,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2400,38 +1501,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAgentStatusCommand */ @@ -2440,7 +1509,7 @@ export const de_UpdateAgentStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAgentStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2453,38 +1522,6 @@ export const de_UpdateAgentStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAgentStatusCommandError - */ -const de_UpdateAgentStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConfigCommand */ @@ -2493,7 +1530,7 @@ export const de_UpdateConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2508,38 +1545,6 @@ export const de_UpdateConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateConfigCommandError - */ -const de_UpdateConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEphemerisCommand */ @@ -2548,7 +1553,7 @@ export const de_UpdateEphemerisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEphemerisCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2561,38 +1566,6 @@ export const de_UpdateEphemerisCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEphemerisCommandError - */ -const de_UpdateEphemerisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyException": - case "com.amazonaws.groundstation#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.groundstation#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.groundstation#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMissionProfileCommand */ @@ -2601,7 +1574,7 @@ export const de_UpdateMissionProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMissionProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2615,12 +1588,9 @@ export const de_UpdateMissionProfileCommand = async ( }; /** - * deserializeAws_restJson1UpdateMissionProfileCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateMissionProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2636,13 +1606,16 @@ const de_UpdateMissionProfileCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.groundstation#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ResourceLimitExceededException": + case "com.amazonaws.groundstation#ResourceLimitExceededException": + throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-guardduty/src/protocols/Aws_restJson1.ts b/clients/client-guardduty/src/protocols/Aws_restJson1.ts index f6eb817f8dc2..563981e86cf0 100644 --- a/clients/client-guardduty/src/protocols/Aws_restJson1.ts +++ b/clients/client-guardduty/src/protocols/Aws_restJson1.ts @@ -1901,7 +1901,7 @@ export const de_AcceptAdministratorInvitationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptAdministratorInvitationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1910,35 +1910,6 @@ export const de_AcceptAdministratorInvitationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptAdministratorInvitationCommandError - */ -const de_AcceptAdministratorInvitationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AcceptInvitationCommand */ @@ -1947,7 +1918,7 @@ export const de_AcceptInvitationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptInvitationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1956,35 +1927,6 @@ export const de_AcceptInvitationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptInvitationCommandError - */ -const de_AcceptInvitationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ArchiveFindingsCommand */ @@ -1993,7 +1935,7 @@ export const de_ArchiveFindingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ArchiveFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2002,35 +1944,6 @@ export const de_ArchiveFindingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ArchiveFindingsCommandError - */ -const de_ArchiveFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDetectorCommand */ @@ -2039,7 +1952,7 @@ export const de_CreateDetectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDetectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2053,35 +1966,6 @@ export const de_CreateDetectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDetectorCommandError - */ -const de_CreateDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFilterCommand */ @@ -2090,7 +1974,7 @@ export const de_CreateFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFilterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2103,35 +1987,6 @@ export const de_CreateFilterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFilterCommandError - */ -const de_CreateFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateIPSetCommand */ @@ -2140,7 +1995,7 @@ export const de_CreateIPSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateIPSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2153,35 +2008,6 @@ export const de_CreateIPSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateIPSetCommandError - */ -const de_CreateIPSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMembersCommand */ @@ -2190,7 +2016,7 @@ export const de_CreateMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2203,35 +2029,6 @@ export const de_CreateMembersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMembersCommandError - */ -const de_CreateMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePublishingDestinationCommand */ @@ -2240,7 +2037,7 @@ export const de_CreatePublishingDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePublishingDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2253,35 +2050,6 @@ export const de_CreatePublishingDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePublishingDestinationCommandError - */ -const de_CreatePublishingDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSampleFindingsCommand */ @@ -2290,7 +2058,7 @@ export const de_CreateSampleFindingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSampleFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2300,143 +2068,56 @@ export const de_CreateSampleFindingsCommand = async ( }; /** - * deserializeAws_restJson1CreateSampleFindingsCommandError + * deserializeAws_restJson1CreateThreatIntelSetCommand */ -const de_CreateSampleFindingsCommandError = async ( +export const de_CreateThreatIntelSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ThreatIntelSetId: [, __expectString, `threatIntelSetId`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateThreatIntelSetCommand + * deserializeAws_restJson1DeclineInvitationsCommand */ -export const de_CreateThreatIntelSetCommand = async ( +export const de_DeclineInvitationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateThreatIntelSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ThreatIntelSetId: [, __expectString, `threatIntelSetId`], + UnprocessedAccounts: [, (_) => de_UnprocessedAccounts(_, context), `unprocessedAccounts`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateThreatIntelSetCommandError + * deserializeAws_restJson1DeleteDetectorCommand */ -const de_CreateThreatIntelSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeclineInvitationsCommand - */ -export const de_DeclineInvitationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeclineInvitationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - UnprocessedAccounts: [, (_) => de_UnprocessedAccounts(_, context), `unprocessedAccounts`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeclineInvitationsCommandError - */ -const de_DeclineInvitationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDetectorCommand - */ -export const de_DeleteDetectorCommand = async ( +export const de_DeleteDetectorCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDetectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2445,35 +2126,6 @@ export const de_DeleteDetectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDetectorCommandError - */ -const de_DeleteDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteFilterCommand */ @@ -2482,7 +2134,7 @@ export const de_DeleteFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFilterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2491,35 +2143,6 @@ export const de_DeleteFilterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteFilterCommandError - */ -const de_DeleteFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteInvitationsCommand */ @@ -2528,7 +2151,7 @@ export const de_DeleteInvitationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteInvitationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2541,35 +2164,6 @@ export const de_DeleteInvitationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteInvitationsCommandError - */ -const de_DeleteInvitationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteIPSetCommand */ @@ -2578,7 +2172,7 @@ export const de_DeleteIPSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteIPSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2587,35 +2181,6 @@ export const de_DeleteIPSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteIPSetCommandError - */ -const de_DeleteIPSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteMembersCommand */ @@ -2624,7 +2189,7 @@ export const de_DeleteMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2637,35 +2202,6 @@ export const de_DeleteMembersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteMembersCommandError - */ -const de_DeleteMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePublishingDestinationCommand */ @@ -2674,7 +2210,7 @@ export const de_DeletePublishingDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePublishingDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2683,35 +2219,6 @@ export const de_DeletePublishingDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePublishingDestinationCommandError - */ -const de_DeletePublishingDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteThreatIntelSetCommand */ @@ -2720,7 +2227,7 @@ export const de_DeleteThreatIntelSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteThreatIntelSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2729,35 +2236,6 @@ export const de_DeleteThreatIntelSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteThreatIntelSetCommandError - */ -const de_DeleteThreatIntelSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeMalwareScansCommand */ @@ -2766,7 +2244,7 @@ export const de_DescribeMalwareScansCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeMalwareScansCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2781,43 +2259,14 @@ export const de_DescribeMalwareScansCommand = async ( }; /** - * deserializeAws_restJson1DescribeMalwareScansCommandError + * deserializeAws_restJson1DescribeOrganizationConfigurationCommand */ -const de_DescribeMalwareScansCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeOrganizationConfigurationCommand - */ -export const de_DescribeOrganizationConfigurationCommand = async ( +export const de_DescribeOrganizationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeOrganizationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2835,35 +2284,6 @@ export const de_DescribeOrganizationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeOrganizationConfigurationCommandError - */ -const de_DescribeOrganizationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribePublishingDestinationCommand */ @@ -2872,7 +2292,7 @@ export const de_DescribePublishingDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePublishingDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2889,35 +2309,6 @@ export const de_DescribePublishingDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribePublishingDestinationCommandError - */ -const de_DescribePublishingDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisableOrganizationAdminAccountCommand */ @@ -2926,7 +2317,7 @@ export const de_DisableOrganizationAdminAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableOrganizationAdminAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2935,35 +2326,6 @@ export const de_DisableOrganizationAdminAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisableOrganizationAdminAccountCommandError - */ -const de_DisableOrganizationAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateFromAdministratorAccountCommand */ @@ -2972,7 +2334,7 @@ export const de_DisassociateFromAdministratorAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateFromAdministratorAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2981,35 +2343,6 @@ export const de_DisassociateFromAdministratorAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateFromAdministratorAccountCommandError - */ -const de_DisassociateFromAdministratorAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateFromMasterAccountCommand */ @@ -3018,7 +2351,7 @@ export const de_DisassociateFromMasterAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateFromMasterAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3027,35 +2360,6 @@ export const de_DisassociateFromMasterAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateFromMasterAccountCommandError - */ -const de_DisassociateFromMasterAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateMembersCommand */ @@ -3064,7 +2368,7 @@ export const de_DisassociateMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3077,35 +2381,6 @@ export const de_DisassociateMembersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateMembersCommandError - */ -const de_DisassociateMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1EnableOrganizationAdminAccountCommand */ @@ -3114,1190 +2389,435 @@ export const de_EnableOrganizationAdminAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableOrganizationAdminAccountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1EnableOrganizationAdminAccountCommandError - */ -const de_EnableOrganizationAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAdministratorAccountCommand - */ -export const de_GetAdministratorAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAdministratorAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Administrator: [, (_) => de_Administrator(_, context), `administrator`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAdministratorAccountCommandError - */ -const de_GetAdministratorAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCoverageStatisticsCommand - */ -export const de_GetCoverageStatisticsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCoverageStatisticsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CoverageStatistics: [, (_) => de_CoverageStatistics(_, context), `coverageStatistics`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetCoverageStatisticsCommandError - */ -const de_GetCoverageStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDetectorCommand - */ -export const de_GetDetectorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDetectorCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CreatedAt: [, __expectString, `createdAt`], - DataSources: [, (_) => de_DataSourceConfigurationsResult(_, context), `dataSources`], - Features: [, (_) => de_DetectorFeatureConfigurationsResults(_, context), `features`], - FindingPublishingFrequency: [, __expectString, `findingPublishingFrequency`], - ServiceRole: [, __expectString, `serviceRole`], - Status: [, __expectString, `status`], - Tags: [, _json, `tags`], - UpdatedAt: [, __expectString, `updatedAt`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDetectorCommandError - */ -const de_GetDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFilterCommand - */ -export const de_GetFilterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFilterCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Action: [, __expectString, `action`], - Description: [, __expectString, `description`], - FindingCriteria: [, (_) => de_FindingCriteria(_, context), `findingCriteria`], - Name: [, __expectString, `name`], - Rank: [, __expectInt32, `rank`], - Tags: [, _json, `tags`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFilterCommandError - */ -const de_GetFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFindingsCommand - */ -export const de_GetFindingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFindingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Findings: [, (_) => de_Findings(_, context), `findings`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFindingsCommandError - */ -const de_GetFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFindingsStatisticsCommand - */ -export const de_GetFindingsStatisticsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFindingsStatisticsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - FindingStatistics: [, (_) => de_FindingStatistics(_, context), `findingStatistics`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFindingsStatisticsCommandError - */ -const de_GetFindingsStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetInvitationsCountCommand - */ -export const de_GetInvitationsCountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInvitationsCountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - InvitationsCount: [, __expectInt32, `invitationsCount`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetInvitationsCountCommandError - */ -const de_GetInvitationsCountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetIPSetCommand - */ -export const de_GetIPSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIPSetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Format: [, __expectString, `format`], - Location: [, __expectString, `location`], - Name: [, __expectString, `name`], - Status: [, __expectString, `status`], - Tags: [, _json, `tags`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetIPSetCommandError - */ -const de_GetIPSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMalwareScanSettingsCommand - */ -export const de_GetMalwareScanSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMalwareScanSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - EbsSnapshotPreservation: [, __expectString, `ebsSnapshotPreservation`], - ScanResourceCriteria: [, (_) => de_ScanResourceCriteria(_, context), `scanResourceCriteria`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMalwareScanSettingsCommandError - */ -const de_GetMalwareScanSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMasterAccountCommand - */ -export const de_GetMasterAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMasterAccountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Master: [, (_) => de_Master(_, context), `master`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMasterAccountCommandError - */ -const de_GetMasterAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMemberDetectorsCommand - */ -export const de_GetMemberDetectorsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMemberDetectorsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - MemberDataSourceConfigurations: [, (_) => de_MemberDataSourceConfigurations(_, context), `members`], - UnprocessedAccounts: [, (_) => de_UnprocessedAccounts(_, context), `unprocessedAccounts`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMemberDetectorsCommandError - */ -const de_GetMemberDetectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMembersCommand - */ -export const de_GetMembersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMembersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Members: [, (_) => de_Members(_, context), `members`], - UnprocessedAccounts: [, (_) => de_UnprocessedAccounts(_, context), `unprocessedAccounts`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMembersCommandError - */ -const de_GetMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetOrganizationStatisticsCommand - */ -export const de_GetOrganizationStatisticsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOrganizationStatisticsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - OrganizationDetails: [, (_) => de_OrganizationDetails(_, context), `organizationDetails`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetOrganizationStatisticsCommandError - */ -const de_GetOrganizationStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetRemainingFreeTrialDaysCommand + * deserializeAws_restJson1GetAdministratorAccountCommand */ -export const de_GetRemainingFreeTrialDaysCommand = async ( +export const de_GetAdministratorAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRemainingFreeTrialDaysCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Accounts: [, (_) => de_AccountFreeTrialInfos(_, context), `accounts`], - UnprocessedAccounts: [, (_) => de_UnprocessedAccounts(_, context), `unprocessedAccounts`], + Administrator: [, (_) => de_Administrator(_, context), `administrator`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetRemainingFreeTrialDaysCommandError + * deserializeAws_restJson1GetCoverageStatisticsCommand */ -const de_GetRemainingFreeTrialDaysCommandError = async ( +export const de_GetCoverageStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CoverageStatistics: [, (_) => de_CoverageStatistics(_, context), `coverageStatistics`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetThreatIntelSetCommand + * deserializeAws_restJson1GetDetectorCommand */ -export const de_GetThreatIntelSetCommand = async ( +export const de_GetDetectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetThreatIntelSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Format: [, __expectString, `format`], - Location: [, __expectString, `location`], - Name: [, __expectString, `name`], + CreatedAt: [, __expectString, `createdAt`], + DataSources: [, (_) => de_DataSourceConfigurationsResult(_, context), `dataSources`], + Features: [, (_) => de_DetectorFeatureConfigurationsResults(_, context), `features`], + FindingPublishingFrequency: [, __expectString, `findingPublishingFrequency`], + ServiceRole: [, __expectString, `serviceRole`], Status: [, __expectString, `status`], Tags: [, _json, `tags`], + UpdatedAt: [, __expectString, `updatedAt`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetThreatIntelSetCommandError + * deserializeAws_restJson1GetFilterCommand */ -const de_GetThreatIntelSetCommandError = async ( +export const de_GetFilterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Action: [, __expectString, `action`], + Description: [, __expectString, `description`], + FindingCriteria: [, (_) => de_FindingCriteria(_, context), `findingCriteria`], + Name: [, __expectString, `name`], + Rank: [, __expectInt32, `rank`], + Tags: [, _json, `tags`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetUsageStatisticsCommand + * deserializeAws_restJson1GetFindingsCommand */ -export const de_GetUsageStatisticsCommand = async ( +export const de_GetFindingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUsageStatisticsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: [, __expectString, `nextToken`], - UsageStatistics: [, (_) => de_UsageStatistics(_, context), `usageStatistics`], + Findings: [, (_) => de_Findings(_, context), `findings`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetUsageStatisticsCommandError + * deserializeAws_restJson1GetFindingsStatisticsCommand */ -const de_GetUsageStatisticsCommandError = async ( +export const de_GetFindingsStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + FindingStatistics: [, (_) => de_FindingStatistics(_, context), `findingStatistics`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1InviteMembersCommand + * deserializeAws_restJson1GetInvitationsCountCommand */ -export const de_InviteMembersCommand = async ( +export const de_GetInvitationsCountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_InviteMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - UnprocessedAccounts: [, (_) => de_UnprocessedAccounts(_, context), `unprocessedAccounts`], + InvitationsCount: [, __expectInt32, `invitationsCount`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1InviteMembersCommandError + * deserializeAws_restJson1GetIPSetCommand */ -const de_InviteMembersCommandError = async ( +export const de_GetIPSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Format: [, __expectString, `format`], + Location: [, __expectString, `location`], + Name: [, __expectString, `name`], + Status: [, __expectString, `status`], + Tags: [, _json, `tags`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListCoverageCommand + * deserializeAws_restJson1GetMalwareScanSettingsCommand */ -export const de_ListCoverageCommand = async ( +export const de_GetMalwareScanSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCoverageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: [, __expectString, `nextToken`], - Resources: [, (_) => de_CoverageResources(_, context), `resources`], + EbsSnapshotPreservation: [, __expectString, `ebsSnapshotPreservation`], + ScanResourceCriteria: [, (_) => de_ScanResourceCriteria(_, context), `scanResourceCriteria`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListCoverageCommandError + * deserializeAws_restJson1GetMasterAccountCommand */ -const de_ListCoverageCommandError = async ( +export const de_GetMasterAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Master: [, (_) => de_Master(_, context), `master`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListDetectorsCommand + * deserializeAws_restJson1GetMemberDetectorsCommand */ -export const de_ListDetectorsCommand = async ( +export const de_GetMemberDetectorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDetectorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DetectorIds: [, _json, `detectorIds`], - NextToken: [, __expectString, `nextToken`], + MemberDataSourceConfigurations: [, (_) => de_MemberDataSourceConfigurations(_, context), `members`], + UnprocessedAccounts: [, (_) => de_UnprocessedAccounts(_, context), `unprocessedAccounts`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListDetectorsCommandError + * deserializeAws_restJson1GetMembersCommand */ -const de_ListDetectorsCommandError = async ( +export const de_GetMembersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Members: [, (_) => de_Members(_, context), `members`], + UnprocessedAccounts: [, (_) => de_UnprocessedAccounts(_, context), `unprocessedAccounts`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListFiltersCommand + * deserializeAws_restJson1GetOrganizationStatisticsCommand */ -export const de_ListFiltersCommand = async ( +export const de_GetOrganizationStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFiltersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - FilterNames: [, _json, `filterNames`], - NextToken: [, __expectString, `nextToken`], + OrganizationDetails: [, (_) => de_OrganizationDetails(_, context), `organizationDetails`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListFiltersCommandError + * deserializeAws_restJson1GetRemainingFreeTrialDaysCommand */ -const de_ListFiltersCommandError = async ( +export const de_GetRemainingFreeTrialDaysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Accounts: [, (_) => de_AccountFreeTrialInfos(_, context), `accounts`], + UnprocessedAccounts: [, (_) => de_UnprocessedAccounts(_, context), `unprocessedAccounts`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListFindingsCommand + * deserializeAws_restJson1GetThreatIntelSetCommand */ -export const de_ListFindingsCommand = async ( +export const de_GetThreatIntelSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - FindingIds: [, _json, `findingIds`], - NextToken: [, __expectString, `nextToken`], + Format: [, __expectString, `format`], + Location: [, __expectString, `location`], + Name: [, __expectString, `name`], + Status: [, __expectString, `status`], + Tags: [, _json, `tags`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListFindingsCommandError + * deserializeAws_restJson1GetUsageStatisticsCommand */ -const de_ListFindingsCommandError = async ( +export const de_GetUsageStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: [, __expectString, `nextToken`], + UsageStatistics: [, (_) => de_UsageStatistics(_, context), `usageStatistics`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListInvitationsCommand + * deserializeAws_restJson1InviteMembersCommand */ -export const de_ListInvitationsCommand = async ( +export const de_InviteMembersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInvitationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Invitations: [, (_) => de_Invitations(_, context), `invitations`], - NextToken: [, __expectString, `nextToken`], + UnprocessedAccounts: [, (_) => de_UnprocessedAccounts(_, context), `unprocessedAccounts`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListInvitationsCommandError + * deserializeAws_restJson1ListCoverageCommand */ -const de_ListInvitationsCommandError = async ( +export const de_ListCoverageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: [, __expectString, `nextToken`], + Resources: [, (_) => de_CoverageResources(_, context), `resources`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListIPSetsCommand + * deserializeAws_restJson1ListDetectorsCommand */ -export const de_ListIPSetsCommand = async ( +export const de_ListDetectorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIPSetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - IpSetIds: [, _json, `ipSetIds`], + DetectorIds: [, _json, `detectorIds`], NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); @@ -4305,50 +2825,43 @@ export const de_ListIPSetsCommand = async ( }; /** - * deserializeAws_restJson1ListIPSetsCommandError + * deserializeAws_restJson1ListFiltersCommand */ -const de_ListIPSetsCommandError = async ( +export const de_ListFiltersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + FilterNames: [, _json, `filterNames`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListMembersCommand + * deserializeAws_restJson1ListFindingsCommand */ -export const de_ListMembersCommand = async ( +export const de_ListFindingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Members: [, (_) => de_Members(_, context), `members`], + FindingIds: [, _json, `findingIds`], NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); @@ -4356,50 +2869,43 @@ export const de_ListMembersCommand = async ( }; /** - * deserializeAws_restJson1ListMembersCommandError + * deserializeAws_restJson1ListInvitationsCommand */ -const de_ListMembersCommandError = async ( +export const de_ListInvitationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Invitations: [, (_) => de_Invitations(_, context), `invitations`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListOrganizationAdminAccountsCommand + * deserializeAws_restJson1ListIPSetsCommand */ -export const de_ListOrganizationAdminAccountsCommand = async ( +export const de_ListIPSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOrganizationAdminAccountsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AdminAccounts: [, (_) => de_AdminAccounts(_, context), `adminAccounts`], + IpSetIds: [, _json, `ipSetIds`], NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); @@ -4407,50 +2913,43 @@ export const de_ListOrganizationAdminAccountsCommand = async ( }; /** - * deserializeAws_restJson1ListOrganizationAdminAccountsCommandError + * deserializeAws_restJson1ListMembersCommand */ -const de_ListOrganizationAdminAccountsCommandError = async ( +export const de_ListMembersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Members: [, (_) => de_Members(_, context), `members`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPublishingDestinationsCommand + * deserializeAws_restJson1ListOrganizationAdminAccountsCommand */ -export const de_ListPublishingDestinationsCommand = async ( +export const de_ListOrganizationAdminAccountsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPublishingDestinationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Destinations: [, (_) => de_Destinations(_, context), `destinations`], + AdminAccounts: [, (_) => de_AdminAccounts(_, context), `adminAccounts`], NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); @@ -4458,32 +2957,25 @@ export const de_ListPublishingDestinationsCommand = async ( }; /** - * deserializeAws_restJson1ListPublishingDestinationsCommandError + * deserializeAws_restJson1ListPublishingDestinationsCommand */ -const de_ListPublishingDestinationsCommandError = async ( +export const de_ListPublishingDestinationsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Destinations: [, (_) => de_Destinations(_, context), `destinations`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4494,7 +2986,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4507,38 +2999,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.guardduty#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListThreatIntelSetsCommand */ @@ -4547,7 +3007,7 @@ export const de_ListThreatIntelSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListThreatIntelSetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4561,35 +3021,6 @@ export const de_ListThreatIntelSetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListThreatIntelSetsCommandError - */ -const de_ListThreatIntelSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartMalwareScanCommand */ @@ -4598,7 +3029,7 @@ export const de_StartMalwareScanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartMalwareScanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4611,38 +3042,6 @@ export const de_StartMalwareScanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartMalwareScanCommandError - */ -const de_StartMalwareScanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.guardduty#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartMonitoringMembersCommand */ @@ -4651,7 +3050,7 @@ export const de_StartMonitoringMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartMonitoringMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4664,35 +3063,6 @@ export const de_StartMonitoringMembersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartMonitoringMembersCommandError - */ -const de_StartMonitoringMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopMonitoringMembersCommand */ @@ -4701,7 +3071,7 @@ export const de_StopMonitoringMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopMonitoringMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4714,35 +3084,6 @@ export const de_StopMonitoringMembersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopMonitoringMembersCommandError - */ -const de_StopMonitoringMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -4751,102 +3092,24 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.guardduty#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UnarchiveFindingsCommand - */ -export const de_UnarchiveFindingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UnarchiveFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1UnarchiveFindingsCommandError - */ -const de_UnarchiveFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1UnarchiveFindingsCommand */ -export const de_UntagResourceCommand = async ( +export const de_UnarchiveFindingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4856,35 +3119,20 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.guardduty#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -4895,7 +3143,7 @@ export const de_UpdateDetectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDetectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4904,35 +3152,6 @@ export const de_UpdateDetectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDetectorCommandError - */ -const de_UpdateDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFilterCommand */ @@ -4941,7 +3160,7 @@ export const de_UpdateFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFilterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4954,35 +3173,6 @@ export const de_UpdateFilterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFilterCommandError - */ -const de_UpdateFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFindingsFeedbackCommand */ @@ -4991,7 +3181,7 @@ export const de_UpdateFindingsFeedbackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFindingsFeedbackCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5000,35 +3190,6 @@ export const de_UpdateFindingsFeedbackCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFindingsFeedbackCommandError - */ -const de_UpdateFindingsFeedbackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateIPSetCommand */ @@ -5037,7 +3198,7 @@ export const de_UpdateIPSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIPSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5046,35 +3207,6 @@ export const de_UpdateIPSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateIPSetCommandError - */ -const de_UpdateIPSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMalwareScanSettingsCommand */ @@ -5083,7 +3215,7 @@ export const de_UpdateMalwareScanSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMalwareScanSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5092,35 +3224,6 @@ export const de_UpdateMalwareScanSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateMalwareScanSettingsCommandError - */ -const de_UpdateMalwareScanSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMemberDetectorsCommand */ @@ -5129,7 +3232,7 @@ export const de_UpdateMemberDetectorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMemberDetectorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5142,35 +3245,6 @@ export const de_UpdateMemberDetectorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateMemberDetectorsCommandError - */ -const de_UpdateMemberDetectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateOrganizationConfigurationCommand */ @@ -5179,7 +3253,7 @@ export const de_UpdateOrganizationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateOrganizationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5188,35 +3262,6 @@ export const de_UpdateOrganizationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateOrganizationConfigurationCommandError - */ -const de_UpdateOrganizationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePublishingDestinationCommand */ @@ -5225,7 +3270,7 @@ export const de_UpdatePublishingDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePublishingDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5234,35 +3279,6 @@ export const de_UpdatePublishingDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePublishingDestinationCommandError - */ -const de_UpdatePublishingDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.guardduty#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.guardduty#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateThreatIntelSetCommand */ @@ -5271,7 +3287,7 @@ export const de_UpdateThreatIntelSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateThreatIntelSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5281,12 +3297,9 @@ export const de_UpdateThreatIntelSetCommand = async ( }; /** - * deserializeAws_restJson1UpdateThreatIntelSetCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateThreatIntelSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5299,13 +3312,19 @@ const de_UpdateThreatIntelSetCommandError = async ( case "InternalServerErrorException": case "com.amazonaws.guardduty#InternalServerErrorException": throw await de_InternalServerErrorExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.guardduty#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.guardduty#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-health/src/protocols/Aws_json1_1.ts b/clients/client-health/src/protocols/Aws_json1_1.ts index 63ac6485459a..bd8f0b8b71f1 100644 --- a/clients/client-health/src/protocols/Aws_json1_1.ts +++ b/clients/client-health/src/protocols/Aws_json1_1.ts @@ -294,7 +294,7 @@ export const de_DescribeAffectedAccountsForOrganizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAffectedAccountsForOrganizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -306,32 +306,6 @@ export const de_DescribeAffectedAccountsForOrganizationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAffectedAccountsForOrganizationCommandError - */ -const de_DescribeAffectedAccountsForOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidPaginationToken": - case "com.amazonaws.health#InvalidPaginationToken": - throw await de_InvalidPaginationTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAffectedEntitiesCommand */ @@ -340,7 +314,7 @@ export const de_DescribeAffectedEntitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAffectedEntitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -352,35 +326,6 @@ export const de_DescribeAffectedEntitiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAffectedEntitiesCommandError - */ -const de_DescribeAffectedEntitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidPaginationToken": - case "com.amazonaws.health#InvalidPaginationToken": - throw await de_InvalidPaginationTokenRes(parsedOutput, context); - case "UnsupportedLocale": - case "com.amazonaws.health#UnsupportedLocale": - throw await de_UnsupportedLocaleRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAffectedEntitiesForOrganizationCommand */ @@ -389,7 +334,7 @@ export const de_DescribeAffectedEntitiesForOrganizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAffectedEntitiesForOrganizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -401,35 +346,6 @@ export const de_DescribeAffectedEntitiesForOrganizationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAffectedEntitiesForOrganizationCommandError - */ -const de_DescribeAffectedEntitiesForOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidPaginationToken": - case "com.amazonaws.health#InvalidPaginationToken": - throw await de_InvalidPaginationTokenRes(parsedOutput, context); - case "UnsupportedLocale": - case "com.amazonaws.health#UnsupportedLocale": - throw await de_UnsupportedLocaleRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEntityAggregatesCommand */ @@ -438,7 +354,7 @@ export const de_DescribeEntityAggregatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEntityAggregatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -450,26 +366,6 @@ export const de_DescribeEntityAggregatesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEntityAggregatesCommandError - */ -const de_DescribeEntityAggregatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribeEntityAggregatesForOrganizationCommand */ @@ -478,7 +374,7 @@ export const de_DescribeEntityAggregatesForOrganizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEntityAggregatesForOrganizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -490,26 +386,6 @@ export const de_DescribeEntityAggregatesForOrganizationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEntityAggregatesForOrganizationCommandError - */ -const de_DescribeEntityAggregatesForOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribeEventAggregatesCommand */ @@ -518,7 +394,7 @@ export const de_DescribeEventAggregatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventAggregatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -530,32 +406,6 @@ export const de_DescribeEventAggregatesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEventAggregatesCommandError - */ -const de_DescribeEventAggregatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidPaginationToken": - case "com.amazonaws.health#InvalidPaginationToken": - throw await de_InvalidPaginationTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEventDetailsCommand */ @@ -564,7 +414,7 @@ export const de_DescribeEventDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventDetailsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -576,32 +426,6 @@ export const de_DescribeEventDetailsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEventDetailsCommandError - */ -const de_DescribeEventDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UnsupportedLocale": - case "com.amazonaws.health#UnsupportedLocale": - throw await de_UnsupportedLocaleRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEventDetailsForOrganizationCommand */ @@ -610,7 +434,7 @@ export const de_DescribeEventDetailsForOrganizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventDetailsForOrganizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -622,32 +446,6 @@ export const de_DescribeEventDetailsForOrganizationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEventDetailsForOrganizationCommandError - */ -const de_DescribeEventDetailsForOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UnsupportedLocale": - case "com.amazonaws.health#UnsupportedLocale": - throw await de_UnsupportedLocaleRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEventsCommand */ @@ -656,7 +454,7 @@ export const de_DescribeEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -668,35 +466,6 @@ export const de_DescribeEventsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEventsCommandError - */ -const de_DescribeEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidPaginationToken": - case "com.amazonaws.health#InvalidPaginationToken": - throw await de_InvalidPaginationTokenRes(parsedOutput, context); - case "UnsupportedLocale": - case "com.amazonaws.health#UnsupportedLocale": - throw await de_UnsupportedLocaleRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEventsForOrganizationCommand */ @@ -705,7 +474,7 @@ export const de_DescribeEventsForOrganizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventsForOrganizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -717,35 +486,6 @@ export const de_DescribeEventsForOrganizationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEventsForOrganizationCommandError - */ -const de_DescribeEventsForOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidPaginationToken": - case "com.amazonaws.health#InvalidPaginationToken": - throw await de_InvalidPaginationTokenRes(parsedOutput, context); - case "UnsupportedLocale": - case "com.amazonaws.health#UnsupportedLocale": - throw await de_UnsupportedLocaleRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEventTypesCommand */ @@ -754,7 +494,7 @@ export const de_DescribeEventTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -766,35 +506,6 @@ export const de_DescribeEventTypesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEventTypesCommandError - */ -const de_DescribeEventTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidPaginationToken": - case "com.amazonaws.health#InvalidPaginationToken": - throw await de_InvalidPaginationTokenRes(parsedOutput, context); - case "UnsupportedLocale": - case "com.amazonaws.health#UnsupportedLocale": - throw await de_UnsupportedLocaleRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeHealthServiceStatusForOrganizationCommand */ @@ -803,7 +514,7 @@ export const de_DescribeHealthServiceStatusForOrganizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeHealthServiceStatusForOrganizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -815,26 +526,6 @@ export const de_DescribeHealthServiceStatusForOrganizationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeHealthServiceStatusForOrganizationCommandError - */ -const de_DescribeHealthServiceStatusForOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DisableHealthServiceAccessForOrganizationCommand */ @@ -843,7 +534,7 @@ export const de_DisableHealthServiceAccessForOrganizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableHealthServiceAccessForOrganizationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DisableHealthServiceAccessForOrganizationCommandOutput = { @@ -852,32 +543,6 @@ export const de_DisableHealthServiceAccessForOrganizationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisableHealthServiceAccessForOrganizationCommandError - */ -const de_DisableHealthServiceAccessForOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.health#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1EnableHealthServiceAccessForOrganizationCommand */ @@ -886,7 +551,7 @@ export const de_EnableHealthServiceAccessForOrganizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableHealthServiceAccessForOrganizationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: EnableHealthServiceAccessForOrganizationCommandOutput = { @@ -896,18 +561,21 @@ export const de_EnableHealthServiceAccessForOrganizationCommand = async ( }; /** - * deserializeAws_json1_1EnableHealthServiceAccessForOrganizationCommandError + * deserialize_Aws_json1_1CommandError */ -const de_EnableHealthServiceAccessForOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "InvalidPaginationToken": + case "com.amazonaws.health#InvalidPaginationToken": + throw await de_InvalidPaginationTokenRes(parsedOutput, context); + case "UnsupportedLocale": + case "com.amazonaws.health#UnsupportedLocale": + throw await de_UnsupportedLocaleRes(parsedOutput, context); case "ConcurrentModificationException": case "com.amazonaws.health#ConcurrentModificationException": throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); @@ -917,7 +585,7 @@ const de_EnableHealthServiceAccessForOrganizationCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-healthlake/src/protocols/Aws_json1_0.ts b/clients/client-healthlake/src/protocols/Aws_json1_0.ts index f1cd6b16dc21..df91444abfaa 100644 --- a/clients/client-healthlake/src/protocols/Aws_json1_0.ts +++ b/clients/client-healthlake/src/protocols/Aws_json1_0.ts @@ -269,7 +269,7 @@ export const de_CreateFHIRDatastoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFHIRDatastoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -281,41 +281,6 @@ export const de_CreateFHIRDatastoreCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateFHIRDatastoreCommandError - */ -const de_CreateFHIRDatastoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.healthlake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.healthlake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.healthlake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.healthlake#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteFHIRDatastoreCommand */ @@ -324,7 +289,7 @@ export const de_DeleteFHIRDatastoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteFHIRDatastoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -336,47 +301,6 @@ export const de_DeleteFHIRDatastoreCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteFHIRDatastoreCommandError - */ -const de_DeleteFHIRDatastoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.healthlake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.healthlake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.healthlake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.healthlake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.healthlake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.healthlake#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeFHIRDatastoreCommand */ @@ -385,7 +309,7 @@ export const de_DescribeFHIRDatastoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFHIRDatastoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -397,41 +321,6 @@ export const de_DescribeFHIRDatastoreCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeFHIRDatastoreCommandError - */ -const de_DescribeFHIRDatastoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.healthlake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.healthlake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.healthlake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.healthlake#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeFHIRExportJobCommand */ @@ -440,7 +329,7 @@ export const de_DescribeFHIRExportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFHIRExportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -452,41 +341,6 @@ export const de_DescribeFHIRExportJobCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeFHIRExportJobCommandError - */ -const de_DescribeFHIRExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.healthlake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.healthlake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.healthlake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.healthlake#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeFHIRImportJobCommand */ @@ -495,7 +349,7 @@ export const de_DescribeFHIRImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFHIRImportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -507,41 +361,6 @@ export const de_DescribeFHIRImportJobCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeFHIRImportJobCommandError - */ -const de_DescribeFHIRImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.healthlake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.healthlake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.healthlake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.healthlake#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListFHIRDatastoresCommand */ @@ -550,7 +369,7 @@ export const de_ListFHIRDatastoresCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListFHIRDatastoresCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -562,38 +381,6 @@ export const de_ListFHIRDatastoresCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListFHIRDatastoresCommandError - */ -const de_ListFHIRDatastoresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.healthlake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.healthlake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.healthlake#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListFHIRExportJobsCommand */ @@ -602,7 +389,7 @@ export const de_ListFHIRExportJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListFHIRExportJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -614,44 +401,6 @@ export const de_ListFHIRExportJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListFHIRExportJobsCommandError - */ -const de_ListFHIRExportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.healthlake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.healthlake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.healthlake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.healthlake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.healthlake#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListFHIRImportJobsCommand */ @@ -660,7 +409,7 @@ export const de_ListFHIRImportJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListFHIRImportJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -672,44 +421,6 @@ export const de_ListFHIRImportJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListFHIRImportJobsCommandError - */ -const de_ListFHIRImportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.healthlake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.healthlake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.healthlake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.healthlake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.healthlake#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListTagsForResourceCommand */ @@ -718,7 +429,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -730,35 +441,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.healthlake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.healthlake#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0StartFHIRExportJobCommand */ @@ -767,7 +449,7 @@ export const de_StartFHIRExportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartFHIRExportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -779,44 +461,6 @@ export const de_StartFHIRExportJobCommand = async ( return response; }; -/** - * deserializeAws_json1_0StartFHIRExportJobCommandError - */ -const de_StartFHIRExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.healthlake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.healthlake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.healthlake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.healthlake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.healthlake#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0StartFHIRImportJobCommand */ @@ -825,7 +469,7 @@ export const de_StartFHIRImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartFHIRImportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -837,44 +481,6 @@ export const de_StartFHIRImportJobCommand = async ( return response; }; -/** - * deserializeAws_json1_0StartFHIRImportJobCommandError - */ -const de_StartFHIRImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.healthlake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.healthlake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.healthlake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.healthlake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.healthlake#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TagResourceCommand */ @@ -883,7 +489,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -895,35 +501,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.healthlake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.healthlake#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UntagResourceCommand */ @@ -932,7 +509,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -945,31 +522,40 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_0UntagResourceCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.healthlake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.healthlake#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.healthlake#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.healthlake#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.healthlake#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.healthlake#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.healthlake#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-honeycode/src/protocols/Aws_restJson1.ts b/clients/client-honeycode/src/protocols/Aws_restJson1.ts index 426ef55e27c0..0fe8cc9bf104 100644 --- a/clients/client-honeycode/src/protocols/Aws_restJson1.ts +++ b/clients/client-honeycode/src/protocols/Aws_restJson1.ts @@ -450,7 +450,7 @@ export const de_BatchCreateTableRowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchCreateTableRowsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -465,53 +465,6 @@ export const de_BatchCreateTableRowsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchCreateTableRowsCommandError - */ -const de_BatchCreateTableRowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.honeycode#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.honeycode#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.honeycode#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.honeycode#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.honeycode#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.honeycode#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.honeycode#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.honeycode#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDeleteTableRowsCommand */ @@ -520,7 +473,7 @@ export const de_BatchDeleteTableRowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDeleteTableRowsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -534,50 +487,6 @@ export const de_BatchDeleteTableRowsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDeleteTableRowsCommandError - */ -const de_BatchDeleteTableRowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.honeycode#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.honeycode#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.honeycode#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.honeycode#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.honeycode#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.honeycode#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.honeycode#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUpdateTableRowsCommand */ @@ -586,7 +495,7 @@ export const de_BatchUpdateTableRowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpdateTableRowsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -600,50 +509,6 @@ export const de_BatchUpdateTableRowsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchUpdateTableRowsCommandError - */ -const de_BatchUpdateTableRowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.honeycode#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.honeycode#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.honeycode#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.honeycode#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.honeycode#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.honeycode#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.honeycode#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUpsertTableRowsCommand */ @@ -652,7 +517,7 @@ export const de_BatchUpsertTableRowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpsertTableRowsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -667,53 +532,6 @@ export const de_BatchUpsertTableRowsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchUpsertTableRowsCommandError - */ -const de_BatchUpsertTableRowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.honeycode#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.honeycode#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.honeycode#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.honeycode#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.honeycode#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.honeycode#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.honeycode#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.honeycode#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeTableDataImportJobCommand */ @@ -722,7 +540,7 @@ export const de_DescribeTableDataImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTableDataImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -738,50 +556,6 @@ export const de_DescribeTableDataImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeTableDataImportJobCommandError - */ -const de_DescribeTableDataImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.honeycode#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.honeycode#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.honeycode#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.honeycode#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.honeycode#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.honeycode#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.honeycode#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetScreenDataCommand */ @@ -790,7 +564,7 @@ export const de_GetScreenDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetScreenDataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -805,50 +579,6 @@ export const de_GetScreenDataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetScreenDataCommandError - */ -const de_GetScreenDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.honeycode#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.honeycode#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.honeycode#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.honeycode#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.honeycode#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.honeycode#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.honeycode#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1InvokeScreenAutomationCommand */ @@ -857,217 +587,28 @@ export const de_InvokeScreenAutomationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_InvokeScreenAutomationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - workbookCursor: __expectLong, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1InvokeScreenAutomationCommandError - */ -const de_InvokeScreenAutomationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.honeycode#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AutomationExecutionException": - case "com.amazonaws.honeycode#AutomationExecutionException": - throw await de_AutomationExecutionExceptionRes(parsedOutput, context); - case "AutomationExecutionTimeoutException": - case "com.amazonaws.honeycode#AutomationExecutionTimeoutException": - throw await de_AutomationExecutionTimeoutExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.honeycode#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.honeycode#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.honeycode#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.honeycode#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.honeycode#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.honeycode#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.honeycode#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTableColumnsCommand - */ -export const de_ListTableColumnsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTableColumnsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - tableColumns: _json, - workbookCursor: __expectLong, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTableColumnsCommandError - */ -const de_ListTableColumnsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.honeycode#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.honeycode#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.honeycode#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.honeycode#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.honeycode#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.honeycode#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.honeycode#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTableRowsCommand - */ -export const de_ListTableRowsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTableRowsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - columnIds: _json, - nextToken: __expectString, - rowIdsNotFound: _json, - rows: _json, - workbookCursor: __expectLong, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTableRowsCommandError - */ -const de_ListTableRowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.honeycode#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.honeycode#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.honeycode#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.honeycode#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.honeycode#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.honeycode#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.honeycode#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + workbookCursor: __expectLong, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTablesCommand + * deserializeAws_restJson1ListTableColumnsCommand */ -export const de_ListTablesCommand = async ( +export const de_ListTableColumnsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTablesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1075,7 +616,7 @@ export const de_ListTablesCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - tables: _json, + tableColumns: _json, workbookCursor: __expectLong, }); Object.assign(contents, doc); @@ -1083,112 +624,72 @@ export const de_ListTablesCommand = async ( }; /** - * deserializeAws_restJson1ListTablesCommandError + * deserializeAws_restJson1ListTableRowsCommand */ -const de_ListTablesCommandError = async ( +export const de_ListTableRowsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.honeycode#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.honeycode#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.honeycode#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.honeycode#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.honeycode#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.honeycode#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.honeycode#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + columnIds: _json, + nextToken: __expectString, + rowIdsNotFound: _json, + rows: _json, + workbookCursor: __expectLong, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListTablesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListTablesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + nextToken: __expectString, + tables: _json, + workbookCursor: __expectLong, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.honeycode#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.honeycode#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.honeycode#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.honeycode#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.honeycode#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.honeycode#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.honeycode#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1199,7 +700,7 @@ export const de_QueryTableRowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_QueryTableRowsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1215,50 +716,6 @@ export const de_QueryTableRowsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1QueryTableRowsCommandError - */ -const de_QueryTableRowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.honeycode#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.honeycode#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.honeycode#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.honeycode#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.honeycode#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.honeycode#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.honeycode#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartTableDataImportJobCommand */ @@ -1267,7 +724,7 @@ export const de_StartTableDataImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartTableDataImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1281,53 +738,6 @@ export const de_StartTableDataImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartTableDataImportJobCommandError - */ -const de_StartTableDataImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.honeycode#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.honeycode#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.honeycode#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.honeycode#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.honeycode#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.honeycode#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.honeycode#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.honeycode#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1336,7 +746,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1345,50 +755,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.honeycode#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.honeycode#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.honeycode#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.honeycode#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.honeycode#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.honeycode#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.honeycode#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1397,7 +763,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1407,12 +773,9 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1431,6 +794,9 @@ const de_UntagResourceCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.honeycode#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.honeycode#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ServiceUnavailableException": case "com.amazonaws.honeycode#ServiceUnavailableException": throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); @@ -1440,13 +806,19 @@ const de_UntagResourceCommandError = async ( case "ValidationException": case "com.amazonaws.honeycode#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "AutomationExecutionException": + case "com.amazonaws.honeycode#AutomationExecutionException": + throw await de_AutomationExecutionExceptionRes(parsedOutput, context); + case "AutomationExecutionTimeoutException": + case "com.amazonaws.honeycode#AutomationExecutionTimeoutException": + throw await de_AutomationExecutionTimeoutExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iam/src/protocols/Aws_query.ts b/clients/client-iam/src/protocols/Aws_query.ts index 2d219c39fe49..4dab7aed8408 100644 --- a/clients/client-iam/src/protocols/Aws_query.ts +++ b/clients/client-iam/src/protocols/Aws_query.ts @@ -3431,7 +3431,7 @@ export const de_AddClientIDToOpenIDConnectProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddClientIDToOpenIDConnectProviderCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AddClientIDToOpenIDConnectProviderCommandOutput = { @@ -3440,41 +3440,6 @@ export const de_AddClientIDToOpenIDConnectProviderCommand = async ( return response; }; -/** - * deserializeAws_queryAddClientIDToOpenIDConnectProviderCommandError - */ -const de_AddClientIDToOpenIDConnectProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAddRoleToInstanceProfileCommand */ @@ -3483,7 +3448,7 @@ export const de_AddRoleToInstanceProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddRoleToInstanceProfileCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AddRoleToInstanceProfileCommandOutput = { @@ -3492,44 +3457,6 @@ export const de_AddRoleToInstanceProfileCommand = async ( return response; }; -/** - * deserializeAws_queryAddRoleToInstanceProfileCommandError - */ -const de_AddRoleToInstanceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "UnmodifiableEntity": - case "com.amazonaws.iam#UnmodifiableEntityException": - throw await de_UnmodifiableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAddUserToGroupCommand */ @@ -3538,7 +3465,7 @@ export const de_AddUserToGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddUserToGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AddUserToGroupCommandOutput = { @@ -3547,38 +3474,6 @@ export const de_AddUserToGroupCommand = async ( return response; }; -/** - * deserializeAws_queryAddUserToGroupCommandError - */ -const de_AddUserToGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAttachGroupPolicyCommand */ @@ -3587,7 +3482,7 @@ export const de_AttachGroupPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachGroupPolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AttachGroupPolicyCommandOutput = { @@ -3596,44 +3491,6 @@ export const de_AttachGroupPolicyCommand = async ( return response; }; -/** - * deserializeAws_queryAttachGroupPolicyCommandError - */ -const de_AttachGroupPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "PolicyNotAttachable": - case "com.amazonaws.iam#PolicyNotAttachableException": - throw await de_PolicyNotAttachableExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAttachRolePolicyCommand */ @@ -3642,7 +3499,7 @@ export const de_AttachRolePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachRolePolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AttachRolePolicyCommandOutput = { @@ -3651,47 +3508,6 @@ export const de_AttachRolePolicyCommand = async ( return response; }; -/** - * deserializeAws_queryAttachRolePolicyCommandError - */ -const de_AttachRolePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "PolicyNotAttachable": - case "com.amazonaws.iam#PolicyNotAttachableException": - throw await de_PolicyNotAttachableExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "UnmodifiableEntity": - case "com.amazonaws.iam#UnmodifiableEntityException": - throw await de_UnmodifiableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAttachUserPolicyCommand */ @@ -3700,7 +3516,7 @@ export const de_AttachUserPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachUserPolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AttachUserPolicyCommandOutput = { @@ -3709,44 +3525,6 @@ export const de_AttachUserPolicyCommand = async ( return response; }; -/** - * deserializeAws_queryAttachUserPolicyCommandError - */ -const de_AttachUserPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "PolicyNotAttachable": - case "com.amazonaws.iam#PolicyNotAttachableException": - throw await de_PolicyNotAttachableExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryChangePasswordCommand */ @@ -3755,7 +3533,7 @@ export const de_ChangePasswordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ChangePasswordCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ChangePasswordCommandOutput = { @@ -3764,47 +3542,6 @@ export const de_ChangePasswordCommand = async ( return response; }; -/** - * deserializeAws_queryChangePasswordCommandError - */ -const de_ChangePasswordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityTemporarilyUnmodifiable": - case "com.amazonaws.iam#EntityTemporarilyUnmodifiableException": - throw await de_EntityTemporarilyUnmodifiableExceptionRes(parsedOutput, context); - case "InvalidUserType": - case "com.amazonaws.iam#InvalidUserTypeException": - throw await de_InvalidUserTypeExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "PasswordPolicyViolation": - case "com.amazonaws.iam#PasswordPolicyViolationException": - throw await de_PasswordPolicyViolationExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateAccessKeyCommand */ @@ -3813,7 +3550,7 @@ export const de_CreateAccessKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAccessKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3826,46 +3563,14 @@ export const de_CreateAccessKeyCommand = async ( }; /** - * deserializeAws_queryCreateAccessKeyCommandError + * deserializeAws_queryCreateAccountAliasCommand */ -const de_CreateAccessKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryCreateAccountAliasCommand - */ -export const de_CreateAccountAliasCommand = async ( +export const de_CreateAccountAliasCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAccountAliasCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateAccountAliasCommandOutput = { @@ -3874,41 +3579,6 @@ export const de_CreateAccountAliasCommand = async ( return response; }; -/** - * deserializeAws_queryCreateAccountAliasCommandError - */ -const de_CreateAccountAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateGroupCommand */ @@ -3917,7 +3587,7 @@ export const de_CreateGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3929,41 +3599,6 @@ export const de_CreateGroupCommand = async ( return response; }; -/** - * deserializeAws_queryCreateGroupCommandError - */ -const de_CreateGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateInstanceProfileCommand */ @@ -3972,7 +3607,7 @@ export const de_CreateInstanceProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateInstanceProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3984,44 +3619,6 @@ export const de_CreateInstanceProfileCommand = async ( return response; }; -/** - * deserializeAws_queryCreateInstanceProfileCommandError - */ -const de_CreateInstanceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateLoginProfileCommand */ @@ -4030,7 +3627,7 @@ export const de_CreateLoginProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLoginProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4042,44 +3639,6 @@ export const de_CreateLoginProfileCommand = async ( return response; }; -/** - * deserializeAws_queryCreateLoginProfileCommandError - */ -const de_CreateLoginProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "PasswordPolicyViolation": - case "com.amazonaws.iam#PasswordPolicyViolationException": - throw await de_PasswordPolicyViolationExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateOpenIDConnectProviderCommand */ @@ -4088,7 +3647,7 @@ export const de_CreateOpenIDConnectProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateOpenIDConnectProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4100,44 +3659,6 @@ export const de_CreateOpenIDConnectProviderCommand = async ( return response; }; -/** - * deserializeAws_queryCreateOpenIDConnectProviderCommandError - */ -const de_CreateOpenIDConnectProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreatePolicyCommand */ @@ -4146,7 +3667,7 @@ export const de_CreatePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4158,47 +3679,6 @@ export const de_CreatePolicyCommand = async ( return response; }; -/** - * deserializeAws_queryCreatePolicyCommandError - */ -const de_CreatePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedPolicyDocument": - case "com.amazonaws.iam#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreatePolicyVersionCommand */ @@ -4207,7 +3687,7 @@ export const de_CreatePolicyVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePolicyVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4220,104 +3700,25 @@ export const de_CreatePolicyVersionCommand = async ( }; /** - * deserializeAws_queryCreatePolicyVersionCommandError + * deserializeAws_queryCreateRoleCommand */ -const de_CreatePolicyVersionCommandError = async ( +export const de_CreateRoleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedPolicyDocument": - case "com.amazonaws.iam#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryCreateRoleCommand - */ -export const de_CreateRoleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateRoleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateRoleResponse(data.CreateRoleResult, context); - const response: CreateRoleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateRoleResponse(data.CreateRoleResult, context); + const response: CreateRoleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; return response; }; -/** - * deserializeAws_queryCreateRoleCommandError - */ -const de_CreateRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedPolicyDocument": - case "com.amazonaws.iam#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateSAMLProviderCommand */ @@ -4326,7 +3727,7 @@ export const de_CreateSAMLProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSAMLProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4338,44 +3739,6 @@ export const de_CreateSAMLProviderCommand = async ( return response; }; -/** - * deserializeAws_queryCreateSAMLProviderCommandError - */ -const de_CreateSAMLProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateServiceLinkedRoleCommand */ @@ -4384,7 +3747,7 @@ export const de_CreateServiceLinkedRoleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateServiceLinkedRoleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4396,41 +3759,6 @@ export const de_CreateServiceLinkedRoleCommand = async ( return response; }; -/** - * deserializeAws_queryCreateServiceLinkedRoleCommandError - */ -const de_CreateServiceLinkedRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateServiceSpecificCredentialCommand */ @@ -4439,7 +3767,7 @@ export const de_CreateServiceSpecificCredentialCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateServiceSpecificCredentialCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4451,38 +3779,6 @@ export const de_CreateServiceSpecificCredentialCommand = async ( return response; }; -/** - * deserializeAws_queryCreateServiceSpecificCredentialCommandError - */ -const de_CreateServiceSpecificCredentialCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "NotSupportedService": - case "com.amazonaws.iam#ServiceNotSupportedException": - throw await de_ServiceNotSupportedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateUserCommand */ @@ -4491,7 +3787,7 @@ export const de_CreateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4503,47 +3799,6 @@ export const de_CreateUserCommand = async ( return response; }; -/** - * deserializeAws_queryCreateUserCommandError - */ -const de_CreateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateVirtualMFADeviceCommand */ @@ -4552,7 +3807,7 @@ export const de_CreateVirtualMFADeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVirtualMFADeviceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4564,44 +3819,6 @@ export const de_CreateVirtualMFADeviceCommand = async ( return response; }; -/** - * deserializeAws_queryCreateVirtualMFADeviceCommandError - */ -const de_CreateVirtualMFADeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeactivateMFADeviceCommand */ @@ -4610,7 +3827,7 @@ export const de_DeactivateMFADeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeactivateMFADeviceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeactivateMFADeviceCommandOutput = { @@ -4620,52 +3837,14 @@ export const de_DeactivateMFADeviceCommand = async ( }; /** - * deserializeAws_queryDeactivateMFADeviceCommandError - */ -const de_DeactivateMFADeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityTemporarilyUnmodifiable": - case "com.amazonaws.iam#EntityTemporarilyUnmodifiableException": - throw await de_EntityTemporarilyUnmodifiableExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteAccessKeyCommand + * deserializeAws_queryDeleteAccessKeyCommand */ export const de_DeleteAccessKeyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAccessKeyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteAccessKeyCommandOutput = { @@ -4674,38 +3853,6 @@ export const de_DeleteAccessKeyCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteAccessKeyCommandError - */ -const de_DeleteAccessKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteAccountAliasCommand */ @@ -4714,7 +3861,7 @@ export const de_DeleteAccountAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAccountAliasCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteAccountAliasCommandOutput = { @@ -4723,41 +3870,6 @@ export const de_DeleteAccountAliasCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteAccountAliasCommandError - */ -const de_DeleteAccountAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteAccountPasswordPolicyCommand */ @@ -4766,7 +3878,7 @@ export const de_DeleteAccountPasswordPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAccountPasswordPolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteAccountPasswordPolicyCommandOutput = { @@ -4775,38 +3887,6 @@ export const de_DeleteAccountPasswordPolicyCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteAccountPasswordPolicyCommandError - */ -const de_DeleteAccountPasswordPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteGroupCommand */ @@ -4815,7 +3895,7 @@ export const de_DeleteGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteGroupCommandOutput = { @@ -4824,41 +3904,6 @@ export const de_DeleteGroupCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteGroupCommandError - */ -const de_DeleteGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeleteConflict": - case "com.amazonaws.iam#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteGroupPolicyCommand */ @@ -4867,7 +3912,7 @@ export const de_DeleteGroupPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteGroupPolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteGroupPolicyCommandOutput = { @@ -4877,577 +3922,396 @@ export const de_DeleteGroupPolicyCommand = async ( }; /** - * deserializeAws_queryDeleteGroupPolicyCommandError + * deserializeAws_queryDeleteInstanceProfileCommand */ -const de_DeleteGroupPolicyCommandError = async ( +export const de_DeleteInstanceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteInstanceProfileCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryDeleteInstanceProfileCommand + * deserializeAws_queryDeleteLoginProfileCommand */ -export const de_DeleteInstanceProfileCommand = async ( +export const de_DeleteLoginProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteInstanceProfileCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteInstanceProfileCommandOutput = { + const response: DeleteLoginProfileCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryDeleteInstanceProfileCommandError + * deserializeAws_queryDeleteOpenIDConnectProviderCommand */ -const de_DeleteInstanceProfileCommandError = async ( +export const de_DeleteOpenIDConnectProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeleteConflict": - case "com.amazonaws.iam#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteOpenIDConnectProviderCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryDeleteLoginProfileCommand + * deserializeAws_queryDeletePolicyCommand */ -export const de_DeleteLoginProfileCommand = async ( +export const de_DeletePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteLoginProfileCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteLoginProfileCommandOutput = { + const response: DeletePolicyCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryDeleteLoginProfileCommandError + * deserializeAws_queryDeletePolicyVersionCommand */ -const de_DeleteLoginProfileCommandError = async ( +export const de_DeletePolicyVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityTemporarilyUnmodifiable": - case "com.amazonaws.iam#EntityTemporarilyUnmodifiableException": - throw await de_EntityTemporarilyUnmodifiableExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeletePolicyVersionCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryDeleteOpenIDConnectProviderCommand + * deserializeAws_queryDeleteRoleCommand */ -export const de_DeleteOpenIDConnectProviderCommand = async ( +export const de_DeleteRoleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteOpenIDConnectProviderCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteOpenIDConnectProviderCommandOutput = { + const response: DeleteRoleCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryDeleteOpenIDConnectProviderCommandError + * deserializeAws_queryDeleteRolePermissionsBoundaryCommand */ -const de_DeleteOpenIDConnectProviderCommandError = async ( +export const de_DeleteRolePermissionsBoundaryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteRolePermissionsBoundaryCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryDeletePolicyCommand + * deserializeAws_queryDeleteRolePolicyCommand */ -export const de_DeletePolicyCommand = async ( +export const de_DeleteRolePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeletePolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeletePolicyCommandOutput = { + const response: DeleteRolePolicyCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryDeletePolicyCommandError + * deserializeAws_queryDeleteSAMLProviderCommand */ -const de_DeletePolicyCommandError = async ( +export const de_DeleteSAMLProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeleteConflict": - case "com.amazonaws.iam#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteSAMLProviderCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryDeletePolicyVersionCommand + * deserializeAws_queryDeleteServerCertificateCommand */ -export const de_DeletePolicyVersionCommand = async ( +export const de_DeleteServerCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeletePolicyVersionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeletePolicyVersionCommandOutput = { + const response: DeleteServerCertificateCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryDeletePolicyVersionCommandError + * deserializeAws_queryDeleteServiceLinkedRoleCommand */ -const de_DeletePolicyVersionCommandError = async ( +export const de_DeleteServiceLinkedRoleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeleteConflict": - case "com.amazonaws.iam#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteServiceLinkedRoleResponse(data.DeleteServiceLinkedRoleResult, context); + const response: DeleteServiceLinkedRoleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteRoleCommand + * deserializeAws_queryDeleteServiceSpecificCredentialCommand */ -export const de_DeleteRoleCommand = async ( +export const de_DeleteServiceSpecificCredentialCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRoleCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteRoleCommandOutput = { + const response: DeleteServiceSpecificCredentialCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryDeleteRoleCommandError - */ -const de_DeleteRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "DeleteConflict": - case "com.amazonaws.iam#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "UnmodifiableEntity": - case "com.amazonaws.iam#UnmodifiableEntityException": - throw await de_UnmodifiableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteRolePermissionsBoundaryCommand + * deserializeAws_queryDeleteSigningCertificateCommand */ -export const de_DeleteRolePermissionsBoundaryCommand = async ( +export const de_DeleteSigningCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRolePermissionsBoundaryCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteRolePermissionsBoundaryCommandOutput = { + const response: DeleteSigningCertificateCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryDeleteRolePermissionsBoundaryCommandError + * deserializeAws_queryDeleteSSHPublicKeyCommand */ -const de_DeleteRolePermissionsBoundaryCommandError = async ( +export const de_DeleteSSHPublicKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "UnmodifiableEntity": - case "com.amazonaws.iam#UnmodifiableEntityException": - throw await de_UnmodifiableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteSSHPublicKeyCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryDeleteRolePolicyCommand + * deserializeAws_queryDeleteUserCommand */ -export const de_DeleteRolePolicyCommand = async ( +export const de_DeleteUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRolePolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteRolePolicyCommandOutput = { + const response: DeleteUserCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryDeleteRolePolicyCommandError + * deserializeAws_queryDeleteUserPermissionsBoundaryCommand */ -const de_DeleteRolePolicyCommandError = async ( +export const de_DeleteUserPermissionsBoundaryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "UnmodifiableEntity": - case "com.amazonaws.iam#UnmodifiableEntityException": - throw await de_UnmodifiableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteUserPermissionsBoundaryCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryDeleteSAMLProviderCommand + * deserializeAws_queryDeleteUserPolicyCommand */ -export const de_DeleteSAMLProviderCommand = async ( +export const de_DeleteUserPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSAMLProviderCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteSAMLProviderCommandOutput = { + const response: DeleteUserPolicyCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryDeleteSAMLProviderCommandError + * deserializeAws_queryDeleteVirtualMFADeviceCommand */ -const de_DeleteSAMLProviderCommandError = async ( +export const de_DeleteVirtualMFADeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeleteVirtualMFADeviceCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_queryDetachGroupPolicyCommand + */ +export const de_DetachGroupPolicyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DetachGroupPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryDeleteServerCertificateCommand + * deserializeAws_queryDetachRolePolicyCommand */ -export const de_DeleteServerCertificateCommand = async ( +export const de_DetachRolePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteServerCertificateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteServerCertificateCommandOutput = { + const response: DetachRolePolicyCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryDeleteServerCertificateCommandError + * deserializeAws_queryDetachUserPolicyCommand */ -const de_DeleteServerCertificateCommandError = async ( +export const de_DetachUserPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DetachUserPolicyCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeleteConflict": - case "com.amazonaws.iam#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_queryEnableMFADeviceCommand + */ +export const de_EnableMFADeviceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: EnableMFADeviceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryDeleteServiceLinkedRoleCommand + * deserializeAws_queryGenerateCredentialReportCommand */ -export const de_DeleteServiceLinkedRoleCommand = async ( +export const de_GenerateCredentialReportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteServiceLinkedRoleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteServiceLinkedRoleResponse(data.DeleteServiceLinkedRoleResult, context); - const response: DeleteServiceLinkedRoleCommandOutput = { + contents = de_GenerateCredentialReportResponse(data.GenerateCredentialReportResult, context); + const response: GenerateCredentialReportCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5455,614 +4319,482 @@ export const de_DeleteServiceLinkedRoleCommand = async ( }; /** - * deserializeAws_queryDeleteServiceLinkedRoleCommandError + * deserializeAws_queryGenerateOrganizationsAccessReportCommand */ -const de_DeleteServiceLinkedRoleCommandError = async ( +export const de_GenerateOrganizationsAccessReportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GenerateOrganizationsAccessReportResponse(data.GenerateOrganizationsAccessReportResult, context); + const response: GenerateOrganizationsAccessReportCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteServiceSpecificCredentialCommand + * deserializeAws_queryGenerateServiceLastAccessedDetailsCommand */ -export const de_DeleteServiceSpecificCredentialCommand = async ( +export const de_GenerateServiceLastAccessedDetailsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteServiceSpecificCredentialCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteServiceSpecificCredentialCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GenerateServiceLastAccessedDetailsResponse(data.GenerateServiceLastAccessedDetailsResult, context); + const response: GenerateServiceLastAccessedDetailsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteServiceSpecificCredentialCommandError + * deserializeAws_queryGetAccessKeyLastUsedCommand */ -const de_DeleteServiceSpecificCredentialCommandError = async ( +export const de_GetAccessKeyLastUsedCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetAccessKeyLastUsedResponse(data.GetAccessKeyLastUsedResult, context); + const response: GetAccessKeyLastUsedCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteSigningCertificateCommand + * deserializeAws_queryGetAccountAuthorizationDetailsCommand */ -export const de_DeleteSigningCertificateCommand = async ( +export const de_GetAccountAuthorizationDetailsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSigningCertificateCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteSigningCertificateCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetAccountAuthorizationDetailsResponse(data.GetAccountAuthorizationDetailsResult, context); + const response: GetAccountAuthorizationDetailsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteSigningCertificateCommandError + * deserializeAws_queryGetAccountPasswordPolicyCommand */ -const de_DeleteSigningCertificateCommandError = async ( +export const de_GetAccountPasswordPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetAccountPasswordPolicyResponse(data.GetAccountPasswordPolicyResult, context); + const response: GetAccountPasswordPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteSSHPublicKeyCommand + * deserializeAws_queryGetAccountSummaryCommand */ -export const de_DeleteSSHPublicKeyCommand = async ( +export const de_GetAccountSummaryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSSHPublicKeyCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteSSHPublicKeyCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetAccountSummaryResponse(data.GetAccountSummaryResult, context); + const response: GetAccountSummaryCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteSSHPublicKeyCommandError + * deserializeAws_queryGetContextKeysForCustomPolicyCommand */ -const de_DeleteSSHPublicKeyCommandError = async ( +export const de_GetContextKeysForCustomPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetContextKeysForPolicyResponse(data.GetContextKeysForCustomPolicyResult, context); + const response: GetContextKeysForCustomPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteUserCommand + * deserializeAws_queryGetContextKeysForPrincipalPolicyCommand */ -export const de_DeleteUserCommand = async ( +export const de_GetContextKeysForPrincipalPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteUserCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteUserCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetContextKeysForPolicyResponse(data.GetContextKeysForPrincipalPolicyResult, context); + const response: GetContextKeysForPrincipalPolicyCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteUserCommandError + * deserializeAws_queryGetCredentialReportCommand */ -const de_DeleteUserCommandError = async ( +export const de_GetCredentialReportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "DeleteConflict": - case "com.amazonaws.iam#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetCredentialReportResponse(data.GetCredentialReportResult, context); + const response: GetCredentialReportCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteUserPermissionsBoundaryCommand + * deserializeAws_queryGetGroupCommand */ -export const de_DeleteUserPermissionsBoundaryCommand = async ( +export const de_GetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteUserPermissionsBoundaryCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteUserPermissionsBoundaryCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetGroupResponse(data.GetGroupResult, context); + const response: GetGroupCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteUserPermissionsBoundaryCommandError + * deserializeAws_queryGetGroupPolicyCommand */ -const de_DeleteUserPermissionsBoundaryCommandError = async ( +export const de_GetGroupPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetGroupPolicyResponse(data.GetGroupPolicyResult, context); + const response: GetGroupPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteUserPolicyCommand + * deserializeAws_queryGetInstanceProfileCommand */ -export const de_DeleteUserPolicyCommand = async ( +export const de_GetInstanceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteUserPolicyCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteUserPolicyCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetInstanceProfileResponse(data.GetInstanceProfileResult, context); + const response: GetInstanceProfileCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteUserPolicyCommandError + * deserializeAws_queryGetLoginProfileCommand */ -const de_DeleteUserPolicyCommandError = async ( +export const de_GetLoginProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetLoginProfileResponse(data.GetLoginProfileResult, context); + const response: GetLoginProfileCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteVirtualMFADeviceCommand + * deserializeAws_queryGetMFADeviceCommand */ -export const de_DeleteVirtualMFADeviceCommand = async ( +export const de_GetMFADeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteVirtualMFADeviceCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteVirtualMFADeviceCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetMFADeviceResponse(data.GetMFADeviceResult, context); + const response: GetMFADeviceCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteVirtualMFADeviceCommandError + * deserializeAws_queryGetOpenIDConnectProviderCommand */ -const de_DeleteVirtualMFADeviceCommandError = async ( +export const de_GetOpenIDConnectProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetOpenIDConnectProviderResponse(data.GetOpenIDConnectProviderResult, context); + const response: GetOpenIDConnectProviderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "DeleteConflict": - case "com.amazonaws.iam#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + return response; }; /** - * deserializeAws_queryDetachGroupPolicyCommand + * deserializeAws_queryGetOrganizationsAccessReportCommand */ -export const de_DetachGroupPolicyCommand = async ( +export const de_GetOrganizationsAccessReportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DetachGroupPolicyCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DetachGroupPolicyCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetOrganizationsAccessReportResponse(data.GetOrganizationsAccessReportResult, context); + const response: GetOrganizationsAccessReportCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDetachGroupPolicyCommandError + * deserializeAws_queryGetPolicyCommand */ -const de_DetachGroupPolicyCommandError = async ( +export const de_GetPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetPolicyResponse(data.GetPolicyResult, context); + const response: GetPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDetachRolePolicyCommand + * deserializeAws_queryGetPolicyVersionCommand */ -export const de_DetachRolePolicyCommand = async ( +export const de_GetPolicyVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DetachRolePolicyCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DetachRolePolicyCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetPolicyVersionResponse(data.GetPolicyVersionResult, context); + const response: GetPolicyVersionCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDetachRolePolicyCommandError + * deserializeAws_queryGetRoleCommand */ -const de_DetachRolePolicyCommandError = async ( +export const de_GetRoleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "UnmodifiableEntity": - case "com.amazonaws.iam#UnmodifiableEntityException": - throw await de_UnmodifiableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetRoleResponse(data.GetRoleResult, context); + const response: GetRoleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDetachUserPolicyCommand + * deserializeAws_queryGetRolePolicyCommand */ -export const de_DetachUserPolicyCommand = async ( +export const de_GetRolePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DetachUserPolicyCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DetachUserPolicyCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetRolePolicyResponse(data.GetRolePolicyResult, context); + const response: GetRolePolicyCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDetachUserPolicyCommandError + * deserializeAws_queryGetSAMLProviderCommand */ -const de_DetachUserPolicyCommandError = async ( +export const de_GetSAMLProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetSAMLProviderResponse(data.GetSAMLProviderResult, context); + const response: GetSAMLProviderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryEnableMFADeviceCommand + * deserializeAws_queryGetServerCertificateCommand */ -export const de_EnableMFADeviceCommand = async ( +export const de_GetServerCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_EnableMFADeviceCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: EnableMFADeviceCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetServerCertificateResponse(data.GetServerCertificateResult, context); + const response: GetServerCertificateCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryEnableMFADeviceCommandError + * deserializeAws_queryGetServiceLastAccessedDetailsCommand */ -const de_EnableMFADeviceCommandError = async ( +export const de_GetServiceLastAccessedDetailsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "EntityTemporarilyUnmodifiable": - case "com.amazonaws.iam#EntityTemporarilyUnmodifiableException": - throw await de_EntityTemporarilyUnmodifiableExceptionRes(parsedOutput, context); - case "InvalidAuthenticationCode": - case "com.amazonaws.iam#InvalidAuthenticationCodeException": - throw await de_InvalidAuthenticationCodeExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetServiceLastAccessedDetailsResponse(data.GetServiceLastAccessedDetailsResult, context); + const response: GetServiceLastAccessedDetailsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGenerateCredentialReportCommand + * deserializeAws_queryGetServiceLastAccessedDetailsWithEntitiesCommand */ -export const de_GenerateCredentialReportCommand = async ( +export const de_GetServiceLastAccessedDetailsWithEntitiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GenerateCredentialReportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GenerateCredentialReportResponse(data.GenerateCredentialReportResult, context); - const response: GenerateCredentialReportCommandOutput = { + contents = de_GetServiceLastAccessedDetailsWithEntitiesResponse( + data.GetServiceLastAccessedDetailsWithEntitiesResult, + context + ); + const response: GetServiceLastAccessedDetailsWithEntitiesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6070,48 +4802,19 @@ export const de_GenerateCredentialReportCommand = async ( }; /** - * deserializeAws_queryGenerateCredentialReportCommandError + * deserializeAws_queryGetServiceLinkedRoleDeletionStatusCommand */ -const de_GenerateCredentialReportCommandError = async ( +export const de_GetServiceLinkedRoleDeletionStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGenerateOrganizationsAccessReportCommand - */ -export const de_GenerateOrganizationsAccessReportCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GenerateOrganizationsAccessReportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GenerateOrganizationsAccessReportResponse(data.GenerateOrganizationsAccessReportResult, context); - const response: GenerateOrganizationsAccessReportCommandOutput = { + contents = de_GetServiceLinkedRoleDeletionStatusResponse(data.GetServiceLinkedRoleDeletionStatusResult, context); + const response: GetServiceLinkedRoleDeletionStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6119,45 +4822,39 @@ export const de_GenerateOrganizationsAccessReportCommand = async ( }; /** - * deserializeAws_queryGenerateOrganizationsAccessReportCommandError + * deserializeAws_queryGetSSHPublicKeyCommand */ -const de_GenerateOrganizationsAccessReportCommandError = async ( +export const de_GetSSHPublicKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ReportGenerationLimitExceeded": - case "com.amazonaws.iam#ReportGenerationLimitExceededException": - throw await de_ReportGenerationLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetSSHPublicKeyResponse(data.GetSSHPublicKeyResult, context); + const response: GetSSHPublicKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGenerateServiceLastAccessedDetailsCommand + * deserializeAws_queryGetUserCommand */ -export const de_GenerateServiceLastAccessedDetailsCommand = async ( +export const de_GetUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GenerateServiceLastAccessedDetailsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GenerateServiceLastAccessedDetailsResponse(data.GenerateServiceLastAccessedDetailsResult, context); - const response: GenerateServiceLastAccessedDetailsCommandOutput = { + contents = de_GetUserResponse(data.GetUserResult, context); + const response: GetUserCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6165,48 +4862,39 @@ export const de_GenerateServiceLastAccessedDetailsCommand = async ( }; /** - * deserializeAws_queryGenerateServiceLastAccessedDetailsCommandError + * deserializeAws_queryGetUserPolicyCommand */ -const de_GenerateServiceLastAccessedDetailsCommandError = async ( +export const de_GetUserPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetUserPolicyResponse(data.GetUserPolicyResult, context); + const response: GetUserPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGetAccessKeyLastUsedCommand + * deserializeAws_queryListAccessKeysCommand */ -export const de_GetAccessKeyLastUsedCommand = async ( +export const de_ListAccessKeysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetAccessKeyLastUsedCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetAccessKeyLastUsedResponse(data.GetAccessKeyLastUsedResult, context); - const response: GetAccessKeyLastUsedCommandOutput = { + contents = de_ListAccessKeysResponse(data.ListAccessKeysResult, context); + const response: ListAccessKeysCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6214,39 +4902,39 @@ export const de_GetAccessKeyLastUsedCommand = async ( }; /** - * deserializeAws_queryGetAccessKeyLastUsedCommandError + * deserializeAws_queryListAccountAliasesCommand */ -const de_GetAccessKeyLastUsedCommandError = async ( +export const de_ListAccountAliasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListAccountAliasesResponse(data.ListAccountAliasesResult, context); + const response: ListAccountAliasesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** - * deserializeAws_queryGetAccountAuthorizationDetailsCommand + * deserializeAws_queryListAttachedGroupPoliciesCommand */ -export const de_GetAccountAuthorizationDetailsCommand = async ( +export const de_ListAttachedGroupPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetAccountAuthorizationDetailsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetAccountAuthorizationDetailsResponse(data.GetAccountAuthorizationDetailsResult, context); - const response: GetAccountAuthorizationDetailsCommandOutput = { + contents = de_ListAttachedGroupPoliciesResponse(data.ListAttachedGroupPoliciesResult, context); + const response: ListAttachedGroupPoliciesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6254,45 +4942,39 @@ export const de_GetAccountAuthorizationDetailsCommand = async ( }; /** - * deserializeAws_queryGetAccountAuthorizationDetailsCommandError + * deserializeAws_queryListAttachedRolePoliciesCommand */ -const de_GetAccountAuthorizationDetailsCommandError = async ( +export const de_ListAttachedRolePoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListAttachedRolePoliciesResponse(data.ListAttachedRolePoliciesResult, context); + const response: ListAttachedRolePoliciesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGetAccountPasswordPolicyCommand + * deserializeAws_queryListAttachedUserPoliciesCommand */ -export const de_GetAccountPasswordPolicyCommand = async ( +export const de_ListAttachedUserPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetAccountPasswordPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetAccountPasswordPolicyResponse(data.GetAccountPasswordPolicyResult, context); - const response: GetAccountPasswordPolicyCommandOutput = { + contents = de_ListAttachedUserPoliciesResponse(data.ListAttachedUserPoliciesResult, context); + const response: ListAttachedUserPoliciesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6300,48 +4982,39 @@ export const de_GetAccountPasswordPolicyCommand = async ( }; /** - * deserializeAws_queryGetAccountPasswordPolicyCommandError + * deserializeAws_queryListEntitiesForPolicyCommand */ -const de_GetAccountPasswordPolicyCommandError = async ( +export const de_ListEntitiesForPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListEntitiesForPolicyResponse(data.ListEntitiesForPolicyResult, context); + const response: ListEntitiesForPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGetAccountSummaryCommand + * deserializeAws_queryListGroupPoliciesCommand */ -export const de_GetAccountSummaryCommand = async ( +export const de_ListGroupPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetAccountSummaryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetAccountSummaryResponse(data.GetAccountSummaryResult, context); - const response: GetAccountSummaryCommandOutput = { + contents = de_ListGroupPoliciesResponse(data.ListGroupPoliciesResult, context); + const response: ListGroupPoliciesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6349,45 +5022,39 @@ export const de_GetAccountSummaryCommand = async ( }; /** - * deserializeAws_queryGetAccountSummaryCommandError + * deserializeAws_queryListGroupsCommand */ -const de_GetAccountSummaryCommandError = async ( +export const de_ListGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListGroupsResponse(data.ListGroupsResult, context); + const response: ListGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGetContextKeysForCustomPolicyCommand + * deserializeAws_queryListGroupsForUserCommand */ -export const de_GetContextKeysForCustomPolicyCommand = async ( +export const de_ListGroupsForUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetContextKeysForCustomPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetContextKeysForPolicyResponse(data.GetContextKeysForCustomPolicyResult, context); - const response: GetContextKeysForCustomPolicyCommandOutput = { + contents = de_ListGroupsForUserResponse(data.ListGroupsForUserResult, context); + const response: ListGroupsForUserCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6395,45 +5062,39 @@ export const de_GetContextKeysForCustomPolicyCommand = async ( }; /** - * deserializeAws_queryGetContextKeysForCustomPolicyCommandError + * deserializeAws_queryListInstanceProfilesCommand */ -const de_GetContextKeysForCustomPolicyCommandError = async ( +export const de_ListInstanceProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListInstanceProfilesResponse(data.ListInstanceProfilesResult, context); + const response: ListInstanceProfilesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGetContextKeysForPrincipalPolicyCommand + * deserializeAws_queryListInstanceProfilesForRoleCommand */ -export const de_GetContextKeysForPrincipalPolicyCommand = async ( +export const de_ListInstanceProfilesForRoleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetContextKeysForPrincipalPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetContextKeysForPolicyResponse(data.GetContextKeysForPrincipalPolicyResult, context); - const response: GetContextKeysForPrincipalPolicyCommandOutput = { + contents = de_ListInstanceProfilesForRoleResponse(data.ListInstanceProfilesForRoleResult, context); + const response: ListInstanceProfilesForRoleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6441,48 +5102,39 @@ export const de_GetContextKeysForPrincipalPolicyCommand = async ( }; /** - * deserializeAws_queryGetContextKeysForPrincipalPolicyCommandError + * deserializeAws_queryListInstanceProfileTagsCommand */ -const de_GetContextKeysForPrincipalPolicyCommandError = async ( +export const de_ListInstanceProfileTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListInstanceProfileTagsResponse(data.ListInstanceProfileTagsResult, context); + const response: ListInstanceProfileTagsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGetCredentialReportCommand + * deserializeAws_queryListMFADevicesCommand */ -export const de_GetCredentialReportCommand = async ( +export const de_ListMFADevicesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetCredentialReportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetCredentialReportResponse(data.GetCredentialReportResult, context); - const response: GetCredentialReportCommandOutput = { + contents = de_ListMFADevicesResponse(data.ListMFADevicesResult, context); + const response: ListMFADevicesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6490,54 +5142,39 @@ export const de_GetCredentialReportCommand = async ( }; /** - * deserializeAws_queryGetCredentialReportCommandError + * deserializeAws_queryListMFADeviceTagsCommand */ -const de_GetCredentialReportCommandError = async ( +export const de_ListMFADeviceTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ReportExpired": - case "com.amazonaws.iam#CredentialReportExpiredException": - throw await de_CredentialReportExpiredExceptionRes(parsedOutput, context); - case "ReportInProgress": - case "com.amazonaws.iam#CredentialReportNotReadyException": - throw await de_CredentialReportNotReadyExceptionRes(parsedOutput, context); - case "ReportNotPresent": - case "com.amazonaws.iam#CredentialReportNotPresentException": - throw await de_CredentialReportNotPresentExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListMFADeviceTagsResponse(data.ListMFADeviceTagsResult, context); + const response: ListMFADeviceTagsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGetGroupCommand + * deserializeAws_queryListOpenIDConnectProvidersCommand */ -export const de_GetGroupCommand = async ( +export const de_ListOpenIDConnectProvidersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetGroupResponse(data.GetGroupResult, context); - const response: GetGroupCommandOutput = { + contents = de_ListOpenIDConnectProvidersResponse(data.ListOpenIDConnectProvidersResult, context); + const response: ListOpenIDConnectProvidersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6545,48 +5182,39 @@ export const de_GetGroupCommand = async ( }; /** - * deserializeAws_queryGetGroupCommandError + * deserializeAws_queryListOpenIDConnectProviderTagsCommand */ -const de_GetGroupCommandError = async ( +export const de_ListOpenIDConnectProviderTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListOpenIDConnectProviderTagsResponse(data.ListOpenIDConnectProviderTagsResult, context); + const response: ListOpenIDConnectProviderTagsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGetGroupPolicyCommand + * deserializeAws_queryListPoliciesCommand */ -export const de_GetGroupPolicyCommand = async ( +export const de_ListPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetGroupPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetGroupPolicyResponse(data.GetGroupPolicyResult, context); - const response: GetGroupPolicyCommandOutput = { + contents = de_ListPoliciesResponse(data.ListPoliciesResult, context); + const response: ListPoliciesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6594,48 +5222,39 @@ export const de_GetGroupPolicyCommand = async ( }; /** - * deserializeAws_queryGetGroupPolicyCommandError + * deserializeAws_queryListPoliciesGrantingServiceAccessCommand */ -const de_GetGroupPolicyCommandError = async ( +export const de_ListPoliciesGrantingServiceAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListPoliciesGrantingServiceAccessResponse(data.ListPoliciesGrantingServiceAccessResult, context); + const response: ListPoliciesGrantingServiceAccessCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGetInstanceProfileCommand + * deserializeAws_queryListPolicyTagsCommand */ -export const de_GetInstanceProfileCommand = async ( +export const de_ListPolicyTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetInstanceProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetInstanceProfileResponse(data.GetInstanceProfileResult, context); - const response: GetInstanceProfileCommandOutput = { + contents = de_ListPolicyTagsResponse(data.ListPolicyTagsResult, context); + const response: ListPolicyTagsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6643,48 +5262,39 @@ export const de_GetInstanceProfileCommand = async ( }; /** - * deserializeAws_queryGetInstanceProfileCommandError + * deserializeAws_queryListPolicyVersionsCommand */ -const de_GetInstanceProfileCommandError = async ( +export const de_ListPolicyVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListPolicyVersionsResponse(data.ListPolicyVersionsResult, context); + const response: ListPolicyVersionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGetLoginProfileCommand + * deserializeAws_queryListRolePoliciesCommand */ -export const de_GetLoginProfileCommand = async ( +export const de_ListRolePoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetLoginProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetLoginProfileResponse(data.GetLoginProfileResult, context); - const response: GetLoginProfileCommandOutput = { + contents = de_ListRolePoliciesResponse(data.ListRolePoliciesResult, context); + const response: ListRolePoliciesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6692,48 +5302,19 @@ export const de_GetLoginProfileCommand = async ( }; /** - * deserializeAws_queryGetLoginProfileCommandError + * deserializeAws_queryListRolesCommand */ -const de_GetLoginProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetMFADeviceCommand - */ -export const de_GetMFADeviceCommand = async ( +export const de_ListRolesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetMFADeviceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetMFADeviceResponse(data.GetMFADeviceResult, context); - const response: GetMFADeviceCommandOutput = { + contents = de_ListRolesResponse(data.ListRolesResult, context); + const response: ListRolesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6741,48 +5322,19 @@ export const de_GetMFADeviceCommand = async ( }; /** - * deserializeAws_queryGetMFADeviceCommandError - */ -const de_GetMFADeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetOpenIDConnectProviderCommand + * deserializeAws_queryListRoleTagsCommand */ -export const de_GetOpenIDConnectProviderCommand = async ( +export const de_ListRoleTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetOpenIDConnectProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetOpenIDConnectProviderResponse(data.GetOpenIDConnectProviderResult, context); - const response: GetOpenIDConnectProviderCommandOutput = { + contents = de_ListRoleTagsResponse(data.ListRoleTagsResult, context); + const response: ListRoleTagsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6790,51 +5342,19 @@ export const de_GetOpenIDConnectProviderCommand = async ( }; /** - * deserializeAws_queryGetOpenIDConnectProviderCommandError - */ -const de_GetOpenIDConnectProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetOrganizationsAccessReportCommand + * deserializeAws_queryListSAMLProvidersCommand */ -export const de_GetOrganizationsAccessReportCommand = async ( +export const de_ListSAMLProvidersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetOrganizationsAccessReportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetOrganizationsAccessReportResponse(data.GetOrganizationsAccessReportResult, context); - const response: GetOrganizationsAccessReportCommandOutput = { + contents = de_ListSAMLProvidersResponse(data.ListSAMLProvidersResult, context); + const response: ListSAMLProvidersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6842,45 +5362,19 @@ export const de_GetOrganizationsAccessReportCommand = async ( }; /** - * deserializeAws_queryGetOrganizationsAccessReportCommandError - */ -const de_GetOrganizationsAccessReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetPolicyCommand + * deserializeAws_queryListSAMLProviderTagsCommand */ -export const de_GetPolicyCommand = async ( +export const de_ListSAMLProviderTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetPolicyResponse(data.GetPolicyResult, context); - const response: GetPolicyCommandOutput = { + contents = de_ListSAMLProviderTagsResponse(data.ListSAMLProviderTagsResult, context); + const response: ListSAMLProviderTagsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6888,51 +5382,19 @@ export const de_GetPolicyCommand = async ( }; /** - * deserializeAws_queryGetPolicyCommandError - */ -const de_GetPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetPolicyVersionCommand + * deserializeAws_queryListServerCertificatesCommand */ -export const de_GetPolicyVersionCommand = async ( +export const de_ListServerCertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetPolicyVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetPolicyVersionResponse(data.GetPolicyVersionResult, context); - const response: GetPolicyVersionCommandOutput = { + contents = de_ListServerCertificatesResponse(data.ListServerCertificatesResult, context); + const response: ListServerCertificatesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6940,51 +5402,19 @@ export const de_GetPolicyVersionCommand = async ( }; /** - * deserializeAws_queryGetPolicyVersionCommandError - */ -const de_GetPolicyVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetRoleCommand + * deserializeAws_queryListServerCertificateTagsCommand */ -export const de_GetRoleCommand = async ( +export const de_ListServerCertificateTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRoleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetRoleResponse(data.GetRoleResult, context); - const response: GetRoleCommandOutput = { + contents = de_ListServerCertificateTagsResponse(data.ListServerCertificateTagsResult, context); + const response: ListServerCertificateTagsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6992,4415 +5422,909 @@ export const de_GetRoleCommand = async ( }; /** - * deserializeAws_queryGetRoleCommandError - */ -const de_GetRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetRolePolicyCommand + * deserializeAws_queryListServiceSpecificCredentialsCommand */ -export const de_GetRolePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRolePolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetRolePolicyResponse(data.GetRolePolicyResult, context); - const response: GetRolePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetRolePolicyCommandError - */ -const de_GetRolePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetSAMLProviderCommand - */ -export const de_GetSAMLProviderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSAMLProviderCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetSAMLProviderResponse(data.GetSAMLProviderResult, context); - const response: GetSAMLProviderCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetSAMLProviderCommandError - */ -const de_GetSAMLProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetServerCertificateCommand - */ -export const de_GetServerCertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetServerCertificateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetServerCertificateResponse(data.GetServerCertificateResult, context); - const response: GetServerCertificateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetServerCertificateCommandError - */ -const de_GetServerCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetServiceLastAccessedDetailsCommand - */ -export const de_GetServiceLastAccessedDetailsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetServiceLastAccessedDetailsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetServiceLastAccessedDetailsResponse(data.GetServiceLastAccessedDetailsResult, context); - const response: GetServiceLastAccessedDetailsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetServiceLastAccessedDetailsCommandError - */ -const de_GetServiceLastAccessedDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetServiceLastAccessedDetailsWithEntitiesCommand - */ -export const de_GetServiceLastAccessedDetailsWithEntitiesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetServiceLastAccessedDetailsWithEntitiesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetServiceLastAccessedDetailsWithEntitiesResponse( - data.GetServiceLastAccessedDetailsWithEntitiesResult, - context - ); - const response: GetServiceLastAccessedDetailsWithEntitiesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetServiceLastAccessedDetailsWithEntitiesCommandError - */ -const de_GetServiceLastAccessedDetailsWithEntitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetServiceLinkedRoleDeletionStatusCommand - */ -export const de_GetServiceLinkedRoleDeletionStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetServiceLinkedRoleDeletionStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetServiceLinkedRoleDeletionStatusResponse(data.GetServiceLinkedRoleDeletionStatusResult, context); - const response: GetServiceLinkedRoleDeletionStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetServiceLinkedRoleDeletionStatusCommandError - */ -const de_GetServiceLinkedRoleDeletionStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetSSHPublicKeyCommand - */ -export const de_GetSSHPublicKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSSHPublicKeyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetSSHPublicKeyResponse(data.GetSSHPublicKeyResult, context); - const response: GetSSHPublicKeyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetSSHPublicKeyCommandError - */ -const de_GetSSHPublicKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "UnrecognizedPublicKeyEncoding": - case "com.amazonaws.iam#UnrecognizedPublicKeyEncodingException": - throw await de_UnrecognizedPublicKeyEncodingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetUserCommand - */ -export const de_GetUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetUserCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetUserResponse(data.GetUserResult, context); - const response: GetUserCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetUserCommandError - */ -const de_GetUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetUserPolicyCommand - */ -export const de_GetUserPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetUserPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetUserPolicyResponse(data.GetUserPolicyResult, context); - const response: GetUserPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetUserPolicyCommandError - */ -const de_GetUserPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListAccessKeysCommand - */ -export const de_ListAccessKeysCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAccessKeysCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListAccessKeysResponse(data.ListAccessKeysResult, context); - const response: ListAccessKeysCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListAccessKeysCommandError - */ -const de_ListAccessKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListAccountAliasesCommand - */ -export const de_ListAccountAliasesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAccountAliasesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListAccountAliasesResponse(data.ListAccountAliasesResult, context); - const response: ListAccountAliasesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListAccountAliasesCommandError - */ -const de_ListAccountAliasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListAttachedGroupPoliciesCommand - */ -export const de_ListAttachedGroupPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAttachedGroupPoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListAttachedGroupPoliciesResponse(data.ListAttachedGroupPoliciesResult, context); - const response: ListAttachedGroupPoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListAttachedGroupPoliciesCommandError - */ -const de_ListAttachedGroupPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListAttachedRolePoliciesCommand - */ -export const de_ListAttachedRolePoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAttachedRolePoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListAttachedRolePoliciesResponse(data.ListAttachedRolePoliciesResult, context); - const response: ListAttachedRolePoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListAttachedRolePoliciesCommandError - */ -const de_ListAttachedRolePoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListAttachedUserPoliciesCommand - */ -export const de_ListAttachedUserPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAttachedUserPoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListAttachedUserPoliciesResponse(data.ListAttachedUserPoliciesResult, context); - const response: ListAttachedUserPoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListAttachedUserPoliciesCommandError - */ -const de_ListAttachedUserPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListEntitiesForPolicyCommand - */ -export const de_ListEntitiesForPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListEntitiesForPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListEntitiesForPolicyResponse(data.ListEntitiesForPolicyResult, context); - const response: ListEntitiesForPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListEntitiesForPolicyCommandError - */ -const de_ListEntitiesForPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListGroupPoliciesCommand - */ -export const de_ListGroupPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListGroupPoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListGroupPoliciesResponse(data.ListGroupPoliciesResult, context); - const response: ListGroupPoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListGroupPoliciesCommandError - */ -const de_ListGroupPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListGroupsCommand - */ -export const de_ListGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListGroupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListGroupsResponse(data.ListGroupsResult, context); - const response: ListGroupsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListGroupsCommandError - */ -const de_ListGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListGroupsForUserCommand - */ -export const de_ListGroupsForUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListGroupsForUserCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListGroupsForUserResponse(data.ListGroupsForUserResult, context); - const response: ListGroupsForUserCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListGroupsForUserCommandError - */ -const de_ListGroupsForUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListInstanceProfilesCommand - */ -export const de_ListInstanceProfilesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListInstanceProfilesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListInstanceProfilesResponse(data.ListInstanceProfilesResult, context); - const response: ListInstanceProfilesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListInstanceProfilesCommandError - */ -const de_ListInstanceProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListInstanceProfilesForRoleCommand - */ -export const de_ListInstanceProfilesForRoleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListInstanceProfilesForRoleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListInstanceProfilesForRoleResponse(data.ListInstanceProfilesForRoleResult, context); - const response: ListInstanceProfilesForRoleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListInstanceProfilesForRoleCommandError - */ -const de_ListInstanceProfilesForRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListInstanceProfileTagsCommand - */ -export const de_ListInstanceProfileTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListInstanceProfileTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListInstanceProfileTagsResponse(data.ListInstanceProfileTagsResult, context); - const response: ListInstanceProfileTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListInstanceProfileTagsCommandError - */ -const de_ListInstanceProfileTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListMFADevicesCommand - */ -export const de_ListMFADevicesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListMFADevicesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListMFADevicesResponse(data.ListMFADevicesResult, context); - const response: ListMFADevicesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListMFADevicesCommandError - */ -const de_ListMFADevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListMFADeviceTagsCommand - */ -export const de_ListMFADeviceTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListMFADeviceTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListMFADeviceTagsResponse(data.ListMFADeviceTagsResult, context); - const response: ListMFADeviceTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListMFADeviceTagsCommandError - */ -const de_ListMFADeviceTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListOpenIDConnectProvidersCommand - */ -export const de_ListOpenIDConnectProvidersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListOpenIDConnectProvidersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListOpenIDConnectProvidersResponse(data.ListOpenIDConnectProvidersResult, context); - const response: ListOpenIDConnectProvidersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListOpenIDConnectProvidersCommandError - */ -const de_ListOpenIDConnectProvidersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListOpenIDConnectProviderTagsCommand - */ -export const de_ListOpenIDConnectProviderTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListOpenIDConnectProviderTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListOpenIDConnectProviderTagsResponse(data.ListOpenIDConnectProviderTagsResult, context); - const response: ListOpenIDConnectProviderTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListOpenIDConnectProviderTagsCommandError - */ -const de_ListOpenIDConnectProviderTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListPoliciesCommand - */ -export const de_ListPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListPoliciesResponse(data.ListPoliciesResult, context); - const response: ListPoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListPoliciesCommandError - */ -const de_ListPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListPoliciesGrantingServiceAccessCommand - */ -export const de_ListPoliciesGrantingServiceAccessCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPoliciesGrantingServiceAccessCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListPoliciesGrantingServiceAccessResponse(data.ListPoliciesGrantingServiceAccessResult, context); - const response: ListPoliciesGrantingServiceAccessCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListPoliciesGrantingServiceAccessCommandError - */ -const de_ListPoliciesGrantingServiceAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListPolicyTagsCommand - */ -export const de_ListPolicyTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPolicyTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListPolicyTagsResponse(data.ListPolicyTagsResult, context); - const response: ListPolicyTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListPolicyTagsCommandError - */ -const de_ListPolicyTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListPolicyVersionsCommand - */ -export const de_ListPolicyVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPolicyVersionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListPolicyVersionsResponse(data.ListPolicyVersionsResult, context); - const response: ListPolicyVersionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListPolicyVersionsCommandError - */ -const de_ListPolicyVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListRolePoliciesCommand - */ -export const de_ListRolePoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRolePoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListRolePoliciesResponse(data.ListRolePoliciesResult, context); - const response: ListRolePoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListRolePoliciesCommandError - */ -const de_ListRolePoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListRolesCommand - */ -export const de_ListRolesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRolesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListRolesResponse(data.ListRolesResult, context); - const response: ListRolesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListRolesCommandError - */ -const de_ListRolesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListRoleTagsCommand - */ -export const de_ListRoleTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRoleTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListRoleTagsResponse(data.ListRoleTagsResult, context); - const response: ListRoleTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListRoleTagsCommandError - */ -const de_ListRoleTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListSAMLProvidersCommand - */ -export const de_ListSAMLProvidersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSAMLProvidersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListSAMLProvidersResponse(data.ListSAMLProvidersResult, context); - const response: ListSAMLProvidersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListSAMLProvidersCommandError - */ -const de_ListSAMLProvidersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListSAMLProviderTagsCommand - */ -export const de_ListSAMLProviderTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSAMLProviderTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListSAMLProviderTagsResponse(data.ListSAMLProviderTagsResult, context); - const response: ListSAMLProviderTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListSAMLProviderTagsCommandError - */ -const de_ListSAMLProviderTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListServerCertificatesCommand - */ -export const de_ListServerCertificatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListServerCertificatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListServerCertificatesResponse(data.ListServerCertificatesResult, context); - const response: ListServerCertificatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListServerCertificatesCommandError - */ -const de_ListServerCertificatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListServerCertificateTagsCommand - */ -export const de_ListServerCertificateTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListServerCertificateTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListServerCertificateTagsResponse(data.ListServerCertificateTagsResult, context); - const response: ListServerCertificateTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListServerCertificateTagsCommandError - */ -const de_ListServerCertificateTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListServiceSpecificCredentialsCommand - */ -export const de_ListServiceSpecificCredentialsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListServiceSpecificCredentialsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListServiceSpecificCredentialsResponse(data.ListServiceSpecificCredentialsResult, context); - const response: ListServiceSpecificCredentialsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListServiceSpecificCredentialsCommandError - */ -const de_ListServiceSpecificCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "NotSupportedService": - case "com.amazonaws.iam#ServiceNotSupportedException": - throw await de_ServiceNotSupportedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListSigningCertificatesCommand - */ -export const de_ListSigningCertificatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSigningCertificatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListSigningCertificatesResponse(data.ListSigningCertificatesResult, context); - const response: ListSigningCertificatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListSigningCertificatesCommandError - */ -const de_ListSigningCertificatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListSSHPublicKeysCommand - */ -export const de_ListSSHPublicKeysCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSSHPublicKeysCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListSSHPublicKeysResponse(data.ListSSHPublicKeysResult, context); - const response: ListSSHPublicKeysCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListSSHPublicKeysCommandError - */ -const de_ListSSHPublicKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListUserPoliciesCommand - */ -export const de_ListUserPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListUserPoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListUserPoliciesResponse(data.ListUserPoliciesResult, context); - const response: ListUserPoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListUserPoliciesCommandError - */ -const de_ListUserPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListUsersCommand - */ -export const de_ListUsersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListUsersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListUsersResponse(data.ListUsersResult, context); - const response: ListUsersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListUsersCommandError - */ -const de_ListUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListUserTagsCommand - */ -export const de_ListUserTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListUserTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListUserTagsResponse(data.ListUserTagsResult, context); - const response: ListUserTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListUserTagsCommandError - */ -const de_ListUserTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListVirtualMFADevicesCommand - */ -export const de_ListVirtualMFADevicesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListVirtualMFADevicesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListVirtualMFADevicesResponse(data.ListVirtualMFADevicesResult, context); - const response: ListVirtualMFADevicesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListVirtualMFADevicesCommandError - */ -const de_ListVirtualMFADevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryPutGroupPolicyCommand - */ -export const de_PutGroupPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutGroupPolicyCommandError(output, context); - } - await collectBody(output.body, context); - const response: PutGroupPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryPutGroupPolicyCommandError - */ -const de_PutGroupPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedPolicyDocument": - case "com.amazonaws.iam#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPutRolePermissionsBoundaryCommand - */ -export const de_PutRolePermissionsBoundaryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutRolePermissionsBoundaryCommandError(output, context); - } - await collectBody(output.body, context); - const response: PutRolePermissionsBoundaryCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryPutRolePermissionsBoundaryCommandError - */ -const de_PutRolePermissionsBoundaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "PolicyNotAttachable": - case "com.amazonaws.iam#PolicyNotAttachableException": - throw await de_PolicyNotAttachableExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "UnmodifiableEntity": - case "com.amazonaws.iam#UnmodifiableEntityException": - throw await de_UnmodifiableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPutRolePolicyCommand - */ -export const de_PutRolePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutRolePolicyCommandError(output, context); - } - await collectBody(output.body, context); - const response: PutRolePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryPutRolePolicyCommandError - */ -const de_PutRolePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedPolicyDocument": - case "com.amazonaws.iam#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "UnmodifiableEntity": - case "com.amazonaws.iam#UnmodifiableEntityException": - throw await de_UnmodifiableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPutUserPermissionsBoundaryCommand - */ -export const de_PutUserPermissionsBoundaryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutUserPermissionsBoundaryCommandError(output, context); - } - await collectBody(output.body, context); - const response: PutUserPermissionsBoundaryCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryPutUserPermissionsBoundaryCommandError - */ -const de_PutUserPermissionsBoundaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "PolicyNotAttachable": - case "com.amazonaws.iam#PolicyNotAttachableException": - throw await de_PolicyNotAttachableExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPutUserPolicyCommand - */ -export const de_PutUserPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutUserPolicyCommandError(output, context); - } - await collectBody(output.body, context); - const response: PutUserPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryPutUserPolicyCommandError - */ -const de_PutUserPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedPolicyDocument": - case "com.amazonaws.iam#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRemoveClientIDFromOpenIDConnectProviderCommand - */ -export const de_RemoveClientIDFromOpenIDConnectProviderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveClientIDFromOpenIDConnectProviderCommandError(output, context); - } - await collectBody(output.body, context); - const response: RemoveClientIDFromOpenIDConnectProviderCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryRemoveClientIDFromOpenIDConnectProviderCommandError - */ -const de_RemoveClientIDFromOpenIDConnectProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRemoveRoleFromInstanceProfileCommand - */ -export const de_RemoveRoleFromInstanceProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveRoleFromInstanceProfileCommandError(output, context); - } - await collectBody(output.body, context); - const response: RemoveRoleFromInstanceProfileCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryRemoveRoleFromInstanceProfileCommandError - */ -const de_RemoveRoleFromInstanceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "UnmodifiableEntity": - case "com.amazonaws.iam#UnmodifiableEntityException": - throw await de_UnmodifiableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRemoveUserFromGroupCommand - */ -export const de_RemoveUserFromGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveUserFromGroupCommandError(output, context); - } - await collectBody(output.body, context); - const response: RemoveUserFromGroupCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryRemoveUserFromGroupCommandError - */ -const de_RemoveUserFromGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryResetServiceSpecificCredentialCommand - */ -export const de_ResetServiceSpecificCredentialCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ResetServiceSpecificCredentialCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ResetServiceSpecificCredentialResponse(data.ResetServiceSpecificCredentialResult, context); - const response: ResetServiceSpecificCredentialCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryResetServiceSpecificCredentialCommandError - */ -const de_ResetServiceSpecificCredentialCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryResyncMFADeviceCommand - */ -export const de_ResyncMFADeviceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ResyncMFADeviceCommandError(output, context); - } - await collectBody(output.body, context); - const response: ResyncMFADeviceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryResyncMFADeviceCommandError - */ -const de_ResyncMFADeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidAuthenticationCode": - case "com.amazonaws.iam#InvalidAuthenticationCodeException": - throw await de_InvalidAuthenticationCodeExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_querySetDefaultPolicyVersionCommand - */ -export const de_SetDefaultPolicyVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SetDefaultPolicyVersionCommandError(output, context); - } - await collectBody(output.body, context); - const response: SetDefaultPolicyVersionCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_querySetDefaultPolicyVersionCommandError - */ -const de_SetDefaultPolicyVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_querySetSecurityTokenServicePreferencesCommand - */ -export const de_SetSecurityTokenServicePreferencesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SetSecurityTokenServicePreferencesCommandError(output, context); - } - await collectBody(output.body, context); - const response: SetSecurityTokenServicePreferencesCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_querySetSecurityTokenServicePreferencesCommandError - */ -const de_SetSecurityTokenServicePreferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_querySimulateCustomPolicyCommand - */ -export const de_SimulateCustomPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SimulateCustomPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SimulatePolicyResponse(data.SimulateCustomPolicyResult, context); - const response: SimulateCustomPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_querySimulateCustomPolicyCommandError - */ -const de_SimulateCustomPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "PolicyEvaluation": - case "com.amazonaws.iam#PolicyEvaluationException": - throw await de_PolicyEvaluationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_querySimulatePrincipalPolicyCommand - */ -export const de_SimulatePrincipalPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SimulatePrincipalPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SimulatePolicyResponse(data.SimulatePrincipalPolicyResult, context); - const response: SimulatePrincipalPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_querySimulatePrincipalPolicyCommandError - */ -const de_SimulatePrincipalPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "PolicyEvaluation": - case "com.amazonaws.iam#PolicyEvaluationException": - throw await de_PolicyEvaluationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryTagInstanceProfileCommand - */ -export const de_TagInstanceProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TagInstanceProfileCommandError(output, context); - } - await collectBody(output.body, context); - const response: TagInstanceProfileCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryTagInstanceProfileCommandError - */ -const de_TagInstanceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryTagMFADeviceCommand - */ -export const de_TagMFADeviceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TagMFADeviceCommandError(output, context); - } - await collectBody(output.body, context); - const response: TagMFADeviceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryTagMFADeviceCommandError - */ -const de_TagMFADeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryTagOpenIDConnectProviderCommand - */ -export const de_TagOpenIDConnectProviderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TagOpenIDConnectProviderCommandError(output, context); - } - await collectBody(output.body, context); - const response: TagOpenIDConnectProviderCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryTagOpenIDConnectProviderCommandError - */ -const de_TagOpenIDConnectProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryTagPolicyCommand - */ -export const de_TagPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TagPolicyCommandError(output, context); - } - await collectBody(output.body, context); - const response: TagPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryTagPolicyCommandError - */ -const de_TagPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryTagRoleCommand - */ -export const de_TagRoleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TagRoleCommandError(output, context); - } - await collectBody(output.body, context); - const response: TagRoleCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryTagRoleCommandError - */ -const de_TagRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryTagSAMLProviderCommand - */ -export const de_TagSAMLProviderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TagSAMLProviderCommandError(output, context); - } - await collectBody(output.body, context); - const response: TagSAMLProviderCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryTagSAMLProviderCommandError - */ -const de_TagSAMLProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +export const de_ListServiceSpecificCredentialsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListServiceSpecificCredentialsResponse(data.ListServiceSpecificCredentialsResult, context); + const response: ListServiceSpecificCredentialsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryTagServerCertificateCommand + * deserializeAws_queryListSigningCertificatesCommand */ -export const de_TagServerCertificateCommand = async ( +export const de_ListSigningCertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagServerCertificateCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: TagServerCertificateCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListSigningCertificatesResponse(data.ListSigningCertificatesResult, context); + const response: ListSigningCertificatesCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryTagServerCertificateCommandError + * deserializeAws_queryListSSHPublicKeysCommand */ -const de_TagServerCertificateCommandError = async ( +export const de_ListSSHPublicKeysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListSSHPublicKeysResponse(data.ListSSHPublicKeysResult, context); + const response: ListSSHPublicKeysCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryTagUserCommand + * deserializeAws_queryListUserPoliciesCommand */ -export const de_TagUserCommand = async ( +export const de_ListUserPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagUserCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: TagUserCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListUserPoliciesResponse(data.ListUserPoliciesResult, context); + const response: ListUserPoliciesCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryTagUserCommandError + * deserializeAws_queryListUsersCommand */ -const de_TagUserCommandError = async ( +export const de_ListUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListUsersResponse(data.ListUsersResult, context); + const response: ListUsersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryUntagInstanceProfileCommand + * deserializeAws_queryListUserTagsCommand */ -export const de_UntagInstanceProfileCommand = async ( +export const de_ListUserTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagInstanceProfileCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: UntagInstanceProfileCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListUserTagsResponse(data.ListUserTagsResult, context); + const response: ListUserTagsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryUntagInstanceProfileCommandError + * deserializeAws_queryListVirtualMFADevicesCommand */ -const de_UntagInstanceProfileCommandError = async ( +export const de_ListVirtualMFADevicesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListVirtualMFADevicesResponse(data.ListVirtualMFADevicesResult, context); + const response: ListVirtualMFADevicesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryUntagMFADeviceCommand + * deserializeAws_queryPutGroupPolicyCommand */ -export const de_UntagMFADeviceCommand = async ( +export const de_PutGroupPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagMFADeviceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UntagMFADeviceCommandOutput = { + const response: PutGroupPolicyCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUntagMFADeviceCommandError + * deserializeAws_queryPutRolePermissionsBoundaryCommand */ -const de_UntagMFADeviceCommandError = async ( +export const de_PutRolePermissionsBoundaryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: PutRolePermissionsBoundaryCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUntagOpenIDConnectProviderCommand + * deserializeAws_queryPutRolePolicyCommand */ -export const de_UntagOpenIDConnectProviderCommand = async ( +export const de_PutRolePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagOpenIDConnectProviderCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UntagOpenIDConnectProviderCommandOutput = { + const response: PutRolePolicyCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUntagOpenIDConnectProviderCommandError + * deserializeAws_queryPutUserPermissionsBoundaryCommand */ -const de_UntagOpenIDConnectProviderCommandError = async ( +export const de_PutUserPermissionsBoundaryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: PutUserPermissionsBoundaryCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUntagPolicyCommand + * deserializeAws_queryPutUserPolicyCommand */ -export const de_UntagPolicyCommand = async ( +export const de_PutUserPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagPolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UntagPolicyCommandOutput = { + const response: PutUserPolicyCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUntagPolicyCommandError + * deserializeAws_queryRemoveClientIDFromOpenIDConnectProviderCommand */ -const de_UntagPolicyCommandError = async ( +export const de_RemoveClientIDFromOpenIDConnectProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: RemoveClientIDFromOpenIDConnectProviderCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUntagRoleCommand + * deserializeAws_queryRemoveRoleFromInstanceProfileCommand */ -export const de_UntagRoleCommand = async ( +export const de_RemoveRoleFromInstanceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagRoleCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UntagRoleCommandOutput = { + const response: RemoveRoleFromInstanceProfileCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUntagRoleCommandError + * deserializeAws_queryRemoveUserFromGroupCommand */ -const de_UntagRoleCommandError = async ( +export const de_RemoveUserFromGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: RemoveUserFromGroupCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_queryResetServiceSpecificCredentialCommand + */ +export const de_ResetServiceSpecificCredentialCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ResetServiceSpecificCredentialResponse(data.ResetServiceSpecificCredentialResult, context); + const response: ResetServiceSpecificCredentialCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryUntagSAMLProviderCommand + * deserializeAws_queryResyncMFADeviceCommand */ -export const de_UntagSAMLProviderCommand = async ( +export const de_ResyncMFADeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagSAMLProviderCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UntagSAMLProviderCommandOutput = { + const response: ResyncMFADeviceCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUntagSAMLProviderCommandError + * deserializeAws_querySetDefaultPolicyVersionCommand */ -const de_UntagSAMLProviderCommandError = async ( +export const de_SetDefaultPolicyVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: SetDefaultPolicyVersionCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUntagServerCertificateCommand + * deserializeAws_querySetSecurityTokenServicePreferencesCommand */ -export const de_UntagServerCertificateCommand = async ( +export const de_SetSecurityTokenServicePreferencesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagServerCertificateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UntagServerCertificateCommandOutput = { + const response: SetSecurityTokenServicePreferencesCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUntagServerCertificateCommandError + * deserializeAws_querySimulateCustomPolicyCommand */ -const de_UntagServerCertificateCommandError = async ( +export const de_SimulateCustomPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SimulatePolicyResponse(data.SimulateCustomPolicyResult, context); + const response: SimulateCustomPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_querySimulatePrincipalPolicyCommand + */ +export const de_SimulatePrincipalPolicyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SimulatePolicyResponse(data.SimulatePrincipalPolicyResult, context); + const response: SimulatePrincipalPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryUntagUserCommand + * deserializeAws_queryTagInstanceProfileCommand */ -export const de_UntagUserCommand = async ( +export const de_TagInstanceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagUserCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UntagUserCommandOutput = { + const response: TagInstanceProfileCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUntagUserCommandError + * deserializeAws_queryTagMFADeviceCommand */ -const de_UntagUserCommandError = async ( +export const de_TagMFADeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: TagMFADeviceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUpdateAccessKeyCommand + * deserializeAws_queryTagOpenIDConnectProviderCommand */ -export const de_UpdateAccessKeyCommand = async ( +export const de_TagOpenIDConnectProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateAccessKeyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UpdateAccessKeyCommandOutput = { + const response: TagOpenIDConnectProviderCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUpdateAccessKeyCommandError + * deserializeAws_queryTagPolicyCommand */ -const de_UpdateAccessKeyCommandError = async ( +export const de_TagPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: TagPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUpdateAccountPasswordPolicyCommand + * deserializeAws_queryTagRoleCommand */ -export const de_UpdateAccountPasswordPolicyCommand = async ( +export const de_TagRoleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateAccountPasswordPolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UpdateAccountPasswordPolicyCommandOutput = { + const response: TagRoleCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUpdateAccountPasswordPolicyCommandError + * deserializeAws_queryTagSAMLProviderCommand */ -const de_UpdateAccountPasswordPolicyCommandError = async ( +export const de_TagSAMLProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedPolicyDocument": - case "com.amazonaws.iam#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: TagSAMLProviderCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUpdateAssumeRolePolicyCommand + * deserializeAws_queryTagServerCertificateCommand */ -export const de_UpdateAssumeRolePolicyCommand = async ( +export const de_TagServerCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateAssumeRolePolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UpdateAssumeRolePolicyCommandOutput = { + const response: TagServerCertificateCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUpdateAssumeRolePolicyCommandError + * deserializeAws_queryTagUserCommand */ -const de_UpdateAssumeRolePolicyCommandError = async ( +export const de_TagUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedPolicyDocument": - case "com.amazonaws.iam#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "UnmodifiableEntity": - case "com.amazonaws.iam#UnmodifiableEntityException": - throw await de_UnmodifiableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: TagUserCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUpdateGroupCommand + * deserializeAws_queryUntagInstanceProfileCommand */ -export const de_UpdateGroupCommand = async ( +export const de_UntagInstanceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UpdateGroupCommandOutput = { + const response: UntagInstanceProfileCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUpdateGroupCommandError + * deserializeAws_queryUntagMFADeviceCommand */ -const de_UpdateGroupCommandError = async ( +export const de_UntagMFADeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UntagMFADeviceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUpdateLoginProfileCommand + * deserializeAws_queryUntagOpenIDConnectProviderCommand */ -export const de_UpdateLoginProfileCommand = async ( +export const de_UntagOpenIDConnectProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateLoginProfileCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UpdateLoginProfileCommandOutput = { + const response: UntagOpenIDConnectProviderCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUpdateLoginProfileCommandError + * deserializeAws_queryUntagPolicyCommand */ -const de_UpdateLoginProfileCommandError = async ( +export const de_UntagPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityTemporarilyUnmodifiable": - case "com.amazonaws.iam#EntityTemporarilyUnmodifiableException": - throw await de_EntityTemporarilyUnmodifiableExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "PasswordPolicyViolation": - case "com.amazonaws.iam#PasswordPolicyViolationException": - throw await de_PasswordPolicyViolationExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UntagPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUpdateOpenIDConnectProviderThumbprintCommand + * deserializeAws_queryUntagRoleCommand */ -export const de_UpdateOpenIDConnectProviderThumbprintCommand = async ( +export const de_UntagRoleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateOpenIDConnectProviderThumbprintCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UpdateOpenIDConnectProviderThumbprintCommandOutput = { + const response: UntagRoleCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUpdateOpenIDConnectProviderThumbprintCommandError + * deserializeAws_queryUntagSAMLProviderCommand */ -const de_UpdateOpenIDConnectProviderThumbprintCommandError = async ( +export const de_UntagSAMLProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UntagSAMLProviderCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUpdateRoleCommand + * deserializeAws_queryUntagServerCertificateCommand */ -export const de_UpdateRoleCommand = async ( +export const de_UntagServerCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateRoleCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateRoleResponse(data.UpdateRoleResult, context); - const response: UpdateRoleCommandOutput = { + await collectBody(output.body, context); + const response: UntagServerCertificateCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_queryUpdateRoleCommandError + * deserializeAws_queryUntagUserCommand */ -const de_UpdateRoleCommandError = async ( +export const de_UntagUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "UnmodifiableEntity": - case "com.amazonaws.iam#UnmodifiableEntityException": - throw await de_UnmodifiableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UntagUserCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUpdateRoleDescriptionCommand + * deserializeAws_queryUpdateAccessKeyCommand */ -export const de_UpdateRoleDescriptionCommand = async ( +export const de_UpdateAccessKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateRoleDescriptionCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateRoleDescriptionResponse(data.UpdateRoleDescriptionResult, context); - const response: UpdateRoleDescriptionCommandOutput = { + await collectBody(output.body, context); + const response: UpdateAccessKeyCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_queryUpdateRoleDescriptionCommandError + * deserializeAws_queryUpdateAccountPasswordPolicyCommand */ -const de_UpdateRoleDescriptionCommandError = async ( +export const de_UpdateAccountPasswordPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "UnmodifiableEntity": - case "com.amazonaws.iam#UnmodifiableEntityException": - throw await de_UnmodifiableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UpdateAccountPasswordPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUpdateSAMLProviderCommand + * deserializeAws_queryUpdateAssumeRolePolicyCommand */ -export const de_UpdateSAMLProviderCommand = async ( +export const de_UpdateAssumeRolePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateSAMLProviderCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateSAMLProviderResponse(data.UpdateSAMLProviderResult, context); - const response: UpdateSAMLProviderCommandOutput = { + await collectBody(output.body, context); + const response: UpdateAssumeRolePolicyCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_queryUpdateSAMLProviderCommandError + * deserializeAws_queryUpdateGroupCommand */ -const de_UpdateSAMLProviderCommandError = async ( +export const de_UpdateGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UpdateGroupCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUpdateServerCertificateCommand + * deserializeAws_queryUpdateLoginProfileCommand */ -export const de_UpdateServerCertificateCommand = async ( +export const de_UpdateLoginProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateServerCertificateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UpdateServerCertificateCommandOutput = { + const response: UpdateLoginProfileCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUpdateServerCertificateCommandError + * deserializeAws_queryUpdateOpenIDConnectProviderThumbprintCommand */ -const de_UpdateServerCertificateCommandError = async ( +export const de_UpdateOpenIDConnectProviderThumbprintCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UpdateOpenIDConnectProviderThumbprintCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUpdateServiceSpecificCredentialCommand + * deserializeAws_queryUpdateRoleCommand */ -export const de_UpdateServiceSpecificCredentialCommand = async ( +export const de_UpdateRoleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateServiceSpecificCredentialCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: UpdateServiceSpecificCredentialCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateRoleResponse(data.UpdateRoleResult, context); + const response: UpdateRoleCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryUpdateServiceSpecificCredentialCommandError + * deserializeAws_queryUpdateRoleDescriptionCommand */ -const de_UpdateServiceSpecificCredentialCommandError = async ( +export const de_UpdateRoleDescriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateRoleDescriptionResponse(data.UpdateRoleDescriptionResult, context); + const response: UpdateRoleDescriptionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryUpdateSigningCertificateCommand + * deserializeAws_queryUpdateSAMLProviderCommand */ -export const de_UpdateSigningCertificateCommand = async ( +export const de_UpdateSAMLProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateSigningCertificateCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: UpdateSigningCertificateCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateSAMLProviderResponse(data.UpdateSAMLProviderResult, context); + const response: UpdateSAMLProviderCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryUpdateSigningCertificateCommandError + * deserializeAws_queryUpdateServerCertificateCommand */ -const de_UpdateSigningCertificateCommandError = async ( +export const de_UpdateServerCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UpdateServerCertificateCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUpdateSSHPublicKeyCommand + * deserializeAws_queryUpdateServiceSpecificCredentialCommand */ -export const de_UpdateSSHPublicKeyCommand = async ( +export const de_UpdateServiceSpecificCredentialCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateSSHPublicKeyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UpdateSSHPublicKeyCommandOutput = { + const response: UpdateServiceSpecificCredentialCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUpdateSSHPublicKeyCommandError + * deserializeAws_queryUpdateSigningCertificateCommand */ -const de_UpdateSSHPublicKeyCommandError = async ( +export const de_UpdateSigningCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UpdateSigningCertificateCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryUpdateUserCommand + * deserializeAws_queryUpdateSSHPublicKeyCommand */ -export const de_UpdateUserCommand = async ( +export const de_UpdateSSHPublicKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateUserCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UpdateUserCommandOutput = { + const response: UpdateSSHPublicKeyCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryUpdateUserCommandError + * deserializeAws_queryUpdateUserCommand */ -const de_UpdateUserCommandError = async ( +export const de_UpdateUserCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "EntityTemporarilyUnmodifiable": - case "com.amazonaws.iam#EntityTemporarilyUnmodifiableException": - throw await de_EntityTemporarilyUnmodifiableExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UpdateUserCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** @@ -11411,7 +6335,7 @@ export const de_UploadServerCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UploadServerCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11423,50 +6347,6 @@ export const de_UploadServerCertificateCommand = async ( return response; }; -/** - * deserializeAws_queryUploadServerCertificateCommandError - */ -const de_UploadServerCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.iam#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "KeyPairMismatch": - case "com.amazonaws.iam#KeyPairMismatchException": - throw await de_KeyPairMismatchExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedCertificate": - case "com.amazonaws.iam#MalformedCertificateException": - throw await de_MalformedCertificateExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUploadSigningCertificateCommand */ @@ -11475,7 +6355,7 @@ export const de_UploadSigningCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UploadSigningCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11487,53 +6367,6 @@ export const de_UploadSigningCertificateCommand = async ( return response; }; -/** - * deserializeAws_queryUploadSigningCertificateCommandError - */ -const de_UploadSigningCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.iam#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "DuplicateCertificate": - case "com.amazonaws.iam#DuplicateCertificateException": - throw await de_DuplicateCertificateExceptionRes(parsedOutput, context); - case "EntityAlreadyExists": - case "com.amazonaws.iam#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidCertificate": - case "com.amazonaws.iam#InvalidCertificateException": - throw await de_InvalidCertificateExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.iam#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedCertificate": - case "com.amazonaws.iam#MalformedCertificateException": - throw await de_MalformedCertificateExceptionRes(parsedOutput, context); - case "NoSuchEntity": - case "com.amazonaws.iam#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceFailure": - case "com.amazonaws.iam#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUploadSSHPublicKeyCommand */ @@ -11542,7 +6375,7 @@ export const de_UploadSSHPublicKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UploadSSHPublicKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11555,40 +6388,103 @@ export const de_UploadSSHPublicKeyCommand = async ( }; /** - * deserializeAws_queryUploadSSHPublicKeyCommandError + * deserialize_Aws_queryCommandError */ -const de_UploadSSHPublicKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { - case "DuplicateSSHPublicKey": - case "com.amazonaws.iam#DuplicateSSHPublicKeyException": - throw await de_DuplicateSSHPublicKeyExceptionRes(parsedOutput, context); - case "InvalidPublicKey": - case "com.amazonaws.iam#InvalidPublicKeyException": - throw await de_InvalidPublicKeyExceptionRes(parsedOutput, context); + case "InvalidInput": + case "com.amazonaws.iam#InvalidInputException": + throw await de_InvalidInputExceptionRes(parsedOutput, context); case "LimitExceeded": case "com.amazonaws.iam#LimitExceededException": throw await de_LimitExceededExceptionRes(parsedOutput, context); case "NoSuchEntity": case "com.amazonaws.iam#NoSuchEntityException": throw await de_NoSuchEntityExceptionRes(parsedOutput, context); + case "ServiceFailure": + case "com.amazonaws.iam#ServiceFailureException": + throw await de_ServiceFailureExceptionRes(parsedOutput, context); + case "EntityAlreadyExists": + case "com.amazonaws.iam#EntityAlreadyExistsException": + throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); + case "UnmodifiableEntity": + case "com.amazonaws.iam#UnmodifiableEntityException": + throw await de_UnmodifiableEntityExceptionRes(parsedOutput, context); + case "PolicyNotAttachable": + case "com.amazonaws.iam#PolicyNotAttachableException": + throw await de_PolicyNotAttachableExceptionRes(parsedOutput, context); + case "EntityTemporarilyUnmodifiable": + case "com.amazonaws.iam#EntityTemporarilyUnmodifiableException": + throw await de_EntityTemporarilyUnmodifiableExceptionRes(parsedOutput, context); + case "InvalidUserType": + case "com.amazonaws.iam#InvalidUserTypeException": + throw await de_InvalidUserTypeExceptionRes(parsedOutput, context); + case "PasswordPolicyViolation": + case "com.amazonaws.iam#PasswordPolicyViolationException": + throw await de_PasswordPolicyViolationExceptionRes(parsedOutput, context); + case "ConcurrentModification": + case "com.amazonaws.iam#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "MalformedPolicyDocument": + case "com.amazonaws.iam#MalformedPolicyDocumentException": + throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); + case "NotSupportedService": + case "com.amazonaws.iam#ServiceNotSupportedException": + throw await de_ServiceNotSupportedExceptionRes(parsedOutput, context); + case "DeleteConflict": + case "com.amazonaws.iam#DeleteConflictException": + throw await de_DeleteConflictExceptionRes(parsedOutput, context); + case "InvalidAuthenticationCode": + case "com.amazonaws.iam#InvalidAuthenticationCodeException": + throw await de_InvalidAuthenticationCodeExceptionRes(parsedOutput, context); + case "ReportGenerationLimitExceeded": + case "com.amazonaws.iam#ReportGenerationLimitExceededException": + throw await de_ReportGenerationLimitExceededExceptionRes(parsedOutput, context); + case "ReportExpired": + case "com.amazonaws.iam#CredentialReportExpiredException": + throw await de_CredentialReportExpiredExceptionRes(parsedOutput, context); + case "ReportInProgress": + case "com.amazonaws.iam#CredentialReportNotReadyException": + throw await de_CredentialReportNotReadyExceptionRes(parsedOutput, context); + case "ReportNotPresent": + case "com.amazonaws.iam#CredentialReportNotPresentException": + throw await de_CredentialReportNotPresentExceptionRes(parsedOutput, context); case "UnrecognizedPublicKeyEncoding": case "com.amazonaws.iam#UnrecognizedPublicKeyEncodingException": throw await de_UnrecognizedPublicKeyEncodingExceptionRes(parsedOutput, context); + case "PolicyEvaluation": + case "com.amazonaws.iam#PolicyEvaluationException": + throw await de_PolicyEvaluationExceptionRes(parsedOutput, context); + case "KeyPairMismatch": + case "com.amazonaws.iam#KeyPairMismatchException": + throw await de_KeyPairMismatchExceptionRes(parsedOutput, context); + case "MalformedCertificate": + case "com.amazonaws.iam#MalformedCertificateException": + throw await de_MalformedCertificateExceptionRes(parsedOutput, context); + case "DuplicateCertificate": + case "com.amazonaws.iam#DuplicateCertificateException": + throw await de_DuplicateCertificateExceptionRes(parsedOutput, context); + case "InvalidCertificate": + case "com.amazonaws.iam#InvalidCertificateException": + throw await de_InvalidCertificateExceptionRes(parsedOutput, context); + case "DuplicateSSHPublicKey": + case "com.amazonaws.iam#DuplicateSSHPublicKeyException": + throw await de_DuplicateSSHPublicKeyExceptionRes(parsedOutput, context); + case "InvalidPublicKey": + case "com.amazonaws.iam#InvalidPublicKeyException": + throw await de_InvalidPublicKeyExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody: parsedBody.Error, errorCode, - }); + }) as never; } }; diff --git a/clients/client-identitystore/src/protocols/Aws_json1_1.ts b/clients/client-identitystore/src/protocols/Aws_json1_1.ts index 4d7ffad0e8b8..634d8bdcd467 100644 --- a/clients/client-identitystore/src/protocols/Aws_json1_1.ts +++ b/clients/client-identitystore/src/protocols/Aws_json1_1.ts @@ -347,7 +347,7 @@ export const de_CreateGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -359,50 +359,6 @@ export const de_CreateGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateGroupCommandError - */ -const de_CreateGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.identitystore#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.identitystore#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateGroupMembershipCommand */ @@ -411,7 +367,7 @@ export const de_CreateGroupMembershipCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateGroupMembershipCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -423,50 +379,6 @@ export const de_CreateGroupMembershipCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateGroupMembershipCommandError - */ -const de_CreateGroupMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.identitystore#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.identitystore#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateUserCommand */ @@ -475,7 +387,7 @@ export const de_CreateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -487,50 +399,6 @@ export const de_CreateUserCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateUserCommandError - */ -const de_CreateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.identitystore#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.identitystore#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteGroupCommand */ @@ -539,7 +407,7 @@ export const de_DeleteGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -551,47 +419,6 @@ export const de_DeleteGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteGroupCommandError - */ -const de_DeleteGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.identitystore#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteGroupMembershipCommand */ @@ -600,7 +427,7 @@ export const de_DeleteGroupMembershipCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteGroupMembershipCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -612,47 +439,6 @@ export const de_DeleteGroupMembershipCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteGroupMembershipCommandError - */ -const de_DeleteGroupMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.identitystore#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteUserCommand */ @@ -661,7 +447,7 @@ export const de_DeleteUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -673,47 +459,6 @@ export const de_DeleteUserCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteUserCommandError - */ -const de_DeleteUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.identitystore#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeGroupCommand */ @@ -722,7 +467,7 @@ export const de_DescribeGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -734,44 +479,6 @@ export const de_DescribeGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeGroupCommandError - */ -const de_DescribeGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeGroupMembershipCommand */ @@ -780,7 +487,7 @@ export const de_DescribeGroupMembershipCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeGroupMembershipCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -792,44 +499,6 @@ export const de_DescribeGroupMembershipCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeGroupMembershipCommandError - */ -const de_DescribeGroupMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeUserCommand */ @@ -838,7 +507,7 @@ export const de_DescribeUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -850,44 +519,6 @@ export const de_DescribeUserCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeUserCommandError - */ -const de_DescribeUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetGroupIdCommand */ @@ -896,7 +527,7 @@ export const de_GetGroupIdCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetGroupIdCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -908,44 +539,6 @@ export const de_GetGroupIdCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetGroupIdCommandError - */ -const de_GetGroupIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetGroupMembershipIdCommand */ @@ -954,7 +547,7 @@ export const de_GetGroupMembershipIdCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetGroupMembershipIdCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -962,46 +555,8 @@ export const de_GetGroupMembershipIdCommand = async ( const response: GetGroupMembershipIdCommandOutput = { $metadata: deserializeMetadata(output), ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetGroupMembershipIdCommandError - */ -const de_GetGroupMembershipIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }; + return response; }; /** @@ -1012,7 +567,7 @@ export const de_GetUserIdCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetUserIdCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1024,44 +579,6 @@ export const de_GetUserIdCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetUserIdCommandError - */ -const de_GetUserIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1IsMemberInGroupsCommand */ @@ -1070,7 +587,7 @@ export const de_IsMemberInGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_IsMemberInGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1082,44 +599,6 @@ export const de_IsMemberInGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1IsMemberInGroupsCommandError - */ -const de_IsMemberInGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListGroupMembershipsCommand */ @@ -1128,7 +607,7 @@ export const de_ListGroupMembershipsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListGroupMembershipsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1140,44 +619,6 @@ export const de_ListGroupMembershipsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListGroupMembershipsCommandError - */ -const de_ListGroupMembershipsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListGroupMembershipsForMemberCommand */ @@ -1186,7 +627,7 @@ export const de_ListGroupMembershipsForMemberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListGroupMembershipsForMemberCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1198,44 +639,6 @@ export const de_ListGroupMembershipsForMemberCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListGroupMembershipsForMemberCommandError - */ -const de_ListGroupMembershipsForMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListGroupsCommand */ @@ -1244,7 +647,7 @@ export const de_ListGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1256,44 +659,6 @@ export const de_ListGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListGroupsCommandError - */ -const de_ListGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListUsersCommand */ @@ -1302,7 +667,7 @@ export const de_ListUsersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListUsersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1314,44 +679,6 @@ export const de_ListUsersCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListUsersCommandError - */ -const de_ListUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateGroupCommand */ @@ -1360,7 +687,7 @@ export const de_UpdateGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1372,50 +699,6 @@ export const de_UpdateGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateGroupCommandError - */ -const de_UpdateGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.identitystore#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.identitystore#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.identitystore#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.identitystore#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.identitystore#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.identitystore#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.identitystore#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateUserCommand */ @@ -1424,7 +707,7 @@ export const de_UpdateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1437,12 +720,9 @@ export const de_UpdateUserCommand = async ( }; /** - * deserializeAws_json1_1UpdateUserCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1476,7 +756,7 @@ const de_UpdateUserCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts b/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts index b6edea8cded2..aaecd7810c0a 100644 --- a/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts +++ b/clients/client-imagebuilder/src/protocols/Aws_restJson1.ts @@ -2025,7 +2025,7 @@ export const de_CancelImageCreationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelImageCreationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2040,53 +2040,6 @@ export const de_CancelImageCreationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelImageCreationCommandError - */ -const de_CancelImageCreationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelLifecycleExecutionCommand */ @@ -2095,7 +2048,7 @@ export const de_CancelLifecycleExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelLifecycleExecutionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2108,53 +2061,6 @@ export const de_CancelLifecycleExecutionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelLifecycleExecutionCommandError - */ -const de_CancelLifecycleExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateComponentCommand */ @@ -2163,7 +2069,7 @@ export const de_CreateComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2178,62 +2084,6 @@ export const de_CreateComponentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateComponentCommandError - */ -const de_CreateComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.imagebuilder#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidVersionNumberException": - case "com.amazonaws.imagebuilder#InvalidVersionNumberException": - throw await de_InvalidVersionNumberExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.imagebuilder#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateContainerRecipeCommand */ @@ -2242,7 +2092,7 @@ export const de_CreateContainerRecipeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateContainerRecipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2257,62 +2107,6 @@ export const de_CreateContainerRecipeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateContainerRecipeCommandError - */ -const de_CreateContainerRecipeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidVersionNumberException": - case "com.amazonaws.imagebuilder#InvalidVersionNumberException": - throw await de_InvalidVersionNumberExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.imagebuilder#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.imagebuilder#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDistributionConfigurationCommand */ @@ -2321,7 +2115,7 @@ export const de_CreateDistributionConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDistributionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2336,62 +2130,6 @@ export const de_CreateDistributionConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDistributionConfigurationCommandError - */ -const de_CreateDistributionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.imagebuilder#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.imagebuilder#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.imagebuilder#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateImageCommand */ @@ -2400,7 +2138,7 @@ export const de_CreateImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateImageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2416,64 +2154,14 @@ export const de_CreateImageCommand = async ( }; /** - * deserializeAws_restJson1CreateImageCommandError + * deserializeAws_restJson1CreateImagePipelineCommand */ -const de_CreateImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.imagebuilder#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateImagePipelineCommand - */ -export const de_CreateImagePipelineCommand = async ( +export const de_CreateImagePipelineCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateImagePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2488,59 +2176,6 @@ export const de_CreateImagePipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateImagePipelineCommandError - */ -const de_CreateImagePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.imagebuilder#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.imagebuilder#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateImageRecipeCommand */ @@ -2549,7 +2184,7 @@ export const de_CreateImageRecipeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateImageRecipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2564,62 +2199,6 @@ export const de_CreateImageRecipeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateImageRecipeCommandError - */ -const de_CreateImageRecipeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidVersionNumberException": - case "com.amazonaws.imagebuilder#InvalidVersionNumberException": - throw await de_InvalidVersionNumberExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.imagebuilder#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.imagebuilder#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateInfrastructureConfigurationCommand */ @@ -2628,7 +2207,7 @@ export const de_CreateInfrastructureConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateInfrastructureConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2643,59 +2222,6 @@ export const de_CreateInfrastructureConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateInfrastructureConfigurationCommandError - */ -const de_CreateInfrastructureConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.imagebuilder#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.imagebuilder#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLifecyclePolicyCommand */ @@ -2704,7 +2230,7 @@ export const de_CreateLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2718,59 +2244,6 @@ export const de_CreateLifecyclePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLifecyclePolicyCommandError - */ -const de_CreateLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.imagebuilder#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.imagebuilder#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWorkflowCommand */ @@ -2779,7 +2252,7 @@ export const de_CreateWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2794,70 +2267,14 @@ export const de_CreateWorkflowCommand = async ( }; /** - * deserializeAws_restJson1CreateWorkflowCommandError + * deserializeAws_restJson1DeleteComponentCommand */ -const de_CreateWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.imagebuilder#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidVersionNumberException": - case "com.amazonaws.imagebuilder#InvalidVersionNumberException": - throw await de_InvalidVersionNumberExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.imagebuilder#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteComponentCommand - */ -export const de_DeleteComponentCommand = async ( +export const de_DeleteComponentCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2871,50 +2288,6 @@ export const de_DeleteComponentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteComponentCommandError - */ -const de_DeleteComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceDependencyException": - case "com.amazonaws.imagebuilder#ResourceDependencyException": - throw await de_ResourceDependencyExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteContainerRecipeCommand */ @@ -2923,7 +2296,7 @@ export const de_DeleteContainerRecipeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteContainerRecipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2937,50 +2310,6 @@ export const de_DeleteContainerRecipeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteContainerRecipeCommandError - */ -const de_DeleteContainerRecipeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceDependencyException": - case "com.amazonaws.imagebuilder#ResourceDependencyException": - throw await de_ResourceDependencyExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDistributionConfigurationCommand */ @@ -2989,7 +2318,7 @@ export const de_DeleteDistributionConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDistributionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3003,50 +2332,6 @@ export const de_DeleteDistributionConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDistributionConfigurationCommandError - */ -const de_DeleteDistributionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceDependencyException": - case "com.amazonaws.imagebuilder#ResourceDependencyException": - throw await de_ResourceDependencyExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteImageCommand */ @@ -3055,7 +2340,7 @@ export const de_DeleteImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteImageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3069,50 +2354,6 @@ export const de_DeleteImageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteImageCommandError - */ -const de_DeleteImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceDependencyException": - case "com.amazonaws.imagebuilder#ResourceDependencyException": - throw await de_ResourceDependencyExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteImagePipelineCommand */ @@ -3121,7 +2362,7 @@ export const de_DeleteImagePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteImagePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3135,50 +2376,6 @@ export const de_DeleteImagePipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteImagePipelineCommandError - */ -const de_DeleteImagePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceDependencyException": - case "com.amazonaws.imagebuilder#ResourceDependencyException": - throw await de_ResourceDependencyExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteImageRecipeCommand */ @@ -3187,7 +2384,7 @@ export const de_DeleteImageRecipeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteImageRecipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3202,58 +2399,14 @@ export const de_DeleteImageRecipeCommand = async ( }; /** - * deserializeAws_restJson1DeleteImageRecipeCommandError + * deserializeAws_restJson1DeleteInfrastructureConfigurationCommand */ -const de_DeleteImageRecipeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceDependencyException": - case "com.amazonaws.imagebuilder#ResourceDependencyException": - throw await de_ResourceDependencyExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteInfrastructureConfigurationCommand - */ -export const de_DeleteInfrastructureConfigurationCommand = async ( +export const de_DeleteInfrastructureConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteInfrastructureConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3267,50 +2420,6 @@ export const de_DeleteInfrastructureConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteInfrastructureConfigurationCommandError - */ -const de_DeleteInfrastructureConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceDependencyException": - case "com.amazonaws.imagebuilder#ResourceDependencyException": - throw await de_ResourceDependencyExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteLifecyclePolicyCommand */ @@ -3319,7 +2428,7 @@ export const de_DeleteLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3332,50 +2441,6 @@ export const de_DeleteLifecyclePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLifecyclePolicyCommandError - */ -const de_DeleteLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceDependencyException": - case "com.amazonaws.imagebuilder#ResourceDependencyException": - throw await de_ResourceDependencyExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteWorkflowCommand */ @@ -3384,7 +2449,7 @@ export const de_DeleteWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3397,50 +2462,6 @@ export const de_DeleteWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteWorkflowCommandError - */ -const de_DeleteWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceDependencyException": - case "com.amazonaws.imagebuilder#ResourceDependencyException": - throw await de_ResourceDependencyExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetComponentCommand */ @@ -3449,7 +2470,7 @@ export const de_GetComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3463,47 +2484,6 @@ export const de_GetComponentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetComponentCommandError - */ -const de_GetComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetComponentPolicyCommand */ @@ -3512,7 +2492,7 @@ export const de_GetComponentPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetComponentPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3527,62 +2507,43 @@ export const de_GetComponentPolicyCommand = async ( }; /** - * deserializeAws_restJson1GetComponentPolicyCommandError + * deserializeAws_restJson1GetContainerRecipeCommand */ -const de_GetComponentPolicyCommandError = async ( +export const de_GetContainerRecipeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + containerRecipe: _json, + requestId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetContainerRecipeCommand + * deserializeAws_restJson1GetContainerRecipePolicyCommand */ -export const de_GetContainerRecipeCommand = async ( +export const de_GetContainerRecipePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetContainerRecipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - containerRecipe: _json, + policy: __expectString, requestId: __expectString, }); Object.assign(contents, doc); @@ -3590,62 +2551,21 @@ export const de_GetContainerRecipeCommand = async ( }; /** - * deserializeAws_restJson1GetContainerRecipeCommandError + * deserializeAws_restJson1GetDistributionConfigurationCommand */ -const de_GetContainerRecipeCommandError = async ( +export const de_GetDistributionConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetContainerRecipePolicyCommand - */ -export const de_GetContainerRecipePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetContainerRecipePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - policy: __expectString, + distributionConfiguration: _json, requestId: __expectString, }); Object.assign(contents, doc); @@ -3653,62 +2573,43 @@ export const de_GetContainerRecipePolicyCommand = async ( }; /** - * deserializeAws_restJson1GetContainerRecipePolicyCommandError + * deserializeAws_restJson1GetImageCommand */ -const de_GetContainerRecipePolicyCommandError = async ( +export const de_GetImageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + image: (_) => de_Image(_, context), + requestId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetDistributionConfigurationCommand + * deserializeAws_restJson1GetImagePipelineCommand */ -export const de_GetDistributionConfigurationCommand = async ( +export const de_GetImagePipelineCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDistributionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - distributionConfiguration: _json, + imagePipeline: _json, requestId: __expectString, }); Object.assign(contents, doc); @@ -3716,62 +2617,43 @@ export const de_GetDistributionConfigurationCommand = async ( }; /** - * deserializeAws_restJson1GetDistributionConfigurationCommandError + * deserializeAws_restJson1GetImagePolicyCommand */ -const de_GetDistributionConfigurationCommandError = async ( +export const de_GetImagePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + policy: __expectString, + requestId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetImageCommand + * deserializeAws_restJson1GetImageRecipeCommand */ -export const de_GetImageCommand = async ( +export const de_GetImageRecipeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - image: (_) => de_Image(_, context), + imageRecipe: _json, requestId: __expectString, }); Object.assign(contents, doc); @@ -3779,62 +2661,43 @@ export const de_GetImageCommand = async ( }; /** - * deserializeAws_restJson1GetImageCommandError + * deserializeAws_restJson1GetImageRecipePolicyCommand */ -const de_GetImageCommandError = async ( +export const de_GetImageRecipePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + policy: __expectString, + requestId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetImagePipelineCommand + * deserializeAws_restJson1GetInfrastructureConfigurationCommand */ -export const de_GetImagePipelineCommand = async ( +export const de_GetInfrastructureConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImagePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - imagePipeline: _json, + infrastructureConfiguration: _json, requestId: __expectString, }); Object.assign(contents, doc); @@ -3842,188 +2705,156 @@ export const de_GetImagePipelineCommand = async ( }; /** - * deserializeAws_restJson1GetImagePipelineCommandError + * deserializeAws_restJson1GetLifecycleExecutionCommand */ -const de_GetImagePipelineCommandError = async ( +export const de_GetLifecycleExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + lifecycleExecution: (_) => de_LifecycleExecution(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetImagePolicyCommand + * deserializeAws_restJson1GetLifecyclePolicyCommand */ -export const de_GetImagePolicyCommand = async ( +export const de_GetLifecyclePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImagePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - policy: __expectString, - requestId: __expectString, + lifecyclePolicy: (_) => de_LifecyclePolicy(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetImagePolicyCommandError + * deserializeAws_restJson1GetWorkflowCommand */ -const de_GetImagePolicyCommandError = async ( +export const de_GetWorkflowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + workflow: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetImageRecipeCommand + * deserializeAws_restJson1GetWorkflowExecutionCommand */ -export const de_GetImageRecipeCommand = async ( +export const de_GetWorkflowExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImageRecipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - imageRecipe: _json, + endTime: __expectString, + imageBuildVersionArn: __expectString, + message: __expectString, + parallelGroup: __expectString, requestId: __expectString, + startTime: __expectString, + status: __expectString, + totalStepCount: __expectInt32, + totalStepsFailed: __expectInt32, + totalStepsSkipped: __expectInt32, + totalStepsSucceeded: __expectInt32, + type: __expectString, + workflowBuildVersionArn: __expectString, + workflowExecutionId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetImageRecipeCommandError + * deserializeAws_restJson1GetWorkflowStepExecutionCommand */ -const de_GetImageRecipeCommandError = async ( +export const de_GetWorkflowStepExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + action: __expectString, + description: __expectString, + endTime: __expectString, + imageBuildVersionArn: __expectString, + inputs: __expectString, + message: __expectString, + name: __expectString, + onFailure: __expectString, + outputs: __expectString, + requestId: __expectString, + rollbackStatus: __expectString, + startTime: __expectString, + status: __expectString, + stepExecutionId: __expectString, + timeoutSeconds: __expectInt32, + workflowBuildVersionArn: __expectString, + workflowExecutionId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetImageRecipePolicyCommand + * deserializeAws_restJson1ImportComponentCommand */ -export const de_GetImageRecipePolicyCommand = async ( +export const de_ImportComponentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImageRecipePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - policy: __expectString, + clientToken: __expectString, + componentBuildVersionArn: __expectString, requestId: __expectString, }); Object.assign(contents, doc); @@ -4031,62 +2862,45 @@ export const de_GetImageRecipePolicyCommand = async ( }; /** - * deserializeAws_restJson1GetImageRecipePolicyCommandError + * deserializeAws_restJson1ImportVmImageCommand */ -const de_GetImageRecipePolicyCommandError = async ( +export const de_ImportVmImageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + clientToken: __expectString, + imageArn: __expectString, + requestId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetInfrastructureConfigurationCommand + * deserializeAws_restJson1ListComponentBuildVersionsCommand */ -export const de_GetInfrastructureConfigurationCommand = async ( +export const de_ListComponentBuildVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInfrastructureConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - infrastructureConfiguration: _json, + componentSummaryList: _json, + nextToken: __expectString, requestId: __expectString, }); Object.assign(contents, doc); @@ -4094,402 +2908,253 @@ export const de_GetInfrastructureConfigurationCommand = async ( }; /** - * deserializeAws_restJson1GetInfrastructureConfigurationCommandError + * deserializeAws_restJson1ListComponentsCommand */ -const de_GetInfrastructureConfigurationCommandError = async ( +export const de_ListComponentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + componentVersionList: _json, + nextToken: __expectString, + requestId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetLifecycleExecutionCommand + * deserializeAws_restJson1ListContainerRecipesCommand */ -export const de_GetLifecycleExecutionCommand = async ( +export const de_ListContainerRecipesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLifecycleExecutionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - lifecycleExecution: (_) => de_LifecycleExecution(_, context), + containerRecipeSummaryList: _json, + nextToken: __expectString, + requestId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetLifecycleExecutionCommandError + * deserializeAws_restJson1ListDistributionConfigurationsCommand */ -const de_GetLifecycleExecutionCommandError = async ( +export const de_ListDistributionConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + distributionConfigurationSummaryList: _json, + nextToken: __expectString, + requestId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetLifecyclePolicyCommand + * deserializeAws_restJson1ListImageBuildVersionsCommand */ -export const de_GetLifecyclePolicyCommand = async ( +export const de_ListImageBuildVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - lifecyclePolicy: (_) => de_LifecyclePolicy(_, context), + imageSummaryList: (_) => de_ImageSummaryList(_, context), + nextToken: __expectString, + requestId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetLifecyclePolicyCommandError + * deserializeAws_restJson1ListImagePackagesCommand */ -const de_GetLifecyclePolicyCommandError = async ( +export const de_ListImagePackagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + imagePackageList: _json, + nextToken: __expectString, + requestId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetWorkflowCommand + * deserializeAws_restJson1ListImagePipelineImagesCommand */ -export const de_GetWorkflowCommand = async ( +export const de_ListImagePipelineImagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - workflow: _json, + imageSummaryList: (_) => de_ImageSummaryList(_, context), + nextToken: __expectString, + requestId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetWorkflowCommandError + * deserializeAws_restJson1ListImagePipelinesCommand */ -const de_GetWorkflowCommandError = async ( +export const de_ListImagePipelinesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + imagePipelineList: _json, + nextToken: __expectString, + requestId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetWorkflowExecutionCommand + * deserializeAws_restJson1ListImageRecipesCommand */ -export const de_GetWorkflowExecutionCommand = async ( +export const de_ListImageRecipesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkflowExecutionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - endTime: __expectString, - imageBuildVersionArn: __expectString, - message: __expectString, - parallelGroup: __expectString, + imageRecipeSummaryList: _json, + nextToken: __expectString, requestId: __expectString, - startTime: __expectString, - status: __expectString, - totalStepCount: __expectInt32, - totalStepsFailed: __expectInt32, - totalStepsSkipped: __expectInt32, - totalStepsSucceeded: __expectInt32, - type: __expectString, - workflowBuildVersionArn: __expectString, - workflowExecutionId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetWorkflowExecutionCommandError + * deserializeAws_restJson1ListImagesCommand */ -const de_GetWorkflowExecutionCommandError = async ( +export const de_ListImagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + imageVersionList: _json, + nextToken: __expectString, + requestId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetWorkflowStepExecutionCommand + * deserializeAws_restJson1ListImageScanFindingAggregationsCommand */ -export const de_GetWorkflowStepExecutionCommand = async ( +export const de_ListImageScanFindingAggregationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkflowStepExecutionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - action: __expectString, - description: __expectString, - endTime: __expectString, - imageBuildVersionArn: __expectString, - inputs: __expectString, - message: __expectString, - name: __expectString, - onFailure: __expectString, - outputs: __expectString, + aggregationType: __expectString, + nextToken: __expectString, requestId: __expectString, - rollbackStatus: __expectString, - startTime: __expectString, - status: __expectString, - stepExecutionId: __expectString, - timeoutSeconds: __expectInt32, - workflowBuildVersionArn: __expectString, - workflowExecutionId: __expectString, + responses: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetWorkflowStepExecutionCommandError + * deserializeAws_restJson1ListImageScanFindingsCommand */ -const de_GetWorkflowStepExecutionCommandError = async ( +export const de_ListImageScanFindingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ImportComponentCommand - */ -export const de_ImportComponentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ImportComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - clientToken: __expectString, - componentBuildVersionArn: __expectString, + findings: (_) => de_ImageScanFindingsList(_, context), + nextToken: __expectString, requestId: __expectString, }); Object.assign(contents, doc); @@ -4497,75 +3162,22 @@ export const de_ImportComponentCommand = async ( }; /** - * deserializeAws_restJson1ImportComponentCommandError - */ -const de_ImportComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.imagebuilder#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidVersionNumberException": - case "com.amazonaws.imagebuilder#InvalidVersionNumberException": - throw await de_InvalidVersionNumberExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ImportVmImageCommand + * deserializeAws_restJson1ListInfrastructureConfigurationsCommand */ -export const de_ImportVmImageCommand = async ( +export const de_ListInfrastructureConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ImportVmImageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - clientToken: __expectString, - imageArn: __expectString, + infrastructureConfigurationSummaryList: _json, + nextToken: __expectString, requestId: __expectString, }); Object.assign(contents, doc); @@ -4573,389 +3185,250 @@ export const de_ImportVmImageCommand = async ( }; /** - * deserializeAws_restJson1ImportVmImageCommandError + * deserializeAws_restJson1ListLifecycleExecutionResourcesCommand */ -const de_ImportVmImageCommandError = async ( +export const de_ListLifecycleExecutionResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + lifecycleExecutionId: __expectString, + lifecycleExecutionState: _json, + nextToken: __expectString, + resources: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListComponentBuildVersionsCommand + * deserializeAws_restJson1ListLifecycleExecutionsCommand */ -export const de_ListComponentBuildVersionsCommand = async ( +export const de_ListLifecycleExecutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListComponentBuildVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - componentSummaryList: _json, + lifecycleExecutions: (_) => de_LifecycleExecutionsList(_, context), nextToken: __expectString, - requestId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListComponentBuildVersionsCommandError + * deserializeAws_restJson1ListLifecyclePoliciesCommand */ -const de_ListComponentBuildVersionsCommandError = async ( +export const de_ListLifecyclePoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + lifecyclePolicySummaryList: (_) => de_LifecyclePolicySummaryList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListComponentsCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_ListComponentsCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListComponentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - componentVersionList: _json, - nextToken: __expectString, - requestId: __expectString, + tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListComponentsCommandError + * deserializeAws_restJson1ListWaitingWorkflowStepsCommand */ -const de_ListComponentsCommandError = async ( +export const de_ListWaitingWorkflowStepsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + steps: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListContainerRecipesCommand + * deserializeAws_restJson1ListWorkflowBuildVersionsCommand */ -export const de_ListContainerRecipesCommand = async ( +export const de_ListWorkflowBuildVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListContainerRecipesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - containerRecipeSummaryList: _json, nextToken: __expectString, - requestId: __expectString, + workflowSummaryList: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListContainerRecipesCommandError + * deserializeAws_restJson1ListWorkflowExecutionsCommand */ -const de_ListContainerRecipesCommandError = async ( +export const de_ListWorkflowExecutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDistributionConfigurationsCommand - */ -export const de_ListDistributionConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDistributionConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - distributionConfigurationSummaryList: _json, + imageBuildVersionArn: __expectString, + message: __expectString, nextToken: __expectString, requestId: __expectString, + workflowExecutions: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListDistributionConfigurationsCommandError + * deserializeAws_restJson1ListWorkflowsCommand */ -const de_ListDistributionConfigurationsCommandError = async ( +export const de_ListWorkflowsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + workflowVersionList: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListImageBuildVersionsCommand + * deserializeAws_restJson1ListWorkflowStepExecutionsCommand */ -export const de_ListImageBuildVersionsCommand = async ( +export const de_ListWorkflowStepExecutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImageBuildVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - imageSummaryList: (_) => de_ImageSummaryList(_, context), + imageBuildVersionArn: __expectString, + message: __expectString, nextToken: __expectString, requestId: __expectString, + steps: _json, + workflowBuildVersionArn: __expectString, + workflowExecutionId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListImageBuildVersionsCommandError + * deserializeAws_restJson1PutComponentPolicyCommand */ -const de_ListImageBuildVersionsCommandError = async ( +export const de_PutComponentPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + componentArn: __expectString, + requestId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListImagePackagesCommand + * deserializeAws_restJson1PutContainerRecipePolicyCommand */ -export const de_ListImagePackagesCommand = async ( +export const de_PutContainerRecipePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImagePackagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - imagePackageList: _json, - nextToken: __expectString, + containerRecipeArn: __expectString, requestId: __expectString, }); Object.assign(contents, doc); @@ -4963,69 +3436,43 @@ export const de_ListImagePackagesCommand = async ( }; /** - * deserializeAws_restJson1ListImagePackagesCommandError + * deserializeAws_restJson1PutImagePolicyCommand */ -const de_ListImagePackagesCommandError = async ( +export const de_PutImagePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + imageArn: __expectString, + requestId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListImagePipelineImagesCommand + * deserializeAws_restJson1PutImageRecipePolicyCommand */ -export const de_ListImagePipelineImagesCommand = async ( +export const de_PutImageRecipePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImagePipelineImagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - imageSummaryList: (_) => de_ImageSummaryList(_, context), - nextToken: __expectString, + imageRecipeArn: __expectString, requestId: __expectString, }); Object.assign(contents, doc); @@ -5033,1331 +3480,14 @@ export const de_ListImagePipelineImagesCommand = async ( }; /** - * deserializeAws_restJson1ListImagePipelineImagesCommandError + * deserializeAws_restJson1SendWorkflowStepActionCommand */ -const de_ListImagePipelineImagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListImagePipelinesCommand - */ -export const de_ListImagePipelinesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImagePipelinesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - imagePipelineList: _json, - nextToken: __expectString, - requestId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListImagePipelinesCommandError - */ -const de_ListImagePipelinesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListImageRecipesCommand - */ -export const de_ListImageRecipesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImageRecipesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - imageRecipeSummaryList: _json, - nextToken: __expectString, - requestId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListImageRecipesCommandError - */ -const de_ListImageRecipesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListImagesCommand - */ -export const de_ListImagesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImagesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - imageVersionList: _json, - nextToken: __expectString, - requestId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListImagesCommandError - */ -const de_ListImagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListImageScanFindingAggregationsCommand - */ -export const de_ListImageScanFindingAggregationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImageScanFindingAggregationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - aggregationType: __expectString, - nextToken: __expectString, - requestId: __expectString, - responses: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListImageScanFindingAggregationsCommandError - */ -const de_ListImageScanFindingAggregationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListImageScanFindingsCommand - */ -export const de_ListImageScanFindingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImageScanFindingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - findings: (_) => de_ImageScanFindingsList(_, context), - nextToken: __expectString, - requestId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListImageScanFindingsCommandError - */ -const de_ListImageScanFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListInfrastructureConfigurationsCommand - */ -export const de_ListInfrastructureConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInfrastructureConfigurationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - infrastructureConfigurationSummaryList: _json, - nextToken: __expectString, - requestId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListInfrastructureConfigurationsCommandError - */ -const de_ListInfrastructureConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListLifecycleExecutionResourcesCommand - */ -export const de_ListLifecycleExecutionResourcesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLifecycleExecutionResourcesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - lifecycleExecutionId: __expectString, - lifecycleExecutionState: _json, - nextToken: __expectString, - resources: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListLifecycleExecutionResourcesCommandError - */ -const de_ListLifecycleExecutionResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListLifecycleExecutionsCommand - */ -export const de_ListLifecycleExecutionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLifecycleExecutionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - lifecycleExecutions: (_) => de_LifecycleExecutionsList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListLifecycleExecutionsCommandError - */ -const de_ListLifecycleExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListLifecyclePoliciesCommand - */ -export const de_ListLifecyclePoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLifecyclePoliciesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - lifecyclePolicySummaryList: (_) => de_LifecyclePolicySummaryList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListLifecyclePoliciesCommandError - */ -const de_ListLifecyclePoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.imagebuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListWaitingWorkflowStepsCommand - */ -export const de_ListWaitingWorkflowStepsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWaitingWorkflowStepsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - steps: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListWaitingWorkflowStepsCommandError - */ -const de_ListWaitingWorkflowStepsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListWorkflowBuildVersionsCommand - */ -export const de_ListWorkflowBuildVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkflowBuildVersionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - workflowSummaryList: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListWorkflowBuildVersionsCommandError - */ -const de_ListWorkflowBuildVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListWorkflowExecutionsCommand - */ -export const de_ListWorkflowExecutionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkflowExecutionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - imageBuildVersionArn: __expectString, - message: __expectString, - nextToken: __expectString, - requestId: __expectString, - workflowExecutions: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListWorkflowExecutionsCommandError - */ -const de_ListWorkflowExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListWorkflowsCommand - */ -export const de_ListWorkflowsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkflowsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - workflowVersionList: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListWorkflowsCommandError - */ -const de_ListWorkflowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListWorkflowStepExecutionsCommand - */ -export const de_ListWorkflowStepExecutionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkflowStepExecutionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - imageBuildVersionArn: __expectString, - message: __expectString, - nextToken: __expectString, - requestId: __expectString, - steps: _json, - workflowBuildVersionArn: __expectString, - workflowExecutionId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListWorkflowStepExecutionsCommandError - */ -const de_ListWorkflowStepExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutComponentPolicyCommand - */ -export const de_PutComponentPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutComponentPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - componentArn: __expectString, - requestId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutComponentPolicyCommandError - */ -const de_PutComponentPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.imagebuilder#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutContainerRecipePolicyCommand - */ -export const de_PutContainerRecipePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutContainerRecipePolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - containerRecipeArn: __expectString, - requestId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutContainerRecipePolicyCommandError - */ -const de_PutContainerRecipePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.imagebuilder#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutImagePolicyCommand - */ -export const de_PutImagePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutImagePolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - imageArn: __expectString, - requestId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutImagePolicyCommandError - */ -const de_PutImagePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.imagebuilder#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutImageRecipePolicyCommand - */ -export const de_PutImageRecipePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutImageRecipePolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - imageRecipeArn: __expectString, - requestId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutImageRecipePolicyCommandError - */ -const de_PutImageRecipePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.imagebuilder#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SendWorkflowStepActionCommand - */ -export const de_SendWorkflowStepActionCommand = async ( +export const de_SendWorkflowStepActionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendWorkflowStepActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6367,267 +3497,65 @@ export const de_SendWorkflowStepActionCommand = async ( clientToken: __expectString, imageBuildVersionArn: __expectString, stepExecutionId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SendWorkflowStepActionCommandError - */ -const de_SendWorkflowStepActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.imagebuilder#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartImagePipelineExecutionCommand - */ -export const de_StartImagePipelineExecutionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartImagePipelineExecutionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - clientToken: __expectString, - imageBuildVersionArn: __expectString, - requestId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartImagePipelineExecutionCommandError - */ -const de_StartImagePipelineExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartResourceStateUpdateCommand - */ -export const de_StartResourceStateUpdateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartResourceStateUpdateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - lifecycleExecutionId: __expectString, - resourceArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartResourceStateUpdateCommandError - */ -const de_StartResourceStateUpdateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1StartImagePipelineExecutionCommand */ -export const de_TagResourceCommand = async ( +export const de_StartImagePipelineExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + clientToken: __expectString, + imageBuildVersionArn: __expectString, + requestId: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1StartResourceStateUpdateCommand */ -const de_TagResourceCommandError = async ( +export const de_StartResourceStateUpdateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.imagebuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + lifecycleExecutionId: __expectString, + resourceArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UntagResourceCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6637,35 +3565,20 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.imagebuilder#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.imagebuilder#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -6676,7 +3589,7 @@ export const de_UpdateDistributionConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDistributionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6691,56 +3604,6 @@ export const de_UpdateDistributionConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDistributionConfigurationCommandError - */ -const de_UpdateDistributionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.imagebuilder#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateImagePipelineCommand */ @@ -6749,7 +3612,7 @@ export const de_UpdateImagePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateImagePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6764,53 +3627,6 @@ export const de_UpdateImagePipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateImagePipelineCommandError - */ -const de_UpdateImagePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateInfrastructureConfigurationCommand */ @@ -6819,7 +3635,7 @@ export const de_UpdateInfrastructureConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateInfrastructureConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6834,53 +3650,6 @@ export const de_UpdateInfrastructureConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateInfrastructureConfigurationCommandError - */ -const de_UpdateInfrastructureConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CallRateLimitExceededException": - case "com.amazonaws.imagebuilder#CallRateLimitExceededException": - throw await de_CallRateLimitExceededExceptionRes(parsedOutput, context); - case "ClientException": - case "com.amazonaws.imagebuilder#ClientException": - throw await de_ClientExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.imagebuilder#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.imagebuilder#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.imagebuilder#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.imagebuilder#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.imagebuilder#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLifecyclePolicyCommand */ @@ -6889,7 +3658,7 @@ export const de_UpdateLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6903,12 +3672,9 @@ export const de_UpdateLifecyclePolicyCommand = async ( }; /** - * deserializeAws_restJson1UpdateLifecyclePolicyCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -6927,9 +3693,6 @@ const de_UpdateLifecyclePolicyCommandError = async ( case "IdempotentParameterMismatchException": case "com.amazonaws.imagebuilder#IdempotentParameterMismatchException": throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.imagebuilder#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); case "InvalidRequestException": case "com.amazonaws.imagebuilder#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); @@ -6942,13 +3705,40 @@ const de_UpdateLifecyclePolicyCommandError = async ( case "ServiceUnavailableException": case "com.amazonaws.imagebuilder#ServiceUnavailableException": throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "InvalidParameterCombinationException": + case "com.amazonaws.imagebuilder#InvalidParameterCombinationException": + throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); + case "InvalidVersionNumberException": + case "com.amazonaws.imagebuilder#InvalidVersionNumberException": + throw await de_InvalidVersionNumberExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.imagebuilder#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.imagebuilder#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "ResourceDependencyException": + case "com.amazonaws.imagebuilder#ResourceDependencyException": + throw await de_ResourceDependencyExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.imagebuilder#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "InvalidPaginationTokenException": + case "com.amazonaws.imagebuilder#InvalidPaginationTokenException": + throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.imagebuilder#InvalidParameterException": + throw await de_InvalidParameterExceptionRes(parsedOutput, context); + case "InvalidParameterValueException": + case "com.amazonaws.imagebuilder#InvalidParameterValueException": + throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-inspector-scan/src/protocols/Aws_restJson1.ts b/clients/client-inspector-scan/src/protocols/Aws_restJson1.ts index 114fc2051a7f..44df72d40a9a 100644 --- a/clients/client-inspector-scan/src/protocols/Aws_restJson1.ts +++ b/clients/client-inspector-scan/src/protocols/Aws_restJson1.ts @@ -60,7 +60,7 @@ export const de_ScanSbomCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ScanSbomCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -74,12 +74,9 @@ export const de_ScanSbomCommand = async ( }; /** - * deserializeAws_restJson1ScanSbomCommandError + * deserialize_Aws_restJson1CommandError */ -const de_ScanSbomCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -104,7 +101,7 @@ const de_ScanSbomCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-inspector/src/protocols/Aws_json1_1.ts b/clients/client-inspector/src/protocols/Aws_json1_1.ts index fa7281618fff..ecd581a9f63e 100644 --- a/clients/client-inspector/src/protocols/Aws_json1_1.ts +++ b/clients/client-inspector/src/protocols/Aws_json1_1.ts @@ -705,7 +705,7 @@ export const de_AddAttributesToFindingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddAttributesToFindingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -717,44 +717,6 @@ export const de_AddAttributesToFindingsCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddAttributesToFindingsCommandError - */ -const de_AddAttributesToFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAssessmentTargetCommand */ @@ -763,7 +725,7 @@ export const de_CreateAssessmentTargetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAssessmentTargetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -775,50 +737,6 @@ export const de_CreateAssessmentTargetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAssessmentTargetCommandError - */ -const de_CreateAssessmentTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidCrossAccountRoleException": - case "com.amazonaws.inspector#InvalidCrossAccountRoleException": - throw await de_InvalidCrossAccountRoleExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.inspector#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAssessmentTemplateCommand */ @@ -827,7 +745,7 @@ export const de_CreateAssessmentTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAssessmentTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -839,47 +757,6 @@ export const de_CreateAssessmentTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAssessmentTemplateCommandError - */ -const de_CreateAssessmentTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.inspector#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateExclusionsPreviewCommand */ @@ -888,7 +765,7 @@ export const de_CreateExclusionsPreviewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateExclusionsPreviewCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -900,47 +777,6 @@ export const de_CreateExclusionsPreviewCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateExclusionsPreviewCommandError - */ -const de_CreateExclusionsPreviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "PreviewGenerationInProgressException": - case "com.amazonaws.inspector#PreviewGenerationInProgressException": - throw await de_PreviewGenerationInProgressExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateResourceGroupCommand */ @@ -949,7 +785,7 @@ export const de_CreateResourceGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateResourceGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -962,275 +798,85 @@ export const de_CreateResourceGroupCommand = async ( }; /** - * deserializeAws_json1_1CreateResourceGroupCommandError + * deserializeAws_json1_1DeleteAssessmentRunCommand */ -const de_CreateResourceGroupCommandError = async ( +export const de_DeleteAssessmentRunCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.inspector#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteAssessmentRunCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteAssessmentRunCommand + * deserializeAws_json1_1DeleteAssessmentTargetCommand */ -export const de_DeleteAssessmentRunCommand = async ( +export const de_DeleteAssessmentTargetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteAssessmentRunCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteAssessmentRunCommandOutput = { + const response: DeleteAssessmentTargetCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteAssessmentRunCommandError + * deserializeAws_json1_1DeleteAssessmentTemplateCommand */ -const de_DeleteAssessmentRunCommandError = async ( +export const de_DeleteAssessmentTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AssessmentRunInProgressException": - case "com.amazonaws.inspector#AssessmentRunInProgressException": - throw await de_AssessmentRunInProgressExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteAssessmentTemplateCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteAssessmentTargetCommand + * deserializeAws_json1_1DescribeAssessmentRunsCommand */ -export const de_DeleteAssessmentTargetCommand = async ( +export const de_DescribeAssessmentRunsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteAssessmentTargetCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteAssessmentTargetCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeAssessmentRunsResponse(data, context); + const response: DescribeAssessmentRunsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1DeleteAssessmentTargetCommandError + * deserializeAws_json1_1DescribeAssessmentTargetsCommand */ -const de_DeleteAssessmentTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AssessmentRunInProgressException": - case "com.amazonaws.inspector#AssessmentRunInProgressException": - throw await de_AssessmentRunInProgressExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteAssessmentTemplateCommand - */ -export const de_DeleteAssessmentTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteAssessmentTemplateCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteAssessmentTemplateCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteAssessmentTemplateCommandError - */ -const de_DeleteAssessmentTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AssessmentRunInProgressException": - case "com.amazonaws.inspector#AssessmentRunInProgressException": - throw await de_AssessmentRunInProgressExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAssessmentRunsCommand - */ -export const de_DescribeAssessmentRunsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAssessmentRunsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeAssessmentRunsResponse(data, context); - const response: DescribeAssessmentRunsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAssessmentRunsCommandError - */ -const de_DescribeAssessmentRunsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAssessmentTargetsCommand - */ -export const de_DescribeAssessmentTargetsCommand = async ( +export const de_DescribeAssessmentTargetsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAssessmentTargetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1242,35 +888,6 @@ export const de_DescribeAssessmentTargetsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAssessmentTargetsCommandError - */ -const de_DescribeAssessmentTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAssessmentTemplatesCommand */ @@ -1279,7 +896,7 @@ export const de_DescribeAssessmentTemplatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAssessmentTemplatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1291,35 +908,6 @@ export const de_DescribeAssessmentTemplatesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAssessmentTemplatesCommandError - */ -const de_DescribeAssessmentTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeCrossAccountAccessRoleCommand */ @@ -1328,7 +916,7 @@ export const de_DescribeCrossAccountAccessRoleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCrossAccountAccessRoleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1341,305 +929,19 @@ export const de_DescribeCrossAccountAccessRoleCommand = async ( }; /** - * deserializeAws_json1_1DescribeCrossAccountAccessRoleCommandError - */ -const de_DescribeCrossAccountAccessRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeExclusionsCommand - */ -export const de_DescribeExclusionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeExclusionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeExclusionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeExclusionsCommandError - */ -const de_DescribeExclusionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFindingsCommand - */ -export const de_DescribeFindingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFindingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeFindingsResponse(data, context); - const response: DescribeFindingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFindingsCommandError - */ -const de_DescribeFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeResourceGroupsCommand - */ -export const de_DescribeResourceGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeResourceGroupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeResourceGroupsResponse(data, context); - const response: DescribeResourceGroupsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeResourceGroupsCommandError - */ -const de_DescribeResourceGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeRulesPackagesCommand - */ -export const de_DescribeRulesPackagesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeRulesPackagesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeRulesPackagesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeRulesPackagesCommandError - */ -const de_DescribeRulesPackagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetAssessmentReportCommand - */ -export const de_GetAssessmentReportCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetAssessmentReportCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetAssessmentReportCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetAssessmentReportCommandError - */ -const de_GetAssessmentReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AssessmentRunInProgressException": - case "com.amazonaws.inspector#AssessmentRunInProgressException": - throw await de_AssessmentRunInProgressExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - case "UnsupportedFeatureException": - case "com.amazonaws.inspector#UnsupportedFeatureException": - throw await de_UnsupportedFeatureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetExclusionsPreviewCommand + * deserializeAws_json1_1DescribeExclusionsCommand */ -export const de_GetExclusionsPreviewCommand = async ( +export const de_DescribeExclusionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetExclusionsPreviewCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetExclusionsPreviewCommandOutput = { + const response: DescribeExclusionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1647,54 +949,19 @@ export const de_GetExclusionsPreviewCommand = async ( }; /** - * deserializeAws_json1_1GetExclusionsPreviewCommandError - */ -const de_GetExclusionsPreviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetTelemetryMetadataCommand + * deserializeAws_json1_1DescribeFindingsCommand */ -export const de_GetTelemetryMetadataCommand = async ( +export const de_DescribeFindingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetTelemetryMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetTelemetryMetadataCommandOutput = { + contents = de_DescribeFindingsResponse(data, context); + const response: DescribeFindingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1702,54 +969,39 @@ export const de_GetTelemetryMetadataCommand = async ( }; /** - * deserializeAws_json1_1GetTelemetryMetadataCommandError + * deserializeAws_json1_1DescribeResourceGroupsCommand */ -const de_GetTelemetryMetadataCommandError = async ( +export const de_DescribeResourceGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeResourceGroupsResponse(data, context); + const response: DescribeResourceGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListAssessmentRunAgentsCommand + * deserializeAws_json1_1DescribeRulesPackagesCommand */ -export const de_ListAssessmentRunAgentsCommand = async ( +export const de_DescribeRulesPackagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAssessmentRunAgentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListAssessmentRunAgentsCommandOutput = { + const response: DescribeRulesPackagesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1757,54 +1009,19 @@ export const de_ListAssessmentRunAgentsCommand = async ( }; /** - * deserializeAws_json1_1ListAssessmentRunAgentsCommandError - */ -const de_ListAssessmentRunAgentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAssessmentRunsCommand + * deserializeAws_json1_1GetAssessmentReportCommand */ -export const de_ListAssessmentRunsCommand = async ( +export const de_GetAssessmentReportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAssessmentRunsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListAssessmentRunsCommandOutput = { + const response: GetAssessmentReportCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1812,54 +1029,39 @@ export const de_ListAssessmentRunsCommand = async ( }; /** - * deserializeAws_json1_1ListAssessmentRunsCommandError + * deserializeAws_json1_1GetExclusionsPreviewCommand */ -const de_ListAssessmentRunsCommandError = async ( +export const de_GetExclusionsPreviewCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetExclusionsPreviewCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListAssessmentTargetsCommand + * deserializeAws_json1_1GetTelemetryMetadataCommand */ -export const de_ListAssessmentTargetsCommand = async ( +export const de_GetTelemetryMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAssessmentTargetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListAssessmentTargetsCommandOutput = { + const response: GetTelemetryMetadataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1867,51 +1069,39 @@ export const de_ListAssessmentTargetsCommand = async ( }; /** - * deserializeAws_json1_1ListAssessmentTargetsCommandError + * deserializeAws_json1_1ListAssessmentRunAgentsCommand */ -const de_ListAssessmentTargetsCommandError = async ( +export const de_ListAssessmentRunAgentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListAssessmentRunAgentsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListAssessmentTemplatesCommand + * deserializeAws_json1_1ListAssessmentRunsCommand */ -export const de_ListAssessmentTemplatesCommand = async ( +export const de_ListAssessmentRunsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAssessmentTemplatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListAssessmentTemplatesCommandOutput = { + const response: ListAssessmentRunsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1919,54 +1109,39 @@ export const de_ListAssessmentTemplatesCommand = async ( }; /** - * deserializeAws_json1_1ListAssessmentTemplatesCommandError + * deserializeAws_json1_1ListAssessmentTargetsCommand */ -const de_ListAssessmentTemplatesCommandError = async ( +export const de_ListAssessmentTargetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListAssessmentTargetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListEventSubscriptionsCommand + * deserializeAws_json1_1ListAssessmentTemplatesCommand */ -export const de_ListEventSubscriptionsCommand = async ( +export const de_ListAssessmentTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListEventSubscriptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListEventSubscriptionsResponse(data, context); - const response: ListEventSubscriptionsCommandOutput = { + contents = _json(data); + const response: ListAssessmentTemplatesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1974,38 +1149,23 @@ export const de_ListEventSubscriptionsCommand = async ( }; /** - * deserializeAws_json1_1ListEventSubscriptionsCommandError + * deserializeAws_json1_1ListEventSubscriptionsCommand */ -const de_ListEventSubscriptionsCommandError = async ( +export const de_ListEventSubscriptionsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListEventSubscriptionsResponse(data, context); + const response: ListEventSubscriptionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2016,7 +1176,7 @@ export const de_ListExclusionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListExclusionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2028,41 +1188,6 @@ export const de_ListExclusionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListExclusionsCommandError - */ -const de_ListExclusionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListFindingsCommand */ @@ -2071,7 +1196,7 @@ export const de_ListFindingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListFindingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2083,41 +1208,6 @@ export const de_ListFindingsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListFindingsCommandError - */ -const de_ListFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListRulesPackagesCommand */ @@ -2126,7 +1216,7 @@ export const de_ListRulesPackagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRulesPackagesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2138,38 +1228,6 @@ export const de_ListRulesPackagesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListRulesPackagesCommandError - */ -const de_ListRulesPackagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -2178,7 +1236,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2190,41 +1248,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PreviewAgentsCommand */ @@ -2233,7 +1256,7 @@ export const de_PreviewAgentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PreviewAgentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2245,97 +1268,21 @@ export const de_PreviewAgentsCommand = async ( return response; }; -/** - * deserializeAws_json1_1PreviewAgentsCommandError - */ -const de_PreviewAgentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidCrossAccountRoleException": - case "com.amazonaws.inspector#InvalidCrossAccountRoleException": - throw await de_InvalidCrossAccountRoleExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RegisterCrossAccountAccessRoleCommand - */ -export const de_RegisterCrossAccountAccessRoleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RegisterCrossAccountAccessRoleCommandError(output, context); - } - await collectBody(output.body, context); - const response: RegisterCrossAccountAccessRoleCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1RegisterCrossAccountAccessRoleCommandError - */ -const de_RegisterCrossAccountAccessRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidCrossAccountRoleException": - case "com.amazonaws.inspector#InvalidCrossAccountRoleException": - throw await de_InvalidCrossAccountRoleExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +/** + * deserializeAws_json1_1RegisterCrossAccountAccessRoleCommand + */ +export const de_RegisterCrossAccountAccessRoleCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: RegisterCrossAccountAccessRoleCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** @@ -2346,7 +1293,7 @@ export const de_RemoveAttributesFromFindingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveAttributesFromFindingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2358,44 +1305,6 @@ export const de_RemoveAttributesFromFindingsCommand = async ( return response; }; -/** - * deserializeAws_json1_1RemoveAttributesFromFindingsCommandError - */ -const de_RemoveAttributesFromFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SetTagsForResourceCommand */ @@ -2404,7 +1313,7 @@ export const de_SetTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SetTagsForResourceCommandOutput = { @@ -2413,44 +1322,6 @@ export const de_SetTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1SetTagsForResourceCommandError - */ -const de_SetTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartAssessmentRunCommand */ @@ -2459,7 +1330,7 @@ export const de_StartAssessmentRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartAssessmentRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2471,53 +1342,6 @@ export const de_StartAssessmentRunCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartAssessmentRunCommandError - */ -const de_StartAssessmentRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AgentsAlreadyRunningAssessmentException": - case "com.amazonaws.inspector#AgentsAlreadyRunningAssessmentException": - throw await de_AgentsAlreadyRunningAssessmentExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidCrossAccountRoleException": - case "com.amazonaws.inspector#InvalidCrossAccountRoleException": - throw await de_InvalidCrossAccountRoleExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.inspector#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopAssessmentRunCommand */ @@ -2526,7 +1350,7 @@ export const de_StopAssessmentRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopAssessmentRunCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopAssessmentRunCommandOutput = { @@ -2535,44 +1359,6 @@ export const de_StopAssessmentRunCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopAssessmentRunCommandError - */ -const de_StopAssessmentRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SubscribeToEventCommand */ @@ -2581,7 +1367,7 @@ export const de_SubscribeToEventCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SubscribeToEventCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SubscribeToEventCommandOutput = { @@ -2590,47 +1376,6 @@ export const de_SubscribeToEventCommand = async ( return response; }; -/** - * deserializeAws_json1_1SubscribeToEventCommandError - */ -const de_SubscribeToEventCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.inspector#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UnsubscribeFromEventCommand */ @@ -2639,7 +1384,7 @@ export const de_UnsubscribeFromEventCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UnsubscribeFromEventCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UnsubscribeFromEventCommandOutput = { @@ -2648,44 +1393,6 @@ export const de_UnsubscribeFromEventCommand = async ( return response; }; -/** - * deserializeAws_json1_1UnsubscribeFromEventCommandError - */ -const de_UnsubscribeFromEventCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.inspector#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.inspector#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NoSuchEntityException": - case "com.amazonaws.inspector#NoSuchEntityException": - throw await de_NoSuchEntityExceptionRes(parsedOutput, context); - case "ServiceTemporarilyUnavailableException": - case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": - throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateAssessmentTargetCommand */ @@ -2694,7 +1401,7 @@ export const de_UpdateAssessmentTargetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateAssessmentTargetCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateAssessmentTargetCommandOutput = { @@ -2704,12 +1411,9 @@ export const de_UpdateAssessmentTargetCommand = async ( }; /** - * deserializeAws_json1_1UpdateAssessmentTargetCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateAssessmentTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2731,13 +1435,31 @@ const de_UpdateAssessmentTargetCommandError = async ( case "ServiceTemporarilyUnavailableException": case "com.amazonaws.inspector#ServiceTemporarilyUnavailableException": throw await de_ServiceTemporarilyUnavailableExceptionRes(parsedOutput, context); + case "InvalidCrossAccountRoleException": + case "com.amazonaws.inspector#InvalidCrossAccountRoleException": + throw await de_InvalidCrossAccountRoleExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.inspector#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "PreviewGenerationInProgressException": + case "com.amazonaws.inspector#PreviewGenerationInProgressException": + throw await de_PreviewGenerationInProgressExceptionRes(parsedOutput, context); + case "AssessmentRunInProgressException": + case "com.amazonaws.inspector#AssessmentRunInProgressException": + throw await de_AssessmentRunInProgressExceptionRes(parsedOutput, context); + case "UnsupportedFeatureException": + case "com.amazonaws.inspector#UnsupportedFeatureException": + throw await de_UnsupportedFeatureExceptionRes(parsedOutput, context); + case "AgentsAlreadyRunningAssessmentException": + case "com.amazonaws.inspector#AgentsAlreadyRunningAssessmentException": + throw await de_AgentsAlreadyRunningAssessmentExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-inspector2/src/protocols/Aws_restJson1.ts b/clients/client-inspector2/src/protocols/Aws_restJson1.ts index f6658ff559a7..32aa377a3566 100644 --- a/clients/client-inspector2/src/protocols/Aws_restJson1.ts +++ b/clients/client-inspector2/src/protocols/Aws_restJson1.ts @@ -1665,7 +1665,7 @@ export const de_AssociateMemberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateMemberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1678,41 +1678,6 @@ export const de_AssociateMemberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateMemberCommandError - */ -const de_AssociateMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetAccountStatusCommand */ @@ -1721,7 +1686,7 @@ export const de_BatchGetAccountStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetAccountStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1735,44 +1700,6 @@ export const de_BatchGetAccountStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetAccountStatusCommandError - */ -const de_BatchGetAccountStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetCodeSnippetCommand */ @@ -1781,7 +1708,7 @@ export const de_BatchGetCodeSnippetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetCodeSnippetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1795,41 +1722,6 @@ export const de_BatchGetCodeSnippetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetCodeSnippetCommandError - */ -const de_BatchGetCodeSnippetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetFindingDetailsCommand */ @@ -1838,7 +1730,7 @@ export const de_BatchGetFindingDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetFindingDetailsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1852,41 +1744,6 @@ export const de_BatchGetFindingDetailsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetFindingDetailsCommandError - */ -const de_BatchGetFindingDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetFreeTrialInfoCommand */ @@ -1895,7 +1752,7 @@ export const de_BatchGetFreeTrialInfoCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetFreeTrialInfoCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1909,41 +1766,6 @@ export const de_BatchGetFreeTrialInfoCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetFreeTrialInfoCommandError - */ -const de_BatchGetFreeTrialInfoCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetMemberEc2DeepInspectionStatusCommand */ @@ -1952,7 +1774,7 @@ export const de_BatchGetMemberEc2DeepInspectionStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetMemberEc2DeepInspectionStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1966,41 +1788,6 @@ export const de_BatchGetMemberEc2DeepInspectionStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetMemberEc2DeepInspectionStatusCommandError - */ -const de_BatchGetMemberEc2DeepInspectionStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUpdateMemberEc2DeepInspectionStatusCommand */ @@ -2009,7 +1796,7 @@ export const de_BatchUpdateMemberEc2DeepInspectionStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpdateMemberEc2DeepInspectionStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2024,49 +1811,35 @@ export const de_BatchUpdateMemberEc2DeepInspectionStatusCommand = async ( }; /** - * deserializeAws_restJson1BatchUpdateMemberEc2DeepInspectionStatusCommandError + * deserializeAws_restJson1CancelFindingsReportCommand */ -const de_BatchUpdateMemberEc2DeepInspectionStatusCommandError = async ( +export const de_CancelFindingsReportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + reportId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CancelFindingsReportCommand + * deserializeAws_restJson1CancelSbomExportCommand */ -export const de_CancelFindingsReportCommand = async ( +export const de_CancelSbomExportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelFindingsReportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2080,111 +1853,14 @@ export const de_CancelFindingsReportCommand = async ( }; /** - * deserializeAws_restJson1CancelFindingsReportCommandError + * deserializeAws_restJson1CreateCisScanConfigurationCommand */ -const de_CancelFindingsReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CancelSbomExportCommand - */ -export const de_CancelSbomExportCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelSbomExportCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - reportId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CancelSbomExportCommandError - */ -const de_CancelSbomExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateCisScanConfigurationCommand - */ -export const de_CreateCisScanConfigurationCommand = async ( +export const de_CreateCisScanConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCisScanConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2197,41 +1873,6 @@ export const de_CreateCisScanConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCisScanConfigurationCommandError - */ -const de_CreateCisScanConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFilterCommand */ @@ -2240,7 +1881,7 @@ export const de_CreateFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFilterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2253,47 +1894,6 @@ export const de_CreateFilterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFilterCommandError - */ -const de_CreateFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.inspector2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.inspector2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFindingsReportCommand */ @@ -2302,7 +1902,7 @@ export const de_CreateFindingsReportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFindingsReportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2315,44 +1915,6 @@ export const de_CreateFindingsReportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFindingsReportCommandError - */ -const de_CreateFindingsReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSbomExportCommand */ @@ -2361,7 +1923,7 @@ export const de_CreateSbomExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSbomExportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2374,44 +1936,6 @@ export const de_CreateSbomExportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSbomExportCommandError - */ -const de_CreateSbomExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteCisScanConfigurationCommand */ @@ -2420,7 +1944,7 @@ export const de_DeleteCisScanConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCisScanConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2433,44 +1957,6 @@ export const de_DeleteCisScanConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteCisScanConfigurationCommandError - */ -const de_DeleteCisScanConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteFilterCommand */ @@ -2479,7 +1965,7 @@ export const de_DeleteFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFilterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2493,52 +1979,14 @@ export const de_DeleteFilterCommand = async ( }; /** - * deserializeAws_restJson1DeleteFilterCommandError + * deserializeAws_restJson1DescribeOrganizationConfigurationCommand */ -const de_DeleteFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeOrganizationConfigurationCommand - */ -export const de_DescribeOrganizationConfigurationCommand = async ( +export const de_DescribeOrganizationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeOrganizationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2552,41 +2000,6 @@ export const de_DescribeOrganizationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeOrganizationConfigurationCommandError - */ -const de_DescribeOrganizationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisableCommand */ @@ -2595,7 +2008,7 @@ export const de_DisableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2609,44 +2022,6 @@ export const de_DisableCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisableCommandError - */ -const de_DisableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisableDelegatedAdminAccountCommand */ @@ -2655,7 +2030,7 @@ export const de_DisableDelegatedAdminAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableDelegatedAdminAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2668,47 +2043,6 @@ export const de_DisableDelegatedAdminAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisableDelegatedAdminAccountCommandError - */ -const de_DisableDelegatedAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.inspector2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateMemberCommand */ @@ -2717,7 +2051,7 @@ export const de_DisassociateMemberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateMemberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2730,41 +2064,6 @@ export const de_DisassociateMemberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateMemberCommandError - */ -const de_DisassociateMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1EnableCommand */ @@ -2773,7 +2072,7 @@ export const de_EnableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2787,41 +2086,6 @@ export const de_EnableCommand = async ( return contents; }; -/** - * deserializeAws_restJson1EnableCommandError - */ -const de_EnableCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1EnableDelegatedAdminAccountCommand */ @@ -2830,7 +2094,7 @@ export const de_EnableDelegatedAdminAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableDelegatedAdminAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2843,47 +2107,6 @@ export const de_EnableDelegatedAdminAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1EnableDelegatedAdminAccountCommandError - */ -const de_EnableDelegatedAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.inspector2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCisScanReportCommand */ @@ -2892,7 +2115,7 @@ export const de_GetCisScanReportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCisScanReportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2907,49 +2130,14 @@ export const de_GetCisScanReportCommand = async ( }; /** - * deserializeAws_restJson1GetCisScanReportCommandError + * deserializeAws_restJson1GetCisScanResultDetailsCommand */ -const de_GetCisScanReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCisScanResultDetailsCommand - */ -export const de_GetCisScanResultDetailsCommand = async ( +export const de_GetCisScanResultDetailsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCisScanResultDetailsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2963,41 +2151,6 @@ export const de_GetCisScanResultDetailsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCisScanResultDetailsCommandError - */ -const de_GetCisScanResultDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConfigurationCommand */ @@ -3006,7 +2159,7 @@ export const de_GetConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3019,38 +2172,6 @@ export const de_GetConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetConfigurationCommandError - */ -const de_GetConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDelegatedAdminAccountCommand */ @@ -3059,7 +2180,7 @@ export const de_GetDelegatedAdminAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDelegatedAdminAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3072,44 +2193,6 @@ export const de_GetDelegatedAdminAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDelegatedAdminAccountCommandError - */ -const de_GetDelegatedAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEc2DeepInspectionConfigurationCommand */ @@ -3118,7 +2201,7 @@ export const de_GetEc2DeepInspectionConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEc2DeepInspectionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3134,41 +2217,6 @@ export const de_GetEc2DeepInspectionConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEc2DeepInspectionConfigurationCommandError - */ -const de_GetEc2DeepInspectionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEncryptionKeyCommand */ @@ -3177,7 +2225,7 @@ export const de_GetEncryptionKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEncryptionKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3190,44 +2238,6 @@ export const de_GetEncryptionKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEncryptionKeyCommandError - */ -const de_GetEncryptionKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetFindingsReportStatusCommand */ @@ -3236,7 +2246,7 @@ export const de_GetFindingsReportStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFindingsReportStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3254,44 +2264,6 @@ export const de_GetFindingsReportStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetFindingsReportStatusCommandError - */ -const de_GetFindingsReportStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMemberCommand */ @@ -3300,7 +2272,7 @@ export const de_GetMemberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMemberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3313,44 +2285,6 @@ export const de_GetMemberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMemberCommandError - */ -const de_GetMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSbomExportCommand */ @@ -3359,7 +2293,7 @@ export const de_GetSbomExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSbomExportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3379,52 +2313,14 @@ export const de_GetSbomExportCommand = async ( }; /** - * deserializeAws_restJson1GetSbomExportCommandError - */ -const de_GetSbomExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAccountPermissionsCommand + * deserializeAws_restJson1ListAccountPermissionsCommand */ export const de_ListAccountPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccountPermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3438,41 +2334,6 @@ export const de_ListAccountPermissionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAccountPermissionsCommandError - */ -const de_ListAccountPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCisScanConfigurationsCommand */ @@ -3481,7 +2342,7 @@ export const de_ListCisScanConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCisScanConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3495,41 +2356,6 @@ export const de_ListCisScanConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCisScanConfigurationsCommandError - */ -const de_ListCisScanConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCisScanResultsAggregatedByChecksCommand */ @@ -3538,7 +2364,7 @@ export const de_ListCisScanResultsAggregatedByChecksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCisScanResultsAggregatedByChecksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3552,41 +2378,6 @@ export const de_ListCisScanResultsAggregatedByChecksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCisScanResultsAggregatedByChecksCommandError - */ -const de_ListCisScanResultsAggregatedByChecksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCisScanResultsAggregatedByTargetResourceCommand */ @@ -3595,7 +2386,7 @@ export const de_ListCisScanResultsAggregatedByTargetResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCisScanResultsAggregatedByTargetResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3609,41 +2400,6 @@ export const de_ListCisScanResultsAggregatedByTargetResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCisScanResultsAggregatedByTargetResourceCommandError - */ -const de_ListCisScanResultsAggregatedByTargetResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCisScansCommand */ @@ -3652,7 +2408,7 @@ export const de_ListCisScansCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCisScansCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3666,41 +2422,6 @@ export const de_ListCisScansCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCisScansCommandError - */ -const de_ListCisScansCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCoverageCommand */ @@ -3709,7 +2430,7 @@ export const de_ListCoverageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCoverageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3723,38 +2444,6 @@ export const de_ListCoverageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCoverageCommandError - */ -const de_ListCoverageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCoverageStatisticsCommand */ @@ -3763,7 +2452,7 @@ export const de_ListCoverageStatisticsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCoverageStatisticsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3778,38 +2467,6 @@ export const de_ListCoverageStatisticsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCoverageStatisticsCommandError - */ -const de_ListCoverageStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDelegatedAdminAccountsCommand */ @@ -3818,7 +2475,7 @@ export const de_ListDelegatedAdminAccountsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDelegatedAdminAccountsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3833,49 +2490,14 @@ export const de_ListDelegatedAdminAccountsCommand = async ( }; /** - * deserializeAws_restJson1ListDelegatedAdminAccountsCommandError + * deserializeAws_restJson1ListFiltersCommand */ -const de_ListDelegatedAdminAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListFiltersCommand - */ -export const de_ListFiltersCommand = async ( +export const de_ListFiltersCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFiltersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3889,41 +2511,6 @@ export const de_ListFiltersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFiltersCommandError - */ -const de_ListFiltersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListFindingAggregationsCommand */ @@ -3932,7 +2519,7 @@ export const de_ListFindingAggregationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFindingAggregationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3947,38 +2534,6 @@ export const de_ListFindingAggregationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFindingAggregationsCommandError - */ -const de_ListFindingAggregationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListFindingsCommand */ @@ -3987,7 +2542,7 @@ export const de_ListFindingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4001,38 +2556,6 @@ export const de_ListFindingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFindingsCommandError - */ -const de_ListFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListMembersCommand */ @@ -4041,7 +2564,7 @@ export const de_ListMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4055,41 +2578,6 @@ export const de_ListMembersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListMembersCommandError - */ -const de_ListMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -4098,7 +2586,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4111,41 +2599,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListUsageTotalsCommand */ @@ -4154,7 +2607,7 @@ export const de_ListUsageTotalsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUsageTotalsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4168,41 +2621,6 @@ export const de_ListUsageTotalsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListUsageTotalsCommandError - */ -const de_ListUsageTotalsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ResetEncryptionKeyCommand */ @@ -4211,7 +2629,7 @@ export const de_ResetEncryptionKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ResetEncryptionKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4220,44 +2638,6 @@ export const de_ResetEncryptionKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ResetEncryptionKeyCommandError - */ -const de_ResetEncryptionKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchVulnerabilitiesCommand */ @@ -4266,7 +2646,7 @@ export const de_SearchVulnerabilitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchVulnerabilitiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4280,41 +2660,6 @@ export const de_SearchVulnerabilitiesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchVulnerabilitiesCommandError - */ -const de_SearchVulnerabilitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SendCisSessionHealthCommand */ @@ -4323,7 +2668,7 @@ export const de_SendCisSessionHealthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendCisSessionHealthCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4332,44 +2677,6 @@ export const de_SendCisSessionHealthCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SendCisSessionHealthCommandError - */ -const de_SendCisSessionHealthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.inspector2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SendCisSessionTelemetryCommand */ @@ -4378,7 +2685,7 @@ export const de_SendCisSessionTelemetryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendCisSessionTelemetryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4387,44 +2694,6 @@ export const de_SendCisSessionTelemetryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SendCisSessionTelemetryCommandError - */ -const de_SendCisSessionTelemetryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.inspector2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartCisSessionCommand */ @@ -4433,7 +2702,7 @@ export const de_StartCisSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartCisSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4442,44 +2711,6 @@ export const de_StartCisSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartCisSessionCommandError - */ -const de_StartCisSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.inspector2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopCisSessionCommand */ @@ -4488,117 +2719,24 @@ export const de_StopCisSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopCisSessionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1StopCisSessionCommandError - */ -const de_StopCisSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.inspector2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.inspector2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UntagResourceCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4608,38 +2746,20 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -4650,7 +2770,7 @@ export const de_UpdateCisScanConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCisScanConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4663,44 +2783,6 @@ export const de_UpdateCisScanConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateCisScanConfigurationCommandError - */ -const de_UpdateCisScanConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConfigurationCommand */ @@ -4709,7 +2791,7 @@ export const de_UpdateConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4718,41 +2800,6 @@ export const de_UpdateConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateConfigurationCommandError - */ -const de_UpdateConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEc2DeepInspectionConfigurationCommand */ @@ -4761,7 +2808,7 @@ export const de_UpdateEc2DeepInspectionConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEc2DeepInspectionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4777,41 +2824,6 @@ export const de_UpdateEc2DeepInspectionConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEc2DeepInspectionConfigurationCommandError - */ -const de_UpdateEc2DeepInspectionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEncryptionKeyCommand */ @@ -4820,7 +2832,7 @@ export const de_UpdateEncryptionKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEncryptionKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4829,44 +2841,6 @@ export const de_UpdateEncryptionKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEncryptionKeyCommandError - */ -const de_UpdateEncryptionKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFilterCommand */ @@ -4875,7 +2849,7 @@ export const de_UpdateFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFilterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4888,44 +2862,6 @@ export const de_UpdateFilterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFilterCommandError - */ -const de_UpdateFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.inspector2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateOrganizationConfigurationCommand */ @@ -4934,7 +2870,7 @@ export const de_UpdateOrganizationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateOrganizationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4947,41 +2883,6 @@ export const de_UpdateOrganizationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateOrganizationConfigurationCommandError - */ -const de_UpdateOrganizationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.inspector2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.inspector2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.inspector2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.inspector2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateOrgEc2DeepInspectionConfigurationCommand */ @@ -4990,7 +2891,7 @@ export const de_UpdateOrgEc2DeepInspectionConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateOrgEc2DeepInspectionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5000,12 +2901,9 @@ export const de_UpdateOrgEc2DeepInspectionConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateOrgEc2DeepInspectionConfigurationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateOrgEc2DeepInspectionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5024,13 +2922,25 @@ const de_UpdateOrgEc2DeepInspectionConfigurationCommandError = async ( case "ValidationException": case "com.amazonaws.inspector2#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.inspector2#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "BadRequestException": + case "com.amazonaws.inspector2#BadRequestException": + throw await de_BadRequestExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.inspector2#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.inspector2#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-internetmonitor/src/protocols/Aws_restJson1.ts b/clients/client-internetmonitor/src/protocols/Aws_restJson1.ts index 3935bb412545..d5948691bf99 100644 --- a/clients/client-internetmonitor/src/protocols/Aws_restJson1.ts +++ b/clients/client-internetmonitor/src/protocols/Aws_restJson1.ts @@ -370,7 +370,7 @@ export const de_CreateMonitorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMonitorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -384,47 +384,6 @@ export const de_CreateMonitorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMonitorCommandError - */ -const de_CreateMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.internetmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.internetmonitor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.internetmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.internetmonitor#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.internetmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.internetmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteMonitorCommand */ @@ -433,7 +392,7 @@ export const de_DeleteMonitorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMonitorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -442,41 +401,6 @@ export const de_DeleteMonitorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteMonitorCommandError - */ -const de_DeleteMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.internetmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.internetmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.internetmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.internetmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetHealthEventCommand */ @@ -485,7 +409,7 @@ export const de_GetHealthEventCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetHealthEventCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -508,41 +432,6 @@ export const de_GetHealthEventCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetHealthEventCommandError - */ -const de_GetHealthEventCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.internetmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.internetmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.internetmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.internetmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMonitorCommand */ @@ -551,7 +440,7 @@ export const de_GetMonitorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMonitorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -576,41 +465,6 @@ export const de_GetMonitorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMonitorCommandError - */ -const de_GetMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.internetmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.internetmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.internetmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.internetmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetQueryResultsCommand */ @@ -619,7 +473,7 @@ export const de_GetQueryResultsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetQueryResultsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -634,44 +488,6 @@ export const de_GetQueryResultsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetQueryResultsCommandError - */ -const de_GetQueryResultsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.internetmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.internetmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.internetmonitor#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.internetmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.internetmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetQueryStatusCommand */ @@ -680,7 +496,7 @@ export const de_GetQueryStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetQueryStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -693,44 +509,6 @@ export const de_GetQueryStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetQueryStatusCommandError - */ -const de_GetQueryStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.internetmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.internetmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.internetmonitor#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.internetmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.internetmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListHealthEventsCommand */ @@ -739,7 +517,7 @@ export const de_ListHealthEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListHealthEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -753,41 +531,6 @@ export const de_ListHealthEventsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListHealthEventsCommandError - */ -const de_ListHealthEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.internetmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.internetmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.internetmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.internetmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListMonitorsCommand */ @@ -796,7 +539,7 @@ export const de_ListMonitorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMonitorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -810,41 +553,6 @@ export const de_ListMonitorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListMonitorsCommandError - */ -const de_ListMonitorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.internetmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.internetmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.internetmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.internetmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -853,7 +561,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -866,44 +574,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.internetmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.internetmonitor#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.internetmonitor#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.internetmonitor#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.internetmonitor#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartQueryCommand */ @@ -912,7 +582,7 @@ export const de_StartQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartQueryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -925,44 +595,6 @@ export const de_StartQueryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartQueryCommandError - */ -const de_StartQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.internetmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.internetmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.internetmonitor#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.internetmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.internetmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopQueryCommand */ @@ -971,7 +603,7 @@ export const de_StopQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopQueryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -980,44 +612,6 @@ export const de_StopQueryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopQueryCommandError - */ -const de_StopQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.internetmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.internetmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.internetmonitor#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.internetmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.internetmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1026,7 +620,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1035,44 +629,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.internetmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.internetmonitor#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.internetmonitor#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.internetmonitor#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.internetmonitor#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1081,7 +637,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1090,44 +646,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.internetmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.internetmonitor#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.internetmonitor#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.internetmonitor#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.internetmonitor#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMonitorCommand */ @@ -1136,7 +654,7 @@ export const de_UpdateMonitorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMonitorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1151,12 +669,9 @@ export const de_UpdateMonitorCommand = async ( }; /** - * deserializeAws_restJson1UpdateMonitorCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1166,28 +681,43 @@ const de_UpdateMonitorCommandError = async ( case "AccessDeniedException": case "com.amazonaws.internetmonitor#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.internetmonitor#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.internetmonitor#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "LimitExceededException": case "com.amazonaws.internetmonitor#LimitExceededException": throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.internetmonitor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.internetmonitor#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.internetmonitor#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "BadRequestException": + case "com.amazonaws.internetmonitor#BadRequestException": + throw await de_BadRequestExceptionRes(parsedOutput, context); + case "InternalServerErrorException": + case "com.amazonaws.internetmonitor#InternalServerErrorException": + throw await de_InternalServerErrorExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.internetmonitor#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.internetmonitor#TooManyRequestsException": + throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.internetmonitor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts b/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts index 6b7a85f917a2..4fe9761b1ec1 100644 --- a/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-1click-devices-service/src/protocols/Aws_restJson1.ts @@ -330,7 +330,7 @@ export const de_ClaimDevicesByClaimCodeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ClaimDevicesByClaimCodeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -344,38 +344,6 @@ export const de_ClaimDevicesByClaimCodeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ClaimDevicesByClaimCodeCommandError - */ -const de_ClaimDevicesByClaimCodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.iot1clickdevicesservice#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot1clickdevicesservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickdevicesservice#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDeviceCommand */ @@ -384,7 +352,7 @@ export const de_DescribeDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -397,38 +365,6 @@ export const de_DescribeDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDeviceCommandError - */ -const de_DescribeDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickdevicesservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickdevicesservice#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1FinalizeDeviceClaimCommand */ @@ -437,7 +373,7 @@ export const de_FinalizeDeviceClaimCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_FinalizeDeviceClaimCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -450,44 +386,6 @@ export const de_FinalizeDeviceClaimCommand = async ( return contents; }; -/** - * deserializeAws_restJson1FinalizeDeviceClaimCommandError - */ -const de_FinalizeDeviceClaimCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickdevicesservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickdevicesservice#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.iot1clickdevicesservice#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.iot1clickdevicesservice#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDeviceMethodsCommand */ @@ -496,7 +394,7 @@ export const de_GetDeviceMethodsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeviceMethodsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -509,38 +407,6 @@ export const de_GetDeviceMethodsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeviceMethodsCommandError - */ -const de_GetDeviceMethodsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickdevicesservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickdevicesservice#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1InitiateDeviceClaimCommand */ @@ -549,7 +415,7 @@ export const de_InitiateDeviceClaimCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_InitiateDeviceClaimCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -562,41 +428,6 @@ export const de_InitiateDeviceClaimCommand = async ( return contents; }; -/** - * deserializeAws_restJson1InitiateDeviceClaimCommandError - */ -const de_InitiateDeviceClaimCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickdevicesservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickdevicesservice#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.iot1clickdevicesservice#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1InvokeDeviceMethodCommand */ @@ -605,7 +436,7 @@ export const de_InvokeDeviceMethodCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_InvokeDeviceMethodCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -618,47 +449,6 @@ export const de_InvokeDeviceMethodCommand = async ( return contents; }; -/** - * deserializeAws_restJson1InvokeDeviceMethodCommandError - */ -const de_InvokeDeviceMethodCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickdevicesservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickdevicesservice#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.iot1clickdevicesservice#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "RangeNotSatisfiableException": - case "com.amazonaws.iot1clickdevicesservice#RangeNotSatisfiableException": - throw await de_RangeNotSatisfiableExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.iot1clickdevicesservice#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDeviceEventsCommand */ @@ -667,7 +457,7 @@ export const de_ListDeviceEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeviceEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -681,41 +471,6 @@ export const de_ListDeviceEventsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDeviceEventsCommandError - */ -const de_ListDeviceEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickdevicesservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickdevicesservice#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "RangeNotSatisfiableException": - case "com.amazonaws.iot1clickdevicesservice#RangeNotSatisfiableException": - throw await de_RangeNotSatisfiableExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDevicesCommand */ @@ -724,7 +479,7 @@ export const de_ListDevicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDevicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -738,38 +493,6 @@ export const de_ListDevicesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDevicesCommandError - */ -const de_ListDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickdevicesservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickdevicesservice#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "RangeNotSatisfiableException": - case "com.amazonaws.iot1clickdevicesservice#RangeNotSatisfiableException": - throw await de_RangeNotSatisfiableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -778,7 +501,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -791,35 +514,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickdevicesservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -828,7 +522,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -837,38 +531,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickdevicesservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickdevicesservice#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UnclaimDeviceCommand */ @@ -877,7 +539,7 @@ export const de_UnclaimDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UnclaimDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -890,38 +552,6 @@ export const de_UnclaimDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UnclaimDeviceCommandError - */ -const de_UnclaimDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickdevicesservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickdevicesservice#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -930,7 +560,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -939,38 +569,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickdevicesservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickdevicesservice#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDeviceStateCommand */ @@ -979,7 +577,7 @@ export const de_UpdateDeviceStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDeviceStateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -989,18 +587,18 @@ export const de_UpdateDeviceStateCommand = async ( }; /** - * deserializeAws_restJson1UpdateDeviceStateCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateDeviceStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "ForbiddenException": + case "com.amazonaws.iot1clickdevicesservice#ForbiddenException": + throw await de_ForbiddenExceptionRes(parsedOutput, context); case "InternalFailureException": case "com.amazonaws.iot1clickdevicesservice#InternalFailureException": throw await de_InternalFailureExceptionRes(parsedOutput, context); @@ -1010,13 +608,22 @@ const de_UpdateDeviceStateCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "PreconditionFailedException": + case "com.amazonaws.iot1clickdevicesservice#PreconditionFailedException": + throw await de_PreconditionFailedExceptionRes(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.iot1clickdevicesservice#ResourceConflictException": + throw await de_ResourceConflictExceptionRes(parsedOutput, context); + case "RangeNotSatisfiableException": + case "com.amazonaws.iot1clickdevicesservice#RangeNotSatisfiableException": + throw await de_RangeNotSatisfiableExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts b/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts index 3f9f4828987d..3b3f27d56bf6 100644 --- a/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-1click-projects/src/protocols/Aws_restJson1.ts @@ -396,7 +396,7 @@ export const de_AssociateDeviceWithPlacementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateDeviceWithPlacementCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -405,41 +405,6 @@ export const de_AssociateDeviceWithPlacementCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateDeviceWithPlacementCommandError - */ -const de_AssociateDeviceWithPlacementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickprojects#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickprojects#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.iot1clickprojects#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickprojects#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePlacementCommand */ @@ -448,7 +413,7 @@ export const de_CreatePlacementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePlacementCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -457,41 +422,6 @@ export const de_CreatePlacementCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePlacementCommandError - */ -const de_CreatePlacementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickprojects#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickprojects#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.iot1clickprojects#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickprojects#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProjectCommand */ @@ -500,7 +430,7 @@ export const de_CreateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -509,38 +439,6 @@ export const de_CreateProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProjectCommandError - */ -const de_CreateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickprojects#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickprojects#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.iot1clickprojects#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePlacementCommand */ @@ -549,7 +447,7 @@ export const de_DeletePlacementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePlacementCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -558,41 +456,6 @@ export const de_DeletePlacementCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePlacementCommandError - */ -const de_DeletePlacementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickprojects#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickprojects#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickprojects#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.iot1clickprojects#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteProjectCommand */ @@ -601,7 +464,7 @@ export const de_DeleteProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -610,41 +473,6 @@ export const de_DeleteProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteProjectCommandError - */ -const de_DeleteProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickprojects#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickprojects#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickprojects#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.iot1clickprojects#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribePlacementCommand */ @@ -653,7 +481,7 @@ export const de_DescribePlacementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePlacementCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -666,38 +494,6 @@ export const de_DescribePlacementCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribePlacementCommandError - */ -const de_DescribePlacementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickprojects#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickprojects#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickprojects#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeProjectCommand */ @@ -706,7 +502,7 @@ export const de_DescribeProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -719,38 +515,6 @@ export const de_DescribeProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeProjectCommandError - */ -const de_DescribeProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickprojects#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickprojects#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickprojects#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateDeviceFromPlacementCommand */ @@ -759,7 +523,7 @@ export const de_DisassociateDeviceFromPlacementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateDeviceFromPlacementCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -768,41 +532,6 @@ export const de_DisassociateDeviceFromPlacementCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateDeviceFromPlacementCommandError - */ -const de_DisassociateDeviceFromPlacementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickprojects#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickprojects#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickprojects#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.iot1clickprojects#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDevicesInPlacementCommand */ @@ -811,7 +540,7 @@ export const de_GetDevicesInPlacementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDevicesInPlacementCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -824,38 +553,6 @@ export const de_GetDevicesInPlacementCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDevicesInPlacementCommandError - */ -const de_GetDevicesInPlacementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickprojects#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickprojects#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickprojects#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPlacementsCommand */ @@ -864,7 +561,7 @@ export const de_ListPlacementsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPlacementsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -878,38 +575,6 @@ export const de_ListPlacementsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListPlacementsCommandError - */ -const de_ListPlacementsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickprojects#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickprojects#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickprojects#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProjectsCommand */ @@ -918,7 +583,7 @@ export const de_ListProjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProjectsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -932,35 +597,6 @@ export const de_ListProjectsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListProjectsCommandError - */ -const de_ListProjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickprojects#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickprojects#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -969,7 +605,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -982,38 +618,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickprojects#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickprojects#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickprojects#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1022,7 +626,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1031,38 +635,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickprojects#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickprojects#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickprojects#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1071,7 +643,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1080,38 +652,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickprojects#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickprojects#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickprojects#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePlacementCommand */ @@ -1120,7 +660,7 @@ export const de_UpdatePlacementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePlacementCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1129,41 +669,6 @@ export const de_UpdatePlacementCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePlacementCommandError - */ -const de_UpdatePlacementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot1clickprojects#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot1clickprojects#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot1clickprojects#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.iot1clickprojects#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateProjectCommand */ @@ -1172,7 +677,7 @@ export const de_UpdateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1182,12 +687,9 @@ export const de_UpdateProjectCommand = async ( }; /** - * deserializeAws_restJson1UpdateProjectCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1200,6 +702,9 @@ const de_UpdateProjectCommandError = async ( case "InvalidRequestException": case "com.amazonaws.iot1clickprojects#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.iot1clickprojects#ResourceConflictException": + throw await de_ResourceConflictExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.iot1clickprojects#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); @@ -1212,7 +717,7 @@ const de_UpdateProjectCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts b/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts index 922ffa3fb971..e43e3d27f710 100644 --- a/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-data-plane/src/protocols/Aws_restJson1.ts @@ -209,7 +209,7 @@ export const de_DeleteThingShadowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteThingShadowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -219,53 +219,6 @@ export const de_DeleteThingShadowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteThingShadowCommandError - */ -const de_DeleteThingShadowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotdataplane#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotdataplane#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.iotdataplane#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotdataplane#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotdataplane#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotdataplane#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iotdataplane#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedDocumentEncodingException": - case "com.amazonaws.iotdataplane#UnsupportedDocumentEncodingException": - throw await de_UnsupportedDocumentEncodingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRetainedMessageCommand */ @@ -274,7 +227,7 @@ export const de_GetRetainedMessageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRetainedMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -291,50 +244,6 @@ export const de_GetRetainedMessageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRetainedMessageCommandError - */ -const de_GetRetainedMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotdataplane#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotdataplane#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.iotdataplane#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotdataplane#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotdataplane#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotdataplane#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iotdataplane#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetThingShadowCommand */ @@ -343,7 +252,7 @@ export const de_GetThingShadowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetThingShadowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -353,53 +262,6 @@ export const de_GetThingShadowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetThingShadowCommandError - */ -const de_GetThingShadowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotdataplane#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotdataplane#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.iotdataplane#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotdataplane#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotdataplane#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotdataplane#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iotdataplane#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "UnsupportedDocumentEncodingException": - case "com.amazonaws.iotdataplane#UnsupportedDocumentEncodingException": - throw await de_UnsupportedDocumentEncodingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListNamedShadowsForThingCommand */ @@ -408,7 +270,7 @@ export const de_ListNamedShadowsForThingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNamedShadowsForThingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -423,50 +285,6 @@ export const de_ListNamedShadowsForThingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListNamedShadowsForThingCommandError - */ -const de_ListNamedShadowsForThingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotdataplane#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotdataplane#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.iotdataplane#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotdataplane#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotdataplane#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotdataplane#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iotdataplane#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRetainedMessagesCommand */ @@ -475,7 +293,7 @@ export const de_ListRetainedMessagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRetainedMessagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -489,47 +307,6 @@ export const de_ListRetainedMessagesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRetainedMessagesCommandError - */ -const de_ListRetainedMessagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotdataplane#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotdataplane#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.iotdataplane#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotdataplane#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotdataplane#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iotdataplane#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PublishCommand */ @@ -538,7 +315,7 @@ export const de_PublishCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PublishCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -547,44 +324,6 @@ export const de_PublishCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PublishCommandError - */ -const de_PublishCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotdataplane#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotdataplane#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.iotdataplane#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotdataplane#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iotdataplane#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateThingShadowCommand */ @@ -593,7 +332,7 @@ export const de_UpdateThingShadowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateThingShadowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -604,21 +343,15 @@ export const de_UpdateThingShadowCommand = async ( }; /** - * deserializeAws_restJson1UpdateThingShadowCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateThingShadowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ConflictException": - case "com.amazonaws.iotdataplane#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalFailureException": case "com.amazonaws.iotdataplane#InternalFailureException": throw await de_InternalFailureExceptionRes(parsedOutput, context); @@ -628,9 +361,9 @@ const de_UpdateThingShadowCommandError = async ( case "MethodNotAllowedException": case "com.amazonaws.iotdataplane#MethodNotAllowedException": throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "RequestEntityTooLargeException": - case "com.amazonaws.iotdataplane#RequestEntityTooLargeException": - throw await de_RequestEntityTooLargeExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.iotdataplane#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ServiceUnavailableException": case "com.amazonaws.iotdataplane#ServiceUnavailableException": throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); @@ -643,13 +376,19 @@ const de_UpdateThingShadowCommandError = async ( case "UnsupportedDocumentEncodingException": case "com.amazonaws.iotdataplane#UnsupportedDocumentEncodingException": throw await de_UnsupportedDocumentEncodingExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.iotdataplane#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "RequestEntityTooLargeException": + case "com.amazonaws.iotdataplane#RequestEntityTooLargeException": + throw await de_RequestEntityTooLargeExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts b/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts index ca1d365adb75..fbbc87bf94ab 100644 --- a/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-events-data/src/protocols/Aws_restJson1.ts @@ -334,7 +334,7 @@ export const de_BatchAcknowledgeAlarmCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_BatchAcknowledgeAlarmCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -347,41 +347,6 @@ export const de_BatchAcknowledgeAlarmCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchAcknowledgeAlarmCommandError - */ -const de_BatchAcknowledgeAlarmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.ioteventsdata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ioteventsdata#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ioteventsdata#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ioteventsdata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDeleteDetectorCommand */ @@ -390,7 +355,7 @@ export const de_BatchDeleteDetectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDeleteDetectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -403,41 +368,6 @@ export const de_BatchDeleteDetectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDeleteDetectorCommandError - */ -const de_BatchDeleteDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.ioteventsdata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ioteventsdata#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ioteventsdata#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ioteventsdata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDisableAlarmCommand */ @@ -446,7 +376,7 @@ export const de_BatchDisableAlarmCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_BatchDisableAlarmCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -459,41 +389,6 @@ export const de_BatchDisableAlarmCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDisableAlarmCommandError - */ -const de_BatchDisableAlarmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.ioteventsdata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ioteventsdata#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ioteventsdata#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ioteventsdata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchEnableAlarmCommand */ @@ -502,7 +397,7 @@ export const de_BatchEnableAlarmCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_BatchEnableAlarmCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -515,41 +410,6 @@ export const de_BatchEnableAlarmCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchEnableAlarmCommandError - */ -const de_BatchEnableAlarmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.ioteventsdata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ioteventsdata#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ioteventsdata#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ioteventsdata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchPutMessageCommand */ @@ -558,7 +418,7 @@ export const de_BatchPutMessageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchPutMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -571,41 +431,6 @@ export const de_BatchPutMessageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchPutMessageCommandError - */ -const de_BatchPutMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.ioteventsdata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ioteventsdata#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ioteventsdata#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ioteventsdata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchResetAlarmCommand */ @@ -614,7 +439,7 @@ export const de_BatchResetAlarmCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_BatchResetAlarmCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -627,41 +452,6 @@ export const de_BatchResetAlarmCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchResetAlarmCommandError - */ -const de_BatchResetAlarmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.ioteventsdata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ioteventsdata#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ioteventsdata#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ioteventsdata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchSnoozeAlarmCommand */ @@ -670,7 +460,7 @@ export const de_BatchSnoozeAlarmCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_BatchSnoozeAlarmCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -683,41 +473,6 @@ export const de_BatchSnoozeAlarmCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchSnoozeAlarmCommandError - */ -const de_BatchSnoozeAlarmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.ioteventsdata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ioteventsdata#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ioteventsdata#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ioteventsdata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUpdateDetectorCommand */ @@ -726,7 +481,7 @@ export const de_BatchUpdateDetectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpdateDetectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -739,41 +494,6 @@ export const de_BatchUpdateDetectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchUpdateDetectorCommandError - */ -const de_BatchUpdateDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.ioteventsdata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ioteventsdata#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ioteventsdata#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ioteventsdata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAlarmCommand */ @@ -782,7 +502,7 @@ export const de_DescribeAlarmCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAlarmCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -795,44 +515,6 @@ export const de_DescribeAlarmCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAlarmCommandError - */ -const de_DescribeAlarmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.ioteventsdata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ioteventsdata#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ioteventsdata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ioteventsdata#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ioteventsdata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDetectorCommand */ @@ -841,7 +523,7 @@ export const de_DescribeDetectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDetectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -854,44 +536,6 @@ export const de_DescribeDetectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDetectorCommandError - */ -const de_DescribeDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.ioteventsdata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ioteventsdata#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ioteventsdata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ioteventsdata#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ioteventsdata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAlarmsCommand */ @@ -900,7 +544,7 @@ export const de_ListAlarmsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAlarmsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -914,44 +558,6 @@ export const de_ListAlarmsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAlarmsCommandError - */ -const de_ListAlarmsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.ioteventsdata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ioteventsdata#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ioteventsdata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ioteventsdata#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ioteventsdata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDetectorsCommand */ @@ -960,7 +566,7 @@ export const de_ListDetectorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDetectorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -975,12 +581,9 @@ export const de_ListDetectorsCommand = async ( }; /** - * deserializeAws_restJson1ListDetectorsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_ListDetectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -993,22 +596,22 @@ const de_ListDetectorsCommandError = async ( case "InvalidRequestException": case "com.amazonaws.ioteventsdata#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ioteventsdata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ServiceUnavailableException": case "com.amazonaws.ioteventsdata#ServiceUnavailableException": throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.ioteventsdata#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.ioteventsdata#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iot-events/src/protocols/Aws_restJson1.ts b/clients/client-iot-events/src/protocols/Aws_restJson1.ts index c565210d5879..3c4c927b4044 100644 --- a/clients/client-iot-events/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-events/src/protocols/Aws_restJson1.ts @@ -711,7 +711,7 @@ export const de_CreateAlarmModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAlarmModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -728,50 +728,6 @@ export const de_CreateAlarmModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAlarmModelCommandError - */ -const de_CreateAlarmModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotevents#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotevents#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotevents#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDetectorModelCommand */ @@ -780,7 +736,7 @@ export const de_CreateDetectorModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDetectorModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -793,50 +749,6 @@ export const de_CreateDetectorModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDetectorModelCommandError - */ -const de_CreateDetectorModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotevents#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotevents#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotevents#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateInputCommand */ @@ -845,7 +757,7 @@ export const de_CreateInputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateInputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -858,44 +770,6 @@ export const de_CreateInputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateInputCommandError - */ -const de_CreateInputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotevents#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAlarmModelCommand */ @@ -904,7 +778,7 @@ export const de_DeleteAlarmModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAlarmModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -913,47 +787,6 @@ export const de_DeleteAlarmModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAlarmModelCommandError - */ -const de_DeleteAlarmModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotevents#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDetectorModelCommand */ @@ -962,7 +795,7 @@ export const de_DeleteDetectorModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDetectorModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -971,47 +804,6 @@ export const de_DeleteDetectorModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDetectorModelCommandError - */ -const de_DeleteDetectorModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotevents#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteInputCommand */ @@ -1020,7 +812,7 @@ export const de_DeleteInputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteInputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1029,47 +821,6 @@ export const de_DeleteInputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteInputCommandError - */ -const de_DeleteInputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotevents#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAlarmModelCommand */ @@ -1078,7 +829,7 @@ export const de_DescribeAlarmModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAlarmModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1106,52 +857,14 @@ export const de_DescribeAlarmModelCommand = async ( }; /** - * deserializeAws_restJson1DescribeAlarmModelCommandError + * deserializeAws_restJson1DescribeDetectorModelCommand */ -const de_DescribeAlarmModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDetectorModelCommand - */ -export const de_DescribeDetectorModelCommand = async ( +export const de_DescribeDetectorModelCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDetectorModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1164,44 +877,6 @@ export const de_DescribeDetectorModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDetectorModelCommandError - */ -const de_DescribeDetectorModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDetectorModelAnalysisCommand */ @@ -1210,7 +885,7 @@ export const de_DescribeDetectorModelAnalysisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDetectorModelAnalysisCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1223,44 +898,6 @@ export const de_DescribeDetectorModelAnalysisCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDetectorModelAnalysisCommandError - */ -const de_DescribeDetectorModelAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeInputCommand */ @@ -1269,7 +906,7 @@ export const de_DescribeInputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeInputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1282,44 +919,6 @@ export const de_DescribeInputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeInputCommandError - */ -const de_DescribeInputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeLoggingOptionsCommand */ @@ -1328,7 +927,7 @@ export const de_DescribeLoggingOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeLoggingOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1341,47 +940,6 @@ export const de_DescribeLoggingOptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeLoggingOptionsCommandError - */ -const de_DescribeLoggingOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.iotevents#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDetectorModelAnalysisResultsCommand */ @@ -1390,7 +948,7 @@ export const de_GetDetectorModelAnalysisResultsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDetectorModelAnalysisResultsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1404,44 +962,6 @@ export const de_GetDetectorModelAnalysisResultsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDetectorModelAnalysisResultsCommandError - */ -const de_GetDetectorModelAnalysisResultsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAlarmModelsCommand */ @@ -1450,7 +970,7 @@ export const de_ListAlarmModelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAlarmModelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1464,41 +984,6 @@ export const de_ListAlarmModelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAlarmModelsCommandError - */ -const de_ListAlarmModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAlarmModelVersionsCommand */ @@ -1507,7 +992,7 @@ export const de_ListAlarmModelVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAlarmModelVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1521,44 +1006,6 @@ export const de_ListAlarmModelVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAlarmModelVersionsCommandError - */ -const de_ListAlarmModelVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDetectorModelsCommand */ @@ -1567,7 +1014,7 @@ export const de_ListDetectorModelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDetectorModelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1581,41 +1028,6 @@ export const de_ListDetectorModelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDetectorModelsCommandError - */ -const de_ListDetectorModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDetectorModelVersionsCommand */ @@ -1624,7 +1036,7 @@ export const de_ListDetectorModelVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDetectorModelVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1638,44 +1050,6 @@ export const de_ListDetectorModelVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDetectorModelVersionsCommandError - */ -const de_ListDetectorModelVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListInputRoutingsCommand */ @@ -1684,7 +1058,7 @@ export const de_ListInputRoutingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInputRoutingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1698,44 +1072,6 @@ export const de_ListInputRoutingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListInputRoutingsCommandError - */ -const de_ListInputRoutingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListInputsCommand */ @@ -1744,7 +1080,7 @@ export const de_ListInputsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInputsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1752,162 +1088,48 @@ export const de_ListInputsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { inputSummaries: (_) => de_InputSummaries(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListInputsCommandError - */ -const de_ListInputsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotevents#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutLoggingOptionsCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_PutLoggingOptionsCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutLoggingOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutLoggingOptionsCommandError + * deserializeAws_restJson1PutLoggingOptionsCommand */ -const de_PutLoggingOptionsCommandError = async ( +export const de_PutLoggingOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotevents#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.iotevents#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -1918,7 +1140,7 @@ export const de_StartDetectorModelAnalysisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartDetectorModelAnalysisCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1931,44 +1153,6 @@ export const de_StartDetectorModelAnalysisCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartDetectorModelAnalysisCommandError - */ -const de_StartDetectorModelAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotevents#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1977,7 +1161,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1986,47 +1170,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotevents#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotevents#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2035,7 +1178,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2044,44 +1187,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotevents#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAlarmModelCommand */ @@ -2090,7 +1195,7 @@ export const de_UpdateAlarmModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAlarmModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2107,47 +1212,6 @@ export const de_UpdateAlarmModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAlarmModelCommandError - */ -const de_UpdateAlarmModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotevents#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDetectorModelCommand */ @@ -2156,7 +1220,7 @@ export const de_UpdateDetectorModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDetectorModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2169,47 +1233,6 @@ export const de_UpdateDetectorModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDetectorModelCommandError - */ -const de_UpdateDetectorModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotevents#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotevents#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotevents#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotevents#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotevents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateInputCommand */ @@ -2218,7 +1241,7 @@ export const de_UpdateInputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateInputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2232,12 +1255,9 @@ export const de_UpdateInputCommand = async ( }; /** - * deserializeAws_restJson1UpdateInputCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateInputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2250,25 +1270,34 @@ const de_UpdateInputCommandError = async ( case "InvalidRequestException": case "com.amazonaws.iotevents#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.iotevents#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.iotevents#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); case "ResourceInUseException": case "com.amazonaws.iotevents#ResourceInUseException": throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ServiceUnavailableException": case "com.amazonaws.iotevents#ServiceUnavailableException": throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.iotevents#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.iotevents#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "UnsupportedOperationException": + case "com.amazonaws.iotevents#UnsupportedOperationException": + throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts b/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts index 179daf5bcebc..cfe37d28e58a 100644 --- a/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-jobs-data-plane/src/protocols/Aws_restJson1.ts @@ -143,7 +143,7 @@ export const de_DescribeJobExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobExecutionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -156,47 +156,6 @@ export const de_DescribeJobExecutionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeJobExecutionCommandError - */ -const de_DescribeJobExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateValidationException": - case "com.amazonaws.iotjobsdataplane#CertificateValidationException": - throw await de_CertificateValidationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotjobsdataplane#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotjobsdataplane#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotjobsdataplane#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TerminalStateException": - case "com.amazonaws.iotjobsdataplane#TerminalStateException": - throw await de_TerminalStateExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotjobsdataplane#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPendingJobExecutionsCommand */ @@ -205,7 +164,7 @@ export const de_GetPendingJobExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPendingJobExecutionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -219,44 +178,6 @@ export const de_GetPendingJobExecutionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetPendingJobExecutionsCommandError - */ -const de_GetPendingJobExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateValidationException": - case "com.amazonaws.iotjobsdataplane#CertificateValidationException": - throw await de_CertificateValidationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotjobsdataplane#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotjobsdataplane#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotjobsdataplane#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotjobsdataplane#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartNextPendingJobExecutionCommand */ @@ -265,7 +186,7 @@ export const de_StartNextPendingJobExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartNextPendingJobExecutionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -278,44 +199,6 @@ export const de_StartNextPendingJobExecutionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartNextPendingJobExecutionCommandError - */ -const de_StartNextPendingJobExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateValidationException": - case "com.amazonaws.iotjobsdataplane#CertificateValidationException": - throw await de_CertificateValidationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotjobsdataplane#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotjobsdataplane#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotjobsdataplane#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotjobsdataplane#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateJobExecutionCommand */ @@ -324,7 +207,7 @@ export const de_UpdateJobExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateJobExecutionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -339,12 +222,9 @@ export const de_UpdateJobExecutionCommand = async ( }; /** - * deserializeAws_restJson1UpdateJobExecutionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateJobExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -357,25 +237,28 @@ const de_UpdateJobExecutionCommandError = async ( case "InvalidRequestException": case "com.amazonaws.iotjobsdataplane#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateTransitionException": - case "com.amazonaws.iotjobsdataplane#InvalidStateTransitionException": - throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.iotjobsdataplane#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ServiceUnavailableException": case "com.amazonaws.iotjobsdataplane#ServiceUnavailableException": throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "TerminalStateException": + case "com.amazonaws.iotjobsdataplane#TerminalStateException": + throw await de_TerminalStateExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.iotjobsdataplane#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "InvalidStateTransitionException": + case "com.amazonaws.iotjobsdataplane#InvalidStateTransitionException": + throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iot-roborunner/src/protocols/Aws_restJson1.ts b/clients/client-iot-roborunner/src/protocols/Aws_restJson1.ts index 9d5b6fe0aac1..db61fcfac9bd 100644 --- a/clients/client-iot-roborunner/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-roborunner/src/protocols/Aws_restJson1.ts @@ -520,7 +520,7 @@ export const de_CreateDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -537,50 +537,6 @@ export const de_CreateDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDestinationCommandError - */ -const de_CreateDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotroborunner#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iotroborunner#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSiteCommand */ @@ -589,7 +545,7 @@ export const de_CreateSiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -605,47 +561,6 @@ export const de_CreateSiteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSiteCommandError - */ -const de_CreateSiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotroborunner#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iotroborunner#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWorkerCommand */ @@ -654,7 +569,7 @@ export const de_CreateWorkerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWorkerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -671,50 +586,6 @@ export const de_CreateWorkerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWorkerCommandError - */ -const de_CreateWorkerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotroborunner#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iotroborunner#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWorkerFleetCommand */ @@ -723,7 +594,7 @@ export const de_CreateWorkerFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWorkerFleetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -739,50 +610,6 @@ export const de_CreateWorkerFleetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWorkerFleetCommandError - */ -const de_CreateWorkerFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotroborunner#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iotroborunner#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDestinationCommand */ @@ -791,7 +618,7 @@ export const de_DeleteDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -800,47 +627,6 @@ export const de_DeleteDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDestinationCommandError - */ -const de_DeleteDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotroborunner#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSiteCommand */ @@ -849,7 +635,7 @@ export const de_DeleteSiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -858,47 +644,6 @@ export const de_DeleteSiteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSiteCommandError - */ -const de_DeleteSiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotroborunner#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteWorkerCommand */ @@ -907,7 +652,7 @@ export const de_DeleteWorkerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteWorkerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -916,47 +661,6 @@ export const de_DeleteWorkerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteWorkerCommandError - */ -const de_DeleteWorkerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotroborunner#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteWorkerFleetCommand */ @@ -965,7 +669,7 @@ export const de_DeleteWorkerFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteWorkerFleetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -974,47 +678,6 @@ export const de_DeleteWorkerFleetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteWorkerFleetCommandError - */ -const de_DeleteWorkerFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotroborunner#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDestinationCommand */ @@ -1023,7 +686,7 @@ export const de_GetDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1043,44 +706,6 @@ export const de_GetDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDestinationCommandError - */ -const de_GetDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSiteCommand */ @@ -1089,7 +714,7 @@ export const de_GetSiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1108,44 +733,6 @@ export const de_GetSiteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSiteCommandError - */ -const de_GetSiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetWorkerCommand */ @@ -1154,7 +741,7 @@ export const de_GetWorkerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1178,44 +765,6 @@ export const de_GetWorkerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetWorkerCommandError - */ -const de_GetWorkerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetWorkerFleetCommand */ @@ -1224,7 +773,7 @@ export const de_GetWorkerFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkerFleetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1236,49 +785,11 @@ export const de_GetWorkerFleetCommand = async ( createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), id: __expectString, name: __expectString, - site: __expectString, - updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetWorkerFleetCommandError - */ -const de_GetWorkerFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + site: __expectString, + updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1289,7 +800,7 @@ export const de_ListDestinationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDestinationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1303,44 +814,6 @@ export const de_ListDestinationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDestinationsCommandError - */ -const de_ListDestinationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSitesCommand */ @@ -1349,7 +822,7 @@ export const de_ListSitesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSitesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1363,41 +836,6 @@ export const de_ListSitesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSitesCommandError - */ -const de_ListSitesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWorkerFleetsCommand */ @@ -1406,7 +844,7 @@ export const de_ListWorkerFleetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkerFleetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1420,44 +858,6 @@ export const de_ListWorkerFleetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListWorkerFleetsCommandError - */ -const de_ListWorkerFleetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWorkersCommand */ @@ -1466,7 +866,7 @@ export const de_ListWorkersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1480,44 +880,6 @@ export const de_ListWorkersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListWorkersCommandError - */ -const de_ListWorkersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDestinationCommand */ @@ -1526,7 +888,7 @@ export const de_UpdateDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1544,44 +906,6 @@ export const de_UpdateDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDestinationCommandError - */ -const de_UpdateDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSiteCommand */ @@ -1590,7 +914,7 @@ export const de_UpdateSiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1608,44 +932,6 @@ export const de_UpdateSiteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSiteCommandError - */ -const de_UpdateSiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWorkerCommand */ @@ -1654,7 +940,7 @@ export const de_UpdateWorkerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateWorkerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1676,44 +962,6 @@ export const de_UpdateWorkerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateWorkerCommandError - */ -const de_UpdateWorkerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotroborunner#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotroborunner#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotroborunner#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotroborunner#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotroborunner#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWorkerFleetCommand */ @@ -1722,7 +970,7 @@ export const de_UpdateWorkerFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateWorkerFleetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1740,12 +988,9 @@ export const de_UpdateWorkerFleetCommand = async ( }; /** - * deserializeAws_restJson1UpdateWorkerFleetCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateWorkerFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1755,12 +1000,18 @@ const de_UpdateWorkerFleetCommandError = async ( case "AccessDeniedException": case "com.amazonaws.iotroborunner#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.iotroborunner#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.iotroborunner#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.iotroborunner#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.iotroborunner#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.iotroborunner#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -1773,7 +1024,7 @@ const de_UpdateWorkerFleetCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts b/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts index b133f987cce7..a9ff2c8c5d23 100644 --- a/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot-wireless/src/protocols/Aws_restJson1.ts @@ -2770,7 +2770,7 @@ export const de_AssociateAwsAccountWithPartnerAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateAwsAccountWithPartnerAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2784,47 +2784,6 @@ export const de_AssociateAwsAccountWithPartnerAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateAwsAccountWithPartnerAccountCommandError - */ -const de_AssociateAwsAccountWithPartnerAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateMulticastGroupWithFuotaTaskCommand */ @@ -2833,7 +2792,7 @@ export const de_AssociateMulticastGroupWithFuotaTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_AssociateMulticastGroupWithFuotaTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2842,47 +2801,6 @@ export const de_AssociateMulticastGroupWithFuotaTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateMulticastGroupWithFuotaTaskCommandError - */ -const de_AssociateMulticastGroupWithFuotaTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateWirelessDeviceWithFuotaTaskCommand */ @@ -2891,7 +2809,7 @@ export const de_AssociateWirelessDeviceWithFuotaTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_AssociateWirelessDeviceWithFuotaTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2900,47 +2818,6 @@ export const de_AssociateWirelessDeviceWithFuotaTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateWirelessDeviceWithFuotaTaskCommandError - */ -const de_AssociateWirelessDeviceWithFuotaTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateWirelessDeviceWithMulticastGroupCommand */ @@ -2949,7 +2826,7 @@ export const de_AssociateWirelessDeviceWithMulticastGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_AssociateWirelessDeviceWithMulticastGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2958,47 +2835,6 @@ export const de_AssociateWirelessDeviceWithMulticastGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateWirelessDeviceWithMulticastGroupCommandError - */ -const de_AssociateWirelessDeviceWithMulticastGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateWirelessDeviceWithThingCommand */ @@ -3007,7 +2843,7 @@ export const de_AssociateWirelessDeviceWithThingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_AssociateWirelessDeviceWithThingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3016,47 +2852,6 @@ export const de_AssociateWirelessDeviceWithThingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateWirelessDeviceWithThingCommandError - */ -const de_AssociateWirelessDeviceWithThingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateWirelessGatewayWithCertificateCommand */ @@ -3065,7 +2860,7 @@ export const de_AssociateWirelessGatewayWithCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateWirelessGatewayWithCertificateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3079,55 +2874,31 @@ export const de_AssociateWirelessGatewayWithCertificateCommand = async ( }; /** - * deserializeAws_restJson1AssociateWirelessGatewayWithCertificateCommandError + * deserializeAws_restJson1AssociateWirelessGatewayWithThingCommand */ -const de_AssociateWirelessGatewayWithCertificateCommandError = async ( +export const de_AssociateWirelessGatewayWithThingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1AssociateWirelessGatewayWithThingCommand + * deserializeAws_restJson1CancelMulticastGroupSessionCommand */ -export const de_AssociateWirelessGatewayWithThingCommand = async ( +export const de_CancelMulticastGroupSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_AssociateWirelessGatewayWithThingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3137,113 +2908,80 @@ export const de_AssociateWirelessGatewayWithThingCommand = async ( }; /** - * deserializeAws_restJson1AssociateWirelessGatewayWithThingCommandError + * deserializeAws_restJson1CreateDestinationCommand */ -const de_AssociateWirelessGatewayWithThingCommandError = async ( +export const de_CreateDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Name: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CancelMulticastGroupSessionCommand + * deserializeAws_restJson1CreateDeviceProfileCommand */ -export const de_CancelMulticastGroupSessionCommand = async ( +export const de_CreateDeviceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_CancelMulticastGroupSessionCommandError(output, context); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Id: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CancelMulticastGroupSessionCommandError + * deserializeAws_restJson1CreateFuotaTaskCommand */ -const de_CancelMulticastGroupSessionCommandError = async ( +export const de_CreateFuotaTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Id: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateDestinationCommand + * deserializeAws_restJson1CreateMulticastGroupCommand */ -export const de_CreateDestinationCommand = async ( +export const de_CreateMulticastGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3251,62 +2989,43 @@ export const de_CreateDestinationCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { Arn: __expectString, - Name: __expectString, + Id: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateDestinationCommandError + * deserializeAws_restJson1CreateNetworkAnalyzerConfigurationCommand */ -const de_CreateDestinationCommandError = async ( +export const de_CreateNetworkAnalyzerConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Name: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateDeviceProfileCommand + * deserializeAws_restJson1CreateServiceProfileCommand */ -export const de_CreateDeviceProfileCommand = async ( +export const de_CreateServiceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDeviceProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3321,52 +3040,36 @@ export const de_CreateDeviceProfileCommand = async ( }; /** - * deserializeAws_restJson1CreateDeviceProfileCommandError + * deserializeAws_restJson1CreateWirelessDeviceCommand */ -const de_CreateDeviceProfileCommandError = async ( +export const de_CreateWirelessDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Id: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateFuotaTaskCommand + * deserializeAws_restJson1CreateWirelessGatewayCommand */ -export const de_CreateFuotaTaskCommand = async ( +export const de_CreateWirelessGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateFuotaTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3381,55 +3084,36 @@ export const de_CreateFuotaTaskCommand = async ( }; /** - * deserializeAws_restJson1CreateFuotaTaskCommandError + * deserializeAws_restJson1CreateWirelessGatewayTaskCommand */ -const de_CreateFuotaTaskCommandError = async ( +export const de_CreateWirelessGatewayTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Status: __expectString, + WirelessGatewayTaskDefinitionId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateMulticastGroupCommand + * deserializeAws_restJson1CreateWirelessGatewayTaskDefinitionCommand */ -export const de_CreateMulticastGroupCommand = async ( +export const de_CreateWirelessGatewayTaskDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateMulticastGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3444,427 +3128,235 @@ export const de_CreateMulticastGroupCommand = async ( }; /** - * deserializeAws_restJson1CreateMulticastGroupCommandError + * deserializeAws_restJson1DeleteDestinationCommand */ -const de_CreateMulticastGroupCommandError = async ( +export const de_DeleteDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateNetworkAnalyzerConfigurationCommand + * deserializeAws_restJson1DeleteDeviceProfileCommand */ -export const de_CreateNetworkAnalyzerConfigurationCommand = async ( +export const de_DeleteDeviceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateNetworkAnalyzerConfigurationCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - Name: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateNetworkAnalyzerConfigurationCommandError + * deserializeAws_restJson1DeleteFuotaTaskCommand */ -const de_CreateNetworkAnalyzerConfigurationCommandError = async ( +export const de_DeleteFuotaTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateServiceProfileCommand + * deserializeAws_restJson1DeleteMulticastGroupCommand */ -export const de_CreateServiceProfileCommand = async ( +export const de_DeleteMulticastGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateServiceProfileCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - Id: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateServiceProfileCommandError + * deserializeAws_restJson1DeleteNetworkAnalyzerConfigurationCommand */ -const de_CreateServiceProfileCommandError = async ( +export const de_DeleteNetworkAnalyzerConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateWirelessDeviceCommand + * deserializeAws_restJson1DeleteQueuedMessagesCommand */ -export const de_CreateWirelessDeviceCommand = async ( +export const de_DeleteQueuedMessagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateWirelessDeviceCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - Id: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateWirelessDeviceCommandError + * deserializeAws_restJson1DeleteServiceProfileCommand */ -const de_CreateWirelessDeviceCommandError = async ( +export const de_DeleteServiceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateWirelessGatewayCommand + * deserializeAws_restJson1DeleteWirelessDeviceCommand */ -export const de_CreateWirelessGatewayCommand = async ( +export const de_DeleteWirelessDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateWirelessGatewayCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - Id: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateWirelessGatewayCommandError + * deserializeAws_restJson1DeleteWirelessDeviceImportTaskCommand */ -const de_CreateWirelessGatewayCommandError = async ( +export const de_DeleteWirelessDeviceImportTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateWirelessGatewayTaskCommand + * deserializeAws_restJson1DeleteWirelessGatewayCommand */ -export const de_CreateWirelessGatewayTaskCommand = async ( +export const de_DeleteWirelessGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateWirelessGatewayTaskCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Status: __expectString, - WirelessGatewayTaskDefinitionId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateWirelessGatewayTaskCommandError + * deserializeAws_restJson1DeleteWirelessGatewayTaskCommand */ -const de_CreateWirelessGatewayTaskCommandError = async ( +export const de_DeleteWirelessGatewayTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateWirelessGatewayTaskDefinitionCommand + * deserializeAws_restJson1DeleteWirelessGatewayTaskDefinitionCommand */ -export const de_CreateWirelessGatewayTaskDefinitionCommand = async ( +export const de_DeleteWirelessGatewayTaskDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateWirelessGatewayTaskDefinitionCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - Id: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateWirelessGatewayTaskDefinitionCommandError + * deserializeAws_restJson1DeregisterWirelessDeviceCommand */ -const de_CreateWirelessGatewayTaskDefinitionCommandError = async ( +export const de_DeregisterWirelessDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteDestinationCommand + * deserializeAws_restJson1DisassociateAwsAccountFromPartnerAccountCommand */ -export const de_DeleteDestinationCommand = async ( +export const de_DisassociateAwsAccountFromPartnerAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3874,55 +3366,31 @@ export const de_DeleteDestinationCommand = async ( }; /** - * deserializeAws_restJson1DeleteDestinationCommandError + * deserializeAws_restJson1DisassociateMulticastGroupFromFuotaTaskCommand */ -const de_DeleteDestinationCommandError = async ( +export const de_DisassociateMulticastGroupFromFuotaTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteDeviceProfileCommand + * deserializeAws_restJson1DisassociateWirelessDeviceFromFuotaTaskCommand */ -export const de_DeleteDeviceProfileCommand = async ( +export const de_DisassociateWirelessDeviceFromFuotaTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDeviceProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3932,55 +3400,31 @@ export const de_DeleteDeviceProfileCommand = async ( }; /** - * deserializeAws_restJson1DeleteDeviceProfileCommandError + * deserializeAws_restJson1DisassociateWirelessDeviceFromMulticastGroupCommand */ -const de_DeleteDeviceProfileCommandError = async ( +export const de_DisassociateWirelessDeviceFromMulticastGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteFuotaTaskCommand + * deserializeAws_restJson1DisassociateWirelessDeviceFromThingCommand */ -export const de_DeleteFuotaTaskCommand = async ( +export const de_DisassociateWirelessDeviceFromThingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteFuotaTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3990,52 +3434,31 @@ export const de_DeleteFuotaTaskCommand = async ( }; /** - * deserializeAws_restJson1DeleteFuotaTaskCommandError + * deserializeAws_restJson1DisassociateWirelessGatewayFromCertificateCommand */ -const de_DeleteFuotaTaskCommandError = async ( +export const de_DisassociateWirelessGatewayFromCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteMulticastGroupCommand + * deserializeAws_restJson1DisassociateWirelessGatewayFromThingCommand */ -export const de_DeleteMulticastGroupCommand = async ( +export const de_DisassociateWirelessGatewayFromThingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteMulticastGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4045,3032 +3468,50 @@ export const de_DeleteMulticastGroupCommand = async ( }; /** - * deserializeAws_restJson1DeleteMulticastGroupCommandError + * deserializeAws_restJson1GetDestinationCommand */ -const de_DeleteMulticastGroupCommandError = async ( +export const de_GetDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteNetworkAnalyzerConfigurationCommand - */ -export const de_DeleteNetworkAnalyzerConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteNetworkAnalyzerConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteNetworkAnalyzerConfigurationCommandError - */ -const de_DeleteNetworkAnalyzerConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteQueuedMessagesCommand - */ -export const de_DeleteQueuedMessagesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteQueuedMessagesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteQueuedMessagesCommandError - */ -const de_DeleteQueuedMessagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteServiceProfileCommand - */ -export const de_DeleteServiceProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteServiceProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteServiceProfileCommandError - */ -const de_DeleteServiceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteWirelessDeviceCommand - */ -export const de_DeleteWirelessDeviceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteWirelessDeviceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteWirelessDeviceCommandError - */ -const de_DeleteWirelessDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteWirelessDeviceImportTaskCommand - */ -export const de_DeleteWirelessDeviceImportTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteWirelessDeviceImportTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteWirelessDeviceImportTaskCommandError - */ -const de_DeleteWirelessDeviceImportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteWirelessGatewayCommand - */ -export const de_DeleteWirelessGatewayCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteWirelessGatewayCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteWirelessGatewayCommandError - */ -const de_DeleteWirelessGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteWirelessGatewayTaskCommand - */ -export const de_DeleteWirelessGatewayTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteWirelessGatewayTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteWirelessGatewayTaskCommandError - */ -const de_DeleteWirelessGatewayTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteWirelessGatewayTaskDefinitionCommand - */ -export const de_DeleteWirelessGatewayTaskDefinitionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteWirelessGatewayTaskDefinitionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteWirelessGatewayTaskDefinitionCommandError - */ -const de_DeleteWirelessGatewayTaskDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeregisterWirelessDeviceCommand - */ -export const de_DeregisterWirelessDeviceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeregisterWirelessDeviceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeregisterWirelessDeviceCommandError - */ -const de_DeregisterWirelessDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateAwsAccountFromPartnerAccountCommand - */ -export const de_DisassociateAwsAccountFromPartnerAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DisassociateAwsAccountFromPartnerAccountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateAwsAccountFromPartnerAccountCommandError - */ -const de_DisassociateAwsAccountFromPartnerAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateMulticastGroupFromFuotaTaskCommand - */ -export const de_DisassociateMulticastGroupFromFuotaTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DisassociateMulticastGroupFromFuotaTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateMulticastGroupFromFuotaTaskCommandError - */ -const de_DisassociateMulticastGroupFromFuotaTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateWirelessDeviceFromFuotaTaskCommand - */ -export const de_DisassociateWirelessDeviceFromFuotaTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DisassociateWirelessDeviceFromFuotaTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateWirelessDeviceFromFuotaTaskCommandError - */ -const de_DisassociateWirelessDeviceFromFuotaTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateWirelessDeviceFromMulticastGroupCommand - */ -export const de_DisassociateWirelessDeviceFromMulticastGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DisassociateWirelessDeviceFromMulticastGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateWirelessDeviceFromMulticastGroupCommandError - */ -const de_DisassociateWirelessDeviceFromMulticastGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateWirelessDeviceFromThingCommand - */ -export const de_DisassociateWirelessDeviceFromThingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DisassociateWirelessDeviceFromThingCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateWirelessDeviceFromThingCommandError - */ -const de_DisassociateWirelessDeviceFromThingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateWirelessGatewayFromCertificateCommand - */ -export const de_DisassociateWirelessGatewayFromCertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DisassociateWirelessGatewayFromCertificateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateWirelessGatewayFromCertificateCommandError - */ -const de_DisassociateWirelessGatewayFromCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateWirelessGatewayFromThingCommand - */ -export const de_DisassociateWirelessGatewayFromThingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DisassociateWirelessGatewayFromThingCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateWirelessGatewayFromThingCommandError - */ -const de_DisassociateWirelessGatewayFromThingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDestinationCommand - */ -export const de_GetDestinationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDestinationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - Description: __expectString, - Expression: __expectString, - ExpressionType: __expectString, - Name: __expectString, - RoleArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDestinationCommandError - */ -const de_GetDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDeviceProfileCommand - */ -export const de_GetDeviceProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeviceProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - Id: __expectString, - LoRaWAN: _json, - Name: __expectString, - Sidewalk: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDeviceProfileCommandError - */ -const de_GetDeviceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEventConfigurationByResourceTypesCommand - */ -export const de_GetEventConfigurationByResourceTypesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEventConfigurationByResourceTypesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ConnectionStatus: _json, - DeviceRegistrationState: _json, - Join: _json, - MessageDeliveryStatus: _json, - Proximity: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEventConfigurationByResourceTypesCommandError - */ -const de_GetEventConfigurationByResourceTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFuotaTaskCommand - */ -export const de_GetFuotaTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFuotaTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - Description: __expectString, - FirmwareUpdateImage: __expectString, - FirmwareUpdateRole: __expectString, - FragmentIntervalMS: __expectInt32, - FragmentSizeBytes: __expectInt32, - Id: __expectString, - LoRaWAN: (_) => de_LoRaWANFuotaTaskGetInfo(_, context), - Name: __expectString, - RedundancyPercent: __expectInt32, - Status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFuotaTaskCommandError - */ -const de_GetFuotaTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetLogLevelsByResourceTypesCommand - */ -export const de_GetLogLevelsByResourceTypesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLogLevelsByResourceTypesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DefaultLogLevel: __expectString, - WirelessDeviceLogOptions: _json, - WirelessGatewayLogOptions: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetLogLevelsByResourceTypesCommandError - */ -const de_GetLogLevelsByResourceTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMulticastGroupCommand - */ -export const de_GetMulticastGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMulticastGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - Description: __expectString, - Id: __expectString, - LoRaWAN: _json, - Name: __expectString, - Status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMulticastGroupCommandError - */ -const de_GetMulticastGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMulticastGroupSessionCommand - */ -export const de_GetMulticastGroupSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMulticastGroupSessionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LoRaWAN: (_) => de_LoRaWANMulticastSession(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMulticastGroupSessionCommandError - */ -const de_GetMulticastGroupSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetNetworkAnalyzerConfigurationCommand - */ -export const de_GetNetworkAnalyzerConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetNetworkAnalyzerConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - Description: __expectString, - MulticastGroups: _json, - Name: __expectString, - TraceContent: _json, - WirelessDevices: _json, - WirelessGateways: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetNetworkAnalyzerConfigurationCommandError - */ -const de_GetNetworkAnalyzerConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPartnerAccountCommand - */ -export const de_GetPartnerAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPartnerAccountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AccountLinked: __expectBoolean, - Sidewalk: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPartnerAccountCommandError - */ -const de_GetPartnerAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPositionCommand - */ -export const de_GetPositionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPositionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Accuracy: (_) => de_Accuracy(_, context), - Position: (_) => de_PositionCoordinate(_, context), - SolverProvider: __expectString, - SolverType: __expectString, - SolverVersion: __expectString, - Timestamp: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPositionCommandError - */ -const de_GetPositionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPositionConfigurationCommand - */ -export const de_GetPositionConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPositionConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Destination: __expectString, - Solvers: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPositionConfigurationCommandError - */ -const de_GetPositionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPositionEstimateCommand - */ -export const de_GetPositionEstimateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPositionEstimateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: any = await collectBody(output.body, context); - contents.GeoJsonPayload = data; - return contents; -}; - -/** - * deserializeAws_restJson1GetPositionEstimateCommandError - */ -const de_GetPositionEstimateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetResourceEventConfigurationCommand - */ -export const de_GetResourceEventConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourceEventConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ConnectionStatus: _json, - DeviceRegistrationState: _json, - Join: _json, - MessageDeliveryStatus: _json, - Proximity: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetResourceEventConfigurationCommandError - */ -const de_GetResourceEventConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetResourceLogLevelCommand - */ -export const de_GetResourceLogLevelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourceLogLevelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LogLevel: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetResourceLogLevelCommandError - */ -const de_GetResourceLogLevelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetResourcePositionCommand - */ -export const de_GetResourcePositionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourcePositionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: any = await collectBody(output.body, context); - contents.GeoJsonPayload = data; - return contents; -}; - -/** - * deserializeAws_restJson1GetResourcePositionCommandError - */ -const de_GetResourcePositionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetServiceEndpointCommand - */ -export const de_GetServiceEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetServiceEndpointCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ServerTrust: __expectString, - ServiceEndpoint: __expectString, - ServiceType: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetServiceEndpointCommandError - */ -const de_GetServiceEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetServiceProfileCommand - */ -export const de_GetServiceProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetServiceProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - Id: __expectString, - LoRaWAN: _json, - Name: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetServiceProfileCommandError - */ -const de_GetServiceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetWirelessDeviceCommand - */ -export const de_GetWirelessDeviceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWirelessDeviceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - Description: __expectString, - DestinationName: __expectString, - Id: __expectString, - LoRaWAN: _json, - Name: __expectString, - Positioning: __expectString, - Sidewalk: _json, - ThingArn: __expectString, - ThingName: __expectString, - Type: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetWirelessDeviceCommandError - */ -const de_GetWirelessDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetWirelessDeviceImportTaskCommand - */ -export const de_GetWirelessDeviceImportTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWirelessDeviceImportTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - CreationTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - DestinationName: __expectString, - FailedImportedDeviceCount: __expectLong, - Id: __expectString, - InitializedImportedDeviceCount: __expectLong, - OnboardedImportedDeviceCount: __expectLong, - PendingImportedDeviceCount: __expectLong, - Sidewalk: _json, - Status: __expectString, - StatusReason: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetWirelessDeviceImportTaskCommandError - */ -const de_GetWirelessDeviceImportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetWirelessDeviceStatisticsCommand - */ -export const de_GetWirelessDeviceStatisticsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWirelessDeviceStatisticsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LastUplinkReceivedAt: __expectString, - LoRaWAN: (_) => de_LoRaWANDeviceMetadata(_, context), - Sidewalk: _json, - WirelessDeviceId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetWirelessDeviceStatisticsCommandError - */ -const de_GetWirelessDeviceStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetWirelessGatewayCommand - */ -export const de_GetWirelessGatewayCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWirelessGatewayCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - Description: __expectString, - Id: __expectString, - LoRaWAN: (_) => de_LoRaWANGateway(_, context), - Name: __expectString, - ThingArn: __expectString, - ThingName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetWirelessGatewayCommandError - */ -const de_GetWirelessGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetWirelessGatewayCertificateCommand - */ -export const de_GetWirelessGatewayCertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWirelessGatewayCertificateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - IotCertificateId: __expectString, - LoRaWANNetworkServerCertificateId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetWirelessGatewayCertificateCommandError - */ -const de_GetWirelessGatewayCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetWirelessGatewayFirmwareInformationCommand - */ -export const de_GetWirelessGatewayFirmwareInformationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWirelessGatewayFirmwareInformationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LoRaWAN: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetWirelessGatewayFirmwareInformationCommandError - */ -const de_GetWirelessGatewayFirmwareInformationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetWirelessGatewayStatisticsCommand - */ -export const de_GetWirelessGatewayStatisticsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWirelessGatewayStatisticsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ConnectionStatus: __expectString, - LastUplinkReceivedAt: __expectString, - WirelessGatewayId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetWirelessGatewayStatisticsCommandError - */ -const de_GetWirelessGatewayStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetWirelessGatewayTaskCommand - */ -export const de_GetWirelessGatewayTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWirelessGatewayTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LastUplinkReceivedAt: __expectString, - Status: __expectString, - TaskCreatedAt: __expectString, - WirelessGatewayId: __expectString, - WirelessGatewayTaskDefinitionId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetWirelessGatewayTaskCommandError - */ -const de_GetWirelessGatewayTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetWirelessGatewayTaskDefinitionCommand - */ -export const de_GetWirelessGatewayTaskDefinitionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWirelessGatewayTaskDefinitionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - AutoCreateTasks: __expectBoolean, - Name: __expectString, - Update: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetWirelessGatewayTaskDefinitionCommandError - */ -const de_GetWirelessGatewayTaskDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDestinationsCommand - */ -export const de_ListDestinationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDestinationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DestinationList: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDestinationsCommandError - */ -const de_ListDestinationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDeviceProfilesCommand - */ -export const de_ListDeviceProfilesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeviceProfilesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DeviceProfileList: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDeviceProfilesCommandError - */ -const de_ListDeviceProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDevicesForWirelessDeviceImportTaskCommand - */ -export const de_ListDevicesForWirelessDeviceImportTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDevicesForWirelessDeviceImportTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DestinationName: __expectString, - ImportedWirelessDeviceList: (_) => de_ImportedWirelessDeviceList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDevicesForWirelessDeviceImportTaskCommandError - */ -const de_ListDevicesForWirelessDeviceImportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListEventConfigurationsCommand - */ -export const de_ListEventConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEventConfigurationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - EventConfigurationsList: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListEventConfigurationsCommandError - */ -const de_ListEventConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListFuotaTasksCommand - */ -export const de_ListFuotaTasksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFuotaTasksCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - FuotaTaskList: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListFuotaTasksCommandError - */ -const de_ListFuotaTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListMulticastGroupsCommand - */ -export const de_ListMulticastGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMulticastGroupsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - MulticastGroupList: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListMulticastGroupsCommandError - */ -const de_ListMulticastGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListMulticastGroupsByFuotaTaskCommand - */ -export const de_ListMulticastGroupsByFuotaTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMulticastGroupsByFuotaTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - MulticastGroupList: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListMulticastGroupsByFuotaTaskCommandError - */ -const de_ListMulticastGroupsByFuotaTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListNetworkAnalyzerConfigurationsCommand - */ -export const de_ListNetworkAnalyzerConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNetworkAnalyzerConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NetworkAnalyzerConfigurationList: _json, - NextToken: __expectString, + Arn: __expectString, + Description: __expectString, + Expression: __expectString, + ExpressionType: __expectString, + Name: __expectString, + RoleArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListNetworkAnalyzerConfigurationsCommandError - */ -const de_ListNetworkAnalyzerConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPartnerAccountsCommand + * deserializeAws_restJson1GetDeviceProfileCommand */ -export const de_ListPartnerAccountsCommand = async ( +export const de_GetDeviceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPartnerAccountsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, + Arn: __expectString, + Id: __expectString, + LoRaWAN: _json, + Name: __expectString, Sidewalk: _json, }); Object.assign(contents, doc); @@ -7078,1320 +3519,1004 @@ export const de_ListPartnerAccountsCommand = async ( }; /** - * deserializeAws_restJson1ListPartnerAccountsCommandError - */ -const de_ListPartnerAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPositionConfigurationsCommand - */ -export const de_ListPositionConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPositionConfigurationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - PositionConfigurationList: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPositionConfigurationsCommandError - */ -const de_ListPositionConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListQueuedMessagesCommand + * deserializeAws_restJson1GetEventConfigurationByResourceTypesCommand */ -export const de_ListQueuedMessagesCommand = async ( +export const de_GetEventConfigurationByResourceTypesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListQueuedMessagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DownlinkQueueMessagesList: _json, - NextToken: __expectString, + ConnectionStatus: _json, + DeviceRegistrationState: _json, + Join: _json, + MessageDeliveryStatus: _json, + Proximity: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListQueuedMessagesCommandError - */ -const de_ListQueuedMessagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListServiceProfilesCommand + * deserializeAws_restJson1GetFuotaTaskCommand */ -export const de_ListServiceProfilesCommand = async ( +export const de_GetFuotaTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListServiceProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - ServiceProfileList: _json, + Arn: __expectString, + CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Description: __expectString, + FirmwareUpdateImage: __expectString, + FirmwareUpdateRole: __expectString, + FragmentIntervalMS: __expectInt32, + FragmentSizeBytes: __expectInt32, + Id: __expectString, + LoRaWAN: (_) => de_LoRaWANFuotaTaskGetInfo(_, context), + Name: __expectString, + RedundancyPercent: __expectInt32, + Status: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListServiceProfilesCommandError - */ -const de_ListServiceProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1GetLogLevelsByResourceTypesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_GetLogLevelsByResourceTypesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: _json, + DefaultLogLevel: __expectString, + WirelessDeviceLogOptions: _json, + WirelessGatewayLogOptions: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1GetMulticastGroupCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_GetMulticastGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Description: __expectString, + Id: __expectString, + LoRaWAN: _json, + Name: __expectString, + Status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListWirelessDeviceImportTasksCommand + * deserializeAws_restJson1GetMulticastGroupSessionCommand */ -export const de_ListWirelessDeviceImportTasksCommand = async ( +export const de_GetMulticastGroupSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWirelessDeviceImportTasksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - WirelessDeviceImportTaskList: (_) => de_WirelessDeviceImportTaskList(_, context), + LoRaWAN: (_) => de_LoRaWANMulticastSession(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListWirelessDeviceImportTasksCommandError + * deserializeAws_restJson1GetNetworkAnalyzerConfigurationCommand */ -const de_ListWirelessDeviceImportTasksCommandError = async ( +export const de_GetNetworkAnalyzerConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Description: __expectString, + MulticastGroups: _json, + Name: __expectString, + TraceContent: _json, + WirelessDevices: _json, + WirelessGateways: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListWirelessDevicesCommand + * deserializeAws_restJson1GetPartnerAccountCommand */ -export const de_ListWirelessDevicesCommand = async ( +export const de_GetPartnerAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWirelessDevicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - WirelessDeviceList: _json, + AccountLinked: __expectBoolean, + Sidewalk: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListWirelessDevicesCommandError + * deserializeAws_restJson1GetPositionCommand */ -const de_ListWirelessDevicesCommandError = async ( +export const de_GetPositionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Accuracy: (_) => de_Accuracy(_, context), + Position: (_) => de_PositionCoordinate(_, context), + SolverProvider: __expectString, + SolverType: __expectString, + SolverVersion: __expectString, + Timestamp: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListWirelessGatewaysCommand + * deserializeAws_restJson1GetPositionConfigurationCommand */ -export const de_ListWirelessGatewaysCommand = async ( +export const de_GetPositionConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWirelessGatewaysCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - WirelessGatewayList: (_) => de_WirelessGatewayStatisticsList(_, context), + Destination: __expectString, + Solvers: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListWirelessGatewaysCommandError + * deserializeAws_restJson1GetPositionEstimateCommand */ -const de_ListWirelessGatewaysCommandError = async ( +export const de_GetPositionEstimateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: any = await collectBody(output.body, context); + contents.GeoJsonPayload = data; + return contents; +}; + +/** + * deserializeAws_restJson1GetResourceEventConfigurationCommand + */ +export const de_GetResourceEventConfigurationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ConnectionStatus: _json, + DeviceRegistrationState: _json, + Join: _json, + MessageDeliveryStatus: _json, + Proximity: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListWirelessGatewayTaskDefinitionsCommand + * deserializeAws_restJson1GetResourceLogLevelCommand */ -export const de_ListWirelessGatewayTaskDefinitionsCommand = async ( +export const de_GetResourceLogLevelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWirelessGatewayTaskDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - TaskDefinitions: _json, + LogLevel: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListWirelessGatewayTaskDefinitionsCommandError + * deserializeAws_restJson1GetResourcePositionCommand */ -const de_ListWirelessGatewayTaskDefinitionsCommandError = async ( +export const de_GetResourcePositionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: any = await collectBody(output.body, context); + contents.GeoJsonPayload = data; + return contents; }; /** - * deserializeAws_restJson1PutPositionConfigurationCommand + * deserializeAws_restJson1GetServiceEndpointCommand */ -export const de_PutPositionConfigurationCommand = async ( +export const de_GetServiceEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutPositionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ServerTrust: __expectString, + ServiceEndpoint: __expectString, + ServiceType: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutPositionConfigurationCommandError + * deserializeAws_restJson1GetServiceProfileCommand */ -const de_PutPositionConfigurationCommandError = async ( +export const de_GetServiceProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Id: __expectString, + LoRaWAN: _json, + Name: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutResourceLogLevelCommand + * deserializeAws_restJson1GetWirelessDeviceCommand */ -export const de_PutResourceLogLevelCommand = async ( +export const de_GetWirelessDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutResourceLogLevelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Description: __expectString, + DestinationName: __expectString, + Id: __expectString, + LoRaWAN: _json, + Name: __expectString, + Positioning: __expectString, + Sidewalk: _json, + ThingArn: __expectString, + ThingName: __expectString, + Type: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutResourceLogLevelCommandError + * deserializeAws_restJson1GetWirelessDeviceImportTaskCommand */ -const de_PutResourceLogLevelCommandError = async ( +export const de_GetWirelessDeviceImportTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + CreationTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + DestinationName: __expectString, + FailedImportedDeviceCount: __expectLong, + Id: __expectString, + InitializedImportedDeviceCount: __expectLong, + OnboardedImportedDeviceCount: __expectLong, + PendingImportedDeviceCount: __expectLong, + Sidewalk: _json, + Status: __expectString, + StatusReason: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ResetAllResourceLogLevelsCommand + * deserializeAws_restJson1GetWirelessDeviceStatisticsCommand */ -export const de_ResetAllResourceLogLevelsCommand = async ( +export const de_GetWirelessDeviceStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_ResetAllResourceLogLevelsCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LastUplinkReceivedAt: __expectString, + LoRaWAN: (_) => de_LoRaWANDeviceMetadata(_, context), + Sidewalk: _json, + WirelessDeviceId: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ResetAllResourceLogLevelsCommandError + * deserializeAws_restJson1GetWirelessGatewayCommand */ -const de_ResetAllResourceLogLevelsCommandError = async ( +export const de_GetWirelessGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Description: __expectString, + Id: __expectString, + LoRaWAN: (_) => de_LoRaWANGateway(_, context), + Name: __expectString, + ThingArn: __expectString, + ThingName: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetWirelessGatewayCertificateCommand + */ +export const de_GetWirelessGatewayCertificateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + IotCertificateId: __expectString, + LoRaWANNetworkServerCertificateId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ResetResourceLogLevelCommand + * deserializeAws_restJson1GetWirelessGatewayFirmwareInformationCommand */ -export const de_ResetResourceLogLevelCommand = async ( +export const de_GetWirelessGatewayFirmwareInformationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_ResetResourceLogLevelCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LoRaWAN: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ResetResourceLogLevelCommandError + * deserializeAws_restJson1GetWirelessGatewayStatisticsCommand */ -const de_ResetResourceLogLevelCommandError = async ( +export const de_GetWirelessGatewayStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ConnectionStatus: __expectString, + LastUplinkReceivedAt: __expectString, + WirelessGatewayId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SendDataToMulticastGroupCommand + * deserializeAws_restJson1GetWirelessGatewayTaskCommand */ -export const de_SendDataToMulticastGroupCommand = async ( +export const de_GetWirelessGatewayTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_SendDataToMulticastGroupCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - MessageId: __expectString, + LastUplinkReceivedAt: __expectString, + Status: __expectString, + TaskCreatedAt: __expectString, + WirelessGatewayId: __expectString, + WirelessGatewayTaskDefinitionId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SendDataToMulticastGroupCommandError + * deserializeAws_restJson1GetWirelessGatewayTaskDefinitionCommand */ -const de_SendDataToMulticastGroupCommandError = async ( +export const de_GetWirelessGatewayTaskDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + AutoCreateTasks: __expectBoolean, + Name: __expectString, + Update: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SendDataToWirelessDeviceCommand + * deserializeAws_restJson1ListDestinationsCommand */ -export const de_SendDataToWirelessDeviceCommand = async ( +export const de_ListDestinationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_SendDataToWirelessDeviceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - MessageId: __expectString, + DestinationList: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SendDataToWirelessDeviceCommandError + * deserializeAws_restJson1ListDeviceProfilesCommand */ -const de_SendDataToWirelessDeviceCommandError = async ( +export const de_ListDeviceProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DeviceProfileList: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartBulkAssociateWirelessDeviceWithMulticastGroupCommand + * deserializeAws_restJson1ListDevicesForWirelessDeviceImportTaskCommand */ -export const de_StartBulkAssociateWirelessDeviceWithMulticastGroupCommand = async ( +export const de_ListDevicesForWirelessDeviceImportTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_StartBulkAssociateWirelessDeviceWithMulticastGroupCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DestinationName: __expectString, + ImportedWirelessDeviceList: (_) => de_ImportedWirelessDeviceList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartBulkAssociateWirelessDeviceWithMulticastGroupCommandError + * deserializeAws_restJson1ListEventConfigurationsCommand */ -const de_StartBulkAssociateWirelessDeviceWithMulticastGroupCommandError = async ( +export const de_ListEventConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EventConfigurationsList: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListFuotaTasksCommand + */ +export const de_ListFuotaTasksCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + FuotaTaskList: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand + * deserializeAws_restJson1ListMulticastGroupsCommand */ -export const de_StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand = async ( +export const de_ListMulticastGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_StartBulkDisassociateWirelessDeviceFromMulticastGroupCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + MulticastGroupList: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartBulkDisassociateWirelessDeviceFromMulticastGroupCommandError + * deserializeAws_restJson1ListMulticastGroupsByFuotaTaskCommand */ -const de_StartBulkDisassociateWirelessDeviceFromMulticastGroupCommandError = async ( +export const de_ListMulticastGroupsByFuotaTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + MulticastGroupList: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartFuotaTaskCommand + * deserializeAws_restJson1ListNetworkAnalyzerConfigurationsCommand */ -export const de_StartFuotaTaskCommand = async ( +export const de_ListNetworkAnalyzerConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_StartFuotaTaskCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NetworkAnalyzerConfigurationList: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartFuotaTaskCommandError + * deserializeAws_restJson1ListPartnerAccountsCommand */ -const de_StartFuotaTaskCommandError = async ( +export const de_ListPartnerAccountsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Sidewalk: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartMulticastGroupSessionCommand + * deserializeAws_restJson1ListPositionConfigurationsCommand */ -export const de_StartMulticastGroupSessionCommand = async ( +export const de_ListPositionConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_StartMulticastGroupSessionCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + PositionConfigurationList: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartMulticastGroupSessionCommandError + * deserializeAws_restJson1ListQueuedMessagesCommand */ -const de_StartMulticastGroupSessionCommandError = async ( +export const de_ListQueuedMessagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DownlinkQueueMessagesList: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartSingleWirelessDeviceImportTaskCommand + * deserializeAws_restJson1ListServiceProfilesCommand */ -export const de_StartSingleWirelessDeviceImportTaskCommand = async ( +export const de_ListServiceProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_StartSingleWirelessDeviceImportTaskCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - Id: __expectString, + NextToken: __expectString, + ServiceProfileList: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartSingleWirelessDeviceImportTaskCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_StartSingleWirelessDeviceImportTaskCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartWirelessDeviceImportTaskCommand + * deserializeAws_restJson1ListWirelessDeviceImportTasksCommand */ -export const de_StartWirelessDeviceImportTaskCommand = async ( +export const de_ListWirelessDeviceImportTasksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_StartWirelessDeviceImportTaskCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - Id: __expectString, + NextToken: __expectString, + WirelessDeviceImportTaskList: (_) => de_WirelessDeviceImportTaskList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartWirelessDeviceImportTaskCommandError + * deserializeAws_restJson1ListWirelessDevicesCommand */ -const de_StartWirelessDeviceImportTaskCommandError = async ( +export const de_ListWirelessDevicesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + WirelessDeviceList: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListWirelessGatewaysCommand */ -export const de_TagResourceCommand = async ( +export const de_ListWirelessGatewaysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + WirelessGatewayList: (_) => de_WirelessGatewayStatisticsList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1ListWirelessGatewayTaskDefinitionsCommand */ -const de_TagResourceCommandError = async ( +export const de_ListWirelessGatewayTaskDefinitionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.iotwireless#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + TaskDefinitions: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TestWirelessDeviceCommand + * deserializeAws_restJson1PutPositionConfigurationCommand */ -export const de_TestWirelessDeviceCommand = async ( +export const de_PutPositionConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TestWirelessDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Result: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1TestWirelessDeviceCommandError + * deserializeAws_restJson1PutResourceLogLevelCommand */ -const de_TestWirelessDeviceCommandError = async ( +export const de_PutResourceLogLevelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1ResetAllResourceLogLevelsCommand */ -export const de_UntagResourceCommand = async ( +export const de_ResetAllResourceLogLevelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8401,107 +4526,73 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1ResetResourceLogLevelCommand */ -const de_UntagResourceCommandError = async ( +export const de_ResetResourceLogLevelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateDestinationCommand + * deserializeAws_restJson1SendDataToMulticastGroupCommand */ -export const de_UpdateDestinationCommand = async ( +export const de_SendDataToMulticastGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateDestinationCommandError(output, context); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + MessageId: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateDestinationCommandError + * deserializeAws_restJson1SendDataToWirelessDeviceCommand */ -const de_UpdateDestinationCommandError = async ( +export const de_SendDataToWirelessDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + MessageId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateEventConfigurationByResourceTypesCommand + * deserializeAws_restJson1StartBulkAssociateWirelessDeviceWithMulticastGroupCommand */ -export const de_UpdateEventConfigurationByResourceTypesCommand = async ( +export const de_StartBulkAssociateWirelessDeviceWithMulticastGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateEventConfigurationByResourceTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8511,49 +4602,31 @@ export const de_UpdateEventConfigurationByResourceTypesCommand = async ( }; /** - * deserializeAws_restJson1UpdateEventConfigurationByResourceTypesCommandError + * deserializeAws_restJson1StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand */ -const de_UpdateEventConfigurationByResourceTypesCommandError = async ( +export const de_StartBulkDisassociateWirelessDeviceFromMulticastGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateFuotaTaskCommand + * deserializeAws_restJson1StartFuotaTaskCommand */ -export const de_UpdateFuotaTaskCommand = async ( +export const de_StartFuotaTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateFuotaTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8563,113 +4636,75 @@ export const de_UpdateFuotaTaskCommand = async ( }; /** - * deserializeAws_restJson1UpdateFuotaTaskCommandError + * deserializeAws_restJson1StartMulticastGroupSessionCommand */ -const de_UpdateFuotaTaskCommandError = async ( +export const de_StartMulticastGroupSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateLogLevelsByResourceTypesCommand + * deserializeAws_restJson1StartSingleWirelessDeviceImportTaskCommand */ -export const de_UpdateLogLevelsByResourceTypesCommand = async ( +export const de_StartSingleWirelessDeviceImportTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLogLevelsByResourceTypesCommandError(output, context); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Id: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateLogLevelsByResourceTypesCommandError + * deserializeAws_restJson1StartWirelessDeviceImportTaskCommand */ -const de_UpdateLogLevelsByResourceTypesCommandError = async ( +export const de_StartWirelessDeviceImportTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + Id: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateMulticastGroupCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UpdateMulticastGroupCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateMulticastGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8679,55 +4714,35 @@ export const de_UpdateMulticastGroupCommand = async ( }; /** - * deserializeAws_restJson1UpdateMulticastGroupCommandError + * deserializeAws_restJson1TestWirelessDeviceCommand */ -const de_UpdateMulticastGroupCommandError = async ( +export const de_TestWirelessDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Result: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateNetworkAnalyzerConfigurationCommand + * deserializeAws_restJson1UntagResourceCommand */ -export const de_UpdateNetworkAnalyzerConfigurationCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateNetworkAnalyzerConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8737,52 +4752,48 @@ export const de_UpdateNetworkAnalyzerConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateNetworkAnalyzerConfigurationCommandError + * deserializeAws_restJson1UpdateDestinationCommand */ -const de_UpdateNetworkAnalyzerConfigurationCommandError = async ( +export const de_UpdateDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateEventConfigurationByResourceTypesCommand + */ +export const de_UpdateEventConfigurationByResourceTypesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdatePartnerAccountCommand + * deserializeAws_restJson1UpdateFuotaTaskCommand */ -export const de_UpdatePartnerAccountCommand = async ( +export const de_UpdateFuotaTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdatePartnerAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8792,49 +4803,31 @@ export const de_UpdatePartnerAccountCommand = async ( }; /** - * deserializeAws_restJson1UpdatePartnerAccountCommandError + * deserializeAws_restJson1UpdateLogLevelsByResourceTypesCommand */ -const de_UpdatePartnerAccountCommandError = async ( +export const de_UpdateLogLevelsByResourceTypesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdatePositionCommand + * deserializeAws_restJson1UpdateMulticastGroupCommand */ -export const de_UpdatePositionCommand = async ( +export const de_UpdateMulticastGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdatePositionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8844,52 +4837,31 @@ export const de_UpdatePositionCommand = async ( }; /** - * deserializeAws_restJson1UpdatePositionCommandError + * deserializeAws_restJson1UpdateNetworkAnalyzerConfigurationCommand */ -const de_UpdatePositionCommandError = async ( +export const de_UpdateNetworkAnalyzerConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateResourceEventConfigurationCommand + * deserializeAws_restJson1UpdatePartnerAccountCommand */ -export const de_UpdateResourceEventConfigurationCommand = async ( +export const de_UpdatePartnerAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateResourceEventConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8899,55 +4871,31 @@ export const de_UpdateResourceEventConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateResourceEventConfigurationCommandError + * deserializeAws_restJson1UpdatePositionCommand */ -const de_UpdateResourceEventConfigurationCommandError = async ( +export const de_UpdatePositionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateResourcePositionCommand + * deserializeAws_restJson1UpdateResourceEventConfigurationCommand */ -export const de_UpdateResourcePositionCommand = async ( +export const de_UpdateResourceEventConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateResourcePositionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8957,41 +4905,20 @@ export const de_UpdateResourcePositionCommand = async ( }; /** - * deserializeAws_restJson1UpdateResourcePositionCommandError + * deserializeAws_restJson1UpdateResourcePositionCommand */ -const de_UpdateResourcePositionCommandError = async ( +export const de_UpdateResourcePositionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -9002,7 +4929,7 @@ export const de_UpdateWirelessDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateWirelessDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9011,44 +4938,6 @@ export const de_UpdateWirelessDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateWirelessDeviceCommandError - */ -const de_UpdateWirelessDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWirelessDeviceImportTaskCommand */ @@ -9057,7 +4946,7 @@ export const de_UpdateWirelessDeviceImportTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateWirelessDeviceImportTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9066,47 +4955,6 @@ export const de_UpdateWirelessDeviceImportTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateWirelessDeviceImportTaskCommandError - */ -const de_UpdateWirelessDeviceImportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotwireless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotwireless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotwireless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotwireless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotwireless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotwireless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWirelessGatewayCommand */ @@ -9115,7 +4963,7 @@ export const de_UpdateWirelessGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateWirelessGatewayCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9125,12 +4973,9 @@ export const de_UpdateWirelessGatewayCommand = async ( }; /** - * deserializeAws_restJson1UpdateWirelessGatewayCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateWirelessGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -9140,6 +4985,9 @@ const de_UpdateWirelessGatewayCommandError = async ( case "AccessDeniedException": case "com.amazonaws.iotwireless#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.iotwireless#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.iotwireless#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); @@ -9152,13 +5000,16 @@ const de_UpdateWirelessGatewayCommandError = async ( case "ValidationException": case "com.amazonaws.iotwireless#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.iotwireless#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iot/src/protocols/Aws_restJson1.ts b/clients/client-iot/src/protocols/Aws_restJson1.ts index be610b880695..d141b59f1e34 100644 --- a/clients/client-iot/src/protocols/Aws_restJson1.ts +++ b/clients/client-iot/src/protocols/Aws_restJson1.ts @@ -6405,7 +6405,7 @@ export const de_AcceptCertificateTransferCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptCertificateTransferCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6414,50 +6414,6 @@ export const de_AcceptCertificateTransferCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptCertificateTransferCommandError - */ -const de_AcceptCertificateTransferCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TransferAlreadyCompletedException": - case "com.amazonaws.iot#TransferAlreadyCompletedException": - throw await de_TransferAlreadyCompletedExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AddThingToBillingGroupCommand */ @@ -6466,7 +6422,7 @@ export const de_AddThingToBillingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AddThingToBillingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6475,41 +6431,6 @@ export const de_AddThingToBillingGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddThingToBillingGroupCommandError - */ -const de_AddThingToBillingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AddThingToThingGroupCommand */ @@ -6518,7 +6439,7 @@ export const de_AddThingToThingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AddThingToThingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6527,41 +6448,6 @@ export const de_AddThingToThingGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddThingToThingGroupCommandError - */ -const de_AddThingToThingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateTargetsWithJobCommand */ @@ -6570,7 +6456,7 @@ export const de_AssociateTargetsWithJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateTargetsWithJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6586,52 +6472,31 @@ export const de_AssociateTargetsWithJobCommand = async ( }; /** - * deserializeAws_restJson1AssociateTargetsWithJobCommandError + * deserializeAws_restJson1AttachPolicyCommand */ -const de_AssociateTargetsWithJobCommandError = async ( +export const de_AttachPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1AttachPolicyCommand + * deserializeAws_restJson1AttachPrincipalPolicyCommand */ -export const de_AttachPolicyCommand = async ( +export const de_AttachPrincipalPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AttachPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6641,58 +6506,31 @@ export const de_AttachPolicyCommand = async ( }; /** - * deserializeAws_restJson1AttachPolicyCommandError + * deserializeAws_restJson1AttachSecurityProfileCommand */ -const de_AttachPolicyCommandError = async ( +export const de_AttachSecurityProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1AttachPrincipalPolicyCommand + * deserializeAws_restJson1AttachThingPrincipalCommand */ -export const de_AttachPrincipalPolicyCommand = async ( +export const de_AttachThingPrincipalCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AttachPrincipalPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6702,58 +6540,31 @@ export const de_AttachPrincipalPolicyCommand = async ( }; /** - * deserializeAws_restJson1AttachPrincipalPolicyCommandError + * deserializeAws_restJson1CancelAuditMitigationActionsTaskCommand */ -const de_AttachPrincipalPolicyCommandError = async ( +export const de_CancelAuditMitigationActionsTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1AttachSecurityProfileCommand + * deserializeAws_restJson1CancelAuditTaskCommand */ -export const de_AttachSecurityProfileCommand = async ( +export const de_CancelAuditTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AttachSecurityProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6763,55 +6574,31 @@ export const de_AttachSecurityProfileCommand = async ( }; /** - * deserializeAws_restJson1AttachSecurityProfileCommandError + * deserializeAws_restJson1CancelCertificateTransferCommand */ -const de_AttachSecurityProfileCommandError = async ( +export const de_CancelCertificateTransferCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VersionConflictException": - case "com.amazonaws.iot#VersionConflictException": - throw await de_VersionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1AttachThingPrincipalCommand + * deserializeAws_restJson1CancelDetectMitigationActionsTaskCommand */ -export const de_AttachThingPrincipalCommand = async ( +export const de_CancelDetectMitigationActionsTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AttachThingPrincipalCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6821,55 +6608,37 @@ export const de_AttachThingPrincipalCommand = async ( }; /** - * deserializeAws_restJson1AttachThingPrincipalCommandError + * deserializeAws_restJson1CancelJobCommand */ -const de_AttachThingPrincipalCommandError = async ( +export const de_CancelJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + description: __expectString, + jobArn: __expectString, + jobId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CancelAuditMitigationActionsTaskCommand + * deserializeAws_restJson1CancelJobExecutionCommand */ -export const de_CancelAuditMitigationActionsTaskCommand = async ( +export const de_CancelJobExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelAuditMitigationActionsTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6879,49 +6648,31 @@ export const de_CancelAuditMitigationActionsTaskCommand = async ( }; /** - * deserializeAws_restJson1CancelAuditMitigationActionsTaskCommandError + * deserializeAws_restJson1ClearDefaultAuthorizerCommand */ -const de_CancelAuditMitigationActionsTaskCommandError = async ( +export const de_ClearDefaultAuthorizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CancelAuditTaskCommand + * deserializeAws_restJson1ConfirmTopicRuleDestinationCommand */ -export const de_CancelAuditTaskCommand = async ( +export const de_ConfirmTopicRuleDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelAuditTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6931,11038 +6682,2795 @@ export const de_CancelAuditTaskCommand = async ( }; /** - * deserializeAws_restJson1CancelAuditTaskCommandError + * deserializeAws_restJson1CreateAuditSuppressionCommand */ -const de_CancelAuditTaskCommandError = async ( +export const de_CreateAuditSuppressionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CancelCertificateTransferCommand + * deserializeAws_restJson1CreateAuthorizerCommand */ -export const de_CancelCertificateTransferCommand = async ( +export const de_CreateAuthorizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelCertificateTransferCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + authorizerArn: __expectString, + authorizerName: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CancelCertificateTransferCommandError + * deserializeAws_restJson1CreateBillingGroupCommand */ -const de_CancelCertificateTransferCommandError = async ( +export const de_CreateBillingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TransferAlreadyCompletedException": - case "com.amazonaws.iot#TransferAlreadyCompletedException": - throw await de_TransferAlreadyCompletedExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + billingGroupArn: __expectString, + billingGroupId: __expectString, + billingGroupName: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CancelDetectMitigationActionsTaskCommand + * deserializeAws_restJson1CreateCertificateFromCsrCommand */ -export const de_CancelDetectMitigationActionsTaskCommand = async ( +export const de_CreateCertificateFromCsrCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelDetectMitigationActionsTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + certificateArn: __expectString, + certificateId: __expectString, + certificatePem: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CancelDetectMitigationActionsTaskCommandError + * deserializeAws_restJson1CreateCertificateProviderCommand */ -const de_CancelDetectMitigationActionsTaskCommandError = async ( +export const de_CreateCertificateProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + certificateProviderArn: __expectString, + certificateProviderName: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CancelJobCommand + * deserializeAws_restJson1CreateCustomMetricCommand */ -export const de_CancelJobCommand = async ( +export const de_CreateCustomMetricCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - description: __expectString, - jobArn: __expectString, - jobId: __expectString, + metricArn: __expectString, + metricName: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CancelJobCommandError + * deserializeAws_restJson1CreateDimensionCommand */ -const de_CancelJobCommandError = async ( +export const de_CreateDimensionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + arn: __expectString, + name: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CancelJobExecutionCommand + * deserializeAws_restJson1CreateDomainConfigurationCommand */ -export const de_CancelJobExecutionCommand = async ( +export const de_CreateDomainConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelJobExecutionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + domainConfigurationArn: __expectString, + domainConfigurationName: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CancelJobExecutionCommandError + * deserializeAws_restJson1CreateDynamicThingGroupCommand */ -const de_CancelJobExecutionCommandError = async ( +export const de_CreateDynamicThingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateTransitionException": - case "com.amazonaws.iot#InvalidStateTransitionException": - throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VersionConflictException": - case "com.amazonaws.iot#VersionConflictException": - throw await de_VersionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + indexName: __expectString, + queryString: __expectString, + queryVersion: __expectString, + thingGroupArn: __expectString, + thingGroupId: __expectString, + thingGroupName: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ClearDefaultAuthorizerCommand + * deserializeAws_restJson1CreateFleetMetricCommand */ -export const de_ClearDefaultAuthorizerCommand = async ( +export const de_CreateFleetMetricCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ClearDefaultAuthorizerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + metricArn: __expectString, + metricName: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ClearDefaultAuthorizerCommandError + * deserializeAws_restJson1CreateJobCommand */ -const de_ClearDefaultAuthorizerCommandError = async ( +export const de_CreateJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + description: __expectString, + jobArn: __expectString, + jobId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ConfirmTopicRuleDestinationCommand + * deserializeAws_restJson1CreateJobTemplateCommand */ -export const de_ConfirmTopicRuleDestinationCommand = async ( +export const de_CreateJobTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ConfirmTopicRuleDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + jobTemplateArn: __expectString, + jobTemplateId: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ConfirmTopicRuleDestinationCommandError + * deserializeAws_restJson1CreateKeysAndCertificateCommand */ -const de_ConfirmTopicRuleDestinationCommandError = async ( +export const de_CreateKeysAndCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingResourceUpdateException": - case "com.amazonaws.iot#ConflictingResourceUpdateException": - throw await de_ConflictingResourceUpdateExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + certificateArn: __expectString, + certificateId: __expectString, + certificatePem: __expectString, + keyPair: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateAuditSuppressionCommand + * deserializeAws_restJson1CreateMitigationActionCommand */ -export const de_CreateAuditSuppressionCommand = async ( +export const de_CreateMitigationActionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAuditSuppressionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + actionArn: __expectString, + actionId: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateAuditSuppressionCommandError + * deserializeAws_restJson1CreateOTAUpdateCommand */ -const de_CreateAuditSuppressionCommandError = async ( +export const de_CreateOTAUpdateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + awsIotJobArn: __expectString, + awsIotJobId: __expectString, + otaUpdateArn: __expectString, + otaUpdateId: __expectString, + otaUpdateStatus: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateAuthorizerCommand + * deserializeAws_restJson1CreatePackageCommand */ -export const de_CreateAuthorizerCommand = async ( +export const de_CreatePackageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAuthorizerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - authorizerArn: __expectString, - authorizerName: __expectString, + description: __expectString, + packageArn: __expectString, + packageName: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateAuthorizerCommandError + * deserializeAws_restJson1CreatePackageVersionCommand */ -const de_CreateAuthorizerCommandError = async ( +export const de_CreatePackageVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + attributes: _json, + description: __expectString, + errorReason: __expectString, + packageName: __expectString, + packageVersionArn: __expectString, + status: __expectString, + versionName: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateBillingGroupCommand + * deserializeAws_restJson1CreatePolicyCommand */ -export const de_CreateBillingGroupCommand = async ( +export const de_CreatePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBillingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - billingGroupArn: __expectString, - billingGroupId: __expectString, - billingGroupName: __expectString, + policyArn: __expectString, + policyDocument: __expectString, + policyName: __expectString, + policyVersionId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateBillingGroupCommandError + * deserializeAws_restJson1CreatePolicyVersionCommand */ -const de_CreateBillingGroupCommandError = async ( +export const de_CreatePolicyVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + isDefaultVersion: __expectBoolean, + policyArn: __expectString, + policyDocument: __expectString, + policyVersionId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateCertificateFromCsrCommand + * deserializeAws_restJson1CreateProvisioningClaimCommand */ -export const de_CreateCertificateFromCsrCommand = async ( +export const de_CreateProvisioningClaimCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCertificateFromCsrCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - certificateArn: __expectString, certificateId: __expectString, certificatePem: __expectString, + expiration: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + keyPair: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateCertificateFromCsrCommandError + * deserializeAws_restJson1CreateProvisioningTemplateCommand */ -const de_CreateCertificateFromCsrCommandError = async ( +export const de_CreateProvisioningTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + defaultVersionId: __expectInt32, + templateArn: __expectString, + templateName: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateCertificateProviderCommand + * deserializeAws_restJson1CreateProvisioningTemplateVersionCommand */ -export const de_CreateCertificateProviderCommand = async ( +export const de_CreateProvisioningTemplateVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCertificateProviderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - certificateProviderArn: __expectString, - certificateProviderName: __expectString, + isDefaultVersion: __expectBoolean, + templateArn: __expectString, + templateName: __expectString, + versionId: __expectInt32, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateCertificateProviderCommandError + * deserializeAws_restJson1CreateRoleAliasCommand */ -const de_CreateCertificateProviderCommandError = async ( +export const de_CreateRoleAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateCustomMetricCommand - */ -export const de_CreateCustomMetricCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCustomMetricCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - metricArn: __expectString, - metricName: __expectString, + roleAlias: __expectString, + roleAliasArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateCustomMetricCommandError + * deserializeAws_restJson1CreateScheduledAuditCommand */ -const de_CreateCustomMetricCommandError = async ( +export const de_CreateScheduledAuditCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + scheduledAuditArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateDimensionCommand + * deserializeAws_restJson1CreateSecurityProfileCommand */ -export const de_CreateDimensionCommand = async ( +export const de_CreateSecurityProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDimensionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - arn: __expectString, - name: __expectString, + securityProfileArn: __expectString, + securityProfileName: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateDimensionCommandError + * deserializeAws_restJson1CreateStreamCommand */ -const de_CreateDimensionCommandError = async ( +export const de_CreateStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + description: __expectString, + streamArn: __expectString, + streamId: __expectString, + streamVersion: __expectInt32, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateDomainConfigurationCommand + * deserializeAws_restJson1CreateThingCommand */ -export const de_CreateDomainConfigurationCommand = async ( +export const de_CreateThingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDomainConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - domainConfigurationArn: __expectString, - domainConfigurationName: __expectString, + thingArn: __expectString, + thingId: __expectString, + thingName: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateDomainConfigurationCommandError + * deserializeAws_restJson1CreateThingGroupCommand */ -const de_CreateDomainConfigurationCommandError = async ( +export const de_CreateThingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateValidationException": - case "com.amazonaws.iot#CertificateValidationException": - throw await de_CertificateValidationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + thingGroupArn: __expectString, + thingGroupId: __expectString, + thingGroupName: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateDynamicThingGroupCommand + * deserializeAws_restJson1CreateThingTypeCommand */ -export const de_CreateDynamicThingGroupCommand = async ( +export const de_CreateThingTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDynamicThingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - indexName: __expectString, - queryString: __expectString, - queryVersion: __expectString, - thingGroupArn: __expectString, - thingGroupId: __expectString, - thingGroupName: __expectString, + thingTypeArn: __expectString, + thingTypeId: __expectString, + thingTypeName: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateDynamicThingGroupCommandError + * deserializeAws_restJson1CreateTopicRuleCommand */ -const de_CreateDynamicThingGroupCommandError = async ( +export const de_CreateTopicRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidQueryException": - case "com.amazonaws.iot#InvalidQueryException": - throw await de_InvalidQueryExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateFleetMetricCommand + * deserializeAws_restJson1CreateTopicRuleDestinationCommand */ -export const de_CreateFleetMetricCommand = async ( +export const de_CreateTopicRuleDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFleetMetricCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - metricArn: __expectString, - metricName: __expectString, + topicRuleDestination: (_) => de_TopicRuleDestination(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateFleetMetricCommandError - */ -const de_CreateFleetMetricCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IndexNotReadyException": - case "com.amazonaws.iot#IndexNotReadyException": - throw await de_IndexNotReadyExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidAggregationException": - case "com.amazonaws.iot#InvalidAggregationException": - throw await de_InvalidAggregationExceptionRes(parsedOutput, context); - case "InvalidQueryException": - case "com.amazonaws.iot#InvalidQueryException": - throw await de_InvalidQueryExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateJobCommand - */ -export const de_CreateJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - description: __expectString, - jobArn: __expectString, - jobId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateJobCommandError - */ -const de_CreateJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateJobTemplateCommand - */ -export const de_CreateJobTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateJobTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - jobTemplateArn: __expectString, - jobTemplateId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateJobTemplateCommandError - */ -const de_CreateJobTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.iot#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateKeysAndCertificateCommand - */ -export const de_CreateKeysAndCertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateKeysAndCertificateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - certificateArn: __expectString, - certificateId: __expectString, - certificatePem: __expectString, - keyPair: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateKeysAndCertificateCommandError - */ -const de_CreateKeysAndCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateMitigationActionCommand - */ -export const de_CreateMitigationActionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMitigationActionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - actionArn: __expectString, - actionId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateMitigationActionCommandError - */ -const de_CreateMitigationActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateOTAUpdateCommand - */ -export const de_CreateOTAUpdateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateOTAUpdateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - awsIotJobArn: __expectString, - awsIotJobId: __expectString, - otaUpdateArn: __expectString, - otaUpdateId: __expectString, - otaUpdateStatus: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateOTAUpdateCommandError - */ -const de_CreateOTAUpdateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreatePackageCommand - */ -export const de_CreatePackageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePackageCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - description: __expectString, - packageArn: __expectString, - packageName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreatePackageCommandError - */ -const de_CreatePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.iot#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iot#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iot#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iot#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreatePackageVersionCommand - */ -export const de_CreatePackageVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePackageVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - attributes: _json, - description: __expectString, - errorReason: __expectString, - packageName: __expectString, - packageVersionArn: __expectString, - status: __expectString, - versionName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreatePackageVersionCommandError - */ -const de_CreatePackageVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.iot#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iot#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iot#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iot#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreatePolicyCommand - */ -export const de_CreatePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - policyArn: __expectString, - policyDocument: __expectString, - policyName: __expectString, - policyVersionId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreatePolicyCommandError - */ -const de_CreatePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MalformedPolicyException": - case "com.amazonaws.iot#MalformedPolicyException": - throw await de_MalformedPolicyExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreatePolicyVersionCommand - */ -export const de_CreatePolicyVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePolicyVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - isDefaultVersion: __expectBoolean, - policyArn: __expectString, - policyDocument: __expectString, - policyVersionId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreatePolicyVersionCommandError - */ -const de_CreatePolicyVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MalformedPolicyException": - case "com.amazonaws.iot#MalformedPolicyException": - throw await de_MalformedPolicyExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "VersionsLimitExceededException": - case "com.amazonaws.iot#VersionsLimitExceededException": - throw await de_VersionsLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateProvisioningClaimCommand - */ -export const de_CreateProvisioningClaimCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateProvisioningClaimCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - certificateId: __expectString, - certificatePem: __expectString, - expiration: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - keyPair: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateProvisioningClaimCommandError - */ -const de_CreateProvisioningClaimCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateProvisioningTemplateCommand - */ -export const de_CreateProvisioningTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateProvisioningTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - defaultVersionId: __expectInt32, - templateArn: __expectString, - templateName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateProvisioningTemplateCommandError - */ -const de_CreateProvisioningTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateProvisioningTemplateVersionCommand - */ -export const de_CreateProvisioningTemplateVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateProvisioningTemplateVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - isDefaultVersion: __expectBoolean, - templateArn: __expectString, - templateName: __expectString, - versionId: __expectInt32, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateProvisioningTemplateVersionCommandError - */ -const de_CreateProvisioningTemplateVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingResourceUpdateException": - case "com.amazonaws.iot#ConflictingResourceUpdateException": - throw await de_ConflictingResourceUpdateExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "VersionsLimitExceededException": - case "com.amazonaws.iot#VersionsLimitExceededException": - throw await de_VersionsLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateRoleAliasCommand - */ -export const de_CreateRoleAliasCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRoleAliasCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - roleAlias: __expectString, - roleAliasArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateRoleAliasCommandError - */ -const de_CreateRoleAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateScheduledAuditCommand - */ -export const de_CreateScheduledAuditCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateScheduledAuditCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - scheduledAuditArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateScheduledAuditCommandError - */ -const de_CreateScheduledAuditCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateSecurityProfileCommand - */ -export const de_CreateSecurityProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSecurityProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - securityProfileArn: __expectString, - securityProfileName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateSecurityProfileCommandError - */ -const de_CreateSecurityProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateStreamCommand - */ -export const de_CreateStreamCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateStreamCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - description: __expectString, - streamArn: __expectString, - streamId: __expectString, - streamVersion: __expectInt32, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateStreamCommandError - */ -const de_CreateStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateThingCommand - */ -export const de_CreateThingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateThingCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - thingArn: __expectString, - thingId: __expectString, - thingName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateThingCommandError - */ -const de_CreateThingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateThingGroupCommand - */ -export const de_CreateThingGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateThingGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - thingGroupArn: __expectString, - thingGroupId: __expectString, - thingGroupName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateThingGroupCommandError - */ -const de_CreateThingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateThingTypeCommand - */ -export const de_CreateThingTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateThingTypeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - thingTypeArn: __expectString, - thingTypeId: __expectString, - thingTypeName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateThingTypeCommandError - */ -const de_CreateThingTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateTopicRuleCommand - */ -export const de_CreateTopicRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTopicRuleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1CreateTopicRuleCommandError - */ -const de_CreateTopicRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingResourceUpdateException": - case "com.amazonaws.iot#ConflictingResourceUpdateException": - throw await de_ConflictingResourceUpdateExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "SqlParseException": - case "com.amazonaws.iot#SqlParseException": - throw await de_SqlParseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateTopicRuleDestinationCommand - */ -export const de_CreateTopicRuleDestinationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTopicRuleDestinationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - topicRuleDestination: (_) => de_TopicRuleDestination(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateTopicRuleDestinationCommandError - */ -const de_CreateTopicRuleDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingResourceUpdateException": - case "com.amazonaws.iot#ConflictingResourceUpdateException": - throw await de_ConflictingResourceUpdateExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAccountAuditConfigurationCommand - */ -export const de_DeleteAccountAuditConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAccountAuditConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteAccountAuditConfigurationCommandError - */ -const de_DeleteAccountAuditConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAuditSuppressionCommand - */ -export const de_DeleteAuditSuppressionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAuditSuppressionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteAuditSuppressionCommandError - */ -const de_DeleteAuditSuppressionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAuthorizerCommand - */ -export const de_DeleteAuthorizerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAuthorizerCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteAuthorizerCommandError - */ -const de_DeleteAuthorizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeleteConflictException": - case "com.amazonaws.iot#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteBillingGroupCommand - */ -export const de_DeleteBillingGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBillingGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteBillingGroupCommandError - */ -const de_DeleteBillingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VersionConflictException": - case "com.amazonaws.iot#VersionConflictException": - throw await de_VersionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteCACertificateCommand - */ -export const de_DeleteCACertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCACertificateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteCACertificateCommandError - */ -const de_DeleteCACertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateStateException": - case "com.amazonaws.iot#CertificateStateException": - throw await de_CertificateStateExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteCertificateCommand - */ -export const de_DeleteCertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCertificateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteCertificateCommandError - */ -const de_DeleteCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateStateException": - case "com.amazonaws.iot#CertificateStateException": - throw await de_CertificateStateExceptionRes(parsedOutput, context); - case "DeleteConflictException": - case "com.amazonaws.iot#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteCertificateProviderCommand - */ -export const de_DeleteCertificateProviderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCertificateProviderCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteCertificateProviderCommandError - */ -const de_DeleteCertificateProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeleteConflictException": - case "com.amazonaws.iot#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteCustomMetricCommand - */ -export const de_DeleteCustomMetricCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCustomMetricCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteCustomMetricCommandError - */ -const de_DeleteCustomMetricCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDimensionCommand - */ -export const de_DeleteDimensionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDimensionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteDimensionCommandError - */ -const de_DeleteDimensionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDomainConfigurationCommand - */ -export const de_DeleteDomainConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDomainConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteDomainConfigurationCommandError - */ -const de_DeleteDomainConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDynamicThingGroupCommand - */ -export const de_DeleteDynamicThingGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDynamicThingGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteDynamicThingGroupCommandError - */ -const de_DeleteDynamicThingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VersionConflictException": - case "com.amazonaws.iot#VersionConflictException": - throw await de_VersionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteFleetMetricCommand - */ -export const de_DeleteFleetMetricCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFleetMetricCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteFleetMetricCommandError - */ -const de_DeleteFleetMetricCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "VersionConflictException": - case "com.amazonaws.iot#VersionConflictException": - throw await de_VersionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteJobCommand - */ -export const de_DeleteJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteJobCommandError - */ -const de_DeleteJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateTransitionException": - case "com.amazonaws.iot#InvalidStateTransitionException": - throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteJobExecutionCommand - */ -export const de_DeleteJobExecutionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteJobExecutionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteJobExecutionCommandError - */ -const de_DeleteJobExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidStateTransitionException": - case "com.amazonaws.iot#InvalidStateTransitionException": - throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteJobTemplateCommand - */ -export const de_DeleteJobTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteJobTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteJobTemplateCommandError - */ -const de_DeleteJobTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteMitigationActionCommand - */ -export const de_DeleteMitigationActionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMitigationActionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteMitigationActionCommandError - */ -const de_DeleteMitigationActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteOTAUpdateCommand - */ -export const de_DeleteOTAUpdateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteOTAUpdateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteOTAUpdateCommandError - */ -const de_DeleteOTAUpdateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "VersionConflictException": - case "com.amazonaws.iot#VersionConflictException": - throw await de_VersionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePackageCommand - */ -export const de_DeletePackageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePackageCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeletePackageCommandError - */ -const de_DeletePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iot#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iot#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePackageVersionCommand - */ -export const de_DeletePackageVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePackageVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeletePackageVersionCommandError - */ -const de_DeletePackageVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iot#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iot#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePolicyCommand - */ -export const de_DeletePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeletePolicyCommandError - */ -const de_DeletePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeleteConflictException": - case "com.amazonaws.iot#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePolicyVersionCommand - */ -export const de_DeletePolicyVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePolicyVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeletePolicyVersionCommandError - */ -const de_DeletePolicyVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeleteConflictException": - case "com.amazonaws.iot#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteProvisioningTemplateCommand - */ -export const de_DeleteProvisioningTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProvisioningTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteProvisioningTemplateCommandError - */ -const de_DeleteProvisioningTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingResourceUpdateException": - case "com.amazonaws.iot#ConflictingResourceUpdateException": - throw await de_ConflictingResourceUpdateExceptionRes(parsedOutput, context); - case "DeleteConflictException": - case "com.amazonaws.iot#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteProvisioningTemplateVersionCommand - */ -export const de_DeleteProvisioningTemplateVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProvisioningTemplateVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteProvisioningTemplateVersionCommandError - */ -const de_DeleteProvisioningTemplateVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingResourceUpdateException": - case "com.amazonaws.iot#ConflictingResourceUpdateException": - throw await de_ConflictingResourceUpdateExceptionRes(parsedOutput, context); - case "DeleteConflictException": - case "com.amazonaws.iot#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRegistrationCodeCommand - */ -export const de_DeleteRegistrationCodeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRegistrationCodeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRegistrationCodeCommandError - */ -const de_DeleteRegistrationCodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRoleAliasCommand - */ -export const de_DeleteRoleAliasCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRoleAliasCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRoleAliasCommandError - */ -const de_DeleteRoleAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeleteConflictException": - case "com.amazonaws.iot#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteScheduledAuditCommand - */ -export const de_DeleteScheduledAuditCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteScheduledAuditCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteScheduledAuditCommandError - */ -const de_DeleteScheduledAuditCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSecurityProfileCommand - */ -export const de_DeleteSecurityProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSecurityProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSecurityProfileCommandError - */ -const de_DeleteSecurityProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VersionConflictException": - case "com.amazonaws.iot#VersionConflictException": - throw await de_VersionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteStreamCommand - */ -export const de_DeleteStreamCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteStreamCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteStreamCommandError - */ -const de_DeleteStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DeleteConflictException": - case "com.amazonaws.iot#DeleteConflictException": - throw await de_DeleteConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteThingCommand - */ -export const de_DeleteThingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteThingCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteThingCommandError - */ -const de_DeleteThingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "VersionConflictException": - case "com.amazonaws.iot#VersionConflictException": - throw await de_VersionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteThingGroupCommand - */ -export const de_DeleteThingGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteThingGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteThingGroupCommandError - */ -const de_DeleteThingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VersionConflictException": - case "com.amazonaws.iot#VersionConflictException": - throw await de_VersionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteThingTypeCommand - */ -export const de_DeleteThingTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteThingTypeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteThingTypeCommandError - */ -const de_DeleteThingTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteTopicRuleCommand - */ -export const de_DeleteTopicRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTopicRuleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteTopicRuleCommandError - */ -const de_DeleteTopicRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingResourceUpdateException": - case "com.amazonaws.iot#ConflictingResourceUpdateException": - throw await de_ConflictingResourceUpdateExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteTopicRuleDestinationCommand - */ -export const de_DeleteTopicRuleDestinationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTopicRuleDestinationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteTopicRuleDestinationCommandError - */ -const de_DeleteTopicRuleDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingResourceUpdateException": - case "com.amazonaws.iot#ConflictingResourceUpdateException": - throw await de_ConflictingResourceUpdateExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteV2LoggingLevelCommand - */ -export const de_DeleteV2LoggingLevelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteV2LoggingLevelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteV2LoggingLevelCommandError - */ -const de_DeleteV2LoggingLevelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeprecateThingTypeCommand - */ -export const de_DeprecateThingTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeprecateThingTypeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeprecateThingTypeCommandError - */ -const de_DeprecateThingTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAccountAuditConfigurationCommand - */ -export const de_DescribeAccountAuditConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAccountAuditConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - auditCheckConfigurations: _json, - auditNotificationTargetConfigurations: _json, - roleArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAccountAuditConfigurationCommandError - */ -const de_DescribeAccountAuditConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAuditFindingCommand - */ -export const de_DescribeAuditFindingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAuditFindingCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - finding: (_) => de_AuditFinding(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAuditFindingCommandError - */ -const de_DescribeAuditFindingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAuditMitigationActionsTaskCommand - */ -export const de_DescribeAuditMitigationActionsTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAuditMitigationActionsTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - actionsDefinition: _json, - auditCheckToActionsMapping: _json, - endTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - startTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - target: _json, - taskStatistics: _json, - taskStatus: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAuditMitigationActionsTaskCommandError - */ -const de_DescribeAuditMitigationActionsTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAuditSuppressionCommand - */ -export const de_DescribeAuditSuppressionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAuditSuppressionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - checkName: __expectString, - description: __expectString, - expirationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - resourceIdentifier: _json, - suppressIndefinitely: __expectBoolean, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAuditSuppressionCommandError - */ -const de_DescribeAuditSuppressionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAuditTaskCommand - */ -export const de_DescribeAuditTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAuditTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - auditDetails: _json, - scheduledAuditName: __expectString, - taskStartTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - taskStatistics: _json, - taskStatus: __expectString, - taskType: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAuditTaskCommandError - */ -const de_DescribeAuditTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAuthorizerCommand - */ -export const de_DescribeAuthorizerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAuthorizerCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - authorizerDescription: (_) => de_AuthorizerDescription(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAuthorizerCommandError - */ -const de_DescribeAuthorizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeBillingGroupCommand - */ -export const de_DescribeBillingGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBillingGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - billingGroupArn: __expectString, - billingGroupId: __expectString, - billingGroupMetadata: (_) => de_BillingGroupMetadata(_, context), - billingGroupName: __expectString, - billingGroupProperties: _json, - version: __expectLong, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeBillingGroupCommandError - */ -const de_DescribeBillingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeCACertificateCommand - */ -export const de_DescribeCACertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeCACertificateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - certificateDescription: (_) => de_CACertificateDescription(_, context), - registrationConfig: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeCACertificateCommandError - */ -const de_DescribeCACertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeCertificateCommand - */ -export const de_DescribeCertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeCertificateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - certificateDescription: (_) => de_CertificateDescription(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeCertificateCommandError - */ -const de_DescribeCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeCertificateProviderCommand - */ -export const de_DescribeCertificateProviderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeCertificateProviderCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - accountDefaultForOperations: _json, - certificateProviderArn: __expectString, - certificateProviderName: __expectString, - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - lambdaFunctionArn: __expectString, - lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeCertificateProviderCommandError - */ -const de_DescribeCertificateProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeCustomMetricCommand - */ -export const de_DescribeCustomMetricCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeCustomMetricCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - displayName: __expectString, - lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - metricArn: __expectString, - metricName: __expectString, - metricType: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeCustomMetricCommandError - */ -const de_DescribeCustomMetricCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDefaultAuthorizerCommand - */ -export const de_DescribeDefaultAuthorizerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDefaultAuthorizerCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - authorizerDescription: (_) => de_AuthorizerDescription(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeDefaultAuthorizerCommandError - */ -const de_DescribeDefaultAuthorizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDetectMitigationActionsTaskCommand - */ -export const de_DescribeDetectMitigationActionsTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDetectMitigationActionsTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - taskSummary: (_) => de_DetectMitigationActionsTaskSummary(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeDetectMitigationActionsTaskCommandError - */ -const de_DescribeDetectMitigationActionsTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDimensionCommand - */ -export const de_DescribeDimensionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDimensionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - arn: __expectString, - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - name: __expectString, - stringValues: _json, - type: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeDimensionCommandError - */ -const de_DescribeDimensionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDomainConfigurationCommand - */ -export const de_DescribeDomainConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDomainConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - authorizerConfig: _json, - domainConfigurationArn: __expectString, - domainConfigurationName: __expectString, - domainConfigurationStatus: __expectString, - domainName: __expectString, - domainType: __expectString, - lastStatusChangeDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - serverCertificates: _json, - serviceType: __expectString, - tlsConfig: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeDomainConfigurationCommandError - */ -const de_DescribeDomainConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeEndpointCommand - */ -export const de_DescribeEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeEndpointCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - endpointAddress: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeEndpointCommandError - */ -const de_DescribeEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeEventConfigurationsCommand - */ -export const de_DescribeEventConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeEventConfigurationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - eventConfigurations: _json, - lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeEventConfigurationsCommandError - */ -const de_DescribeEventConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeFleetMetricCommand - */ -export const de_DescribeFleetMetricCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFleetMetricCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - aggregationField: __expectString, - aggregationType: _json, - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - description: __expectString, - indexName: __expectString, - lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - metricArn: __expectString, - metricName: __expectString, - period: __expectInt32, - queryString: __expectString, - queryVersion: __expectString, - unit: __expectString, - version: __expectLong, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeFleetMetricCommandError - */ -const de_DescribeFleetMetricCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeIndexCommand - */ -export const de_DescribeIndexCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeIndexCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - indexName: __expectString, - indexStatus: __expectString, - schema: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeIndexCommandError - */ -const de_DescribeIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeJobCommand - */ -export const de_DescribeJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - documentSource: __expectString, - job: (_) => de_Job(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeJobCommandError - */ -const de_DescribeJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeJobExecutionCommand - */ -export const de_DescribeJobExecutionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobExecutionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - execution: (_) => de_JobExecution(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeJobExecutionCommandError - */ -const de_DescribeJobExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeJobTemplateCommand - */ -export const de_DescribeJobTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - abortConfig: (_) => de_AbortConfig(_, context), - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - description: __expectString, - destinationPackageVersions: _json, - document: __expectString, - documentSource: __expectString, - jobExecutionsRetryConfig: _json, - jobExecutionsRolloutConfig: (_) => de_JobExecutionsRolloutConfig(_, context), - jobTemplateArn: __expectString, - jobTemplateId: __expectString, - maintenanceWindows: _json, - presignedUrlConfig: _json, - timeoutConfig: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeJobTemplateCommandError - */ -const de_DescribeJobTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeManagedJobTemplateCommand - */ -export const de_DescribeManagedJobTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeManagedJobTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - description: __expectString, - document: __expectString, - documentParameters: _json, - environments: _json, - templateArn: __expectString, - templateName: __expectString, - templateVersion: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeManagedJobTemplateCommandError - */ -const de_DescribeManagedJobTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iot#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeMitigationActionCommand - */ -export const de_DescribeMitigationActionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeMitigationActionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - actionArn: __expectString, - actionId: __expectString, - actionName: __expectString, - actionParams: _json, - actionType: __expectString, - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - roleArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeMitigationActionCommandError - */ -const de_DescribeMitigationActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeProvisioningTemplateCommand - */ -export const de_DescribeProvisioningTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeProvisioningTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - defaultVersionId: __expectInt32, - description: __expectString, - enabled: __expectBoolean, - lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - preProvisioningHook: _json, - provisioningRoleArn: __expectString, - templateArn: __expectString, - templateBody: __expectString, - templateName: __expectString, - type: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeProvisioningTemplateCommandError - */ -const de_DescribeProvisioningTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeProvisioningTemplateVersionCommand - */ -export const de_DescribeProvisioningTemplateVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeProvisioningTemplateVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - isDefaultVersion: __expectBoolean, - templateBody: __expectString, - versionId: __expectInt32, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeProvisioningTemplateVersionCommandError - */ -const de_DescribeProvisioningTemplateVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeRoleAliasCommand - */ -export const de_DescribeRoleAliasCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRoleAliasCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - roleAliasDescription: (_) => de_RoleAliasDescription(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeRoleAliasCommandError - */ -const de_DescribeRoleAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeScheduledAuditCommand - */ -export const de_DescribeScheduledAuditCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeScheduledAuditCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - dayOfMonth: __expectString, - dayOfWeek: __expectString, - frequency: __expectString, - scheduledAuditArn: __expectString, - scheduledAuditName: __expectString, - targetCheckNames: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeScheduledAuditCommandError - */ -const de_DescribeScheduledAuditCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeSecurityProfileCommand - */ -export const de_DescribeSecurityProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSecurityProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - additionalMetricsToRetain: _json, - additionalMetricsToRetainV2: _json, - alertTargets: _json, - behaviors: (_) => de_Behaviors(_, context), - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - metricsExportConfig: _json, - securityProfileArn: __expectString, - securityProfileDescription: __expectString, - securityProfileName: __expectString, - version: __expectLong, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeSecurityProfileCommandError - */ -const de_DescribeSecurityProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeStreamCommand - */ -export const de_DescribeStreamCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeStreamCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - streamInfo: (_) => de_StreamInfo(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeStreamCommandError - */ -const de_DescribeStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeThingCommand - */ -export const de_DescribeThingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeThingCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - attributes: _json, - billingGroupName: __expectString, - defaultClientId: __expectString, - thingArn: __expectString, - thingId: __expectString, - thingName: __expectString, - thingTypeName: __expectString, - version: __expectLong, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeThingCommandError - */ -const de_DescribeThingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeThingGroupCommand - */ -export const de_DescribeThingGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeThingGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - indexName: __expectString, - queryString: __expectString, - queryVersion: __expectString, - status: __expectString, - thingGroupArn: __expectString, - thingGroupId: __expectString, - thingGroupMetadata: (_) => de_ThingGroupMetadata(_, context), - thingGroupName: __expectString, - thingGroupProperties: _json, - version: __expectLong, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeThingGroupCommandError - */ -const de_DescribeThingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeThingRegistrationTaskCommand - */ -export const de_DescribeThingRegistrationTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeThingRegistrationTaskCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - failureCount: __expectInt32, - inputFileBucket: __expectString, - inputFileKey: __expectString, - lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - message: __expectString, - percentageProgress: __expectInt32, - roleArn: __expectString, - status: __expectString, - successCount: __expectInt32, - taskId: __expectString, - templateBody: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeThingRegistrationTaskCommandError - */ -const de_DescribeThingRegistrationTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeThingTypeCommand - */ -export const de_DescribeThingTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeThingTypeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - thingTypeArn: __expectString, - thingTypeId: __expectString, - thingTypeMetadata: (_) => de_ThingTypeMetadata(_, context), - thingTypeName: __expectString, - thingTypeProperties: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeThingTypeCommandError - */ -const de_DescribeThingTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DetachPolicyCommand - */ -export const de_DetachPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DetachPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DetachPolicyCommandError - */ -const de_DetachPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DetachPrincipalPolicyCommand - */ -export const de_DetachPrincipalPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DetachPrincipalPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DetachPrincipalPolicyCommandError - */ -const de_DetachPrincipalPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DetachSecurityProfileCommand - */ -export const de_DetachSecurityProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DetachSecurityProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DetachSecurityProfileCommandError - */ -const de_DetachSecurityProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DetachThingPrincipalCommand - */ -export const de_DetachThingPrincipalCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DetachThingPrincipalCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DetachThingPrincipalCommandError - */ -const de_DetachThingPrincipalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisableTopicRuleCommand - */ -export const de_DisableTopicRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableTopicRuleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisableTopicRuleCommandError - */ -const de_DisableTopicRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingResourceUpdateException": - case "com.amazonaws.iot#ConflictingResourceUpdateException": - throw await de_ConflictingResourceUpdateExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1EnableTopicRuleCommand - */ -export const de_EnableTopicRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableTopicRuleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1EnableTopicRuleCommandError - */ -const de_EnableTopicRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingResourceUpdateException": - case "com.amazonaws.iot#ConflictingResourceUpdateException": - throw await de_ConflictingResourceUpdateExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetBehaviorModelTrainingSummariesCommand - */ -export const de_GetBehaviorModelTrainingSummariesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBehaviorModelTrainingSummariesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - summaries: (_) => de_BehaviorModelTrainingSummaries(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetBehaviorModelTrainingSummariesCommandError - */ -const de_GetBehaviorModelTrainingSummariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetBucketsAggregationCommand - */ -export const de_GetBucketsAggregationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketsAggregationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - buckets: _json, - totalCount: __expectInt32, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetBucketsAggregationCommandError - */ -const de_GetBucketsAggregationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IndexNotReadyException": - case "com.amazonaws.iot#IndexNotReadyException": - throw await de_IndexNotReadyExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidAggregationException": - case "com.amazonaws.iot#InvalidAggregationException": - throw await de_InvalidAggregationExceptionRes(parsedOutput, context); - case "InvalidQueryException": - case "com.amazonaws.iot#InvalidQueryException": - throw await de_InvalidQueryExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCardinalityCommand - */ -export const de_GetCardinalityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCardinalityCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - cardinality: __expectInt32, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetCardinalityCommandError - */ -const de_GetCardinalityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IndexNotReadyException": - case "com.amazonaws.iot#IndexNotReadyException": - throw await de_IndexNotReadyExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidAggregationException": - case "com.amazonaws.iot#InvalidAggregationException": - throw await de_InvalidAggregationExceptionRes(parsedOutput, context); - case "InvalidQueryException": - case "com.amazonaws.iot#InvalidQueryException": - throw await de_InvalidQueryExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEffectivePoliciesCommand - */ -export const de_GetEffectivePoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEffectivePoliciesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - effectivePolicies: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEffectivePoliciesCommandError - */ -const de_GetEffectivePoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetIndexingConfigurationCommand - */ -export const de_GetIndexingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIndexingConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - thingGroupIndexingConfiguration: _json, - thingIndexingConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetIndexingConfigurationCommandError - */ -const de_GetIndexingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetJobDocumentCommand - */ -export const de_GetJobDocumentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJobDocumentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - document: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetJobDocumentCommandError - */ -const de_GetJobDocumentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetLoggingOptionsCommand - */ -export const de_GetLoggingOptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLoggingOptionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - logLevel: __expectString, - roleArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetLoggingOptionsCommandError - */ -const de_GetLoggingOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetOTAUpdateCommand - */ -export const de_GetOTAUpdateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOTAUpdateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - otaUpdateInfo: (_) => de_OTAUpdateInfo(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetOTAUpdateCommandError - */ -const de_GetOTAUpdateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPackageCommand - */ -export const de_GetPackageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPackageCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - defaultVersionName: __expectString, - description: __expectString, - lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - packageArn: __expectString, - packageName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPackageCommandError - */ -const de_GetPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iot#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iot#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPackageConfigurationCommand - */ -export const de_GetPackageConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPackageConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - versionUpdateByJobsConfig: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPackageConfigurationCommandError - */ -const de_GetPackageConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iot#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPackageVersionCommand - */ -export const de_GetPackageVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPackageVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - attributes: _json, - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - description: __expectString, - errorReason: __expectString, - lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - packageName: __expectString, - packageVersionArn: __expectString, - status: __expectString, - versionName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPackageVersionCommandError - */ -const de_GetPackageVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iot#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iot#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPercentilesCommand - */ -export const de_GetPercentilesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPercentilesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - percentiles: (_) => de_Percentiles(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPercentilesCommandError - */ -const de_GetPercentilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IndexNotReadyException": - case "com.amazonaws.iot#IndexNotReadyException": - throw await de_IndexNotReadyExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidAggregationException": - case "com.amazonaws.iot#InvalidAggregationException": - throw await de_InvalidAggregationExceptionRes(parsedOutput, context); - case "InvalidQueryException": - case "com.amazonaws.iot#InvalidQueryException": - throw await de_InvalidQueryExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPolicyCommand - */ -export const de_GetPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - defaultVersionId: __expectString, - generationId: __expectString, - lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - policyArn: __expectString, - policyDocument: __expectString, - policyName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPolicyCommandError - */ -const de_GetPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPolicyVersionCommand - */ -export const de_GetPolicyVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPolicyVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - generationId: __expectString, - isDefaultVersion: __expectBoolean, - lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - policyArn: __expectString, - policyDocument: __expectString, - policyName: __expectString, - policyVersionId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPolicyVersionCommandError - */ -const de_GetPolicyVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRegistrationCodeCommand - */ -export const de_GetRegistrationCodeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRegistrationCodeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - registrationCode: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRegistrationCodeCommandError - */ -const de_GetRegistrationCodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetStatisticsCommand - */ -export const de_GetStatisticsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStatisticsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - statistics: (_) => de_Statistics(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetStatisticsCommandError - */ -const de_GetStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IndexNotReadyException": - case "com.amazonaws.iot#IndexNotReadyException": - throw await de_IndexNotReadyExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidAggregationException": - case "com.amazonaws.iot#InvalidAggregationException": - throw await de_InvalidAggregationExceptionRes(parsedOutput, context); - case "InvalidQueryException": - case "com.amazonaws.iot#InvalidQueryException": - throw await de_InvalidQueryExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetTopicRuleCommand - */ -export const de_GetTopicRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTopicRuleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - rule: (_) => de_TopicRule(_, context), - ruleArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetTopicRuleCommandError - */ -const de_GetTopicRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetTopicRuleDestinationCommand - */ -export const de_GetTopicRuleDestinationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTopicRuleDestinationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - topicRuleDestination: (_) => de_TopicRuleDestination(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetTopicRuleDestinationCommandError - */ -const de_GetTopicRuleDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetV2LoggingOptionsCommand - */ -export const de_GetV2LoggingOptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetV2LoggingOptionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - defaultLogLevel: __expectString, - disableAllLogs: __expectBoolean, - roleArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetV2LoggingOptionsCommandError - */ -const de_GetV2LoggingOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "NotConfiguredException": - case "com.amazonaws.iot#NotConfiguredException": - throw await de_NotConfiguredExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListActiveViolationsCommand + * deserializeAws_restJson1DeleteAccountAuditConfigurationCommand */ -export const de_ListActiveViolationsCommand = async ( +export const de_DeleteAccountAuditConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListActiveViolationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - activeViolations: (_) => de_ActiveViolations(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListActiveViolationsCommandError - */ -const de_ListActiveViolationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAttachedPoliciesCommand + * deserializeAws_restJson1DeleteAuditSuppressionCommand */ -export const de_ListAttachedPoliciesCommand = async ( +export const de_DeleteAuditSuppressionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAttachedPoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextMarker: __expectString, - policies: _json, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListAttachedPoliciesCommandError - */ -const de_ListAttachedPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAuditFindingsCommand + * deserializeAws_restJson1DeleteAuthorizerCommand */ -export const de_ListAuditFindingsCommand = async ( +export const de_DeleteAuthorizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAuditFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - findings: (_) => de_AuditFindings(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListAuditFindingsCommandError - */ -const de_ListAuditFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAuditMitigationActionsExecutionsCommand + * deserializeAws_restJson1DeleteBillingGroupCommand */ -export const de_ListAuditMitigationActionsExecutionsCommand = async ( +export const de_DeleteBillingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAuditMitigationActionsExecutionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - actionsExecutions: (_) => de_AuditMitigationActionExecutionMetadataList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListAuditMitigationActionsExecutionsCommandError - */ -const de_ListAuditMitigationActionsExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAuditMitigationActionsTasksCommand + * deserializeAws_restJson1DeleteCACertificateCommand */ -export const de_ListAuditMitigationActionsTasksCommand = async ( +export const de_DeleteCACertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAuditMitigationActionsTasksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - tasks: (_) => de_AuditMitigationActionsTaskMetadataList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAuditMitigationActionsTasksCommandError - */ -const de_ListAuditMitigationActionsTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListAuditSuppressionsCommand + * deserializeAws_restJson1DeleteCertificateCommand */ -export const de_ListAuditSuppressionsCommand = async ( +export const de_DeleteCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAuditSuppressionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - suppressions: (_) => de_AuditSuppressionList(_, context), - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListAuditSuppressionsCommandError + * deserializeAws_restJson1DeleteCertificateProviderCommand */ -const de_ListAuditSuppressionsCommandError = async ( +export const de_DeleteCertificateProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListAuditTasksCommand + * deserializeAws_restJson1DeleteCustomMetricCommand */ -export const de_ListAuditTasksCommand = async ( +export const de_DeleteCustomMetricCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAuditTasksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - tasks: _json, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListAuditTasksCommandError + * deserializeAws_restJson1DeleteDimensionCommand */ -const de_ListAuditTasksCommandError = async ( +export const de_DeleteDimensionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListAuthorizersCommand + * deserializeAws_restJson1DeleteDomainConfigurationCommand */ -export const de_ListAuthorizersCommand = async ( +export const de_DeleteDomainConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAuthorizersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - authorizers: _json, - nextMarker: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListAuthorizersCommandError + * deserializeAws_restJson1DeleteDynamicThingGroupCommand */ -const de_ListAuthorizersCommandError = async ( +export const de_DeleteDynamicThingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListBillingGroupsCommand + * deserializeAws_restJson1DeleteFleetMetricCommand */ -export const de_ListBillingGroupsCommand = async ( +export const de_DeleteFleetMetricCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBillingGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - billingGroups: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListBillingGroupsCommandError + * deserializeAws_restJson1DeleteJobCommand */ -const de_ListBillingGroupsCommandError = async ( +export const de_DeleteJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListCACertificatesCommand + * deserializeAws_restJson1DeleteJobExecutionCommand */ -export const de_ListCACertificatesCommand = async ( +export const de_DeleteJobExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCACertificatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - certificates: (_) => de_CACertificates(_, context), - nextMarker: __expectString, + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteJobTemplateCommand + */ +export const de_DeleteJobTemplateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListCACertificatesCommandError + * deserializeAws_restJson1DeleteMitigationActionCommand */ -const de_ListCACertificatesCommandError = async ( +export const de_DeleteMitigationActionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteOTAUpdateCommand + */ +export const de_DeleteOTAUpdateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListCertificateProvidersCommand + * deserializeAws_restJson1DeletePackageCommand */ -export const de_ListCertificateProvidersCommand = async ( +export const de_DeletePackageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCertificateProvidersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - certificateProviders: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListCertificateProvidersCommandError + * deserializeAws_restJson1DeletePackageVersionCommand */ -const de_ListCertificateProvidersCommandError = async ( +export const de_DeletePackageVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListCertificatesCommand + * deserializeAws_restJson1DeletePolicyCommand */ -export const de_ListCertificatesCommand = async ( +export const de_DeletePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCertificatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - certificates: (_) => de_Certificates(_, context), - nextMarker: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListCertificatesCommandError + * deserializeAws_restJson1DeletePolicyVersionCommand */ -const de_ListCertificatesCommandError = async ( +export const de_DeletePolicyVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListCertificatesByCACommand + * deserializeAws_restJson1DeleteProvisioningTemplateCommand */ -export const de_ListCertificatesByCACommand = async ( +export const de_DeleteProvisioningTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCertificatesByCACommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - certificates: (_) => de_Certificates(_, context), - nextMarker: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListCertificatesByCACommandError + * deserializeAws_restJson1DeleteProvisioningTemplateVersionCommand */ -const de_ListCertificatesByCACommandError = async ( +export const de_DeleteProvisioningTemplateVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListCustomMetricsCommand + * deserializeAws_restJson1DeleteRegistrationCodeCommand */ -export const de_ListCustomMetricsCommand = async ( +export const de_DeleteRegistrationCodeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCustomMetricsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - metricNames: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListCustomMetricsCommandError + * deserializeAws_restJson1DeleteRoleAliasCommand */ -const de_ListCustomMetricsCommandError = async ( +export const de_DeleteRoleAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListDetectMitigationActionsExecutionsCommand + * deserializeAws_restJson1DeleteScheduledAuditCommand */ -export const de_ListDetectMitigationActionsExecutionsCommand = async ( +export const de_DeleteScheduledAuditCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDetectMitigationActionsExecutionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - actionsExecutions: (_) => de_DetectMitigationActionExecutionList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListDetectMitigationActionsExecutionsCommandError + * deserializeAws_restJson1DeleteSecurityProfileCommand */ -const de_ListDetectMitigationActionsExecutionsCommandError = async ( +export const de_DeleteSecurityProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteStreamCommand + */ +export const de_DeleteStreamCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListDetectMitigationActionsTasksCommand + * deserializeAws_restJson1DeleteThingCommand */ -export const de_ListDetectMitigationActionsTasksCommand = async ( +export const de_DeleteThingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDetectMitigationActionsTasksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - tasks: (_) => de_DetectMitigationActionsTaskSummaryList(_, context), - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListDetectMitigationActionsTasksCommandError + * deserializeAws_restJson1DeleteThingGroupCommand */ -const de_ListDetectMitigationActionsTasksCommandError = async ( +export const de_DeleteThingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListDimensionsCommand + * deserializeAws_restJson1DeleteThingTypeCommand */ -export const de_ListDimensionsCommand = async ( +export const de_DeleteThingTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDimensionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - dimensionNames: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListDimensionsCommandError + * deserializeAws_restJson1DeleteTopicRuleCommand */ -const de_ListDimensionsCommandError = async ( +export const de_DeleteTopicRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListDomainConfigurationsCommand + * deserializeAws_restJson1DeleteTopicRuleDestinationCommand */ -export const de_ListDomainConfigurationsCommand = async ( +export const de_DeleteTopicRuleDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDomainConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - domainConfigurations: _json, - nextMarker: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListDomainConfigurationsCommandError + * deserializeAws_restJson1DeleteV2LoggingLevelCommand */ -const de_ListDomainConfigurationsCommandError = async ( +export const de_DeleteV2LoggingLevelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListFleetMetricsCommand + * deserializeAws_restJson1DeprecateThingTypeCommand */ -export const de_ListFleetMetricsCommand = async ( +export const de_DeprecateThingTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFleetMetricsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - fleetMetrics: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListFleetMetricsCommandError + * deserializeAws_restJson1DescribeAccountAuditConfigurationCommand */ -const de_ListFleetMetricsCommandError = async ( +export const de_DescribeAccountAuditConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + auditCheckConfigurations: _json, + auditNotificationTargetConfigurations: _json, + roleArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListIndicesCommand + * deserializeAws_restJson1DescribeAuditFindingCommand */ -export const de_ListIndicesCommand = async ( +export const de_DescribeAuditFindingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIndicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - indexNames: _json, - nextToken: __expectString, + finding: (_) => de_AuditFinding(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListIndicesCommandError + * deserializeAws_restJson1DescribeAuditMitigationActionsTaskCommand */ -const de_ListIndicesCommandError = async ( +export const de_DescribeAuditMitigationActionsTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + actionsDefinition: _json, + auditCheckToActionsMapping: _json, + endTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + startTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + target: _json, + taskStatistics: _json, + taskStatus: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListJobExecutionsForJobCommand + * deserializeAws_restJson1DescribeAuditSuppressionCommand */ -export const de_ListJobExecutionsForJobCommand = async ( +export const de_DescribeAuditSuppressionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobExecutionsForJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - executionSummaries: (_) => de_JobExecutionSummaryForJobList(_, context), - nextToken: __expectString, + checkName: __expectString, + description: __expectString, + expirationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + resourceIdentifier: _json, + suppressIndefinitely: __expectBoolean, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListJobExecutionsForJobCommandError - */ -const de_ListJobExecutionsForJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListJobExecutionsForThingCommand + * deserializeAws_restJson1DescribeAuditTaskCommand */ -export const de_ListJobExecutionsForThingCommand = async ( +export const de_DescribeAuditTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobExecutionsForThingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - executionSummaries: (_) => de_JobExecutionSummaryForThingList(_, context), - nextToken: __expectString, + auditDetails: _json, + scheduledAuditName: __expectString, + taskStartTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + taskStatistics: _json, + taskStatus: __expectString, + taskType: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListJobExecutionsForThingCommandError + * deserializeAws_restJson1DescribeAuthorizerCommand */ -const de_ListJobExecutionsForThingCommandError = async ( +export const de_DescribeAuthorizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + authorizerDescription: (_) => de_AuthorizerDescription(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListJobsCommand + * deserializeAws_restJson1DescribeBillingGroupCommand */ -export const de_ListJobsCommand = async ( +export const de_DescribeBillingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - jobs: (_) => de_JobSummaryList(_, context), - nextToken: __expectString, + billingGroupArn: __expectString, + billingGroupId: __expectString, + billingGroupMetadata: (_) => de_BillingGroupMetadata(_, context), + billingGroupName: __expectString, + billingGroupProperties: _json, + version: __expectLong, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListJobsCommandError + * deserializeAws_restJson1DescribeCACertificateCommand */ -const de_ListJobsCommandError = async ( +export const de_DescribeCACertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + certificateDescription: (_) => de_CACertificateDescription(_, context), + registrationConfig: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListJobTemplatesCommand + * deserializeAws_restJson1DescribeCertificateCommand */ -export const de_ListJobTemplatesCommand = async ( +export const de_DescribeCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - jobTemplates: (_) => de_JobTemplateSummaryList(_, context), - nextToken: __expectString, + certificateDescription: (_) => de_CertificateDescription(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListJobTemplatesCommandError + * deserializeAws_restJson1DescribeCertificateProviderCommand */ -const de_ListJobTemplatesCommandError = async ( +export const de_DescribeCertificateProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + accountDefaultForOperations: _json, + certificateProviderArn: __expectString, + certificateProviderName: __expectString, + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + lambdaFunctionArn: __expectString, + lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListManagedJobTemplatesCommand + * deserializeAws_restJson1DescribeCustomMetricCommand */ -export const de_ListManagedJobTemplatesCommand = async ( +export const de_DescribeCustomMetricCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListManagedJobTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - managedJobTemplates: _json, - nextToken: __expectString, + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + displayName: __expectString, + lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + metricArn: __expectString, + metricName: __expectString, + metricType: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListManagedJobTemplatesCommandError + * deserializeAws_restJson1DescribeDefaultAuthorizerCommand */ -const de_ListManagedJobTemplatesCommandError = async ( +export const de_DescribeDefaultAuthorizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iot#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + authorizerDescription: (_) => de_AuthorizerDescription(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListMetricValuesCommand + * deserializeAws_restJson1DescribeDetectMitigationActionsTaskCommand */ -export const de_ListMetricValuesCommand = async ( +export const de_DescribeDetectMitigationActionsTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMetricValuesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - metricDatumList: (_) => de_MetricDatumList(_, context), - nextToken: __expectString, + taskSummary: (_) => de_DetectMitigationActionsTaskSummary(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListMetricValuesCommandError - */ -const de_ListMetricValuesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListMitigationActionsCommand + * deserializeAws_restJson1DescribeDimensionCommand */ -export const de_ListMitigationActionsCommand = async ( +export const de_DescribeDimensionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMitigationActionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - actionIdentifiers: (_) => de_MitigationActionIdentifierList(_, context), - nextToken: __expectString, + arn: __expectString, + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + name: __expectString, + stringValues: _json, + type: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListMitigationActionsCommandError + * deserializeAws_restJson1DescribeDomainConfigurationCommand */ -const de_ListMitigationActionsCommandError = async ( +export const de_DescribeDomainConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + authorizerConfig: _json, + domainConfigurationArn: __expectString, + domainConfigurationName: __expectString, + domainConfigurationStatus: __expectString, + domainName: __expectString, + domainType: __expectString, + lastStatusChangeDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + serverCertificates: _json, + serviceType: __expectString, + tlsConfig: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListOTAUpdatesCommand + * deserializeAws_restJson1DescribeEndpointCommand */ -export const de_ListOTAUpdatesCommand = async ( +export const de_DescribeEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOTAUpdatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - otaUpdates: (_) => de_OTAUpdatesSummary(_, context), + endpointAddress: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListOTAUpdatesCommandError + * deserializeAws_restJson1DescribeEventConfigurationsCommand */ -const de_ListOTAUpdatesCommandError = async ( +export const de_DescribeEventConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + eventConfigurations: _json, + lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListOutgoingCertificatesCommand + * deserializeAws_restJson1DescribeFleetMetricCommand */ -export const de_ListOutgoingCertificatesCommand = async ( +export const de_DescribeFleetMetricCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOutgoingCertificatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextMarker: __expectString, - outgoingCertificates: (_) => de_OutgoingCertificates(_, context), + aggregationField: __expectString, + aggregationType: _json, + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + description: __expectString, + indexName: __expectString, + lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + metricArn: __expectString, + metricName: __expectString, + period: __expectInt32, + queryString: __expectString, + queryVersion: __expectString, + unit: __expectString, + version: __expectLong, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListOutgoingCertificatesCommandError + * deserializeAws_restJson1DescribeIndexCommand */ -const de_ListOutgoingCertificatesCommandError = async ( +export const de_DescribeIndexCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + indexName: __expectString, + indexStatus: __expectString, + schema: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPackagesCommand + * deserializeAws_restJson1DescribeJobCommand */ -export const de_ListPackagesCommand = async ( +export const de_DescribeJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPackagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - packageSummaries: (_) => de_PackageSummaryList(_, context), + documentSource: __expectString, + job: (_) => de_Job(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPackagesCommandError + * deserializeAws_restJson1DescribeJobExecutionCommand */ -const de_ListPackagesCommandError = async ( +export const de_DescribeJobExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iot#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iot#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + execution: (_) => de_JobExecution(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPackageVersionsCommand + * deserializeAws_restJson1DescribeJobTemplateCommand */ -export const de_ListPackageVersionsCommand = async ( +export const de_DescribeJobTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPackageVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - packageVersionSummaries: (_) => de_PackageVersionSummaryList(_, context), + abortConfig: (_) => de_AbortConfig(_, context), + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + description: __expectString, + destinationPackageVersions: _json, + document: __expectString, + documentSource: __expectString, + jobExecutionsRetryConfig: _json, + jobExecutionsRolloutConfig: (_) => de_JobExecutionsRolloutConfig(_, context), + jobTemplateArn: __expectString, + jobTemplateId: __expectString, + maintenanceWindows: _json, + presignedUrlConfig: _json, + timeoutConfig: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPackageVersionsCommandError + * deserializeAws_restJson1DescribeManagedJobTemplateCommand */ -const de_ListPackageVersionsCommandError = async ( +export const de_DescribeManagedJobTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iot#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iot#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + description: __expectString, + document: __expectString, + documentParameters: _json, + environments: _json, + templateArn: __expectString, + templateName: __expectString, + templateVersion: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPoliciesCommand + * deserializeAws_restJson1DescribeMitigationActionCommand */ -export const de_ListPoliciesCommand = async ( +export const de_DescribeMitigationActionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextMarker: __expectString, - policies: _json, + actionArn: __expectString, + actionId: __expectString, + actionName: __expectString, + actionParams: _json, + actionType: __expectString, + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + roleArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPoliciesCommandError + * deserializeAws_restJson1DescribeProvisioningTemplateCommand */ -const de_ListPoliciesCommandError = async ( +export const de_DescribeProvisioningTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + defaultVersionId: __expectInt32, + description: __expectString, + enabled: __expectBoolean, + lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + preProvisioningHook: _json, + provisioningRoleArn: __expectString, + templateArn: __expectString, + templateBody: __expectString, + templateName: __expectString, + type: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPolicyPrincipalsCommand + * deserializeAws_restJson1DescribeProvisioningTemplateVersionCommand */ -export const de_ListPolicyPrincipalsCommand = async ( +export const de_DescribeProvisioningTemplateVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPolicyPrincipalsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextMarker: __expectString, - principals: _json, + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + isDefaultVersion: __expectBoolean, + templateBody: __expectString, + versionId: __expectInt32, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPolicyPrincipalsCommandError + * deserializeAws_restJson1DescribeRoleAliasCommand */ -const de_ListPolicyPrincipalsCommandError = async ( +export const de_DescribeRoleAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + roleAliasDescription: (_) => de_RoleAliasDescription(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPolicyVersionsCommand + * deserializeAws_restJson1DescribeScheduledAuditCommand */ -export const de_ListPolicyVersionsCommand = async ( +export const de_DescribeScheduledAuditCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPolicyVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - policyVersions: (_) => de_PolicyVersions(_, context), + dayOfMonth: __expectString, + dayOfWeek: __expectString, + frequency: __expectString, + scheduledAuditArn: __expectString, + scheduledAuditName: __expectString, + targetCheckNames: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPolicyVersionsCommandError + * deserializeAws_restJson1DescribeSecurityProfileCommand */ -const de_ListPolicyVersionsCommandError = async ( +export const de_DescribeSecurityProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + additionalMetricsToRetain: _json, + additionalMetricsToRetainV2: _json, + alertTargets: _json, + behaviors: (_) => de_Behaviors(_, context), + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + metricsExportConfig: _json, + securityProfileArn: __expectString, + securityProfileDescription: __expectString, + securityProfileName: __expectString, + version: __expectLong, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPrincipalPoliciesCommand + * deserializeAws_restJson1DescribeStreamCommand */ -export const de_ListPrincipalPoliciesCommand = async ( +export const de_DescribeStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPrincipalPoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextMarker: __expectString, - policies: _json, + streamInfo: (_) => de_StreamInfo(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPrincipalPoliciesCommandError - */ -const de_ListPrincipalPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPrincipalThingsCommand + * deserializeAws_restJson1DescribeThingCommand */ -export const de_ListPrincipalThingsCommand = async ( +export const de_DescribeThingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPrincipalThingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - things: _json, + attributes: _json, + billingGroupName: __expectString, + defaultClientId: __expectString, + thingArn: __expectString, + thingId: __expectString, + thingName: __expectString, + thingTypeName: __expectString, + version: __expectLong, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPrincipalThingsCommandError - */ -const de_ListPrincipalThingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListProvisioningTemplatesCommand + * deserializeAws_restJson1DescribeThingGroupCommand */ -export const de_ListProvisioningTemplatesCommand = async ( +export const de_DescribeThingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProvisioningTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - templates: (_) => de_ProvisioningTemplateListing(_, context), + indexName: __expectString, + queryString: __expectString, + queryVersion: __expectString, + status: __expectString, + thingGroupArn: __expectString, + thingGroupId: __expectString, + thingGroupMetadata: (_) => de_ThingGroupMetadata(_, context), + thingGroupName: __expectString, + thingGroupProperties: _json, + version: __expectLong, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListProvisioningTemplatesCommandError + * deserializeAws_restJson1DescribeThingRegistrationTaskCommand */ -const de_ListProvisioningTemplatesCommandError = async ( +export const de_DescribeThingRegistrationTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + failureCount: __expectInt32, + inputFileBucket: __expectString, + inputFileKey: __expectString, + lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + message: __expectString, + percentageProgress: __expectInt32, + roleArn: __expectString, + status: __expectString, + successCount: __expectInt32, + taskId: __expectString, + templateBody: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListProvisioningTemplateVersionsCommand + * deserializeAws_restJson1DescribeThingTypeCommand */ -export const de_ListProvisioningTemplateVersionsCommand = async ( +export const de_DescribeThingTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProvisioningTemplateVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - versions: (_) => de_ProvisioningTemplateVersionListing(_, context), + thingTypeArn: __expectString, + thingTypeId: __expectString, + thingTypeMetadata: (_) => de_ThingTypeMetadata(_, context), + thingTypeName: __expectString, + thingTypeProperties: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListProvisioningTemplateVersionsCommandError + * deserializeAws_restJson1DetachPolicyCommand */ -const de_ListProvisioningTemplateVersionsCommandError = async ( +export const de_DetachPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListRelatedResourcesForAuditFindingCommand + * deserializeAws_restJson1DetachPrincipalPolicyCommand */ -export const de_ListRelatedResourcesForAuditFindingCommand = async ( +export const de_DetachPrincipalPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRelatedResourcesForAuditFindingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - relatedResources: _json, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListRelatedResourcesForAuditFindingCommandError + * deserializeAws_restJson1DetachSecurityProfileCommand */ -const de_ListRelatedResourcesForAuditFindingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_DetachSecurityProfileCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListRoleAliasesCommand + * deserializeAws_restJson1DetachThingPrincipalCommand */ -export const de_ListRoleAliasesCommand = async ( +export const de_DetachThingPrincipalCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRoleAliasesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextMarker: __expectString, - roleAliases: _json, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListRoleAliasesCommandError + * deserializeAws_restJson1DisableTopicRuleCommand */ -const de_ListRoleAliasesCommandError = async ( +export const de_DisableTopicRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListScheduledAuditsCommand + * deserializeAws_restJson1EnableTopicRuleCommand */ -export const de_ListScheduledAuditsCommand = async ( +export const de_EnableTopicRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListScheduledAuditsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - scheduledAudits: _json, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListScheduledAuditsCommandError + * deserializeAws_restJson1GetBehaviorModelTrainingSummariesCommand */ -const de_ListScheduledAuditsCommandError = async ( +export const de_GetBehaviorModelTrainingSummariesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + summaries: (_) => de_BehaviorModelTrainingSummaries(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListSecurityProfilesCommand + * deserializeAws_restJson1GetBucketsAggregationCommand */ -export const de_ListSecurityProfilesCommand = async ( +export const de_GetBucketsAggregationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSecurityProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - securityProfileIdentifiers: _json, + buckets: _json, + totalCount: __expectInt32, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSecurityProfilesCommandError + * deserializeAws_restJson1GetCardinalityCommand */ -const de_ListSecurityProfilesCommandError = async ( +export const de_GetCardinalityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + cardinality: __expectInt32, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListSecurityProfilesForTargetCommand + * deserializeAws_restJson1GetEffectivePoliciesCommand */ -export const de_ListSecurityProfilesForTargetCommand = async ( +export const de_GetEffectivePoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSecurityProfilesForTargetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - securityProfileTargetMappings: _json, + effectivePolicies: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSecurityProfilesForTargetCommandError + * deserializeAws_restJson1GetIndexingConfigurationCommand */ -const de_ListSecurityProfilesForTargetCommandError = async ( +export const de_GetIndexingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + thingGroupIndexingConfiguration: _json, + thingIndexingConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListStreamsCommand + * deserializeAws_restJson1GetJobDocumentCommand */ -export const de_ListStreamsCommand = async ( +export const de_GetJobDocumentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStreamsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - streams: _json, + document: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListStreamsCommandError + * deserializeAws_restJson1GetLoggingOptionsCommand */ -const de_ListStreamsCommandError = async ( +export const de_GetLoggingOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + logLevel: __expectString, + roleArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1GetOTAUpdateCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_GetOTAUpdateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - tags: _json, + otaUpdateInfo: (_) => de_OTAUpdateInfo(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTargetsForPolicyCommand + * deserializeAws_restJson1GetPackageCommand */ -export const de_ListTargetsForPolicyCommand = async ( +export const de_GetPackageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTargetsForPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextMarker: __expectString, - targets: _json, + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + defaultVersionName: __expectString, + description: __expectString, + lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + packageArn: __expectString, + packageName: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTargetsForPolicyCommandError - */ -const de_ListTargetsForPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTargetsForSecurityProfileCommand + * deserializeAws_restJson1GetPackageConfigurationCommand */ -export const de_ListTargetsForSecurityProfileCommand = async ( +export const de_GetPackageConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTargetsForSecurityProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - securityProfileTargets: _json, + versionUpdateByJobsConfig: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTargetsForSecurityProfileCommandError + * deserializeAws_restJson1GetPackageVersionCommand */ -const de_ListTargetsForSecurityProfileCommandError = async ( +export const de_GetPackageVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + attributes: _json, + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + description: __expectString, + errorReason: __expectString, + lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + packageName: __expectString, + packageVersionArn: __expectString, + status: __expectString, + versionName: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListThingGroupsCommand + * deserializeAws_restJson1GetPercentilesCommand */ -export const de_ListThingGroupsCommand = async ( +export const de_GetPercentilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListThingGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - thingGroups: _json, + percentiles: (_) => de_Percentiles(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListThingGroupsCommandError + * deserializeAws_restJson1GetPolicyCommand */ -const de_ListThingGroupsCommandError = async ( +export const de_GetPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + defaultVersionId: __expectString, + generationId: __expectString, + lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + policyArn: __expectString, + policyDocument: __expectString, + policyName: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListThingGroupsForThingCommand + * deserializeAws_restJson1GetPolicyVersionCommand */ -export const de_ListThingGroupsForThingCommand = async ( +export const de_GetPolicyVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListThingGroupsForThingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - thingGroups: _json, + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + generationId: __expectString, + isDefaultVersion: __expectBoolean, + lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + policyArn: __expectString, + policyDocument: __expectString, + policyName: __expectString, + policyVersionId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListThingGroupsForThingCommandError + * deserializeAws_restJson1GetRegistrationCodeCommand */ -const de_ListThingGroupsForThingCommandError = async ( +export const de_GetRegistrationCodeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + registrationCode: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListThingPrincipalsCommand + * deserializeAws_restJson1GetStatisticsCommand */ -export const de_ListThingPrincipalsCommand = async ( +export const de_GetStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListThingPrincipalsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - principals: _json, + statistics: (_) => de_Statistics(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListThingPrincipalsCommandError + * deserializeAws_restJson1GetTopicRuleCommand */ -const de_ListThingPrincipalsCommandError = async ( +export const de_GetTopicRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + rule: (_) => de_TopicRule(_, context), + ruleArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListThingRegistrationTaskReportsCommand + * deserializeAws_restJson1GetTopicRuleDestinationCommand */ -export const de_ListThingRegistrationTaskReportsCommand = async ( +export const de_GetTopicRuleDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListThingRegistrationTaskReportsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - reportType: __expectString, - resourceLinks: _json, + topicRuleDestination: (_) => de_TopicRuleDestination(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListThingRegistrationTaskReportsCommandError + * deserializeAws_restJson1GetV2LoggingOptionsCommand */ -const de_ListThingRegistrationTaskReportsCommandError = async ( +export const de_GetV2LoggingOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + defaultLogLevel: __expectString, + disableAllLogs: __expectBoolean, + roleArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListThingRegistrationTasksCommand + * deserializeAws_restJson1ListActiveViolationsCommand */ -export const de_ListThingRegistrationTasksCommand = async ( +export const de_ListActiveViolationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListThingRegistrationTasksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + activeViolations: (_) => de_ActiveViolations(_, context), nextToken: __expectString, - taskIds: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListThingRegistrationTasksCommandError + * deserializeAws_restJson1ListAttachedPoliciesCommand */ -const de_ListThingRegistrationTasksCommandError = async ( +export const de_ListAttachedPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextMarker: __expectString, + policies: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListThingsCommand + * deserializeAws_restJson1ListAuditFindingsCommand */ -export const de_ListThingsCommand = async ( +export const de_ListAuditFindingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListThingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + findings: (_) => de_AuditFindings(_, context), nextToken: __expectString, - things: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListThingsCommandError + * deserializeAws_restJson1ListAuditMitigationActionsExecutionsCommand */ -const de_ListThingsCommandError = async ( +export const de_ListAuditMitigationActionsExecutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + actionsExecutions: (_) => de_AuditMitigationActionExecutionMetadataList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListThingsInBillingGroupCommand + * deserializeAws_restJson1ListAuditMitigationActionsTasksCommand */ -export const de_ListThingsInBillingGroupCommand = async ( +export const de_ListAuditMitigationActionsTasksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListThingsInBillingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -17970,56 +9478,43 @@ export const de_ListThingsInBillingGroupCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - things: _json, + tasks: (_) => de_AuditMitigationActionsTaskMetadataList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListThingsInBillingGroupCommandError + * deserializeAws_restJson1ListAuditSuppressionsCommand */ -const de_ListThingsInBillingGroupCommandError = async ( +export const de_ListAuditSuppressionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + suppressions: (_) => de_AuditSuppressionList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListThingsInThingGroupCommand + * deserializeAws_restJson1ListAuditTasksCommand */ -export const de_ListThingsInThingGroupCommand = async ( +export const de_ListAuditTasksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListThingsInThingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -18027,123 +9522,94 @@ export const de_ListThingsInThingGroupCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - things: _json, + tasks: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListThingsInThingGroupCommandError + * deserializeAws_restJson1ListAuthorizersCommand */ -const de_ListThingsInThingGroupCommandError = async ( +export const de_ListAuthorizersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + authorizers: _json, + nextMarker: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListThingTypesCommand + * deserializeAws_restJson1ListBillingGroupsCommand */ -export const de_ListThingTypesCommand = async ( +export const de_ListBillingGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListThingTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + billingGroups: _json, nextToken: __expectString, - thingTypes: (_) => de_ThingTypeList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListThingTypesCommandError + * deserializeAws_restJson1ListCACertificatesCommand */ -const de_ListThingTypesCommandError = async ( +export const de_ListCACertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + certificates: (_) => de_CACertificates(_, context), + nextMarker: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTopicRuleDestinationsCommand + * deserializeAws_restJson1ListCertificateProvidersCommand */ -export const de_ListTopicRuleDestinationsCommand = async ( +export const de_ListCertificateProvidersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTopicRuleDestinationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - destinationSummaries: (_) => de_TopicRuleDestinationSummaries(_, context), + certificateProviders: _json, nextToken: __expectString, }); Object.assign(contents, doc); @@ -18151,110 +9617,65 @@ export const de_ListTopicRuleDestinationsCommand = async ( }; /** - * deserializeAws_restJson1ListTopicRuleDestinationsCommandError - */ -const de_ListTopicRuleDestinationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTopicRulesCommand + * deserializeAws_restJson1ListCertificatesCommand */ -export const de_ListTopicRulesCommand = async ( +export const de_ListCertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTopicRulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - rules: (_) => de_TopicRuleList(_, context), + certificates: (_) => de_Certificates(_, context), + nextMarker: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTopicRulesCommandError + * deserializeAws_restJson1ListCertificatesByCACommand */ -const de_ListTopicRulesCommandError = async ( +export const de_ListCertificatesByCACommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + certificates: (_) => de_Certificates(_, context), + nextMarker: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListV2LoggingLevelsCommand + * deserializeAws_restJson1ListCustomMetricsCommand */ -export const de_ListV2LoggingLevelsCommand = async ( +export const de_ListCustomMetricsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListV2LoggingLevelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - logTargetConfigurations: _json, + metricNames: _json, nextToken: __expectString, }); Object.assign(contents, doc); @@ -18262,49 +9683,36 @@ export const de_ListV2LoggingLevelsCommand = async ( }; /** - * deserializeAws_restJson1ListV2LoggingLevelsCommandError + * deserializeAws_restJson1ListDetectMitigationActionsExecutionsCommand */ -const de_ListV2LoggingLevelsCommandError = async ( +export const de_ListDetectMitigationActionsExecutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "NotConfiguredException": - case "com.amazonaws.iot#NotConfiguredException": - throw await de_NotConfiguredExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + actionsExecutions: (_) => de_DetectMitigationActionExecutionList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListViolationEventsCommand + * deserializeAws_restJson1ListDetectMitigationActionsTasksCommand */ -export const de_ListViolationEventsCommand = async ( +export const de_ListDetectMitigationActionsTasksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListViolationEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -18312,1548 +9720,1094 @@ export const de_ListViolationEventsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - violationEvents: (_) => de_ViolationEvents(_, context), + tasks: (_) => de_DetectMitigationActionsTaskSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListViolationEventsCommandError + * deserializeAws_restJson1ListDimensionsCommand */ -const de_ListViolationEventsCommandError = async ( +export const de_ListDimensionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + dimensionNames: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutVerificationStateOnViolationCommand + * deserializeAws_restJson1ListDomainConfigurationsCommand */ -export const de_PutVerificationStateOnViolationCommand = async ( +export const de_ListDomainConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutVerificationStateOnViolationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + domainConfigurations: _json, + nextMarker: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutVerificationStateOnViolationCommandError + * deserializeAws_restJson1ListFleetMetricsCommand */ -const de_PutVerificationStateOnViolationCommandError = async ( +export const de_ListFleetMetricsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + fleetMetrics: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RegisterCACertificateCommand + * deserializeAws_restJson1ListIndicesCommand */ -export const de_RegisterCACertificateCommand = async ( +export const de_ListIndicesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterCACertificateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - certificateArn: __expectString, - certificateId: __expectString, + indexNames: _json, + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RegisterCACertificateCommandError + * deserializeAws_restJson1ListJobExecutionsForJobCommand */ -const de_RegisterCACertificateCommandError = async ( +export const de_ListJobExecutionsForJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateValidationException": - case "com.amazonaws.iot#CertificateValidationException": - throw await de_CertificateValidationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RegistrationCodeValidationException": - case "com.amazonaws.iot#RegistrationCodeValidationException": - throw await de_RegistrationCodeValidationExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + executionSummaries: (_) => de_JobExecutionSummaryForJobList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RegisterCertificateCommand + * deserializeAws_restJson1ListJobExecutionsForThingCommand */ -export const de_RegisterCertificateCommand = async ( +export const de_ListJobExecutionsForThingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterCertificateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - certificateArn: __expectString, - certificateId: __expectString, + executionSummaries: (_) => de_JobExecutionSummaryForThingList(_, context), + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RegisterCertificateCommandError + * deserializeAws_restJson1ListJobsCommand */ -const de_RegisterCertificateCommandError = async ( +export const de_ListJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateConflictException": - case "com.amazonaws.iot#CertificateConflictException": - throw await de_CertificateConflictExceptionRes(parsedOutput, context); - case "CertificateStateException": - case "com.amazonaws.iot#CertificateStateException": - throw await de_CertificateStateExceptionRes(parsedOutput, context); - case "CertificateValidationException": - case "com.amazonaws.iot#CertificateValidationException": - throw await de_CertificateValidationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + jobs: (_) => de_JobSummaryList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RegisterCertificateWithoutCACommand + * deserializeAws_restJson1ListJobTemplatesCommand */ -export const de_RegisterCertificateWithoutCACommand = async ( +export const de_ListJobTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterCertificateWithoutCACommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - certificateArn: __expectString, - certificateId: __expectString, + jobTemplates: (_) => de_JobTemplateSummaryList(_, context), + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RegisterCertificateWithoutCACommandError + * deserializeAws_restJson1ListManagedJobTemplatesCommand */ -const de_RegisterCertificateWithoutCACommandError = async ( +export const de_ListManagedJobTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateStateException": - case "com.amazonaws.iot#CertificateStateException": - throw await de_CertificateStateExceptionRes(parsedOutput, context); - case "CertificateValidationException": - case "com.amazonaws.iot#CertificateValidationException": - throw await de_CertificateValidationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + managedJobTemplates: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RegisterThingCommand + * deserializeAws_restJson1ListMetricValuesCommand */ -export const de_RegisterThingCommand = async ( +export const de_ListMetricValuesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterThingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - certificatePem: __expectString, - resourceArns: _json, + metricDatumList: (_) => de_MetricDatumList(_, context), + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RegisterThingCommandError - */ -const de_RegisterThingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingResourceUpdateException": - case "com.amazonaws.iot#ConflictingResourceUpdateException": - throw await de_ConflictingResourceUpdateExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceRegistrationFailureException": - case "com.amazonaws.iot#ResourceRegistrationFailureException": - throw await de_ResourceRegistrationFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RejectCertificateTransferCommand + * deserializeAws_restJson1ListMitigationActionsCommand */ -export const de_RejectCertificateTransferCommand = async ( +export const de_ListMitigationActionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RejectCertificateTransferCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + actionIdentifiers: (_) => de_MitigationActionIdentifierList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RejectCertificateTransferCommandError - */ -const de_RejectCertificateTransferCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TransferAlreadyCompletedException": - case "com.amazonaws.iot#TransferAlreadyCompletedException": - throw await de_TransferAlreadyCompletedExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RemoveThingFromBillingGroupCommand + * deserializeAws_restJson1ListOTAUpdatesCommand */ -export const de_RemoveThingFromBillingGroupCommand = async ( +export const de_ListOTAUpdatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveThingFromBillingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + otaUpdates: (_) => de_OTAUpdatesSummary(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RemoveThingFromBillingGroupCommandError + * deserializeAws_restJson1ListOutgoingCertificatesCommand */ -const de_RemoveThingFromBillingGroupCommandError = async ( +export const de_ListOutgoingCertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextMarker: __expectString, + outgoingCertificates: (_) => de_OutgoingCertificates(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RemoveThingFromThingGroupCommand + * deserializeAws_restJson1ListPackagesCommand */ -export const de_RemoveThingFromThingGroupCommand = async ( +export const de_ListPackagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveThingFromThingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + packageSummaries: (_) => de_PackageSummaryList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RemoveThingFromThingGroupCommandError + * deserializeAws_restJson1ListPackageVersionsCommand */ -const de_RemoveThingFromThingGroupCommandError = async ( +export const de_ListPackageVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + packageVersionSummaries: (_) => de_PackageVersionSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ReplaceTopicRuleCommand + * deserializeAws_restJson1ListPoliciesCommand */ -export const de_ReplaceTopicRuleCommand = async ( +export const de_ListPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ReplaceTopicRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextMarker: __expectString, + policies: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ReplaceTopicRuleCommandError + * deserializeAws_restJson1ListPolicyPrincipalsCommand */ -const de_ReplaceTopicRuleCommandError = async ( +export const de_ListPolicyPrincipalsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingResourceUpdateException": - case "com.amazonaws.iot#ConflictingResourceUpdateException": - throw await de_ConflictingResourceUpdateExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "SqlParseException": - case "com.amazonaws.iot#SqlParseException": - throw await de_SqlParseExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextMarker: __expectString, + principals: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListPolicyVersionsCommand + */ +export const de_ListPolicyVersionsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + policyVersions: (_) => de_PolicyVersions(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SearchIndexCommand + * deserializeAws_restJson1ListPrincipalPoliciesCommand */ -export const de_SearchIndexCommand = async ( +export const de_ListPrincipalPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchIndexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - thingGroups: _json, - things: _json, + nextMarker: __expectString, + policies: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SearchIndexCommandError + * deserializeAws_restJson1ListPrincipalThingsCommand */ -const de_SearchIndexCommandError = async ( +export const de_ListPrincipalThingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IndexNotReadyException": - case "com.amazonaws.iot#IndexNotReadyException": - throw await de_IndexNotReadyExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidQueryException": - case "com.amazonaws.iot#InvalidQueryException": - throw await de_InvalidQueryExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + things: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SetDefaultAuthorizerCommand + * deserializeAws_restJson1ListProvisioningTemplatesCommand */ -export const de_SetDefaultAuthorizerCommand = async ( +export const de_ListProvisioningTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SetDefaultAuthorizerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - authorizerArn: __expectString, - authorizerName: __expectString, + nextToken: __expectString, + templates: (_) => de_ProvisioningTemplateListing(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SetDefaultAuthorizerCommandError + * deserializeAws_restJson1ListProvisioningTemplateVersionsCommand */ -const de_SetDefaultAuthorizerCommandError = async ( +export const de_ListProvisioningTemplateVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iot#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + versions: (_) => de_ProvisioningTemplateVersionListing(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SetDefaultPolicyVersionCommand + * deserializeAws_restJson1ListRelatedResourcesForAuditFindingCommand */ -export const de_SetDefaultPolicyVersionCommand = async ( +export const de_ListRelatedResourcesForAuditFindingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SetDefaultPolicyVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + relatedResources: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SetDefaultPolicyVersionCommandError + * deserializeAws_restJson1ListRoleAliasesCommand */ -const de_SetDefaultPolicyVersionCommandError = async ( +export const de_ListRoleAliasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextMarker: __expectString, + roleAliases: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SetLoggingOptionsCommand + * deserializeAws_restJson1ListScheduledAuditsCommand */ -export const de_SetLoggingOptionsCommand = async ( +export const de_ListScheduledAuditsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SetLoggingOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + scheduledAudits: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SetLoggingOptionsCommandError + * deserializeAws_restJson1ListSecurityProfilesCommand */ -const de_SetLoggingOptionsCommandError = async ( +export const de_ListSecurityProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + securityProfileIdentifiers: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SetV2LoggingLevelCommand + * deserializeAws_restJson1ListSecurityProfilesForTargetCommand */ -export const de_SetV2LoggingLevelCommand = async ( +export const de_ListSecurityProfilesForTargetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SetV2LoggingLevelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + securityProfileTargetMappings: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SetV2LoggingLevelCommandError + * deserializeAws_restJson1ListStreamsCommand */ -const de_SetV2LoggingLevelCommandError = async ( +export const de_ListStreamsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotConfiguredException": - case "com.amazonaws.iot#NotConfiguredException": - throw await de_NotConfiguredExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + streams: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SetV2LoggingOptionsCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_SetV2LoggingOptionsCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SetV2LoggingOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + tags: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SetV2LoggingOptionsCommandError + * deserializeAws_restJson1ListTargetsForPolicyCommand */ -const de_SetV2LoggingOptionsCommandError = async ( +export const de_ListTargetsForPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextMarker: __expectString, + targets: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartAuditMitigationActionsTaskCommand + * deserializeAws_restJson1ListTargetsForSecurityProfileCommand */ -export const de_StartAuditMitigationActionsTaskCommand = async ( +export const de_ListTargetsForSecurityProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartAuditMitigationActionsTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - taskId: __expectString, + nextToken: __expectString, + securityProfileTargets: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartAuditMitigationActionsTaskCommandError + * deserializeAws_restJson1ListThingGroupsCommand */ -const de_StartAuditMitigationActionsTaskCommandError = async ( +export const de_ListThingGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TaskAlreadyExistsException": - case "com.amazonaws.iot#TaskAlreadyExistsException": - throw await de_TaskAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + thingGroups: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartDetectMitigationActionsTaskCommand + * deserializeAws_restJson1ListThingGroupsForThingCommand */ -export const de_StartDetectMitigationActionsTaskCommand = async ( +export const de_ListThingGroupsForThingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartDetectMitigationActionsTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - taskId: __expectString, + nextToken: __expectString, + thingGroups: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartDetectMitigationActionsTaskCommandError + * deserializeAws_restJson1ListThingPrincipalsCommand */ -const de_StartDetectMitigationActionsTaskCommandError = async ( +export const de_ListThingPrincipalsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TaskAlreadyExistsException": - case "com.amazonaws.iot#TaskAlreadyExistsException": - throw await de_TaskAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + principals: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartOnDemandAuditTaskCommand + * deserializeAws_restJson1ListThingRegistrationTaskReportsCommand */ -export const de_StartOnDemandAuditTaskCommand = async ( +export const de_ListThingRegistrationTaskReportsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartOnDemandAuditTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - taskId: __expectString, + nextToken: __expectString, + reportType: __expectString, + resourceLinks: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartOnDemandAuditTaskCommandError + * deserializeAws_restJson1ListThingRegistrationTasksCommand */ -const de_StartOnDemandAuditTaskCommandError = async ( +export const de_ListThingRegistrationTasksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + taskIds: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartThingRegistrationTaskCommand + * deserializeAws_restJson1ListThingsCommand */ -export const de_StartThingRegistrationTaskCommand = async ( +export const de_ListThingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartThingRegistrationTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - taskId: __expectString, + nextToken: __expectString, + things: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartThingRegistrationTaskCommandError - */ -const de_StartThingRegistrationTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StopThingRegistrationTaskCommand + * deserializeAws_restJson1ListThingsInBillingGroupCommand */ -export const de_StopThingRegistrationTaskCommand = async ( +export const de_ListThingsInBillingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopThingRegistrationTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + things: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StopThingRegistrationTaskCommandError + * deserializeAws_restJson1ListThingsInThingGroupCommand */ -const de_StopThingRegistrationTaskCommandError = async ( +export const de_ListThingsInThingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + things: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListThingTypesCommand */ -export const de_TagResourceCommand = async ( +export const de_ListThingTypesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + thingTypes: (_) => de_ThingTypeList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1ListTopicRuleDestinationsCommand */ -const de_TagResourceCommandError = async ( +export const de_ListTopicRuleDestinationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + destinationSummaries: (_) => de_TopicRuleDestinationSummaries(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TestAuthorizationCommand + * deserializeAws_restJson1ListTopicRulesCommand */ -export const de_TestAuthorizationCommand = async ( +export const de_ListTopicRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TestAuthorizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - authResults: _json, + nextToken: __expectString, + rules: (_) => de_TopicRuleList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TestAuthorizationCommandError + * deserializeAws_restJson1ListV2LoggingLevelsCommand */ -const de_TestAuthorizationCommandError = async ( +export const de_ListV2LoggingLevelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + logTargetConfigurations: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TestInvokeAuthorizerCommand + * deserializeAws_restJson1ListViolationEventsCommand */ -export const de_TestInvokeAuthorizerCommand = async ( +export const de_ListViolationEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TestInvokeAuthorizerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - disconnectAfterInSeconds: __expectInt32, - isAuthenticated: __expectBoolean, - policyDocuments: _json, - principalId: __expectString, - refreshAfterInSeconds: __expectInt32, + nextToken: __expectString, + violationEvents: (_) => de_ViolationEvents(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TestInvokeAuthorizerCommandError + * deserializeAws_restJson1PutVerificationStateOnViolationCommand */ -const de_TestInvokeAuthorizerCommandError = async ( +export const de_PutVerificationStateOnViolationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidResponseException": - case "com.amazonaws.iot#InvalidResponseException": - throw await de_InvalidResponseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1TransferCertificateCommand + * deserializeAws_restJson1RegisterCACertificateCommand */ -export const de_TransferCertificateCommand = async ( +export const de_RegisterCACertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TransferCertificateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - transferredCertificateArn: __expectString, + certificateArn: __expectString, + certificateId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TransferCertificateCommandError + * deserializeAws_restJson1RegisterCertificateCommand */ -const de_TransferCertificateCommandError = async ( +export const de_RegisterCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateStateException": - case "com.amazonaws.iot#CertificateStateException": - throw await de_CertificateStateExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TransferConflictException": - case "com.amazonaws.iot#TransferConflictException": - throw await de_TransferConflictExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + certificateArn: __expectString, + certificateId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1RegisterCertificateWithoutCACommand */ -export const de_UntagResourceCommand = async ( +export const de_RegisterCertificateWithoutCACommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + certificateArn: __expectString, + certificateId: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1RegisterThingCommand */ -const de_UntagResourceCommandError = async ( +export const de_RegisterThingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + certificatePem: __expectString, + resourceArns: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateAccountAuditConfigurationCommand + * deserializeAws_restJson1RejectCertificateTransferCommand */ -export const de_UpdateAccountAuditConfigurationCommand = async ( +export const de_RejectCertificateTransferCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAccountAuditConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -19863,46 +10817,31 @@ export const de_UpdateAccountAuditConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateAccountAuditConfigurationCommandError + * deserializeAws_restJson1RemoveThingFromBillingGroupCommand */ -const de_UpdateAccountAuditConfigurationCommandError = async ( +export const de_RemoveThingFromBillingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateAuditSuppressionCommand + * deserializeAws_restJson1RemoveThingFromThingGroupCommand */ -export const de_UpdateAuditSuppressionCommand = async ( +export const de_RemoveThingFromThingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAuditSuppressionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -19912,174 +10851,93 @@ export const de_UpdateAuditSuppressionCommand = async ( }; /** - * deserializeAws_restJson1UpdateAuditSuppressionCommandError + * deserializeAws_restJson1ReplaceTopicRuleCommand */ -const de_UpdateAuditSuppressionCommandError = async ( +export const de_ReplaceTopicRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateAuthorizerCommand + * deserializeAws_restJson1SearchIndexCommand */ -export const de_UpdateAuthorizerCommand = async ( +export const de_SearchIndexCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAuthorizerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - authorizerArn: __expectString, - authorizerName: __expectString, + nextToken: __expectString, + thingGroups: _json, + things: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateAuthorizerCommandError - */ -const de_UpdateAuthorizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iot#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateBillingGroupCommand + * deserializeAws_restJson1SetDefaultAuthorizerCommand */ -export const de_UpdateBillingGroupCommand = async ( +export const de_SetDefaultAuthorizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBillingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - version: __expectLong, + authorizerArn: __expectString, + authorizerName: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateBillingGroupCommandError + * deserializeAws_restJson1SetDefaultPolicyVersionCommand */ -const de_UpdateBillingGroupCommandError = async ( +export const de_SetDefaultPolicyVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VersionConflictException": - case "com.amazonaws.iot#VersionConflictException": - throw await de_VersionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateCACertificateCommand + * deserializeAws_restJson1SetLoggingOptionsCommand */ -export const de_UpdateCACertificateCommand = async ( +export const de_SetLoggingOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCACertificateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20089,55 +10947,31 @@ export const de_UpdateCACertificateCommand = async ( }; /** - * deserializeAws_restJson1UpdateCACertificateCommandError + * deserializeAws_restJson1SetV2LoggingLevelCommand */ -const de_UpdateCACertificateCommandError = async ( +export const de_SetV2LoggingLevelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateCertificateCommand + * deserializeAws_restJson1SetV2LoggingOptionsCommand */ -export const de_UpdateCertificateCommand = async ( +export const de_SetV2LoggingOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCertificateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20147,420 +10981,293 @@ export const de_UpdateCertificateCommand = async ( }; /** - * deserializeAws_restJson1UpdateCertificateCommandError + * deserializeAws_restJson1StartAuditMitigationActionsTaskCommand */ -const de_UpdateCertificateCommandError = async ( +export const de_StartAuditMitigationActionsTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateStateException": - case "com.amazonaws.iot#CertificateStateException": - throw await de_CertificateStateExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + taskId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateCertificateProviderCommand + * deserializeAws_restJson1StartDetectMitigationActionsTaskCommand */ -export const de_UpdateCertificateProviderCommand = async ( +export const de_StartDetectMitigationActionsTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCertificateProviderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - certificateProviderArn: __expectString, - certificateProviderName: __expectString, + taskId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateCertificateProviderCommandError + * deserializeAws_restJson1StartOnDemandAuditTaskCommand */ -const de_UpdateCertificateProviderCommandError = async ( +export const de_StartOnDemandAuditTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + taskId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateCustomMetricCommand + * deserializeAws_restJson1StartThingRegistrationTaskCommand */ -export const de_UpdateCustomMetricCommand = async ( +export const de_StartThingRegistrationTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCustomMetricCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - displayName: __expectString, - lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - metricArn: __expectString, - metricName: __expectString, - metricType: __expectString, + taskId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateCustomMetricCommandError + * deserializeAws_restJson1StopThingRegistrationTaskCommand */ -const de_UpdateCustomMetricCommandError = async ( +export const de_StopThingRegistrationTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateDimensionCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UpdateDimensionCommand = async ( +export const de_TagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1TestAuthorizationCommand + */ +export const de_TestAuthorizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDimensionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - arn: __expectString, - creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - name: __expectString, - stringValues: _json, - type: __expectString, + authResults: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateDimensionCommandError + * deserializeAws_restJson1TestInvokeAuthorizerCommand */ -const de_UpdateDimensionCommandError = async ( +export const de_TestInvokeAuthorizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + disconnectAfterInSeconds: __expectInt32, + isAuthenticated: __expectBoolean, + policyDocuments: _json, + principalId: __expectString, + refreshAfterInSeconds: __expectInt32, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateDomainConfigurationCommand + * deserializeAws_restJson1TransferCertificateCommand */ -export const de_UpdateDomainConfigurationCommand = async ( +export const de_TransferCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDomainConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - domainConfigurationArn: __expectString, - domainConfigurationName: __expectString, + transferredCertificateArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateDomainConfigurationCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UpdateDomainConfigurationCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateValidationException": - case "com.amazonaws.iot#CertificateValidationException": - throw await de_CertificateValidationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateDynamicThingGroupCommand + * deserializeAws_restJson1UpdateAccountAuditConfigurationCommand */ -export const de_UpdateDynamicThingGroupCommand = async ( +export const de_UpdateAccountAuditConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDynamicThingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - version: __expectLong, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1UpdateDynamicThingGroupCommandError + * deserializeAws_restJson1UpdateAuditSuppressionCommand */ -const de_UpdateDynamicThingGroupCommandError = async ( +export const de_UpdateAuditSuppressionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidQueryException": - case "com.amazonaws.iot#InvalidQueryException": - throw await de_InvalidQueryExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VersionConflictException": - case "com.amazonaws.iot#VersionConflictException": - throw await de_VersionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateEventConfigurationsCommand + * deserializeAws_restJson1UpdateAuthorizerCommand */ -export const de_UpdateEventConfigurationsCommand = async ( +export const de_UpdateAuthorizerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEventConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + authorizerArn: __expectString, + authorizerName: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateEventConfigurationsCommandError + * deserializeAws_restJson1UpdateBillingGroupCommand */ -const de_UpdateEventConfigurationsCommandError = async ( +export const de_UpdateBillingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + version: __expectLong, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateFleetMetricCommand + * deserializeAws_restJson1UpdateCACertificateCommand */ -export const de_UpdateFleetMetricCommand = async ( +export const de_UpdateCACertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFleetMetricCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20570,231 +11277,165 @@ export const de_UpdateFleetMetricCommand = async ( }; /** - * deserializeAws_restJson1UpdateFleetMetricCommandError - */ -const de_UpdateFleetMetricCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IndexNotReadyException": - case "com.amazonaws.iot#IndexNotReadyException": - throw await de_IndexNotReadyExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidAggregationException": - case "com.amazonaws.iot#InvalidAggregationException": - throw await de_InvalidAggregationExceptionRes(parsedOutput, context); - case "InvalidQueryException": - case "com.amazonaws.iot#InvalidQueryException": - throw await de_InvalidQueryExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "VersionConflictException": - case "com.amazonaws.iot#VersionConflictException": - throw await de_VersionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + * deserializeAws_restJson1UpdateCertificateCommand + */ +export const de_UpdateCertificateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateIndexingConfigurationCommand + * deserializeAws_restJson1UpdateCertificateProviderCommand */ -export const de_UpdateIndexingConfigurationCommand = async ( +export const de_UpdateCertificateProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIndexingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + certificateProviderArn: __expectString, + certificateProviderName: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateIndexingConfigurationCommandError + * deserializeAws_restJson1UpdateCustomMetricCommand */ -const de_UpdateIndexingConfigurationCommandError = async ( +export const de_UpdateCustomMetricCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + displayName: __expectString, + lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + metricArn: __expectString, + metricName: __expectString, + metricType: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateJobCommand + * deserializeAws_restJson1UpdateDimensionCommand */ -export const de_UpdateJobCommand = async ( +export const de_UpdateDimensionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + arn: __expectString, + creationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + lastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + name: __expectString, + stringValues: _json, + type: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateJobCommandError + * deserializeAws_restJson1UpdateDomainConfigurationCommand */ -const de_UpdateJobCommandError = async ( +export const de_UpdateDomainConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + domainConfigurationArn: __expectString, + domainConfigurationName: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateMitigationActionCommand + * deserializeAws_restJson1UpdateDynamicThingGroupCommand */ -export const de_UpdateMitigationActionCommand = async ( +export const de_UpdateDynamicThingGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMitigationActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - actionArn: __expectString, - actionId: __expectString, + version: __expectLong, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateMitigationActionCommandError + * deserializeAws_restJson1UpdateEventConfigurationsCommand */ -const de_UpdateMitigationActionCommandError = async ( +export const de_UpdateEventConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdatePackageCommand + * deserializeAws_restJson1UpdateFleetMetricCommand */ -export const de_UpdatePackageCommand = async ( +export const de_UpdateFleetMetricCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20804,52 +11445,31 @@ export const de_UpdatePackageCommand = async ( }; /** - * deserializeAws_restJson1UpdatePackageCommandError + * deserializeAws_restJson1UpdateIndexingConfigurationCommand */ -const de_UpdatePackageCommandError = async ( +export const de_UpdateIndexingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.iot#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iot#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iot#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdatePackageConfigurationCommand + * deserializeAws_restJson1UpdateJobCommand */ -export const de_UpdatePackageConfigurationCommand = async ( +export const de_UpdateJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePackageConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20859,49 +11479,36 @@ export const de_UpdatePackageConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdatePackageConfigurationCommandError + * deserializeAws_restJson1UpdateMitigationActionCommand */ -const de_UpdatePackageConfigurationCommandError = async ( +export const de_UpdateMitigationActionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.iot#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iot#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iot#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + actionArn: __expectString, + actionId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdatePackageVersionCommand + * deserializeAws_restJson1UpdatePackageCommand */ -export const de_UpdatePackageVersionCommand = async ( +export const de_UpdatePackageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePackageVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20911,52 +11518,31 @@ export const de_UpdatePackageVersionCommand = async ( }; /** - * deserializeAws_restJson1UpdatePackageVersionCommandError + * deserializeAws_restJson1UpdatePackageConfigurationCommand */ -const de_UpdatePackageVersionCommandError = async ( +export const de_UpdatePackageConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.iot#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iot#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iot#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateProvisioningTemplateCommand + * deserializeAws_restJson1UpdatePackageVersionCommand */ -export const de_UpdateProvisioningTemplateCommand = async ( +export const de_UpdatePackageVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProvisioningTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -20966,41 +11552,20 @@ export const de_UpdateProvisioningTemplateCommand = async ( }; /** - * deserializeAws_restJson1UpdateProvisioningTemplateCommandError + * deserializeAws_restJson1UpdateProvisioningTemplateCommand */ -const de_UpdateProvisioningTemplateCommandError = async ( +export const de_UpdateProvisioningTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingResourceUpdateException": - case "com.amazonaws.iot#ConflictingResourceUpdateException": - throw await de_ConflictingResourceUpdateExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -21011,7 +11576,7 @@ export const de_UpdateRoleAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRoleAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -21025,47 +11590,6 @@ export const de_UpdateRoleAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRoleAliasCommandError - */ -const de_UpdateRoleAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateScheduledAuditCommand */ @@ -21074,7 +11598,7 @@ export const de_UpdateScheduledAuditCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateScheduledAuditCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -21087,41 +11611,6 @@ export const de_UpdateScheduledAuditCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateScheduledAuditCommandError - */ -const de_UpdateScheduledAuditCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSecurityProfileCommand */ @@ -21130,7 +11619,7 @@ export const de_UpdateSecurityProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSecurityProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -21146,175 +11635,52 @@ export const de_UpdateSecurityProfileCommand = async ( metricsExportConfig: _json, securityProfileArn: __expectString, securityProfileDescription: __expectString, - securityProfileName: __expectString, - version: __expectLong, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateSecurityProfileCommandError - */ -const de_UpdateSecurityProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VersionConflictException": - case "com.amazonaws.iot#VersionConflictException": - throw await de_VersionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateStreamCommand - */ -export const de_UpdateStreamCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateStreamCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - description: __expectString, - streamArn: __expectString, - streamId: __expectString, - streamVersion: __expectInt32, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateStreamCommandError - */ -const de_UpdateStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + securityProfileName: __expectString, + version: __expectLong, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateThingCommand + * deserializeAws_restJson1UpdateStreamCommand */ -export const de_UpdateThingCommand = async ( +export const de_UpdateStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateThingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + description: __expectString, + streamArn: __expectString, + streamId: __expectString, + streamVersion: __expectInt32, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateThingCommandError + * deserializeAws_restJson1UpdateThingCommand */ -const de_UpdateThingCommandError = async ( +export const de_UpdateThingCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "VersionConflictException": - case "com.amazonaws.iot#VersionConflictException": - throw await de_VersionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -21325,7 +11691,7 @@ export const de_UpdateThingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateThingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -21338,44 +11704,6 @@ export const de_UpdateThingGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateThingGroupCommandError - */ -const de_UpdateThingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VersionConflictException": - case "com.amazonaws.iot#VersionConflictException": - throw await de_VersionConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateThingGroupsForThingCommand */ @@ -21384,7 +11712,7 @@ export const de_UpdateThingGroupsForThingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateThingGroupsForThingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -21393,41 +11721,6 @@ export const de_UpdateThingGroupsForThingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateThingGroupsForThingCommandError - */ -const de_UpdateThingGroupsForThingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iot#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iot#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iot#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTopicRuleDestinationCommand */ @@ -21436,7 +11729,7 @@ export const de_UpdateTopicRuleDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTopicRuleDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -21445,44 +11738,6 @@ export const de_UpdateTopicRuleDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateTopicRuleDestinationCommandError - */ -const de_UpdateTopicRuleDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingResourceUpdateException": - case "com.amazonaws.iot#ConflictingResourceUpdateException": - throw await de_ConflictingResourceUpdateExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.iot#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iot#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iot#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iot#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ValidateSecurityProfileBehaviorsCommand */ @@ -21491,7 +11746,7 @@ export const de_ValidateSecurityProfileBehaviorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ValidateSecurityProfileBehaviorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -21506,12 +11761,9 @@ export const de_ValidateSecurityProfileBehaviorsCommand = async ( }; /** - * deserializeAws_restJson1ValidateSecurityProfileBehaviorsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_ValidateSecurityProfileBehaviorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -21524,16 +11776,106 @@ const de_ValidateSecurityProfileBehaviorsCommandError = async ( case "InvalidRequestException": case "com.amazonaws.iot#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.iot#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.iot#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.iot#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "TransferAlreadyCompletedException": + case "com.amazonaws.iot#TransferAlreadyCompletedException": + throw await de_TransferAlreadyCompletedExceptionRes(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.iot#UnauthorizedException": + throw await de_UnauthorizedExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.iot#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "VersionConflictException": + case "com.amazonaws.iot#VersionConflictException": + throw await de_VersionConflictExceptionRes(parsedOutput, context); + case "InvalidStateTransitionException": + case "com.amazonaws.iot#InvalidStateTransitionException": + throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context); + case "ConflictingResourceUpdateException": + case "com.amazonaws.iot#ConflictingResourceUpdateException": + throw await de_ConflictingResourceUpdateExceptionRes(parsedOutput, context); + case "InternalException": + case "com.amazonaws.iot#InternalException": + throw await de_InternalExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.iot#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "CertificateValidationException": + case "com.amazonaws.iot#CertificateValidationException": + throw await de_CertificateValidationExceptionRes(parsedOutput, context); + case "InvalidQueryException": + case "com.amazonaws.iot#InvalidQueryException": + throw await de_InvalidQueryExceptionRes(parsedOutput, context); + case "IndexNotReadyException": + case "com.amazonaws.iot#IndexNotReadyException": + throw await de_IndexNotReadyExceptionRes(parsedOutput, context); + case "InvalidAggregationException": + case "com.amazonaws.iot#InvalidAggregationException": + throw await de_InvalidAggregationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.iot#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.iot#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.iot#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.iot#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "MalformedPolicyException": + case "com.amazonaws.iot#MalformedPolicyException": + throw await de_MalformedPolicyExceptionRes(parsedOutput, context); + case "VersionsLimitExceededException": + case "com.amazonaws.iot#VersionsLimitExceededException": + throw await de_VersionsLimitExceededExceptionRes(parsedOutput, context); + case "SqlParseException": + case "com.amazonaws.iot#SqlParseException": + throw await de_SqlParseExceptionRes(parsedOutput, context); + case "DeleteConflictException": + case "com.amazonaws.iot#DeleteConflictException": + throw await de_DeleteConflictExceptionRes(parsedOutput, context); + case "CertificateStateException": + case "com.amazonaws.iot#CertificateStateException": + throw await de_CertificateStateExceptionRes(parsedOutput, context); + case "NotConfiguredException": + case "com.amazonaws.iot#NotConfiguredException": + throw await de_NotConfiguredExceptionRes(parsedOutput, context); + case "RegistrationCodeValidationException": + case "com.amazonaws.iot#RegistrationCodeValidationException": + throw await de_RegistrationCodeValidationExceptionRes(parsedOutput, context); + case "CertificateConflictException": + case "com.amazonaws.iot#CertificateConflictException": + throw await de_CertificateConflictExceptionRes(parsedOutput, context); + case "ResourceRegistrationFailureException": + case "com.amazonaws.iot#ResourceRegistrationFailureException": + throw await de_ResourceRegistrationFailureExceptionRes(parsedOutput, context); + case "TaskAlreadyExistsException": + case "com.amazonaws.iot#TaskAlreadyExistsException": + throw await de_TaskAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidResponseException": + case "com.amazonaws.iot#InvalidResponseException": + throw await de_InvalidResponseExceptionRes(parsedOutput, context); + case "TransferConflictException": + case "com.amazonaws.iot#TransferConflictException": + throw await de_TransferConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts b/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts index 2d56e4ab0a9e..ff56d68693d1 100644 --- a/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotanalytics/src/protocols/Aws_restJson1.ts @@ -884,7 +884,7 @@ export const de_BatchPutMessageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchPutMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -897,44 +897,6 @@ export const de_BatchPutMessageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchPutMessageCommandError - */ -const de_BatchPutMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelPipelineReprocessingCommand */ @@ -943,7 +905,7 @@ export const de_CancelPipelineReprocessingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelPipelineReprocessingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -952,44 +914,6 @@ export const de_CancelPipelineReprocessingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelPipelineReprocessingCommandError - */ -const de_CancelPipelineReprocessingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateChannelCommand */ @@ -998,7 +922,7 @@ export const de_CreateChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1013,47 +937,6 @@ export const de_CreateChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateChannelCommandError - */ -const de_CreateChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotanalytics#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotanalytics#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDatasetCommand */ @@ -1062,7 +945,7 @@ export const de_CreateDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1077,47 +960,6 @@ export const de_CreateDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDatasetCommandError - */ -const de_CreateDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotanalytics#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotanalytics#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDatasetContentCommand */ @@ -1126,7 +968,7 @@ export const de_CreateDatasetContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDatasetContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1139,44 +981,6 @@ export const de_CreateDatasetContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDatasetContentCommandError - */ -const de_CreateDatasetContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDatastoreCommand */ @@ -1185,7 +989,7 @@ export const de_CreateDatastoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDatastoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1200,47 +1004,6 @@ export const de_CreateDatastoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDatastoreCommandError - */ -const de_CreateDatastoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotanalytics#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotanalytics#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePipelineCommand */ @@ -1249,7 +1012,7 @@ export const de_CreatePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreatePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1264,55 +1027,14 @@ export const de_CreatePipelineCommand = async ( }; /** - * deserializeAws_restJson1CreatePipelineCommandError + * deserializeAws_restJson1DeleteChannelCommand */ -const de_CreatePipelineCommandError = async ( +export const de_DeleteChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotanalytics#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotanalytics#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteChannelCommand - */ -export const de_DeleteChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteChannelCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1321,44 +1043,6 @@ export const de_DeleteChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteChannelCommandError - */ -const de_DeleteChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDatasetCommand */ @@ -1367,7 +1051,7 @@ export const de_DeleteDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1376,44 +1060,6 @@ export const de_DeleteDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDatasetCommandError - */ -const de_DeleteDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDatasetContentCommand */ @@ -1422,7 +1068,7 @@ export const de_DeleteDatasetContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDatasetContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1431,44 +1077,6 @@ export const de_DeleteDatasetContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDatasetContentCommandError - */ -const de_DeleteDatasetContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDatastoreCommand */ @@ -1477,7 +1085,7 @@ export const de_DeleteDatastoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDatastoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1486,44 +1094,6 @@ export const de_DeleteDatastoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDatastoreCommandError - */ -const de_DeleteDatastoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePipelineCommand */ @@ -1532,7 +1102,7 @@ export const de_DeletePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeletePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1541,44 +1111,6 @@ export const de_DeletePipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePipelineCommandError - */ -const de_DeletePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeChannelCommand */ @@ -1587,7 +1119,7 @@ export const de_DescribeChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1601,44 +1133,6 @@ export const de_DescribeChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeChannelCommandError - */ -const de_DescribeChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDatasetCommand */ @@ -1647,7 +1141,7 @@ export const de_DescribeDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1660,44 +1154,6 @@ export const de_DescribeDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDatasetCommandError - */ -const de_DescribeDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDatastoreCommand */ @@ -1706,7 +1162,7 @@ export const de_DescribeDatastoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDatastoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1721,52 +1177,14 @@ export const de_DescribeDatastoreCommand = async ( }; /** - * deserializeAws_restJson1DescribeDatastoreCommandError + * deserializeAws_restJson1DescribeLoggingOptionsCommand */ -const de_DescribeDatastoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeLoggingOptionsCommand - */ -export const de_DescribeLoggingOptionsCommand = async ( +export const de_DescribeLoggingOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeLoggingOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1779,44 +1197,6 @@ export const de_DescribeLoggingOptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeLoggingOptionsCommandError - */ -const de_DescribeLoggingOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribePipelineCommand */ @@ -1825,7 +1205,7 @@ export const de_DescribePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1838,44 +1218,6 @@ export const de_DescribePipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribePipelineCommandError - */ -const de_DescribePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDatasetContentCommand */ @@ -1884,7 +1226,7 @@ export const de_GetDatasetContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDatasetContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1899,44 +1241,6 @@ export const de_GetDatasetContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDatasetContentCommandError - */ -const de_GetDatasetContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListChannelsCommand */ @@ -1945,7 +1249,7 @@ export const de_ListChannelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1959,41 +1263,6 @@ export const de_ListChannelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListChannelsCommandError - */ -const de_ListChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDatasetContentsCommand */ @@ -2002,7 +1271,7 @@ export const de_ListDatasetContentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDatasetContentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2016,44 +1285,6 @@ export const de_ListDatasetContentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDatasetContentsCommandError - */ -const de_ListDatasetContentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDatasetsCommand */ @@ -2062,7 +1293,7 @@ export const de_ListDatasetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDatasetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2076,41 +1307,6 @@ export const de_ListDatasetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDatasetsCommandError - */ -const de_ListDatasetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDatastoresCommand */ @@ -2119,7 +1315,7 @@ export const de_ListDatastoresCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDatastoresCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2133,41 +1329,6 @@ export const de_ListDatastoresCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDatastoresCommandError - */ -const de_ListDatastoresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPipelinesCommand */ @@ -2176,7 +1337,7 @@ export const de_ListPipelinesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPipelinesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2190,41 +1351,6 @@ export const de_ListPipelinesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListPipelinesCommandError - */ -const de_ListPipelinesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -2233,7 +1359,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2246,47 +1372,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotanalytics#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutLoggingOptionsCommand */ @@ -2295,7 +1380,7 @@ export const de_PutLoggingOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutLoggingOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2304,217 +1389,68 @@ export const de_PutLoggingOptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutLoggingOptionsCommandError - */ -const de_PutLoggingOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RunPipelineActivityCommand */ export const de_RunPipelineActivityCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RunPipelineActivityCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - logResult: __expectString, - payloads: (_) => de_MessagePayloads(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1RunPipelineActivityCommandError - */ -const de_RunPipelineActivityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SampleChannelDataCommand - */ -export const de_SampleChannelDataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SampleChannelDataCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - payloads: (_) => de_MessagePayloads(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SampleChannelDataCommandError - */ -const de_SampleChannelDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + logResult: __expectString, + payloads: (_) => de_MessagePayloads(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartPipelineReprocessingCommand + * deserializeAws_restJson1SampleChannelDataCommand */ -export const de_StartPipelineReprocessingCommand = async ( +export const de_SampleChannelDataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartPipelineReprocessingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - reprocessingId: __expectString, + payloads: (_) => de_MessagePayloads(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartPipelineReprocessingCommandError + * deserializeAws_restJson1StartPipelineReprocessingCommand */ -const de_StartPipelineReprocessingCommandError = async ( +export const de_StartPipelineReprocessingCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotanalytics#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + reprocessingId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2525,7 +1461,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2534,47 +1470,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotanalytics#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2583,7 +1478,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2592,47 +1487,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotanalytics#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateChannelCommand */ @@ -2641,7 +1495,7 @@ export const de_UpdateChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2650,44 +1504,6 @@ export const de_UpdateChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateChannelCommandError - */ -const de_UpdateChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDatasetCommand */ @@ -2696,7 +1512,7 @@ export const de_UpdateDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2705,44 +1521,6 @@ export const de_UpdateDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDatasetCommandError - */ -const de_UpdateDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDatastoreCommand */ @@ -2751,7 +1529,7 @@ export const de_UpdateDatastoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDatastoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2760,44 +1538,6 @@ export const de_UpdateDatastoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDatastoreCommandError - */ -const de_UpdateDatastoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotanalytics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotanalytics#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotanalytics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePipelineCommand */ @@ -2806,7 +1546,7 @@ export const de_UpdatePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2816,12 +1556,9 @@ export const de_UpdatePipelineCommand = async ( }; /** - * deserializeAws_restJson1UpdatePipelineCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdatePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2834,9 +1571,6 @@ const de_UpdatePipelineCommandError = async ( case "InvalidRequestException": case "com.amazonaws.iotanalytics#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotanalytics#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.iotanalytics#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); @@ -2846,13 +1580,19 @@ const de_UpdatePipelineCommandError = async ( case "ThrottlingException": case "com.amazonaws.iotanalytics#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.iotanalytics#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.iotanalytics#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts b/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts index 7b7bbbf35b6b..802515ee4d7f 100644 --- a/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotdeviceadvisor/src/protocols/Aws_restJson1.ts @@ -356,7 +356,7 @@ export const de_CreateSuiteDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSuiteDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -372,35 +372,6 @@ export const de_CreateSuiteDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSuiteDefinitionCommandError - */ -const de_CreateSuiteDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotdeviceadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotdeviceadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSuiteDefinitionCommand */ @@ -409,7 +380,7 @@ export const de_DeleteSuiteDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSuiteDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -418,35 +389,6 @@ export const de_DeleteSuiteDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSuiteDefinitionCommandError - */ -const de_DeleteSuiteDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotdeviceadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotdeviceadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEndpointCommand */ @@ -455,7 +397,7 @@ export const de_GetEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -468,38 +410,6 @@ export const de_GetEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEndpointCommandError - */ -const de_GetEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotdeviceadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotdeviceadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSuiteDefinitionCommand */ @@ -508,7 +418,7 @@ export const de_GetSuiteDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSuiteDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -528,38 +438,6 @@ export const de_GetSuiteDefinitionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSuiteDefinitionCommandError - */ -const de_GetSuiteDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotdeviceadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotdeviceadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSuiteRunCommand */ @@ -568,7 +446,7 @@ export const de_GetSuiteRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSuiteRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -591,38 +469,6 @@ export const de_GetSuiteRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSuiteRunCommandError - */ -const de_GetSuiteRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotdeviceadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotdeviceadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSuiteRunReportCommand */ @@ -631,7 +477,7 @@ export const de_GetSuiteRunReportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSuiteRunReportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -644,38 +490,6 @@ export const de_GetSuiteRunReportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSuiteRunReportCommandError - */ -const de_GetSuiteRunReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotdeviceadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotdeviceadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSuiteDefinitionsCommand */ @@ -684,7 +498,7 @@ export const de_ListSuiteDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSuiteDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -698,35 +512,6 @@ export const de_ListSuiteDefinitionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSuiteDefinitionsCommandError - */ -const de_ListSuiteDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotdeviceadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotdeviceadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSuiteRunsCommand */ @@ -735,7 +520,7 @@ export const de_ListSuiteRunsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSuiteRunsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -749,35 +534,6 @@ export const de_ListSuiteRunsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSuiteRunsCommandError - */ -const de_ListSuiteRunsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotdeviceadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotdeviceadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -786,7 +542,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -799,38 +555,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotdeviceadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotdeviceadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartSuiteRunCommand */ @@ -839,7 +563,7 @@ export const de_StartSuiteRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartSuiteRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -855,38 +579,6 @@ export const de_StartSuiteRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartSuiteRunCommandError - */ -const de_StartSuiteRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.iotdeviceadvisor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotdeviceadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotdeviceadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopSuiteRunCommand */ @@ -895,7 +587,7 @@ export const de_StopSuiteRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopSuiteRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -904,38 +596,6 @@ export const de_StopSuiteRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopSuiteRunCommandError - */ -const de_StopSuiteRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotdeviceadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotdeviceadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -944,7 +604,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -953,38 +613,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotdeviceadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotdeviceadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -993,7 +621,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1002,38 +630,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iotdeviceadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotdeviceadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSuiteDefinitionCommand */ @@ -1042,7 +638,7 @@ export const de_UpdateSuiteDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSuiteDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1061,12 +657,9 @@ export const de_UpdateSuiteDefinitionCommand = async ( }; /** - * deserializeAws_restJson1UpdateSuiteDefinitionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateSuiteDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1079,13 +672,19 @@ const de_UpdateSuiteDefinitionCommandError = async ( case "ValidationException": case "com.amazonaws.iotdeviceadvisor#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.iotdeviceadvisor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.iotdeviceadvisor#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts b/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts index c55f6d4073c3..44cfacc0c85b 100644 --- a/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotfleethub/src/protocols/Aws_restJson1.ts @@ -219,7 +219,7 @@ export const de_CreateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -233,41 +233,6 @@ export const de_CreateApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotfleethub#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotfleethub#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotfleethub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleethub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteApplicationCommand */ @@ -276,7 +241,7 @@ export const de_DeleteApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -285,41 +250,6 @@ export const de_DeleteApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteApplicationCommandError - */ -const de_DeleteApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotfleethub#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotfleethub#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleethub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleethub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeApplicationCommand */ @@ -328,7 +258,7 @@ export const de_DescribeApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -352,41 +282,6 @@ export const de_DescribeApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeApplicationCommandError - */ -const de_DescribeApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotfleethub#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotfleethub#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleethub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleethub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationsCommand */ @@ -395,7 +290,7 @@ export const de_ListApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -409,38 +304,6 @@ export const de_ListApplicationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationsCommandError - */ -const de_ListApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotfleethub#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotfleethub#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleethub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -449,7 +312,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -462,38 +325,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotfleethub#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotfleethub#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleethub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -502,7 +333,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -511,38 +342,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotfleethub#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotfleethub#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleethub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -551,7 +350,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -560,38 +359,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotfleethub#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotfleethub#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleethub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateApplicationCommand */ @@ -600,7 +367,7 @@ export const de_UpdateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -610,40 +377,40 @@ export const de_UpdateApplicationCommand = async ( }; /** - * deserializeAws_restJson1UpdateApplicationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ConflictException": - case "com.amazonaws.iotfleethub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalFailureException": case "com.amazonaws.iotfleethub#InternalFailureException": throw await de_InternalFailureExceptionRes(parsedOutput, context); case "InvalidRequestException": case "com.amazonaws.iotfleethub#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleethub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.iotfleethub#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.iotfleethub#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.iotfleethub#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.iotfleethub#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts b/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts index 46d12ae0c053..15de253894bf 100644 --- a/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts +++ b/clients/client-iotfleetwise/src/protocols/Aws_json1_0.ts @@ -958,7 +958,7 @@ export const de_AssociateVehicleFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateVehicleFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -970,47 +970,6 @@ export const de_AssociateVehicleFleetCommand = async ( return response; }; -/** - * deserializeAws_json1_0AssociateVehicleFleetCommandError - */ -const de_AssociateVehicleFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotfleetwise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0BatchCreateVehicleCommand */ @@ -1019,7 +978,7 @@ export const de_BatchCreateVehicleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchCreateVehicleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1031,44 +990,6 @@ export const de_BatchCreateVehicleCommand = async ( return response; }; -/** - * deserializeAws_json1_0BatchCreateVehicleCommandError - */ -const de_BatchCreateVehicleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotfleetwise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0BatchUpdateVehicleCommand */ @@ -1077,7 +998,7 @@ export const de_BatchUpdateVehicleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchUpdateVehicleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1089,41 +1010,6 @@ export const de_BatchUpdateVehicleCommand = async ( return response; }; -/** - * deserializeAws_json1_0BatchUpdateVehicleCommandError - */ -const de_BatchUpdateVehicleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateCampaignCommand */ @@ -1132,7 +1018,7 @@ export const de_CreateCampaignCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCampaignCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1144,50 +1030,6 @@ export const de_CreateCampaignCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateCampaignCommandError - */ -const de_CreateCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotfleetwise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateDecoderManifestCommand */ @@ -1196,7 +1038,7 @@ export const de_CreateDecoderManifestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDecoderManifestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1208,53 +1050,6 @@ export const de_CreateDecoderManifestCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateDecoderManifestCommandError - */ -const de_CreateDecoderManifestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DecoderManifestValidationException": - case "com.amazonaws.iotfleetwise#DecoderManifestValidationException": - throw await de_DecoderManifestValidationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotfleetwise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateFleetCommand */ @@ -1263,7 +1058,7 @@ export const de_CreateFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1276,63 +1071,39 @@ export const de_CreateFleetCommand = async ( }; /** - * deserializeAws_json1_0CreateFleetCommandError + * deserializeAws_json1_0CreateModelManifestCommand */ -const de_CreateFleetCommandError = async ( +export const de_CreateModelManifestCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotfleetwise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateModelManifestCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0CreateModelManifestCommand + * deserializeAws_json1_0CreateSignalCatalogCommand */ -export const de_CreateModelManifestCommand = async ( +export const de_CreateSignalCatalogCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateModelManifestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateModelManifestCommandOutput = { + const response: CreateSignalCatalogCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1340,66 +1111,39 @@ export const de_CreateModelManifestCommand = async ( }; /** - * deserializeAws_json1_0CreateModelManifestCommandError + * deserializeAws_json1_0CreateVehicleCommand */ -const de_CreateModelManifestCommandError = async ( +export const de_CreateVehicleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidSignalsException": - case "com.amazonaws.iotfleetwise#InvalidSignalsException": - throw await de_InvalidSignalsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotfleetwise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateVehicleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0CreateSignalCatalogCommand + * deserializeAws_json1_0DeleteCampaignCommand */ -export const de_CreateSignalCatalogCommand = async ( +export const de_DeleteCampaignCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateSignalCatalogCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateSignalCatalogCommandOutput = { + const response: DeleteCampaignCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1407,66 +1151,39 @@ export const de_CreateSignalCatalogCommand = async ( }; /** - * deserializeAws_json1_0CreateSignalCatalogCommandError + * deserializeAws_json1_0DeleteDecoderManifestCommand */ -const de_CreateSignalCatalogCommandError = async ( +export const de_DeleteDecoderManifestCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidNodeException": - case "com.amazonaws.iotfleetwise#InvalidNodeException": - throw await de_InvalidNodeExceptionRes(parsedOutput, context); - case "InvalidSignalsException": - case "com.amazonaws.iotfleetwise#InvalidSignalsException": - throw await de_InvalidSignalsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotfleetwise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteDecoderManifestCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0CreateVehicleCommand + * deserializeAws_json1_0DeleteFleetCommand */ -export const de_CreateVehicleCommand = async ( +export const de_DeleteFleetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateVehicleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateVehicleCommandOutput = { + const response: DeleteFleetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1474,63 +1191,39 @@ export const de_CreateVehicleCommand = async ( }; /** - * deserializeAws_json1_0CreateVehicleCommandError + * deserializeAws_json1_0DeleteModelManifestCommand */ -const de_CreateVehicleCommandError = async ( +export const de_DeleteModelManifestCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotfleetwise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteModelManifestCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DeleteCampaignCommand + * deserializeAws_json1_0DeleteSignalCatalogCommand */ -export const de_DeleteCampaignCommand = async ( +export const de_DeleteSignalCatalogCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteCampaignCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteCampaignCommandOutput = { + const response: DeleteSignalCatalogCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1538,57 +1231,39 @@ export const de_DeleteCampaignCommand = async ( }; /** - * deserializeAws_json1_0DeleteCampaignCommandError + * deserializeAws_json1_0DeleteVehicleCommand */ -const de_DeleteCampaignCommandError = async ( +export const de_DeleteVehicleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteVehicleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DeleteDecoderManifestCommand + * deserializeAws_json1_0DisassociateVehicleFleetCommand */ -export const de_DeleteDecoderManifestCommand = async ( +export const de_DisassociateVehicleFleetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDecoderManifestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteDecoderManifestCommandOutput = { + const response: DisassociateVehicleFleetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1596,57 +1271,39 @@ export const de_DeleteDecoderManifestCommand = async ( }; /** - * deserializeAws_json1_0DeleteDecoderManifestCommandError + * deserializeAws_json1_0GetCampaignCommand */ -const de_DeleteDecoderManifestCommandError = async ( +export const de_GetCampaignCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetCampaignResponse(data, context); + const response: GetCampaignCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DeleteFleetCommand + * deserializeAws_json1_0GetDecoderManifestCommand */ -export const de_DeleteFleetCommand = async ( +export const de_GetDecoderManifestCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteFleetCommandOutput = { + contents = de_GetDecoderManifestResponse(data, context); + const response: GetDecoderManifestCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1654,54 +1311,39 @@ export const de_DeleteFleetCommand = async ( }; /** - * deserializeAws_json1_0DeleteFleetCommandError + * deserializeAws_json1_0GetEncryptionConfigurationCommand */ -const de_DeleteFleetCommandError = async ( +export const de_GetEncryptionConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetEncryptionConfigurationResponse(data, context); + const response: GetEncryptionConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DeleteModelManifestCommand + * deserializeAws_json1_0GetFleetCommand */ -export const de_DeleteModelManifestCommand = async ( +export const de_GetFleetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteModelManifestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteModelManifestCommandOutput = { + contents = de_GetFleetResponse(data, context); + const response: GetFleetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1709,57 +1351,39 @@ export const de_DeleteModelManifestCommand = async ( }; /** - * deserializeAws_json1_0DeleteModelManifestCommandError + * deserializeAws_json1_0GetLoggingOptionsCommand */ -const de_DeleteModelManifestCommandError = async ( +export const de_GetLoggingOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetLoggingOptionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DeleteSignalCatalogCommand + * deserializeAws_json1_0GetModelManifestCommand */ -export const de_DeleteSignalCatalogCommand = async ( +export const de_GetModelManifestCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSignalCatalogCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteSignalCatalogCommandOutput = { + contents = de_GetModelManifestResponse(data, context); + const response: GetModelManifestCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1767,57 +1391,39 @@ export const de_DeleteSignalCatalogCommand = async ( }; /** - * deserializeAws_json1_0DeleteSignalCatalogCommandError + * deserializeAws_json1_0GetRegisterAccountStatusCommand */ -const de_DeleteSignalCatalogCommandError = async ( +export const de_GetRegisterAccountStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetRegisterAccountStatusResponse(data, context); + const response: GetRegisterAccountStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DeleteVehicleCommand + * deserializeAws_json1_0GetSignalCatalogCommand */ -export const de_DeleteVehicleCommand = async ( +export const de_GetSignalCatalogCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteVehicleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteVehicleCommandOutput = { + contents = de_GetSignalCatalogResponse(data, context); + const response: GetSignalCatalogCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1825,54 +1431,39 @@ export const de_DeleteVehicleCommand = async ( }; /** - * deserializeAws_json1_0DeleteVehicleCommandError + * deserializeAws_json1_0GetVehicleCommand */ -const de_DeleteVehicleCommandError = async ( +export const de_GetVehicleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetVehicleResponse(data, context); + const response: GetVehicleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DisassociateVehicleFleetCommand + * deserializeAws_json1_0GetVehicleStatusCommand */ -export const de_DisassociateVehicleFleetCommand = async ( +export const de_GetVehicleStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateVehicleFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateVehicleFleetCommandOutput = { + const response: GetVehicleStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1880,57 +1471,39 @@ export const de_DisassociateVehicleFleetCommand = async ( }; /** - * deserializeAws_json1_0DisassociateVehicleFleetCommandError + * deserializeAws_json1_0ImportDecoderManifestCommand */ -const de_DisassociateVehicleFleetCommandError = async ( +export const de_ImportDecoderManifestCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ImportDecoderManifestCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0GetCampaignCommand + * deserializeAws_json1_0ImportSignalCatalogCommand */ -export const de_GetCampaignCommand = async ( +export const de_ImportSignalCatalogCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetCampaignCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetCampaignResponse(data, context); - const response: GetCampaignCommandOutput = { + contents = _json(data); + const response: ImportSignalCatalogCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1938,1165 +1511,39 @@ export const de_GetCampaignCommand = async ( }; /** - * deserializeAws_json1_0GetCampaignCommandError + * deserializeAws_json1_0ListCampaignsCommand */ -const de_GetCampaignCommandError = async ( +export const de_ListCampaignsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetDecoderManifestCommand - */ -export const de_GetDecoderManifestCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDecoderManifestCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDecoderManifestResponse(data, context); - const response: GetDecoderManifestCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetDecoderManifestCommandError - */ -const de_GetDecoderManifestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetEncryptionConfigurationCommand - */ -export const de_GetEncryptionConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetEncryptionConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetEncryptionConfigurationResponse(data, context); - const response: GetEncryptionConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetEncryptionConfigurationCommandError - */ -const de_GetEncryptionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetFleetCommand - */ -export const de_GetFleetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetFleetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetFleetResponse(data, context); - const response: GetFleetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetFleetCommandError - */ -const de_GetFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetLoggingOptionsCommand - */ -export const de_GetLoggingOptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLoggingOptionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetLoggingOptionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetLoggingOptionsCommandError - */ -const de_GetLoggingOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetModelManifestCommand - */ -export const de_GetModelManifestCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetModelManifestCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetModelManifestResponse(data, context); - const response: GetModelManifestCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetModelManifestCommandError - */ -const de_GetModelManifestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetRegisterAccountStatusCommand - */ -export const de_GetRegisterAccountStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRegisterAccountStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetRegisterAccountStatusResponse(data, context); - const response: GetRegisterAccountStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetRegisterAccountStatusCommandError - */ -const de_GetRegisterAccountStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetSignalCatalogCommand - */ -export const de_GetSignalCatalogCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSignalCatalogCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetSignalCatalogResponse(data, context); - const response: GetSignalCatalogCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetSignalCatalogCommandError - */ -const de_GetSignalCatalogCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetVehicleCommand - */ -export const de_GetVehicleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetVehicleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetVehicleResponse(data, context); - const response: GetVehicleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetVehicleCommandError - */ -const de_GetVehicleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetVehicleStatusCommand - */ -export const de_GetVehicleStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetVehicleStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetVehicleStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetVehicleStatusCommandError - */ -const de_GetVehicleStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ImportDecoderManifestCommand - */ -export const de_ImportDecoderManifestCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ImportDecoderManifestCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ImportDecoderManifestCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ImportDecoderManifestCommandError - */ -const de_ImportDecoderManifestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DecoderManifestValidationException": - case "com.amazonaws.iotfleetwise#DecoderManifestValidationException": - throw await de_DecoderManifestValidationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidSignalsException": - case "com.amazonaws.iotfleetwise#InvalidSignalsException": - throw await de_InvalidSignalsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ImportSignalCatalogCommand - */ -export const de_ImportSignalCatalogCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ImportSignalCatalogCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ImportSignalCatalogCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ImportSignalCatalogCommandError - */ -const de_ImportSignalCatalogCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidSignalsException": - case "com.amazonaws.iotfleetwise#InvalidSignalsException": - throw await de_InvalidSignalsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotfleetwise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListCampaignsCommand - */ -export const de_ListCampaignsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListCampaignsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListCampaignsResponse(data, context); - const response: ListCampaignsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListCampaignsCommandError - */ -const de_ListCampaignsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListDecoderManifestNetworkInterfacesCommand - */ -export const de_ListDecoderManifestNetworkInterfacesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDecoderManifestNetworkInterfacesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListDecoderManifestNetworkInterfacesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListDecoderManifestNetworkInterfacesCommandError - */ -const de_ListDecoderManifestNetworkInterfacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListDecoderManifestsCommand - */ -export const de_ListDecoderManifestsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDecoderManifestsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDecoderManifestsResponse(data, context); - const response: ListDecoderManifestsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListDecoderManifestsCommandError - */ -const de_ListDecoderManifestsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListDecoderManifestSignalsCommand - */ -export const de_ListDecoderManifestSignalsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDecoderManifestSignalsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDecoderManifestSignalsResponse(data, context); - const response: ListDecoderManifestSignalsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListDecoderManifestSignalsCommandError - */ -const de_ListDecoderManifestSignalsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListFleetsCommand - */ -export const de_ListFleetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListFleetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListFleetsResponse(data, context); - const response: ListFleetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListFleetsCommandError - */ -const de_ListFleetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListFleetsForVehicleCommand - */ -export const de_ListFleetsForVehicleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListFleetsForVehicleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListFleetsForVehicleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListFleetsForVehicleCommandError - */ -const de_ListFleetsForVehicleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListModelManifestNodesCommand - */ -export const de_ListModelManifestNodesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListModelManifestNodesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListModelManifestNodesResponse(data, context); - const response: ListModelManifestNodesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListModelManifestNodesCommandError - */ -const de_ListModelManifestNodesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotfleetwise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListModelManifestsCommand - */ -export const de_ListModelManifestsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListModelManifestsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListModelManifestsResponse(data, context); - const response: ListModelManifestsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListCampaignsResponse(data, context); + const response: ListCampaignsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_0ListModelManifestsCommandError - */ -const de_ListModelManifestsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListSignalCatalogNodesCommand + * deserializeAws_json1_0ListDecoderManifestNetworkInterfacesCommand */ -export const de_ListSignalCatalogNodesCommand = async ( +export const de_ListDecoderManifestNetworkInterfacesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSignalCatalogNodesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListSignalCatalogNodesResponse(data, context); - const response: ListSignalCatalogNodesCommandOutput = { + contents = _json(data); + const response: ListDecoderManifestNetworkInterfacesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3104,60 +1551,19 @@ export const de_ListSignalCatalogNodesCommand = async ( }; /** - * deserializeAws_json1_0ListSignalCatalogNodesCommandError - */ -const de_ListSignalCatalogNodesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotfleetwise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListSignalCatalogsCommand + * deserializeAws_json1_0ListDecoderManifestsCommand */ -export const de_ListSignalCatalogsCommand = async ( +export const de_ListDecoderManifestsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSignalCatalogsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListSignalCatalogsResponse(data, context); - const response: ListSignalCatalogsCommandOutput = { + contents = de_ListDecoderManifestsResponse(data, context); + const response: ListDecoderManifestsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3165,54 +1571,19 @@ export const de_ListSignalCatalogsCommand = async ( }; /** - * deserializeAws_json1_0ListSignalCatalogsCommandError - */ -const de_ListSignalCatalogsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListTagsForResourceCommand + * deserializeAws_json1_0ListDecoderManifestSignalsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListDecoderManifestSignalsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_ListDecoderManifestSignalsResponse(data, context); + const response: ListDecoderManifestSignalsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3220,57 +1591,19 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_0ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListVehiclesCommand + * deserializeAws_json1_0ListFleetsCommand */ -export const de_ListVehiclesCommand = async ( +export const de_ListFleetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListVehiclesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListVehiclesResponse(data, context); - const response: ListVehiclesCommandOutput = { + contents = de_ListFleetsResponse(data, context); + const response: ListFleetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3278,112 +1611,39 @@ export const de_ListVehiclesCommand = async ( }; /** - * deserializeAws_json1_0ListVehiclesCommandError - */ -const de_ListVehiclesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListVehiclesInFleetCommand + * deserializeAws_json1_0ListFleetsForVehicleCommand */ -export const de_ListVehiclesInFleetCommand = async ( +export const de_ListFleetsForVehicleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListVehiclesInFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListVehiclesInFleetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListVehiclesInFleetCommandError - */ -const de_ListVehiclesInFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const response: ListFleetsForVehicleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0PutEncryptionConfigurationCommand + * deserializeAws_json1_0ListModelManifestNodesCommand */ -export const de_PutEncryptionConfigurationCommand = async ( +export const de_ListModelManifestNodesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutEncryptionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: PutEncryptionConfigurationCommandOutput = { + contents = de_ListModelManifestNodesResponse(data, context); + const response: ListModelManifestNodesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3391,60 +1651,39 @@ export const de_PutEncryptionConfigurationCommand = async ( }; /** - * deserializeAws_json1_0PutEncryptionConfigurationCommandError + * deserializeAws_json1_0ListModelManifestsCommand */ -const de_PutEncryptionConfigurationCommandError = async ( +export const de_ListModelManifestsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListModelManifestsResponse(data, context); + const response: ListModelManifestsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0PutLoggingOptionsCommand + * deserializeAws_json1_0ListSignalCatalogNodesCommand */ -export const de_PutLoggingOptionsCommand = async ( +export const de_ListSignalCatalogNodesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutLoggingOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: PutLoggingOptionsCommandOutput = { + contents = de_ListSignalCatalogNodesResponse(data, context); + const response: ListSignalCatalogNodesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3452,60 +1691,39 @@ export const de_PutLoggingOptionsCommand = async ( }; /** - * deserializeAws_json1_0PutLoggingOptionsCommandError + * deserializeAws_json1_0ListSignalCatalogsCommand */ -const de_PutLoggingOptionsCommandError = async ( +export const de_ListSignalCatalogsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListSignalCatalogsResponse(data, context); + const response: ListSignalCatalogsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0RegisterAccountCommand + * deserializeAws_json1_0ListTagsForResourceCommand */ -export const de_RegisterAccountCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RegisterAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RegisterAccountResponse(data, context); - const response: RegisterAccountCommandOutput = { + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3513,60 +1731,39 @@ export const de_RegisterAccountCommand = async ( }; /** - * deserializeAws_json1_0RegisterAccountCommandError + * deserializeAws_json1_0ListVehiclesCommand */ -const de_RegisterAccountCommandError = async ( +export const de_ListVehiclesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListVehiclesResponse(data, context); + const response: ListVehiclesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0TagResourceCommand + * deserializeAws_json1_0ListVehiclesInFleetCommand */ -export const de_TagResourceCommand = async ( +export const de_ListVehiclesInFleetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: ListVehiclesInFleetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3574,57 +1771,39 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_0TagResourceCommandError + * deserializeAws_json1_0PutEncryptionConfigurationCommand */ -const de_TagResourceCommandError = async ( +export const de_PutEncryptionConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutEncryptionConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0UntagResourceCommand + * deserializeAws_json1_0PutLoggingOptionsCommand */ -export const de_UntagResourceCommand = async ( +export const de_PutLoggingOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UntagResourceCommandOutput = { + const response: PutLoggingOptionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3632,57 +1811,39 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_0UntagResourceCommandError + * deserializeAws_json1_0RegisterAccountCommand */ -const de_UntagResourceCommandError = async ( +export const de_RegisterAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RegisterAccountResponse(data, context); + const response: RegisterAccountCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0UpdateCampaignCommand + * deserializeAws_json1_0TagResourceCommand */ -export const de_UpdateCampaignCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateCampaignCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateCampaignCommandOutput = { + const response: TagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3690,60 +1851,39 @@ export const de_UpdateCampaignCommand = async ( }; /** - * deserializeAws_json1_0UpdateCampaignCommandError + * deserializeAws_json1_0UntagResourceCommand */ -const de_UpdateCampaignCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0UpdateDecoderManifestCommand + * deserializeAws_json1_0UpdateCampaignCommand */ -export const de_UpdateDecoderManifestCommand = async ( +export const de_UpdateCampaignCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateDecoderManifestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateDecoderManifestCommandOutput = { + const response: UpdateCampaignCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3751,50 +1891,23 @@ export const de_UpdateDecoderManifestCommand = async ( }; /** - * deserializeAws_json1_0UpdateDecoderManifestCommandError + * deserializeAws_json1_0UpdateDecoderManifestCommand */ -const de_UpdateDecoderManifestCommandError = async ( +export const de_UpdateDecoderManifestCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DecoderManifestValidationException": - case "com.amazonaws.iotfleetwise#DecoderManifestValidationException": - throw await de_DecoderManifestValidationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotfleetwise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateDecoderManifestCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3805,7 +1918,7 @@ export const de_UpdateFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3817,47 +1930,6 @@ export const de_UpdateFleetCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateFleetCommandError - */ -const de_UpdateFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateModelManifestCommand */ @@ -3866,7 +1938,7 @@ export const de_UpdateModelManifestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateModelManifestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3878,50 +1950,6 @@ export const de_UpdateModelManifestCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateModelManifestCommandError - */ -const de_UpdateModelManifestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidSignalsException": - case "com.amazonaws.iotfleetwise#InvalidSignalsException": - throw await de_InvalidSignalsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateSignalCatalogCommand */ @@ -3930,7 +1958,7 @@ export const de_UpdateSignalCatalogCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSignalCatalogCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3942,56 +1970,6 @@ export const de_UpdateSignalCatalogCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateSignalCatalogCommandError - */ -const de_UpdateSignalCatalogCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotfleetwise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iotfleetwise#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidNodeException": - case "com.amazonaws.iotfleetwise#InvalidNodeException": - throw await de_InvalidNodeExceptionRes(parsedOutput, context); - case "InvalidSignalsException": - case "com.amazonaws.iotfleetwise#InvalidSignalsException": - throw await de_InvalidSignalsExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotfleetwise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotfleetwise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotfleetwise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotfleetwise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateVehicleCommand */ @@ -4000,7 +1978,7 @@ export const de_UpdateVehicleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateVehicleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4013,12 +1991,9 @@ export const de_UpdateVehicleCommand = async ( }; /** - * deserializeAws_json1_0UpdateVehicleCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateVehicleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4028,12 +2003,12 @@ const de_UpdateVehicleCommandError = async ( case "AccessDeniedException": case "com.amazonaws.iotfleetwise#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iotfleetwise#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.iotfleetwise#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.iotfleetwise#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.iotfleetwise#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); @@ -4043,13 +2018,25 @@ const de_UpdateVehicleCommandError = async ( case "ValidationException": case "com.amazonaws.iotfleetwise#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.iotfleetwise#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "DecoderManifestValidationException": + case "com.amazonaws.iotfleetwise#DecoderManifestValidationException": + throw await de_DecoderManifestValidationExceptionRes(parsedOutput, context); + case "InvalidSignalsException": + case "com.amazonaws.iotfleetwise#InvalidSignalsException": + throw await de_InvalidSignalsExceptionRes(parsedOutput, context); + case "InvalidNodeException": + case "com.amazonaws.iotfleetwise#InvalidNodeException": + throw await de_InvalidNodeExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts b/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts index 70579ad2cca8..93bc98181502 100644 --- a/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts +++ b/clients/client-iotsecuretunneling/src/protocols/Aws_json1_1.ts @@ -166,7 +166,7 @@ export const de_CloseTunnelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CloseTunnelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -178,32 +178,6 @@ export const de_CloseTunnelCommand = async ( return response; }; -/** - * deserializeAws_json1_1CloseTunnelCommandError - */ -const de_CloseTunnelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.iotsecuretunneling#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTunnelCommand */ @@ -212,7 +186,7 @@ export const de_DescribeTunnelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTunnelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -224,32 +198,6 @@ export const de_DescribeTunnelCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTunnelCommandError - */ -const de_DescribeTunnelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.iotsecuretunneling#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -258,7 +206,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -270,32 +218,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.iotsecuretunneling#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTunnelsCommand */ @@ -304,7 +226,7 @@ export const de_ListTunnelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTunnelsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -316,26 +238,6 @@ export const de_ListTunnelsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTunnelsCommandError - */ -const de_ListTunnelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1OpenTunnelCommand */ @@ -344,7 +246,7 @@ export const de_OpenTunnelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_OpenTunnelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -356,32 +258,6 @@ export const de_OpenTunnelCommand = async ( return response; }; -/** - * deserializeAws_json1_1OpenTunnelCommandError - */ -const de_OpenTunnelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.iotsecuretunneling#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RotateTunnelAccessTokenCommand */ @@ -390,7 +266,7 @@ export const de_RotateTunnelAccessTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RotateTunnelAccessTokenCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -402,32 +278,6 @@ export const de_RotateTunnelAccessTokenCommand = async ( return response; }; -/** - * deserializeAws_json1_1RotateTunnelAccessTokenCommandError - */ -const de_RotateTunnelAccessTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.iotsecuretunneling#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -436,7 +286,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -448,32 +298,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.iotsecuretunneling#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -482,7 +306,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -495,12 +319,9 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -510,13 +331,16 @@ const de_UntagResourceCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.iotsecuretunneling#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.iotsecuretunneling#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts b/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts index ef264e19e8a3..cfedcec9fba5 100644 --- a/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts +++ b/clients/client-iotsitewise/src/protocols/Aws_restJson1.ts @@ -2877,7 +2877,7 @@ export const de_AssociateAssetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateAssetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2886,50 +2886,6 @@ export const de_AssociateAssetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateAssetsCommandError - */ -const de_AssociateAssetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotsitewise#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateTimeSeriesToAssetPropertyCommand */ @@ -2938,7 +2894,7 @@ export const de_AssociateTimeSeriesToAssetPropertyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateTimeSeriesToAssetPropertyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2947,44 +2903,6 @@ export const de_AssociateTimeSeriesToAssetPropertyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateTimeSeriesToAssetPropertyCommandError - */ -const de_AssociateTimeSeriesToAssetPropertyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchAssociateProjectAssetsCommand */ @@ -2993,7 +2911,7 @@ export const de_BatchAssociateProjectAssetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchAssociateProjectAssetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3006,44 +2924,6 @@ export const de_BatchAssociateProjectAssetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchAssociateProjectAssetsCommandError - */ -const de_BatchAssociateProjectAssetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDisassociateProjectAssetsCommand */ @@ -3052,7 +2932,7 @@ export const de_BatchDisassociateProjectAssetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDisassociateProjectAssetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3065,41 +2945,6 @@ export const de_BatchDisassociateProjectAssetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDisassociateProjectAssetsCommandError - */ -const de_BatchDisassociateProjectAssetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetAssetPropertyAggregatesCommand */ @@ -3108,7 +2953,7 @@ export const de_BatchGetAssetPropertyAggregatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetAssetPropertyAggregatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3124,41 +2969,6 @@ export const de_BatchGetAssetPropertyAggregatesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetAssetPropertyAggregatesCommandError - */ -const de_BatchGetAssetPropertyAggregatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotsitewise#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetAssetPropertyValueCommand */ @@ -3167,7 +2977,7 @@ export const de_BatchGetAssetPropertyValueCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetAssetPropertyValueCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3183,41 +2993,6 @@ export const de_BatchGetAssetPropertyValueCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetAssetPropertyValueCommandError - */ -const de_BatchGetAssetPropertyValueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotsitewise#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetAssetPropertyValueHistoryCommand */ @@ -3226,7 +3001,7 @@ export const de_BatchGetAssetPropertyValueHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetAssetPropertyValueHistoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3242,41 +3017,6 @@ export const de_BatchGetAssetPropertyValueHistoryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetAssetPropertyValueHistoryCommandError - */ -const de_BatchGetAssetPropertyValueHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotsitewise#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchPutAssetPropertyValueCommand */ @@ -3285,7 +3025,7 @@ export const de_BatchPutAssetPropertyValueCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchPutAssetPropertyValueCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3299,58 +3039,14 @@ export const de_BatchPutAssetPropertyValueCommand = async ( }; /** - * deserializeAws_restJson1BatchPutAssetPropertyValueCommandError + * deserializeAws_restJson1CreateAccessPolicyCommand */ -const de_BatchPutAssetPropertyValueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotsitewise#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateAccessPolicyCommand - */ -export const de_CreateAccessPolicyCommand = async ( +export const de_CreateAccessPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAccessPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3364,44 +3060,6 @@ export const de_CreateAccessPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAccessPolicyCommandError - */ -const de_CreateAccessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAssetCommand */ @@ -3410,7 +3068,7 @@ export const de_CreateAssetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateAssetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3425,50 +3083,6 @@ export const de_CreateAssetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAssetCommandError - */ -const de_CreateAssetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotsitewise#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAssetModelCommand */ @@ -3477,7 +3091,7 @@ export const de_CreateAssetModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateAssetModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3492,50 +3106,6 @@ export const de_CreateAssetModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAssetModelCommandError - */ -const de_CreateAssetModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotsitewise#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAssetModelCompositeModelCommand */ @@ -3544,7 +3114,7 @@ export const de_CreateAssetModelCompositeModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateAssetModelCompositeModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3559,50 +3129,6 @@ export const de_CreateAssetModelCompositeModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAssetModelCompositeModelCommandError - */ -const de_CreateAssetModelCompositeModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotsitewise#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBulkImportJobCommand */ @@ -3611,7 +3137,7 @@ export const de_CreateBulkImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateBulkImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3627,178 +3153,58 @@ export const de_CreateBulkImportJobCommand = async ( }; /** - * deserializeAws_restJson1CreateBulkImportJobCommandError + * deserializeAws_restJson1CreateDashboardCommand */ -const de_CreateBulkImportJobCommandError = async ( +export const de_CreateDashboardCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotsitewise#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + dashboardArn: __expectString, + dashboardId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateDashboardCommand + * deserializeAws_restJson1CreateGatewayCommand */ -export const de_CreateDashboardCommand = async ( +export const de_CreateGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDashboardCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - dashboardArn: __expectString, - dashboardId: __expectString, + gatewayArn: __expectString, + gatewayId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateDashboardCommandError + * deserializeAws_restJson1CreatePortalCommand */ -const de_CreateDashboardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateGatewayCommand - */ -export const de_CreateGatewayCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateGatewayCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - gatewayArn: __expectString, - gatewayId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateGatewayCommandError - */ -const de_CreateGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotsitewise#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreatePortalCommand - */ -export const de_CreatePortalCommand = async ( +export const de_CreatePortalCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreatePortalCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3815,44 +3221,6 @@ export const de_CreatePortalCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePortalCommandError - */ -const de_CreatePortalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProjectCommand */ @@ -3861,7 +3229,7 @@ export const de_CreateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3875,44 +3243,6 @@ export const de_CreateProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProjectCommandError - */ -const de_CreateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAccessPolicyCommand */ @@ -3921,7 +3251,7 @@ export const de_DeleteAccessPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAccessPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3930,41 +3260,6 @@ export const de_DeleteAccessPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAccessPolicyCommandError - */ -const de_DeleteAccessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAssetCommand */ @@ -3973,7 +3268,7 @@ export const de_DeleteAssetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteAssetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3986,44 +3281,6 @@ export const de_DeleteAssetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAssetCommandError - */ -const de_DeleteAssetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAssetModelCommand */ @@ -4032,7 +3289,7 @@ export const de_DeleteAssetModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteAssetModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4045,44 +3302,6 @@ export const de_DeleteAssetModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAssetModelCommandError - */ -const de_DeleteAssetModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAssetModelCompositeModelCommand */ @@ -4091,7 +3310,7 @@ export const de_DeleteAssetModelCompositeModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteAssetModelCompositeModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4105,52 +3324,14 @@ export const de_DeleteAssetModelCompositeModelCommand = async ( }; /** - * deserializeAws_restJson1DeleteAssetModelCompositeModelCommandError - */ -const de_DeleteAssetModelCompositeModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDashboardCommand + * deserializeAws_restJson1DeleteDashboardCommand */ export const de_DeleteDashboardCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDashboardCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4159,41 +3340,6 @@ export const de_DeleteDashboardCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDashboardCommandError - */ -const de_DeleteDashboardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteGatewayCommand */ @@ -4202,7 +3348,7 @@ export const de_DeleteGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGatewayCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4211,41 +3357,6 @@ export const de_DeleteGatewayCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteGatewayCommandError - */ -const de_DeleteGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePortalCommand */ @@ -4254,7 +3365,7 @@ export const de_DeletePortalCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeletePortalCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4267,44 +3378,6 @@ export const de_DeletePortalCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePortalCommandError - */ -const de_DeletePortalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteProjectCommand */ @@ -4313,7 +3386,7 @@ export const de_DeleteProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4322,41 +3395,6 @@ export const de_DeleteProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteProjectCommandError - */ -const de_DeleteProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteTimeSeriesCommand */ @@ -4365,7 +3403,7 @@ export const de_DeleteTimeSeriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTimeSeriesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4374,44 +3412,6 @@ export const de_DeleteTimeSeriesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteTimeSeriesCommandError - */ -const de_DeleteTimeSeriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAccessPolicyCommand */ @@ -4420,7 +3420,7 @@ export const de_DescribeAccessPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAccessPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4439,41 +3439,6 @@ export const de_DescribeAccessPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAccessPolicyCommandError - */ -const de_DescribeAccessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeActionCommand */ @@ -4482,7 +3447,7 @@ export const de_DescribeActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4500,49 +3465,14 @@ export const de_DescribeActionCommand = async ( }; /** - * deserializeAws_restJson1DescribeActionCommandError + * deserializeAws_restJson1DescribeAssetCommand */ -const de_DescribeActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAssetCommand - */ -export const de_DescribeAssetCommand = async ( +export const de_DescribeAssetCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAssetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4567,41 +3497,6 @@ export const de_DescribeAssetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAssetCommandError - */ -const de_DescribeAssetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAssetCompositeModelCommand */ @@ -4610,7 +3505,7 @@ export const de_DescribeAssetCompositeModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAssetCompositeModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4632,41 +3527,6 @@ export const de_DescribeAssetCompositeModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAssetCompositeModelCommandError - */ -const de_DescribeAssetCompositeModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAssetModelCommand */ @@ -4675,7 +3535,7 @@ export const de_DescribeAssetModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAssetModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4700,41 +3560,6 @@ export const de_DescribeAssetModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAssetModelCommandError - */ -const de_DescribeAssetModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAssetModelCompositeModelCommand */ @@ -4743,7 +3568,7 @@ export const de_DescribeAssetModelCompositeModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAssetModelCompositeModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4766,41 +3591,6 @@ export const de_DescribeAssetModelCompositeModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAssetModelCompositeModelCommandError - */ -const de_DescribeAssetModelCompositeModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAssetPropertyCommand */ @@ -4809,7 +3599,7 @@ export const de_DescribeAssetPropertyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAssetPropertyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4827,41 +3617,6 @@ export const de_DescribeAssetPropertyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAssetPropertyCommandError - */ -const de_DescribeAssetPropertyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeBulkImportJobCommand */ @@ -4870,7 +3625,7 @@ export const de_DescribeBulkImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBulkImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4893,41 +3648,6 @@ export const de_DescribeBulkImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeBulkImportJobCommandError - */ -const de_DescribeBulkImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDashboardCommand */ @@ -4936,7 +3656,7 @@ export const de_DescribeDashboardCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDashboardCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4956,41 +3676,6 @@ export const de_DescribeDashboardCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDashboardCommandError - */ -const de_DescribeDashboardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDefaultEncryptionConfigurationCommand */ @@ -4999,7 +3684,7 @@ export const de_DescribeDefaultEncryptionConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDefaultEncryptionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5015,46 +3700,14 @@ export const de_DescribeDefaultEncryptionConfigurationCommand = async ( }; /** - * deserializeAws_restJson1DescribeDefaultEncryptionConfigurationCommandError + * deserializeAws_restJson1DescribeGatewayCommand */ -const de_DescribeDefaultEncryptionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeGatewayCommand - */ -export const de_DescribeGatewayCommand = async ( +export const de_DescribeGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeGatewayCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5073,41 +3726,6 @@ export const de_DescribeGatewayCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeGatewayCommandError - */ -const de_DescribeGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeGatewayCapabilityConfigurationCommand */ @@ -5116,7 +3734,7 @@ export const de_DescribeGatewayCapabilityConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeGatewayCapabilityConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5132,41 +3750,6 @@ export const de_DescribeGatewayCapabilityConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeGatewayCapabilityConfigurationCommandError - */ -const de_DescribeGatewayCapabilityConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeLoggingOptionsCommand */ @@ -5175,7 +3758,7 @@ export const de_DescribeLoggingOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeLoggingOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5188,41 +3771,6 @@ export const de_DescribeLoggingOptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeLoggingOptionsCommandError - */ -const de_DescribeLoggingOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribePortalCommand */ @@ -5231,7 +3779,7 @@ export const de_DescribePortalCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePortalCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5258,41 +3806,6 @@ export const de_DescribePortalCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribePortalCommandError - */ -const de_DescribePortalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeProjectCommand */ @@ -5301,7 +3814,7 @@ export const de_DescribeProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5320,41 +3833,6 @@ export const de_DescribeProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeProjectCommandError - */ -const de_DescribeProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeStorageConfigurationCommand */ @@ -5363,7 +3841,7 @@ export const de_DescribeStorageConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeStorageConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5383,47 +3861,6 @@ export const de_DescribeStorageConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeStorageConfigurationCommandError - */ -const de_DescribeStorageConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeTimeSeriesCommand */ @@ -5432,7 +3869,7 @@ export const de_DescribeTimeSeriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTimeSeriesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5454,49 +3891,31 @@ export const de_DescribeTimeSeriesCommand = async ( }; /** - * deserializeAws_restJson1DescribeTimeSeriesCommandError + * deserializeAws_restJson1DisassociateAssetsCommand */ -const de_DescribeTimeSeriesCommandError = async ( +export const de_DisassociateAssetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DisassociateAssetsCommand + * deserializeAws_restJson1DisassociateTimeSeriesFromAssetPropertyCommand */ -export const de_DisassociateAssetsCommand = async ( +export const de_DisassociateTimeSeriesFromAssetPropertyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateAssetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5506,107 +3925,14 @@ export const de_DisassociateAssetsCommand = async ( }; /** - * deserializeAws_restJson1DisassociateAssetsCommandError + * deserializeAws_restJson1ExecuteActionCommand */ -const de_DisassociateAssetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateTimeSeriesFromAssetPropertyCommand - */ -export const de_DisassociateTimeSeriesFromAssetPropertyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateTimeSeriesFromAssetPropertyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateTimeSeriesFromAssetPropertyCommandError - */ -const de_DisassociateTimeSeriesFromAssetPropertyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ExecuteActionCommand - */ -export const de_ExecuteActionCommand = async ( +export const de_ExecuteActionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_ExecuteActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5619,47 +3945,6 @@ export const de_ExecuteActionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExecuteActionCommandError - */ -const de_ExecuteActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExecuteQueryCommand */ @@ -5668,7 +3953,7 @@ export const de_ExecuteQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExecuteQueryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5683,50 +3968,6 @@ export const de_ExecuteQueryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExecuteQueryCommandError - */ -const de_ExecuteQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iotsitewise#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "QueryTimeoutException": - case "com.amazonaws.iotsitewise#QueryTimeoutException": - throw await de_QueryTimeoutExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotsitewise#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iotsitewise#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAssetPropertyAggregatesCommand */ @@ -5735,7 +3976,7 @@ export const de_GetAssetPropertyAggregatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssetPropertyAggregatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5749,44 +3990,6 @@ export const de_GetAssetPropertyAggregatesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAssetPropertyAggregatesCommandError - */ -const de_GetAssetPropertyAggregatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotsitewise#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAssetPropertyValueCommand */ @@ -5795,7 +3998,7 @@ export const de_GetAssetPropertyValueCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssetPropertyValueCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5809,59 +4012,43 @@ export const de_GetAssetPropertyValueCommand = async ( }; /** - * deserializeAws_restJson1GetAssetPropertyValueCommandError + * deserializeAws_restJson1GetAssetPropertyValueHistoryCommand */ -const de_GetAssetPropertyValueCommandError = async ( +export const de_GetAssetPropertyValueHistoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotsitewise#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + assetPropertyValueHistory: (_) => de_AssetPropertyValueHistory(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetAssetPropertyValueHistoryCommand + * deserializeAws_restJson1GetInterpolatedAssetPropertyValuesCommand */ -export const de_GetAssetPropertyValueHistoryCommand = async ( +export const de_GetInterpolatedAssetPropertyValuesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssetPropertyValueHistoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - assetPropertyValueHistory: (_) => de_AssetPropertyValueHistory(_, context), + interpolatedAssetPropertyValues: (_) => de_InterpolatedAssetPropertyValues(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -5869,112 +4056,14 @@ export const de_GetAssetPropertyValueHistoryCommand = async ( }; /** - * deserializeAws_restJson1GetAssetPropertyValueHistoryCommandError + * deserializeAws_restJson1ListAccessPoliciesCommand */ -const de_GetAssetPropertyValueHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotsitewise#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetInterpolatedAssetPropertyValuesCommand - */ -export const de_GetInterpolatedAssetPropertyValuesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInterpolatedAssetPropertyValuesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - interpolatedAssetPropertyValues: (_) => de_InterpolatedAssetPropertyValues(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetInterpolatedAssetPropertyValuesCommandError - */ -const de_GetInterpolatedAssetPropertyValuesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.iotsitewise#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAccessPoliciesCommand - */ -export const de_ListAccessPoliciesCommand = async ( +export const de_ListAccessPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccessPoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5988,38 +4077,6 @@ export const de_ListAccessPoliciesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAccessPoliciesCommandError - */ -const de_ListAccessPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListActionsCommand */ @@ -6028,7 +4085,7 @@ export const de_ListActionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListActionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6042,41 +4099,6 @@ export const de_ListActionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListActionsCommandError - */ -const de_ListActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssetModelCompositeModelsCommand */ @@ -6085,7 +4107,7 @@ export const de_ListAssetModelCompositeModelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssetModelCompositeModelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6099,41 +4121,6 @@ export const de_ListAssetModelCompositeModelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssetModelCompositeModelsCommandError - */ -const de_ListAssetModelCompositeModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssetModelPropertiesCommand */ @@ -6142,7 +4129,7 @@ export const de_ListAssetModelPropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssetModelPropertiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6156,41 +4143,6 @@ export const de_ListAssetModelPropertiesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssetModelPropertiesCommandError - */ -const de_ListAssetModelPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssetModelsCommand */ @@ -6199,7 +4151,7 @@ export const de_ListAssetModelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssetModelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6213,38 +4165,6 @@ export const de_ListAssetModelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssetModelsCommandError - */ -const de_ListAssetModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssetPropertiesCommand */ @@ -6253,7 +4173,7 @@ export const de_ListAssetPropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssetPropertiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6268,49 +4188,14 @@ export const de_ListAssetPropertiesCommand = async ( }; /** - * deserializeAws_restJson1ListAssetPropertiesCommandError + * deserializeAws_restJson1ListAssetRelationshipsCommand */ -const de_ListAssetPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAssetRelationshipsCommand - */ -export const de_ListAssetRelationshipsCommand = async ( +export const de_ListAssetRelationshipsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssetRelationshipsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6324,41 +4209,6 @@ export const de_ListAssetRelationshipsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssetRelationshipsCommandError - */ -const de_ListAssetRelationshipsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssetsCommand */ @@ -6367,7 +4217,7 @@ export const de_ListAssetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6381,41 +4231,6 @@ export const de_ListAssetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssetsCommandError - */ -const de_ListAssetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssociatedAssetsCommand */ @@ -6424,7 +4239,7 @@ export const de_ListAssociatedAssetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssociatedAssetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6438,41 +4253,6 @@ export const de_ListAssociatedAssetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssociatedAssetsCommandError - */ -const de_ListAssociatedAssetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListBulkImportJobsCommand */ @@ -6481,7 +4261,7 @@ export const de_ListBulkImportJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBulkImportJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6495,41 +4275,6 @@ export const de_ListBulkImportJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListBulkImportJobsCommandError - */ -const de_ListBulkImportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCompositionRelationshipsCommand */ @@ -6538,7 +4283,7 @@ export const de_ListCompositionRelationshipsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCompositionRelationshipsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6552,41 +4297,6 @@ export const de_ListCompositionRelationshipsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCompositionRelationshipsCommandError - */ -const de_ListCompositionRelationshipsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDashboardsCommand */ @@ -6595,7 +4305,7 @@ export const de_ListDashboardsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDashboardsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6609,38 +4319,6 @@ export const de_ListDashboardsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDashboardsCommandError - */ -const de_ListDashboardsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListGatewaysCommand */ @@ -6649,7 +4327,7 @@ export const de_ListGatewaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGatewaysCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6663,38 +4341,6 @@ export const de_ListGatewaysCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListGatewaysCommandError - */ -const de_ListGatewaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPortalsCommand */ @@ -6703,7 +4349,7 @@ export const de_ListPortalsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPortalsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6718,46 +4364,14 @@ export const de_ListPortalsCommand = async ( }; /** - * deserializeAws_restJson1ListPortalsCommandError + * deserializeAws_restJson1ListProjectAssetsCommand */ -const de_ListPortalsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListProjectAssetsCommand - */ -export const de_ListProjectAssetsCommand = async ( +export const de_ListProjectAssetsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProjectAssetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6771,38 +4385,6 @@ export const de_ListProjectAssetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListProjectAssetsCommandError - */ -const de_ListProjectAssetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProjectsCommand */ @@ -6811,7 +4393,7 @@ export const de_ListProjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProjectsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6825,38 +4407,6 @@ export const de_ListProjectsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListProjectsCommandError - */ -const de_ListProjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -6865,7 +4415,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6878,50 +4428,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iotsitewise#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTimeSeriesCommand */ @@ -6930,7 +4436,7 @@ export const de_ListTimeSeriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTimeSeriesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6944,41 +4450,6 @@ export const de_ListTimeSeriesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTimeSeriesCommandError - */ -const de_ListTimeSeriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutDefaultEncryptionConfigurationCommand */ @@ -6987,7 +4458,7 @@ export const de_PutDefaultEncryptionConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutDefaultEncryptionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7002,44 +4473,6 @@ export const de_PutDefaultEncryptionConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutDefaultEncryptionConfigurationCommandError - */ -const de_PutDefaultEncryptionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutLoggingOptionsCommand */ @@ -7048,7 +4481,7 @@ export const de_PutLoggingOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutLoggingOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7057,44 +4490,6 @@ export const de_PutLoggingOptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutLoggingOptionsCommandError - */ -const de_PutLoggingOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutStorageConfigurationCommand */ @@ -7103,7 +4498,7 @@ export const de_PutStorageConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutStorageConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7122,50 +4517,6 @@ export const de_PutStorageConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutStorageConfigurationCommandError - */ -const de_PutStorageConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotsitewise#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -7174,7 +4525,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7183,53 +4534,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.iotsitewise#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iotsitewise#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -7238,7 +4542,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7247,50 +4551,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.iotsitewise#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAccessPolicyCommand */ @@ -7299,7 +4559,7 @@ export const de_UpdateAccessPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAccessPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7308,41 +4568,6 @@ export const de_UpdateAccessPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAccessPolicyCommandError - */ -const de_UpdateAccessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAssetCommand */ @@ -7351,7 +4576,7 @@ export const de_UpdateAssetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateAssetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7364,128 +4589,21 @@ export const de_UpdateAssetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAssetCommandError - */ -const de_UpdateAssetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotsitewise#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAssetModelCommand */ -export const de_UpdateAssetModelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateAssetModelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - assetModelStatus: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateAssetModelCommandError - */ -const de_UpdateAssetModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotsitewise#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateAssetModelCompositeModelCommand - */ -export const de_UpdateAssetModelCompositeModelCommand = async ( +export const de_UpdateAssetModelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateAssetModelCompositeModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - assetModelCompositeModelPath: _json, assetModelStatus: _json, }); Object.assign(contents, doc); @@ -7493,47 +4611,25 @@ export const de_UpdateAssetModelCompositeModelCommand = async ( }; /** - * deserializeAws_restJson1UpdateAssetModelCompositeModelCommandError + * deserializeAws_restJson1UpdateAssetModelCompositeModelCommand */ -const de_UpdateAssetModelCompositeModelCommandError = async ( +export const de_UpdateAssetModelCompositeModelCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotsitewise#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + assetModelCompositeModelPath: _json, + assetModelStatus: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -7544,7 +4640,7 @@ export const de_UpdateAssetPropertyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAssetPropertyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7553,44 +4649,6 @@ export const de_UpdateAssetPropertyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAssetPropertyCommandError - */ -const de_UpdateAssetPropertyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDashboardCommand */ @@ -7599,7 +4657,7 @@ export const de_UpdateDashboardCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDashboardCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7608,41 +4666,6 @@ export const de_UpdateDashboardCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDashboardCommandError - */ -const de_UpdateDashboardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateGatewayCommand */ @@ -7651,7 +4674,7 @@ export const de_UpdateGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGatewayCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7660,44 +4683,6 @@ export const de_UpdateGatewayCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateGatewayCommandError - */ -const de_UpdateGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateGatewayCapabilityConfigurationCommand */ @@ -7706,7 +4691,7 @@ export const de_UpdateGatewayCapabilityConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_UpdateGatewayCapabilityConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7720,47 +4705,6 @@ export const de_UpdateGatewayCapabilityConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateGatewayCapabilityConfigurationCommandError - */ -const de_UpdateGatewayCapabilityConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotsitewise#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePortalCommand */ @@ -7769,7 +4713,7 @@ export const de_UpdatePortalCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdatePortalCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7782,44 +4726,6 @@ export const de_UpdatePortalCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePortalCommandError - */ -const de_UpdatePortalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.iotsitewise#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.iotsitewise#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotsitewise#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotsitewise#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotsitewise#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateProjectCommand */ @@ -7828,7 +4734,7 @@ export const de_UpdateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7838,37 +4744,61 @@ export const de_UpdateProjectCommand = async ( }; /** - * deserializeAws_restJson1UpdateProjectCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "ConflictingOperationException": + case "com.amazonaws.iotsitewise#ConflictingOperationException": + throw await de_ConflictingOperationExceptionRes(parsedOutput, context); case "InternalFailureException": case "com.amazonaws.iotsitewise#InternalFailureException": throw await de_InternalFailureExceptionRes(parsedOutput, context); case "InvalidRequestException": case "com.amazonaws.iotsitewise#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.iotsitewise#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.iotsitewise#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.iotsitewise#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.iotsitewise#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.iotsitewise#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.iotsitewise#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "QueryTimeoutException": + case "com.amazonaws.iotsitewise#QueryTimeoutException": + throw await de_QueryTimeoutExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.iotsitewise#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.iotsitewise#UnauthorizedException": + throw await de_UnauthorizedExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.iotsitewise#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts b/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts index e8e7b6e71a28..2cc5fca97843 100644 --- a/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts +++ b/clients/client-iotthingsgraph/src/protocols/Aws_json1_1.ts @@ -663,7 +663,7 @@ export const de_AssociateEntityToThingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateEntityToThingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -675,41 +675,6 @@ export const de_AssociateEntityToThingCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateEntityToThingCommandError - */ -const de_AssociateEntityToThingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateFlowTemplateCommand */ @@ -718,7 +683,7 @@ export const de_CreateFlowTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFlowTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -730,44 +695,6 @@ export const de_CreateFlowTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateFlowTemplateCommandError - */ -const de_CreateFlowTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotthingsgraph#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotthingsgraph#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateSystemInstanceCommand */ @@ -776,7 +703,7 @@ export const de_CreateSystemInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSystemInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -788,44 +715,6 @@ export const de_CreateSystemInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateSystemInstanceCommandError - */ -const de_CreateSystemInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.iotthingsgraph#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotthingsgraph#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateSystemTemplateCommand */ @@ -834,7 +723,7 @@ export const de_CreateSystemTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSystemTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -846,41 +735,6 @@ export const de_CreateSystemTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateSystemTemplateCommandError - */ -const de_CreateSystemTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotthingsgraph#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteFlowTemplateCommand */ @@ -889,7 +743,7 @@ export const de_DeleteFlowTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteFlowTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -901,41 +755,6 @@ export const de_DeleteFlowTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteFlowTemplateCommandError - */ -const de_DeleteFlowTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotthingsgraph#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteNamespaceCommand */ @@ -944,7 +763,7 @@ export const de_DeleteNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -956,35 +775,6 @@ export const de_DeleteNamespaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteNamespaceCommandError - */ -const de_DeleteNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteSystemInstanceCommand */ @@ -993,7 +783,7 @@ export const de_DeleteSystemInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSystemInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1005,41 +795,6 @@ export const de_DeleteSystemInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteSystemInstanceCommandError - */ -const de_DeleteSystemInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotthingsgraph#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteSystemTemplateCommand */ @@ -1048,7 +803,7 @@ export const de_DeleteSystemTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSystemTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1060,41 +815,6 @@ export const de_DeleteSystemTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteSystemTemplateCommandError - */ -const de_DeleteSystemTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotthingsgraph#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeploySystemInstanceCommand */ @@ -1103,7 +823,7 @@ export const de_DeploySystemInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeploySystemInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1115,44 +835,6 @@ export const de_DeploySystemInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeploySystemInstanceCommandError - */ -const de_DeploySystemInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotthingsgraph#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeprecateFlowTemplateCommand */ @@ -1161,7 +843,7 @@ export const de_DeprecateFlowTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeprecateFlowTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1173,41 +855,6 @@ export const de_DeprecateFlowTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeprecateFlowTemplateCommandError - */ -const de_DeprecateFlowTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeprecateSystemTemplateCommand */ @@ -1216,7 +863,7 @@ export const de_DeprecateSystemTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeprecateSystemTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1228,41 +875,6 @@ export const de_DeprecateSystemTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeprecateSystemTemplateCommandError - */ -const de_DeprecateSystemTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeNamespaceCommand */ @@ -1271,7 +883,7 @@ export const de_DescribeNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1283,41 +895,6 @@ export const de_DescribeNamespaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeNamespaceCommandError - */ -const de_DescribeNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DissociateEntityFromThingCommand */ @@ -1326,7 +903,7 @@ export const de_DissociateEntityFromThingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DissociateEntityFromThingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1338,41 +915,6 @@ export const de_DissociateEntityFromThingCommand = async ( return response; }; -/** - * deserializeAws_json1_1DissociateEntityFromThingCommandError - */ -const de_DissociateEntityFromThingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetEntitiesCommand */ @@ -1381,7 +923,7 @@ export const de_GetEntitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetEntitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1393,41 +935,6 @@ export const de_GetEntitiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetEntitiesCommandError - */ -const de_GetEntitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetFlowTemplateCommand */ @@ -1436,7 +943,7 @@ export const de_GetFlowTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetFlowTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1449,54 +956,39 @@ export const de_GetFlowTemplateCommand = async ( }; /** - * deserializeAws_json1_1GetFlowTemplateCommandError + * deserializeAws_json1_1GetFlowTemplateRevisionsCommand */ -const de_GetFlowTemplateCommandError = async ( +export const de_GetFlowTemplateRevisionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetFlowTemplateRevisionsResponse(data, context); + const response: GetFlowTemplateRevisionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetFlowTemplateRevisionsCommand + * deserializeAws_json1_1GetNamespaceDeletionStatusCommand */ -export const de_GetFlowTemplateRevisionsCommand = async ( +export const de_GetNamespaceDeletionStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetFlowTemplateRevisionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetFlowTemplateRevisionsResponse(data, context); - const response: GetFlowTemplateRevisionsCommandOutput = { + contents = _json(data); + const response: GetNamespaceDeletionStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1504,101 +996,14 @@ export const de_GetFlowTemplateRevisionsCommand = async ( }; /** - * deserializeAws_json1_1GetFlowTemplateRevisionsCommandError + * deserializeAws_json1_1GetSystemInstanceCommand */ -const de_GetFlowTemplateRevisionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetNamespaceDeletionStatusCommand - */ -export const de_GetNamespaceDeletionStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetNamespaceDeletionStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetNamespaceDeletionStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetNamespaceDeletionStatusCommandError - */ -const de_GetNamespaceDeletionStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSystemInstanceCommand - */ -export const de_GetSystemInstanceCommand = async ( +export const de_GetSystemInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSystemInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1610,41 +1015,6 @@ export const de_GetSystemInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetSystemInstanceCommandError - */ -const de_GetSystemInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetSystemTemplateCommand */ @@ -1653,7 +1023,7 @@ export const de_GetSystemTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSystemTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1665,41 +1035,6 @@ export const de_GetSystemTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetSystemTemplateCommandError - */ -const de_GetSystemTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetSystemTemplateRevisionsCommand */ @@ -1708,7 +1043,7 @@ export const de_GetSystemTemplateRevisionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSystemTemplateRevisionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1720,41 +1055,6 @@ export const de_GetSystemTemplateRevisionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetSystemTemplateRevisionsCommandError - */ -const de_GetSystemTemplateRevisionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetUploadStatusCommand */ @@ -1763,7 +1063,7 @@ export const de_GetUploadStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetUploadStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1775,41 +1075,6 @@ export const de_GetUploadStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetUploadStatusCommandError - */ -const de_GetUploadStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListFlowExecutionMessagesCommand */ @@ -1818,7 +1083,7 @@ export const de_ListFlowExecutionMessagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListFlowExecutionMessagesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1830,41 +1095,6 @@ export const de_ListFlowExecutionMessagesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListFlowExecutionMessagesCommandError - */ -const de_ListFlowExecutionMessagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -1873,7 +1103,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1885,41 +1115,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotthingsgraph#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SearchEntitiesCommand */ @@ -1928,7 +1123,7 @@ export const de_SearchEntitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchEntitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1940,38 +1135,6 @@ export const de_SearchEntitiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1SearchEntitiesCommandError - */ -const de_SearchEntitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SearchFlowExecutionsCommand */ @@ -1980,7 +1143,7 @@ export const de_SearchFlowExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchFlowExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1992,41 +1155,6 @@ export const de_SearchFlowExecutionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1SearchFlowExecutionsCommandError - */ -const de_SearchFlowExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SearchFlowTemplatesCommand */ @@ -2035,116 +1163,32 @@ export const de_SearchFlowTemplatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchFlowTemplatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_SearchFlowTemplatesResponse(data, context); const response: SearchFlowTemplatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1SearchFlowTemplatesCommandError - */ -const de_SearchFlowTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1SearchSystemInstancesCommand - */ -export const de_SearchSystemInstancesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SearchSystemInstancesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SearchSystemInstancesResponse(data, context); - const response: SearchSystemInstancesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1SearchSystemInstancesCommandError - */ -const de_SearchSystemInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SearchSystemTemplatesCommand + * deserializeAws_json1_1SearchSystemInstancesCommand */ -export const de_SearchSystemTemplatesCommand = async ( +export const de_SearchSystemInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SearchSystemTemplatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_SearchSystemTemplatesResponse(data, context); - const response: SearchSystemTemplatesCommandOutput = { + contents = de_SearchSystemInstancesResponse(data, context); + const response: SearchSystemInstancesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2152,35 +1196,23 @@ export const de_SearchSystemTemplatesCommand = async ( }; /** - * deserializeAws_json1_1SearchSystemTemplatesCommandError + * deserializeAws_json1_1SearchSystemTemplatesCommand */ -const de_SearchSystemTemplatesCommandError = async ( +export const de_SearchSystemTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SearchSystemTemplatesResponse(data, context); + const response: SearchSystemTemplatesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2191,7 +1223,7 @@ export const de_SearchThingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchThingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2203,41 +1235,6 @@ export const de_SearchThingsCommand = async ( return response; }; -/** - * deserializeAws_json1_1SearchThingsCommandError - */ -const de_SearchThingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -2246,7 +1243,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2258,41 +1255,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotthingsgraph#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UndeploySystemInstanceCommand */ @@ -2301,7 +1263,7 @@ export const de_UndeploySystemInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UndeploySystemInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2313,44 +1275,6 @@ export const de_UndeploySystemInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UndeploySystemInstanceCommandError - */ -const de_UndeploySystemInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.iotthingsgraph#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -2359,7 +1283,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2371,41 +1295,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.iotthingsgraph#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateFlowTemplateCommand */ @@ -2414,7 +1303,7 @@ export const de_UpdateFlowTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateFlowTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2426,41 +1315,6 @@ export const de_UpdateFlowTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateFlowTemplateCommandError - */ -const de_UpdateFlowTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSystemTemplateCommand */ @@ -2469,7 +1323,7 @@ export const de_UpdateSystemTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSystemTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2481,41 +1335,6 @@ export const de_UpdateSystemTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSystemTemplateCommandError - */ -const de_UpdateSystemTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.iotthingsgraph#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.iotthingsgraph#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iotthingsgraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UploadEntityDefinitionsCommand */ @@ -2524,7 +1343,7 @@ export const de_UploadEntityDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UploadEntityDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2537,12 +1356,9 @@ export const de_UploadEntityDefinitionsCommand = async ( }; /** - * deserializeAws_json1_1UploadEntityDefinitionsCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UploadEntityDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2555,16 +1371,28 @@ const de_UploadEntityDefinitionsCommandError = async ( case "InvalidRequestException": case "com.amazonaws.iotthingsgraph#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.iotthingsgraph#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.iotthingsgraph#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.iotthingsgraph#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.iotthingsgraph#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.iotthingsgraph#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts b/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts index 88468174e118..17a83c1c852e 100644 --- a/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts +++ b/clients/client-iottwinmaker/src/protocols/Aws_restJson1.ts @@ -1435,7 +1435,7 @@ export const de_BatchPutPropertyValuesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchPutPropertyValuesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1448,41 +1448,6 @@ export const de_BatchPutPropertyValuesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchPutPropertyValuesCommandError - */ -const de_BatchPutPropertyValuesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelMetadataTransferJobCommand */ @@ -1491,7 +1456,7 @@ export const de_CancelMetadataTransferJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelMetadataTransferJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1508,47 +1473,6 @@ export const de_CancelMetadataTransferJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelMetadataTransferJobCommandError - */ -const de_CancelMetadataTransferJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iottwinmaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateComponentTypeCommand */ @@ -1557,7 +1481,7 @@ export const de_CreateComponentTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateComponentTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1572,47 +1496,6 @@ export const de_CreateComponentTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateComponentTypeCommandError - */ -const de_CreateComponentTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iottwinmaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateEntityCommand */ @@ -1621,7 +1504,7 @@ export const de_CreateEntityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEntityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1637,47 +1520,6 @@ export const de_CreateEntityCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEntityCommandError - */ -const de_CreateEntityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iottwinmaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMetadataTransferJobCommand */ @@ -1686,7 +1528,7 @@ export const de_CreateMetadataTransferJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMetadataTransferJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1703,58 +1545,36 @@ export const de_CreateMetadataTransferJobCommand = async ( }; /** - * deserializeAws_restJson1CreateMetadataTransferJobCommandError + * deserializeAws_restJson1CreateSceneCommand */ -const de_CreateMetadataTransferJobCommandError = async ( +export const de_CreateSceneCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iottwinmaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + arn: __expectString, + creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateSceneCommand + * deserializeAws_restJson1CreateSyncJobCommand */ -export const de_CreateSceneCommand = async ( +export const de_CreateSyncJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSceneCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1763,69 +1583,49 @@ export const de_CreateSceneCommand = async ( const doc = take(data, { arn: __expectString, creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + state: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateSceneCommandError + * deserializeAws_restJson1CreateWorkspaceCommand */ -const de_CreateSceneCommandError = async ( +export const de_CreateWorkspaceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iottwinmaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + arn: __expectString, + creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateSyncJobCommand + * deserializeAws_restJson1DeleteComponentTypeCommand */ -export const de_CreateSyncJobCommand = async ( +export const de_DeleteComponentTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSyncJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - arn: __expectString, - creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), state: __expectString, }); Object.assign(contents, doc); @@ -1833,177 +1633,14 @@ export const de_CreateSyncJobCommand = async ( }; /** - * deserializeAws_restJson1CreateSyncJobCommandError + * deserializeAws_restJson1DeleteEntityCommand */ -const de_CreateSyncJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iottwinmaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateWorkspaceCommand - */ -export const de_CreateWorkspaceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWorkspaceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - arn: __expectString, - creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateWorkspaceCommandError - */ -const de_CreateWorkspaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iottwinmaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteComponentTypeCommand - */ -export const de_DeleteComponentTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteComponentTypeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - state: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteComponentTypeCommandError - */ -const de_DeleteComponentTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteEntityCommand - */ -export const de_DeleteEntityCommand = async ( +export const de_DeleteEntityCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEntityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2016,44 +1653,6 @@ export const de_DeleteEntityCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEntityCommandError - */ -const de_DeleteEntityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSceneCommand */ @@ -2062,7 +1661,7 @@ export const de_DeleteSceneCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSceneCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2071,44 +1670,6 @@ export const de_DeleteSceneCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSceneCommandError - */ -const de_DeleteSceneCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSyncJobCommand */ @@ -2117,7 +1678,7 @@ export const de_DeleteSyncJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSyncJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2129,1021 +1690,206 @@ export const de_DeleteSyncJobCommand = async ( Object.assign(contents, doc); return contents; }; - -/** - * deserializeAws_restJson1DeleteSyncJobCommandError - */ -const de_DeleteSyncJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteWorkspaceCommand - */ -export const de_DeleteWorkspaceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteWorkspaceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - message: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteWorkspaceCommandError - */ -const de_DeleteWorkspaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ExecuteQueryCommand - */ -export const de_ExecuteQueryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExecuteQueryCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - columnDescriptions: _json, - nextToken: __expectString, - rows: (_) => de_Rows(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ExecuteQueryCommandError - */ -const de_ExecuteQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "QueryTimeoutException": - case "com.amazonaws.iottwinmaker#QueryTimeoutException": - throw await de_QueryTimeoutExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetComponentTypeCommand - */ -export const de_GetComponentTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetComponentTypeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - arn: __expectString, - componentTypeId: __expectString, - componentTypeName: __expectString, - compositeComponentTypes: _json, - creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - description: __expectString, - extendsFrom: _json, - functions: _json, - isAbstract: __expectBoolean, - isSchemaInitialized: __expectBoolean, - isSingleton: __expectBoolean, - propertyDefinitions: (_) => de_PropertyDefinitionsResponse(_, context), - propertyGroups: _json, - status: _json, - syncSource: __expectString, - updateDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - workspaceId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetComponentTypeCommandError - */ -const de_GetComponentTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEntityCommand - */ -export const de_GetEntityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEntityCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - areAllComponentsReturned: __expectBoolean, - arn: __expectString, - components: (_) => de_ComponentsMap(_, context), - creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - description: __expectString, - entityId: __expectString, - entityName: __expectString, - hasChildEntities: __expectBoolean, - parentEntityId: __expectString, - status: _json, - syncSource: __expectString, - updateDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - workspaceId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEntityCommandError - */ -const de_GetEntityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMetadataTransferJobCommand - */ -export const de_GetMetadataTransferJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMetadataTransferJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - arn: __expectString, - creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - description: __expectString, - destination: _json, - metadataTransferJobId: __expectString, - metadataTransferJobRole: __expectString, - progress: _json, - reportUrl: __expectString, - sources: _json, - status: _json, - updateDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMetadataTransferJobCommandError - */ -const de_GetMetadataTransferJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPricingPlanCommand - */ -export const de_GetPricingPlanCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPricingPlanCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - currentPricingPlan: (_) => de_PricingPlan(_, context), - pendingPricingPlan: (_) => de_PricingPlan(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPricingPlanCommandError - */ -const de_GetPricingPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPropertyValueCommand - */ -export const de_GetPropertyValueCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPropertyValueCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - propertyValues: (_) => de_PropertyLatestValueMap(_, context), - tabularPropertyValues: (_) => de_TabularPropertyValues(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPropertyValueCommandError - */ -const de_GetPropertyValueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConnectorFailureException": - case "com.amazonaws.iottwinmaker#ConnectorFailureException": - throw await de_ConnectorFailureExceptionRes(parsedOutput, context); - case "ConnectorTimeoutException": - case "com.amazonaws.iottwinmaker#ConnectorTimeoutException": - throw await de_ConnectorTimeoutExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPropertyValueHistoryCommand - */ -export const de_GetPropertyValueHistoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPropertyValueHistoryCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - propertyValues: (_) => de_PropertyValueList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPropertyValueHistoryCommandError - */ -const de_GetPropertyValueHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConnectorFailureException": - case "com.amazonaws.iottwinmaker#ConnectorFailureException": - throw await de_ConnectorFailureExceptionRes(parsedOutput, context); - case "ConnectorTimeoutException": - case "com.amazonaws.iottwinmaker#ConnectorTimeoutException": - throw await de_ConnectorTimeoutExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSceneCommand - */ -export const de_GetSceneCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSceneCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - arn: __expectString, - capabilities: _json, - contentLocation: __expectString, - creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - description: __expectString, - error: _json, - generatedSceneMetadata: _json, - sceneId: __expectString, - sceneMetadata: _json, - updateDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - workspaceId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSceneCommandError - */ -const de_GetSceneCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSyncJobCommand - */ -export const de_GetSyncJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSyncJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - arn: __expectString, - creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - status: _json, - syncRole: __expectString, - syncSource: __expectString, - updateDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - workspaceId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSyncJobCommandError - */ -const de_GetSyncJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetWorkspaceCommand - */ -export const de_GetWorkspaceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkspaceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - arn: __expectString, - creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - description: __expectString, - linkedServices: _json, - role: __expectString, - s3Location: __expectString, - updateDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - workspaceId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetWorkspaceCommandError - */ -const de_GetWorkspaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListComponentsCommand - */ -export const de_ListComponentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListComponentsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - componentSummaries: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListComponentsCommandError - */ -const de_ListComponentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + +/** + * deserializeAws_restJson1DeleteWorkspaceCommand + */ +export const de_DeleteWorkspaceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListComponentTypesCommand + * deserializeAws_restJson1ExecuteQueryCommand */ -export const de_ListComponentTypesCommand = async ( +export const de_ExecuteQueryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListComponentTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - componentTypeSummaries: (_) => de_ComponentTypeSummaries(_, context), - maxResults: __expectInt32, + columnDescriptions: _json, nextToken: __expectString, - workspaceId: __expectString, + rows: (_) => de_Rows(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListComponentTypesCommandError + * deserializeAws_restJson1GetComponentTypeCommand */ -const de_ListComponentTypesCommandError = async ( +export const de_GetComponentTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + arn: __expectString, + componentTypeId: __expectString, + componentTypeName: __expectString, + compositeComponentTypes: _json, + creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + description: __expectString, + extendsFrom: _json, + functions: _json, + isAbstract: __expectBoolean, + isSchemaInitialized: __expectBoolean, + isSingleton: __expectBoolean, + propertyDefinitions: (_) => de_PropertyDefinitionsResponse(_, context), + propertyGroups: _json, + status: _json, + syncSource: __expectString, + updateDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + workspaceId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListEntitiesCommand + * deserializeAws_restJson1GetEntityCommand */ -export const de_ListEntitiesCommand = async ( +export const de_GetEntityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEntitiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - entitySummaries: (_) => de_EntitySummaries(_, context), - nextToken: __expectString, + areAllComponentsReturned: __expectBoolean, + arn: __expectString, + components: (_) => de_ComponentsMap(_, context), + creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + description: __expectString, + entityId: __expectString, + entityName: __expectString, + hasChildEntities: __expectBoolean, + parentEntityId: __expectString, + status: _json, + syncSource: __expectString, + updateDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + workspaceId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListEntitiesCommandError + * deserializeAws_restJson1GetMetadataTransferJobCommand */ -const de_ListEntitiesCommandError = async ( +export const de_GetMetadataTransferJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + arn: __expectString, + creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + description: __expectString, + destination: _json, + metadataTransferJobId: __expectString, + metadataTransferJobRole: __expectString, + progress: _json, + reportUrl: __expectString, + sources: _json, + status: _json, + updateDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListMetadataTransferJobsCommand + * deserializeAws_restJson1GetPricingPlanCommand */ -export const de_ListMetadataTransferJobsCommand = async ( +export const de_GetPricingPlanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMetadataTransferJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - metadataTransferJobSummaries: (_) => de_MetadataTransferJobSummaries(_, context), - nextToken: __expectString, + currentPricingPlan: (_) => de_PricingPlan(_, context), + pendingPricingPlan: (_) => de_PricingPlan(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListMetadataTransferJobsCommandError + * deserializeAws_restJson1GetPropertyValueCommand */ -const de_ListMetadataTransferJobsCommandError = async ( +export const de_GetPropertyValueCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + propertyValues: (_) => de_PropertyLatestValueMap(_, context), + tabularPropertyValues: (_) => de_TabularPropertyValues(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPropertiesCommand + * deserializeAws_restJson1GetPropertyValueHistoryCommand */ -export const de_ListPropertiesCommand = async ( +export const de_GetPropertyValueHistoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPropertiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3151,236 +1897,197 @@ export const de_ListPropertiesCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - propertySummaries: (_) => de_PropertySummaries(_, context), + propertyValues: (_) => de_PropertyValueList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPropertiesCommandError + * deserializeAws_restJson1GetSceneCommand */ -const de_ListPropertiesCommandError = async ( +export const de_GetSceneCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + arn: __expectString, + capabilities: _json, + contentLocation: __expectString, + creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + description: __expectString, + error: _json, + generatedSceneMetadata: _json, + sceneId: __expectString, + sceneMetadata: _json, + updateDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + workspaceId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListScenesCommand + * deserializeAws_restJson1GetSyncJobCommand */ -export const de_ListScenesCommand = async ( +export const de_GetSyncJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListScenesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - sceneSummaries: (_) => de_SceneSummaries(_, context), + arn: __expectString, + creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + status: _json, + syncRole: __expectString, + syncSource: __expectString, + updateDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + workspaceId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListScenesCommandError + * deserializeAws_restJson1GetWorkspaceCommand */ -const de_ListScenesCommandError = async ( +export const de_GetWorkspaceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + arn: __expectString, + creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + description: __expectString, + linkedServices: _json, + role: __expectString, + s3Location: __expectString, + updateDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + workspaceId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListSyncJobsCommand + * deserializeAws_restJson1ListComponentsCommand */ -export const de_ListSyncJobsCommand = async ( +export const de_ListComponentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSyncJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + componentSummaries: _json, nextToken: __expectString, - syncJobSummaries: (_) => de_SyncJobSummaries(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSyncJobsCommandError + * deserializeAws_restJson1ListComponentTypesCommand */ -const de_ListSyncJobsCommandError = async ( +export const de_ListComponentTypesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + componentTypeSummaries: (_) => de_ComponentTypeSummaries(_, context), + maxResults: __expectInt32, + nextToken: __expectString, + workspaceId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListSyncResourcesCommand + * deserializeAws_restJson1ListEntitiesCommand */ -export const de_ListSyncResourcesCommand = async ( +export const de_ListEntitiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSyncResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + entitySummaries: (_) => de_EntitySummaries(_, context), nextToken: __expectString, - syncResources: (_) => de_SyncResourceSummaries(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSyncResourcesCommandError + * deserializeAws_restJson1ListMetadataTransferJobsCommand */ -const de_ListSyncResourcesCommandError = async ( +export const de_ListMetadataTransferJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + metadataTransferJobSummaries: (_) => de_MetadataTransferJobSummaries(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListPropertiesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListPropertiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3388,50 +2095,43 @@ export const de_ListTagsForResourceCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - tags: _json, + propertySummaries: (_) => de_PropertySummaries(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListScenesCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListScenesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + sceneSummaries: (_) => de_SceneSummaries(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListWorkspacesCommand + * deserializeAws_restJson1ListSyncJobsCommand */ -export const de_ListWorkspacesCommand = async ( +export const de_ListSyncJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkspacesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3439,105 +2139,87 @@ export const de_ListWorkspacesCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - workspaceSummaries: (_) => de_WorkspaceSummaries(_, context), + syncJobSummaries: (_) => de_SyncJobSummaries(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListWorkspacesCommandError + * deserializeAws_restJson1ListSyncResourcesCommand */ -const de_ListWorkspacesCommandError = async ( +export const de_ListSyncResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + syncResources: (_) => de_SyncResourceSummaries(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_TagResourceCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + tags: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1ListWorkspacesCommand */ -const de_TagResourceCommandError = async ( +export const de_ListWorkspacesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.iottwinmaker#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + workspaceSummaries: (_) => de_WorkspaceSummaries(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UntagResourceCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3547,32 +2229,20 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -3583,7 +2253,7 @@ export const de_UpdateComponentTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateComponentTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3599,47 +2269,6 @@ export const de_UpdateComponentTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateComponentTypeCommandError - */ -const de_UpdateComponentTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEntityCommand */ @@ -3648,7 +2277,7 @@ export const de_UpdateEntityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEntityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3662,50 +2291,6 @@ export const de_UpdateEntityCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEntityCommandError - */ -const de_UpdateEntityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.iottwinmaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePricingPlanCommand */ @@ -3714,7 +2299,7 @@ export const de_UpdatePricingPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePricingPlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3728,41 +2313,6 @@ export const de_UpdatePricingPlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePricingPlanCommandError - */ -const de_UpdatePricingPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSceneCommand */ @@ -3771,7 +2321,7 @@ export const de_UpdateSceneCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSceneCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3784,44 +2334,6 @@ export const de_UpdateSceneCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSceneCommandError - */ -const de_UpdateSceneCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.iottwinmaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.iottwinmaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.iottwinmaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.iottwinmaker#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWorkspaceCommand */ @@ -3830,7 +2342,7 @@ export const de_UpdateWorkspaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateWorkspaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3844,43 +2356,55 @@ export const de_UpdateWorkspaceCommand = async ( }; /** - * deserializeAws_restJson1UpdateWorkspaceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateWorkspaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.iottwinmaker#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.iottwinmaker#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.iottwinmaker#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.iottwinmaker#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.iottwinmaker#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.iottwinmaker#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.iottwinmaker#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.iottwinmaker#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "QueryTimeoutException": + case "com.amazonaws.iottwinmaker#QueryTimeoutException": + throw await de_QueryTimeoutExceptionRes(parsedOutput, context); + case "ConnectorFailureException": + case "com.amazonaws.iottwinmaker#ConnectorFailureException": + throw await de_ConnectorFailureExceptionRes(parsedOutput, context); + case "ConnectorTimeoutException": + case "com.amazonaws.iottwinmaker#ConnectorTimeoutException": + throw await de_ConnectorTimeoutExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.iottwinmaker#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-ivs-realtime/src/protocols/Aws_restJson1.ts b/clients/client-ivs-realtime/src/protocols/Aws_restJson1.ts index ca391622245f..ad89d1147507 100644 --- a/clients/client-ivs-realtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-ivs-realtime/src/protocols/Aws_restJson1.ts @@ -756,7 +756,7 @@ export const de_CreateEncoderConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEncoderConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -769,50 +769,6 @@ export const de_CreateEncoderConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEncoderConfigurationCommandError - */ -const de_CreateEncoderConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivsrealtime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivsrealtime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivsrealtime#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivsrealtime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateParticipantTokenCommand */ @@ -821,7 +777,7 @@ export const de_CreateParticipantTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateParticipantTokenCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -834,44 +790,6 @@ export const de_CreateParticipantTokenCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateParticipantTokenCommandError - */ -const de_CreateParticipantTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivsrealtime#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivsrealtime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateStageCommand */ @@ -880,7 +798,7 @@ export const de_CreateStageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateStageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -894,41 +812,6 @@ export const de_CreateStageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateStageCommandError - */ -const de_CreateStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivsrealtime#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivsrealtime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateStorageConfigurationCommand */ @@ -937,7 +820,7 @@ export const de_CreateStorageConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateStorageConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -950,50 +833,6 @@ export const de_CreateStorageConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateStorageConfigurationCommandError - */ -const de_CreateStorageConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivsrealtime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivsrealtime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivsrealtime#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivsrealtime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteEncoderConfigurationCommand */ @@ -1002,7 +841,7 @@ export const de_DeleteEncoderConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEncoderConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1011,47 +850,6 @@ export const de_DeleteEncoderConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEncoderConfigurationCommandError - */ -const de_DeleteEncoderConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivsrealtime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivsrealtime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivsrealtime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteStageCommand */ @@ -1060,7 +858,7 @@ export const de_DeleteStageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteStageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1070,52 +868,31 @@ export const de_DeleteStageCommand = async ( }; /** - * deserializeAws_restJson1DeleteStageCommandError + * deserializeAws_restJson1DeleteStorageConfigurationCommand */ -const de_DeleteStageCommandError = async ( +export const de_DeleteStorageConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivsrealtime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivsrealtime#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteStorageConfigurationCommand + * deserializeAws_restJson1DisconnectParticipantCommand */ -export const de_DeleteStorageConfigurationCommand = async ( +export const de_DisconnectParticipantCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteStorageConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1125,579 +902,147 @@ export const de_DeleteStorageConfigurationCommand = async ( }; /** - * deserializeAws_restJson1DeleteStorageConfigurationCommandError - */ -const de_DeleteStorageConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivsrealtime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivsrealtime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivsrealtime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisconnectParticipantCommand - */ -export const de_DisconnectParticipantCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisconnectParticipantCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisconnectParticipantCommandError - */ -const de_DisconnectParticipantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivsrealtime#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCompositionCommand - */ -export const de_GetCompositionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCompositionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - composition: (_) => de_Composition(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetCompositionCommandError - */ -const de_GetCompositionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivsrealtime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivsrealtime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivsrealtime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEncoderConfigurationCommand - */ -export const de_GetEncoderConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEncoderConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - encoderConfiguration: (_) => de_EncoderConfiguration(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEncoderConfigurationCommandError - */ -const de_GetEncoderConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivsrealtime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivsrealtime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivsrealtime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetParticipantCommand - */ -export const de_GetParticipantCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetParticipantCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - participant: (_) => de_Participant(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetParticipantCommandError - */ -const de_GetParticipantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetStageCommand - */ -export const de_GetStageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStageCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - stage: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetStageCommandError - */ -const de_GetStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetStageSessionCommand - */ -export const de_GetStageSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStageSessionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - stageSession: (_) => de_StageSession(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetStageSessionCommandError - */ -const de_GetStageSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetStorageConfigurationCommand + * deserializeAws_restJson1GetCompositionCommand */ -export const de_GetStorageConfigurationCommand = async ( +export const de_GetCompositionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStorageConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - storageConfiguration: _json, + composition: (_) => de_Composition(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetStorageConfigurationCommandError + * deserializeAws_restJson1GetEncoderConfigurationCommand */ -const de_GetStorageConfigurationCommandError = async ( +export const de_GetEncoderConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivsrealtime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivsrealtime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivsrealtime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + encoderConfiguration: (_) => de_EncoderConfiguration(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListCompositionsCommand + * deserializeAws_restJson1GetParticipantCommand */ -export const de_ListCompositionsCommand = async ( +export const de_GetParticipantCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCompositionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - compositions: (_) => de_CompositionSummaryList(_, context), - nextToken: __expectString, + participant: (_) => de_Participant(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListCompositionsCommandError + * deserializeAws_restJson1GetStageCommand */ -const de_ListCompositionsCommandError = async ( +export const de_GetStageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivsrealtime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivsrealtime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivsrealtime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + stage: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListEncoderConfigurationsCommand + * deserializeAws_restJson1GetStageSessionCommand */ -export const de_ListEncoderConfigurationsCommand = async ( +export const de_GetStageSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEncoderConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - encoderConfigurations: _json, - nextToken: __expectString, + stageSession: (_) => de_StageSession(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListEncoderConfigurationsCommandError + * deserializeAws_restJson1GetStorageConfigurationCommand */ -const de_ListEncoderConfigurationsCommandError = async ( +export const de_GetStorageConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivsrealtime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivsrealtime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivsrealtime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + storageConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListParticipantEventsCommand + * deserializeAws_restJson1ListCompositionsCommand */ -export const de_ListParticipantEventsCommand = async ( +export const de_ListCompositionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListParticipantEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - events: (_) => de_EventList(_, context), + compositions: (_) => de_CompositionSummaryList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -1705,148 +1050,80 @@ export const de_ListParticipantEventsCommand = async ( }; /** - * deserializeAws_restJson1ListParticipantEventsCommandError - */ -const de_ListParticipantEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListParticipantsCommand + * deserializeAws_restJson1ListEncoderConfigurationsCommand */ -export const de_ListParticipantsCommand = async ( +export const de_ListEncoderConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListParticipantsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + encoderConfigurations: _json, nextToken: __expectString, - participants: (_) => de_ParticipantList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListParticipantsCommandError - */ -const de_ListParticipantsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListStagesCommand + * deserializeAws_restJson1ListParticipantEventsCommand */ -export const de_ListStagesCommand = async ( +export const de_ListParticipantEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + events: (_) => de_EventList(_, context), nextToken: __expectString, - stages: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListStagesCommandError + * deserializeAws_restJson1ListParticipantsCommand */ -const de_ListStagesCommandError = async ( +export const de_ListParticipantsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivsrealtime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + participants: (_) => de_ParticipantList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListStageSessionsCommand + * deserializeAws_restJson1ListStagesCommand */ -export const de_ListStageSessionsCommand = async ( +export const de_ListStagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStageSessionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1854,39 +1131,32 @@ export const de_ListStageSessionsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - stageSessions: (_) => de_StageSessionList(_, context), + stages: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListStageSessionsCommandError + * deserializeAws_restJson1ListStageSessionsCommand */ -const de_ListStageSessionsCommandError = async ( +export const de_ListStageSessionsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + stageSessions: (_) => de_StageSessionList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1897,7 +1167,7 @@ export const de_ListStorageConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStorageConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1911,44 +1181,6 @@ export const de_ListStorageConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListStorageConfigurationsCommandError - */ -const de_ListStorageConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivsrealtime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivsrealtime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivsrealtime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1957,7 +1189,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1970,38 +1202,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ivsrealtime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartCompositionCommand */ @@ -2010,7 +1210,7 @@ export const de_StartCompositionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartCompositionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2023,50 +1223,6 @@ export const de_StartCompositionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartCompositionCommandError - */ -const de_StartCompositionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivsrealtime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivsrealtime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivsrealtime#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivsrealtime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopCompositionCommand */ @@ -2075,7 +1231,7 @@ export const de_StopCompositionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopCompositionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2084,47 +1240,6 @@ export const de_StopCompositionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopCompositionCommandError - */ -const de_StopCompositionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivsrealtime#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivsrealtime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivsrealtime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivsrealtime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2133,7 +1248,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2142,38 +1257,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ivsrealtime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2182,7 +1265,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2191,38 +1274,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ivsrealtime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivsrealtime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivsrealtime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateStageCommand */ @@ -2231,7 +1282,7 @@ export const de_UpdateStageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateStageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2245,12 +1296,9 @@ export const de_UpdateStageCommand = async ( }; /** - * deserializeAws_restJson1UpdateStageCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2260,6 +1308,12 @@ const de_UpdateStageCommandError = async ( case "AccessDeniedException": case "com.amazonaws.ivsrealtime#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.ivsrealtime#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.ivsrealtime#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); case "PendingVerification": case "com.amazonaws.ivsrealtime#PendingVerification": throw await de_PendingVerificationRes(parsedOutput, context); @@ -2278,7 +1332,7 @@ const de_UpdateStageCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-ivs/src/protocols/Aws_restJson1.ts b/clients/client-ivs/src/protocols/Aws_restJson1.ts index 83406f1cedff..2cd26160efac 100644 --- a/clients/client-ivs/src/protocols/Aws_restJson1.ts +++ b/clients/client-ivs/src/protocols/Aws_restJson1.ts @@ -952,7 +952,7 @@ export const de_BatchGetChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -966,26 +966,6 @@ export const de_BatchGetChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetChannelCommandError - */ -const de_BatchGetChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1BatchGetStreamKeyCommand */ @@ -994,7 +974,7 @@ export const de_BatchGetStreamKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetStreamKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1008,26 +988,6 @@ export const de_BatchGetStreamKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetStreamKeyCommandError - */ -const de_BatchGetStreamKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1BatchStartViewerSessionRevocationCommand */ @@ -1036,7 +996,7 @@ export const de_BatchStartViewerSessionRevocationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchStartViewerSessionRevocationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1049,41 +1009,6 @@ export const de_BatchStartViewerSessionRevocationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchStartViewerSessionRevocationCommandError - */ -const de_BatchStartViewerSessionRevocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivs#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ivs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateChannelCommand */ @@ -1092,7 +1017,7 @@ export const de_CreateChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1106,44 +1031,6 @@ export const de_CreateChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateChannelCommandError - */ -const de_CreateChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivs#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePlaybackRestrictionPolicyCommand */ @@ -1152,7 +1039,7 @@ export const de_CreatePlaybackRestrictionPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePlaybackRestrictionPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1165,44 +1052,6 @@ export const de_CreatePlaybackRestrictionPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePlaybackRestrictionPolicyCommandError - */ -const de_CreatePlaybackRestrictionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivs#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ivs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRecordingConfigurationCommand */ @@ -1211,7 +1060,7 @@ export const de_CreateRecordingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRecordingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1224,47 +1073,6 @@ export const de_CreateRecordingConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRecordingConfigurationCommandError - */ -const de_CreateRecordingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivs#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateStreamKeyCommand */ @@ -1273,7 +1081,7 @@ export const de_CreateStreamKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateStreamKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1286,44 +1094,6 @@ export const de_CreateStreamKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateStreamKeyCommandError - */ -const de_CreateStreamKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivs#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteChannelCommand */ @@ -1332,7 +1102,7 @@ export const de_DeleteChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1342,52 +1112,31 @@ export const de_DeleteChannelCommand = async ( }; /** - * deserializeAws_restJson1DeleteChannelCommandError + * deserializeAws_restJson1DeletePlaybackKeyPairCommand */ -const de_DeleteChannelCommandError = async ( +export const de_DeletePlaybackKeyPairCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivs#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeletePlaybackKeyPairCommand + * deserializeAws_restJson1DeletePlaybackRestrictionPolicyCommand */ -export const de_DeletePlaybackKeyPairCommand = async ( +export const de_DeletePlaybackRestrictionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePlaybackKeyPairCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1397,104 +1146,14 @@ export const de_DeletePlaybackKeyPairCommand = async ( }; /** - * deserializeAws_restJson1DeletePlaybackKeyPairCommandError + * deserializeAws_restJson1DeleteRecordingConfigurationCommand */ -const de_DeletePlaybackKeyPairCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivs#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePlaybackRestrictionPolicyCommand - */ -export const de_DeletePlaybackRestrictionPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeletePlaybackRestrictionPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeletePlaybackRestrictionPolicyCommandError - */ -const de_DeletePlaybackRestrictionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivs#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRecordingConfigurationCommand - */ -export const de_DeleteRecordingConfigurationCommand = async ( +export const de_DeleteRecordingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRecordingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1503,44 +1162,6 @@ export const de_DeleteRecordingConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRecordingConfigurationCommandError - */ -const de_DeleteRecordingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteStreamKeyCommand */ @@ -1549,7 +1170,7 @@ export const de_DeleteStreamKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteStreamKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1558,41 +1179,6 @@ export const de_DeleteStreamKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteStreamKeyCommandError - */ -const de_DeleteStreamKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivs#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetChannelCommand */ @@ -1601,7 +1187,7 @@ export const de_GetChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1614,38 +1200,6 @@ export const de_GetChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetChannelCommandError - */ -const de_GetChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPlaybackKeyPairCommand */ @@ -1654,7 +1208,7 @@ export const de_GetPlaybackKeyPairCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPlaybackKeyPairCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1667,38 +1221,6 @@ export const de_GetPlaybackKeyPairCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetPlaybackKeyPairCommandError - */ -const de_GetPlaybackKeyPairCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPlaybackRestrictionPolicyCommand */ @@ -1707,7 +1229,7 @@ export const de_GetPlaybackRestrictionPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPlaybackRestrictionPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1717,651 +1239,189 @@ export const de_GetPlaybackRestrictionPolicyCommand = async ( playbackRestrictionPolicy: _json, }); Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPlaybackRestrictionPolicyCommandError - */ -const de_GetPlaybackRestrictionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivs#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRecordingConfigurationCommand - */ -export const de_GetRecordingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRecordingConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - recordingConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRecordingConfigurationCommandError - */ -const de_GetRecordingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetStreamCommand - */ -export const de_GetStreamCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStreamCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - stream: (_) => de__Stream(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetStreamCommandError - */ -const de_GetStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ChannelNotBroadcasting": - case "com.amazonaws.ivs#ChannelNotBroadcasting": - throw await de_ChannelNotBroadcastingRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetStreamKeyCommand - */ -export const de_GetStreamKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStreamKeyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - streamKey: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetStreamKeyCommandError - */ -const de_GetStreamKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetStreamSessionCommand - */ -export const de_GetStreamSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStreamSessionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - streamSession: (_) => de_StreamSession(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetStreamSessionCommandError - */ -const de_GetStreamSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ImportPlaybackKeyPairCommand - */ -export const de_ImportPlaybackKeyPairCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ImportPlaybackKeyPairCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - keyPair: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ImportPlaybackKeyPairCommandError - */ -const de_ImportPlaybackKeyPairCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivs#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivs#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListChannelsCommand - */ -export const de_ListChannelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - channels: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListChannelsCommandError - */ -const de_ListChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPlaybackKeyPairsCommand - */ -export const de_ListPlaybackKeyPairsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPlaybackKeyPairsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - keyPairs: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPlaybackKeyPairsCommandError - */ -const de_ListPlaybackKeyPairsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return contents; }; /** - * deserializeAws_restJson1ListPlaybackRestrictionPoliciesCommand + * deserializeAws_restJson1GetRecordingConfigurationCommand */ -export const de_ListPlaybackRestrictionPoliciesCommand = async ( +export const de_GetRecordingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPlaybackRestrictionPoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - playbackRestrictionPolicies: _json, + recordingConfiguration: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPlaybackRestrictionPoliciesCommandError + * deserializeAws_restJson1GetStreamCommand */ -const de_ListPlaybackRestrictionPoliciesCommandError = async ( +export const de_GetStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivs#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + stream: (_) => de__Stream(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRecordingConfigurationsCommand + * deserializeAws_restJson1GetStreamKeyCommand */ -export const de_ListRecordingConfigurationsCommand = async ( +export const de_GetStreamKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecordingConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - recordingConfigurations: _json, + streamKey: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRecordingConfigurationsCommandError + * deserializeAws_restJson1GetStreamSessionCommand */ -const de_ListRecordingConfigurationsCommandError = async ( +export const de_GetStreamSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + streamSession: (_) => de_StreamSession(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListStreamKeysCommand + * deserializeAws_restJson1ImportPlaybackKeyPairCommand */ -export const de_ListStreamKeysCommand = async ( +export const de_ImportPlaybackKeyPairCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStreamKeysCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - streamKeys: _json, + keyPair: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListStreamKeysCommandError + * deserializeAws_restJson1ListChannelsCommand */ -const de_ListStreamKeysCommandError = async ( +export const de_ListChannelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + channels: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListStreamsCommand + * deserializeAws_restJson1ListPlaybackKeyPairsCommand */ -export const de_ListStreamsCommand = async ( +export const de_ListPlaybackKeyPairsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStreamsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + keyPairs: _json, nextToken: __expectString, - streams: (_) => de_StreamList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListStreamsCommandError + * deserializeAws_restJson1ListPlaybackRestrictionPoliciesCommand */ -const de_ListStreamsCommandError = async ( +export const de_ListPlaybackRestrictionPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + playbackRestrictionPolicies: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListStreamSessionsCommand + * deserializeAws_restJson1ListRecordingConfigurationsCommand */ -export const de_ListStreamSessionsCommand = async ( +export const de_ListRecordingConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStreamSessionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2369,150 +1429,114 @@ export const de_ListStreamSessionsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - streamSessions: (_) => de_StreamSessionList(_, context), + recordingConfigurations: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListStreamSessionsCommandError + * deserializeAws_restJson1ListStreamKeysCommand */ -const de_ListStreamSessionsCommandError = async ( +export const de_ListStreamKeysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + streamKeys: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListStreamsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListStreamsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + nextToken: __expectString, + streams: (_) => de_StreamList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListStreamSessionsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListStreamSessionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ivs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + streamSessions: (_) => de_StreamSessionList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutMetadataCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_PutMetadataCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_PutMetadataCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutMetadataCommandError + * deserializeAws_restJson1PutMetadataCommand */ -const de_PutMetadataCommandError = async ( +export const de_PutMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ChannelNotBroadcasting": - case "com.amazonaws.ivs#ChannelNotBroadcasting": - throw await de_ChannelNotBroadcastingRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ivs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -2523,7 +1547,7 @@ export const de_StartViewerSessionRevocationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartViewerSessionRevocationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2532,47 +1556,6 @@ export const de_StartViewerSessionRevocationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartViewerSessionRevocationCommandError - */ -const de_StartViewerSessionRevocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ivs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivs#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ivs#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopStreamCommand */ @@ -2581,7 +1564,7 @@ export const de_StopStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2590,44 +1573,6 @@ export const de_StopStreamCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopStreamCommandError - */ -const de_StopStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ChannelNotBroadcasting": - case "com.amazonaws.ivs#ChannelNotBroadcasting": - throw await de_ChannelNotBroadcastingRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "StreamUnavailable": - case "com.amazonaws.ivs#StreamUnavailable": - throw await de_StreamUnavailableRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2636,7 +1581,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2645,38 +1590,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ivs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2685,7 +1598,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2694,38 +1607,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ivs#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateChannelCommand */ @@ -2734,7 +1615,7 @@ export const de_UpdateChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2747,44 +1628,6 @@ export const de_UpdateChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateChannelCommandError - */ -const de_UpdateChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivs#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivs#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivs#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePlaybackRestrictionPolicyCommand */ @@ -2793,7 +1636,7 @@ export const de_UpdatePlaybackRestrictionPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePlaybackRestrictionPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2807,12 +1650,9 @@ export const de_UpdatePlaybackRestrictionPolicyCommand = async ( }; /** - * deserializeAws_restJson1UpdatePlaybackRestrictionPolicyCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdatePlaybackRestrictionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2822,25 +1662,40 @@ const de_UpdatePlaybackRestrictionPolicyCommandError = async ( case "AccessDeniedException": case "com.amazonaws.ivs#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivs#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "PendingVerification": case "com.amazonaws.ivs#PendingVerification": throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.ivs#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.ivs#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.ivs#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.ivs#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.ivs#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.ivs#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ChannelNotBroadcasting": + case "com.amazonaws.ivs#ChannelNotBroadcasting": + throw await de_ChannelNotBroadcastingRes(parsedOutput, context); + case "StreamUnavailable": + case "com.amazonaws.ivs#StreamUnavailable": + throw await de_StreamUnavailableRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-ivschat/src/protocols/Aws_restJson1.ts b/clients/client-ivschat/src/protocols/Aws_restJson1.ts index 906b9ce6213b..d72ca869141c 100644 --- a/clients/client-ivschat/src/protocols/Aws_restJson1.ts +++ b/clients/client-ivschat/src/protocols/Aws_restJson1.ts @@ -484,7 +484,7 @@ export const de_CreateChatTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateChatTokenCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -499,41 +499,6 @@ export const de_CreateChatTokenCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateChatTokenCommandError - */ -const de_CreateChatTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivschat#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivschat#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivschat#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLoggingConfigurationCommand */ @@ -542,7 +507,7 @@ export const de_CreateLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -562,47 +527,6 @@ export const de_CreateLoggingConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLoggingConfigurationCommandError - */ -const de_CreateLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivschat#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivschat#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivschat#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivschat#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivschat#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRoomCommand */ @@ -611,7 +535,7 @@ export const de_CreateRoomCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRoomCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -633,47 +557,6 @@ export const de_CreateRoomCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRoomCommandError - */ -const de_CreateRoomCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivschat#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivschat#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivschat#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivschat#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ivschat#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteLoggingConfigurationCommand */ @@ -682,7 +565,7 @@ export const de_DeleteLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -691,44 +574,6 @@ export const de_DeleteLoggingConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLoggingConfigurationCommandError - */ -const de_DeleteLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivschat#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivschat#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivschat#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivschat#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteMessageCommand */ @@ -737,7 +582,7 @@ export const de_DeleteMessageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -750,44 +595,6 @@ export const de_DeleteMessageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteMessageCommandError - */ -const de_DeleteMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivschat#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivschat#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivschat#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ivschat#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRoomCommand */ @@ -796,7 +603,7 @@ export const de_DeleteRoomCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRoomCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -805,41 +612,6 @@ export const de_DeleteRoomCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRoomCommandError - */ -const de_DeleteRoomCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivschat#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivschat#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivschat#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisconnectUserCommand */ @@ -848,7 +620,7 @@ export const de_DisconnectUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisconnectUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -857,44 +629,6 @@ export const de_DisconnectUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisconnectUserCommandError - */ -const de_DisconnectUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivschat#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivschat#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivschat#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ivschat#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLoggingConfigurationCommand */ @@ -903,7 +637,7 @@ export const de_GetLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -923,38 +657,6 @@ export const de_GetLoggingConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLoggingConfigurationCommandError - */ -const de_GetLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivschat#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivschat#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRoomCommand */ @@ -963,7 +665,7 @@ export const de_GetRoomCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRoomCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -985,38 +687,6 @@ export const de_GetRoomCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRoomCommandError - */ -const de_GetRoomCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivschat#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivschat#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListLoggingConfigurationsCommand */ @@ -1025,7 +695,7 @@ export const de_ListLoggingConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLoggingConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1039,35 +709,6 @@ export const de_ListLoggingConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListLoggingConfigurationsCommandError - */ -const de_ListLoggingConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivschat#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRoomsCommand */ @@ -1076,7 +717,7 @@ export const de_ListRoomsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRoomsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1090,38 +731,6 @@ export const de_ListRoomsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRoomsCommandError - */ -const de_ListRoomsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivschat#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivschat#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1130,7 +739,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1143,38 +752,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ivschat#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivschat#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SendEventCommand */ @@ -1183,7 +760,7 @@ export const de_SendEventCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendEventCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1196,44 +773,6 @@ export const de_SendEventCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SendEventCommandError - */ -const de_SendEventCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivschat#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivschat#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivschat#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ivschat#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1242,7 +781,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1251,38 +790,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ivschat#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivschat#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1291,7 +798,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1300,38 +807,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ivschat#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivschat#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLoggingConfigurationCommand */ @@ -1340,7 +815,7 @@ export const de_UpdateLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1360,44 +835,6 @@ export const de_UpdateLoggingConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLoggingConfigurationCommandError - */ -const de_UpdateLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ivschat#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ivschat#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "PendingVerification": - case "com.amazonaws.ivschat#PendingVerification": - throw await de_PendingVerificationRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ivschat#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ivschat#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRoomCommand */ @@ -1406,7 +843,7 @@ export const de_UpdateRoomCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRoomCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1429,12 +866,9 @@ export const de_UpdateRoomCommand = async ( }; /** - * deserializeAws_restJson1UpdateRoomCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateRoomCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1453,13 +887,25 @@ const de_UpdateRoomCommandError = async ( case "ValidationException": case "com.amazonaws.ivschat#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.ivschat#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.ivschat#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.ivschat#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.ivschat#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-kafka/src/protocols/Aws_restJson1.ts b/clients/client-kafka/src/protocols/Aws_restJson1.ts index 390accdf05bb..ef38bfec3471 100644 --- a/clients/client-kafka/src/protocols/Aws_restJson1.ts +++ b/clients/client-kafka/src/protocols/Aws_restJson1.ts @@ -1345,7 +1345,7 @@ export const de_BatchAssociateScramSecretCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchAssociateScramSecretCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1359,50 +1359,6 @@ export const de_BatchAssociateScramSecretCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchAssociateScramSecretCommandError - */ -const de_BatchAssociateScramSecretCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDisassociateScramSecretCommand */ @@ -1411,7 +1367,7 @@ export const de_BatchDisassociateScramSecretCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDisassociateScramSecretCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1425,50 +1381,6 @@ export const de_BatchDisassociateScramSecretCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDisassociateScramSecretCommandError - */ -const de_BatchDisassociateScramSecretCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateClusterCommand */ @@ -1477,7 +1389,7 @@ export const de_CreateClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1492,50 +1404,6 @@ export const de_CreateClusterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateClusterCommandError - */ -const de_CreateClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kafka#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateClusterV2Command */ @@ -1544,7 +1412,7 @@ export const de_CreateClusterV2Command = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateClusterV2CommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1560,50 +1428,6 @@ export const de_CreateClusterV2Command = async ( return contents; }; -/** - * deserializeAws_restJson1CreateClusterV2CommandError - */ -const de_CreateClusterV2CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kafka#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConfigurationCommand */ @@ -1612,7 +1436,7 @@ export const de_CreateConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1629,50 +1453,6 @@ export const de_CreateConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConfigurationCommandError - */ -const de_CreateConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kafka#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateReplicatorCommand */ @@ -1681,7 +1461,7 @@ export const de_CreateReplicatorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateReplicatorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1696,53 +1476,6 @@ export const de_CreateReplicatorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateReplicatorCommandError - */ -const de_CreateReplicatorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kafka#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateVpcConnectionCommand */ @@ -1751,7 +1484,7 @@ export const de_CreateVpcConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateVpcConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1772,55 +1505,14 @@ export const de_CreateVpcConnectionCommand = async ( }; /** - * deserializeAws_restJson1CreateVpcConnectionCommandError + * deserializeAws_restJson1DeleteClusterCommand */ -const de_CreateVpcConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteClusterCommand - */ -export const de_DeleteClusterCommand = async ( +export const de_DeleteClusterCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1834,41 +1526,6 @@ export const de_DeleteClusterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteClusterCommandError - */ -const de_DeleteClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteClusterPolicyCommand */ @@ -1877,7 +1534,7 @@ export const de_DeleteClusterPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteClusterPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1886,41 +1543,6 @@ export const de_DeleteClusterPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteClusterPolicyCommandError - */ -const de_DeleteClusterPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteConfigurationCommand */ @@ -1929,7 +1551,7 @@ export const de_DeleteConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1943,41 +1565,6 @@ export const de_DeleteConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteConfigurationCommandError - */ -const de_DeleteConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteReplicatorCommand */ @@ -1986,7 +1573,7 @@ export const de_DeleteReplicatorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteReplicatorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2000,50 +1587,6 @@ export const de_DeleteReplicatorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteReplicatorCommandError - */ -const de_DeleteReplicatorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteVpcConnectionCommand */ @@ -2052,7 +1595,7 @@ export const de_DeleteVpcConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteVpcConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2066,41 +1609,6 @@ export const de_DeleteVpcConnectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteVpcConnectionCommandError - */ -const de_DeleteVpcConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeClusterCommand */ @@ -2109,7 +1617,7 @@ export const de_DescribeClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2123,176 +1631,56 @@ export const de_DescribeClusterCommand = async ( }; /** - * deserializeAws_restJson1DescribeClusterCommandError + * deserializeAws_restJson1DescribeClusterOperationCommand */ -const de_DescribeClusterCommandError = async ( +export const de_DescribeClusterOperationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ClusterOperationInfo: [, (_) => de_ClusterOperationInfo(_, context), `clusterOperationInfo`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeClusterOperationCommand + * deserializeAws_restJson1DescribeClusterOperationV2Command */ -export const de_DescribeClusterOperationCommand = async ( +export const de_DescribeClusterOperationV2Command = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeClusterOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ClusterOperationInfo: [, (_) => de_ClusterOperationInfo(_, context), `clusterOperationInfo`], + ClusterOperationInfo: [, (_) => de_ClusterOperationV2(_, context), `clusterOperationInfo`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeClusterOperationCommandError + * deserializeAws_restJson1DescribeClusterV2Command */ -const de_DescribeClusterOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeClusterOperationV2Command - */ -export const de_DescribeClusterOperationV2Command = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeClusterOperationV2CommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ClusterOperationInfo: [, (_) => de_ClusterOperationV2(_, context), `clusterOperationInfo`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeClusterOperationV2CommandError - */ -const de_DescribeClusterOperationV2CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeClusterV2Command - */ -export const de_DescribeClusterV2Command = async ( +export const de_DescribeClusterV2Command = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeClusterV2CommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2305,44 +1693,6 @@ export const de_DescribeClusterV2Command = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeClusterV2CommandError - */ -const de_DescribeClusterV2CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeConfigurationCommand */ @@ -2351,7 +1701,7 @@ export const de_DescribeConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2370,47 +1720,6 @@ export const de_DescribeConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeConfigurationCommandError - */ -const de_DescribeConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeConfigurationRevisionCommand */ @@ -2419,7 +1728,7 @@ export const de_DescribeConfigurationRevisionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeConfigurationRevisionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2436,47 +1745,6 @@ export const de_DescribeConfigurationRevisionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeConfigurationRevisionCommandError - */ -const de_DescribeConfigurationRevisionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeReplicatorCommand */ @@ -2485,7 +1753,7 @@ export const de_DescribeReplicatorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeReplicatorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2510,50 +1778,6 @@ export const de_DescribeReplicatorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeReplicatorCommandError - */ -const de_DescribeReplicatorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeVpcConnectionCommand */ @@ -2562,7 +1786,7 @@ export const de_DescribeVpcConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeVpcConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2584,55 +1808,14 @@ export const de_DescribeVpcConnectionCommand = async ( }; /** - * deserializeAws_restJson1DescribeVpcConnectionCommandError + * deserializeAws_restJson1GetBootstrapBrokersCommand */ -const de_DescribeVpcConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetBootstrapBrokersCommand - */ -export const de_GetBootstrapBrokersCommand = async ( +export const de_GetBootstrapBrokersCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBootstrapBrokersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2654,44 +1837,6 @@ export const de_GetBootstrapBrokersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBootstrapBrokersCommandError - */ -const de_GetBootstrapBrokersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kafka#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetClusterPolicyCommand */ @@ -2700,7 +1845,7 @@ export const de_GetClusterPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetClusterPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2714,41 +1859,6 @@ export const de_GetClusterPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetClusterPolicyCommandError - */ -const de_GetClusterPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCompatibleKafkaVersionsCommand */ @@ -2757,7 +1867,7 @@ export const de_GetCompatibleKafkaVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCompatibleKafkaVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2770,50 +1880,6 @@ export const de_GetCompatibleKafkaVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCompatibleKafkaVersionsCommandError - */ -const de_GetCompatibleKafkaVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListClientVpcConnectionsCommand */ @@ -2822,7 +1888,7 @@ export const de_ListClientVpcConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListClientVpcConnectionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2836,44 +1902,6 @@ export const de_ListClientVpcConnectionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListClientVpcConnectionsCommandError - */ -const de_ListClientVpcConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListClusterOperationsCommand */ @@ -2882,7 +1910,7 @@ export const de_ListClusterOperationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListClusterOperationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2896,41 +1924,6 @@ export const de_ListClusterOperationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListClusterOperationsCommandError - */ -const de_ListClusterOperationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListClusterOperationsV2Command */ @@ -2939,7 +1932,7 @@ export const de_ListClusterOperationsV2Command = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListClusterOperationsV2CommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2953,50 +1946,6 @@ export const de_ListClusterOperationsV2Command = async ( return contents; }; -/** - * deserializeAws_restJson1ListClusterOperationsV2CommandError - */ -const de_ListClusterOperationsV2CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListClustersCommand */ @@ -3005,7 +1954,7 @@ export const de_ListClustersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListClustersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3020,49 +1969,14 @@ export const de_ListClustersCommand = async ( }; /** - * deserializeAws_restJson1ListClustersCommandError + * deserializeAws_restJson1ListClustersV2Command */ -const de_ListClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListClustersV2Command - */ -export const de_ListClustersV2Command = async ( +export const de_ListClustersV2Command = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListClustersV2CommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3076,41 +1990,6 @@ export const de_ListClustersV2Command = async ( return contents; }; -/** - * deserializeAws_restJson1ListClustersV2CommandError - */ -const de_ListClustersV2CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListConfigurationRevisionsCommand */ @@ -3119,7 +1998,7 @@ export const de_ListConfigurationRevisionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConfigurationRevisionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3133,47 +2012,6 @@ export const de_ListConfigurationRevisionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListConfigurationRevisionsCommandError - */ -const de_ListConfigurationRevisionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListConfigurationsCommand */ @@ -3182,7 +2020,7 @@ export const de_ListConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3196,44 +2034,6 @@ export const de_ListConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListConfigurationsCommandError - */ -const de_ListConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListKafkaVersionsCommand */ @@ -3242,7 +2042,7 @@ export const de_ListKafkaVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKafkaVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3256,41 +2056,6 @@ export const de_ListKafkaVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListKafkaVersionsCommandError - */ -const de_ListKafkaVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListNodesCommand */ @@ -3299,7 +2064,7 @@ export const de_ListNodesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNodesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3313,41 +2078,6 @@ export const de_ListNodesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListNodesCommandError - */ -const de_ListNodesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListReplicatorsCommand */ @@ -3356,7 +2086,7 @@ export const de_ListReplicatorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReplicatorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3370,50 +2100,6 @@ export const de_ListReplicatorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListReplicatorsCommandError - */ -const de_ListReplicatorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListScramSecretsCommand */ @@ -3422,7 +2108,7 @@ export const de_ListScramSecretsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListScramSecretsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3437,58 +2123,14 @@ export const de_ListScramSecretsCommand = async ( }; /** - * deserializeAws_restJson1ListScramSecretsCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListScramSecretsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3501,38 +2143,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListVpcConnectionsCommand */ @@ -3541,7 +2151,7 @@ export const de_ListVpcConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVpcConnectionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3555,44 +2165,6 @@ export const de_ListVpcConnectionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListVpcConnectionsCommandError - */ -const de_ListVpcConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutClusterPolicyCommand */ @@ -3601,7 +2173,7 @@ export const de_PutClusterPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutClusterPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3614,38 +2186,6 @@ export const de_PutClusterPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutClusterPolicyCommandError - */ -const de_PutClusterPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RebootBrokerCommand */ @@ -3654,7 +2194,7 @@ export const de_RebootBrokerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RebootBrokerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3668,50 +2208,6 @@ export const de_RebootBrokerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RebootBrokerCommandError - */ -const de_RebootBrokerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RejectClientVpcConnectionCommand */ @@ -3720,7 +2216,7 @@ export const de_RejectClientVpcConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RejectClientVpcConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3729,44 +2225,6 @@ export const de_RejectClientVpcConnectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RejectClientVpcConnectionCommandError - */ -const de_RejectClientVpcConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -3775,7 +2233,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3784,38 +2242,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -3824,7 +2250,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3833,38 +2259,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBrokerCountCommand */ @@ -3873,7 +2267,7 @@ export const de_UpdateBrokerCountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBrokerCountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3887,44 +2281,6 @@ export const de_UpdateBrokerCountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateBrokerCountCommandError - */ -const de_UpdateBrokerCountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBrokerStorageCommand */ @@ -3933,7 +2289,7 @@ export const de_UpdateBrokerStorageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBrokerStorageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3947,44 +2303,6 @@ export const de_UpdateBrokerStorageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateBrokerStorageCommandError - */ -const de_UpdateBrokerStorageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBrokerTypeCommand */ @@ -3993,136 +2311,29 @@ export const de_UpdateBrokerTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBrokerTypeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ClusterArn: [, __expectString, `clusterArn`], - ClusterOperationArn: [, __expectString, `clusterOperationArn`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateBrokerTypeCommandError - */ -const de_UpdateBrokerTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateClusterConfigurationCommand - */ -export const de_UpdateClusterConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateClusterConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ClusterArn: [, __expectString, `clusterArn`], - ClusterOperationArn: [, __expectString, `clusterOperationArn`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateClusterConfigurationCommandError - */ -const de_UpdateClusterConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + ClusterArn: [, __expectString, `clusterArn`], + ClusterOperationArn: [, __expectString, `clusterOperationArn`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateClusterKafkaVersionCommand + * deserializeAws_restJson1UpdateClusterConfigurationCommand */ -export const de_UpdateClusterKafkaVersionCommand = async ( +export const de_UpdateClusterConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateClusterKafkaVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4137,47 +2348,25 @@ export const de_UpdateClusterKafkaVersionCommand = async ( }; /** - * deserializeAws_restJson1UpdateClusterKafkaVersionCommandError + * deserializeAws_restJson1UpdateClusterKafkaVersionCommand */ -const de_UpdateClusterKafkaVersionCommandError = async ( +export const de_UpdateClusterKafkaVersionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ClusterArn: [, __expectString, `clusterArn`], + ClusterOperationArn: [, __expectString, `clusterOperationArn`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4188,7 +2377,7 @@ export const de_UpdateConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4202,47 +2391,6 @@ export const de_UpdateConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateConfigurationCommandError - */ -const de_UpdateConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConnectivityCommand */ @@ -4251,7 +2399,7 @@ export const de_UpdateConnectivityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConnectivityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4265,47 +2413,6 @@ export const de_UpdateConnectivityCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateConnectivityCommandError - */ -const de_UpdateConnectivityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMonitoringCommand */ @@ -4314,7 +2421,7 @@ export const de_UpdateMonitoringCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMonitoringCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4328,44 +2435,6 @@ export const de_UpdateMonitoringCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateMonitoringCommandError - */ -const de_UpdateMonitoringCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateReplicationInfoCommand */ @@ -4374,7 +2443,7 @@ export const de_UpdateReplicationInfoCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateReplicationInfoCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4388,50 +2457,6 @@ export const de_UpdateReplicationInfoCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateReplicationInfoCommandError - */ -const de_UpdateReplicationInfoCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSecurityCommand */ @@ -4440,7 +2465,7 @@ export const de_UpdateSecurityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSecurityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4454,50 +2479,6 @@ export const de_UpdateSecurityCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSecurityCommandError - */ -const de_UpdateSecurityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafka#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafka#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafka#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafka#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafka#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafka#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafka#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateStorageCommand */ @@ -4506,7 +2487,7 @@ export const de_UpdateStorageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateStorageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4521,12 +2502,9 @@ export const de_UpdateStorageCommand = async ( }; /** - * deserializeAws_restJson1UpdateStorageCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateStorageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4554,13 +2532,16 @@ const de_UpdateStorageCommandError = async ( case "UnauthorizedException": case "com.amazonaws.kafka#UnauthorizedException": throw await de_UnauthorizedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.kafka#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts b/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts index 2b69a054bf5a..6fdb86532052 100644 --- a/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts +++ b/clients/client-kafkaconnect/src/protocols/Aws_restJson1.ts @@ -346,7 +346,7 @@ export const de_CreateConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -361,53 +361,6 @@ export const de_CreateConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConnectorCommandError - */ -const de_CreateConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafkaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kafkaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafkaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafkaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafkaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafkaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafkaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafkaconnect#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCustomPluginCommand */ @@ -416,7 +369,7 @@ export const de_CreateCustomPluginCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCustomPluginCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -432,53 +385,6 @@ export const de_CreateCustomPluginCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCustomPluginCommandError - */ -const de_CreateCustomPluginCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafkaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kafkaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafkaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafkaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafkaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafkaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafkaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafkaconnect#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWorkerConfigurationCommand */ @@ -487,7 +393,7 @@ export const de_CreateWorkerConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWorkerConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -503,53 +409,6 @@ export const de_CreateWorkerConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWorkerConfigurationCommandError - */ -const de_CreateWorkerConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafkaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kafkaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafkaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafkaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafkaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafkaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafkaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafkaconnect#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteConnectorCommand */ @@ -558,7 +417,7 @@ export const de_DeleteConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -572,50 +431,6 @@ export const de_DeleteConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteConnectorCommandError - */ -const de_DeleteConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafkaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafkaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafkaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafkaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafkaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafkaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafkaconnect#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteCustomPluginCommand */ @@ -624,7 +439,7 @@ export const de_DeleteCustomPluginCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCustomPluginCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -638,50 +453,6 @@ export const de_DeleteCustomPluginCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteCustomPluginCommandError - */ -const de_DeleteCustomPluginCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafkaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafkaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafkaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafkaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafkaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafkaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafkaconnect#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeConnectorCommand */ @@ -690,7 +461,7 @@ export const de_DescribeConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -719,50 +490,6 @@ export const de_DescribeConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeConnectorCommandError - */ -const de_DescribeConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafkaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafkaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafkaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafkaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafkaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafkaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafkaconnect#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeCustomPluginCommand */ @@ -771,7 +498,7 @@ export const de_DescribeCustomPluginCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeCustomPluginCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -790,50 +517,6 @@ export const de_DescribeCustomPluginCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeCustomPluginCommandError - */ -const de_DescribeCustomPluginCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafkaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafkaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafkaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafkaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafkaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafkaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafkaconnect#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeWorkerConfigurationCommand */ @@ -842,7 +525,7 @@ export const de_DescribeWorkerConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeWorkerConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -859,50 +542,6 @@ export const de_DescribeWorkerConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeWorkerConfigurationCommandError - */ -const de_DescribeWorkerConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafkaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafkaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafkaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafkaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafkaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafkaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafkaconnect#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListConnectorsCommand */ @@ -911,7 +550,7 @@ export const de_ListConnectorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConnectorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -925,50 +564,6 @@ export const de_ListConnectorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListConnectorsCommandError - */ -const de_ListConnectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafkaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafkaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafkaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafkaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafkaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafkaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafkaconnect#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCustomPluginsCommand */ @@ -977,7 +572,7 @@ export const de_ListCustomPluginsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCustomPluginsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -991,50 +586,6 @@ export const de_ListCustomPluginsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCustomPluginsCommandError - */ -const de_ListCustomPluginsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafkaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafkaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafkaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafkaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafkaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafkaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafkaconnect#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWorkerConfigurationsCommand */ @@ -1043,7 +594,7 @@ export const de_ListWorkerConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkerConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1057,50 +608,6 @@ export const de_ListWorkerConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListWorkerConfigurationsCommandError - */ -const de_ListWorkerConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.kafkaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.kafkaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.kafkaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kafkaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kafkaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.kafkaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.kafkaconnect#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConnectorCommand */ @@ -1109,7 +616,7 @@ export const de_UpdateConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1124,12 +631,9 @@ export const de_UpdateConnectorCommand = async ( }; /** - * deserializeAws_restJson1UpdateConnectorCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1139,6 +643,9 @@ const de_UpdateConnectorCommandError = async ( case "BadRequestException": case "com.amazonaws.kafkaconnect#BadRequestException": throw await de_BadRequestExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.kafkaconnect#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "ForbiddenException": case "com.amazonaws.kafkaconnect#ForbiddenException": throw await de_ForbiddenExceptionRes(parsedOutput, context); @@ -1163,7 +670,7 @@ const de_UpdateConnectorCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts b/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts index 4a14ce55fc09..c597fb16e35f 100644 --- a/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts +++ b/clients/client-kendra-ranking/src/protocols/Aws_json1_0.ts @@ -202,7 +202,7 @@ export const de_CreateRescoreExecutionPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRescoreExecutionPlanCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -214,47 +214,6 @@ export const de_CreateRescoreExecutionPlanCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateRescoreExecutionPlanCommandError - */ -const de_CreateRescoreExecutionPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendraranking#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendraranking#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendraranking#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.kendraranking#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendraranking#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendraranking#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteRescoreExecutionPlanCommand */ @@ -263,7 +222,7 @@ export const de_DeleteRescoreExecutionPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRescoreExecutionPlanCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteRescoreExecutionPlanCommandOutput = { @@ -272,47 +231,6 @@ export const de_DeleteRescoreExecutionPlanCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteRescoreExecutionPlanCommandError - */ -const de_DeleteRescoreExecutionPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendraranking#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendraranking#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendraranking#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendraranking#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendraranking#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendraranking#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeRescoreExecutionPlanCommand */ @@ -321,7 +239,7 @@ export const de_DescribeRescoreExecutionPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRescoreExecutionPlanCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -333,44 +251,6 @@ export const de_DescribeRescoreExecutionPlanCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeRescoreExecutionPlanCommandError - */ -const de_DescribeRescoreExecutionPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendraranking#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendraranking#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendraranking#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendraranking#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendraranking#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListRescoreExecutionPlansCommand */ @@ -379,7 +259,7 @@ export const de_ListRescoreExecutionPlansCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRescoreExecutionPlansCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -391,41 +271,6 @@ export const de_ListRescoreExecutionPlansCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListRescoreExecutionPlansCommandError - */ -const de_ListRescoreExecutionPlansCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendraranking#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendraranking#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendraranking#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendraranking#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListTagsForResourceCommand */ @@ -434,7 +279,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -446,44 +291,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendraranking#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendraranking#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.kendraranking#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendraranking#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendraranking#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0RescoreCommand */ @@ -492,7 +299,7 @@ export const de_RescoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RescoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -504,47 +311,6 @@ export const de_RescoreCommand = async ( return response; }; -/** - * deserializeAws_json1_0RescoreCommandError - */ -const de_RescoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendraranking#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendraranking#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendraranking#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendraranking#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendraranking#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendraranking#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TagResourceCommand */ @@ -553,7 +319,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -565,44 +331,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendraranking#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendraranking#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.kendraranking#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendraranking#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendraranking#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UntagResourceCommand */ @@ -611,7 +339,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -623,44 +351,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendraranking#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendraranking#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.kendraranking#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendraranking#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendraranking#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateRescoreExecutionPlanCommand */ @@ -669,7 +359,7 @@ export const de_UpdateRescoreExecutionPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRescoreExecutionPlanCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateRescoreExecutionPlanCommandOutput = { @@ -679,12 +369,9 @@ export const de_UpdateRescoreExecutionPlanCommand = async ( }; /** - * deserializeAws_json1_0UpdateRescoreExecutionPlanCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateRescoreExecutionPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -700,9 +387,6 @@ const de_UpdateRescoreExecutionPlanCommandError = async ( case "InternalServerException": case "com.amazonaws.kendraranking#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendraranking#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ServiceQuotaExceededException": case "com.amazonaws.kendraranking#ServiceQuotaExceededException": throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); @@ -712,13 +396,19 @@ const de_UpdateRescoreExecutionPlanCommandError = async ( case "ValidationException": case "com.amazonaws.kendraranking#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.kendraranking#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ResourceUnavailableException": + case "com.amazonaws.kendraranking#ResourceUnavailableException": + throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-kendra/src/protocols/Aws_json1_1.ts b/clients/client-kendra/src/protocols/Aws_json1_1.ts index d64034b158cf..9caed4979577 100644 --- a/clients/client-kendra/src/protocols/Aws_json1_1.ts +++ b/clients/client-kendra/src/protocols/Aws_json1_1.ts @@ -1284,7 +1284,7 @@ export const de_AssociateEntitiesToExperienceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateEntitiesToExperienceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1296,47 +1296,6 @@ export const de_AssociateEntitiesToExperienceCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateEntitiesToExperienceCommandError - */ -const de_AssociateEntitiesToExperienceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistException": - case "com.amazonaws.kendra#ResourceAlreadyExistException": - throw await de_ResourceAlreadyExistExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociatePersonasToEntitiesCommand */ @@ -1345,7 +1304,7 @@ export const de_AssociatePersonasToEntitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociatePersonasToEntitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1357,47 +1316,6 @@ export const de_AssociatePersonasToEntitiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociatePersonasToEntitiesCommandError - */ -const de_AssociatePersonasToEntitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistException": - case "com.amazonaws.kendra#ResourceAlreadyExistException": - throw await de_ResourceAlreadyExistExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDeleteDocumentCommand */ @@ -1406,7 +1324,7 @@ export const de_BatchDeleteDocumentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDeleteDocumentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1418,47 +1336,6 @@ export const de_BatchDeleteDocumentCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDeleteDocumentCommandError - */ -const de_BatchDeleteDocumentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDeleteFeaturedResultsSetCommand */ @@ -1467,7 +1344,7 @@ export const de_BatchDeleteFeaturedResultsSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDeleteFeaturedResultsSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1479,44 +1356,6 @@ export const de_BatchDeleteFeaturedResultsSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDeleteFeaturedResultsSetCommandError - */ -const de_BatchDeleteFeaturedResultsSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchGetDocumentStatusCommand */ @@ -1525,7 +1364,7 @@ export const de_BatchGetDocumentStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetDocumentStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1537,47 +1376,6 @@ export const de_BatchGetDocumentStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetDocumentStatusCommandError - */ -const de_BatchGetDocumentStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchPutDocumentCommand */ @@ -1586,7 +1384,7 @@ export const de_BatchPutDocumentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchPutDocumentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1599,121 +1397,76 @@ export const de_BatchPutDocumentCommand = async ( }; /** - * deserializeAws_json1_1BatchPutDocumentCommandError + * deserializeAws_json1_1ClearQuerySuggestionsCommand */ -const de_BatchPutDocumentCommandError = async ( +export const de_ClearQuerySuggestionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.kendra#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: ClearQuerySuggestionsCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ClearQuerySuggestionsCommand + * deserializeAws_json1_1CreateAccessControlConfigurationCommand */ -export const de_ClearQuerySuggestionsCommand = async ( +export const de_CreateAccessControlConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ClearQuerySuggestionsCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: ClearQuerySuggestionsCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateAccessControlConfigurationCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1ClearQuerySuggestionsCommandError + * deserializeAws_json1_1CreateDataSourceCommand */ -const de_ClearQuerySuggestionsCommandError = async ( +export const de_CreateDataSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateDataSourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateAccessControlConfigurationCommand + * deserializeAws_json1_1CreateExperienceCommand */ -export const de_CreateAccessControlConfigurationCommand = async ( +export const de_CreateExperienceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateAccessControlConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateAccessControlConfigurationCommandOutput = { + const response: CreateExperienceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1721,63 +1474,39 @@ export const de_CreateAccessControlConfigurationCommand = async ( }; /** - * deserializeAws_json1_1CreateAccessControlConfigurationCommandError + * deserializeAws_json1_1CreateFaqCommand */ -const de_CreateAccessControlConfigurationCommandError = async ( +export const de_CreateFaqCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.kendra#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateFaqCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateDataSourceCommand + * deserializeAws_json1_1CreateFeaturedResultsSetCommand */ -export const de_CreateDataSourceCommand = async ( +export const de_CreateFeaturedResultsSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDataSourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateDataSourceCommandOutput = { + const response: CreateFeaturedResultsSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1785,66 +1514,39 @@ export const de_CreateDataSourceCommand = async ( }; /** - * deserializeAws_json1_1CreateDataSourceCommandError + * deserializeAws_json1_1CreateIndexCommand */ -const de_CreateDataSourceCommandError = async ( +export const de_CreateIndexCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistException": - case "com.amazonaws.kendra#ResourceAlreadyExistException": - throw await de_ResourceAlreadyExistExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.kendra#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateIndexCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateExperienceCommand + * deserializeAws_json1_1CreateQuerySuggestionsBlockListCommand */ -export const de_CreateExperienceCommand = async ( +export const de_CreateQuerySuggestionsBlockListCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateExperienceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateExperienceCommandOutput = { + const response: CreateQuerySuggestionsBlockListCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1852,63 +1554,39 @@ export const de_CreateExperienceCommand = async ( }; /** - * deserializeAws_json1_1CreateExperienceCommandError + * deserializeAws_json1_1CreateThesaurusCommand */ -const de_CreateExperienceCommandError = async ( +export const de_CreateThesaurusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.kendra#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateThesaurusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateFaqCommand + * deserializeAws_json1_1DeleteAccessControlConfigurationCommand */ -export const de_CreateFaqCommand = async ( +export const de_DeleteAccessControlConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateFaqCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateFaqCommandOutput = { + const response: DeleteAccessControlConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1916,63 +1594,36 @@ export const de_CreateFaqCommand = async ( }; /** - * deserializeAws_json1_1CreateFaqCommandError + * deserializeAws_json1_1DeleteDataSourceCommand */ -const de_CreateFaqCommandError = async ( +export const de_DeleteDataSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.kendra#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteDataSourceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1CreateFeaturedResultsSetCommand + * deserializeAws_json1_1DeleteExperienceCommand */ -export const de_CreateFeaturedResultsSetCommand = async ( +export const de_DeleteExperienceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateFeaturedResultsSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateFeaturedResultsSetCommandOutput = { + const response: DeleteExperienceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1980,1891 +1631,104 @@ export const de_CreateFeaturedResultsSetCommand = async ( }; /** - * deserializeAws_json1_1CreateFeaturedResultsSetCommandError + * deserializeAws_json1_1DeleteFaqCommand */ -const de_CreateFeaturedResultsSetCommandError = async ( +export const de_DeleteFaqCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "FeaturedResultsConflictException": - case "com.amazonaws.kendra#FeaturedResultsConflictException": - throw await de_FeaturedResultsConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateIndexCommand - */ -export const de_CreateIndexCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateIndexCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateIndexCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateIndexCommandError - */ -const de_CreateIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistException": - case "com.amazonaws.kendra#ResourceAlreadyExistException": - throw await de_ResourceAlreadyExistExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.kendra#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateQuerySuggestionsBlockListCommand - */ -export const de_CreateQuerySuggestionsBlockListCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateQuerySuggestionsBlockListCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateQuerySuggestionsBlockListCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateQuerySuggestionsBlockListCommandError - */ -const de_CreateQuerySuggestionsBlockListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.kendra#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateThesaurusCommand - */ -export const de_CreateThesaurusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateThesaurusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateThesaurusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateThesaurusCommandError - */ -const de_CreateThesaurusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.kendra#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteAccessControlConfigurationCommand - */ -export const de_DeleteAccessControlConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteAccessControlConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteAccessControlConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteAccessControlConfigurationCommandError - */ -const de_DeleteAccessControlConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDataSourceCommand - */ -export const de_DeleteDataSourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDataSourceCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteDataSourceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDataSourceCommandError - */ -const de_DeleteDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteExperienceCommand - */ -export const de_DeleteExperienceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteExperienceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteExperienceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteExperienceCommandError - */ -const de_DeleteExperienceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteFaqCommand - */ -export const de_DeleteFaqCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteFaqCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteFaqCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteFaqCommandError - */ -const de_DeleteFaqCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteIndexCommand - */ -export const de_DeleteIndexCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteIndexCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteIndexCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteIndexCommandError - */ -const de_DeleteIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeletePrincipalMappingCommand - */ -export const de_DeletePrincipalMappingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeletePrincipalMappingCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeletePrincipalMappingCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeletePrincipalMappingCommandError - */ -const de_DeletePrincipalMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteQuerySuggestionsBlockListCommand - */ -export const de_DeleteQuerySuggestionsBlockListCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteQuerySuggestionsBlockListCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteQuerySuggestionsBlockListCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteQuerySuggestionsBlockListCommandError - */ -const de_DeleteQuerySuggestionsBlockListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteThesaurusCommand - */ -export const de_DeleteThesaurusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteThesaurusCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteThesaurusCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteThesaurusCommandError - */ -const de_DeleteThesaurusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAccessControlConfigurationCommand - */ -export const de_DescribeAccessControlConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAccessControlConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeAccessControlConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAccessControlConfigurationCommandError - */ -const de_DescribeAccessControlConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDataSourceCommand - */ -export const de_DescribeDataSourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDataSourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeDataSourceResponse(data, context); - const response: DescribeDataSourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeDataSourceCommandError - */ -const de_DescribeDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeExperienceCommand - */ -export const de_DescribeExperienceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeExperienceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeExperienceResponse(data, context); - const response: DescribeExperienceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeExperienceCommandError - */ -const de_DescribeExperienceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFaqCommand - */ -export const de_DescribeFaqCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFaqCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeFaqResponse(data, context); - const response: DescribeFaqCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFaqCommandError - */ -const de_DescribeFaqCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFeaturedResultsSetCommand - */ -export const de_DescribeFeaturedResultsSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFeaturedResultsSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeFeaturedResultsSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFeaturedResultsSetCommandError - */ -const de_DescribeFeaturedResultsSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeIndexCommand - */ -export const de_DescribeIndexCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeIndexCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeIndexResponse(data, context); - const response: DescribeIndexCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeIndexCommandError - */ -const de_DescribeIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribePrincipalMappingCommand - */ -export const de_DescribePrincipalMappingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribePrincipalMappingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribePrincipalMappingResponse(data, context); - const response: DescribePrincipalMappingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribePrincipalMappingCommandError - */ -const de_DescribePrincipalMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeQuerySuggestionsBlockListCommand - */ -export const de_DescribeQuerySuggestionsBlockListCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeQuerySuggestionsBlockListCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeQuerySuggestionsBlockListResponse(data, context); - const response: DescribeQuerySuggestionsBlockListCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeQuerySuggestionsBlockListCommandError - */ -const de_DescribeQuerySuggestionsBlockListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeQuerySuggestionsConfigCommand - */ -export const de_DescribeQuerySuggestionsConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeQuerySuggestionsConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeQuerySuggestionsConfigResponse(data, context); - const response: DescribeQuerySuggestionsConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeQuerySuggestionsConfigCommandError - */ -const de_DescribeQuerySuggestionsConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeThesaurusCommand - */ -export const de_DescribeThesaurusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeThesaurusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeThesaurusResponse(data, context); - const response: DescribeThesaurusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeThesaurusCommandError - */ -const de_DescribeThesaurusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociateEntitiesFromExperienceCommand - */ -export const de_DisassociateEntitiesFromExperienceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisassociateEntitiesFromExperienceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DisassociateEntitiesFromExperienceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisassociateEntitiesFromExperienceCommandError - */ -const de_DisassociateEntitiesFromExperienceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociatePersonasFromEntitiesCommand - */ -export const de_DisassociatePersonasFromEntitiesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisassociatePersonasFromEntitiesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DisassociatePersonasFromEntitiesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisassociatePersonasFromEntitiesCommandError - */ -const de_DisassociatePersonasFromEntitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetQuerySuggestionsCommand - */ -export const de_GetQuerySuggestionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetQuerySuggestionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetQuerySuggestionsResponse(data, context); - const response: GetQuerySuggestionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetQuerySuggestionsCommandError - */ -const de_GetQuerySuggestionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.kendra#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSnapshotsCommand - */ -export const de_GetSnapshotsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSnapshotsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetSnapshotsResponse(data, context); - const response: GetSnapshotsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSnapshotsCommandError - */ -const de_GetSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kendra#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAccessControlConfigurationsCommand - */ -export const de_ListAccessControlConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAccessControlConfigurationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListAccessControlConfigurationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAccessControlConfigurationsCommandError - */ -const de_ListAccessControlConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDataSourcesCommand - */ -export const de_ListDataSourcesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDataSourcesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDataSourcesResponse(data, context); - const response: ListDataSourcesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDataSourcesCommandError - */ -const de_ListDataSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDataSourceSyncJobsCommand - */ -export const de_ListDataSourceSyncJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDataSourceSyncJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDataSourceSyncJobsResponse(data, context); - const response: ListDataSourceSyncJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDataSourceSyncJobsCommandError - */ -const de_ListDataSourceSyncJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListEntityPersonasCommand - */ -export const de_ListEntityPersonasCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListEntityPersonasCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListEntityPersonasResponse(data, context); - const response: ListEntityPersonasCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListEntityPersonasCommandError - */ -const de_ListEntityPersonasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteFaqCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListExperienceEntitiesCommand + * deserializeAws_json1_1DeleteIndexCommand */ -export const de_ListExperienceEntitiesCommand = async ( +export const de_DeleteIndexCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListExperienceEntitiesCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListExperienceEntitiesCommandOutput = { + await collectBody(output.body, context); + const response: DeleteIndexCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1ListExperienceEntitiesCommandError + * deserializeAws_json1_1DeletePrincipalMappingCommand */ -const de_ListExperienceEntitiesCommandError = async ( +export const de_DeletePrincipalMappingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeletePrincipalMappingCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListExperiencesCommand + * deserializeAws_json1_1DeleteQuerySuggestionsBlockListCommand */ -export const de_ListExperiencesCommand = async ( +export const de_DeleteQuerySuggestionsBlockListCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListExperiencesCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListExperiencesResponse(data, context); - const response: ListExperiencesCommandOutput = { + await collectBody(output.body, context); + const response: DeleteQuerySuggestionsBlockListCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1ListExperiencesCommandError + * deserializeAws_json1_1DeleteThesaurusCommand */ -const de_ListExperiencesCommandError = async ( +export const de_DeleteThesaurusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteThesaurusCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListFaqsCommand + * deserializeAws_json1_1DescribeAccessControlConfigurationCommand */ -export const de_ListFaqsCommand = async ( +export const de_DescribeAccessControlConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListFaqsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListFaqsResponse(data, context); - const response: ListFaqsCommandOutput = { + contents = _json(data); + const response: DescribeAccessControlConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3872,57 +1736,19 @@ export const de_ListFaqsCommand = async ( }; /** - * deserializeAws_json1_1ListFaqsCommandError - */ -const de_ListFaqsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListFeaturedResultsSetsCommand + * deserializeAws_json1_1DescribeDataSourceCommand */ -export const de_ListFeaturedResultsSetsCommand = async ( +export const de_DescribeDataSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListFeaturedResultsSetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListFeaturedResultsSetsCommandOutput = { + contents = de_DescribeDataSourceResponse(data, context); + const response: DescribeDataSourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3930,57 +1756,39 @@ export const de_ListFeaturedResultsSetsCommand = async ( }; /** - * deserializeAws_json1_1ListFeaturedResultsSetsCommandError + * deserializeAws_json1_1DescribeExperienceCommand */ -const de_ListFeaturedResultsSetsCommandError = async ( +export const de_DescribeExperienceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeExperienceResponse(data, context); + const response: DescribeExperienceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListGroupsOlderThanOrderingIdCommand + * deserializeAws_json1_1DescribeFaqCommand */ -export const de_ListGroupsOlderThanOrderingIdCommand = async ( +export const de_DescribeFaqCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListGroupsOlderThanOrderingIdCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListGroupsOlderThanOrderingIdCommandOutput = { + contents = de_DescribeFaqResponse(data, context); + const response: DescribeFaqCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3988,60 +1796,39 @@ export const de_ListGroupsOlderThanOrderingIdCommand = async ( }; /** - * deserializeAws_json1_1ListGroupsOlderThanOrderingIdCommandError + * deserializeAws_json1_1DescribeFeaturedResultsSetCommand */ -const de_ListGroupsOlderThanOrderingIdCommandError = async ( +export const de_DescribeFeaturedResultsSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeFeaturedResultsSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListIndicesCommand + * deserializeAws_json1_1DescribeIndexCommand */ -export const de_ListIndicesCommand = async ( +export const de_DescribeIndexCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListIndicesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListIndicesResponse(data, context); - const response: ListIndicesCommandOutput = { + contents = de_DescribeIndexResponse(data, context); + const response: DescribeIndexCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4049,54 +1836,39 @@ export const de_ListIndicesCommand = async ( }; /** - * deserializeAws_json1_1ListIndicesCommandError + * deserializeAws_json1_1DescribePrincipalMappingCommand */ -const de_ListIndicesCommandError = async ( +export const de_DescribePrincipalMappingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribePrincipalMappingResponse(data, context); + const response: DescribePrincipalMappingCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListQuerySuggestionsBlockListsCommand + * deserializeAws_json1_1DescribeQuerySuggestionsBlockListCommand */ -export const de_ListQuerySuggestionsBlockListsCommand = async ( +export const de_DescribeQuerySuggestionsBlockListCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListQuerySuggestionsBlockListsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListQuerySuggestionsBlockListsResponse(data, context); - const response: ListQuerySuggestionsBlockListsCommandOutput = { + contents = de_DescribeQuerySuggestionsBlockListResponse(data, context); + const response: DescribeQuerySuggestionsBlockListCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4104,57 +1876,39 @@ export const de_ListQuerySuggestionsBlockListsCommand = async ( }; /** - * deserializeAws_json1_1ListQuerySuggestionsBlockListsCommandError + * deserializeAws_json1_1DescribeQuerySuggestionsConfigCommand */ -const de_ListQuerySuggestionsBlockListsCommandError = async ( +export const de_DescribeQuerySuggestionsConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeQuerySuggestionsConfigResponse(data, context); + const response: DescribeQuerySuggestionsConfigCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1DescribeThesaurusCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_DescribeThesaurusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_DescribeThesaurusResponse(data, context); + const response: DescribeThesaurusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4162,57 +1916,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1DisassociateEntitiesFromExperienceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_DisassociateEntitiesFromExperienceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.kendra#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisassociateEntitiesFromExperienceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListThesauriCommand + * deserializeAws_json1_1DisassociatePersonasFromEntitiesCommand */ -export const de_ListThesauriCommand = async ( +export const de_DisassociatePersonasFromEntitiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListThesauriCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListThesauriResponse(data, context); - const response: ListThesauriCommandOutput = { + contents = _json(data); + const response: DisassociatePersonasFromEntitiesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4220,115 +1956,79 @@ export const de_ListThesauriCommand = async ( }; /** - * deserializeAws_json1_1ListThesauriCommandError + * deserializeAws_json1_1GetQuerySuggestionsCommand */ -const de_ListThesauriCommandError = async ( +export const de_GetQuerySuggestionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetQuerySuggestionsResponse(data, context); + const response: GetQuerySuggestionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutPrincipalMappingCommand + * deserializeAws_json1_1GetSnapshotsCommand */ -export const de_PutPrincipalMappingCommand = async ( +export const de_GetSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutPrincipalMappingCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: PutPrincipalMappingCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetSnapshotsResponse(data, context); + const response: GetSnapshotsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1PutPrincipalMappingCommandError + * deserializeAws_json1_1ListAccessControlConfigurationsCommand */ -const de_PutPrincipalMappingCommandError = async ( +export const de_ListAccessControlConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.kendra#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListAccessControlConfigurationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1QueryCommand + * deserializeAws_json1_1ListDataSourcesCommand */ -export const de_QueryCommand = async (output: __HttpResponse, context: __SerdeContext): Promise => { +export const de_ListDataSourcesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { if (output.statusCode >= 300) { - return de_QueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_QueryResult(data, context); - const response: QueryCommandOutput = { + contents = de_ListDataSourcesResponse(data, context); + const response: ListDataSourcesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4336,60 +2036,39 @@ export const de_QueryCommand = async (output: __HttpResponse, context: __SerdeCo }; /** - * deserializeAws_json1_1QueryCommandError + * deserializeAws_json1_1ListDataSourceSyncJobsCommand */ -const de_QueryCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.kendra#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_ListDataSourceSyncJobsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDataSourceSyncJobsResponse(data, context); + const response: ListDataSourceSyncJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RetrieveCommand + * deserializeAws_json1_1ListEntityPersonasCommand */ -export const de_RetrieveCommand = async ( +export const de_ListEntityPersonasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RetrieveCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RetrieveResult(data, context); - const response: RetrieveCommandOutput = { + contents = de_ListEntityPersonasResponse(data, context); + const response: ListEntityPersonasCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4397,63 +2076,39 @@ export const de_RetrieveCommand = async ( }; /** - * deserializeAws_json1_1RetrieveCommandError + * deserializeAws_json1_1ListExperienceEntitiesCommand */ -const de_RetrieveCommandError = async ( +export const de_ListExperienceEntitiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.kendra#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListExperienceEntitiesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartDataSourceSyncJobCommand + * deserializeAws_json1_1ListExperiencesCommand */ -export const de_StartDataSourceSyncJobCommand = async ( +export const de_ListExperiencesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartDataSourceSyncJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartDataSourceSyncJobCommandOutput = { + contents = de_ListExperiencesResponse(data, context); + const response: ListExperiencesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4461,176 +2116,139 @@ export const de_StartDataSourceSyncJobCommand = async ( }; /** - * deserializeAws_json1_1StartDataSourceSyncJobCommandError + * deserializeAws_json1_1ListFaqsCommand */ -const de_StartDataSourceSyncJobCommandError = async ( +export const de_ListFaqsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kendra#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListFaqsResponse(data, context); + const response: ListFaqsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopDataSourceSyncJobCommand + * deserializeAws_json1_1ListFeaturedResultsSetsCommand */ -export const de_StopDataSourceSyncJobCommand = async ( +export const de_ListFeaturedResultsSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopDataSourceSyncJobCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: StopDataSourceSyncJobCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListFeaturedResultsSetsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1StopDataSourceSyncJobCommandError + * deserializeAws_json1_1ListGroupsOlderThanOrderingIdCommand */ -const de_StopDataSourceSyncJobCommandError = async ( +export const de_ListGroupsOlderThanOrderingIdCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListGroupsOlderThanOrderingIdCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1ListIndicesCommand + */ +export const de_ListIndicesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListIndicesResponse(data, context); + const response: ListIndicesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SubmitFeedbackCommand + * deserializeAws_json1_1ListQuerySuggestionsBlockListsCommand */ -export const de_SubmitFeedbackCommand = async ( +export const de_ListQuerySuggestionsBlockListsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SubmitFeedbackCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: SubmitFeedbackCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListQuerySuggestionsBlockListsResponse(data, context); + const response: ListQuerySuggestionsBlockListsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1SubmitFeedbackCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_SubmitFeedbackCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.kendra#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1ListThesauriCommand */ -export const de_TagResourceCommand = async ( +export const de_ListThesauriCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: TagResourceCommandOutput = { + contents = de_ListThesauriResponse(data, context); + const response: ListThesauriCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4638,57 +2256,33 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1PutPrincipalMappingCommand */ -const de_TagResourceCommandError = async ( +export const de_PutPrincipalMappingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.kendra#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: PutPrincipalMappingCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1UntagResourceCommand + * deserializeAws_json1_1QueryCommand */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +export const de_QueryCommand = async (output: __HttpResponse, context: __SerdeContext): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: UntagResourceCommandOutput = { + contents = de_QueryResult(data, context); + const response: QueryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4696,57 +2290,39 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserializeAws_json1_1RetrieveCommand */ -const de_UntagResourceCommandError = async ( +export const de_RetrieveCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.kendra#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RetrieveResult(data, context); + const response: RetrieveCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateAccessControlConfigurationCommand + * deserializeAws_json1_1StartDataSourceSyncJobCommand */ -export const de_UpdateAccessControlConfigurationCommand = async ( +export const de_StartDataSourceSyncJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateAccessControlConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateAccessControlConfigurationCommandOutput = { + const response: StartDataSourceSyncJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4754,163 +2330,131 @@ export const de_UpdateAccessControlConfigurationCommand = async ( }; /** - * deserializeAws_json1_1UpdateAccessControlConfigurationCommandError + * deserializeAws_json1_1StopDataSourceSyncJobCommand */ -const de_UpdateAccessControlConfigurationCommandError = async ( +export const de_StopDataSourceSyncJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.kendra#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: StopDataSourceSyncJobCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1UpdateDataSourceCommand + * deserializeAws_json1_1SubmitFeedbackCommand */ -export const de_UpdateDataSourceCommand = async ( +export const de_SubmitFeedbackCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateDataSourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UpdateDataSourceCommandOutput = { + const response: SubmitFeedbackCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1UpdateDataSourceCommandError + * deserializeAws_json1_1TagResourceCommand */ -const de_UpdateDataSourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1UntagResourceCommand + */ +export const de_UntagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateExperienceCommand + * deserializeAws_json1_1UpdateAccessControlConfigurationCommand */ -export const de_UpdateExperienceCommand = async ( +export const de_UpdateAccessControlConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateAccessControlConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1UpdateDataSourceCommand + */ +export const de_UpdateDataSourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { if (output.statusCode >= 300) { - return de_UpdateExperienceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UpdateExperienceCommandOutput = { + const response: UpdateDataSourceCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1UpdateExperienceCommandError + * deserializeAws_json1_1UpdateExperienceCommand */ -const de_UpdateExperienceCommandError = async ( +export const de_UpdateExperienceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UpdateExperienceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** @@ -4921,7 +2465,7 @@ export const de_UpdateFeaturedResultsSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateFeaturedResultsSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4933,47 +2477,6 @@ export const de_UpdateFeaturedResultsSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateFeaturedResultsSetCommandError - */ -const de_UpdateFeaturedResultsSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "FeaturedResultsConflictException": - case "com.amazonaws.kendra#FeaturedResultsConflictException": - throw await de_FeaturedResultsConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateIndexCommand */ @@ -4982,7 +2485,7 @@ export const de_UpdateIndexCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateIndexCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateIndexCommandOutput = { @@ -4991,50 +2494,6 @@ export const de_UpdateIndexCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateIndexCommandError - */ -const de_UpdateIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.kendra#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateQuerySuggestionsBlockListCommand */ @@ -5043,7 +2502,7 @@ export const de_UpdateQuerySuggestionsBlockListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateQuerySuggestionsBlockListCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateQuerySuggestionsBlockListCommandOutput = { @@ -5052,47 +2511,6 @@ export const de_UpdateQuerySuggestionsBlockListCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateQuerySuggestionsBlockListCommandError - */ -const de_UpdateQuerySuggestionsBlockListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateQuerySuggestionsConfigCommand */ @@ -5101,7 +2519,7 @@ export const de_UpdateQuerySuggestionsConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateQuerySuggestionsConfigCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateQuerySuggestionsConfigCommandOutput = { @@ -5110,47 +2528,6 @@ export const de_UpdateQuerySuggestionsConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateQuerySuggestionsConfigCommandError - */ -const de_UpdateQuerySuggestionsConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kendra#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.kendra#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kendra#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.kendra#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kendra#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateThesaurusCommand */ @@ -5159,7 +2536,7 @@ export const de_UpdateThesaurusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateThesaurusCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateThesaurusCommandOutput = { @@ -5169,12 +2546,9 @@ export const de_UpdateThesaurusCommand = async ( }; /** - * deserializeAws_json1_1UpdateThesaurusCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateThesaurusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5184,12 +2558,12 @@ const de_UpdateThesaurusCommandError = async ( case "AccessDeniedException": case "com.amazonaws.kendra#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.kendra#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.kendra#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistException": + case "com.amazonaws.kendra#ResourceAlreadyExistException": + throw await de_ResourceAlreadyExistExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.kendra#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); @@ -5199,13 +2573,31 @@ const de_UpdateThesaurusCommandError = async ( case "ValidationException": case "com.amazonaws.kendra#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.kendra#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.kendra#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "FeaturedResultsConflictException": + case "com.amazonaws.kendra#FeaturedResultsConflictException": + throw await de_FeaturedResultsConflictExceptionRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.kendra#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "ResourceUnavailableException": + case "com.amazonaws.kendra#ResourceUnavailableException": + throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.kendra#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-keyspaces/src/protocols/Aws_json1_0.ts b/clients/client-keyspaces/src/protocols/Aws_json1_0.ts index 72d0b7220185..80c9d0c80193 100644 --- a/clients/client-keyspaces/src/protocols/Aws_json1_0.ts +++ b/clients/client-keyspaces/src/protocols/Aws_json1_0.ts @@ -281,7 +281,7 @@ export const de_CreateKeyspaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateKeyspaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -293,44 +293,6 @@ export const de_CreateKeyspaceCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateKeyspaceCommandError - */ -const de_CreateKeyspaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.keyspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.keyspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.keyspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.keyspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.keyspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateTableCommand */ @@ -339,7 +301,7 @@ export const de_CreateTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -351,47 +313,6 @@ export const de_CreateTableCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateTableCommandError - */ -const de_CreateTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.keyspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.keyspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.keyspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.keyspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.keyspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.keyspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteKeyspaceCommand */ @@ -400,7 +321,7 @@ export const de_DeleteKeyspaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteKeyspaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -412,47 +333,6 @@ export const de_DeleteKeyspaceCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteKeyspaceCommandError - */ -const de_DeleteKeyspaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.keyspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.keyspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.keyspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.keyspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.keyspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.keyspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteTableCommand */ @@ -461,7 +341,7 @@ export const de_DeleteTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -473,47 +353,6 @@ export const de_DeleteTableCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteTableCommandError - */ -const de_DeleteTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.keyspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.keyspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.keyspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.keyspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.keyspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.keyspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetKeyspaceCommand */ @@ -522,7 +361,7 @@ export const de_GetKeyspaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetKeyspaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -534,44 +373,6 @@ export const de_GetKeyspaceCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetKeyspaceCommandError - */ -const de_GetKeyspaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.keyspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.keyspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.keyspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.keyspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.keyspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetTableCommand */ @@ -580,7 +381,7 @@ export const de_GetTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -592,44 +393,6 @@ export const de_GetTableCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetTableCommandError - */ -const de_GetTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.keyspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.keyspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.keyspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.keyspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.keyspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetTableAutoScalingSettingsCommand */ @@ -638,7 +401,7 @@ export const de_GetTableAutoScalingSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTableAutoScalingSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -650,44 +413,6 @@ export const de_GetTableAutoScalingSettingsCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetTableAutoScalingSettingsCommandError - */ -const de_GetTableAutoScalingSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.keyspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.keyspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.keyspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.keyspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.keyspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListKeyspacesCommand */ @@ -696,7 +421,7 @@ export const de_ListKeyspacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListKeyspacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -708,44 +433,6 @@ export const de_ListKeyspacesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListKeyspacesCommandError - */ -const de_ListKeyspacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.keyspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.keyspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.keyspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.keyspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.keyspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListTablesCommand */ @@ -754,7 +441,7 @@ export const de_ListTablesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTablesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -766,44 +453,6 @@ export const de_ListTablesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListTablesCommandError - */ -const de_ListTablesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.keyspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.keyspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.keyspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.keyspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.keyspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListTagsForResourceCommand */ @@ -812,7 +461,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -824,44 +473,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.keyspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.keyspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.keyspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.keyspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.keyspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0RestoreTableCommand */ @@ -870,7 +481,7 @@ export const de_RestoreTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -882,47 +493,6 @@ export const de_RestoreTableCommand = async ( return response; }; -/** - * deserializeAws_json1_0RestoreTableCommandError - */ -const de_RestoreTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.keyspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.keyspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.keyspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.keyspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.keyspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.keyspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TagResourceCommand */ @@ -931,7 +501,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -943,44 +513,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.keyspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.keyspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.keyspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.keyspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.keyspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UntagResourceCommand */ @@ -989,7 +521,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1001,47 +533,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.keyspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.keyspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.keyspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.keyspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.keyspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.keyspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateTableCommand */ @@ -1050,7 +541,7 @@ export const de_UpdateTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1063,12 +554,9 @@ export const de_UpdateTableCommand = async ( }; /** - * deserializeAws_json1_0UpdateTableCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1084,22 +572,22 @@ const de_UpdateTableCommandError = async ( case "InternalServerException": case "com.amazonaws.keyspaces#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.keyspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ServiceQuotaExceededException": case "com.amazonaws.keyspaces#ServiceQuotaExceededException": throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.keyspaces#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.keyspaces#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts b/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts index e58371e2cb71..6aae98d980ba 100644 --- a/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis-analytics-v2/src/protocols/Aws_json1_1.ts @@ -669,7 +669,7 @@ export const de_AddApplicationCloudWatchLoggingOptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddApplicationCloudWatchLoggingOptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -681,47 +681,6 @@ export const de_AddApplicationCloudWatchLoggingOptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddApplicationCloudWatchLoggingOptionCommandError - */ -const de_AddApplicationCloudWatchLoggingOptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidApplicationConfigurationException": - case "com.amazonaws.kinesisanalyticsv2#InvalidApplicationConfigurationException": - throw await de_InvalidApplicationConfigurationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddApplicationInputCommand */ @@ -730,7 +689,7 @@ export const de_AddApplicationInputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddApplicationInputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -742,47 +701,6 @@ export const de_AddApplicationInputCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddApplicationInputCommandError - */ -const de_AddApplicationInputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeValidationException": - case "com.amazonaws.kinesisanalyticsv2#CodeValidationException": - throw await de_CodeValidationExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddApplicationInputProcessingConfigurationCommand */ @@ -791,7 +709,7 @@ export const de_AddApplicationInputProcessingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddApplicationInputProcessingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -803,44 +721,6 @@ export const de_AddApplicationInputProcessingConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddApplicationInputProcessingConfigurationCommandError - */ -const de_AddApplicationInputProcessingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddApplicationOutputCommand */ @@ -849,7 +729,7 @@ export const de_AddApplicationOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddApplicationOutputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -861,44 +741,6 @@ export const de_AddApplicationOutputCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddApplicationOutputCommandError - */ -const de_AddApplicationOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddApplicationReferenceDataSourceCommand */ @@ -907,7 +749,7 @@ export const de_AddApplicationReferenceDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddApplicationReferenceDataSourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -920,57 +762,39 @@ export const de_AddApplicationReferenceDataSourceCommand = async ( }; /** - * deserializeAws_json1_1AddApplicationReferenceDataSourceCommandError + * deserializeAws_json1_1AddApplicationVpcConfigurationCommand */ -const de_AddApplicationReferenceDataSourceCommandError = async ( +export const de_AddApplicationVpcConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: AddApplicationVpcConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1AddApplicationVpcConfigurationCommand + * deserializeAws_json1_1CreateApplicationCommand */ -export const de_AddApplicationVpcConfigurationCommand = async ( +export const de_CreateApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_AddApplicationVpcConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: AddApplicationVpcConfigurationCommandOutput = { + contents = de_CreateApplicationResponse(data, context); + const response: CreateApplicationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -978,57 +802,39 @@ export const de_AddApplicationVpcConfigurationCommand = async ( }; /** - * deserializeAws_json1_1AddApplicationVpcConfigurationCommandError + * deserializeAws_json1_1CreateApplicationPresignedUrlCommand */ -const de_AddApplicationVpcConfigurationCommandError = async ( +export const de_CreateApplicationPresignedUrlCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidApplicationConfigurationException": - case "com.amazonaws.kinesisanalyticsv2#InvalidApplicationConfigurationException": - throw await de_InvalidApplicationConfigurationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateApplicationPresignedUrlCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateApplicationCommand + * deserializeAws_json1_1CreateApplicationSnapshotCommand */ -export const de_CreateApplicationCommand = async ( +export const de_CreateApplicationSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateApplicationResponse(data, context); - const response: CreateApplicationCommandOutput = { + contents = _json(data); + const response: CreateApplicationSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1036,177 +842,14 @@ export const de_CreateApplicationCommand = async ( }; /** - * deserializeAws_json1_1CreateApplicationCommandError + * deserializeAws_json1_1DeleteApplicationCommand */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeValidationException": - case "com.amazonaws.kinesisanalyticsv2#CodeValidationException": - throw await de_CodeValidationExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesisanalyticsv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.kinesisanalyticsv2#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalyticsv2#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateApplicationPresignedUrlCommand - */ -export const de_CreateApplicationPresignedUrlCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateApplicationPresignedUrlCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateApplicationPresignedUrlCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateApplicationPresignedUrlCommandError - */ -const de_CreateApplicationPresignedUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateApplicationSnapshotCommand - */ -export const de_CreateApplicationSnapshotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateApplicationSnapshotCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateApplicationSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateApplicationSnapshotCommandError - */ -const de_CreateApplicationSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidApplicationConfigurationException": - case "com.amazonaws.kinesisanalyticsv2#InvalidApplicationConfigurationException": - throw await de_InvalidApplicationConfigurationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesisanalyticsv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalyticsv2#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteApplicationCommand - */ -export const de_DeleteApplicationCommand = async ( +export const de_DeleteApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1218,47 +861,6 @@ export const de_DeleteApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteApplicationCommandError - */ -const de_DeleteApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidApplicationConfigurationException": - case "com.amazonaws.kinesisanalyticsv2#InvalidApplicationConfigurationException": - throw await de_InvalidApplicationConfigurationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionCommand */ @@ -1267,7 +869,7 @@ export const de_DeleteApplicationCloudWatchLoggingOptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationCloudWatchLoggingOptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1279,47 +881,6 @@ export const de_DeleteApplicationCloudWatchLoggingOptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionCommandError - */ -const de_DeleteApplicationCloudWatchLoggingOptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidApplicationConfigurationException": - case "com.amazonaws.kinesisanalyticsv2#InvalidApplicationConfigurationException": - throw await de_InvalidApplicationConfigurationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationInputProcessingConfigurationCommand */ @@ -1328,7 +889,7 @@ export const de_DeleteApplicationInputProcessingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationInputProcessingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1340,44 +901,6 @@ export const de_DeleteApplicationInputProcessingConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteApplicationInputProcessingConfigurationCommandError - */ -const de_DeleteApplicationInputProcessingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationOutputCommand */ @@ -1386,7 +909,7 @@ export const de_DeleteApplicationOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationOutputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1398,44 +921,6 @@ export const de_DeleteApplicationOutputCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteApplicationOutputCommandError - */ -const de_DeleteApplicationOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationReferenceDataSourceCommand */ @@ -1444,7 +929,7 @@ export const de_DeleteApplicationReferenceDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationReferenceDataSourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1456,44 +941,6 @@ export const de_DeleteApplicationReferenceDataSourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteApplicationReferenceDataSourceCommandError - */ -const de_DeleteApplicationReferenceDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationSnapshotCommand */ @@ -1502,131 +949,32 @@ export const de_DeleteApplicationSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationSnapshotCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteApplicationSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteApplicationSnapshotCommandError - */ -const de_DeleteApplicationSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalyticsv2#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteApplicationVpcConfigurationCommand - */ -export const de_DeleteApplicationVpcConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteApplicationVpcConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteApplicationVpcConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteApplicationVpcConfigurationCommandError - */ -const de_DeleteApplicationVpcConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidApplicationConfigurationException": - case "com.amazonaws.kinesisanalyticsv2#InvalidApplicationConfigurationException": - throw await de_InvalidApplicationConfigurationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + let contents: any = {}; + contents = _json(data); + const response: DeleteApplicationSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeApplicationCommand + * deserializeAws_json1_1DeleteApplicationVpcConfigurationCommand */ -export const de_DescribeApplicationCommand = async ( +export const de_DeleteApplicationVpcConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeApplicationResponse(data, context); - const response: DescribeApplicationCommandOutput = { + contents = _json(data); + const response: DeleteApplicationVpcConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1634,35 +982,23 @@ export const de_DescribeApplicationCommand = async ( }; /** - * deserializeAws_json1_1DescribeApplicationCommandError + * deserializeAws_json1_1DescribeApplicationCommand */ -const de_DescribeApplicationCommandError = async ( +export const de_DescribeApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeApplicationResponse(data, context); + const response: DescribeApplicationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1673,7 +1009,7 @@ export const de_DescribeApplicationSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeApplicationSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1685,38 +1021,6 @@ export const de_DescribeApplicationSnapshotCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeApplicationSnapshotCommandError - */ -const de_DescribeApplicationSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalyticsv2#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeApplicationVersionCommand */ @@ -1725,7 +1029,7 @@ export const de_DescribeApplicationVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeApplicationVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1737,38 +1041,6 @@ export const de_DescribeApplicationVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeApplicationVersionCommandError - */ -const de_DescribeApplicationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalyticsv2#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DiscoverInputSchemaCommand */ @@ -1777,7 +1049,7 @@ export const de_DiscoverInputSchemaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DiscoverInputSchemaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1789,47 +1061,6 @@ export const de_DiscoverInputSchemaCommand = async ( return response; }; -/** - * deserializeAws_json1_1DiscoverInputSchemaCommandError - */ -const de_DiscoverInputSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceProvisionedThroughputExceededException": - case "com.amazonaws.kinesisanalyticsv2#ResourceProvisionedThroughputExceededException": - throw await de_ResourceProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kinesisanalyticsv2#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnableToDetectSchemaException": - case "com.amazonaws.kinesisanalyticsv2#UnableToDetectSchemaException": - throw await de_UnableToDetectSchemaExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalyticsv2#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListApplicationsCommand */ @@ -1838,7 +1069,7 @@ export const de_ListApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1850,32 +1081,6 @@ export const de_ListApplicationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListApplicationsCommandError - */ -const de_ListApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListApplicationSnapshotsCommand */ @@ -1884,7 +1089,7 @@ export const de_ListApplicationSnapshotsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListApplicationSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1896,35 +1101,6 @@ export const de_ListApplicationSnapshotsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListApplicationSnapshotsCommandError - */ -const de_ListApplicationSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalyticsv2#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListApplicationVersionsCommand */ @@ -1933,7 +1109,7 @@ export const de_ListApplicationVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListApplicationVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1945,38 +1121,6 @@ export const de_ListApplicationVersionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListApplicationVersionsCommandError - */ -const de_ListApplicationVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalyticsv2#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -1985,48 +1129,16 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2037,7 +1149,7 @@ export const de_RollbackApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RollbackApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2049,47 +1161,6 @@ export const de_RollbackApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1RollbackApplicationCommandError - */ -const de_RollbackApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalyticsv2#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartApplicationCommand */ @@ -2098,7 +1169,7 @@ export const de_StartApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2110,44 +1181,6 @@ export const de_StartApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartApplicationCommandError - */ -const de_StartApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidApplicationConfigurationException": - case "com.amazonaws.kinesisanalyticsv2#InvalidApplicationConfigurationException": - throw await de_InvalidApplicationConfigurationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopApplicationCommand */ @@ -2156,7 +1189,7 @@ export const de_StopApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2168,47 +1201,6 @@ export const de_StopApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopApplicationCommandError - */ -const de_StopApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidApplicationConfigurationException": - case "com.amazonaws.kinesisanalyticsv2#InvalidApplicationConfigurationException": - throw await de_InvalidApplicationConfigurationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -2217,7 +1209,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2229,44 +1221,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.kinesisanalyticsv2#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -2275,7 +1229,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2287,44 +1241,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.kinesisanalyticsv2#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateApplicationCommand */ @@ -2333,7 +1249,7 @@ export const de_UpdateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2345,53 +1261,6 @@ export const de_UpdateApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateApplicationCommandError - */ -const de_UpdateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeValidationException": - case "com.amazonaws.kinesisanalyticsv2#CodeValidationException": - throw await de_CodeValidationExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidApplicationConfigurationException": - case "com.amazonaws.kinesisanalyticsv2#InvalidApplicationConfigurationException": - throw await de_InvalidApplicationConfigurationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesisanalyticsv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateApplicationMaintenanceConfigurationCommand */ @@ -2400,7 +1269,7 @@ export const de_UpdateApplicationMaintenanceConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateApplicationMaintenanceConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2413,12 +1282,9 @@ export const de_UpdateApplicationMaintenanceConfigurationCommand = async ( }; /** - * deserializeAws_json1_1UpdateApplicationMaintenanceConfigurationCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateApplicationMaintenanceConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2428,25 +1294,49 @@ const de_UpdateApplicationMaintenanceConfigurationCommandError = async ( case "ConcurrentModificationException": case "com.amazonaws.kinesisanalyticsv2#ConcurrentModificationException": throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "InvalidApplicationConfigurationException": + case "com.amazonaws.kinesisanalyticsv2#InvalidApplicationConfigurationException": + throw await de_InvalidApplicationConfigurationExceptionRes(parsedOutput, context); case "InvalidArgumentException": case "com.amazonaws.kinesisanalyticsv2#InvalidArgumentException": throw await de_InvalidArgumentExceptionRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.kinesisanalyticsv2#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); case "ResourceInUseException": case "com.amazonaws.kinesisanalyticsv2#ResourceInUseException": throw await de_ResourceInUseExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.kinesisanalyticsv2#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "CodeValidationException": + case "com.amazonaws.kinesisanalyticsv2#CodeValidationException": + throw await de_CodeValidationExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.kinesisanalyticsv2#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.kinesisanalyticsv2#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); case "UnsupportedOperationException": case "com.amazonaws.kinesisanalyticsv2#UnsupportedOperationException": throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); + case "ResourceProvisionedThroughputExceededException": + case "com.amazonaws.kinesisanalyticsv2#ResourceProvisionedThroughputExceededException": + throw await de_ResourceProvisionedThroughputExceededExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.kinesisanalyticsv2#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "UnableToDetectSchemaException": + case "com.amazonaws.kinesisanalyticsv2#UnableToDetectSchemaException": + throw await de_UnableToDetectSchemaExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts b/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts index 2ebb32aaeff1..9681827a1a5a 100644 --- a/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis-analytics/src/protocols/Aws_json1_1.ts @@ -420,7 +420,7 @@ export const de_AddApplicationCloudWatchLoggingOptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddApplicationCloudWatchLoggingOptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -432,44 +432,6 @@ export const de_AddApplicationCloudWatchLoggingOptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddApplicationCloudWatchLoggingOptionCommandError - */ -const de_AddApplicationCloudWatchLoggingOptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalytics#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalytics#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalytics#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddApplicationInputCommand */ @@ -478,7 +440,7 @@ export const de_AddApplicationInputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddApplicationInputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -490,47 +452,6 @@ export const de_AddApplicationInputCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddApplicationInputCommandError - */ -const de_AddApplicationInputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeValidationException": - case "com.amazonaws.kinesisanalytics#CodeValidationException": - throw await de_CodeValidationExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalytics#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalytics#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalytics#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddApplicationInputProcessingConfigurationCommand */ @@ -539,7 +460,7 @@ export const de_AddApplicationInputProcessingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddApplicationInputProcessingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -551,44 +472,6 @@ export const de_AddApplicationInputProcessingConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddApplicationInputProcessingConfigurationCommandError - */ -const de_AddApplicationInputProcessingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalytics#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalytics#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalytics#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddApplicationOutputCommand */ @@ -597,7 +480,7 @@ export const de_AddApplicationOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddApplicationOutputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -609,44 +492,6 @@ export const de_AddApplicationOutputCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddApplicationOutputCommandError - */ -const de_AddApplicationOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalytics#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalytics#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalytics#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddApplicationReferenceDataSourceCommand */ @@ -655,7 +500,7 @@ export const de_AddApplicationReferenceDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddApplicationReferenceDataSourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -667,44 +512,6 @@ export const de_AddApplicationReferenceDataSourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddApplicationReferenceDataSourceCommandError - */ -const de_AddApplicationReferenceDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalytics#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalytics#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalytics#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateApplicationCommand */ @@ -713,7 +520,7 @@ export const de_CreateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -725,47 +532,6 @@ export const de_CreateApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeValidationException": - case "com.amazonaws.kinesisanalytics#CodeValidationException": - throw await de_CodeValidationExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalytics#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesisanalytics#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalytics#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.kinesisanalytics#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationCommand */ @@ -774,7 +540,7 @@ export const de_DeleteApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -786,41 +552,6 @@ export const de_DeleteApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteApplicationCommandError - */ -const de_DeleteApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalytics#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalytics#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionCommand */ @@ -829,7 +560,7 @@ export const de_DeleteApplicationCloudWatchLoggingOptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationCloudWatchLoggingOptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -841,44 +572,6 @@ export const de_DeleteApplicationCloudWatchLoggingOptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionCommandError - */ -const de_DeleteApplicationCloudWatchLoggingOptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalytics#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalytics#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalytics#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationInputProcessingConfigurationCommand */ @@ -887,7 +580,7 @@ export const de_DeleteApplicationInputProcessingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationInputProcessingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -899,44 +592,6 @@ export const de_DeleteApplicationInputProcessingConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteApplicationInputProcessingConfigurationCommandError - */ -const de_DeleteApplicationInputProcessingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalytics#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalytics#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalytics#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationOutputCommand */ @@ -945,7 +600,7 @@ export const de_DeleteApplicationOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationOutputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -957,44 +612,6 @@ export const de_DeleteApplicationOutputCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteApplicationOutputCommandError - */ -const de_DeleteApplicationOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalytics#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalytics#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalytics#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationReferenceDataSourceCommand */ @@ -1003,119 +620,32 @@ export const de_DeleteApplicationReferenceDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationReferenceDataSourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteApplicationReferenceDataSourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteApplicationReferenceDataSourceCommandError - */ -const de_DeleteApplicationReferenceDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalytics#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalytics#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalytics#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeApplicationCommand - */ -export const de_DescribeApplicationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeApplicationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeApplicationResponse(data, context); - const response: DescribeApplicationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeApplicationCommandError - */ -const de_DescribeApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalytics#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteApplicationReferenceDataSourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DiscoverInputSchemaCommand + * deserializeAws_json1_1DescribeApplicationCommand */ -export const de_DiscoverInputSchemaCommand = async ( +export const de_DescribeApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DiscoverInputSchemaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DiscoverInputSchemaCommandOutput = { + contents = de_DescribeApplicationResponse(data, context); + const response: DescribeApplicationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1123,38 +653,23 @@ export const de_DiscoverInputSchemaCommand = async ( }; /** - * deserializeAws_json1_1DiscoverInputSchemaCommandError + * deserializeAws_json1_1DiscoverInputSchemaCommand */ -const de_DiscoverInputSchemaCommandError = async ( +export const de_DiscoverInputSchemaCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalytics#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceProvisionedThroughputExceededException": - case "com.amazonaws.kinesisanalytics#ResourceProvisionedThroughputExceededException": - throw await de_ResourceProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.kinesisanalytics#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnableToDetectSchemaException": - case "com.amazonaws.kinesisanalytics#UnableToDetectSchemaException": - throw await de_UnableToDetectSchemaExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DiscoverInputSchemaCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1165,7 +680,7 @@ export const de_ListApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1177,26 +692,6 @@ export const de_ListApplicationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListApplicationsCommandError - */ -const de_ListApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -1205,7 +700,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1217,38 +712,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalytics#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartApplicationCommand */ @@ -1257,7 +720,7 @@ export const de_StartApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1269,44 +732,6 @@ export const de_StartApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartApplicationCommandError - */ -const de_StartApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidApplicationConfigurationException": - case "com.amazonaws.kinesisanalytics#InvalidApplicationConfigurationException": - throw await de_InvalidApplicationConfigurationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalytics#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalytics#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalytics#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopApplicationCommand */ @@ -1315,7 +740,7 @@ export const de_StopApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1327,38 +752,6 @@ export const de_StopApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopApplicationCommandError - */ -const de_StopApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUseException": - case "com.amazonaws.kinesisanalytics#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kinesisanalytics#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -1367,7 +760,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1379,44 +772,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalytics#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalytics#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.kinesisanalytics#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -1425,7 +780,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1437,44 +792,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisanalytics#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisanalytics#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisanalytics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.kinesisanalytics#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateApplicationCommand */ @@ -1483,7 +800,7 @@ export const de_UpdateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1496,21 +813,15 @@ export const de_UpdateApplicationCommand = async ( }; /** - * deserializeAws_json1_1UpdateApplicationCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "CodeValidationException": - case "com.amazonaws.kinesisanalytics#CodeValidationException": - throw await de_CodeValidationExceptionRes(parsedOutput, context); case "ConcurrentModificationException": case "com.amazonaws.kinesisanalytics#ConcurrentModificationException": throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); @@ -1526,13 +837,34 @@ const de_UpdateApplicationCommandError = async ( case "UnsupportedOperationException": case "com.amazonaws.kinesisanalytics#UnsupportedOperationException": throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); + case "CodeValidationException": + case "com.amazonaws.kinesisanalytics#CodeValidationException": + throw await de_CodeValidationExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.kinesisanalytics#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.kinesisanalytics#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "ResourceProvisionedThroughputExceededException": + case "com.amazonaws.kinesisanalytics#ResourceProvisionedThroughputExceededException": + throw await de_ResourceProvisionedThroughputExceededExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.kinesisanalytics#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "UnableToDetectSchemaException": + case "com.amazonaws.kinesisanalytics#UnableToDetectSchemaException": + throw await de_UnableToDetectSchemaExceptionRes(parsedOutput, context); + case "InvalidApplicationConfigurationException": + case "com.amazonaws.kinesisanalytics#InvalidApplicationConfigurationException": + throw await de_InvalidApplicationConfigurationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts index b14767379a44..30ad4893fa0e 100644 --- a/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-archived-media/src/protocols/Aws_restJson1.ts @@ -235,7 +235,7 @@ export const de_GetClipCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetClipCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -247,56 +247,6 @@ export const de_GetClipCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetClipCommandError - */ -const de_GetClipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideoarchivedmedia#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideoarchivedmedia#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidCodecPrivateDataException": - case "com.amazonaws.kinesisvideoarchivedmedia#InvalidCodecPrivateDataException": - throw await de_InvalidCodecPrivateDataExceptionRes(parsedOutput, context); - case "InvalidMediaFrameException": - case "com.amazonaws.kinesisvideoarchivedmedia#InvalidMediaFrameException": - throw await de_InvalidMediaFrameExceptionRes(parsedOutput, context); - case "MissingCodecPrivateDataException": - case "com.amazonaws.kinesisvideoarchivedmedia#MissingCodecPrivateDataException": - throw await de_MissingCodecPrivateDataExceptionRes(parsedOutput, context); - case "NoDataRetentionException": - case "com.amazonaws.kinesisvideoarchivedmedia#NoDataRetentionException": - throw await de_NoDataRetentionExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.kinesisvideoarchivedmedia#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideoarchivedmedia#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedStreamMediaTypeException": - case "com.amazonaws.kinesisvideoarchivedmedia#UnsupportedStreamMediaTypeException": - throw await de_UnsupportedStreamMediaTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDASHStreamingSessionURLCommand */ @@ -305,7 +255,7 @@ export const de_GetDASHStreamingSessionURLCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDASHStreamingSessionURLCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -318,53 +268,6 @@ export const de_GetDASHStreamingSessionURLCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDASHStreamingSessionURLCommandError - */ -const de_GetDASHStreamingSessionURLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideoarchivedmedia#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideoarchivedmedia#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidCodecPrivateDataException": - case "com.amazonaws.kinesisvideoarchivedmedia#InvalidCodecPrivateDataException": - throw await de_InvalidCodecPrivateDataExceptionRes(parsedOutput, context); - case "MissingCodecPrivateDataException": - case "com.amazonaws.kinesisvideoarchivedmedia#MissingCodecPrivateDataException": - throw await de_MissingCodecPrivateDataExceptionRes(parsedOutput, context); - case "NoDataRetentionException": - case "com.amazonaws.kinesisvideoarchivedmedia#NoDataRetentionException": - throw await de_NoDataRetentionExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.kinesisvideoarchivedmedia#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideoarchivedmedia#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedStreamMediaTypeException": - case "com.amazonaws.kinesisvideoarchivedmedia#UnsupportedStreamMediaTypeException": - throw await de_UnsupportedStreamMediaTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetHLSStreamingSessionURLCommand */ @@ -373,7 +276,7 @@ export const de_GetHLSStreamingSessionURLCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetHLSStreamingSessionURLCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -386,53 +289,6 @@ export const de_GetHLSStreamingSessionURLCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetHLSStreamingSessionURLCommandError - */ -const de_GetHLSStreamingSessionURLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideoarchivedmedia#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideoarchivedmedia#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidCodecPrivateDataException": - case "com.amazonaws.kinesisvideoarchivedmedia#InvalidCodecPrivateDataException": - throw await de_InvalidCodecPrivateDataExceptionRes(parsedOutput, context); - case "MissingCodecPrivateDataException": - case "com.amazonaws.kinesisvideoarchivedmedia#MissingCodecPrivateDataException": - throw await de_MissingCodecPrivateDataExceptionRes(parsedOutput, context); - case "NoDataRetentionException": - case "com.amazonaws.kinesisvideoarchivedmedia#NoDataRetentionException": - throw await de_NoDataRetentionExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.kinesisvideoarchivedmedia#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideoarchivedmedia#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedStreamMediaTypeException": - case "com.amazonaws.kinesisvideoarchivedmedia#UnsupportedStreamMediaTypeException": - throw await de_UnsupportedStreamMediaTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetImagesCommand */ @@ -441,7 +297,7 @@ export const de_GetImagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -455,44 +311,6 @@ export const de_GetImagesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetImagesCommandError - */ -const de_GetImagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideoarchivedmedia#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideoarchivedmedia#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NoDataRetentionException": - case "com.amazonaws.kinesisvideoarchivedmedia#NoDataRetentionException": - throw await de_NoDataRetentionExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.kinesisvideoarchivedmedia#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideoarchivedmedia#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMediaForFragmentListCommand */ @@ -501,7 +319,7 @@ export const de_GetMediaForFragmentListCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMediaForFragmentListCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -513,41 +331,6 @@ export const de_GetMediaForFragmentListCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMediaForFragmentListCommandError - */ -const de_GetMediaForFragmentListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideoarchivedmedia#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideoarchivedmedia#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.kinesisvideoarchivedmedia#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideoarchivedmedia#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListFragmentsCommand */ @@ -556,7 +339,7 @@ export const de_ListFragmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFragmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -571,12 +354,9 @@ export const de_ListFragmentsCommand = async ( }; /** - * deserializeAws_restJson1ListFragmentsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_ListFragmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -589,19 +369,34 @@ const de_ListFragmentsCommandError = async ( case "InvalidArgumentException": case "com.amazonaws.kinesisvideoarchivedmedia#InvalidArgumentException": throw await de_InvalidArgumentExceptionRes(parsedOutput, context); + case "InvalidCodecPrivateDataException": + case "com.amazonaws.kinesisvideoarchivedmedia#InvalidCodecPrivateDataException": + throw await de_InvalidCodecPrivateDataExceptionRes(parsedOutput, context); + case "InvalidMediaFrameException": + case "com.amazonaws.kinesisvideoarchivedmedia#InvalidMediaFrameException": + throw await de_InvalidMediaFrameExceptionRes(parsedOutput, context); + case "MissingCodecPrivateDataException": + case "com.amazonaws.kinesisvideoarchivedmedia#MissingCodecPrivateDataException": + throw await de_MissingCodecPrivateDataExceptionRes(parsedOutput, context); + case "NoDataRetentionException": + case "com.amazonaws.kinesisvideoarchivedmedia#NoDataRetentionException": + throw await de_NoDataRetentionExceptionRes(parsedOutput, context); case "NotAuthorizedException": case "com.amazonaws.kinesisvideoarchivedmedia#NotAuthorizedException": throw await de_NotAuthorizedExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.kinesisvideoarchivedmedia#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "UnsupportedStreamMediaTypeException": + case "com.amazonaws.kinesisvideoarchivedmedia#UnsupportedStreamMediaTypeException": + throw await de_UnsupportedStreamMediaTypeExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts index b1f4a2ed8442..ff96d63656c4 100644 --- a/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-media/src/protocols/Aws_restJson1.ts @@ -61,7 +61,7 @@ export const de_GetMediaCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMediaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -74,12 +74,9 @@ export const de_GetMediaCommand = async ( }; /** - * deserializeAws_restJson1GetMediaCommandError + * deserialize_Aws_restJson1CommandError */ -const de_GetMediaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -110,7 +107,7 @@ const de_GetMediaCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts index 5e4a47f368e2..5287d0b6b591 100644 --- a/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-signaling/src/protocols/Aws_restJson1.ts @@ -90,7 +90,7 @@ export const de_GetIceServerConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIceServerConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -103,47 +103,6 @@ export const de_GetIceServerConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetIceServerConfigCommandError - */ -const de_GetIceServerConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideosignaling#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideosignaling#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidClientException": - case "com.amazonaws.kinesisvideosignaling#InvalidClientException": - throw await de_InvalidClientExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.kinesisvideosignaling#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideosignaling#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "SessionExpiredException": - case "com.amazonaws.kinesisvideosignaling#SessionExpiredException": - throw await de_SessionExpiredExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SendAlexaOfferToMasterCommand */ @@ -152,7 +111,7 @@ export const de_SendAlexaOfferToMasterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendAlexaOfferToMasterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -166,12 +125,9 @@ export const de_SendAlexaOfferToMasterCommand = async ( }; /** - * deserializeAws_restJson1SendAlexaOfferToMasterCommandError + * deserialize_Aws_restJson1CommandError */ -const de_SendAlexaOfferToMasterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -184,19 +140,25 @@ const de_SendAlexaOfferToMasterCommandError = async ( case "InvalidArgumentException": case "com.amazonaws.kinesisvideosignaling#InvalidArgumentException": throw await de_InvalidArgumentExceptionRes(parsedOutput, context); + case "InvalidClientException": + case "com.amazonaws.kinesisvideosignaling#InvalidClientException": + throw await de_InvalidClientExceptionRes(parsedOutput, context); case "NotAuthorizedException": case "com.amazonaws.kinesisvideosignaling#NotAuthorizedException": throw await de_NotAuthorizedExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.kinesisvideosignaling#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "SessionExpiredException": + case "com.amazonaws.kinesisvideosignaling#SessionExpiredException": + throw await de_SessionExpiredExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-kinesis-video-webrtc-storage/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video-webrtc-storage/src/protocols/Aws_restJson1.ts index 39ef17fc8d2e..0d67f9bb6105 100644 --- a/clients/client-kinesis-video-webrtc-storage/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video-webrtc-storage/src/protocols/Aws_restJson1.ts @@ -55,7 +55,7 @@ export const de_JoinStorageSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_JoinStorageSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -65,12 +65,9 @@ export const de_JoinStorageSessionCommand = async ( }; /** - * deserializeAws_restJson1JoinStorageSessionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_JoinStorageSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -95,7 +92,7 @@ const de_JoinStorageSessionCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts b/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts index 2b30aa302ef3..0e14d23fc441 100644 --- a/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts +++ b/clients/client-kinesis-video/src/protocols/Aws_restJson1.ts @@ -875,7 +875,7 @@ export const de_CreateSignalingChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSignalingChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -888,47 +888,6 @@ export const de_CreateSignalingChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSignalingChannelCommandError - */ -const de_CreateSignalingChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountChannelLimitExceededException": - case "com.amazonaws.kinesisvideo#AccountChannelLimitExceededException": - throw await de_AccountChannelLimitExceededExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisvideo#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "TagsPerResourceExceededLimitException": - case "com.amazonaws.kinesisvideo#TagsPerResourceExceededLimitException": - throw await de_TagsPerResourceExceededLimitExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateStreamCommand */ @@ -937,7 +896,7 @@ export const de_CreateStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -950,50 +909,6 @@ export const de_CreateStreamCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateStreamCommandError - */ -const de_CreateStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountStreamLimitExceededException": - case "com.amazonaws.kinesisvideo#AccountStreamLimitExceededException": - throw await de_AccountStreamLimitExceededExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "DeviceStreamLimitExceededException": - case "com.amazonaws.kinesisvideo#DeviceStreamLimitExceededException": - throw await de_DeviceStreamLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidDeviceException": - case "com.amazonaws.kinesisvideo#InvalidDeviceException": - throw await de_InvalidDeviceExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisvideo#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "TagsPerResourceExceededLimitException": - case "com.amazonaws.kinesisvideo#TagsPerResourceExceededLimitException": - throw await de_TagsPerResourceExceededLimitExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteEdgeConfigurationCommand */ @@ -1002,7 +917,7 @@ export const de_DeleteEdgeConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEdgeConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1011,44 +926,6 @@ export const de_DeleteEdgeConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEdgeConfigurationCommandError - */ -const de_DeleteEdgeConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "StreamEdgeConfigurationNotFoundException": - case "com.amazonaws.kinesisvideo#StreamEdgeConfigurationNotFoundException": - throw await de_StreamEdgeConfigurationNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSignalingChannelCommand */ @@ -1057,7 +934,7 @@ export const de_DeleteSignalingChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSignalingChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1066,47 +943,6 @@ export const de_DeleteSignalingChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSignalingChannelCommandError - */ -const de_DeleteSignalingChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisvideo#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "VersionMismatchException": - case "com.amazonaws.kinesisvideo#VersionMismatchException": - throw await de_VersionMismatchExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteStreamCommand */ @@ -1115,7 +951,7 @@ export const de_DeleteStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1124,47 +960,6 @@ export const de_DeleteStreamCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteStreamCommandError - */ -const de_DeleteStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.kinesisvideo#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisvideo#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "VersionMismatchException": - case "com.amazonaws.kinesisvideo#VersionMismatchException": - throw await de_VersionMismatchExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeEdgeConfigurationCommand */ @@ -1173,7 +968,7 @@ export const de_DescribeEdgeConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeEdgeConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1194,769 +989,282 @@ export const de_DescribeEdgeConfigurationCommand = async ( }; /** - * deserializeAws_restJson1DescribeEdgeConfigurationCommandError + * deserializeAws_restJson1DescribeImageGenerationConfigurationCommand */ -const de_DescribeEdgeConfigurationCommandError = async ( +export const de_DescribeImageGenerationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "StreamEdgeConfigurationNotFoundException": - case "com.amazonaws.kinesisvideo#StreamEdgeConfigurationNotFoundException": - throw await de_StreamEdgeConfigurationNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ImageGenerationConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeImageGenerationConfigurationCommand + * deserializeAws_restJson1DescribeMappedResourceConfigurationCommand */ -export const de_DescribeImageGenerationConfigurationCommand = async ( +export const de_DescribeMappedResourceConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeImageGenerationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ImageGenerationConfiguration: _json, + MappedResourceConfigurationList: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeImageGenerationConfigurationCommandError + * deserializeAws_restJson1DescribeMediaStorageConfigurationCommand */ -const de_DescribeImageGenerationConfigurationCommandError = async ( +export const de_DescribeMediaStorageConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeMappedResourceConfigurationCommand - */ -export const de_DescribeMappedResourceConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeMappedResourceConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - MappedResourceConfigurationList: _json, - NextToken: __expectString, + MediaStorageConfiguration: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeMappedResourceConfigurationCommandError - */ -const de_DescribeMappedResourceConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeMediaStorageConfigurationCommand + * deserializeAws_restJson1DescribeNotificationConfigurationCommand */ -export const de_DescribeMediaStorageConfigurationCommand = async ( +export const de_DescribeNotificationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeMediaStorageConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - MediaStorageConfiguration: _json, + NotificationConfiguration: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeMediaStorageConfigurationCommandError + * deserializeAws_restJson1DescribeSignalingChannelCommand */ -const de_DescribeMediaStorageConfigurationCommandError = async ( +export const de_DescribeSignalingChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ChannelInfo: (_) => de_ChannelInfo(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeNotificationConfigurationCommand + * deserializeAws_restJson1DescribeStreamCommand */ -export const de_DescribeNotificationConfigurationCommand = async ( +export const de_DescribeStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeNotificationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NotificationConfiguration: _json, + StreamInfo: (_) => de_StreamInfo(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeNotificationConfigurationCommandError + * deserializeAws_restJson1GetDataEndpointCommand */ -const de_DescribeNotificationConfigurationCommandError = async ( +export const de_GetDataEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DataEndpoint: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeSignalingChannelCommand + * deserializeAws_restJson1GetSignalingChannelEndpointCommand */ -export const de_DescribeSignalingChannelCommand = async ( +export const de_GetSignalingChannelEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSignalingChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ChannelInfo: (_) => de_ChannelInfo(_, context), + ResourceEndpointList: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeSignalingChannelCommandError + * deserializeAws_restJson1ListEdgeAgentConfigurationsCommand */ -const de_DescribeSignalingChannelCommandError = async ( +export const de_ListEdgeAgentConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EdgeConfigs: (_) => de_ListEdgeAgentConfigurationsEdgeConfigList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeStreamCommand + * deserializeAws_restJson1ListSignalingChannelsCommand */ -export const de_DescribeStreamCommand = async ( +export const de_ListSignalingChannelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - StreamInfo: (_) => de_StreamInfo(_, context), + ChannelInfoList: (_) => de_ChannelInfoList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeStreamCommandError + * deserializeAws_restJson1ListStreamsCommand */ -const de_DescribeStreamCommandError = async ( +export const de_ListStreamsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.kinesisvideo#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + StreamInfoList: (_) => de_StreamInfoList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetDataEndpointCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_GetDataEndpointCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DataEndpoint: __expectString, + NextToken: __expectString, + Tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetDataEndpointCommandError + * deserializeAws_restJson1ListTagsForStreamCommand */ -const de_GetDataEndpointCommandError = async ( +export const de_ListTagsForStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.kinesisvideo#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSignalingChannelEndpointCommand - */ -export const de_GetSignalingChannelEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSignalingChannelEndpointCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ResourceEndpointList: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSignalingChannelEndpointCommandError - */ -const de_GetSignalingChannelEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisvideo#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListEdgeAgentConfigurationsCommand - */ -export const de_ListEdgeAgentConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEdgeAgentConfigurationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - EdgeConfigs: (_) => de_ListEdgeAgentConfigurationsEdgeConfigList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListEdgeAgentConfigurationsCommandError - */ -const de_ListEdgeAgentConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.kinesisvideo#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSignalingChannelsCommand - */ -export const de_ListSignalingChannelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSignalingChannelsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ChannelInfoList: (_) => de_ChannelInfoList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSignalingChannelsCommandError - */ -const de_ListSignalingChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListStreamsCommand - */ -export const de_ListStreamsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStreamsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - StreamInfoList: (_) => de_StreamInfoList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListStreamsCommandError - */ -const de_ListStreamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForStreamCommand - */ -export const de_ListTagsForStreamCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForStreamCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForStreamCommandError - */ -const de_ListTagsForStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidResourceFormatException": - case "com.amazonaws.kinesisvideo#InvalidResourceFormatException": - throw await de_InvalidResourceFormatExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.kinesisvideo#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1967,7 +1275,7 @@ export const de_StartEdgeConfigurationUpdateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartEdgeConfigurationUpdateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1987,275 +1295,14 @@ export const de_StartEdgeConfigurationUpdateCommand = async ( }; /** - * deserializeAws_restJson1StartEdgeConfigurationUpdateCommandError - */ -const de_StartEdgeConfigurationUpdateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NoDataRetentionException": - case "com.amazonaws.kinesisvideo#NoDataRetentionException": - throw await de_NoDataRetentionExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisvideo#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagsPerResourceExceededLimitException": - case "com.amazonaws.kinesisvideo#TagsPerResourceExceededLimitException": - throw await de_TagsPerResourceExceededLimitExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1TagStreamCommand - */ -export const de_TagStreamCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagStreamCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1TagStreamCommandError - */ -const de_TagStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidResourceFormatException": - case "com.amazonaws.kinesisvideo#InvalidResourceFormatException": - throw await de_InvalidResourceFormatExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.kinesisvideo#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagsPerResourceExceededLimitException": - case "com.amazonaws.kinesisvideo#TagsPerResourceExceededLimitException": - throw await de_TagsPerResourceExceededLimitExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UntagResourceCommand - */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UntagStreamCommand - */ -export const de_UntagStreamCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagStreamCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1UntagStreamCommandError - */ -const de_UntagStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidResourceFormatException": - case "com.amazonaws.kinesisvideo#InvalidResourceFormatException": - throw await de_InvalidResourceFormatExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.kinesisvideo#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateDataRetentionCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UpdateDataRetentionCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDataRetentionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2265,55 +1312,31 @@ export const de_UpdateDataRetentionCommand = async ( }; /** - * deserializeAws_restJson1UpdateDataRetentionCommandError + * deserializeAws_restJson1TagStreamCommand */ -const de_UpdateDataRetentionCommandError = async ( +export const de_TagStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.kinesisvideo#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisvideo#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "VersionMismatchException": - case "com.amazonaws.kinesisvideo#VersionMismatchException": - throw await de_VersionMismatchExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateImageGenerationConfigurationCommand + * deserializeAws_restJson1UntagResourceCommand */ -export const de_UpdateImageGenerationConfigurationCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateImageGenerationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2323,55 +1346,31 @@ export const de_UpdateImageGenerationConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateImageGenerationConfigurationCommandError + * deserializeAws_restJson1UntagStreamCommand */ -const de_UpdateImageGenerationConfigurationCommandError = async ( +export const de_UntagStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NoDataRetentionException": - case "com.amazonaws.kinesisvideo#NoDataRetentionException": - throw await de_NoDataRetentionExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisvideo#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateMediaStorageConfigurationCommand + * deserializeAws_restJson1UpdateDataRetentionCommand */ -export const de_UpdateMediaStorageConfigurationCommand = async ( +export const de_UpdateDataRetentionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMediaStorageConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2381,55 +1380,31 @@ export const de_UpdateMediaStorageConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateMediaStorageConfigurationCommandError + * deserializeAws_restJson1UpdateImageGenerationConfigurationCommand */ -const de_UpdateMediaStorageConfigurationCommandError = async ( +export const de_UpdateImageGenerationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NoDataRetentionException": - case "com.amazonaws.kinesisvideo#NoDataRetentionException": - throw await de_NoDataRetentionExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisvideo#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateNotificationConfigurationCommand + * deserializeAws_restJson1UpdateMediaStorageConfigurationCommand */ -export const de_UpdateNotificationConfigurationCommand = async ( +export const de_UpdateMediaStorageConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateNotificationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2439,44 +1414,20 @@ export const de_UpdateNotificationConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateNotificationConfigurationCommandError + * deserializeAws_restJson1UpdateNotificationConfigurationCommand */ -const de_UpdateNotificationConfigurationCommandError = async ( +export const de_UpdateNotificationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NoDataRetentionException": - case "com.amazonaws.kinesisvideo#NoDataRetentionException": - throw await de_NoDataRetentionExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisvideo#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -2487,7 +1438,7 @@ export const de_UpdateSignalingChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSignalingChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2496,47 +1447,6 @@ export const de_UpdateSignalingChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSignalingChannelCommandError - */ -const de_UpdateSignalingChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesisvideo#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientLimitExceededException": - case "com.amazonaws.kinesisvideo#ClientLimitExceededException": - throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesisvideo#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesisvideo#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesisvideo#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "VersionMismatchException": - case "com.amazonaws.kinesisvideo#VersionMismatchException": - throw await de_VersionMismatchExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateStreamCommand */ @@ -2545,7 +1455,7 @@ export const de_UpdateStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2555,43 +1465,67 @@ export const de_UpdateStreamCommand = async ( }; /** - * deserializeAws_restJson1UpdateStreamCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.kinesisvideo#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "AccountChannelLimitExceededException": + case "com.amazonaws.kinesisvideo#AccountChannelLimitExceededException": + throw await de_AccountChannelLimitExceededExceptionRes(parsedOutput, context); case "ClientLimitExceededException": case "com.amazonaws.kinesisvideo#ClientLimitExceededException": throw await de_ClientLimitExceededExceptionRes(parsedOutput, context); case "InvalidArgumentException": case "com.amazonaws.kinesisvideo#InvalidArgumentException": throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.kinesisvideo#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); case "ResourceInUseException": case "com.amazonaws.kinesisvideo#ResourceInUseException": throw await de_ResourceInUseExceptionRes(parsedOutput, context); + case "TagsPerResourceExceededLimitException": + case "com.amazonaws.kinesisvideo#TagsPerResourceExceededLimitException": + throw await de_TagsPerResourceExceededLimitExceptionRes(parsedOutput, context); + case "AccountStreamLimitExceededException": + case "com.amazonaws.kinesisvideo#AccountStreamLimitExceededException": + throw await de_AccountStreamLimitExceededExceptionRes(parsedOutput, context); + case "DeviceStreamLimitExceededException": + case "com.amazonaws.kinesisvideo#DeviceStreamLimitExceededException": + throw await de_DeviceStreamLimitExceededExceptionRes(parsedOutput, context); + case "InvalidDeviceException": + case "com.amazonaws.kinesisvideo#InvalidDeviceException": + throw await de_InvalidDeviceExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.kinesisvideo#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "StreamEdgeConfigurationNotFoundException": + case "com.amazonaws.kinesisvideo#StreamEdgeConfigurationNotFoundException": + throw await de_StreamEdgeConfigurationNotFoundExceptionRes(parsedOutput, context); case "VersionMismatchException": case "com.amazonaws.kinesisvideo#VersionMismatchException": throw await de_VersionMismatchExceptionRes(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.kinesisvideo#NotAuthorizedException": + throw await de_NotAuthorizedExceptionRes(parsedOutput, context); + case "InvalidResourceFormatException": + case "com.amazonaws.kinesisvideo#InvalidResourceFormatException": + throw await de_InvalidResourceFormatExceptionRes(parsedOutput, context); + case "NoDataRetentionException": + case "com.amazonaws.kinesisvideo#NoDataRetentionException": + throw await de_NoDataRetentionExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-kinesis/src/protocols/Aws_json1_1.ts b/clients/client-kinesis/src/protocols/Aws_json1_1.ts index 2a99cd817404..6f331324b7c4 100644 --- a/clients/client-kinesis/src/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis/src/protocols/Aws_json1_1.ts @@ -589,7 +589,7 @@ export const de_AddTagsToStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsToStreamCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AddTagsToStreamCommandOutput = { @@ -598,44 +598,6 @@ export const de_AddTagsToStreamCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddTagsToStreamCommandError - */ -const de_AddTagsToStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateStreamCommand */ @@ -644,7 +606,7 @@ export const de_CreateStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateStreamCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateStreamCommandOutput = { @@ -653,38 +615,6 @@ export const de_CreateStreamCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateStreamCommandError - */ -const de_CreateStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DecreaseStreamRetentionPeriodCommand */ @@ -693,7 +623,7 @@ export const de_DecreaseStreamRetentionPeriodCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DecreaseStreamRetentionPeriodCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DecreaseStreamRetentionPeriodCommandOutput = { @@ -702,44 +632,6 @@ export const de_DecreaseStreamRetentionPeriodCommand = async ( return response; }; -/** - * deserializeAws_json1_1DecreaseStreamRetentionPeriodCommandError - */ -const de_DecreaseStreamRetentionPeriodCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteResourcePolicyCommand */ @@ -748,7 +640,7 @@ export const de_DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteResourcePolicyCommandOutput = { @@ -757,44 +649,6 @@ export const de_DeleteResourcePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteStreamCommand */ @@ -803,7 +657,7 @@ export const de_DeleteStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteStreamCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteStreamCommandOutput = { @@ -812,44 +666,6 @@ export const de_DeleteStreamCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteStreamCommandError - */ -const de_DeleteStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeregisterStreamConsumerCommand */ @@ -858,7 +674,7 @@ export const de_DeregisterStreamConsumerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterStreamConsumerCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeregisterStreamConsumerCommandOutput = { @@ -867,38 +683,6 @@ export const de_DeregisterStreamConsumerCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeregisterStreamConsumerCommandError - */ -const de_DeregisterStreamConsumerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLimitsCommand */ @@ -907,7 +691,7 @@ export const de_DescribeLimitsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLimitsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -919,32 +703,6 @@ export const de_DescribeLimitsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLimitsCommandError - */ -const de_DescribeLimitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeStreamCommand */ @@ -953,7 +711,7 @@ export const de_DescribeStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStreamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -965,41 +723,6 @@ export const de_DescribeStreamCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeStreamCommandError - */ -const de_DescribeStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeStreamConsumerCommand */ @@ -1008,7 +731,7 @@ export const de_DescribeStreamConsumerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStreamConsumerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1021,46 +744,14 @@ export const de_DescribeStreamConsumerCommand = async ( }; /** - * deserializeAws_json1_1DescribeStreamConsumerCommandError + * deserializeAws_json1_1DescribeStreamSummaryCommand */ -const de_DescribeStreamConsumerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeStreamSummaryCommand - */ -export const de_DescribeStreamSummaryCommand = async ( +export const de_DescribeStreamSummaryCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStreamSummaryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1072,41 +763,6 @@ export const de_DescribeStreamSummaryCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeStreamSummaryCommandError - */ -const de_DescribeStreamSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisableEnhancedMonitoringCommand */ @@ -1115,7 +771,7 @@ export const de_DisableEnhancedMonitoringCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableEnhancedMonitoringCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1127,44 +783,6 @@ export const de_DisableEnhancedMonitoringCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisableEnhancedMonitoringCommandError - */ -const de_DisableEnhancedMonitoringCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1EnableEnhancedMonitoringCommand */ @@ -1173,7 +791,7 @@ export const de_EnableEnhancedMonitoringCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableEnhancedMonitoringCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1185,44 +803,6 @@ export const de_EnableEnhancedMonitoringCommand = async ( return response; }; -/** - * deserializeAws_json1_1EnableEnhancedMonitoringCommandError - */ -const de_EnableEnhancedMonitoringCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetRecordsCommand */ @@ -1231,7 +811,7 @@ export const de_GetRecordsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRecordsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1243,62 +823,6 @@ export const de_GetRecordsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetRecordsCommandError - */ -const de_GetRecordsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ExpiredIteratorException": - case "com.amazonaws.kinesis#ExpiredIteratorException": - throw await de_ExpiredIteratorExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "KMSAccessDeniedException": - case "com.amazonaws.kinesis#KMSAccessDeniedException": - throw await de_KMSAccessDeniedExceptionRes(parsedOutput, context); - case "KMSDisabledException": - case "com.amazonaws.kinesis#KMSDisabledException": - throw await de_KMSDisabledExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kinesis#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KMSNotFoundException": - case "com.amazonaws.kinesis#KMSNotFoundException": - throw await de_KMSNotFoundExceptionRes(parsedOutput, context); - case "KMSOptInRequired": - case "com.amazonaws.kinesis#KMSOptInRequired": - throw await de_KMSOptInRequiredRes(parsedOutput, context); - case "KMSThrottlingException": - case "com.amazonaws.kinesis#KMSThrottlingException": - throw await de_KMSThrottlingExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.kinesis#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetResourcePolicyCommand */ @@ -1307,7 +831,7 @@ export const de_GetResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1319,41 +843,6 @@ export const de_GetResourcePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetResourcePolicyCommandError - */ -const de_GetResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetShardIteratorCommand */ @@ -1362,7 +851,7 @@ export const de_GetShardIteratorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetShardIteratorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1374,41 +863,6 @@ export const de_GetShardIteratorCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetShardIteratorCommandError - */ -const de_GetShardIteratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.kinesis#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1IncreaseStreamRetentionPeriodCommand */ @@ -1417,7 +871,7 @@ export const de_IncreaseStreamRetentionPeriodCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_IncreaseStreamRetentionPeriodCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: IncreaseStreamRetentionPeriodCommandOutput = { @@ -1427,52 +881,14 @@ export const de_IncreaseStreamRetentionPeriodCommand = async ( }; /** - * deserializeAws_json1_1IncreaseStreamRetentionPeriodCommandError + * deserializeAws_json1_1ListShardsCommand */ -const de_IncreaseStreamRetentionPeriodCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListShardsCommand - */ -export const de_ListShardsCommand = async ( +export const de_ListShardsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListShardsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1484,47 +900,6 @@ export const de_ListShardsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListShardsCommandError - */ -const de_ListShardsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ExpiredNextTokenException": - case "com.amazonaws.kinesis#ExpiredNextTokenException": - throw await de_ExpiredNextTokenExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListStreamConsumersCommand */ @@ -1533,7 +908,7 @@ export const de_ListStreamConsumersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStreamConsumersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1545,44 +920,6 @@ export const de_ListStreamConsumersCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListStreamConsumersCommandError - */ -const de_ListStreamConsumersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExpiredNextTokenException": - case "com.amazonaws.kinesis#ExpiredNextTokenException": - throw await de_ExpiredNextTokenExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListStreamsCommand */ @@ -1591,7 +928,7 @@ export const de_ListStreamsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStreamsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1603,38 +940,6 @@ export const de_ListStreamsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListStreamsCommandError - */ -const de_ListStreamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExpiredNextTokenException": - case "com.amazonaws.kinesis#ExpiredNextTokenException": - throw await de_ExpiredNextTokenExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForStreamCommand */ @@ -1643,7 +948,7 @@ export const de_ListTagsForStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForStreamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1655,41 +960,6 @@ export const de_ListTagsForStreamCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForStreamCommandError - */ -const de_ListTagsForStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1MergeShardsCommand */ @@ -1698,7 +968,7 @@ export const de_MergeShardsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_MergeShardsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: MergeShardsCommandOutput = { @@ -1707,47 +977,6 @@ export const de_MergeShardsCommand = async ( return response; }; -/** - * deserializeAws_json1_1MergeShardsCommandError - */ -const de_MergeShardsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kinesis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutRecordCommand */ @@ -1756,7 +985,7 @@ export const de_PutRecordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutRecordCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1768,59 +997,6 @@ export const de_PutRecordCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutRecordCommandError - */ -const de_PutRecordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "KMSAccessDeniedException": - case "com.amazonaws.kinesis#KMSAccessDeniedException": - throw await de_KMSAccessDeniedExceptionRes(parsedOutput, context); - case "KMSDisabledException": - case "com.amazonaws.kinesis#KMSDisabledException": - throw await de_KMSDisabledExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kinesis#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KMSNotFoundException": - case "com.amazonaws.kinesis#KMSNotFoundException": - throw await de_KMSNotFoundExceptionRes(parsedOutput, context); - case "KMSOptInRequired": - case "com.amazonaws.kinesis#KMSOptInRequired": - throw await de_KMSOptInRequiredRes(parsedOutput, context); - case "KMSThrottlingException": - case "com.amazonaws.kinesis#KMSThrottlingException": - throw await de_KMSThrottlingExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.kinesis#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutRecordsCommand */ @@ -1829,7 +1005,7 @@ export const de_PutRecordsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutRecordsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1842,67 +1018,14 @@ export const de_PutRecordsCommand = async ( }; /** - * deserializeAws_json1_1PutRecordsCommandError + * deserializeAws_json1_1PutResourcePolicyCommand */ -const de_PutRecordsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "KMSAccessDeniedException": - case "com.amazonaws.kinesis#KMSAccessDeniedException": - throw await de_KMSAccessDeniedExceptionRes(parsedOutput, context); - case "KMSDisabledException": - case "com.amazonaws.kinesis#KMSDisabledException": - throw await de_KMSDisabledExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kinesis#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KMSNotFoundException": - case "com.amazonaws.kinesis#KMSNotFoundException": - throw await de_KMSNotFoundExceptionRes(parsedOutput, context); - case "KMSOptInRequired": - case "com.amazonaws.kinesis#KMSOptInRequired": - throw await de_KMSOptInRequiredRes(parsedOutput, context); - case "KMSThrottlingException": - case "com.amazonaws.kinesis#KMSThrottlingException": - throw await de_KMSThrottlingExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.kinesis#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutResourcePolicyCommand - */ -export const de_PutResourcePolicyCommand = async ( +export const de_PutResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutResourcePolicyCommandOutput = { @@ -1911,44 +1034,6 @@ export const de_PutResourcePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RegisterStreamConsumerCommand */ @@ -1957,7 +1042,7 @@ export const de_RegisterStreamConsumerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterStreamConsumerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1969,41 +1054,6 @@ export const de_RegisterStreamConsumerCommand = async ( return response; }; -/** - * deserializeAws_json1_1RegisterStreamConsumerCommandError - */ -const de_RegisterStreamConsumerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RemoveTagsFromStreamCommand */ @@ -2012,7 +1062,7 @@ export const de_RemoveTagsFromStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveTagsFromStreamCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RemoveTagsFromStreamCommandOutput = { @@ -2021,44 +1071,6 @@ export const de_RemoveTagsFromStreamCommand = async ( return response; }; -/** - * deserializeAws_json1_1RemoveTagsFromStreamCommandError - */ -const de_RemoveTagsFromStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SplitShardCommand */ @@ -2067,7 +1079,7 @@ export const de_SplitShardCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SplitShardCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SplitShardCommandOutput = { @@ -2076,47 +1088,6 @@ export const de_SplitShardCommand = async ( return response; }; -/** - * deserializeAws_json1_1SplitShardCommandError - */ -const de_SplitShardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kinesis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartStreamEncryptionCommand */ @@ -2125,7 +1096,7 @@ export const de_StartStreamEncryptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartStreamEncryptionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StartStreamEncryptionCommandOutput = { @@ -2134,62 +1105,6 @@ export const de_StartStreamEncryptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartStreamEncryptionCommandError - */ -const de_StartStreamEncryptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "KMSAccessDeniedException": - case "com.amazonaws.kinesis#KMSAccessDeniedException": - throw await de_KMSAccessDeniedExceptionRes(parsedOutput, context); - case "KMSDisabledException": - case "com.amazonaws.kinesis#KMSDisabledException": - throw await de_KMSDisabledExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kinesis#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KMSNotFoundException": - case "com.amazonaws.kinesis#KMSNotFoundException": - throw await de_KMSNotFoundExceptionRes(parsedOutput, context); - case "KMSOptInRequired": - case "com.amazonaws.kinesis#KMSOptInRequired": - throw await de_KMSOptInRequiredRes(parsedOutput, context); - case "KMSThrottlingException": - case "com.amazonaws.kinesis#KMSThrottlingException": - throw await de_KMSThrottlingExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopStreamEncryptionCommand */ @@ -2198,7 +1113,7 @@ export const de_StopStreamEncryptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopStreamEncryptionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopStreamEncryptionCommandOutput = { @@ -2207,44 +1122,6 @@ export const de_StopStreamEncryptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopStreamEncryptionCommandError - */ -const de_StopStreamEncryptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SubscribeToShardCommand */ @@ -2253,7 +1130,7 @@ export const de_SubscribeToShardCommand = async ( context: __SerdeContext & __EventStreamSerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SubscribeToShardCommandError(output, context); + return de_CommandError(output, context); } const contents = { EventStream: de_SubscribeToShardEventStream(output.body, context) }; const response: SubscribeToShardCommandOutput = { @@ -2263,44 +1140,6 @@ export const de_SubscribeToShardCommand = async ( return response; }; -/** - * deserializeAws_json1_1SubscribeToShardCommandError - */ -const de_SubscribeToShardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateShardCountCommand */ @@ -2309,7 +1148,7 @@ export const de_UpdateShardCountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateShardCountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2321,47 +1160,6 @@ export const de_UpdateShardCountCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateShardCountCommandError - */ -const de_UpdateShardCountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.kinesis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.kinesis#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kinesis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.kinesis#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.kinesis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.kinesis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateStreamModeCommand */ @@ -2370,7 +1168,7 @@ export const de_UpdateStreamModeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateStreamModeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateStreamModeCommandOutput = { @@ -2380,18 +1178,18 @@ export const de_UpdateStreamModeCommand = async ( }; /** - * deserializeAws_json1_1UpdateStreamModeCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateStreamModeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.kinesis#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); case "InvalidArgumentException": case "com.amazonaws.kinesis#InvalidArgumentException": throw await de_InvalidArgumentExceptionRes(parsedOutput, context); @@ -2404,13 +1202,43 @@ const de_UpdateStreamModeCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.kinesis#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ExpiredIteratorException": + case "com.amazonaws.kinesis#ExpiredIteratorException": + throw await de_ExpiredIteratorExceptionRes(parsedOutput, context); + case "KMSAccessDeniedException": + case "com.amazonaws.kinesis#KMSAccessDeniedException": + throw await de_KMSAccessDeniedExceptionRes(parsedOutput, context); + case "KMSDisabledException": + case "com.amazonaws.kinesis#KMSDisabledException": + throw await de_KMSDisabledExceptionRes(parsedOutput, context); + case "KMSInvalidStateException": + case "com.amazonaws.kinesis#KMSInvalidStateException": + throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); + case "KMSNotFoundException": + case "com.amazonaws.kinesis#KMSNotFoundException": + throw await de_KMSNotFoundExceptionRes(parsedOutput, context); + case "KMSOptInRequired": + case "com.amazonaws.kinesis#KMSOptInRequired": + throw await de_KMSOptInRequiredRes(parsedOutput, context); + case "KMSThrottlingException": + case "com.amazonaws.kinesis#KMSThrottlingException": + throw await de_KMSThrottlingExceptionRes(parsedOutput, context); + case "ProvisionedThroughputExceededException": + case "com.amazonaws.kinesis#ProvisionedThroughputExceededException": + throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); + case "ExpiredNextTokenException": + case "com.amazonaws.kinesis#ExpiredNextTokenException": + throw await de_ExpiredNextTokenExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.kinesis#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-kms/src/protocols/Aws_json1_1.ts b/clients/client-kms/src/protocols/Aws_json1_1.ts index 24186fedd47f..c199319a404e 100644 --- a/clients/client-kms/src/protocols/Aws_json1_1.ts +++ b/clients/client-kms/src/protocols/Aws_json1_1.ts @@ -899,7 +899,7 @@ export const de_CancelKeyDeletionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelKeyDeletionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -911,44 +911,6 @@ export const de_CancelKeyDeletionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelKeyDeletionCommandError - */ -const de_CancelKeyDeletionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ConnectCustomKeyStoreCommand */ @@ -957,7 +919,7 @@ export const de_ConnectCustomKeyStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ConnectCustomKeyStoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -969,44 +931,6 @@ export const de_ConnectCustomKeyStoreCommand = async ( return response; }; -/** - * deserializeAws_json1_1ConnectCustomKeyStoreCommandError - */ -const de_ConnectCustomKeyStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmClusterInvalidConfigurationException": - case "com.amazonaws.kms#CloudHsmClusterInvalidConfigurationException": - throw await de_CloudHsmClusterInvalidConfigurationExceptionRes(parsedOutput, context); - case "CloudHsmClusterNotActiveException": - case "com.amazonaws.kms#CloudHsmClusterNotActiveException": - throw await de_CloudHsmClusterNotActiveExceptionRes(parsedOutput, context); - case "CustomKeyStoreInvalidStateException": - case "com.amazonaws.kms#CustomKeyStoreInvalidStateException": - throw await de_CustomKeyStoreInvalidStateExceptionRes(parsedOutput, context); - case "CustomKeyStoreNotFoundException": - case "com.amazonaws.kms#CustomKeyStoreNotFoundException": - throw await de_CustomKeyStoreNotFoundExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAliasCommand */ @@ -1015,7 +939,7 @@ export const de_CreateAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAliasCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateAliasCommandOutput = { @@ -1024,50 +948,6 @@ export const de_CreateAliasCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAliasCommandError - */ -const de_CreateAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.kms#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidAliasNameException": - case "com.amazonaws.kms#InvalidAliasNameException": - throw await de_InvalidAliasNameExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateCustomKeyStoreCommand */ @@ -1076,7 +956,7 @@ export const de_CreateCustomKeyStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCustomKeyStoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1088,80 +968,6 @@ export const de_CreateCustomKeyStoreCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCustomKeyStoreCommandError - */ -const de_CreateCustomKeyStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmClusterInUseException": - case "com.amazonaws.kms#CloudHsmClusterInUseException": - throw await de_CloudHsmClusterInUseExceptionRes(parsedOutput, context); - case "CloudHsmClusterInvalidConfigurationException": - case "com.amazonaws.kms#CloudHsmClusterInvalidConfigurationException": - throw await de_CloudHsmClusterInvalidConfigurationExceptionRes(parsedOutput, context); - case "CloudHsmClusterNotActiveException": - case "com.amazonaws.kms#CloudHsmClusterNotActiveException": - throw await de_CloudHsmClusterNotActiveExceptionRes(parsedOutput, context); - case "CloudHsmClusterNotFoundException": - case "com.amazonaws.kms#CloudHsmClusterNotFoundException": - throw await de_CloudHsmClusterNotFoundExceptionRes(parsedOutput, context); - case "CustomKeyStoreNameInUseException": - case "com.amazonaws.kms#CustomKeyStoreNameInUseException": - throw await de_CustomKeyStoreNameInUseExceptionRes(parsedOutput, context); - case "IncorrectTrustAnchorException": - case "com.amazonaws.kms#IncorrectTrustAnchorException": - throw await de_IncorrectTrustAnchorExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "XksProxyIncorrectAuthenticationCredentialException": - case "com.amazonaws.kms#XksProxyIncorrectAuthenticationCredentialException": - throw await de_XksProxyIncorrectAuthenticationCredentialExceptionRes(parsedOutput, context); - case "XksProxyInvalidConfigurationException": - case "com.amazonaws.kms#XksProxyInvalidConfigurationException": - throw await de_XksProxyInvalidConfigurationExceptionRes(parsedOutput, context); - case "XksProxyInvalidResponseException": - case "com.amazonaws.kms#XksProxyInvalidResponseException": - throw await de_XksProxyInvalidResponseExceptionRes(parsedOutput, context); - case "XksProxyUriEndpointInUseException": - case "com.amazonaws.kms#XksProxyUriEndpointInUseException": - throw await de_XksProxyUriEndpointInUseExceptionRes(parsedOutput, context); - case "XksProxyUriInUseException": - case "com.amazonaws.kms#XksProxyUriInUseException": - throw await de_XksProxyUriInUseExceptionRes(parsedOutput, context); - case "XksProxyUriUnreachableException": - case "com.amazonaws.kms#XksProxyUriUnreachableException": - throw await de_XksProxyUriUnreachableExceptionRes(parsedOutput, context); - case "XksProxyVpcEndpointServiceInUseException": - case "com.amazonaws.kms#XksProxyVpcEndpointServiceInUseException": - throw await de_XksProxyVpcEndpointServiceInUseExceptionRes(parsedOutput, context); - case "XksProxyVpcEndpointServiceInvalidConfigurationException": - case "com.amazonaws.kms#XksProxyVpcEndpointServiceInvalidConfigurationException": - throw await de_XksProxyVpcEndpointServiceInvalidConfigurationExceptionRes(parsedOutput, context); - case "XksProxyVpcEndpointServiceNotFoundException": - case "com.amazonaws.kms#XksProxyVpcEndpointServiceNotFoundException": - throw await de_XksProxyVpcEndpointServiceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateGrantCommand */ @@ -1170,7 +976,7 @@ export const de_CreateGrantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateGrantCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1183,69 +989,39 @@ export const de_CreateGrantCommand = async ( }; /** - * deserializeAws_json1_1CreateGrantCommandError + * deserializeAws_json1_1CreateKeyCommand */ -const de_CreateGrantCommandError = async ( +export const de_CreateKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "DryRunOperationException": - case "com.amazonaws.kms#DryRunOperationException": - throw await de_DryRunOperationExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidGrantTokenException": - case "com.amazonaws.kms#InvalidGrantTokenException": - throw await de_InvalidGrantTokenExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateKeyResponse(data, context); + const response: CreateKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateKeyCommand + * deserializeAws_json1_1DecryptCommand */ -export const de_CreateKeyCommand = async ( +export const de_DecryptCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateKeyResponse(data, context); - const response: CreateKeyCommandOutput = { + contents = de_DecryptResponse(data, context); + const response: DecryptCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1253,81 +1029,36 @@ export const de_CreateKeyCommand = async ( }; /** - * deserializeAws_json1_1CreateKeyCommandError + * deserializeAws_json1_1DeleteAliasCommand */ -const de_CreateKeyCommandError = async ( +export const de_DeleteAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeleteAliasCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmClusterInvalidConfigurationException": - case "com.amazonaws.kms#CloudHsmClusterInvalidConfigurationException": - throw await de_CloudHsmClusterInvalidConfigurationExceptionRes(parsedOutput, context); - case "CustomKeyStoreInvalidStateException": - case "com.amazonaws.kms#CustomKeyStoreInvalidStateException": - throw await de_CustomKeyStoreInvalidStateExceptionRes(parsedOutput, context); - case "CustomKeyStoreNotFoundException": - case "com.amazonaws.kms#CustomKeyStoreNotFoundException": - throw await de_CustomKeyStoreNotFoundExceptionRes(parsedOutput, context); - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedPolicyDocumentException": - case "com.amazonaws.kms#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "TagException": - case "com.amazonaws.kms#TagException": - throw await de_TagExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kms#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - case "XksKeyAlreadyInUseException": - case "com.amazonaws.kms#XksKeyAlreadyInUseException": - throw await de_XksKeyAlreadyInUseExceptionRes(parsedOutput, context); - case "XksKeyInvalidConfigurationException": - case "com.amazonaws.kms#XksKeyInvalidConfigurationException": - throw await de_XksKeyInvalidConfigurationExceptionRes(parsedOutput, context); - case "XksKeyNotFoundException": - case "com.amazonaws.kms#XksKeyNotFoundException": - throw await de_XksKeyNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1DecryptCommand + * deserializeAws_json1_1DeleteCustomKeyStoreCommand */ -export const de_DecryptCommand = async ( +export const de_DeleteCustomKeyStoreCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DecryptCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DecryptResponse(data, context); - const response: DecryptCommandOutput = { + contents = _json(data); + const response: DeleteCustomKeyStoreCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1335,127 +1066,110 @@ export const de_DecryptCommand = async ( }; /** - * deserializeAws_json1_1DecryptCommandError + * deserializeAws_json1_1DeleteImportedKeyMaterialCommand */ -const de_DecryptCommandError = async ( +export const de_DeleteImportedKeyMaterialCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeleteImportedKeyMaterialCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "DryRunOperationException": - case "com.amazonaws.kms#DryRunOperationException": - throw await de_DryRunOperationExceptionRes(parsedOutput, context); - case "IncorrectKeyException": - case "com.amazonaws.kms#IncorrectKeyException": - throw await de_IncorrectKeyExceptionRes(parsedOutput, context); - case "InvalidCiphertextException": - case "com.amazonaws.kms#InvalidCiphertextException": - throw await de_InvalidCiphertextExceptionRes(parsedOutput, context); - case "InvalidGrantTokenException": - case "com.amazonaws.kms#InvalidGrantTokenException": - throw await de_InvalidGrantTokenExceptionRes(parsedOutput, context); - case "InvalidKeyUsageException": - case "com.amazonaws.kms#InvalidKeyUsageException": - throw await de_InvalidKeyUsageExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KeyUnavailableException": - case "com.amazonaws.kms#KeyUnavailableException": - throw await de_KeyUnavailableExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DescribeCustomKeyStoresCommand + */ +export const de_DescribeCustomKeyStoresCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeCustomKeyStoresResponse(data, context); + const response: DescribeCustomKeyStoresCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1DescribeKeyCommand + */ +export const de_DescribeKeyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeKeyResponse(data, context); + const response: DescribeKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteAliasCommand + * deserializeAws_json1_1DisableKeyCommand */ -export const de_DeleteAliasCommand = async ( +export const de_DisableKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteAliasCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteAliasCommandOutput = { + const response: DisableKeyCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteAliasCommandError + * deserializeAws_json1_1DisableKeyRotationCommand */ -const de_DeleteAliasCommandError = async ( +export const de_DisableKeyRotationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DisableKeyRotationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteCustomKeyStoreCommand + * deserializeAws_json1_1DisconnectCustomKeyStoreCommand */ -export const de_DeleteCustomKeyStoreCommand = async ( +export const de_DisconnectCustomKeyStoreCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteCustomKeyStoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteCustomKeyStoreCommandOutput = { + const response: DisconnectCustomKeyStoreCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1463,112 +1177,73 @@ export const de_DeleteCustomKeyStoreCommand = async ( }; /** - * deserializeAws_json1_1DeleteCustomKeyStoreCommandError + * deserializeAws_json1_1EnableKeyCommand */ -const de_DeleteCustomKeyStoreCommandError = async ( +export const de_EnableKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomKeyStoreHasCMKsException": - case "com.amazonaws.kms#CustomKeyStoreHasCMKsException": - throw await de_CustomKeyStoreHasCMKsExceptionRes(parsedOutput, context); - case "CustomKeyStoreInvalidStateException": - case "com.amazonaws.kms#CustomKeyStoreInvalidStateException": - throw await de_CustomKeyStoreInvalidStateExceptionRes(parsedOutput, context); - case "CustomKeyStoreNotFoundException": - case "com.amazonaws.kms#CustomKeyStoreNotFoundException": - throw await de_CustomKeyStoreNotFoundExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: EnableKeyCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteImportedKeyMaterialCommand + * deserializeAws_json1_1EnableKeyRotationCommand */ -export const de_DeleteImportedKeyMaterialCommand = async ( +export const de_EnableKeyRotationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteImportedKeyMaterialCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteImportedKeyMaterialCommandOutput = { + const response: EnableKeyRotationCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteImportedKeyMaterialCommandError + * deserializeAws_json1_1EncryptCommand */ -const de_DeleteImportedKeyMaterialCommandError = async ( +export const de_EncryptCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kms#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EncryptResponse(data, context); + const response: EncryptCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeCustomKeyStoresCommand + * deserializeAws_json1_1GenerateDataKeyCommand */ -export const de_DescribeCustomKeyStoresCommand = async ( +export const de_GenerateDataKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeCustomKeyStoresCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeCustomKeyStoresResponse(data, context); - const response: DescribeCustomKeyStoresCommandOutput = { + contents = de_GenerateDataKeyResponse(data, context); + const response: GenerateDataKeyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1576,51 +1251,39 @@ export const de_DescribeCustomKeyStoresCommand = async ( }; /** - * deserializeAws_json1_1DescribeCustomKeyStoresCommandError + * deserializeAws_json1_1GenerateDataKeyPairCommand */ -const de_DescribeCustomKeyStoresCommandError = async ( +export const de_GenerateDataKeyPairCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomKeyStoreNotFoundException": - case "com.amazonaws.kms#CustomKeyStoreNotFoundException": - throw await de_CustomKeyStoreNotFoundExceptionRes(parsedOutput, context); - case "InvalidMarkerException": - case "com.amazonaws.kms#InvalidMarkerException": - throw await de_InvalidMarkerExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GenerateDataKeyPairResponse(data, context); + const response: GenerateDataKeyPairCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeKeyCommand + * deserializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommand */ -export const de_DescribeKeyCommand = async ( +export const de_GenerateDataKeyPairWithoutPlaintextCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeKeyResponse(data, context); - const response: DescribeKeyCommandOutput = { + contents = de_GenerateDataKeyPairWithoutPlaintextResponse(data, context); + const response: GenerateDataKeyPairWithoutPlaintextCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1628,170 +1291,119 @@ export const de_DescribeKeyCommand = async ( }; /** - * deserializeAws_json1_1DescribeKeyCommandError + * deserializeAws_json1_1GenerateDataKeyWithoutPlaintextCommand */ -const de_DescribeKeyCommandError = async ( +export const de_GenerateDataKeyWithoutPlaintextCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GenerateDataKeyWithoutPlaintextResponse(data, context); + const response: GenerateDataKeyWithoutPlaintextCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisableKeyCommand + * deserializeAws_json1_1GenerateMacCommand */ -export const de_DisableKeyCommand = async ( +export const de_GenerateMacCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisableKeyCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DisableKeyCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GenerateMacResponse(data, context); + const response: GenerateMacCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1DisableKeyCommandError + * deserializeAws_json1_1GenerateRandomCommand */ -const de_DisableKeyCommandError = async ( +export const de_GenerateRandomCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GenerateRandomResponse(data, context); + const response: GenerateRandomCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisableKeyRotationCommand + * deserializeAws_json1_1GetKeyPolicyCommand */ -export const de_DisableKeyRotationCommand = async ( +export const de_GetKeyPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisableKeyRotationCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DisableKeyRotationCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetKeyPolicyCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1DisableKeyRotationCommandError + * deserializeAws_json1_1GetKeyRotationStatusCommand */ -const de_DisableKeyRotationCommandError = async ( +export const de_GetKeyRotationStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kms#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetKeyRotationStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisconnectCustomKeyStoreCommand + * deserializeAws_json1_1GetParametersForImportCommand */ -export const de_DisconnectCustomKeyStoreCommand = async ( +export const de_GetParametersForImportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisconnectCustomKeyStoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DisconnectCustomKeyStoreCommandOutput = { + contents = de_GetParametersForImportResponse(data, context); + const response: GetParametersForImportCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1799,170 +1411,119 @@ export const de_DisconnectCustomKeyStoreCommand = async ( }; /** - * deserializeAws_json1_1DisconnectCustomKeyStoreCommandError + * deserializeAws_json1_1GetPublicKeyCommand */ -const de_DisconnectCustomKeyStoreCommandError = async ( +export const de_GetPublicKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomKeyStoreInvalidStateException": - case "com.amazonaws.kms#CustomKeyStoreInvalidStateException": - throw await de_CustomKeyStoreInvalidStateExceptionRes(parsedOutput, context); - case "CustomKeyStoreNotFoundException": - case "com.amazonaws.kms#CustomKeyStoreNotFoundException": - throw await de_CustomKeyStoreNotFoundExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetPublicKeyResponse(data, context); + const response: GetPublicKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1EnableKeyCommand + * deserializeAws_json1_1ImportKeyMaterialCommand */ -export const de_EnableKeyCommand = async ( +export const de_ImportKeyMaterialCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_EnableKeyCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: EnableKeyCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ImportKeyMaterialCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1EnableKeyCommandError + * deserializeAws_json1_1ListAliasesCommand */ -const de_EnableKeyCommandError = async ( +export const de_ListAliasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListAliasesResponse(data, context); + const response: ListAliasesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1EnableKeyRotationCommand + * deserializeAws_json1_1ListGrantsCommand */ -export const de_EnableKeyRotationCommand = async ( +export const de_ListGrantsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_EnableKeyRotationCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: EnableKeyRotationCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListGrantsResponse(data, context); + const response: ListGrantsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1EnableKeyRotationCommandError + * deserializeAws_json1_1ListKeyPoliciesCommand */ -const de_EnableKeyRotationCommandError = async ( +export const de_ListKeyPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kms#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListKeyPoliciesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1EncryptCommand + * deserializeAws_json1_1ListKeysCommand */ -export const de_EncryptCommand = async ( +export const de_ListKeysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_EncryptCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_EncryptResponse(data, context); - const response: EncryptCommandOutput = { + contents = _json(data); + const response: ListKeysCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1970,69 +1531,39 @@ export const de_EncryptCommand = async ( }; /** - * deserializeAws_json1_1EncryptCommandError + * deserializeAws_json1_1ListResourceTagsCommand */ -const de_EncryptCommandError = async ( +export const de_ListResourceTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "DryRunOperationException": - case "com.amazonaws.kms#DryRunOperationException": - throw await de_DryRunOperationExceptionRes(parsedOutput, context); - case "InvalidGrantTokenException": - case "com.amazonaws.kms#InvalidGrantTokenException": - throw await de_InvalidGrantTokenExceptionRes(parsedOutput, context); - case "InvalidKeyUsageException": - case "com.amazonaws.kms#InvalidKeyUsageException": - throw await de_InvalidKeyUsageExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KeyUnavailableException": - case "com.amazonaws.kms#KeyUnavailableException": - throw await de_KeyUnavailableExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListResourceTagsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GenerateDataKeyCommand + * deserializeAws_json1_1ListRetirableGrantsCommand */ -export const de_GenerateDataKeyCommand = async ( +export const de_ListRetirableGrantsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GenerateDataKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GenerateDataKeyResponse(data, context); - const response: GenerateDataKeyCommandOutput = { + contents = de_ListGrantsResponse(data, context); + const response: ListRetirableGrantsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2040,69 +1571,36 @@ export const de_GenerateDataKeyCommand = async ( }; /** - * deserializeAws_json1_1GenerateDataKeyCommandError + * deserializeAws_json1_1PutKeyPolicyCommand */ -const de_GenerateDataKeyCommandError = async ( +export const de_PutKeyPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "DryRunOperationException": - case "com.amazonaws.kms#DryRunOperationException": - throw await de_DryRunOperationExceptionRes(parsedOutput, context); - case "InvalidGrantTokenException": - case "com.amazonaws.kms#InvalidGrantTokenException": - throw await de_InvalidGrantTokenExceptionRes(parsedOutput, context); - case "InvalidKeyUsageException": - case "com.amazonaws.kms#InvalidKeyUsageException": - throw await de_InvalidKeyUsageExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KeyUnavailableException": - case "com.amazonaws.kms#KeyUnavailableException": - throw await de_KeyUnavailableExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: PutKeyPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1GenerateDataKeyPairCommand + * deserializeAws_json1_1ReEncryptCommand */ -export const de_GenerateDataKeyPairCommand = async ( +export const de_ReEncryptCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GenerateDataKeyPairCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GenerateDataKeyPairResponse(data, context); - const response: GenerateDataKeyPairCommandOutput = { + contents = de_ReEncryptResponse(data, context); + const response: ReEncryptCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2110,145 +1608,73 @@ export const de_GenerateDataKeyPairCommand = async ( }; /** - * deserializeAws_json1_1GenerateDataKeyPairCommandError + * deserializeAws_json1_1ReplicateKeyCommand */ -const de_GenerateDataKeyPairCommandError = async ( +export const de_ReplicateKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "DryRunOperationException": - case "com.amazonaws.kms#DryRunOperationException": - throw await de_DryRunOperationExceptionRes(parsedOutput, context); - case "InvalidGrantTokenException": - case "com.amazonaws.kms#InvalidGrantTokenException": - throw await de_InvalidGrantTokenExceptionRes(parsedOutput, context); - case "InvalidKeyUsageException": - case "com.amazonaws.kms#InvalidKeyUsageException": - throw await de_InvalidKeyUsageExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KeyUnavailableException": - case "com.amazonaws.kms#KeyUnavailableException": - throw await de_KeyUnavailableExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kms#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ReplicateKeyResponse(data, context); + const response: ReplicateKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommand + * deserializeAws_json1_1RetireGrantCommand */ -export const de_GenerateDataKeyPairWithoutPlaintextCommand = async ( +export const de_RetireGrantCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GenerateDataKeyPairWithoutPlaintextCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GenerateDataKeyPairWithoutPlaintextResponse(data, context); - const response: GenerateDataKeyPairWithoutPlaintextCommandOutput = { + await collectBody(output.body, context); + const response: RetireGrantCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommandError + * deserializeAws_json1_1RevokeGrantCommand */ -const de_GenerateDataKeyPairWithoutPlaintextCommandError = async ( +export const de_RevokeGrantCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "DryRunOperationException": - case "com.amazonaws.kms#DryRunOperationException": - throw await de_DryRunOperationExceptionRes(parsedOutput, context); - case "InvalidGrantTokenException": - case "com.amazonaws.kms#InvalidGrantTokenException": - throw await de_InvalidGrantTokenExceptionRes(parsedOutput, context); - case "InvalidKeyUsageException": - case "com.amazonaws.kms#InvalidKeyUsageException": - throw await de_InvalidKeyUsageExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KeyUnavailableException": - case "com.amazonaws.kms#KeyUnavailableException": - throw await de_KeyUnavailableExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kms#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: RevokeGrantCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1GenerateDataKeyWithoutPlaintextCommand + * deserializeAws_json1_1ScheduleKeyDeletionCommand */ -export const de_GenerateDataKeyWithoutPlaintextCommand = async ( +export const de_ScheduleKeyDeletionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GenerateDataKeyWithoutPlaintextCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GenerateDataKeyWithoutPlaintextResponse(data, context); - const response: GenerateDataKeyWithoutPlaintextCommandOutput = { + contents = de_ScheduleKeyDeletionResponse(data, context); + const response: ScheduleKeyDeletionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2256,1684 +1682,125 @@ export const de_GenerateDataKeyWithoutPlaintextCommand = async ( }; /** - * deserializeAws_json1_1GenerateDataKeyWithoutPlaintextCommandError + * deserializeAws_json1_1SignCommand */ -const de_GenerateDataKeyWithoutPlaintextCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "DryRunOperationException": - case "com.amazonaws.kms#DryRunOperationException": - throw await de_DryRunOperationExceptionRes(parsedOutput, context); - case "InvalidGrantTokenException": - case "com.amazonaws.kms#InvalidGrantTokenException": - throw await de_InvalidGrantTokenExceptionRes(parsedOutput, context); - case "InvalidKeyUsageException": - case "com.amazonaws.kms#InvalidKeyUsageException": - throw await de_InvalidKeyUsageExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KeyUnavailableException": - case "com.amazonaws.kms#KeyUnavailableException": - throw await de_KeyUnavailableExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_SignCommand = async (output: __HttpResponse, context: __SerdeContext): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SignResponse(data, context); + const response: SignCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GenerateMacCommand + * deserializeAws_json1_1TagResourceCommand */ -export const de_GenerateMacCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GenerateMacCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GenerateMacResponse(data, context); - const response: GenerateMacCommandOutput = { + await collectBody(output.body, context); + const response: TagResourceCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1GenerateMacCommandError + * deserializeAws_json1_1UntagResourceCommand */ -const de_GenerateMacCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "DryRunOperationException": - case "com.amazonaws.kms#DryRunOperationException": - throw await de_DryRunOperationExceptionRes(parsedOutput, context); - case "InvalidGrantTokenException": - case "com.amazonaws.kms#InvalidGrantTokenException": - throw await de_InvalidGrantTokenExceptionRes(parsedOutput, context); - case "InvalidKeyUsageException": - case "com.amazonaws.kms#InvalidKeyUsageException": - throw await de_InvalidKeyUsageExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KeyUnavailableException": - case "com.amazonaws.kms#KeyUnavailableException": - throw await de_KeyUnavailableExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1GenerateRandomCommand + * deserializeAws_json1_1UpdateAliasCommand */ -export const de_GenerateRandomCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GenerateRandomCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GenerateRandomResponse(data, context); - const response: GenerateRandomCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GenerateRandomCommandError - */ -const de_GenerateRandomCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomKeyStoreInvalidStateException": - case "com.amazonaws.kms#CustomKeyStoreInvalidStateException": - throw await de_CustomKeyStoreInvalidStateExceptionRes(parsedOutput, context); - case "CustomKeyStoreNotFoundException": - case "com.amazonaws.kms#CustomKeyStoreNotFoundException": - throw await de_CustomKeyStoreNotFoundExceptionRes(parsedOutput, context); - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kms#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetKeyPolicyCommand - */ -export const de_GetKeyPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetKeyPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetKeyPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetKeyPolicyCommandError - */ -const de_GetKeyPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetKeyRotationStatusCommand - */ -export const de_GetKeyRotationStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetKeyRotationStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetKeyRotationStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetKeyRotationStatusCommandError - */ -const de_GetKeyRotationStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kms#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetParametersForImportCommand - */ -export const de_GetParametersForImportCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetParametersForImportCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetParametersForImportResponse(data, context); - const response: GetParametersForImportCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetParametersForImportCommandError - */ -const de_GetParametersForImportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kms#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetPublicKeyCommand - */ -export const de_GetPublicKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetPublicKeyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetPublicKeyResponse(data, context); - const response: GetPublicKeyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetPublicKeyCommandError - */ -const de_GetPublicKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidGrantTokenException": - case "com.amazonaws.kms#InvalidGrantTokenException": - throw await de_InvalidGrantTokenExceptionRes(parsedOutput, context); - case "InvalidKeyUsageException": - case "com.amazonaws.kms#InvalidKeyUsageException": - throw await de_InvalidKeyUsageExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KeyUnavailableException": - case "com.amazonaws.kms#KeyUnavailableException": - throw await de_KeyUnavailableExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kms#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ImportKeyMaterialCommand - */ -export const de_ImportKeyMaterialCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ImportKeyMaterialCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ImportKeyMaterialCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ImportKeyMaterialCommandError - */ -const de_ImportKeyMaterialCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "ExpiredImportTokenException": - case "com.amazonaws.kms#ExpiredImportTokenException": - throw await de_ExpiredImportTokenExceptionRes(parsedOutput, context); - case "IncorrectKeyMaterialException": - case "com.amazonaws.kms#IncorrectKeyMaterialException": - throw await de_IncorrectKeyMaterialExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidCiphertextException": - case "com.amazonaws.kms#InvalidCiphertextException": - throw await de_InvalidCiphertextExceptionRes(parsedOutput, context); - case "InvalidImportTokenException": - case "com.amazonaws.kms#InvalidImportTokenException": - throw await de_InvalidImportTokenExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kms#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAliasesCommand - */ -export const de_ListAliasesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAliasesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListAliasesResponse(data, context); - const response: ListAliasesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAliasesCommandError - */ -const de_ListAliasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidMarkerException": - case "com.amazonaws.kms#InvalidMarkerException": - throw await de_InvalidMarkerExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListGrantsCommand - */ -export const de_ListGrantsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListGrantsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListGrantsResponse(data, context); - const response: ListGrantsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListGrantsCommandError - */ -const de_ListGrantsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidGrantIdException": - case "com.amazonaws.kms#InvalidGrantIdException": - throw await de_InvalidGrantIdExceptionRes(parsedOutput, context); - case "InvalidMarkerException": - case "com.amazonaws.kms#InvalidMarkerException": - throw await de_InvalidMarkerExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListKeyPoliciesCommand - */ -export const de_ListKeyPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListKeyPoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListKeyPoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListKeyPoliciesCommandError - */ -const de_ListKeyPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListKeysCommand - */ -export const de_ListKeysCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListKeysCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListKeysCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListKeysCommandError - */ -const de_ListKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidMarkerException": - case "com.amazonaws.kms#InvalidMarkerException": - throw await de_InvalidMarkerExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListResourceTagsCommand - */ -export const de_ListResourceTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListResourceTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListResourceTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListResourceTagsCommandError - */ -const de_ListResourceTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidMarkerException": - case "com.amazonaws.kms#InvalidMarkerException": - throw await de_InvalidMarkerExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRetirableGrantsCommand - */ -export const de_ListRetirableGrantsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRetirableGrantsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListGrantsResponse(data, context); - const response: ListRetirableGrantsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRetirableGrantsCommandError - */ -const de_ListRetirableGrantsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidMarkerException": - case "com.amazonaws.kms#InvalidMarkerException": - throw await de_InvalidMarkerExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutKeyPolicyCommand - */ -export const de_PutKeyPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutKeyPolicyCommandError(output, context); - } - await collectBody(output.body, context); - const response: PutKeyPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1PutKeyPolicyCommandError - */ -const de_PutKeyPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedPolicyDocumentException": - case "com.amazonaws.kms#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kms#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ReEncryptCommand - */ -export const de_ReEncryptCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ReEncryptCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ReEncryptResponse(data, context); - const response: ReEncryptCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ReEncryptCommandError - */ -const de_ReEncryptCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "DryRunOperationException": - case "com.amazonaws.kms#DryRunOperationException": - throw await de_DryRunOperationExceptionRes(parsedOutput, context); - case "IncorrectKeyException": - case "com.amazonaws.kms#IncorrectKeyException": - throw await de_IncorrectKeyExceptionRes(parsedOutput, context); - case "InvalidCiphertextException": - case "com.amazonaws.kms#InvalidCiphertextException": - throw await de_InvalidCiphertextExceptionRes(parsedOutput, context); - case "InvalidGrantTokenException": - case "com.amazonaws.kms#InvalidGrantTokenException": - throw await de_InvalidGrantTokenExceptionRes(parsedOutput, context); - case "InvalidKeyUsageException": - case "com.amazonaws.kms#InvalidKeyUsageException": - throw await de_InvalidKeyUsageExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KeyUnavailableException": - case "com.amazonaws.kms#KeyUnavailableException": - throw await de_KeyUnavailableExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ReplicateKeyCommand - */ -export const de_ReplicateKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ReplicateKeyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ReplicateKeyResponse(data, context); - const response: ReplicateKeyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ReplicateKeyCommandError - */ -const de_ReplicateKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.kms#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedPolicyDocumentException": - case "com.amazonaws.kms#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TagException": - case "com.amazonaws.kms#TagException": - throw await de_TagExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kms#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RetireGrantCommand - */ -export const de_RetireGrantCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RetireGrantCommandError(output, context); - } - await collectBody(output.body, context); - const response: RetireGrantCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1RetireGrantCommandError - */ -const de_RetireGrantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "DryRunOperationException": - case "com.amazonaws.kms#DryRunOperationException": - throw await de_DryRunOperationExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidGrantIdException": - case "com.amazonaws.kms#InvalidGrantIdException": - throw await de_InvalidGrantIdExceptionRes(parsedOutput, context); - case "InvalidGrantTokenException": - case "com.amazonaws.kms#InvalidGrantTokenException": - throw await de_InvalidGrantTokenExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RevokeGrantCommand - */ -export const de_RevokeGrantCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RevokeGrantCommandError(output, context); - } - await collectBody(output.body, context); - const response: RevokeGrantCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1RevokeGrantCommandError - */ -const de_RevokeGrantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "DryRunOperationException": - case "com.amazonaws.kms#DryRunOperationException": - throw await de_DryRunOperationExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "InvalidGrantIdException": - case "com.amazonaws.kms#InvalidGrantIdException": - throw await de_InvalidGrantIdExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ScheduleKeyDeletionCommand - */ -export const de_ScheduleKeyDeletionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ScheduleKeyDeletionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ScheduleKeyDeletionResponse(data, context); - const response: ScheduleKeyDeletionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ScheduleKeyDeletionCommandError - */ -const de_ScheduleKeyDeletionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1SignCommand - */ -export const de_SignCommand = async (output: __HttpResponse, context: __SerdeContext): Promise => { - if (output.statusCode >= 300) { - return de_SignCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SignResponse(data, context); - const response: SignCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1SignCommandError - */ -const de_SignCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "DryRunOperationException": - case "com.amazonaws.kms#DryRunOperationException": - throw await de_DryRunOperationExceptionRes(parsedOutput, context); - case "InvalidGrantTokenException": - case "com.amazonaws.kms#InvalidGrantTokenException": - throw await de_InvalidGrantTokenExceptionRes(parsedOutput, context); - case "InvalidKeyUsageException": - case "com.amazonaws.kms#InvalidKeyUsageException": - throw await de_InvalidKeyUsageExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KeyUnavailableException": - case "com.amazonaws.kms#KeyUnavailableException": - throw await de_KeyUnavailableExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - await collectBody(output.body, context); - const response: TagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TagException": - case "com.amazonaws.kms#TagException": - throw await de_TagExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UntagResourceCommand - */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - await collectBody(output.body, context); - const response: UntagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TagException": - case "com.amazonaws.kms#TagException": - throw await de_TagExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateAliasCommand - */ -export const de_UpdateAliasCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateAliasCommandError(output, context); - } - await collectBody(output.body, context); - const response: UpdateAliasCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateAliasCommandError - */ -const de_UpdateAliasCommandError = async ( +export const de_UpdateAliasCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.kms#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateCustomKeyStoreCommand - */ -export const de_UpdateCustomKeyStoreCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { if (output.statusCode >= 300) { - return de_UpdateCustomKeyStoreCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateCustomKeyStoreCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateCustomKeyStoreCommandError - */ -const de_UpdateCustomKeyStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CloudHsmClusterInvalidConfigurationException": - case "com.amazonaws.kms#CloudHsmClusterInvalidConfigurationException": - throw await de_CloudHsmClusterInvalidConfigurationExceptionRes(parsedOutput, context); - case "CloudHsmClusterNotActiveException": - case "com.amazonaws.kms#CloudHsmClusterNotActiveException": - throw await de_CloudHsmClusterNotActiveExceptionRes(parsedOutput, context); - case "CloudHsmClusterNotFoundException": - case "com.amazonaws.kms#CloudHsmClusterNotFoundException": - throw await de_CloudHsmClusterNotFoundExceptionRes(parsedOutput, context); - case "CloudHsmClusterNotRelatedException": - case "com.amazonaws.kms#CloudHsmClusterNotRelatedException": - throw await de_CloudHsmClusterNotRelatedExceptionRes(parsedOutput, context); - case "CustomKeyStoreInvalidStateException": - case "com.amazonaws.kms#CustomKeyStoreInvalidStateException": - throw await de_CustomKeyStoreInvalidStateExceptionRes(parsedOutput, context); - case "CustomKeyStoreNameInUseException": - case "com.amazonaws.kms#CustomKeyStoreNameInUseException": - throw await de_CustomKeyStoreNameInUseExceptionRes(parsedOutput, context); - case "CustomKeyStoreNotFoundException": - case "com.amazonaws.kms#CustomKeyStoreNotFoundException": - throw await de_CustomKeyStoreNotFoundExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "XksProxyIncorrectAuthenticationCredentialException": - case "com.amazonaws.kms#XksProxyIncorrectAuthenticationCredentialException": - throw await de_XksProxyIncorrectAuthenticationCredentialExceptionRes(parsedOutput, context); - case "XksProxyInvalidConfigurationException": - case "com.amazonaws.kms#XksProxyInvalidConfigurationException": - throw await de_XksProxyInvalidConfigurationExceptionRes(parsedOutput, context); - case "XksProxyInvalidResponseException": - case "com.amazonaws.kms#XksProxyInvalidResponseException": - throw await de_XksProxyInvalidResponseExceptionRes(parsedOutput, context); - case "XksProxyUriEndpointInUseException": - case "com.amazonaws.kms#XksProxyUriEndpointInUseException": - throw await de_XksProxyUriEndpointInUseExceptionRes(parsedOutput, context); - case "XksProxyUriInUseException": - case "com.amazonaws.kms#XksProxyUriInUseException": - throw await de_XksProxyUriInUseExceptionRes(parsedOutput, context); - case "XksProxyUriUnreachableException": - case "com.amazonaws.kms#XksProxyUriUnreachableException": - throw await de_XksProxyUriUnreachableExceptionRes(parsedOutput, context); - case "XksProxyVpcEndpointServiceInUseException": - case "com.amazonaws.kms#XksProxyVpcEndpointServiceInUseException": - throw await de_XksProxyVpcEndpointServiceInUseExceptionRes(parsedOutput, context); - case "XksProxyVpcEndpointServiceInvalidConfigurationException": - case "com.amazonaws.kms#XksProxyVpcEndpointServiceInvalidConfigurationException": - throw await de_XksProxyVpcEndpointServiceInvalidConfigurationExceptionRes(parsedOutput, context); - case "XksProxyVpcEndpointServiceNotFoundException": - case "com.amazonaws.kms#XksProxyVpcEndpointServiceNotFoundException": - throw await de_XksProxyVpcEndpointServiceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateKeyDescriptionCommand - */ -export const de_UpdateKeyDescriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateKeyDescriptionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UpdateKeyDescriptionCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateKeyDescriptionCommandError - */ -const de_UpdateKeyDescriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + const response: UpdateAliasCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_json1_1UpdateCustomKeyStoreCommand + */ +export const de_UpdateCustomKeyStoreCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateCustomKeyStoreCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdatePrimaryRegionCommand + * deserializeAws_json1_1UpdateKeyDescriptionCommand */ -export const de_UpdatePrimaryRegionCommand = async ( +export const de_UpdateKeyDescriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdatePrimaryRegionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UpdatePrimaryRegionCommandOutput = { + const response: UpdateKeyDescriptionCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1UpdatePrimaryRegionCommandError + * deserializeAws_json1_1UpdatePrimaryRegionCommand */ -const de_UpdatePrimaryRegionCommandError = async ( +export const de_UpdatePrimaryRegionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "InvalidArnException": - case "com.amazonaws.kms#InvalidArnException": - throw await de_InvalidArnExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.kms#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UpdatePrimaryRegionCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** @@ -3944,7 +1811,7 @@ export const de_VerifyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_VerifyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3956,56 +1823,6 @@ export const de_VerifyCommand = async ( return response; }; -/** - * deserializeAws_json1_1VerifyCommandError - */ -const de_VerifyCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependencyTimeoutException": - case "com.amazonaws.kms#DependencyTimeoutException": - throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); - case "DisabledException": - case "com.amazonaws.kms#DisabledException": - throw await de_DisabledExceptionRes(parsedOutput, context); - case "DryRunOperationException": - case "com.amazonaws.kms#DryRunOperationException": - throw await de_DryRunOperationExceptionRes(parsedOutput, context); - case "InvalidGrantTokenException": - case "com.amazonaws.kms#InvalidGrantTokenException": - throw await de_InvalidGrantTokenExceptionRes(parsedOutput, context); - case "InvalidKeyUsageException": - case "com.amazonaws.kms#InvalidKeyUsageException": - throw await de_InvalidKeyUsageExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidSignatureException": - case "com.amazonaws.kms#KMSInvalidSignatureException": - throw await de_KMSInvalidSignatureExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KeyUnavailableException": - case "com.amazonaws.kms#KeyUnavailableException": - throw await de_KeyUnavailableExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1VerifyMacCommand */ @@ -4014,7 +1831,7 @@ export const de_VerifyMacCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_VerifyMacCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4027,18 +1844,90 @@ export const de_VerifyMacCommand = async ( }; /** - * deserializeAws_json1_1VerifyMacCommandError + * deserialize_Aws_json1_1CommandError */ -const de_VerifyMacCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "DependencyTimeoutException": + case "com.amazonaws.kms#DependencyTimeoutException": + throw await de_DependencyTimeoutExceptionRes(parsedOutput, context); + case "InvalidArnException": + case "com.amazonaws.kms#InvalidArnException": + throw await de_InvalidArnExceptionRes(parsedOutput, context); + case "KMSInternalException": + case "com.amazonaws.kms#KMSInternalException": + throw await de_KMSInternalExceptionRes(parsedOutput, context); + case "KMSInvalidStateException": + case "com.amazonaws.kms#KMSInvalidStateException": + throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.kms#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); + case "CloudHsmClusterInvalidConfigurationException": + case "com.amazonaws.kms#CloudHsmClusterInvalidConfigurationException": + throw await de_CloudHsmClusterInvalidConfigurationExceptionRes(parsedOutput, context); + case "CloudHsmClusterNotActiveException": + case "com.amazonaws.kms#CloudHsmClusterNotActiveException": + throw await de_CloudHsmClusterNotActiveExceptionRes(parsedOutput, context); + case "CustomKeyStoreInvalidStateException": + case "com.amazonaws.kms#CustomKeyStoreInvalidStateException": + throw await de_CustomKeyStoreInvalidStateExceptionRes(parsedOutput, context); + case "CustomKeyStoreNotFoundException": + case "com.amazonaws.kms#CustomKeyStoreNotFoundException": + throw await de_CustomKeyStoreNotFoundExceptionRes(parsedOutput, context); + case "AlreadyExistsException": + case "com.amazonaws.kms#AlreadyExistsException": + throw await de_AlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidAliasNameException": + case "com.amazonaws.kms#InvalidAliasNameException": + throw await de_InvalidAliasNameExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.kms#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "CloudHsmClusterInUseException": + case "com.amazonaws.kms#CloudHsmClusterInUseException": + throw await de_CloudHsmClusterInUseExceptionRes(parsedOutput, context); + case "CloudHsmClusterNotFoundException": + case "com.amazonaws.kms#CloudHsmClusterNotFoundException": + throw await de_CloudHsmClusterNotFoundExceptionRes(parsedOutput, context); + case "CustomKeyStoreNameInUseException": + case "com.amazonaws.kms#CustomKeyStoreNameInUseException": + throw await de_CustomKeyStoreNameInUseExceptionRes(parsedOutput, context); + case "IncorrectTrustAnchorException": + case "com.amazonaws.kms#IncorrectTrustAnchorException": + throw await de_IncorrectTrustAnchorExceptionRes(parsedOutput, context); + case "XksProxyIncorrectAuthenticationCredentialException": + case "com.amazonaws.kms#XksProxyIncorrectAuthenticationCredentialException": + throw await de_XksProxyIncorrectAuthenticationCredentialExceptionRes(parsedOutput, context); + case "XksProxyInvalidConfigurationException": + case "com.amazonaws.kms#XksProxyInvalidConfigurationException": + throw await de_XksProxyInvalidConfigurationExceptionRes(parsedOutput, context); + case "XksProxyInvalidResponseException": + case "com.amazonaws.kms#XksProxyInvalidResponseException": + throw await de_XksProxyInvalidResponseExceptionRes(parsedOutput, context); + case "XksProxyUriEndpointInUseException": + case "com.amazonaws.kms#XksProxyUriEndpointInUseException": + throw await de_XksProxyUriEndpointInUseExceptionRes(parsedOutput, context); + case "XksProxyUriInUseException": + case "com.amazonaws.kms#XksProxyUriInUseException": + throw await de_XksProxyUriInUseExceptionRes(parsedOutput, context); + case "XksProxyUriUnreachableException": + case "com.amazonaws.kms#XksProxyUriUnreachableException": + throw await de_XksProxyUriUnreachableExceptionRes(parsedOutput, context); + case "XksProxyVpcEndpointServiceInUseException": + case "com.amazonaws.kms#XksProxyVpcEndpointServiceInUseException": + throw await de_XksProxyVpcEndpointServiceInUseExceptionRes(parsedOutput, context); + case "XksProxyVpcEndpointServiceInvalidConfigurationException": + case "com.amazonaws.kms#XksProxyVpcEndpointServiceInvalidConfigurationException": + throw await de_XksProxyVpcEndpointServiceInvalidConfigurationExceptionRes(parsedOutput, context); + case "XksProxyVpcEndpointServiceNotFoundException": + case "com.amazonaws.kms#XksProxyVpcEndpointServiceNotFoundException": + throw await de_XksProxyVpcEndpointServiceNotFoundExceptionRes(parsedOutput, context); case "DisabledException": case "com.amazonaws.kms#DisabledException": throw await de_DisabledExceptionRes(parsedOutput, context); @@ -4048,31 +1937,70 @@ const de_VerifyMacCommandError = async ( case "InvalidGrantTokenException": case "com.amazonaws.kms#InvalidGrantTokenException": throw await de_InvalidGrantTokenExceptionRes(parsedOutput, context); + case "MalformedPolicyDocumentException": + case "com.amazonaws.kms#MalformedPolicyDocumentException": + throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); + case "TagException": + case "com.amazonaws.kms#TagException": + throw await de_TagExceptionRes(parsedOutput, context); + case "UnsupportedOperationException": + case "com.amazonaws.kms#UnsupportedOperationException": + throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); + case "XksKeyAlreadyInUseException": + case "com.amazonaws.kms#XksKeyAlreadyInUseException": + throw await de_XksKeyAlreadyInUseExceptionRes(parsedOutput, context); + case "XksKeyInvalidConfigurationException": + case "com.amazonaws.kms#XksKeyInvalidConfigurationException": + throw await de_XksKeyInvalidConfigurationExceptionRes(parsedOutput, context); + case "XksKeyNotFoundException": + case "com.amazonaws.kms#XksKeyNotFoundException": + throw await de_XksKeyNotFoundExceptionRes(parsedOutput, context); + case "IncorrectKeyException": + case "com.amazonaws.kms#IncorrectKeyException": + throw await de_IncorrectKeyExceptionRes(parsedOutput, context); + case "InvalidCiphertextException": + case "com.amazonaws.kms#InvalidCiphertextException": + throw await de_InvalidCiphertextExceptionRes(parsedOutput, context); case "InvalidKeyUsageException": case "com.amazonaws.kms#InvalidKeyUsageException": throw await de_InvalidKeyUsageExceptionRes(parsedOutput, context); - case "KMSInternalException": - case "com.amazonaws.kms#KMSInternalException": - throw await de_KMSInternalExceptionRes(parsedOutput, context); - case "KMSInvalidMacException": - case "com.amazonaws.kms#KMSInvalidMacException": - throw await de_KMSInvalidMacExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.kms#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); case "KeyUnavailableException": case "com.amazonaws.kms#KeyUnavailableException": throw await de_KeyUnavailableExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.kms#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); + case "CustomKeyStoreHasCMKsException": + case "com.amazonaws.kms#CustomKeyStoreHasCMKsException": + throw await de_CustomKeyStoreHasCMKsExceptionRes(parsedOutput, context); + case "InvalidMarkerException": + case "com.amazonaws.kms#InvalidMarkerException": + throw await de_InvalidMarkerExceptionRes(parsedOutput, context); + case "ExpiredImportTokenException": + case "com.amazonaws.kms#ExpiredImportTokenException": + throw await de_ExpiredImportTokenExceptionRes(parsedOutput, context); + case "IncorrectKeyMaterialException": + case "com.amazonaws.kms#IncorrectKeyMaterialException": + throw await de_IncorrectKeyMaterialExceptionRes(parsedOutput, context); + case "InvalidImportTokenException": + case "com.amazonaws.kms#InvalidImportTokenException": + throw await de_InvalidImportTokenExceptionRes(parsedOutput, context); + case "InvalidGrantIdException": + case "com.amazonaws.kms#InvalidGrantIdException": + throw await de_InvalidGrantIdExceptionRes(parsedOutput, context); + case "CloudHsmClusterNotRelatedException": + case "com.amazonaws.kms#CloudHsmClusterNotRelatedException": + throw await de_CloudHsmClusterNotRelatedExceptionRes(parsedOutput, context); + case "KMSInvalidSignatureException": + case "com.amazonaws.kms#KMSInvalidSignatureException": + throw await de_KMSInvalidSignatureExceptionRes(parsedOutput, context); + case "KMSInvalidMacException": + case "com.amazonaws.kms#KMSInvalidMacException": + throw await de_KMSInvalidMacExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-lakeformation/src/protocols/Aws_restJson1.ts b/clients/client-lakeformation/src/protocols/Aws_restJson1.ts index 14c55ec7443f..cc48dc173a9c 100644 --- a/clients/client-lakeformation/src/protocols/Aws_restJson1.ts +++ b/clients/client-lakeformation/src/protocols/Aws_restJson1.ts @@ -1570,7 +1570,7 @@ export const de_AddLFTagsToResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AddLFTagsToResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1583,47 +1583,6 @@ export const de_AddLFTagsToResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddLFTagsToResourceCommandError - */ -const de_AddLFTagsToResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.lakeformation#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssumeDecoratedRoleWithSAMLCommand */ @@ -1632,7 +1591,7 @@ export const de_AssumeDecoratedRoleWithSAMLCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssumeDecoratedRoleWithSAMLCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1648,44 +1607,6 @@ export const de_AssumeDecoratedRoleWithSAMLCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssumeDecoratedRoleWithSAMLCommandError - */ -const de_AssumeDecoratedRoleWithSAMLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGrantPermissionsCommand */ @@ -1694,7 +1615,7 @@ export const de_BatchGrantPermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGrantPermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1707,35 +1628,6 @@ export const de_BatchGrantPermissionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGrantPermissionsCommandError - */ -const de_BatchGrantPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchRevokePermissionsCommand */ @@ -1744,7 +1636,7 @@ export const de_BatchRevokePermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchRevokePermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1757,35 +1649,6 @@ export const de_BatchRevokePermissionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchRevokePermissionsCommandError - */ -const de_BatchRevokePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelTransactionCommand */ @@ -1794,7 +1657,7 @@ export const de_CancelTransactionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelTransactionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1803,50 +1666,6 @@ export const de_CancelTransactionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelTransactionCommandError - */ -const de_CancelTransactionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.lakeformation#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "TransactionCommitInProgressException": - case "com.amazonaws.lakeformation#TransactionCommitInProgressException": - throw await de_TransactionCommitInProgressExceptionRes(parsedOutput, context); - case "TransactionCommittedException": - case "com.amazonaws.lakeformation#TransactionCommittedException": - throw await de_TransactionCommittedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CommitTransactionCommand */ @@ -1855,7 +1674,7 @@ export const de_CommitTransactionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CommitTransactionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1868,47 +1687,6 @@ export const de_CommitTransactionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CommitTransactionCommandError - */ -const de_CommitTransactionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.lakeformation#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "TransactionCanceledException": - case "com.amazonaws.lakeformation#TransactionCanceledException": - throw await de_TransactionCanceledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDataCellsFilterCommand */ @@ -1917,7 +1695,7 @@ export const de_CreateDataCellsFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDataCellsFilterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1926,50 +1704,6 @@ export const de_CreateDataCellsFilterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDataCellsFilterCommandError - */ -const de_CreateDataCellsFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AlreadyExistsException": - case "com.amazonaws.lakeformation#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.lakeformation#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLakeFormationIdentityCenterConfigurationCommand */ @@ -1978,7 +1712,7 @@ export const de_CreateLakeFormationIdentityCenterConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLakeFormationIdentityCenterConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1992,55 +1726,14 @@ export const de_CreateLakeFormationIdentityCenterConfigurationCommand = async ( }; /** - * deserializeAws_restJson1CreateLakeFormationIdentityCenterConfigurationCommandError + * deserializeAws_restJson1CreateLakeFormationOptInCommand */ -const de_CreateLakeFormationIdentityCenterConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AlreadyExistsException": - case "com.amazonaws.lakeformation#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.lakeformation#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateLakeFormationOptInCommand - */ -export const de_CreateLakeFormationOptInCommand = async ( +export const de_CreateLakeFormationOptInCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLakeFormationOptInCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2049,47 +1742,6 @@ export const de_CreateLakeFormationOptInCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLakeFormationOptInCommandError - */ -const de_CreateLakeFormationOptInCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.lakeformation#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLFTagCommand */ @@ -2098,7 +1750,7 @@ export const de_CreateLFTagCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLFTagCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2107,47 +1759,6 @@ export const de_CreateLFTagCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLFTagCommandError - */ -const de_CreateLFTagCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.lakeformation#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDataCellsFilterCommand */ @@ -2156,7 +1767,7 @@ export const de_DeleteDataCellsFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDataCellsFilterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2165,44 +1776,6 @@ export const de_DeleteDataCellsFilterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDataCellsFilterCommandError - */ -const de_DeleteDataCellsFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteLakeFormationIdentityCenterConfigurationCommand */ @@ -2211,7 +1784,7 @@ export const de_DeleteLakeFormationIdentityCenterConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLakeFormationIdentityCenterConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2220,47 +1793,6 @@ export const de_DeleteLakeFormationIdentityCenterConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLakeFormationIdentityCenterConfigurationCommandError - */ -const de_DeleteLakeFormationIdentityCenterConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.lakeformation#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteLakeFormationOptInCommand */ @@ -2269,7 +1801,7 @@ export const de_DeleteLakeFormationOptInCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLakeFormationOptInCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2278,47 +1810,6 @@ export const de_DeleteLakeFormationOptInCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLakeFormationOptInCommandError - */ -const de_DeleteLakeFormationOptInCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.lakeformation#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteLFTagCommand */ @@ -2327,7 +1818,7 @@ export const de_DeleteLFTagCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLFTagCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2336,44 +1827,6 @@ export const de_DeleteLFTagCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLFTagCommandError - */ -const de_DeleteLFTagCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteObjectsOnCancelCommand */ @@ -2382,7 +1835,7 @@ export const de_DeleteObjectsOnCancelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteObjectsOnCancelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2392,61 +1845,14 @@ export const de_DeleteObjectsOnCancelCommand = async ( }; /** - * deserializeAws_restJson1DeleteObjectsOnCancelCommandError + * deserializeAws_restJson1DeregisterResourceCommand */ -const de_DeleteObjectsOnCancelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.lakeformation#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.lakeformation#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "TransactionCanceledException": - case "com.amazonaws.lakeformation#TransactionCanceledException": - throw await de_TransactionCanceledExceptionRes(parsedOutput, context); - case "TransactionCommittedException": - case "com.amazonaws.lakeformation#TransactionCommittedException": - throw await de_TransactionCommittedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeregisterResourceCommand - */ -export const de_DeregisterResourceCommand = async ( +export const de_DeregisterResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeregisterResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2455,41 +1861,6 @@ export const de_DeregisterResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeregisterResourceCommandError - */ -const de_DeregisterResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeLakeFormationIdentityCenterConfigurationCommand */ @@ -2498,7 +1869,7 @@ export const de_DescribeLakeFormationIdentityCenterConfigurationCommand = async context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeLakeFormationIdentityCenterConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2514,44 +1885,6 @@ export const de_DescribeLakeFormationIdentityCenterConfigurationCommand = async return contents; }; -/** - * deserializeAws_restJson1DescribeLakeFormationIdentityCenterConfigurationCommandError - */ -const de_DescribeLakeFormationIdentityCenterConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeResourceCommand */ @@ -2560,7 +1893,7 @@ export const de_DescribeResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2573,41 +1906,6 @@ export const de_DescribeResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeResourceCommandError - */ -const de_DescribeResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeTransactionCommand */ @@ -2616,7 +1914,7 @@ export const de_DescribeTransactionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTransactionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2629,41 +1927,6 @@ export const de_DescribeTransactionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeTransactionCommandError - */ -const de_DescribeTransactionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExtendTransactionCommand */ @@ -2672,7 +1935,7 @@ export const de_ExtendTransactionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExtendTransactionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2681,50 +1944,6 @@ export const de_ExtendTransactionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExtendTransactionCommandError - */ -const de_ExtendTransactionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "TransactionCanceledException": - case "com.amazonaws.lakeformation#TransactionCanceledException": - throw await de_TransactionCanceledExceptionRes(parsedOutput, context); - case "TransactionCommitInProgressException": - case "com.amazonaws.lakeformation#TransactionCommitInProgressException": - throw await de_TransactionCommitInProgressExceptionRes(parsedOutput, context); - case "TransactionCommittedException": - case "com.amazonaws.lakeformation#TransactionCommittedException": - throw await de_TransactionCommittedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDataCellsFilterCommand */ @@ -2733,7 +1952,7 @@ export const de_GetDataCellsFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataCellsFilterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2746,44 +1965,6 @@ export const de_GetDataCellsFilterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDataCellsFilterCommandError - */ -const de_GetDataCellsFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDataLakeSettingsCommand */ @@ -2792,7 +1973,7 @@ export const de_GetDataLakeSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataLakeSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2806,46 +1987,14 @@ export const de_GetDataLakeSettingsCommand = async ( }; /** - * deserializeAws_restJson1GetDataLakeSettingsCommandError + * deserializeAws_restJson1GetEffectivePermissionsForPathCommand */ -const de_GetDataLakeSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEffectivePermissionsForPathCommand - */ -export const de_GetEffectivePermissionsForPathCommand = async ( +export const de_GetEffectivePermissionsForPathCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEffectivePermissionsForPathCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2859,41 +2008,6 @@ export const de_GetEffectivePermissionsForPathCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEffectivePermissionsForPathCommandError - */ -const de_GetEffectivePermissionsForPathCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLFTagCommand */ @@ -2902,7 +2016,7 @@ export const de_GetLFTagCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLFTagCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2917,44 +2031,6 @@ export const de_GetLFTagCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLFTagCommandError - */ -const de_GetLFTagCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetQueryStateCommand */ @@ -2963,7 +2039,7 @@ export const de_GetQueryStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetQueryStateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2977,38 +2053,6 @@ export const de_GetQueryStateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetQueryStateCommandError - */ -const de_GetQueryStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetQueryStatisticsCommand */ @@ -3017,7 +2061,7 @@ export const de_GetQueryStatisticsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetQueryStatisticsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3032,47 +2076,6 @@ export const de_GetQueryStatisticsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetQueryStatisticsCommandError - */ -const de_GetQueryStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ExpiredException": - case "com.amazonaws.lakeformation#ExpiredException": - throw await de_ExpiredExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "StatisticsNotReadyYetException": - case "com.amazonaws.lakeformation#StatisticsNotReadyYetException": - throw await de_StatisticsNotReadyYetExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.lakeformation#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetResourceLFTagsCommand */ @@ -3081,7 +2084,7 @@ export const de_GetResourceLFTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourceLFTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3096,47 +2099,6 @@ export const de_GetResourceLFTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetResourceLFTagsCommandError - */ -const de_GetResourceLFTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.lakeformation#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTableObjectsCommand */ @@ -3145,7 +2107,7 @@ export const de_GetTableObjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTableObjectsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3159,50 +2121,6 @@ export const de_GetTableObjectsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTableObjectsCommandError - */ -const de_GetTableObjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.lakeformation#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "TransactionCanceledException": - case "com.amazonaws.lakeformation#TransactionCanceledException": - throw await de_TransactionCanceledExceptionRes(parsedOutput, context); - case "TransactionCommittedException": - case "com.amazonaws.lakeformation#TransactionCommittedException": - throw await de_TransactionCommittedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTemporaryGluePartitionCredentialsCommand */ @@ -3211,7 +2129,7 @@ export const de_GetTemporaryGluePartitionCredentialsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTemporaryGluePartitionCredentialsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3228,55 +2146,14 @@ export const de_GetTemporaryGluePartitionCredentialsCommand = async ( }; /** - * deserializeAws_restJson1GetTemporaryGluePartitionCredentialsCommandError + * deserializeAws_restJson1GetTemporaryGlueTableCredentialsCommand */ -const de_GetTemporaryGluePartitionCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "PermissionTypeMismatchException": - case "com.amazonaws.lakeformation#PermissionTypeMismatchException": - throw await de_PermissionTypeMismatchExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetTemporaryGlueTableCredentialsCommand - */ -export const de_GetTemporaryGlueTableCredentialsCommand = async ( +export const de_GetTemporaryGlueTableCredentialsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTemporaryGlueTableCredentialsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3293,47 +2170,6 @@ export const de_GetTemporaryGlueTableCredentialsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTemporaryGlueTableCredentialsCommandError - */ -const de_GetTemporaryGlueTableCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "PermissionTypeMismatchException": - case "com.amazonaws.lakeformation#PermissionTypeMismatchException": - throw await de_PermissionTypeMismatchExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetWorkUnitResultsCommand */ @@ -3342,7 +2178,7 @@ export const de_GetWorkUnitResultsCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkUnitResultsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3353,44 +2189,6 @@ export const de_GetWorkUnitResultsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetWorkUnitResultsCommandError - */ -const de_GetWorkUnitResultsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ExpiredException": - case "com.amazonaws.lakeformation#ExpiredException": - throw await de_ExpiredExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.lakeformation#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetWorkUnitsCommand */ @@ -3399,7 +2197,7 @@ export const de_GetWorkUnitsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkUnitsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3414,44 +2212,6 @@ export const de_GetWorkUnitsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetWorkUnitsCommandError - */ -const de_GetWorkUnitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ExpiredException": - case "com.amazonaws.lakeformation#ExpiredException": - throw await de_ExpiredExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "WorkUnitsNotReadyYetException": - case "com.amazonaws.lakeformation#WorkUnitsNotReadyYetException": - throw await de_WorkUnitsNotReadyYetExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GrantPermissionsCommand */ @@ -3460,7 +2220,7 @@ export const de_GrantPermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GrantPermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3469,38 +2229,6 @@ export const de_GrantPermissionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GrantPermissionsCommandError - */ -const de_GrantPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.lakeformation#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDataCellsFilterCommand */ @@ -3509,7 +2237,7 @@ export const de_ListDataCellsFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataCellsFilterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3523,41 +2251,6 @@ export const de_ListDataCellsFilterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDataCellsFilterCommandError - */ -const de_ListDataCellsFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListLakeFormationOptInsCommand */ @@ -3566,7 +2259,7 @@ export const de_ListLakeFormationOptInsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLakeFormationOptInsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3581,163 +2274,58 @@ export const de_ListLakeFormationOptInsCommand = async ( }; /** - * deserializeAws_restJson1ListLakeFormationOptInsCommandError + * deserializeAws_restJson1ListLFTagsCommand */ -const de_ListLakeFormationOptInsCommandError = async ( +export const de_ListLFTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LFTags: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListLFTagsCommand + * deserializeAws_restJson1ListPermissionsCommand */ -export const de_ListLFTagsCommand = async ( +export const de_ListPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLFTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - LFTags: _json, NextToken: __expectString, + PrincipalResourcePermissions: (_) => de_PrincipalResourcePermissionsList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListLFTagsCommandError + * deserializeAws_restJson1ListResourcesCommand */ -const de_ListLFTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPermissionsCommand - */ -export const de_ListPermissionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPermissionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - PrincipalResourcePermissions: (_) => de_PrincipalResourcePermissionsList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPermissionsCommandError - */ -const de_ListPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListResourcesCommand - */ -export const de_ListResourcesCommand = async ( +export const de_ListResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3751,38 +2339,6 @@ export const de_ListResourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListResourcesCommandError - */ -const de_ListResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTableStorageOptimizersCommand */ @@ -3791,7 +2347,7 @@ export const de_ListTableStorageOptimizersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTableStorageOptimizersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3805,41 +2361,6 @@ export const de_ListTableStorageOptimizersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTableStorageOptimizersCommandError - */ -const de_ListTableStorageOptimizersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTransactionsCommand */ @@ -3848,7 +2369,7 @@ export const de_ListTransactionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTransactionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3862,38 +2383,6 @@ export const de_ListTransactionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTransactionsCommandError - */ -const de_ListTransactionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutDataLakeSettingsCommand */ @@ -3902,7 +2391,7 @@ export const de_PutDataLakeSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutDataLakeSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3911,35 +2400,6 @@ export const de_PutDataLakeSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutDataLakeSettingsCommandError - */ -const de_PutDataLakeSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RegisterResourceCommand */ @@ -3948,7 +2408,7 @@ export const de_RegisterResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3957,50 +2417,6 @@ export const de_RegisterResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RegisterResourceCommandError - */ -const de_RegisterResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AlreadyExistsException": - case "com.amazonaws.lakeformation#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNumberLimitExceededException": - case "com.amazonaws.lakeformation#ResourceNumberLimitExceededException": - throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RemoveLFTagsFromResourceCommand */ @@ -4009,7 +2425,7 @@ export const de_RemoveLFTagsFromResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveLFTagsFromResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4022,50 +2438,6 @@ export const de_RemoveLFTagsFromResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RemoveLFTagsFromResourceCommandError - */ -const de_RemoveLFTagsFromResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.lakeformation#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.lakeformation#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RevokePermissionsCommand */ @@ -4074,7 +2446,7 @@ export const de_RevokePermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RevokePermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4083,38 +2455,6 @@ export const de_RevokePermissionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RevokePermissionsCommandError - */ -const de_RevokePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.lakeformation#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchDatabasesByLFTagsCommand */ @@ -4123,7 +2463,7 @@ export const de_SearchDatabasesByLFTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchDatabasesByLFTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4137,47 +2477,6 @@ export const de_SearchDatabasesByLFTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchDatabasesByLFTagsCommandError - */ -const de_SearchDatabasesByLFTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.lakeformation#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchTablesByLFTagsCommand */ @@ -4186,7 +2485,7 @@ export const de_SearchTablesByLFTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchTablesByLFTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4200,47 +2499,6 @@ export const de_SearchTablesByLFTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchTablesByLFTagsCommandError - */ -const de_SearchTablesByLFTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "GlueEncryptionException": - case "com.amazonaws.lakeformation#GlueEncryptionException": - throw await de_GlueEncryptionExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartQueryPlanningCommand */ @@ -4249,160 +2507,55 @@ export const de_StartQueryPlanningCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartQueryPlanningCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - QueryId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartQueryPlanningCommandError - */ -const de_StartQueryPlanningCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.lakeformation#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartTransactionCommand - */ -export const de_StartTransactionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartTransactionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - TransactionId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartTransactionCommandError - */ -const de_StartTransactionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + QueryId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateDataCellsFilterCommand + * deserializeAws_restJson1StartTransactionCommand */ -export const de_UpdateDataCellsFilterCommand = async ( +export const de_StartTransactionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDataCellsFilterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + TransactionId: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateDataCellsFilterCommandError + * deserializeAws_restJson1UpdateDataCellsFilterCommand */ -const de_UpdateDataCellsFilterCommandError = async ( +export const de_UpdateDataCellsFilterCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.lakeformation#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -4413,7 +2566,7 @@ export const de_UpdateLakeFormationIdentityCenterConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLakeFormationIdentityCenterConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4422,47 +2575,6 @@ export const de_UpdateLakeFormationIdentityCenterConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLakeFormationIdentityCenterConfigurationCommandError - */ -const de_UpdateLakeFormationIdentityCenterConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.lakeformation#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLFTagCommand */ @@ -4471,7 +2583,7 @@ export const de_UpdateLFTagCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLFTagCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4480,47 +2592,6 @@ export const de_UpdateLFTagCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLFTagCommandError - */ -const de_UpdateLFTagCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lakeformation#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.lakeformation#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateResourceCommand */ @@ -4529,7 +2600,7 @@ export const de_UpdateResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4538,41 +2609,6 @@ export const de_UpdateResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateResourceCommandError - */ -const de_UpdateResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTableObjectsCommand */ @@ -4581,7 +2617,7 @@ export const de_UpdateTableObjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTableObjectsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4590,56 +2626,6 @@ export const de_UpdateTableObjectsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateTableObjectsCommandError - */ -const de_UpdateTableObjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.lakeformation#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.lakeformation#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.lakeformation#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lakeformation#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OperationTimeoutException": - case "com.amazonaws.lakeformation#OperationTimeoutException": - throw await de_OperationTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.lakeformation#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "TransactionCanceledException": - case "com.amazonaws.lakeformation#TransactionCanceledException": - throw await de_TransactionCanceledExceptionRes(parsedOutput, context); - case "TransactionCommitInProgressException": - case "com.amazonaws.lakeformation#TransactionCommitInProgressException": - throw await de_TransactionCommitInProgressExceptionRes(parsedOutput, context); - case "TransactionCommittedException": - case "com.amazonaws.lakeformation#TransactionCommittedException": - throw await de_TransactionCommittedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTableStorageOptimizerCommand */ @@ -4648,7 +2634,7 @@ export const de_UpdateTableStorageOptimizerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTableStorageOptimizerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4662,12 +2648,9 @@ export const de_UpdateTableStorageOptimizerCommand = async ( }; /** - * deserializeAws_restJson1UpdateTableStorageOptimizerCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateTableStorageOptimizerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4677,6 +2660,9 @@ const de_UpdateTableStorageOptimizerCommandError = async ( case "AccessDeniedException": case "com.amazonaws.lakeformation#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.lakeformation#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); case "EntityNotFoundException": case "com.amazonaws.lakeformation#EntityNotFoundException": throw await de_EntityNotFoundExceptionRes(parsedOutput, context); @@ -4686,13 +2672,52 @@ const de_UpdateTableStorageOptimizerCommandError = async ( case "InvalidInputException": case "com.amazonaws.lakeformation#InvalidInputException": throw await de_InvalidInputExceptionRes(parsedOutput, context); + case "OperationTimeoutException": + case "com.amazonaws.lakeformation#OperationTimeoutException": + throw await de_OperationTimeoutExceptionRes(parsedOutput, context); + case "TransactionCommitInProgressException": + case "com.amazonaws.lakeformation#TransactionCommitInProgressException": + throw await de_TransactionCommitInProgressExceptionRes(parsedOutput, context); + case "TransactionCommittedException": + case "com.amazonaws.lakeformation#TransactionCommittedException": + throw await de_TransactionCommittedExceptionRes(parsedOutput, context); + case "TransactionCanceledException": + case "com.amazonaws.lakeformation#TransactionCanceledException": + throw await de_TransactionCanceledExceptionRes(parsedOutput, context); + case "AlreadyExistsException": + case "com.amazonaws.lakeformation#AlreadyExistsException": + throw await de_AlreadyExistsExceptionRes(parsedOutput, context); + case "ResourceNumberLimitExceededException": + case "com.amazonaws.lakeformation#ResourceNumberLimitExceededException": + throw await de_ResourceNumberLimitExceededExceptionRes(parsedOutput, context); + case "ResourceNotReadyException": + case "com.amazonaws.lakeformation#ResourceNotReadyException": + throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); + case "ExpiredException": + case "com.amazonaws.lakeformation#ExpiredException": + throw await de_ExpiredExceptionRes(parsedOutput, context); + case "StatisticsNotReadyYetException": + case "com.amazonaws.lakeformation#StatisticsNotReadyYetException": + throw await de_StatisticsNotReadyYetExceptionRes(parsedOutput, context); + case "ThrottledException": + case "com.amazonaws.lakeformation#ThrottledException": + throw await de_ThrottledExceptionRes(parsedOutput, context); + case "GlueEncryptionException": + case "com.amazonaws.lakeformation#GlueEncryptionException": + throw await de_GlueEncryptionExceptionRes(parsedOutput, context); + case "PermissionTypeMismatchException": + case "com.amazonaws.lakeformation#PermissionTypeMismatchException": + throw await de_PermissionTypeMismatchExceptionRes(parsedOutput, context); + case "WorkUnitsNotReadyYetException": + case "com.amazonaws.lakeformation#WorkUnitsNotReadyYetException": + throw await de_WorkUnitsNotReadyYetExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-lambda/src/protocols/Aws_restJson1.ts b/clients/client-lambda/src/protocols/Aws_restJson1.ts index 6bf27a9bd509..a18f83b072b7 100644 --- a/clients/client-lambda/src/protocols/Aws_restJson1.ts +++ b/clients/client-lambda/src/protocols/Aws_restJson1.ts @@ -1792,7 +1792,7 @@ export const de_AddLayerVersionPermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_AddLayerVersionPermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1806,50 +1806,6 @@ export const de_AddLayerVersionPermissionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddLayerVersionPermissionCommandError - */ -const de_AddLayerVersionPermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PolicyLengthExceededException": - case "com.amazonaws.lambda#PolicyLengthExceededException": - throw await de_PolicyLengthExceededExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lambda#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AddPermissionCommand */ @@ -1858,7 +1814,7 @@ export const de_AddPermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_AddPermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1871,50 +1827,6 @@ export const de_AddPermissionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddPermissionCommandError - */ -const de_AddPermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PolicyLengthExceededException": - case "com.amazonaws.lambda#PolicyLengthExceededException": - throw await de_PolicyLengthExceededExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lambda#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAliasCommand */ @@ -1923,7 +1835,7 @@ export const de_CreateAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1941,44 +1853,6 @@ export const de_CreateAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAliasCommandError - */ -const de_CreateAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCodeSigningConfigCommand */ @@ -1987,7 +1861,7 @@ export const de_CreateCodeSigningConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateCodeSigningConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2000,35 +1874,6 @@ export const de_CreateCodeSigningConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCodeSigningConfigCommandError - */ -const de_CreateCodeSigningConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateEventSourceMappingCommand */ @@ -2037,7 +1882,7 @@ export const de_CreateEventSourceMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateEventSourceMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2076,44 +1921,6 @@ export const de_CreateEventSourceMappingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEventSourceMappingCommandError - */ -const de_CreateEventSourceMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFunctionCommand */ @@ -2122,7 +1929,7 @@ export const de_CreateFunctionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateFunctionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2170,56 +1977,6 @@ export const de_CreateFunctionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFunctionCommandError - */ -const de_CreateFunctionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeSigningConfigNotFoundException": - case "com.amazonaws.lambda#CodeSigningConfigNotFoundException": - throw await de_CodeSigningConfigNotFoundExceptionRes(parsedOutput, context); - case "CodeStorageExceededException": - case "com.amazonaws.lambda#CodeStorageExceededException": - throw await de_CodeStorageExceededExceptionRes(parsedOutput, context); - case "CodeVerificationFailedException": - case "com.amazonaws.lambda#CodeVerificationFailedException": - throw await de_CodeVerificationFailedExceptionRes(parsedOutput, context); - case "InvalidCodeSignatureException": - case "com.amazonaws.lambda#InvalidCodeSignatureException": - throw await de_InvalidCodeSignatureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFunctionUrlConfigCommand */ @@ -2228,7 +1985,7 @@ export const de_CreateFunctionUrlConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateFunctionUrlConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2247,52 +2004,14 @@ export const de_CreateFunctionUrlConfigCommand = async ( }; /** - * deserializeAws_restJson1CreateFunctionUrlConfigCommandError + * deserializeAws_restJson1DeleteAliasCommand */ -const de_CreateFunctionUrlConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAliasCommand - */ -export const de_DeleteAliasCommand = async ( +export const de_DeleteAliasCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2301,41 +2020,6 @@ export const de_DeleteAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAliasCommandError - */ -const de_DeleteAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteCodeSigningConfigCommand */ @@ -2344,7 +2028,7 @@ export const de_DeleteCodeSigningConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteCodeSigningConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2353,41 +2037,6 @@ export const de_DeleteCodeSigningConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteCodeSigningConfigCommandError - */ -const de_DeleteCodeSigningConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteEventSourceMappingCommand */ @@ -2396,7 +2045,7 @@ export const de_DeleteEventSourceMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteEventSourceMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2435,47 +2084,6 @@ export const de_DeleteEventSourceMappingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEventSourceMappingCommandError - */ -const de_DeleteEventSourceMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.lambda#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteFunctionCommand */ @@ -2484,7 +2092,7 @@ export const de_DeleteFunctionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteFunctionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2493,44 +2101,6 @@ export const de_DeleteFunctionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteFunctionCommandError - */ -const de_DeleteFunctionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteFunctionCodeSigningConfigCommand */ @@ -2539,7 +2109,7 @@ export const de_DeleteFunctionCodeSigningConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteFunctionCodeSigningConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2548,47 +2118,6 @@ export const de_DeleteFunctionCodeSigningConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteFunctionCodeSigningConfigCommandError - */ -const de_DeleteFunctionCodeSigningConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeSigningConfigNotFoundException": - case "com.amazonaws.lambda#CodeSigningConfigNotFoundException": - throw await de_CodeSigningConfigNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteFunctionConcurrencyCommand */ @@ -2597,7 +2126,7 @@ export const de_DeleteFunctionConcurrencyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteFunctionConcurrencyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2606,44 +2135,6 @@ export const de_DeleteFunctionConcurrencyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteFunctionConcurrencyCommandError - */ -const de_DeleteFunctionConcurrencyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteFunctionEventInvokeConfigCommand */ @@ -2652,7 +2143,7 @@ export const de_DeleteFunctionEventInvokeConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteFunctionEventInvokeConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2661,44 +2152,6 @@ export const de_DeleteFunctionEventInvokeConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteFunctionEventInvokeConfigCommandError - */ -const de_DeleteFunctionEventInvokeConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteFunctionUrlConfigCommand */ @@ -2707,7 +2160,7 @@ export const de_DeleteFunctionUrlConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteFunctionUrlConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2717,49 +2170,14 @@ export const de_DeleteFunctionUrlConfigCommand = async ( }; /** - * deserializeAws_restJson1DeleteFunctionUrlConfigCommandError + * deserializeAws_restJson1DeleteLayerVersionCommand */ -const de_DeleteFunctionUrlConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteLayerVersionCommand - */ -export const de_DeleteLayerVersionCommand = async ( +export const de_DeleteLayerVersionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteLayerVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2768,35 +2186,6 @@ export const de_DeleteLayerVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLayerVersionCommandError - */ -const de_DeleteLayerVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteProvisionedConcurrencyConfigCommand */ @@ -2805,7 +2194,7 @@ export const de_DeleteProvisionedConcurrencyConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteProvisionedConcurrencyConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2814,44 +2203,6 @@ export const de_DeleteProvisionedConcurrencyConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteProvisionedConcurrencyConfigCommandError - */ -const de_DeleteProvisionedConcurrencyConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAccountSettingsCommand */ @@ -2860,7 +2211,7 @@ export const de_GetAccountSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccountSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2874,35 +2225,6 @@ export const de_GetAccountSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAccountSettingsCommandError - */ -const de_GetAccountSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAliasCommand */ @@ -2911,7 +2233,7 @@ export const de_GetAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2929,41 +2251,6 @@ export const de_GetAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAliasCommandError - */ -const de_GetAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCodeSigningConfigCommand */ @@ -2972,7 +2259,7 @@ export const de_GetCodeSigningConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCodeSigningConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2985,38 +2272,6 @@ export const de_GetCodeSigningConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCodeSigningConfigCommandError - */ -const de_GetCodeSigningConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEventSourceMappingCommand */ @@ -3025,7 +2280,7 @@ export const de_GetEventSourceMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEventSourceMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3064,41 +2319,6 @@ export const de_GetEventSourceMappingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEventSourceMappingCommandError - */ -const de_GetEventSourceMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetFunctionCommand */ @@ -3107,7 +2327,7 @@ export const de_GetFunctionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFunctionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3123,41 +2343,6 @@ export const de_GetFunctionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetFunctionCommandError - */ -const de_GetFunctionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetFunctionCodeSigningConfigCommand */ @@ -3166,7 +2351,7 @@ export const de_GetFunctionCodeSigningConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFunctionCodeSigningConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3181,49 +2366,14 @@ export const de_GetFunctionCodeSigningConfigCommand = async ( }; /** - * deserializeAws_restJson1GetFunctionCodeSigningConfigCommandError + * deserializeAws_restJson1GetFunctionConcurrencyCommand */ -const de_GetFunctionCodeSigningConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFunctionConcurrencyCommand - */ -export const de_GetFunctionConcurrencyCommand = async ( +export const de_GetFunctionConcurrencyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFunctionConcurrencyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3236,41 +2386,6 @@ export const de_GetFunctionConcurrencyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetFunctionConcurrencyCommandError - */ -const de_GetFunctionConcurrencyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetFunctionConfigurationCommand */ @@ -3279,7 +2394,7 @@ export const de_GetFunctionConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFunctionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3327,41 +2442,6 @@ export const de_GetFunctionConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetFunctionConfigurationCommandError - */ -const de_GetFunctionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetFunctionEventInvokeConfigCommand */ @@ -3370,7 +2450,7 @@ export const de_GetFunctionEventInvokeConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFunctionEventInvokeConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3387,41 +2467,6 @@ export const de_GetFunctionEventInvokeConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetFunctionEventInvokeConfigCommandError - */ -const de_GetFunctionEventInvokeConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetFunctionUrlConfigCommand */ @@ -3430,7 +2475,7 @@ export const de_GetFunctionUrlConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFunctionUrlConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3449,41 +2494,6 @@ export const de_GetFunctionUrlConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetFunctionUrlConfigCommandError - */ -const de_GetFunctionUrlConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLayerVersionCommand */ @@ -3492,7 +2502,7 @@ export const de_GetLayerVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLayerVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3513,41 +2523,6 @@ export const de_GetLayerVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLayerVersionCommandError - */ -const de_GetLayerVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLayerVersionByArnCommand */ @@ -3556,7 +2531,7 @@ export const de_GetLayerVersionByArnCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLayerVersionByArnCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3577,41 +2552,6 @@ export const de_GetLayerVersionByArnCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLayerVersionByArnCommandError - */ -const de_GetLayerVersionByArnCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLayerVersionPolicyCommand */ @@ -3620,7 +2560,7 @@ export const de_GetLayerVersionPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLayerVersionPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3634,41 +2574,6 @@ export const de_GetLayerVersionPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLayerVersionPolicyCommandError - */ -const de_GetLayerVersionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPolicyCommand */ @@ -3677,7 +2582,7 @@ export const de_GetPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3692,49 +2597,14 @@ export const de_GetPolicyCommand = async ( }; /** - * deserializeAws_restJson1GetPolicyCommandError + * deserializeAws_restJson1GetProvisionedConcurrencyConfigCommand */ -const de_GetPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetProvisionedConcurrencyConfigCommand - */ -export const de_GetProvisionedConcurrencyConfigCommand = async ( +export const de_GetProvisionedConcurrencyConfigCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProvisionedConcurrencyConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3752,44 +2622,6 @@ export const de_GetProvisionedConcurrencyConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetProvisionedConcurrencyConfigCommandError - */ -const de_GetProvisionedConcurrencyConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ProvisionedConcurrencyConfigNotFoundException": - case "com.amazonaws.lambda#ProvisionedConcurrencyConfigNotFoundException": - throw await de_ProvisionedConcurrencyConfigNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRuntimeManagementConfigCommand */ @@ -3798,7 +2630,7 @@ export const de_GetRuntimeManagementConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRuntimeManagementConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3813,41 +2645,6 @@ export const de_GetRuntimeManagementConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRuntimeManagementConfigCommandError - */ -const de_GetRuntimeManagementConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1InvokeCommand */ @@ -3856,7 +2653,7 @@ export const de_InvokeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_InvokeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3872,116 +2669,6 @@ export const de_InvokeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1InvokeCommandError - */ -const de_InvokeCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EC2AccessDeniedException": - case "com.amazonaws.lambda#EC2AccessDeniedException": - throw await de_EC2AccessDeniedExceptionRes(parsedOutput, context); - case "EC2ThrottledException": - case "com.amazonaws.lambda#EC2ThrottledException": - throw await de_EC2ThrottledExceptionRes(parsedOutput, context); - case "EC2UnexpectedException": - case "com.amazonaws.lambda#EC2UnexpectedException": - throw await de_EC2UnexpectedExceptionRes(parsedOutput, context); - case "EFSIOException": - case "com.amazonaws.lambda#EFSIOException": - throw await de_EFSIOExceptionRes(parsedOutput, context); - case "EFSMountConnectivityException": - case "com.amazonaws.lambda#EFSMountConnectivityException": - throw await de_EFSMountConnectivityExceptionRes(parsedOutput, context); - case "EFSMountFailureException": - case "com.amazonaws.lambda#EFSMountFailureException": - throw await de_EFSMountFailureExceptionRes(parsedOutput, context); - case "EFSMountTimeoutException": - case "com.amazonaws.lambda#EFSMountTimeoutException": - throw await de_EFSMountTimeoutExceptionRes(parsedOutput, context); - case "ENILimitReachedException": - case "com.amazonaws.lambda#ENILimitReachedException": - throw await de_ENILimitReachedExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestContentException": - case "com.amazonaws.lambda#InvalidRequestContentException": - throw await de_InvalidRequestContentExceptionRes(parsedOutput, context); - case "InvalidRuntimeException": - case "com.amazonaws.lambda#InvalidRuntimeException": - throw await de_InvalidRuntimeExceptionRes(parsedOutput, context); - case "InvalidSecurityGroupIDException": - case "com.amazonaws.lambda#InvalidSecurityGroupIDException": - throw await de_InvalidSecurityGroupIDExceptionRes(parsedOutput, context); - case "InvalidSubnetIDException": - case "com.amazonaws.lambda#InvalidSubnetIDException": - throw await de_InvalidSubnetIDExceptionRes(parsedOutput, context); - case "InvalidZipFileException": - case "com.amazonaws.lambda#InvalidZipFileException": - throw await de_InvalidZipFileExceptionRes(parsedOutput, context); - case "KMSAccessDeniedException": - case "com.amazonaws.lambda#KMSAccessDeniedException": - throw await de_KMSAccessDeniedExceptionRes(parsedOutput, context); - case "KMSDisabledException": - case "com.amazonaws.lambda#KMSDisabledException": - throw await de_KMSDisabledExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.lambda#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KMSNotFoundException": - case "com.amazonaws.lambda#KMSNotFoundException": - throw await de_KMSNotFoundExceptionRes(parsedOutput, context); - case "RecursiveInvocationException": - case "com.amazonaws.lambda#RecursiveInvocationException": - throw await de_RecursiveInvocationExceptionRes(parsedOutput, context); - case "RequestTooLargeException": - case "com.amazonaws.lambda#RequestTooLargeException": - throw await de_RequestTooLargeExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.lambda#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "SnapStartException": - case "com.amazonaws.lambda#SnapStartException": - throw await de_SnapStartExceptionRes(parsedOutput, context); - case "SnapStartNotReadyException": - case "com.amazonaws.lambda#SnapStartNotReadyException": - throw await de_SnapStartNotReadyExceptionRes(parsedOutput, context); - case "SnapStartTimeoutException": - case "com.amazonaws.lambda#SnapStartTimeoutException": - throw await de_SnapStartTimeoutExceptionRes(parsedOutput, context); - case "SubnetIPAddressLimitReachedException": - case "com.amazonaws.lambda#SubnetIPAddressLimitReachedException": - throw await de_SubnetIPAddressLimitReachedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedMediaTypeException": - case "com.amazonaws.lambda#UnsupportedMediaTypeException": - throw await de_UnsupportedMediaTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1InvokeAsyncCommand */ @@ -3990,7 +2677,7 @@ export const de_InvokeAsyncCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_InvokeAsyncCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4002,44 +2689,6 @@ export const de_InvokeAsyncCommand = async ( return contents; }; -/** - * deserializeAws_restJson1InvokeAsyncCommandError - */ -const de_InvokeAsyncCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestContentException": - case "com.amazonaws.lambda#InvalidRequestContentException": - throw await de_InvalidRequestContentExceptionRes(parsedOutput, context); - case "InvalidRuntimeException": - case "com.amazonaws.lambda#InvalidRuntimeException": - throw await de_InvalidRuntimeExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1InvokeWithResponseStreamCommand */ @@ -4048,7 +2697,7 @@ export const de_InvokeWithResponseStreamCommand = async ( context: __SerdeContext & __EventStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_InvokeWithResponseStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4064,127 +2713,14 @@ export const de_InvokeWithResponseStreamCommand = async ( }; /** - * deserializeAws_restJson1InvokeWithResponseStreamCommandError + * deserializeAws_restJson1ListAliasesCommand */ -const de_InvokeWithResponseStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EC2AccessDeniedException": - case "com.amazonaws.lambda#EC2AccessDeniedException": - throw await de_EC2AccessDeniedExceptionRes(parsedOutput, context); - case "EC2ThrottledException": - case "com.amazonaws.lambda#EC2ThrottledException": - throw await de_EC2ThrottledExceptionRes(parsedOutput, context); - case "EC2UnexpectedException": - case "com.amazonaws.lambda#EC2UnexpectedException": - throw await de_EC2UnexpectedExceptionRes(parsedOutput, context); - case "EFSIOException": - case "com.amazonaws.lambda#EFSIOException": - throw await de_EFSIOExceptionRes(parsedOutput, context); - case "EFSMountConnectivityException": - case "com.amazonaws.lambda#EFSMountConnectivityException": - throw await de_EFSMountConnectivityExceptionRes(parsedOutput, context); - case "EFSMountFailureException": - case "com.amazonaws.lambda#EFSMountFailureException": - throw await de_EFSMountFailureExceptionRes(parsedOutput, context); - case "EFSMountTimeoutException": - case "com.amazonaws.lambda#EFSMountTimeoutException": - throw await de_EFSMountTimeoutExceptionRes(parsedOutput, context); - case "ENILimitReachedException": - case "com.amazonaws.lambda#ENILimitReachedException": - throw await de_ENILimitReachedExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestContentException": - case "com.amazonaws.lambda#InvalidRequestContentException": - throw await de_InvalidRequestContentExceptionRes(parsedOutput, context); - case "InvalidRuntimeException": - case "com.amazonaws.lambda#InvalidRuntimeException": - throw await de_InvalidRuntimeExceptionRes(parsedOutput, context); - case "InvalidSecurityGroupIDException": - case "com.amazonaws.lambda#InvalidSecurityGroupIDException": - throw await de_InvalidSecurityGroupIDExceptionRes(parsedOutput, context); - case "InvalidSubnetIDException": - case "com.amazonaws.lambda#InvalidSubnetIDException": - throw await de_InvalidSubnetIDExceptionRes(parsedOutput, context); - case "InvalidZipFileException": - case "com.amazonaws.lambda#InvalidZipFileException": - throw await de_InvalidZipFileExceptionRes(parsedOutput, context); - case "KMSAccessDeniedException": - case "com.amazonaws.lambda#KMSAccessDeniedException": - throw await de_KMSAccessDeniedExceptionRes(parsedOutput, context); - case "KMSDisabledException": - case "com.amazonaws.lambda#KMSDisabledException": - throw await de_KMSDisabledExceptionRes(parsedOutput, context); - case "KMSInvalidStateException": - case "com.amazonaws.lambda#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KMSNotFoundException": - case "com.amazonaws.lambda#KMSNotFoundException": - throw await de_KMSNotFoundExceptionRes(parsedOutput, context); - case "RecursiveInvocationException": - case "com.amazonaws.lambda#RecursiveInvocationException": - throw await de_RecursiveInvocationExceptionRes(parsedOutput, context); - case "RequestTooLargeException": - case "com.amazonaws.lambda#RequestTooLargeException": - throw await de_RequestTooLargeExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.lambda#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "SnapStartException": - case "com.amazonaws.lambda#SnapStartException": - throw await de_SnapStartExceptionRes(parsedOutput, context); - case "SnapStartNotReadyException": - case "com.amazonaws.lambda#SnapStartNotReadyException": - throw await de_SnapStartNotReadyExceptionRes(parsedOutput, context); - case "SnapStartTimeoutException": - case "com.amazonaws.lambda#SnapStartTimeoutException": - throw await de_SnapStartTimeoutExceptionRes(parsedOutput, context); - case "SubnetIPAddressLimitReachedException": - case "com.amazonaws.lambda#SubnetIPAddressLimitReachedException": - throw await de_SubnetIPAddressLimitReachedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedMediaTypeException": - case "com.amazonaws.lambda#UnsupportedMediaTypeException": - throw await de_UnsupportedMediaTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAliasesCommand - */ -export const de_ListAliasesCommand = async ( +export const de_ListAliasesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAliasesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4198,41 +2734,6 @@ export const de_ListAliasesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAliasesCommandError - */ -const de_ListAliasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCodeSigningConfigsCommand */ @@ -4241,7 +2742,7 @@ export const de_ListCodeSigningConfigsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCodeSigningConfigsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4255,35 +2756,6 @@ export const de_ListCodeSigningConfigsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCodeSigningConfigsCommandError - */ -const de_ListCodeSigningConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEventSourceMappingsCommand */ @@ -4292,7 +2764,7 @@ export const de_ListEventSourceMappingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEventSourceMappingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4306,41 +2778,6 @@ export const de_ListEventSourceMappingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEventSourceMappingsCommandError - */ -const de_ListEventSourceMappingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListFunctionEventInvokeConfigsCommand */ @@ -4349,7 +2786,7 @@ export const de_ListFunctionEventInvokeConfigsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFunctionEventInvokeConfigsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4363,41 +2800,6 @@ export const de_ListFunctionEventInvokeConfigsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFunctionEventInvokeConfigsCommandError - */ -const de_ListFunctionEventInvokeConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListFunctionsCommand */ @@ -4406,7 +2808,7 @@ export const de_ListFunctionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFunctionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4420,38 +2822,6 @@ export const de_ListFunctionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFunctionsCommandError - */ -const de_ListFunctionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListFunctionsByCodeSigningConfigCommand */ @@ -4460,7 +2830,7 @@ export const de_ListFunctionsByCodeSigningConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFunctionsByCodeSigningConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4475,46 +2845,14 @@ export const de_ListFunctionsByCodeSigningConfigCommand = async ( }; /** - * deserializeAws_restJson1ListFunctionsByCodeSigningConfigCommandError + * deserializeAws_restJson1ListFunctionUrlConfigsCommand */ -const de_ListFunctionsByCodeSigningConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListFunctionUrlConfigsCommand - */ -export const de_ListFunctionUrlConfigsCommand = async ( +export const de_ListFunctionUrlConfigsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFunctionUrlConfigsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4528,41 +2866,6 @@ export const de_ListFunctionUrlConfigsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFunctionUrlConfigsCommandError - */ -const de_ListFunctionUrlConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListLayersCommand */ @@ -4571,7 +2874,7 @@ export const de_ListLayersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLayersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4585,38 +2888,6 @@ export const de_ListLayersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListLayersCommandError - */ -const de_ListLayersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListLayerVersionsCommand */ @@ -4625,7 +2896,7 @@ export const de_ListLayerVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLayerVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4639,41 +2910,6 @@ export const de_ListLayerVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListLayerVersionsCommandError - */ -const de_ListLayerVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProvisionedConcurrencyConfigsCommand */ @@ -4682,7 +2918,7 @@ export const de_ListProvisionedConcurrencyConfigsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProvisionedConcurrencyConfigsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4696,41 +2932,6 @@ export const de_ListProvisionedConcurrencyConfigsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListProvisionedConcurrencyConfigsCommandError - */ -const de_ListProvisionedConcurrencyConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsCommand */ @@ -4739,7 +2940,7 @@ export const de_ListTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4752,41 +2953,6 @@ export const de_ListTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsCommandError - */ -const de_ListTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListVersionsByFunctionCommand */ @@ -4795,7 +2961,7 @@ export const de_ListVersionsByFunctionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVersionsByFunctionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4809,41 +2975,6 @@ export const de_ListVersionsByFunctionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListVersionsByFunctionCommandError - */ -const de_ListVersionsByFunctionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PublishLayerVersionCommand */ @@ -4852,7 +2983,7 @@ export const de_PublishLayerVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_PublishLayerVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4873,44 +3004,6 @@ export const de_PublishLayerVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PublishLayerVersionCommandError - */ -const de_PublishLayerVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeStorageExceededException": - case "com.amazonaws.lambda#CodeStorageExceededException": - throw await de_CodeStorageExceededExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PublishVersionCommand */ @@ -4919,7 +3012,7 @@ export const de_PublishVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_PublishVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4968,58 +3061,14 @@ export const de_PublishVersionCommand = async ( }; /** - * deserializeAws_restJson1PublishVersionCommandError + * deserializeAws_restJson1PutFunctionCodeSigningConfigCommand */ -const de_PublishVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeStorageExceededException": - case "com.amazonaws.lambda#CodeStorageExceededException": - throw await de_CodeStorageExceededExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lambda#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutFunctionCodeSigningConfigCommand - */ -export const de_PutFunctionCodeSigningConfigCommand = async ( +export const de_PutFunctionCodeSigningConfigCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutFunctionCodeSigningConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5033,47 +3082,6 @@ export const de_PutFunctionCodeSigningConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutFunctionCodeSigningConfigCommandError - */ -const de_PutFunctionCodeSigningConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeSigningConfigNotFoundException": - case "com.amazonaws.lambda#CodeSigningConfigNotFoundException": - throw await de_CodeSigningConfigNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutFunctionConcurrencyCommand */ @@ -5082,7 +3090,7 @@ export const de_PutFunctionConcurrencyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutFunctionConcurrencyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5095,44 +3103,6 @@ export const de_PutFunctionConcurrencyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutFunctionConcurrencyCommandError - */ -const de_PutFunctionConcurrencyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutFunctionEventInvokeConfigCommand */ @@ -5141,7 +3111,7 @@ export const de_PutFunctionEventInvokeConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutFunctionEventInvokeConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5158,44 +3128,6 @@ export const de_PutFunctionEventInvokeConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutFunctionEventInvokeConfigCommandError - */ -const de_PutFunctionEventInvokeConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutProvisionedConcurrencyConfigCommand */ @@ -5204,7 +3136,7 @@ export const de_PutProvisionedConcurrencyConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_PutProvisionedConcurrencyConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5223,223 +3155,54 @@ export const de_PutProvisionedConcurrencyConfigCommand = async ( }; /** - * deserializeAws_restJson1PutProvisionedConcurrencyConfigCommandError - */ -const de_PutProvisionedConcurrencyConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutRuntimeManagementConfigCommand - */ -export const de_PutRuntimeManagementConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutRuntimeManagementConfigCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - FunctionArn: __expectString, - RuntimeVersionArn: __expectString, - UpdateRuntimeOn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutRuntimeManagementConfigCommandError - */ -const de_PutRuntimeManagementConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RemoveLayerVersionPermissionCommand - */ -export const de_RemoveLayerVersionPermissionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_RemoveLayerVersionPermissionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1RemoveLayerVersionPermissionCommandError - */ -const de_RemoveLayerVersionPermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lambda#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RemovePermissionCommand + * deserializeAws_restJson1PutRuntimeManagementConfigCommand */ -export const de_RemovePermissionCommand = async ( +export const de_PutRuntimeManagementConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_RemovePermissionCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + FunctionArn: __expectString, + RuntimeVersionArn: __expectString, + UpdateRuntimeOn: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RemovePermissionCommandError + * deserializeAws_restJson1RemoveLayerVersionPermissionCommand */ -const de_RemovePermissionCommandError = async ( +export const de_RemoveLayerVersionPermissionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lambda#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1RemovePermissionCommand */ -export const de_TagResourceCommand = async ( +export const de_RemovePermissionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5449,41 +3212,20 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -5494,7 +3236,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5503,44 +3245,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAliasCommand */ @@ -5549,7 +3253,7 @@ export const de_UpdateAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5567,47 +3271,6 @@ export const de_UpdateAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAliasCommandError - */ -const de_UpdateAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lambda#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateCodeSigningConfigCommand */ @@ -5616,7 +3279,7 @@ export const de_UpdateCodeSigningConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCodeSigningConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5629,38 +3292,6 @@ export const de_UpdateCodeSigningConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateCodeSigningConfigCommandError - */ -const de_UpdateCodeSigningConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEventSourceMappingCommand */ @@ -5669,7 +3300,7 @@ export const de_UpdateEventSourceMappingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateEventSourceMappingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5684,69 +3315,28 @@ export const de_UpdateEventSourceMappingCommand = async ( EventSourceArn: __expectString, FilterCriteria: _json, FunctionArn: __expectString, - FunctionResponseTypes: _json, - LastModified: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - LastProcessingResult: __expectString, - MaximumBatchingWindowInSeconds: __expectInt32, - MaximumRecordAgeInSeconds: __expectInt32, - MaximumRetryAttempts: __expectInt32, - ParallelizationFactor: __expectInt32, - Queues: _json, - ScalingConfig: _json, - SelfManagedEventSource: _json, - SelfManagedKafkaEventSourceConfig: _json, - SourceAccessConfigurations: _json, - StartingPosition: __expectString, - StartingPositionTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - State: __expectString, - StateTransitionReason: __expectString, - Topics: _json, - TumblingWindowInSeconds: __expectInt32, - UUID: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateEventSourceMappingCommandError - */ -const de_UpdateEventSourceMappingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.lambda#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + FunctionResponseTypes: _json, + LastModified: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + LastProcessingResult: __expectString, + MaximumBatchingWindowInSeconds: __expectInt32, + MaximumRecordAgeInSeconds: __expectInt32, + MaximumRetryAttempts: __expectInt32, + ParallelizationFactor: __expectInt32, + Queues: _json, + ScalingConfig: _json, + SelfManagedEventSource: _json, + SelfManagedKafkaEventSourceConfig: _json, + SourceAccessConfigurations: _json, + StartingPosition: __expectString, + StartingPositionTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + State: __expectString, + StateTransitionReason: __expectString, + Topics: _json, + TumblingWindowInSeconds: __expectInt32, + UUID: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -5757,7 +3347,7 @@ export const de_UpdateFunctionCodeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFunctionCodeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5805,59 +3395,6 @@ export const de_UpdateFunctionCodeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFunctionCodeCommandError - */ -const de_UpdateFunctionCodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeSigningConfigNotFoundException": - case "com.amazonaws.lambda#CodeSigningConfigNotFoundException": - throw await de_CodeSigningConfigNotFoundExceptionRes(parsedOutput, context); - case "CodeStorageExceededException": - case "com.amazonaws.lambda#CodeStorageExceededException": - throw await de_CodeStorageExceededExceptionRes(parsedOutput, context); - case "CodeVerificationFailedException": - case "com.amazonaws.lambda#CodeVerificationFailedException": - throw await de_CodeVerificationFailedExceptionRes(parsedOutput, context); - case "InvalidCodeSignatureException": - case "com.amazonaws.lambda#InvalidCodeSignatureException": - throw await de_InvalidCodeSignatureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lambda#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFunctionConfigurationCommand */ @@ -5866,7 +3403,7 @@ export const de_UpdateFunctionConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFunctionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5914,56 +3451,6 @@ export const de_UpdateFunctionConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFunctionConfigurationCommandError - */ -const de_UpdateFunctionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CodeSigningConfigNotFoundException": - case "com.amazonaws.lambda#CodeSigningConfigNotFoundException": - throw await de_CodeSigningConfigNotFoundExceptionRes(parsedOutput, context); - case "CodeVerificationFailedException": - case "com.amazonaws.lambda#CodeVerificationFailedException": - throw await de_CodeVerificationFailedExceptionRes(parsedOutput, context); - case "InvalidCodeSignatureException": - case "com.amazonaws.lambda#InvalidCodeSignatureException": - throw await de_InvalidCodeSignatureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lambda#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFunctionEventInvokeConfigCommand */ @@ -5972,7 +3459,7 @@ export const de_UpdateFunctionEventInvokeConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFunctionEventInvokeConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5989,44 +3476,6 @@ export const de_UpdateFunctionEventInvokeConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFunctionEventInvokeConfigCommandError - */ -const de_UpdateFunctionEventInvokeConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.lambda#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.lambda#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lambda#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lambda#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lambda#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFunctionUrlConfigCommand */ @@ -6035,7 +3484,7 @@ export const de_UpdateFunctionUrlConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFunctionUrlConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6055,12 +3504,9 @@ export const de_UpdateFunctionUrlConfigCommand = async ( }; /** - * deserializeAws_restJson1UpdateFunctionUrlConfigCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateFunctionUrlConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -6070,6 +3516,12 @@ const de_UpdateFunctionUrlConfigCommandError = async ( case "InvalidParameterValueException": case "com.amazonaws.lambda#InvalidParameterValueException": throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); + case "PolicyLengthExceededException": + case "com.amazonaws.lambda#PolicyLengthExceededException": + throw await de_PolicyLengthExceededExceptionRes(parsedOutput, context); + case "PreconditionFailedException": + case "com.amazonaws.lambda#PreconditionFailedException": + throw await de_PreconditionFailedExceptionRes(parsedOutput, context); case "ResourceConflictException": case "com.amazonaws.lambda#ResourceConflictException": throw await de_ResourceConflictExceptionRes(parsedOutput, context); @@ -6082,13 +3534,106 @@ const de_UpdateFunctionUrlConfigCommandError = async ( case "TooManyRequestsException": case "com.amazonaws.lambda#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "CodeSigningConfigNotFoundException": + case "com.amazonaws.lambda#CodeSigningConfigNotFoundException": + throw await de_CodeSigningConfigNotFoundExceptionRes(parsedOutput, context); + case "CodeStorageExceededException": + case "com.amazonaws.lambda#CodeStorageExceededException": + throw await de_CodeStorageExceededExceptionRes(parsedOutput, context); + case "CodeVerificationFailedException": + case "com.amazonaws.lambda#CodeVerificationFailedException": + throw await de_CodeVerificationFailedExceptionRes(parsedOutput, context); + case "InvalidCodeSignatureException": + case "com.amazonaws.lambda#InvalidCodeSignatureException": + throw await de_InvalidCodeSignatureExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.lambda#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); + case "ProvisionedConcurrencyConfigNotFoundException": + case "com.amazonaws.lambda#ProvisionedConcurrencyConfigNotFoundException": + throw await de_ProvisionedConcurrencyConfigNotFoundExceptionRes(parsedOutput, context); + case "EC2AccessDeniedException": + case "com.amazonaws.lambda#EC2AccessDeniedException": + throw await de_EC2AccessDeniedExceptionRes(parsedOutput, context); + case "EC2ThrottledException": + case "com.amazonaws.lambda#EC2ThrottledException": + throw await de_EC2ThrottledExceptionRes(parsedOutput, context); + case "EC2UnexpectedException": + case "com.amazonaws.lambda#EC2UnexpectedException": + throw await de_EC2UnexpectedExceptionRes(parsedOutput, context); + case "EFSIOException": + case "com.amazonaws.lambda#EFSIOException": + throw await de_EFSIOExceptionRes(parsedOutput, context); + case "EFSMountConnectivityException": + case "com.amazonaws.lambda#EFSMountConnectivityException": + throw await de_EFSMountConnectivityExceptionRes(parsedOutput, context); + case "EFSMountFailureException": + case "com.amazonaws.lambda#EFSMountFailureException": + throw await de_EFSMountFailureExceptionRes(parsedOutput, context); + case "EFSMountTimeoutException": + case "com.amazonaws.lambda#EFSMountTimeoutException": + throw await de_EFSMountTimeoutExceptionRes(parsedOutput, context); + case "ENILimitReachedException": + case "com.amazonaws.lambda#ENILimitReachedException": + throw await de_ENILimitReachedExceptionRes(parsedOutput, context); + case "InvalidRequestContentException": + case "com.amazonaws.lambda#InvalidRequestContentException": + throw await de_InvalidRequestContentExceptionRes(parsedOutput, context); + case "InvalidRuntimeException": + case "com.amazonaws.lambda#InvalidRuntimeException": + throw await de_InvalidRuntimeExceptionRes(parsedOutput, context); + case "InvalidSecurityGroupIDException": + case "com.amazonaws.lambda#InvalidSecurityGroupIDException": + throw await de_InvalidSecurityGroupIDExceptionRes(parsedOutput, context); + case "InvalidSubnetIDException": + case "com.amazonaws.lambda#InvalidSubnetIDException": + throw await de_InvalidSubnetIDExceptionRes(parsedOutput, context); + case "InvalidZipFileException": + case "com.amazonaws.lambda#InvalidZipFileException": + throw await de_InvalidZipFileExceptionRes(parsedOutput, context); + case "KMSAccessDeniedException": + case "com.amazonaws.lambda#KMSAccessDeniedException": + throw await de_KMSAccessDeniedExceptionRes(parsedOutput, context); + case "KMSDisabledException": + case "com.amazonaws.lambda#KMSDisabledException": + throw await de_KMSDisabledExceptionRes(parsedOutput, context); + case "KMSInvalidStateException": + case "com.amazonaws.lambda#KMSInvalidStateException": + throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); + case "KMSNotFoundException": + case "com.amazonaws.lambda#KMSNotFoundException": + throw await de_KMSNotFoundExceptionRes(parsedOutput, context); + case "RecursiveInvocationException": + case "com.amazonaws.lambda#RecursiveInvocationException": + throw await de_RecursiveInvocationExceptionRes(parsedOutput, context); + case "RequestTooLargeException": + case "com.amazonaws.lambda#RequestTooLargeException": + throw await de_RequestTooLargeExceptionRes(parsedOutput, context); + case "ResourceNotReadyException": + case "com.amazonaws.lambda#ResourceNotReadyException": + throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); + case "SnapStartException": + case "com.amazonaws.lambda#SnapStartException": + throw await de_SnapStartExceptionRes(parsedOutput, context); + case "SnapStartNotReadyException": + case "com.amazonaws.lambda#SnapStartNotReadyException": + throw await de_SnapStartNotReadyExceptionRes(parsedOutput, context); + case "SnapStartTimeoutException": + case "com.amazonaws.lambda#SnapStartTimeoutException": + throw await de_SnapStartTimeoutExceptionRes(parsedOutput, context); + case "SubnetIPAddressLimitReachedException": + case "com.amazonaws.lambda#SubnetIPAddressLimitReachedException": + throw await de_SubnetIPAddressLimitReachedExceptionRes(parsedOutput, context); + case "UnsupportedMediaTypeException": + case "com.amazonaws.lambda#UnsupportedMediaTypeException": + throw await de_UnsupportedMediaTypeExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-launch-wizard/src/protocols/Aws_restJson1.ts b/clients/client-launch-wizard/src/protocols/Aws_restJson1.ts index 89dfe8e49a59..6de2a9b716ec 100644 --- a/clients/client-launch-wizard/src/protocols/Aws_restJson1.ts +++ b/clients/client-launch-wizard/src/protocols/Aws_restJson1.ts @@ -241,7 +241,7 @@ export const de_CreateDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -254,41 +254,6 @@ export const de_CreateDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDeploymentCommandError - */ -const de_CreateDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.launchwizard#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceLimitException": - case "com.amazonaws.launchwizard#ResourceLimitException": - throw await de_ResourceLimitExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.launchwizard#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.launchwizard#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDeploymentCommand */ @@ -297,7 +262,7 @@ export const de_DeleteDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -311,38 +276,6 @@ export const de_DeleteDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDeploymentCommandError - */ -const de_DeleteDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.launchwizard#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.launchwizard#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.launchwizard#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDeploymentCommand */ @@ -351,7 +284,7 @@ export const de_GetDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -364,38 +297,6 @@ export const de_GetDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeploymentCommandError - */ -const de_GetDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.launchwizard#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.launchwizard#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.launchwizard#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetWorkloadCommand */ @@ -404,7 +305,7 @@ export const de_GetWorkloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkloadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -417,38 +318,6 @@ export const de_GetWorkloadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetWorkloadCommandError - */ -const de_GetWorkloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.launchwizard#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.launchwizard#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.launchwizard#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDeploymentEventsCommand */ @@ -457,7 +326,7 @@ export const de_ListDeploymentEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeploymentEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -471,38 +340,6 @@ export const de_ListDeploymentEventsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDeploymentEventsCommandError - */ -const de_ListDeploymentEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.launchwizard#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.launchwizard#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.launchwizard#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDeploymentsCommand */ @@ -511,7 +348,7 @@ export const de_ListDeploymentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeploymentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -525,35 +362,6 @@ export const de_ListDeploymentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDeploymentsCommandError - */ -const de_ListDeploymentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.launchwizard#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.launchwizard#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWorkloadDeploymentPatternsCommand */ @@ -562,7 +370,7 @@ export const de_ListWorkloadDeploymentPatternsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkloadDeploymentPatternsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -576,38 +384,6 @@ export const de_ListWorkloadDeploymentPatternsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListWorkloadDeploymentPatternsCommandError - */ -const de_ListWorkloadDeploymentPatternsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.launchwizard#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.launchwizard#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.launchwizard#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWorkloadsCommand */ @@ -616,7 +392,7 @@ export const de_ListWorkloadsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkloadsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -631,12 +407,9 @@ export const de_ListWorkloadsCommand = async ( }; /** - * deserializeAws_restJson1ListWorkloadsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_ListWorkloadsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -646,6 +419,12 @@ const de_ListWorkloadsCommandError = async ( case "InternalServerException": case "com.amazonaws.launchwizard#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceLimitException": + case "com.amazonaws.launchwizard#ResourceLimitException": + throw await de_ResourceLimitExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.launchwizard#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.launchwizard#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); @@ -655,7 +434,7 @@ const de_ListWorkloadsCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts b/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts index 3cf68b567008..ed9f33391600 100644 --- a/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-model-building-service/src/protocols/Aws_restJson1.ts @@ -1009,7 +1009,7 @@ export const de_CreateBotVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateBotVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1038,47 +1038,6 @@ export const de_CreateBotVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBotVersionCommandError - */ -const de_CreateBotVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelbuildingservice#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateIntentVersionCommand */ @@ -1087,7 +1046,7 @@ export const de_CreateIntentVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateIntentVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1117,47 +1076,6 @@ export const de_CreateIntentVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateIntentVersionCommandError - */ -const de_CreateIntentVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelbuildingservice#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSlotTypeVersionCommand */ @@ -1166,7 +1084,7 @@ export const de_CreateSlotTypeVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSlotTypeVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1188,47 +1106,6 @@ export const de_CreateSlotTypeVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSlotTypeVersionCommandError - */ -const de_CreateSlotTypeVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelbuildingservice#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBotCommand */ @@ -1237,7 +1114,7 @@ export const de_DeleteBotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1247,55 +1124,31 @@ export const de_DeleteBotCommand = async ( }; /** - * deserializeAws_restJson1DeleteBotCommandError + * deserializeAws_restJson1DeleteBotAliasCommand */ -const de_DeleteBotCommandError = async ( +export const de_DeleteBotAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.lexmodelbuildingservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteBotAliasCommand + * deserializeAws_restJson1DeleteBotChannelAssociationCommand */ -export const de_DeleteBotAliasCommand = async ( +export const de_DeleteBotChannelAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBotAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1305,55 +1158,31 @@ export const de_DeleteBotAliasCommand = async ( }; /** - * deserializeAws_restJson1DeleteBotAliasCommandError + * deserializeAws_restJson1DeleteBotVersionCommand */ -const de_DeleteBotAliasCommandError = async ( +export const de_DeleteBotVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.lexmodelbuildingservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteBotChannelAssociationCommand + * deserializeAws_restJson1DeleteIntentCommand */ -export const de_DeleteBotChannelAssociationCommand = async ( +export const de_DeleteIntentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBotChannelAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1363,52 +1192,31 @@ export const de_DeleteBotChannelAssociationCommand = async ( }; /** - * deserializeAws_restJson1DeleteBotChannelAssociationCommandError + * deserializeAws_restJson1DeleteIntentVersionCommand */ -const de_DeleteBotChannelAssociationCommandError = async ( +export const de_DeleteIntentVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteBotVersionCommand + * deserializeAws_restJson1DeleteSlotTypeCommand */ -export const de_DeleteBotVersionCommand = async ( +export const de_DeleteSlotTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBotVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1418,229 +1226,14 @@ export const de_DeleteBotVersionCommand = async ( }; /** - * deserializeAws_restJson1DeleteBotVersionCommandError + * deserializeAws_restJson1DeleteSlotTypeVersionCommand */ -const de_DeleteBotVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.lexmodelbuildingservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteIntentCommand - */ -export const de_DeleteIntentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteIntentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteIntentCommandError - */ -const de_DeleteIntentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.lexmodelbuildingservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteIntentVersionCommand - */ -export const de_DeleteIntentVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteIntentVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteIntentVersionCommandError - */ -const de_DeleteIntentVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.lexmodelbuildingservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSlotTypeCommand - */ -export const de_DeleteSlotTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSlotTypeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSlotTypeCommandError - */ -const de_DeleteSlotTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.lexmodelbuildingservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSlotTypeVersionCommand - */ -export const de_DeleteSlotTypeVersionCommand = async ( +export const de_DeleteSlotTypeVersionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSlotTypeVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1649,47 +1242,6 @@ export const de_DeleteSlotTypeVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSlotTypeVersionCommandError - */ -const de_DeleteSlotTypeVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.lexmodelbuildingservice#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteUtterancesCommand */ @@ -1698,48 +1250,13 @@ export const de_DeleteUtterancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteUtterancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteUtterancesCommandError - */ -const de_DeleteUtterancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return contents; }; /** @@ -1750,7 +1267,7 @@ export const de_GetBotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1780,38 +1297,6 @@ export const de_GetBotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBotCommandError - */ -const de_GetBotCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBotAliasCommand */ @@ -1820,7 +1305,7 @@ export const de_GetBotAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBotAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1840,41 +1325,6 @@ export const de_GetBotAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBotAliasCommandError - */ -const de_GetBotAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBotAliasesCommand */ @@ -1883,7 +1333,7 @@ export const de_GetBotAliasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBotAliasesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1897,38 +1347,6 @@ export const de_GetBotAliasesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBotAliasesCommandError - */ -const de_GetBotAliasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBotChannelAssociationCommand */ @@ -1937,7 +1355,7 @@ export const de_GetBotChannelAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBotChannelAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1958,41 +1376,6 @@ export const de_GetBotChannelAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBotChannelAssociationCommandError - */ -const de_GetBotChannelAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBotChannelAssociationsCommand */ @@ -2001,7 +1384,7 @@ export const de_GetBotChannelAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBotChannelAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2015,38 +1398,6 @@ export const de_GetBotChannelAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBotChannelAssociationsCommandError - */ -const de_GetBotChannelAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBotsCommand */ @@ -2055,7 +1406,7 @@ export const de_GetBotsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBotsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2069,41 +1420,6 @@ export const de_GetBotsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBotsCommandError - */ -const de_GetBotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBotVersionsCommand */ @@ -2112,7 +1428,7 @@ export const de_GetBotVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBotVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2126,41 +1442,6 @@ export const de_GetBotVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBotVersionsCommandError - */ -const de_GetBotVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBuiltinIntentCommand */ @@ -2169,54 +1450,19 @@ export const de_GetBuiltinIntentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBuiltinIntentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - signature: __expectString, - slots: _json, - supportedLocales: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetBuiltinIntentCommandError - */ -const de_GetBuiltinIntentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + signature: __expectString, + slots: _json, + supportedLocales: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2227,7 +1473,7 @@ export const de_GetBuiltinIntentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBuiltinIntentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2241,38 +1487,6 @@ export const de_GetBuiltinIntentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBuiltinIntentsCommandError - */ -const de_GetBuiltinIntentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBuiltinSlotTypesCommand */ @@ -2281,7 +1495,7 @@ export const de_GetBuiltinSlotTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBuiltinSlotTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2295,38 +1509,6 @@ export const de_GetBuiltinSlotTypesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBuiltinSlotTypesCommandError - */ -const de_GetBuiltinSlotTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetExportCommand */ @@ -2335,7 +1517,7 @@ export const de_GetExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetExportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2354,41 +1536,6 @@ export const de_GetExportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetExportCommandError - */ -const de_GetExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetImportCommand */ @@ -2397,7 +1544,7 @@ export const de_GetImportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2416,41 +1563,6 @@ export const de_GetImportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetImportCommandError - */ -const de_GetImportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIntentCommand */ @@ -2459,7 +1571,7 @@ export const de_GetIntentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIntentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2489,41 +1601,6 @@ export const de_GetIntentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetIntentCommandError - */ -const de_GetIntentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIntentsCommand */ @@ -2532,110 +1609,40 @@ export const de_GetIntentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIntentsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - intents: (_) => de_IntentMetadataList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetIntentsCommandError - */ -const de_GetIntentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetIntentVersionsCommand - */ -export const de_GetIntentVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIntentVersionsCommandError(output, context); + return de_CommandError(output, context); } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - intents: (_) => de_IntentMetadataList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetIntentVersionsCommandError - */ -const de_GetIntentVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + intents: (_) => de_IntentMetadataList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetIntentVersionsCommand + */ +export const de_GetIntentVersionsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + intents: (_) => de_IntentMetadataList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2646,7 +1653,7 @@ export const de_GetMigrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMigrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2668,41 +1675,6 @@ export const de_GetMigrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMigrationCommandError - */ -const de_GetMigrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMigrationsCommand */ @@ -2711,7 +1683,7 @@ export const de_GetMigrationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMigrationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2725,38 +1697,6 @@ export const de_GetMigrationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMigrationsCommandError - */ -const de_GetMigrationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSlotTypeCommand */ @@ -2765,7 +1705,7 @@ export const de_GetSlotTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSlotTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2787,41 +1727,6 @@ export const de_GetSlotTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSlotTypeCommandError - */ -const de_GetSlotTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSlotTypesCommand */ @@ -2830,7 +1735,7 @@ export const de_GetSlotTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSlotTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2844,41 +1749,6 @@ export const de_GetSlotTypesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSlotTypesCommandError - */ -const de_GetSlotTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSlotTypeVersionsCommand */ @@ -2887,7 +1757,7 @@ export const de_GetSlotTypeVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSlotTypeVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2901,41 +1771,6 @@ export const de_GetSlotTypeVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSlotTypeVersionsCommandError - */ -const de_GetSlotTypeVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetUtterancesViewCommand */ @@ -2944,7 +1779,7 @@ export const de_GetUtterancesViewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUtterancesViewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2958,38 +1793,6 @@ export const de_GetUtterancesViewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetUtterancesViewCommandError - */ -const de_GetUtterancesViewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -2998,52 +1801,17 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3054,7 +1822,7 @@ export const de_PutBotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3086,41 +1854,6 @@ export const de_PutBotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutBotCommandError - */ -const de_PutBotCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelbuildingservice#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutBotAliasCommand */ @@ -3129,7 +1862,7 @@ export const de_PutBotAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBotAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3150,44 +1883,6 @@ export const de_PutBotAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutBotAliasCommandError - */ -const de_PutBotAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelbuildingservice#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutIntentCommand */ @@ -3196,7 +1891,7 @@ export const de_PutIntentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutIntentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3227,44 +1922,6 @@ export const de_PutIntentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutIntentCommandError - */ -const de_PutIntentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelbuildingservice#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutSlotTypeCommand */ @@ -3273,7 +1930,7 @@ export const de_PutSlotTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutSlotTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3296,44 +1953,6 @@ export const de_PutSlotTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutSlotTypeCommandError - */ -const de_PutSlotTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelbuildingservice#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartImportCommand */ @@ -3342,7 +1961,7 @@ export const de_StartImportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_StartImportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3361,38 +1980,6 @@ export const de_StartImportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartImportCommandError - */ -const de_StartImportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartMigrationCommand */ @@ -3401,7 +1988,7 @@ export const de_StartMigrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartMigrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3421,44 +2008,6 @@ export const de_StartMigrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartMigrationCommandError - */ -const de_StartMigrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lexmodelbuildingservice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -3467,7 +2016,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3476,44 +2025,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexmodelbuildingservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexmodelbuildingservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexmodelbuildingservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexmodelbuildingservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexmodelbuildingservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -3522,7 +2033,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3532,12 +2043,9 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3559,13 +2067,22 @@ const de_UntagResourceCommandError = async ( case "NotFoundException": case "com.amazonaws.lexmodelbuildingservice#NotFoundException": throw await de_NotFoundExceptionRes(parsedOutput, context); + case "PreconditionFailedException": + case "com.amazonaws.lexmodelbuildingservice#PreconditionFailedException": + throw await de_PreconditionFailedExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.lexmodelbuildingservice#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.lexmodelbuildingservice#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts b/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts index b37d8dbb4a50..2a9ec11acb7c 100644 --- a/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-models-v2/src/protocols/Aws_restJson1.ts @@ -2730,7 +2730,7 @@ export const de_BatchCreateCustomVocabularyItemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchCreateCustomVocabularyItemCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2747,44 +2747,6 @@ export const de_BatchCreateCustomVocabularyItemCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchCreateCustomVocabularyItemCommandError - */ -const de_BatchCreateCustomVocabularyItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDeleteCustomVocabularyItemCommand */ @@ -2793,7 +2755,7 @@ export const de_BatchDeleteCustomVocabularyItemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDeleteCustomVocabularyItemCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2810,44 +2772,6 @@ export const de_BatchDeleteCustomVocabularyItemCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDeleteCustomVocabularyItemCommandError - */ -const de_BatchDeleteCustomVocabularyItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUpdateCustomVocabularyItemCommand */ @@ -2856,7 +2780,7 @@ export const de_BatchUpdateCustomVocabularyItemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpdateCustomVocabularyItemCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2873,44 +2797,6 @@ export const de_BatchUpdateCustomVocabularyItemCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchUpdateCustomVocabularyItemCommandError - */ -const de_BatchUpdateCustomVocabularyItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BuildBotLocaleCommand */ @@ -2919,7 +2805,7 @@ export const de_BuildBotLocaleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_BuildBotLocaleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2936,47 +2822,6 @@ export const de_BuildBotLocaleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BuildBotLocaleCommandError - */ -const de_BuildBotLocaleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBotCommand */ @@ -2985,7 +2830,7 @@ export const de_CreateBotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateBotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3009,47 +2854,6 @@ export const de_CreateBotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBotCommandError - */ -const de_CreateBotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBotAliasCommand */ @@ -3058,7 +2862,7 @@ export const de_CreateBotAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateBotAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3081,47 +2885,6 @@ export const de_CreateBotAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBotAliasCommandError - */ -const de_CreateBotAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateBotLocaleCommand */ @@ -3130,7 +2893,7 @@ export const de_CreateBotLocaleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateBotLocaleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3153,55 +2916,14 @@ export const de_CreateBotLocaleCommand = async ( }; /** - * deserializeAws_restJson1CreateBotLocaleCommandError + * deserializeAws_restJson1CreateBotVersionCommand */ -const de_CreateBotLocaleCommandError = async ( +export const de_CreateBotVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateBotVersionCommand - */ -export const de_CreateBotVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateBotVersionCommandError(output, context); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3219,47 +2941,6 @@ export const de_CreateBotVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBotVersionCommandError - */ -const de_CreateBotVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateExportCommand */ @@ -3268,7 +2949,7 @@ export const de_CreateExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateExportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3285,47 +2966,6 @@ export const de_CreateExportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateExportCommandError - */ -const de_CreateExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateIntentCommand */ @@ -3334,7 +2974,7 @@ export const de_CreateIntentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateIntentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3363,47 +3003,6 @@ export const de_CreateIntentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateIntentCommandError - */ -const de_CreateIntentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateResourcePolicyCommand */ @@ -3412,7 +3011,7 @@ export const de_CreateResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3426,47 +3025,6 @@ export const de_CreateResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateResourcePolicyCommandError - */ -const de_CreateResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateResourcePolicyStatementCommand */ @@ -3475,7 +3033,7 @@ export const de_CreateResourcePolicyStatementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateResourcePolicyStatementCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3489,50 +3047,6 @@ export const de_CreateResourcePolicyStatementCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateResourcePolicyStatementCommandError - */ -const de_CreateResourcePolicyStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSlotCommand */ @@ -3541,7 +3055,7 @@ export const de_CreateSlotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSlotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3566,47 +3080,6 @@ export const de_CreateSlotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSlotCommandError - */ -const de_CreateSlotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSlotTypeCommand */ @@ -3615,7 +3088,7 @@ export const de_CreateSlotTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSlotTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3640,55 +3113,14 @@ export const de_CreateSlotTypeCommand = async ( }; /** - * deserializeAws_restJson1CreateSlotTypeCommandError + * deserializeAws_restJson1CreateTestSetDiscrepancyReportCommand */ -const de_CreateSlotTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateTestSetDiscrepancyReportCommand - */ -export const de_CreateTestSetDiscrepancyReportCommand = async ( +export const de_CreateTestSetDiscrepancyReportCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateTestSetDiscrepancyReportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3704,47 +3136,6 @@ export const de_CreateTestSetDiscrepancyReportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTestSetDiscrepancyReportCommandError - */ -const de_CreateTestSetDiscrepancyReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateUploadUrlCommand */ @@ -3753,7 +3144,7 @@ export const de_CreateUploadUrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateUploadUrlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3767,44 +3158,6 @@ export const de_CreateUploadUrlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateUploadUrlCommandError - */ -const de_CreateUploadUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBotCommand */ @@ -3813,7 +3166,7 @@ export const de_DeleteBotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteBotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3827,47 +3180,6 @@ export const de_DeleteBotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteBotCommandError - */ -const de_DeleteBotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBotAliasCommand */ @@ -3876,7 +3188,7 @@ export const de_DeleteBotAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteBotAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3891,47 +3203,6 @@ export const de_DeleteBotAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteBotAliasCommandError - */ -const de_DeleteBotAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBotLocaleCommand */ @@ -3940,7 +3211,7 @@ export const de_DeleteBotLocaleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteBotLocaleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3956,47 +3227,6 @@ export const de_DeleteBotLocaleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteBotLocaleCommandError - */ -const de_DeleteBotLocaleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBotVersionCommand */ @@ -4005,7 +3235,7 @@ export const de_DeleteBotVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteBotVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4020,47 +3250,6 @@ export const de_DeleteBotVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteBotVersionCommandError - */ -const de_DeleteBotVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteCustomVocabularyCommand */ @@ -4069,7 +3258,7 @@ export const de_DeleteCustomVocabularyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteCustomVocabularyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4086,55 +3275,14 @@ export const de_DeleteCustomVocabularyCommand = async ( }; /** - * deserializeAws_restJson1DeleteCustomVocabularyCommandError + * deserializeAws_restJson1DeleteExportCommand */ -const de_DeleteCustomVocabularyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteExportCommand - */ -export const de_DeleteExportCommand = async ( +export const de_DeleteExportCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteExportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4148,44 +3296,6 @@ export const de_DeleteExportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteExportCommandError - */ -const de_DeleteExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteImportCommand */ @@ -4194,7 +3304,7 @@ export const de_DeleteImportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteImportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4208,44 +3318,6 @@ export const de_DeleteImportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteImportCommandError - */ -const de_DeleteImportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteIntentCommand */ @@ -4254,7 +3326,7 @@ export const de_DeleteIntentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteIntentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4263,47 +3335,6 @@ export const de_DeleteIntentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteIntentCommandError - */ -const de_DeleteIntentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteResourcePolicyCommand */ @@ -4312,7 +3343,7 @@ export const de_DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4326,41 +3357,6 @@ export const de_DeleteResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteResourcePolicyStatementCommand */ @@ -4369,7 +3365,7 @@ export const de_DeleteResourcePolicyStatementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteResourcePolicyStatementCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4383,41 +3379,6 @@ export const de_DeleteResourcePolicyStatementCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteResourcePolicyStatementCommandError - */ -const de_DeleteResourcePolicyStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSlotCommand */ @@ -4426,7 +3387,7 @@ export const de_DeleteSlotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSlotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4436,55 +3397,31 @@ export const de_DeleteSlotCommand = async ( }; /** - * deserializeAws_restJson1DeleteSlotCommandError + * deserializeAws_restJson1DeleteSlotTypeCommand */ -const de_DeleteSlotCommandError = async ( +export const de_DeleteSlotTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteSlotTypeCommand + * deserializeAws_restJson1DeleteTestSetCommand */ -export const de_DeleteSlotTypeCommand = async ( +export const de_DeleteTestSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSlotTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4494,113 +3431,14 @@ export const de_DeleteSlotTypeCommand = async ( }; /** - * deserializeAws_restJson1DeleteSlotTypeCommandError - */ -const de_DeleteSlotTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteTestSetCommand - */ -export const de_DeleteTestSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteTestSetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteTestSetCommandError - */ -const de_DeleteTestSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteUtterancesCommand + * deserializeAws_restJson1DeleteUtterancesCommand */ export const de_DeleteUtterancesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteUtterancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4609,38 +3447,6 @@ export const de_DeleteUtterancesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteUtterancesCommandError - */ -const de_DeleteUtterancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeBotCommand */ @@ -4649,7 +3455,7 @@ export const de_DescribeBotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4673,44 +3479,6 @@ export const de_DescribeBotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeBotCommandError - */ -const de_DescribeBotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeBotAliasCommand */ @@ -4719,7 +3487,7 @@ export const de_DescribeBotAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBotAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4744,44 +3512,6 @@ export const de_DescribeBotAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeBotAliasCommandError - */ -const de_DescribeBotAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeBotLocaleCommand */ @@ -4790,7 +3520,7 @@ export const de_DescribeBotLocaleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBotLocaleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4819,44 +3549,6 @@ export const de_DescribeBotLocaleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeBotLocaleCommandError - */ -const de_DescribeBotLocaleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeBotRecommendationCommand */ @@ -4865,7 +3557,7 @@ export const de_DescribeBotRecommendationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBotRecommendationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4889,49 +3581,14 @@ export const de_DescribeBotRecommendationCommand = async ( }; /** - * deserializeAws_restJson1DescribeBotRecommendationCommandError + * deserializeAws_restJson1DescribeBotResourceGenerationCommand */ -const de_DescribeBotRecommendationCommandError = async ( +export const de_DescribeBotResourceGenerationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeBotResourceGenerationCommand - */ -export const de_DescribeBotResourceGenerationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBotResourceGenerationCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4954,41 +3611,6 @@ export const de_DescribeBotResourceGenerationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeBotResourceGenerationCommandError - */ -const de_DescribeBotResourceGenerationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeBotVersionCommand */ @@ -4997,7 +3619,7 @@ export const de_DescribeBotVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBotVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5022,44 +3644,6 @@ export const de_DescribeBotVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeBotVersionCommandError - */ -const de_DescribeBotVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeCustomVocabularyMetadataCommand */ @@ -5068,7 +3652,7 @@ export const de_DescribeCustomVocabularyMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeCustomVocabularyMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5086,44 +3670,6 @@ export const de_DescribeCustomVocabularyMetadataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeCustomVocabularyMetadataCommandError - */ -const de_DescribeCustomVocabularyMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeExportCommand */ @@ -5132,7 +3678,7 @@ export const de_DescribeExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeExportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5152,41 +3698,6 @@ export const de_DescribeExportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeExportCommandError - */ -const de_DescribeExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeImportCommand */ @@ -5195,7 +3706,7 @@ export const de_DescribeImportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeImportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5216,41 +3727,6 @@ export const de_DescribeImportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeImportCommandError - */ -const de_DescribeImportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeIntentCommand */ @@ -5259,7 +3735,7 @@ export const de_DescribeIntentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeIntentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5290,44 +3766,6 @@ export const de_DescribeIntentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeIntentCommandError - */ -const de_DescribeIntentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeResourcePolicyCommand */ @@ -5336,7 +3774,7 @@ export const de_DescribeResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5351,38 +3789,6 @@ export const de_DescribeResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeResourcePolicyCommandError - */ -const de_DescribeResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeSlotCommand */ @@ -5391,7 +3797,7 @@ export const de_DescribeSlotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSlotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5418,52 +3824,14 @@ export const de_DescribeSlotCommand = async ( }; /** - * deserializeAws_restJson1DescribeSlotCommandError + * deserializeAws_restJson1DescribeSlotTypeCommand */ -const de_DescribeSlotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeSlotTypeCommand - */ -export const de_DescribeSlotTypeCommand = async ( +export const de_DescribeSlotTypeCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSlotTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5488,44 +3856,6 @@ export const de_DescribeSlotTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeSlotTypeCommandError - */ -const de_DescribeSlotTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeTestExecutionCommand */ @@ -5534,7 +3864,7 @@ export const de_DescribeTestExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTestExecutionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5556,44 +3886,6 @@ export const de_DescribeTestExecutionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeTestExecutionCommandError - */ -const de_DescribeTestExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeTestSetCommand */ @@ -5602,7 +3894,7 @@ export const de_DescribeTestSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTestSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5624,44 +3916,6 @@ export const de_DescribeTestSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeTestSetCommandError - */ -const de_DescribeTestSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeTestSetDiscrepancyReportCommand */ @@ -5670,7 +3924,7 @@ export const de_DescribeTestSetDiscrepancyReportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTestSetDiscrepancyReportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5691,44 +3945,6 @@ export const de_DescribeTestSetDiscrepancyReportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeTestSetDiscrepancyReportCommandError - */ -const de_DescribeTestSetDiscrepancyReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeTestSetGenerationCommand */ @@ -5737,7 +3953,7 @@ export const de_DescribeTestSetGenerationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTestSetGenerationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5760,44 +3976,6 @@ export const de_DescribeTestSetGenerationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeTestSetGenerationCommandError - */ -const de_DescribeTestSetGenerationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GenerateBotElementCommand */ @@ -5806,7 +3984,7 @@ export const de_GenerateBotElementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_GenerateBotElementCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5823,50 +4001,6 @@ export const de_GenerateBotElementCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GenerateBotElementCommandError - */ -const de_GenerateBotElementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTestExecutionArtifactsUrlCommand */ @@ -5875,7 +4009,7 @@ export const de_GetTestExecutionArtifactsUrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTestExecutionArtifactsUrlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5890,52 +4024,14 @@ export const de_GetTestExecutionArtifactsUrlCommand = async ( }; /** - * deserializeAws_restJson1GetTestExecutionArtifactsUrlCommandError + * deserializeAws_restJson1ListAggregatedUtterancesCommand */ -const de_GetTestExecutionArtifactsUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAggregatedUtterancesCommand - */ -export const de_ListAggregatedUtterancesCommand = async ( +export const de_ListAggregatedUtterancesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAggregatedUtterancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5957,41 +4053,6 @@ export const de_ListAggregatedUtterancesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAggregatedUtterancesCommandError - */ -const de_ListAggregatedUtterancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListBotAliasesCommand */ @@ -6000,7 +4061,7 @@ export const de_ListBotAliasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBotAliasesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6015,41 +4076,6 @@ export const de_ListBotAliasesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListBotAliasesCommandError - */ -const de_ListBotAliasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListBotLocalesCommand */ @@ -6058,7 +4084,7 @@ export const de_ListBotLocalesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBotLocalesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6074,41 +4100,6 @@ export const de_ListBotLocalesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListBotLocalesCommandError - */ -const de_ListBotLocalesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListBotRecommendationsCommand */ @@ -6117,7 +4108,7 @@ export const de_ListBotRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBotRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6134,41 +4125,6 @@ export const de_ListBotRecommendationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListBotRecommendationsCommandError - */ -const de_ListBotRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListBotResourceGenerationsCommand */ @@ -6177,7 +4133,7 @@ export const de_ListBotResourceGenerationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBotResourceGenerationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6194,41 +4150,6 @@ export const de_ListBotResourceGenerationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListBotResourceGenerationsCommandError - */ -const de_ListBotResourceGenerationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListBotsCommand */ @@ -6237,7 +4158,7 @@ export const de_ListBotsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBotsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6251,41 +4172,6 @@ export const de_ListBotsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListBotsCommandError - */ -const de_ListBotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListBotVersionsCommand */ @@ -6294,7 +4180,7 @@ export const de_ListBotVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBotVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6309,41 +4195,6 @@ export const de_ListBotVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListBotVersionsCommandError - */ -const de_ListBotVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListBuiltInIntentsCommand */ @@ -6352,7 +4203,7 @@ export const de_ListBuiltInIntentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBuiltInIntentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6368,49 +4219,14 @@ export const de_ListBuiltInIntentsCommand = async ( }; /** - * deserializeAws_restJson1ListBuiltInIntentsCommandError + * deserializeAws_restJson1ListBuiltInSlotTypesCommand */ -const de_ListBuiltInIntentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListBuiltInSlotTypesCommand - */ -export const de_ListBuiltInSlotTypesCommand = async ( +export const de_ListBuiltInSlotTypesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBuiltInSlotTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6425,41 +4241,6 @@ export const de_ListBuiltInSlotTypesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListBuiltInSlotTypesCommandError - */ -const de_ListBuiltInSlotTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCustomVocabularyItemsCommand */ @@ -6468,7 +4249,7 @@ export const de_ListCustomVocabularyItemsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCustomVocabularyItemsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6485,44 +4266,6 @@ export const de_ListCustomVocabularyItemsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCustomVocabularyItemsCommandError - */ -const de_ListCustomVocabularyItemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListExportsCommand */ @@ -6531,7 +4274,7 @@ export const de_ListExportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListExportsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6548,38 +4291,6 @@ export const de_ListExportsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListExportsCommandError - */ -const de_ListExportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListImportsCommand */ @@ -6588,7 +4299,7 @@ export const de_ListImportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImportsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6605,38 +4316,6 @@ export const de_ListImportsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListImportsCommandError - */ -const de_ListImportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIntentMetricsCommand */ @@ -6645,7 +4324,7 @@ export const de_ListIntentMetricsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIntentMetricsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6660,44 +4339,6 @@ export const de_ListIntentMetricsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListIntentMetricsCommandError - */ -const de_ListIntentMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIntentPathsCommand */ @@ -6706,7 +4347,7 @@ export const de_ListIntentPathsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIntentPathsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6719,44 +4360,6 @@ export const de_ListIntentPathsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListIntentPathsCommandError - */ -const de_ListIntentPathsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIntentsCommand */ @@ -6765,7 +4368,7 @@ export const de_ListIntentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIntentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6782,41 +4385,6 @@ export const de_ListIntentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListIntentsCommandError - */ -const de_ListIntentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIntentStageMetricsCommand */ @@ -6825,7 +4393,7 @@ export const de_ListIntentStageMetricsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIntentStageMetricsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6841,52 +4409,14 @@ export const de_ListIntentStageMetricsCommand = async ( }; /** - * deserializeAws_restJson1ListIntentStageMetricsCommandError + * deserializeAws_restJson1ListRecommendedIntentsCommand */ -const de_ListIntentStageMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListRecommendedIntentsCommand - */ -export const de_ListRecommendedIntentsCommand = async ( +export const de_ListRecommendedIntentsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecommendedIntentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6904,44 +4434,6 @@ export const de_ListRecommendedIntentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRecommendedIntentsCommandError - */ -const de_ListRecommendedIntentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSessionAnalyticsDataCommand */ @@ -6950,7 +4442,7 @@ export const de_ListSessionAnalyticsDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSessionAnalyticsDataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6965,44 +4457,6 @@ export const de_ListSessionAnalyticsDataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSessionAnalyticsDataCommandError - */ -const de_ListSessionAnalyticsDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSessionMetricsCommand */ @@ -7011,7 +4465,7 @@ export const de_ListSessionMetricsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSessionMetricsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7026,44 +4480,6 @@ export const de_ListSessionMetricsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSessionMetricsCommandError - */ -const de_ListSessionMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSlotsCommand */ @@ -7072,7 +4488,7 @@ export const de_ListSlotsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSlotsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7090,41 +4506,6 @@ export const de_ListSlotsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSlotsCommandError - */ -const de_ListSlotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSlotTypesCommand */ @@ -7133,7 +4514,7 @@ export const de_ListSlotTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSlotTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7150,41 +4531,6 @@ export const de_ListSlotTypesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSlotTypesCommandError - */ -const de_ListSlotTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -7193,7 +4539,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7207,49 +4553,36 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListTestExecutionResultItemsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTestExecutionResultItemsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + testExecutionResults: (_) => de_TestExecutionResultItems(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTestExecutionResultItemsCommand + * deserializeAws_restJson1ListTestExecutionsCommand */ -export const de_ListTestExecutionResultItemsCommand = async ( +export const de_ListTestExecutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTestExecutionResultItemsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7257,116 +4590,21 @@ export const de_ListTestExecutionResultItemsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - testExecutionResults: (_) => de_TestExecutionResultItems(_, context), + testExecutions: (_) => de_TestExecutionSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTestExecutionResultItemsCommandError + * deserializeAws_restJson1ListTestSetRecordsCommand */ -const de_ListTestExecutionResultItemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTestExecutionsCommand - */ -export const de_ListTestExecutionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTestExecutionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - testExecutions: (_) => de_TestExecutionSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTestExecutionsCommandError - */ -const de_ListTestExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTestSetRecordsCommand - */ -export const de_ListTestSetRecordsCommand = async ( +export const de_ListTestSetRecordsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTestSetRecordsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7380,44 +4618,6 @@ export const de_ListTestSetRecordsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTestSetRecordsCommandError - */ -const de_ListTestSetRecordsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTestSetsCommand */ @@ -7426,7 +4626,7 @@ export const de_ListTestSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTestSetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7440,41 +4640,6 @@ export const de_ListTestSetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTestSetsCommandError - */ -const de_ListTestSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListUtteranceAnalyticsDataCommand */ @@ -7483,7 +4648,7 @@ export const de_ListUtteranceAnalyticsDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUtteranceAnalyticsDataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7498,44 +4663,6 @@ export const de_ListUtteranceAnalyticsDataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListUtteranceAnalyticsDataCommandError - */ -const de_ListUtteranceAnalyticsDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListUtteranceMetricsCommand */ @@ -7544,7 +4671,7 @@ export const de_ListUtteranceMetricsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUtteranceMetricsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7559,44 +4686,6 @@ export const de_ListUtteranceMetricsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListUtteranceMetricsCommandError - */ -const de_ListUtteranceMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchAssociatedTranscriptsCommand */ @@ -7605,7 +4694,7 @@ export const de_SearchAssociatedTranscriptsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchAssociatedTranscriptsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7624,44 +4713,6 @@ export const de_SearchAssociatedTranscriptsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchAssociatedTranscriptsCommandError - */ -const de_SearchAssociatedTranscriptsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartBotRecommendationCommand */ @@ -7670,7 +4721,7 @@ export const de_StartBotRecommendationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartBotRecommendationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7690,50 +4741,6 @@ export const de_StartBotRecommendationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartBotRecommendationCommandError - */ -const de_StartBotRecommendationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartBotResourceGenerationCommand */ @@ -7742,7 +4749,7 @@ export const de_StartBotResourceGenerationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartBotResourceGenerationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7761,47 +4768,6 @@ export const de_StartBotResourceGenerationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartBotResourceGenerationCommandError - */ -const de_StartBotResourceGenerationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartImportCommand */ @@ -7810,7 +4776,7 @@ export const de_StartImportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartImportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7827,47 +4793,6 @@ export const de_StartImportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartImportCommandError - */ -const de_StartImportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartTestExecutionCommand */ @@ -7876,7 +4801,7 @@ export const de_StartTestExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartTestExecutionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7889,120 +4814,38 @@ export const de_StartTestExecutionCommand = async ( testExecutionId: __expectString, testExecutionModality: __expectString, testSetId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartTestExecutionCommandError - */ -const de_StartTestExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartTestSetGenerationCommand - */ -export const de_StartTestSetGenerationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartTestSetGenerationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - description: __expectString, - generationDataSource: (_) => de_TestSetGenerationDataSource(_, context), - roleArn: __expectString, - storageLocation: _json, - testSetGenerationId: __expectString, - testSetGenerationStatus: __expectString, - testSetName: __expectString, - testSetTags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartTestSetGenerationCommandError - */ -const de_StartTestSetGenerationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1StartTestSetGenerationCommand + */ +export const de_StartTestSetGenerationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + creationDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + description: __expectString, + generationDataSource: (_) => de_TestSetGenerationDataSource(_, context), + roleArn: __expectString, + storageLocation: _json, + testSetGenerationId: __expectString, + testSetGenerationStatus: __expectString, + testSetName: __expectString, + testSetTags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -8013,7 +4856,7 @@ export const de_StopBotRecommendationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StopBotRecommendationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8030,50 +4873,6 @@ export const de_StopBotRecommendationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopBotRecommendationCommandError - */ -const de_StopBotRecommendationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -8082,7 +4881,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8091,41 +4890,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -8134,7 +4898,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8143,41 +4907,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBotCommand */ @@ -8186,7 +4915,7 @@ export const de_UpdateBotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateBotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8209,47 +4938,6 @@ export const de_UpdateBotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateBotCommandError - */ -const de_UpdateBotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBotAliasCommand */ @@ -8258,7 +4946,7 @@ export const de_UpdateBotAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateBotAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8281,47 +4969,6 @@ export const de_UpdateBotAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateBotAliasCommandError - */ -const de_UpdateBotAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBotLocaleCommand */ @@ -8330,7 +4977,7 @@ export const de_UpdateBotLocaleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateBotLocaleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8346,54 +4993,13 @@ export const de_UpdateBotLocaleCommand = async ( generativeAISettings: _json, lastUpdatedDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), localeId: __expectString, - localeName: __expectString, - nluIntentConfidenceThreshold: __limitedParseDouble, - recommendedActions: _json, - voiceSettings: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateBotLocaleCommandError - */ -const de_UpdateBotLocaleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + localeName: __expectString, + nluIntentConfidenceThreshold: __limitedParseDouble, + recommendedActions: _json, + voiceSettings: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -8404,7 +5010,7 @@ export const de_UpdateBotRecommendationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateBotRecommendationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8425,50 +5031,6 @@ export const de_UpdateBotRecommendationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateBotRecommendationCommandError - */ -const de_UpdateBotRecommendationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateExportCommand */ @@ -8477,7 +5039,7 @@ export const de_UpdateExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateExportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8495,47 +5057,6 @@ export const de_UpdateExportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateExportCommandError - */ -const de_UpdateExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateIntentCommand */ @@ -8544,7 +5065,7 @@ export const de_UpdateIntentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIntentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8575,47 +5096,6 @@ export const de_UpdateIntentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateIntentCommandError - */ -const de_UpdateIntentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateResourcePolicyCommand */ @@ -8624,7 +5104,7 @@ export const de_UpdateResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8638,47 +5118,6 @@ export const de_UpdateResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateResourcePolicyCommandError - */ -const de_UpdateResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSlotCommand */ @@ -8687,7 +5126,7 @@ export const de_UpdateSlotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSlotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8713,47 +5152,6 @@ export const de_UpdateSlotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSlotCommandError - */ -const de_UpdateSlotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSlotTypeCommand */ @@ -8762,7 +5160,7 @@ export const de_UpdateSlotTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateSlotTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8787,47 +5185,6 @@ export const de_UpdateSlotTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSlotTypeCommandError - */ -const de_UpdateSlotTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexmodelsv2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexmodelsv2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexmodelsv2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTestSetCommand */ @@ -8836,7 +5193,7 @@ export const de_UpdateTestSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTestSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8859,27 +5216,21 @@ export const de_UpdateTestSetCommand = async ( }; /** - * deserializeAws_restJson1UpdateTestSetCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateTestSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ConflictException": - case "com.amazonaws.lexmodelsv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.lexmodelsv2#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.lexmodelsv2#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.lexmodelsv2#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ServiceQuotaExceededException": case "com.amazonaws.lexmodelsv2#ServiceQuotaExceededException": throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); @@ -8889,13 +5240,19 @@ const de_UpdateTestSetCommandError = async ( case "ValidationException": case "com.amazonaws.lexmodelsv2#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.lexmodelsv2#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "PreconditionFailedException": + case "com.amazonaws.lexmodelsv2#PreconditionFailedException": + throw await de_PreconditionFailedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-lex-runtime-service/src/protocols/Aws_restJson1.ts b/clients/client-lex-runtime-service/src/protocols/Aws_restJson1.ts index 38d1be8e3baa..5db9194fbb29 100644 --- a/clients/client-lex-runtime-service/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-runtime-service/src/protocols/Aws_restJson1.ts @@ -190,7 +190,7 @@ export const de_DeleteSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -206,44 +206,6 @@ export const de_DeleteSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSessionCommandError - */ -const de_DeleteSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexruntimeservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexruntimeservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexruntimeservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexruntimeservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexruntimeservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSessionCommand */ @@ -252,7 +214,7 @@ export const de_GetSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -269,41 +231,6 @@ export const de_GetSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSessionCommandError - */ -const de_GetSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.lexruntimeservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexruntimeservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexruntimeservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexruntimeservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PostContentCommand */ @@ -312,7 +239,7 @@ export const de_PostContentCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PostContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -355,62 +282,6 @@ export const de_PostContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PostContentCommandError - */ -const de_PostContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.lexruntimeservice#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.lexruntimeservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexruntimeservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DependencyFailedException": - case "com.amazonaws.lexruntimeservice#DependencyFailedException": - throw await de_DependencyFailedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexruntimeservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexruntimeservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "LoopDetectedException": - case "com.amazonaws.lexruntimeservice#LoopDetectedException": - throw await de_LoopDetectedExceptionRes(parsedOutput, context); - case "NotAcceptableException": - case "com.amazonaws.lexruntimeservice#NotAcceptableException": - throw await de_NotAcceptableExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexruntimeservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.lexruntimeservice#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "UnsupportedMediaTypeException": - case "com.amazonaws.lexruntimeservice#UnsupportedMediaTypeException": - throw await de_UnsupportedMediaTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PostTextCommand */ @@ -419,7 +290,7 @@ export const de_PostTextCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PostTextCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -445,53 +316,6 @@ export const de_PostTextCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PostTextCommandError - */ -const de_PostTextCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.lexruntimeservice#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.lexruntimeservice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexruntimeservice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DependencyFailedException": - case "com.amazonaws.lexruntimeservice#DependencyFailedException": - throw await de_DependencyFailedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.lexruntimeservice#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.lexruntimeservice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "LoopDetectedException": - case "com.amazonaws.lexruntimeservice#LoopDetectedException": - throw await de_LoopDetectedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lexruntimeservice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutSessionCommand */ @@ -500,7 +324,7 @@ export const de_PutSessionCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -532,49 +356,55 @@ export const de_PutSessionCommand = async ( }; /** - * deserializeAws_restJson1PutSessionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_PutSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.lexruntimeservice#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); case "BadRequestException": case "com.amazonaws.lexruntimeservice#BadRequestException": throw await de_BadRequestExceptionRes(parsedOutput, context); case "ConflictException": case "com.amazonaws.lexruntimeservice#ConflictException": throw await de_ConflictExceptionRes(parsedOutput, context); - case "DependencyFailedException": - case "com.amazonaws.lexruntimeservice#DependencyFailedException": - throw await de_DependencyFailedExceptionRes(parsedOutput, context); case "InternalFailureException": case "com.amazonaws.lexruntimeservice#InternalFailureException": throw await de_InternalFailureExceptionRes(parsedOutput, context); case "LimitExceededException": case "com.amazonaws.lexruntimeservice#LimitExceededException": throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotAcceptableException": - case "com.amazonaws.lexruntimeservice#NotAcceptableException": - throw await de_NotAcceptableExceptionRes(parsedOutput, context); case "NotFoundException": case "com.amazonaws.lexruntimeservice#NotFoundException": throw await de_NotFoundExceptionRes(parsedOutput, context); + case "BadGatewayException": + case "com.amazonaws.lexruntimeservice#BadGatewayException": + throw await de_BadGatewayExceptionRes(parsedOutput, context); + case "DependencyFailedException": + case "com.amazonaws.lexruntimeservice#DependencyFailedException": + throw await de_DependencyFailedExceptionRes(parsedOutput, context); + case "LoopDetectedException": + case "com.amazonaws.lexruntimeservice#LoopDetectedException": + throw await de_LoopDetectedExceptionRes(parsedOutput, context); + case "NotAcceptableException": + case "com.amazonaws.lexruntimeservice#NotAcceptableException": + throw await de_NotAcceptableExceptionRes(parsedOutput, context); + case "RequestTimeoutException": + case "com.amazonaws.lexruntimeservice#RequestTimeoutException": + throw await de_RequestTimeoutExceptionRes(parsedOutput, context); + case "UnsupportedMediaTypeException": + case "com.amazonaws.lexruntimeservice#UnsupportedMediaTypeException": + throw await de_UnsupportedMediaTypeExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts b/clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts index 792de9298c17..244a8c04e4b4 100644 --- a/clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts +++ b/clients/client-lex-runtime-v2/src/protocols/Aws_restJson1.ts @@ -229,7 +229,7 @@ export const de_DeleteSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -245,47 +245,6 @@ export const de_DeleteSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSessionCommandError - */ -const de_DeleteSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lexruntimev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexruntimev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexruntimev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexruntimev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexruntimev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexruntimev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSessionCommand */ @@ -294,7 +253,7 @@ export const de_GetSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -310,44 +269,6 @@ export const de_GetSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSessionCommandError - */ -const de_GetSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lexruntimev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexruntimev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexruntimev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexruntimev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexruntimev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutSessionCommand */ @@ -356,7 +277,7 @@ export const de_PutSessionCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -372,53 +293,6 @@ export const de_PutSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutSessionCommandError - */ -const de_PutSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lexruntimev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadGatewayException": - case "com.amazonaws.lexruntimev2#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexruntimev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DependencyFailedException": - case "com.amazonaws.lexruntimev2#DependencyFailedException": - throw await de_DependencyFailedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexruntimev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexruntimev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexruntimev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexruntimev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RecognizeTextCommand */ @@ -427,7 +301,7 @@ export const de_RecognizeTextCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RecognizeTextCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -445,53 +319,6 @@ export const de_RecognizeTextCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RecognizeTextCommandError - */ -const de_RecognizeTextCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lexruntimev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadGatewayException": - case "com.amazonaws.lexruntimev2#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexruntimev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DependencyFailedException": - case "com.amazonaws.lexruntimev2#DependencyFailedException": - throw await de_DependencyFailedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexruntimev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexruntimev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexruntimev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexruntimev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RecognizeUtteranceCommand */ @@ -500,7 +327,7 @@ export const de_RecognizeUtteranceCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RecognizeUtteranceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -520,53 +347,6 @@ export const de_RecognizeUtteranceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RecognizeUtteranceCommandError - */ -const de_RecognizeUtteranceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lexruntimev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadGatewayException": - case "com.amazonaws.lexruntimev2#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lexruntimev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DependencyFailedException": - case "com.amazonaws.lexruntimev2#DependencyFailedException": - throw await de_DependencyFailedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lexruntimev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lexruntimev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lexruntimev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lexruntimev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartConversationCommand */ @@ -575,7 +355,7 @@ export const de_StartConversationCommand = async ( context: __SerdeContext & __EventStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartConversationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -586,12 +366,9 @@ export const de_StartConversationCommand = async ( }; /** - * deserializeAws_restJson1StartConversationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_StartConversationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -601,22 +378,34 @@ const de_StartConversationCommandError = async ( case "AccessDeniedException": case "com.amazonaws.lexruntimev2#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.lexruntimev2#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.lexruntimev2#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.lexruntimev2#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.lexruntimev2#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.lexruntimev2#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "BadGatewayException": + case "com.amazonaws.lexruntimev2#BadGatewayException": + throw await de_BadGatewayExceptionRes(parsedOutput, context); + case "DependencyFailedException": + case "com.amazonaws.lexruntimev2#DependencyFailedException": + throw await de_DependencyFailedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-license-manager-linux-subscriptions/src/protocols/Aws_restJson1.ts b/clients/client-license-manager-linux-subscriptions/src/protocols/Aws_restJson1.ts index 626945b43c78..663bd93a1caa 100644 --- a/clients/client-license-manager-linux-subscriptions/src/protocols/Aws_restJson1.ts +++ b/clients/client-license-manager-linux-subscriptions/src/protocols/Aws_restJson1.ts @@ -138,7 +138,7 @@ export const de_GetServiceSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetServiceSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -155,38 +155,6 @@ export const de_GetServiceSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetServiceSettingsCommandError - */ -const de_GetServiceSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.licensemanagerlinuxsubscriptions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.licensemanagerlinuxsubscriptions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanagerlinuxsubscriptions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListLinuxSubscriptionInstancesCommand */ @@ -195,7 +163,7 @@ export const de_ListLinuxSubscriptionInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLinuxSubscriptionInstancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -209,38 +177,6 @@ export const de_ListLinuxSubscriptionInstancesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListLinuxSubscriptionInstancesCommandError - */ -const de_ListLinuxSubscriptionInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.licensemanagerlinuxsubscriptions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.licensemanagerlinuxsubscriptions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanagerlinuxsubscriptions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListLinuxSubscriptionsCommand */ @@ -249,7 +185,7 @@ export const de_ListLinuxSubscriptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLinuxSubscriptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -263,38 +199,6 @@ export const de_ListLinuxSubscriptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListLinuxSubscriptionsCommandError - */ -const de_ListLinuxSubscriptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.licensemanagerlinuxsubscriptions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.licensemanagerlinuxsubscriptions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanagerlinuxsubscriptions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateServiceSettingsCommand */ @@ -303,7 +207,7 @@ export const de_UpdateServiceSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateServiceSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -321,12 +225,9 @@ export const de_UpdateServiceSettingsCommand = async ( }; /** - * deserializeAws_restJson1UpdateServiceSettingsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateServiceSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -348,7 +249,7 @@ const de_UpdateServiceSettingsCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts b/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts index fb5aa16e87a8..036ab5173abe 100644 --- a/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts +++ b/clients/client-license-manager-user-subscriptions/src/protocols/Aws_restJson1.ts @@ -347,7 +347,7 @@ export const de_AssociateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -360,50 +360,6 @@ export const de_AssociateUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateUserCommandError - */ -const de_AssociateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeregisterIdentityProviderCommand */ @@ -412,7 +368,7 @@ export const de_DeregisterIdentityProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeregisterIdentityProviderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -425,50 +381,6 @@ export const de_DeregisterIdentityProviderCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeregisterIdentityProviderCommandError - */ -const de_DeregisterIdentityProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateUserCommand */ @@ -477,7 +389,7 @@ export const de_DisassociateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -490,50 +402,6 @@ export const de_DisassociateUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateUserCommandError - */ -const de_DisassociateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIdentityProvidersCommand */ @@ -542,7 +410,7 @@ export const de_ListIdentityProvidersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIdentityProvidersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -556,50 +424,6 @@ export const de_ListIdentityProvidersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListIdentityProvidersCommandError - */ -const de_ListIdentityProvidersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListInstancesCommand */ @@ -608,7 +432,7 @@ export const de_ListInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInstancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -622,50 +446,6 @@ export const de_ListInstancesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListInstancesCommandError - */ -const de_ListInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProductSubscriptionsCommand */ @@ -674,7 +454,7 @@ export const de_ListProductSubscriptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProductSubscriptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -688,50 +468,6 @@ export const de_ListProductSubscriptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListProductSubscriptionsCommandError - */ -const de_ListProductSubscriptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListUserAssociationsCommand */ @@ -740,7 +476,7 @@ export const de_ListUserAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUserAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -754,50 +490,6 @@ export const de_ListUserAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListUserAssociationsCommandError - */ -const de_ListUserAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RegisterIdentityProviderCommand */ @@ -806,7 +498,7 @@ export const de_RegisterIdentityProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterIdentityProviderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -819,50 +511,6 @@ export const de_RegisterIdentityProviderCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RegisterIdentityProviderCommandError - */ -const de_RegisterIdentityProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartProductSubscriptionCommand */ @@ -871,7 +519,7 @@ export const de_StartProductSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartProductSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -884,50 +532,6 @@ export const de_StartProductSubscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartProductSubscriptionCommandError - */ -const de_StartProductSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopProductSubscriptionCommand */ @@ -936,7 +540,7 @@ export const de_StopProductSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopProductSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -949,50 +553,6 @@ export const de_StopProductSubscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopProductSubscriptionCommandError - */ -const de_StopProductSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanagerusersubscriptions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateIdentityProviderSettingsCommand */ @@ -1001,7 +561,7 @@ export const de_UpdateIdentityProviderSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIdentityProviderSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1015,12 +575,9 @@ export const de_UpdateIdentityProviderSettingsCommand = async ( }; /** - * deserializeAws_restJson1UpdateIdentityProviderSettingsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateIdentityProviderSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1030,9 +587,18 @@ const de_UpdateIdentityProviderSettingsCommandError = async ( case "AccessDeniedException": case "com.amazonaws.licensemanagerusersubscriptions#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.licensemanagerusersubscriptions#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.licensemanagerusersubscriptions#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.licensemanagerusersubscriptions#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.licensemanagerusersubscriptions#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.licensemanagerusersubscriptions#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -1045,7 +611,7 @@ const de_UpdateIdentityProviderSettingsCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-license-manager/src/protocols/Aws_json1_1.ts b/clients/client-license-manager/src/protocols/Aws_json1_1.ts index 42f1a1ccb97f..6c42fdb50b8c 100644 --- a/clients/client-license-manager/src/protocols/Aws_json1_1.ts +++ b/clients/client-license-manager/src/protocols/Aws_json1_1.ts @@ -920,7 +920,7 @@ export const de_AcceptGrantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptGrantCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -932,50 +932,6 @@ export const de_AcceptGrantCommand = async ( return response; }; -/** - * deserializeAws_json1_1AcceptGrantCommandError - */ -const de_AcceptGrantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CheckInLicenseCommand */ @@ -984,7 +940,7 @@ export const de_CheckInLicenseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CheckInLicenseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -996,53 +952,6 @@ export const de_CheckInLicenseCommand = async ( return response; }; -/** - * deserializeAws_json1_1CheckInLicenseCommandError - */ -const de_CheckInLicenseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.licensemanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CheckoutBorrowLicenseCommand */ @@ -1051,7 +960,7 @@ export const de_CheckoutBorrowLicenseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CheckoutBorrowLicenseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1063,62 +972,6 @@ export const de_CheckoutBorrowLicenseCommand = async ( return response; }; -/** - * deserializeAws_json1_1CheckoutBorrowLicenseCommandError - */ -const de_CheckoutBorrowLicenseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "EntitlementNotAllowedException": - case "com.amazonaws.licensemanager#EntitlementNotAllowedException": - throw await de_EntitlementNotAllowedExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoEntitlementsAllowedException": - case "com.amazonaws.licensemanager#NoEntitlementsAllowedException": - throw await de_NoEntitlementsAllowedExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "RedirectException": - case "com.amazonaws.licensemanager#RedirectException": - throw await de_RedirectExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "UnsupportedDigitalSignatureMethodException": - case "com.amazonaws.licensemanager#UnsupportedDigitalSignatureMethodException": - throw await de_UnsupportedDigitalSignatureMethodExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CheckoutLicenseCommand */ @@ -1127,7 +980,7 @@ export const de_CheckoutLicenseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CheckoutLicenseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1140,72 +993,39 @@ export const de_CheckoutLicenseCommand = async ( }; /** - * deserializeAws_json1_1CheckoutLicenseCommandError + * deserializeAws_json1_1CreateGrantCommand */ -const de_CheckoutLicenseCommandError = async ( +export const de_CreateGrantCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "NoEntitlementsAllowedException": - case "com.amazonaws.licensemanager#NoEntitlementsAllowedException": - throw await de_NoEntitlementsAllowedExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "RedirectException": - case "com.amazonaws.licensemanager#RedirectException": - throw await de_RedirectExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "UnsupportedDigitalSignatureMethodException": - case "com.amazonaws.licensemanager#UnsupportedDigitalSignatureMethodException": - throw await de_UnsupportedDigitalSignatureMethodExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateGrantCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateGrantCommand + * deserializeAws_json1_1CreateGrantVersionCommand */ -export const de_CreateGrantCommand = async ( +export const de_CreateGrantVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateGrantCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateGrantCommandOutput = { + const response: CreateGrantVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1213,63 +1033,39 @@ export const de_CreateGrantCommand = async ( }; /** - * deserializeAws_json1_1CreateGrantCommandError + * deserializeAws_json1_1CreateLicenseCommand */ -const de_CreateGrantCommandError = async ( +export const de_CreateLicenseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateLicenseCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateGrantVersionCommand + * deserializeAws_json1_1CreateLicenseConfigurationCommand */ -export const de_CreateGrantVersionCommand = async ( +export const de_CreateLicenseConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateGrantVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateGrantVersionCommandOutput = { + const response: CreateLicenseConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1277,1200 +1073,19 @@ export const de_CreateGrantVersionCommand = async ( }; /** - * deserializeAws_json1_1CreateGrantVersionCommandError + * deserializeAws_json1_1CreateLicenseConversionTaskForResourceCommand */ -const de_CreateGrantVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateLicenseCommand - */ -export const de_CreateLicenseCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateLicenseCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateLicenseCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateLicenseCommandError - */ -const de_CreateLicenseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "RedirectException": - case "com.amazonaws.licensemanager#RedirectException": - throw await de_RedirectExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateLicenseConfigurationCommand - */ -export const de_CreateLicenseConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateLicenseConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateLicenseConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateLicenseConfigurationCommandError - */ -const de_CreateLicenseConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateLicenseConversionTaskForResourceCommand - */ -export const de_CreateLicenseConversionTaskForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateLicenseConversionTaskForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateLicenseConversionTaskForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateLicenseConversionTaskForResourceCommandError - */ -const de_CreateLicenseConversionTaskForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateLicenseManagerReportGeneratorCommand - */ -export const de_CreateLicenseManagerReportGeneratorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateLicenseManagerReportGeneratorCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateLicenseManagerReportGeneratorCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateLicenseManagerReportGeneratorCommandError - */ -const de_CreateLicenseManagerReportGeneratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateLicenseVersionCommand - */ -export const de_CreateLicenseVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateLicenseVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateLicenseVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateLicenseVersionCommandError - */ -const de_CreateLicenseVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.licensemanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "RedirectException": - case "com.amazonaws.licensemanager#RedirectException": - throw await de_RedirectExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateTokenCommand - */ -export const de_CreateTokenCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateTokenCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateTokenCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateTokenCommandError - */ -const de_CreateTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "RedirectException": - case "com.amazonaws.licensemanager#RedirectException": - throw await de_RedirectExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteGrantCommand - */ -export const de_DeleteGrantCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteGrantCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteGrantCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteGrantCommandError - */ -const de_DeleteGrantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteLicenseCommand - */ -export const de_DeleteLicenseCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteLicenseCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteLicenseCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteLicenseCommandError - */ -const de_DeleteLicenseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.licensemanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "RedirectException": - case "com.amazonaws.licensemanager#RedirectException": - throw await de_RedirectExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteLicenseConfigurationCommand - */ -export const de_DeleteLicenseConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteLicenseConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteLicenseConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteLicenseConfigurationCommandError - */ -const de_DeleteLicenseConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteLicenseManagerReportGeneratorCommand - */ -export const de_DeleteLicenseManagerReportGeneratorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteLicenseManagerReportGeneratorCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteLicenseManagerReportGeneratorCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteLicenseManagerReportGeneratorCommandError - */ -const de_DeleteLicenseManagerReportGeneratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteTokenCommand - */ -export const de_DeleteTokenCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteTokenCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteTokenCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteTokenCommandError - */ -const de_DeleteTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "RedirectException": - case "com.amazonaws.licensemanager#RedirectException": - throw await de_RedirectExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ExtendLicenseConsumptionCommand - */ -export const de_ExtendLicenseConsumptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ExtendLicenseConsumptionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ExtendLicenseConsumptionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ExtendLicenseConsumptionCommandError - */ -const de_ExtendLicenseConsumptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetAccessTokenCommand - */ -export const de_GetAccessTokenCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetAccessTokenCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetAccessTokenCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetAccessTokenCommandError - */ -const de_GetAccessTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetGrantCommand - */ -export const de_GetGrantCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetGrantCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetGrantCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetGrantCommandError - */ -const de_GetGrantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLicenseCommand - */ -export const de_GetLicenseCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLicenseCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetLicenseCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetLicenseCommandError - */ -const de_GetLicenseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLicenseConfigurationCommand - */ -export const de_GetLicenseConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLicenseConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetLicenseConfigurationResponse(data, context); - const response: GetLicenseConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetLicenseConfigurationCommandError - */ -const de_GetLicenseConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLicenseConversionTaskCommand - */ -export const de_GetLicenseConversionTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLicenseConversionTaskCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetLicenseConversionTaskResponse(data, context); - const response: GetLicenseConversionTaskCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetLicenseConversionTaskCommandError - */ -const de_GetLicenseConversionTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLicenseManagerReportGeneratorCommand - */ -export const de_GetLicenseManagerReportGeneratorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLicenseManagerReportGeneratorCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetLicenseManagerReportGeneratorCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetLicenseManagerReportGeneratorCommandError - */ -const de_GetLicenseManagerReportGeneratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLicenseUsageCommand - */ -export const de_GetLicenseUsageCommand = async ( +export const de_CreateLicenseConversionTaskForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetLicenseUsageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetLicenseUsageCommandOutput = { + const response: CreateLicenseConversionTaskForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2478,60 +1093,19 @@ export const de_GetLicenseUsageCommand = async ( }; /** - * deserializeAws_json1_1GetLicenseUsageCommandError - */ -const de_GetLicenseUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetServiceSettingsCommand + * deserializeAws_json1_1CreateLicenseManagerReportGeneratorCommand */ -export const de_GetServiceSettingsCommand = async ( +export const de_CreateLicenseManagerReportGeneratorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetServiceSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetServiceSettingsCommandOutput = { + const response: CreateLicenseManagerReportGeneratorCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2539,54 +1113,19 @@ export const de_GetServiceSettingsCommand = async ( }; /** - * deserializeAws_json1_1GetServiceSettingsCommandError - */ -const de_GetServiceSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAssociationsForLicenseConfigurationCommand + * deserializeAws_json1_1CreateLicenseVersionCommand */ -export const de_ListAssociationsForLicenseConfigurationCommand = async ( +export const de_CreateLicenseVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAssociationsForLicenseConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListAssociationsForLicenseConfigurationResponse(data, context); - const response: ListAssociationsForLicenseConfigurationCommandOutput = { + contents = _json(data); + const response: CreateLicenseVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2594,60 +1133,19 @@ export const de_ListAssociationsForLicenseConfigurationCommand = async ( }; /** - * deserializeAws_json1_1ListAssociationsForLicenseConfigurationCommandError - */ -const de_ListAssociationsForLicenseConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "FilterLimitExceededException": - case "com.amazonaws.licensemanager#FilterLimitExceededException": - throw await de_FilterLimitExceededExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDistributedGrantsCommand + * deserializeAws_json1_1CreateTokenCommand */ -export const de_ListDistributedGrantsCommand = async ( +export const de_CreateTokenCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDistributedGrantsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListDistributedGrantsCommandOutput = { + const response: CreateTokenCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2655,63 +1153,19 @@ export const de_ListDistributedGrantsCommand = async ( }; /** - * deserializeAws_json1_1ListDistributedGrantsCommandError - */ -const de_ListDistributedGrantsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListFailuresForLicenseConfigurationOperationsCommand + * deserializeAws_json1_1DeleteGrantCommand */ -export const de_ListFailuresForLicenseConfigurationOperationsCommand = async ( +export const de_DeleteGrantCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListFailuresForLicenseConfigurationOperationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListFailuresForLicenseConfigurationOperationsResponse(data, context); - const response: ListFailuresForLicenseConfigurationOperationsCommandOutput = { + contents = _json(data); + const response: DeleteGrantCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2719,57 +1173,19 @@ export const de_ListFailuresForLicenseConfigurationOperationsCommand = async ( }; /** - * deserializeAws_json1_1ListFailuresForLicenseConfigurationOperationsCommandError - */ -const de_ListFailuresForLicenseConfigurationOperationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListLicenseConfigurationsCommand + * deserializeAws_json1_1DeleteLicenseCommand */ -export const de_ListLicenseConfigurationsCommand = async ( +export const de_DeleteLicenseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListLicenseConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListLicenseConfigurationsResponse(data, context); - const response: ListLicenseConfigurationsCommandOutput = { + let contents: any = {}; + contents = _json(data); + const response: DeleteLicenseCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2777,60 +1193,39 @@ export const de_ListLicenseConfigurationsCommand = async ( }; /** - * deserializeAws_json1_1ListLicenseConfigurationsCommandError + * deserializeAws_json1_1DeleteLicenseConfigurationCommand */ -const de_ListLicenseConfigurationsCommandError = async ( +export const de_DeleteLicenseConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "FilterLimitExceededException": - case "com.amazonaws.licensemanager#FilterLimitExceededException": - throw await de_FilterLimitExceededExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteLicenseConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListLicenseConversionTasksCommand + * deserializeAws_json1_1DeleteLicenseManagerReportGeneratorCommand */ -export const de_ListLicenseConversionTasksCommand = async ( +export const de_DeleteLicenseManagerReportGeneratorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListLicenseConversionTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListLicenseConversionTasksResponse(data, context); - const response: ListLicenseConversionTasksCommandOutput = { + contents = _json(data); + const response: DeleteLicenseManagerReportGeneratorCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2838,57 +1233,39 @@ export const de_ListLicenseConversionTasksCommand = async ( }; /** - * deserializeAws_json1_1ListLicenseConversionTasksCommandError + * deserializeAws_json1_1DeleteTokenCommand */ -const de_ListLicenseConversionTasksCommandError = async ( +export const de_DeleteTokenCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteTokenCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListLicenseManagerReportGeneratorsCommand + * deserializeAws_json1_1ExtendLicenseConsumptionCommand */ -export const de_ListLicenseManagerReportGeneratorsCommand = async ( +export const de_ExtendLicenseConsumptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListLicenseManagerReportGeneratorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListLicenseManagerReportGeneratorsCommandOutput = { + const response: ExtendLicenseConsumptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2896,66 +1273,39 @@ export const de_ListLicenseManagerReportGeneratorsCommand = async ( }; /** - * deserializeAws_json1_1ListLicenseManagerReportGeneratorsCommandError + * deserializeAws_json1_1GetAccessTokenCommand */ -const de_ListLicenseManagerReportGeneratorsCommandError = async ( +export const de_GetAccessTokenCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetAccessTokenCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListLicensesCommand + * deserializeAws_json1_1GetGrantCommand */ -export const de_ListLicensesCommand = async ( +export const de_GetGrantCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListLicensesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListLicensesCommandOutput = { + const response: GetGrantCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2963,60 +1313,39 @@ export const de_ListLicensesCommand = async ( }; /** - * deserializeAws_json1_1ListLicensesCommandError + * deserializeAws_json1_1GetLicenseCommand */ -const de_ListLicensesCommandError = async ( +export const de_GetLicenseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetLicenseCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListLicenseSpecificationsForResourceCommand + * deserializeAws_json1_1GetLicenseConfigurationCommand */ -export const de_ListLicenseSpecificationsForResourceCommand = async ( +export const de_GetLicenseConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListLicenseSpecificationsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListLicenseSpecificationsForResourceCommandOutput = { + contents = de_GetLicenseConfigurationResponse(data, context); + const response: GetLicenseConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3024,57 +1353,39 @@ export const de_ListLicenseSpecificationsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListLicenseSpecificationsForResourceCommandError + * deserializeAws_json1_1GetLicenseConversionTaskCommand */ -const de_ListLicenseSpecificationsForResourceCommandError = async ( +export const de_GetLicenseConversionTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetLicenseConversionTaskResponse(data, context); + const response: GetLicenseConversionTaskCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListLicenseVersionsCommand + * deserializeAws_json1_1GetLicenseManagerReportGeneratorCommand */ -export const de_ListLicenseVersionsCommand = async ( +export const de_GetLicenseManagerReportGeneratorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListLicenseVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListLicenseVersionsCommandOutput = { + const response: GetLicenseManagerReportGeneratorCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3082,57 +1393,39 @@ export const de_ListLicenseVersionsCommand = async ( }; /** - * deserializeAws_json1_1ListLicenseVersionsCommandError + * deserializeAws_json1_1GetLicenseUsageCommand */ -const de_ListLicenseVersionsCommandError = async ( +export const de_GetLicenseUsageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetLicenseUsageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListReceivedGrantsCommand + * deserializeAws_json1_1GetServiceSettingsCommand */ -export const de_ListReceivedGrantsCommand = async ( +export const de_GetServiceSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListReceivedGrantsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListReceivedGrantsCommandOutput = { + const response: GetServiceSettingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3140,63 +1433,39 @@ export const de_ListReceivedGrantsCommand = async ( }; /** - * deserializeAws_json1_1ListReceivedGrantsCommandError + * deserializeAws_json1_1ListAssociationsForLicenseConfigurationCommand */ -const de_ListReceivedGrantsCommandError = async ( +export const de_ListAssociationsForLicenseConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListAssociationsForLicenseConfigurationResponse(data, context); + const response: ListAssociationsForLicenseConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListReceivedGrantsForOrganizationCommand + * deserializeAws_json1_1ListDistributedGrantsCommand */ -export const de_ListReceivedGrantsForOrganizationCommand = async ( +export const de_ListDistributedGrantsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListReceivedGrantsForOrganizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListReceivedGrantsForOrganizationCommandOutput = { + const response: ListDistributedGrantsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3204,63 +1473,39 @@ export const de_ListReceivedGrantsForOrganizationCommand = async ( }; /** - * deserializeAws_json1_1ListReceivedGrantsForOrganizationCommandError + * deserializeAws_json1_1ListFailuresForLicenseConfigurationOperationsCommand */ -const de_ListReceivedGrantsForOrganizationCommandError = async ( +export const de_ListFailuresForLicenseConfigurationOperationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListFailuresForLicenseConfigurationOperationsResponse(data, context); + const response: ListFailuresForLicenseConfigurationOperationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListReceivedLicensesCommand + * deserializeAws_json1_1ListLicenseConfigurationsCommand */ -export const de_ListReceivedLicensesCommand = async ( +export const de_ListLicenseConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListReceivedLicensesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListReceivedLicensesCommandOutput = { + contents = de_ListLicenseConfigurationsResponse(data, context); + const response: ListLicenseConfigurationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3268,63 +1513,39 @@ export const de_ListReceivedLicensesCommand = async ( }; /** - * deserializeAws_json1_1ListReceivedLicensesCommandError + * deserializeAws_json1_1ListLicenseConversionTasksCommand */ -const de_ListReceivedLicensesCommandError = async ( +export const de_ListLicenseConversionTasksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListLicenseConversionTasksResponse(data, context); + const response: ListLicenseConversionTasksCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListReceivedLicensesForOrganizationCommand + * deserializeAws_json1_1ListLicenseManagerReportGeneratorsCommand */ -export const de_ListReceivedLicensesForOrganizationCommand = async ( +export const de_ListLicenseManagerReportGeneratorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListReceivedLicensesForOrganizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListReceivedLicensesForOrganizationCommandOutput = { + const response: ListLicenseManagerReportGeneratorsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3332,63 +1553,39 @@ export const de_ListReceivedLicensesForOrganizationCommand = async ( }; /** - * deserializeAws_json1_1ListReceivedLicensesForOrganizationCommandError + * deserializeAws_json1_1ListLicensesCommand */ -const de_ListReceivedLicensesForOrganizationCommandError = async ( +export const de_ListLicensesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListLicensesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListResourceInventoryCommand + * deserializeAws_json1_1ListLicenseSpecificationsForResourceCommand */ -export const de_ListResourceInventoryCommand = async ( +export const de_ListLicenseSpecificationsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListResourceInventoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListResourceInventoryCommandOutput = { + const response: ListLicenseSpecificationsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3396,63 +1593,39 @@ export const de_ListResourceInventoryCommand = async ( }; /** - * deserializeAws_json1_1ListResourceInventoryCommandError + * deserializeAws_json1_1ListLicenseVersionsCommand */ -const de_ListResourceInventoryCommandError = async ( +export const de_ListLicenseVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.licensemanager#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "FilterLimitExceededException": - case "com.amazonaws.licensemanager#FilterLimitExceededException": - throw await de_FilterLimitExceededExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListLicenseVersionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1ListReceivedGrantsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListReceivedGrantsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + const response: ListReceivedGrantsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3460,57 +1633,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1ListReceivedGrantsForOrganizationCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListReceivedGrantsForOrganizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListReceivedGrantsForOrganizationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTokensCommand + * deserializeAws_json1_1ListReceivedLicensesCommand */ -export const de_ListTokensCommand = async ( +export const de_ListReceivedLicensesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTokensCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTokensCommandOutput = { + const response: ListReceivedLicensesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3518,57 +1673,39 @@ export const de_ListTokensCommand = async ( }; /** - * deserializeAws_json1_1ListTokensCommandError + * deserializeAws_json1_1ListReceivedLicensesForOrganizationCommand */ -const de_ListTokensCommandError = async ( +export const de_ListReceivedLicensesForOrganizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListReceivedLicensesForOrganizationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListUsageForLicenseConfigurationCommand + * deserializeAws_json1_1ListResourceInventoryCommand */ -export const de_ListUsageForLicenseConfigurationCommand = async ( +export const de_ListResourceInventoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListUsageForLicenseConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListUsageForLicenseConfigurationResponse(data, context); - const response: ListUsageForLicenseConfigurationCommandOutput = { + contents = _json(data); + const response: ListResourceInventoryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3576,60 +1713,39 @@ export const de_ListUsageForLicenseConfigurationCommand = async ( }; /** - * deserializeAws_json1_1ListUsageForLicenseConfigurationCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_ListUsageForLicenseConfigurationCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "FilterLimitExceededException": - case "com.amazonaws.licensemanager#FilterLimitExceededException": - throw await de_FilterLimitExceededExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RejectGrantCommand + * deserializeAws_json1_1ListTokensCommand */ -export const de_RejectGrantCommand = async ( +export const de_ListTokensCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RejectGrantCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: RejectGrantCommandOutput = { + const response: ListTokensCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3637,63 +1753,39 @@ export const de_RejectGrantCommand = async ( }; /** - * deserializeAws_json1_1RejectGrantCommandError + * deserializeAws_json1_1ListUsageForLicenseConfigurationCommand */ -const de_RejectGrantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_ListUsageForLicenseConfigurationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListUsageForLicenseConfigurationResponse(data, context); + const response: ListUsageForLicenseConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1RejectGrantCommand */ -export const de_TagResourceCommand = async ( +export const de_RejectGrantCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: RejectGrantCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3701,41 +1793,23 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3746,7 +1820,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3758,44 +1832,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateLicenseConfigurationCommand */ @@ -3804,7 +1840,7 @@ export const de_UpdateLicenseConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLicenseConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3816,47 +1852,6 @@ export const de_UpdateLicenseConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateLicenseConfigurationCommandError - */ -const de_UpdateLicenseConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateLicenseManagerReportGeneratorCommand */ @@ -3865,7 +1860,7 @@ export const de_UpdateLicenseManagerReportGeneratorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLicenseManagerReportGeneratorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3877,53 +1872,6 @@ export const de_UpdateLicenseManagerReportGeneratorCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateLicenseManagerReportGeneratorCommandError - */ -const de_UpdateLicenseManagerReportGeneratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.licensemanager#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.licensemanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.licensemanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateLicenseSpecificationsForResourceCommand */ @@ -3932,7 +1880,7 @@ export const de_UpdateLicenseSpecificationsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLicenseSpecificationsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3944,50 +1892,6 @@ export const de_UpdateLicenseSpecificationsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateLicenseSpecificationsForResourceCommandError - */ -const de_UpdateLicenseSpecificationsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.licensemanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationException": - case "com.amazonaws.licensemanager#AuthorizationException": - throw await de_AuthorizationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.licensemanager#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.licensemanager#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "LicenseUsageException": - case "com.amazonaws.licensemanager#LicenseUsageException": - throw await de_LicenseUsageExceptionRes(parsedOutput, context); - case "RateLimitExceededException": - case "com.amazonaws.licensemanager#RateLimitExceededException": - throw await de_RateLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.licensemanager#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateServiceSettingsCommand */ @@ -3996,7 +1900,7 @@ export const de_UpdateServiceSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateServiceSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4009,12 +1913,9 @@ export const de_UpdateServiceSettingsCommand = async ( }; /** - * deserializeAws_json1_1UpdateServiceSettingsCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateServiceSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4033,16 +1934,52 @@ const de_UpdateServiceSettingsCommandError = async ( case "RateLimitExceededException": case "com.amazonaws.licensemanager#RateLimitExceededException": throw await de_RateLimitExceededExceptionRes(parsedOutput, context); + case "ResourceLimitExceededException": + case "com.amazonaws.licensemanager#ResourceLimitExceededException": + throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); case "ServerInternalException": case "com.amazonaws.licensemanager#ServerInternalException": throw await de_ServerInternalExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.licensemanager#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.licensemanager#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.licensemanager#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "EntitlementNotAllowedException": + case "com.amazonaws.licensemanager#EntitlementNotAllowedException": + throw await de_EntitlementNotAllowedExceptionRes(parsedOutput, context); + case "NoEntitlementsAllowedException": + case "com.amazonaws.licensemanager#NoEntitlementsAllowedException": + throw await de_NoEntitlementsAllowedExceptionRes(parsedOutput, context); + case "RedirectException": + case "com.amazonaws.licensemanager#RedirectException": + throw await de_RedirectExceptionRes(parsedOutput, context); + case "UnsupportedDigitalSignatureMethodException": + case "com.amazonaws.licensemanager#UnsupportedDigitalSignatureMethodException": + throw await de_UnsupportedDigitalSignatureMethodExceptionRes(parsedOutput, context); + case "FilterLimitExceededException": + case "com.amazonaws.licensemanager#FilterLimitExceededException": + throw await de_FilterLimitExceededExceptionRes(parsedOutput, context); + case "FailedDependencyException": + case "com.amazonaws.licensemanager#FailedDependencyException": + throw await de_FailedDependencyExceptionRes(parsedOutput, context); + case "InvalidResourceStateException": + case "com.amazonaws.licensemanager#InvalidResourceStateException": + throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); + case "LicenseUsageException": + case "com.amazonaws.licensemanager#LicenseUsageException": + throw await de_LicenseUsageExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-lightsail/src/protocols/Aws_json1_1.ts b/clients/client-lightsail/src/protocols/Aws_json1_1.ts index f785c1fdd25c..4b2d1d1fb20a 100644 --- a/clients/client-lightsail/src/protocols/Aws_json1_1.ts +++ b/clients/client-lightsail/src/protocols/Aws_json1_1.ts @@ -2921,7 +2921,7 @@ export const de_AllocateStaticIpCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AllocateStaticIpCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2933,50 +2933,6 @@ export const de_AllocateStaticIpCommand = async ( return response; }; -/** - * deserializeAws_json1_1AllocateStaticIpCommandError - */ -const de_AllocateStaticIpCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AttachCertificateToDistributionCommand */ @@ -2985,7 +2941,7 @@ export const de_AttachCertificateToDistributionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachCertificateToDistributionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2997,47 +2953,6 @@ export const de_AttachCertificateToDistributionCommand = async ( return response; }; -/** - * deserializeAws_json1_1AttachCertificateToDistributionCommandError - */ -const de_AttachCertificateToDistributionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AttachDiskCommand */ @@ -3046,7 +2961,7 @@ export const de_AttachDiskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachDiskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3058,50 +2973,6 @@ export const de_AttachDiskCommand = async ( return response; }; -/** - * deserializeAws_json1_1AttachDiskCommandError - */ -const de_AttachDiskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AttachInstancesToLoadBalancerCommand */ @@ -3110,7 +2981,7 @@ export const de_AttachInstancesToLoadBalancerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachInstancesToLoadBalancerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3122,50 +2993,6 @@ export const de_AttachInstancesToLoadBalancerCommand = async ( return response; }; -/** - * deserializeAws_json1_1AttachInstancesToLoadBalancerCommandError - */ -const de_AttachInstancesToLoadBalancerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AttachLoadBalancerTlsCertificateCommand */ @@ -3174,7 +3001,7 @@ export const de_AttachLoadBalancerTlsCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachLoadBalancerTlsCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3186,50 +3013,6 @@ export const de_AttachLoadBalancerTlsCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1AttachLoadBalancerTlsCertificateCommandError - */ -const de_AttachLoadBalancerTlsCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AttachStaticIpCommand */ @@ -3238,7 +3021,7 @@ export const de_AttachStaticIpCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachStaticIpCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3250,50 +3033,6 @@ export const de_AttachStaticIpCommand = async ( return response; }; -/** - * deserializeAws_json1_1AttachStaticIpCommandError - */ -const de_AttachStaticIpCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CloseInstancePublicPortsCommand */ @@ -3302,7 +3041,7 @@ export const de_CloseInstancePublicPortsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CloseInstancePublicPortsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3315,58 +3054,14 @@ export const de_CloseInstancePublicPortsCommand = async ( }; /** - * deserializeAws_json1_1CloseInstancePublicPortsCommandError + * deserializeAws_json1_1CopySnapshotCommand */ -const de_CloseInstancePublicPortsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CopySnapshotCommand - */ -export const de_CopySnapshotCommand = async ( +export const de_CopySnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopySnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3378,50 +3073,6 @@ export const de_CopySnapshotCommand = async ( return response; }; -/** - * deserializeAws_json1_1CopySnapshotCommandError - */ -const de_CopySnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateBucketCommand */ @@ -3430,7 +3081,7 @@ export const de_CreateBucketCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBucketCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3442,41 +3093,6 @@ export const de_CreateBucketCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateBucketCommandError - */ -const de_CreateBucketCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateBucketAccessKeyCommand */ @@ -3485,7 +3101,7 @@ export const de_CreateBucketAccessKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBucketAccessKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3497,44 +3113,6 @@ export const de_CreateBucketAccessKeyCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateBucketAccessKeyCommandError - */ -const de_CreateBucketAccessKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateCertificateCommand */ @@ -3543,7 +3121,7 @@ export const de_CreateCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3555,44 +3133,6 @@ export const de_CreateCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCertificateCommandError - */ -const de_CreateCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateCloudFormationStackCommand */ @@ -3601,7 +3141,7 @@ export const de_CreateCloudFormationStackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCloudFormationStackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3613,50 +3153,6 @@ export const de_CreateCloudFormationStackCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCloudFormationStackCommandError - */ -const de_CreateCloudFormationStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateContactMethodCommand */ @@ -3665,7 +3161,7 @@ export const de_CreateContactMethodCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateContactMethodCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3677,47 +3173,6 @@ export const de_CreateContactMethodCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateContactMethodCommandError - */ -const de_CreateContactMethodCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateContainerServiceCommand */ @@ -3726,7 +3181,7 @@ export const de_CreateContainerServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateContainerServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3739,52 +3194,14 @@ export const de_CreateContainerServiceCommand = async ( }; /** - * deserializeAws_json1_1CreateContainerServiceCommandError + * deserializeAws_json1_1CreateContainerServiceDeploymentCommand */ -const de_CreateContainerServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateContainerServiceDeploymentCommand - */ -export const de_CreateContainerServiceDeploymentCommand = async ( +export const de_CreateContainerServiceDeploymentCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateContainerServiceDeploymentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3796,44 +3213,6 @@ export const de_CreateContainerServiceDeploymentCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateContainerServiceDeploymentCommandError - */ -const de_CreateContainerServiceDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateContainerServiceRegistryLoginCommand */ @@ -3842,7 +3221,7 @@ export const de_CreateContainerServiceRegistryLoginCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateContainerServiceRegistryLoginCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3854,44 +3233,6 @@ export const de_CreateContainerServiceRegistryLoginCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateContainerServiceRegistryLoginCommandError - */ -const de_CreateContainerServiceRegistryLoginCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDiskCommand */ @@ -3900,7 +3241,7 @@ export const de_CreateDiskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDiskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3912,50 +3253,6 @@ export const de_CreateDiskCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDiskCommandError - */ -const de_CreateDiskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDiskFromSnapshotCommand */ @@ -3964,7 +3261,7 @@ export const de_CreateDiskFromSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDiskFromSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3976,50 +3273,6 @@ export const de_CreateDiskFromSnapshotCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDiskFromSnapshotCommandError - */ -const de_CreateDiskFromSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDiskSnapshotCommand */ @@ -4028,7 +3281,7 @@ export const de_CreateDiskSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDiskSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4041,63 +3294,39 @@ export const de_CreateDiskSnapshotCommand = async ( }; /** - * deserializeAws_json1_1CreateDiskSnapshotCommandError + * deserializeAws_json1_1CreateDistributionCommand */ -const de_CreateDiskSnapshotCommandError = async ( +export const de_CreateDistributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateDistributionResult(data, context); + const response: CreateDistributionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateDistributionCommand + * deserializeAws_json1_1CreateDomainCommand */ -export const de_CreateDistributionCommand = async ( +export const de_CreateDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDistributionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDistributionResult(data, context); - const response: CreateDistributionCommandOutput = { + contents = de_CreateDomainResult(data, context); + const response: CreateDomainCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4105,60 +3334,19 @@ export const de_CreateDistributionCommand = async ( }; /** - * deserializeAws_json1_1CreateDistributionCommandError + * deserializeAws_json1_1CreateDomainEntryCommand */ -const de_CreateDistributionCommandError = async ( +export const de_CreateDomainEntryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateDomainCommand - */ -export const de_CreateDomainCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDomainResult(data, context); - const response: CreateDomainCommandOutput = { + contents = de_CreateDomainEntryResult(data, context); + const response: CreateDomainEntryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4166,63 +3354,39 @@ export const de_CreateDomainCommand = async ( }; /** - * deserializeAws_json1_1CreateDomainCommandError + * deserializeAws_json1_1CreateGUISessionAccessDetailsCommand */ -const de_CreateDomainCommandError = async ( +export const de_CreateGUISessionAccessDetailsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateGUISessionAccessDetailsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateDomainEntryCommand + * deserializeAws_json1_1CreateInstancesCommand */ -export const de_CreateDomainEntryCommand = async ( +export const de_CreateInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDomainEntryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDomainEntryResult(data, context); - const response: CreateDomainEntryCommandOutput = { + contents = de_CreateInstancesResult(data, context); + const response: CreateInstancesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4230,63 +3394,39 @@ export const de_CreateDomainEntryCommand = async ( }; /** - * deserializeAws_json1_1CreateDomainEntryCommandError + * deserializeAws_json1_1CreateInstancesFromSnapshotCommand */ -const de_CreateDomainEntryCommandError = async ( +export const de_CreateInstancesFromSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateInstancesFromSnapshotResult(data, context); + const response: CreateInstancesFromSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateGUISessionAccessDetailsCommand + * deserializeAws_json1_1CreateInstanceSnapshotCommand */ -export const de_CreateGUISessionAccessDetailsCommand = async ( +export const de_CreateInstanceSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateGUISessionAccessDetailsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: CreateGUISessionAccessDetailsCommandOutput = { + contents = de_CreateInstanceSnapshotResult(data, context); + const response: CreateInstanceSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4294,57 +3434,39 @@ export const de_CreateGUISessionAccessDetailsCommand = async ( }; /** - * deserializeAws_json1_1CreateGUISessionAccessDetailsCommandError + * deserializeAws_json1_1CreateKeyPairCommand */ -const de_CreateGUISessionAccessDetailsCommandError = async ( +export const de_CreateKeyPairCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateKeyPairResult(data, context); + const response: CreateKeyPairCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateInstancesCommand + * deserializeAws_json1_1CreateLoadBalancerCommand */ -export const de_CreateInstancesCommand = async ( +export const de_CreateLoadBalancerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateInstancesResult(data, context); - const response: CreateInstancesCommandOutput = { + contents = de_CreateLoadBalancerResult(data, context); + const response: CreateLoadBalancerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4352,63 +3474,39 @@ export const de_CreateInstancesCommand = async ( }; /** - * deserializeAws_json1_1CreateInstancesCommandError + * deserializeAws_json1_1CreateLoadBalancerTlsCertificateCommand */ -const de_CreateInstancesCommandError = async ( +export const de_CreateLoadBalancerTlsCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateLoadBalancerTlsCertificateResult(data, context); + const response: CreateLoadBalancerTlsCertificateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateInstancesFromSnapshotCommand + * deserializeAws_json1_1CreateRelationalDatabaseCommand */ -export const de_CreateInstancesFromSnapshotCommand = async ( +export const de_CreateRelationalDatabaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateInstancesFromSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateInstancesFromSnapshotResult(data, context); - const response: CreateInstancesFromSnapshotCommandOutput = { + contents = de_CreateRelationalDatabaseResult(data, context); + const response: CreateRelationalDatabaseCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4416,63 +3514,39 @@ export const de_CreateInstancesFromSnapshotCommand = async ( }; /** - * deserializeAws_json1_1CreateInstancesFromSnapshotCommandError + * deserializeAws_json1_1CreateRelationalDatabaseFromSnapshotCommand */ -const de_CreateInstancesFromSnapshotCommandError = async ( +export const de_CreateRelationalDatabaseFromSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateRelationalDatabaseFromSnapshotResult(data, context); + const response: CreateRelationalDatabaseFromSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateInstanceSnapshotCommand + * deserializeAws_json1_1CreateRelationalDatabaseSnapshotCommand */ -export const de_CreateInstanceSnapshotCommand = async ( +export const de_CreateRelationalDatabaseSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateInstanceSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateInstanceSnapshotResult(data, context); - const response: CreateInstanceSnapshotCommandOutput = { + contents = de_CreateRelationalDatabaseSnapshotResult(data, context); + const response: CreateRelationalDatabaseSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4480,63 +3554,39 @@ export const de_CreateInstanceSnapshotCommand = async ( }; /** - * deserializeAws_json1_1CreateInstanceSnapshotCommandError + * deserializeAws_json1_1DeleteAlarmCommand */ -const de_CreateInstanceSnapshotCommandError = async ( +export const de_DeleteAlarmCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteAlarmResult(data, context); + const response: DeleteAlarmCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateKeyPairCommand + * deserializeAws_json1_1DeleteAutoSnapshotCommand */ -export const de_CreateKeyPairCommand = async ( +export const de_DeleteAutoSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateKeyPairCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateKeyPairResult(data, context); - const response: CreateKeyPairCommandOutput = { + contents = de_DeleteAutoSnapshotResult(data, context); + const response: DeleteAutoSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4544,63 +3594,39 @@ export const de_CreateKeyPairCommand = async ( }; /** - * deserializeAws_json1_1CreateKeyPairCommandError + * deserializeAws_json1_1DeleteBucketCommand */ -const de_CreateKeyPairCommandError = async ( +export const de_DeleteBucketCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteBucketResult(data, context); + const response: DeleteBucketCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateLoadBalancerCommand + * deserializeAws_json1_1DeleteBucketAccessKeyCommand */ -export const de_CreateLoadBalancerCommand = async ( +export const de_DeleteBucketAccessKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateLoadBalancerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateLoadBalancerResult(data, context); - const response: CreateLoadBalancerCommandOutput = { + contents = de_DeleteBucketAccessKeyResult(data, context); + const response: DeleteBucketAccessKeyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4608,63 +3634,59 @@ export const de_CreateLoadBalancerCommand = async ( }; /** - * deserializeAws_json1_1CreateLoadBalancerCommandError + * deserializeAws_json1_1DeleteCertificateCommand */ -const de_CreateLoadBalancerCommandError = async ( +export const de_DeleteCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteCertificateResult(data, context); + const response: DeleteCertificateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DeleteContactMethodCommand + */ +export const de_DeleteContactMethodCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteContactMethodResult(data, context); + const response: DeleteContactMethodCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateLoadBalancerTlsCertificateCommand + * deserializeAws_json1_1DeleteContainerImageCommand */ -export const de_CreateLoadBalancerTlsCertificateCommand = async ( +export const de_DeleteContainerImageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateLoadBalancerTlsCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateLoadBalancerTlsCertificateResult(data, context); - const response: CreateLoadBalancerTlsCertificateCommandOutput = { + contents = _json(data); + const response: DeleteContainerImageCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4672,63 +3694,39 @@ export const de_CreateLoadBalancerTlsCertificateCommand = async ( }; /** - * deserializeAws_json1_1CreateLoadBalancerTlsCertificateCommandError + * deserializeAws_json1_1DeleteContainerServiceCommand */ -const de_CreateLoadBalancerTlsCertificateCommandError = async ( +export const de_DeleteContainerServiceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteContainerServiceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1CreateRelationalDatabaseCommand + * deserializeAws_json1_1DeleteDiskCommand */ -export const de_CreateRelationalDatabaseCommand = async ( +export const de_DeleteDiskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateRelationalDatabaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateRelationalDatabaseResult(data, context); - const response: CreateRelationalDatabaseCommandOutput = { + contents = de_DeleteDiskResult(data, context); + const response: DeleteDiskCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4736,63 +3734,19 @@ export const de_CreateRelationalDatabaseCommand = async ( }; /** - * deserializeAws_json1_1CreateRelationalDatabaseCommandError - */ -const de_CreateRelationalDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateRelationalDatabaseFromSnapshotCommand + * deserializeAws_json1_1DeleteDiskSnapshotCommand */ -export const de_CreateRelationalDatabaseFromSnapshotCommand = async ( +export const de_DeleteDiskSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateRelationalDatabaseFromSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateRelationalDatabaseFromSnapshotResult(data, context); - const response: CreateRelationalDatabaseFromSnapshotCommandOutput = { + contents = de_DeleteDiskSnapshotResult(data, context); + const response: DeleteDiskSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4800,63 +3754,39 @@ export const de_CreateRelationalDatabaseFromSnapshotCommand = async ( }; /** - * deserializeAws_json1_1CreateRelationalDatabaseFromSnapshotCommandError + * deserializeAws_json1_1DeleteDistributionCommand */ -const de_CreateRelationalDatabaseFromSnapshotCommandError = async ( +export const de_DeleteDistributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteDistributionResult(data, context); + const response: DeleteDistributionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateRelationalDatabaseSnapshotCommand + * deserializeAws_json1_1DeleteDomainCommand */ -export const de_CreateRelationalDatabaseSnapshotCommand = async ( +export const de_DeleteDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateRelationalDatabaseSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateRelationalDatabaseSnapshotResult(data, context); - const response: CreateRelationalDatabaseSnapshotCommandOutput = { + contents = de_DeleteDomainResult(data, context); + const response: DeleteDomainCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4864,63 +3794,39 @@ export const de_CreateRelationalDatabaseSnapshotCommand = async ( }; /** - * deserializeAws_json1_1CreateRelationalDatabaseSnapshotCommandError + * deserializeAws_json1_1DeleteDomainEntryCommand */ -const de_CreateRelationalDatabaseSnapshotCommandError = async ( +export const de_DeleteDomainEntryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteDomainEntryResult(data, context); + const response: DeleteDomainEntryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteAlarmCommand + * deserializeAws_json1_1DeleteInstanceCommand */ -export const de_DeleteAlarmCommand = async ( +export const de_DeleteInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteAlarmCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteAlarmResult(data, context); - const response: DeleteAlarmCommandOutput = { + contents = de_DeleteInstanceResult(data, context); + const response: DeleteInstanceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4928,60 +3834,39 @@ export const de_DeleteAlarmCommand = async ( }; /** - * deserializeAws_json1_1DeleteAlarmCommandError + * deserializeAws_json1_1DeleteInstanceSnapshotCommand */ -const de_DeleteAlarmCommandError = async ( +export const de_DeleteInstanceSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteInstanceSnapshotResult(data, context); + const response: DeleteInstanceSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteAutoSnapshotCommand + * deserializeAws_json1_1DeleteKeyPairCommand */ -export const de_DeleteAutoSnapshotCommand = async ( +export const de_DeleteKeyPairCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteAutoSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteAutoSnapshotResult(data, context); - const response: DeleteAutoSnapshotCommandOutput = { + contents = de_DeleteKeyPairResult(data, context); + const response: DeleteKeyPairCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4989,60 +3874,39 @@ export const de_DeleteAutoSnapshotCommand = async ( }; /** - * deserializeAws_json1_1DeleteAutoSnapshotCommandError + * deserializeAws_json1_1DeleteKnownHostKeysCommand */ -const de_DeleteAutoSnapshotCommandError = async ( +export const de_DeleteKnownHostKeysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteKnownHostKeysResult(data, context); + const response: DeleteKnownHostKeysCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteBucketCommand + * deserializeAws_json1_1DeleteLoadBalancerCommand */ -export const de_DeleteBucketCommand = async ( +export const de_DeleteLoadBalancerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteBucketCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteBucketResult(data, context); - const response: DeleteBucketCommandOutput = { + contents = de_DeleteLoadBalancerResult(data, context); + const response: DeleteLoadBalancerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5050,57 +3914,39 @@ export const de_DeleteBucketCommand = async ( }; /** - * deserializeAws_json1_1DeleteBucketCommandError + * deserializeAws_json1_1DeleteLoadBalancerTlsCertificateCommand */ -const de_DeleteBucketCommandError = async ( +export const de_DeleteLoadBalancerTlsCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteLoadBalancerTlsCertificateResult(data, context); + const response: DeleteLoadBalancerTlsCertificateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteBucketAccessKeyCommand + * deserializeAws_json1_1DeleteRelationalDatabaseCommand */ -export const de_DeleteBucketAccessKeyCommand = async ( +export const de_DeleteRelationalDatabaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteBucketAccessKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteBucketAccessKeyResult(data, context); - const response: DeleteBucketAccessKeyCommandOutput = { + contents = de_DeleteRelationalDatabaseResult(data, context); + const response: DeleteRelationalDatabaseCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5108,57 +3954,39 @@ export const de_DeleteBucketAccessKeyCommand = async ( }; /** - * deserializeAws_json1_1DeleteBucketAccessKeyCommandError + * deserializeAws_json1_1DeleteRelationalDatabaseSnapshotCommand */ -const de_DeleteBucketAccessKeyCommandError = async ( +export const de_DeleteRelationalDatabaseSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteRelationalDatabaseSnapshotResult(data, context); + const response: DeleteRelationalDatabaseSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteCertificateCommand + * deserializeAws_json1_1DetachCertificateFromDistributionCommand */ -export const de_DeleteCertificateCommand = async ( +export const de_DetachCertificateFromDistributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteCertificateResult(data, context); - const response: DeleteCertificateCommandOutput = { + contents = de_DetachCertificateFromDistributionResult(data, context); + const response: DetachCertificateFromDistributionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5166,57 +3994,39 @@ export const de_DeleteCertificateCommand = async ( }; /** - * deserializeAws_json1_1DeleteCertificateCommandError + * deserializeAws_json1_1DetachDiskCommand */ -const de_DeleteCertificateCommandError = async ( +export const de_DetachDiskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DetachDiskResult(data, context); + const response: DetachDiskCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteContactMethodCommand + * deserializeAws_json1_1DetachInstancesFromLoadBalancerCommand */ -export const de_DeleteContactMethodCommand = async ( +export const de_DetachInstancesFromLoadBalancerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteContactMethodCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteContactMethodResult(data, context); - const response: DeleteContactMethodCommandOutput = { + contents = de_DetachInstancesFromLoadBalancerResult(data, context); + const response: DetachInstancesFromLoadBalancerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5224,60 +4034,39 @@ export const de_DeleteContactMethodCommand = async ( }; /** - * deserializeAws_json1_1DeleteContactMethodCommandError + * deserializeAws_json1_1DetachStaticIpCommand */ -const de_DeleteContactMethodCommandError = async ( +export const de_DetachStaticIpCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DetachStaticIpResult(data, context); + const response: DetachStaticIpCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteContainerImageCommand + * deserializeAws_json1_1DisableAddOnCommand */ -export const de_DeleteContainerImageCommand = async ( +export const de_DisableAddOnCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteContainerImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteContainerImageCommandOutput = { + contents = de_DisableAddOnResult(data, context); + const response: DisableAddOnCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5285,57 +4074,19 @@ export const de_DeleteContainerImageCommand = async ( }; /** - * deserializeAws_json1_1DeleteContainerImageCommandError - */ -const de_DeleteContainerImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteContainerServiceCommand + * deserializeAws_json1_1DownloadDefaultKeyPairCommand */ -export const de_DeleteContainerServiceCommand = async ( +export const de_DownloadDefaultKeyPairCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteContainerServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteContainerServiceCommandOutput = { + contents = de_DownloadDefaultKeyPairResult(data, context); + const response: DownloadDefaultKeyPairCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5343,57 +4094,19 @@ export const de_DeleteContainerServiceCommand = async ( }; /** - * deserializeAws_json1_1DeleteContainerServiceCommandError - */ -const de_DeleteContainerServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDiskCommand + * deserializeAws_json1_1EnableAddOnCommand */ -export const de_DeleteDiskCommand = async ( +export const de_EnableAddOnCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDiskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDiskResult(data, context); - const response: DeleteDiskCommandOutput = { + contents = de_EnableAddOnResult(data, context); + const response: EnableAddOnCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5401,63 +4114,39 @@ export const de_DeleteDiskCommand = async ( }; /** - * deserializeAws_json1_1DeleteDiskCommandError + * deserializeAws_json1_1ExportSnapshotCommand */ -const de_DeleteDiskCommandError = async ( +export const de_ExportSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ExportSnapshotResult(data, context); + const response: ExportSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteDiskSnapshotCommand + * deserializeAws_json1_1GetActiveNamesCommand */ -export const de_DeleteDiskSnapshotCommand = async ( +export const de_GetActiveNamesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDiskSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDiskSnapshotResult(data, context); - const response: DeleteDiskSnapshotCommandOutput = { + contents = _json(data); + const response: GetActiveNamesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5465,63 +4154,39 @@ export const de_DeleteDiskSnapshotCommand = async ( }; /** - * deserializeAws_json1_1DeleteDiskSnapshotCommandError + * deserializeAws_json1_1GetAlarmsCommand */ -const de_DeleteDiskSnapshotCommandError = async ( +export const de_GetAlarmsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetAlarmsResult(data, context); + const response: GetAlarmsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteDistributionCommand + * deserializeAws_json1_1GetAutoSnapshotsCommand */ -export const de_DeleteDistributionCommand = async ( +export const de_GetAutoSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDistributionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDistributionResult(data, context); - const response: DeleteDistributionCommandOutput = { + contents = de_GetAutoSnapshotsResult(data, context); + const response: GetAutoSnapshotsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5529,60 +4194,39 @@ export const de_DeleteDistributionCommand = async ( }; /** - * deserializeAws_json1_1DeleteDistributionCommandError + * deserializeAws_json1_1GetBlueprintsCommand */ -const de_DeleteDistributionCommandError = async ( +export const de_GetBlueprintsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetBlueprintsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteDomainCommand + * deserializeAws_json1_1GetBucketAccessKeysCommand */ -export const de_DeleteDomainCommand = async ( +export const de_GetBucketAccessKeysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDomainResult(data, context); - const response: DeleteDomainCommandOutput = { + contents = de_GetBucketAccessKeysResult(data, context); + const response: GetBucketAccessKeysCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5590,63 +4234,39 @@ export const de_DeleteDomainCommand = async ( }; /** - * deserializeAws_json1_1DeleteDomainCommandError + * deserializeAws_json1_1GetBucketBundlesCommand */ -const de_DeleteDomainCommandError = async ( +export const de_GetBucketBundlesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetBucketBundlesResult(data, context); + const response: GetBucketBundlesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteDomainEntryCommand + * deserializeAws_json1_1GetBucketMetricDataCommand */ -export const de_DeleteDomainEntryCommand = async ( +export const de_GetBucketMetricDataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDomainEntryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDomainEntryResult(data, context); - const response: DeleteDomainEntryCommandOutput = { + contents = de_GetBucketMetricDataResult(data, context); + const response: GetBucketMetricDataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5654,63 +4274,39 @@ export const de_DeleteDomainEntryCommand = async ( }; /** - * deserializeAws_json1_1DeleteDomainEntryCommandError + * deserializeAws_json1_1GetBucketsCommand */ -const de_DeleteDomainEntryCommandError = async ( +export const de_GetBucketsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetBucketsResult(data, context); + const response: GetBucketsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteInstanceCommand + * deserializeAws_json1_1GetBundlesCommand */ -export const de_DeleteInstanceCommand = async ( +export const de_GetBundlesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteInstanceResult(data, context); - const response: DeleteInstanceCommandOutput = { + contents = de_GetBundlesResult(data, context); + const response: GetBundlesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5718,63 +4314,39 @@ export const de_DeleteInstanceCommand = async ( }; /** - * deserializeAws_json1_1DeleteInstanceCommandError + * deserializeAws_json1_1GetCertificatesCommand */ -const de_DeleteInstanceCommandError = async ( +export const de_GetCertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetCertificatesResult(data, context); + const response: GetCertificatesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteInstanceSnapshotCommand + * deserializeAws_json1_1GetCloudFormationStackRecordsCommand */ -export const de_DeleteInstanceSnapshotCommand = async ( +export const de_GetCloudFormationStackRecordsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteInstanceSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteInstanceSnapshotResult(data, context); - const response: DeleteInstanceSnapshotCommandOutput = { + contents = de_GetCloudFormationStackRecordsResult(data, context); + const response: GetCloudFormationStackRecordsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5782,63 +4354,59 @@ export const de_DeleteInstanceSnapshotCommand = async ( }; /** - * deserializeAws_json1_1DeleteInstanceSnapshotCommandError + * deserializeAws_json1_1GetContactMethodsCommand */ -const de_DeleteInstanceSnapshotCommandError = async ( +export const de_GetContactMethodsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetContactMethodsResult(data, context); + const response: GetContactMethodsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1GetContainerAPIMetadataCommand + */ +export const de_GetContainerAPIMetadataCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetContainerAPIMetadataCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteKeyPairCommand + * deserializeAws_json1_1GetContainerImagesCommand */ -export const de_DeleteKeyPairCommand = async ( +export const de_GetContainerImagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteKeyPairCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteKeyPairResult(data, context); - const response: DeleteKeyPairCommandOutput = { + contents = de_GetContainerImagesResult(data, context); + const response: GetContainerImagesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5846,63 +4414,39 @@ export const de_DeleteKeyPairCommand = async ( }; /** - * deserializeAws_json1_1DeleteKeyPairCommandError + * deserializeAws_json1_1GetContainerLogCommand */ -const de_DeleteKeyPairCommandError = async ( +export const de_GetContainerLogCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetContainerLogResult(data, context); + const response: GetContainerLogCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1DeleteKnownHostKeysCommand + * deserializeAws_json1_1GetContainerServiceDeploymentsCommand */ -export const de_DeleteKnownHostKeysCommand = async ( +export const de_GetContainerServiceDeploymentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteKnownHostKeysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteKnownHostKeysResult(data, context); - const response: DeleteKnownHostKeysCommandOutput = { + contents = de_GetContainerServiceDeploymentsResult(data, context); + const response: GetContainerServiceDeploymentsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5910,63 +4454,19 @@ export const de_DeleteKnownHostKeysCommand = async ( }; /** - * deserializeAws_json1_1DeleteKnownHostKeysCommandError - */ -const de_DeleteKnownHostKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteLoadBalancerCommand + * deserializeAws_json1_1GetContainerServiceMetricDataCommand */ -export const de_DeleteLoadBalancerCommand = async ( +export const de_GetContainerServiceMetricDataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteLoadBalancerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteLoadBalancerResult(data, context); - const response: DeleteLoadBalancerCommandOutput = { + contents = de_GetContainerServiceMetricDataResult(data, context); + const response: GetContainerServiceMetricDataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5974,63 +4474,19 @@ export const de_DeleteLoadBalancerCommand = async ( }; /** - * deserializeAws_json1_1DeleteLoadBalancerCommandError - */ -const de_DeleteLoadBalancerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteLoadBalancerTlsCertificateCommand + * deserializeAws_json1_1GetContainerServicePowersCommand */ -export const de_DeleteLoadBalancerTlsCertificateCommand = async ( +export const de_GetContainerServicePowersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteLoadBalancerTlsCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteLoadBalancerTlsCertificateResult(data, context); - const response: DeleteLoadBalancerTlsCertificateCommandOutput = { + contents = de_GetContainerServicePowersResult(data, context); + const response: GetContainerServicePowersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6038,63 +4494,39 @@ export const de_DeleteLoadBalancerTlsCertificateCommand = async ( }; /** - * deserializeAws_json1_1DeleteLoadBalancerTlsCertificateCommandError + * deserializeAws_json1_1GetContainerServicesCommand */ -const de_DeleteLoadBalancerTlsCertificateCommandError = async ( +export const de_GetContainerServicesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ContainerServicesListResult(data, context); + const response: GetContainerServicesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRelationalDatabaseCommand + * deserializeAws_json1_1GetCostEstimateCommand */ -export const de_DeleteRelationalDatabaseCommand = async ( +export const de_GetCostEstimateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRelationalDatabaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteRelationalDatabaseResult(data, context); - const response: DeleteRelationalDatabaseCommandOutput = { + contents = de_GetCostEstimateResult(data, context); + const response: GetCostEstimateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6102,63 +4534,39 @@ export const de_DeleteRelationalDatabaseCommand = async ( }; /** - * deserializeAws_json1_1DeleteRelationalDatabaseCommandError + * deserializeAws_json1_1GetDiskCommand */ -const de_DeleteRelationalDatabaseCommandError = async ( +export const de_GetDiskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetDiskResult(data, context); + const response: GetDiskCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRelationalDatabaseSnapshotCommand + * deserializeAws_json1_1GetDisksCommand */ -export const de_DeleteRelationalDatabaseSnapshotCommand = async ( +export const de_GetDisksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRelationalDatabaseSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteRelationalDatabaseSnapshotResult(data, context); - const response: DeleteRelationalDatabaseSnapshotCommandOutput = { + contents = de_GetDisksResult(data, context); + const response: GetDisksCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6166,4100 +4574,19 @@ export const de_DeleteRelationalDatabaseSnapshotCommand = async ( }; /** - * deserializeAws_json1_1DeleteRelationalDatabaseSnapshotCommandError + * deserializeAws_json1_1GetDiskSnapshotCommand */ -const de_DeleteRelationalDatabaseSnapshotCommandError = async ( +export const de_GetDiskSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetachCertificateFromDistributionCommand - */ -export const de_DetachCertificateFromDistributionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetachCertificateFromDistributionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetachCertificateFromDistributionResult(data, context); - const response: DetachCertificateFromDistributionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetachCertificateFromDistributionCommandError - */ -const de_DetachCertificateFromDistributionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetachDiskCommand - */ -export const de_DetachDiskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetachDiskCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetachDiskResult(data, context); - const response: DetachDiskCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetachDiskCommandError - */ -const de_DetachDiskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetachInstancesFromLoadBalancerCommand - */ -export const de_DetachInstancesFromLoadBalancerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetachInstancesFromLoadBalancerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetachInstancesFromLoadBalancerResult(data, context); - const response: DetachInstancesFromLoadBalancerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetachInstancesFromLoadBalancerCommandError - */ -const de_DetachInstancesFromLoadBalancerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetachStaticIpCommand - */ -export const de_DetachStaticIpCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetachStaticIpCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetachStaticIpResult(data, context); - const response: DetachStaticIpCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetachStaticIpCommandError - */ -const de_DetachStaticIpCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisableAddOnCommand - */ -export const de_DisableAddOnCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisableAddOnCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DisableAddOnResult(data, context); - const response: DisableAddOnCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisableAddOnCommandError - */ -const de_DisableAddOnCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DownloadDefaultKeyPairCommand - */ -export const de_DownloadDefaultKeyPairCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DownloadDefaultKeyPairCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DownloadDefaultKeyPairResult(data, context); - const response: DownloadDefaultKeyPairCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DownloadDefaultKeyPairCommandError - */ -const de_DownloadDefaultKeyPairCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1EnableAddOnCommand - */ -export const de_EnableAddOnCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_EnableAddOnCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_EnableAddOnResult(data, context); - const response: EnableAddOnCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1EnableAddOnCommandError - */ -const de_EnableAddOnCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ExportSnapshotCommand - */ -export const de_ExportSnapshotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ExportSnapshotCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ExportSnapshotResult(data, context); - const response: ExportSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ExportSnapshotCommandError - */ -const de_ExportSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetActiveNamesCommand - */ -export const de_GetActiveNamesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetActiveNamesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetActiveNamesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetActiveNamesCommandError - */ -const de_GetActiveNamesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetAlarmsCommand - */ -export const de_GetAlarmsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetAlarmsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetAlarmsResult(data, context); - const response: GetAlarmsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetAlarmsCommandError - */ -const de_GetAlarmsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetAutoSnapshotsCommand - */ -export const de_GetAutoSnapshotsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetAutoSnapshotsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetAutoSnapshotsResult(data, context); - const response: GetAutoSnapshotsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetAutoSnapshotsCommandError - */ -const de_GetAutoSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetBlueprintsCommand - */ -export const de_GetBlueprintsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetBlueprintsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetBlueprintsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetBlueprintsCommandError - */ -const de_GetBlueprintsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetBucketAccessKeysCommand - */ -export const de_GetBucketAccessKeysCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetBucketAccessKeysCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetBucketAccessKeysResult(data, context); - const response: GetBucketAccessKeysCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetBucketAccessKeysCommandError - */ -const de_GetBucketAccessKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetBucketBundlesCommand - */ -export const de_GetBucketBundlesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetBucketBundlesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetBucketBundlesResult(data, context); - const response: GetBucketBundlesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetBucketBundlesCommandError - */ -const de_GetBucketBundlesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetBucketMetricDataCommand - */ -export const de_GetBucketMetricDataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetBucketMetricDataCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetBucketMetricDataResult(data, context); - const response: GetBucketMetricDataCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetBucketMetricDataCommandError - */ -const de_GetBucketMetricDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetBucketsCommand - */ -export const de_GetBucketsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetBucketsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetBucketsResult(data, context); - const response: GetBucketsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetBucketsCommandError - */ -const de_GetBucketsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetBundlesCommand - */ -export const de_GetBundlesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetBundlesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetBundlesResult(data, context); - const response: GetBundlesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetBundlesCommandError - */ -const de_GetBundlesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCertificatesCommand - */ -export const de_GetCertificatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetCertificatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetCertificatesResult(data, context); - const response: GetCertificatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetCertificatesCommandError - */ -const de_GetCertificatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCloudFormationStackRecordsCommand - */ -export const de_GetCloudFormationStackRecordsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetCloudFormationStackRecordsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetCloudFormationStackRecordsResult(data, context); - const response: GetCloudFormationStackRecordsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetCloudFormationStackRecordsCommandError - */ -const de_GetCloudFormationStackRecordsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetContactMethodsCommand - */ -export const de_GetContactMethodsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetContactMethodsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetContactMethodsResult(data, context); - const response: GetContactMethodsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetContactMethodsCommandError - */ -const de_GetContactMethodsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetContainerAPIMetadataCommand - */ -export const de_GetContainerAPIMetadataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetContainerAPIMetadataCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetContainerAPIMetadataCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetContainerAPIMetadataCommandError - */ -const de_GetContainerAPIMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetContainerImagesCommand - */ -export const de_GetContainerImagesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetContainerImagesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetContainerImagesResult(data, context); - const response: GetContainerImagesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetContainerImagesCommandError - */ -const de_GetContainerImagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetContainerLogCommand - */ -export const de_GetContainerLogCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetContainerLogCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetContainerLogResult(data, context); - const response: GetContainerLogCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetContainerLogCommandError - */ -const de_GetContainerLogCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetContainerServiceDeploymentsCommand - */ -export const de_GetContainerServiceDeploymentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetContainerServiceDeploymentsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetContainerServiceDeploymentsResult(data, context); - const response: GetContainerServiceDeploymentsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetContainerServiceDeploymentsCommandError - */ -const de_GetContainerServiceDeploymentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetContainerServiceMetricDataCommand - */ -export const de_GetContainerServiceMetricDataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetContainerServiceMetricDataCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetContainerServiceMetricDataResult(data, context); - const response: GetContainerServiceMetricDataCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetContainerServiceMetricDataCommandError - */ -const de_GetContainerServiceMetricDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetContainerServicePowersCommand - */ -export const de_GetContainerServicePowersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetContainerServicePowersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetContainerServicePowersResult(data, context); - const response: GetContainerServicePowersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetContainerServicePowersCommandError - */ -const de_GetContainerServicePowersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetContainerServicesCommand - */ -export const de_GetContainerServicesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetContainerServicesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ContainerServicesListResult(data, context); - const response: GetContainerServicesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetContainerServicesCommandError - */ -const de_GetContainerServicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCostEstimateCommand - */ -export const de_GetCostEstimateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetCostEstimateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetCostEstimateResult(data, context); - const response: GetCostEstimateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetCostEstimateCommandError - */ -const de_GetCostEstimateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDiskCommand - */ -export const de_GetDiskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDiskCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDiskResult(data, context); - const response: GetDiskCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDiskCommandError - */ -const de_GetDiskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDisksCommand - */ -export const de_GetDisksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDisksCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDisksResult(data, context); - const response: GetDisksCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDisksCommandError - */ -const de_GetDisksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDiskSnapshotCommand - */ -export const de_GetDiskSnapshotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDiskSnapshotCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDiskSnapshotResult(data, context); - const response: GetDiskSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDiskSnapshotCommandError - */ -const de_GetDiskSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDiskSnapshotsCommand - */ -export const de_GetDiskSnapshotsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDiskSnapshotsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDiskSnapshotsResult(data, context); - const response: GetDiskSnapshotsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDiskSnapshotsCommandError - */ -const de_GetDiskSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDistributionBundlesCommand - */ -export const de_GetDistributionBundlesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDistributionBundlesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDistributionBundlesResult(data, context); - const response: GetDistributionBundlesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDistributionBundlesCommandError - */ -const de_GetDistributionBundlesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDistributionLatestCacheResetCommand - */ -export const de_GetDistributionLatestCacheResetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDistributionLatestCacheResetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDistributionLatestCacheResetResult(data, context); - const response: GetDistributionLatestCacheResetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDistributionLatestCacheResetCommandError - */ -const de_GetDistributionLatestCacheResetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDistributionMetricDataCommand - */ -export const de_GetDistributionMetricDataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDistributionMetricDataCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDistributionMetricDataResult(data, context); - const response: GetDistributionMetricDataCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDistributionMetricDataCommandError - */ -const de_GetDistributionMetricDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDistributionsCommand - */ -export const de_GetDistributionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDistributionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDistributionsResult(data, context); - const response: GetDistributionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDistributionsCommandError - */ -const de_GetDistributionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDomainCommand - */ -export const de_GetDomainCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDomainCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDomainResult(data, context); - const response: GetDomainCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDomainCommandError - */ -const de_GetDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDomainsCommand - */ -export const de_GetDomainsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDomainsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDomainsResult(data, context); - const response: GetDomainsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDomainsCommandError - */ -const de_GetDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetExportSnapshotRecordsCommand - */ -export const de_GetExportSnapshotRecordsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetExportSnapshotRecordsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetExportSnapshotRecordsResult(data, context); - const response: GetExportSnapshotRecordsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetExportSnapshotRecordsCommandError - */ -const de_GetExportSnapshotRecordsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetInstanceCommand - */ -export const de_GetInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetInstanceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetInstanceResult(data, context); - const response: GetInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetInstanceCommandError - */ -const de_GetInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetInstanceAccessDetailsCommand - */ -export const de_GetInstanceAccessDetailsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetInstanceAccessDetailsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetInstanceAccessDetailsResult(data, context); - const response: GetInstanceAccessDetailsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetInstanceAccessDetailsCommandError - */ -const de_GetInstanceAccessDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetInstanceMetricDataCommand - */ -export const de_GetInstanceMetricDataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetInstanceMetricDataCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetInstanceMetricDataResult(data, context); - const response: GetInstanceMetricDataCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetInstanceMetricDataCommandError - */ -const de_GetInstanceMetricDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetInstancePortStatesCommand - */ -export const de_GetInstancePortStatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetInstancePortStatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetInstancePortStatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetInstancePortStatesCommandError - */ -const de_GetInstancePortStatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetInstancesCommand - */ -export const de_GetInstancesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetInstancesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetInstancesResult(data, context); - const response: GetInstancesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetInstancesCommandError - */ -const de_GetInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetInstanceSnapshotCommand - */ -export const de_GetInstanceSnapshotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetInstanceSnapshotCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetInstanceSnapshotResult(data, context); - const response: GetInstanceSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetInstanceSnapshotCommandError - */ -const de_GetInstanceSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetInstanceSnapshotsCommand - */ -export const de_GetInstanceSnapshotsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetInstanceSnapshotsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetInstanceSnapshotsResult(data, context); - const response: GetInstanceSnapshotsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetInstanceSnapshotsCommandError - */ -const de_GetInstanceSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetInstanceStateCommand - */ -export const de_GetInstanceStateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetInstanceStateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetInstanceStateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetInstanceStateCommandError - */ -const de_GetInstanceStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetKeyPairCommand - */ -export const de_GetKeyPairCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetKeyPairCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetKeyPairResult(data, context); - const response: GetKeyPairCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetKeyPairCommandError - */ -const de_GetKeyPairCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetKeyPairsCommand - */ -export const de_GetKeyPairsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetKeyPairsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetKeyPairsResult(data, context); - const response: GetKeyPairsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetKeyPairsCommandError - */ -const de_GetKeyPairsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLoadBalancerCommand - */ -export const de_GetLoadBalancerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLoadBalancerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetLoadBalancerResult(data, context); - const response: GetLoadBalancerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetLoadBalancerCommandError - */ -const de_GetLoadBalancerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLoadBalancerMetricDataCommand - */ -export const de_GetLoadBalancerMetricDataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLoadBalancerMetricDataCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetLoadBalancerMetricDataResult(data, context); - const response: GetLoadBalancerMetricDataCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetLoadBalancerMetricDataCommandError - */ -const de_GetLoadBalancerMetricDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLoadBalancersCommand - */ -export const de_GetLoadBalancersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLoadBalancersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetLoadBalancersResult(data, context); - const response: GetLoadBalancersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetLoadBalancersCommandError - */ -const de_GetLoadBalancersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLoadBalancerTlsCertificatesCommand - */ -export const de_GetLoadBalancerTlsCertificatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLoadBalancerTlsCertificatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetLoadBalancerTlsCertificatesResult(data, context); - const response: GetLoadBalancerTlsCertificatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetLoadBalancerTlsCertificatesCommandError - */ -const de_GetLoadBalancerTlsCertificatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLoadBalancerTlsPoliciesCommand - */ -export const de_GetLoadBalancerTlsPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLoadBalancerTlsPoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetLoadBalancerTlsPoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetLoadBalancerTlsPoliciesCommandError - */ -const de_GetLoadBalancerTlsPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetOperationCommand - */ -export const de_GetOperationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetOperationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetOperationResult(data, context); - const response: GetOperationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetOperationCommandError - */ -const de_GetOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetOperationsCommand - */ -export const de_GetOperationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetOperationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetOperationsResult(data, context); - const response: GetOperationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetOperationsCommandError - */ -const de_GetOperationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetOperationsForResourceCommand - */ -export const de_GetOperationsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetOperationsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetOperationsForResourceResult(data, context); - const response: GetOperationsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetOperationsForResourceCommandError - */ -const de_GetOperationsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRegionsCommand - */ -export const de_GetRegionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRegionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetRegionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRegionsCommandError - */ -const de_GetRegionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseCommand - */ -export const de_GetRelationalDatabaseCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRelationalDatabaseCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetRelationalDatabaseResult(data, context); - const response: GetRelationalDatabaseCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseCommandError - */ -const de_GetRelationalDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseBlueprintsCommand - */ -export const de_GetRelationalDatabaseBlueprintsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRelationalDatabaseBlueprintsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetRelationalDatabaseBlueprintsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseBlueprintsCommandError - */ -const de_GetRelationalDatabaseBlueprintsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseBundlesCommand - */ -export const de_GetRelationalDatabaseBundlesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRelationalDatabaseBundlesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetRelationalDatabaseBundlesResult(data, context); - const response: GetRelationalDatabaseBundlesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseBundlesCommandError - */ -const de_GetRelationalDatabaseBundlesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseEventsCommand - */ -export const de_GetRelationalDatabaseEventsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRelationalDatabaseEventsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetRelationalDatabaseEventsResult(data, context); - const response: GetRelationalDatabaseEventsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseEventsCommandError - */ -const de_GetRelationalDatabaseEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseLogEventsCommand - */ -export const de_GetRelationalDatabaseLogEventsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRelationalDatabaseLogEventsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetRelationalDatabaseLogEventsResult(data, context); - const response: GetRelationalDatabaseLogEventsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseLogEventsCommandError - */ -const de_GetRelationalDatabaseLogEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseLogStreamsCommand - */ -export const de_GetRelationalDatabaseLogStreamsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRelationalDatabaseLogStreamsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetRelationalDatabaseLogStreamsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseLogStreamsCommandError - */ -const de_GetRelationalDatabaseLogStreamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseMasterUserPasswordCommand - */ -export const de_GetRelationalDatabaseMasterUserPasswordCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRelationalDatabaseMasterUserPasswordCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetRelationalDatabaseMasterUserPasswordResult(data, context); - const response: GetRelationalDatabaseMasterUserPasswordCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseMasterUserPasswordCommandError - */ -const de_GetRelationalDatabaseMasterUserPasswordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseMetricDataCommand - */ -export const de_GetRelationalDatabaseMetricDataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRelationalDatabaseMetricDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetRelationalDatabaseMetricDataResult(data, context); - const response: GetRelationalDatabaseMetricDataCommandOutput = { + contents = de_GetDiskSnapshotResult(data, context); + const response: GetDiskSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -10267,63 +4594,19 @@ export const de_GetRelationalDatabaseMetricDataCommand = async ( }; /** - * deserializeAws_json1_1GetRelationalDatabaseMetricDataCommandError - */ -const de_GetRelationalDatabaseMetricDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseParametersCommand + * deserializeAws_json1_1GetDiskSnapshotsCommand */ -export const de_GetRelationalDatabaseParametersCommand = async ( +export const de_GetDiskSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRelationalDatabaseParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetRelationalDatabaseParametersCommandOutput = { + contents = de_GetDiskSnapshotsResult(data, context); + const response: GetDiskSnapshotsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -10331,63 +4614,19 @@ export const de_GetRelationalDatabaseParametersCommand = async ( }; /** - * deserializeAws_json1_1GetRelationalDatabaseParametersCommandError - */ -const de_GetRelationalDatabaseParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRelationalDatabasesCommand + * deserializeAws_json1_1GetDistributionBundlesCommand */ -export const de_GetRelationalDatabasesCommand = async ( +export const de_GetDistributionBundlesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRelationalDatabasesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetRelationalDatabasesResult(data, context); - const response: GetRelationalDatabasesCommandOutput = { + contents = de_GetDistributionBundlesResult(data, context); + const response: GetDistributionBundlesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -10395,127 +4634,39 @@ export const de_GetRelationalDatabasesCommand = async ( }; /** - * deserializeAws_json1_1GetRelationalDatabasesCommandError - */ -const de_GetRelationalDatabasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseSnapshotCommand + * deserializeAws_json1_1GetDistributionLatestCacheResetCommand */ -export const de_GetRelationalDatabaseSnapshotCommand = async ( +export const de_GetDistributionLatestCacheResetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRelationalDatabaseSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetRelationalDatabaseSnapshotResult(data, context); - const response: GetRelationalDatabaseSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRelationalDatabaseSnapshotCommandError - */ -const de_GetRelationalDatabaseSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + contents = de_GetDistributionLatestCacheResetResult(data, context); + const response: GetDistributionLatestCacheResetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetRelationalDatabaseSnapshotsCommand + * deserializeAws_json1_1GetDistributionMetricDataCommand */ -export const de_GetRelationalDatabaseSnapshotsCommand = async ( +export const de_GetDistributionMetricDataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRelationalDatabaseSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetRelationalDatabaseSnapshotsResult(data, context); - const response: GetRelationalDatabaseSnapshotsCommandOutput = { + contents = de_GetDistributionMetricDataResult(data, context); + const response: GetDistributionMetricDataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -10523,63 +4674,39 @@ export const de_GetRelationalDatabaseSnapshotsCommand = async ( }; /** - * deserializeAws_json1_1GetRelationalDatabaseSnapshotsCommandError + * deserializeAws_json1_1GetDistributionsCommand */ -const de_GetRelationalDatabaseSnapshotsCommandError = async ( +export const de_GetDistributionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetDistributionsResult(data, context); + const response: GetDistributionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetSetupHistoryCommand + * deserializeAws_json1_1GetDomainCommand */ -export const de_GetSetupHistoryCommand = async ( +export const de_GetDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetSetupHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetSetupHistoryResult(data, context); - const response: GetSetupHistoryCommandOutput = { + contents = de_GetDomainResult(data, context); + const response: GetDomainCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -10587,57 +4714,39 @@ export const de_GetSetupHistoryCommand = async ( }; /** - * deserializeAws_json1_1GetSetupHistoryCommandError + * deserializeAws_json1_1GetDomainsCommand */ -const de_GetSetupHistoryCommandError = async ( +export const de_GetDomainsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetDomainsResult(data, context); + const response: GetDomainsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetStaticIpCommand + * deserializeAws_json1_1GetExportSnapshotRecordsCommand */ -export const de_GetStaticIpCommand = async ( +export const de_GetExportSnapshotRecordsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetStaticIpCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetStaticIpResult(data, context); - const response: GetStaticIpCommandOutput = { + contents = de_GetExportSnapshotRecordsResult(data, context); + const response: GetExportSnapshotRecordsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -10645,63 +4754,59 @@ export const de_GetStaticIpCommand = async ( }; /** - * deserializeAws_json1_1GetStaticIpCommandError + * deserializeAws_json1_1GetInstanceCommand */ -const de_GetStaticIpCommandError = async ( +export const de_GetInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetInstanceResult(data, context); + const response: GetInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1GetInstanceAccessDetailsCommand + */ +export const de_GetInstanceAccessDetailsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetInstanceAccessDetailsResult(data, context); + const response: GetInstanceAccessDetailsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetStaticIpsCommand + * deserializeAws_json1_1GetInstanceMetricDataCommand */ -export const de_GetStaticIpsCommand = async ( +export const de_GetInstanceMetricDataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetStaticIpsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetStaticIpsResult(data, context); - const response: GetStaticIpsCommandOutput = { + contents = de_GetInstanceMetricDataResult(data, context); + const response: GetInstanceMetricDataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -10709,63 +4814,59 @@ export const de_GetStaticIpsCommand = async ( }; /** - * deserializeAws_json1_1GetStaticIpsCommandError + * deserializeAws_json1_1GetInstancePortStatesCommand */ -const de_GetStaticIpsCommandError = async ( +export const de_GetInstancePortStatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetInstancePortStatesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1GetInstancesCommand + */ +export const de_GetInstancesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetInstancesResult(data, context); + const response: GetInstancesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ImportKeyPairCommand + * deserializeAws_json1_1GetInstanceSnapshotCommand */ -export const de_ImportKeyPairCommand = async ( +export const de_GetInstanceSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ImportKeyPairCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ImportKeyPairResult(data, context); - const response: ImportKeyPairCommandOutput = { + contents = de_GetInstanceSnapshotResult(data, context); + const response: GetInstanceSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -10773,63 +4874,39 @@ export const de_ImportKeyPairCommand = async ( }; /** - * deserializeAws_json1_1ImportKeyPairCommandError + * deserializeAws_json1_1GetInstanceSnapshotsCommand */ -const de_ImportKeyPairCommandError = async ( +export const de_GetInstanceSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetInstanceSnapshotsResult(data, context); + const response: GetInstanceSnapshotsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1IsVpcPeeredCommand + * deserializeAws_json1_1GetInstanceStateCommand */ -export const de_IsVpcPeeredCommand = async ( +export const de_GetInstanceStateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_IsVpcPeeredCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: IsVpcPeeredCommandOutput = { + const response: GetInstanceStateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -10837,63 +4914,19 @@ export const de_IsVpcPeeredCommand = async ( }; /** - * deserializeAws_json1_1IsVpcPeeredCommandError - */ -const de_IsVpcPeeredCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1OpenInstancePublicPortsCommand + * deserializeAws_json1_1GetKeyPairCommand */ -export const de_OpenInstancePublicPortsCommand = async ( +export const de_GetKeyPairCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_OpenInstancePublicPortsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_OpenInstancePublicPortsResult(data, context); - const response: OpenInstancePublicPortsCommandOutput = { + contents = de_GetKeyPairResult(data, context); + const response: GetKeyPairCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -10901,63 +4934,19 @@ export const de_OpenInstancePublicPortsCommand = async ( }; /** - * deserializeAws_json1_1OpenInstancePublicPortsCommandError - */ -const de_OpenInstancePublicPortsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PeerVpcCommand + * deserializeAws_json1_1GetKeyPairsCommand */ -export const de_PeerVpcCommand = async ( +export const de_GetKeyPairsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PeerVpcCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_PeerVpcResult(data, context); - const response: PeerVpcCommandOutput = { + contents = de_GetKeyPairsResult(data, context); + const response: GetKeyPairsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -10965,63 +4954,39 @@ export const de_PeerVpcCommand = async ( }; /** - * deserializeAws_json1_1PeerVpcCommandError + * deserializeAws_json1_1GetLoadBalancerCommand */ -const de_PeerVpcCommandError = async ( +export const de_GetLoadBalancerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetLoadBalancerResult(data, context); + const response: GetLoadBalancerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutAlarmCommand + * deserializeAws_json1_1GetLoadBalancerMetricDataCommand */ -export const de_PutAlarmCommand = async ( +export const de_GetLoadBalancerMetricDataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutAlarmCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_PutAlarmResult(data, context); - const response: PutAlarmCommandOutput = { + contents = de_GetLoadBalancerMetricDataResult(data, context); + const response: GetLoadBalancerMetricDataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11029,60 +4994,39 @@ export const de_PutAlarmCommand = async ( }; /** - * deserializeAws_json1_1PutAlarmCommandError + * deserializeAws_json1_1GetLoadBalancersCommand */ -const de_PutAlarmCommandError = async ( +export const de_GetLoadBalancersCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetLoadBalancersResult(data, context); + const response: GetLoadBalancersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutInstancePublicPortsCommand + * deserializeAws_json1_1GetLoadBalancerTlsCertificatesCommand */ -export const de_PutInstancePublicPortsCommand = async ( +export const de_GetLoadBalancerTlsCertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutInstancePublicPortsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_PutInstancePublicPortsResult(data, context); - const response: PutInstancePublicPortsCommandOutput = { + contents = de_GetLoadBalancerTlsCertificatesResult(data, context); + const response: GetLoadBalancerTlsCertificatesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11090,63 +5034,39 @@ export const de_PutInstancePublicPortsCommand = async ( }; /** - * deserializeAws_json1_1PutInstancePublicPortsCommandError + * deserializeAws_json1_1GetLoadBalancerTlsPoliciesCommand */ -const de_PutInstancePublicPortsCommandError = async ( +export const de_GetLoadBalancerTlsPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetLoadBalancerTlsPoliciesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RebootInstanceCommand + * deserializeAws_json1_1GetOperationCommand */ -export const de_RebootInstanceCommand = async ( +export const de_GetOperationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RebootInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RebootInstanceResult(data, context); - const response: RebootInstanceCommandOutput = { + contents = de_GetOperationResult(data, context); + const response: GetOperationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11154,63 +5074,39 @@ export const de_RebootInstanceCommand = async ( }; /** - * deserializeAws_json1_1RebootInstanceCommandError + * deserializeAws_json1_1GetOperationsCommand */ -const de_RebootInstanceCommandError = async ( +export const de_GetOperationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetOperationsResult(data, context); + const response: GetOperationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RebootRelationalDatabaseCommand + * deserializeAws_json1_1GetOperationsForResourceCommand */ -export const de_RebootRelationalDatabaseCommand = async ( +export const de_GetOperationsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RebootRelationalDatabaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RebootRelationalDatabaseResult(data, context); - const response: RebootRelationalDatabaseCommandOutput = { + contents = de_GetOperationsForResourceResult(data, context); + const response: GetOperationsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11218,63 +5114,39 @@ export const de_RebootRelationalDatabaseCommand = async ( }; /** - * deserializeAws_json1_1RebootRelationalDatabaseCommandError + * deserializeAws_json1_1GetRegionsCommand */ -const de_RebootRelationalDatabaseCommandError = async ( +export const de_GetRegionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetRegionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RegisterContainerImageCommand + * deserializeAws_json1_1GetRelationalDatabaseCommand */ -export const de_RegisterContainerImageCommand = async ( +export const de_GetRelationalDatabaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RegisterContainerImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RegisterContainerImageResult(data, context); - const response: RegisterContainerImageCommandOutput = { + contents = de_GetRelationalDatabaseResult(data, context); + const response: GetRelationalDatabaseCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11282,57 +5154,59 @@ export const de_RegisterContainerImageCommand = async ( }; /** - * deserializeAws_json1_1RegisterContainerImageCommandError + * deserializeAws_json1_1GetRelationalDatabaseBlueprintsCommand */ -const de_RegisterContainerImageCommandError = async ( +export const de_GetRelationalDatabaseBlueprintsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetRelationalDatabaseBlueprintsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1GetRelationalDatabaseBundlesCommand + */ +export const de_GetRelationalDatabaseBundlesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetRelationalDatabaseBundlesResult(data, context); + const response: GetRelationalDatabaseBundlesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ReleaseStaticIpCommand + * deserializeAws_json1_1GetRelationalDatabaseEventsCommand */ -export const de_ReleaseStaticIpCommand = async ( +export const de_GetRelationalDatabaseEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ReleaseStaticIpCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ReleaseStaticIpResult(data, context); - const response: ReleaseStaticIpCommandOutput = { + contents = de_GetRelationalDatabaseEventsResult(data, context); + const response: GetRelationalDatabaseEventsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11340,63 +5214,39 @@ export const de_ReleaseStaticIpCommand = async ( }; /** - * deserializeAws_json1_1ReleaseStaticIpCommandError + * deserializeAws_json1_1GetRelationalDatabaseLogEventsCommand */ -const de_ReleaseStaticIpCommandError = async ( +export const de_GetRelationalDatabaseLogEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetRelationalDatabaseLogEventsResult(data, context); + const response: GetRelationalDatabaseLogEventsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ResetDistributionCacheCommand + * deserializeAws_json1_1GetRelationalDatabaseLogStreamsCommand */ -export const de_ResetDistributionCacheCommand = async ( +export const de_GetRelationalDatabaseLogStreamsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ResetDistributionCacheCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ResetDistributionCacheResult(data, context); - const response: ResetDistributionCacheCommandOutput = { + contents = _json(data); + const response: GetRelationalDatabaseLogStreamsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11404,60 +5254,39 @@ export const de_ResetDistributionCacheCommand = async ( }; /** - * deserializeAws_json1_1ResetDistributionCacheCommandError + * deserializeAws_json1_1GetRelationalDatabaseMasterUserPasswordCommand */ -const de_ResetDistributionCacheCommandError = async ( +export const de_GetRelationalDatabaseMasterUserPasswordCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetRelationalDatabaseMasterUserPasswordResult(data, context); + const response: GetRelationalDatabaseMasterUserPasswordCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SendContactMethodVerificationCommand + * deserializeAws_json1_1GetRelationalDatabaseMetricDataCommand */ -export const de_SendContactMethodVerificationCommand = async ( +export const de_GetRelationalDatabaseMetricDataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SendContactMethodVerificationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_SendContactMethodVerificationResult(data, context); - const response: SendContactMethodVerificationCommandOutput = { + contents = de_GetRelationalDatabaseMetricDataResult(data, context); + const response: GetRelationalDatabaseMetricDataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11465,60 +5294,39 @@ export const de_SendContactMethodVerificationCommand = async ( }; /** - * deserializeAws_json1_1SendContactMethodVerificationCommandError + * deserializeAws_json1_1GetRelationalDatabaseParametersCommand */ -const de_SendContactMethodVerificationCommandError = async ( +export const de_GetRelationalDatabaseParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetRelationalDatabaseParametersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SetIpAddressTypeCommand + * deserializeAws_json1_1GetRelationalDatabasesCommand */ -export const de_SetIpAddressTypeCommand = async ( +export const de_GetRelationalDatabasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetIpAddressTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_SetIpAddressTypeResult(data, context); - const response: SetIpAddressTypeCommandOutput = { + contents = de_GetRelationalDatabasesResult(data, context); + const response: GetRelationalDatabasesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11526,63 +5334,39 @@ export const de_SetIpAddressTypeCommand = async ( }; /** - * deserializeAws_json1_1SetIpAddressTypeCommandError + * deserializeAws_json1_1GetRelationalDatabaseSnapshotCommand */ -const de_SetIpAddressTypeCommandError = async ( +export const de_GetRelationalDatabaseSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetRelationalDatabaseSnapshotResult(data, context); + const response: GetRelationalDatabaseSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SetResourceAccessForBucketCommand + * deserializeAws_json1_1GetRelationalDatabaseSnapshotsCommand */ -export const de_SetResourceAccessForBucketCommand = async ( +export const de_GetRelationalDatabaseSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetResourceAccessForBucketCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_SetResourceAccessForBucketResult(data, context); - const response: SetResourceAccessForBucketCommandOutput = { + contents = de_GetRelationalDatabaseSnapshotsResult(data, context); + const response: GetRelationalDatabaseSnapshotsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11590,57 +5374,39 @@ export const de_SetResourceAccessForBucketCommand = async ( }; /** - * deserializeAws_json1_1SetResourceAccessForBucketCommandError + * deserializeAws_json1_1GetSetupHistoryCommand */ -const de_SetResourceAccessForBucketCommandError = async ( +export const de_GetSetupHistoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetSetupHistoryResult(data, context); + const response: GetSetupHistoryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SetupInstanceHttpsCommand + * deserializeAws_json1_1GetStaticIpCommand */ -export const de_SetupInstanceHttpsCommand = async ( +export const de_GetStaticIpCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetupInstanceHttpsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_SetupInstanceHttpsResult(data, context); - const response: SetupInstanceHttpsCommandOutput = { + contents = de_GetStaticIpResult(data, context); + const response: GetStaticIpCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11648,57 +5414,39 @@ export const de_SetupInstanceHttpsCommand = async ( }; /** - * deserializeAws_json1_1SetupInstanceHttpsCommandError + * deserializeAws_json1_1GetStaticIpsCommand */ -const de_SetupInstanceHttpsCommandError = async ( +export const de_GetStaticIpsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetStaticIpsResult(data, context); + const response: GetStaticIpsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartGUISessionCommand + * deserializeAws_json1_1ImportKeyPairCommand */ -export const de_StartGUISessionCommand = async ( +export const de_ImportKeyPairCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartGUISessionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StartGUISessionResult(data, context); - const response: StartGUISessionCommandOutput = { + contents = de_ImportKeyPairResult(data, context); + const response: ImportKeyPairCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11706,57 +5454,39 @@ export const de_StartGUISessionCommand = async ( }; /** - * deserializeAws_json1_1StartGUISessionCommandError + * deserializeAws_json1_1IsVpcPeeredCommand */ -const de_StartGUISessionCommandError = async ( +export const de_IsVpcPeeredCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: IsVpcPeeredCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartInstanceCommand + * deserializeAws_json1_1OpenInstancePublicPortsCommand */ -export const de_StartInstanceCommand = async ( +export const de_OpenInstancePublicPortsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StartInstanceResult(data, context); - const response: StartInstanceCommandOutput = { + contents = de_OpenInstancePublicPortsResult(data, context); + const response: OpenInstancePublicPortsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11764,63 +5494,39 @@ export const de_StartInstanceCommand = async ( }; /** - * deserializeAws_json1_1StartInstanceCommandError + * deserializeAws_json1_1PeerVpcCommand */ -const de_StartInstanceCommandError = async ( +export const de_PeerVpcCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_PeerVpcResult(data, context); + const response: PeerVpcCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartRelationalDatabaseCommand + * deserializeAws_json1_1PutAlarmCommand */ -export const de_StartRelationalDatabaseCommand = async ( +export const de_PutAlarmCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartRelationalDatabaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StartRelationalDatabaseResult(data, context); - const response: StartRelationalDatabaseCommandOutput = { + contents = de_PutAlarmResult(data, context); + const response: PutAlarmCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11828,63 +5534,39 @@ export const de_StartRelationalDatabaseCommand = async ( }; /** - * deserializeAws_json1_1StartRelationalDatabaseCommandError + * deserializeAws_json1_1PutInstancePublicPortsCommand */ -const de_StartRelationalDatabaseCommandError = async ( +export const de_PutInstancePublicPortsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_PutInstancePublicPortsResult(data, context); + const response: PutInstancePublicPortsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopGUISessionCommand + * deserializeAws_json1_1RebootInstanceCommand */ -export const de_StopGUISessionCommand = async ( +export const de_RebootInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopGUISessionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StopGUISessionResult(data, context); - const response: StopGUISessionCommandOutput = { + contents = de_RebootInstanceResult(data, context); + const response: RebootInstanceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11892,57 +5574,39 @@ export const de_StopGUISessionCommand = async ( }; /** - * deserializeAws_json1_1StopGUISessionCommandError + * deserializeAws_json1_1RebootRelationalDatabaseCommand */ -const de_StopGUISessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_RebootRelationalDatabaseCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RebootRelationalDatabaseResult(data, context); + const response: RebootRelationalDatabaseCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopInstanceCommand + * deserializeAws_json1_1RegisterContainerImageCommand */ -export const de_StopInstanceCommand = async ( +export const de_RegisterContainerImageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StopInstanceResult(data, context); - const response: StopInstanceCommandOutput = { + contents = de_RegisterContainerImageResult(data, context); + const response: RegisterContainerImageCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11950,63 +5614,39 @@ export const de_StopInstanceCommand = async ( }; /** - * deserializeAws_json1_1StopInstanceCommandError + * deserializeAws_json1_1ReleaseStaticIpCommand */ -const de_StopInstanceCommandError = async ( +export const de_ReleaseStaticIpCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ReleaseStaticIpResult(data, context); + const response: ReleaseStaticIpCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopRelationalDatabaseCommand + * deserializeAws_json1_1ResetDistributionCacheCommand */ -export const de_StopRelationalDatabaseCommand = async ( +export const de_ResetDistributionCacheCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopRelationalDatabaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StopRelationalDatabaseResult(data, context); - const response: StopRelationalDatabaseCommandOutput = { + contents = de_ResetDistributionCacheResult(data, context); + const response: ResetDistributionCacheCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12014,63 +5654,39 @@ export const de_StopRelationalDatabaseCommand = async ( }; /** - * deserializeAws_json1_1StopRelationalDatabaseCommandError + * deserializeAws_json1_1SendContactMethodVerificationCommand */ -const de_StopRelationalDatabaseCommandError = async ( +export const de_SendContactMethodVerificationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SendContactMethodVerificationResult(data, context); + const response: SendContactMethodVerificationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1SetIpAddressTypeCommand */ -export const de_TagResourceCommand = async ( +export const de_SetIpAddressTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_TagResourceResult(data, context); - const response: TagResourceCommandOutput = { + contents = de_SetIpAddressTypeResult(data, context); + const response: SetIpAddressTypeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12078,63 +5694,39 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1SetResourceAccessForBucketCommand */ -const de_TagResourceCommandError = async ( +export const de_SetResourceAccessForBucketCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SetResourceAccessForBucketResult(data, context); + const response: SetResourceAccessForBucketCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TestAlarmCommand + * deserializeAws_json1_1SetupInstanceHttpsCommand */ -export const de_TestAlarmCommand = async ( +export const de_SetupInstanceHttpsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TestAlarmCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_TestAlarmResult(data, context); - const response: TestAlarmCommandOutput = { + contents = de_SetupInstanceHttpsResult(data, context); + const response: SetupInstanceHttpsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12142,60 +5734,59 @@ export const de_TestAlarmCommand = async ( }; /** - * deserializeAws_json1_1TestAlarmCommandError + * deserializeAws_json1_1StartGUISessionCommand */ -const de_TestAlarmCommandError = async ( +export const de_StartGUISessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StartGUISessionResult(data, context); + const response: StartGUISessionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1StartInstanceCommand + */ +export const de_StartInstanceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StartInstanceResult(data, context); + const response: StartInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UnpeerVpcCommand + * deserializeAws_json1_1StartRelationalDatabaseCommand */ -export const de_UnpeerVpcCommand = async ( +export const de_StartRelationalDatabaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UnpeerVpcCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UnpeerVpcResult(data, context); - const response: UnpeerVpcCommandOutput = { + contents = de_StartRelationalDatabaseResult(data, context); + const response: StartRelationalDatabaseCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12203,63 +5794,39 @@ export const de_UnpeerVpcCommand = async ( }; /** - * deserializeAws_json1_1UnpeerVpcCommandError + * deserializeAws_json1_1StopGUISessionCommand */ -const de_UnpeerVpcCommandError = async ( +export const de_StopGUISessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StopGUISessionResult(data, context); + const response: StopGUISessionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UntagResourceCommand + * deserializeAws_json1_1StopInstanceCommand */ -export const de_UntagResourceCommand = async ( +export const de_StopInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UntagResourceResult(data, context); - const response: UntagResourceCommandOutput = { + contents = de_StopInstanceResult(data, context); + const response: StopInstanceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12267,63 +5834,39 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserializeAws_json1_1StopRelationalDatabaseCommand */ -const de_UntagResourceCommandError = async ( +export const de_StopRelationalDatabaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StopRelationalDatabaseResult(data, context); + const response: StopRelationalDatabaseCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateBucketCommand + * deserializeAws_json1_1TagResourceCommand */ -export const de_UpdateBucketCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateBucketCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateBucketResult(data, context); - const response: UpdateBucketCommandOutput = { + contents = de_TagResourceResult(data, context); + const response: TagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12331,57 +5874,39 @@ export const de_UpdateBucketCommand = async ( }; /** - * deserializeAws_json1_1UpdateBucketCommandError + * deserializeAws_json1_1TestAlarmCommand */ -const de_UpdateBucketCommandError = async ( +export const de_TestAlarmCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_TestAlarmResult(data, context); + const response: TestAlarmCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateBucketBundleCommand + * deserializeAws_json1_1UnpeerVpcCommand */ -export const de_UpdateBucketBundleCommand = async ( +export const de_UnpeerVpcCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateBucketBundleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateBucketBundleResult(data, context); - const response: UpdateBucketBundleCommandOutput = { + contents = de_UnpeerVpcResult(data, context); + const response: UnpeerVpcCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12389,57 +5914,39 @@ export const de_UpdateBucketBundleCommand = async ( }; /** - * deserializeAws_json1_1UpdateBucketBundleCommandError + * deserializeAws_json1_1UntagResourceCommand */ -const de_UpdateBucketBundleCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UntagResourceResult(data, context); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateContainerServiceCommand + * deserializeAws_json1_1UpdateBucketCommand */ -export const de_UpdateContainerServiceCommand = async ( +export const de_UpdateBucketCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateContainerServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateContainerServiceResult(data, context); - const response: UpdateContainerServiceCommandOutput = { + contents = de_UpdateBucketResult(data, context); + const response: UpdateBucketCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12447,57 +5954,39 @@ export const de_UpdateContainerServiceCommand = async ( }; /** - * deserializeAws_json1_1UpdateContainerServiceCommandError + * deserializeAws_json1_1UpdateBucketBundleCommand */ -const de_UpdateContainerServiceCommandError = async ( +export const de_UpdateBucketBundleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateBucketBundleResult(data, context); + const response: UpdateBucketBundleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateDistributionCommand + * deserializeAws_json1_1UpdateContainerServiceCommand */ -export const de_UpdateDistributionCommand = async ( +export const de_UpdateContainerServiceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateDistributionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateDistributionResult(data, context); - const response: UpdateDistributionCommandOutput = { + contents = de_UpdateContainerServiceResult(data, context); + const response: UpdateContainerServiceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -12505,44 +5994,23 @@ export const de_UpdateDistributionCommand = async ( }; /** - * deserializeAws_json1_1UpdateDistributionCommandError + * deserializeAws_json1_1UpdateDistributionCommand */ -const de_UpdateDistributionCommandError = async ( +export const de_UpdateDistributionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateDistributionResult(data, context); + const response: UpdateDistributionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -12553,7 +6021,7 @@ export const de_UpdateDistributionBundleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDistributionBundleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12565,47 +6033,6 @@ export const de_UpdateDistributionBundleCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDistributionBundleCommandError - */ -const de_UpdateDistributionBundleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDomainEntryCommand */ @@ -12614,7 +6041,7 @@ export const de_UpdateDomainEntryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDomainEntryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12626,50 +6053,6 @@ export const de_UpdateDomainEntryCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDomainEntryCommandError - */ -const de_UpdateDomainEntryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateInstanceMetadataOptionsCommand */ @@ -12678,7 +6061,7 @@ export const de_UpdateInstanceMetadataOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateInstanceMetadataOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12690,50 +6073,6 @@ export const de_UpdateInstanceMetadataOptionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateInstanceMetadataOptionsCommandError - */ -const de_UpdateInstanceMetadataOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateLoadBalancerAttributeCommand */ @@ -12742,7 +6081,7 @@ export const de_UpdateLoadBalancerAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLoadBalancerAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12754,50 +6093,6 @@ export const de_UpdateLoadBalancerAttributeCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateLoadBalancerAttributeCommandError - */ -const de_UpdateLoadBalancerAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateRelationalDatabaseCommand */ @@ -12806,7 +6101,7 @@ export const de_UpdateRelationalDatabaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRelationalDatabaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12818,50 +6113,6 @@ export const de_UpdateRelationalDatabaseCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateRelationalDatabaseCommandError - */ -const de_UpdateRelationalDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lightsail#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountSetupInProgressException": - case "com.amazonaws.lightsail#AccountSetupInProgressException": - throw await de_AccountSetupInProgressExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.lightsail#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.lightsail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "OperationFailureException": - case "com.amazonaws.lightsail#OperationFailureException": - throw await de_OperationFailureExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.lightsail#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "UnauthenticatedException": - case "com.amazonaws.lightsail#UnauthenticatedException": - throw await de_UnauthenticatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateRelationalDatabaseParametersCommand */ @@ -12870,7 +6121,7 @@ export const de_UpdateRelationalDatabaseParametersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRelationalDatabaseParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12883,12 +6134,9 @@ export const de_UpdateRelationalDatabaseParametersCommand = async ( }; /** - * deserializeAws_json1_1UpdateRelationalDatabaseParametersCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateRelationalDatabaseParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -12922,7 +6170,7 @@ const de_UpdateRelationalDatabaseParametersCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-location/src/protocols/Aws_restJson1.ts b/clients/client-location/src/protocols/Aws_restJson1.ts index 7da5b49f08d9..3e6c01cda69f 100644 --- a/clients/client-location/src/protocols/Aws_restJson1.ts +++ b/clients/client-location/src/protocols/Aws_restJson1.ts @@ -2002,7 +2002,7 @@ export const de_AssociateTrackerConsumerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateTrackerConsumerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2011,50 +2011,6 @@ export const de_AssociateTrackerConsumerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateTrackerConsumerCommandError - */ -const de_AssociateTrackerConsumerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.location#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.location#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDeleteDevicePositionHistoryCommand */ @@ -2063,7 +2019,7 @@ export const de_BatchDeleteDevicePositionHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDeleteDevicePositionHistoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2076,44 +2032,6 @@ export const de_BatchDeleteDevicePositionHistoryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDeleteDevicePositionHistoryCommandError - */ -const de_BatchDeleteDevicePositionHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDeleteGeofenceCommand */ @@ -2122,7 +2040,7 @@ export const de_BatchDeleteGeofenceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDeleteGeofenceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2135,44 +2053,6 @@ export const de_BatchDeleteGeofenceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDeleteGeofenceCommandError - */ -const de_BatchDeleteGeofenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchEvaluateGeofencesCommand */ @@ -2181,7 +2061,7 @@ export const de_BatchEvaluateGeofencesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchEvaluateGeofencesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2194,44 +2074,6 @@ export const de_BatchEvaluateGeofencesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchEvaluateGeofencesCommandError - */ -const de_BatchEvaluateGeofencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetDevicePositionCommand */ @@ -2240,7 +2082,7 @@ export const de_BatchGetDevicePositionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetDevicePositionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2254,44 +2096,6 @@ export const de_BatchGetDevicePositionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetDevicePositionCommandError - */ -const de_BatchGetDevicePositionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchPutGeofenceCommand */ @@ -2300,7 +2104,7 @@ export const de_BatchPutGeofenceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchPutGeofenceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2314,44 +2118,6 @@ export const de_BatchPutGeofenceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchPutGeofenceCommandError - */ -const de_BatchPutGeofenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUpdateDevicePositionCommand */ @@ -2360,7 +2126,7 @@ export const de_BatchUpdateDevicePositionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpdateDevicePositionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2373,44 +2139,6 @@ export const de_BatchUpdateDevicePositionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchUpdateDevicePositionCommandError - */ -const de_BatchUpdateDevicePositionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CalculateRouteCommand */ @@ -2419,7 +2147,7 @@ export const de_CalculateRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CalculateRouteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2434,52 +2162,14 @@ export const de_CalculateRouteCommand = async ( }; /** - * deserializeAws_restJson1CalculateRouteCommandError + * deserializeAws_restJson1CalculateRouteMatrixCommand */ -const de_CalculateRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CalculateRouteMatrixCommand - */ -export const de_CalculateRouteMatrixCommand = async ( +export const de_CalculateRouteMatrixCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CalculateRouteMatrixCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2495,44 +2185,6 @@ export const de_CalculateRouteMatrixCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CalculateRouteMatrixCommandError - */ -const de_CalculateRouteMatrixCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateGeofenceCollectionCommand */ @@ -2541,7 +2193,7 @@ export const de_CreateGeofenceCollectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateGeofenceCollectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2556,47 +2208,6 @@ export const de_CreateGeofenceCollectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGeofenceCollectionCommandError - */ -const de_CreateGeofenceCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.location#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.location#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateKeyCommand */ @@ -2605,7 +2216,7 @@ export const de_CreateKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2621,47 +2232,6 @@ export const de_CreateKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateKeyCommandError - */ -const de_CreateKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.location#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.location#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMapCommand */ @@ -2670,7 +2240,7 @@ export const de_CreateMapCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMapCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2685,47 +2255,6 @@ export const de_CreateMapCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMapCommandError - */ -const de_CreateMapCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.location#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.location#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePlaceIndexCommand */ @@ -2734,7 +2263,7 @@ export const de_CreatePlaceIndexCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePlaceIndexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2750,183 +2279,60 @@ export const de_CreatePlaceIndexCommand = async ( }; /** - * deserializeAws_restJson1CreatePlaceIndexCommandError + * deserializeAws_restJson1CreateRouteCalculatorCommand */ -const de_CreatePlaceIndexCommandError = async ( +export const de_CreateRouteCalculatorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.location#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.location#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CalculatorArn: __expectString, + CalculatorName: __expectString, + CreateTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateRouteCalculatorCommand + * deserializeAws_restJson1CreateTrackerCommand */ -export const de_CreateRouteCalculatorCommand = async ( +export const de_CreateTrackerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRouteCalculatorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CalculatorArn: __expectString, - CalculatorName: __expectString, CreateTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + TrackerArn: __expectString, + TrackerName: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateRouteCalculatorCommandError + * deserializeAws_restJson1DeleteGeofenceCollectionCommand */ -const de_CreateRouteCalculatorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.location#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.location#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateTrackerCommand - */ -export const de_CreateTrackerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTrackerCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CreateTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - TrackerArn: __expectString, - TrackerName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateTrackerCommandError - */ -const de_CreateTrackerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.location#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.location#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteGeofenceCollectionCommand - */ -export const de_DeleteGeofenceCollectionCommand = async ( +export const de_DeleteGeofenceCollectionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGeofenceCollectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2935,44 +2341,6 @@ export const de_DeleteGeofenceCollectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteGeofenceCollectionCommandError - */ -const de_DeleteGeofenceCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteKeyCommand */ @@ -2981,7 +2349,7 @@ export const de_DeleteKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2990,44 +2358,6 @@ export const de_DeleteKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteKeyCommandError - */ -const de_DeleteKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteMapCommand */ @@ -3036,7 +2366,7 @@ export const de_DeleteMapCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMapCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3045,44 +2375,6 @@ export const de_DeleteMapCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteMapCommandError - */ -const de_DeleteMapCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePlaceIndexCommand */ @@ -3091,7 +2383,7 @@ export const de_DeletePlaceIndexCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePlaceIndexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3100,44 +2392,6 @@ export const de_DeletePlaceIndexCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePlaceIndexCommandError - */ -const de_DeletePlaceIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRouteCalculatorCommand */ @@ -3146,7 +2400,7 @@ export const de_DeleteRouteCalculatorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRouteCalculatorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3155,44 +2409,6 @@ export const de_DeleteRouteCalculatorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRouteCalculatorCommandError - */ -const de_DeleteRouteCalculatorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteTrackerCommand */ @@ -3201,7 +2417,7 @@ export const de_DeleteTrackerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTrackerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3210,44 +2426,6 @@ export const de_DeleteTrackerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteTrackerCommandError - */ -const de_DeleteTrackerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeGeofenceCollectionCommand */ @@ -3256,7 +2434,7 @@ export const de_DescribeGeofenceCollectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeGeofenceCollectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3268,52 +2446,14 @@ export const de_DescribeGeofenceCollectionCommand = async ( CreateTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), Description: __expectString, GeofenceCount: __expectInt32, - KmsKeyId: __expectString, - PricingPlan: __expectString, - PricingPlanDataSource: __expectString, - Tags: _json, - UpdateTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeGeofenceCollectionCommandError - */ -const de_DescribeGeofenceCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + KmsKeyId: __expectString, + PricingPlan: __expectString, + PricingPlanDataSource: __expectString, + Tags: _json, + UpdateTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3324,7 +2464,7 @@ export const de_DescribeKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3345,44 +2485,6 @@ export const de_DescribeKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeKeyCommandError - */ -const de_DescribeKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeMapCommand */ @@ -3391,7 +2493,7 @@ export const de_DescribeMapCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeMapCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3412,44 +2514,6 @@ export const de_DescribeMapCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeMapCommandError - */ -const de_DescribeMapCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribePlaceIndexCommand */ @@ -3458,7 +2522,7 @@ export const de_DescribePlaceIndexCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePlaceIndexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3479,44 +2543,6 @@ export const de_DescribePlaceIndexCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribePlaceIndexCommandError - */ -const de_DescribePlaceIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeRouteCalculatorCommand */ @@ -3525,7 +2551,7 @@ export const de_DescribeRouteCalculatorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRouteCalculatorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3545,44 +2571,6 @@ export const de_DescribeRouteCalculatorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeRouteCalculatorCommandError - */ -const de_DescribeRouteCalculatorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeTrackerCommand */ @@ -3591,7 +2579,7 @@ export const de_DescribeTrackerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTrackerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3615,44 +2603,6 @@ export const de_DescribeTrackerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeTrackerCommandError - */ -const de_DescribeTrackerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateTrackerConsumerCommand */ @@ -3661,7 +2611,7 @@ export const de_DisassociateTrackerConsumerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateTrackerConsumerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3670,44 +2620,6 @@ export const de_DisassociateTrackerConsumerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateTrackerConsumerCommandError - */ -const de_DisassociateTrackerConsumerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDevicePositionCommand */ @@ -3716,7 +2628,7 @@ export const de_GetDevicePositionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDevicePositionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3729,47 +2641,9 @@ export const de_GetDevicePositionCommand = async ( PositionProperties: _json, ReceivedTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), SampleTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDevicePositionCommandError - */ -const de_GetDevicePositionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3780,7 +2654,7 @@ export const de_GetDevicePositionHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDevicePositionHistoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3794,44 +2668,6 @@ export const de_GetDevicePositionHistoryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDevicePositionHistoryCommandError - */ -const de_GetDevicePositionHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGeofenceCommand */ @@ -3840,7 +2676,7 @@ export const de_GetGeofenceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGeofenceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3858,44 +2694,6 @@ export const de_GetGeofenceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetGeofenceCommandError - */ -const de_GetGeofenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMapGlyphsCommand */ @@ -3904,7 +2702,7 @@ export const de_GetMapGlyphsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMapGlyphsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3916,44 +2714,6 @@ export const de_GetMapGlyphsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMapGlyphsCommandError - */ -const de_GetMapGlyphsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMapSpritesCommand */ @@ -3962,7 +2722,7 @@ export const de_GetMapSpritesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMapSpritesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3974,44 +2734,6 @@ export const de_GetMapSpritesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMapSpritesCommandError - */ -const de_GetMapSpritesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMapStyleDescriptorCommand */ @@ -4020,7 +2742,7 @@ export const de_GetMapStyleDescriptorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMapStyleDescriptorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4032,44 +2754,6 @@ export const de_GetMapStyleDescriptorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMapStyleDescriptorCommandError - */ -const de_GetMapStyleDescriptorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMapTileCommand */ @@ -4078,7 +2762,7 @@ export const de_GetMapTileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMapTileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4090,44 +2774,6 @@ export const de_GetMapTileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMapTileCommandError - */ -const de_GetMapTileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPlaceCommand */ @@ -4136,55 +2782,17 @@ export const de_GetPlaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPlaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Place: (_) => de_Place(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPlaceCommandError - */ -const de_GetPlaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Place: (_) => de_Place(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4195,7 +2803,7 @@ export const de_ListDevicePositionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDevicePositionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4209,41 +2817,6 @@ export const de_ListDevicePositionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDevicePositionsCommandError - */ -const de_ListDevicePositionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListGeofenceCollectionsCommand */ @@ -4252,7 +2825,7 @@ export const de_ListGeofenceCollectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGeofenceCollectionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4266,41 +2839,6 @@ export const de_ListGeofenceCollectionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListGeofenceCollectionsCommandError - */ -const de_ListGeofenceCollectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListGeofencesCommand */ @@ -4309,7 +2847,7 @@ export const de_ListGeofencesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGeofencesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4323,44 +2861,6 @@ export const de_ListGeofencesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListGeofencesCommandError - */ -const de_ListGeofencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListKeysCommand */ @@ -4369,7 +2869,7 @@ export const de_ListKeysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKeysCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4383,41 +2883,6 @@ export const de_ListKeysCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListKeysCommandError - */ -const de_ListKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListMapsCommand */ @@ -4426,7 +2891,7 @@ export const de_ListMapsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMapsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4440,41 +2905,6 @@ export const de_ListMapsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListMapsCommandError - */ -const de_ListMapsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPlaceIndexesCommand */ @@ -4483,7 +2913,7 @@ export const de_ListPlaceIndexesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPlaceIndexesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4497,155 +2927,47 @@ export const de_ListPlaceIndexesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListPlaceIndexesCommandError - */ -const de_ListPlaceIndexesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRouteCalculatorsCommand */ export const de_ListRouteCalculatorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRouteCalculatorsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Entries: (_) => de_ListRouteCalculatorsResponseEntryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListRouteCalculatorsCommandError - */ -const de_ListRouteCalculatorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: _json, + Entries: (_) => de_ListRouteCalculatorsResponseEntryList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4656,7 +2978,7 @@ export const de_ListTrackerConsumersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTrackerConsumersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4670,44 +2992,6 @@ export const de_ListTrackerConsumersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTrackerConsumersCommandError - */ -const de_ListTrackerConsumersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTrackersCommand */ @@ -4716,7 +3000,7 @@ export const de_ListTrackersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTrackersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4730,41 +3014,6 @@ export const de_ListTrackersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTrackersCommandError - */ -const de_ListTrackersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutGeofenceCommand */ @@ -4773,7 +3022,7 @@ export const de_PutGeofenceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutGeofenceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4788,47 +3037,6 @@ export const de_PutGeofenceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutGeofenceCommandError - */ -const de_PutGeofenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.location#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchPlaceIndexForPositionCommand */ @@ -4837,7 +3045,7 @@ export const de_SearchPlaceIndexForPositionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchPlaceIndexForPositionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4851,44 +3059,6 @@ export const de_SearchPlaceIndexForPositionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchPlaceIndexForPositionCommandError - */ -const de_SearchPlaceIndexForPositionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchPlaceIndexForSuggestionsCommand */ @@ -4897,7 +3067,7 @@ export const de_SearchPlaceIndexForSuggestionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchPlaceIndexForSuggestionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4911,44 +3081,6 @@ export const de_SearchPlaceIndexForSuggestionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchPlaceIndexForSuggestionsCommandError - */ -const de_SearchPlaceIndexForSuggestionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchPlaceIndexForTextCommand */ @@ -4957,7 +3089,7 @@ export const de_SearchPlaceIndexForTextCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchPlaceIndexForTextCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4967,46 +3099,8 @@ export const de_SearchPlaceIndexForTextCommand = async ( Results: (_) => de_SearchForTextResultList(_, context), Summary: (_) => de_SearchPlaceIndexForTextSummary(_, context), }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SearchPlaceIndexForTextCommandError - */ -const de_SearchPlaceIndexForTextCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Object.assign(contents, doc); + return contents; }; /** @@ -5017,7 +3111,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5026,44 +3120,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -5072,7 +3128,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5081,44 +3137,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateGeofenceCollectionCommand */ @@ -5127,7 +3145,7 @@ export const de_UpdateGeofenceCollectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGeofenceCollectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5142,44 +3160,6 @@ export const de_UpdateGeofenceCollectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateGeofenceCollectionCommandError - */ -const de_UpdateGeofenceCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateKeyCommand */ @@ -5188,7 +3168,7 @@ export const de_UpdateKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5203,44 +3183,6 @@ export const de_UpdateKeyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateKeyCommandError - */ -const de_UpdateKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMapCommand */ @@ -5249,7 +3191,7 @@ export const de_UpdateMapCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMapCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5264,44 +3206,6 @@ export const de_UpdateMapCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateMapCommandError - */ -const de_UpdateMapCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePlaceIndexCommand */ @@ -5310,7 +3214,7 @@ export const de_UpdatePlaceIndexCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePlaceIndexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5325,44 +3229,6 @@ export const de_UpdatePlaceIndexCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePlaceIndexCommandError - */ -const de_UpdatePlaceIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRouteCalculatorCommand */ @@ -5371,7 +3237,7 @@ export const de_UpdateRouteCalculatorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRouteCalculatorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5386,44 +3252,6 @@ export const de_UpdateRouteCalculatorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRouteCalculatorCommandError - */ -const de_UpdateRouteCalculatorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.location#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.location#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.location#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.location#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.location#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTrackerCommand */ @@ -5432,7 +3260,7 @@ export const de_UpdateTrackerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTrackerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5448,12 +3276,9 @@ export const de_UpdateTrackerCommand = async ( }; /** - * deserializeAws_restJson1UpdateTrackerCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateTrackerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5463,12 +3288,18 @@ const de_UpdateTrackerCommandError = async ( case "AccessDeniedException": case "com.amazonaws.location#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.location#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.location#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.location#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.location#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.location#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -5481,7 +3312,7 @@ const de_UpdateTrackerCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts b/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts index 3f73b3af4deb..cf2d666577eb 100644 --- a/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts +++ b/clients/client-lookoutequipment/src/protocols/Aws_json1_0.ts @@ -893,7 +893,7 @@ export const de_CreateDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDatasetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -905,47 +905,6 @@ export const de_CreateDatasetCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateDatasetCommandError - */ -const de_CreateDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutequipment#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateInferenceSchedulerCommand */ @@ -954,7 +913,7 @@ export const de_CreateInferenceSchedulerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateInferenceSchedulerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -966,50 +925,6 @@ export const de_CreateInferenceSchedulerCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateInferenceSchedulerCommandError - */ -const de_CreateInferenceSchedulerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutequipment#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateLabelCommand */ @@ -1018,7 +933,7 @@ export const de_CreateLabelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLabelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1030,50 +945,6 @@ export const de_CreateLabelCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateLabelCommandError - */ -const de_CreateLabelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutequipment#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateLabelGroupCommand */ @@ -1082,7 +953,7 @@ export const de_CreateLabelGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLabelGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1094,47 +965,6 @@ export const de_CreateLabelGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateLabelGroupCommandError - */ -const de_CreateLabelGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutequipment#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateModelCommand */ @@ -1143,7 +973,7 @@ export const de_CreateModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateModelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1155,50 +985,6 @@ export const de_CreateModelCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateModelCommandError - */ -const de_CreateModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutequipment#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateRetrainingSchedulerCommand */ @@ -1207,7 +993,7 @@ export const de_CreateRetrainingSchedulerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRetrainingSchedulerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1220,171 +1006,48 @@ export const de_CreateRetrainingSchedulerCommand = async ( }; /** - * deserializeAws_json1_0CreateRetrainingSchedulerCommandError + * deserializeAws_json1_0DeleteDatasetCommand */ -const de_CreateRetrainingSchedulerCommandError = async ( +export const de_DeleteDatasetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteDatasetCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_0DeleteDatasetCommand + * deserializeAws_json1_0DeleteInferenceSchedulerCommand */ -export const de_DeleteDatasetCommand = async ( +export const de_DeleteInferenceSchedulerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDatasetCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteDatasetCommandOutput = { + const response: DeleteInferenceSchedulerCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_0DeleteDatasetCommandError + * deserializeAws_json1_0DeleteLabelCommand */ -const de_DeleteDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteInferenceSchedulerCommand - */ -export const de_DeleteInferenceSchedulerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteInferenceSchedulerCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteInferenceSchedulerCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteInferenceSchedulerCommandError - */ -const de_DeleteInferenceSchedulerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteLabelCommand - */ -export const de_DeleteLabelCommand = async ( +export const de_DeleteLabelCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLabelCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteLabelCommandOutput = { @@ -1393,1169 +1056,88 @@ export const de_DeleteLabelCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteLabelCommandError - */ -const de_DeleteLabelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteLabelGroupCommand */ export const de_DeleteLabelGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteLabelGroupCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteLabelGroupCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteLabelGroupCommandError - */ -const de_DeleteLabelGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteModelCommand - */ -export const de_DeleteModelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteModelCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteModelCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteModelCommandError - */ -const de_DeleteModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteResourcePolicyCommand - */ -export const de_DeleteResourcePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteResourcePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteRetrainingSchedulerCommand - */ -export const de_DeleteRetrainingSchedulerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteRetrainingSchedulerCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteRetrainingSchedulerCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteRetrainingSchedulerCommandError - */ -const de_DeleteRetrainingSchedulerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeDataIngestionJobCommand - */ -export const de_DescribeDataIngestionJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDataIngestionJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeDataIngestionJobResponse(data, context); - const response: DescribeDataIngestionJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeDataIngestionJobCommandError - */ -const de_DescribeDataIngestionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeDatasetCommand - */ -export const de_DescribeDatasetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDatasetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeDatasetResponse(data, context); - const response: DescribeDatasetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeDatasetCommandError - */ -const de_DescribeDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeInferenceSchedulerCommand - */ -export const de_DescribeInferenceSchedulerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeInferenceSchedulerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeInferenceSchedulerResponse(data, context); - const response: DescribeInferenceSchedulerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeInferenceSchedulerCommandError - */ -const de_DescribeInferenceSchedulerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeLabelCommand - */ -export const de_DescribeLabelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeLabelCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeLabelResponse(data, context); - const response: DescribeLabelCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeLabelCommandError - */ -const de_DescribeLabelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeLabelGroupCommand - */ -export const de_DescribeLabelGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeLabelGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeLabelGroupResponse(data, context); - const response: DescribeLabelGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeLabelGroupCommandError - */ -const de_DescribeLabelGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeModelCommand - */ -export const de_DescribeModelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeModelCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeModelResponse(data, context); - const response: DescribeModelCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeModelCommandError - */ -const de_DescribeModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeModelVersionCommand - */ -export const de_DescribeModelVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeModelVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeModelVersionResponse(data, context); - const response: DescribeModelVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeModelVersionCommandError - */ -const de_DescribeModelVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeResourcePolicyCommand - */ -export const de_DescribeResourcePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeResourcePolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeResourcePolicyResponse(data, context); - const response: DescribeResourcePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeResourcePolicyCommandError - */ -const de_DescribeResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeRetrainingSchedulerCommand - */ -export const de_DescribeRetrainingSchedulerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeRetrainingSchedulerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeRetrainingSchedulerResponse(data, context); - const response: DescribeRetrainingSchedulerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeRetrainingSchedulerCommandError - */ -const de_DescribeRetrainingSchedulerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ImportDatasetCommand - */ -export const de_ImportDatasetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ImportDatasetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ImportDatasetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ImportDatasetCommandError - */ -const de_ImportDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutequipment#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ImportModelVersionCommand - */ -export const de_ImportModelVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ImportModelVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ImportModelVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ImportModelVersionCommandError - */ -const de_ImportModelVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutequipment#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListDataIngestionJobsCommand - */ -export const de_ListDataIngestionJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDataIngestionJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListDataIngestionJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListDataIngestionJobsCommandError - */ -const de_ListDataIngestionJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListDatasetsCommand - */ -export const de_ListDatasetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDatasetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDatasetsResponse(data, context); - const response: ListDatasetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListDatasetsCommandError - */ -const de_ListDatasetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListInferenceEventsCommand - */ -export const de_ListInferenceEventsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListInferenceEventsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListInferenceEventsResponse(data, context); - const response: ListInferenceEventsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListInferenceEventsCommandError - */ -const de_ListInferenceEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteLabelGroupCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_0ListInferenceExecutionsCommand + * deserializeAws_json1_0DeleteModelCommand */ -export const de_ListInferenceExecutionsCommand = async ( +export const de_DeleteModelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListInferenceExecutionsCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListInferenceExecutionsResponse(data, context); - const response: ListInferenceExecutionsCommandOutput = { + await collectBody(output.body, context); + const response: DeleteModelCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_0ListInferenceExecutionsCommandError + * deserializeAws_json1_0DeleteResourcePolicyCommand */ -const de_ListInferenceExecutionsCommandError = async ( +export const de_DeleteResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeleteResourcePolicyCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_0DeleteRetrainingSchedulerCommand + */ +export const de_DeleteRetrainingSchedulerCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteRetrainingSchedulerCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_0ListInferenceSchedulersCommand + * deserializeAws_json1_0DescribeDataIngestionJobCommand */ -export const de_ListInferenceSchedulersCommand = async ( +export const de_DescribeDataIngestionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListInferenceSchedulersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListInferenceSchedulersCommandOutput = { + contents = de_DescribeDataIngestionJobResponse(data, context); + const response: DescribeDataIngestionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2563,54 +1145,39 @@ export const de_ListInferenceSchedulersCommand = async ( }; /** - * deserializeAws_json1_0ListInferenceSchedulersCommandError + * deserializeAws_json1_0DescribeDatasetCommand */ -const de_ListInferenceSchedulersCommandError = async ( +export const de_DescribeDatasetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDatasetResponse(data, context); + const response: DescribeDatasetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListLabelGroupsCommand + * deserializeAws_json1_0DescribeInferenceSchedulerCommand */ -export const de_ListLabelGroupsCommand = async ( +export const de_DescribeInferenceSchedulerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListLabelGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListLabelGroupsResponse(data, context); - const response: ListLabelGroupsCommandOutput = { + contents = de_DescribeInferenceSchedulerResponse(data, context); + const response: DescribeInferenceSchedulerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2618,54 +1185,39 @@ export const de_ListLabelGroupsCommand = async ( }; /** - * deserializeAws_json1_0ListLabelGroupsCommandError + * deserializeAws_json1_0DescribeLabelCommand */ -const de_ListLabelGroupsCommandError = async ( +export const de_DescribeLabelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeLabelResponse(data, context); + const response: DescribeLabelCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListLabelsCommand + * deserializeAws_json1_0DescribeLabelGroupCommand */ -export const de_ListLabelsCommand = async ( +export const de_DescribeLabelGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListLabelsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListLabelsResponse(data, context); - const response: ListLabelsCommandOutput = { + contents = de_DescribeLabelGroupResponse(data, context); + const response: DescribeLabelGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2673,54 +1225,39 @@ export const de_ListLabelsCommand = async ( }; /** - * deserializeAws_json1_0ListLabelsCommandError + * deserializeAws_json1_0DescribeModelCommand */ -const de_ListLabelsCommandError = async ( +export const de_DescribeModelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeModelResponse(data, context); + const response: DescribeModelCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListModelsCommand + * deserializeAws_json1_0DescribeModelVersionCommand */ -export const de_ListModelsCommand = async ( +export const de_DescribeModelVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListModelsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListModelsResponse(data, context); - const response: ListModelsCommandOutput = { + contents = de_DescribeModelVersionResponse(data, context); + const response: DescribeModelVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2728,54 +1265,39 @@ export const de_ListModelsCommand = async ( }; /** - * deserializeAws_json1_0ListModelsCommandError + * deserializeAws_json1_0DescribeResourcePolicyCommand */ -const de_ListModelsCommandError = async ( +export const de_DescribeResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeResourcePolicyResponse(data, context); + const response: DescribeResourcePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListModelVersionsCommand + * deserializeAws_json1_0DescribeRetrainingSchedulerCommand */ -export const de_ListModelVersionsCommand = async ( +export const de_DescribeRetrainingSchedulerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListModelVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListModelVersionsResponse(data, context); - const response: ListModelVersionsCommandOutput = { + contents = de_DescribeRetrainingSchedulerResponse(data, context); + const response: DescribeRetrainingSchedulerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2783,57 +1305,39 @@ export const de_ListModelVersionsCommand = async ( }; /** - * deserializeAws_json1_0ListModelVersionsCommandError + * deserializeAws_json1_0ImportDatasetCommand */ -const de_ListModelVersionsCommandError = async ( +export const de_ImportDatasetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ImportDatasetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListRetrainingSchedulersCommand + * deserializeAws_json1_0ImportModelVersionCommand */ -export const de_ListRetrainingSchedulersCommand = async ( +export const de_ImportModelVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListRetrainingSchedulersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListRetrainingSchedulersResponse(data, context); - const response: ListRetrainingSchedulersCommandOutput = { + contents = _json(data); + const response: ImportModelVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2841,54 +1345,39 @@ export const de_ListRetrainingSchedulersCommand = async ( }; /** - * deserializeAws_json1_0ListRetrainingSchedulersCommandError + * deserializeAws_json1_0ListDataIngestionJobsCommand */ -const de_ListRetrainingSchedulersCommandError = async ( +export const de_ListDataIngestionJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListDataIngestionJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListSensorStatisticsCommand + * deserializeAws_json1_0ListDatasetsCommand */ -export const de_ListSensorStatisticsCommand = async ( +export const de_ListDatasetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSensorStatisticsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListSensorStatisticsResponse(data, context); - const response: ListSensorStatisticsCommandOutput = { + contents = de_ListDatasetsResponse(data, context); + const response: ListDatasetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2896,57 +1385,39 @@ export const de_ListSensorStatisticsCommand = async ( }; /** - * deserializeAws_json1_0ListSensorStatisticsCommandError + * deserializeAws_json1_0ListInferenceEventsCommand */ -const de_ListSensorStatisticsCommandError = async ( +export const de_ListInferenceEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListInferenceEventsResponse(data, context); + const response: ListInferenceEventsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListTagsForResourceCommand + * deserializeAws_json1_0ListInferenceExecutionsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListInferenceExecutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_ListInferenceExecutionsResponse(data, context); + const response: ListInferenceExecutionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2954,57 +1425,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_0ListTagsForResourceCommandError + * deserializeAws_json1_0ListInferenceSchedulersCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListInferenceSchedulersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListInferenceSchedulersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0PutResourcePolicyCommand + * deserializeAws_json1_0ListLabelGroupsCommand */ -export const de_PutResourcePolicyCommand = async ( +export const de_ListLabelGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: PutResourcePolicyCommandOutput = { + contents = de_ListLabelGroupsResponse(data, context); + const response: ListLabelGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3012,63 +1465,39 @@ export const de_PutResourcePolicyCommand = async ( }; /** - * deserializeAws_json1_0PutResourcePolicyCommandError + * deserializeAws_json1_0ListLabelsCommand */ -const de_PutResourcePolicyCommandError = async ( +export const de_ListLabelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutequipment#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListLabelsResponse(data, context); + const response: ListLabelsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0StartDataIngestionJobCommand + * deserializeAws_json1_0ListModelsCommand */ -export const de_StartDataIngestionJobCommand = async ( +export const de_ListModelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartDataIngestionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartDataIngestionJobCommandOutput = { + contents = de_ListModelsResponse(data, context); + const response: ListModelsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3076,63 +1505,39 @@ export const de_StartDataIngestionJobCommand = async ( }; /** - * deserializeAws_json1_0StartDataIngestionJobCommandError + * deserializeAws_json1_0ListModelVersionsCommand */ -const de_StartDataIngestionJobCommandError = async ( +export const de_ListModelVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutequipment#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListModelVersionsResponse(data, context); + const response: ListModelVersionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0StartInferenceSchedulerCommand + * deserializeAws_json1_0ListRetrainingSchedulersCommand */ -export const de_StartInferenceSchedulerCommand = async ( +export const de_ListRetrainingSchedulersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartInferenceSchedulerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartInferenceSchedulerCommandOutput = { + contents = de_ListRetrainingSchedulersResponse(data, context); + const response: ListRetrainingSchedulersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3140,60 +1545,39 @@ export const de_StartInferenceSchedulerCommand = async ( }; /** - * deserializeAws_json1_0StartInferenceSchedulerCommandError + * deserializeAws_json1_0ListSensorStatisticsCommand */ -const de_StartInferenceSchedulerCommandError = async ( +export const de_ListSensorStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListSensorStatisticsResponse(data, context); + const response: ListSensorStatisticsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0StartRetrainingSchedulerCommand + * deserializeAws_json1_0ListTagsForResourceCommand */ -export const de_StartRetrainingSchedulerCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartRetrainingSchedulerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartRetrainingSchedulerCommandOutput = { + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3201,60 +1585,39 @@ export const de_StartRetrainingSchedulerCommand = async ( }; /** - * deserializeAws_json1_0StartRetrainingSchedulerCommandError + * deserializeAws_json1_0PutResourcePolicyCommand */ -const de_StartRetrainingSchedulerCommandError = async ( +export const de_PutResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutResourcePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0StopInferenceSchedulerCommand + * deserializeAws_json1_0StartDataIngestionJobCommand */ -export const de_StopInferenceSchedulerCommand = async ( +export const de_StartDataIngestionJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopInferenceSchedulerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopInferenceSchedulerCommandOutput = { + const response: StartDataIngestionJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3262,60 +1625,39 @@ export const de_StopInferenceSchedulerCommand = async ( }; /** - * deserializeAws_json1_0StopInferenceSchedulerCommandError + * deserializeAws_json1_0StartInferenceSchedulerCommand */ -const de_StopInferenceSchedulerCommandError = async ( +export const de_StartInferenceSchedulerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartInferenceSchedulerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0StopRetrainingSchedulerCommand + * deserializeAws_json1_0StartRetrainingSchedulerCommand */ -export const de_StopRetrainingSchedulerCommand = async ( +export const de_StartRetrainingSchedulerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopRetrainingSchedulerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopRetrainingSchedulerCommandOutput = { + const response: StartRetrainingSchedulerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3323,60 +1665,39 @@ export const de_StopRetrainingSchedulerCommand = async ( }; /** - * deserializeAws_json1_0StopRetrainingSchedulerCommandError + * deserializeAws_json1_0StopInferenceSchedulerCommand */ -const de_StopRetrainingSchedulerCommandError = async ( +export const de_StopInferenceSchedulerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StopInferenceSchedulerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0TagResourceCommand + * deserializeAws_json1_0StopRetrainingSchedulerCommand */ -export const de_TagResourceCommand = async ( +export const de_StopRetrainingSchedulerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: StopRetrainingSchedulerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3384,44 +1705,23 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_0TagResourceCommandError + * deserializeAws_json1_0TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutequipment#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3432,7 +1732,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3444,44 +1744,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateActiveModelVersionCommand */ @@ -3490,7 +1752,7 @@ export const de_UpdateActiveModelVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateActiveModelVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3502,47 +1764,6 @@ export const de_UpdateActiveModelVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateActiveModelVersionCommandError - */ -const de_UpdateActiveModelVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateInferenceSchedulerCommand */ @@ -3551,7 +1772,7 @@ export const de_UpdateInferenceSchedulerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateInferenceSchedulerCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateInferenceSchedulerCommandOutput = { @@ -3560,47 +1781,6 @@ export const de_UpdateInferenceSchedulerCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateInferenceSchedulerCommandError - */ -const de_UpdateInferenceSchedulerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateLabelGroupCommand */ @@ -3609,7 +1789,7 @@ export const de_UpdateLabelGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLabelGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateLabelGroupCommandOutput = { @@ -3618,47 +1798,6 @@ export const de_UpdateLabelGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateLabelGroupCommandError - */ -const de_UpdateLabelGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateModelCommand */ @@ -3667,7 +1806,7 @@ export const de_UpdateModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateModelCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateModelCommandOutput = { @@ -3676,47 +1815,6 @@ export const de_UpdateModelCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateModelCommandError - */ -const de_UpdateModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutequipment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutequipment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutequipment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutequipment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutequipment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateRetrainingSchedulerCommand */ @@ -3725,7 +1823,7 @@ export const de_UpdateRetrainingSchedulerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRetrainingSchedulerCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateRetrainingSchedulerCommandOutput = { @@ -3735,12 +1833,9 @@ export const de_UpdateRetrainingSchedulerCommand = async ( }; /** - * deserializeAws_json1_0UpdateRetrainingSchedulerCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateRetrainingSchedulerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3756,22 +1851,25 @@ const de_UpdateRetrainingSchedulerCommandError = async ( case "InternalServerException": case "com.amazonaws.lookoutequipment#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutequipment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.lookoutequipment#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.lookoutequipment#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.lookoutequipment#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.lookoutequipment#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts b/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts index 58f20d46646a..e5f4dc0832b1 100644 --- a/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts +++ b/clients/client-lookoutmetrics/src/protocols/Aws_restJson1.ts @@ -877,7 +877,7 @@ export const de_ActivateAnomalyDetectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ActivateAnomalyDetectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -886,47 +886,6 @@ export const de_ActivateAnomalyDetectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ActivateAnomalyDetectorCommandError - */ -const de_ActivateAnomalyDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutmetrics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BackTestAnomalyDetectorCommand */ @@ -935,7 +894,7 @@ export const de_BackTestAnomalyDetectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BackTestAnomalyDetectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -944,44 +903,6 @@ export const de_BackTestAnomalyDetectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BackTestAnomalyDetectorCommandError - */ -const de_BackTestAnomalyDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAlertCommand */ @@ -990,7 +911,7 @@ export const de_CreateAlertCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAlertCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1003,50 +924,6 @@ export const de_CreateAlertCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAlertCommandError - */ -const de_CreateAlertCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutmetrics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutmetrics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAnomalyDetectorCommand */ @@ -1055,7 +932,7 @@ export const de_CreateAnomalyDetectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAnomalyDetectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1068,47 +945,6 @@ export const de_CreateAnomalyDetectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAnomalyDetectorCommandError - */ -const de_CreateAnomalyDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutmetrics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutmetrics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMetricSetCommand */ @@ -1117,7 +953,7 @@ export const de_CreateMetricSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMetricSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1131,58 +967,31 @@ export const de_CreateMetricSetCommand = async ( }; /** - * deserializeAws_restJson1CreateMetricSetCommandError + * deserializeAws_restJson1DeactivateAnomalyDetectorCommand */ -const de_CreateMetricSetCommandError = async ( +export const de_DeactivateAnomalyDetectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutmetrics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutmetrics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeactivateAnomalyDetectorCommand + * deserializeAws_restJson1DeleteAlertCommand */ -export const de_DeactivateAnomalyDetectorCommand = async ( +export const de_DeleteAlertCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeactivateAnomalyDetectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1192,227 +1001,52 @@ export const de_DeactivateAnomalyDetectorCommand = async ( }; /** - * deserializeAws_restJson1DeactivateAnomalyDetectorCommandError + * deserializeAws_restJson1DeleteAnomalyDetectorCommand */ -const de_DeactivateAnomalyDetectorCommandError = async ( +export const de_DeleteAnomalyDetectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutmetrics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteAlertCommand + * deserializeAws_restJson1DescribeAlertCommand */ -export const de_DeleteAlertCommand = async ( +export const de_DescribeAlertCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAlertCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Alert: (_) => de_Alert(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteAlertCommandError + * deserializeAws_restJson1DescribeAnomalyDetectionExecutionsCommand */ -const de_DeleteAlertCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAnomalyDetectorCommand - */ -export const de_DeleteAnomalyDetectorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAnomalyDetectorCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteAnomalyDetectorCommandError - */ -const de_DeleteAnomalyDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutmetrics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAlertCommand - */ -export const de_DescribeAlertCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAlertCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Alert: (_) => de_Alert(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAlertCommandError - */ -const de_DescribeAlertCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAnomalyDetectionExecutionsCommand - */ -export const de_DescribeAnomalyDetectionExecutionsCommand = async ( +export const de_DescribeAnomalyDetectionExecutionsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAnomalyDetectionExecutionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1426,44 +1060,6 @@ export const de_DescribeAnomalyDetectionExecutionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAnomalyDetectionExecutionsCommandError - */ -const de_DescribeAnomalyDetectionExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAnomalyDetectorCommand */ @@ -1472,7 +1068,7 @@ export const de_DescribeAnomalyDetectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAnomalyDetectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1494,44 +1090,6 @@ export const de_DescribeAnomalyDetectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAnomalyDetectorCommandError - */ -const de_DescribeAnomalyDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeMetricSetCommand */ @@ -1540,7 +1098,7 @@ export const de_DescribeMetricSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeMetricSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1556,487 +1114,95 @@ export const de_DescribeMetricSetCommand = async ( MetricSetArn: __expectString, MetricSetDescription: __expectString, MetricSetFrequency: __expectString, - MetricSetName: __expectString, - MetricSource: _json, - Offset: __expectInt32, - TimestampColumn: _json, - Timezone: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeMetricSetCommandError - */ -const de_DescribeMetricSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DetectMetricSetConfigCommand - */ -export const de_DetectMetricSetConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DetectMetricSetConfigCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DetectedMetricSetConfig: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DetectMetricSetConfigCommandError - */ -const de_DetectMetricSetConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAnomalyGroupCommand - */ -export const de_GetAnomalyGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAnomalyGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AnomalyGroup: (_) => de_AnomalyGroup(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAnomalyGroupCommandError - */ -const de_GetAnomalyGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDataQualityMetricsCommand - */ -export const de_GetDataQualityMetricsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataQualityMetricsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AnomalyDetectorDataQualityMetricList: (_) => de_AnomalyDetectorDataQualityMetricList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDataQualityMetricsCommandError - */ -const de_GetDataQualityMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFeedbackCommand - */ -export const de_GetFeedbackCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFeedbackCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AnomalyGroupTimeSeriesFeedback: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFeedbackCommandError - */ -const de_GetFeedbackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSampleDataCommand - */ -export const de_GetSampleDataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSampleDataCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - HeaderValues: _json, - SampleRows: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSampleDataCommandError - */ -const de_GetSampleDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + MetricSetName: __expectString, + MetricSource: _json, + Offset: __expectInt32, + TimestampColumn: _json, + Timezone: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListAlertsCommand + * deserializeAws_restJson1DetectMetricSetConfigCommand */ -export const de_ListAlertsCommand = async ( +export const de_DetectMetricSetConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAlertsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AlertSummaryList: (_) => de_AlertSummaryList(_, context), - NextToken: __expectString, + DetectedMetricSetConfig: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAlertsCommandError - */ -const de_ListAlertsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAnomalyDetectorsCommand + * deserializeAws_restJson1GetAnomalyGroupCommand */ -export const de_ListAnomalyDetectorsCommand = async ( +export const de_GetAnomalyGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnomalyDetectorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AnomalyDetectorSummaryList: (_) => de_AnomalyDetectorSummaryList(_, context), - NextToken: __expectString, + AnomalyGroup: (_) => de_AnomalyGroup(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAnomalyDetectorsCommandError + * deserializeAws_restJson1GetDataQualityMetricsCommand */ -const de_ListAnomalyDetectorsCommandError = async ( +export const de_GetDataQualityMetricsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AnomalyDetectorDataQualityMetricList: (_) => de_AnomalyDetectorDataQualityMetricList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListAnomalyGroupRelatedMetricsCommand + * deserializeAws_restJson1GetFeedbackCommand */ -export const de_ListAnomalyGroupRelatedMetricsCommand = async ( +export const de_GetFeedbackCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnomalyGroupRelatedMetricsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - InterMetricImpactList: (_) => de_InterMetricImpactList(_, context), + AnomalyGroupTimeSeriesFeedback: _json, NextToken: __expectString, }); Object.assign(contents, doc); @@ -2044,60 +1210,43 @@ export const de_ListAnomalyGroupRelatedMetricsCommand = async ( }; /** - * deserializeAws_restJson1ListAnomalyGroupRelatedMetricsCommandError + * deserializeAws_restJson1GetSampleDataCommand */ -const de_ListAnomalyGroupRelatedMetricsCommandError = async ( +export const de_GetSampleDataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + HeaderValues: _json, + SampleRows: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListAnomalyGroupSummariesCommand + * deserializeAws_restJson1ListAlertsCommand */ -export const de_ListAnomalyGroupSummariesCommand = async ( +export const de_ListAlertsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnomalyGroupSummariesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AnomalyGroupStatistics: _json, - AnomalyGroupSummaryList: (_) => de_AnomalyGroupSummaryList(_, context), + AlertSummaryList: (_) => de_AlertSummaryList(_, context), NextToken: __expectString, }); Object.assign(contents, doc); @@ -2105,164 +1254,117 @@ export const de_ListAnomalyGroupSummariesCommand = async ( }; /** - * deserializeAws_restJson1ListAnomalyGroupSummariesCommandError + * deserializeAws_restJson1ListAnomalyDetectorsCommand */ -const de_ListAnomalyGroupSummariesCommandError = async ( +export const de_ListAnomalyDetectorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AnomalyDetectorSummaryList: (_) => de_AnomalyDetectorSummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListAnomalyGroupTimeSeriesCommand + * deserializeAws_restJson1ListAnomalyGroupRelatedMetricsCommand */ -export const de_ListAnomalyGroupTimeSeriesCommand = async ( +export const de_ListAnomalyGroupRelatedMetricsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnomalyGroupTimeSeriesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AnomalyGroupId: __expectString, - MetricName: __expectString, + InterMetricImpactList: (_) => de_InterMetricImpactList(_, context), NextToken: __expectString, - TimeSeriesList: (_) => de_TimeSeriesList(_, context), - TimestampList: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAnomalyGroupTimeSeriesCommandError + * deserializeAws_restJson1ListAnomalyGroupSummariesCommand */ -const de_ListAnomalyGroupTimeSeriesCommandError = async ( +export const de_ListAnomalyGroupSummariesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AnomalyGroupStatistics: _json, + AnomalyGroupSummaryList: (_) => de_AnomalyGroupSummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListMetricSetsCommand + * deserializeAws_restJson1ListAnomalyGroupTimeSeriesCommand */ -export const de_ListMetricSetsCommand = async ( +export const de_ListAnomalyGroupTimeSeriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMetricSetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - MetricSetSummaryList: (_) => de_MetricSetSummaryList(_, context), + AnomalyGroupId: __expectString, + MetricName: __expectString, NextToken: __expectString, + TimeSeriesList: (_) => de_TimeSeriesList(_, context), + TimestampList: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListMetricSetsCommandError + * deserializeAws_restJson1ListMetricSetsCommand */ -const de_ListMetricSetsCommandError = async ( +export const de_ListMetricSetsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + MetricSetSummaryList: (_) => de_MetricSetSummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2273,7 +1375,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2286,38 +1388,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutFeedbackCommand */ @@ -2326,7 +1396,7 @@ export const de_PutFeedbackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutFeedbackCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2335,44 +1405,6 @@ export const de_PutFeedbackCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutFeedbackCommandError - */ -const de_PutFeedbackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2381,7 +1413,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2390,38 +1422,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2430,7 +1430,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2439,38 +1439,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAlertCommand */ @@ -2479,7 +1447,7 @@ export const de_UpdateAlertCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAlertCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2492,44 +1460,6 @@ export const de_UpdateAlertCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAlertCommandError - */ -const de_UpdateAlertCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAnomalyDetectorCommand */ @@ -2538,7 +1468,7 @@ export const de_UpdateAnomalyDetectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAnomalyDetectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2551,44 +1481,6 @@ export const de_UpdateAnomalyDetectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAnomalyDetectorCommandError - */ -const de_UpdateAnomalyDetectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutmetrics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutmetrics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.lookoutmetrics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutmetrics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMetricSetCommand */ @@ -2597,7 +1489,7 @@ export const de_UpdateMetricSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMetricSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2611,12 +1503,9 @@ export const de_UpdateMetricSetCommand = async ( }; /** - * deserializeAws_restJson1UpdateMetricSetCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateMetricSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2626,28 +1515,31 @@ const de_UpdateMetricSetCommandError = async ( case "AccessDeniedException": case "com.amazonaws.lookoutmetrics#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.lookoutmetrics#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.lookoutmetrics#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.lookoutmetrics#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutmetrics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.lookoutmetrics#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.lookoutmetrics#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.lookoutmetrics#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-lookoutvision/src/protocols/Aws_restJson1.ts b/clients/client-lookoutvision/src/protocols/Aws_restJson1.ts index b121bbdaa520..e06f1d306222 100644 --- a/clients/client-lookoutvision/src/protocols/Aws_restJson1.ts +++ b/clients/client-lookoutvision/src/protocols/Aws_restJson1.ts @@ -573,7 +573,7 @@ export const de_CreateDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -586,50 +586,6 @@ export const de_CreateDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDatasetCommandError - */ -const de_CreateDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutvision#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateModelCommand */ @@ -638,7 +594,7 @@ export const de_CreateModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -651,50 +607,6 @@ export const de_CreateModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateModelCommandError - */ -const de_CreateModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutvision#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProjectCommand */ @@ -703,7 +615,7 @@ export const de_CreateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -716,50 +628,6 @@ export const de_CreateProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProjectCommandError - */ -const de_CreateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutvision#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDatasetCommand */ @@ -768,7 +636,7 @@ export const de_DeleteDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -777,47 +645,6 @@ export const de_DeleteDatasetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDatasetCommandError - */ -const de_DeleteDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteModelCommand */ @@ -826,7 +653,7 @@ export const de_DeleteModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -839,47 +666,6 @@ export const de_DeleteModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteModelCommandError - */ -const de_DeleteModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteProjectCommand */ @@ -888,7 +674,7 @@ export const de_DeleteProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -902,179 +688,56 @@ export const de_DeleteProjectCommand = async ( }; /** - * deserializeAws_restJson1DeleteProjectCommandError + * deserializeAws_restJson1DescribeDatasetCommand */ -const de_DeleteProjectCommandError = async ( +export const de_DescribeDatasetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DatasetDescription: (_) => de_DatasetDescription(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeDatasetCommand + * deserializeAws_restJson1DescribeModelCommand */ -export const de_DescribeDatasetCommand = async ( +export const de_DescribeModelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDatasetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DatasetDescription: (_) => de_DatasetDescription(_, context), + ModelDescription: (_) => de_ModelDescription(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeDatasetCommandError + * deserializeAws_restJson1DescribeModelPackagingJobCommand */ -const de_DescribeDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeModelCommand - */ -export const de_DescribeModelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeModelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ModelDescription: (_) => de_ModelDescription(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeModelCommandError - */ -const de_DescribeModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeModelPackagingJobCommand - */ -export const de_DescribeModelPackagingJobCommand = async ( +export const de_DescribeModelPackagingJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeModelPackagingJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1087,44 +750,6 @@ export const de_DescribeModelPackagingJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeModelPackagingJobCommandError - */ -const de_DescribeModelPackagingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeProjectCommand */ @@ -1133,7 +758,7 @@ export const de_DescribeProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1146,47 +771,6 @@ export const de_DescribeProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeProjectCommandError - */ -const de_DescribeProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DetectAnomaliesCommand */ @@ -1195,7 +779,7 @@ export const de_DetectAnomaliesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DetectAnomaliesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1208,47 +792,6 @@ export const de_DetectAnomaliesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DetectAnomaliesCommandError - */ -const de_DetectAnomaliesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDatasetEntriesCommand */ @@ -1257,7 +800,7 @@ export const de_ListDatasetEntriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDatasetEntriesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1271,47 +814,6 @@ export const de_ListDatasetEntriesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDatasetEntriesCommandError - */ -const de_ListDatasetEntriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListModelPackagingJobsCommand */ @@ -1320,7 +822,7 @@ export const de_ListModelPackagingJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListModelPackagingJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1334,44 +836,6 @@ export const de_ListModelPackagingJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListModelPackagingJobsCommandError - */ -const de_ListModelPackagingJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListModelsCommand */ @@ -1380,7 +844,7 @@ export const de_ListModelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListModelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1395,169 +859,46 @@ export const de_ListModelsCommand = async ( }; /** - * deserializeAws_restJson1ListModelsCommandError - */ -const de_ListModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListProjectsCommand - */ -export const de_ListProjectsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProjectsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Projects: (_) => de_ProjectMetadataList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListProjectsCommandError - */ -const de_ListProjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListProjectsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListProjectsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: _json, + NextToken: __expectString, + Projects: (_) => de_ProjectMetadataList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1568,7 +909,7 @@ export const de_StartModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1581,50 +922,6 @@ export const de_StartModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartModelCommandError - */ -const de_StartModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutvision#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartModelPackagingJobCommand */ @@ -1633,7 +930,7 @@ export const de_StartModelPackagingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartModelPackagingJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1646,50 +943,6 @@ export const de_StartModelPackagingJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartModelPackagingJobCommandError - */ -const de_StartModelPackagingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutvision#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopModelCommand */ @@ -1698,7 +951,7 @@ export const de_StopModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StopModelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1711,47 +964,6 @@ export const de_StopModelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopModelCommandError - */ -const de_StopModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1760,7 +972,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1769,50 +981,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.lookoutvision#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1821,7 +989,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1830,47 +998,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.lookoutvision#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.lookoutvision#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.lookoutvision#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.lookoutvision#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.lookoutvision#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.lookoutvision#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDatasetEntriesCommand */ @@ -1879,7 +1006,7 @@ export const de_UpdateDatasetEntriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateDatasetEntriesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1893,12 +1020,9 @@ export const de_UpdateDatasetEntriesCommand = async ( }; /** - * deserializeAws_restJson1UpdateDatasetEntriesCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateDatasetEntriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1917,6 +1041,9 @@ const de_UpdateDatasetEntriesCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.lookoutvision#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.lookoutvision#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.lookoutvision#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -1929,7 +1056,7 @@ const de_UpdateDatasetEntriesCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-m2/src/protocols/Aws_restJson1.ts b/clients/client-m2/src/protocols/Aws_restJson1.ts index 93e92860e149..8fbc4ba1db80 100644 --- a/clients/client-m2/src/protocols/Aws_restJson1.ts +++ b/clients/client-m2/src/protocols/Aws_restJson1.ts @@ -829,7 +829,7 @@ export const de_CancelBatchJobExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelBatchJobExecutionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -838,47 +838,6 @@ export const de_CancelBatchJobExecutionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelBatchJobExecutionCommandError - */ -const de_CancelBatchJobExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.m2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateApplicationCommand */ @@ -887,7 +846,7 @@ export const de_CreateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -902,47 +861,6 @@ export const de_CreateApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.m2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.m2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDataSetImportTaskCommand */ @@ -951,7 +869,7 @@ export const de_CreateDataSetImportTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDataSetImportTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -964,50 +882,6 @@ export const de_CreateDataSetImportTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDataSetImportTaskCommandError - */ -const de_CreateDataSetImportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.m2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.m2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDeploymentCommand */ @@ -1016,7 +890,7 @@ export const de_CreateDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDeploymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1029,50 +903,6 @@ export const de_CreateDeploymentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDeploymentCommandError - */ -const de_CreateDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.m2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.m2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateEnvironmentCommand */ @@ -1081,7 +911,7 @@ export const de_CreateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1094,47 +924,6 @@ export const de_CreateEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEnvironmentCommandError - */ -const de_CreateEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.m2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.m2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteApplicationCommand */ @@ -1143,7 +932,7 @@ export const de_DeleteApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1153,52 +942,31 @@ export const de_DeleteApplicationCommand = async ( }; /** - * deserializeAws_restJson1DeleteApplicationCommandError + * deserializeAws_restJson1DeleteApplicationFromEnvironmentCommand */ -const de_DeleteApplicationCommandError = async ( +export const de_DeleteApplicationFromEnvironmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.m2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteApplicationFromEnvironmentCommand + * deserializeAws_restJson1DeleteEnvironmentCommand */ -export const de_DeleteApplicationFromEnvironmentCommand = async ( +export const de_DeleteEnvironmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteApplicationFromEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1208,110 +976,14 @@ export const de_DeleteApplicationFromEnvironmentCommand = async ( }; /** - * deserializeAws_restJson1DeleteApplicationFromEnvironmentCommandError + * deserializeAws_restJson1GetApplicationCommand */ -const de_DeleteApplicationFromEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.m2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteEnvironmentCommand - */ -export const de_DeleteEnvironmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEnvironmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteEnvironmentCommandError - */ -const de_DeleteEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.m2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetApplicationCommand - */ -export const de_GetApplicationCommand = async ( +export const de_GetApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1343,44 +1015,6 @@ export const de_GetApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetApplicationCommandError - */ -const de_GetApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetApplicationVersionCommand */ @@ -1389,7 +1023,7 @@ export const de_GetApplicationVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApplicationVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1408,44 +1042,6 @@ export const de_GetApplicationVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetApplicationVersionCommandError - */ -const de_GetApplicationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBatchJobExecutionCommand */ @@ -1454,7 +1050,7 @@ export const de_GetBatchJobExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBatchJobExecutionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1478,44 +1074,6 @@ export const de_GetBatchJobExecutionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBatchJobExecutionCommandError - */ -const de_GetBatchJobExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDataSetDetailsCommand */ @@ -1524,7 +1082,7 @@ export const de_GetDataSetDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataSetDetailsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1546,187 +1104,64 @@ export const de_GetDataSetDetailsCommand = async ( }; /** - * deserializeAws_restJson1GetDataSetDetailsCommandError + * deserializeAws_restJson1GetDataSetImportTaskCommand */ -const de_GetDataSetDetailsCommandError = async ( +export const de_GetDataSetImportTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.m2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ExecutionTimeoutException": - case "com.amazonaws.m2#ExecutionTimeoutException": - throw await de_ExecutionTimeoutExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.m2#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + status: __expectString, + summary: _json, + taskId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetDataSetImportTaskCommand + * deserializeAws_restJson1GetDeploymentCommand */ -export const de_GetDataSetImportTaskCommand = async ( +export const de_GetDeploymentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataSetImportTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + applicationId: __expectString, + applicationVersion: __expectInt32, + creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + deploymentId: __expectString, + environmentId: __expectString, status: __expectString, - summary: _json, - taskId: __expectString, + statusReason: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetDataSetImportTaskCommandError + * deserializeAws_restJson1GetEnvironmentCommand */ -const de_GetDataSetImportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDeploymentCommand - */ -export const de_GetDeploymentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeploymentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - applicationId: __expectString, - applicationVersion: __expectInt32, - creationTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - deploymentId: __expectString, - environmentId: __expectString, - status: __expectString, - statusReason: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDeploymentCommandError - */ -const de_GetDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEnvironmentCommand - */ -export const de_GetEnvironmentCommand = async ( +export const de_GetEnvironmentCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1760,44 +1195,6 @@ export const de_GetEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEnvironmentCommandError - */ -const de_GetEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSignedBluinsightsUrlCommand */ @@ -1806,7 +1203,7 @@ export const de_GetSignedBluinsightsUrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSignedBluinsightsUrlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1819,38 +1216,6 @@ export const de_GetSignedBluinsightsUrlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSignedBluinsightsUrlCommandError - */ -const de_GetSignedBluinsightsUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationsCommand */ @@ -1859,7 +1224,7 @@ export const de_ListApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1874,56 +1239,43 @@ export const de_ListApplicationsCommand = async ( }; /** - * deserializeAws_restJson1ListApplicationsCommandError + * deserializeAws_restJson1ListApplicationVersionsCommand */ -const de_ListApplicationsCommandError = async ( +export const de_ListApplicationVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + applicationVersions: (_) => de_ApplicationVersionSummaryList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListApplicationVersionsCommand + * deserializeAws_restJson1ListBatchJobDefinitionsCommand */ -export const de_ListApplicationVersionsCommand = async ( +export const de_ListBatchJobDefinitionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - applicationVersions: (_) => de_ApplicationVersionSummaryList(_, context), + batchJobDefinitions: _json, nextToken: __expectString, }); Object.assign(contents, doc); @@ -1931,59 +1283,43 @@ export const de_ListApplicationVersionsCommand = async ( }; /** - * deserializeAws_restJson1ListApplicationVersionsCommandError + * deserializeAws_restJson1ListBatchJobExecutionsCommand */ -const de_ListApplicationVersionsCommandError = async ( +export const de_ListBatchJobExecutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + batchJobExecutions: (_) => de_BatchJobExecutionSummaryList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListBatchJobDefinitionsCommand + * deserializeAws_restJson1ListDataSetImportHistoryCommand */ -export const de_ListBatchJobDefinitionsCommand = async ( +export const de_ListDataSetImportHistoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBatchJobDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - batchJobDefinitions: _json, + dataSetImportTasks: _json, nextToken: __expectString, }); Object.assign(contents, doc); @@ -1991,172 +1327,14 @@ export const de_ListBatchJobDefinitionsCommand = async ( }; /** - * deserializeAws_restJson1ListBatchJobDefinitionsCommandError + * deserializeAws_restJson1ListDataSetsCommand */ -const de_ListBatchJobDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListBatchJobExecutionsCommand - */ -export const de_ListBatchJobExecutionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBatchJobExecutionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - batchJobExecutions: (_) => de_BatchJobExecutionSummaryList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListBatchJobExecutionsCommandError - */ -const de_ListBatchJobExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDataSetImportHistoryCommand - */ -export const de_ListDataSetImportHistoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataSetImportHistoryCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - dataSetImportTasks: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDataSetImportHistoryCommandError - */ -const de_ListDataSetImportHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDataSetsCommand - */ -export const de_ListDataSetsCommand = async ( +export const de_ListDataSetsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataSetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2170,53 +1348,6 @@ export const de_ListDataSetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDataSetsCommandError - */ -const de_ListDataSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.m2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ExecutionTimeoutException": - case "com.amazonaws.m2#ExecutionTimeoutException": - throw await de_ExecutionTimeoutExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.m2#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDeploymentsCommand */ @@ -2225,7 +1356,7 @@ export const de_ListDeploymentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeploymentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2239,44 +1370,6 @@ export const de_ListDeploymentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDeploymentsCommandError - */ -const de_ListDeploymentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEngineVersionsCommand */ @@ -2285,7 +1378,7 @@ export const de_ListEngineVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEngineVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2299,41 +1392,6 @@ export const de_ListEngineVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEngineVersionsCommandError - */ -const de_ListEngineVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEnvironmentsCommand */ @@ -2342,7 +1400,7 @@ export const de_ListEnvironmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEnvironmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2350,162 +1408,48 @@ export const de_ListEnvironmentsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { environments: (_) => de_EnvironmentSummaryList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListEnvironmentsCommandError - */ -const de_ListEnvironmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartApplicationCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_StartApplicationCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartApplicationCommandError + * deserializeAws_restJson1StartApplicationCommand */ -const de_StartApplicationCommandError = async ( +export const de_StartApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.m2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -2516,7 +1460,7 @@ export const de_StartBatchJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartBatchJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2529,47 +1473,6 @@ export const de_StartBatchJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartBatchJobCommandError - */ -const de_StartBatchJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.m2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopApplicationCommand */ @@ -2578,7 +1481,7 @@ export const de_StopApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2587,47 +1490,6 @@ export const de_StopApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopApplicationCommandError - */ -const de_StopApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.m2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2636,7 +1498,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2645,47 +1507,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.m2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2694,7 +1515,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2703,44 +1524,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateApplicationCommand */ @@ -2749,7 +1532,7 @@ export const de_UpdateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2762,47 +1545,6 @@ export const de_UpdateApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateApplicationCommandError - */ -const de_UpdateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.m2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.m2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.m2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.m2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.m2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.m2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEnvironmentCommand */ @@ -2811,7 +1553,7 @@ export const de_UpdateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2825,12 +1567,9 @@ export const de_UpdateEnvironmentCommand = async ( }; /** - * deserializeAws_restJson1UpdateEnvironmentCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2849,22 +1588,28 @@ const de_UpdateEnvironmentCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.m2#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.m2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.m2#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.m2#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.m2#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ExecutionTimeoutException": + case "com.amazonaws.m2#ExecutionTimeoutException": + throw await de_ExecutionTimeoutExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.m2#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-machine-learning/src/protocols/Aws_json1_1.ts b/clients/client-machine-learning/src/protocols/Aws_json1_1.ts index 0677cb05fab9..3ce5b7ab2b9a 100644 --- a/clients/client-machine-learning/src/protocols/Aws_json1_1.ts +++ b/clients/client-machine-learning/src/protocols/Aws_json1_1.ts @@ -521,7 +521,7 @@ export const de_AddTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -533,44 +533,6 @@ export const de_AddTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddTagsCommandError - */ -const de_AddTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.machinelearning#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagLimitExceededException": - case "com.amazonaws.machinelearning#TagLimitExceededException": - throw await de_TagLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateBatchPredictionCommand */ @@ -579,7 +541,7 @@ export const de_CreateBatchPredictionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBatchPredictionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -591,38 +553,6 @@ export const de_CreateBatchPredictionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateBatchPredictionCommandError - */ -const de_CreateBatchPredictionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.machinelearning#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDataSourceFromRDSCommand */ @@ -631,7 +561,7 @@ export const de_CreateDataSourceFromRDSCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDataSourceFromRDSCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -643,38 +573,6 @@ export const de_CreateDataSourceFromRDSCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDataSourceFromRDSCommandError - */ -const de_CreateDataSourceFromRDSCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.machinelearning#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDataSourceFromRedshiftCommand */ @@ -683,7 +581,7 @@ export const de_CreateDataSourceFromRedshiftCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDataSourceFromRedshiftCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -695,38 +593,6 @@ export const de_CreateDataSourceFromRedshiftCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDataSourceFromRedshiftCommandError - */ -const de_CreateDataSourceFromRedshiftCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.machinelearning#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDataSourceFromS3Command */ @@ -735,7 +601,7 @@ export const de_CreateDataSourceFromS3Command = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDataSourceFromS3CommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -747,38 +613,6 @@ export const de_CreateDataSourceFromS3Command = async ( return response; }; -/** - * deserializeAws_json1_1CreateDataSourceFromS3CommandError - */ -const de_CreateDataSourceFromS3CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.machinelearning#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateEvaluationCommand */ @@ -787,7 +621,7 @@ export const de_CreateEvaluationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEvaluationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -799,38 +633,6 @@ export const de_CreateEvaluationCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateEvaluationCommandError - */ -const de_CreateEvaluationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.machinelearning#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateMLModelCommand */ @@ -839,7 +641,7 @@ export const de_CreateMLModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateMLModelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -851,38 +653,6 @@ export const de_CreateMLModelCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateMLModelCommandError - */ -const de_CreateMLModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.machinelearning#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateRealtimeEndpointCommand */ @@ -891,7 +661,7 @@ export const de_CreateRealtimeEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRealtimeEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -903,38 +673,6 @@ export const de_CreateRealtimeEndpointCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateRealtimeEndpointCommandError - */ -const de_CreateRealtimeEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteBatchPredictionCommand */ @@ -943,7 +681,7 @@ export const de_DeleteBatchPredictionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteBatchPredictionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -955,38 +693,6 @@ export const de_DeleteBatchPredictionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteBatchPredictionCommandError - */ -const de_DeleteBatchPredictionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteDataSourceCommand */ @@ -995,48 +701,16 @@ export const de_DeleteDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDataSourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); const response: DeleteDataSourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDataSourceCommandError - */ -const de_DeleteDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1047,7 +721,7 @@ export const de_DeleteEvaluationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEvaluationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1059,38 +733,6 @@ export const de_DeleteEvaluationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteEvaluationCommandError - */ -const de_DeleteEvaluationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteMLModelCommand */ @@ -1099,7 +741,7 @@ export const de_DeleteMLModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteMLModelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1111,38 +753,6 @@ export const de_DeleteMLModelCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteMLModelCommandError - */ -const de_DeleteMLModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteRealtimeEndpointCommand */ @@ -1151,7 +761,7 @@ export const de_DeleteRealtimeEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRealtimeEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1163,38 +773,6 @@ export const de_DeleteRealtimeEndpointCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteRealtimeEndpointCommandError - */ -const de_DeleteRealtimeEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteTagsCommand */ @@ -1203,7 +781,7 @@ export const de_DeleteTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1215,41 +793,6 @@ export const de_DeleteTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteTagsCommandError - */ -const de_DeleteTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.machinelearning#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeBatchPredictionsCommand */ @@ -1258,7 +801,7 @@ export const de_DescribeBatchPredictionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBatchPredictionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1270,35 +813,6 @@ export const de_DescribeBatchPredictionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeBatchPredictionsCommandError - */ -const de_DescribeBatchPredictionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeDataSourcesCommand */ @@ -1307,7 +821,7 @@ export const de_DescribeDataSourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDataSourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1319,35 +833,6 @@ export const de_DescribeDataSourcesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDataSourcesCommandError - */ -const de_DescribeDataSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEvaluationsCommand */ @@ -1356,7 +841,7 @@ export const de_DescribeEvaluationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEvaluationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1368,35 +853,6 @@ export const de_DescribeEvaluationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEvaluationsCommandError - */ -const de_DescribeEvaluationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeMLModelsCommand */ @@ -1405,7 +861,7 @@ export const de_DescribeMLModelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeMLModelsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1417,35 +873,6 @@ export const de_DescribeMLModelsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeMLModelsCommandError - */ -const de_DescribeMLModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTagsCommand */ @@ -1454,7 +881,7 @@ export const de_DescribeTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1466,38 +893,6 @@ export const de_DescribeTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTagsCommandError - */ -const de_DescribeTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetBatchPredictionCommand */ @@ -1506,7 +901,7 @@ export const de_GetBatchPredictionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetBatchPredictionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1518,38 +913,6 @@ export const de_GetBatchPredictionCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetBatchPredictionCommandError - */ -const de_GetBatchPredictionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetDataSourceCommand */ @@ -1558,7 +921,7 @@ export const de_GetDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDataSourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1570,38 +933,6 @@ export const de_GetDataSourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetDataSourceCommandError - */ -const de_GetDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetEvaluationCommand */ @@ -1610,7 +941,7 @@ export const de_GetEvaluationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetEvaluationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1622,38 +953,6 @@ export const de_GetEvaluationCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetEvaluationCommandError - */ -const de_GetEvaluationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetMLModelCommand */ @@ -1662,7 +961,7 @@ export const de_GetMLModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetMLModelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1674,38 +973,6 @@ export const de_GetMLModelCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetMLModelCommandError - */ -const de_GetMLModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PredictCommand */ @@ -1714,7 +981,7 @@ export const de_PredictCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PredictCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1726,44 +993,6 @@ export const de_PredictCommand = async ( return response; }; -/** - * deserializeAws_json1_1PredictCommandError - */ -const de_PredictCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.machinelearning#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PredictorNotMountedException": - case "com.amazonaws.machinelearning#PredictorNotMountedException": - throw await de_PredictorNotMountedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateBatchPredictionCommand */ @@ -1772,7 +1001,7 @@ export const de_UpdateBatchPredictionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateBatchPredictionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1784,38 +1013,6 @@ export const de_UpdateBatchPredictionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateBatchPredictionCommandError - */ -const de_UpdateBatchPredictionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDataSourceCommand */ @@ -1824,7 +1021,7 @@ export const de_UpdateDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDataSourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1836,38 +1033,6 @@ export const de_UpdateDataSourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDataSourceCommandError - */ -const de_UpdateDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateEvaluationCommand */ @@ -1876,7 +1041,7 @@ export const de_UpdateEvaluationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateEvaluationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1888,38 +1053,6 @@ export const de_UpdateEvaluationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateEvaluationCommandError - */ -const de_UpdateEvaluationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.machinelearning#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.machinelearning#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.machinelearning#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateMLModelCommand */ @@ -1928,7 +1061,7 @@ export const de_UpdateMLModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateMLModelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1941,12 +1074,9 @@ export const de_UpdateMLModelCommand = async ( }; /** - * deserializeAws_json1_1UpdateMLModelCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateMLModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1959,16 +1089,31 @@ const de_UpdateMLModelCommandError = async ( case "InvalidInputException": case "com.amazonaws.machinelearning#InvalidInputException": throw await de_InvalidInputExceptionRes(parsedOutput, context); + case "InvalidTagException": + case "com.amazonaws.machinelearning#InvalidTagException": + throw await de_InvalidTagExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.machinelearning#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "TagLimitExceededException": + case "com.amazonaws.machinelearning#TagLimitExceededException": + throw await de_TagLimitExceededExceptionRes(parsedOutput, context); + case "IdempotentParameterMismatchException": + case "com.amazonaws.machinelearning#IdempotentParameterMismatchException": + throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.machinelearning#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "PredictorNotMountedException": + case "com.amazonaws.machinelearning#PredictorNotMountedException": + throw await de_PredictorNotMountedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-macie2/src/protocols/Aws_restJson1.ts b/clients/client-macie2/src/protocols/Aws_restJson1.ts index 285b4514a704..40e2e0f8ce7f 100644 --- a/clients/client-macie2/src/protocols/Aws_restJson1.ts +++ b/clients/client-macie2/src/protocols/Aws_restJson1.ts @@ -2068,7 +2068,7 @@ export const de_AcceptInvitationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptInvitationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2077,50 +2077,6 @@ export const de_AcceptInvitationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptInvitationCommandError - */ -const de_AcceptInvitationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetCustomDataIdentifiersCommand */ @@ -2129,7 +2085,7 @@ export const de_BatchGetCustomDataIdentifiersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetCustomDataIdentifiersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2147,50 +2103,6 @@ export const de_BatchGetCustomDataIdentifiersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetCustomDataIdentifiersCommandError - */ -const de_BatchGetCustomDataIdentifiersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAllowListCommand */ @@ -2199,7 +2111,7 @@ export const de_CreateAllowListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAllowListCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2213,50 +2125,6 @@ export const de_CreateAllowListCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAllowListCommandError - */ -const de_CreateAllowListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateClassificationJobCommand */ @@ -2265,7 +2133,7 @@ export const de_CreateClassificationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateClassificationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2279,50 +2147,6 @@ export const de_CreateClassificationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateClassificationJobCommandError - */ -const de_CreateClassificationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCustomDataIdentifierCommand */ @@ -2331,7 +2155,7 @@ export const de_CreateCustomDataIdentifierCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCustomDataIdentifierCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2344,50 +2168,6 @@ export const de_CreateCustomDataIdentifierCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCustomDataIdentifierCommandError - */ -const de_CreateCustomDataIdentifierCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFindingsFilterCommand */ @@ -2396,7 +2176,7 @@ export const de_CreateFindingsFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFindingsFilterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2410,50 +2190,6 @@ export const de_CreateFindingsFilterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFindingsFilterCommandError - */ -const de_CreateFindingsFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateInvitationsCommand */ @@ -2462,7 +2198,7 @@ export const de_CreateInvitationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateInvitationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2476,58 +2212,14 @@ export const de_CreateInvitationsCommand = async ( }; /** - * deserializeAws_restJson1CreateInvitationsCommandError + * deserializeAws_restJson1CreateMemberCommand */ -const de_CreateInvitationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateMemberCommand - */ -export const de_CreateMemberCommand = async ( +export const de_CreateMemberCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMemberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2540,50 +2232,6 @@ export const de_CreateMemberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMemberCommandError - */ -const de_CreateMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSampleFindingsCommand */ @@ -2592,7 +2240,7 @@ export const de_CreateSampleFindingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSampleFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2601,50 +2249,6 @@ export const de_CreateSampleFindingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSampleFindingsCommandError - */ -const de_CreateSampleFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeclineInvitationsCommand */ @@ -2653,7 +2257,7 @@ export const de_DeclineInvitationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeclineInvitationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2666,50 +2270,6 @@ export const de_DeclineInvitationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeclineInvitationsCommandError - */ -const de_DeclineInvitationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAllowListCommand */ @@ -2718,7 +2278,7 @@ export const de_DeleteAllowListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAllowListCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2728,52 +2288,31 @@ export const de_DeleteAllowListCommand = async ( }; /** - * deserializeAws_restJson1DeleteAllowListCommandError + * deserializeAws_restJson1DeleteCustomDataIdentifierCommand */ -const de_DeleteAllowListCommandError = async ( +export const de_DeleteCustomDataIdentifierCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteCustomDataIdentifierCommand + * deserializeAws_restJson1DeleteFindingsFilterCommand */ -export const de_DeleteCustomDataIdentifierCommand = async ( +export const de_DeleteFindingsFilterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCustomDataIdentifierCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2783,58 +2322,35 @@ export const de_DeleteCustomDataIdentifierCommand = async ( }; /** - * deserializeAws_restJson1DeleteCustomDataIdentifierCommandError + * deserializeAws_restJson1DeleteInvitationsCommand */ -const de_DeleteCustomDataIdentifierCommandError = async ( +export const de_DeleteInvitationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + unprocessedAccounts: [, (_) => de___listOfUnprocessedAccount(_, context), `unprocessedAccounts`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteFindingsFilterCommand + * deserializeAws_restJson1DeleteMemberCommand */ -export const de_DeleteFindingsFilterCommand = async ( +export const de_DeleteMemberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFindingsFilterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2844,184 +2360,14 @@ export const de_DeleteFindingsFilterCommand = async ( }; /** - * deserializeAws_restJson1DeleteFindingsFilterCommandError + * deserializeAws_restJson1DescribeBucketsCommand */ -const de_DeleteFindingsFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteInvitationsCommand - */ -export const de_DeleteInvitationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteInvitationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - unprocessedAccounts: [, (_) => de___listOfUnprocessedAccount(_, context), `unprocessedAccounts`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteInvitationsCommandError - */ -const de_DeleteInvitationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteMemberCommand - */ -export const de_DeleteMemberCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMemberCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteMemberCommandError - */ -const de_DeleteMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeBucketsCommand - */ -export const de_DescribeBucketsCommand = async ( +export const de_DescribeBucketsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBucketsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3035,50 +2381,6 @@ export const de_DescribeBucketsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeBucketsCommandError - */ -const de_DescribeBucketsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeClassificationJobCommand */ @@ -3087,7 +2389,7 @@ export const de_DescribeClassificationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeClassificationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3120,50 +2422,6 @@ export const de_DescribeClassificationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeClassificationJobCommandError - */ -const de_DescribeClassificationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeOrganizationConfigurationCommand */ @@ -3172,7 +2430,7 @@ export const de_DescribeOrganizationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeOrganizationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3187,58 +2445,14 @@ export const de_DescribeOrganizationConfigurationCommand = async ( }; /** - * deserializeAws_restJson1DescribeOrganizationConfigurationCommandError + * deserializeAws_restJson1DisableMacieCommand */ -const de_DescribeOrganizationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisableMacieCommand - */ -export const de_DisableMacieCommand = async ( +export const de_DisableMacieCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableMacieCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3247,50 +2461,6 @@ export const de_DisableMacieCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisableMacieCommandError - */ -const de_DisableMacieCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisableOrganizationAdminAccountCommand */ @@ -3299,7 +2469,7 @@ export const de_DisableOrganizationAdminAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableOrganizationAdminAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3308,50 +2478,6 @@ export const de_DisableOrganizationAdminAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisableOrganizationAdminAccountCommandError - */ -const de_DisableOrganizationAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateFromAdministratorAccountCommand */ @@ -3360,7 +2486,7 @@ export const de_DisassociateFromAdministratorAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateFromAdministratorAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3369,50 +2495,6 @@ export const de_DisassociateFromAdministratorAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateFromAdministratorAccountCommandError - */ -const de_DisassociateFromAdministratorAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateFromMasterAccountCommand */ @@ -3421,7 +2503,7 @@ export const de_DisassociateFromMasterAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateFromMasterAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3430,50 +2512,6 @@ export const de_DisassociateFromMasterAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateFromMasterAccountCommandError - */ -const de_DisassociateFromMasterAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateMemberCommand */ @@ -3482,7 +2520,7 @@ export const de_DisassociateMemberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateMemberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3492,58 +2530,31 @@ export const de_DisassociateMemberCommand = async ( }; /** - * deserializeAws_restJson1DisassociateMemberCommandError + * deserializeAws_restJson1EnableMacieCommand */ -const de_DisassociateMemberCommandError = async ( +export const de_EnableMacieCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1EnableMacieCommand + * deserializeAws_restJson1EnableOrganizationAdminAccountCommand */ -export const de_EnableMacieCommand = async ( +export const de_EnableOrganizationAdminAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableMacieCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3553,119 +2564,14 @@ export const de_EnableMacieCommand = async ( }; /** - * deserializeAws_restJson1EnableMacieCommandError + * deserializeAws_restJson1GetAdministratorAccountCommand */ -const de_EnableMacieCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1EnableOrganizationAdminAccountCommand - */ -export const de_EnableOrganizationAdminAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableOrganizationAdminAccountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1EnableOrganizationAdminAccountCommandError - */ -const de_EnableOrganizationAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAdministratorAccountCommand - */ -export const de_GetAdministratorAccountCommand = async ( +export const de_GetAdministratorAccountCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAdministratorAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3678,50 +2584,6 @@ export const de_GetAdministratorAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAdministratorAccountCommandError - */ -const de_GetAdministratorAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAllowListCommand */ @@ -3730,7 +2592,7 @@ export const de_GetAllowListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAllowListCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3751,44 +2613,6 @@ export const de_GetAllowListCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAllowListCommandError - */ -const de_GetAllowListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAutomatedDiscoveryConfigurationCommand */ @@ -3797,7 +2621,7 @@ export const de_GetAutomatedDiscoveryConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAutomatedDiscoveryConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3815,41 +2639,6 @@ export const de_GetAutomatedDiscoveryConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAutomatedDiscoveryConfigurationCommandError - */ -const de_GetAutomatedDiscoveryConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBucketStatisticsCommand */ @@ -3858,7 +2647,7 @@ export const de_GetBucketStatisticsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketStatisticsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3900,50 +2689,6 @@ export const de_GetBucketStatisticsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBucketStatisticsCommandError - */ -const de_GetBucketStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetClassificationExportConfigurationCommand */ @@ -3952,7 +2697,7 @@ export const de_GetClassificationExportConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetClassificationExportConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3966,58 +2711,14 @@ export const de_GetClassificationExportConfigurationCommand = async ( }; /** - * deserializeAws_restJson1GetClassificationExportConfigurationCommandError + * deserializeAws_restJson1GetClassificationScopeCommand */ -const de_GetClassificationExportConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetClassificationScopeCommand - */ -export const de_GetClassificationScopeCommand = async ( +export const de_GetClassificationScopeCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetClassificationScopeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4032,44 +2733,6 @@ export const de_GetClassificationScopeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetClassificationScopeCommandError - */ -const de_GetClassificationScopeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCustomDataIdentifierCommand */ @@ -4078,7 +2741,7 @@ export const de_GetCustomDataIdentifierCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCustomDataIdentifierCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4099,1781 +2762,321 @@ export const de_GetCustomDataIdentifierCommand = async ( tags: [, _json, `tags`], }); Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetCustomDataIdentifierCommandError - */ -const de_GetCustomDataIdentifierCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFindingsCommand - */ -export const de_GetFindingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFindingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - findings: [, (_) => de___listOfFinding(_, context), `findings`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFindingsCommandError - */ -const de_GetFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFindingsFilterCommand - */ -export const de_GetFindingsFilterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFindingsFilterCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - action: [, __expectString, `action`], - arn: [, __expectString, `arn`], - description: [, __expectString, `description`], - findingCriteria: [, (_) => de_FindingCriteria(_, context), `findingCriteria`], - id: [, __expectString, `id`], - name: [, __expectString, `name`], - position: [, __expectInt32, `position`], - tags: [, _json, `tags`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFindingsFilterCommandError - */ -const de_GetFindingsFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFindingsPublicationConfigurationCommand - */ -export const de_GetFindingsPublicationConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFindingsPublicationConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - securityHubConfiguration: [, (_) => de_SecurityHubConfiguration(_, context), `securityHubConfiguration`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFindingsPublicationConfigurationCommandError - */ -const de_GetFindingsPublicationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetFindingStatisticsCommand - */ -export const de_GetFindingStatisticsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFindingStatisticsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - countsByGroup: [, (_) => de___listOfGroupCount(_, context), `countsByGroup`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFindingStatisticsCommandError - */ -const de_GetFindingStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetInvitationsCountCommand - */ -export const de_GetInvitationsCountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInvitationsCountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - invitationsCount: [, __expectLong, `invitationsCount`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetInvitationsCountCommandError - */ -const de_GetInvitationsCountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMacieSessionCommand - */ -export const de_GetMacieSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMacieSessionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - createdAt: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `createdAt`], - findingPublishingFrequency: [, __expectString, `findingPublishingFrequency`], - serviceRole: [, __expectString, `serviceRole`], - status: [, __expectString, `status`], - updatedAt: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `updatedAt`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMacieSessionCommandError - */ -const de_GetMacieSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMasterAccountCommand - */ -export const de_GetMasterAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMasterAccountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - master: [, (_) => de_Invitation(_, context), `master`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMasterAccountCommandError - */ -const de_GetMasterAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMemberCommand - */ -export const de_GetMemberCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMemberCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - accountId: [, __expectString, `accountId`], - administratorAccountId: [, __expectString, `administratorAccountId`], - arn: [, __expectString, `arn`], - email: [, __expectString, `email`], - invitedAt: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `invitedAt`], - masterAccountId: [, __expectString, `masterAccountId`], - relationshipStatus: [, __expectString, `relationshipStatus`], - tags: [, _json, `tags`], - updatedAt: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `updatedAt`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMemberCommandError - */ -const de_GetMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetResourceProfileCommand - */ -export const de_GetResourceProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourceProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - profileUpdatedAt: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `profileUpdatedAt`], - sensitivityScore: [, __expectInt32, `sensitivityScore`], - sensitivityScoreOverridden: [, __expectBoolean, `sensitivityScoreOverridden`], - statistics: [, (_) => de_ResourceStatistics(_, context), `statistics`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetResourceProfileCommandError - */ -const de_GetResourceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRevealConfigurationCommand - */ -export const de_GetRevealConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRevealConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - configuration: [, (_) => de_RevealConfiguration(_, context), `configuration`], - retrievalConfiguration: [, (_) => de_RetrievalConfiguration(_, context), `retrievalConfiguration`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRevealConfigurationCommandError - */ -const de_GetRevealConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSensitiveDataOccurrencesCommand - */ -export const de_GetSensitiveDataOccurrencesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSensitiveDataOccurrencesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - error: [, __expectString, `error`], - sensitiveDataOccurrences: [, (_) => de_SensitiveDataOccurrences(_, context), `sensitiveDataOccurrences`], - status: [, __expectString, `status`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSensitiveDataOccurrencesCommandError - */ -const de_GetSensitiveDataOccurrencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.macie2#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSensitiveDataOccurrencesAvailabilityCommand - */ -export const de_GetSensitiveDataOccurrencesAvailabilityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSensitiveDataOccurrencesAvailabilityCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - code: [, __expectString, `code`], - reasons: [, _json, `reasons`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSensitiveDataOccurrencesAvailabilityCommandError - */ -const de_GetSensitiveDataOccurrencesAvailabilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSensitivityInspectionTemplateCommand - */ -export const de_GetSensitivityInspectionTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSensitivityInspectionTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - description: [, __expectString, `description`], - excludes: [, (_) => de_SensitivityInspectionTemplateExcludes(_, context), `excludes`], - includes: [, (_) => de_SensitivityInspectionTemplateIncludes(_, context), `includes`], - name: [, __expectString, `name`], - sensitivityInspectionTemplateId: [, __expectString, `sensitivityInspectionTemplateId`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSensitivityInspectionTemplateCommandError - */ -const de_GetSensitivityInspectionTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetUsageStatisticsCommand - */ -export const de_GetUsageStatisticsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUsageStatisticsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: [, __expectString, `nextToken`], - records: [, (_) => de___listOfUsageRecord(_, context), `records`], - timeRange: [, __expectString, `timeRange`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetUsageStatisticsCommandError - */ -const de_GetUsageStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetUsageTotalsCommand - */ -export const de_GetUsageTotalsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUsageTotalsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - timeRange: [, __expectString, `timeRange`], - usageTotals: [, (_) => de___listOfUsageTotal(_, context), `usageTotals`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetUsageTotalsCommandError - */ -const de_GetUsageTotalsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAllowListsCommand - */ -export const de_ListAllowListsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAllowListsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - allowLists: [, (_) => de___listOfAllowListSummary(_, context), `allowLists`], - nextToken: [, __expectString, `nextToken`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAllowListsCommandError - */ -const de_ListAllowListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListClassificationJobsCommand - */ -export const de_ListClassificationJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListClassificationJobsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - items: [, (_) => de___listOfJobSummary(_, context), `items`], - nextToken: [, __expectString, `nextToken`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListClassificationJobsCommandError - */ -const de_ListClassificationJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListClassificationScopesCommand - */ -export const de_ListClassificationScopesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListClassificationScopesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - classificationScopes: [, (_) => de___listOfClassificationScopeSummary(_, context), `classificationScopes`], - nextToken: [, __expectString, `nextToken`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListClassificationScopesCommandError - */ -const de_ListClassificationScopesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListCustomDataIdentifiersCommand - */ -export const de_ListCustomDataIdentifiersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCustomDataIdentifiersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - items: [, (_) => de___listOfCustomDataIdentifierSummary(_, context), `items`], - nextToken: [, __expectString, `nextToken`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListCustomDataIdentifiersCommandError - */ -const de_ListCustomDataIdentifiersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListFindingsCommand - */ -export const de_ListFindingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFindingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - findingIds: [, _json, `findingIds`], - nextToken: [, __expectString, `nextToken`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListFindingsCommandError - */ -const de_ListFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return contents; }; /** - * deserializeAws_restJson1ListFindingsFiltersCommand + * deserializeAws_restJson1GetFindingsCommand */ -export const de_ListFindingsFiltersCommand = async ( +export const de_GetFindingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFindingsFiltersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - findingsFilterListItems: [, (_) => de___listOfFindingsFilterListItem(_, context), `findingsFilterListItems`], - nextToken: [, __expectString, `nextToken`], + findings: [, (_) => de___listOfFinding(_, context), `findings`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListFindingsFiltersCommandError - */ -const de_ListFindingsFiltersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListInvitationsCommand + * deserializeAws_restJson1GetFindingsFilterCommand */ -export const de_ListInvitationsCommand = async ( +export const de_GetFindingsFilterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInvitationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - invitations: [, (_) => de___listOfInvitation(_, context), `invitations`], - nextToken: [, __expectString, `nextToken`], + action: [, __expectString, `action`], + arn: [, __expectString, `arn`], + description: [, __expectString, `description`], + findingCriteria: [, (_) => de_FindingCriteria(_, context), `findingCriteria`], + id: [, __expectString, `id`], + name: [, __expectString, `name`], + position: [, __expectInt32, `position`], + tags: [, _json, `tags`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListInvitationsCommandError + * deserializeAws_restJson1GetFindingsPublicationConfigurationCommand */ -const de_ListInvitationsCommandError = async ( +export const de_GetFindingsPublicationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + securityHubConfiguration: [, (_) => de_SecurityHubConfiguration(_, context), `securityHubConfiguration`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListManagedDataIdentifiersCommand + * deserializeAws_restJson1GetFindingStatisticsCommand */ -export const de_ListManagedDataIdentifiersCommand = async ( +export const de_GetFindingStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListManagedDataIdentifiersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: [, (_) => de___listOfManagedDataIdentifierSummary(_, context), `items`], - nextToken: [, __expectString, `nextToken`], + countsByGroup: [, (_) => de___listOfGroupCount(_, context), `countsByGroup`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListManagedDataIdentifiersCommandError + * deserializeAws_restJson1GetInvitationsCountCommand */ -const de_ListManagedDataIdentifiersCommandError = async ( +export const de_GetInvitationsCountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + invitationsCount: [, __expectLong, `invitationsCount`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListMembersCommand + * deserializeAws_restJson1GetMacieSessionCommand */ -export const de_ListMembersCommand = async ( +export const de_GetMacieSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - members: [, (_) => de___listOfMember(_, context), `members`], - nextToken: [, __expectString, `nextToken`], + createdAt: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `createdAt`], + findingPublishingFrequency: [, __expectString, `findingPublishingFrequency`], + serviceRole: [, __expectString, `serviceRole`], + status: [, __expectString, `status`], + updatedAt: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `updatedAt`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListMembersCommandError + * deserializeAws_restJson1GetMasterAccountCommand */ -const de_ListMembersCommandError = async ( +export const de_GetMasterAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + master: [, (_) => de_Invitation(_, context), `master`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListOrganizationAdminAccountsCommand + * deserializeAws_restJson1GetMemberCommand */ -export const de_ListOrganizationAdminAccountsCommand = async ( +export const de_GetMemberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOrganizationAdminAccountsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - adminAccounts: [, (_) => de___listOfAdminAccount(_, context), `adminAccounts`], - nextToken: [, __expectString, `nextToken`], + accountId: [, __expectString, `accountId`], + administratorAccountId: [, __expectString, `administratorAccountId`], + arn: [, __expectString, `arn`], + email: [, __expectString, `email`], + invitedAt: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `invitedAt`], + masterAccountId: [, __expectString, `masterAccountId`], + relationshipStatus: [, __expectString, `relationshipStatus`], + tags: [, _json, `tags`], + updatedAt: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `updatedAt`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListOrganizationAdminAccountsCommandError + * deserializeAws_restJson1GetResourceProfileCommand */ -const de_ListOrganizationAdminAccountsCommandError = async ( +export const de_GetResourceProfileCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + profileUpdatedAt: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `profileUpdatedAt`], + sensitivityScore: [, __expectInt32, `sensitivityScore`], + sensitivityScoreOverridden: [, __expectBoolean, `sensitivityScoreOverridden`], + statistics: [, (_) => de_ResourceStatistics(_, context), `statistics`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListResourceProfileArtifactsCommand + * deserializeAws_restJson1GetRevealConfigurationCommand */ -export const de_ListResourceProfileArtifactsCommand = async ( +export const de_GetRevealConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResourceProfileArtifactsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - artifacts: [, (_) => de___listOfResourceProfileArtifact(_, context), `artifacts`], - nextToken: [, __expectString, `nextToken`], + configuration: [, (_) => de_RevealConfiguration(_, context), `configuration`], + retrievalConfiguration: [, (_) => de_RetrievalConfiguration(_, context), `retrievalConfiguration`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListResourceProfileArtifactsCommandError + * deserializeAws_restJson1GetSensitiveDataOccurrencesCommand */ -const de_ListResourceProfileArtifactsCommandError = async ( +export const de_GetSensitiveDataOccurrencesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + error: [, __expectString, `error`], + sensitiveDataOccurrences: [, (_) => de_SensitiveDataOccurrences(_, context), `sensitiveDataOccurrences`], + status: [, __expectString, `status`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListResourceProfileDetectionsCommand + * deserializeAws_restJson1GetSensitiveDataOccurrencesAvailabilityCommand */ -export const de_ListResourceProfileDetectionsCommand = async ( +export const de_GetSensitiveDataOccurrencesAvailabilityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResourceProfileDetectionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - detections: [, (_) => de___listOfDetection(_, context), `detections`], - nextToken: [, __expectString, `nextToken`], + code: [, __expectString, `code`], + reasons: [, _json, `reasons`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListResourceProfileDetectionsCommandError + * deserializeAws_restJson1GetSensitivityInspectionTemplateCommand */ -const de_ListResourceProfileDetectionsCommandError = async ( +export const de_GetSensitivityInspectionTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + description: [, __expectString, `description`], + excludes: [, (_) => de_SensitivityInspectionTemplateExcludes(_, context), `excludes`], + includes: [, (_) => de_SensitivityInspectionTemplateIncludes(_, context), `includes`], + name: [, __expectString, `name`], + sensitivityInspectionTemplateId: [, __expectString, `sensitivityInspectionTemplateId`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListSensitivityInspectionTemplatesCommand + * deserializeAws_restJson1GetUsageStatisticsCommand */ -export const de_ListSensitivityInspectionTemplatesCommand = async ( +export const de_GetUsageStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSensitivityInspectionTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5881,237 +3084,183 @@ export const de_ListSensitivityInspectionTemplatesCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: [, __expectString, `nextToken`], - sensitivityInspectionTemplates: [ - , - (_) => de___listOfSensitivityInspectionTemplatesEntry(_, context), - `sensitivityInspectionTemplates`, - ], + records: [, (_) => de___listOfUsageRecord(_, context), `records`], + timeRange: [, __expectString, `timeRange`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSensitivityInspectionTemplatesCommandError + * deserializeAws_restJson1GetUsageTotalsCommand */ -const de_ListSensitivityInspectionTemplatesCommandError = async ( +export const de_GetUsageTotalsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + timeRange: [, __expectString, `timeRange`], + usageTotals: [, (_) => de___listOfUsageTotal(_, context), `usageTotals`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListAllowListsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListAllowListsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: [, _json, `tags`], + allowLists: [, (_) => de___listOfAllowListSummary(_, context), `allowLists`], + nextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListClassificationJobsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListClassificationJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: [, (_) => de___listOfJobSummary(_, context), `items`], + nextToken: [, __expectString, `nextToken`], }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutClassificationExportConfigurationCommand + * deserializeAws_restJson1ListClassificationScopesCommand */ -export const de_PutClassificationExportConfigurationCommand = async ( +export const de_ListClassificationScopesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutClassificationExportConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - configuration: [, (_) => de_ClassificationExportConfiguration(_, context), `configuration`], + classificationScopes: [, (_) => de___listOfClassificationScopeSummary(_, context), `classificationScopes`], + nextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutClassificationExportConfigurationCommandError + * deserializeAws_restJson1ListCustomDataIdentifiersCommand */ -const de_PutClassificationExportConfigurationCommandError = async ( +export const de_ListCustomDataIdentifiersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: [, (_) => de___listOfCustomDataIdentifierSummary(_, context), `items`], + nextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutFindingsPublicationConfigurationCommand + * deserializeAws_restJson1ListFindingsCommand */ -export const de_PutFindingsPublicationConfigurationCommand = async ( +export const de_ListFindingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutFindingsPublicationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + findingIds: [, _json, `findingIds`], + nextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutFindingsPublicationConfigurationCommandError + * deserializeAws_restJson1ListFindingsFiltersCommand */ -const de_PutFindingsPublicationConfigurationCommandError = async ( +export const de_ListFindingsFiltersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + findingsFilterListItems: [, (_) => de___listOfFindingsFilterListItem(_, context), `findingsFilterListItems`], + nextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SearchResourcesCommand + * deserializeAws_restJson1ListInvitationsCommand */ -export const de_SearchResourcesCommand = async ( +export const de_ListInvitationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - matchingResources: [, (_) => de___listOfMatchingResource(_, context), `matchingResources`], + invitations: [, (_) => de___listOfInvitation(_, context), `invitations`], nextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); @@ -6119,541 +3268,387 @@ export const de_SearchResourcesCommand = async ( }; /** - * deserializeAws_restJson1SearchResourcesCommandError + * deserializeAws_restJson1ListManagedDataIdentifiersCommand */ -const de_SearchResourcesCommandError = async ( +export const de_ListManagedDataIdentifiersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: [, (_) => de___listOfManagedDataIdentifierSummary(_, context), `items`], + nextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListMembersCommand */ -export const de_TagResourceCommand = async ( +export const de_ListMembersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + members: [, (_) => de___listOfMember(_, context), `members`], + nextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1ListOrganizationAdminAccountsCommand */ -const de_TagResourceCommandError = async ( +export const de_ListOrganizationAdminAccountsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + adminAccounts: [, (_) => de___listOfAdminAccount(_, context), `adminAccounts`], + nextToken: [, __expectString, `nextToken`], }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TestCustomDataIdentifierCommand + * deserializeAws_restJson1ListResourceProfileArtifactsCommand */ -export const de_TestCustomDataIdentifierCommand = async ( +export const de_ListResourceProfileArtifactsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TestCustomDataIdentifierCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - matchCount: [, __expectInt32, `matchCount`], + artifacts: [, (_) => de___listOfResourceProfileArtifact(_, context), `artifacts`], + nextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TestCustomDataIdentifierCommandError + * deserializeAws_restJson1ListResourceProfileDetectionsCommand */ -const de_TestCustomDataIdentifierCommandError = async ( +export const de_ListResourceProfileDetectionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + detections: [, (_) => de___listOfDetection(_, context), `detections`], + nextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1ListSensitivityInspectionTemplatesCommand */ -export const de_UntagResourceCommand = async ( +export const de_ListSensitivityInspectionTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: [, __expectString, `nextToken`], + sensitivityInspectionTemplates: [ + , + (_) => de___listOfSensitivityInspectionTemplatesEntry(_, context), + `sensitivityInspectionTemplates`, + ], + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: [, _json, `tags`], }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateAllowListCommand + * deserializeAws_restJson1PutClassificationExportConfigurationCommand */ -export const de_UpdateAllowListCommand = async ( +export const de_PutClassificationExportConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAllowListCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - arn: [, __expectString, `arn`], - id: [, __expectString, `id`], + configuration: [, (_) => de_ClassificationExportConfiguration(_, context), `configuration`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateAllowListCommandError + * deserializeAws_restJson1PutFindingsPublicationConfigurationCommand */ -const de_UpdateAllowListCommandError = async ( +export const de_PutFindingsPublicationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateAutomatedDiscoveryConfigurationCommand + * deserializeAws_restJson1SearchResourcesCommand */ -export const de_UpdateAutomatedDiscoveryConfigurationCommand = async ( +export const de_SearchResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAutomatedDiscoveryConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + matchingResources: [, (_) => de___listOfMatchingResource(_, context), `matchingResources`], + nextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateAutomatedDiscoveryConfigurationCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_UpdateAutomatedDiscoveryConfigurationCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateClassificationJobCommand + * deserializeAws_restJson1TestCustomDataIdentifierCommand */ -export const de_UpdateClassificationJobCommand = async ( +export const de_TestCustomDataIdentifierCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateClassificationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + matchCount: [, __expectInt32, `matchCount`], + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateClassificationJobCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UpdateClassificationJobCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateClassificationScopeCommand + * deserializeAws_restJson1UpdateAllowListCommand */ -export const de_UpdateClassificationScopeCommand = async ( +export const de_UpdateAllowListCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateClassificationScopeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + arn: [, __expectString, `arn`], + id: [, __expectString, `id`], + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateClassificationScopeCommandError + * deserializeAws_restJson1UpdateAutomatedDiscoveryConfigurationCommand */ -const de_UpdateClassificationScopeCommandError = async ( +export const de_UpdateAutomatedDiscoveryConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateFindingsFilterCommand + * deserializeAws_restJson1UpdateClassificationJobCommand */ -export const de_UpdateFindingsFilterCommand = async ( +export const de_UpdateClassificationJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFindingsFilterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - arn: [, __expectString, `arn`], - id: [, __expectString, `id`], - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1UpdateFindingsFilterCommandError + * deserializeAws_restJson1UpdateClassificationScopeCommand */ -const de_UpdateFindingsFilterCommandError = async ( +export const de_UpdateClassificationScopeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateMacieSessionCommand + * deserializeAws_restJson1UpdateFindingsFilterCommand */ -export const de_UpdateMacieSessionCommand = async ( +export const de_UpdateFindingsFilterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMacieSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + arn: [, __expectString, `arn`], + id: [, __expectString, `id`], + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateMacieSessionCommandError + * deserializeAws_restJson1UpdateMacieSessionCommand */ -const de_UpdateMacieSessionCommandError = async ( +export const de_UpdateMacieSessionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -6664,7 +3659,7 @@ export const de_UpdateMemberSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMemberSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6673,50 +3668,6 @@ export const de_UpdateMemberSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateMemberSessionCommandError - */ -const de_UpdateMemberSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateOrganizationConfigurationCommand */ @@ -6725,7 +3676,7 @@ export const de_UpdateOrganizationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateOrganizationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6734,50 +3685,6 @@ export const de_UpdateOrganizationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateOrganizationConfigurationCommandError - */ -const de_UpdateOrganizationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.macie2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateResourceProfileCommand */ @@ -6786,7 +3693,7 @@ export const de_UpdateResourceProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateResourceProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6795,47 +3702,6 @@ export const de_UpdateResourceProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateResourceProfileCommandError - */ -const de_UpdateResourceProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateResourceProfileDetectionsCommand */ @@ -6844,7 +3710,7 @@ export const de_UpdateResourceProfileDetectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateResourceProfileDetectionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6853,47 +3719,6 @@ export const de_UpdateResourceProfileDetectionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateResourceProfileDetectionsCommandError - */ -const de_UpdateResourceProfileDetectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.macie2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.macie2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRevealConfigurationCommand */ @@ -6902,7 +3727,7 @@ export const de_UpdateRevealConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRevealConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6916,41 +3741,6 @@ export const de_UpdateRevealConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRevealConfigurationCommandError - */ -const de_UpdateRevealConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.macie2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.macie2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.macie2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.macie2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSensitivityInspectionTemplateCommand */ @@ -6959,7 +3749,7 @@ export const de_UpdateSensitivityInspectionTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSensitivityInspectionTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6969,12 +3759,9 @@ export const de_UpdateSensitivityInspectionTemplateCommand = async ( }; /** - * deserializeAws_restJson1UpdateSensitivityInspectionTemplateCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateSensitivityInspectionTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -6984,25 +3771,34 @@ const de_UpdateSensitivityInspectionTemplateCommandError = async ( case "AccessDeniedException": case "com.amazonaws.macie2#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.macie2#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.macie2#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.macie2#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.macie2#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.macie2#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.macie2#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "UnprocessableEntityException": + case "com.amazonaws.macie2#UnprocessableEntityException": + throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-managedblockchain-query/src/protocols/Aws_restJson1.ts b/clients/client-managedblockchain-query/src/protocols/Aws_restJson1.ts index 6288ad593071..64e6f5bd3913 100644 --- a/clients/client-managedblockchain-query/src/protocols/Aws_restJson1.ts +++ b/clients/client-managedblockchain-query/src/protocols/Aws_restJson1.ts @@ -265,7 +265,7 @@ export const de_BatchGetTokenBalanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetTokenBalanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -279,47 +279,6 @@ export const de_BatchGetTokenBalanceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetTokenBalanceCommandError - */ -const de_BatchGetTokenBalanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchainquery#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.managedblockchainquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchainquery#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.managedblockchainquery#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchainquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.managedblockchainquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAssetContractCommand */ @@ -328,7 +287,7 @@ export const de_GetAssetContractCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssetContractCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -344,47 +303,6 @@ export const de_GetAssetContractCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAssetContractCommandError - */ -const de_GetAssetContractCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchainquery#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.managedblockchainquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchainquery#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.managedblockchainquery#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchainquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.managedblockchainquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTokenBalanceCommand */ @@ -393,7 +311,7 @@ export const de_GetTokenBalanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTokenBalanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -410,47 +328,6 @@ export const de_GetTokenBalanceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTokenBalanceCommandError - */ -const de_GetTokenBalanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchainquery#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.managedblockchainquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchainquery#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.managedblockchainquery#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchainquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.managedblockchainquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTransactionCommand */ @@ -459,7 +336,7 @@ export const de_GetTransactionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTransactionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -472,47 +349,6 @@ export const de_GetTransactionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTransactionCommandError - */ -const de_GetTransactionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchainquery#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.managedblockchainquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchainquery#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.managedblockchainquery#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchainquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.managedblockchainquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssetContractsCommand */ @@ -521,7 +357,7 @@ export const de_ListAssetContractsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssetContractsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -535,44 +371,6 @@ export const de_ListAssetContractsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssetContractsCommandError - */ -const de_ListAssetContractsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchainquery#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.managedblockchainquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.managedblockchainquery#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchainquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.managedblockchainquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTokenBalancesCommand */ @@ -581,7 +379,7 @@ export const de_ListTokenBalancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTokenBalancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -595,44 +393,6 @@ export const de_ListTokenBalancesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTokenBalancesCommandError - */ -const de_ListTokenBalancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchainquery#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.managedblockchainquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.managedblockchainquery#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchainquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.managedblockchainquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTransactionEventsCommand */ @@ -641,7 +401,7 @@ export const de_ListTransactionEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTransactionEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -655,44 +415,6 @@ export const de_ListTransactionEventsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTransactionEventsCommandError - */ -const de_ListTransactionEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchainquery#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.managedblockchainquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.managedblockchainquery#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchainquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.managedblockchainquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTransactionsCommand */ @@ -701,7 +423,7 @@ export const de_ListTransactionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTransactionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -716,12 +438,9 @@ export const de_ListTransactionsCommand = async ( }; /** - * deserializeAws_restJson1ListTransactionsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_ListTransactionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -734,6 +453,9 @@ const de_ListTransactionsCommandError = async ( case "InternalServerException": case "com.amazonaws.managedblockchainquery#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.managedblockchainquery#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ServiceQuotaExceededException": case "com.amazonaws.managedblockchainquery#ServiceQuotaExceededException": throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); @@ -749,7 +471,7 @@ const de_ListTransactionsCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts b/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts index 40cae4ee6d9d..3202fd39e47d 100644 --- a/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts +++ b/clients/client-managedblockchain/src/protocols/Aws_restJson1.ts @@ -674,7 +674,7 @@ export const de_CreateAccessorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAccessorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -689,50 +689,6 @@ export const de_CreateAccessorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAccessorCommandError - */ -const de_CreateAccessorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.managedblockchain#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.managedblockchain#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.managedblockchain#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMemberCommand */ @@ -741,7 +697,7 @@ export const de_CreateMemberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMemberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -754,56 +710,6 @@ export const de_CreateMemberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMemberCommandError - */ -const de_CreateMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.managedblockchain#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.managedblockchain#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.managedblockchain#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.managedblockchain#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateNetworkCommand */ @@ -812,7 +718,7 @@ export const de_CreateNetworkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -826,50 +732,6 @@ export const de_CreateNetworkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateNetworkCommandError - */ -const de_CreateNetworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.managedblockchain#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.managedblockchain#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.managedblockchain#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateNodeCommand */ @@ -878,7 +740,7 @@ export const de_CreateNodeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateNodeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -891,56 +753,6 @@ export const de_CreateNodeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateNodeCommandError - */ -const de_CreateNodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.managedblockchain#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.managedblockchain#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.managedblockchain#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.managedblockchain#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProposalCommand */ @@ -949,7 +761,7 @@ export const de_CreateProposalCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateProposalCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -962,50 +774,6 @@ export const de_CreateProposalCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProposalCommandError - */ -const de_CreateProposalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.managedblockchain#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.managedblockchain#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAccessorCommand */ @@ -1014,7 +782,7 @@ export const de_DeleteAccessorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAccessorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1023,44 +791,6 @@ export const de_DeleteAccessorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAccessorCommandError - */ -const de_DeleteAccessorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteMemberCommand */ @@ -1069,7 +799,7 @@ export const de_DeleteMemberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMemberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1079,759 +809,224 @@ export const de_DeleteMemberCommand = async ( }; /** - * deserializeAws_restJson1DeleteMemberCommandError + * deserializeAws_restJson1DeleteNodeCommand */ -const de_DeleteMemberCommandError = async ( +export const de_DeleteNodeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.managedblockchain#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteNodeCommand - */ -export const de_DeleteNodeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteNodeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteNodeCommandError - */ -const de_DeleteNodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.managedblockchain#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAccessorCommand - */ -export const de_GetAccessorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccessorCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Accessor: (_) => de_Accessor(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAccessorCommandError - */ -const de_GetAccessorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMemberCommand - */ -export const de_GetMemberCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMemberCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Member: (_) => de_Member(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMemberCommandError - */ -const de_GetMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetNetworkCommand - */ -export const de_GetNetworkCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetNetworkCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Network: (_) => de_Network(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetNetworkCommandError - */ -const de_GetNetworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetNodeCommand - */ -export const de_GetNodeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetNodeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Node: (_) => de_Node(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetNodeCommandError - */ -const de_GetNodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetProposalCommand - */ -export const de_GetProposalCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProposalCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Proposal: (_) => de_Proposal(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetProposalCommandError - */ -const de_GetProposalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAccessorsCommand - */ -export const de_ListAccessorsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccessorsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Accessors: (_) => de_AccessorSummaryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAccessorsCommandError - */ -const de_ListAccessorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListInvitationsCommand - */ -export const de_ListInvitationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInvitationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Invitations: (_) => de_InvitationList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListInvitationsCommandError - */ -const de_ListInvitationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.managedblockchain#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListMembersCommand + * deserializeAws_restJson1GetAccessorCommand */ -export const de_ListMembersCommand = async ( +export const de_GetAccessorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Members: (_) => de_MemberSummaryList(_, context), - NextToken: __expectString, + Accessor: (_) => de_Accessor(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListMembersCommandError + * deserializeAws_restJson1GetMemberCommand */ -const de_ListMembersCommandError = async ( +export const de_GetMemberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Member: (_) => de_Member(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListNetworksCommand + * deserializeAws_restJson1GetNetworkCommand */ -export const de_ListNetworksCommand = async ( +export const de_GetNetworkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNetworksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Networks: (_) => de_NetworkSummaryList(_, context), - NextToken: __expectString, + Network: (_) => de_Network(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetNodeCommand + */ +export const de_GetNodeCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Node: (_) => de_Node(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListNetworksCommandError + * deserializeAws_restJson1GetProposalCommand */ -const de_ListNetworksCommandError = async ( +export const de_GetProposalCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Proposal: (_) => de_Proposal(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListNodesCommand + * deserializeAws_restJson1ListAccessorsCommand */ -export const de_ListNodesCommand = async ( +export const de_ListAccessorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNodesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + Accessors: (_) => de_AccessorSummaryList(_, context), NextToken: __expectString, - Nodes: (_) => de_NodeSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListNodesCommandError + * deserializeAws_restJson1ListInvitationsCommand */ -const de_ListNodesCommandError = async ( +export const de_ListInvitationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Invitations: (_) => de_InvitationList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListProposalsCommand + * deserializeAws_restJson1ListMembersCommand */ -export const de_ListProposalsCommand = async ( +export const de_ListMembersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProposalsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + Members: (_) => de_MemberSummaryList(_, context), NextToken: __expectString, - Proposals: (_) => de_ProposalSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListProposalsCommandError + * deserializeAws_restJson1ListNetworksCommand */ -const de_ListProposalsCommandError = async ( +export const de_ListNetworksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Networks: (_) => de_NetworkSummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListProposalVotesCommand + * deserializeAws_restJson1ListNodesCommand */ -export const de_ListProposalVotesCommand = async ( +export const de_ListNodesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProposalVotesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1839,101 +1034,75 @@ export const de_ListProposalVotesCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { NextToken: __expectString, - ProposalVotes: _json, + Nodes: (_) => de_NodeSummaryList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListProposalVotesCommandError + * deserializeAws_restJson1ListProposalsCommand */ -const de_ListProposalVotesCommandError = async ( +export const de_ListProposalsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Proposals: (_) => de_ProposalSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListProposalVotesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListProposalVotesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: _json, + NextToken: __expectString, + ProposalVotes: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.managedblockchain#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1944,7 +1113,7 @@ export const de_RejectInvitationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RejectInvitationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1953,47 +1122,6 @@ export const de_RejectInvitationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RejectInvitationCommandError - */ -const de_RejectInvitationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalActionException": - case "com.amazonaws.managedblockchain#IllegalActionException": - throw await de_IllegalActionExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2002,7 +1130,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2011,44 +1139,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.managedblockchain#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.managedblockchain#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2057,7 +1147,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2066,41 +1156,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.managedblockchain#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMemberCommand */ @@ -2109,7 +1164,7 @@ export const de_UpdateMemberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMemberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2118,44 +1173,6 @@ export const de_UpdateMemberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateMemberCommandError - */ -const de_UpdateMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateNodeCommand */ @@ -2164,7 +1181,7 @@ export const de_UpdateNodeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateNodeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2173,44 +1190,6 @@ export const de_UpdateNodeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateNodeCommandError - */ -const de_UpdateNodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.managedblockchain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.managedblockchain#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.managedblockchain#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.managedblockchain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1VoteOnProposalCommand */ @@ -2219,7 +1198,7 @@ export const de_VoteOnProposalCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_VoteOnProposalCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2229,12 +1208,9 @@ export const de_VoteOnProposalCommand = async ( }; /** - * deserializeAws_restJson1VoteOnProposalCommandError + * deserialize_Aws_restJson1CommandError */ -const de_VoteOnProposalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2244,28 +1220,40 @@ const de_VoteOnProposalCommandError = async ( case "AccessDeniedException": case "com.amazonaws.managedblockchain#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalActionException": - case "com.amazonaws.managedblockchain#IllegalActionException": - throw await de_IllegalActionExceptionRes(parsedOutput, context); case "InternalServiceErrorException": case "com.amazonaws.managedblockchain#InternalServiceErrorException": throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); case "InvalidRequestException": case "com.amazonaws.managedblockchain#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.managedblockchain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.managedblockchain#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "ResourceLimitExceededException": + case "com.amazonaws.managedblockchain#ResourceLimitExceededException": + throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.managedblockchain#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.managedblockchain#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.managedblockchain#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ResourceNotReadyException": + case "com.amazonaws.managedblockchain#ResourceNotReadyException": + throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); + case "IllegalActionException": + case "com.amazonaws.managedblockchain#IllegalActionException": + throw await de_IllegalActionExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-marketplace-agreement/src/protocols/Aws_json1_0.ts b/clients/client-marketplace-agreement/src/protocols/Aws_json1_0.ts index 3c96319f6063..3e7857bd86ca 100644 --- a/clients/client-marketplace-agreement/src/protocols/Aws_json1_0.ts +++ b/clients/client-marketplace-agreement/src/protocols/Aws_json1_0.ts @@ -91,7 +91,7 @@ export const de_DescribeAgreementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAgreementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -103,44 +103,6 @@ export const de_DescribeAgreementCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeAgreementCommandError - */ -const de_DescribeAgreementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplaceagreement#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.marketplaceagreement#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplaceagreement#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplaceagreement#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplaceagreement#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetAgreementTermsCommand */ @@ -149,7 +111,7 @@ export const de_GetAgreementTermsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAgreementTermsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -161,44 +123,6 @@ export const de_GetAgreementTermsCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetAgreementTermsCommandError - */ -const de_GetAgreementTermsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplaceagreement#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.marketplaceagreement#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplaceagreement#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplaceagreement#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplaceagreement#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0SearchAgreementsCommand */ @@ -207,7 +131,7 @@ export const de_SearchAgreementsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchAgreementsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -220,12 +144,9 @@ export const de_SearchAgreementsCommand = async ( }; /** - * deserializeAws_json1_0SearchAgreementsCommandError + * deserialize_Aws_json1_0CommandError */ -const de_SearchAgreementsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -238,6 +159,9 @@ const de_SearchAgreementsCommandError = async ( case "InternalServerException": case "com.amazonaws.marketplaceagreement#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.marketplaceagreement#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.marketplaceagreement#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -250,7 +174,7 @@ const de_SearchAgreementsCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts b/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts index 5644a74a3d42..774c4867e797 100644 --- a/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts +++ b/clients/client-marketplace-catalog/src/protocols/Aws_restJson1.ts @@ -428,7 +428,7 @@ export const de_BatchDescribeEntitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDescribeEntitiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -442,41 +442,6 @@ export const de_BatchDescribeEntitiesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDescribeEntitiesCommandError - */ -const de_BatchDescribeEntitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplacecatalog#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.marketplacecatalog#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacecatalog#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplacecatalog#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelChangeSetCommand */ @@ -485,7 +450,7 @@ export const de_CancelChangeSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelChangeSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -499,47 +464,6 @@ export const de_CancelChangeSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelChangeSetCommandError - */ -const de_CancelChangeSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplacecatalog#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.marketplacecatalog#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.marketplacecatalog#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplacecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacecatalog#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplacecatalog#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteResourcePolicyCommand */ @@ -548,7 +472,7 @@ export const de_DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -557,44 +481,6 @@ export const de_DeleteResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplacecatalog#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.marketplacecatalog#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplacecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacecatalog#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplacecatalog#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeChangeSetCommand */ @@ -603,7 +489,7 @@ export const de_DescribeChangeSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChangeSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -624,44 +510,6 @@ export const de_DescribeChangeSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeChangeSetCommandError - */ -const de_DescribeChangeSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplacecatalog#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.marketplacecatalog#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplacecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacecatalog#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplacecatalog#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeEntityCommand */ @@ -670,7 +518,7 @@ export const de_DescribeEntityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeEntityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -688,47 +536,6 @@ export const de_DescribeEntityCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeEntityCommandError - */ -const de_DescribeEntityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplacecatalog#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.marketplacecatalog#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplacecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotSupportedException": - case "com.amazonaws.marketplacecatalog#ResourceNotSupportedException": - throw await de_ResourceNotSupportedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacecatalog#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplacecatalog#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetResourcePolicyCommand */ @@ -737,7 +544,7 @@ export const de_GetResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -750,44 +557,6 @@ export const de_GetResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetResourcePolicyCommandError - */ -const de_GetResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplacecatalog#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.marketplacecatalog#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplacecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacecatalog#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplacecatalog#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListChangeSetsCommand */ @@ -796,7 +565,7 @@ export const de_ListChangeSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChangeSetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -810,41 +579,6 @@ export const de_ListChangeSetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListChangeSetsCommandError - */ -const de_ListChangeSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplacecatalog#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.marketplacecatalog#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacecatalog#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplacecatalog#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEntitiesCommand */ @@ -853,7 +587,7 @@ export const de_ListEntitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEntitiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -867,44 +601,6 @@ export const de_ListEntitiesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEntitiesCommandError - */ -const de_ListEntitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplacecatalog#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.marketplacecatalog#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplacecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacecatalog#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplacecatalog#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -913,7 +609,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -927,44 +623,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplacecatalog#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.marketplacecatalog#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplacecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacecatalog#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplacecatalog#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutResourcePolicyCommand */ @@ -973,7 +631,7 @@ export const de_PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -982,44 +640,6 @@ export const de_PutResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplacecatalog#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.marketplacecatalog#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplacecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacecatalog#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplacecatalog#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartChangeSetCommand */ @@ -1028,7 +648,7 @@ export const de_StartChangeSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartChangeSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1042,50 +662,6 @@ export const de_StartChangeSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartChangeSetCommandError - */ -const de_StartChangeSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplacecatalog#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.marketplacecatalog#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.marketplacecatalog#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplacecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.marketplacecatalog#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacecatalog#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplacecatalog#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1094,7 +670,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1103,44 +679,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplacecatalog#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.marketplacecatalog#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplacecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacecatalog#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplacecatalog#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1149,7 +687,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1159,12 +697,9 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1177,22 +712,31 @@ const de_UntagResourceCommandError = async ( case "InternalServiceException": case "com.amazonaws.marketplacecatalog#InternalServiceException": throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplacecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.marketplacecatalog#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.marketplacecatalog#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.marketplacecatalog#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.marketplacecatalog#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ResourceNotSupportedException": + case "com.amazonaws.marketplacecatalog#ResourceNotSupportedException": + throw await de_ResourceNotSupportedExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.marketplacecatalog#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts b/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts index 00bd90e00dc9..ad8dc2610c31 100644 --- a/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-commerce-analytics/src/protocols/Aws_json1_1.ts @@ -60,7 +60,7 @@ export const de_GenerateDataSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GenerateDataSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -72,32 +72,6 @@ export const de_GenerateDataSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1GenerateDataSetCommandError - */ -const de_GenerateDataSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "MarketplaceCommerceAnalyticsException": - case "com.amazonaws.marketplacecommerceanalytics#MarketplaceCommerceAnalyticsException": - throw await de_MarketplaceCommerceAnalyticsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartSupportDataExportCommand */ @@ -106,7 +80,7 @@ export const de_StartSupportDataExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartSupportDataExportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -119,12 +93,9 @@ export const de_StartSupportDataExportCommand = async ( }; /** - * deserializeAws_json1_1StartSupportDataExportCommandError + * deserialize_Aws_json1_1CommandError */ -const de_StartSupportDataExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -140,7 +111,7 @@ const de_StartSupportDataExportCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-marketplace-deployment/src/protocols/Aws_restJson1.ts b/clients/client-marketplace-deployment/src/protocols/Aws_restJson1.ts index 242074ea8061..0f0338bd3eb8 100644 --- a/clients/client-marketplace-deployment/src/protocols/Aws_restJson1.ts +++ b/clients/client-marketplace-deployment/src/protocols/Aws_restJson1.ts @@ -140,7 +140,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -153,44 +153,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplacedeployment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.marketplacedeployment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplacedeployment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacedeployment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplacedeployment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutDeploymentParameterCommand */ @@ -199,7 +161,7 @@ export const de_PutDeploymentParameterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutDeploymentParameterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -215,50 +177,6 @@ export const de_PutDeploymentParameterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutDeploymentParameterCommandError - */ -const de_PutDeploymentParameterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplacedeployment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.marketplacedeployment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.marketplacedeployment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplacedeployment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.marketplacedeployment#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacedeployment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplacedeployment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -267,7 +185,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -276,47 +194,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.marketplacedeployment#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.marketplacedeployment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.marketplacedeployment#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.marketplacedeployment#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacedeployment#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.marketplacedeployment#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -325,7 +202,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -335,12 +212,9 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -350,9 +224,6 @@ const de_UntagResourceCommandError = async ( case "AccessDeniedException": case "com.amazonaws.marketplacedeployment#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.marketplacedeployment#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.marketplacedeployment#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); @@ -365,13 +236,19 @@ const de_UntagResourceCommandError = async ( case "ValidationException": case "com.amazonaws.marketplacedeployment#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.marketplacedeployment#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.marketplacedeployment#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts b/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts index ad31849f9fdd..aef63e168359 100644 --- a/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-entitlement-service/src/protocols/Aws_json1_1.ts @@ -55,7 +55,7 @@ export const de_GetEntitlementsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetEntitlementsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -68,12 +68,9 @@ export const de_GetEntitlementsCommand = async ( }; /** - * deserializeAws_json1_1GetEntitlementsCommandError + * deserialize_Aws_json1_1CommandError */ -const de_GetEntitlementsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -95,7 +92,7 @@ const de_GetEntitlementsCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts b/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts index e7bbb4e71a2b..4bf65ccad215 100644 --- a/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-metering/src/protocols/Aws_json1_1.ts @@ -114,7 +114,7 @@ export const de_BatchMeterUsageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchMeterUsageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -126,56 +126,6 @@ export const de_BatchMeterUsageCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchMeterUsageCommandError - */ -const de_BatchMeterUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledApiException": - case "com.amazonaws.marketplacemetering#DisabledApiException": - throw await de_DisabledApiExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.marketplacemetering#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidCustomerIdentifierException": - case "com.amazonaws.marketplacemetering#InvalidCustomerIdentifierException": - throw await de_InvalidCustomerIdentifierExceptionRes(parsedOutput, context); - case "InvalidProductCodeException": - case "com.amazonaws.marketplacemetering#InvalidProductCodeException": - throw await de_InvalidProductCodeExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.marketplacemetering#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); - case "InvalidUsageAllocationsException": - case "com.amazonaws.marketplacemetering#InvalidUsageAllocationsException": - throw await de_InvalidUsageAllocationsExceptionRes(parsedOutput, context); - case "InvalidUsageDimensionException": - case "com.amazonaws.marketplacemetering#InvalidUsageDimensionException": - throw await de_InvalidUsageDimensionExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacemetering#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TimestampOutOfBoundsException": - case "com.amazonaws.marketplacemetering#TimestampOutOfBoundsException": - throw await de_TimestampOutOfBoundsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1MeterUsageCommand */ @@ -184,7 +134,7 @@ export const de_MeterUsageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_MeterUsageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -196,59 +146,6 @@ export const de_MeterUsageCommand = async ( return response; }; -/** - * deserializeAws_json1_1MeterUsageCommandError - */ -const de_MeterUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomerNotEntitledException": - case "com.amazonaws.marketplacemetering#CustomerNotEntitledException": - throw await de_CustomerNotEntitledExceptionRes(parsedOutput, context); - case "DuplicateRequestException": - case "com.amazonaws.marketplacemetering#DuplicateRequestException": - throw await de_DuplicateRequestExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.marketplacemetering#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidEndpointRegionException": - case "com.amazonaws.marketplacemetering#InvalidEndpointRegionException": - throw await de_InvalidEndpointRegionExceptionRes(parsedOutput, context); - case "InvalidProductCodeException": - case "com.amazonaws.marketplacemetering#InvalidProductCodeException": - throw await de_InvalidProductCodeExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.marketplacemetering#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); - case "InvalidUsageAllocationsException": - case "com.amazonaws.marketplacemetering#InvalidUsageAllocationsException": - throw await de_InvalidUsageAllocationsExceptionRes(parsedOutput, context); - case "InvalidUsageDimensionException": - case "com.amazonaws.marketplacemetering#InvalidUsageDimensionException": - throw await de_InvalidUsageDimensionExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacemetering#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TimestampOutOfBoundsException": - case "com.amazonaws.marketplacemetering#TimestampOutOfBoundsException": - throw await de_TimestampOutOfBoundsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RegisterUsageCommand */ @@ -257,7 +154,7 @@ export const de_RegisterUsageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterUsageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -269,53 +166,6 @@ export const de_RegisterUsageCommand = async ( return response; }; -/** - * deserializeAws_json1_1RegisterUsageCommandError - */ -const de_RegisterUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomerNotEntitledException": - case "com.amazonaws.marketplacemetering#CustomerNotEntitledException": - throw await de_CustomerNotEntitledExceptionRes(parsedOutput, context); - case "DisabledApiException": - case "com.amazonaws.marketplacemetering#DisabledApiException": - throw await de_DisabledApiExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.marketplacemetering#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidProductCodeException": - case "com.amazonaws.marketplacemetering#InvalidProductCodeException": - throw await de_InvalidProductCodeExceptionRes(parsedOutput, context); - case "InvalidPublicKeyVersionException": - case "com.amazonaws.marketplacemetering#InvalidPublicKeyVersionException": - throw await de_InvalidPublicKeyVersionExceptionRes(parsedOutput, context); - case "InvalidRegionException": - case "com.amazonaws.marketplacemetering#InvalidRegionException": - throw await de_InvalidRegionExceptionRes(parsedOutput, context); - case "PlatformNotSupportedException": - case "com.amazonaws.marketplacemetering#PlatformNotSupportedException": - throw await de_PlatformNotSupportedExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.marketplacemetering#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ResolveCustomerCommand */ @@ -324,7 +174,7 @@ export const de_ResolveCustomerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResolveCustomerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -337,12 +187,9 @@ export const de_ResolveCustomerCommand = async ( }; /** - * deserializeAws_json1_1ResolveCustomerCommandError + * deserialize_Aws_json1_1CommandError */ -const de_ResolveCustomerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -352,25 +199,61 @@ const de_ResolveCustomerCommandError = async ( case "DisabledApiException": case "com.amazonaws.marketplacemetering#DisabledApiException": throw await de_DisabledApiExceptionRes(parsedOutput, context); - case "ExpiredTokenException": - case "com.amazonaws.marketplacemetering#ExpiredTokenException": - throw await de_ExpiredTokenExceptionRes(parsedOutput, context); case "InternalServiceErrorException": case "com.amazonaws.marketplacemetering#InternalServiceErrorException": throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidTokenException": - case "com.amazonaws.marketplacemetering#InvalidTokenException": - throw await de_InvalidTokenExceptionRes(parsedOutput, context); + case "InvalidCustomerIdentifierException": + case "com.amazonaws.marketplacemetering#InvalidCustomerIdentifierException": + throw await de_InvalidCustomerIdentifierExceptionRes(parsedOutput, context); + case "InvalidProductCodeException": + case "com.amazonaws.marketplacemetering#InvalidProductCodeException": + throw await de_InvalidProductCodeExceptionRes(parsedOutput, context); + case "InvalidTagException": + case "com.amazonaws.marketplacemetering#InvalidTagException": + throw await de_InvalidTagExceptionRes(parsedOutput, context); + case "InvalidUsageAllocationsException": + case "com.amazonaws.marketplacemetering#InvalidUsageAllocationsException": + throw await de_InvalidUsageAllocationsExceptionRes(parsedOutput, context); + case "InvalidUsageDimensionException": + case "com.amazonaws.marketplacemetering#InvalidUsageDimensionException": + throw await de_InvalidUsageDimensionExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.marketplacemetering#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "TimestampOutOfBoundsException": + case "com.amazonaws.marketplacemetering#TimestampOutOfBoundsException": + throw await de_TimestampOutOfBoundsExceptionRes(parsedOutput, context); + case "CustomerNotEntitledException": + case "com.amazonaws.marketplacemetering#CustomerNotEntitledException": + throw await de_CustomerNotEntitledExceptionRes(parsedOutput, context); + case "DuplicateRequestException": + case "com.amazonaws.marketplacemetering#DuplicateRequestException": + throw await de_DuplicateRequestExceptionRes(parsedOutput, context); + case "InvalidEndpointRegionException": + case "com.amazonaws.marketplacemetering#InvalidEndpointRegionException": + throw await de_InvalidEndpointRegionExceptionRes(parsedOutput, context); + case "InvalidPublicKeyVersionException": + case "com.amazonaws.marketplacemetering#InvalidPublicKeyVersionException": + throw await de_InvalidPublicKeyVersionExceptionRes(parsedOutput, context); + case "InvalidRegionException": + case "com.amazonaws.marketplacemetering#InvalidRegionException": + throw await de_InvalidRegionExceptionRes(parsedOutput, context); + case "PlatformNotSupportedException": + case "com.amazonaws.marketplacemetering#PlatformNotSupportedException": + throw await de_PlatformNotSupportedExceptionRes(parsedOutput, context); + case "ExpiredTokenException": + case "com.amazonaws.marketplacemetering#ExpiredTokenException": + throw await de_ExpiredTokenExceptionRes(parsedOutput, context); + case "InvalidTokenException": + case "com.amazonaws.marketplacemetering#InvalidTokenException": + throw await de_InvalidTokenExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts b/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts index edca09a11c45..29caaf0a28a5 100644 --- a/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediaconnect/src/protocols/Aws_restJson1.ts @@ -1302,7 +1302,7 @@ export const de_AddBridgeOutputsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_AddBridgeOutputsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1316,50 +1316,6 @@ export const de_AddBridgeOutputsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddBridgeOutputsCommandError - */ -const de_AddBridgeOutputsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AddBridgeSourcesCommand */ @@ -1368,7 +1324,7 @@ export const de_AddBridgeSourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_AddBridgeSourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1382,50 +1338,6 @@ export const de_AddBridgeSourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddBridgeSourcesCommandError - */ -const de_AddBridgeSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AddFlowMediaStreamsCommand */ @@ -1434,7 +1346,7 @@ export const de_AddFlowMediaStreamsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_AddFlowMediaStreamsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1448,47 +1360,6 @@ export const de_AddFlowMediaStreamsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddFlowMediaStreamsCommandError - */ -const de_AddFlowMediaStreamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AddFlowOutputsCommand */ @@ -1497,7 +1368,7 @@ export const de_AddFlowOutputsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_AddFlowOutputsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1511,50 +1382,6 @@ export const de_AddFlowOutputsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddFlowOutputsCommandError - */ -const de_AddFlowOutputsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AddFlowOutputs420Exception": - case "com.amazonaws.mediaconnect#AddFlowOutputs420Exception": - throw await de_AddFlowOutputs420ExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AddFlowSourcesCommand */ @@ -1563,7 +1390,7 @@ export const de_AddFlowSourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_AddFlowSourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1577,47 +1404,6 @@ export const de_AddFlowSourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddFlowSourcesCommandError - */ -const de_AddFlowSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AddFlowVpcInterfacesCommand */ @@ -1626,7 +1412,7 @@ export const de_AddFlowVpcInterfacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_AddFlowVpcInterfacesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1641,182 +1427,56 @@ export const de_AddFlowVpcInterfacesCommand = async ( }; /** - * deserializeAws_restJson1AddFlowVpcInterfacesCommandError + * deserializeAws_restJson1CreateBridgeCommand */ -const de_AddFlowVpcInterfacesCommandError = async ( +export const de_CreateBridgeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Bridge: [, (_) => de_Bridge(_, context), `bridge`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateBridgeCommand + * deserializeAws_restJson1CreateFlowCommand */ -export const de_CreateBridgeCommand = async ( +export const de_CreateFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateBridgeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Bridge: [, (_) => de_Bridge(_, context), `bridge`], + Flow: [, (_) => de_Flow(_, context), `flow`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateBridgeCommandError + * deserializeAws_restJson1CreateGatewayCommand */ -const de_CreateBridgeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "CreateBridge420Exception": - case "com.amazonaws.mediaconnect#CreateBridge420Exception": - throw await de_CreateBridge420ExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateFlowCommand - */ -export const de_CreateFlowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateFlowCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Flow: [, (_) => de_Flow(_, context), `flow`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateFlowCommandError - */ -const de_CreateFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "CreateFlow420Exception": - case "com.amazonaws.mediaconnect#CreateFlow420Exception": - throw await de_CreateFlow420ExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateGatewayCommand - */ -export const de_CreateGatewayCommand = async ( +export const de_CreateGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateGatewayCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1829,50 +1489,6 @@ export const de_CreateGatewayCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGatewayCommandError - */ -const de_CreateGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "CreateGateway420Exception": - case "com.amazonaws.mediaconnect#CreateGateway420Exception": - throw await de_CreateGateway420ExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBridgeCommand */ @@ -1881,7 +1497,7 @@ export const de_DeleteBridgeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBridgeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1894,50 +1510,6 @@ export const de_DeleteBridgeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteBridgeCommandError - */ -const de_DeleteBridgeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteFlowCommand */ @@ -1946,1552 +1518,485 @@ export const de_DeleteFlowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteFlowCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - FlowArn: [, __expectString, `flowArn`], - Status: [, __expectString, `status`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteFlowCommandError - */ -const de_DeleteFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteGatewayCommand - */ -export const de_DeleteGatewayCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGatewayCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - GatewayArn: [, __expectString, `gatewayArn`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteGatewayCommandError - */ -const de_DeleteGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeregisterGatewayInstanceCommand - */ -export const de_DeregisterGatewayInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeregisterGatewayInstanceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - GatewayInstanceArn: [, __expectString, `gatewayInstanceArn`], - InstanceState: [, __expectString, `instanceState`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeregisterGatewayInstanceCommandError - */ -const de_DeregisterGatewayInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeBridgeCommand - */ -export const de_DescribeBridgeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBridgeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Bridge: [, (_) => de_Bridge(_, context), `bridge`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeBridgeCommandError - */ -const de_DescribeBridgeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeFlowCommand - */ -export const de_DescribeFlowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFlowCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Flow: [, (_) => de_Flow(_, context), `flow`], - Messages: [, (_) => de_Messages(_, context), `messages`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeFlowCommandError - */ -const de_DescribeFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeFlowSourceMetadataCommand - */ -export const de_DescribeFlowSourceMetadataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFlowSourceMetadataCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - FlowArn: [, __expectString, `flowArn`], - Messages: [, (_) => de___listOfMessageDetail(_, context), `messages`], - Timestamp: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `timestamp`], - TransportMediaInfo: [, (_) => de_TransportMediaInfo(_, context), `transportMediaInfo`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeFlowSourceMetadataCommandError - */ -const de_DescribeFlowSourceMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeGatewayCommand - */ -export const de_DescribeGatewayCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeGatewayCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Gateway: [, (_) => de_Gateway(_, context), `gateway`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeGatewayCommandError - */ -const de_DescribeGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeGatewayInstanceCommand - */ -export const de_DescribeGatewayInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeGatewayInstanceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - GatewayInstance: [, (_) => de_GatewayInstance(_, context), `gatewayInstance`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeGatewayInstanceCommandError - */ -const de_DescribeGatewayInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeOfferingCommand - */ -export const de_DescribeOfferingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeOfferingCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Offering: [, (_) => de_Offering(_, context), `offering`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeOfferingCommandError - */ -const de_DescribeOfferingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeReservationCommand - */ -export const de_DescribeReservationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeReservationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Reservation: [, (_) => de_Reservation(_, context), `reservation`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeReservationCommandError - */ -const de_DescribeReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GrantFlowEntitlementsCommand - */ -export const de_GrantFlowEntitlementsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GrantFlowEntitlementsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Entitlements: [, (_) => de___listOfEntitlement(_, context), `entitlements`], - FlowArn: [, __expectString, `flowArn`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GrantFlowEntitlementsCommandError - */ -const de_GrantFlowEntitlementsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GrantFlowEntitlements420Exception": - case "com.amazonaws.mediaconnect#GrantFlowEntitlements420Exception": - throw await de_GrantFlowEntitlements420ExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListBridgesCommand - */ -export const de_ListBridgesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBridgesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Bridges: [, (_) => de___listOfListedBridge(_, context), `bridges`], - NextToken: [, __expectString, `nextToken`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListBridgesCommandError - */ -const de_ListBridgesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListEntitlementsCommand - */ -export const de_ListEntitlementsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEntitlementsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Entitlements: [, (_) => de___listOfListedEntitlement(_, context), `entitlements`], - NextToken: [, __expectString, `nextToken`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListEntitlementsCommandError - */ -const de_ListEntitlementsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + FlowArn: [, __expectString, `flowArn`], + Status: [, __expectString, `status`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListFlowsCommand + * deserializeAws_restJson1DeleteGatewayCommand */ -export const de_ListFlowsCommand = async ( +export const de_DeleteGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFlowsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Flows: [, (_) => de___listOfListedFlow(_, context), `flows`], - NextToken: [, __expectString, `nextToken`], + GatewayArn: [, __expectString, `gatewayArn`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListFlowsCommandError + * deserializeAws_restJson1DeregisterGatewayInstanceCommand */ -const de_ListFlowsCommandError = async ( +export const de_DeregisterGatewayInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + GatewayInstanceArn: [, __expectString, `gatewayInstanceArn`], + InstanceState: [, __expectString, `instanceState`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListGatewayInstancesCommand + * deserializeAws_restJson1DescribeBridgeCommand */ -export const de_ListGatewayInstancesCommand = async ( +export const de_DescribeBridgeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGatewayInstancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Instances: [, (_) => de___listOfListedGatewayInstance(_, context), `instances`], - NextToken: [, __expectString, `nextToken`], + Bridge: [, (_) => de_Bridge(_, context), `bridge`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListGatewayInstancesCommandError + * deserializeAws_restJson1DescribeFlowCommand */ -const de_ListGatewayInstancesCommandError = async ( +export const de_DescribeFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Flow: [, (_) => de_Flow(_, context), `flow`], + Messages: [, (_) => de_Messages(_, context), `messages`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListGatewaysCommand + * deserializeAws_restJson1DescribeFlowSourceMetadataCommand */ -export const de_ListGatewaysCommand = async ( +export const de_DescribeFlowSourceMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGatewaysCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Gateways: [, (_) => de___listOfListedGateway(_, context), `gateways`], - NextToken: [, __expectString, `nextToken`], + FlowArn: [, __expectString, `flowArn`], + Messages: [, (_) => de___listOfMessageDetail(_, context), `messages`], + Timestamp: [, (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), `timestamp`], + TransportMediaInfo: [, (_) => de_TransportMediaInfo(_, context), `transportMediaInfo`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListGatewaysCommandError + * deserializeAws_restJson1DescribeGatewayCommand */ -const de_ListGatewaysCommandError = async ( +export const de_DescribeGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Gateway: [, (_) => de_Gateway(_, context), `gateway`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListOfferingsCommand + * deserializeAws_restJson1DescribeGatewayInstanceCommand */ -export const de_ListOfferingsCommand = async ( +export const de_DescribeGatewayInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOfferingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: [, __expectString, `nextToken`], - Offerings: [, (_) => de___listOfOffering(_, context), `offerings`], + GatewayInstance: [, (_) => de_GatewayInstance(_, context), `gatewayInstance`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListOfferingsCommandError + * deserializeAws_restJson1DescribeOfferingCommand */ -const de_ListOfferingsCommandError = async ( +export const de_DescribeOfferingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Offering: [, (_) => de_Offering(_, context), `offering`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListReservationsCommand + * deserializeAws_restJson1DescribeReservationCommand */ -export const de_ListReservationsCommand = async ( +export const de_DescribeReservationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReservationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: [, __expectString, `nextToken`], - Reservations: [, (_) => de___listOfReservation(_, context), `reservations`], + Reservation: [, (_) => de_Reservation(_, context), `reservation`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListReservationsCommandError + * deserializeAws_restJson1GrantFlowEntitlementsCommand */ -const de_ListReservationsCommandError = async ( +export const de_GrantFlowEntitlementsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Entitlements: [, (_) => de___listOfEntitlement(_, context), `entitlements`], + FlowArn: [, __expectString, `flowArn`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListBridgesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListBridgesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: [, _json, `tags`], + Bridges: [, (_) => de___listOfListedBridge(_, context), `bridges`], + NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PurchaseOfferingCommand + * deserializeAws_restJson1ListEntitlementsCommand */ -export const de_PurchaseOfferingCommand = async ( +export const de_ListEntitlementsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_PurchaseOfferingCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Reservation: [, (_) => de_Reservation(_, context), `reservation`], + Entitlements: [, (_) => de___listOfListedEntitlement(_, context), `entitlements`], + NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PurchaseOfferingCommandError - */ -const de_PurchaseOfferingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RemoveBridgeOutputCommand + * deserializeAws_restJson1ListFlowsCommand */ -export const de_RemoveBridgeOutputCommand = async ( +export const de_ListFlowsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_RemoveBridgeOutputCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - BridgeArn: [, __expectString, `bridgeArn`], - OutputName: [, __expectString, `outputName`], + Flows: [, (_) => de___listOfListedFlow(_, context), `flows`], + NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RemoveBridgeOutputCommandError - */ -const de_RemoveBridgeOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RemoveBridgeSourceCommand + * deserializeAws_restJson1ListGatewayInstancesCommand */ -export const de_RemoveBridgeSourceCommand = async ( +export const de_ListGatewayInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_RemoveBridgeSourceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - BridgeArn: [, __expectString, `bridgeArn`], - SourceName: [, __expectString, `sourceName`], + Instances: [, (_) => de___listOfListedGatewayInstance(_, context), `instances`], + NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RemoveBridgeSourceCommandError + * deserializeAws_restJson1ListGatewaysCommand */ -const de_RemoveBridgeSourceCommandError = async ( +export const de_ListGatewaysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Gateways: [, (_) => de___listOfListedGateway(_, context), `gateways`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RemoveFlowMediaStreamCommand + * deserializeAws_restJson1ListOfferingsCommand */ -export const de_RemoveFlowMediaStreamCommand = async ( +export const de_ListOfferingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveFlowMediaStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - FlowArn: [, __expectString, `flowArn`], - MediaStreamName: [, __expectString, `mediaStreamName`], + NextToken: [, __expectString, `nextToken`], + Offerings: [, (_) => de___listOfOffering(_, context), `offerings`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RemoveFlowMediaStreamCommandError + * deserializeAws_restJson1ListReservationsCommand */ -const de_RemoveFlowMediaStreamCommandError = async ( +export const de_ListReservationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: [, __expectString, `nextToken`], + Reservations: [, (_) => de___listOfReservation(_, context), `reservations`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RemoveFlowOutputCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_RemoveFlowOutputCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_RemoveFlowOutputCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - FlowArn: [, __expectString, `flowArn`], - OutputArn: [, __expectString, `outputArn`], + Tags: [, _json, `tags`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RemoveFlowOutputCommandError + * deserializeAws_restJson1PurchaseOfferingCommand */ -const de_RemoveFlowOutputCommandError = async ( +export const de_PurchaseOfferingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Reservation: [, (_) => de_Reservation(_, context), `reservation`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RemoveFlowSourceCommand + * deserializeAws_restJson1RemoveBridgeOutputCommand */ -export const de_RemoveFlowSourceCommand = async ( +export const de_RemoveBridgeOutputCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_RemoveFlowSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - FlowArn: [, __expectString, `flowArn`], - SourceArn: [, __expectString, `sourceArn`], + BridgeArn: [, __expectString, `bridgeArn`], + OutputName: [, __expectString, `outputName`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RemoveFlowSourceCommandError + * deserializeAws_restJson1RemoveBridgeSourceCommand */ -const de_RemoveFlowSourceCommandError = async ( +export const de_RemoveBridgeSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + BridgeArn: [, __expectString, `bridgeArn`], + SourceName: [, __expectString, `sourceName`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RemoveFlowVpcInterfaceCommand + * deserializeAws_restJson1RemoveFlowMediaStreamCommand */ -export const de_RemoveFlowVpcInterfaceCommand = async ( +export const de_RemoveFlowMediaStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveFlowVpcInterfaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3499,126 +2004,43 @@ export const de_RemoveFlowVpcInterfaceCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { FlowArn: [, __expectString, `flowArn`], - NonDeletedNetworkInterfaceIds: [, _json, `nonDeletedNetworkInterfaceIds`], - VpcInterfaceName: [, __expectString, `vpcInterfaceName`], + MediaStreamName: [, __expectString, `mediaStreamName`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RemoveFlowVpcInterfaceCommandError - */ -const de_RemoveFlowVpcInterfaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RevokeFlowEntitlementCommand + * deserializeAws_restJson1RemoveFlowOutputCommand */ -export const de_RevokeFlowEntitlementCommand = async ( +export const de_RemoveFlowOutputCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_RevokeFlowEntitlementCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - EntitlementArn: [, __expectString, `entitlementArn`], FlowArn: [, __expectString, `flowArn`], + OutputArn: [, __expectString, `outputArn`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RevokeFlowEntitlementCommandError - */ -const de_RevokeFlowEntitlementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartFlowCommand + * deserializeAws_restJson1RemoveFlowSourceCommand */ -export const de_StartFlowCommand = async ( +export const de_RemoveFlowSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3626,163 +2048,116 @@ export const de_StartFlowCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { FlowArn: [, __expectString, `flowArn`], - Status: [, __expectString, `status`], + SourceArn: [, __expectString, `sourceArn`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartFlowCommandError + * deserializeAws_restJson1RemoveFlowVpcInterfaceCommand */ -const de_StartFlowCommandError = async ( +export const de_RemoveFlowVpcInterfaceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + FlowArn: [, __expectString, `flowArn`], + NonDeletedNetworkInterfaceIds: [, _json, `nonDeletedNetworkInterfaceIds`], + VpcInterfaceName: [, __expectString, `vpcInterfaceName`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StopFlowCommand + * deserializeAws_restJson1RevokeFlowEntitlementCommand */ -export const de_StopFlowCommand = async ( +export const de_RevokeFlowEntitlementCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StopFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + EntitlementArn: [, __expectString, `entitlementArn`], FlowArn: [, __expectString, `flowArn`], - Status: [, __expectString, `status`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StopFlowCommandError + * deserializeAws_restJson1StartFlowCommand */ -const de_StopFlowCommandError = async ( +export const de_StartFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + FlowArn: [, __expectString, `flowArn`], + Status: [, __expectString, `status`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1StopFlowCommand */ -export const de_TagResourceCommand = async ( +export const de_StopFlowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + FlowArn: [, __expectString, `flowArn`], + Status: [, __expectString, `status`], + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -3793,7 +2168,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3802,38 +2177,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBridgeCommand */ @@ -3842,7 +2185,7 @@ export const de_UpdateBridgeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateBridgeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3855,50 +2198,6 @@ export const de_UpdateBridgeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateBridgeCommandError - */ -const de_UpdateBridgeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBridgeOutputCommand */ @@ -3907,7 +2206,7 @@ export const de_UpdateBridgeOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateBridgeOutputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3921,50 +2220,6 @@ export const de_UpdateBridgeOutputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateBridgeOutputCommandError - */ -const de_UpdateBridgeOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBridgeSourceCommand */ @@ -3973,62 +2228,18 @@ export const de_UpdateBridgeSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateBridgeSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BridgeArn: [, __expectString, `bridgeArn`], - Source: [, (_) => de_BridgeSource(_, context), `source`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateBridgeSourceCommandError - */ -const de_UpdateBridgeSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + BridgeArn: [, __expectString, `bridgeArn`], + Source: [, (_) => de_BridgeSource(_, context), `source`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4039,7 +2250,7 @@ export const de_UpdateBridgeStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateBridgeStateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4053,50 +2264,6 @@ export const de_UpdateBridgeStateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateBridgeStateCommandError - */ -const de_UpdateBridgeStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFlowCommand */ @@ -4105,7 +2272,7 @@ export const de_UpdateFlowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateFlowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4118,47 +2285,6 @@ export const de_UpdateFlowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFlowCommandError - */ -const de_UpdateFlowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFlowEntitlementCommand */ @@ -4167,7 +2293,7 @@ export const de_UpdateFlowEntitlementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateFlowEntitlementCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4181,47 +2307,6 @@ export const de_UpdateFlowEntitlementCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFlowEntitlementCommandError - */ -const de_UpdateFlowEntitlementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFlowMediaStreamCommand */ @@ -4230,7 +2315,7 @@ export const de_UpdateFlowMediaStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateFlowMediaStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4244,47 +2329,6 @@ export const de_UpdateFlowMediaStreamCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFlowMediaStreamCommandError - */ -const de_UpdateFlowMediaStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFlowOutputCommand */ @@ -4293,7 +2337,7 @@ export const de_UpdateFlowOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateFlowOutputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4307,47 +2351,6 @@ export const de_UpdateFlowOutputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFlowOutputCommandError - */ -const de_UpdateFlowOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFlowSourceCommand */ @@ -4356,7 +2359,7 @@ export const de_UpdateFlowSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateFlowSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4370,47 +2373,6 @@ export const de_UpdateFlowSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFlowSourceCommandError - */ -const de_UpdateFlowSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconnect#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconnect#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconnect#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconnect#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediaconnect#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconnect#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateGatewayInstanceCommand */ @@ -4419,7 +2381,7 @@ export const de_UpdateGatewayInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGatewayInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4434,12 +2396,9 @@ export const de_UpdateGatewayInstanceCommand = async ( }; /** - * deserializeAws_restJson1UpdateGatewayInstanceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateGatewayInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4467,13 +2426,28 @@ const de_UpdateGatewayInstanceCommandError = async ( case "TooManyRequestsException": case "com.amazonaws.mediaconnect#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "AddFlowOutputs420Exception": + case "com.amazonaws.mediaconnect#AddFlowOutputs420Exception": + throw await de_AddFlowOutputs420ExceptionRes(parsedOutput, context); + case "CreateBridge420Exception": + case "com.amazonaws.mediaconnect#CreateBridge420Exception": + throw await de_CreateBridge420ExceptionRes(parsedOutput, context); + case "CreateFlow420Exception": + case "com.amazonaws.mediaconnect#CreateFlow420Exception": + throw await de_CreateFlow420ExceptionRes(parsedOutput, context); + case "CreateGateway420Exception": + case "com.amazonaws.mediaconnect#CreateGateway420Exception": + throw await de_CreateGateway420ExceptionRes(parsedOutput, context); + case "GrantFlowEntitlements420Exception": + case "com.amazonaws.mediaconnect#GrantFlowEntitlements420Exception": + throw await de_GrantFlowEntitlements420ExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts b/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts index 7fd93c0fae45..c8c41854376b 100644 --- a/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediaconvert/src/protocols/Aws_restJson1.ts @@ -857,7 +857,7 @@ export const de_AssociateCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_AssociateCertificateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -866,47 +866,6 @@ export const de_AssociateCertificateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateCertificateCommandError - */ -const de_AssociateCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelJobCommand */ @@ -915,7 +874,7 @@ export const de_CancelJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CancelJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -924,47 +883,6 @@ export const de_CancelJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelJobCommandError - */ -const de_CancelJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateJobCommand */ @@ -973,7 +891,7 @@ export const de_CreateJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -986,47 +904,6 @@ export const de_CreateJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateJobCommandError - */ -const de_CreateJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateJobTemplateCommand */ @@ -1035,7 +912,7 @@ export const de_CreateJobTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateJobTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1048,47 +925,6 @@ export const de_CreateJobTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateJobTemplateCommandError - */ -const de_CreateJobTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePresetCommand */ @@ -1097,7 +933,7 @@ export const de_CreatePresetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreatePresetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1110,47 +946,6 @@ export const de_CreatePresetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePresetCommandError - */ -const de_CreatePresetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateQueueCommand */ @@ -1159,7 +954,7 @@ export const de_CreateQueueCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateQueueCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1173,55 +968,48 @@ export const de_CreateQueueCommand = async ( }; /** - * deserializeAws_restJson1CreateQueueCommandError + * deserializeAws_restJson1DeleteJobTemplateCommand + */ +export const de_DeleteJobTemplateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeletePolicyCommand */ -const de_CreateQueueCommandError = async ( +export const de_DeletePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteJobTemplateCommand + * deserializeAws_restJson1DeletePresetCommand */ -export const de_DeleteJobTemplateCommand = async ( +export const de_DeletePresetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteJobTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1231,960 +1019,273 @@ export const de_DeleteJobTemplateCommand = async ( }; /** - * deserializeAws_restJson1DeleteJobTemplateCommandError + * deserializeAws_restJson1DeleteQueueCommand */ -const de_DeleteJobTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePolicyCommand - */ -export const de_DeletePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeletePolicyCommandError - */ -const de_DeletePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePresetCommand - */ -export const de_DeletePresetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeletePresetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeletePresetCommandError - */ -const de_DeletePresetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteQueueCommand - */ -export const de_DeleteQueueCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteQueueCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteQueueCommandError - */ -const de_DeleteQueueCommandError = async ( +export const de_DeleteQueueCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeEndpointsCommand - */ -export const de_DescribeEndpointsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeEndpointsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Endpoints: [, (_) => de___listOfEndpoint(_, context), `endpoints`], - NextToken: [, __expectString, `nextToken`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeEndpointsCommandError - */ -const de_DescribeEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateCertificateCommand - */ -export const de_DisassociateCertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DisassociateCertificateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateCertificateCommandError - */ -const de_DisassociateCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetJobCommand - */ -export const de_GetJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Job: [, (_) => de_Job(_, context), `job`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetJobCommandError - */ -const de_GetJobCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetJobTemplateCommand - */ -export const de_GetJobTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJobTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - JobTemplate: [, (_) => de_JobTemplate(_, context), `jobTemplate`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetJobTemplateCommandError - */ -const de_GetJobTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPolicyCommand - */ -export const de_GetPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Policy: [, (_) => de_Policy(_, context), `policy`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPolicyCommandError - */ -const de_GetPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPresetCommand - */ -export const de_GetPresetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPresetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Preset: [, (_) => de_Preset(_, context), `preset`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPresetCommandError - */ -const de_GetPresetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetQueueCommand + * deserializeAws_restJson1DescribeEndpointsCommand */ -export const de_GetQueueCommand = async ( +export const de_DescribeEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetQueueCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Queue: [, (_) => de_Queue(_, context), `queue`], + Endpoints: [, (_) => de___listOfEndpoint(_, context), `endpoints`], + NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetQueueCommandError + * deserializeAws_restJson1DisassociateCertificateCommand */ -const de_GetQueueCommandError = async ( +export const de_DisassociateCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListJobsCommand + * deserializeAws_restJson1GetJobCommand */ -export const de_ListJobsCommand = async ( +export const de_GetJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Jobs: [, (_) => de___listOfJob(_, context), `jobs`], - NextToken: [, __expectString, `nextToken`], + Job: [, (_) => de_Job(_, context), `job`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListJobsCommandError + * deserializeAws_restJson1GetJobTemplateCommand */ -const de_ListJobsCommandError = async ( +export const de_GetJobTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + JobTemplate: [, (_) => de_JobTemplate(_, context), `jobTemplate`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListJobTemplatesCommand + * deserializeAws_restJson1GetPolicyCommand */ -export const de_ListJobTemplatesCommand = async ( +export const de_GetPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - JobTemplates: [, (_) => de___listOfJobTemplate(_, context), `jobTemplates`], - NextToken: [, __expectString, `nextToken`], + Policy: [, (_) => de_Policy(_, context), `policy`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListJobTemplatesCommandError + * deserializeAws_restJson1GetPresetCommand */ -const de_ListJobTemplatesCommandError = async ( +export const de_GetPresetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Preset: [, (_) => de_Preset(_, context), `preset`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPresetsCommand + * deserializeAws_restJson1GetQueueCommand */ -export const de_ListPresetsCommand = async ( +export const de_GetQueueCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPresetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: [, __expectString, `nextToken`], - Presets: [, (_) => de___listOfPreset(_, context), `presets`], + Queue: [, (_) => de_Queue(_, context), `queue`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPresetsCommandError + * deserializeAws_restJson1ListJobsCommand */ -const de_ListPresetsCommandError = async ( +export const de_ListJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Jobs: [, (_) => de___listOfJob(_, context), `jobs`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListQueuesCommand + * deserializeAws_restJson1ListJobTemplatesCommand */ -export const de_ListQueuesCommand = async ( +export const de_ListJobTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListQueuesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + JobTemplates: [, (_) => de___listOfJobTemplate(_, context), `jobTemplates`], NextToken: [, __expectString, `nextToken`], - Queues: [, (_) => de___listOfQueue(_, context), `queues`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListQueuesCommandError + * deserializeAws_restJson1ListPresetsCommand */ -const de_ListQueuesCommandError = async ( +export const de_ListPresetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: [, __expectString, `nextToken`], + Presets: [, (_) => de___listOfPreset(_, context), `presets`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListQueuesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListQueuesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ResourceTags: [, (_) => de_ResourceTags(_, context), `resourceTags`], + NextToken: [, __expectString, `nextToken`], + Queues: [, (_) => de___listOfQueue(_, context), `queues`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ResourceTags: [, (_) => de_ResourceTags(_, context), `resourceTags`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2195,7 +1296,7 @@ export const de_PutPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2208,47 +1309,6 @@ export const de_PutPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutPolicyCommandError - */ -const de_PutPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2257,7 +1317,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2266,47 +1326,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2315,7 +1334,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2324,47 +1343,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateJobTemplateCommand */ @@ -2373,7 +1351,7 @@ export const de_UpdateJobTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateJobTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2386,47 +1364,6 @@ export const de_UpdateJobTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateJobTemplateCommandError - */ -const de_UpdateJobTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePresetCommand */ @@ -2435,7 +1372,7 @@ export const de_UpdatePresetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePresetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2448,47 +1385,6 @@ export const de_UpdatePresetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePresetCommandError - */ -const de_UpdatePresetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediaconvert#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediaconvert#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mediaconvert#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediaconvert#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediaconvert#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediaconvert#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateQueueCommand */ @@ -2497,7 +1393,7 @@ export const de_UpdateQueueCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateQueueCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2511,12 +1407,9 @@ export const de_UpdateQueueCommand = async ( }; /** - * deserializeAws_restJson1UpdateQueueCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateQueueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2547,7 +1440,7 @@ const de_UpdateQueueCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-medialive/src/protocols/Aws_restJson1.ts b/clients/client-medialive/src/protocols/Aws_restJson1.ts index 38e209bb8cec..2aaedfad25b2 100644 --- a/clients/client-medialive/src/protocols/Aws_restJson1.ts +++ b/clients/client-medialive/src/protocols/Aws_restJson1.ts @@ -1753,7 +1753,7 @@ export const de_AcceptInputDeviceTransferCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptInputDeviceTransferCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1762,56 +1762,6 @@ export const de_AcceptInputDeviceTransferCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptInputDeviceTransferCommandError - */ -const de_AcceptInputDeviceTransferCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDeleteCommand */ @@ -1820,7 +1770,7 @@ export const de_BatchDeleteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDeleteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1834,53 +1784,6 @@ export const de_BatchDeleteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDeleteCommandError - */ -const de_BatchDeleteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchStartCommand */ @@ -1889,7 +1792,7 @@ export const de_BatchStartCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchStartCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1903,53 +1806,6 @@ export const de_BatchStartCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchStartCommandError - */ -const de_BatchStartCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchStopCommand */ @@ -1958,7 +1814,7 @@ export const de_BatchStopCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchStopCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1972,53 +1828,6 @@ export const de_BatchStopCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchStopCommandError - */ -const de_BatchStopCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUpdateScheduleCommand */ @@ -2027,7 +1836,7 @@ export const de_BatchUpdateScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpdateScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2042,61 +1851,31 @@ export const de_BatchUpdateScheduleCommand = async ( }; /** - * deserializeAws_restJson1BatchUpdateScheduleCommandError + * deserializeAws_restJson1CancelInputDeviceTransferCommand */ -const de_BatchUpdateScheduleCommandError = async ( +export const de_CancelInputDeviceTransferCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CancelInputDeviceTransferCommand + * deserializeAws_restJson1ClaimDeviceCommand */ -export const de_CancelInputDeviceTransferCommand = async ( +export const de_ClaimDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelInputDeviceTransferCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2106,128 +1885,14 @@ export const de_CancelInputDeviceTransferCommand = async ( }; /** - * deserializeAws_restJson1CancelInputDeviceTransferCommandError + * deserializeAws_restJson1CreateChannelCommand */ -const de_CancelInputDeviceTransferCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ClaimDeviceCommand - */ -export const de_ClaimDeviceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ClaimDeviceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1ClaimDeviceCommandError - */ -const de_ClaimDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateChannelCommand - */ -export const de_CreateChannelCommand = async ( +export const de_CreateChannelCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2240,53 +1905,6 @@ export const de_CreateChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateChannelCommandError - */ -const de_CreateChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateInputCommand */ @@ -2295,7 +1913,7 @@ export const de_CreateInputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateInputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2308,47 +1926,6 @@ export const de_CreateInputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateInputCommandError - */ -const de_CreateInputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateInputSecurityGroupCommand */ @@ -2357,7 +1934,7 @@ export const de_CreateInputSecurityGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateInputSecurityGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2370,47 +1947,6 @@ export const de_CreateInputSecurityGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateInputSecurityGroupCommandError - */ -const de_CreateInputSecurityGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMultiplexCommand */ @@ -2419,7 +1955,7 @@ export const de_CreateMultiplexCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateMultiplexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2432,53 +1968,6 @@ export const de_CreateMultiplexCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMultiplexCommandError - */ -const de_CreateMultiplexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMultiplexProgramCommand */ @@ -2487,7 +1976,7 @@ export const de_CreateMultiplexProgramCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateMultiplexProgramCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2501,61 +1990,14 @@ export const de_CreateMultiplexProgramCommand = async ( }; /** - * deserializeAws_restJson1CreateMultiplexProgramCommandError + * deserializeAws_restJson1CreatePartnerInputCommand */ -const de_CreateMultiplexProgramCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreatePartnerInputCommand - */ -export const de_CreatePartnerInputCommand = async ( +export const de_CreatePartnerInputCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreatePartnerInputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2568,47 +2010,6 @@ export const de_CreatePartnerInputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePartnerInputCommandError - */ -const de_CreatePartnerInputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateTagsCommand */ @@ -2617,7 +2018,7 @@ export const de_CreateTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_CreateTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2626,41 +2027,6 @@ export const de_CreateTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTagsCommandError - */ -const de_CreateTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteChannelCommand */ @@ -2669,7 +2035,7 @@ export const de_DeleteChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2699,53 +2065,6 @@ export const de_DeleteChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteChannelCommandError - */ -const de_DeleteChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteInputCommand */ @@ -2754,7 +2073,7 @@ export const de_DeleteInputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteInputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2763,53 +2082,6 @@ export const de_DeleteInputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteInputCommandError - */ -const de_DeleteInputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteInputSecurityGroupCommand */ @@ -2818,7 +2090,7 @@ export const de_DeleteInputSecurityGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteInputSecurityGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2827,50 +2099,6 @@ export const de_DeleteInputSecurityGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteInputSecurityGroupCommandError - */ -const de_DeleteInputSecurityGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteMultiplexCommand */ @@ -2879,7 +2107,7 @@ export const de_DeleteMultiplexCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteMultiplexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2902,61 +2130,14 @@ export const de_DeleteMultiplexCommand = async ( }; /** - * deserializeAws_restJson1DeleteMultiplexCommandError + * deserializeAws_restJson1DeleteMultiplexProgramCommand */ -const de_DeleteMultiplexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteMultiplexProgramCommand - */ -export const de_DeleteMultiplexProgramCommand = async ( +export const de_DeleteMultiplexProgramCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMultiplexProgramCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2973,53 +2154,6 @@ export const de_DeleteMultiplexProgramCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteMultiplexProgramCommandError - */ -const de_DeleteMultiplexProgramCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteReservationCommand */ @@ -3028,7 +2162,7 @@ export const de_DeleteReservationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteReservationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3059,53 +2193,6 @@ export const de_DeleteReservationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteReservationCommandError - */ -const de_DeleteReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteScheduleCommand */ @@ -3114,7 +2201,7 @@ export const de_DeleteScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3123,50 +2210,6 @@ export const de_DeleteScheduleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteScheduleCommandError - */ -const de_DeleteScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteTagsCommand */ @@ -3175,7 +2218,7 @@ export const de_DeleteTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3184,41 +2227,6 @@ export const de_DeleteTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteTagsCommandError - */ -const de_DeleteTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAccountConfigurationCommand */ @@ -3227,7 +2235,7 @@ export const de_DescribeAccountConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAccountConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3240,47 +2248,6 @@ export const de_DescribeAccountConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAccountConfigurationCommandError - */ -const de_DescribeAccountConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeChannelCommand */ @@ -3289,7 +2256,7 @@ export const de_DescribeChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3320,58 +2287,14 @@ export const de_DescribeChannelCommand = async ( }; /** - * deserializeAws_restJson1DescribeChannelCommandError + * deserializeAws_restJson1DescribeInputCommand */ -const de_DescribeChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeInputCommand - */ -export const de_DescribeInputCommand = async ( +export const de_DescribeInputCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeInputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3399,50 +2322,6 @@ export const de_DescribeInputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeInputCommandError - */ -const de_DescribeInputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeInputDeviceCommand */ @@ -3451,7 +2330,7 @@ export const de_DescribeInputDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeInputDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3479,50 +2358,6 @@ export const de_DescribeInputDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeInputDeviceCommandError - */ -const de_DescribeInputDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeInputDeviceThumbnailCommand */ @@ -3531,7 +2366,7 @@ export const de_DescribeInputDeviceThumbnailCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeInputDeviceThumbnailCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3546,50 +2381,6 @@ export const de_DescribeInputDeviceThumbnailCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeInputDeviceThumbnailCommandError - */ -const de_DescribeInputDeviceThumbnailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeInputSecurityGroupCommand */ @@ -3598,7 +2389,7 @@ export const de_DescribeInputSecurityGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeInputSecurityGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3616,50 +2407,6 @@ export const de_DescribeInputSecurityGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeInputSecurityGroupCommandError - */ -const de_DescribeInputSecurityGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeMultiplexCommand */ @@ -3668,7 +2415,7 @@ export const de_DescribeMultiplexCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeMultiplexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3690,50 +2437,6 @@ export const de_DescribeMultiplexCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeMultiplexCommandError - */ -const de_DescribeMultiplexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeMultiplexProgramCommand */ @@ -3742,7 +2445,7 @@ export const de_DescribeMultiplexProgramCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeMultiplexProgramCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3760,58 +2463,14 @@ export const de_DescribeMultiplexProgramCommand = async ( }; /** - * deserializeAws_restJson1DescribeMultiplexProgramCommandError + * deserializeAws_restJson1DescribeOfferingCommand */ -const de_DescribeMultiplexProgramCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeOfferingCommand - */ -export const de_DescribeOfferingCommand = async ( +export const de_DescribeOfferingCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeOfferingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3834,50 +2493,6 @@ export const de_DescribeOfferingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeOfferingCommandError - */ -const de_DescribeOfferingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeReservationCommand */ @@ -3886,7 +2501,7 @@ export const de_DescribeReservationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeReservationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3917,50 +2532,6 @@ export const de_DescribeReservationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeReservationCommandError - */ -const de_DescribeReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeScheduleCommand */ @@ -3969,7 +2540,7 @@ export const de_DescribeScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3983,50 +2554,6 @@ export const de_DescribeScheduleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeScheduleCommandError - */ -const de_DescribeScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeThumbnailsCommand */ @@ -4035,7 +2562,7 @@ export const de_DescribeThumbnailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeThumbnailsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4049,68 +2576,43 @@ export const de_DescribeThumbnailsCommand = async ( }; /** - * deserializeAws_restJson1DescribeThumbnailsCommandError + * deserializeAws_restJson1ListChannelsCommand */ -const de_DescribeThumbnailsCommandError = async ( +export const de_ListChannelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Channels: [, (_) => de___listOfChannelSummary(_, context), `channels`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListChannelsCommand + * deserializeAws_restJson1ListInputDevicesCommand */ -export const de_ListChannelsCommand = async ( +export const de_ListInputDevicesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Channels: [, (_) => de___listOfChannelSummary(_, context), `channels`], + InputDevices: [, (_) => de___listOfInputDeviceSummary(_, context), `inputDevices`], NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); @@ -4118,62 +2620,43 @@ export const de_ListChannelsCommand = async ( }; /** - * deserializeAws_restJson1ListChannelsCommandError + * deserializeAws_restJson1ListInputDeviceTransfersCommand */ -const de_ListChannelsCommandError = async ( +export const de_ListInputDeviceTransfersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + InputDeviceTransfers: [, (_) => de___listOfTransferringInputDeviceSummary(_, context), `inputDeviceTransfers`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListInputDevicesCommand + * deserializeAws_restJson1ListInputsCommand */ -export const de_ListInputDevicesCommand = async ( +export const de_ListInputsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInputDevicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - InputDevices: [, (_) => de___listOfInputDeviceSummary(_, context), `inputDevices`], + Inputs: [, (_) => de___listOfInput(_, context), `inputs`], NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); @@ -4181,62 +2664,21 @@ export const de_ListInputDevicesCommand = async ( }; /** - * deserializeAws_restJson1ListInputDevicesCommandError + * deserializeAws_restJson1ListInputSecurityGroupsCommand */ -const de_ListInputDevicesCommandError = async ( +export const de_ListInputSecurityGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListInputDeviceTransfersCommand - */ -export const de_ListInputDeviceTransfersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInputDeviceTransfersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - InputDeviceTransfers: [, (_) => de___listOfTransferringInputDeviceSummary(_, context), `inputDeviceTransfers`], + InputSecurityGroups: [, (_) => de___listOfInputSecurityGroup(_, context), `inputSecurityGroups`], NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); @@ -4244,65 +2686,21 @@ export const de_ListInputDeviceTransfersCommand = async ( }; /** - * deserializeAws_restJson1ListInputDeviceTransfersCommandError - */ -const de_ListInputDeviceTransfersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListInputsCommand + * deserializeAws_restJson1ListMultiplexesCommand */ -export const de_ListInputsCommand = async ( +export const de_ListMultiplexesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInputsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Inputs: [, (_) => de___listOfInput(_, context), `inputs`], + Multiplexes: [, (_) => de___listOfMultiplexSummary(_, context), `multiplexes`], NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); @@ -4310,1144 +2708,343 @@ export const de_ListInputsCommand = async ( }; /** - * deserializeAws_restJson1ListInputsCommandError + * deserializeAws_restJson1ListMultiplexProgramsCommand */ -const de_ListInputsCommandError = async ( +export const de_ListMultiplexProgramsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + MultiplexPrograms: [, (_) => de___listOfMultiplexProgramSummary(_, context), `multiplexPrograms`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListInputSecurityGroupsCommand + * deserializeAws_restJson1ListOfferingsCommand */ -export const de_ListInputSecurityGroupsCommand = async ( +export const de_ListOfferingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInputSecurityGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - InputSecurityGroups: [, (_) => de___listOfInputSecurityGroup(_, context), `inputSecurityGroups`], NextToken: [, __expectString, `nextToken`], + Offerings: [, (_) => de___listOfOffering(_, context), `offerings`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListInputSecurityGroupsCommandError + * deserializeAws_restJson1ListReservationsCommand */ -const de_ListInputSecurityGroupsCommandError = async ( +export const de_ListReservationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: [, __expectString, `nextToken`], + Reservations: [, (_) => de___listOfReservation(_, context), `reservations`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListMultiplexesCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_ListMultiplexesCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMultiplexesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Multiplexes: [, (_) => de___listOfMultiplexSummary(_, context), `multiplexes`], - NextToken: [, __expectString, `nextToken`], + Tags: [, _json, `tags`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListMultiplexesCommandError + * deserializeAws_restJson1PurchaseOfferingCommand */ -const de_ListMultiplexesCommandError = async ( +export const de_PurchaseOfferingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Reservation: [, (_) => de_Reservation(_, context), `reservation`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListMultiplexProgramsCommand + * deserializeAws_restJson1RebootInputDeviceCommand */ -export const de_ListMultiplexProgramsCommand = async ( +export const de_RebootInputDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMultiplexProgramsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - MultiplexPrograms: [, (_) => de___listOfMultiplexProgramSummary(_, context), `multiplexPrograms`], - NextToken: [, __expectString, `nextToken`], - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListMultiplexProgramsCommandError + * deserializeAws_restJson1RejectInputDeviceTransferCommand */ -const de_ListMultiplexProgramsCommandError = async ( +export const de_RejectInputDeviceTransferCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListOfferingsCommand + * deserializeAws_restJson1StartChannelCommand */ -export const de_ListOfferingsCommand = async ( +export const de_StartChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOfferingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: [, __expectString, `nextToken`], - Offerings: [, (_) => de___listOfOffering(_, context), `offerings`], + Arn: [, __expectString, `arn`], + CdiInputSpecification: [, (_) => de_CdiInputSpecification(_, context), `cdiInputSpecification`], + ChannelClass: [, __expectString, `channelClass`], + Destinations: [, (_) => de___listOfOutputDestination(_, context), `destinations`], + EgressEndpoints: [, (_) => de___listOfChannelEgressEndpoint(_, context), `egressEndpoints`], + EncoderSettings: [, (_) => de_EncoderSettings(_, context), `encoderSettings`], + Id: [, __expectString, `id`], + InputAttachments: [, (_) => de___listOfInputAttachment(_, context), `inputAttachments`], + InputSpecification: [, (_) => de_InputSpecification(_, context), `inputSpecification`], + LogLevel: [, __expectString, `logLevel`], + Maintenance: [, (_) => de_MaintenanceStatus(_, context), `maintenance`], + Name: [, __expectString, `name`], + PipelineDetails: [, (_) => de___listOfPipelineDetail(_, context), `pipelineDetails`], + PipelinesRunningCount: [, __expectInt32, `pipelinesRunningCount`], + RoleArn: [, __expectString, `roleArn`], + State: [, __expectString, `state`], + Tags: [, _json, `tags`], + Vpc: [, (_) => de_VpcOutputSettingsDescription(_, context), `vpc`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListOfferingsCommandError + * deserializeAws_restJson1StartInputDeviceCommand */ -const de_ListOfferingsCommandError = async ( +export const de_StartInputDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListReservationsCommand + * deserializeAws_restJson1StartInputDeviceMaintenanceWindowCommand */ -export const de_ListReservationsCommand = async ( +export const de_StartInputDeviceMaintenanceWindowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReservationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: [, __expectString, `nextToken`], - Reservations: [, (_) => de___listOfReservation(_, context), `reservations`], - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListReservationsCommandError + * deserializeAws_restJson1StartMultiplexCommand */ -const de_ListReservationsCommandError = async ( +export const de_StartMultiplexCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: [, __expectString, `arn`], + AvailabilityZones: [, _json, `availabilityZones`], + Destinations: [, (_) => de___listOfMultiplexOutputDestination(_, context), `destinations`], + Id: [, __expectString, `id`], + MultiplexSettings: [, (_) => de_MultiplexSettings(_, context), `multiplexSettings`], + Name: [, __expectString, `name`], + PipelinesRunningCount: [, __expectInt32, `pipelinesRunningCount`], + ProgramCount: [, __expectInt32, `programCount`], + State: [, __expectString, `state`], + Tags: [, _json, `tags`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1StopChannelCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_StopChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + Arn: [, __expectString, `arn`], + CdiInputSpecification: [, (_) => de_CdiInputSpecification(_, context), `cdiInputSpecification`], + ChannelClass: [, __expectString, `channelClass`], + Destinations: [, (_) => de___listOfOutputDestination(_, context), `destinations`], + EgressEndpoints: [, (_) => de___listOfChannelEgressEndpoint(_, context), `egressEndpoints`], + EncoderSettings: [, (_) => de_EncoderSettings(_, context), `encoderSettings`], + Id: [, __expectString, `id`], + InputAttachments: [, (_) => de___listOfInputAttachment(_, context), `inputAttachments`], + InputSpecification: [, (_) => de_InputSpecification(_, context), `inputSpecification`], + LogLevel: [, __expectString, `logLevel`], + Maintenance: [, (_) => de_MaintenanceStatus(_, context), `maintenance`], + Name: [, __expectString, `name`], + PipelineDetails: [, (_) => de___listOfPipelineDetail(_, context), `pipelineDetails`], + PipelinesRunningCount: [, __expectInt32, `pipelinesRunningCount`], + RoleArn: [, __expectString, `roleArn`], + State: [, __expectString, `state`], Tags: [, _json, `tags`], + Vpc: [, (_) => de_VpcOutputSettingsDescription(_, context), `vpc`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1StopInputDeviceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_StopInputDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1PurchaseOfferingCommand + * deserializeAws_restJson1StopMultiplexCommand */ -export const de_PurchaseOfferingCommand = async ( +export const de_StopMultiplexCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_PurchaseOfferingCommandError(output, context); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Reservation: [, (_) => de_Reservation(_, context), `reservation`], + Arn: [, __expectString, `arn`], + AvailabilityZones: [, _json, `availabilityZones`], + Destinations: [, (_) => de___listOfMultiplexOutputDestination(_, context), `destinations`], + Id: [, __expectString, `id`], + MultiplexSettings: [, (_) => de_MultiplexSettings(_, context), `multiplexSettings`], + Name: [, __expectString, `name`], + PipelinesRunningCount: [, __expectInt32, `pipelinesRunningCount`], + ProgramCount: [, __expectInt32, `programCount`], + State: [, __expectString, `state`], + Tags: [, _json, `tags`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PurchaseOfferingCommandError + * deserializeAws_restJson1TransferInputDeviceCommand */ -const de_PurchaseOfferingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RebootInputDeviceCommand - */ -export const de_RebootInputDeviceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RebootInputDeviceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1RebootInputDeviceCommandError - */ -const de_RebootInputDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RejectInputDeviceTransferCommand - */ -export const de_RejectInputDeviceTransferCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RejectInputDeviceTransferCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1RejectInputDeviceTransferCommandError - */ -const de_RejectInputDeviceTransferCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartChannelCommand - */ -export const de_StartChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: [, __expectString, `arn`], - CdiInputSpecification: [, (_) => de_CdiInputSpecification(_, context), `cdiInputSpecification`], - ChannelClass: [, __expectString, `channelClass`], - Destinations: [, (_) => de___listOfOutputDestination(_, context), `destinations`], - EgressEndpoints: [, (_) => de___listOfChannelEgressEndpoint(_, context), `egressEndpoints`], - EncoderSettings: [, (_) => de_EncoderSettings(_, context), `encoderSettings`], - Id: [, __expectString, `id`], - InputAttachments: [, (_) => de___listOfInputAttachment(_, context), `inputAttachments`], - InputSpecification: [, (_) => de_InputSpecification(_, context), `inputSpecification`], - LogLevel: [, __expectString, `logLevel`], - Maintenance: [, (_) => de_MaintenanceStatus(_, context), `maintenance`], - Name: [, __expectString, `name`], - PipelineDetails: [, (_) => de___listOfPipelineDetail(_, context), `pipelineDetails`], - PipelinesRunningCount: [, __expectInt32, `pipelinesRunningCount`], - RoleArn: [, __expectString, `roleArn`], - State: [, __expectString, `state`], - Tags: [, _json, `tags`], - Vpc: [, (_) => de_VpcOutputSettingsDescription(_, context), `vpc`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartChannelCommandError - */ -const de_StartChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartInputDeviceCommand - */ -export const de_StartInputDeviceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartInputDeviceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1StartInputDeviceCommandError - */ -const de_StartInputDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartInputDeviceMaintenanceWindowCommand - */ -export const de_StartInputDeviceMaintenanceWindowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartInputDeviceMaintenanceWindowCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1StartInputDeviceMaintenanceWindowCommandError - */ -const de_StartInputDeviceMaintenanceWindowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartMultiplexCommand - */ -export const de_StartMultiplexCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartMultiplexCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: [, __expectString, `arn`], - AvailabilityZones: [, _json, `availabilityZones`], - Destinations: [, (_) => de___listOfMultiplexOutputDestination(_, context), `destinations`], - Id: [, __expectString, `id`], - MultiplexSettings: [, (_) => de_MultiplexSettings(_, context), `multiplexSettings`], - Name: [, __expectString, `name`], - PipelinesRunningCount: [, __expectInt32, `pipelinesRunningCount`], - ProgramCount: [, __expectInt32, `programCount`], - State: [, __expectString, `state`], - Tags: [, _json, `tags`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartMultiplexCommandError - */ -const de_StartMultiplexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StopChannelCommand - */ -export const de_StopChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: [, __expectString, `arn`], - CdiInputSpecification: [, (_) => de_CdiInputSpecification(_, context), `cdiInputSpecification`], - ChannelClass: [, __expectString, `channelClass`], - Destinations: [, (_) => de___listOfOutputDestination(_, context), `destinations`], - EgressEndpoints: [, (_) => de___listOfChannelEgressEndpoint(_, context), `egressEndpoints`], - EncoderSettings: [, (_) => de_EncoderSettings(_, context), `encoderSettings`], - Id: [, __expectString, `id`], - InputAttachments: [, (_) => de___listOfInputAttachment(_, context), `inputAttachments`], - InputSpecification: [, (_) => de_InputSpecification(_, context), `inputSpecification`], - LogLevel: [, __expectString, `logLevel`], - Maintenance: [, (_) => de_MaintenanceStatus(_, context), `maintenance`], - Name: [, __expectString, `name`], - PipelineDetails: [, (_) => de___listOfPipelineDetail(_, context), `pipelineDetails`], - PipelinesRunningCount: [, __expectInt32, `pipelinesRunningCount`], - RoleArn: [, __expectString, `roleArn`], - State: [, __expectString, `state`], - Tags: [, _json, `tags`], - Vpc: [, (_) => de_VpcOutputSettingsDescription(_, context), `vpc`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StopChannelCommandError - */ -const de_StopChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StopInputDeviceCommand - */ -export const de_StopInputDeviceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopInputDeviceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1StopInputDeviceCommandError - */ -const de_StopInputDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StopMultiplexCommand - */ -export const de_StopMultiplexCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StopMultiplexCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: [, __expectString, `arn`], - AvailabilityZones: [, _json, `availabilityZones`], - Destinations: [, (_) => de___listOfMultiplexOutputDestination(_, context), `destinations`], - Id: [, __expectString, `id`], - MultiplexSettings: [, (_) => de_MultiplexSettings(_, context), `multiplexSettings`], - Name: [, __expectString, `name`], - PipelinesRunningCount: [, __expectInt32, `pipelinesRunningCount`], - ProgramCount: [, __expectInt32, `programCount`], - State: [, __expectString, `state`], - Tags: [, _json, `tags`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StopMultiplexCommandError - */ -const de_StopMultiplexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1TransferInputDeviceCommand - */ -export const de_TransferInputDeviceCommand = async ( +export const de_TransferInputDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TransferInputDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5456,56 +3053,6 @@ export const de_TransferInputDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TransferInputDeviceCommandError - */ -const de_TransferInputDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAccountConfigurationCommand */ @@ -5514,262 +3061,80 @@ export const de_UpdateAccountConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAccountConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AccountConfiguration: [, (_) => de_AccountConfiguration(_, context), `accountConfiguration`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateAccountConfigurationCommandError - */ -const de_UpdateAccountConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateChannelCommand - */ -export const de_UpdateChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Channel: [, (_) => de_Channel(_, context), `channel`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateChannelCommandError - */ -const de_UpdateChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateChannelClassCommand - */ -export const de_UpdateChannelClassCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChannelClassCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Channel: [, (_) => de_Channel(_, context), `channel`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateChannelClassCommandError - */ -const de_UpdateChannelClassCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + const doc = take(data, { + AccountConfiguration: [, (_) => de_AccountConfiguration(_, context), `accountConfiguration`], + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateChannelCommand + */ +export const de_UpdateChannelCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Channel: [, (_) => de_Channel(_, context), `channel`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateInputCommand + * deserializeAws_restJson1UpdateChannelClassCommand */ -export const de_UpdateInputCommand = async ( +export const de_UpdateChannelClassCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateInputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Input: [, (_) => de_Input(_, context), `input`], + Channel: [, (_) => de_Channel(_, context), `channel`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateInputCommandError + * deserializeAws_restJson1UpdateInputCommand */ -const de_UpdateInputCommandError = async ( +export const de_UpdateInputCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Input: [, (_) => de_Input(_, context), `input`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -5780,7 +3145,7 @@ export const de_UpdateInputDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateInputDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5808,53 +3173,6 @@ export const de_UpdateInputDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateInputDeviceCommandError - */ -const de_UpdateInputDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.medialive#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateInputSecurityGroupCommand */ @@ -5863,7 +3181,7 @@ export const de_UpdateInputSecurityGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateInputSecurityGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5876,50 +3194,6 @@ export const de_UpdateInputSecurityGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateInputSecurityGroupCommandError - */ -const de_UpdateInputSecurityGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMultiplexCommand */ @@ -5928,7 +3202,7 @@ export const de_UpdateMultiplexCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMultiplexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5941,53 +3215,6 @@ export const de_UpdateMultiplexCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateMultiplexCommandError - */ -const de_UpdateMultiplexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMultiplexProgramCommand */ @@ -5996,7 +3223,7 @@ export const de_UpdateMultiplexProgramCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMultiplexProgramCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6009,53 +3236,6 @@ export const de_UpdateMultiplexProgramCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateMultiplexProgramCommandError - */ -const de_UpdateMultiplexProgramCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadGatewayException": - case "com.amazonaws.medialive#BadGatewayException": - throw await de_BadGatewayExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.medialive#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medialive#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.medialive#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GatewayTimeoutException": - case "com.amazonaws.medialive#GatewayTimeoutException": - throw await de_GatewayTimeoutExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.medialive#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.medialive#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.medialive#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateReservationCommand */ @@ -6064,7 +3244,7 @@ export const de_UpdateReservationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateReservationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6078,12 +3258,9 @@ export const de_UpdateReservationCommand = async ( }; /** - * deserializeAws_restJson1UpdateReservationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateReservationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -6114,13 +3291,16 @@ const de_UpdateReservationCommandError = async ( case "TooManyRequestsException": case "com.amazonaws.medialive#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "UnprocessableEntityException": + case "com.amazonaws.medialive#UnprocessableEntityException": + throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts b/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts index 8f23664dc17b..0aa9df9b45f8 100644 --- a/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediapackage-vod/src/protocols/Aws_restJson1.ts @@ -450,7 +450,7 @@ export const de_ConfigureLogsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ConfigureLogsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -469,47 +469,6 @@ export const de_ConfigureLogsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ConfigureLogsCommandError - */ -const de_ConfigureLogsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackagevod#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackagevod#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackagevod#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackagevod#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackagevod#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackagevod#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAssetCommand */ @@ -518,7 +477,7 @@ export const de_CreateAssetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAssetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -539,47 +498,6 @@ export const de_CreateAssetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAssetCommandError - */ -const de_CreateAssetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackagevod#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackagevod#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackagevod#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackagevod#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackagevod#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackagevod#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePackagingConfigurationCommand */ @@ -588,7 +506,7 @@ export const de_CreatePackagingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePackagingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -609,47 +527,6 @@ export const de_CreatePackagingConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePackagingConfigurationCommandError - */ -const de_CreatePackagingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackagevod#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackagevod#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackagevod#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackagevod#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackagevod#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackagevod#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePackagingGroupCommand */ @@ -658,7 +535,7 @@ export const de_CreatePackagingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePackagingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -677,47 +554,6 @@ export const de_CreatePackagingGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePackagingGroupCommandError - */ -const de_CreatePackagingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackagevod#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackagevod#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackagevod#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackagevod#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackagevod#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackagevod#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAssetCommand */ @@ -726,7 +562,7 @@ export const de_DeleteAssetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteAssetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -735,47 +571,6 @@ export const de_DeleteAssetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAssetCommandError - */ -const de_DeleteAssetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackagevod#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackagevod#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackagevod#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackagevod#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackagevod#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackagevod#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePackagingConfigurationCommand */ @@ -784,7 +579,7 @@ export const de_DeletePackagingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeletePackagingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -793,47 +588,6 @@ export const de_DeletePackagingConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePackagingConfigurationCommandError - */ -const de_DeletePackagingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackagevod#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackagevod#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackagevod#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackagevod#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackagevod#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackagevod#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePackagingGroupCommand */ @@ -842,7 +596,7 @@ export const de_DeletePackagingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeletePackagingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -852,114 +606,32 @@ export const de_DeletePackagingGroupCommand = async ( }; /** - * deserializeAws_restJson1DeletePackagingGroupCommandError - */ -const de_DeletePackagingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackagevod#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackagevod#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackagevod#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackagevod#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackagevod#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackagevod#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAssetCommand - */ -export const de_DescribeAssetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAssetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: [, __expectString, `arn`], - CreatedAt: [, __expectString, `createdAt`], - EgressEndpoints: [, (_) => de___listOfEgressEndpoint(_, context), `egressEndpoints`], - Id: [, __expectString, `id`], - PackagingGroupId: [, __expectString, `packagingGroupId`], - ResourceId: [, __expectString, `resourceId`], - SourceArn: [, __expectString, `sourceArn`], - SourceRoleArn: [, __expectString, `sourceRoleArn`], - Tags: [, _json, `tags`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAssetCommandError - */ -const de_DescribeAssetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackagevod#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackagevod#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackagevod#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackagevod#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackagevod#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackagevod#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + * deserializeAws_restJson1DescribeAssetCommand + */ +export const de_DescribeAssetCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: [, __expectString, `arn`], + CreatedAt: [, __expectString, `createdAt`], + EgressEndpoints: [, (_) => de___listOfEgressEndpoint(_, context), `egressEndpoints`], + Id: [, __expectString, `id`], + PackagingGroupId: [, __expectString, `packagingGroupId`], + ResourceId: [, __expectString, `resourceId`], + SourceArn: [, __expectString, `sourceArn`], + SourceRoleArn: [, __expectString, `sourceRoleArn`], + Tags: [, _json, `tags`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -970,7 +642,7 @@ export const de_DescribePackagingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePackagingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -991,47 +663,6 @@ export const de_DescribePackagingConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribePackagingConfigurationCommandError - */ -const de_DescribePackagingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackagevod#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackagevod#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackagevod#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackagevod#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackagevod#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackagevod#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribePackagingGroupCommand */ @@ -1040,7 +671,7 @@ export const de_DescribePackagingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePackagingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1060,47 +691,6 @@ export const de_DescribePackagingGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribePackagingGroupCommandError - */ -const de_DescribePackagingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackagevod#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackagevod#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackagevod#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackagevod#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackagevod#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackagevod#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssetsCommand */ @@ -1109,7 +699,7 @@ export const de_ListAssetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1123,47 +713,6 @@ export const de_ListAssetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssetsCommandError - */ -const de_ListAssetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackagevod#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackagevod#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackagevod#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackagevod#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackagevod#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackagevod#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPackagingConfigurationsCommand */ @@ -1172,7 +721,7 @@ export const de_ListPackagingConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPackagingConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1186,47 +735,6 @@ export const de_ListPackagingConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListPackagingConfigurationsCommandError - */ -const de_ListPackagingConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackagevod#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackagevod#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackagevod#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackagevod#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackagevod#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackagevod#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPackagingGroupsCommand */ @@ -1235,7 +743,7 @@ export const de_ListPackagingGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPackagingGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1249,47 +757,6 @@ export const de_ListPackagingGroupsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListPackagingGroupsCommandError - */ -const de_ListPackagingGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackagevod#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackagevod#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackagevod#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackagevod#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackagevod#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackagevod#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1298,7 +765,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1311,26 +778,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1339,7 +786,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1348,26 +795,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1376,7 +803,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1385,26 +812,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1UpdatePackagingGroupCommand */ @@ -1413,7 +820,7 @@ export const de_UpdatePackagingGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePackagingGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1434,12 +841,9 @@ export const de_UpdatePackagingGroupCommand = async ( }; /** - * deserializeAws_restJson1UpdatePackagingGroupCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdatePackagingGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1470,7 +874,7 @@ const de_UpdatePackagingGroupCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-mediapackage/src/protocols/Aws_restJson1.ts b/clients/client-mediapackage/src/protocols/Aws_restJson1.ts index ca5578242b3c..e85dc8fb80d6 100644 --- a/clients/client-mediapackage/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediapackage/src/protocols/Aws_restJson1.ts @@ -507,7 +507,7 @@ export const de_ConfigureLogsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ConfigureLogsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -527,47 +527,6 @@ export const de_ConfigureLogsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ConfigureLogsCommandError - */ -const de_ConfigureLogsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackage#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackage#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackage#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackage#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackage#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateChannelCommand */ @@ -576,7 +535,7 @@ export const de_CreateChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -596,47 +555,6 @@ export const de_CreateChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateChannelCommandError - */ -const de_CreateChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackage#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackage#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackage#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackage#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackage#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateHarvestJobCommand */ @@ -645,7 +563,7 @@ export const de_CreateHarvestJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateHarvestJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -666,47 +584,6 @@ export const de_CreateHarvestJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateHarvestJobCommandError - */ -const de_CreateHarvestJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackage#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackage#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackage#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackage#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackage#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateOriginEndpointCommand */ @@ -715,7 +592,7 @@ export const de_CreateOriginEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateOriginEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -744,47 +621,6 @@ export const de_CreateOriginEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateOriginEndpointCommandError - */ -const de_CreateOriginEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackage#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackage#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackage#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackage#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackage#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteChannelCommand */ @@ -793,7 +629,7 @@ export const de_DeleteChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -802,47 +638,6 @@ export const de_DeleteChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteChannelCommandError - */ -const de_DeleteChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackage#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackage#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackage#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackage#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackage#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteOriginEndpointCommand */ @@ -851,7 +646,7 @@ export const de_DeleteOriginEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteOriginEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -860,47 +655,6 @@ export const de_DeleteOriginEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteOriginEndpointCommandError - */ -const de_DeleteOriginEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackage#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackage#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackage#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackage#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackage#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeChannelCommand */ @@ -909,7 +663,7 @@ export const de_DescribeChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -929,47 +683,6 @@ export const de_DescribeChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeChannelCommandError - */ -const de_DescribeChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackage#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackage#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackage#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackage#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackage#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeHarvestJobCommand */ @@ -978,7 +691,7 @@ export const de_DescribeHarvestJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeHarvestJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -999,47 +712,6 @@ export const de_DescribeHarvestJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeHarvestJobCommandError - */ -const de_DescribeHarvestJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackage#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackage#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackage#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackage#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackage#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeOriginEndpointCommand */ @@ -1048,7 +720,7 @@ export const de_DescribeOriginEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeOriginEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1064,139 +736,35 @@ export const de_DescribeOriginEndpointCommand = async ( Description: [, __expectString, `description`], HlsPackage: [, (_) => de_HlsPackage(_, context), `hlsPackage`], Id: [, __expectString, `id`], - ManifestName: [, __expectString, `manifestName`], - MssPackage: [, (_) => de_MssPackage(_, context), `mssPackage`], - Origination: [, __expectString, `origination`], - StartoverWindowSeconds: [, __expectInt32, `startoverWindowSeconds`], - Tags: [, _json, `tags`], - TimeDelaySeconds: [, __expectInt32, `timeDelaySeconds`], - Url: [, __expectString, `url`], - Whitelist: [, _json, `whitelist`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeOriginEndpointCommandError - */ -const de_DescribeOriginEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackage#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackage#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackage#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackage#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackage#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListChannelsCommand - */ -export const de_ListChannelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Channels: [, (_) => de___listOfChannel(_, context), `channels`], - NextToken: [, __expectString, `nextToken`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListChannelsCommandError - */ -const de_ListChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackage#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackage#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackage#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackage#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackage#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + ManifestName: [, __expectString, `manifestName`], + MssPackage: [, (_) => de_MssPackage(_, context), `mssPackage`], + Origination: [, __expectString, `origination`], + StartoverWindowSeconds: [, __expectInt32, `startoverWindowSeconds`], + Tags: [, _json, `tags`], + TimeDelaySeconds: [, __expectInt32, `timeDelaySeconds`], + Url: [, __expectString, `url`], + Whitelist: [, _json, `whitelist`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListHarvestJobsCommand + * deserializeAws_restJson1ListChannelsCommand */ -export const de_ListHarvestJobsCommand = async ( +export const de_ListChannelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListHarvestJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - HarvestJobs: [, (_) => de___listOfHarvestJob(_, context), `harvestJobs`], + Channels: [, (_) => de___listOfChannel(_, context), `channels`], NextToken: [, __expectString, `nextToken`], }); Object.assign(contents, doc); @@ -1204,44 +772,25 @@ export const de_ListHarvestJobsCommand = async ( }; /** - * deserializeAws_restJson1ListHarvestJobsCommandError + * deserializeAws_restJson1ListHarvestJobsCommand */ -const de_ListHarvestJobsCommandError = async ( +export const de_ListHarvestJobsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackage#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackage#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackage#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackage#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackage#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + HarvestJobs: [, (_) => de___listOfHarvestJob(_, context), `harvestJobs`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1252,7 +801,7 @@ export const de_ListOriginEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOriginEndpointsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1266,47 +815,6 @@ export const de_ListOriginEndpointsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListOriginEndpointsCommandError - */ -const de_ListOriginEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackage#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackage#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackage#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackage#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackage#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1315,7 +823,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1328,26 +836,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1RotateChannelCredentialsCommand */ @@ -1356,7 +844,7 @@ export const de_RotateChannelCredentialsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RotateChannelCredentialsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1376,47 +864,6 @@ export const de_RotateChannelCredentialsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RotateChannelCredentialsCommandError - */ -const de_RotateChannelCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackage#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackage#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackage#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackage#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackage#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RotateIngestEndpointCredentialsCommand */ @@ -1425,7 +872,7 @@ export const de_RotateIngestEndpointCredentialsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RotateIngestEndpointCredentialsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1445,47 +892,6 @@ export const de_RotateIngestEndpointCredentialsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RotateIngestEndpointCredentialsCommandError - */ -const de_RotateIngestEndpointCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackage#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackage#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackage#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackage#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackage#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1494,7 +900,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1503,26 +909,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1531,7 +917,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1540,26 +926,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1UpdateChannelCommand */ @@ -1568,7 +934,7 @@ export const de_UpdateChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1588,47 +954,6 @@ export const de_UpdateChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateChannelCommandError - */ -const de_UpdateChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ForbiddenException": - case "com.amazonaws.mediapackage#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mediapackage#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mediapackage#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mediapackage#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mediapackage#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnprocessableEntityException": - case "com.amazonaws.mediapackage#UnprocessableEntityException": - throw await de_UnprocessableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateOriginEndpointCommand */ @@ -1637,7 +962,7 @@ export const de_UpdateOriginEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateOriginEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1667,12 +992,9 @@ export const de_UpdateOriginEndpointCommand = async ( }; /** - * deserializeAws_restJson1UpdateOriginEndpointCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateOriginEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1703,7 +1025,7 @@ const de_UpdateOriginEndpointCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-mediapackagev2/src/protocols/Aws_restJson1.ts b/clients/client-mediapackagev2/src/protocols/Aws_restJson1.ts index 9389ffb0d06d..0439b1662a48 100644 --- a/clients/client-mediapackagev2/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediapackagev2/src/protocols/Aws_restJson1.ts @@ -613,7 +613,7 @@ export const de_CreateChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -633,50 +633,6 @@ export const de_CreateChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateChannelCommandError - */ -const de_CreateChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediapackagev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mediapackagev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mediapackagev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateChannelGroupCommand */ @@ -685,7 +641,7 @@ export const de_CreateChannelGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateChannelGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -704,50 +660,6 @@ export const de_CreateChannelGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateChannelGroupCommandError - */ -const de_CreateChannelGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediapackagev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mediapackagev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mediapackagev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateOriginEndpointCommand */ @@ -756,7 +668,7 @@ export const de_CreateOriginEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateOriginEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -781,50 +693,6 @@ export const de_CreateOriginEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateOriginEndpointCommandError - */ -const de_CreateOriginEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediapackagev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mediapackagev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mediapackagev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteChannelCommand */ @@ -833,7 +701,7 @@ export const de_DeleteChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -842,44 +710,6 @@ export const de_DeleteChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteChannelCommandError - */ -const de_DeleteChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediapackagev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteChannelGroupCommand */ @@ -888,7 +718,7 @@ export const de_DeleteChannelGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteChannelGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -897,44 +727,6 @@ export const de_DeleteChannelGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteChannelGroupCommandError - */ -const de_DeleteChannelGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediapackagev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteChannelPolicyCommand */ @@ -943,7 +735,7 @@ export const de_DeleteChannelPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteChannelPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -953,52 +745,31 @@ export const de_DeleteChannelPolicyCommand = async ( }; /** - * deserializeAws_restJson1DeleteChannelPolicyCommandError + * deserializeAws_restJson1DeleteOriginEndpointCommand */ -const de_DeleteChannelPolicyCommandError = async ( +export const de_DeleteOriginEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediapackagev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteOriginEndpointCommand + * deserializeAws_restJson1DeleteOriginEndpointPolicyCommand */ -export const de_DeleteOriginEndpointCommand = async ( +export const de_DeleteOriginEndpointPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteOriginEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1008,104 +779,14 @@ export const de_DeleteOriginEndpointCommand = async ( }; /** - * deserializeAws_restJson1DeleteOriginEndpointCommandError + * deserializeAws_restJson1GetChannelCommand */ -const de_DeleteOriginEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteOriginEndpointPolicyCommand - */ -export const de_DeleteOriginEndpointPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteOriginEndpointPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteOriginEndpointPolicyCommandError - */ -const de_DeleteOriginEndpointPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediapackagev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetChannelCommand - */ -export const de_GetChannelCommand = async ( +export const de_GetChannelCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1125,44 +806,6 @@ export const de_GetChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetChannelCommandError - */ -const de_GetChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mediapackagev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetChannelGroupCommand */ @@ -1171,7 +814,7 @@ export const de_GetChannelGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChannelGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1190,44 +833,6 @@ export const de_GetChannelGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetChannelGroupCommandError - */ -const de_GetChannelGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mediapackagev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetChannelPolicyCommand */ @@ -1236,7 +841,7 @@ export const de_GetChannelPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChannelPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1251,44 +856,6 @@ export const de_GetChannelPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetChannelPolicyCommandError - */ -const de_GetChannelPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mediapackagev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetOriginEndpointCommand */ @@ -1297,7 +864,7 @@ export const de_GetOriginEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOriginEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1322,44 +889,6 @@ export const de_GetOriginEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetOriginEndpointCommandError - */ -const de_GetOriginEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mediapackagev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetOriginEndpointPolicyCommand */ @@ -1368,7 +897,7 @@ export const de_GetOriginEndpointPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOriginEndpointPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1384,44 +913,6 @@ export const de_GetOriginEndpointPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetOriginEndpointPolicyCommandError - */ -const de_GetOriginEndpointPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mediapackagev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListChannelGroupsCommand */ @@ -1430,7 +921,7 @@ export const de_ListChannelGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1438,270 +929,92 @@ export const de_ListChannelGroupsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { Items: (_) => de_ChannelGroupsList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListChannelGroupsCommandError - */ -const de_ListChannelGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListChannelsCommand - */ -export const de_ListChannelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Items: (_) => de_ChannelList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListChannelsCommandError - */ -const de_ListChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mediapackagev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListOriginEndpointsCommand - */ -export const de_ListOriginEndpointsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOriginEndpointsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Items: (_) => de_OriginEndpointsList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListOriginEndpointsCommandError - */ -const de_ListOriginEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mediapackagev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListChannelsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListChannelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: [, _json, `tags`], + Items: (_) => de_ChannelList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListOriginEndpointsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListOriginEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Items: (_) => de_OriginEndpointsList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutChannelPolicyCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_PutChannelPolicyCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutChannelPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Tags: [, _json, `tags`], + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutChannelPolicyCommandError + * deserializeAws_restJson1PutChannelPolicyCommand */ -const de_PutChannelPolicyCommandError = async ( +export const de_PutChannelPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediapackagev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mediapackagev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -1712,7 +1025,7 @@ export const de_PutOriginEndpointPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutOriginEndpointPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1721,47 +1034,6 @@ export const de_PutOriginEndpointPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutOriginEndpointPolicyCommandError - */ -const de_PutOriginEndpointPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediapackagev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mediapackagev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1770,7 +1042,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1779,32 +1051,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1813,7 +1059,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1822,32 +1068,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateChannelCommand */ @@ -1856,7 +1076,7 @@ export const de_UpdateChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1876,47 +1096,6 @@ export const de_UpdateChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateChannelCommandError - */ -const de_UpdateChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediapackagev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mediapackagev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateChannelGroupCommand */ @@ -1925,7 +1104,7 @@ export const de_UpdateChannelGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChannelGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1944,47 +1123,6 @@ export const de_UpdateChannelGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateChannelGroupCommandError - */ -const de_UpdateChannelGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mediapackagev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mediapackagev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mediapackagev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mediapackagev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mediapackagev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mediapackagev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateOriginEndpointCommand */ @@ -1993,7 +1131,7 @@ export const de_UpdateOriginEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateOriginEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2019,12 +1157,9 @@ export const de_UpdateOriginEndpointCommand = async ( }; /** - * deserializeAws_restJson1UpdateOriginEndpointCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateOriginEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2058,7 +1193,7 @@ const de_UpdateOriginEndpointCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts b/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts index 8fcda1d6ad1e..2ca9232994a6 100644 --- a/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediastore-data/src/protocols/Aws_restJson1.ts @@ -143,7 +143,7 @@ export const de_DeleteObjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -152,38 +152,6 @@ export const de_DeleteObjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteObjectCommandError - */ -const de_DeleteObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerNotFoundException": - case "com.amazonaws.mediastoredata#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastoredata#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ObjectNotFoundException": - case "com.amazonaws.mediastoredata#ObjectNotFoundException": - throw await de_ObjectNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeObjectCommand */ @@ -192,7 +160,7 @@ export const de_DescribeObjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -206,38 +174,6 @@ export const de_DescribeObjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeObjectCommandError - */ -const de_DescribeObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerNotFoundException": - case "com.amazonaws.mediastoredata#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastoredata#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ObjectNotFoundException": - case "com.amazonaws.mediastoredata#ObjectNotFoundException": - throw await de_ObjectNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetObjectCommand */ @@ -246,7 +182,7 @@ export const de_GetObjectCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -266,41 +202,6 @@ export const de_GetObjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetObjectCommandError - */ -const de_GetObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerNotFoundException": - case "com.amazonaws.mediastoredata#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastoredata#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ObjectNotFoundException": - case "com.amazonaws.mediastoredata#ObjectNotFoundException": - throw await de_ObjectNotFoundExceptionRes(parsedOutput, context); - case "RequestedRangeNotSatisfiableException": - case "com.amazonaws.mediastoredata#RequestedRangeNotSatisfiableException": - throw await de_RequestedRangeNotSatisfiableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListItemsCommand */ @@ -309,7 +210,7 @@ export const de_ListItemsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListItemsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -323,35 +224,6 @@ export const de_ListItemsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListItemsCommandError - */ -const de_ListItemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerNotFoundException": - case "com.amazonaws.mediastoredata#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastoredata#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutObjectCommand */ @@ -360,7 +232,7 @@ export const de_PutObjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -376,12 +248,9 @@ export const de_PutObjectCommand = async ( }; /** - * deserializeAws_restJson1PutObjectCommandError + * deserialize_Aws_restJson1CommandError */ -const de_PutObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -394,13 +263,19 @@ const de_PutObjectCommandError = async ( case "InternalServerError": case "com.amazonaws.mediastoredata#InternalServerError": throw await de_InternalServerErrorRes(parsedOutput, context); + case "ObjectNotFoundException": + case "com.amazonaws.mediastoredata#ObjectNotFoundException": + throw await de_ObjectNotFoundExceptionRes(parsedOutput, context); + case "RequestedRangeNotSatisfiableException": + case "com.amazonaws.mediastoredata#RequestedRangeNotSatisfiableException": + throw await de_RequestedRangeNotSatisfiableExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-mediastore/src/protocols/Aws_json1_1.ts b/clients/client-mediastore/src/protocols/Aws_json1_1.ts index e10fc875a456..22f4143af054 100644 --- a/clients/client-mediastore/src/protocols/Aws_json1_1.ts +++ b/clients/client-mediastore/src/protocols/Aws_json1_1.ts @@ -370,7 +370,7 @@ export const de_CreateContainerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateContainerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -382,38 +382,6 @@ export const de_CreateContainerCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateContainerCommandError - */ -const de_CreateContainerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.mediastore#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteContainerCommand */ @@ -422,7 +390,7 @@ export const de_DeleteContainerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteContainerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -434,38 +402,6 @@ export const de_DeleteContainerCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteContainerCommandError - */ -const de_DeleteContainerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteContainerPolicyCommand */ @@ -474,7 +410,7 @@ export const de_DeleteContainerPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteContainerPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -486,41 +422,6 @@ export const de_DeleteContainerPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteContainerPolicyCommandError - */ -const de_DeleteContainerPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "PolicyNotFoundException": - case "com.amazonaws.mediastore#PolicyNotFoundException": - throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteCorsPolicyCommand */ @@ -529,7 +430,7 @@ export const de_DeleteCorsPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCorsPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -541,41 +442,6 @@ export const de_DeleteCorsPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteCorsPolicyCommandError - */ -const de_DeleteCorsPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "CorsPolicyNotFoundException": - case "com.amazonaws.mediastore#CorsPolicyNotFoundException": - throw await de_CorsPolicyNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteLifecyclePolicyCommand */ @@ -584,7 +450,7 @@ export const de_DeleteLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -596,41 +462,6 @@ export const de_DeleteLifecyclePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteLifecyclePolicyCommandError - */ -const de_DeleteLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "PolicyNotFoundException": - case "com.amazonaws.mediastore#PolicyNotFoundException": - throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteMetricPolicyCommand */ @@ -639,7 +470,7 @@ export const de_DeleteMetricPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteMetricPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -651,41 +482,6 @@ export const de_DeleteMetricPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteMetricPolicyCommandError - */ -const de_DeleteMetricPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "PolicyNotFoundException": - case "com.amazonaws.mediastore#PolicyNotFoundException": - throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeContainerCommand */ @@ -694,7 +490,7 @@ export const de_DescribeContainerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeContainerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -706,35 +502,6 @@ export const de_DescribeContainerCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeContainerCommandError - */ -const de_DescribeContainerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetContainerPolicyCommand */ @@ -743,7 +510,7 @@ export const de_GetContainerPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetContainerPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -755,41 +522,6 @@ export const de_GetContainerPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetContainerPolicyCommandError - */ -const de_GetContainerPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "PolicyNotFoundException": - case "com.amazonaws.mediastore#PolicyNotFoundException": - throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetCorsPolicyCommand */ @@ -798,7 +530,7 @@ export const de_GetCorsPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCorsPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -810,41 +542,6 @@ export const de_GetCorsPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCorsPolicyCommandError - */ -const de_GetCorsPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "CorsPolicyNotFoundException": - case "com.amazonaws.mediastore#CorsPolicyNotFoundException": - throw await de_CorsPolicyNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetLifecyclePolicyCommand */ @@ -853,7 +550,7 @@ export const de_GetLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -865,41 +562,6 @@ export const de_GetLifecyclePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetLifecyclePolicyCommandError - */ -const de_GetLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "PolicyNotFoundException": - case "com.amazonaws.mediastore#PolicyNotFoundException": - throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetMetricPolicyCommand */ @@ -908,7 +570,7 @@ export const de_GetMetricPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetMetricPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -920,41 +582,6 @@ export const de_GetMetricPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetMetricPolicyCommandError - */ -const de_GetMetricPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "PolicyNotFoundException": - case "com.amazonaws.mediastore#PolicyNotFoundException": - throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListContainersCommand */ @@ -963,42 +590,16 @@ export const de_ListContainersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListContainersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListContainersOutput(data, context); - const response: ListContainersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListContainersCommandError - */ -const de_ListContainersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + contents = de_ListContainersOutput(data, context); + const response: ListContainersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1009,7 +610,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1021,38 +622,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutContainerPolicyCommand */ @@ -1061,7 +630,7 @@ export const de_PutContainerPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutContainerPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1073,38 +642,6 @@ export const de_PutContainerPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutContainerPolicyCommandError - */ -const de_PutContainerPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutCorsPolicyCommand */ @@ -1113,7 +650,7 @@ export const de_PutCorsPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutCorsPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1125,38 +662,6 @@ export const de_PutCorsPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutCorsPolicyCommandError - */ -const de_PutCorsPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutLifecyclePolicyCommand */ @@ -1165,7 +670,7 @@ export const de_PutLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1177,38 +682,6 @@ export const de_PutLifecyclePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutLifecyclePolicyCommandError - */ -const de_PutLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutMetricPolicyCommand */ @@ -1217,7 +690,7 @@ export const de_PutMetricPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutMetricPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1229,38 +702,6 @@ export const de_PutMetricPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutMetricPolicyCommandError - */ -const de_PutMetricPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartAccessLoggingCommand */ @@ -1269,7 +710,7 @@ export const de_StartAccessLoggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartAccessLoggingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1281,38 +722,6 @@ export const de_StartAccessLoggingCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartAccessLoggingCommandError - */ -const de_StartAccessLoggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopAccessLoggingCommand */ @@ -1321,7 +730,7 @@ export const de_StopAccessLoggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopAccessLoggingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1333,38 +742,6 @@ export const de_StopAccessLoggingCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopAccessLoggingCommandError - */ -const de_StopAccessLoggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -1373,7 +750,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1385,38 +762,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ContainerInUseException": - case "com.amazonaws.mediastore#ContainerInUseException": - throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.mediastore#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -1425,7 +770,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1438,12 +783,9 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1453,19 +795,28 @@ const de_UntagResourceCommandError = async ( case "ContainerInUseException": case "com.amazonaws.mediastore#ContainerInUseException": throw await de_ContainerInUseExceptionRes(parsedOutput, context); - case "ContainerNotFoundException": - case "com.amazonaws.mediastore#ContainerNotFoundException": - throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); case "InternalServerError": case "com.amazonaws.mediastore#InternalServerError": throw await de_InternalServerErrorRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.mediastore#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ContainerNotFoundException": + case "com.amazonaws.mediastore#ContainerNotFoundException": + throw await de_ContainerNotFoundExceptionRes(parsedOutput, context); + case "PolicyNotFoundException": + case "com.amazonaws.mediastore#PolicyNotFoundException": + throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); + case "CorsPolicyNotFoundException": + case "com.amazonaws.mediastore#CorsPolicyNotFoundException": + throw await de_CorsPolicyNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-mediatailor/src/protocols/Aws_restJson1.ts b/clients/client-mediatailor/src/protocols/Aws_restJson1.ts index d63643e7fd9b..89b1a2f960b3 100644 --- a/clients/client-mediatailor/src/protocols/Aws_restJson1.ts +++ b/clients/client-mediatailor/src/protocols/Aws_restJson1.ts @@ -1081,7 +1081,7 @@ export const de_ConfigureLogsForChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ConfigureLogsForChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1095,26 +1095,6 @@ export const de_ConfigureLogsForChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ConfigureLogsForChannelCommandError - */ -const de_ConfigureLogsForChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ConfigureLogsForPlaybackConfigurationCommand */ @@ -1123,7 +1103,7 @@ export const de_ConfigureLogsForPlaybackConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ConfigureLogsForPlaybackConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1137,26 +1117,6 @@ export const de_ConfigureLogsForPlaybackConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ConfigureLogsForPlaybackConfigurationCommandError - */ -const de_ConfigureLogsForPlaybackConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1CreateChannelCommand */ @@ -1165,7 +1125,7 @@ export const de_CreateChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1188,26 +1148,6 @@ export const de_CreateChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateChannelCommandError - */ -const de_CreateChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1CreateLiveSourceCommand */ @@ -1216,7 +1156,7 @@ export const de_CreateLiveSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLiveSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1235,26 +1175,6 @@ export const de_CreateLiveSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLiveSourceCommandError - */ -const de_CreateLiveSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1CreatePrefetchScheduleCommand */ @@ -1263,7 +1183,7 @@ export const de_CreatePrefetchScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePrefetchScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1281,26 +1201,6 @@ export const de_CreatePrefetchScheduleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePrefetchScheduleCommandError - */ -const de_CreatePrefetchScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1CreateProgramCommand */ @@ -1309,7 +1209,7 @@ export const de_CreateProgramCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateProgramCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1332,26 +1232,6 @@ export const de_CreateProgramCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProgramCommandError - */ -const de_CreateProgramCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1CreateSourceLocationCommand */ @@ -1360,7 +1240,7 @@ export const de_CreateSourceLocationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSourceLocationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1381,26 +1261,6 @@ export const de_CreateSourceLocationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSourceLocationCommandError - */ -const de_CreateSourceLocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1CreateVodSourceCommand */ @@ -1409,7 +1269,7 @@ export const de_CreateVodSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateVodSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1428,26 +1288,6 @@ export const de_CreateVodSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateVodSourceCommandError - */ -const de_CreateVodSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1DeleteChannelCommand */ @@ -1456,7 +1296,7 @@ export const de_DeleteChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1465,26 +1305,6 @@ export const de_DeleteChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteChannelCommandError - */ -const de_DeleteChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1DeleteChannelPolicyCommand */ @@ -1493,7 +1313,7 @@ export const de_DeleteChannelPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteChannelPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1502,26 +1322,6 @@ export const de_DeleteChannelPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteChannelPolicyCommandError - */ -const de_DeleteChannelPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1DeleteLiveSourceCommand */ @@ -1530,7 +1330,7 @@ export const de_DeleteLiveSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLiveSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1539,26 +1339,6 @@ export const de_DeleteLiveSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLiveSourceCommandError - */ -const de_DeleteLiveSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1DeletePlaybackConfigurationCommand */ @@ -1567,7 +1347,7 @@ export const de_DeletePlaybackConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeletePlaybackConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1576,26 +1356,6 @@ export const de_DeletePlaybackConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePlaybackConfigurationCommandError - */ -const de_DeletePlaybackConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1DeletePrefetchScheduleCommand */ @@ -1604,7 +1364,7 @@ export const de_DeletePrefetchScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeletePrefetchScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1613,26 +1373,6 @@ export const de_DeletePrefetchScheduleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePrefetchScheduleCommandError - */ -const de_DeletePrefetchScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1DeleteProgramCommand */ @@ -1641,7 +1381,7 @@ export const de_DeleteProgramCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProgramCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1650,26 +1390,6 @@ export const de_DeleteProgramCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteProgramCommandError - */ -const de_DeleteProgramCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1DeleteSourceLocationCommand */ @@ -1678,7 +1398,7 @@ export const de_DeleteSourceLocationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSourceLocationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1687,26 +1407,6 @@ export const de_DeleteSourceLocationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSourceLocationCommandError - */ -const de_DeleteSourceLocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1DeleteVodSourceCommand */ @@ -1715,7 +1415,7 @@ export const de_DeleteVodSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteVodSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1724,26 +1424,6 @@ export const de_DeleteVodSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteVodSourceCommandError - */ -const de_DeleteVodSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1DescribeChannelCommand */ @@ -1752,7 +1432,7 @@ export const de_DescribeChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1776,26 +1456,6 @@ export const de_DescribeChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeChannelCommandError - */ -const de_DescribeChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1DescribeLiveSourceCommand */ @@ -1804,7 +1464,7 @@ export const de_DescribeLiveSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeLiveSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1823,26 +1483,6 @@ export const de_DescribeLiveSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeLiveSourceCommandError - */ -const de_DescribeLiveSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1DescribeProgramCommand */ @@ -1851,7 +1491,7 @@ export const de_DescribeProgramCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeProgramCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1874,26 +1514,6 @@ export const de_DescribeProgramCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeProgramCommandError - */ -const de_DescribeProgramCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1DescribeSourceLocationCommand */ @@ -1902,7 +1522,7 @@ export const de_DescribeSourceLocationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSourceLocationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1924,34 +1544,14 @@ export const de_DescribeSourceLocationCommand = async ( }; /** - * deserializeAws_restJson1DescribeSourceLocationCommandError + * deserializeAws_restJson1DescribeVodSourceCommand */ -const de_DescribeSourceLocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_restJson1DescribeVodSourceCommand - */ -export const de_DescribeVodSourceCommand = async ( +export const de_DescribeVodSourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeVodSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1971,26 +1571,6 @@ export const de_DescribeVodSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeVodSourceCommandError - */ -const de_DescribeVodSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1GetChannelPolicyCommand */ @@ -1999,7 +1579,7 @@ export const de_GetChannelPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChannelPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2012,26 +1592,6 @@ export const de_GetChannelPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetChannelPolicyCommandError - */ -const de_GetChannelPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1GetChannelScheduleCommand */ @@ -2040,7 +1600,7 @@ export const de_GetChannelScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChannelScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2054,26 +1614,6 @@ export const de_GetChannelScheduleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetChannelScheduleCommandError - */ -const de_GetChannelScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1GetPlaybackConfigurationCommand */ @@ -2082,7 +1622,7 @@ export const de_GetPlaybackConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPlaybackConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2113,26 +1653,6 @@ export const de_GetPlaybackConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetPlaybackConfigurationCommandError - */ -const de_GetPlaybackConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1GetPrefetchScheduleCommand */ @@ -2141,7 +1661,7 @@ export const de_GetPrefetchScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPrefetchScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2159,26 +1679,6 @@ export const de_GetPrefetchScheduleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetPrefetchScheduleCommandError - */ -const de_GetPrefetchScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListAlertsCommand */ @@ -2187,7 +1687,7 @@ export const de_ListAlertsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAlertsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2201,26 +1701,6 @@ export const de_ListAlertsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAlertsCommandError - */ -const de_ListAlertsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListChannelsCommand */ @@ -2229,7 +1709,7 @@ export const de_ListChannelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChannelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2243,26 +1723,6 @@ export const de_ListChannelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListChannelsCommandError - */ -const de_ListChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListLiveSourcesCommand */ @@ -2271,7 +1731,7 @@ export const de_ListLiveSourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLiveSourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2285,26 +1745,6 @@ export const de_ListLiveSourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListLiveSourcesCommandError - */ -const de_ListLiveSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListPlaybackConfigurationsCommand */ @@ -2313,7 +1753,7 @@ export const de_ListPlaybackConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPlaybackConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2327,26 +1767,6 @@ export const de_ListPlaybackConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListPlaybackConfigurationsCommandError - */ -const de_ListPlaybackConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListPrefetchSchedulesCommand */ @@ -2355,7 +1775,7 @@ export const de_ListPrefetchSchedulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPrefetchSchedulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2369,26 +1789,6 @@ export const de_ListPrefetchSchedulesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListPrefetchSchedulesCommandError - */ -const de_ListPrefetchSchedulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListSourceLocationsCommand */ @@ -2397,7 +1797,7 @@ export const de_ListSourceLocationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSourceLocationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2411,26 +1811,6 @@ export const de_ListSourceLocationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSourceLocationsCommandError - */ -const de_ListSourceLocationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -2439,7 +1819,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2452,32 +1832,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediatailor#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListVodSourcesCommand */ @@ -2486,7 +1840,7 @@ export const de_ListVodSourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVodSourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2500,26 +1854,6 @@ export const de_ListVodSourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListVodSourcesCommandError - */ -const de_ListVodSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1PutChannelPolicyCommand */ @@ -2528,7 +1862,7 @@ export const de_PutChannelPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutChannelPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2537,26 +1871,6 @@ export const de_PutChannelPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutChannelPolicyCommandError - */ -const de_PutChannelPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1PutPlaybackConfigurationCommand */ @@ -2565,7 +1879,7 @@ export const de_PutPlaybackConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutPlaybackConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2596,26 +1910,6 @@ export const de_PutPlaybackConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutPlaybackConfigurationCommandError - */ -const de_PutPlaybackConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1StartChannelCommand */ @@ -2624,7 +1918,7 @@ export const de_StartChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2633,26 +1927,6 @@ export const de_StartChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartChannelCommandError - */ -const de_StartChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1StopChannelCommand */ @@ -2661,7 +1935,7 @@ export const de_StopChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2670,26 +1944,6 @@ export const de_StopChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopChannelCommandError - */ -const de_StopChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2698,7 +1952,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2707,32 +1961,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediatailor#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2741,7 +1969,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2750,32 +1978,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mediatailor#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateChannelCommand */ @@ -2784,7 +1986,7 @@ export const de_UpdateChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2807,26 +2009,6 @@ export const de_UpdateChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateChannelCommandError - */ -const de_UpdateChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1UpdateLiveSourceCommand */ @@ -2835,7 +2017,7 @@ export const de_UpdateLiveSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLiveSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2854,26 +2036,6 @@ export const de_UpdateLiveSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLiveSourceCommandError - */ -const de_UpdateLiveSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1UpdateProgramCommand */ @@ -2882,7 +2044,7 @@ export const de_UpdateProgramCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProgramCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2905,26 +2067,6 @@ export const de_UpdateProgramCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateProgramCommandError - */ -const de_UpdateProgramCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1UpdateSourceLocationCommand */ @@ -2933,7 +2075,7 @@ export const de_UpdateSourceLocationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSourceLocationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2954,26 +2096,6 @@ export const de_UpdateSourceLocationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSourceLocationCommandError - */ -const de_UpdateSourceLocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1UpdateVodSourceCommand */ @@ -2982,7 +2104,7 @@ export const de_UpdateVodSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVodSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3002,23 +2124,26 @@ export const de_UpdateVodSourceCommand = async ( }; /** - * deserializeAws_restJson1UpdateVodSourceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateVodSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + switch (errorCode) { + case "BadRequestException": + case "com.amazonaws.mediatailor#BadRequestException": + throw await de_BadRequestExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }) as never; + } }; const throwDefaultError = withBaseException(__BaseException); diff --git a/clients/client-medical-imaging/src/protocols/Aws_restJson1.ts b/clients/client-medical-imaging/src/protocols/Aws_restJson1.ts index 2292bfa170c5..6347242c09af 100644 --- a/clients/client-medical-imaging/src/protocols/Aws_restJson1.ts +++ b/clients/client-medical-imaging/src/protocols/Aws_restJson1.ts @@ -557,7 +557,7 @@ export const de_CopyImageSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CopyImageSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -572,50 +572,6 @@ export const de_CopyImageSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CopyImageSetCommandError - */ -const de_CopyImageSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medicalimaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.medicalimaging#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.medicalimaging#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDatastoreCommand */ @@ -624,7 +580,7 @@ export const de_CreateDatastoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDatastoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -638,47 +594,6 @@ export const de_CreateDatastoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDatastoreCommandError - */ -const de_CreateDatastoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medicalimaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.medicalimaging#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDatastoreCommand */ @@ -687,7 +602,7 @@ export const de_DeleteDatastoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDatastoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -701,47 +616,6 @@ export const de_DeleteDatastoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDatastoreCommandError - */ -const de_DeleteDatastoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medicalimaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.medicalimaging#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteImageSetCommand */ @@ -750,7 +624,7 @@ export const de_DeleteImageSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteImageSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -766,47 +640,6 @@ export const de_DeleteImageSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteImageSetCommandError - */ -const de_DeleteImageSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medicalimaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.medicalimaging#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDatastoreCommand */ @@ -815,7 +648,7 @@ export const de_GetDatastoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDatastoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -828,44 +661,6 @@ export const de_GetDatastoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDatastoreCommandError - */ -const de_GetDatastoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.medicalimaging#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDICOMImportJobCommand */ @@ -874,7 +669,7 @@ export const de_GetDICOMImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDICOMImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -887,47 +682,6 @@ export const de_GetDICOMImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDICOMImportJobCommandError - */ -const de_GetDICOMImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medicalimaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.medicalimaging#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetImageFrameCommand */ @@ -936,7 +690,7 @@ export const de_GetImageFrameCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImageFrameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -948,47 +702,6 @@ export const de_GetImageFrameCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetImageFrameCommandError - */ -const de_GetImageFrameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medicalimaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.medicalimaging#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetImageSetCommand */ @@ -997,7 +710,7 @@ export const de_GetImageSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImageSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1019,47 +732,6 @@ export const de_GetImageSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetImageSetCommandError - */ -const de_GetImageSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medicalimaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.medicalimaging#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetImageSetMetadataCommand */ @@ -1068,7 +740,7 @@ export const de_GetImageSetMetadataCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImageSetMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1076,188 +748,27 @@ export const de_GetImageSetMetadataCommand = async ( [_cE]: [, output.headers[_ce]], }); const data: any = output.body; - context.sdkStreamMixin(data); - contents.imageSetMetadataBlob = data; - return contents; -}; - -/** - * deserializeAws_restJson1GetImageSetMetadataCommandError - */ -const de_GetImageSetMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medicalimaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.medicalimaging#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDatastoresCommand - */ -export const de_ListDatastoresCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDatastoresCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - datastoreSummaries: (_) => de_DatastoreSummaries(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDatastoresCommandError - */ -const de_ListDatastoresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDICOMImportJobsCommand - */ -export const de_ListDICOMImportJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDICOMImportJobsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - jobSummaries: (_) => de_DICOMImportJobSummaries(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDICOMImportJobsCommandError - */ -const de_ListDICOMImportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medicalimaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.medicalimaging#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + context.sdkStreamMixin(data); + contents.imageSetMetadataBlob = data; + return contents; }; /** - * deserializeAws_restJson1ListImageSetVersionsCommand + * deserializeAws_restJson1ListDatastoresCommand */ -export const de_ListImageSetVersionsCommand = async ( +export const de_ListDatastoresCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImageSetVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - imageSetPropertiesList: (_) => de_ImageSetPropertiesList(_, context), + datastoreSummaries: (_) => de_DatastoreSummaries(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -1265,103 +776,68 @@ export const de_ListImageSetVersionsCommand = async ( }; /** - * deserializeAws_restJson1ListImageSetVersionsCommandError + * deserializeAws_restJson1ListDICOMImportJobsCommand */ -const de_ListImageSetVersionsCommandError = async ( +export const de_ListDICOMImportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medicalimaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.medicalimaging#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + jobSummaries: (_) => de_DICOMImportJobSummaries(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListImageSetVersionsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListImageSetVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + imageSetPropertiesList: (_) => de_ImageSetPropertiesList(_, context), + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.medicalimaging#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1372,7 +848,7 @@ export const de_SearchImageSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchImageSetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1386,47 +862,6 @@ export const de_SearchImageSetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchImageSetsCommandError - */ -const de_SearchImageSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medicalimaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.medicalimaging#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartDICOMImportJobCommand */ @@ -1435,7 +870,7 @@ export const de_StartDICOMImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartDICOMImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1451,50 +886,6 @@ export const de_StartDICOMImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartDICOMImportJobCommandError - */ -const de_StartDICOMImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.medicalimaging#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.medicalimaging#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.medicalimaging#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1503,7 +894,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1512,44 +903,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.medicalimaging#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1558,7 +911,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1567,44 +920,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.medicalimaging#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.medicalimaging#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.medicalimaging#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.medicalimaging#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.medicalimaging#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateImageSetMetadataCommand */ @@ -1613,7 +928,7 @@ export const de_UpdateImageSetMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateImageSetMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1634,12 +949,9 @@ export const de_UpdateImageSetMetadataCommand = async ( }; /** - * deserializeAws_restJson1UpdateImageSetMetadataCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateImageSetMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1673,7 +985,7 @@ const de_UpdateImageSetMetadataCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-memorydb/src/protocols/Aws_json1_1.ts b/clients/client-memorydb/src/protocols/Aws_json1_1.ts index 399e8803082b..da31a51eae2a 100644 --- a/clients/client-memorydb/src/protocols/Aws_json1_1.ts +++ b/clients/client-memorydb/src/protocols/Aws_json1_1.ts @@ -729,7 +729,7 @@ export const de_BatchUpdateClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchUpdateClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -741,35 +741,6 @@ export const de_BatchUpdateClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchUpdateClusterCommandError - */ -const de_BatchUpdateClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceUpdateNotFoundFault": - case "com.amazonaws.memorydb#ServiceUpdateNotFoundFault": - throw await de_ServiceUpdateNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CopySnapshotCommand */ @@ -778,7 +749,7 @@ export const de_CopySnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopySnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -790,53 +761,6 @@ export const de_CopySnapshotCommand = async ( return response; }; -/** - * deserializeAws_json1_1CopySnapshotCommandError - */ -const de_CopySnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidSnapshotStateFault": - case "com.amazonaws.memorydb#InvalidSnapshotStateFault": - throw await de_InvalidSnapshotStateFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "SnapshotAlreadyExistsFault": - case "com.amazonaws.memorydb#SnapshotAlreadyExistsFault": - throw await de_SnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "SnapshotNotFoundFault": - case "com.amazonaws.memorydb#SnapshotNotFoundFault": - throw await de_SnapshotNotFoundFaultRes(parsedOutput, context); - case "SnapshotQuotaExceededFault": - case "com.amazonaws.memorydb#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.memorydb#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateACLCommand */ @@ -845,7 +769,7 @@ export const de_CreateACLCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -857,50 +781,6 @@ export const de_CreateACLCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateACLCommandError - */ -const de_CreateACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ACLAlreadyExistsFault": - case "com.amazonaws.memorydb#ACLAlreadyExistsFault": - throw await de_ACLAlreadyExistsFaultRes(parsedOutput, context); - case "ACLQuotaExceededFault": - case "com.amazonaws.memorydb#ACLQuotaExceededFault": - throw await de_ACLQuotaExceededFaultRes(parsedOutput, context); - case "DefaultUserRequired": - case "com.amazonaws.memorydb#DefaultUserRequired": - throw await de_DefaultUserRequiredRes(parsedOutput, context); - case "DuplicateUserNameFault": - case "com.amazonaws.memorydb#DuplicateUserNameFault": - throw await de_DuplicateUserNameFaultRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.memorydb#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - case "UserNotFoundFault": - case "com.amazonaws.memorydb#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateClusterCommand */ @@ -909,7 +789,7 @@ export const de_CreateClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -922,90 +802,39 @@ export const de_CreateClusterCommand = async ( }; /** - * deserializeAws_json1_1CreateClusterCommandError + * deserializeAws_json1_1CreateParameterGroupCommand */ -const de_CreateClusterCommandError = async ( +export const de_CreateParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ACLNotFoundFault": - case "com.amazonaws.memorydb#ACLNotFoundFault": - throw await de_ACLNotFoundFaultRes(parsedOutput, context); - case "ClusterAlreadyExistsFault": - case "com.amazonaws.memorydb#ClusterAlreadyExistsFault": - throw await de_ClusterAlreadyExistsFaultRes(parsedOutput, context); - case "ClusterQuotaForCustomerExceededFault": - case "com.amazonaws.memorydb#ClusterQuotaForCustomerExceededFault": - throw await de_ClusterQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "InsufficientClusterCapacityFault": - case "com.amazonaws.memorydb#InsufficientClusterCapacityFault": - throw await de_InsufficientClusterCapacityFaultRes(parsedOutput, context); - case "InvalidACLStateFault": - case "com.amazonaws.memorydb#InvalidACLStateFault": - throw await de_InvalidACLStateFaultRes(parsedOutput, context); - case "InvalidCredentialsException": - case "com.amazonaws.memorydb#InvalidCredentialsException": - throw await de_InvalidCredentialsExceptionRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.memorydb#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "NodeQuotaForClusterExceededFault": - case "com.amazonaws.memorydb#NodeQuotaForClusterExceededFault": - throw await de_NodeQuotaForClusterExceededFaultRes(parsedOutput, context); - case "NodeQuotaForCustomerExceededFault": - case "com.amazonaws.memorydb#NodeQuotaForCustomerExceededFault": - throw await de_NodeQuotaForCustomerExceededFaultRes(parsedOutput, context); - case "ParameterGroupNotFoundFault": - case "com.amazonaws.memorydb#ParameterGroupNotFoundFault": - throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "ShardsPerClusterQuotaExceededFault": - case "com.amazonaws.memorydb#ShardsPerClusterQuotaExceededFault": - throw await de_ShardsPerClusterQuotaExceededFaultRes(parsedOutput, context); - case "SubnetGroupNotFoundFault": - case "com.amazonaws.memorydb#SubnetGroupNotFoundFault": - throw await de_SubnetGroupNotFoundFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.memorydb#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateParameterGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateParameterGroupCommand + * deserializeAws_json1_1CreateSnapshotCommand */ -export const de_CreateParameterGroupCommand = async ( +export const de_CreateSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: CreateParameterGroupCommandOutput = { + contents = de_CreateSnapshotResponse(data, context); + const response: CreateSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1013,63 +842,39 @@ export const de_CreateParameterGroupCommand = async ( }; /** - * deserializeAws_json1_1CreateParameterGroupCommandError + * deserializeAws_json1_1CreateSubnetGroupCommand */ -const de_CreateParameterGroupCommandError = async ( +export const de_CreateSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterGroupStateFault": - case "com.amazonaws.memorydb#InvalidParameterGroupStateFault": - throw await de_InvalidParameterGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ParameterGroupAlreadyExistsFault": - case "com.amazonaws.memorydb#ParameterGroupAlreadyExistsFault": - throw await de_ParameterGroupAlreadyExistsFaultRes(parsedOutput, context); - case "ParameterGroupQuotaExceededFault": - case "com.amazonaws.memorydb#ParameterGroupQuotaExceededFault": - throw await de_ParameterGroupQuotaExceededFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.memorydb#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateSubnetGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateSnapshotCommand + * deserializeAws_json1_1CreateUserCommand */ -export const de_CreateSnapshotCommand = async ( +export const de_CreateUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateSnapshotResponse(data, context); - const response: CreateSnapshotCommandOutput = { + contents = _json(data); + const response: CreateUserCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1077,66 +882,19 @@ export const de_CreateSnapshotCommand = async ( }; /** - * deserializeAws_json1_1CreateSnapshotCommandError + * deserializeAws_json1_1DeleteACLCommand */ -const de_CreateSnapshotCommandError = async ( +export const de_DeleteACLCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFoundFault": - case "com.amazonaws.memorydb#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.memorydb#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "SnapshotAlreadyExistsFault": - case "com.amazonaws.memorydb#SnapshotAlreadyExistsFault": - throw await de_SnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "SnapshotQuotaExceededFault": - case "com.amazonaws.memorydb#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.memorydb#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateSubnetGroupCommand - */ -export const de_CreateSubnetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateSubnetGroupCommandOutput = { + const response: DeleteACLCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1144,63 +902,39 @@ export const de_CreateSubnetGroupCommand = async ( }; /** - * deserializeAws_json1_1CreateSubnetGroupCommandError + * deserializeAws_json1_1DeleteClusterCommand */ -const de_CreateSubnetGroupCommandError = async ( +export const de_DeleteClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidSubnet": - case "com.amazonaws.memorydb#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "SubnetGroupAlreadyExistsFault": - case "com.amazonaws.memorydb#SubnetGroupAlreadyExistsFault": - throw await de_SubnetGroupAlreadyExistsFaultRes(parsedOutput, context); - case "SubnetGroupQuotaExceededFault": - case "com.amazonaws.memorydb#SubnetGroupQuotaExceededFault": - throw await de_SubnetGroupQuotaExceededFaultRes(parsedOutput, context); - case "SubnetNotAllowedFault": - case "com.amazonaws.memorydb#SubnetNotAllowedFault": - throw await de_SubnetNotAllowedFaultRes(parsedOutput, context); - case "SubnetQuotaExceededFault": - case "com.amazonaws.memorydb#SubnetQuotaExceededFault": - throw await de_SubnetQuotaExceededFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.memorydb#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteClusterResponse(data, context); + const response: DeleteClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateUserCommand + * deserializeAws_json1_1DeleteParameterGroupCommand */ -export const de_CreateUserCommand = async ( +export const de_DeleteParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateUserCommandOutput = { + const response: DeleteParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1208,60 +942,39 @@ export const de_CreateUserCommand = async ( }; /** - * deserializeAws_json1_1CreateUserCommandError + * deserializeAws_json1_1DeleteSnapshotCommand */ -const de_CreateUserCommandError = async ( +export const de_DeleteSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateUserNameFault": - case "com.amazonaws.memorydb#DuplicateUserNameFault": - throw await de_DuplicateUserNameFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.memorydb#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - case "UserAlreadyExistsFault": - case "com.amazonaws.memorydb#UserAlreadyExistsFault": - throw await de_UserAlreadyExistsFaultRes(parsedOutput, context); - case "UserQuotaExceededFault": - case "com.amazonaws.memorydb#UserQuotaExceededFault": - throw await de_UserQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteSnapshotResponse(data, context); + const response: DeleteSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteACLCommand + * deserializeAws_json1_1DeleteSubnetGroupCommand */ -export const de_DeleteACLCommand = async ( +export const de_DeleteSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteACLCommandOutput = { + const response: DeleteSubnetGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1269,51 +982,39 @@ export const de_DeleteACLCommand = async ( }; /** - * deserializeAws_json1_1DeleteACLCommandError + * deserializeAws_json1_1DeleteUserCommand */ -const de_DeleteACLCommandError = async ( +export const de_DeleteUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ACLNotFoundFault": - case "com.amazonaws.memorydb#ACLNotFoundFault": - throw await de_ACLNotFoundFaultRes(parsedOutput, context); - case "InvalidACLStateFault": - case "com.amazonaws.memorydb#InvalidACLStateFault": - throw await de_InvalidACLStateFaultRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteUserCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteClusterCommand + * deserializeAws_json1_1DescribeACLsCommand */ -export const de_DeleteClusterCommand = async ( +export const de_DescribeACLsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteClusterResponse(data, context); - const response: DeleteClusterCommandOutput = { + contents = _json(data); + const response: DescribeACLsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1321,60 +1022,39 @@ export const de_DeleteClusterCommand = async ( }; /** - * deserializeAws_json1_1DeleteClusterCommandError + * deserializeAws_json1_1DescribeClustersCommand */ -const de_DeleteClusterCommandError = async ( +export const de_DescribeClustersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFoundFault": - case "com.amazonaws.memorydb#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.memorydb#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "SnapshotAlreadyExistsFault": - case "com.amazonaws.memorydb#SnapshotAlreadyExistsFault": - throw await de_SnapshotAlreadyExistsFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeClustersResponse(data, context); + const response: DescribeClustersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteParameterGroupCommand + * deserializeAws_json1_1DescribeEngineVersionsCommand */ -export const de_DeleteParameterGroupCommand = async ( +export const de_DescribeEngineVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteParameterGroupCommandOutput = { + const response: DescribeEngineVersionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1382,57 +1062,19 @@ export const de_DeleteParameterGroupCommand = async ( }; /** - * deserializeAws_json1_1DeleteParameterGroupCommandError + * deserializeAws_json1_1DescribeEventsCommand */ -const de_DeleteParameterGroupCommandError = async ( +export const de_DescribeEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterGroupStateFault": - case "com.amazonaws.memorydb#InvalidParameterGroupStateFault": - throw await de_InvalidParameterGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ParameterGroupNotFoundFault": - case "com.amazonaws.memorydb#ParameterGroupNotFoundFault": - throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteSnapshotCommand - */ -export const de_DeleteSnapshotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteSnapshotResponse(data, context); - const response: DeleteSnapshotCommandOutput = { + contents = de_DescribeEventsResponse(data, context); + const response: DescribeEventsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1440,57 +1082,19 @@ export const de_DeleteSnapshotCommand = async ( }; /** - * deserializeAws_json1_1DeleteSnapshotCommandError - */ -const de_DeleteSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidSnapshotStateFault": - case "com.amazonaws.memorydb#InvalidSnapshotStateFault": - throw await de_InvalidSnapshotStateFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "SnapshotNotFoundFault": - case "com.amazonaws.memorydb#SnapshotNotFoundFault": - throw await de_SnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteSubnetGroupCommand + * deserializeAws_json1_1DescribeParameterGroupsCommand */ -export const de_DeleteSubnetGroupCommand = async ( +export const de_DescribeParameterGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteSubnetGroupCommandOutput = { + const response: DescribeParameterGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1498,51 +1102,39 @@ export const de_DeleteSubnetGroupCommand = async ( }; /** - * deserializeAws_json1_1DeleteSubnetGroupCommandError + * deserializeAws_json1_1DescribeParametersCommand */ -const de_DeleteSubnetGroupCommandError = async ( +export const de_DescribeParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "SubnetGroupInUseFault": - case "com.amazonaws.memorydb#SubnetGroupInUseFault": - throw await de_SubnetGroupInUseFaultRes(parsedOutput, context); - case "SubnetGroupNotFoundFault": - case "com.amazonaws.memorydb#SubnetGroupNotFoundFault": - throw await de_SubnetGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeParametersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteUserCommand + * deserializeAws_json1_1DescribeReservedNodesCommand */ -export const de_DeleteUserCommand = async ( +export const de_DescribeReservedNodesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteUserCommandOutput = { + contents = de_DescribeReservedNodesResponse(data, context); + const response: DescribeReservedNodesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1550,51 +1142,39 @@ export const de_DeleteUserCommand = async ( }; /** - * deserializeAws_json1_1DeleteUserCommandError + * deserializeAws_json1_1DescribeReservedNodesOfferingsCommand */ -const de_DeleteUserCommandError = async ( +export const de_DescribeReservedNodesOfferingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidUserStateFault": - case "com.amazonaws.memorydb#InvalidUserStateFault": - throw await de_InvalidUserStateFaultRes(parsedOutput, context); - case "UserNotFoundFault": - case "com.amazonaws.memorydb#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeReservedNodesOfferingsResponse(data, context); + const response: DescribeReservedNodesOfferingsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeACLsCommand + * deserializeAws_json1_1DescribeServiceUpdatesCommand */ -export const de_DescribeACLsCommand = async ( +export const de_DescribeServiceUpdatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeACLsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeACLsCommandOutput = { + contents = de_DescribeServiceUpdatesResponse(data, context); + const response: DescribeServiceUpdatesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1602,48 +1182,39 @@ export const de_DescribeACLsCommand = async ( }; /** - * deserializeAws_json1_1DescribeACLsCommandError + * deserializeAws_json1_1DescribeSnapshotsCommand */ -const de_DescribeACLsCommandError = async ( +export const de_DescribeSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ACLNotFoundFault": - case "com.amazonaws.memorydb#ACLNotFoundFault": - throw await de_ACLNotFoundFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeSnapshotsResponse(data, context); + const response: DescribeSnapshotsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeClustersCommand + * deserializeAws_json1_1DescribeSubnetGroupsCommand */ -export const de_DescribeClustersCommand = async ( +export const de_DescribeSubnetGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeClustersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeClustersResponse(data, context); - const response: DescribeClustersCommandOutput = { + contents = _json(data); + const response: DescribeSubnetGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1651,54 +1222,39 @@ export const de_DescribeClustersCommand = async ( }; /** - * deserializeAws_json1_1DescribeClustersCommandError + * deserializeAws_json1_1DescribeUsersCommand */ -const de_DescribeClustersCommandError = async ( +export const de_DescribeUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFoundFault": - case "com.amazonaws.memorydb#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeUsersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeEngineVersionsCommand + * deserializeAws_json1_1FailoverShardCommand */ -export const de_DescribeEngineVersionsCommand = async ( +export const de_FailoverShardCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEngineVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeEngineVersionsCommandOutput = { + contents = de_FailoverShardResponse(data, context); + const response: FailoverShardCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1706,51 +1262,39 @@ export const de_DescribeEngineVersionsCommand = async ( }; /** - * deserializeAws_json1_1DescribeEngineVersionsCommandError + * deserializeAws_json1_1ListAllowedNodeTypeUpdatesCommand */ -const de_DescribeEngineVersionsCommandError = async ( +export const de_ListAllowedNodeTypeUpdatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListAllowedNodeTypeUpdatesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeEventsCommand + * deserializeAws_json1_1ListTagsCommand */ -export const de_DescribeEventsCommand = async ( +export const de_ListTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEventsResponse(data, context); - const response: DescribeEventsCommandOutput = { + contents = _json(data); + const response: ListTagsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1758,51 +1302,39 @@ export const de_DescribeEventsCommand = async ( }; /** - * deserializeAws_json1_1DescribeEventsCommandError + * deserializeAws_json1_1PurchaseReservedNodesOfferingCommand */ -const de_DescribeEventsCommandError = async ( +export const de_PurchaseReservedNodesOfferingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_PurchaseReservedNodesOfferingResponse(data, context); + const response: PurchaseReservedNodesOfferingCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeParameterGroupsCommand + * deserializeAws_json1_1ResetParameterGroupCommand */ -export const de_DescribeParameterGroupsCommand = async ( +export const de_ResetParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeParameterGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeParameterGroupsCommandOutput = { + const response: ResetParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1810,54 +1342,39 @@ export const de_DescribeParameterGroupsCommand = async ( }; /** - * deserializeAws_json1_1DescribeParameterGroupsCommandError + * deserializeAws_json1_1TagResourceCommand */ -const de_DescribeParameterGroupsCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ParameterGroupNotFoundFault": - case "com.amazonaws.memorydb#ParameterGroupNotFoundFault": - throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeParametersCommand + * deserializeAws_json1_1UntagResourceCommand */ -export const de_DescribeParametersCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeParametersCommandOutput = { + const response: UntagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1865,54 +1382,39 @@ export const de_DescribeParametersCommand = async ( }; /** - * deserializeAws_json1_1DescribeParametersCommandError + * deserializeAws_json1_1UpdateACLCommand */ -const de_DescribeParametersCommandError = async ( +export const de_UpdateACLCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ParameterGroupNotFoundFault": - case "com.amazonaws.memorydb#ParameterGroupNotFoundFault": - throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateACLCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeReservedNodesCommand + * deserializeAws_json1_1UpdateClusterCommand */ -export const de_DescribeReservedNodesCommand = async ( +export const de_UpdateClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeReservedNodesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeReservedNodesResponse(data, context); - const response: DescribeReservedNodesCommandOutput = { + contents = de_UpdateClusterResponse(data, context); + const response: UpdateClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1920,54 +1422,39 @@ export const de_DescribeReservedNodesCommand = async ( }; /** - * deserializeAws_json1_1DescribeReservedNodesCommandError + * deserializeAws_json1_1UpdateParameterGroupCommand */ -const de_DescribeReservedNodesCommandError = async ( +export const de_UpdateParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ReservedNodeNotFoundFault": - case "com.amazonaws.memorydb#ReservedNodeNotFoundFault": - throw await de_ReservedNodeNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateParameterGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeReservedNodesOfferingsCommand + * deserializeAws_json1_1UpdateSubnetGroupCommand */ -export const de_DescribeReservedNodesOfferingsCommand = async ( +export const de_UpdateSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeReservedNodesOfferingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeReservedNodesOfferingsResponse(data, context); - const response: DescribeReservedNodesOfferingsCommandOutput = { + contents = _json(data); + const response: UpdateSubnetGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1975,832 +1462,98 @@ export const de_DescribeReservedNodesOfferingsCommand = async ( }; /** - * deserializeAws_json1_1DescribeReservedNodesOfferingsCommandError + * deserializeAws_json1_1UpdateUserCommand */ -const de_DescribeReservedNodesOfferingsCommandError = async ( +export const de_UpdateUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateUserCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserialize_Aws_json1_1CommandError + */ +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); case "InvalidParameterValueException": case "com.amazonaws.memorydb#InvalidParameterValueException": throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ReservedNodesOfferingNotFoundFault": - case "com.amazonaws.memorydb#ReservedNodesOfferingNotFoundFault": - throw await de_ReservedNodesOfferingNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeServiceUpdatesCommand - */ -export const de_DescribeServiceUpdatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeServiceUpdatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeServiceUpdatesResponse(data, context); - const response: DescribeServiceUpdatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeServiceUpdatesCommandError - */ -const de_DescribeServiceUpdatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeSnapshotsCommand - */ -export const de_DescribeSnapshotsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeSnapshotsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeSnapshotsResponse(data, context); - const response: DescribeSnapshotsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeSnapshotsCommandError - */ -const de_DescribeSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "SnapshotNotFoundFault": - case "com.amazonaws.memorydb#SnapshotNotFoundFault": - throw await de_SnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeSubnetGroupsCommand - */ -export const de_DescribeSubnetGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeSubnetGroupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeSubnetGroupsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeSubnetGroupsCommandError - */ -const de_DescribeSubnetGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "SubnetGroupNotFoundFault": - case "com.amazonaws.memorydb#SubnetGroupNotFoundFault": - throw await de_SubnetGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeUsersCommand - */ -export const de_DescribeUsersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeUsersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeUsersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeUsersCommandError - */ -const de_DescribeUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "UserNotFoundFault": - case "com.amazonaws.memorydb#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1FailoverShardCommand - */ -export const de_FailoverShardCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_FailoverShardCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_FailoverShardResponse(data, context); - const response: FailoverShardCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1FailoverShardCommandError - */ -const de_FailoverShardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "APICallRateForCustomerExceededFault": - case "com.amazonaws.memorydb#APICallRateForCustomerExceededFault": - throw await de_APICallRateForCustomerExceededFaultRes(parsedOutput, context); - case "ClusterNotFoundFault": - case "com.amazonaws.memorydb#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.memorydb#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidKMSKeyFault": - case "com.amazonaws.memorydb#InvalidKMSKeyFault": - throw await de_InvalidKMSKeyFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ShardNotFoundFault": - case "com.amazonaws.memorydb#ShardNotFoundFault": - throw await de_ShardNotFoundFaultRes(parsedOutput, context); - case "TestFailoverNotAvailableFault": - case "com.amazonaws.memorydb#TestFailoverNotAvailableFault": - throw await de_TestFailoverNotAvailableFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAllowedNodeTypeUpdatesCommand - */ -export const de_ListAllowedNodeTypeUpdatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAllowedNodeTypeUpdatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListAllowedNodeTypeUpdatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAllowedNodeTypeUpdatesCommandError - */ -const de_ListAllowedNodeTypeUpdatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFoundFault": - case "com.amazonaws.memorydb#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsCommand - */ -export const de_ListTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsCommandError - */ -const de_ListTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ACLNotFoundFault": - case "com.amazonaws.memorydb#ACLNotFoundFault": - throw await de_ACLNotFoundFaultRes(parsedOutput, context); - case "ClusterNotFoundFault": - case "com.amazonaws.memorydb#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidARNFault": - case "com.amazonaws.memorydb#InvalidARNFault": - throw await de_InvalidARNFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.memorydb#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "ParameterGroupNotFoundFault": - case "com.amazonaws.memorydb#ParameterGroupNotFoundFault": - throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "SnapshotNotFoundFault": - case "com.amazonaws.memorydb#SnapshotNotFoundFault": - throw await de_SnapshotNotFoundFaultRes(parsedOutput, context); - case "SubnetGroupNotFoundFault": - case "com.amazonaws.memorydb#SubnetGroupNotFoundFault": - throw await de_SubnetGroupNotFoundFaultRes(parsedOutput, context); - case "UserNotFoundFault": - case "com.amazonaws.memorydb#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PurchaseReservedNodesOfferingCommand - */ -export const de_PurchaseReservedNodesOfferingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PurchaseReservedNodesOfferingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PurchaseReservedNodesOfferingResponse(data, context); - const response: PurchaseReservedNodesOfferingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PurchaseReservedNodesOfferingCommandError - */ -const de_PurchaseReservedNodesOfferingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ReservedNodeAlreadyExistsFault": - case "com.amazonaws.memorydb#ReservedNodeAlreadyExistsFault": - throw await de_ReservedNodeAlreadyExistsFaultRes(parsedOutput, context); - case "ReservedNodeQuotaExceededFault": - case "com.amazonaws.memorydb#ReservedNodeQuotaExceededFault": - throw await de_ReservedNodeQuotaExceededFaultRes(parsedOutput, context); - case "ReservedNodesOfferingNotFoundFault": - case "com.amazonaws.memorydb#ReservedNodesOfferingNotFoundFault": - throw await de_ReservedNodesOfferingNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "TagQuotaPerResourceExceeded": - case "com.amazonaws.memorydb#TagQuotaPerResourceExceeded": - throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ResetParameterGroupCommand - */ -export const de_ResetParameterGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ResetParameterGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ResetParameterGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ResetParameterGroupCommandError - */ -const de_ResetParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterGroupStateFault": - case "com.amazonaws.memorydb#InvalidParameterGroupStateFault": - throw await de_InvalidParameterGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ParameterGroupNotFoundFault": - case "com.amazonaws.memorydb#ParameterGroupNotFoundFault": - throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: TagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ACLNotFoundFault": - case "com.amazonaws.memorydb#ACLNotFoundFault": - throw await de_ACLNotFoundFaultRes(parsedOutput, context); - case "ClusterNotFoundFault": - case "com.amazonaws.memorydb#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidARNFault": - case "com.amazonaws.memorydb#InvalidARNFault": - throw await de_InvalidARNFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.memorydb#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "ParameterGroupNotFoundFault": - case "com.amazonaws.memorydb#ParameterGroupNotFoundFault": - throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); + case "ServiceUpdateNotFoundFault": + case "com.amazonaws.memorydb#ServiceUpdateNotFoundFault": + throw await de_ServiceUpdateNotFoundFaultRes(parsedOutput, context); + case "InvalidParameterCombinationException": + case "com.amazonaws.memorydb#InvalidParameterCombinationException": + throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); + case "InvalidSnapshotStateFault": + case "com.amazonaws.memorydb#InvalidSnapshotStateFault": + throw await de_InvalidSnapshotStateFaultRes(parsedOutput, context); case "ServiceLinkedRoleNotFoundFault": case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); + case "SnapshotAlreadyExistsFault": + case "com.amazonaws.memorydb#SnapshotAlreadyExistsFault": + throw await de_SnapshotAlreadyExistsFaultRes(parsedOutput, context); case "SnapshotNotFoundFault": case "com.amazonaws.memorydb#SnapshotNotFoundFault": throw await de_SnapshotNotFoundFaultRes(parsedOutput, context); - case "SubnetGroupNotFoundFault": - case "com.amazonaws.memorydb#SubnetGroupNotFoundFault": - throw await de_SubnetGroupNotFoundFaultRes(parsedOutput, context); + case "SnapshotQuotaExceededFault": + case "com.amazonaws.memorydb#SnapshotQuotaExceededFault": + throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); case "TagQuotaPerResourceExceeded": case "com.amazonaws.memorydb#TagQuotaPerResourceExceeded": throw await de_TagQuotaPerResourceExceededRes(parsedOutput, context); - case "UserNotFoundFault": - case "com.amazonaws.memorydb#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UntagResourceCommand - */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UntagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ACLNotFoundFault": - case "com.amazonaws.memorydb#ACLNotFoundFault": - throw await de_ACLNotFoundFaultRes(parsedOutput, context); - case "ClusterNotFoundFault": - case "com.amazonaws.memorydb#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidARNFault": - case "com.amazonaws.memorydb#InvalidARNFault": - throw await de_InvalidARNFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.memorydb#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "ParameterGroupNotFoundFault": - case "com.amazonaws.memorydb#ParameterGroupNotFoundFault": - throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "SnapshotNotFoundFault": - case "com.amazonaws.memorydb#SnapshotNotFoundFault": - throw await de_SnapshotNotFoundFaultRes(parsedOutput, context); - case "SubnetGroupNotFoundFault": - case "com.amazonaws.memorydb#SubnetGroupNotFoundFault": - throw await de_SubnetGroupNotFoundFaultRes(parsedOutput, context); - case "TagNotFoundFault": - case "com.amazonaws.memorydb#TagNotFoundFault": - throw await de_TagNotFoundFaultRes(parsedOutput, context); - case "UserNotFoundFault": - case "com.amazonaws.memorydb#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateACLCommand - */ -export const de_UpdateACLCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateACLCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateACLCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateACLCommandError - */ -const de_UpdateACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ACLNotFoundFault": - case "com.amazonaws.memorydb#ACLNotFoundFault": - throw await de_ACLNotFoundFaultRes(parsedOutput, context); + case "ACLAlreadyExistsFault": + case "com.amazonaws.memorydb#ACLAlreadyExistsFault": + throw await de_ACLAlreadyExistsFaultRes(parsedOutput, context); + case "ACLQuotaExceededFault": + case "com.amazonaws.memorydb#ACLQuotaExceededFault": + throw await de_ACLQuotaExceededFaultRes(parsedOutput, context); case "DefaultUserRequired": case "com.amazonaws.memorydb#DefaultUserRequired": - throw await de_DefaultUserRequiredRes(parsedOutput, context); - case "DuplicateUserNameFault": - case "com.amazonaws.memorydb#DuplicateUserNameFault": - throw await de_DuplicateUserNameFaultRes(parsedOutput, context); - case "InvalidACLStateFault": - case "com.amazonaws.memorydb#InvalidACLStateFault": - throw await de_InvalidACLStateFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "UserNotFoundFault": - case "com.amazonaws.memorydb#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateClusterCommand - */ -export const de_UpdateClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateClusterResponse(data, context); - const response: UpdateClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateClusterCommandError - */ -const de_UpdateClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { + throw await de_DefaultUserRequiredRes(parsedOutput, context); + case "DuplicateUserNameFault": + case "com.amazonaws.memorydb#DuplicateUserNameFault": + throw await de_DuplicateUserNameFaultRes(parsedOutput, context); + case "UserNotFoundFault": + case "com.amazonaws.memorydb#UserNotFoundFault": + throw await de_UserNotFoundFaultRes(parsedOutput, context); case "ACLNotFoundFault": case "com.amazonaws.memorydb#ACLNotFoundFault": throw await de_ACLNotFoundFaultRes(parsedOutput, context); - case "ClusterNotFoundFault": - case "com.amazonaws.memorydb#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); + case "ClusterAlreadyExistsFault": + case "com.amazonaws.memorydb#ClusterAlreadyExistsFault": + throw await de_ClusterAlreadyExistsFaultRes(parsedOutput, context); case "ClusterQuotaForCustomerExceededFault": case "com.amazonaws.memorydb#ClusterQuotaForCustomerExceededFault": throw await de_ClusterQuotaForCustomerExceededFaultRes(parsedOutput, context); + case "InsufficientClusterCapacityFault": + case "com.amazonaws.memorydb#InsufficientClusterCapacityFault": + throw await de_InsufficientClusterCapacityFaultRes(parsedOutput, context); case "InvalidACLStateFault": case "com.amazonaws.memorydb#InvalidACLStateFault": throw await de_InvalidACLStateFaultRes(parsedOutput, context); - case "InvalidClusterStateFault": - case "com.amazonaws.memorydb#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidKMSKeyFault": - case "com.amazonaws.memorydb#InvalidKMSKeyFault": - throw await de_InvalidKMSKeyFaultRes(parsedOutput, context); - case "InvalidNodeStateFault": - case "com.amazonaws.memorydb#InvalidNodeStateFault": - throw await de_InvalidNodeStateFaultRes(parsedOutput, context); - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); + case "InvalidCredentialsException": + case "com.amazonaws.memorydb#InvalidCredentialsException": + throw await de_InvalidCredentialsExceptionRes(parsedOutput, context); case "InvalidVPCNetworkStateFault": case "com.amazonaws.memorydb#InvalidVPCNetworkStateFault": throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "NoOperationFault": - case "com.amazonaws.memorydb#NoOperationFault": - throw await de_NoOperationFaultRes(parsedOutput, context); case "NodeQuotaForClusterExceededFault": case "com.amazonaws.memorydb#NodeQuotaForClusterExceededFault": throw await de_NodeQuotaForClusterExceededFaultRes(parsedOutput, context); @@ -2810,193 +1563,100 @@ const de_UpdateClusterCommandError = async ( case "ParameterGroupNotFoundFault": case "com.amazonaws.memorydb#ParameterGroupNotFoundFault": throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); case "ShardsPerClusterQuotaExceededFault": case "com.amazonaws.memorydb#ShardsPerClusterQuotaExceededFault": throw await de_ShardsPerClusterQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateParameterGroupCommand - */ -export const de_UpdateParameterGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateParameterGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateParameterGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateParameterGroupCommandError - */ -const de_UpdateParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); + case "SubnetGroupNotFoundFault": + case "com.amazonaws.memorydb#SubnetGroupNotFoundFault": + throw await de_SubnetGroupNotFoundFaultRes(parsedOutput, context); case "InvalidParameterGroupStateFault": case "com.amazonaws.memorydb#InvalidParameterGroupStateFault": throw await de_InvalidParameterGroupStateFaultRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ParameterGroupNotFoundFault": - case "com.amazonaws.memorydb#ParameterGroupNotFoundFault": - throw await de_ParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateSubnetGroupCommand - */ -export const de_UpdateSubnetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateSubnetGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateSubnetGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateSubnetGroupCommandError - */ -const de_UpdateSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { + case "ParameterGroupAlreadyExistsFault": + case "com.amazonaws.memorydb#ParameterGroupAlreadyExistsFault": + throw await de_ParameterGroupAlreadyExistsFaultRes(parsedOutput, context); + case "ParameterGroupQuotaExceededFault": + case "com.amazonaws.memorydb#ParameterGroupQuotaExceededFault": + throw await de_ParameterGroupQuotaExceededFaultRes(parsedOutput, context); + case "ClusterNotFoundFault": + case "com.amazonaws.memorydb#ClusterNotFoundFault": + throw await de_ClusterNotFoundFaultRes(parsedOutput, context); + case "InvalidClusterStateFault": + case "com.amazonaws.memorydb#InvalidClusterStateFault": + throw await de_InvalidClusterStateFaultRes(parsedOutput, context); case "InvalidSubnet": case "com.amazonaws.memorydb#InvalidSubnet": throw await de_InvalidSubnetRes(parsedOutput, context); - case "ServiceLinkedRoleNotFoundFault": - case "com.amazonaws.memorydb#ServiceLinkedRoleNotFoundFault": - throw await de_ServiceLinkedRoleNotFoundFaultRes(parsedOutput, context); - case "SubnetGroupNotFoundFault": - case "com.amazonaws.memorydb#SubnetGroupNotFoundFault": - throw await de_SubnetGroupNotFoundFaultRes(parsedOutput, context); - case "SubnetInUse": - case "com.amazonaws.memorydb#SubnetInUse": - throw await de_SubnetInUseRes(parsedOutput, context); + case "SubnetGroupAlreadyExistsFault": + case "com.amazonaws.memorydb#SubnetGroupAlreadyExistsFault": + throw await de_SubnetGroupAlreadyExistsFaultRes(parsedOutput, context); + case "SubnetGroupQuotaExceededFault": + case "com.amazonaws.memorydb#SubnetGroupQuotaExceededFault": + throw await de_SubnetGroupQuotaExceededFaultRes(parsedOutput, context); case "SubnetNotAllowedFault": case "com.amazonaws.memorydb#SubnetNotAllowedFault": throw await de_SubnetNotAllowedFaultRes(parsedOutput, context); case "SubnetQuotaExceededFault": case "com.amazonaws.memorydb#SubnetQuotaExceededFault": throw await de_SubnetQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateUserCommand - */ -export const de_UpdateUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateUserCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateUserCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateUserCommandError - */ -const de_UpdateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterCombinationException": - case "com.amazonaws.memorydb#InvalidParameterCombinationException": - throw await de_InvalidParameterCombinationExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.memorydb#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); + case "UserAlreadyExistsFault": + case "com.amazonaws.memorydb#UserAlreadyExistsFault": + throw await de_UserAlreadyExistsFaultRes(parsedOutput, context); + case "UserQuotaExceededFault": + case "com.amazonaws.memorydb#UserQuotaExceededFault": + throw await de_UserQuotaExceededFaultRes(parsedOutput, context); + case "SubnetGroupInUseFault": + case "com.amazonaws.memorydb#SubnetGroupInUseFault": + throw await de_SubnetGroupInUseFaultRes(parsedOutput, context); case "InvalidUserStateFault": case "com.amazonaws.memorydb#InvalidUserStateFault": throw await de_InvalidUserStateFaultRes(parsedOutput, context); - case "UserNotFoundFault": - case "com.amazonaws.memorydb#UserNotFoundFault": - throw await de_UserNotFoundFaultRes(parsedOutput, context); + case "ReservedNodeNotFoundFault": + case "com.amazonaws.memorydb#ReservedNodeNotFoundFault": + throw await de_ReservedNodeNotFoundFaultRes(parsedOutput, context); + case "ReservedNodesOfferingNotFoundFault": + case "com.amazonaws.memorydb#ReservedNodesOfferingNotFoundFault": + throw await de_ReservedNodesOfferingNotFoundFaultRes(parsedOutput, context); + case "APICallRateForCustomerExceededFault": + case "com.amazonaws.memorydb#APICallRateForCustomerExceededFault": + throw await de_APICallRateForCustomerExceededFaultRes(parsedOutput, context); + case "InvalidKMSKeyFault": + case "com.amazonaws.memorydb#InvalidKMSKeyFault": + throw await de_InvalidKMSKeyFaultRes(parsedOutput, context); + case "ShardNotFoundFault": + case "com.amazonaws.memorydb#ShardNotFoundFault": + throw await de_ShardNotFoundFaultRes(parsedOutput, context); + case "TestFailoverNotAvailableFault": + case "com.amazonaws.memorydb#TestFailoverNotAvailableFault": + throw await de_TestFailoverNotAvailableFaultRes(parsedOutput, context); + case "InvalidARNFault": + case "com.amazonaws.memorydb#InvalidARNFault": + throw await de_InvalidARNFaultRes(parsedOutput, context); + case "ReservedNodeAlreadyExistsFault": + case "com.amazonaws.memorydb#ReservedNodeAlreadyExistsFault": + throw await de_ReservedNodeAlreadyExistsFaultRes(parsedOutput, context); + case "ReservedNodeQuotaExceededFault": + case "com.amazonaws.memorydb#ReservedNodeQuotaExceededFault": + throw await de_ReservedNodeQuotaExceededFaultRes(parsedOutput, context); + case "TagNotFoundFault": + case "com.amazonaws.memorydb#TagNotFoundFault": + throw await de_TagNotFoundFaultRes(parsedOutput, context); + case "InvalidNodeStateFault": + case "com.amazonaws.memorydb#InvalidNodeStateFault": + throw await de_InvalidNodeStateFaultRes(parsedOutput, context); + case "NoOperationFault": + case "com.amazonaws.memorydb#NoOperationFault": + throw await de_NoOperationFaultRes(parsedOutput, context); + case "SubnetInUse": + case "com.amazonaws.memorydb#SubnetInUse": + throw await de_SubnetInUseRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-mgn/src/protocols/Aws_restJson1.ts b/clients/client-mgn/src/protocols/Aws_restJson1.ts index 3cffba2ef163..536b83b83531 100644 --- a/clients/client-mgn/src/protocols/Aws_restJson1.ts +++ b/clients/client-mgn/src/protocols/Aws_restJson1.ts @@ -1972,7 +1972,7 @@ export const de_ArchiveApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ArchiveApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1994,41 +1994,6 @@ export const de_ArchiveApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ArchiveApplicationCommandError - */ -const de_ArchiveApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mgn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ArchiveWaveCommand */ @@ -2037,7 +2002,7 @@ export const de_ArchiveWaveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ArchiveWaveCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2058,41 +2023,6 @@ export const de_ArchiveWaveCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ArchiveWaveCommandError - */ -const de_ArchiveWaveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mgn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateApplicationsCommand */ @@ -2101,7 +2031,7 @@ export const de_AssociateApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateApplicationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2110,41 +2040,6 @@ export const de_AssociateApplicationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateApplicationsCommandError - */ -const de_AssociateApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mgn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateSourceServersCommand */ @@ -2153,7 +2048,7 @@ export const de_AssociateSourceServersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateSourceServersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2162,41 +2057,6 @@ export const de_AssociateSourceServersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateSourceServersCommandError - */ -const de_AssociateSourceServersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mgn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ChangeServerLifeCycleStateCommand */ @@ -2205,7 +2065,7 @@ export const de_ChangeServerLifeCycleStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ChangeServerLifeCycleStateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2231,41 +2091,6 @@ export const de_ChangeServerLifeCycleStateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ChangeServerLifeCycleStateCommandError - */ -const de_ChangeServerLifeCycleStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateApplicationCommand */ @@ -2274,7 +2099,7 @@ export const de_CreateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2296,38 +2121,6 @@ export const de_CreateApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mgn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConnectorCommand */ @@ -2336,7 +2129,7 @@ export const de_CreateConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2354,35 +2147,6 @@ export const de_CreateConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConnectorCommandError - */ -const de_CreateConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLaunchConfigurationTemplateCommand */ @@ -2391,7 +2155,7 @@ export const de_CreateLaunchConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateLaunchConfigurationTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2420,38 +2184,6 @@ export const de_CreateLaunchConfigurationTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLaunchConfigurationTemplateCommandError - */ -const de_CreateLaunchConfigurationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mgn#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateReplicationConfigurationTemplateCommand */ @@ -2460,7 +2192,7 @@ export const de_CreateReplicationConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateReplicationConfigurationTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2489,46 +2221,14 @@ export const de_CreateReplicationConfigurationTemplateCommand = async ( }; /** - * deserializeAws_restJson1CreateReplicationConfigurationTemplateCommandError + * deserializeAws_restJson1CreateWaveCommand */ -const de_CreateReplicationConfigurationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mgn#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateWaveCommand - */ -export const de_CreateWaveCommand = async ( +export const de_CreateWaveCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateWaveCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2549,38 +2249,6 @@ export const de_CreateWaveCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWaveCommandError - */ -const de_CreateWaveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mgn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteApplicationCommand */ @@ -2589,7 +2257,7 @@ export const de_DeleteApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2598,38 +2266,6 @@ export const de_DeleteApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteApplicationCommandError - */ -const de_DeleteApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteConnectorCommand */ @@ -2638,7 +2274,7 @@ export const de_DeleteConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2647,38 +2283,6 @@ export const de_DeleteConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteConnectorCommandError - */ -const de_DeleteConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteJobCommand */ @@ -2687,7 +2291,7 @@ export const de_DeleteJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2696,38 +2300,6 @@ export const de_DeleteJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteJobCommandError - */ -const de_DeleteJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteLaunchConfigurationTemplateCommand */ @@ -2736,7 +2308,7 @@ export const de_DeleteLaunchConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteLaunchConfigurationTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2745,38 +2317,6 @@ export const de_DeleteLaunchConfigurationTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLaunchConfigurationTemplateCommandError - */ -const de_DeleteLaunchConfigurationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommand */ @@ -2785,7 +2325,7 @@ export const de_DeleteReplicationConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteReplicationConfigurationTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2794,38 +2334,6 @@ export const de_DeleteReplicationConfigurationTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteReplicationConfigurationTemplateCommandError - */ -const de_DeleteReplicationConfigurationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSourceServerCommand */ @@ -2834,7 +2342,7 @@ export const de_DeleteSourceServerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSourceServerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2843,38 +2351,6 @@ export const de_DeleteSourceServerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSourceServerCommandError - */ -const de_DeleteSourceServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteVcenterClientCommand */ @@ -2883,7 +2359,7 @@ export const de_DeleteVcenterClientCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteVcenterClientCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2892,38 +2368,6 @@ export const de_DeleteVcenterClientCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteVcenterClientCommandError - */ -const de_DeleteVcenterClientCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteWaveCommand */ @@ -2932,7 +2376,7 @@ export const de_DeleteWaveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteWaveCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2941,38 +2385,6 @@ export const de_DeleteWaveCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteWaveCommandError - */ -const de_DeleteWaveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeJobLogItemsCommand */ @@ -2981,7 +2393,7 @@ export const de_DescribeJobLogItemsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobLogItemsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2995,35 +2407,6 @@ export const de_DescribeJobLogItemsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeJobLogItemsCommandError - */ -const de_DescribeJobLogItemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeJobsCommand */ @@ -3032,7 +2415,7 @@ export const de_DescribeJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3046,35 +2429,6 @@ export const de_DescribeJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeJobsCommandError - */ -const de_DescribeJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeLaunchConfigurationTemplatesCommand */ @@ -3083,7 +2437,7 @@ export const de_DescribeLaunchConfigurationTemplatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeLaunchConfigurationTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3097,38 +2451,6 @@ export const de_DescribeLaunchConfigurationTemplatesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeLaunchConfigurationTemplatesCommandError - */ -const de_DescribeLaunchConfigurationTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommand */ @@ -3137,61 +2459,7 @@ export const de_DescribeReplicationConfigurationTemplatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeReplicationConfigurationTemplatesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - items: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommandError - */ -const de_DescribeReplicationConfigurationTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeSourceServersCommand - */ -export const de_DescribeSourceServersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSourceServersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3199,50 +2467,21 @@ export const de_DescribeSourceServersCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { items: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeSourceServersCommandError - */ -const de_DescribeSourceServersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeVcenterClientsCommand + * deserializeAws_restJson1DescribeSourceServersCommand */ -export const de_DescribeVcenterClientsCommand = async ( +export const de_DescribeSourceServersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeVcenterClientsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3257,35 +2496,25 @@ export const de_DescribeVcenterClientsCommand = async ( }; /** - * deserializeAws_restJson1DescribeVcenterClientsCommandError + * deserializeAws_restJson1DescribeVcenterClientsCommand */ -const de_DescribeVcenterClientsCommandError = async ( +export const de_DescribeVcenterClientsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3296,7 +2525,7 @@ export const de_DisassociateApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateApplicationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3305,38 +2534,6 @@ export const de_DisassociateApplicationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateApplicationsCommandError - */ -const de_DisassociateApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateSourceServersCommand */ @@ -3345,7 +2542,7 @@ export const de_DisassociateSourceServersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateSourceServersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3354,38 +2551,6 @@ export const de_DisassociateSourceServersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateSourceServersCommandError - */ -const de_DisassociateSourceServersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisconnectFromServiceCommand */ @@ -3394,7 +2559,7 @@ export const de_DisconnectFromServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisconnectFromServiceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3420,38 +2585,6 @@ export const de_DisconnectFromServiceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisconnectFromServiceCommandError - */ -const de_DisconnectFromServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1FinalizeCutoverCommand */ @@ -3460,7 +2593,7 @@ export const de_FinalizeCutoverCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_FinalizeCutoverCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3486,41 +2619,6 @@ export const de_FinalizeCutoverCommand = async ( return contents; }; -/** - * deserializeAws_restJson1FinalizeCutoverCommandError - */ -const de_FinalizeCutoverCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLaunchConfigurationCommand */ @@ -3529,7 +2627,7 @@ export const de_GetLaunchConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLaunchConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3553,35 +2651,6 @@ export const de_GetLaunchConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLaunchConfigurationCommandError - */ -const de_GetLaunchConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetReplicationConfigurationCommand */ @@ -3590,7 +2659,7 @@ export const de_GetReplicationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReplicationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3616,81 +2685,23 @@ export const de_GetReplicationConfigurationCommand = async ( }); Object.assign(contents, doc); return contents; -}; - -/** - * deserializeAws_restJson1GetReplicationConfigurationCommandError - */ -const de_GetReplicationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1InitializeServiceCommand - */ -export const de_InitializeServiceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_InitializeServiceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1InitializeServiceCommandError - */ -const de_InitializeServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mgn#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +}; + +/** + * deserializeAws_restJson1InitializeServiceCommand + */ +export const de_InitializeServiceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -3701,7 +2712,7 @@ export const de_ListApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3715,32 +2726,6 @@ export const de_ListApplicationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationsCommandError - */ -const de_ListApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListConnectorsCommand */ @@ -3749,7 +2734,7 @@ export const de_ListConnectorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConnectorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3763,35 +2748,6 @@ export const de_ListConnectorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListConnectorsCommandError - */ -const de_ListConnectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListExportErrorsCommand */ @@ -3800,7 +2756,7 @@ export const de_ListExportErrorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListExportErrorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3814,35 +2770,6 @@ export const de_ListExportErrorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListExportErrorsCommandError - */ -const de_ListExportErrorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListExportsCommand */ @@ -3851,7 +2778,7 @@ export const de_ListExportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListExportsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3865,32 +2792,6 @@ export const de_ListExportsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListExportsCommandError - */ -const de_ListExportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListImportErrorsCommand */ @@ -3899,7 +2800,7 @@ export const de_ListImportErrorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImportErrorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3913,35 +2814,6 @@ export const de_ListImportErrorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListImportErrorsCommandError - */ -const de_ListImportErrorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListImportsCommand */ @@ -3950,7 +2822,7 @@ export const de_ListImportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImportsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3964,35 +2836,6 @@ export const de_ListImportsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListImportsCommandError - */ -const de_ListImportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListManagedAccountsCommand */ @@ -4001,7 +2844,7 @@ export const de_ListManagedAccountsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListManagedAccountsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4015,35 +2858,6 @@ export const de_ListManagedAccountsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListManagedAccountsCommandError - */ -const de_ListManagedAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSourceServerActionsCommand */ @@ -4052,7 +2866,7 @@ export const de_ListSourceServerActionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSourceServerActionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4066,35 +2880,6 @@ export const de_ListSourceServerActionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSourceServerActionsCommandError - */ -const de_ListSourceServerActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -4103,55 +2888,17 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mgn#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mgn#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mgn#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4162,7 +2909,7 @@ export const de_ListTemplateActionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTemplateActionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4176,35 +2923,6 @@ export const de_ListTemplateActionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTemplateActionsCommandError - */ -const de_ListTemplateActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWavesCommand */ @@ -4213,7 +2931,7 @@ export const de_ListWavesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWavesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4227,32 +2945,6 @@ export const de_ListWavesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListWavesCommandError - */ -const de_ListWavesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1MarkAsArchivedCommand */ @@ -4261,7 +2953,7 @@ export const de_MarkAsArchivedCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MarkAsArchivedCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4287,38 +2979,6 @@ export const de_MarkAsArchivedCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MarkAsArchivedCommandError - */ -const de_MarkAsArchivedCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PauseReplicationCommand */ @@ -4327,7 +2987,7 @@ export const de_PauseReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PauseReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4353,44 +3013,6 @@ export const de_PauseReplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PauseReplicationCommandError - */ -const de_PauseReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mgn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutSourceServerActionCommand */ @@ -4399,7 +3021,7 @@ export const de_PutSourceServerActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutSourceServerActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4423,41 +3045,6 @@ export const de_PutSourceServerActionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutSourceServerActionCommandError - */ -const de_PutSourceServerActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutTemplateActionCommand */ @@ -4466,7 +3053,7 @@ export const de_PutTemplateActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutTemplateActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4491,41 +3078,6 @@ export const de_PutTemplateActionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutTemplateActionCommandError - */ -const de_PutTemplateActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RemoveSourceServerActionCommand */ @@ -4534,94 +3086,30 @@ export const de_RemoveSourceServerActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_RemoveSourceServerActionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1RemoveSourceServerActionCommandError - */ -const de_RemoveSourceServerActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RemoveTemplateActionCommand - */ -export const de_RemoveTemplateActionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_RemoveTemplateActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1RemoveTemplateActionCommandError - */ -const de_RemoveTemplateActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1RemoveTemplateActionCommand + */ +export const de_RemoveTemplateActionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -4632,7 +3120,7 @@ export const de_ResumeReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ResumeReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4658,44 +3146,6 @@ export const de_ResumeReplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ResumeReplicationCommandError - */ -const de_ResumeReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mgn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RetryDataReplicationCommand */ @@ -4704,7 +3154,7 @@ export const de_RetryDataReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RetryDataReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4730,38 +3180,6 @@ export const de_RetryDataReplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RetryDataReplicationCommandError - */ -const de_RetryDataReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartCutoverCommand */ @@ -4770,7 +3188,7 @@ export const de_StartCutoverCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartCutoverCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4783,38 +3201,6 @@ export const de_StartCutoverCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartCutoverCommandError - */ -const de_StartCutoverCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartExportCommand */ @@ -4823,7 +3209,7 @@ export const de_StartExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartExportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4836,38 +3222,6 @@ export const de_StartExportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartExportCommandError - */ -const de_StartExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ServiceQuotaExceededException": - case "com.amazonaws.mgn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartImportCommand */ @@ -4876,7 +3230,7 @@ export const de_StartImportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartImportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4889,44 +3243,6 @@ export const de_StartImportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartImportCommandError - */ -const de_StartImportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mgn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartReplicationCommand */ @@ -4935,7 +3251,7 @@ export const de_StartReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4960,96 +3276,26 @@ export const de_StartReplicationCommand = async ( Object.assign(contents, doc); return contents; }; - -/** - * deserializeAws_restJson1StartReplicationCommandError - */ -const de_StartReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mgn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartTestCommand - */ -export const de_StartTestCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_StartTestCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - job: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartTestCommandError - */ -const de_StartTestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + +/** + * deserializeAws_restJson1StartTestCommand + */ +export const de_StartTestCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + job: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -5060,7 +3306,7 @@ export const de_StopReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5086,44 +3332,6 @@ export const de_StopReplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopReplicationCommandError - */ -const de_StopReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mgn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -5132,7 +3340,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5141,44 +3349,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mgn#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mgn#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mgn#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TerminateTargetInstancesCommand */ @@ -5187,7 +3357,7 @@ export const de_TerminateTargetInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_TerminateTargetInstancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5200,38 +3370,6 @@ export const de_TerminateTargetInstancesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TerminateTargetInstancesCommandError - */ -const de_TerminateTargetInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UnarchiveApplicationCommand */ @@ -5240,7 +3378,7 @@ export const de_UnarchiveApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UnarchiveApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5262,38 +3400,6 @@ export const de_UnarchiveApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UnarchiveApplicationCommandError - */ -const de_UnarchiveApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mgn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UnarchiveWaveCommand */ @@ -5302,7 +3408,7 @@ export const de_UnarchiveWaveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UnarchiveWaveCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5323,38 +3429,6 @@ export const de_UnarchiveWaveCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UnarchiveWaveCommandError - */ -const de_UnarchiveWaveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.mgn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -5363,7 +3437,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5372,44 +3446,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mgn#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mgn#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.mgn#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateApplicationCommand */ @@ -5418,58 +3454,26 @@ export const de_UpdateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - applicationAggregatedStatus: _json, - applicationID: __expectString, - arn: __expectString, - creationDateTime: __expectString, - description: __expectString, - isArchived: __expectBoolean, - lastModifiedDateTime: __expectString, - name: __expectString, - tags: _json, - waveID: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateApplicationCommandError - */ -const de_UpdateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + applicationAggregatedStatus: _json, + applicationID: __expectString, + arn: __expectString, + creationDateTime: __expectString, + description: __expectString, + isArchived: __expectBoolean, + lastModifiedDateTime: __expectString, + name: __expectString, + tags: _json, + waveID: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -5480,7 +3484,7 @@ export const de_UpdateConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5498,38 +3502,6 @@ export const de_UpdateConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateConnectorCommandError - */ -const de_UpdateConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLaunchConfigurationCommand */ @@ -5538,7 +3510,7 @@ export const de_UpdateLaunchConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLaunchConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5562,41 +3534,6 @@ export const de_UpdateLaunchConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLaunchConfigurationCommandError - */ -const de_UpdateLaunchConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLaunchConfigurationTemplateCommand */ @@ -5605,7 +3542,7 @@ export const de_UpdateLaunchConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLaunchConfigurationTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5634,41 +3571,6 @@ export const de_UpdateLaunchConfigurationTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLaunchConfigurationTemplateCommandError - */ -const de_UpdateLaunchConfigurationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mgn#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateReplicationConfigurationCommand */ @@ -5677,7 +3579,7 @@ export const de_UpdateReplicationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateReplicationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5705,44 +3607,6 @@ export const de_UpdateReplicationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateReplicationConfigurationCommandError - */ -const de_UpdateReplicationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mgn#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommand */ @@ -5751,7 +3615,7 @@ export const de_UpdateReplicationConfigurationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateReplicationConfigurationTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5779,41 +3643,6 @@ export const de_UpdateReplicationConfigurationTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateReplicationConfigurationTemplateCommandError - */ -const de_UpdateReplicationConfigurationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mgn#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSourceServerCommand */ @@ -5822,7 +3651,7 @@ export const de_UpdateSourceServerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSourceServerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5848,38 +3677,6 @@ export const de_UpdateSourceServerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSourceServerCommandError - */ -const de_UpdateSourceServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSourceServerReplicationTypeCommand */ @@ -5888,7 +3685,7 @@ export const de_UpdateSourceServerReplicationTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSourceServerReplicationTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5914,41 +3711,6 @@ export const de_UpdateSourceServerReplicationTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSourceServerReplicationTypeCommandError - */ -const de_UpdateSourceServerReplicationTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.mgn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mgn#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UninitializedAccountException": - case "com.amazonaws.mgn#UninitializedAccountException": - throw await de_UninitializedAccountExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mgn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWaveCommand */ @@ -5957,7 +3719,7 @@ export const de_UpdateWaveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateWaveCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5979,12 +3741,9 @@ export const de_UpdateWaveCommand = async ( }; /** - * deserializeAws_restJson1UpdateWaveCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateWaveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5997,16 +3756,31 @@ const de_UpdateWaveCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.mgn#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.mgn#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "UninitializedAccountException": case "com.amazonaws.mgn#UninitializedAccountException": throw await de_UninitializedAccountExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.mgn#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.mgn#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.mgn#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.mgn#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts b/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts index 7756ed80e4de..55a245f6e811 100644 --- a/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts +++ b/clients/client-migration-hub-refactor-spaces/src/protocols/Aws_restJson1.ts @@ -583,7 +583,7 @@ export const de_CreateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -608,50 +608,6 @@ export const de_CreateApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.migrationhubrefactorspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.migrationhubrefactorspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateEnvironmentCommand */ @@ -660,7 +616,7 @@ export const de_CreateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -682,50 +638,6 @@ export const de_CreateEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEnvironmentCommandError - */ -const de_CreateEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.migrationhubrefactorspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.migrationhubrefactorspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRouteCommand */ @@ -734,7 +646,7 @@ export const de_CreateRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRouteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -758,50 +670,6 @@ export const de_CreateRouteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRouteCommandError - */ -const de_CreateRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.migrationhubrefactorspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.migrationhubrefactorspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateServiceCommand */ @@ -810,7 +678,7 @@ export const de_CreateServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateServiceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -838,50 +706,6 @@ export const de_CreateServiceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateServiceCommandError - */ -const de_CreateServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.migrationhubrefactorspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.migrationhubrefactorspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteApplicationCommand */ @@ -890,7 +714,7 @@ export const de_DeleteApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -908,47 +732,6 @@ export const de_DeleteApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteApplicationCommandError - */ -const de_DeleteApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.migrationhubrefactorspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteEnvironmentCommand */ @@ -957,7 +740,7 @@ export const de_DeleteEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -974,47 +757,6 @@ export const de_DeleteEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEnvironmentCommandError - */ -const de_DeleteEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.migrationhubrefactorspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteResourcePolicyCommand */ @@ -1023,7 +765,7 @@ export const de_DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1032,44 +774,6 @@ export const de_DeleteResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRouteCommand */ @@ -1078,7 +782,7 @@ export const de_DeleteRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRouteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1096,47 +800,6 @@ export const de_DeleteRouteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRouteCommandError - */ -const de_DeleteRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.migrationhubrefactorspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteServiceCommand */ @@ -1145,7 +808,7 @@ export const de_DeleteServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteServiceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1159,50 +822,9 @@ export const de_DeleteServiceCommand = async ( Name: __expectString, ServiceId: __expectString, State: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteServiceCommandError - */ -const de_DeleteServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.migrationhubrefactorspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1213,7 +835,7 @@ export const de_GetApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1239,44 +861,6 @@ export const de_GetApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetApplicationCommandError - */ -const de_GetApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEnvironmentCommand */ @@ -1285,7 +869,7 @@ export const de_GetEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1309,44 +893,6 @@ export const de_GetEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEnvironmentCommandError - */ -const de_GetEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetResourcePolicyCommand */ @@ -1355,7 +901,7 @@ export const de_GetResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1368,44 +914,6 @@ export const de_GetResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetResourcePolicyCommandError - */ -const de_GetResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRouteCommand */ @@ -1414,7 +922,7 @@ export const de_GetRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRouteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1444,44 +952,6 @@ export const de_GetRouteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRouteCommandError - */ -const de_GetRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetServiceCommand */ @@ -1490,7 +960,7 @@ export const de_GetServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetServiceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1519,44 +989,6 @@ export const de_GetServiceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetServiceCommandError - */ -const de_GetServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationsCommand */ @@ -1565,7 +997,7 @@ export const de_ListApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1579,50 +1011,6 @@ export const de_ListApplicationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationsCommandError - */ -const de_ListApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.migrationhubrefactorspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.migrationhubrefactorspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEnvironmentsCommand */ @@ -1631,7 +1019,7 @@ export const de_ListEnvironmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEnvironmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1641,46 +1029,8 @@ export const de_ListEnvironmentsCommand = async ( EnvironmentSummaryList: (_) => de_EnvironmentSummaries(_, context), NextToken: __expectString, }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListEnvironmentsCommandError - */ -const de_ListEnvironmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Object.assign(contents, doc); + return contents; }; /** @@ -1691,7 +1041,7 @@ export const de_ListEnvironmentVpcsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEnvironmentVpcsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1705,44 +1055,6 @@ export const de_ListEnvironmentVpcsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEnvironmentVpcsCommandError - */ -const de_ListEnvironmentVpcsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRoutesCommand */ @@ -1751,7 +1063,7 @@ export const de_ListRoutesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRoutesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1765,50 +1077,6 @@ export const de_ListRoutesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRoutesCommandError - */ -const de_ListRoutesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.migrationhubrefactorspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.migrationhubrefactorspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListServicesCommand */ @@ -1817,7 +1085,7 @@ export const de_ListServicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListServicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1831,50 +1099,6 @@ export const de_ListServicesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListServicesCommandError - */ -const de_ListServicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.migrationhubrefactorspaces#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.migrationhubrefactorspaces#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1883,7 +1107,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1896,38 +1120,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutResourcePolicyCommand */ @@ -1936,7 +1128,7 @@ export const de_PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1945,47 +1137,6 @@ export const de_PutResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidResourcePolicyException": - case "com.amazonaws.migrationhubrefactorspaces#InvalidResourcePolicyException": - throw await de_InvalidResourcePolicyExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1994,7 +1145,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2003,38 +1154,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2043,7 +1162,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2052,38 +1171,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubrefactorspaces#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRouteCommand */ @@ -2092,7 +1179,7 @@ export const de_UpdateRouteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRouteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2111,12 +1198,9 @@ export const de_UpdateRouteCommand = async ( }; /** - * deserializeAws_restJson1UpdateRouteCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateRouteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2126,25 +1210,34 @@ const de_UpdateRouteCommandError = async ( case "AccessDeniedException": case "com.amazonaws.migrationhubrefactorspaces#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.migrationhubrefactorspaces#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.migrationhubrefactorspaces#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.migrationhubrefactorspaces#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.migrationhubrefactorspaces#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.migrationhubrefactorspaces#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.migrationhubrefactorspaces#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "InvalidResourcePolicyException": + case "com.amazonaws.migrationhubrefactorspaces#InvalidResourcePolicyException": + throw await de_InvalidResourcePolicyExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-migration-hub/src/protocols/Aws_json1_1.ts b/clients/client-migration-hub/src/protocols/Aws_json1_1.ts index 72f63e4e5973..20769dee6995 100644 --- a/clients/client-migration-hub/src/protocols/Aws_json1_1.ts +++ b/clients/client-migration-hub/src/protocols/Aws_json1_1.ts @@ -355,7 +355,7 @@ export const de_AssociateCreatedArtifactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateCreatedArtifactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -367,56 +367,6 @@ export const de_AssociateCreatedArtifactCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateCreatedArtifactCommandError - */ -const de_AssociateCreatedArtifactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DryRunOperation": - case "com.amazonaws.migrationhub#DryRunOperation": - throw await de_DryRunOperationRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.migrationhub#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateDiscoveredResourceCommand */ @@ -425,7 +375,7 @@ export const de_AssociateDiscoveredResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateDiscoveredResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -437,59 +387,6 @@ export const de_AssociateDiscoveredResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateDiscoveredResourceCommandError - */ -const de_AssociateDiscoveredResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DryRunOperation": - case "com.amazonaws.migrationhub#DryRunOperation": - throw await de_DryRunOperationRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "PolicyErrorException": - case "com.amazonaws.migrationhub#PolicyErrorException": - throw await de_PolicyErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.migrationhub#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateProgressUpdateStreamCommand */ @@ -498,7 +395,7 @@ export const de_CreateProgressUpdateStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateProgressUpdateStreamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -510,53 +407,6 @@ export const de_CreateProgressUpdateStreamCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateProgressUpdateStreamCommandError - */ -const de_CreateProgressUpdateStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DryRunOperation": - case "com.amazonaws.migrationhub#DryRunOperation": - throw await de_DryRunOperationRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.migrationhub#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteProgressUpdateStreamCommand */ @@ -565,7 +415,7 @@ export const de_DeleteProgressUpdateStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteProgressUpdateStreamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -577,56 +427,6 @@ export const de_DeleteProgressUpdateStreamCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteProgressUpdateStreamCommandError - */ -const de_DeleteProgressUpdateStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DryRunOperation": - case "com.amazonaws.migrationhub#DryRunOperation": - throw await de_DryRunOperationRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.migrationhub#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeApplicationStateCommand */ @@ -635,7 +435,7 @@ export const de_DescribeApplicationStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeApplicationStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -648,66 +448,39 @@ export const de_DescribeApplicationStateCommand = async ( }; /** - * deserializeAws_json1_1DescribeApplicationStateCommandError + * deserializeAws_json1_1DescribeMigrationTaskCommand */ -const de_DescribeApplicationStateCommandError = async ( +export const de_DescribeMigrationTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "PolicyErrorException": - case "com.amazonaws.migrationhub#PolicyErrorException": - throw await de_PolicyErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeMigrationTaskResult(data, context); + const response: DescribeMigrationTaskCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeMigrationTaskCommand + * deserializeAws_json1_1DisassociateCreatedArtifactCommand */ -export const de_DescribeMigrationTaskCommand = async ( +export const de_DisassociateCreatedArtifactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeMigrationTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeMigrationTaskResult(data, context); - const response: DescribeMigrationTaskCommandOutput = { + contents = _json(data); + const response: DisassociateCreatedArtifactCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -715,128 +488,14 @@ export const de_DescribeMigrationTaskCommand = async ( }; /** - * deserializeAws_json1_1DescribeMigrationTaskCommandError + * deserializeAws_json1_1DisassociateDiscoveredResourceCommand */ -const de_DescribeMigrationTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociateCreatedArtifactCommand - */ -export const de_DisassociateCreatedArtifactCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisassociateCreatedArtifactCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DisassociateCreatedArtifactCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisassociateCreatedArtifactCommandError - */ -const de_DisassociateCreatedArtifactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DryRunOperation": - case "com.amazonaws.migrationhub#DryRunOperation": - throw await de_DryRunOperationRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.migrationhub#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociateDiscoveredResourceCommand - */ -export const de_DisassociateDiscoveredResourceCommand = async ( +export const de_DisassociateDiscoveredResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateDiscoveredResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -848,56 +507,6 @@ export const de_DisassociateDiscoveredResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateDiscoveredResourceCommandError - */ -const de_DisassociateDiscoveredResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DryRunOperation": - case "com.amazonaws.migrationhub#DryRunOperation": - throw await de_DryRunOperationRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.migrationhub#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ImportMigrationTaskCommand */ @@ -906,7 +515,7 @@ export const de_ImportMigrationTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportMigrationTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -914,199 +523,24 @@ export const de_ImportMigrationTaskCommand = async ( const response: ImportMigrationTaskCommandOutput = { $metadata: deserializeMetadata(output), ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ImportMigrationTaskCommandError - */ -const de_ImportMigrationTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DryRunOperation": - case "com.amazonaws.migrationhub#DryRunOperation": - throw await de_DryRunOperationRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.migrationhub#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListApplicationStatesCommand - */ -export const de_ListApplicationStatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListApplicationStatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListApplicationStatesResult(data, context); - const response: ListApplicationStatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListApplicationStatesCommandError - */ -const de_ListApplicationStatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListCreatedArtifactsCommand - */ -export const de_ListCreatedArtifactsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListCreatedArtifactsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListCreatedArtifactsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListCreatedArtifactsCommandError - */ -const de_ListCreatedArtifactsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }; + return response; }; /** - * deserializeAws_json1_1ListDiscoveredResourcesCommand + * deserializeAws_json1_1ListApplicationStatesCommand */ -export const de_ListDiscoveredResourcesCommand = async ( +export const de_ListApplicationStatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDiscoveredResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListDiscoveredResourcesCommandOutput = { + contents = de_ListApplicationStatesResult(data, context); + const response: ListApplicationStatesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1114,63 +548,39 @@ export const de_ListDiscoveredResourcesCommand = async ( }; /** - * deserializeAws_json1_1ListDiscoveredResourcesCommandError + * deserializeAws_json1_1ListCreatedArtifactsCommand */ -const de_ListDiscoveredResourcesCommandError = async ( +export const de_ListCreatedArtifactsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListCreatedArtifactsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListMigrationTasksCommand + * deserializeAws_json1_1ListDiscoveredResourcesCommand */ -export const de_ListMigrationTasksCommand = async ( +export const de_ListDiscoveredResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListMigrationTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListMigrationTasksResult(data, context); - const response: ListMigrationTasksCommandOutput = { + contents = _json(data); + const response: ListDiscoveredResourcesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1178,50 +588,23 @@ export const de_ListMigrationTasksCommand = async ( }; /** - * deserializeAws_json1_1ListMigrationTasksCommandError + * deserializeAws_json1_1ListMigrationTasksCommand */ -const de_ListMigrationTasksCommandError = async ( +export const de_ListMigrationTasksCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "PolicyErrorException": - case "com.amazonaws.migrationhub#PolicyErrorException": - throw await de_PolicyErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListMigrationTasksResult(data, context); + const response: ListMigrationTasksCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1232,7 +615,7 @@ export const de_ListProgressUpdateStreamsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListProgressUpdateStreamsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1244,47 +627,6 @@ export const de_ListProgressUpdateStreamsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListProgressUpdateStreamsCommandError - */ -const de_ListProgressUpdateStreamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1NotifyApplicationStateCommand */ @@ -1293,7 +635,7 @@ export const de_NotifyApplicationStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_NotifyApplicationStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1305,59 +647,6 @@ export const de_NotifyApplicationStateCommand = async ( return response; }; -/** - * deserializeAws_json1_1NotifyApplicationStateCommandError - */ -const de_NotifyApplicationStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DryRunOperation": - case "com.amazonaws.migrationhub#DryRunOperation": - throw await de_DryRunOperationRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "PolicyErrorException": - case "com.amazonaws.migrationhub#PolicyErrorException": - throw await de_PolicyErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.migrationhub#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1NotifyMigrationTaskStateCommand */ @@ -1366,7 +655,7 @@ export const de_NotifyMigrationTaskStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_NotifyMigrationTaskStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1378,56 +667,6 @@ export const de_NotifyMigrationTaskStateCommand = async ( return response; }; -/** - * deserializeAws_json1_1NotifyMigrationTaskStateCommandError - */ -const de_NotifyMigrationTaskStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DryRunOperation": - case "com.amazonaws.migrationhub#DryRunOperation": - throw await de_DryRunOperationRes(parsedOutput, context); - case "HomeRegionNotSetException": - case "com.amazonaws.migrationhub#HomeRegionNotSetException": - throw await de_HomeRegionNotSetExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhub#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhub#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.migrationhub#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutResourceAttributesCommand */ @@ -1436,7 +675,7 @@ export const de_PutResourceAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutResourceAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1449,12 +688,9 @@ export const de_PutResourceAttributesCommand = async ( }; /** - * deserializeAws_json1_1PutResourceAttributesCommandError + * deserialize_Aws_json1_1CommandError */ -const de_PutResourceAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1488,13 +724,16 @@ const de_PutResourceAttributesCommandError = async ( case "UnauthorizedOperation": case "com.amazonaws.migrationhub#UnauthorizedOperation": throw await de_UnauthorizedOperationRes(parsedOutput, context); + case "PolicyErrorException": + case "com.amazonaws.migrationhub#PolicyErrorException": + throw await de_PolicyErrorExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts b/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts index dd5278c6fd19..d9606685d2cc 100644 --- a/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts +++ b/clients/client-migrationhub-config/src/protocols/Aws_json1_1.ts @@ -109,7 +109,7 @@ export const de_CreateHomeRegionControlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateHomeRegionControlCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -121,47 +121,6 @@ export const de_CreateHomeRegionControlCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateHomeRegionControlCommandError - */ -const de_CreateHomeRegionControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DryRunOperation": - case "com.amazonaws.migrationhubconfig#DryRunOperation": - throw await de_DryRunOperationRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhubconfig#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhubconfig#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhubconfig#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteHomeRegionControlCommand */ @@ -170,7 +129,7 @@ export const de_DeleteHomeRegionControlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteHomeRegionControlCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -182,44 +141,6 @@ export const de_DeleteHomeRegionControlCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteHomeRegionControlCommandError - */ -const de_DeleteHomeRegionControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhubconfig#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhubconfig#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhubconfig#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeHomeRegionControlsCommand */ @@ -228,7 +149,7 @@ export const de_DescribeHomeRegionControlsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeHomeRegionControlsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -240,44 +161,6 @@ export const de_DescribeHomeRegionControlsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeHomeRegionControlsCommandError - */ -const de_DescribeHomeRegionControlsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.migrationhubconfig#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.migrationhubconfig#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.migrationhubconfig#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetHomeRegionCommand */ @@ -286,7 +169,7 @@ export const de_GetHomeRegionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetHomeRegionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -299,12 +182,9 @@ export const de_GetHomeRegionCommand = async ( }; /** - * deserializeAws_json1_1GetHomeRegionCommandError + * deserialize_Aws_json1_1CommandError */ -const de_GetHomeRegionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -314,6 +194,9 @@ const de_GetHomeRegionCommandError = async ( case "AccessDeniedException": case "com.amazonaws.migrationhubconfig#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "DryRunOperation": + case "com.amazonaws.migrationhubconfig#DryRunOperation": + throw await de_DryRunOperationRes(parsedOutput, context); case "InternalServerError": case "com.amazonaws.migrationhubconfig#InternalServerError": throw await de_InternalServerErrorRes(parsedOutput, context); @@ -332,7 +215,7 @@ const de_GetHomeRegionCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-migrationhuborchestrator/src/protocols/Aws_restJson1.ts b/clients/client-migrationhuborchestrator/src/protocols/Aws_restJson1.ts index 9b231a130d6b..a4fbbaea8f2e 100644 --- a/clients/client-migrationhuborchestrator/src/protocols/Aws_restJson1.ts +++ b/clients/client-migrationhuborchestrator/src/protocols/Aws_restJson1.ts @@ -692,7 +692,7 @@ export const de_CreateWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -715,41 +715,6 @@ export const de_CreateWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWorkflowCommandError - */ -const de_CreateWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWorkflowStepCommand */ @@ -758,7 +723,7 @@ export const de_CreateWorkflowStepCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWorkflowStepCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -774,41 +739,6 @@ export const de_CreateWorkflowStepCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWorkflowStepCommandError - */ -const de_CreateWorkflowStepCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWorkflowStepGroupCommand */ @@ -817,7 +747,7 @@ export const de_CreateWorkflowStepGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWorkflowStepGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -837,41 +767,6 @@ export const de_CreateWorkflowStepGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWorkflowStepGroupCommandError - */ -const de_CreateWorkflowStepGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteWorkflowCommand */ @@ -880,7 +775,7 @@ export const de_DeleteWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -895,44 +790,6 @@ export const de_DeleteWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteWorkflowCommandError - */ -const de_DeleteWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteWorkflowStepCommand */ @@ -941,7 +798,7 @@ export const de_DeleteWorkflowStepCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteWorkflowStepCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -950,44 +807,6 @@ export const de_DeleteWorkflowStepCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteWorkflowStepCommandError - */ -const de_DeleteWorkflowStepCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteWorkflowStepGroupCommand */ @@ -996,7 +815,7 @@ export const de_DeleteWorkflowStepGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteWorkflowStepGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1005,44 +824,6 @@ export const de_DeleteWorkflowStepGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteWorkflowStepGroupCommandError - */ -const de_DeleteWorkflowStepGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTemplateCommand */ @@ -1051,7 +832,7 @@ export const de_GetTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1070,41 +851,6 @@ export const de_GetTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTemplateCommandError - */ -const de_GetTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTemplateStepCommand */ @@ -1113,7 +859,7 @@ export const de_GetTemplateStepCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTemplateStepCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1137,52 +883,14 @@ export const de_GetTemplateStepCommand = async ( }; /** - * deserializeAws_restJson1GetTemplateStepCommandError + * deserializeAws_restJson1GetTemplateStepGroupCommand */ -const de_GetTemplateStepCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetTemplateStepGroupCommand - */ -export const de_GetTemplateStepGroupCommand = async ( +export const de_GetTemplateStepGroupCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTemplateStepGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1204,44 +912,6 @@ export const de_GetTemplateStepGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTemplateStepGroupCommandError - */ -const de_GetTemplateStepGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetWorkflowCommand */ @@ -1250,7 +920,7 @@ export const de_GetWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1282,44 +952,6 @@ export const de_GetWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetWorkflowCommandError - */ -const de_GetWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetWorkflowStepCommand */ @@ -1328,7 +960,7 @@ export const de_GetWorkflowStepCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkflowStepCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1361,41 +993,6 @@ export const de_GetWorkflowStepCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetWorkflowStepCommandError - */ -const de_GetWorkflowStepCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetWorkflowStepGroupCommand */ @@ -1404,7 +1001,7 @@ export const de_GetWorkflowStepGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkflowStepGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1428,44 +1025,6 @@ export const de_GetWorkflowStepGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetWorkflowStepGroupCommandError - */ -const de_GetWorkflowStepGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPluginsCommand */ @@ -1474,7 +1033,7 @@ export const de_ListPluginsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPluginsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1488,38 +1047,6 @@ export const de_ListPluginsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListPluginsCommandError - */ -const de_ListPluginsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1528,7 +1055,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1541,35 +1068,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTemplatesCommand */ @@ -1578,7 +1076,7 @@ export const de_ListTemplatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1592,38 +1090,6 @@ export const de_ListTemplatesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTemplatesCommandError - */ -const de_ListTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTemplateStepGroupsCommand */ @@ -1632,7 +1098,7 @@ export const de_ListTemplateStepGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTemplateStepGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1646,41 +1112,6 @@ export const de_ListTemplateStepGroupsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTemplateStepGroupsCommandError - */ -const de_ListTemplateStepGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTemplateStepsCommand */ @@ -1689,7 +1120,7 @@ export const de_ListTemplateStepsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTemplateStepsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1703,44 +1134,6 @@ export const de_ListTemplateStepsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTemplateStepsCommandError - */ -const de_ListTemplateStepsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWorkflowsCommand */ @@ -1749,7 +1142,7 @@ export const de_ListWorkflowsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkflowsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1763,44 +1156,6 @@ export const de_ListWorkflowsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListWorkflowsCommandError - */ -const de_ListWorkflowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWorkflowStepGroupsCommand */ @@ -1809,172 +1164,64 @@ export const de_ListWorkflowStepGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkflowStepGroupsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - workflowStepGroupsSummary: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListWorkflowStepGroupsCommandError - */ -const de_ListWorkflowStepGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListWorkflowStepsCommand - */ -export const de_ListWorkflowStepsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkflowStepsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - workflowStepsSummary: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListWorkflowStepsCommandError - */ -const de_ListWorkflowStepsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + workflowStepGroupsSummary: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RetryWorkflowStepCommand + * deserializeAws_restJson1ListWorkflowStepsCommand */ -export const de_RetryWorkflowStepCommand = async ( +export const de_ListWorkflowStepsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RetryWorkflowStepCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - id: __expectString, - status: __expectString, - stepGroupId: __expectString, - workflowId: __expectString, + nextToken: __expectString, + workflowStepsSummary: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RetryWorkflowStepCommandError + * deserializeAws_restJson1RetryWorkflowStepCommand */ -const de_RetryWorkflowStepCommandError = async ( +export const de_RetryWorkflowStepCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + id: __expectString, + status: __expectString, + stepGroupId: __expectString, + workflowId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1985,7 +1232,7 @@ export const de_StartWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2002,44 +1249,6 @@ export const de_StartWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartWorkflowCommandError - */ -const de_StartWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopWorkflowCommand */ @@ -2048,7 +1257,7 @@ export const de_StopWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2065,44 +1274,6 @@ export const de_StopWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopWorkflowCommandError - */ -const de_StopWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2111,7 +1282,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2120,35 +1291,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2157,7 +1299,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2166,35 +1308,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWorkflowCommand */ @@ -2203,7 +1316,7 @@ export const de_UpdateWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2227,44 +1340,6 @@ export const de_UpdateWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateWorkflowCommandError - */ -const de_UpdateWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWorkflowStepCommand */ @@ -2273,7 +1348,7 @@ export const de_UpdateWorkflowStepCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateWorkflowStepCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2289,41 +1364,6 @@ export const de_UpdateWorkflowStepCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateWorkflowStepCommandError - */ -const de_UpdateWorkflowStepCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhuborchestrator#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhuborchestrator#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhuborchestrator#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhuborchestrator#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWorkflowStepGroupCommand */ @@ -2332,7 +1372,7 @@ export const de_UpdateWorkflowStepGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateWorkflowStepGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2353,12 +1393,9 @@ export const de_UpdateWorkflowStepGroupCommand = async ( }; /** - * deserializeAws_restJson1UpdateWorkflowStepGroupCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateWorkflowStepGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2371,22 +1408,22 @@ const de_UpdateWorkflowStepGroupCommandError = async ( case "InternalServerException": case "com.amazonaws.migrationhuborchestrator#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.migrationhuborchestrator#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.migrationhuborchestrator#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.migrationhuborchestrator#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts b/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts index 4eaa00eb263f..7fed7dd77599 100644 --- a/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts +++ b/clients/client-migrationhubstrategy/src/protocols/Aws_restJson1.ts @@ -593,7 +593,7 @@ export const de_GetApplicationComponentDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApplicationComponentDetailsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -609,38 +609,6 @@ export const de_GetApplicationComponentDetailsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetApplicationComponentDetailsCommandError - */ -const de_GetApplicationComponentDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetApplicationComponentStrategiesCommand */ @@ -649,7 +617,7 @@ export const de_GetApplicationComponentStrategiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApplicationComponentStrategiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -662,38 +630,6 @@ export const de_GetApplicationComponentStrategiesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetApplicationComponentStrategiesCommandError - */ -const de_GetApplicationComponentStrategiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAssessmentCommand */ @@ -702,7 +638,7 @@ export const de_GetAssessmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssessmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -717,41 +653,6 @@ export const de_GetAssessmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAssessmentCommandError - */ -const de_GetAssessmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetImportFileTaskCommand */ @@ -760,7 +661,7 @@ export const de_GetImportFileTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImportFileTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -783,44 +684,6 @@ export const de_GetImportFileTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetImportFileTaskCommandError - */ -const de_GetImportFileTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubstrategy#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLatestAssessmentIdCommand */ @@ -829,7 +692,7 @@ export const de_GetLatestAssessmentIdCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLatestAssessmentIdCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -842,41 +705,6 @@ export const de_GetLatestAssessmentIdCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLatestAssessmentIdCommandError - */ -const de_GetLatestAssessmentIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DependencyException": - case "com.amazonaws.migrationhubstrategy#DependencyException": - throw await de_DependencyExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubstrategy#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPortfolioPreferencesCommand */ @@ -885,7 +713,7 @@ export const de_GetPortfolioPreferencesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPortfolioPreferencesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -901,41 +729,6 @@ export const de_GetPortfolioPreferencesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetPortfolioPreferencesCommandError - */ -const de_GetPortfolioPreferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPortfolioSummaryCommand */ @@ -944,7 +737,7 @@ export const de_GetPortfolioSummaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPortfolioSummaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -957,38 +750,6 @@ export const de_GetPortfolioSummaryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetPortfolioSummaryCommandError - */ -const de_GetPortfolioSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRecommendationReportDetailsCommand */ @@ -997,7 +758,7 @@ export const de_GetRecommendationReportDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRecommendationReportDetailsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1011,44 +772,6 @@ export const de_GetRecommendationReportDetailsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRecommendationReportDetailsCommandError - */ -const de_GetRecommendationReportDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubstrategy#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetServerDetailsCommand */ @@ -1057,7 +780,7 @@ export const de_GetServerDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetServerDetailsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1073,52 +796,14 @@ export const de_GetServerDetailsCommand = async ( }; /** - * deserializeAws_restJson1GetServerDetailsCommandError + * deserializeAws_restJson1GetServerStrategiesCommand */ -const de_GetServerDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubstrategy#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetServerStrategiesCommand - */ -export const de_GetServerStrategiesCommand = async ( +export const de_GetServerStrategiesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetServerStrategiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1131,44 +816,6 @@ export const de_GetServerStrategiesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetServerStrategiesCommandError - */ -const de_GetServerStrategiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubstrategy#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAnalyzableServersCommand */ @@ -1177,7 +824,7 @@ export const de_ListAnalyzableServersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnalyzableServersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1191,41 +838,6 @@ export const de_ListAnalyzableServersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAnalyzableServersCommandError - */ -const de_ListAnalyzableServersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubstrategy#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationComponentsCommand */ @@ -1234,7 +846,7 @@ export const de_ListApplicationComponentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationComponentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1248,41 +860,6 @@ export const de_ListApplicationComponentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationComponentsCommandError - */ -const de_ListApplicationComponentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceLinkedRoleLockClientException": - case "com.amazonaws.migrationhubstrategy#ServiceLinkedRoleLockClientException": - throw await de_ServiceLinkedRoleLockClientExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubstrategy#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCollectorsCommand */ @@ -1291,7 +868,7 @@ export const de_ListCollectorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCollectorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1305,41 +882,6 @@ export const de_ListCollectorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCollectorsCommandError - */ -const de_ListCollectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubstrategy#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListImportFileTaskCommand */ @@ -1348,7 +890,7 @@ export const de_ListImportFileTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImportFileTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1362,41 +904,6 @@ export const de_ListImportFileTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListImportFileTaskCommandError - */ -const de_ListImportFileTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubstrategy#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListServersCommand */ @@ -1405,7 +912,7 @@ export const de_ListServersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListServersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1419,41 +926,6 @@ export const de_ListServersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListServersCommandError - */ -const de_ListServersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubstrategy#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutPortfolioPreferencesCommand */ @@ -1462,7 +934,7 @@ export const de_PutPortfolioPreferencesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutPortfolioPreferencesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1471,44 +943,6 @@ export const de_PutPortfolioPreferencesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutPortfolioPreferencesCommandError - */ -const de_PutPortfolioPreferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.migrationhubstrategy#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubstrategy#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartAssessmentCommand */ @@ -1517,7 +951,7 @@ export const de_StartAssessmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartAssessmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1530,41 +964,6 @@ export const de_StartAssessmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartAssessmentCommandError - */ -const de_StartAssessmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.migrationhubstrategy#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartImportFileTaskCommand */ @@ -1573,7 +972,7 @@ export const de_StartImportFileTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartImportFileTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1586,44 +985,6 @@ export const de_StartImportFileTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartImportFileTaskCommandError - */ -const de_StartImportFileTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.migrationhubstrategy#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubstrategy#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartRecommendationReportGenerationCommand */ @@ -1632,7 +993,7 @@ export const de_StartRecommendationReportGenerationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartRecommendationReportGenerationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1645,44 +1006,6 @@ export const de_StartRecommendationReportGenerationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartRecommendationReportGenerationCommandError - */ -const de_StartRecommendationReportGenerationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.migrationhubstrategy#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubstrategy#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopAssessmentCommand */ @@ -1691,7 +1014,7 @@ export const de_StopAssessmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopAssessmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1700,41 +1023,6 @@ export const de_StopAssessmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopAssessmentCommandError - */ -const de_StopAssessmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.migrationhubstrategy#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubstrategy#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateApplicationComponentConfigCommand */ @@ -1743,7 +1031,7 @@ export const de_UpdateApplicationComponentConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApplicationComponentConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1752,41 +1040,6 @@ export const de_UpdateApplicationComponentConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateApplicationComponentConfigCommandError - */ -const de_UpdateApplicationComponentConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.migrationhubstrategy#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.migrationhubstrategy#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.migrationhubstrategy#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.migrationhubstrategy#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateServerConfigCommand */ @@ -1795,7 +1048,7 @@ export const de_UpdateServerConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateServerConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1805,12 +1058,9 @@ export const de_UpdateServerConfigCommand = async ( }; /** - * deserializeAws_restJson1UpdateServerConfigCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateServerConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1826,16 +1076,31 @@ const de_UpdateServerConfigCommandError = async ( case "ThrottlingException": case "com.amazonaws.migrationhubstrategy#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.migrationhubstrategy#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.migrationhubstrategy#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "DependencyException": + case "com.amazonaws.migrationhubstrategy#DependencyException": + throw await de_DependencyExceptionRes(parsedOutput, context); + case "ServiceLinkedRoleLockClientException": + case "com.amazonaws.migrationhubstrategy#ServiceLinkedRoleLockClientException": + throw await de_ServiceLinkedRoleLockClientExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.migrationhubstrategy#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.migrationhubstrategy#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-mobile/src/protocols/Aws_restJson1.ts b/clients/client-mobile/src/protocols/Aws_restJson1.ts index 4dcff5c38e84..3109d5ed9325 100644 --- a/clients/client-mobile/src/protocols/Aws_restJson1.ts +++ b/clients/client-mobile/src/protocols/Aws_restJson1.ts @@ -225,7 +225,7 @@ export const de_CreateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -238,50 +238,6 @@ export const de_CreateProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProjectCommandError - */ -const de_CreateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mobile#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.mobile#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.mobile#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mobile#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mobile#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mobile#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.mobile#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteProjectCommand */ @@ -290,7 +246,7 @@ export const de_DeleteProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -304,44 +260,6 @@ export const de_DeleteProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteProjectCommandError - */ -const de_DeleteProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.mobile#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mobile#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mobile#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mobile#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.mobile#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeBundleCommand */ @@ -350,7 +268,7 @@ export const de_DescribeBundleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBundleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -363,47 +281,6 @@ export const de_DescribeBundleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeBundleCommandError - */ -const de_DescribeBundleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mobile#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.mobile#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mobile#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mobile#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mobile#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.mobile#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeProjectCommand */ @@ -412,7 +289,7 @@ export const de_DescribeProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -425,47 +302,6 @@ export const de_DescribeProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeProjectCommandError - */ -const de_DescribeProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mobile#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.mobile#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mobile#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mobile#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mobile#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.mobile#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExportBundleCommand */ @@ -474,7 +310,7 @@ export const de_ExportBundleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExportBundleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -487,47 +323,6 @@ export const de_ExportBundleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExportBundleCommandError - */ -const de_ExportBundleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mobile#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.mobile#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mobile#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mobile#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mobile#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.mobile#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExportProjectCommand */ @@ -536,7 +331,7 @@ export const de_ExportProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExportProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -551,47 +346,6 @@ export const de_ExportProjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExportProjectCommandError - */ -const de_ExportProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mobile#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.mobile#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mobile#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mobile#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mobile#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.mobile#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListBundlesCommand */ @@ -600,7 +354,7 @@ export const de_ListBundlesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBundlesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -614,44 +368,6 @@ export const de_ListBundlesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListBundlesCommandError - */ -const de_ListBundlesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mobile#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.mobile#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mobile#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mobile#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.mobile#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProjectsCommand */ @@ -660,7 +376,7 @@ export const de_ListProjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProjectsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -674,44 +390,6 @@ export const de_ListProjectsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListProjectsCommandError - */ -const de_ListProjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mobile#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.mobile#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.mobile#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.mobile#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.mobile#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateProjectCommand */ @@ -720,7 +398,7 @@ export const de_UpdateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -734,21 +412,15 @@ export const de_UpdateProjectCommand = async ( }; /** - * deserializeAws_restJson1UpdateProjectCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "AccountActionRequiredException": - case "com.amazonaws.mobile#AccountActionRequiredException": - throw await de_AccountActionRequiredExceptionRes(parsedOutput, context); case "BadRequestException": case "com.amazonaws.mobile#BadRequestException": throw await de_BadRequestExceptionRes(parsedOutput, context); @@ -770,13 +442,16 @@ const de_UpdateProjectCommandError = async ( case "UnauthorizedException": case "com.amazonaws.mobile#UnauthorizedException": throw await de_UnauthorizedExceptionRes(parsedOutput, context); + case "AccountActionRequiredException": + case "com.amazonaws.mobile#AccountActionRequiredException": + throw await de_AccountActionRequiredExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-mq/src/protocols/Aws_restJson1.ts b/clients/client-mq/src/protocols/Aws_restJson1.ts index 48181b333c28..31423a8f98c9 100644 --- a/clients/client-mq/src/protocols/Aws_restJson1.ts +++ b/clients/client-mq/src/protocols/Aws_restJson1.ts @@ -607,7 +607,7 @@ export const de_CreateBrokerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBrokerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -621,44 +621,6 @@ export const de_CreateBrokerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBrokerCommandError - */ -const de_CreateBrokerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mq#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.mq#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConfigurationCommand */ @@ -667,7 +629,7 @@ export const de_CreateConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -685,41 +647,6 @@ export const de_CreateConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConfigurationCommandError - */ -const de_CreateConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mq#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateTagsCommand */ @@ -728,7 +655,7 @@ export const de_CreateTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_CreateTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -737,41 +664,6 @@ export const de_CreateTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTagsCommandError - */ -const de_CreateTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateUserCommand */ @@ -780,7 +672,7 @@ export const de_CreateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -789,44 +681,6 @@ export const de_CreateUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateUserCommandError - */ -const de_CreateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mq#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteBrokerCommand */ @@ -835,7 +689,7 @@ export const de_DeleteBrokerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBrokerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -848,41 +702,6 @@ export const de_DeleteBrokerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteBrokerCommandError - */ -const de_DeleteBrokerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteTagsCommand */ @@ -891,7 +710,7 @@ export const de_DeleteTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -900,41 +719,6 @@ export const de_DeleteTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteTagsCommandError - */ -const de_DeleteTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteUserCommand */ @@ -943,7 +727,7 @@ export const de_DeleteUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -952,41 +736,6 @@ export const de_DeleteUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteUserCommandError - */ -const de_DeleteUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeBrokerCommand */ @@ -995,7 +744,7 @@ export const de_DescribeBrokerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBrokerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1044,41 +793,6 @@ export const de_DescribeBrokerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeBrokerCommandError - */ -const de_DescribeBrokerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeBrokerEngineTypesCommand */ @@ -1087,7 +801,7 @@ export const de_DescribeBrokerEngineTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBrokerEngineTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1102,38 +816,6 @@ export const de_DescribeBrokerEngineTypesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeBrokerEngineTypesCommandError - */ -const de_DescribeBrokerEngineTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeBrokerInstanceOptionsCommand */ @@ -1142,7 +824,7 @@ export const de_DescribeBrokerInstanceOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeBrokerInstanceOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1157,38 +839,6 @@ export const de_DescribeBrokerInstanceOptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeBrokerInstanceOptionsCommandError - */ -const de_DescribeBrokerInstanceOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeConfigurationCommand */ @@ -1197,7 +847,7 @@ export const de_DescribeConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1219,41 +869,6 @@ export const de_DescribeConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeConfigurationCommandError - */ -const de_DescribeConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeConfigurationRevisionCommand */ @@ -1262,7 +877,7 @@ export const de_DescribeConfigurationRevisionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeConfigurationRevisionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1278,41 +893,6 @@ export const de_DescribeConfigurationRevisionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeConfigurationRevisionCommandError - */ -const de_DescribeConfigurationRevisionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeUserCommand */ @@ -1321,7 +901,7 @@ export const de_DescribeUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1339,41 +919,6 @@ export const de_DescribeUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeUserCommandError - */ -const de_DescribeUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListBrokersCommand */ @@ -1382,164 +927,65 @@ export const de_ListBrokersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBrokersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BrokerSummaries: [, (_) => de___listOfBrokerSummary(_, context), `brokerSummaries`], - NextToken: [, __expectString, `nextToken`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListBrokersCommandError - */ -const de_ListBrokersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListConfigurationRevisionsCommand - */ -export const de_ListConfigurationRevisionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConfigurationRevisionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ConfigurationId: [, __expectString, `configurationId`], - MaxResults: [, __expectInt32, `maxResults`], - NextToken: [, __expectString, `nextToken`], - Revisions: [, (_) => de___listOfConfigurationRevision(_, context), `revisions`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListConfigurationRevisionsCommandError - */ -const de_ListConfigurationRevisionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + BrokerSummaries: [, (_) => de___listOfBrokerSummary(_, context), `brokerSummaries`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListConfigurationsCommand + * deserializeAws_restJson1ListConfigurationRevisionsCommand */ -export const de_ListConfigurationsCommand = async ( +export const de_ListConfigurationRevisionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Configurations: [, (_) => de___listOfConfiguration(_, context), `configurations`], + ConfigurationId: [, __expectString, `configurationId`], MaxResults: [, __expectInt32, `maxResults`], NextToken: [, __expectString, `nextToken`], + Revisions: [, (_) => de___listOfConfigurationRevision(_, context), `revisions`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListConfigurationsCommandError + * deserializeAws_restJson1ListConfigurationsCommand */ -const de_ListConfigurationsCommandError = async ( +export const de_ListConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Configurations: [, (_) => de___listOfConfiguration(_, context), `configurations`], + MaxResults: [, __expectInt32, `maxResults`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1550,7 +996,7 @@ export const de_ListTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1563,41 +1009,6 @@ export const de_ListTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsCommandError - */ -const de_ListTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListUsersCommand */ @@ -1606,7 +1017,7 @@ export const de_ListUsersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUsersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1622,41 +1033,6 @@ export const de_ListUsersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListUsersCommandError - */ -const de_ListUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PromoteCommand */ @@ -1665,7 +1041,7 @@ export const de_PromoteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PromoteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1678,41 +1054,6 @@ export const de_PromoteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PromoteCommandError - */ -const de_PromoteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RebootBrokerCommand */ @@ -1721,7 +1062,7 @@ export const de_RebootBrokerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RebootBrokerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1730,41 +1071,6 @@ export const de_RebootBrokerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RebootBrokerCommandError - */ -const de_RebootBrokerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateBrokerCommand */ @@ -1773,7 +1079,7 @@ export const de_UpdateBrokerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBrokerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1803,44 +1109,6 @@ export const de_UpdateBrokerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateBrokerCommandError - */ -const de_UpdateBrokerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mq#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConfigurationCommand */ @@ -1849,7 +1117,7 @@ export const de_UpdateConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1867,44 +1135,6 @@ export const de_UpdateConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateConfigurationCommandError - */ -const de_UpdateConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.mq#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.mq#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.mq#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.mq#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.mq#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateUserCommand */ @@ -1913,7 +1143,7 @@ export const de_UpdateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1923,12 +1153,9 @@ export const de_UpdateUserCommand = async ( }; /** - * deserializeAws_restJson1UpdateUserCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1947,6 +1174,9 @@ const de_UpdateUserCommandError = async ( case "InternalServerErrorException": case "com.amazonaws.mq#InternalServerErrorException": throw await de_InternalServerErrorExceptionRes(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.mq#UnauthorizedException": + throw await de_UnauthorizedExceptionRes(parsedOutput, context); case "NotFoundException": case "com.amazonaws.mq#NotFoundException": throw await de_NotFoundExceptionRes(parsedOutput, context); @@ -1956,7 +1186,7 @@ const de_UpdateUserCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-mturk/src/protocols/Aws_json1_1.ts b/clients/client-mturk/src/protocols/Aws_json1_1.ts index 21ea5c21280b..f245cf5cc8fd 100644 --- a/clients/client-mturk/src/protocols/Aws_json1_1.ts +++ b/clients/client-mturk/src/protocols/Aws_json1_1.ts @@ -715,7 +715,7 @@ export const de_AcceptQualificationRequestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptQualificationRequestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -727,35 +727,6 @@ export const de_AcceptQualificationRequestCommand = async ( return response; }; -/** - * deserializeAws_json1_1AcceptQualificationRequestCommandError - */ -const de_AcceptQualificationRequestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ApproveAssignmentCommand */ @@ -764,7 +735,7 @@ export const de_ApproveAssignmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ApproveAssignmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -776,35 +747,6 @@ export const de_ApproveAssignmentCommand = async ( return response; }; -/** - * deserializeAws_json1_1ApproveAssignmentCommandError - */ -const de_ApproveAssignmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateQualificationWithWorkerCommand */ @@ -813,7 +755,7 @@ export const de_AssociateQualificationWithWorkerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateQualificationWithWorkerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -825,35 +767,6 @@ export const de_AssociateQualificationWithWorkerCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateQualificationWithWorkerCommandError - */ -const de_AssociateQualificationWithWorkerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAdditionalAssignmentsForHITCommand */ @@ -862,7 +775,7 @@ export const de_CreateAdditionalAssignmentsForHITCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAdditionalAssignmentsForHITCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -874,35 +787,6 @@ export const de_CreateAdditionalAssignmentsForHITCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAdditionalAssignmentsForHITCommandError - */ -const de_CreateAdditionalAssignmentsForHITCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateHITCommand */ @@ -911,7 +795,7 @@ export const de_CreateHITCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateHITCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -923,35 +807,6 @@ export const de_CreateHITCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateHITCommandError - */ -const de_CreateHITCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateHITTypeCommand */ @@ -960,7 +815,7 @@ export const de_CreateHITTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateHITTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -972,35 +827,6 @@ export const de_CreateHITTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateHITTypeCommandError - */ -const de_CreateHITTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateHITWithHITTypeCommand */ @@ -1009,7 +835,7 @@ export const de_CreateHITWithHITTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateHITWithHITTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1021,35 +847,6 @@ export const de_CreateHITWithHITTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateHITWithHITTypeCommandError - */ -const de_CreateHITWithHITTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateQualificationTypeCommand */ @@ -1058,7 +855,7 @@ export const de_CreateQualificationTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateQualificationTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1070,35 +867,6 @@ export const de_CreateQualificationTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateQualificationTypeCommandError - */ -const de_CreateQualificationTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateWorkerBlockCommand */ @@ -1107,7 +875,7 @@ export const de_CreateWorkerBlockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateWorkerBlockCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1120,48 +888,39 @@ export const de_CreateWorkerBlockCommand = async ( }; /** - * deserializeAws_json1_1CreateWorkerBlockCommandError + * deserializeAws_json1_1DeleteHITCommand */ -const de_CreateWorkerBlockCommandError = async ( +export const de_DeleteHITCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteHITCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteHITCommand + * deserializeAws_json1_1DeleteQualificationTypeCommand */ -export const de_DeleteHITCommand = async ( +export const de_DeleteQualificationTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteHITCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteHITCommandOutput = { + const response: DeleteQualificationTypeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1169,92 +928,14 @@ export const de_DeleteHITCommand = async ( }; /** - * deserializeAws_json1_1DeleteHITCommandError + * deserializeAws_json1_1DeleteWorkerBlockCommand */ -const de_DeleteHITCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteQualificationTypeCommand - */ -export const de_DeleteQualificationTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteQualificationTypeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteQualificationTypeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteQualificationTypeCommandError - */ -const de_DeleteQualificationTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteWorkerBlockCommand - */ -export const de_DeleteWorkerBlockCommand = async ( +export const de_DeleteWorkerBlockCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteWorkerBlockCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1266,35 +947,6 @@ export const de_DeleteWorkerBlockCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteWorkerBlockCommandError - */ -const de_DeleteWorkerBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisassociateQualificationFromWorkerCommand */ @@ -1303,7 +955,7 @@ export const de_DisassociateQualificationFromWorkerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateQualificationFromWorkerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1315,35 +967,6 @@ export const de_DisassociateQualificationFromWorkerCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateQualificationFromWorkerCommandError - */ -const de_DisassociateQualificationFromWorkerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAccountBalanceCommand */ @@ -1352,7 +975,7 @@ export const de_GetAccountBalanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAccountBalanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1364,35 +987,6 @@ export const de_GetAccountBalanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAccountBalanceCommandError - */ -const de_GetAccountBalanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAssignmentCommand */ @@ -1401,7 +995,7 @@ export const de_GetAssignmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAssignmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1413,35 +1007,6 @@ export const de_GetAssignmentCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAssignmentCommandError - */ -const de_GetAssignmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetFileUploadURLCommand */ @@ -1450,7 +1015,7 @@ export const de_GetFileUploadURLCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetFileUploadURLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1462,35 +1027,6 @@ export const de_GetFileUploadURLCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetFileUploadURLCommandError - */ -const de_GetFileUploadURLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetHITCommand */ @@ -1499,7 +1035,7 @@ export const de_GetHITCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetHITCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1511,32 +1047,6 @@ export const de_GetHITCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetHITCommandError - */ -const de_GetHITCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetQualificationScoreCommand */ @@ -1545,7 +1055,7 @@ export const de_GetQualificationScoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetQualificationScoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1557,35 +1067,6 @@ export const de_GetQualificationScoreCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetQualificationScoreCommandError - */ -const de_GetQualificationScoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetQualificationTypeCommand */ @@ -1594,7 +1075,7 @@ export const de_GetQualificationTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetQualificationTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1607,43 +1088,14 @@ export const de_GetQualificationTypeCommand = async ( }; /** - * deserializeAws_json1_1GetQualificationTypeCommandError + * deserializeAws_json1_1ListAssignmentsForHITCommand */ -const de_GetQualificationTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAssignmentsForHITCommand - */ -export const de_ListAssignmentsForHITCommand = async ( +export const de_ListAssignmentsForHITCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAssignmentsForHITCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1655,35 +1107,6 @@ export const de_ListAssignmentsForHITCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAssignmentsForHITCommandError - */ -const de_ListAssignmentsForHITCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListBonusPaymentsCommand */ @@ -1692,7 +1115,7 @@ export const de_ListBonusPaymentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListBonusPaymentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1704,35 +1127,6 @@ export const de_ListBonusPaymentsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListBonusPaymentsCommandError - */ -const de_ListBonusPaymentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListHITsCommand */ @@ -1741,7 +1135,7 @@ export const de_ListHITsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListHITsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1753,35 +1147,6 @@ export const de_ListHITsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListHITsCommandError - */ -const de_ListHITsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListHITsForQualificationTypeCommand */ @@ -1790,7 +1155,7 @@ export const de_ListHITsForQualificationTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListHITsForQualificationTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1802,35 +1167,6 @@ export const de_ListHITsForQualificationTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListHITsForQualificationTypeCommandError - */ -const de_ListHITsForQualificationTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListQualificationRequestsCommand */ @@ -1839,7 +1175,7 @@ export const de_ListQualificationRequestsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListQualificationRequestsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1851,35 +1187,6 @@ export const de_ListQualificationRequestsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListQualificationRequestsCommandError - */ -const de_ListQualificationRequestsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListQualificationTypesCommand */ @@ -1888,7 +1195,7 @@ export const de_ListQualificationTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListQualificationTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1900,35 +1207,6 @@ export const de_ListQualificationTypesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListQualificationTypesCommandError - */ -const de_ListQualificationTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListReviewableHITsCommand */ @@ -1937,7 +1215,7 @@ export const de_ListReviewableHITsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListReviewableHITsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1949,35 +1227,6 @@ export const de_ListReviewableHITsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListReviewableHITsCommandError - */ -const de_ListReviewableHITsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListReviewPolicyResultsForHITCommand */ @@ -1986,7 +1235,7 @@ export const de_ListReviewPolicyResultsForHITCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListReviewPolicyResultsForHITCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1998,35 +1247,6 @@ export const de_ListReviewPolicyResultsForHITCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListReviewPolicyResultsForHITCommandError - */ -const de_ListReviewPolicyResultsForHITCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListWorkerBlocksCommand */ @@ -2035,110 +1255,32 @@ export const de_ListWorkerBlocksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListWorkerBlocksCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListWorkerBlocksCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListWorkerBlocksCommandError - */ -const de_ListWorkerBlocksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListWorkersWithQualificationTypeCommand - */ -export const de_ListWorkersWithQualificationTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListWorkersWithQualificationTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListWorkersWithQualificationTypeResponse(data, context); - const response: ListWorkersWithQualificationTypeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListWorkersWithQualificationTypeCommandError - */ -const de_ListWorkersWithQualificationTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + contents = _json(data); + const response: ListWorkerBlocksCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1NotifyWorkersCommand + * deserializeAws_json1_1ListWorkersWithQualificationTypeCommand */ -export const de_NotifyWorkersCommand = async ( +export const de_ListWorkersWithQualificationTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_NotifyWorkersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: NotifyWorkersCommandOutput = { + contents = de_ListWorkersWithQualificationTypeResponse(data, context); + const response: ListWorkersWithQualificationTypeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2146,32 +1288,23 @@ export const de_NotifyWorkersCommand = async ( }; /** - * deserializeAws_json1_1NotifyWorkersCommandError + * deserializeAws_json1_1NotifyWorkersCommand */ -const de_NotifyWorkersCommandError = async ( +export const de_NotifyWorkersCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: NotifyWorkersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2182,7 +1315,7 @@ export const de_RejectAssignmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RejectAssignmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2194,35 +1327,6 @@ export const de_RejectAssignmentCommand = async ( return response; }; -/** - * deserializeAws_json1_1RejectAssignmentCommandError - */ -const de_RejectAssignmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RejectQualificationRequestCommand */ @@ -2231,7 +1335,7 @@ export const de_RejectQualificationRequestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RejectQualificationRequestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2243,35 +1347,6 @@ export const de_RejectQualificationRequestCommand = async ( return response; }; -/** - * deserializeAws_json1_1RejectQualificationRequestCommandError - */ -const de_RejectQualificationRequestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SendBonusCommand */ @@ -2280,7 +1355,7 @@ export const de_SendBonusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendBonusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2292,35 +1367,6 @@ export const de_SendBonusCommand = async ( return response; }; -/** - * deserializeAws_json1_1SendBonusCommandError - */ -const de_SendBonusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SendTestEventNotificationCommand */ @@ -2329,7 +1375,7 @@ export const de_SendTestEventNotificationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendTestEventNotificationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2341,35 +1387,6 @@ export const de_SendTestEventNotificationCommand = async ( return response; }; -/** - * deserializeAws_json1_1SendTestEventNotificationCommandError - */ -const de_SendTestEventNotificationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateExpirationForHITCommand */ @@ -2378,7 +1395,7 @@ export const de_UpdateExpirationForHITCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateExpirationForHITCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2390,35 +1407,6 @@ export const de_UpdateExpirationForHITCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateExpirationForHITCommandError - */ -const de_UpdateExpirationForHITCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateHITReviewStatusCommand */ @@ -2427,7 +1415,7 @@ export const de_UpdateHITReviewStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateHITReviewStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2439,35 +1427,6 @@ export const de_UpdateHITReviewStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateHITReviewStatusCommandError - */ -const de_UpdateHITReviewStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateHITTypeOfHITCommand */ @@ -2476,7 +1435,7 @@ export const de_UpdateHITTypeOfHITCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateHITTypeOfHITCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2488,35 +1447,6 @@ export const de_UpdateHITTypeOfHITCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateHITTypeOfHITCommandError - */ -const de_UpdateHITTypeOfHITCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateNotificationSettingsCommand */ @@ -2525,7 +1455,7 @@ export const de_UpdateNotificationSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateNotificationSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2537,35 +1467,6 @@ export const de_UpdateNotificationSettingsCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateNotificationSettingsCommandError - */ -const de_UpdateNotificationSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RequestError": - case "com.amazonaws.mturk#RequestError": - throw await de_RequestErrorRes(parsedOutput, context); - case "ServiceFault": - case "com.amazonaws.mturk#ServiceFault": - throw await de_ServiceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateQualificationTypeCommand */ @@ -2574,7 +1475,7 @@ export const de_UpdateQualificationTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateQualificationTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2587,12 +1488,9 @@ export const de_UpdateQualificationTypeCommand = async ( }; /** - * deserializeAws_json1_1UpdateQualificationTypeCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateQualificationTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2611,7 +1509,7 @@ const de_UpdateQualificationTypeCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-mwaa/src/protocols/Aws_restJson1.ts b/clients/client-mwaa/src/protocols/Aws_restJson1.ts index 00f8b053b2ab..8bf7dafb4573 100644 --- a/clients/client-mwaa/src/protocols/Aws_restJson1.ts +++ b/clients/client-mwaa/src/protocols/Aws_restJson1.ts @@ -410,7 +410,7 @@ export const de_CreateCliTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCliTokenCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -424,32 +424,6 @@ export const de_CreateCliTokenCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCliTokenCommandError - */ -const de_CreateCliTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.mwaa#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateEnvironmentCommand */ @@ -458,7 +432,7 @@ export const de_CreateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -471,35 +445,6 @@ export const de_CreateEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEnvironmentCommandError - */ -const de_CreateEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.mwaa#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mwaa#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWebLoginTokenCommand */ @@ -508,7 +453,7 @@ export const de_CreateWebLoginTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWebLoginTokenCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -524,41 +469,6 @@ export const de_CreateWebLoginTokenCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWebLoginTokenCommandError - */ -const de_CreateWebLoginTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.mwaa#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.mwaa#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mwaa#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mwaa#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteEnvironmentCommand */ @@ -567,7 +477,7 @@ export const de_DeleteEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -576,38 +486,6 @@ export const de_DeleteEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEnvironmentCommandError - */ -const de_DeleteEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.mwaa#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mwaa#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mwaa#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEnvironmentCommand */ @@ -616,7 +494,7 @@ export const de_GetEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -629,38 +507,6 @@ export const de_GetEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEnvironmentCommandError - */ -const de_GetEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.mwaa#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mwaa#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mwaa#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEnvironmentsCommand */ @@ -669,7 +515,7 @@ export const de_ListEnvironmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEnvironmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -683,35 +529,6 @@ export const de_ListEnvironmentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEnvironmentsCommandError - */ -const de_ListEnvironmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.mwaa#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mwaa#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -720,7 +537,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -733,38 +550,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.mwaa#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mwaa#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mwaa#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PublishMetricsCommand */ @@ -773,7 +558,7 @@ export const de_PublishMetricsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PublishMetricsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -782,35 +567,6 @@ export const de_PublishMetricsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PublishMetricsCommandError - */ -const de_PublishMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.mwaa#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mwaa#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -819,7 +575,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -828,38 +584,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.mwaa#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mwaa#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mwaa#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -868,7 +592,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -877,38 +601,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.mwaa#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.mwaa#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.mwaa#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEnvironmentCommand */ @@ -917,7 +609,7 @@ export const de_UpdateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -931,34 +623,34 @@ export const de_UpdateEnvironmentCommand = async ( }; /** - * deserializeAws_restJson1UpdateEnvironmentCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.mwaa#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.mwaa#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.mwaa#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.mwaa#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.mwaa#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-neptune-graph/src/protocols/Aws_restJson1.ts b/clients/client-neptune-graph/src/protocols/Aws_restJson1.ts index aa5c909785bb..61cc6d6cd270 100644 --- a/clients/client-neptune-graph/src/protocols/Aws_restJson1.ts +++ b/clients/client-neptune-graph/src/protocols/Aws_restJson1.ts @@ -736,7 +736,7 @@ export const de_CancelImportTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelImportTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -754,44 +754,6 @@ export const de_CancelImportTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelImportTaskCommandError - */ -const de_CancelImportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.neptunegraph#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelQueryCommand */ @@ -800,7 +762,7 @@ export const de_CancelQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelQueryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -809,44 +771,6 @@ export const de_CancelQueryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelQueryCommandError - */ -const de_CancelQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunegraph#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateGraphCommand */ @@ -855,7 +779,7 @@ export const de_CreateGraphCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateGraphCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -882,44 +806,6 @@ export const de_CreateGraphCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGraphCommandError - */ -const de_CreateGraphCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.neptunegraph#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.neptunegraph#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateGraphSnapshotCommand */ @@ -928,7 +814,7 @@ export const de_CreateGraphSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateGraphSnapshotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -947,47 +833,6 @@ export const de_CreateGraphSnapshotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGraphSnapshotCommandError - */ -const de_CreateGraphSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.neptunegraph#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.neptunegraph#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateGraphUsingImportTaskCommand */ @@ -996,7 +841,7 @@ export const de_CreateGraphUsingImportTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateGraphUsingImportTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1015,44 +860,6 @@ export const de_CreateGraphUsingImportTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGraphUsingImportTaskCommandError - */ -const de_CreateGraphUsingImportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.neptunegraph#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.neptunegraph#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePrivateGraphEndpointCommand */ @@ -1061,7 +868,7 @@ export const de_CreatePrivateGraphEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreatePrivateGraphEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1077,47 +884,6 @@ export const de_CreatePrivateGraphEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePrivateGraphEndpointCommandError - */ -const de_CreatePrivateGraphEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.neptunegraph#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.neptunegraph#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteGraphCommand */ @@ -1126,7 +892,7 @@ export const de_DeleteGraphCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGraphCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1153,44 +919,6 @@ export const de_DeleteGraphCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteGraphCommandError - */ -const de_DeleteGraphCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.neptunegraph#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteGraphSnapshotCommand */ @@ -1199,7 +927,7 @@ export const de_DeleteGraphSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGraphSnapshotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1219,52 +947,14 @@ export const de_DeleteGraphSnapshotCommand = async ( }; /** - * deserializeAws_restJson1DeleteGraphSnapshotCommandError + * deserializeAws_restJson1DeletePrivateGraphEndpointCommand */ -const de_DeleteGraphSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.neptunegraph#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePrivateGraphEndpointCommand - */ -export const de_DeletePrivateGraphEndpointCommand = async ( +export const de_DeletePrivateGraphEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePrivateGraphEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1280,44 +970,6 @@ export const de_DeletePrivateGraphEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePrivateGraphEndpointCommandError - */ -const de_DeletePrivateGraphEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.neptunegraph#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExecuteQueryCommand */ @@ -1326,7 +978,7 @@ export const de_ExecuteQueryCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExecuteQueryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1337,47 +989,6 @@ export const de_ExecuteQueryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExecuteQueryCommandError - */ -const de_ExecuteQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunegraph#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.neptunegraph#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnprocessableException": - case "com.amazonaws.neptunegraph#UnprocessableException": - throw await de_UnprocessableExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGraphCommand */ @@ -1386,7 +997,7 @@ export const de_GetGraphCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGraphCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1413,41 +1024,6 @@ export const de_GetGraphCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetGraphCommandError - */ -const de_GetGraphCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGraphSnapshotCommand */ @@ -1456,7 +1032,7 @@ export const de_GetGraphSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGraphSnapshotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1475,41 +1051,6 @@ export const de_GetGraphSnapshotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetGraphSnapshotCommandError - */ -const de_GetGraphSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGraphSummaryCommand */ @@ -1518,7 +1059,7 @@ export const de_GetGraphSummaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGraphSummaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1533,44 +1074,6 @@ export const de_GetGraphSummaryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetGraphSummaryCommandError - */ -const de_GetGraphSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunegraph#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetImportTaskCommand */ @@ -1579,7 +1082,7 @@ export const de_GetImportTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImportTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1601,41 +1104,6 @@ export const de_GetImportTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetImportTaskCommandError - */ -const de_GetImportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPrivateGraphEndpointCommand */ @@ -1644,7 +1112,7 @@ export const de_GetPrivateGraphEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPrivateGraphEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1660,41 +1128,6 @@ export const de_GetPrivateGraphEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetPrivateGraphEndpointCommandError - */ -const de_GetPrivateGraphEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetQueryCommand */ @@ -1703,7 +1136,7 @@ export const de_GetQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetQueryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1720,44 +1153,6 @@ export const de_GetQueryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetQueryCommandError - */ -const de_GetQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunegraph#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListGraphsCommand */ @@ -1766,7 +1161,7 @@ export const de_ListGraphsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGraphsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1780,38 +1175,6 @@ export const de_ListGraphsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListGraphsCommandError - */ -const de_ListGraphsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListGraphSnapshotsCommand */ @@ -1820,7 +1183,7 @@ export const de_ListGraphSnapshotsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGraphSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1834,107 +1197,15 @@ export const de_ListGraphSnapshotsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListGraphSnapshotsCommandError - */ -const de_ListGraphSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListImportTasksCommand */ -export const de_ListImportTasksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImportTasksCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - tasks: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListImportTasksCommandError - */ -const de_ListImportTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPrivateGraphEndpointsCommand - */ -export const de_ListPrivateGraphEndpointsCommand = async ( +export const de_ListImportTasksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPrivateGraphEndpointsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1942,45 +1213,32 @@ export const de_ListPrivateGraphEndpointsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - privateGraphEndpoints: _json, + tasks: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPrivateGraphEndpointsCommandError + * deserializeAws_restJson1ListPrivateGraphEndpointsCommand */ -const de_ListPrivateGraphEndpointsCommandError = async ( +export const de_ListPrivateGraphEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + privateGraphEndpoints: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1991,7 +1249,7 @@ export const de_ListQueriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListQueriesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2004,41 +1262,6 @@ export const de_ListQueriesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListQueriesCommandError - */ -const de_ListQueriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunegraph#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -2047,7 +1270,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2060,41 +1283,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ResetGraphCommand */ @@ -2103,7 +1291,7 @@ export const de_ResetGraphCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ResetGraphCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2130,44 +1318,6 @@ export const de_ResetGraphCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ResetGraphCommandError - */ -const de_ResetGraphCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.neptunegraph#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RestoreGraphFromSnapshotCommand */ @@ -2176,7 +1326,7 @@ export const de_RestoreGraphFromSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_RestoreGraphFromSnapshotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2203,47 +1353,6 @@ export const de_RestoreGraphFromSnapshotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RestoreGraphFromSnapshotCommandError - */ -const de_RestoreGraphFromSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.neptunegraph#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.neptunegraph#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2252,7 +1361,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2261,41 +1370,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2304,7 +1378,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2313,41 +1387,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.neptunegraph#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.neptunegraph#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunegraph#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.neptunegraph#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateGraphCommand */ @@ -2356,7 +1395,7 @@ export const de_UpdateGraphCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGraphCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2384,12 +1423,9 @@ export const de_UpdateGraphCommand = async ( }; /** - * deserializeAws_restJson1UpdateGraphCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateGraphCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2411,13 +1447,22 @@ const de_UpdateGraphCommandError = async ( case "ValidationException": case "com.amazonaws.neptunegraph#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.neptunegraph#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.neptunegraph#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "UnprocessableException": + case "com.amazonaws.neptunegraph#UnprocessableException": + throw await de_UnprocessableExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-neptune/src/protocols/Aws_query.ts b/clients/client-neptune/src/protocols/Aws_query.ts index 53627ab9aab4..e87bb959a04a 100644 --- a/clients/client-neptune/src/protocols/Aws_query.ts +++ b/clients/client-neptune/src/protocols/Aws_query.ts @@ -1685,7 +1685,7 @@ export const de_AddRoleToDBClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddRoleToDBClusterCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AddRoleToDBClusterCommandOutput = { @@ -1694,41 +1694,6 @@ export const de_AddRoleToDBClusterCommand = async ( return response; }; -/** - * deserializeAws_queryAddRoleToDBClusterCommandError - */ -const de_AddRoleToDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterRoleAlreadyExists": - case "com.amazonaws.neptune#DBClusterRoleAlreadyExistsFault": - throw await de_DBClusterRoleAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterRoleQuotaExceeded": - case "com.amazonaws.neptune#DBClusterRoleQuotaExceededFault": - throw await de_DBClusterRoleQuotaExceededFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAddSourceIdentifierToSubscriptionCommand */ @@ -1737,7 +1702,7 @@ export const de_AddSourceIdentifierToSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddSourceIdentifierToSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1749,35 +1714,6 @@ export const de_AddSourceIdentifierToSubscriptionCommand = async ( return response; }; -/** - * deserializeAws_queryAddSourceIdentifierToSubscriptionCommandError - */ -const de_AddSourceIdentifierToSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "SourceNotFound": - case "com.amazonaws.neptune#SourceNotFoundFault": - throw await de_SourceNotFoundFaultRes(parsedOutput, context); - case "SubscriptionNotFound": - case "com.amazonaws.neptune#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAddTagsToResourceCommand */ @@ -1786,7 +1722,7 @@ export const de_AddTagsToResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsToResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AddTagsToResourceCommandOutput = { @@ -1795,38 +1731,6 @@ export const de_AddTagsToResourceCommand = async ( return response; }; -/** - * deserializeAws_queryAddTagsToResourceCommandError - */ -const de_AddTagsToResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.neptune#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotNotFound": - case "com.amazonaws.neptune#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryApplyPendingMaintenanceActionCommand */ @@ -1835,7 +1739,7 @@ export const de_ApplyPendingMaintenanceActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ApplyPendingMaintenanceActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1847,32 +1751,6 @@ export const de_ApplyPendingMaintenanceActionCommand = async ( return response; }; -/** - * deserializeAws_queryApplyPendingMaintenanceActionCommandError - */ -const de_ApplyPendingMaintenanceActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.neptune#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCopyDBClusterParameterGroupCommand */ @@ -1881,7 +1759,7 @@ export const de_CopyDBClusterParameterGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopyDBClusterParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1893,38 +1771,6 @@ export const de_CopyDBClusterParameterGroupCommand = async ( return response; }; -/** - * deserializeAws_queryCopyDBClusterParameterGroupCommandError - */ -const de_CopyDBClusterParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupAlreadyExists": - case "com.amazonaws.neptune#DBParameterGroupAlreadyExistsFault": - throw await de_DBParameterGroupAlreadyExistsFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.neptune#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBParameterGroupQuotaExceeded": - case "com.amazonaws.neptune#DBParameterGroupQuotaExceededFault": - throw await de_DBParameterGroupQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCopyDBClusterSnapshotCommand */ @@ -1933,7 +1779,7 @@ export const de_CopyDBClusterSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopyDBClusterSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1946,60 +1792,39 @@ export const de_CopyDBClusterSnapshotCommand = async ( }; /** - * deserializeAws_queryCopyDBClusterSnapshotCommandError + * deserializeAws_queryCopyDBParameterGroupCommand */ -const de_CopyDBClusterSnapshotCommandError = async ( +export const de_CopyDBParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterSnapshotAlreadyExistsFault": - case "com.amazonaws.neptune#DBClusterSnapshotAlreadyExistsFault": - throw await de_DBClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.neptune#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.neptune#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.neptune#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "SnapshotQuotaExceeded": - case "com.amazonaws.neptune#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CopyDBParameterGroupResult(data.CopyDBParameterGroupResult, context); + const response: CopyDBParameterGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCopyDBParameterGroupCommand + * deserializeAws_queryCreateDBClusterCommand */ -export const de_CopyDBParameterGroupCommand = async ( +export const de_CreateDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CopyDBParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CopyDBParameterGroupResult(data.CopyDBParameterGroupResult, context); - const response: CopyDBParameterGroupCommandOutput = { + contents = de_CreateDBClusterResult(data.CreateDBClusterResult, context); + const response: CreateDBClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2007,51 +1832,39 @@ export const de_CopyDBParameterGroupCommand = async ( }; /** - * deserializeAws_queryCopyDBParameterGroupCommandError + * deserializeAws_queryCreateDBClusterEndpointCommand */ -const de_CopyDBParameterGroupCommandError = async ( +export const de_CreateDBClusterEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupAlreadyExists": - case "com.amazonaws.neptune#DBParameterGroupAlreadyExistsFault": - throw await de_DBParameterGroupAlreadyExistsFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.neptune#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBParameterGroupQuotaExceeded": - case "com.amazonaws.neptune#DBParameterGroupQuotaExceededFault": - throw await de_DBParameterGroupQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateDBClusterEndpointOutput(data.CreateDBClusterEndpointResult, context); + const response: CreateDBClusterEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateDBClusterCommand + * deserializeAws_queryCreateDBClusterParameterGroupCommand */ -export const de_CreateDBClusterCommand = async ( +export const de_CreateDBClusterParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBClusterResult(data.CreateDBClusterResult, context); - const response: CreateDBClusterCommandOutput = { + contents = de_CreateDBClusterParameterGroupResult(data.CreateDBClusterParameterGroupResult, context); + const response: CreateDBClusterParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2059,93 +1872,39 @@ export const de_CreateDBClusterCommand = async ( }; /** - * deserializeAws_queryCreateDBClusterCommandError + * deserializeAws_queryCreateDBClusterSnapshotCommand */ -const de_CreateDBClusterCommandError = async ( +export const de_CreateDBClusterSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterAlreadyExistsFault": - case "com.amazonaws.neptune#DBClusterAlreadyExistsFault": - throw await de_DBClusterAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterParameterGroupNotFound": - case "com.amazonaws.neptune#DBClusterParameterGroupNotFoundFault": - throw await de_DBClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBClusterQuotaExceededFault": - case "com.amazonaws.neptune#DBClusterQuotaExceededFault": - throw await de_DBClusterQuotaExceededFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.neptune#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.neptune#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.neptune#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "GlobalClusterNotFoundFault": - case "com.amazonaws.neptune#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - case "InsufficientStorageClusterCapacity": - case "com.amazonaws.neptune#InsufficientStorageClusterCapacityFault": - throw await de_InsufficientStorageClusterCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.neptune#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "InvalidDBSubnetGroupStateFault": - case "com.amazonaws.neptune#InvalidDBSubnetGroupStateFault": - throw await de_InvalidDBSubnetGroupStateFaultRes(parsedOutput, context); - case "InvalidGlobalClusterStateFault": - case "com.amazonaws.neptune#InvalidGlobalClusterStateFault": - throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.neptune#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.neptune#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.neptune#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.neptune#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateDBClusterSnapshotResult(data.CreateDBClusterSnapshotResult, context); + const response: CreateDBClusterSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateDBClusterEndpointCommand + * deserializeAws_queryCreateDBInstanceCommand */ -export const de_CreateDBClusterEndpointCommand = async ( +export const de_CreateDBInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBClusterEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBClusterEndpointOutput(data.CreateDBClusterEndpointResult, context); - const response: CreateDBClusterEndpointCommandOutput = { + contents = de_CreateDBInstanceResult(data.CreateDBInstanceResult, context); + const response: CreateDBInstanceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2153,60 +1912,39 @@ export const de_CreateDBClusterEndpointCommand = async ( }; /** - * deserializeAws_queryCreateDBClusterEndpointCommandError + * deserializeAws_queryCreateDBParameterGroupCommand */ -const de_CreateDBClusterEndpointCommandError = async ( +export const de_CreateDBParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterEndpointAlreadyExistsFault": - case "com.amazonaws.neptune#DBClusterEndpointAlreadyExistsFault": - throw await de_DBClusterEndpointAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterEndpointQuotaExceededFault": - case "com.amazonaws.neptune#DBClusterEndpointQuotaExceededFault": - throw await de_DBClusterEndpointQuotaExceededFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.neptune#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.neptune#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateDBParameterGroupResult(data.CreateDBParameterGroupResult, context); + const response: CreateDBParameterGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateDBClusterParameterGroupCommand + * deserializeAws_queryCreateDBSubnetGroupCommand */ -export const de_CreateDBClusterParameterGroupCommand = async ( +export const de_CreateDBSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBClusterParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBClusterParameterGroupResult(data.CreateDBClusterParameterGroupResult, context); - const response: CreateDBClusterParameterGroupCommandOutput = { + contents = de_CreateDBSubnetGroupResult(data.CreateDBSubnetGroupResult, context); + const response: CreateDBSubnetGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2214,48 +1952,59 @@ export const de_CreateDBClusterParameterGroupCommand = async ( }; /** - * deserializeAws_queryCreateDBClusterParameterGroupCommandError + * deserializeAws_queryCreateEventSubscriptionCommand */ -const de_CreateDBClusterParameterGroupCommandError = async ( +export const de_CreateEventSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateEventSubscriptionResult(data.CreateEventSubscriptionResult, context); + const response: CreateEventSubscriptionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupAlreadyExists": - case "com.amazonaws.neptune#DBParameterGroupAlreadyExistsFault": - throw await de_DBParameterGroupAlreadyExistsFaultRes(parsedOutput, context); - case "DBParameterGroupQuotaExceeded": - case "com.amazonaws.neptune#DBParameterGroupQuotaExceededFault": - throw await de_DBParameterGroupQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_queryCreateGlobalClusterCommand + */ +export const de_CreateGlobalClusterCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateGlobalClusterResult(data.CreateGlobalClusterResult, context); + const response: CreateGlobalClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateDBClusterSnapshotCommand + * deserializeAws_queryDeleteDBClusterCommand */ -export const de_CreateDBClusterSnapshotCommand = async ( +export const de_DeleteDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBClusterSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBClusterSnapshotResult(data.CreateDBClusterSnapshotResult, context); - const response: CreateDBClusterSnapshotCommandOutput = { + contents = de_DeleteDBClusterResult(data.DeleteDBClusterResult, context); + const response: DeleteDBClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2263,57 +2012,56 @@ export const de_CreateDBClusterSnapshotCommand = async ( }; /** - * deserializeAws_queryCreateDBClusterSnapshotCommandError + * deserializeAws_queryDeleteDBClusterEndpointCommand */ -const de_CreateDBClusterSnapshotCommandError = async ( +export const de_DeleteDBClusterEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteDBClusterEndpointOutput(data.DeleteDBClusterEndpointResult, context); + const response: DeleteDBClusterEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterSnapshotAlreadyExistsFault": - case "com.amazonaws.neptune#DBClusterSnapshotAlreadyExistsFault": - throw await de_DBClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.neptune#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "SnapshotQuotaExceeded": - case "com.amazonaws.neptune#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_queryDeleteDBClusterParameterGroupCommand + */ +export const de_DeleteDBClusterParameterGroupCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteDBClusterParameterGroupCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateDBInstanceCommand + * deserializeAws_queryDeleteDBClusterSnapshotCommand */ -export const de_CreateDBInstanceCommand = async ( +export const de_DeleteDBClusterSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBInstanceResult(data.CreateDBInstanceResult, context); - const response: CreateDBInstanceCommandOutput = { + contents = de_DeleteDBClusterSnapshotResult(data.DeleteDBClusterSnapshotResult, context); + const response: DeleteDBClusterSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2321,145 +2069,73 @@ export const de_CreateDBInstanceCommand = async ( }; /** - * deserializeAws_queryCreateDBInstanceCommandError + * deserializeAws_queryDeleteDBInstanceCommand */ -const de_CreateDBInstanceCommandError = async ( +export const de_DeleteDBInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationNotFound": - case "com.amazonaws.neptune#AuthorizationNotFoundFault": - throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceAlreadyExists": - case "com.amazonaws.neptune#DBInstanceAlreadyExistsFault": - throw await de_DBInstanceAlreadyExistsFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.neptune#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBSecurityGroupNotFound": - case "com.amazonaws.neptune#DBSecurityGroupNotFoundFault": - throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.neptune#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.neptune#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "DomainNotFoundFault": - case "com.amazonaws.neptune#DomainNotFoundFault": - throw await de_DomainNotFoundFaultRes(parsedOutput, context); - case "InstanceQuotaExceeded": - case "com.amazonaws.neptune#InstanceQuotaExceededFault": - throw await de_InstanceQuotaExceededFaultRes(parsedOutput, context); - case "InsufficientDBInstanceCapacity": - case "com.amazonaws.neptune#InsufficientDBInstanceCapacityFault": - throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.neptune#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.neptune#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.neptune#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.neptune#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - case "ProvisionedIopsNotAvailableInAZFault": - case "com.amazonaws.neptune#ProvisionedIopsNotAvailableInAZFault": - throw await de_ProvisionedIopsNotAvailableInAZFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.neptune#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - case "StorageTypeNotSupported": - case "com.amazonaws.neptune#StorageTypeNotSupportedFault": - throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteDBInstanceResult(data.DeleteDBInstanceResult, context); + const response: DeleteDBInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateDBParameterGroupCommand + * deserializeAws_queryDeleteDBParameterGroupCommand */ -export const de_CreateDBParameterGroupCommand = async ( +export const de_DeleteDBParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBParameterGroupCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateDBParameterGroupResult(data.CreateDBParameterGroupResult, context); - const response: CreateDBParameterGroupCommandOutput = { + await collectBody(output.body, context); + const response: DeleteDBParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_queryCreateDBParameterGroupCommandError + * deserializeAws_queryDeleteDBSubnetGroupCommand */ -const de_CreateDBParameterGroupCommandError = async ( +export const de_DeleteDBSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupAlreadyExists": - case "com.amazonaws.neptune#DBParameterGroupAlreadyExistsFault": - throw await de_DBParameterGroupAlreadyExistsFaultRes(parsedOutput, context); - case "DBParameterGroupQuotaExceeded": - case "com.amazonaws.neptune#DBParameterGroupQuotaExceededFault": - throw await de_DBParameterGroupQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteDBSubnetGroupCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateDBSubnetGroupCommand + * deserializeAws_queryDeleteEventSubscriptionCommand */ -export const de_CreateDBSubnetGroupCommand = async ( +export const de_DeleteEventSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBSubnetGroupResult(data.CreateDBSubnetGroupResult, context); - const response: CreateDBSubnetGroupCommandOutput = { + contents = de_DeleteEventSubscriptionResult(data.DeleteEventSubscriptionResult, context); + const response: DeleteEventSubscriptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2467,57 +2143,39 @@ export const de_CreateDBSubnetGroupCommand = async ( }; /** - * deserializeAws_queryCreateDBSubnetGroupCommandError + * deserializeAws_queryDeleteGlobalClusterCommand */ -const de_CreateDBSubnetGroupCommandError = async ( +export const de_DeleteGlobalClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSubnetGroupAlreadyExists": - case "com.amazonaws.neptune#DBSubnetGroupAlreadyExistsFault": - throw await de_DBSubnetGroupAlreadyExistsFaultRes(parsedOutput, context); - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.neptune#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupQuotaExceeded": - case "com.amazonaws.neptune#DBSubnetGroupQuotaExceededFault": - throw await de_DBSubnetGroupQuotaExceededFaultRes(parsedOutput, context); - case "DBSubnetQuotaExceededFault": - case "com.amazonaws.neptune#DBSubnetQuotaExceededFault": - throw await de_DBSubnetQuotaExceededFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.neptune#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteGlobalClusterResult(data.DeleteGlobalClusterResult, context); + const response: DeleteGlobalClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateEventSubscriptionCommand + * deserializeAws_queryDescribeDBClusterEndpointsCommand */ -export const de_CreateEventSubscriptionCommand = async ( +export const de_DescribeDBClusterEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateEventSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateEventSubscriptionResult(data.CreateEventSubscriptionResult, context); - const response: CreateEventSubscriptionCommandOutput = { + contents = de_DBClusterEndpointMessage(data.DescribeDBClusterEndpointsResult, context); + const response: DescribeDBClusterEndpointsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2525,63 +2183,39 @@ export const de_CreateEventSubscriptionCommand = async ( }; /** - * deserializeAws_queryCreateEventSubscriptionCommandError + * deserializeAws_queryDescribeDBClusterParameterGroupsCommand */ -const de_CreateEventSubscriptionCommandError = async ( +export const de_DescribeDBClusterParameterGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EventSubscriptionQuotaExceeded": - case "com.amazonaws.neptune#EventSubscriptionQuotaExceededFault": - throw await de_EventSubscriptionQuotaExceededFaultRes(parsedOutput, context); - case "SNSInvalidTopic": - case "com.amazonaws.neptune#SNSInvalidTopicFault": - throw await de_SNSInvalidTopicFaultRes(parsedOutput, context); - case "SNSNoAuthorization": - case "com.amazonaws.neptune#SNSNoAuthorizationFault": - throw await de_SNSNoAuthorizationFaultRes(parsedOutput, context); - case "SNSTopicArnNotFound": - case "com.amazonaws.neptune#SNSTopicArnNotFoundFault": - throw await de_SNSTopicArnNotFoundFaultRes(parsedOutput, context); - case "SourceNotFound": - case "com.amazonaws.neptune#SourceNotFoundFault": - throw await de_SourceNotFoundFaultRes(parsedOutput, context); - case "SubscriptionAlreadyExist": - case "com.amazonaws.neptune#SubscriptionAlreadyExistFault": - throw await de_SubscriptionAlreadyExistFaultRes(parsedOutput, context); - case "SubscriptionCategoryNotFound": - case "com.amazonaws.neptune#SubscriptionCategoryNotFoundFault": - throw await de_SubscriptionCategoryNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBClusterParameterGroupsMessage(data.DescribeDBClusterParameterGroupsResult, context); + const response: DescribeDBClusterParameterGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateGlobalClusterCommand + * deserializeAws_queryDescribeDBClusterParametersCommand */ -export const de_CreateGlobalClusterCommand = async ( +export const de_DescribeDBClusterParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateGlobalClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateGlobalClusterResult(data.CreateGlobalClusterResult, context); - const response: CreateGlobalClusterCommandOutput = { + contents = de_DBClusterParameterGroupDetails(data.DescribeDBClusterParametersResult, context); + const response: DescribeDBClusterParametersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2589,54 +2223,39 @@ export const de_CreateGlobalClusterCommand = async ( }; /** - * deserializeAws_queryCreateGlobalClusterCommandError + * deserializeAws_queryDescribeDBClustersCommand */ -const de_CreateGlobalClusterCommandError = async ( +export const de_DescribeDBClustersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBClusterMessage(data.DescribeDBClustersResult, context); + const response: DescribeDBClustersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "GlobalClusterAlreadyExistsFault": - case "com.amazonaws.neptune#GlobalClusterAlreadyExistsFault": - throw await de_GlobalClusterAlreadyExistsFaultRes(parsedOutput, context); - case "GlobalClusterQuotaExceededFault": - case "com.amazonaws.neptune#GlobalClusterQuotaExceededFault": - throw await de_GlobalClusterQuotaExceededFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + return response; }; /** - * deserializeAws_queryDeleteDBClusterCommand + * deserializeAws_queryDescribeDBClusterSnapshotAttributesCommand */ -export const de_DeleteDBClusterCommand = async ( +export const de_DescribeDBClusterSnapshotAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDBClusterResult(data.DeleteDBClusterResult, context); - const response: DeleteDBClusterCommandOutput = { + contents = de_DescribeDBClusterSnapshotAttributesResult(data.DescribeDBClusterSnapshotAttributesResult, context); + const response: DescribeDBClusterSnapshotAttributesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2644,57 +2263,39 @@ export const de_DeleteDBClusterCommand = async ( }; /** - * deserializeAws_queryDeleteDBClusterCommandError + * deserializeAws_queryDescribeDBClusterSnapshotsCommand */ -const de_DeleteDBClusterCommandError = async ( +export const de_DescribeDBClusterSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterSnapshotAlreadyExistsFault": - case "com.amazonaws.neptune#DBClusterSnapshotAlreadyExistsFault": - throw await de_DBClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.neptune#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "SnapshotQuotaExceeded": - case "com.amazonaws.neptune#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBClusterSnapshotMessage(data.DescribeDBClusterSnapshotsResult, context); + const response: DescribeDBClusterSnapshotsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBClusterEndpointCommand + * deserializeAws_queryDescribeDBEngineVersionsCommand */ -export const de_DeleteDBClusterEndpointCommand = async ( +export const de_DescribeDBEngineVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBClusterEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDBClusterEndpointOutput(data.DeleteDBClusterEndpointResult, context); - const response: DeleteDBClusterEndpointCommandOutput = { + contents = de_DBEngineVersionMessage(data.DescribeDBEngineVersionsResult, context); + const response: DescribeDBEngineVersionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2702,97 +2303,79 @@ export const de_DeleteDBClusterEndpointCommand = async ( }; /** - * deserializeAws_queryDeleteDBClusterEndpointCommandError + * deserializeAws_queryDescribeDBInstancesCommand */ -const de_DeleteDBClusterEndpointCommandError = async ( +export const de_DescribeDBInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterEndpointNotFoundFault": - case "com.amazonaws.neptune#DBClusterEndpointNotFoundFault": - throw await de_DBClusterEndpointNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterEndpointStateFault": - case "com.amazonaws.neptune#InvalidDBClusterEndpointStateFault": - throw await de_InvalidDBClusterEndpointStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBInstanceMessage(data.DescribeDBInstancesResult, context); + const response: DescribeDBInstancesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBClusterParameterGroupCommand + * deserializeAws_queryDescribeDBParameterGroupsCommand */ -export const de_DeleteDBClusterParameterGroupCommand = async ( +export const de_DescribeDBParameterGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBClusterParameterGroupCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteDBClusterParameterGroupCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBParameterGroupsMessage(data.DescribeDBParameterGroupsResult, context); + const response: DescribeDBParameterGroupsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteDBClusterParameterGroupCommandError + * deserializeAws_queryDescribeDBParametersCommand */ -const de_DeleteDBClusterParameterGroupCommandError = async ( +export const de_DescribeDBParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.neptune#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBParameterGroupState": - case "com.amazonaws.neptune#InvalidDBParameterGroupStateFault": - throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBParameterGroupDetails(data.DescribeDBParametersResult, context); + const response: DescribeDBParametersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBClusterSnapshotCommand + * deserializeAws_queryDescribeDBSubnetGroupsCommand */ -export const de_DeleteDBClusterSnapshotCommand = async ( +export const de_DescribeDBSubnetGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBClusterSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDBClusterSnapshotResult(data.DeleteDBClusterSnapshotResult, context); - const response: DeleteDBClusterSnapshotCommandOutput = { + contents = de_DBSubnetGroupMessage(data.DescribeDBSubnetGroupsResult, context); + const response: DescribeDBSubnetGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2800,48 +2383,42 @@ export const de_DeleteDBClusterSnapshotCommand = async ( }; /** - * deserializeAws_queryDeleteDBClusterSnapshotCommandError + * deserializeAws_queryDescribeEngineDefaultClusterParametersCommand */ -const de_DeleteDBClusterSnapshotCommandError = async ( +export const de_DescribeEngineDefaultClusterParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.neptune#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.neptune#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeEngineDefaultClusterParametersResult( + data.DescribeEngineDefaultClusterParametersResult, + context + ); + const response: DescribeEngineDefaultClusterParametersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBInstanceCommand + * deserializeAws_queryDescribeEngineDefaultParametersCommand */ -export const de_DeleteDBInstanceCommand = async ( +export const de_DescribeEngineDefaultParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDBInstanceResult(data.DeleteDBInstanceResult, context); - const response: DeleteDBInstanceCommandOutput = { + contents = de_DescribeEngineDefaultParametersResult(data.DescribeEngineDefaultParametersResult, context); + const response: DescribeEngineDefaultParametersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2849,152 +2426,79 @@ export const de_DeleteDBInstanceCommand = async ( }; /** - * deserializeAws_queryDeleteDBInstanceCommandError + * deserializeAws_queryDescribeEventCategoriesCommand */ -const de_DeleteDBInstanceCommandError = async ( +export const de_DescribeEventCategoriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.neptune#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotAlreadyExists": - case "com.amazonaws.neptune#DBSnapshotAlreadyExistsFault": - throw await de_DBSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.neptune#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "SnapshotQuotaExceeded": - case "com.amazonaws.neptune#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EventCategoriesMessage(data.DescribeEventCategoriesResult, context); + const response: DescribeEventCategoriesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBParameterGroupCommand + * deserializeAws_queryDescribeEventsCommand */ -export const de_DeleteDBParameterGroupCommand = async ( +export const de_DescribeEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBParameterGroupCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteDBParameterGroupCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EventsMessage(data.DescribeEventsResult, context); + const response: DescribeEventsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteDBParameterGroupCommandError - */ -const de_DeleteDBParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.neptune#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBParameterGroupState": - case "com.amazonaws.neptune#InvalidDBParameterGroupStateFault": - throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteDBSubnetGroupCommand + * deserializeAws_queryDescribeEventSubscriptionsCommand */ -export const de_DeleteDBSubnetGroupCommand = async ( +export const de_DescribeEventSubscriptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteDBSubnetGroupCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EventSubscriptionsMessage(data.DescribeEventSubscriptionsResult, context); + const response: DescribeEventSubscriptionsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteDBSubnetGroupCommandError - */ -const de_DeleteDBSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.neptune#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBSubnetGroupStateFault": - case "com.amazonaws.neptune#InvalidDBSubnetGroupStateFault": - throw await de_InvalidDBSubnetGroupStateFaultRes(parsedOutput, context); - case "InvalidDBSubnetStateFault": - case "com.amazonaws.neptune#InvalidDBSubnetStateFault": - throw await de_InvalidDBSubnetStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteEventSubscriptionCommand + * deserializeAws_queryDescribeGlobalClustersCommand */ -export const de_DeleteEventSubscriptionCommand = async ( +export const de_DescribeGlobalClustersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteEventSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteEventSubscriptionResult(data.DeleteEventSubscriptionResult, context); - const response: DeleteEventSubscriptionCommandOutput = { + contents = de_GlobalClustersMessage(data.DescribeGlobalClustersResult, context); + const response: DescribeGlobalClustersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3002,48 +2506,39 @@ export const de_DeleteEventSubscriptionCommand = async ( }; /** - * deserializeAws_queryDeleteEventSubscriptionCommandError + * deserializeAws_queryDescribeOrderableDBInstanceOptionsCommand */ -const de_DeleteEventSubscriptionCommandError = async ( +export const de_DescribeOrderableDBInstanceOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidEventSubscriptionState": - case "com.amazonaws.neptune#InvalidEventSubscriptionStateFault": - throw await de_InvalidEventSubscriptionStateFaultRes(parsedOutput, context); - case "SubscriptionNotFound": - case "com.amazonaws.neptune#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_OrderableDBInstanceOptionsMessage(data.DescribeOrderableDBInstanceOptionsResult, context); + const response: DescribeOrderableDBInstanceOptionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteGlobalClusterCommand + * deserializeAws_queryDescribePendingMaintenanceActionsCommand */ -export const de_DeleteGlobalClusterCommand = async ( +export const de_DescribePendingMaintenanceActionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteGlobalClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteGlobalClusterResult(data.DeleteGlobalClusterResult, context); - const response: DeleteGlobalClusterCommandOutput = { + contents = de_PendingMaintenanceActionsMessage(data.DescribePendingMaintenanceActionsResult, context); + const response: DescribePendingMaintenanceActionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3051,48 +2546,39 @@ export const de_DeleteGlobalClusterCommand = async ( }; /** - * deserializeAws_queryDeleteGlobalClusterCommandError + * deserializeAws_queryDescribeValidDBInstanceModificationsCommand */ -const de_DeleteGlobalClusterCommandError = async ( +export const de_DescribeValidDBInstanceModificationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalClusterNotFoundFault": - case "com.amazonaws.neptune#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidGlobalClusterStateFault": - case "com.amazonaws.neptune#InvalidGlobalClusterStateFault": - throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeValidDBInstanceModificationsResult(data.DescribeValidDBInstanceModificationsResult, context); + const response: DescribeValidDBInstanceModificationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBClusterEndpointsCommand + * deserializeAws_queryFailoverDBClusterCommand */ -export const de_DescribeDBClusterEndpointsCommand = async ( +export const de_FailoverDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBClusterEndpointMessage(data.DescribeDBClusterEndpointsResult, context); - const response: DescribeDBClusterEndpointsCommandOutput = { + contents = de_FailoverDBClusterResult(data.FailoverDBClusterResult, context); + const response: FailoverDBClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3100,45 +2586,39 @@ export const de_DescribeDBClusterEndpointsCommand = async ( }; /** - * deserializeAws_queryDescribeDBClusterEndpointsCommandError + * deserializeAws_queryFailoverGlobalClusterCommand */ -const de_DescribeDBClusterEndpointsCommandError = async ( +export const de_FailoverGlobalClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_FailoverGlobalClusterResult(data.FailoverGlobalClusterResult, context); + const response: FailoverGlobalClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBClusterParameterGroupsCommand + * deserializeAws_queryListTagsForResourceCommand */ -export const de_DescribeDBClusterParameterGroupsCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterParameterGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBClusterParameterGroupsMessage(data.DescribeDBClusterParameterGroupsResult, context); - const response: DescribeDBClusterParameterGroupsCommandOutput = { + contents = de_TagListMessage(data.ListTagsForResourceResult, context); + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3146,45 +2626,39 @@ export const de_DescribeDBClusterParameterGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeDBClusterParameterGroupsCommandError + * deserializeAws_queryModifyDBClusterCommand */ -const de_DescribeDBClusterParameterGroupsCommandError = async ( +export const de_ModifyDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.neptune#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyDBClusterResult(data.ModifyDBClusterResult, context); + const response: ModifyDBClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBClusterParametersCommand + * deserializeAws_queryModifyDBClusterEndpointCommand */ -export const de_DescribeDBClusterParametersCommand = async ( +export const de_ModifyDBClusterEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBClusterParameterGroupDetails(data.DescribeDBClusterParametersResult, context); - const response: DescribeDBClusterParametersCommandOutput = { + contents = de_ModifyDBClusterEndpointOutput(data.ModifyDBClusterEndpointResult, context); + const response: ModifyDBClusterEndpointCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3192,45 +2666,39 @@ export const de_DescribeDBClusterParametersCommand = async ( }; /** - * deserializeAws_queryDescribeDBClusterParametersCommandError + * deserializeAws_queryModifyDBClusterParameterGroupCommand */ -const de_DescribeDBClusterParametersCommandError = async ( +export const de_ModifyDBClusterParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.neptune#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBClusterParameterGroupNameMessage(data.ModifyDBClusterParameterGroupResult, context); + const response: ModifyDBClusterParameterGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBClustersCommand + * deserializeAws_queryModifyDBClusterSnapshotAttributeCommand */ -export const de_DescribeDBClustersCommand = async ( +export const de_ModifyDBClusterSnapshotAttributeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClustersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBClusterMessage(data.DescribeDBClustersResult, context); - const response: DescribeDBClustersCommandOutput = { + contents = de_ModifyDBClusterSnapshotAttributeResult(data.ModifyDBClusterSnapshotAttributeResult, context); + const response: ModifyDBClusterSnapshotAttributeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3238,45 +2706,39 @@ export const de_DescribeDBClustersCommand = async ( }; /** - * deserializeAws_queryDescribeDBClustersCommandError + * deserializeAws_queryModifyDBInstanceCommand */ -const de_DescribeDBClustersCommandError = async ( +export const de_ModifyDBInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyDBInstanceResult(data.ModifyDBInstanceResult, context); + const response: ModifyDBInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBClusterSnapshotAttributesCommand + * deserializeAws_queryModifyDBParameterGroupCommand */ -export const de_DescribeDBClusterSnapshotAttributesCommand = async ( +export const de_ModifyDBParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterSnapshotAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDBClusterSnapshotAttributesResult(data.DescribeDBClusterSnapshotAttributesResult, context); - const response: DescribeDBClusterSnapshotAttributesCommandOutput = { + contents = de_DBParameterGroupNameMessage(data.ModifyDBParameterGroupResult, context); + const response: ModifyDBParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3284,45 +2746,39 @@ export const de_DescribeDBClusterSnapshotAttributesCommand = async ( }; /** - * deserializeAws_queryDescribeDBClusterSnapshotAttributesCommandError + * deserializeAws_queryModifyDBSubnetGroupCommand */ -const de_DescribeDBClusterSnapshotAttributesCommandError = async ( +export const de_ModifyDBSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.neptune#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyDBSubnetGroupResult(data.ModifyDBSubnetGroupResult, context); + const response: ModifyDBSubnetGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBClusterSnapshotsCommand + * deserializeAws_queryModifyEventSubscriptionCommand */ -export const de_DescribeDBClusterSnapshotsCommand = async ( +export const de_ModifyEventSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBClusterSnapshotMessage(data.DescribeDBClusterSnapshotsResult, context); - const response: DescribeDBClusterSnapshotsCommandOutput = { + contents = de_ModifyEventSubscriptionResult(data.ModifyEventSubscriptionResult, context); + const response: ModifyEventSubscriptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3330,45 +2786,39 @@ export const de_DescribeDBClusterSnapshotsCommand = async ( }; /** - * deserializeAws_queryDescribeDBClusterSnapshotsCommandError + * deserializeAws_queryModifyGlobalClusterCommand */ -const de_DescribeDBClusterSnapshotsCommandError = async ( +export const de_ModifyGlobalClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.neptune#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyGlobalClusterResult(data.ModifyGlobalClusterResult, context); + const response: ModifyGlobalClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBEngineVersionsCommand + * deserializeAws_queryPromoteReadReplicaDBClusterCommand */ -export const de_DescribeDBEngineVersionsCommand = async ( +export const de_PromoteReadReplicaDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBEngineVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBEngineVersionMessage(data.DescribeDBEngineVersionsResult, context); - const response: DescribeDBEngineVersionsCommandOutput = { + contents = de_PromoteReadReplicaDBClusterResult(data.PromoteReadReplicaDBClusterResult, context); + const response: PromoteReadReplicaDBClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3376,39 +2826,39 @@ export const de_DescribeDBEngineVersionsCommand = async ( }; /** - * deserializeAws_queryDescribeDBEngineVersionsCommandError + * deserializeAws_queryRebootDBInstanceCommand */ -const de_DescribeDBEngineVersionsCommandError = async ( +export const de_RebootDBInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RebootDBInstanceResult(data.RebootDBInstanceResult, context); + const response: RebootDBInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** - * deserializeAws_queryDescribeDBInstancesCommand + * deserializeAws_queryRemoveFromGlobalClusterCommand */ -export const de_DescribeDBInstancesCommand = async ( +export const de_RemoveFromGlobalClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBInstanceMessage(data.DescribeDBInstancesResult, context); - const response: DescribeDBInstancesCommandOutput = { + contents = de_RemoveFromGlobalClusterResult(data.RemoveFromGlobalClusterResult, context); + const response: RemoveFromGlobalClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3416,45 +2866,39 @@ export const de_DescribeDBInstancesCommand = async ( }; /** - * deserializeAws_queryDescribeDBInstancesCommandError + * deserializeAws_queryRemoveRoleFromDBClusterCommand */ -const de_DescribeDBInstancesCommandError = async ( +export const de_RemoveRoleFromDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.neptune#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: RemoveRoleFromDBClusterCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryDescribeDBParameterGroupsCommand + * deserializeAws_queryRemoveSourceIdentifierFromSubscriptionCommand */ -export const de_DescribeDBParameterGroupsCommand = async ( +export const de_RemoveSourceIdentifierFromSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBParameterGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBParameterGroupsMessage(data.DescribeDBParameterGroupsResult, context); - const response: DescribeDBParameterGroupsCommandOutput = { + contents = de_RemoveSourceIdentifierFromSubscriptionResult( + data.RemoveSourceIdentifierFromSubscriptionResult, + context + ); + const response: RemoveSourceIdentifierFromSubscriptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3462,91 +2906,36 @@ export const de_DescribeDBParameterGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeDBParameterGroupsCommandError + * deserializeAws_queryRemoveTagsFromResourceCommand */ -const de_DescribeDBParameterGroupsCommandError = async ( +export const de_RemoveTagsFromResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.neptune#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: RemoveTagsFromResourceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryDescribeDBParametersCommand + * deserializeAws_queryResetDBClusterParameterGroupCommand */ -export const de_DescribeDBParametersCommand = async ( +export const de_ResetDBClusterParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBParameterGroupDetails(data.DescribeDBParametersResult, context); - const response: DescribeDBParametersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeDBParametersCommandError - */ -const de_DescribeDBParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.neptune#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeDBSubnetGroupsCommand - */ -export const de_DescribeDBSubnetGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDBSubnetGroupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DBSubnetGroupMessage(data.DescribeDBSubnetGroupsResult, context); - const response: DescribeDBSubnetGroupsCommandOutput = { + contents = de_DBClusterParameterGroupNameMessage(data.ResetDBClusterParameterGroupResult, context); + const response: ResetDBClusterParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3554,48 +2943,19 @@ export const de_DescribeDBSubnetGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeDBSubnetGroupsCommandError - */ -const de_DescribeDBSubnetGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.neptune#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeEngineDefaultClusterParametersCommand + * deserializeAws_queryResetDBParameterGroupCommand */ -export const de_DescribeEngineDefaultClusterParametersCommand = async ( +export const de_ResetDBParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEngineDefaultClusterParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEngineDefaultClusterParametersResult( - data.DescribeEngineDefaultClusterParametersResult, - context - ); - const response: DescribeEngineDefaultClusterParametersCommandOutput = { + contents = de_DBParameterGroupNameMessage(data.ResetDBParameterGroupResult, context); + const response: ResetDBParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3603,39 +2963,19 @@ export const de_DescribeEngineDefaultClusterParametersCommand = async ( }; /** - * deserializeAws_queryDescribeEngineDefaultClusterParametersCommandError - */ -const de_DescribeEngineDefaultClusterParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryDescribeEngineDefaultParametersCommand + * deserializeAws_queryRestoreDBClusterFromSnapshotCommand */ -export const de_DescribeEngineDefaultParametersCommand = async ( +export const de_RestoreDBClusterFromSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEngineDefaultParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEngineDefaultParametersResult(data.DescribeEngineDefaultParametersResult, context); - const response: DescribeEngineDefaultParametersCommandOutput = { + contents = de_RestoreDBClusterFromSnapshotResult(data.RestoreDBClusterFromSnapshotResult, context); + const response: RestoreDBClusterFromSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3643,39 +2983,19 @@ export const de_DescribeEngineDefaultParametersCommand = async ( }; /** - * deserializeAws_queryDescribeEngineDefaultParametersCommandError - */ -const de_DescribeEngineDefaultParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryDescribeEventCategoriesCommand + * deserializeAws_queryRestoreDBClusterToPointInTimeCommand */ -export const de_DescribeEventCategoriesCommand = async ( +export const de_RestoreDBClusterToPointInTimeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventCategoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_EventCategoriesMessage(data.DescribeEventCategoriesResult, context); - const response: DescribeEventCategoriesCommandOutput = { + contents = de_RestoreDBClusterToPointInTimeResult(data.RestoreDBClusterToPointInTimeResult, context); + const response: RestoreDBClusterToPointInTimeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3683,39 +3003,19 @@ export const de_DescribeEventCategoriesCommand = async ( }; /** - * deserializeAws_queryDescribeEventCategoriesCommandError - */ -const de_DescribeEventCategoriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryDescribeEventsCommand + * deserializeAws_queryStartDBClusterCommand */ -export const de_DescribeEventsCommand = async ( +export const de_StartDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_EventsMessage(data.DescribeEventsResult, context); - const response: DescribeEventsCommandOutput = { + contents = de_StartDBClusterResult(data.StartDBClusterResult, context); + const response: StartDBClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3723,39 +3023,19 @@ export const de_DescribeEventsCommand = async ( }; /** - * deserializeAws_queryDescribeEventsCommandError - */ -const de_DescribeEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryDescribeEventSubscriptionsCommand + * deserializeAws_queryStopDBClusterCommand */ -export const de_DescribeEventSubscriptionsCommand = async ( +export const de_StopDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventSubscriptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_EventSubscriptionsMessage(data.DescribeEventSubscriptionsResult, context); - const response: DescribeEventSubscriptionsCommandOutput = { + contents = de_StopDBClusterResult(data.StopDBClusterResult, context); + const response: StopDBClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3763,1601 +3043,223 @@ export const de_DescribeEventSubscriptionsCommand = async ( }; /** - * deserializeAws_queryDescribeEventSubscriptionsCommandError + * deserialize_Aws_queryCommandError */ -const de_DescribeEventSubscriptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { + case "DBClusterNotFoundFault": + case "com.amazonaws.neptune#DBClusterNotFoundFault": + throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); + case "DBClusterRoleAlreadyExists": + case "com.amazonaws.neptune#DBClusterRoleAlreadyExistsFault": + throw await de_DBClusterRoleAlreadyExistsFaultRes(parsedOutput, context); + case "DBClusterRoleQuotaExceeded": + case "com.amazonaws.neptune#DBClusterRoleQuotaExceededFault": + throw await de_DBClusterRoleQuotaExceededFaultRes(parsedOutput, context); + case "InvalidDBClusterStateFault": + case "com.amazonaws.neptune#InvalidDBClusterStateFault": + throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); + case "SourceNotFound": + case "com.amazonaws.neptune#SourceNotFoundFault": + throw await de_SourceNotFoundFaultRes(parsedOutput, context); case "SubscriptionNotFound": case "com.amazonaws.neptune#SubscriptionNotFoundFault": throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeGlobalClustersCommand - */ -export const de_DescribeGlobalClustersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeGlobalClustersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GlobalClustersMessage(data.DescribeGlobalClustersResult, context); - const response: DescribeGlobalClustersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeGlobalClustersCommandError - */ -const de_DescribeGlobalClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalClusterNotFoundFault": - case "com.amazonaws.neptune#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeOrderableDBInstanceOptionsCommand - */ -export const de_DescribeOrderableDBInstanceOptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeOrderableDBInstanceOptionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_OrderableDBInstanceOptionsMessage(data.DescribeOrderableDBInstanceOptionsResult, context); - const response: DescribeOrderableDBInstanceOptionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeOrderableDBInstanceOptionsCommandError - */ -const de_DescribeOrderableDBInstanceOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryDescribePendingMaintenanceActionsCommand - */ -export const de_DescribePendingMaintenanceActionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribePendingMaintenanceActionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PendingMaintenanceActionsMessage(data.DescribePendingMaintenanceActionsResult, context); - const response: DescribePendingMaintenanceActionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribePendingMaintenanceActionsCommandError - */ -const de_DescribePendingMaintenanceActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.neptune#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeValidDBInstanceModificationsCommand - */ -export const de_DescribeValidDBInstanceModificationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeValidDBInstanceModificationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeValidDBInstanceModificationsResult(data.DescribeValidDBInstanceModificationsResult, context); - const response: DescribeValidDBInstanceModificationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeValidDBInstanceModificationsCommandError - */ -const de_DescribeValidDBInstanceModificationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.neptune#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.neptune#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryFailoverDBClusterCommand - */ -export const de_FailoverDBClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_FailoverDBClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_FailoverDBClusterResult(data.FailoverDBClusterResult, context); - const response: FailoverDBClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryFailoverDBClusterCommandError - */ -const de_FailoverDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.neptune#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryFailoverGlobalClusterCommand - */ -export const de_FailoverGlobalClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_FailoverGlobalClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_FailoverGlobalClusterResult(data.FailoverGlobalClusterResult, context); - const response: FailoverGlobalClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryFailoverGlobalClusterCommandError - */ -const de_FailoverGlobalClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "GlobalClusterNotFoundFault": - case "com.amazonaws.neptune#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidGlobalClusterStateFault": - case "com.amazonaws.neptune#InvalidGlobalClusterStateFault": - throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_TagListMessage(data.ListTagsForResourceResult, context); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.neptune#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotNotFound": - case "com.amazonaws.neptune#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBClusterCommand - */ -export const de_ModifyDBClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyDBClusterResult(data.ModifyDBClusterResult, context); - const response: ModifyDBClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBClusterCommandError - */ -const de_ModifyDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterAlreadyExistsFault": - case "com.amazonaws.neptune#DBClusterAlreadyExistsFault": - throw await de_DBClusterAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterParameterGroupNotFound": - case "com.amazonaws.neptune#DBClusterParameterGroupNotFoundFault": - throw await de_DBClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.neptune#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.neptune#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "InvalidDBSecurityGroupState": - case "com.amazonaws.neptune#InvalidDBSecurityGroupStateFault": - throw await de_InvalidDBSecurityGroupStateFaultRes(parsedOutput, context); - case "InvalidDBSubnetGroupStateFault": - case "com.amazonaws.neptune#InvalidDBSubnetGroupStateFault": - throw await de_InvalidDBSubnetGroupStateFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.neptune#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.neptune#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.neptune#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - case "StorageTypeNotSupported": - case "com.amazonaws.neptune#StorageTypeNotSupportedFault": - throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBClusterEndpointCommand - */ -export const de_ModifyDBClusterEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBClusterEndpointCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyDBClusterEndpointOutput(data.ModifyDBClusterEndpointResult, context); - const response: ModifyDBClusterEndpointCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBClusterEndpointCommandError - */ -const de_ModifyDBClusterEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterEndpointNotFoundFault": - case "com.amazonaws.neptune#DBClusterEndpointNotFoundFault": - throw await de_DBClusterEndpointNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.neptune#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterEndpointStateFault": - case "com.amazonaws.neptune#InvalidDBClusterEndpointStateFault": - throw await de_InvalidDBClusterEndpointStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.neptune#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBClusterParameterGroupCommand - */ -export const de_ModifyDBClusterParameterGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBClusterParameterGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DBClusterParameterGroupNameMessage(data.ModifyDBClusterParameterGroupResult, context); - const response: ModifyDBClusterParameterGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBClusterParameterGroupCommandError - */ -const de_ModifyDBClusterParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.neptune#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBParameterGroupState": - case "com.amazonaws.neptune#InvalidDBParameterGroupStateFault": - throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBClusterSnapshotAttributeCommand - */ -export const de_ModifyDBClusterSnapshotAttributeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBClusterSnapshotAttributeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyDBClusterSnapshotAttributeResult(data.ModifyDBClusterSnapshotAttributeResult, context); - const response: ModifyDBClusterSnapshotAttributeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBClusterSnapshotAttributeCommandError - */ -const de_ModifyDBClusterSnapshotAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.neptune#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.neptune#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "SharedSnapshotQuotaExceeded": - case "com.amazonaws.neptune#SharedSnapshotQuotaExceededFault": - throw await de_SharedSnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBInstanceCommand - */ -export const de_ModifyDBInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBInstanceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyDBInstanceResult(data.ModifyDBInstanceResult, context); - const response: ModifyDBInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBInstanceCommandError - */ -const de_ModifyDBInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationNotFound": - case "com.amazonaws.neptune#AuthorizationNotFoundFault": - throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); - case "CertificateNotFound": - case "com.amazonaws.neptune#CertificateNotFoundFault": - throw await de_CertificateNotFoundFaultRes(parsedOutput, context); - case "DBInstanceAlreadyExists": - case "com.amazonaws.neptune#DBInstanceAlreadyExistsFault": - throw await de_DBInstanceAlreadyExistsFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.neptune#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.neptune#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBSecurityGroupNotFound": - case "com.amazonaws.neptune#DBSecurityGroupNotFoundFault": - throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "DBUpgradeDependencyFailure": - case "com.amazonaws.neptune#DBUpgradeDependencyFailureFault": - throw await de_DBUpgradeDependencyFailureFaultRes(parsedOutput, context); - case "DomainNotFoundFault": - case "com.amazonaws.neptune#DomainNotFoundFault": - throw await de_DomainNotFoundFaultRes(parsedOutput, context); - case "InsufficientDBInstanceCapacity": - case "com.amazonaws.neptune#InsufficientDBInstanceCapacityFault": - throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.neptune#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "InvalidDBSecurityGroupState": - case "com.amazonaws.neptune#InvalidDBSecurityGroupStateFault": - throw await de_InvalidDBSecurityGroupStateFaultRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.neptune#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.neptune#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - case "ProvisionedIopsNotAvailableInAZFault": - case "com.amazonaws.neptune#ProvisionedIopsNotAvailableInAZFault": - throw await de_ProvisionedIopsNotAvailableInAZFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.neptune#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - case "StorageTypeNotSupported": - case "com.amazonaws.neptune#StorageTypeNotSupportedFault": - throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBParameterGroupCommand - */ -export const de_ModifyDBParameterGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBParameterGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DBParameterGroupNameMessage(data.ModifyDBParameterGroupResult, context); - const response: ModifyDBParameterGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBParameterGroupCommandError - */ -const de_ModifyDBParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.neptune#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBParameterGroupState": - case "com.amazonaws.neptune#InvalidDBParameterGroupStateFault": - throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBSubnetGroupCommand - */ -export const de_ModifyDBSubnetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBSubnetGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyDBSubnetGroupResult(data.ModifyDBSubnetGroupResult, context); - const response: ModifyDBSubnetGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBSubnetGroupCommandError - */ -const de_ModifyDBSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.neptune#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.neptune#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "DBSubnetQuotaExceededFault": - case "com.amazonaws.neptune#DBSubnetQuotaExceededFault": - throw await de_DBSubnetQuotaExceededFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.neptune#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "SubnetAlreadyInUse": - case "com.amazonaws.neptune#SubnetAlreadyInUse": - throw await de_SubnetAlreadyInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyEventSubscriptionCommand - */ -export const de_ModifyEventSubscriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyEventSubscriptionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyEventSubscriptionResult(data.ModifyEventSubscriptionResult, context); - const response: ModifyEventSubscriptionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyEventSubscriptionCommandError - */ -const de_ModifyEventSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EventSubscriptionQuotaExceeded": - case "com.amazonaws.neptune#EventSubscriptionQuotaExceededFault": - throw await de_EventSubscriptionQuotaExceededFaultRes(parsedOutput, context); - case "SNSInvalidTopic": - case "com.amazonaws.neptune#SNSInvalidTopicFault": - throw await de_SNSInvalidTopicFaultRes(parsedOutput, context); - case "SNSNoAuthorization": - case "com.amazonaws.neptune#SNSNoAuthorizationFault": - throw await de_SNSNoAuthorizationFaultRes(parsedOutput, context); - case "SNSTopicArnNotFound": - case "com.amazonaws.neptune#SNSTopicArnNotFoundFault": - throw await de_SNSTopicArnNotFoundFaultRes(parsedOutput, context); - case "SubscriptionCategoryNotFound": - case "com.amazonaws.neptune#SubscriptionCategoryNotFoundFault": - throw await de_SubscriptionCategoryNotFoundFaultRes(parsedOutput, context); - case "SubscriptionNotFound": - case "com.amazonaws.neptune#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyGlobalClusterCommand - */ -export const de_ModifyGlobalClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyGlobalClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyGlobalClusterResult(data.ModifyGlobalClusterResult, context); - const response: ModifyGlobalClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyGlobalClusterCommandError - */ -const de_ModifyGlobalClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalClusterNotFoundFault": - case "com.amazonaws.neptune#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidGlobalClusterStateFault": - case "com.amazonaws.neptune#InvalidGlobalClusterStateFault": - throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPromoteReadReplicaDBClusterCommand - */ -export const de_PromoteReadReplicaDBClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PromoteReadReplicaDBClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PromoteReadReplicaDBClusterResult(data.PromoteReadReplicaDBClusterResult, context); - const response: PromoteReadReplicaDBClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryPromoteReadReplicaDBClusterCommandError - */ -const de_PromoteReadReplicaDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRebootDBInstanceCommand - */ -export const de_RebootDBInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RebootDBInstanceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RebootDBInstanceResult(data.RebootDBInstanceResult, context); - const response: RebootDBInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRebootDBInstanceCommandError - */ -const de_RebootDBInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.neptune#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.neptune#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRemoveFromGlobalClusterCommand - */ -export const de_RemoveFromGlobalClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveFromGlobalClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RemoveFromGlobalClusterResult(data.RemoveFromGlobalClusterResult, context); - const response: RemoveFromGlobalClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRemoveFromGlobalClusterCommandError - */ -const de_RemoveFromGlobalClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "GlobalClusterNotFoundFault": - case "com.amazonaws.neptune#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidGlobalClusterStateFault": - case "com.amazonaws.neptune#InvalidGlobalClusterStateFault": - throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRemoveRoleFromDBClusterCommand - */ -export const de_RemoveRoleFromDBClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveRoleFromDBClusterCommandError(output, context); - } - await collectBody(output.body, context); - const response: RemoveRoleFromDBClusterCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryRemoveRoleFromDBClusterCommandError - */ -const de_RemoveRoleFromDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterRoleNotFound": - case "com.amazonaws.neptune#DBClusterRoleNotFoundFault": - throw await de_DBClusterRoleNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRemoveSourceIdentifierFromSubscriptionCommand - */ -export const de_RemoveSourceIdentifierFromSubscriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveSourceIdentifierFromSubscriptionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RemoveSourceIdentifierFromSubscriptionResult( - data.RemoveSourceIdentifierFromSubscriptionResult, - context - ); - const response: RemoveSourceIdentifierFromSubscriptionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRemoveSourceIdentifierFromSubscriptionCommandError - */ -const de_RemoveSourceIdentifierFromSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "SourceNotFound": - case "com.amazonaws.neptune#SourceNotFoundFault": - throw await de_SourceNotFoundFaultRes(parsedOutput, context); - case "SubscriptionNotFound": - case "com.amazonaws.neptune#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRemoveTagsFromResourceCommand - */ -export const de_RemoveTagsFromResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveTagsFromResourceCommandError(output, context); - } - await collectBody(output.body, context); - const response: RemoveTagsFromResourceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryRemoveTagsFromResourceCommandError - */ -const de_RemoveTagsFromResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); case "DBInstanceNotFound": case "com.amazonaws.neptune#DBInstanceNotFoundFault": throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); case "DBSnapshotNotFound": case "com.amazonaws.neptune#DBSnapshotNotFoundFault": throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryResetDBClusterParameterGroupCommand - */ -export const de_ResetDBClusterParameterGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ResetDBClusterParameterGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DBClusterParameterGroupNameMessage(data.ResetDBClusterParameterGroupResult, context); - const response: ResetDBClusterParameterGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryResetDBClusterParameterGroupCommandError - */ -const de_ResetDBClusterParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.neptune#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBParameterGroupState": - case "com.amazonaws.neptune#InvalidDBParameterGroupStateFault": - throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryResetDBParameterGroupCommand - */ -export const de_ResetDBParameterGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ResetDBParameterGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DBParameterGroupNameMessage(data.ResetDBParameterGroupResult, context); - const response: ResetDBParameterGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryResetDBParameterGroupCommandError - */ -const de_ResetDBParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { + case "ResourceNotFoundFault": + case "com.amazonaws.neptune#ResourceNotFoundFault": + throw await de_ResourceNotFoundFaultRes(parsedOutput, context); + case "DBParameterGroupAlreadyExists": + case "com.amazonaws.neptune#DBParameterGroupAlreadyExistsFault": + throw await de_DBParameterGroupAlreadyExistsFaultRes(parsedOutput, context); case "DBParameterGroupNotFound": case "com.amazonaws.neptune#DBParameterGroupNotFoundFault": throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBParameterGroupState": - case "com.amazonaws.neptune#InvalidDBParameterGroupStateFault": - throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRestoreDBClusterFromSnapshotCommand - */ -export const de_RestoreDBClusterFromSnapshotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RestoreDBClusterFromSnapshotCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RestoreDBClusterFromSnapshotResult(data.RestoreDBClusterFromSnapshotResult, context); - const response: RestoreDBClusterFromSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRestoreDBClusterFromSnapshotCommandError - */ -const de_RestoreDBClusterFromSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterAlreadyExistsFault": - case "com.amazonaws.neptune#DBClusterAlreadyExistsFault": - throw await de_DBClusterAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterParameterGroupNotFound": - case "com.amazonaws.neptune#DBClusterParameterGroupNotFoundFault": - throw await de_DBClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBClusterQuotaExceededFault": - case "com.amazonaws.neptune#DBClusterQuotaExceededFault": - throw await de_DBClusterQuotaExceededFaultRes(parsedOutput, context); + case "DBParameterGroupQuotaExceeded": + case "com.amazonaws.neptune#DBParameterGroupQuotaExceededFault": + throw await de_DBParameterGroupQuotaExceededFaultRes(parsedOutput, context); + case "DBClusterSnapshotAlreadyExistsFault": + case "com.amazonaws.neptune#DBClusterSnapshotAlreadyExistsFault": + throw await de_DBClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); case "DBClusterSnapshotNotFoundFault": case "com.amazonaws.neptune#DBClusterSnapshotNotFoundFault": throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotNotFound": - case "com.amazonaws.neptune#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.neptune#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InsufficientDBClusterCapacityFault": - case "com.amazonaws.neptune#InsufficientDBClusterCapacityFault": - throw await de_InsufficientDBClusterCapacityFaultRes(parsedOutput, context); - case "InsufficientStorageClusterCapacity": - case "com.amazonaws.neptune#InsufficientStorageClusterCapacityFault": - throw await de_InsufficientStorageClusterCapacityFaultRes(parsedOutput, context); case "InvalidDBClusterSnapshotStateFault": case "com.amazonaws.neptune#InvalidDBClusterSnapshotStateFault": throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidDBSnapshotState": - case "com.amazonaws.neptune#InvalidDBSnapshotStateFault": - throw await de_InvalidDBSnapshotStateFaultRes(parsedOutput, context); - case "InvalidRestoreFault": - case "com.amazonaws.neptune#InvalidRestoreFault": - throw await de_InvalidRestoreFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.neptune#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.neptune#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); case "KMSKeyNotAccessibleFault": case "com.amazonaws.neptune#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.neptune#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.neptune#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRestoreDBClusterToPointInTimeCommand - */ -export const de_RestoreDBClusterToPointInTimeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RestoreDBClusterToPointInTimeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RestoreDBClusterToPointInTimeResult(data.RestoreDBClusterToPointInTimeResult, context); - const response: RestoreDBClusterToPointInTimeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRestoreDBClusterToPointInTimeCommandError - */ -const de_RestoreDBClusterToPointInTimeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { + throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); + case "SnapshotQuotaExceeded": + case "com.amazonaws.neptune#SnapshotQuotaExceededFault": + throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); case "DBClusterAlreadyExistsFault": case "com.amazonaws.neptune#DBClusterAlreadyExistsFault": throw await de_DBClusterAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); case "DBClusterParameterGroupNotFound": case "com.amazonaws.neptune#DBClusterParameterGroupNotFoundFault": throw await de_DBClusterParameterGroupNotFoundFaultRes(parsedOutput, context); case "DBClusterQuotaExceededFault": case "com.amazonaws.neptune#DBClusterQuotaExceededFault": throw await de_DBClusterQuotaExceededFaultRes(parsedOutput, context); - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.neptune#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); + case "DBSubnetGroupDoesNotCoverEnoughAZs": + case "com.amazonaws.neptune#DBSubnetGroupDoesNotCoverEnoughAZs": + throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); case "DBSubnetGroupNotFoundFault": case "com.amazonaws.neptune#DBSubnetGroupNotFoundFault": throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InsufficientDBClusterCapacityFault": - case "com.amazonaws.neptune#InsufficientDBClusterCapacityFault": - throw await de_InsufficientDBClusterCapacityFaultRes(parsedOutput, context); + case "GlobalClusterNotFoundFault": + case "com.amazonaws.neptune#GlobalClusterNotFoundFault": + throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); case "InsufficientStorageClusterCapacity": case "com.amazonaws.neptune#InsufficientStorageClusterCapacityFault": throw await de_InsufficientStorageClusterCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.neptune#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBSnapshotState": - case "com.amazonaws.neptune#InvalidDBSnapshotStateFault": - throw await de_InvalidDBSnapshotStateFaultRes(parsedOutput, context); - case "InvalidRestoreFault": - case "com.amazonaws.neptune#InvalidRestoreFault": - throw await de_InvalidRestoreFaultRes(parsedOutput, context); + case "InvalidDBInstanceState": + case "com.amazonaws.neptune#InvalidDBInstanceStateFault": + throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); + case "InvalidDBSubnetGroupStateFault": + case "com.amazonaws.neptune#InvalidDBSubnetGroupStateFault": + throw await de_InvalidDBSubnetGroupStateFaultRes(parsedOutput, context); + case "InvalidGlobalClusterStateFault": + case "com.amazonaws.neptune#InvalidGlobalClusterStateFault": + throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); case "InvalidSubnet": case "com.amazonaws.neptune#InvalidSubnet": throw await de_InvalidSubnetRes(parsedOutput, context); case "InvalidVPCNetworkStateFault": case "com.amazonaws.neptune#InvalidVPCNetworkStateFault": throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.neptune#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.neptune#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); case "StorageQuotaExceeded": case "com.amazonaws.neptune#StorageQuotaExceededFault": throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); + case "DBClusterEndpointAlreadyExistsFault": + case "com.amazonaws.neptune#DBClusterEndpointAlreadyExistsFault": + throw await de_DBClusterEndpointAlreadyExistsFaultRes(parsedOutput, context); + case "DBClusterEndpointQuotaExceededFault": + case "com.amazonaws.neptune#DBClusterEndpointQuotaExceededFault": + throw await de_DBClusterEndpointQuotaExceededFaultRes(parsedOutput, context); + case "AuthorizationNotFound": + case "com.amazonaws.neptune#AuthorizationNotFoundFault": + throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); + case "DBInstanceAlreadyExists": + case "com.amazonaws.neptune#DBInstanceAlreadyExistsFault": + throw await de_DBInstanceAlreadyExistsFaultRes(parsedOutput, context); + case "DBSecurityGroupNotFound": + case "com.amazonaws.neptune#DBSecurityGroupNotFoundFault": + throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); + case "DomainNotFoundFault": + case "com.amazonaws.neptune#DomainNotFoundFault": + throw await de_DomainNotFoundFaultRes(parsedOutput, context); + case "InstanceQuotaExceeded": + case "com.amazonaws.neptune#InstanceQuotaExceededFault": + throw await de_InstanceQuotaExceededFaultRes(parsedOutput, context); + case "InsufficientDBInstanceCapacity": + case "com.amazonaws.neptune#InsufficientDBInstanceCapacityFault": + throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); + case "OptionGroupNotFoundFault": + case "com.amazonaws.neptune#OptionGroupNotFoundFault": + throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); + case "ProvisionedIopsNotAvailableInAZFault": + case "com.amazonaws.neptune#ProvisionedIopsNotAvailableInAZFault": + throw await de_ProvisionedIopsNotAvailableInAZFaultRes(parsedOutput, context); + case "StorageTypeNotSupported": + case "com.amazonaws.neptune#StorageTypeNotSupportedFault": + throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); + case "DBSubnetGroupAlreadyExists": + case "com.amazonaws.neptune#DBSubnetGroupAlreadyExistsFault": + throw await de_DBSubnetGroupAlreadyExistsFaultRes(parsedOutput, context); + case "DBSubnetGroupQuotaExceeded": + case "com.amazonaws.neptune#DBSubnetGroupQuotaExceededFault": + throw await de_DBSubnetGroupQuotaExceededFaultRes(parsedOutput, context); + case "DBSubnetQuotaExceededFault": + case "com.amazonaws.neptune#DBSubnetQuotaExceededFault": + throw await de_DBSubnetQuotaExceededFaultRes(parsedOutput, context); + case "EventSubscriptionQuotaExceeded": + case "com.amazonaws.neptune#EventSubscriptionQuotaExceededFault": + throw await de_EventSubscriptionQuotaExceededFaultRes(parsedOutput, context); + case "SNSInvalidTopic": + case "com.amazonaws.neptune#SNSInvalidTopicFault": + throw await de_SNSInvalidTopicFaultRes(parsedOutput, context); + case "SNSNoAuthorization": + case "com.amazonaws.neptune#SNSNoAuthorizationFault": + throw await de_SNSNoAuthorizationFaultRes(parsedOutput, context); + case "SNSTopicArnNotFound": + case "com.amazonaws.neptune#SNSTopicArnNotFoundFault": + throw await de_SNSTopicArnNotFoundFaultRes(parsedOutput, context); + case "SubscriptionAlreadyExist": + case "com.amazonaws.neptune#SubscriptionAlreadyExistFault": + throw await de_SubscriptionAlreadyExistFaultRes(parsedOutput, context); + case "SubscriptionCategoryNotFound": + case "com.amazonaws.neptune#SubscriptionCategoryNotFoundFault": + throw await de_SubscriptionCategoryNotFoundFaultRes(parsedOutput, context); + case "GlobalClusterAlreadyExistsFault": + case "com.amazonaws.neptune#GlobalClusterAlreadyExistsFault": + throw await de_GlobalClusterAlreadyExistsFaultRes(parsedOutput, context); + case "GlobalClusterQuotaExceededFault": + case "com.amazonaws.neptune#GlobalClusterQuotaExceededFault": + throw await de_GlobalClusterQuotaExceededFaultRes(parsedOutput, context); + case "DBClusterEndpointNotFoundFault": + case "com.amazonaws.neptune#DBClusterEndpointNotFoundFault": + throw await de_DBClusterEndpointNotFoundFaultRes(parsedOutput, context); + case "InvalidDBClusterEndpointStateFault": + case "com.amazonaws.neptune#InvalidDBClusterEndpointStateFault": + throw await de_InvalidDBClusterEndpointStateFaultRes(parsedOutput, context); + case "InvalidDBParameterGroupState": + case "com.amazonaws.neptune#InvalidDBParameterGroupStateFault": + throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); + case "DBSnapshotAlreadyExists": + case "com.amazonaws.neptune#DBSnapshotAlreadyExistsFault": + throw await de_DBSnapshotAlreadyExistsFaultRes(parsedOutput, context); + case "InvalidDBSubnetStateFault": + case "com.amazonaws.neptune#InvalidDBSubnetStateFault": + throw await de_InvalidDBSubnetStateFaultRes(parsedOutput, context); + case "InvalidEventSubscriptionState": + case "com.amazonaws.neptune#InvalidEventSubscriptionStateFault": + throw await de_InvalidEventSubscriptionStateFaultRes(parsedOutput, context); + case "InvalidDBSecurityGroupState": + case "com.amazonaws.neptune#InvalidDBSecurityGroupStateFault": + throw await de_InvalidDBSecurityGroupStateFaultRes(parsedOutput, context); + case "SharedSnapshotQuotaExceeded": + case "com.amazonaws.neptune#SharedSnapshotQuotaExceededFault": + throw await de_SharedSnapshotQuotaExceededFaultRes(parsedOutput, context); + case "CertificateNotFound": + case "com.amazonaws.neptune#CertificateNotFoundFault": + throw await de_CertificateNotFoundFaultRes(parsedOutput, context); + case "DBUpgradeDependencyFailure": + case "com.amazonaws.neptune#DBUpgradeDependencyFailureFault": + throw await de_DBUpgradeDependencyFailureFaultRes(parsedOutput, context); + case "SubnetAlreadyInUse": + case "com.amazonaws.neptune#SubnetAlreadyInUse": + throw await de_SubnetAlreadyInUseRes(parsedOutput, context); + case "DBClusterRoleNotFound": + case "com.amazonaws.neptune#DBClusterRoleNotFoundFault": + throw await de_DBClusterRoleNotFoundFaultRes(parsedOutput, context); + case "InsufficientDBClusterCapacityFault": + case "com.amazonaws.neptune#InsufficientDBClusterCapacityFault": + throw await de_InsufficientDBClusterCapacityFaultRes(parsedOutput, context); + case "InvalidDBSnapshotState": + case "com.amazonaws.neptune#InvalidDBSnapshotStateFault": + throw await de_InvalidDBSnapshotStateFaultRes(parsedOutput, context); + case "InvalidRestoreFault": + case "com.amazonaws.neptune#InvalidRestoreFault": + throw await de_InvalidRestoreFaultRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody: parsedBody.Error, errorCode, - }); - } -}; - -/** - * deserializeAws_queryStartDBClusterCommand - */ -export const de_StartDBClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartDBClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_StartDBClusterResult(data.StartDBClusterResult, context); - const response: StartDBClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryStartDBClusterCommandError - */ -const de_StartDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.neptune#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryStopDBClusterCommand - */ -export const de_StopDBClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StopDBClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_StopDBClusterResult(data.StopDBClusterResult, context); - const response: StopDBClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryStopDBClusterCommandError - */ -const de_StopDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.neptune#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.neptune#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.neptune#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + }) as never; } }; diff --git a/clients/client-neptunedata/src/protocols/Aws_restJson1.ts b/clients/client-neptunedata/src/protocols/Aws_restJson1.ts index 8a0a4385ec3a..f28355f2d7c5 100644 --- a/clients/client-neptunedata/src/protocols/Aws_restJson1.ts +++ b/clients/client-neptunedata/src/protocols/Aws_restJson1.ts @@ -1134,7 +1134,7 @@ export const de_CancelGremlinQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelGremlinQueryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1147,71 +1147,6 @@ export const de_CancelGremlinQueryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelGremlinQueryCommandError - */ -const de_CancelGremlinQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.neptunedata#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "FailureByQueryException": - case "com.amazonaws.neptunedata#FailureByQueryException": - throw await de_FailureByQueryExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "ParsingException": - case "com.amazonaws.neptunedata#ParsingException": - throw await de_ParsingExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TimeLimitExceededException": - case "com.amazonaws.neptunedata#TimeLimitExceededException": - throw await de_TimeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelLoaderJobCommand */ @@ -1220,7 +1155,7 @@ export const de_CancelLoaderJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelLoaderJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1233,68 +1168,6 @@ export const de_CancelLoaderJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelLoaderJobCommandError - */ -const de_CancelLoaderJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "BulkLoadIdNotFoundException": - case "com.amazonaws.neptunedata#BulkLoadIdNotFoundException": - throw await de_BulkLoadIdNotFoundExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.neptunedata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LoadUrlAccessDeniedException": - case "com.amazonaws.neptunedata#LoadUrlAccessDeniedException": - throw await de_LoadUrlAccessDeniedExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelMLDataProcessingJobCommand */ @@ -1303,7 +1176,7 @@ export const de_CancelMLDataProcessingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelMLDataProcessingJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1316,62 +1189,6 @@ export const de_CancelMLDataProcessingJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelMLDataProcessingJobCommandError - */ -const de_CancelMLDataProcessingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelMLModelTrainingJobCommand */ @@ -1380,7 +1197,7 @@ export const de_CancelMLModelTrainingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelMLModelTrainingJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1394,76 +1211,42 @@ export const de_CancelMLModelTrainingJobCommand = async ( }; /** - * deserializeAws_restJson1CancelMLModelTrainingJobCommandError + * deserializeAws_restJson1CancelMLModelTransformJobCommand */ -const de_CancelMLModelTrainingJobCommandError = async ( +export const de_CancelMLModelTransformJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CancelMLModelTransformJobCommand + * deserializeAws_restJson1CancelOpenCypherQueryCommand */ -export const de_CancelMLModelTransformJobCommand = async ( +export const de_CancelOpenCypherQueryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelMLModelTransformJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + payload: __expectBoolean, status: __expectString, }); Object.assign(contents, doc); @@ -1471,77 +1254,43 @@ export const de_CancelMLModelTransformJobCommand = async ( }; /** - * deserializeAws_restJson1CancelMLModelTransformJobCommandError + * deserializeAws_restJson1CreateMLEndpointCommand */ -const de_CancelMLModelTransformJobCommandError = async ( +export const de_CreateMLEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + arn: __expectString, + creationTimeInMillis: __expectLong, + id: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CancelOpenCypherQueryCommand + * deserializeAws_restJson1DeleteMLEndpointCommand */ -export const de_CancelOpenCypherQueryCommand = async ( +export const de_DeleteMLEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelOpenCypherQueryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - payload: __expectBoolean, status: __expectString, }); Object.assign(contents, doc); @@ -1549,238 +1298,64 @@ export const de_CancelOpenCypherQueryCommand = async ( }; /** - * deserializeAws_restJson1CancelOpenCypherQueryCommandError - */ -const de_CancelOpenCypherQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.neptunedata#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "FailureByQueryException": - case "com.amazonaws.neptunedata#FailureByQueryException": - throw await de_FailureByQueryExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNumericDataException": - case "com.amazonaws.neptunedata#InvalidNumericDataException": - throw await de_InvalidNumericDataExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "ParsingException": - case "com.amazonaws.neptunedata#ParsingException": - throw await de_ParsingExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TimeLimitExceededException": - case "com.amazonaws.neptunedata#TimeLimitExceededException": - throw await de_TimeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateMLEndpointCommand + * deserializeAws_restJson1DeletePropertygraphStatisticsCommand */ -export const de_CreateMLEndpointCommand = async ( +export const de_DeletePropertygraphStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMLEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - arn: __expectString, - creationTimeInMillis: __expectLong, - id: __expectString, + payload: _json, + status: __expectString, }); Object.assign(contents, doc); + map(contents, { + statusCode: [, output.statusCode], + }); return contents; }; /** - * deserializeAws_restJson1CreateMLEndpointCommandError - */ -const de_CreateMLEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteMLEndpointCommand + * deserializeAws_restJson1DeleteSparqlStatisticsCommand */ -export const de_DeleteMLEndpointCommand = async ( +export const de_DeleteSparqlStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMLEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + payload: _json, status: __expectString, }); Object.assign(contents, doc); + map(contents, { + statusCode: [, output.statusCode], + }); return contents; }; /** - * deserializeAws_restJson1DeleteMLEndpointCommandError - */ -const de_DeleteMLEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePropertygraphStatisticsCommand + * deserializeAws_restJson1ExecuteFastResetCommand */ -export const de_DeletePropertygraphStatisticsCommand = async ( +export const de_ExecuteFastResetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePropertygraphStatisticsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1791,245 +1366,9 @@ export const de_DeletePropertygraphStatisticsCommand = async ( status: __expectString, }); Object.assign(contents, doc); - map(contents, { - statusCode: [, output.statusCode], - }); return contents; }; -/** - * deserializeAws_restJson1DeletePropertygraphStatisticsCommandError - */ -const de_DeletePropertygraphStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "ReadOnlyViolationException": - case "com.amazonaws.neptunedata#ReadOnlyViolationException": - throw await de_ReadOnlyViolationExceptionRes(parsedOutput, context); - case "StatisticsNotAvailableException": - case "com.amazonaws.neptunedata#StatisticsNotAvailableException": - throw await de_StatisticsNotAvailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSparqlStatisticsCommand - */ -export const de_DeleteSparqlStatisticsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSparqlStatisticsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - payload: _json, - status: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - statusCode: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSparqlStatisticsCommandError - */ -const de_DeleteSparqlStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "ReadOnlyViolationException": - case "com.amazonaws.neptunedata#ReadOnlyViolationException": - throw await de_ReadOnlyViolationExceptionRes(parsedOutput, context); - case "StatisticsNotAvailableException": - case "com.amazonaws.neptunedata#StatisticsNotAvailableException": - throw await de_StatisticsNotAvailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ExecuteFastResetCommand - */ -export const de_ExecuteFastResetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExecuteFastResetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - payload: _json, - status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ExecuteFastResetCommandError - */ -const de_ExecuteFastResetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.neptunedata#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "ReadOnlyViolationException": - case "com.amazonaws.neptunedata#ReadOnlyViolationException": - throw await de_ReadOnlyViolationExceptionRes(parsedOutput, context); - case "ServerShutdownException": - case "com.amazonaws.neptunedata#ServerShutdownException": - throw await de_ServerShutdownExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExecuteGremlinExplainQueryCommand */ @@ -2038,7 +1377,7 @@ export const de_ExecuteGremlinExplainQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExecuteGremlinExplainQueryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2049,1540 +1388,158 @@ export const de_ExecuteGremlinExplainQueryCommand = async ( }; /** - * deserializeAws_restJson1ExecuteGremlinExplainQueryCommandError + * deserializeAws_restJson1ExecuteGremlinProfileQueryCommand */ -const de_ExecuteGremlinExplainQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "CancelledByUserException": - case "com.amazonaws.neptunedata#CancelledByUserException": - throw await de_CancelledByUserExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.neptunedata#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "FailureByQueryException": - case "com.amazonaws.neptunedata#FailureByQueryException": - throw await de_FailureByQueryExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedQueryException": - case "com.amazonaws.neptunedata#MalformedQueryException": - throw await de_MalformedQueryExceptionRes(parsedOutput, context); - case "MemoryLimitExceededException": - case "com.amazonaws.neptunedata#MemoryLimitExceededException": - throw await de_MemoryLimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "ParsingException": - case "com.amazonaws.neptunedata#ParsingException": - throw await de_ParsingExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "QueryLimitExceededException": - case "com.amazonaws.neptunedata#QueryLimitExceededException": - throw await de_QueryLimitExceededExceptionRes(parsedOutput, context); - case "QueryLimitException": - case "com.amazonaws.neptunedata#QueryLimitException": - throw await de_QueryLimitExceptionRes(parsedOutput, context); - case "QueryTooLargeException": - case "com.amazonaws.neptunedata#QueryTooLargeException": - throw await de_QueryTooLargeExceptionRes(parsedOutput, context); - case "TimeLimitExceededException": - case "com.amazonaws.neptunedata#TimeLimitExceededException": - throw await de_TimeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ExecuteGremlinProfileQueryCommand - */ -export const de_ExecuteGremlinProfileQueryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExecuteGremlinProfileQueryCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: any = await collectBody(output.body, context); - contents.output = data; - return contents; -}; - -/** - * deserializeAws_restJson1ExecuteGremlinProfileQueryCommandError - */ -const de_ExecuteGremlinProfileQueryCommandError = async ( +export const de_ExecuteGremlinProfileQueryCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "CancelledByUserException": - case "com.amazonaws.neptunedata#CancelledByUserException": - throw await de_CancelledByUserExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.neptunedata#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "FailureByQueryException": - case "com.amazonaws.neptunedata#FailureByQueryException": - throw await de_FailureByQueryExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedQueryException": - case "com.amazonaws.neptunedata#MalformedQueryException": - throw await de_MalformedQueryExceptionRes(parsedOutput, context); - case "MemoryLimitExceededException": - case "com.amazonaws.neptunedata#MemoryLimitExceededException": - throw await de_MemoryLimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "ParsingException": - case "com.amazonaws.neptunedata#ParsingException": - throw await de_ParsingExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "QueryLimitExceededException": - case "com.amazonaws.neptunedata#QueryLimitExceededException": - throw await de_QueryLimitExceededExceptionRes(parsedOutput, context); - case "QueryLimitException": - case "com.amazonaws.neptunedata#QueryLimitException": - throw await de_QueryLimitExceptionRes(parsedOutput, context); - case "QueryTooLargeException": - case "com.amazonaws.neptunedata#QueryTooLargeException": - throw await de_QueryTooLargeExceptionRes(parsedOutput, context); - case "TimeLimitExceededException": - case "com.amazonaws.neptunedata#TimeLimitExceededException": - throw await de_TimeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ExecuteGremlinQueryCommand - */ -export const de_ExecuteGremlinQueryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExecuteGremlinQueryCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - meta: (_) => de_Document(_, context), - requestId: __expectString, - result: (_) => de_Document(_, context), - status: (_) => de_GremlinQueryStatusAttributes(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ExecuteGremlinQueryCommandError - */ -const de_ExecuteGremlinQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "CancelledByUserException": - case "com.amazonaws.neptunedata#CancelledByUserException": - throw await de_CancelledByUserExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.neptunedata#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "FailureByQueryException": - case "com.amazonaws.neptunedata#FailureByQueryException": - throw await de_FailureByQueryExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedQueryException": - case "com.amazonaws.neptunedata#MalformedQueryException": - throw await de_MalformedQueryExceptionRes(parsedOutput, context); - case "MemoryLimitExceededException": - case "com.amazonaws.neptunedata#MemoryLimitExceededException": - throw await de_MemoryLimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "ParsingException": - case "com.amazonaws.neptunedata#ParsingException": - throw await de_ParsingExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "QueryLimitExceededException": - case "com.amazonaws.neptunedata#QueryLimitExceededException": - throw await de_QueryLimitExceededExceptionRes(parsedOutput, context); - case "QueryLimitException": - case "com.amazonaws.neptunedata#QueryLimitException": - throw await de_QueryLimitExceptionRes(parsedOutput, context); - case "QueryTooLargeException": - case "com.amazonaws.neptunedata#QueryTooLargeException": - throw await de_QueryTooLargeExceptionRes(parsedOutput, context); - case "TimeLimitExceededException": - case "com.amazonaws.neptunedata#TimeLimitExceededException": - throw await de_TimeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ExecuteOpenCypherExplainQueryCommand - */ -export const de_ExecuteOpenCypherExplainQueryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExecuteOpenCypherExplainQueryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - }); - const data: any = await collectBody(output.body, context); - contents.results = data; - return contents; -}; - -/** - * deserializeAws_restJson1ExecuteOpenCypherExplainQueryCommandError - */ -const de_ExecuteOpenCypherExplainQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "CancelledByUserException": - case "com.amazonaws.neptunedata#CancelledByUserException": - throw await de_CancelledByUserExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.neptunedata#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "FailureByQueryException": - case "com.amazonaws.neptunedata#FailureByQueryException": - throw await de_FailureByQueryExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNumericDataException": - case "com.amazonaws.neptunedata#InvalidNumericDataException": - throw await de_InvalidNumericDataExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedQueryException": - case "com.amazonaws.neptunedata#MalformedQueryException": - throw await de_MalformedQueryExceptionRes(parsedOutput, context); - case "MemoryLimitExceededException": - case "com.amazonaws.neptunedata#MemoryLimitExceededException": - throw await de_MemoryLimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "ParsingException": - case "com.amazonaws.neptunedata#ParsingException": - throw await de_ParsingExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "QueryLimitExceededException": - case "com.amazonaws.neptunedata#QueryLimitExceededException": - throw await de_QueryLimitExceededExceptionRes(parsedOutput, context); - case "QueryLimitException": - case "com.amazonaws.neptunedata#QueryLimitException": - throw await de_QueryLimitExceptionRes(parsedOutput, context); - case "QueryTooLargeException": - case "com.amazonaws.neptunedata#QueryTooLargeException": - throw await de_QueryTooLargeExceptionRes(parsedOutput, context); - case "TimeLimitExceededException": - case "com.amazonaws.neptunedata#TimeLimitExceededException": - throw await de_TimeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ExecuteOpenCypherQueryCommand - */ -export const de_ExecuteOpenCypherQueryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExecuteOpenCypherQueryCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - results: (_) => de_Document(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ExecuteOpenCypherQueryCommandError - */ -const de_ExecuteOpenCypherQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "CancelledByUserException": - case "com.amazonaws.neptunedata#CancelledByUserException": - throw await de_CancelledByUserExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.neptunedata#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "FailureByQueryException": - case "com.amazonaws.neptunedata#FailureByQueryException": - throw await de_FailureByQueryExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNumericDataException": - case "com.amazonaws.neptunedata#InvalidNumericDataException": - throw await de_InvalidNumericDataExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedQueryException": - case "com.amazonaws.neptunedata#MalformedQueryException": - throw await de_MalformedQueryExceptionRes(parsedOutput, context); - case "MemoryLimitExceededException": - case "com.amazonaws.neptunedata#MemoryLimitExceededException": - throw await de_MemoryLimitExceededExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "ParsingException": - case "com.amazonaws.neptunedata#ParsingException": - throw await de_ParsingExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "QueryLimitExceededException": - case "com.amazonaws.neptunedata#QueryLimitExceededException": - throw await de_QueryLimitExceededExceptionRes(parsedOutput, context); - case "QueryLimitException": - case "com.amazonaws.neptunedata#QueryLimitException": - throw await de_QueryLimitExceptionRes(parsedOutput, context); - case "QueryTooLargeException": - case "com.amazonaws.neptunedata#QueryTooLargeException": - throw await de_QueryTooLargeExceptionRes(parsedOutput, context); - case "TimeLimitExceededException": - case "com.amazonaws.neptunedata#TimeLimitExceededException": - throw await de_TimeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEngineStatusCommand - */ -export const de_GetEngineStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEngineStatusCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - dbEngineVersion: __expectString, - dfeQueryEngine: __expectString, - features: (_) => de_DocumentValuedMap(_, context), - gremlin: _json, - labMode: _json, - opencypher: _json, - role: __expectString, - rollingBackTrxCount: __expectInt32, - rollingBackTrxEarliestStartTime: __expectString, - settings: _json, - sparql: _json, - startTime: __expectString, - status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEngineStatusCommandError - */ -const de_GetEngineStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.neptunedata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetGremlinQueryStatusCommand - */ -export const de_GetGremlinQueryStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGremlinQueryStatusCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - queryEvalStats: (_) => de_QueryEvalStats(_, context), - queryId: __expectString, - queryString: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetGremlinQueryStatusCommandError - */ -const de_GetGremlinQueryStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.neptunedata#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "FailureByQueryException": - case "com.amazonaws.neptunedata#FailureByQueryException": - throw await de_FailureByQueryExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "ParsingException": - case "com.amazonaws.neptunedata#ParsingException": - throw await de_ParsingExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "ReadOnlyViolationException": - case "com.amazonaws.neptunedata#ReadOnlyViolationException": - throw await de_ReadOnlyViolationExceptionRes(parsedOutput, context); - case "TimeLimitExceededException": - case "com.amazonaws.neptunedata#TimeLimitExceededException": - throw await de_TimeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetLoaderJobStatusCommand - */ -export const de_GetLoaderJobStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLoaderJobStatusCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - payload: (_) => de_Document(_, context), - status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetLoaderJobStatusCommandError - */ -const de_GetLoaderJobStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "BulkLoadIdNotFoundException": - case "com.amazonaws.neptunedata#BulkLoadIdNotFoundException": - throw await de_BulkLoadIdNotFoundExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.neptunedata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LoadUrlAccessDeniedException": - case "com.amazonaws.neptunedata#LoadUrlAccessDeniedException": - throw await de_LoadUrlAccessDeniedExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMLDataProcessingJobCommand - */ -export const de_GetMLDataProcessingJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMLDataProcessingJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - id: __expectString, - processingJob: _json, - status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMLDataProcessingJobCommandError - */ -const de_GetMLDataProcessingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMLEndpointCommand - */ -export const de_GetMLEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMLEndpointCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - endpoint: _json, - endpointConfig: _json, - id: __expectString, - status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMLEndpointCommandError - */ -const de_GetMLEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMLModelTrainingJobCommand - */ -export const de_GetMLModelTrainingJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMLModelTrainingJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - hpoJob: _json, - id: __expectString, - mlModels: _json, - modelTransformJob: _json, - processingJob: _json, - status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMLModelTrainingJobCommandError - */ -const de_GetMLModelTrainingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMLModelTransformJobCommand - */ -export const de_GetMLModelTransformJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMLModelTransformJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - baseProcessingJob: _json, - id: __expectString, - models: _json, - remoteModelTransformJob: _json, - status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMLModelTransformJobCommandError - */ -const de_GetMLModelTransformJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetOpenCypherQueryStatusCommand - */ -export const de_GetOpenCypherQueryStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOpenCypherQueryStatusCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - queryEvalStats: (_) => de_QueryEvalStats(_, context), - queryId: __expectString, - queryString: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetOpenCypherQueryStatusCommandError - */ -const de_GetOpenCypherQueryStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.neptunedata#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "FailureByQueryException": - case "com.amazonaws.neptunedata#FailureByQueryException": - throw await de_FailureByQueryExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNumericDataException": - case "com.amazonaws.neptunedata#InvalidNumericDataException": - throw await de_InvalidNumericDataExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "ParsingException": - case "com.amazonaws.neptunedata#ParsingException": - throw await de_ParsingExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "ReadOnlyViolationException": - case "com.amazonaws.neptunedata#ReadOnlyViolationException": - throw await de_ReadOnlyViolationExceptionRes(parsedOutput, context); - case "TimeLimitExceededException": - case "com.amazonaws.neptunedata#TimeLimitExceededException": - throw await de_TimeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPropertygraphStatisticsCommand - */ -export const de_GetPropertygraphStatisticsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPropertygraphStatisticsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - payload: (_) => de_Statistics(_, context), - status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPropertygraphStatisticsCommandError - */ -const de_GetPropertygraphStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "ReadOnlyViolationException": - case "com.amazonaws.neptunedata#ReadOnlyViolationException": - throw await de_ReadOnlyViolationExceptionRes(parsedOutput, context); - case "StatisticsNotAvailableException": - case "com.amazonaws.neptunedata#StatisticsNotAvailableException": - throw await de_StatisticsNotAvailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPropertygraphStreamCommand - */ -export const de_GetPropertygraphStreamCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPropertygraphStreamCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - format: __expectString, - lastEventId: _json, - lastTrxTimestampInMillis: [, __expectLong, `lastTrxTimestamp`], - records: (_) => de_PropertygraphRecordsList(_, context), - totalRecords: __expectInt32, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPropertygraphStreamCommandError - */ -const de_GetPropertygraphStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "ExpiredStreamException": - case "com.amazonaws.neptunedata#ExpiredStreamException": - throw await de_ExpiredStreamExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MemoryLimitExceededException": - case "com.amazonaws.neptunedata#MemoryLimitExceededException": - throw await de_MemoryLimitExceededExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "StreamRecordsNotFoundException": - case "com.amazonaws.neptunedata#StreamRecordsNotFoundException": - throw await de_StreamRecordsNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + const data: any = await collectBody(output.body, context); + contents.output = data; + return contents; }; /** - * deserializeAws_restJson1GetPropertygraphSummaryCommand + * deserializeAws_restJson1ExecuteGremlinQueryCommand */ -export const de_GetPropertygraphSummaryCommand = async ( +export const de_ExecuteGremlinQueryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPropertygraphSummaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - payload: (_) => de_PropertygraphSummaryValueMap(_, context), + meta: (_) => de_Document(_, context), + requestId: __expectString, + result: (_) => de_Document(_, context), + status: (_) => de_GremlinQueryStatusAttributes(_, context), }); Object.assign(contents, doc); - map(contents, { - statusCode: [, output.statusCode], - }); return contents; }; /** - * deserializeAws_restJson1GetPropertygraphSummaryCommandError + * deserializeAws_restJson1ExecuteOpenCypherExplainQueryCommand */ -const de_GetPropertygraphSummaryCommandError = async ( +export const de_ExecuteOpenCypherExplainQueryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "ReadOnlyViolationException": - case "com.amazonaws.neptunedata#ReadOnlyViolationException": - throw await de_ReadOnlyViolationExceptionRes(parsedOutput, context); - case "StatisticsNotAvailableException": - case "com.amazonaws.neptunedata#StatisticsNotAvailableException": - throw await de_StatisticsNotAvailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: any = await collectBody(output.body, context); + contents.results = data; + return contents; }; /** - * deserializeAws_restJson1GetRDFGraphSummaryCommand + * deserializeAws_restJson1ExecuteOpenCypherQueryCommand */ -export const de_GetRDFGraphSummaryCommand = async ( +export const de_ExecuteOpenCypherQueryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRDFGraphSummaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - payload: (_) => de_RDFGraphSummaryValueMap(_, context), + results: (_) => de_Document(_, context), }); Object.assign(contents, doc); - map(contents, { - statusCode: [, output.statusCode], + return contents; +}; + +/** + * deserializeAws_restJson1GetEngineStatusCommand + */ +export const de_GetEngineStatusCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + dbEngineVersion: __expectString, + dfeQueryEngine: __expectString, + features: (_) => de_DocumentValuedMap(_, context), + gremlin: _json, + labMode: _json, + opencypher: _json, + role: __expectString, + rollingBackTrxCount: __expectInt32, + rollingBackTrxEarliestStartTime: __expectString, + settings: _json, + sparql: _json, + startTime: __expectString, + status: __expectString, }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetRDFGraphSummaryCommandError + * deserializeAws_restJson1GetGremlinQueryStatusCommand */ -const de_GetRDFGraphSummaryCommandError = async ( +export const de_GetGremlinQueryStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "ReadOnlyViolationException": - case "com.amazonaws.neptunedata#ReadOnlyViolationException": - throw await de_ReadOnlyViolationExceptionRes(parsedOutput, context); - case "StatisticsNotAvailableException": - case "com.amazonaws.neptunedata#StatisticsNotAvailableException": - throw await de_StatisticsNotAvailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + queryEvalStats: (_) => de_QueryEvalStats(_, context), + queryId: __expectString, + queryString: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetSparqlStatisticsCommand + * deserializeAws_restJson1GetLoaderJobStatusCommand */ -export const de_GetSparqlStatisticsCommand = async ( +export const de_GetLoaderJobStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSparqlStatisticsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - payload: (_) => de_Statistics(_, context), + payload: (_) => de_Document(_, context), status: __expectString, }); Object.assign(contents, doc); @@ -3590,261 +1547,142 @@ export const de_GetSparqlStatisticsCommand = async ( }; /** - * deserializeAws_restJson1GetSparqlStatisticsCommandError + * deserializeAws_restJson1GetMLDataProcessingJobCommand */ -const de_GetSparqlStatisticsCommandError = async ( +export const de_GetMLDataProcessingJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "ReadOnlyViolationException": - case "com.amazonaws.neptunedata#ReadOnlyViolationException": - throw await de_ReadOnlyViolationExceptionRes(parsedOutput, context); - case "StatisticsNotAvailableException": - case "com.amazonaws.neptunedata#StatisticsNotAvailableException": - throw await de_StatisticsNotAvailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + id: __expectString, + processingJob: _json, + status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetSparqlStreamCommand + * deserializeAws_restJson1GetMLEndpointCommand */ -export const de_GetSparqlStreamCommand = async ( +export const de_GetMLEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSparqlStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - format: __expectString, - lastEventId: _json, - lastTrxTimestampInMillis: [, __expectLong, `lastTrxTimestamp`], - records: (_) => de_SparqlRecordsList(_, context), - totalRecords: __expectInt32, + endpoint: _json, + endpointConfig: _json, + id: __expectString, + status: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetSparqlStreamCommandError + * deserializeAws_restJson1GetMLModelTrainingJobCommand */ -const de_GetSparqlStreamCommandError = async ( +export const de_GetMLModelTrainingJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "ExpiredStreamException": - case "com.amazonaws.neptunedata#ExpiredStreamException": - throw await de_ExpiredStreamExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MemoryLimitExceededException": - case "com.amazonaws.neptunedata#MemoryLimitExceededException": - throw await de_MemoryLimitExceededExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "StreamRecordsNotFoundException": - case "com.amazonaws.neptunedata#StreamRecordsNotFoundException": - throw await de_StreamRecordsNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.neptunedata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + hpoJob: _json, + id: __expectString, + mlModels: _json, + modelTransformJob: _json, + processingJob: _json, + status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListGremlinQueriesCommand + * deserializeAws_restJson1GetMLModelTransformJobCommand */ -export const de_ListGremlinQueriesCommand = async ( +export const de_GetMLModelTransformJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGremlinQueriesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - acceptedQueryCount: __expectInt32, - queries: (_) => de_GremlinQueries(_, context), - runningQueryCount: __expectInt32, + baseProcessingJob: _json, + id: __expectString, + models: _json, + remoteModelTransformJob: _json, + status: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListGremlinQueriesCommandError + * deserializeAws_restJson1GetOpenCypherQueryStatusCommand */ -const de_ListGremlinQueriesCommandError = async ( +export const de_GetOpenCypherQueryStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.neptunedata#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "FailureByQueryException": - case "com.amazonaws.neptunedata#FailureByQueryException": - throw await de_FailureByQueryExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "ParsingException": - case "com.amazonaws.neptunedata#ParsingException": - throw await de_ParsingExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "ReadOnlyViolationException": - case "com.amazonaws.neptunedata#ReadOnlyViolationException": - throw await de_ReadOnlyViolationExceptionRes(parsedOutput, context); - case "TimeLimitExceededException": - case "com.amazonaws.neptunedata#TimeLimitExceededException": - throw await de_TimeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + queryEvalStats: (_) => de_QueryEvalStats(_, context), + queryId: __expectString, + queryString: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListLoaderJobsCommand + * deserializeAws_restJson1GetPropertygraphStatisticsCommand */ -export const de_ListLoaderJobsCommand = async ( +export const de_GetPropertygraphStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLoaderJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - payload: _json, + payload: (_) => de_Statistics(_, context), status: __expectString, }); Object.assign(contents, doc); @@ -3852,646 +1690,308 @@ export const de_ListLoaderJobsCommand = async ( }; /** - * deserializeAws_restJson1ListLoaderJobsCommandError + * deserializeAws_restJson1GetPropertygraphStreamCommand */ -const de_ListLoaderJobsCommandError = async ( +export const de_GetPropertygraphStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "BulkLoadIdNotFoundException": - case "com.amazonaws.neptunedata#BulkLoadIdNotFoundException": - throw await de_BulkLoadIdNotFoundExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.neptunedata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LoadUrlAccessDeniedException": - case "com.amazonaws.neptunedata#LoadUrlAccessDeniedException": - throw await de_LoadUrlAccessDeniedExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + format: __expectString, + lastEventId: _json, + lastTrxTimestampInMillis: [, __expectLong, `lastTrxTimestamp`], + records: (_) => de_PropertygraphRecordsList(_, context), + totalRecords: __expectInt32, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListMLDataProcessingJobsCommand + * deserializeAws_restJson1GetPropertygraphSummaryCommand */ -export const de_ListMLDataProcessingJobsCommand = async ( +export const de_GetPropertygraphSummaryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMLDataProcessingJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ids: _json, + payload: (_) => de_PropertygraphSummaryValueMap(_, context), }); Object.assign(contents, doc); + map(contents, { + statusCode: [, output.statusCode], + }); return contents; }; /** - * deserializeAws_restJson1ListMLDataProcessingJobsCommandError - */ -const de_ListMLDataProcessingJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListMLEndpointsCommand + * deserializeAws_restJson1GetRDFGraphSummaryCommand */ -export const de_ListMLEndpointsCommand = async ( +export const de_GetRDFGraphSummaryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMLEndpointsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ids: _json, + payload: (_) => de_RDFGraphSummaryValueMap(_, context), }); Object.assign(contents, doc); + map(contents, { + statusCode: [, output.statusCode], + }); return contents; }; /** - * deserializeAws_restJson1ListMLEndpointsCommandError - */ -const de_ListMLEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListMLModelTrainingJobsCommand + * deserializeAws_restJson1GetSparqlStatisticsCommand */ -export const de_ListMLModelTrainingJobsCommand = async ( +export const de_GetSparqlStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMLModelTrainingJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ids: _json, + payload: (_) => de_Statistics(_, context), + status: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListMLModelTrainingJobsCommandError + * deserializeAws_restJson1GetSparqlStreamCommand */ -const de_ListMLModelTrainingJobsCommandError = async ( +export const de_GetSparqlStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + format: __expectString, + lastEventId: _json, + lastTrxTimestampInMillis: [, __expectLong, `lastTrxTimestamp`], + records: (_) => de_SparqlRecordsList(_, context), + totalRecords: __expectInt32, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListMLModelTransformJobsCommand + * deserializeAws_restJson1ListGremlinQueriesCommand */ -export const de_ListMLModelTransformJobsCommand = async ( +export const de_ListGremlinQueriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMLModelTransformJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ids: _json, + acceptedQueryCount: __expectInt32, + queries: (_) => de_GremlinQueries(_, context), + runningQueryCount: __expectInt32, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListMLModelTransformJobsCommandError - */ -const de_ListMLModelTransformJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + * deserializeAws_restJson1ListLoaderJobsCommand + */ +export const de_ListLoaderJobsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + payload: _json, + status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListOpenCypherQueriesCommand + * deserializeAws_restJson1ListMLDataProcessingJobsCommand */ -export const de_ListOpenCypherQueriesCommand = async ( +export const de_ListMLDataProcessingJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOpenCypherQueriesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - acceptedQueryCount: __expectInt32, - queries: (_) => de_OpenCypherQueries(_, context), - runningQueryCount: __expectInt32, + ids: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListOpenCypherQueriesCommandError + * deserializeAws_restJson1ListMLEndpointsCommand */ -const de_ListOpenCypherQueriesCommandError = async ( +export const de_ListMLEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.neptunedata#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "FailureByQueryException": - case "com.amazonaws.neptunedata#FailureByQueryException": - throw await de_FailureByQueryExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidNumericDataException": - case "com.amazonaws.neptunedata#InvalidNumericDataException": - throw await de_InvalidNumericDataExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "ParsingException": - case "com.amazonaws.neptunedata#ParsingException": - throw await de_ParsingExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "ReadOnlyViolationException": - case "com.amazonaws.neptunedata#ReadOnlyViolationException": - throw await de_ReadOnlyViolationExceptionRes(parsedOutput, context); - case "TimeLimitExceededException": - case "com.amazonaws.neptunedata#TimeLimitExceededException": - throw await de_TimeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ids: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ManagePropertygraphStatisticsCommand + * deserializeAws_restJson1ListMLModelTrainingJobsCommand */ -export const de_ManagePropertygraphStatisticsCommand = async ( +export const de_ListMLModelTrainingJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ManagePropertygraphStatisticsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - payload: _json, - status: __expectString, + ids: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ManagePropertygraphStatisticsCommandError + * deserializeAws_restJson1ListMLModelTransformJobsCommand */ -const de_ManagePropertygraphStatisticsCommandError = async ( +export const de_ListMLModelTransformJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "ReadOnlyViolationException": - case "com.amazonaws.neptunedata#ReadOnlyViolationException": - throw await de_ReadOnlyViolationExceptionRes(parsedOutput, context); - case "StatisticsNotAvailableException": - case "com.amazonaws.neptunedata#StatisticsNotAvailableException": - throw await de_StatisticsNotAvailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ids: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ManageSparqlStatisticsCommand + * deserializeAws_restJson1ListOpenCypherQueriesCommand */ -export const de_ManageSparqlStatisticsCommand = async ( +export const de_ListOpenCypherQueriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ManageSparqlStatisticsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - payload: _json, - status: __expectString, + acceptedQueryCount: __expectInt32, + queries: (_) => de_OpenCypherQueries(_, context), + runningQueryCount: __expectInt32, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ManageSparqlStatisticsCommandError + * deserializeAws_restJson1ManagePropertygraphStatisticsCommand */ -const de_ManageSparqlStatisticsCommandError = async ( +export const de_ManagePropertygraphStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.neptunedata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "ReadOnlyViolationException": - case "com.amazonaws.neptunedata#ReadOnlyViolationException": - throw await de_ReadOnlyViolationExceptionRes(parsedOutput, context); - case "StatisticsNotAvailableException": - case "com.amazonaws.neptunedata#StatisticsNotAvailableException": - throw await de_StatisticsNotAvailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + payload: _json, + status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartLoaderJobCommand + * deserializeAws_restJson1ManageSparqlStatisticsCommand */ -export const de_StartLoaderJobCommand = async ( +export const de_ManageSparqlStatisticsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartLoaderJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4506,68 +2006,25 @@ export const de_StartLoaderJobCommand = async ( }; /** - * deserializeAws_restJson1StartLoaderJobCommandError + * deserializeAws_restJson1StartLoaderJobCommand */ -const de_StartLoaderJobCommandError = async ( +export const de_StartLoaderJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "BulkLoadIdNotFoundException": - case "com.amazonaws.neptunedata#BulkLoadIdNotFoundException": - throw await de_BulkLoadIdNotFoundExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.neptunedata#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LoadUrlAccessDeniedException": - case "com.amazonaws.neptunedata#LoadUrlAccessDeniedException": - throw await de_LoadUrlAccessDeniedExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "S3Exception": - case "com.amazonaws.neptunedata#S3Exception": - throw await de_S3ExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + payload: _json, + status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4578,7 +2035,7 @@ export const de_StartMLDataProcessingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartMLDataProcessingJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4593,62 +2050,6 @@ export const de_StartMLDataProcessingJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartMLDataProcessingJobCommandError - */ -const de_StartMLDataProcessingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartMLModelTrainingJobCommand */ @@ -4657,7 +2058,7 @@ export const de_StartMLModelTrainingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartMLModelTrainingJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4672,62 +2073,6 @@ export const de_StartMLModelTrainingJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartMLModelTrainingJobCommandError - */ -const de_StartMLModelTrainingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.neptunedata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ClientTimeoutException": - case "com.amazonaws.neptunedata#ClientTimeoutException": - throw await de_ClientTimeoutExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.neptunedata#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.neptunedata#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.neptunedata#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.neptunedata#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); - case "MissingParameterException": - case "com.amazonaws.neptunedata#MissingParameterException": - throw await de_MissingParameterExceptionRes(parsedOutput, context); - case "PreconditionsFailedException": - case "com.amazonaws.neptunedata#PreconditionsFailedException": - throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.neptunedata#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.neptunedata#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartMLModelTransformJobCommand */ @@ -4736,7 +2081,7 @@ export const de_StartMLModelTransformJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartMLModelTransformJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4752,12 +2097,9 @@ export const de_StartMLModelTransformJobCommand = async ( }; /** - * deserializeAws_restJson1StartMLModelTransformJobCommandError + * deserialize_Aws_restJson1CommandError */ -const de_StartMLModelTransformJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4770,9 +2112,15 @@ const de_StartMLModelTransformJobCommandError = async ( case "ClientTimeoutException": case "com.amazonaws.neptunedata#ClientTimeoutException": throw await de_ClientTimeoutExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.neptunedata#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); case "ConstraintViolationException": case "com.amazonaws.neptunedata#ConstraintViolationException": throw await de_ConstraintViolationExceptionRes(parsedOutput, context); + case "FailureByQueryException": + case "com.amazonaws.neptunedata#FailureByQueryException": + throw await de_FailureByQueryExceptionRes(parsedOutput, context); case "IllegalArgumentException": case "com.amazonaws.neptunedata#IllegalArgumentException": throw await de_IllegalArgumentExceptionRes(parsedOutput, context); @@ -4782,28 +2130,91 @@ const de_StartMLModelTransformJobCommandError = async ( case "InvalidParameterException": case "com.amazonaws.neptunedata#InvalidParameterException": throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MLResourceNotFoundException": - case "com.amazonaws.neptunedata#MLResourceNotFoundException": - throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); case "MissingParameterException": case "com.amazonaws.neptunedata#MissingParameterException": throw await de_MissingParameterExceptionRes(parsedOutput, context); + case "ParsingException": + case "com.amazonaws.neptunedata#ParsingException": + throw await de_ParsingExceptionRes(parsedOutput, context); case "PreconditionsFailedException": case "com.amazonaws.neptunedata#PreconditionsFailedException": throw await de_PreconditionsFailedExceptionRes(parsedOutput, context); + case "TimeLimitExceededException": + case "com.amazonaws.neptunedata#TimeLimitExceededException": + throw await de_TimeLimitExceededExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.neptunedata#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); case "UnsupportedOperationException": case "com.amazonaws.neptunedata#UnsupportedOperationException": throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); + case "BulkLoadIdNotFoundException": + case "com.amazonaws.neptunedata#BulkLoadIdNotFoundException": + throw await de_BulkLoadIdNotFoundExceptionRes(parsedOutput, context); + case "InternalFailureException": + case "com.amazonaws.neptunedata#InternalFailureException": + throw await de_InternalFailureExceptionRes(parsedOutput, context); + case "LoadUrlAccessDeniedException": + case "com.amazonaws.neptunedata#LoadUrlAccessDeniedException": + throw await de_LoadUrlAccessDeniedExceptionRes(parsedOutput, context); + case "MLResourceNotFoundException": + case "com.amazonaws.neptunedata#MLResourceNotFoundException": + throw await de_MLResourceNotFoundExceptionRes(parsedOutput, context); + case "InvalidNumericDataException": + case "com.amazonaws.neptunedata#InvalidNumericDataException": + throw await de_InvalidNumericDataExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.neptunedata#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ReadOnlyViolationException": + case "com.amazonaws.neptunedata#ReadOnlyViolationException": + throw await de_ReadOnlyViolationExceptionRes(parsedOutput, context); + case "StatisticsNotAvailableException": + case "com.amazonaws.neptunedata#StatisticsNotAvailableException": + throw await de_StatisticsNotAvailableExceptionRes(parsedOutput, context); + case "MethodNotAllowedException": + case "com.amazonaws.neptunedata#MethodNotAllowedException": + throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); + case "ServerShutdownException": + case "com.amazonaws.neptunedata#ServerShutdownException": + throw await de_ServerShutdownExceptionRes(parsedOutput, context); + case "CancelledByUserException": + case "com.amazonaws.neptunedata#CancelledByUserException": + throw await de_CancelledByUserExceptionRes(parsedOutput, context); + case "MalformedQueryException": + case "com.amazonaws.neptunedata#MalformedQueryException": + throw await de_MalformedQueryExceptionRes(parsedOutput, context); + case "MemoryLimitExceededException": + case "com.amazonaws.neptunedata#MemoryLimitExceededException": + throw await de_MemoryLimitExceededExceptionRes(parsedOutput, context); + case "QueryLimitExceededException": + case "com.amazonaws.neptunedata#QueryLimitExceededException": + throw await de_QueryLimitExceededExceptionRes(parsedOutput, context); + case "QueryLimitException": + case "com.amazonaws.neptunedata#QueryLimitException": + throw await de_QueryLimitExceptionRes(parsedOutput, context); + case "QueryTooLargeException": + case "com.amazonaws.neptunedata#QueryTooLargeException": + throw await de_QueryTooLargeExceptionRes(parsedOutput, context); + case "ExpiredStreamException": + case "com.amazonaws.neptunedata#ExpiredStreamException": + throw await de_ExpiredStreamExceptionRes(parsedOutput, context); + case "StreamRecordsNotFoundException": + case "com.amazonaws.neptunedata#StreamRecordsNotFoundException": + throw await de_StreamRecordsNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.neptunedata#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "S3Exception": + case "com.amazonaws.neptunedata#S3Exception": + throw await de_S3ExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-network-firewall/src/protocols/Aws_json1_0.ts b/clients/client-network-firewall/src/protocols/Aws_json1_0.ts index 95bf92e6a5cd..5f111d001c92 100644 --- a/clients/client-network-firewall/src/protocols/Aws_json1_0.ts +++ b/clients/client-network-firewall/src/protocols/Aws_json1_0.ts @@ -710,7 +710,7 @@ export const de_AssociateFirewallPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateFirewallPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -722,47 +722,6 @@ export const de_AssociateFirewallPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0AssociateFirewallPolicyCommandError - */ -const de_AssociateFirewallPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.networkfirewall#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidTokenException": - case "com.amazonaws.networkfirewall#InvalidTokenException": - throw await de_InvalidTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0AssociateSubnetsCommand */ @@ -771,7 +730,7 @@ export const de_AssociateSubnetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateSubnetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -783,50 +742,6 @@ export const de_AssociateSubnetsCommand = async ( return response; }; -/** - * deserializeAws_json1_0AssociateSubnetsCommandError - */ -const de_AssociateSubnetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientCapacityException": - case "com.amazonaws.networkfirewall#InsufficientCapacityException": - throw await de_InsufficientCapacityExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.networkfirewall#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidTokenException": - case "com.amazonaws.networkfirewall#InvalidTokenException": - throw await de_InvalidTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateFirewallCommand */ @@ -835,7 +750,7 @@ export const de_CreateFirewallCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFirewallCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -847,47 +762,6 @@ export const de_CreateFirewallCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateFirewallCommandError - */ -const de_CreateFirewallCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientCapacityException": - case "com.amazonaws.networkfirewall#InsufficientCapacityException": - throw await de_InsufficientCapacityExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.networkfirewall#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.networkfirewall#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateFirewallPolicyCommand */ @@ -896,7 +770,7 @@ export const de_CreateFirewallPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFirewallPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -908,44 +782,6 @@ export const de_CreateFirewallPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateFirewallPolicyCommandError - */ -const de_CreateFirewallPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientCapacityException": - case "com.amazonaws.networkfirewall#InsufficientCapacityException": - throw await de_InsufficientCapacityExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.networkfirewall#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateRuleGroupCommand */ @@ -954,7 +790,7 @@ export const de_CreateRuleGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -967,57 +803,39 @@ export const de_CreateRuleGroupCommand = async ( }; /** - * deserializeAws_json1_0CreateRuleGroupCommandError + * deserializeAws_json1_0CreateTLSInspectionConfigurationCommand */ -const de_CreateRuleGroupCommandError = async ( +export const de_CreateTLSInspectionConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientCapacityException": - case "com.amazonaws.networkfirewall#InsufficientCapacityException": - throw await de_InsufficientCapacityExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.networkfirewall#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateTLSInspectionConfigurationResponse(data, context); + const response: CreateTLSInspectionConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0CreateTLSInspectionConfigurationCommand + * deserializeAws_json1_0DeleteFirewallCommand */ -export const de_CreateTLSInspectionConfigurationCommand = async ( +export const de_DeleteFirewallCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateTLSInspectionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateTLSInspectionConfigurationResponse(data, context); - const response: CreateTLSInspectionConfigurationCommandOutput = { + contents = _json(data); + const response: DeleteFirewallCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1025,57 +843,39 @@ export const de_CreateTLSInspectionConfigurationCommand = async ( }; /** - * deserializeAws_json1_0CreateTLSInspectionConfigurationCommandError + * deserializeAws_json1_0DeleteFirewallPolicyCommand */ -const de_CreateTLSInspectionConfigurationCommandError = async ( +export const de_DeleteFirewallPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InsufficientCapacityException": - case "com.amazonaws.networkfirewall#InsufficientCapacityException": - throw await de_InsufficientCapacityExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.networkfirewall#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteFirewallPolicyResponse(data, context); + const response: DeleteFirewallPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DeleteFirewallCommand + * deserializeAws_json1_0DeleteResourcePolicyCommand */ -export const de_DeleteFirewallCommand = async ( +export const de_DeleteResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteFirewallCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteFirewallCommandOutput = { + const response: DeleteResourcePolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1083,174 +883,14 @@ export const de_DeleteFirewallCommand = async ( }; /** - * deserializeAws_json1_0DeleteFirewallCommandError + * deserializeAws_json1_0DeleteRuleGroupCommand */ -const de_DeleteFirewallCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.networkfirewall#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.networkfirewall#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteFirewallPolicyCommand - */ -export const de_DeleteFirewallPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteFirewallPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteFirewallPolicyResponse(data, context); - const response: DeleteFirewallPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteFirewallPolicyCommandError - */ -const de_DeleteFirewallPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.networkfirewall#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.networkfirewall#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteResourcePolicyCommand - */ -export const de_DeleteResourcePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteResourcePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidResourcePolicyException": - case "com.amazonaws.networkfirewall#InvalidResourcePolicyException": - throw await de_InvalidResourcePolicyExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteRuleGroupCommand - */ -export const de_DeleteRuleGroupCommand = async ( +export const de_DeleteRuleGroupCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1262,47 +902,6 @@ export const de_DeleteRuleGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteRuleGroupCommandError - */ -const de_DeleteRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.networkfirewall#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.networkfirewall#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteTLSInspectionConfigurationCommand */ @@ -1311,7 +910,7 @@ export const de_DeleteTLSInspectionConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTLSInspectionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1323,44 +922,6 @@ export const de_DeleteTLSInspectionConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteTLSInspectionConfigurationCommandError - */ -const de_DeleteTLSInspectionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.networkfirewall#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeFirewallCommand */ @@ -1369,7 +930,7 @@ export const de_DescribeFirewallCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFirewallCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1381,41 +942,6 @@ export const de_DescribeFirewallCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeFirewallCommandError - */ -const de_DescribeFirewallCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeFirewallPolicyCommand */ @@ -1424,7 +950,7 @@ export const de_DescribeFirewallPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFirewallPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1436,41 +962,6 @@ export const de_DescribeFirewallPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeFirewallPolicyCommandError - */ -const de_DescribeFirewallPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeLoggingConfigurationCommand */ @@ -1479,7 +970,7 @@ export const de_DescribeLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1491,41 +982,6 @@ export const de_DescribeLoggingConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeLoggingConfigurationCommandError - */ -const de_DescribeLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeResourcePolicyCommand */ @@ -1534,7 +990,7 @@ export const de_DescribeResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1546,41 +1002,6 @@ export const de_DescribeResourcePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeResourcePolicyCommandError - */ -const de_DescribeResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeRuleGroupCommand */ @@ -1589,7 +1010,7 @@ export const de_DescribeRuleGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1601,41 +1022,6 @@ export const de_DescribeRuleGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeRuleGroupCommandError - */ -const de_DescribeRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeRuleGroupMetadataCommand */ @@ -1644,7 +1030,7 @@ export const de_DescribeRuleGroupMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRuleGroupMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1656,41 +1042,6 @@ export const de_DescribeRuleGroupMetadataCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeRuleGroupMetadataCommandError - */ -const de_DescribeRuleGroupMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeTLSInspectionConfigurationCommand */ @@ -1699,7 +1050,7 @@ export const de_DescribeTLSInspectionConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTLSInspectionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1711,41 +1062,6 @@ export const de_DescribeTLSInspectionConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeTLSInspectionConfigurationCommandError - */ -const de_DescribeTLSInspectionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DisassociateSubnetsCommand */ @@ -1754,7 +1070,7 @@ export const de_DisassociateSubnetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateSubnetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1766,47 +1082,6 @@ export const de_DisassociateSubnetsCommand = async ( return response; }; -/** - * deserializeAws_json1_0DisassociateSubnetsCommandError - */ -const de_DisassociateSubnetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.networkfirewall#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidTokenException": - case "com.amazonaws.networkfirewall#InvalidTokenException": - throw await de_InvalidTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListFirewallPoliciesCommand */ @@ -1815,7 +1090,7 @@ export const de_ListFirewallPoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListFirewallPoliciesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1827,38 +1102,6 @@ export const de_ListFirewallPoliciesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListFirewallPoliciesCommandError - */ -const de_ListFirewallPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListFirewallsCommand */ @@ -1867,7 +1110,7 @@ export const de_ListFirewallsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListFirewallsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1879,38 +1122,6 @@ export const de_ListFirewallsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListFirewallsCommandError - */ -const de_ListFirewallsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListRuleGroupsCommand */ @@ -1919,48 +1130,16 @@ export const de_ListRuleGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRuleGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); const response: ListRuleGroupsCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListRuleGroupsCommandError - */ -const de_ListRuleGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + ...contents, + }; + return response; }; /** @@ -1971,7 +1150,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1983,41 +1162,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListTLSInspectionConfigurationsCommand */ @@ -2026,7 +1170,7 @@ export const de_ListTLSInspectionConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTLSInspectionConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2038,38 +1182,6 @@ export const de_ListTLSInspectionConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListTLSInspectionConfigurationsCommandError - */ -const de_ListTLSInspectionConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0PutResourcePolicyCommand */ @@ -2078,7 +1190,7 @@ export const de_PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2090,44 +1202,6 @@ export const de_PutResourcePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0PutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidResourcePolicyException": - case "com.amazonaws.networkfirewall#InvalidResourcePolicyException": - throw await de_InvalidResourcePolicyExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TagResourceCommand */ @@ -2136,7 +1210,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2148,41 +1222,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UntagResourceCommand */ @@ -2191,7 +1230,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2203,41 +1242,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateFirewallDeleteProtectionCommand */ @@ -2246,7 +1250,7 @@ export const de_UpdateFirewallDeleteProtectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateFirewallDeleteProtectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2259,118 +1263,19 @@ export const de_UpdateFirewallDeleteProtectionCommand = async ( }; /** - * deserializeAws_json1_0UpdateFirewallDeleteProtectionCommandError - */ -const de_UpdateFirewallDeleteProtectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidTokenException": - case "com.amazonaws.networkfirewall#InvalidTokenException": - throw await de_InvalidTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceOwnerCheckException": - case "com.amazonaws.networkfirewall#ResourceOwnerCheckException": - throw await de_ResourceOwnerCheckExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0UpdateFirewallDescriptionCommand - */ -export const de_UpdateFirewallDescriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateFirewallDescriptionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateFirewallDescriptionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0UpdateFirewallDescriptionCommandError - */ -const de_UpdateFirewallDescriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidTokenException": - case "com.amazonaws.networkfirewall#InvalidTokenException": - throw await de_InvalidTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0UpdateFirewallEncryptionConfigurationCommand + * deserializeAws_json1_0UpdateFirewallDescriptionCommand */ -export const de_UpdateFirewallEncryptionConfigurationCommand = async ( +export const de_UpdateFirewallDescriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateFirewallEncryptionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateFirewallEncryptionConfigurationCommandOutput = { + const response: UpdateFirewallDescriptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2378,44 +1283,23 @@ export const de_UpdateFirewallEncryptionConfigurationCommand = async ( }; /** - * deserializeAws_json1_0UpdateFirewallEncryptionConfigurationCommandError + * deserializeAws_json1_0UpdateFirewallEncryptionConfigurationCommand */ -const de_UpdateFirewallEncryptionConfigurationCommandError = async ( +export const de_UpdateFirewallEncryptionConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidTokenException": - case "com.amazonaws.networkfirewall#InvalidTokenException": - throw await de_InvalidTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceOwnerCheckException": - case "com.amazonaws.networkfirewall#ResourceOwnerCheckException": - throw await de_ResourceOwnerCheckExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateFirewallEncryptionConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2426,7 +1310,7 @@ export const de_UpdateFirewallPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateFirewallPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2438,44 +1322,6 @@ export const de_UpdateFirewallPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateFirewallPolicyCommandError - */ -const de_UpdateFirewallPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidTokenException": - case "com.amazonaws.networkfirewall#InvalidTokenException": - throw await de_InvalidTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateFirewallPolicyChangeProtectionCommand */ @@ -2484,7 +1330,7 @@ export const de_UpdateFirewallPolicyChangeProtectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateFirewallPolicyChangeProtectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2496,47 +1342,6 @@ export const de_UpdateFirewallPolicyChangeProtectionCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateFirewallPolicyChangeProtectionCommandError - */ -const de_UpdateFirewallPolicyChangeProtectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidTokenException": - case "com.amazonaws.networkfirewall#InvalidTokenException": - throw await de_InvalidTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceOwnerCheckException": - case "com.amazonaws.networkfirewall#ResourceOwnerCheckException": - throw await de_ResourceOwnerCheckExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateLoggingConfigurationCommand */ @@ -2545,7 +1350,7 @@ export const de_UpdateLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2557,47 +1362,6 @@ export const de_UpdateLoggingConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateLoggingConfigurationCommandError - */ -const de_UpdateLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidTokenException": - case "com.amazonaws.networkfirewall#InvalidTokenException": - throw await de_InvalidTokenExceptionRes(parsedOutput, context); - case "LogDestinationPermissionException": - case "com.amazonaws.networkfirewall#LogDestinationPermissionException": - throw await de_LogDestinationPermissionExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateRuleGroupCommand */ @@ -2606,7 +1370,7 @@ export const de_UpdateRuleGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2618,44 +1382,6 @@ export const de_UpdateRuleGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateRuleGroupCommandError - */ -const de_UpdateRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidTokenException": - case "com.amazonaws.networkfirewall#InvalidTokenException": - throw await de_InvalidTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateSubnetChangeProtectionCommand */ @@ -2664,7 +1390,7 @@ export const de_UpdateSubnetChangeProtectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSubnetChangeProtectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2676,47 +1402,6 @@ export const de_UpdateSubnetChangeProtectionCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateSubnetChangeProtectionCommandError - */ -const de_UpdateSubnetChangeProtectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.networkfirewall#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.networkfirewall#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidTokenException": - case "com.amazonaws.networkfirewall#InvalidTokenException": - throw await de_InvalidTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkfirewall#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceOwnerCheckException": - case "com.amazonaws.networkfirewall#ResourceOwnerCheckException": - throw await de_ResourceOwnerCheckExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkfirewall#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateTLSInspectionConfigurationCommand */ @@ -2725,7 +1410,7 @@ export const de_UpdateTLSInspectionConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTLSInspectionConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2738,12 +1423,9 @@ export const de_UpdateTLSInspectionConfigurationCommand = async ( }; /** - * deserializeAws_json1_0UpdateTLSInspectionConfigurationCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateTLSInspectionConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2753,6 +1435,9 @@ const de_UpdateTLSInspectionConfigurationCommandError = async ( case "InternalServerError": case "com.amazonaws.networkfirewall#InternalServerError": throw await de_InternalServerErrorRes(parsedOutput, context); + case "InvalidOperationException": + case "com.amazonaws.networkfirewall#InvalidOperationException": + throw await de_InvalidOperationExceptionRes(parsedOutput, context); case "InvalidRequestException": case "com.amazonaws.networkfirewall#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); @@ -2765,13 +1450,31 @@ const de_UpdateTLSInspectionConfigurationCommandError = async ( case "ThrottlingException": case "com.amazonaws.networkfirewall#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "InsufficientCapacityException": + case "com.amazonaws.networkfirewall#InsufficientCapacityException": + throw await de_InsufficientCapacityExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.networkfirewall#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "UnsupportedOperationException": + case "com.amazonaws.networkfirewall#UnsupportedOperationException": + throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); + case "InvalidResourcePolicyException": + case "com.amazonaws.networkfirewall#InvalidResourcePolicyException": + throw await de_InvalidResourcePolicyExceptionRes(parsedOutput, context); + case "ResourceOwnerCheckException": + case "com.amazonaws.networkfirewall#ResourceOwnerCheckException": + throw await de_ResourceOwnerCheckExceptionRes(parsedOutput, context); + case "LogDestinationPermissionException": + case "com.amazonaws.networkfirewall#LogDestinationPermissionException": + throw await de_LogDestinationPermissionExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-networkmanager/src/protocols/Aws_restJson1.ts b/clients/client-networkmanager/src/protocols/Aws_restJson1.ts index 9cc2a1c46ee7..372a4edd10a1 100644 --- a/clients/client-networkmanager/src/protocols/Aws_restJson1.ts +++ b/clients/client-networkmanager/src/protocols/Aws_restJson1.ts @@ -2121,7 +2121,7 @@ export const de_AcceptAttachmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptAttachmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2134,47 +2134,6 @@ export const de_AcceptAttachmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptAttachmentCommandError - */ -const de_AcceptAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateConnectPeerCommand */ @@ -2183,7 +2142,7 @@ export const de_AssociateConnectPeerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateConnectPeerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2196,50 +2155,6 @@ export const de_AssociateConnectPeerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateConnectPeerCommandError - */ -const de_AssociateConnectPeerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateCustomerGatewayCommand */ @@ -2248,7 +2163,7 @@ export const de_AssociateCustomerGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateCustomerGatewayCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2261,50 +2176,6 @@ export const de_AssociateCustomerGatewayCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateCustomerGatewayCommandError - */ -const de_AssociateCustomerGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateLinkCommand */ @@ -2313,7 +2184,7 @@ export const de_AssociateLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2326,50 +2197,6 @@ export const de_AssociateLinkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateLinkCommandError - */ -const de_AssociateLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateTransitGatewayConnectPeerCommand */ @@ -2378,7 +2205,7 @@ export const de_AssociateTransitGatewayConnectPeerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateTransitGatewayConnectPeerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2391,50 +2218,6 @@ export const de_AssociateTransitGatewayConnectPeerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateTransitGatewayConnectPeerCommandError - */ -const de_AssociateTransitGatewayConnectPeerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConnectAttachmentCommand */ @@ -2443,7 +2226,7 @@ export const de_CreateConnectAttachmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConnectAttachmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2457,1493 +2240,883 @@ export const de_CreateConnectAttachmentCommand = async ( }; /** - * deserializeAws_restJson1CreateConnectAttachmentCommandError + * deserializeAws_restJson1CreateConnectionCommand */ -const de_CreateConnectAttachmentCommandError = async ( +export const de_CreateConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Connection: (_) => de_Connection(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateConnectionCommand + * deserializeAws_restJson1CreateConnectPeerCommand */ -export const de_CreateConnectionCommand = async ( +export const de_CreateConnectPeerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Connection: (_) => de_Connection(_, context), + ConnectPeer: (_) => de_ConnectPeer(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateConnectionCommandError + * deserializeAws_restJson1CreateCoreNetworkCommand */ -const de_CreateConnectionCommandError = async ( +export const de_CreateCoreNetworkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateConnectPeerCommand - */ -export const de_CreateConnectPeerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConnectPeerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ConnectPeer: (_) => de_ConnectPeer(_, context), + CoreNetwork: (_) => de_CoreNetwork(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateConnectPeerCommandError - */ -const de_CreateConnectPeerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateCoreNetworkCommand + * deserializeAws_restJson1CreateDeviceCommand */ -export const de_CreateCoreNetworkCommand = async ( +export const de_CreateDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCoreNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CoreNetwork: (_) => de_CoreNetwork(_, context), + Device: (_) => de_Device(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateCoreNetworkCommandError + * deserializeAws_restJson1CreateGlobalNetworkCommand */ -const de_CreateCoreNetworkCommandError = async ( +export const de_CreateGlobalNetworkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "CoreNetworkPolicyException": - case "com.amazonaws.networkmanager#CoreNetworkPolicyException": - throw await de_CoreNetworkPolicyExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + GlobalNetwork: (_) => de_GlobalNetwork(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateDeviceCommand + * deserializeAws_restJson1CreateLinkCommand */ -export const de_CreateDeviceCommand = async ( +export const de_CreateLinkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Device: (_) => de_Device(_, context), + Link: (_) => de_Link(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateDeviceCommandError + * deserializeAws_restJson1CreateSiteCommand */ -const de_CreateDeviceCommandError = async ( +export const de_CreateSiteCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Site: (_) => de_Site(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateGlobalNetworkCommand + * deserializeAws_restJson1CreateSiteToSiteVpnAttachmentCommand */ -export const de_CreateGlobalNetworkCommand = async ( +export const de_CreateSiteToSiteVpnAttachmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateGlobalNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - GlobalNetwork: (_) => de_GlobalNetwork(_, context), + SiteToSiteVpnAttachment: (_) => de_SiteToSiteVpnAttachment(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateGlobalNetworkCommandError + * deserializeAws_restJson1CreateTransitGatewayPeeringCommand */ -const de_CreateGlobalNetworkCommandError = async ( +export const de_CreateTransitGatewayPeeringCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + TransitGatewayPeering: (_) => de_TransitGatewayPeering(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateLinkCommand + * deserializeAws_restJson1CreateTransitGatewayRouteTableAttachmentCommand */ -export const de_CreateLinkCommand = async ( +export const de_CreateTransitGatewayRouteTableAttachmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Link: (_) => de_Link(_, context), + TransitGatewayRouteTableAttachment: (_) => de_TransitGatewayRouteTableAttachment(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateLinkCommandError + * deserializeAws_restJson1CreateVpcAttachmentCommand */ -const de_CreateLinkCommandError = async ( +export const de_CreateVpcAttachmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateSiteCommand - */ -export const de_CreateSiteCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Site: (_) => de_Site(_, context), + VpcAttachment: (_) => de_VpcAttachment(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateSiteCommandError + * deserializeAws_restJson1DeleteAttachmentCommand */ -const de_CreateSiteCommandError = async ( +export const de_DeleteAttachmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Attachment: (_) => de_Attachment(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateSiteToSiteVpnAttachmentCommand + * deserializeAws_restJson1DeleteConnectionCommand */ -export const de_CreateSiteToSiteVpnAttachmentCommand = async ( +export const de_DeleteConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSiteToSiteVpnAttachmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SiteToSiteVpnAttachment: (_) => de_SiteToSiteVpnAttachment(_, context), + Connection: (_) => de_Connection(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateSiteToSiteVpnAttachmentCommandError + * deserializeAws_restJson1DeleteConnectPeerCommand */ -const de_CreateSiteToSiteVpnAttachmentCommandError = async ( +export const de_DeleteConnectPeerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ConnectPeer: (_) => de_ConnectPeer(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateTransitGatewayPeeringCommand + * deserializeAws_restJson1DeleteCoreNetworkCommand */ -export const de_CreateTransitGatewayPeeringCommand = async ( +export const de_DeleteCoreNetworkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTransitGatewayPeeringCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - TransitGatewayPeering: (_) => de_TransitGatewayPeering(_, context), + CoreNetwork: (_) => de_CoreNetwork(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateTransitGatewayPeeringCommandError + * deserializeAws_restJson1DeleteCoreNetworkPolicyVersionCommand */ -const de_CreateTransitGatewayPeeringCommandError = async ( +export const de_DeleteCoreNetworkPolicyVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CoreNetworkPolicy: (_) => de_CoreNetworkPolicy(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateTransitGatewayRouteTableAttachmentCommand + * deserializeAws_restJson1DeleteDeviceCommand */ -export const de_CreateTransitGatewayRouteTableAttachmentCommand = async ( +export const de_DeleteDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTransitGatewayRouteTableAttachmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - TransitGatewayRouteTableAttachment: (_) => de_TransitGatewayRouteTableAttachment(_, context), + Device: (_) => de_Device(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateTransitGatewayRouteTableAttachmentCommandError + * deserializeAws_restJson1DeleteGlobalNetworkCommand */ -const de_CreateTransitGatewayRouteTableAttachmentCommandError = async ( +export const de_DeleteGlobalNetworkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + GlobalNetwork: (_) => de_GlobalNetwork(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateVpcAttachmentCommand + * deserializeAws_restJson1DeleteLinkCommand */ -export const de_CreateVpcAttachmentCommand = async ( +export const de_DeleteLinkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateVpcAttachmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - VpcAttachment: (_) => de_VpcAttachment(_, context), + Link: (_) => de_Link(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateVpcAttachmentCommandError - */ -const de_CreateVpcAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAttachmentCommand + * deserializeAws_restJson1DeletePeeringCommand */ -export const de_DeleteAttachmentCommand = async ( +export const de_DeletePeeringCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAttachmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Attachment: (_) => de_Attachment(_, context), + Peering: (_) => de_Peering(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteAttachmentCommandError + * deserializeAws_restJson1DeleteResourcePolicyCommand */ -const de_DeleteAttachmentCommandError = async ( +export const de_DeleteResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteConnectionCommand + * deserializeAws_restJson1DeleteSiteCommand */ -export const de_DeleteConnectionCommand = async ( +export const de_DeleteSiteCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Connection: (_) => de_Connection(_, context), + Site: (_) => de_Site(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteConnectionCommandError + * deserializeAws_restJson1DeregisterTransitGatewayCommand */ -const de_DeleteConnectionCommandError = async ( +export const de_DeregisterTransitGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + TransitGatewayRegistration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteConnectPeerCommand + * deserializeAws_restJson1DescribeGlobalNetworksCommand */ -export const de_DeleteConnectPeerCommand = async ( +export const de_DescribeGlobalNetworksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConnectPeerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ConnectPeer: (_) => de_ConnectPeer(_, context), + GlobalNetworks: (_) => de_GlobalNetworkList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteConnectPeerCommandError + * deserializeAws_restJson1DisassociateConnectPeerCommand */ -const de_DeleteConnectPeerCommandError = async ( +export const de_DisassociateConnectPeerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ConnectPeerAssociation: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteCoreNetworkCommand + * deserializeAws_restJson1DisassociateCustomerGatewayCommand */ -export const de_DeleteCoreNetworkCommand = async ( +export const de_DisassociateCustomerGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCoreNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CoreNetwork: (_) => de_CoreNetwork(_, context), + CustomerGatewayAssociation: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteCoreNetworkCommandError + * deserializeAws_restJson1DisassociateLinkCommand */ -const de_DeleteCoreNetworkCommandError = async ( +export const de_DisassociateLinkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LinkAssociation: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteCoreNetworkPolicyVersionCommand + * deserializeAws_restJson1DisassociateTransitGatewayConnectPeerCommand */ -export const de_DeleteCoreNetworkPolicyVersionCommand = async ( +export const de_DisassociateTransitGatewayConnectPeerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCoreNetworkPolicyVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CoreNetworkPolicy: (_) => de_CoreNetworkPolicy(_, context), + TransitGatewayConnectPeerAssociation: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteCoreNetworkPolicyVersionCommandError + * deserializeAws_restJson1ExecuteCoreNetworkChangeSetCommand */ -const de_DeleteCoreNetworkPolicyVersionCommandError = async ( +export const de_ExecuteCoreNetworkChangeSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteDeviceCommand + * deserializeAws_restJson1GetConnectAttachmentCommand */ -export const de_DeleteDeviceCommand = async ( +export const de_GetConnectAttachmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Device: (_) => de_Device(_, context), + ConnectAttachment: (_) => de_ConnectAttachment(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteDeviceCommandError - */ -const de_DeleteDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteGlobalNetworkCommand + * deserializeAws_restJson1GetConnectionsCommand */ -export const de_DeleteGlobalNetworkCommand = async ( +export const de_GetConnectionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGlobalNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - GlobalNetwork: (_) => de_GlobalNetwork(_, context), + Connections: (_) => de_ConnectionList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteGlobalNetworkCommandError + * deserializeAws_restJson1GetConnectPeerCommand */ -const de_DeleteGlobalNetworkCommandError = async ( +export const de_GetConnectPeerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ConnectPeer: (_) => de_ConnectPeer(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteLinkCommand + * deserializeAws_restJson1GetConnectPeerAssociationsCommand */ -export const de_DeleteLinkCommand = async ( +export const de_GetConnectPeerAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Link: (_) => de_Link(_, context), + ConnectPeerAssociations: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteLinkCommandError + * deserializeAws_restJson1GetCoreNetworkCommand */ -const de_DeleteLinkCommandError = async ( +export const de_GetCoreNetworkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CoreNetwork: (_) => de_CoreNetwork(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeletePeeringCommand + * deserializeAws_restJson1GetCoreNetworkChangeEventsCommand */ -export const de_DeletePeeringCommand = async ( +export const de_GetCoreNetworkChangeEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePeeringCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Peering: (_) => de_Peering(_, context), + CoreNetworkChangeEvents: (_) => de_CoreNetworkChangeEventList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeletePeeringCommandError + * deserializeAws_restJson1GetCoreNetworkChangeSetCommand */ -const de_DeletePeeringCommandError = async ( +export const de_GetCoreNetworkChangeSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CoreNetworkChanges: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteResourcePolicyCommand + * deserializeAws_restJson1GetCoreNetworkPolicyCommand */ -export const de_DeleteResourcePolicyCommand = async ( +export const de_GetCoreNetworkPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CoreNetworkPolicy: (_) => de_CoreNetworkPolicy(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteResourcePolicyCommandError + * deserializeAws_restJson1GetCustomerGatewayAssociationsCommand */ -const de_DeleteResourcePolicyCommandError = async ( +export const de_GetCustomerGatewayAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSiteCommand - */ -export const de_DeleteSiteCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Site: (_) => de_Site(_, context), + CustomerGatewayAssociations: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteSiteCommandError + * deserializeAws_restJson1GetDevicesCommand */ -const de_DeleteSiteCommandError = async ( +export const de_GetDevicesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Devices: (_) => de_DeviceList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeregisterTransitGatewayCommand + * deserializeAws_restJson1GetLinkAssociationsCommand */ -export const de_DeregisterTransitGatewayCommand = async ( +export const de_GetLinkAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeregisterTransitGatewayCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - TransitGatewayRegistration: _json, + LinkAssociations: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeregisterTransitGatewayCommandError + * deserializeAws_restJson1GetLinksCommand */ -const de_DeregisterTransitGatewayCommandError = async ( +export const de_GetLinksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Links: (_) => de_LinkList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeGlobalNetworksCommand + * deserializeAws_restJson1GetNetworkResourceCountsCommand */ -export const de_DescribeGlobalNetworksCommand = async ( +export const de_GetNetworkResourceCountsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeGlobalNetworksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - GlobalNetworks: (_) => de_GlobalNetworkList(_, context), + NetworkResourceCounts: _json, NextToken: __expectString, }); Object.assign(contents, doc); @@ -3951,543 +3124,326 @@ export const de_DescribeGlobalNetworksCommand = async ( }; /** - * deserializeAws_restJson1DescribeGlobalNetworksCommandError + * deserializeAws_restJson1GetNetworkResourceRelationshipsCommand */ -const de_DescribeGlobalNetworksCommandError = async ( +export const de_GetNetworkResourceRelationshipsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Relationships: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DisassociateConnectPeerCommand + * deserializeAws_restJson1GetNetworkResourcesCommand */ -export const de_DisassociateConnectPeerCommand = async ( +export const de_GetNetworkResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateConnectPeerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ConnectPeerAssociation: _json, + NetworkResources: (_) => de_NetworkResourceList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DisassociateConnectPeerCommandError + * deserializeAws_restJson1GetNetworkRoutesCommand */ -const de_DisassociateConnectPeerCommandError = async ( +export const de_GetNetworkRoutesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CoreNetworkSegmentEdge: _json, + NetworkRoutes: _json, + RouteTableArn: __expectString, + RouteTableTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + RouteTableType: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DisassociateCustomerGatewayCommand + * deserializeAws_restJson1GetNetworkTelemetryCommand */ -export const de_DisassociateCustomerGatewayCommand = async ( +export const de_GetNetworkTelemetryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateCustomerGatewayCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CustomerGatewayAssociation: _json, + NetworkTelemetry: (_) => de_NetworkTelemetryList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DisassociateCustomerGatewayCommandError - */ -const de_DisassociateCustomerGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateLinkCommand + * deserializeAws_restJson1GetResourcePolicyCommand */ -export const de_DisassociateLinkCommand = async ( +export const de_GetResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - LinkAssociation: _json, + PolicyDocument: (_) => new __LazyJsonString(_), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DisassociateLinkCommandError - */ -const de_DisassociateLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateTransitGatewayConnectPeerCommand + * deserializeAws_restJson1GetRouteAnalysisCommand */ -export const de_DisassociateTransitGatewayConnectPeerCommand = async ( +export const de_GetRouteAnalysisCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateTransitGatewayConnectPeerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - TransitGatewayConnectPeerAssociation: _json, + RouteAnalysis: (_) => de_RouteAnalysis(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DisassociateTransitGatewayConnectPeerCommandError + * deserializeAws_restJson1GetSitesCommand */ -const de_DisassociateTransitGatewayConnectPeerCommandError = async ( +export const de_GetSitesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Sites: (_) => de_SiteList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ExecuteCoreNetworkChangeSetCommand + * deserializeAws_restJson1GetSiteToSiteVpnAttachmentCommand */ -export const de_ExecuteCoreNetworkChangeSetCommand = async ( +export const de_GetSiteToSiteVpnAttachmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExecuteCoreNetworkChangeSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + SiteToSiteVpnAttachment: (_) => de_SiteToSiteVpnAttachment(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ExecuteCoreNetworkChangeSetCommandError + * deserializeAws_restJson1GetTransitGatewayConnectPeerAssociationsCommand */ -const de_ExecuteCoreNetworkChangeSetCommandError = async ( +export const de_GetTransitGatewayConnectPeerAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + TransitGatewayConnectPeerAssociations: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetConnectAttachmentCommand + * deserializeAws_restJson1GetTransitGatewayPeeringCommand */ -export const de_GetConnectAttachmentCommand = async ( +export const de_GetTransitGatewayPeeringCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConnectAttachmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ConnectAttachment: (_) => de_ConnectAttachment(_, context), + TransitGatewayPeering: (_) => de_TransitGatewayPeering(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetConnectAttachmentCommandError + * deserializeAws_restJson1GetTransitGatewayRegistrationsCommand */ -const de_GetConnectAttachmentCommandError = async ( +export const de_GetTransitGatewayRegistrationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + TransitGatewayRegistrations: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetConnectionsCommand + * deserializeAws_restJson1GetTransitGatewayRouteTableAttachmentCommand */ -export const de_GetConnectionsCommand = async ( +export const de_GetTransitGatewayRouteTableAttachmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConnectionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Connections: (_) => de_ConnectionList(_, context), - NextToken: __expectString, + TransitGatewayRouteTableAttachment: (_) => de_TransitGatewayRouteTableAttachment(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetConnectionsCommandError + * deserializeAws_restJson1GetVpcAttachmentCommand */ -const de_GetConnectionsCommandError = async ( +export const de_GetVpcAttachmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetConnectPeerCommand - */ -export const de_GetConnectPeerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConnectPeerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ConnectPeer: (_) => de_ConnectPeer(_, context), + VpcAttachment: (_) => de_VpcAttachment(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetConnectPeerCommandError + * deserializeAws_restJson1ListAttachmentsCommand */ -const de_GetConnectPeerCommandError = async ( +export const de_ListAttachmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Attachments: (_) => de_AttachmentList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetConnectPeerAssociationsCommand + * deserializeAws_restJson1ListConnectPeersCommand */ -export const de_GetConnectPeerAssociationsCommand = async ( +export const de_ListConnectPeersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConnectPeerAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ConnectPeerAssociations: _json, + ConnectPeers: (_) => de_ConnectPeerSummaryList(_, context), NextToken: __expectString, }); Object.assign(contents, doc); @@ -4495,2424 +3451,331 @@ export const de_GetConnectPeerAssociationsCommand = async ( }; /** - * deserializeAws_restJson1GetConnectPeerAssociationsCommandError + * deserializeAws_restJson1ListCoreNetworkPolicyVersionsCommand */ -const de_GetConnectPeerAssociationsCommandError = async ( +export const de_ListCoreNetworkPolicyVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CoreNetworkPolicyVersions: (_) => de_CoreNetworkPolicyVersionList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetCoreNetworkCommand + * deserializeAws_restJson1ListCoreNetworksCommand */ -export const de_GetCoreNetworkCommand = async ( +export const de_ListCoreNetworksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCoreNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CoreNetwork: (_) => de_CoreNetwork(_, context), + CoreNetworks: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetCoreNetworkCommandError + * deserializeAws_restJson1ListOrganizationServiceAccessStatusCommand */ -const de_GetCoreNetworkCommandError = async ( +export const de_ListOrganizationServiceAccessStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + OrganizationStatus: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetCoreNetworkChangeEventsCommand + * deserializeAws_restJson1ListPeeringsCommand */ -export const de_GetCoreNetworkChangeEventsCommand = async ( +export const de_ListPeeringsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCoreNetworkChangeEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CoreNetworkChangeEvents: (_) => de_CoreNetworkChangeEventList(_, context), NextToken: __expectString, + Peerings: (_) => de_PeeringList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetCoreNetworkChangeEventsCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_GetCoreNetworkChangeEventsCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + TagList: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetCoreNetworkChangeSetCommand + * deserializeAws_restJson1PutCoreNetworkPolicyCommand */ -export const de_GetCoreNetworkChangeSetCommand = async ( +export const de_PutCoreNetworkPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCoreNetworkChangeSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CoreNetworkChanges: _json, - NextToken: __expectString, + CoreNetworkPolicy: (_) => de_CoreNetworkPolicy(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetCoreNetworkChangeSetCommandError + * deserializeAws_restJson1PutResourcePolicyCommand */ -const de_GetCoreNetworkChangeSetCommandError = async ( +export const de_PutResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetCoreNetworkPolicyCommand + * deserializeAws_restJson1RegisterTransitGatewayCommand */ -export const de_GetCoreNetworkPolicyCommand = async ( +export const de_RegisterTransitGatewayCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCoreNetworkPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CoreNetworkPolicy: (_) => de_CoreNetworkPolicy(_, context), + TransitGatewayRegistration: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetCoreNetworkPolicyCommandError - */ -const de_GetCoreNetworkPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCustomerGatewayAssociationsCommand + * deserializeAws_restJson1RejectAttachmentCommand */ -export const de_GetCustomerGatewayAssociationsCommand = async ( +export const de_RejectAttachmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCustomerGatewayAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CustomerGatewayAssociations: _json, - NextToken: __expectString, + Attachment: (_) => de_Attachment(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetCustomerGatewayAssociationsCommandError - */ -const de_GetCustomerGatewayAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDevicesCommand + * deserializeAws_restJson1RestoreCoreNetworkPolicyVersionCommand */ -export const de_GetDevicesCommand = async ( +export const de_RestoreCoreNetworkPolicyVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDevicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Devices: (_) => de_DeviceList(_, context), - NextToken: __expectString, + CoreNetworkPolicy: (_) => de_CoreNetworkPolicy(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetDevicesCommandError - */ -const de_GetDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetLinkAssociationsCommand + * deserializeAws_restJson1StartOrganizationServiceAccessUpdateCommand */ -export const de_GetLinkAssociationsCommand = async ( +export const de_StartOrganizationServiceAccessUpdateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLinkAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - LinkAssociations: _json, - NextToken: __expectString, + OrganizationStatus: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetLinkAssociationsCommandError - */ -const de_GetLinkAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetLinksCommand + * deserializeAws_restJson1StartRouteAnalysisCommand */ -export const de_GetLinksCommand = async ( +export const de_StartRouteAnalysisCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLinksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Links: (_) => de_LinkList(_, context), - NextToken: __expectString, + RouteAnalysis: (_) => de_RouteAnalysis(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetLinksCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_GetLinksCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetNetworkResourceCountsCommand + * deserializeAws_restJson1UntagResourceCommand */ -export const de_GetNetworkResourceCountsCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetNetworkResourceCountsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NetworkResourceCounts: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetNetworkResourceCountsCommandError - */ -const de_GetNetworkResourceCountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetNetworkResourceRelationshipsCommand - */ -export const de_GetNetworkResourceRelationshipsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetNetworkResourceRelationshipsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Relationships: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetNetworkResourceRelationshipsCommandError - */ -const de_GetNetworkResourceRelationshipsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetNetworkResourcesCommand - */ -export const de_GetNetworkResourcesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetNetworkResourcesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NetworkResources: (_) => de_NetworkResourceList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetNetworkResourcesCommandError - */ -const de_GetNetworkResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetNetworkRoutesCommand - */ -export const de_GetNetworkRoutesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetNetworkRoutesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CoreNetworkSegmentEdge: _json, - NetworkRoutes: _json, - RouteTableArn: __expectString, - RouteTableTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - RouteTableType: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetNetworkRoutesCommandError - */ -const de_GetNetworkRoutesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetNetworkTelemetryCommand - */ -export const de_GetNetworkTelemetryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetNetworkTelemetryCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NetworkTelemetry: (_) => de_NetworkTelemetryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetNetworkTelemetryCommandError - */ -const de_GetNetworkTelemetryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetResourcePolicyCommand - */ -export const de_GetResourcePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourcePolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - PolicyDocument: (_) => new __LazyJsonString(_), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetResourcePolicyCommandError - */ -const de_GetResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRouteAnalysisCommand - */ -export const de_GetRouteAnalysisCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRouteAnalysisCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RouteAnalysis: (_) => de_RouteAnalysis(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRouteAnalysisCommandError - */ -const de_GetRouteAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSitesCommand - */ -export const de_GetSitesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSitesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Sites: (_) => de_SiteList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSitesCommandError - */ -const de_GetSitesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSiteToSiteVpnAttachmentCommand - */ -export const de_GetSiteToSiteVpnAttachmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSiteToSiteVpnAttachmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - SiteToSiteVpnAttachment: (_) => de_SiteToSiteVpnAttachment(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSiteToSiteVpnAttachmentCommandError - */ -const de_GetSiteToSiteVpnAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetTransitGatewayConnectPeerAssociationsCommand - */ -export const de_GetTransitGatewayConnectPeerAssociationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTransitGatewayConnectPeerAssociationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - TransitGatewayConnectPeerAssociations: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetTransitGatewayConnectPeerAssociationsCommandError - */ -const de_GetTransitGatewayConnectPeerAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetTransitGatewayPeeringCommand - */ -export const de_GetTransitGatewayPeeringCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTransitGatewayPeeringCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - TransitGatewayPeering: (_) => de_TransitGatewayPeering(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetTransitGatewayPeeringCommandError - */ -const de_GetTransitGatewayPeeringCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetTransitGatewayRegistrationsCommand - */ -export const de_GetTransitGatewayRegistrationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTransitGatewayRegistrationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - TransitGatewayRegistrations: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetTransitGatewayRegistrationsCommandError - */ -const de_GetTransitGatewayRegistrationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetTransitGatewayRouteTableAttachmentCommand - */ -export const de_GetTransitGatewayRouteTableAttachmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTransitGatewayRouteTableAttachmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - TransitGatewayRouteTableAttachment: (_) => de_TransitGatewayRouteTableAttachment(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetTransitGatewayRouteTableAttachmentCommandError - */ -const de_GetTransitGatewayRouteTableAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVpcAttachmentCommand - */ -export const de_GetVpcAttachmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVpcAttachmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - VpcAttachment: (_) => de_VpcAttachment(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetVpcAttachmentCommandError - */ -const de_GetVpcAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAttachmentsCommand - */ -export const de_ListAttachmentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAttachmentsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Attachments: (_) => de_AttachmentList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAttachmentsCommandError - */ -const de_ListAttachmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListConnectPeersCommand - */ -export const de_ListConnectPeersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConnectPeersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ConnectPeers: (_) => de_ConnectPeerSummaryList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListConnectPeersCommandError - */ -const de_ListConnectPeersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListCoreNetworkPolicyVersionsCommand - */ -export const de_ListCoreNetworkPolicyVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCoreNetworkPolicyVersionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CoreNetworkPolicyVersions: (_) => de_CoreNetworkPolicyVersionList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListCoreNetworkPolicyVersionsCommandError - */ -const de_ListCoreNetworkPolicyVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListCoreNetworksCommand - */ -export const de_ListCoreNetworksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCoreNetworksCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CoreNetworks: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListCoreNetworksCommandError - */ -const de_ListCoreNetworksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListOrganizationServiceAccessStatusCommand - */ -export const de_ListOrganizationServiceAccessStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOrganizationServiceAccessStatusCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - OrganizationStatus: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListOrganizationServiceAccessStatusCommandError - */ -const de_ListOrganizationServiceAccessStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_restJson1ListPeeringsCommand - */ -export const de_ListPeeringsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPeeringsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Peerings: (_) => de_PeeringList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPeeringsCommandError - */ -const de_ListPeeringsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - TagList: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutCoreNetworkPolicyCommand - */ -export const de_PutCoreNetworkPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutCoreNetworkPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CoreNetworkPolicy: (_) => de_CoreNetworkPolicy(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutCoreNetworkPolicyCommandError - */ -const de_PutCoreNetworkPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "CoreNetworkPolicyException": - case "com.amazonaws.networkmanager#CoreNetworkPolicyException": - throw await de_CoreNetworkPolicyExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutResourcePolicyCommand - */ -export const de_PutResourcePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1PutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RegisterTransitGatewayCommand - */ -export const de_RegisterTransitGatewayCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterTransitGatewayCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - TransitGatewayRegistration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1RegisterTransitGatewayCommandError - */ -const de_RegisterTransitGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RejectAttachmentCommand - */ -export const de_RejectAttachmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RejectAttachmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Attachment: (_) => de_Attachment(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1RejectAttachmentCommandError - */ -const de_RejectAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RestoreCoreNetworkPolicyVersionCommand - */ -export const de_RestoreCoreNetworkPolicyVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RestoreCoreNetworkPolicyVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CoreNetworkPolicy: (_) => de_CoreNetworkPolicy(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1RestoreCoreNetworkPolicyVersionCommandError - */ -const de_RestoreCoreNetworkPolicyVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartOrganizationServiceAccessUpdateCommand - */ -export const de_StartOrganizationServiceAccessUpdateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartOrganizationServiceAccessUpdateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - OrganizationStatus: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartOrganizationServiceAccessUpdateCommandError - */ -const de_StartOrganizationServiceAccessUpdateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartRouteAnalysisCommand - */ -export const de_StartRouteAnalysisCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartRouteAnalysisCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RouteAnalysis: (_) => de_RouteAnalysis(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartRouteAnalysisCommandError - */ -const de_StartRouteAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UntagResourceCommand - */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateConnectionCommand - */ -export const de_UpdateConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConnectionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Connection: (_) => de_Connection(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateConnectionCommandError - */ -const de_UpdateConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateCoreNetworkCommand + * deserializeAws_restJson1UpdateConnectionCommand */ -export const de_UpdateCoreNetworkCommand = async ( +export const de_UpdateConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCoreNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CoreNetwork: (_) => de_CoreNetwork(_, context), + Connection: (_) => de_Connection(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateCoreNetworkCommandError + * deserializeAws_restJson1UpdateCoreNetworkCommand */ -const de_UpdateCoreNetworkCommandError = async ( +export const de_UpdateCoreNetworkCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CoreNetwork: (_) => de_CoreNetwork(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -6923,7 +3786,7 @@ export const de_UpdateDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6936,47 +3799,6 @@ export const de_UpdateDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDeviceCommandError - */ -const de_UpdateDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateGlobalNetworkCommand */ @@ -6985,7 +3807,7 @@ export const de_UpdateGlobalNetworkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGlobalNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6998,47 +3820,6 @@ export const de_UpdateGlobalNetworkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateGlobalNetworkCommandError - */ -const de_UpdateGlobalNetworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLinkCommand */ @@ -7047,7 +3828,7 @@ export const de_UpdateLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7060,50 +3841,6 @@ export const de_UpdateLinkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLinkCommandError - */ -const de_UpdateLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmanager#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateNetworkResourceMetadataCommand */ @@ -7112,7 +3849,7 @@ export const de_UpdateNetworkResourceMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateNetworkResourceMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7126,47 +3863,6 @@ export const de_UpdateNetworkResourceMetadataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateNetworkResourceMetadataCommandError - */ -const de_UpdateNetworkResourceMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSiteCommand */ @@ -7175,7 +3871,7 @@ export const de_UpdateSiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7188,47 +3884,6 @@ export const de_UpdateSiteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSiteCommandError - */ -const de_UpdateSiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmanager#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmanager#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmanager#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmanager#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmanager#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVpcAttachmentCommand */ @@ -7237,7 +3892,7 @@ export const de_UpdateVpcAttachmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVpcAttachmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7251,12 +3906,9 @@ export const de_UpdateVpcAttachmentCommand = async ( }; /** - * deserializeAws_restJson1UpdateVpcAttachmentCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateVpcAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -7281,13 +3933,19 @@ const de_UpdateVpcAttachmentCommandError = async ( case "ValidationException": case "com.amazonaws.networkmanager#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.networkmanager#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "CoreNetworkPolicyException": + case "com.amazonaws.networkmanager#CoreNetworkPolicyException": + throw await de_CoreNetworkPolicyExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-networkmonitor/src/protocols/Aws_restJson1.ts b/clients/client-networkmonitor/src/protocols/Aws_restJson1.ts index 3b5621e8d4de..6e948d3d706f 100644 --- a/clients/client-networkmonitor/src/protocols/Aws_restJson1.ts +++ b/clients/client-networkmonitor/src/protocols/Aws_restJson1.ts @@ -311,7 +311,7 @@ export const de_CreateMonitorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMonitorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -328,47 +328,6 @@ export const de_CreateMonitorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMonitorCommandError - */ -const de_CreateMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmonitor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmonitor#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProbeCommand */ @@ -377,7 +336,7 @@ export const de_CreateProbeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateProbeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -402,47 +361,6 @@ export const de_CreateProbeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProbeCommandError - */ -const de_CreateProbeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmonitor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmonitor#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteMonitorCommand */ @@ -451,7 +369,7 @@ export const de_DeleteMonitorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMonitorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -460,44 +378,6 @@ export const de_DeleteMonitorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteMonitorCommandError - */ -const de_DeleteMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmonitor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteProbeCommand */ @@ -506,7 +386,7 @@ export const de_DeleteProbeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProbeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -515,47 +395,6 @@ export const de_DeleteProbeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteProbeCommandError - */ -const de_DeleteProbeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmonitor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmonitor#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetMonitorCommand */ @@ -564,7 +403,7 @@ export const de_GetMonitorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMonitorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -584,44 +423,6 @@ export const de_GetMonitorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetMonitorCommandError - */ -const de_GetMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmonitor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetProbeCommand */ @@ -630,7 +431,7 @@ export const de_GetProbeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProbeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -655,44 +456,6 @@ export const de_GetProbeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetProbeCommandError - */ -const de_GetProbeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmonitor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListMonitorsCommand */ @@ -701,7 +464,7 @@ export const de_ListMonitorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMonitorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -715,41 +478,6 @@ export const de_ListMonitorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListMonitorsCommandError - */ -const de_ListMonitorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -758,7 +486,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -771,47 +499,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmonitor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmonitor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -820,7 +507,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -829,47 +516,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmonitor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmonitor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -878,7 +524,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -887,47 +533,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.networkmonitor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmonitor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateMonitorCommand */ @@ -936,7 +541,7 @@ export const de_UpdateMonitorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateMonitorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -953,47 +558,6 @@ export const de_UpdateMonitorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateMonitorCommandError - */ -const de_UpdateMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.networkmonitor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.networkmonitor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmonitor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.networkmonitor#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.networkmonitor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.networkmonitor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateProbeCommand */ @@ -1002,7 +566,7 @@ export const de_UpdateProbeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProbeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1028,12 +592,9 @@ export const de_UpdateProbeCommand = async ( }; /** - * deserializeAws_restJson1UpdateProbeCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateProbeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1043,12 +604,12 @@ const de_UpdateProbeCommandError = async ( case "AccessDeniedException": case "com.amazonaws.networkmonitor#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.networkmonitor#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.networkmonitor#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.networkmonitor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ServiceQuotaExceededException": case "com.amazonaws.networkmonitor#ServiceQuotaExceededException": throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); @@ -1058,13 +619,16 @@ const de_UpdateProbeCommandError = async ( case "ValidationException": case "com.amazonaws.networkmonitor#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.networkmonitor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-nimble/src/protocols/Aws_restJson1.ts b/clients/client-nimble/src/protocols/Aws_restJson1.ts index 2c8e0a208b4b..2f25c58ec276 100644 --- a/clients/client-nimble/src/protocols/Aws_restJson1.ts +++ b/clients/client-nimble/src/protocols/Aws_restJson1.ts @@ -1277,7 +1277,7 @@ export const de_AcceptEulasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptEulasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1290,50 +1290,6 @@ export const de_AcceptEulasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptEulasCommandError - */ -const de_AcceptEulasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLaunchProfileCommand */ @@ -1342,7 +1298,7 @@ export const de_CreateLaunchProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLaunchProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1355,50 +1311,6 @@ export const de_CreateLaunchProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLaunchProfileCommandError - */ -const de_CreateLaunchProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateStreamingImageCommand */ @@ -1407,7 +1319,7 @@ export const de_CreateStreamingImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateStreamingImageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1420,50 +1332,6 @@ export const de_CreateStreamingImageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateStreamingImageCommandError - */ -const de_CreateStreamingImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateStreamingSessionCommand */ @@ -1472,7 +1340,7 @@ export const de_CreateStreamingSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateStreamingSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1485,50 +1353,6 @@ export const de_CreateStreamingSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateStreamingSessionCommandError - */ -const de_CreateStreamingSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateStreamingSessionStreamCommand */ @@ -1537,7 +1361,7 @@ export const de_CreateStreamingSessionStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateStreamingSessionStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1550,50 +1374,6 @@ export const de_CreateStreamingSessionStreamCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateStreamingSessionStreamCommandError - */ -const de_CreateStreamingSessionStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateStudioCommand */ @@ -1602,7 +1382,7 @@ export const de_CreateStudioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateStudioCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1615,50 +1395,6 @@ export const de_CreateStudioCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateStudioCommandError - */ -const de_CreateStudioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateStudioComponentCommand */ @@ -1667,7 +1403,7 @@ export const de_CreateStudioComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateStudioComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1681,58 +1417,14 @@ export const de_CreateStudioComponentCommand = async ( }; /** - * deserializeAws_restJson1CreateStudioComponentCommandError + * deserializeAws_restJson1DeleteLaunchProfileCommand */ -const de_CreateStudioComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteLaunchProfileCommand - */ -export const de_DeleteLaunchProfileCommand = async ( +export const de_DeleteLaunchProfileCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLaunchProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1745,50 +1437,6 @@ export const de_DeleteLaunchProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLaunchProfileCommandError - */ -const de_DeleteLaunchProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteLaunchProfileMemberCommand */ @@ -1797,7 +1445,7 @@ export const de_DeleteLaunchProfileMemberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLaunchProfileMemberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1806,50 +1454,6 @@ export const de_DeleteLaunchProfileMemberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLaunchProfileMemberCommandError - */ -const de_DeleteLaunchProfileMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteStreamingImageCommand */ @@ -1858,7 +1462,7 @@ export const de_DeleteStreamingImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteStreamingImageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1871,50 +1475,6 @@ export const de_DeleteStreamingImageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteStreamingImageCommandError - */ -const de_DeleteStreamingImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteStreamingSessionCommand */ @@ -1923,7 +1483,7 @@ export const de_DeleteStreamingSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteStreamingSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1936,50 +1496,6 @@ export const de_DeleteStreamingSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteStreamingSessionCommandError - */ -const de_DeleteStreamingSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteStudioCommand */ @@ -1988,7 +1504,7 @@ export const de_DeleteStudioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteStudioCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2001,50 +1517,6 @@ export const de_DeleteStudioCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteStudioCommandError - */ -const de_DeleteStudioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteStudioComponentCommand */ @@ -2053,7 +1525,7 @@ export const de_DeleteStudioComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteStudioComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2067,58 +1539,14 @@ export const de_DeleteStudioComponentCommand = async ( }; /** - * deserializeAws_restJson1DeleteStudioComponentCommandError + * deserializeAws_restJson1DeleteStudioMemberCommand */ -const de_DeleteStudioComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteStudioMemberCommand - */ -export const de_DeleteStudioMemberCommand = async ( +export const de_DeleteStudioMemberCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteStudioMemberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2127,50 +1555,6 @@ export const de_DeleteStudioMemberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteStudioMemberCommandError - */ -const de_DeleteStudioMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEulaCommand */ @@ -2179,7 +1563,7 @@ export const de_GetEulaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEulaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2192,50 +1576,6 @@ export const de_GetEulaCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEulaCommandError - */ -const de_GetEulaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLaunchProfileCommand */ @@ -2244,7 +1584,7 @@ export const de_GetLaunchProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLaunchProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2257,50 +1597,6 @@ export const de_GetLaunchProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLaunchProfileCommandError - */ -const de_GetLaunchProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLaunchProfileDetailsCommand */ @@ -2309,7 +1605,7 @@ export const de_GetLaunchProfileDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLaunchProfileDetailsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2324,50 +1620,6 @@ export const de_GetLaunchProfileDetailsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLaunchProfileDetailsCommandError - */ -const de_GetLaunchProfileDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLaunchProfileInitializationCommand */ @@ -2376,7 +1628,7 @@ export const de_GetLaunchProfileInitializationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLaunchProfileInitializationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2390,188 +1642,56 @@ export const de_GetLaunchProfileInitializationCommand = async ( }; /** - * deserializeAws_restJson1GetLaunchProfileInitializationCommandError + * deserializeAws_restJson1GetLaunchProfileMemberCommand */ -const de_GetLaunchProfileInitializationCommandError = async ( +export const de_GetLaunchProfileMemberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + member: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetLaunchProfileMemberCommand + * deserializeAws_restJson1GetStreamingImageCommand */ -export const de_GetLaunchProfileMemberCommand = async ( +export const de_GetStreamingImageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLaunchProfileMemberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - member: _json, + streamingImage: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetLaunchProfileMemberCommandError + * deserializeAws_restJson1GetStreamingSessionCommand */ -const de_GetLaunchProfileMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetStreamingImageCommand - */ -export const de_GetStreamingImageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStreamingImageCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - streamingImage: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetStreamingImageCommandError - */ -const de_GetStreamingImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetStreamingSessionCommand - */ -export const de_GetStreamingSessionCommand = async ( +export const de_GetStreamingSessionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStreamingSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2584,50 +1704,6 @@ export const de_GetStreamingSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetStreamingSessionCommandError - */ -const de_GetStreamingSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetStreamingSessionBackupCommand */ @@ -2636,7 +1712,7 @@ export const de_GetStreamingSessionBackupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStreamingSessionBackupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2649,47 +1725,6 @@ export const de_GetStreamingSessionBackupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetStreamingSessionBackupCommandError - */ -const de_GetStreamingSessionBackupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetStreamingSessionStreamCommand */ @@ -2698,7 +1733,7 @@ export const de_GetStreamingSessionStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStreamingSessionStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2711,50 +1746,6 @@ export const de_GetStreamingSessionStreamCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetStreamingSessionStreamCommandError - */ -const de_GetStreamingSessionStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetStudioCommand */ @@ -2763,7 +1754,7 @@ export const de_GetStudioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStudioCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2776,50 +1767,6 @@ export const de_GetStudioCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetStudioCommandError - */ -const de_GetStudioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetStudioComponentCommand */ @@ -2828,7 +1775,7 @@ export const de_GetStudioComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStudioComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2841,50 +1788,6 @@ export const de_GetStudioComponentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetStudioComponentCommandError - */ -const de_GetStudioComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetStudioMemberCommand */ @@ -2893,7 +1796,7 @@ export const de_GetStudioMemberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStudioMemberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2906,50 +1809,6 @@ export const de_GetStudioMemberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetStudioMemberCommandError - */ -const de_GetStudioMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEulaAcceptancesCommand */ @@ -2958,7 +1817,7 @@ export const de_ListEulaAcceptancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEulaAcceptancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2972,50 +1831,6 @@ export const de_ListEulaAcceptancesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEulaAcceptancesCommandError - */ -const de_ListEulaAcceptancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEulasCommand */ @@ -3024,7 +1839,7 @@ export const de_ListEulasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEulasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3038,50 +1853,6 @@ export const de_ListEulasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEulasCommandError - */ -const de_ListEulasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListLaunchProfileMembersCommand */ @@ -3090,7 +1861,7 @@ export const de_ListLaunchProfileMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLaunchProfileMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3104,50 +1875,6 @@ export const de_ListLaunchProfileMembersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListLaunchProfileMembersCommandError - */ -const de_ListLaunchProfileMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListLaunchProfilesCommand */ @@ -3156,62 +1883,18 @@ export const de_ListLaunchProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLaunchProfilesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - launchProfiles: (_) => de_LaunchProfileList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListLaunchProfilesCommandError - */ -const de_ListLaunchProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + launchProfiles: (_) => de_LaunchProfileList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3222,7 +1905,7 @@ export const de_ListStreamingImagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStreamingImagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3236,50 +1919,6 @@ export const de_ListStreamingImagesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListStreamingImagesCommandError - */ -const de_ListStreamingImagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListStreamingSessionBackupsCommand */ @@ -3288,7 +1927,7 @@ export const de_ListStreamingSessionBackupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStreamingSessionBackupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3302,47 +1941,6 @@ export const de_ListStreamingSessionBackupsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListStreamingSessionBackupsCommandError - */ -const de_ListStreamingSessionBackupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListStreamingSessionsCommand */ @@ -3351,7 +1949,7 @@ export const de_ListStreamingSessionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStreamingSessionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3365,50 +1963,6 @@ export const de_ListStreamingSessionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListStreamingSessionsCommandError - */ -const de_ListStreamingSessionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListStudioComponentsCommand */ @@ -3417,7 +1971,7 @@ export const de_ListStudioComponentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStudioComponentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3431,50 +1985,6 @@ export const de_ListStudioComponentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListStudioComponentsCommandError - */ -const de_ListStudioComponentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListStudioMembersCommand */ @@ -3483,7 +1993,7 @@ export const de_ListStudioMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStudioMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3497,50 +2007,6 @@ export const de_ListStudioMembersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListStudioMembersCommandError - */ -const de_ListStudioMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListStudiosCommand */ @@ -3549,7 +2015,7 @@ export const de_ListStudiosCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStudiosCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3558,53 +2024,9 @@ export const de_ListStudiosCommand = async ( const doc = take(data, { nextToken: __expectString, studios: (_) => de_StudioList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListStudiosCommandError - */ -const de_ListStudiosCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3615,7 +2037,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3628,50 +2050,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutLaunchProfileMembersCommand */ @@ -3680,7 +2058,7 @@ export const de_PutLaunchProfileMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutLaunchProfileMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3689,50 +2067,6 @@ export const de_PutLaunchProfileMembersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutLaunchProfileMembersCommandError - */ -const de_PutLaunchProfileMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutStudioMembersCommand */ @@ -3741,7 +2075,7 @@ export const de_PutStudioMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutStudioMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3750,50 +2084,6 @@ export const de_PutStudioMembersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutStudioMembersCommandError - */ -const de_PutStudioMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartStreamingSessionCommand */ @@ -3802,7 +2092,7 @@ export const de_StartStreamingSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartStreamingSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3815,50 +2105,6 @@ export const de_StartStreamingSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartStreamingSessionCommandError - */ -const de_StartStreamingSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartStudioSSOConfigurationRepairCommand */ @@ -3867,7 +2113,7 @@ export const de_StartStudioSSOConfigurationRepairCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartStudioSSOConfigurationRepairCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3880,50 +2126,6 @@ export const de_StartStudioSSOConfigurationRepairCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartStudioSSOConfigurationRepairCommandError - */ -const de_StartStudioSSOConfigurationRepairCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopStreamingSessionCommand */ @@ -3932,61 +2134,17 @@ export const de_StopStreamingSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopStreamingSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - session: (_) => de_StreamingSession(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StopStreamingSessionCommandError - */ -const de_StopStreamingSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + session: (_) => de_StreamingSession(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3997,7 +2155,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4006,50 +2164,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -4058,7 +2172,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4067,50 +2181,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLaunchProfileCommand */ @@ -4119,7 +2189,7 @@ export const de_UpdateLaunchProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLaunchProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4132,50 +2202,6 @@ export const de_UpdateLaunchProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLaunchProfileCommandError - */ -const de_UpdateLaunchProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLaunchProfileMemberCommand */ @@ -4184,7 +2210,7 @@ export const de_UpdateLaunchProfileMemberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLaunchProfileMemberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4197,50 +2223,6 @@ export const de_UpdateLaunchProfileMemberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLaunchProfileMemberCommandError - */ -const de_UpdateLaunchProfileMemberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateStreamingImageCommand */ @@ -4249,7 +2231,7 @@ export const de_UpdateStreamingImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateStreamingImageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4262,50 +2244,6 @@ export const de_UpdateStreamingImageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateStreamingImageCommandError - */ -const de_UpdateStreamingImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateStudioCommand */ @@ -4314,7 +2252,7 @@ export const de_UpdateStudioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateStudioCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4327,50 +2265,6 @@ export const de_UpdateStudioCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateStudioCommandError - */ -const de_UpdateStudioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.nimble#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.nimble#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.nimble#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.nimble#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.nimble#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.nimble#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.nimble#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateStudioComponentCommand */ @@ -4379,7 +2273,7 @@ export const de_UpdateStudioComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateStudioComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4393,12 +2287,9 @@ export const de_UpdateStudioComponentCommand = async ( }; /** - * deserializeAws_restJson1UpdateStudioComponentCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateStudioComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4432,7 +2323,7 @@ const de_UpdateStudioComponentCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-oam/src/protocols/Aws_restJson1.ts b/clients/client-oam/src/protocols/Aws_restJson1.ts index f95ac5c5b5d5..2915ec7ca242 100644 --- a/clients/client-oam/src/protocols/Aws_restJson1.ts +++ b/clients/client-oam/src/protocols/Aws_restJson1.ts @@ -394,7 +394,7 @@ export const de_CreateLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -413,44 +413,6 @@ export const de_CreateLinkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLinkCommandError - */ -const de_CreateLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.oam#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceFault": - case "com.amazonaws.oam#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.oam#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.oam#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.oam#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSinkCommand */ @@ -459,7 +421,7 @@ export const de_CreateSinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -475,44 +437,6 @@ export const de_CreateSinkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSinkCommandError - */ -const de_CreateSinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.oam#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceFault": - case "com.amazonaws.oam#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.oam#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.oam#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.oam#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteLinkCommand */ @@ -521,7 +445,7 @@ export const de_DeleteLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -530,41 +454,6 @@ export const de_DeleteLinkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLinkCommandError - */ -const de_DeleteLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceFault": - case "com.amazonaws.oam#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.oam#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.oam#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.oam#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSinkCommand */ @@ -573,7 +462,7 @@ export const de_DeleteSinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -582,44 +471,6 @@ export const de_DeleteSinkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSinkCommandError - */ -const de_DeleteSinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.oam#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceFault": - case "com.amazonaws.oam#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.oam#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.oam#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.oam#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLinkCommand */ @@ -628,7 +479,7 @@ export const de_GetLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -647,41 +498,6 @@ export const de_GetLinkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLinkCommandError - */ -const de_GetLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceFault": - case "com.amazonaws.oam#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.oam#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.oam#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.oam#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSinkCommand */ @@ -690,7 +506,7 @@ export const de_GetSinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -706,41 +522,6 @@ export const de_GetSinkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSinkCommandError - */ -const de_GetSinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceFault": - case "com.amazonaws.oam#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.oam#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.oam#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.oam#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSinkPolicyCommand */ @@ -749,7 +530,7 @@ export const de_GetSinkPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSinkPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -764,41 +545,6 @@ export const de_GetSinkPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSinkPolicyCommandError - */ -const de_GetSinkPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceFault": - case "com.amazonaws.oam#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.oam#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.oam#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.oam#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAttachedLinksCommand */ @@ -807,7 +553,7 @@ export const de_ListAttachedLinksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAttachedLinksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -821,41 +567,6 @@ export const de_ListAttachedLinksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAttachedLinksCommandError - */ -const de_ListAttachedLinksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceFault": - case "com.amazonaws.oam#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.oam#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.oam#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.oam#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListLinksCommand */ @@ -864,7 +575,7 @@ export const de_ListLinksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLinksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -878,38 +589,6 @@ export const de_ListLinksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListLinksCommandError - */ -const de_ListLinksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceFault": - case "com.amazonaws.oam#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.oam#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.oam#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSinksCommand */ @@ -918,7 +597,7 @@ export const de_ListSinksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSinksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -932,38 +611,6 @@ export const de_ListSinksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSinksCommandError - */ -const de_ListSinksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceFault": - case "com.amazonaws.oam#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.oam#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.oam#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -972,7 +619,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -985,35 +632,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.oam#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.oam#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutSinkPolicyCommand */ @@ -1022,7 +640,7 @@ export const de_PutSinkPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutSinkPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1037,41 +655,6 @@ export const de_PutSinkPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutSinkPolicyCommandError - */ -const de_PutSinkPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceFault": - case "com.amazonaws.oam#InternalServiceFault": - throw await de_InternalServiceFaultRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.oam#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.oam#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.oam#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1080,7 +663,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1089,38 +672,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.oam#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.oam#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.oam#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1129,7 +680,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1138,35 +689,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.oam#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.oam#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLinkCommand */ @@ -1175,7 +697,7 @@ export const de_UpdateLinkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLinkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1195,18 +717,18 @@ export const de_UpdateLinkCommand = async ( }; /** - * deserializeAws_restJson1UpdateLinkCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateLinkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "ConflictException": + case "com.amazonaws.oam#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServiceFault": case "com.amazonaws.oam#InternalServiceFault": throw await de_InternalServiceFaultRes(parsedOutput, context); @@ -1216,16 +738,25 @@ const de_UpdateLinkCommandError = async ( case "MissingRequiredParameterException": case "com.amazonaws.oam#MissingRequiredParameterException": throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.oam#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.oam#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.oam#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.oam#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-omics/src/protocols/Aws_restJson1.ts b/clients/client-omics/src/protocols/Aws_restJson1.ts index cb3b6af8c559..cf5c28938e9a 100644 --- a/clients/client-omics/src/protocols/Aws_restJson1.ts +++ b/clients/client-omics/src/protocols/Aws_restJson1.ts @@ -2777,7 +2777,7 @@ export const de_AbortMultipartReadSetUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AbortMultipartReadSetUploadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2786,53 +2786,6 @@ export const de_AbortMultipartReadSetUploadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AbortMultipartReadSetUploadCommandError - */ -const de_AbortMultipartReadSetUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotSupportedOperationException": - case "com.amazonaws.omics#NotSupportedOperationException": - throw await de_NotSupportedOperationExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AcceptShareCommand */ @@ -2841,7 +2794,7 @@ export const de_AcceptShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2854,50 +2807,6 @@ export const de_AcceptShareCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptShareCommandError - */ -const de_AcceptShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDeleteReadSetCommand */ @@ -2906,7 +2815,7 @@ export const de_BatchDeleteReadSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDeleteReadSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2919,47 +2828,6 @@ export const de_BatchDeleteReadSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDeleteReadSetCommandError - */ -const de_BatchDeleteReadSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelAnnotationImportJobCommand */ @@ -2968,7 +2836,7 @@ export const de_CancelAnnotationImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelAnnotationImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2977,44 +2845,6 @@ export const de_CancelAnnotationImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelAnnotationImportJobCommandError - */ -const de_CancelAnnotationImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelRunCommand */ @@ -3023,7 +2853,7 @@ export const de_CancelRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CancelRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3032,53 +2862,6 @@ export const de_CancelRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelRunCommandError - */ -const de_CancelRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelVariantImportJobCommand */ @@ -3087,7 +2870,7 @@ export const de_CancelVariantImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelVariantImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3096,44 +2879,6 @@ export const de_CancelVariantImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelVariantImportJobCommandError - */ -const de_CancelVariantImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CompleteMultipartReadSetUploadCommand */ @@ -3142,7 +2887,7 @@ export const de_CompleteMultipartReadSetUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CompleteMultipartReadSetUploadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3156,61 +2901,14 @@ export const de_CompleteMultipartReadSetUploadCommand = async ( }; /** - * deserializeAws_restJson1CompleteMultipartReadSetUploadCommandError + * deserializeAws_restJson1CreateAnnotationStoreCommand */ -const de_CompleteMultipartReadSetUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotSupportedOperationException": - case "com.amazonaws.omics#NotSupportedOperationException": - throw await de_NotSupportedOperationExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateAnnotationStoreCommand - */ -export const de_CreateAnnotationStoreCommand = async ( +export const de_CreateAnnotationStoreCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAnnotationStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3230,50 +2928,6 @@ export const de_CreateAnnotationStoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAnnotationStoreCommandError - */ -const de_CreateAnnotationStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAnnotationStoreVersionCommand */ @@ -3282,7 +2936,7 @@ export const de_CreateAnnotationStoreVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAnnotationStoreVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3301,50 +2955,6 @@ export const de_CreateAnnotationStoreVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAnnotationStoreVersionCommandError - */ -const de_CreateAnnotationStoreVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMultipartReadSetUploadCommand */ @@ -3353,7 +2963,7 @@ export const de_CreateMultipartReadSetUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMultipartReadSetUploadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3376,53 +2986,6 @@ export const de_CreateMultipartReadSetUploadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMultipartReadSetUploadCommandError - */ -const de_CreateMultipartReadSetUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotSupportedOperationException": - case "com.amazonaws.omics#NotSupportedOperationException": - throw await de_NotSupportedOperationExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateReferenceStoreCommand */ @@ -3431,7 +2994,7 @@ export const de_CreateReferenceStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateReferenceStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3449,47 +3012,6 @@ export const de_CreateReferenceStoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateReferenceStoreCommandError - */ -const de_CreateReferenceStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRunGroupCommand */ @@ -3498,7 +3020,7 @@ export const de_CreateRunGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateRunGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3513,53 +3035,6 @@ export const de_CreateRunGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRunGroupCommandError - */ -const de_CreateRunGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSequenceStoreCommand */ @@ -3568,7 +3043,7 @@ export const de_CreateSequenceStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSequenceStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3588,55 +3063,14 @@ export const de_CreateSequenceStoreCommand = async ( }; /** - * deserializeAws_restJson1CreateSequenceStoreCommandError + * deserializeAws_restJson1CreateShareCommand */ -const de_CreateSequenceStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateShareCommand - */ -export const de_CreateShareCommand = async ( +export const de_CreateShareCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3651,50 +3085,6 @@ export const de_CreateShareCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateShareCommandError - */ -const de_CreateShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateVariantStoreCommand */ @@ -3703,7 +3093,7 @@ export const de_CreateVariantStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateVariantStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3720,50 +3110,6 @@ export const de_CreateVariantStoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateVariantStoreCommandError - */ -const de_CreateVariantStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWorkflowCommand */ @@ -3772,7 +3118,7 @@ export const de_CreateWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3788,53 +3134,6 @@ export const de_CreateWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWorkflowCommandError - */ -const de_CreateWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAnnotationStoreCommand */ @@ -3843,7 +3142,7 @@ export const de_DeleteAnnotationStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAnnotationStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3856,47 +3155,6 @@ export const de_DeleteAnnotationStoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAnnotationStoreCommandError - */ -const de_DeleteAnnotationStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAnnotationStoreVersionsCommand */ @@ -3905,7 +3163,7 @@ export const de_DeleteAnnotationStoreVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAnnotationStoreVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3919,55 +3177,31 @@ export const de_DeleteAnnotationStoreVersionsCommand = async ( }; /** - * deserializeAws_restJson1DeleteAnnotationStoreVersionsCommandError + * deserializeAws_restJson1DeleteReferenceCommand */ -const de_DeleteAnnotationStoreVersionsCommandError = async ( +export const de_DeleteReferenceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteReferenceCommand + * deserializeAws_restJson1DeleteReferenceStoreCommand */ -export const de_DeleteReferenceCommand = async ( +export const de_DeleteReferenceStoreCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteReferenceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3977,119 +3211,14 @@ export const de_DeleteReferenceCommand = async ( }; /** - * deserializeAws_restJson1DeleteReferenceCommandError + * deserializeAws_restJson1DeleteRunCommand */ -const de_DeleteReferenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteReferenceStoreCommand - */ -export const de_DeleteReferenceStoreCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteReferenceStoreCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteReferenceStoreCommandError - */ -const de_DeleteReferenceStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRunCommand - */ -export const de_DeleteRunCommand = async ( +export const de_DeleteRunCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4098,53 +3227,6 @@ export const de_DeleteRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRunCommandError - */ -const de_DeleteRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRunGroupCommand */ @@ -4153,7 +3235,7 @@ export const de_DeleteRunGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteRunGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4162,53 +3244,6 @@ export const de_DeleteRunGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRunGroupCommandError - */ -const de_DeleteRunGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSequenceStoreCommand */ @@ -4217,7 +3252,7 @@ export const de_DeleteSequenceStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSequenceStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4226,50 +3261,6 @@ export const de_DeleteSequenceStoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSequenceStoreCommandError - */ -const de_DeleteSequenceStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteShareCommand */ @@ -4278,7 +3269,7 @@ export const de_DeleteShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4291,50 +3282,6 @@ export const de_DeleteShareCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteShareCommandError - */ -const de_DeleteShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteVariantStoreCommand */ @@ -4343,7 +3290,7 @@ export const de_DeleteVariantStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteVariantStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4357,55 +3304,14 @@ export const de_DeleteVariantStoreCommand = async ( }; /** - * deserializeAws_restJson1DeleteVariantStoreCommandError + * deserializeAws_restJson1DeleteWorkflowCommand */ -const de_DeleteVariantStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteWorkflowCommand - */ -export const de_DeleteWorkflowCommand = async ( +export const de_DeleteWorkflowCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4414,53 +3320,6 @@ export const de_DeleteWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteWorkflowCommandError - */ -const de_DeleteWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAnnotationImportJobCommand */ @@ -4469,7 +3328,7 @@ export const de_GetAnnotationImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAnnotationImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4494,44 +3353,6 @@ export const de_GetAnnotationImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAnnotationImportJobCommandError - */ -const de_GetAnnotationImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAnnotationStoreCommand */ @@ -4540,7 +3361,7 @@ export const de_GetAnnotationStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAnnotationStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4567,44 +3388,6 @@ export const de_GetAnnotationStoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAnnotationStoreCommandError - */ -const de_GetAnnotationStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAnnotationStoreVersionCommand */ @@ -4613,7 +3396,7 @@ export const de_GetAnnotationStoreVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAnnotationStoreVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4638,44 +3421,6 @@ export const de_GetAnnotationStoreVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAnnotationStoreVersionCommandError - */ -const de_GetAnnotationStoreVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetReadSetCommand */ @@ -4684,7 +3429,7 @@ export const de_GetReadSetCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReadSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4696,61 +3441,41 @@ export const de_GetReadSetCommand = async ( }; /** - * deserializeAws_restJson1GetReadSetCommandError + * deserializeAws_restJson1GetReadSetActivationJobCommand */ -const de_GetReadSetCommandError = async ( +export const de_GetReadSetActivationJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RangeNotSatisfiableException": - case "com.amazonaws.omics#RangeNotSatisfiableException": - throw await de_RangeNotSatisfiableExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + completionTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + creationTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + id: __expectString, + sequenceStoreId: __expectString, + sources: _json, + status: __expectString, + statusMessage: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetReadSetActivationJobCommand + * deserializeAws_restJson1GetReadSetExportJobCommand */ -export const de_GetReadSetActivationJobCommand = async ( +export const de_GetReadSetExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReadSetActivationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4759,9 +3484,10 @@ export const de_GetReadSetActivationJobCommand = async ( const doc = take(data, { completionTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), creationTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + destination: __expectString, id: __expectString, + readSets: _json, sequenceStoreId: __expectString, - sources: _json, status: __expectString, statusMessage: __expectString, }); @@ -4770,124 +3496,14 @@ export const de_GetReadSetActivationJobCommand = async ( }; /** - * deserializeAws_restJson1GetReadSetActivationJobCommandError + * deserializeAws_restJson1GetReadSetImportJobCommand */ -const de_GetReadSetActivationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetReadSetExportJobCommand - */ -export const de_GetReadSetExportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReadSetExportJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - completionTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - creationTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - destination: __expectString, - id: __expectString, - readSets: _json, - sequenceStoreId: __expectString, - status: __expectString, - statusMessage: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetReadSetExportJobCommandError - */ -const de_GetReadSetExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetReadSetImportJobCommand - */ -export const de_GetReadSetImportJobCommand = async ( +export const de_GetReadSetImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReadSetImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4907,47 +3523,6 @@ export const de_GetReadSetImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetReadSetImportJobCommandError - */ -const de_GetReadSetImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetReadSetMetadataCommand */ @@ -4956,7 +3531,7 @@ export const de_GetReadSetMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReadSetMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4984,47 +3559,6 @@ export const de_GetReadSetMetadataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetReadSetMetadataCommandError - */ -const de_GetReadSetMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetReferenceCommand */ @@ -5033,7 +3567,7 @@ export const de_GetReferenceCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReferenceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5044,50 +3578,6 @@ export const de_GetReferenceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetReferenceCommandError - */ -const de_GetReferenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RangeNotSatisfiableException": - case "com.amazonaws.omics#RangeNotSatisfiableException": - throw await de_RangeNotSatisfiableExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetReferenceImportJobCommand */ @@ -5096,7 +3586,7 @@ export const de_GetReferenceImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReferenceImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5116,47 +3606,6 @@ export const de_GetReferenceImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetReferenceImportJobCommandError - */ -const de_GetReferenceImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetReferenceMetadataCommand */ @@ -5165,7 +3614,7 @@ export const de_GetReferenceMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReferenceMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5188,55 +3637,14 @@ export const de_GetReferenceMetadataCommand = async ( }; /** - * deserializeAws_restJson1GetReferenceMetadataCommandError - */ -const de_GetReferenceMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetReferenceStoreCommand + * deserializeAws_restJson1GetReferenceStoreCommand */ export const de_GetReferenceStoreCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReferenceStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5254,47 +3662,6 @@ export const de_GetReferenceStoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetReferenceStoreCommandError - */ -const de_GetReferenceStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRunCommand */ @@ -5303,7 +3670,7 @@ export const de_GetRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5344,50 +3711,6 @@ export const de_GetRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRunCommandError - */ -const de_GetRunCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRunGroupCommand */ @@ -5396,7 +3719,7 @@ export const de_GetRunGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRunGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5417,53 +3740,6 @@ export const de_GetRunGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRunGroupCommandError - */ -const de_GetRunGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRunTaskCommand */ @@ -5472,7 +3748,7 @@ export const de_GetRunTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRunTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5497,53 +3773,6 @@ export const de_GetRunTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRunTaskCommandError - */ -const de_GetRunTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSequenceStoreCommand */ @@ -5552,7 +3781,7 @@ export const de_GetSequenceStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSequenceStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5571,47 +3800,6 @@ export const de_GetSequenceStoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSequenceStoreCommandError - */ -const de_GetSequenceStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetShareCommand */ @@ -5620,7 +3808,7 @@ export const de_GetShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5634,58 +3822,14 @@ export const de_GetShareCommand = async ( }; /** - * deserializeAws_restJson1GetShareCommandError + * deserializeAws_restJson1GetVariantImportJobCommand */ -const de_GetShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetVariantImportJobCommand - */ -export const de_GetVariantImportJobCommand = async ( +export const de_GetVariantImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVariantImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5708,44 +3852,6 @@ export const de_GetVariantImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetVariantImportJobCommandError - */ -const de_GetVariantImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetVariantStoreCommand */ @@ -5754,7 +3860,7 @@ export const de_GetVariantStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVariantStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5778,44 +3884,6 @@ export const de_GetVariantStoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetVariantStoreCommandError - */ -const de_GetVariantStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetWorkflowCommand */ @@ -5824,7 +3892,7 @@ export const de_GetWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5853,639 +3921,22 @@ export const de_GetWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetWorkflowCommandError - */ -const de_GetWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAnnotationImportJobsCommand */ export const de_ListAnnotationImportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnnotationImportJobsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - annotationImportJobs: (_) => de_AnnotationImportJobItems(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAnnotationImportJobsCommandError - */ -const de_ListAnnotationImportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAnnotationStoresCommand - */ -export const de_ListAnnotationStoresCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnnotationStoresCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - annotationStores: (_) => de_AnnotationStoreItems(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAnnotationStoresCommandError - */ -const de_ListAnnotationStoresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAnnotationStoreVersionsCommand - */ -export const de_ListAnnotationStoreVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnnotationStoreVersionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - annotationStoreVersions: (_) => de_AnnotationStoreVersionItems(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAnnotationStoreVersionsCommandError - */ -const de_ListAnnotationStoreVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListMultipartReadSetUploadsCommand - */ -export const de_ListMultipartReadSetUploadsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMultipartReadSetUploadsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - uploads: (_) => de_MultipartReadSetUploadList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListMultipartReadSetUploadsCommandError - */ -const de_ListMultipartReadSetUploadsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotSupportedOperationException": - case "com.amazonaws.omics#NotSupportedOperationException": - throw await de_NotSupportedOperationExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListReadSetActivationJobsCommand - */ -export const de_ListReadSetActivationJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReadSetActivationJobsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - activationJobs: (_) => de_ActivateReadSetJobList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListReadSetActivationJobsCommandError - */ -const de_ListReadSetActivationJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListReadSetExportJobsCommand - */ -export const de_ListReadSetExportJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReadSetExportJobsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - exportJobs: (_) => de_ExportReadSetJobDetailList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListReadSetExportJobsCommandError - */ -const de_ListReadSetExportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListReadSetImportJobsCommand - */ -export const de_ListReadSetImportJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReadSetImportJobsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - importJobs: (_) => de_ImportReadSetJobList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListReadSetImportJobsCommandError - */ -const de_ListReadSetImportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListReadSetsCommand - */ -export const de_ListReadSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReadSetsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - readSets: (_) => de_ReadSetList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListReadSetsCommandError - */ -const de_ListReadSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListReadSetUploadPartsCommand - */ -export const de_ListReadSetUploadPartsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReadSetUploadPartsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - parts: (_) => de_ReadSetUploadPartList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListReadSetUploadPartsCommandError - */ -const de_ListReadSetUploadPartsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotSupportedOperationException": - case "com.amazonaws.omics#NotSupportedOperationException": - throw await de_NotSupportedOperationExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListReferenceImportJobsCommand - */ -export const de_ListReferenceImportJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReferenceImportJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - importJobs: (_) => de_ImportReferenceJobList(_, context), + annotationImportJobs: (_) => de_AnnotationImportJobItems(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -6493,185 +3944,87 @@ export const de_ListReferenceImportJobsCommand = async ( }; /** - * deserializeAws_restJson1ListReferenceImportJobsCommandError - */ -const de_ListReferenceImportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListReferencesCommand + * deserializeAws_restJson1ListAnnotationStoresCommand */ -export const de_ListReferencesCommand = async ( +export const de_ListAnnotationStoresCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReferencesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + annotationStores: (_) => de_AnnotationStoreItems(_, context), nextToken: __expectString, - references: (_) => de_ReferenceList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListReferencesCommandError - */ -const de_ListReferencesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListReferenceStoresCommand + * deserializeAws_restJson1ListAnnotationStoreVersionsCommand */ -export const de_ListReferenceStoresCommand = async ( +export const de_ListAnnotationStoreVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReferenceStoresCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + annotationStoreVersions: (_) => de_AnnotationStoreVersionItems(_, context), nextToken: __expectString, - referenceStores: (_) => de_ReferenceStoreDetailList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListReferenceStoresCommandError + * deserializeAws_restJson1ListMultipartReadSetUploadsCommand */ -const de_ListReferenceStoresCommandError = async ( +export const de_ListMultipartReadSetUploadsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + uploads: (_) => de_MultipartReadSetUploadList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRunGroupsCommand + * deserializeAws_restJson1ListReadSetActivationJobsCommand */ -export const de_ListRunGroupsCommand = async ( +export const de_ListReadSetActivationJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRunGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: (_) => de_RunGroupList(_, context), + activationJobs: (_) => de_ActivateReadSetJobList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -6679,68 +4032,43 @@ export const de_ListRunGroupsCommand = async ( }; /** - * deserializeAws_restJson1ListRunGroupsCommandError + * deserializeAws_restJson1ListReadSetExportJobsCommand */ -const de_ListRunGroupsCommandError = async ( +export const de_ListReadSetExportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + exportJobs: (_) => de_ExportReadSetJobDetailList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRunsCommand + * deserializeAws_restJson1ListReadSetImportJobsCommand */ -export const de_ListRunsCommand = async ( +export const de_ListReadSetImportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRunsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: (_) => de_RunList(_, context), + importJobs: (_) => de_ImportReadSetJobList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -6748,190 +4076,80 @@ export const de_ListRunsCommand = async ( }; /** - * deserializeAws_restJson1ListRunsCommandError + * deserializeAws_restJson1ListReadSetsCommand */ -const de_ListRunsCommandError = async ( +export const de_ListReadSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + readSets: (_) => de_ReadSetList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRunTasksCommand + * deserializeAws_restJson1ListReadSetUploadPartsCommand */ -export const de_ListRunTasksCommand = async ( +export const de_ListReadSetUploadPartsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRunTasksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: (_) => de_TaskList(_, context), nextToken: __expectString, + parts: (_) => de_ReadSetUploadPartList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRunTasksCommandError - */ -const de_ListRunTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSequenceStoresCommand + * deserializeAws_restJson1ListReferenceImportJobsCommand */ -export const de_ListSequenceStoresCommand = async ( +export const de_ListReferenceImportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSequenceStoresCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + importJobs: (_) => de_ImportReferenceJobList(_, context), nextToken: __expectString, - sequenceStores: (_) => de_SequenceStoreDetailList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSequenceStoresCommandError - */ -const de_ListSequenceStoresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSharesCommand + * deserializeAws_restJson1ListReferencesCommand */ -export const de_ListSharesCommand = async ( +export const de_ListReferencesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSharesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6939,193 +4157,109 @@ export const de_ListSharesCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - shares: (_) => de_ShareDetailsList(_, context), + references: (_) => de_ReferenceList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSharesCommandError - */ -const de_ListSharesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListReferenceStoresCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListReferenceStoresCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + nextToken: __expectString, + referenceStores: (_) => de_ReferenceStoreDetailList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListRunGroupsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListRunGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: (_) => de_RunGroupList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListVariantImportJobsCommand + * deserializeAws_restJson1ListRunsCommand */ -export const de_ListVariantImportJobsCommand = async ( +export const de_ListRunsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVariantImportJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + items: (_) => de_RunList(_, context), nextToken: __expectString, - variantImportJobs: (_) => de_VariantImportJobItems(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListVariantImportJobsCommandError + * deserializeAws_restJson1ListRunTasksCommand */ -const de_ListVariantImportJobsCommandError = async ( +export const de_ListRunTasksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: (_) => de_TaskList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListVariantStoresCommand + * deserializeAws_restJson1ListSequenceStoresCommand */ -export const de_ListVariantStoresCommand = async ( +export const de_ListSequenceStoresCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVariantStoresCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7133,327 +4267,175 @@ export const de_ListVariantStoresCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - variantStores: (_) => de_VariantStoreItems(_, context), + sequenceStores: (_) => de_SequenceStoreDetailList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListVariantStoresCommandError - */ -const de_ListVariantStoresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListWorkflowsCommand + * deserializeAws_restJson1ListSharesCommand */ -export const de_ListWorkflowsCommand = async ( +export const de_ListSharesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkflowsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: (_) => de_WorkflowList(_, context), nextToken: __expectString, + shares: (_) => de_ShareDetailsList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListWorkflowsCommandError - */ -const de_ListWorkflowsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartAnnotationImportJobCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_StartAnnotationImportJobCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartAnnotationImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - jobId: __expectString, + tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartAnnotationImportJobCommandError + * deserializeAws_restJson1ListVariantImportJobsCommand */ -const de_StartAnnotationImportJobCommandError = async ( +export const de_ListVariantImportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + variantImportJobs: (_) => de_VariantImportJobItems(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartReadSetActivationJobCommand + * deserializeAws_restJson1ListVariantStoresCommand */ -export const de_StartReadSetActivationJobCommand = async ( +export const de_ListVariantStoresCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartReadSetActivationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - creationTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - id: __expectString, - sequenceStoreId: __expectString, - status: __expectString, + nextToken: __expectString, + variantStores: (_) => de_VariantStoreItems(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartReadSetActivationJobCommandError + * deserializeAws_restJson1ListWorkflowsCommand */ -const de_StartReadSetActivationJobCommandError = async ( +export const de_ListWorkflowsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: (_) => de_WorkflowList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartReadSetExportJobCommand + * deserializeAws_restJson1StartAnnotationImportJobCommand */ -export const de_StartReadSetExportJobCommand = async ( +export const de_StartAnnotationImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartReadSetExportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - creationTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - destination: __expectString, - id: __expectString, - sequenceStoreId: __expectString, - status: __expectString, + jobId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartReadSetExportJobCommandError + * deserializeAws_restJson1StartReadSetActivationJobCommand */ -const de_StartReadSetExportJobCommandError = async ( +export const de_StartReadSetActivationJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + creationTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + id: __expectString, + sequenceStoreId: __expectString, + status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartReadSetImportJobCommand + * deserializeAws_restJson1StartReadSetExportJobCommand */ -export const de_StartReadSetImportJobCommand = async ( +export const de_StartReadSetExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartReadSetImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7461,8 +4443,8 @@ export const de_StartReadSetImportJobCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { creationTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + destination: __expectString, id: __expectString, - roleArn: __expectString, sequenceStoreId: __expectString, status: __expectString, }); @@ -7471,47 +4453,28 @@ export const de_StartReadSetImportJobCommand = async ( }; /** - * deserializeAws_restJson1StartReadSetImportJobCommandError + * deserializeAws_restJson1StartReadSetImportJobCommand */ -const de_StartReadSetImportJobCommandError = async ( +export const de_StartReadSetImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + creationTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + id: __expectString, + roleArn: __expectString, + sequenceStoreId: __expectString, + status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -7522,7 +4485,7 @@ export const de_StartReferenceImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartReferenceImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7539,50 +4502,6 @@ export const de_StartReferenceImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartReferenceImportJobCommandError - */ -const de_StartReferenceImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartRunCommand */ @@ -7591,7 +4510,7 @@ export const de_StartRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_StartRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7609,53 +4528,6 @@ export const de_StartRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartRunCommandError - */ -const de_StartRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartVariantImportJobCommand */ @@ -7664,133 +4536,28 @@ export const de_StartVariantImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartVariantImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - jobId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartVariantImportJobCommandError - */ -const de_StartVariantImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + jobId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UntagResourceCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7800,50 +4567,20 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -7854,7 +4591,7 @@ export const de_UpdateAnnotationStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAnnotationStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7875,44 +4612,6 @@ export const de_UpdateAnnotationStoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAnnotationStoreCommandError - */ -const de_UpdateAnnotationStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAnnotationStoreVersionCommand */ @@ -7921,7 +4620,7 @@ export const de_UpdateAnnotationStoreVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAnnotationStoreVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7941,44 +4640,6 @@ export const de_UpdateAnnotationStoreVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAnnotationStoreVersionCommandError - */ -const de_UpdateAnnotationStoreVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRunGroupCommand */ @@ -7987,7 +4648,7 @@ export const de_UpdateRunGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateRunGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7996,53 +4657,6 @@ export const de_UpdateRunGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRunGroupCommandError - */ -const de_UpdateRunGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVariantStoreCommand */ @@ -8051,7 +4665,7 @@ export const de_UpdateVariantStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVariantStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8070,44 +4684,6 @@ export const de_UpdateVariantStoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateVariantStoreCommandError - */ -const de_UpdateVariantStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWorkflowCommand */ @@ -8116,7 +4692,7 @@ export const de_UpdateWorkflowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateWorkflowCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8125,53 +4701,6 @@ export const de_UpdateWorkflowCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateWorkflowCommandError - */ -const de_UpdateWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.omics#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.omics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.omics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.omics#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.omics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.omics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.omics#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.omics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UploadReadSetPartCommand */ @@ -8180,7 +4709,7 @@ export const de_UploadReadSetPartCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UploadReadSetPartCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -8194,12 +4723,9 @@ export const de_UploadReadSetPartCommand = async ( }; /** - * deserializeAws_restJson1UploadReadSetPartCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UploadReadSetPartCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -8230,13 +4756,19 @@ const de_UploadReadSetPartCommandError = async ( case "ValidationException": case "com.amazonaws.omics#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.omics#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "RangeNotSatisfiableException": + case "com.amazonaws.omics#RangeNotSatisfiableException": + throw await de_RangeNotSatisfiableExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-opensearch/src/protocols/Aws_restJson1.ts b/clients/client-opensearch/src/protocols/Aws_restJson1.ts index df07cce9f5d9..ed494727b8ff 100644 --- a/clients/client-opensearch/src/protocols/Aws_restJson1.ts +++ b/clients/client-opensearch/src/protocols/Aws_restJson1.ts @@ -1585,7 +1585,7 @@ export const de_AcceptInboundConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptInboundConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1598,38 +1598,6 @@ export const de_AcceptInboundConnectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptInboundConnectionCommandError - */ -const de_AcceptInboundConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.opensearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AddDataSourceCommand */ @@ -1638,7 +1606,7 @@ export const de_AddDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AddDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1651,50 +1619,6 @@ export const de_AddDataSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddDataSourceCommandError - */ -const de_AddDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DependencyFailureException": - case "com.amazonaws.opensearch#DependencyFailureException": - throw await de_DependencyFailureExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.opensearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AddTagsCommand */ @@ -1703,7 +1627,7 @@ export const de_AddTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AddTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1712,41 +1636,6 @@ export const de_AddTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddTagsCommandError - */ -const de_AddTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.opensearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociatePackageCommand */ @@ -1755,7 +1644,7 @@ export const de_AssociatePackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociatePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1768,47 +1657,6 @@ export const de_AssociatePackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociatePackageCommandError - */ -const de_AssociatePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.opensearch#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.opensearch#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AuthorizeVpcEndpointAccessCommand */ @@ -1817,7 +1665,7 @@ export const de_AuthorizeVpcEndpointAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AuthorizeVpcEndpointAccessCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1830,47 +1678,6 @@ export const de_AuthorizeVpcEndpointAccessCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AuthorizeVpcEndpointAccessCommandError - */ -const de_AuthorizeVpcEndpointAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.opensearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelServiceSoftwareUpdateCommand */ @@ -1879,7 +1686,7 @@ export const de_CancelServiceSoftwareUpdateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelServiceSoftwareUpdateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1892,41 +1699,6 @@ export const de_CancelServiceSoftwareUpdateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelServiceSoftwareUpdateCommandError - */ -const de_CancelServiceSoftwareUpdateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDomainCommand */ @@ -1935,7 +1707,7 @@ export const de_CreateDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1948,50 +1720,6 @@ export const de_CreateDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDomainCommandError - */ -const de_CreateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidTypeException": - case "com.amazonaws.opensearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.opensearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.opensearch#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateOutboundConnectionCommand */ @@ -2000,7 +1728,7 @@ export const de_CreateOutboundConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateOutboundConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2020,49 +1748,14 @@ export const de_CreateOutboundConnectionCommand = async ( }; /** - * deserializeAws_restJson1CreateOutboundConnectionCommandError + * deserializeAws_restJson1CreatePackageCommand */ -const de_CreateOutboundConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.opensearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.opensearch#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreatePackageCommand - */ -export const de_CreatePackageCommand = async ( +export const de_CreatePackageCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2075,50 +1768,6 @@ export const de_CreatePackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePackageCommandError - */ -const de_CreatePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.opensearch#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidTypeException": - case "com.amazonaws.opensearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.opensearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.opensearch#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateVpcEndpointCommand */ @@ -2127,7 +1776,7 @@ export const de_CreateVpcEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateVpcEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2140,47 +1789,6 @@ export const de_CreateVpcEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateVpcEndpointCommandError - */ -const de_CreateVpcEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.opensearch#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.opensearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDataSourceCommand */ @@ -2189,7 +1797,7 @@ export const de_DeleteDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2202,47 +1810,6 @@ export const de_DeleteDataSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDataSourceCommandError - */ -const de_DeleteDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DependencyFailureException": - case "com.amazonaws.opensearch#DependencyFailureException": - throw await de_DependencyFailureExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDomainCommand */ @@ -2251,7 +1818,7 @@ export const de_DeleteDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2264,41 +1831,6 @@ export const de_DeleteDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDomainCommandError - */ -const de_DeleteDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteInboundConnectionCommand */ @@ -2307,7 +1839,7 @@ export const de_DeleteInboundConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteInboundConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2320,35 +1852,6 @@ export const de_DeleteInboundConnectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteInboundConnectionCommandError - */ -const de_DeleteInboundConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteOutboundConnectionCommand */ @@ -2357,7 +1860,7 @@ export const de_DeleteOutboundConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteOutboundConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2371,161 +1874,56 @@ export const de_DeleteOutboundConnectionCommand = async ( }; /** - * deserializeAws_restJson1DeleteOutboundConnectionCommandError + * deserializeAws_restJson1DeletePackageCommand */ -const de_DeleteOutboundConnectionCommandError = async ( +export const de_DeletePackageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + PackageDetails: (_) => de_PackageDetails(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeletePackageCommand + * deserializeAws_restJson1DeleteVpcEndpointCommand */ -export const de_DeletePackageCommand = async ( +export const de_DeleteVpcEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - PackageDetails: (_) => de_PackageDetails(_, context), + VpcEndpointSummary: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeletePackageCommandError + * deserializeAws_restJson1DescribeDomainCommand */ -const de_DeletePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.opensearch#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.opensearch#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVpcEndpointCommand - */ -export const de_DeleteVpcEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteVpcEndpointCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - VpcEndpointSummary: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVpcEndpointCommandError - */ -const de_DeleteVpcEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDomainCommand - */ -export const de_DescribeDomainCommand = async ( +export const de_DescribeDomainCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2538,41 +1936,6 @@ export const de_DescribeDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDomainCommandError - */ -const de_DescribeDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDomainAutoTunesCommand */ @@ -2581,7 +1944,7 @@ export const de_DescribeDomainAutoTunesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDomainAutoTunesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2595,41 +1958,6 @@ export const de_DescribeDomainAutoTunesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDomainAutoTunesCommandError - */ -const de_DescribeDomainAutoTunesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDomainChangeProgressCommand */ @@ -2638,7 +1966,7 @@ export const de_DescribeDomainChangeProgressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDomainChangeProgressCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2651,41 +1979,6 @@ export const de_DescribeDomainChangeProgressCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDomainChangeProgressCommandError - */ -const de_DescribeDomainChangeProgressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDomainConfigCommand */ @@ -2694,7 +1987,7 @@ export const de_DescribeDomainConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDomainConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2707,41 +2000,6 @@ export const de_DescribeDomainConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDomainConfigCommandError - */ -const de_DescribeDomainConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDomainHealthCommand */ @@ -2750,7 +2008,7 @@ export const de_DescribeDomainHealthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDomainHealthCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2775,44 +2033,6 @@ export const de_DescribeDomainHealthCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDomainHealthCommandError - */ -const de_DescribeDomainHealthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDomainNodesCommand */ @@ -2821,7 +2041,7 @@ export const de_DescribeDomainNodesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDomainNodesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2835,55 +2055,14 @@ export const de_DescribeDomainNodesCommand = async ( }; /** - * deserializeAws_restJson1DescribeDomainNodesCommandError + * deserializeAws_restJson1DescribeDomainsCommand */ -const de_DescribeDomainNodesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DependencyFailureException": - case "com.amazonaws.opensearch#DependencyFailureException": - throw await de_DependencyFailureExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDomainsCommand - */ -export const de_DescribeDomainsCommand = async ( +export const de_DescribeDomainsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDomainsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2896,38 +2075,6 @@ export const de_DescribeDomainsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDomainsCommandError - */ -const de_DescribeDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDryRunProgressCommand */ @@ -2936,7 +2083,7 @@ export const de_DescribeDryRunProgressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDryRunProgressCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2951,44 +2098,6 @@ export const de_DescribeDryRunProgressCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDryRunProgressCommandError - */ -const de_DescribeDryRunProgressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeInboundConnectionsCommand */ @@ -2997,7 +2106,7 @@ export const de_DescribeInboundConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeInboundConnectionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3011,35 +2120,6 @@ export const de_DescribeInboundConnectionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeInboundConnectionsCommandError - */ -const de_DescribeInboundConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.opensearch#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeInstanceTypeLimitsCommand */ @@ -3048,7 +2128,7 @@ export const de_DescribeInstanceTypeLimitsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeInstanceTypeLimitsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3061,47 +2141,6 @@ export const de_DescribeInstanceTypeLimitsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeInstanceTypeLimitsCommandError - */ -const de_DescribeInstanceTypeLimitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidTypeException": - case "com.amazonaws.opensearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.opensearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeOutboundConnectionsCommand */ @@ -3110,7 +2149,7 @@ export const de_DescribeOutboundConnectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeOutboundConnectionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3124,35 +2163,6 @@ export const de_DescribeOutboundConnectionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeOutboundConnectionsCommandError - */ -const de_DescribeOutboundConnectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.opensearch#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribePackagesCommand */ @@ -3161,7 +2171,7 @@ export const de_DescribePackagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePackagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3175,44 +2185,6 @@ export const de_DescribePackagesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribePackagesCommandError - */ -const de_DescribePackagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.opensearch#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeReservedInstanceOfferingsCommand */ @@ -3221,7 +2193,7 @@ export const de_DescribeReservedInstanceOfferingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeReservedInstanceOfferingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3235,41 +2207,6 @@ export const de_DescribeReservedInstanceOfferingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeReservedInstanceOfferingsCommandError - */ -const de_DescribeReservedInstanceOfferingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeReservedInstancesCommand */ @@ -3278,7 +2215,7 @@ export const de_DescribeReservedInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeReservedInstancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3293,49 +2230,14 @@ export const de_DescribeReservedInstancesCommand = async ( }; /** - * deserializeAws_restJson1DescribeReservedInstancesCommandError + * deserializeAws_restJson1DescribeVpcEndpointsCommand */ -const de_DescribeReservedInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeVpcEndpointsCommand - */ -export const de_DescribeVpcEndpointsCommand = async ( +export const de_DescribeVpcEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeVpcEndpointsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3349,41 +2251,6 @@ export const de_DescribeVpcEndpointsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeVpcEndpointsCommandError - */ -const de_DescribeVpcEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DissociatePackageCommand */ @@ -3392,7 +2259,7 @@ export const de_DissociatePackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DissociatePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3405,47 +2272,6 @@ export const de_DissociatePackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DissociatePackageCommandError - */ -const de_DissociatePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.opensearch#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.opensearch#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCompatibleVersionsCommand */ @@ -3454,7 +2280,7 @@ export const de_GetCompatibleVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCompatibleVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3467,44 +2293,6 @@ export const de_GetCompatibleVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCompatibleVersionsCommandError - */ -const de_GetCompatibleVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDataSourceCommand */ @@ -3513,7 +2301,7 @@ export const de_GetDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3528,47 +2316,6 @@ export const de_GetDataSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDataSourceCommandError - */ -const de_GetDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DependencyFailureException": - case "com.amazonaws.opensearch#DependencyFailureException": - throw await de_DependencyFailureExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDomainMaintenanceStatusCommand */ @@ -3577,7 +2324,7 @@ export const de_GetDomainMaintenanceStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDomainMaintenanceStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3595,44 +2342,6 @@ export const de_GetDomainMaintenanceStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDomainMaintenanceStatusCommandError - */ -const de_GetDomainMaintenanceStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPackageVersionHistoryCommand */ @@ -3641,7 +2350,7 @@ export const de_GetPackageVersionHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPackageVersionHistoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3656,44 +2365,6 @@ export const de_GetPackageVersionHistoryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetPackageVersionHistoryCommandError - */ -const de_GetPackageVersionHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.opensearch#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetUpgradeHistoryCommand */ @@ -3702,7 +2373,7 @@ export const de_GetUpgradeHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUpgradeHistoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3717,52 +2388,14 @@ export const de_GetUpgradeHistoryCommand = async ( }; /** - * deserializeAws_restJson1GetUpgradeHistoryCommandError + * deserializeAws_restJson1GetUpgradeStatusCommand */ -const de_GetUpgradeHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetUpgradeStatusCommand - */ -export const de_GetUpgradeStatusCommand = async ( +export const de_GetUpgradeStatusCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUpgradeStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3777,44 +2410,6 @@ export const de_GetUpgradeStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetUpgradeStatusCommandError - */ -const de_GetUpgradeStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDataSourcesCommand */ @@ -3823,7 +2418,7 @@ export const de_ListDataSourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataSourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3836,47 +2431,6 @@ export const de_ListDataSourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDataSourcesCommandError - */ -const de_ListDataSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DependencyFailureException": - case "com.amazonaws.opensearch#DependencyFailureException": - throw await de_DependencyFailureExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDomainMaintenancesCommand */ @@ -3885,7 +2439,7 @@ export const de_ListDomainMaintenancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDomainMaintenancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3899,44 +2453,6 @@ export const de_ListDomainMaintenancesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDomainMaintenancesCommandError - */ -const de_ListDomainMaintenancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDomainNamesCommand */ @@ -3945,7 +2461,7 @@ export const de_ListDomainNamesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDomainNamesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3958,35 +2474,6 @@ export const de_ListDomainNamesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDomainNamesCommandError - */ -const de_ListDomainNamesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDomainsForPackageCommand */ @@ -3995,7 +2482,7 @@ export const de_ListDomainsForPackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDomainsForPackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4009,44 +2496,6 @@ export const de_ListDomainsForPackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDomainsForPackageCommandError - */ -const de_ListDomainsForPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.opensearch#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListInstanceTypeDetailsCommand */ @@ -4055,7 +2504,7 @@ export const de_ListInstanceTypeDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInstanceTypeDetailsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4070,169 +2519,58 @@ export const de_ListInstanceTypeDetailsCommand = async ( }; /** - * deserializeAws_restJson1ListInstanceTypeDetailsCommandError + * deserializeAws_restJson1ListPackagesForDomainCommand */ -const de_ListInstanceTypeDetailsCommandError = async ( +export const de_ListPackagesForDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DomainPackageDetailsList: (_) => de_DomainPackageDetailsList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPackagesForDomainCommand + * deserializeAws_restJson1ListScheduledActionsCommand */ -export const de_ListPackagesForDomainCommand = async ( +export const de_ListScheduledActionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPackagesForDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DomainPackageDetailsList: (_) => de_DomainPackageDetailsList(_, context), NextToken: __expectString, + ScheduledActions: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPackagesForDomainCommandError + * deserializeAws_restJson1ListTagsCommand */ -const de_ListPackagesForDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.opensearch#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListScheduledActionsCommand - */ -export const de_ListScheduledActionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListScheduledActionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - ScheduledActions: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListScheduledActionsCommandError - */ -const de_ListScheduledActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.opensearch#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsCommand - */ -export const de_ListTagsCommand = async ( +export const de_ListTagsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4245,41 +2583,6 @@ export const de_ListTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsCommandError - */ -const de_ListTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListVersionsCommand */ @@ -4288,7 +2591,7 @@ export const de_ListVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4302,41 +2605,6 @@ export const de_ListVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListVersionsCommandError - */ -const de_ListVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListVpcEndpointAccessCommand */ @@ -4345,7 +2613,7 @@ export const de_ListVpcEndpointAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVpcEndpointAccessCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4359,41 +2627,6 @@ export const de_ListVpcEndpointAccessCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListVpcEndpointAccessCommandError - */ -const de_ListVpcEndpointAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListVpcEndpointsCommand */ @@ -4402,7 +2635,7 @@ export const de_ListVpcEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVpcEndpointsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4416,38 +2649,6 @@ export const de_ListVpcEndpointsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListVpcEndpointsCommandError - */ -const de_ListVpcEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListVpcEndpointsForDomainCommand */ @@ -4456,7 +2657,7 @@ export const de_ListVpcEndpointsForDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVpcEndpointsForDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4470,41 +2671,6 @@ export const de_ListVpcEndpointsForDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListVpcEndpointsForDomainCommandError - */ -const de_ListVpcEndpointsForDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PurchaseReservedInstanceOfferingCommand */ @@ -4513,7 +2679,7 @@ export const de_PurchaseReservedInstanceOfferingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PurchaseReservedInstanceOfferingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4527,47 +2693,6 @@ export const de_PurchaseReservedInstanceOfferingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PurchaseReservedInstanceOfferingCommandError - */ -const de_PurchaseReservedInstanceOfferingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.opensearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.opensearch#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RejectInboundConnectionCommand */ @@ -4576,7 +2701,7 @@ export const de_RejectInboundConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RejectInboundConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4589,35 +2714,6 @@ export const de_RejectInboundConnectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RejectInboundConnectionCommandError - */ -const de_RejectInboundConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RemoveTagsCommand */ @@ -4626,7 +2722,7 @@ export const de_RemoveTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4635,38 +2731,6 @@ export const de_RemoveTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RemoveTagsCommandError - */ -const de_RemoveTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RevokeVpcEndpointAccessCommand */ @@ -4675,7 +2739,7 @@ export const de_RevokeVpcEndpointAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RevokeVpcEndpointAccessCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4684,44 +2748,6 @@ export const de_RevokeVpcEndpointAccessCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RevokeVpcEndpointAccessCommandError - */ -const de_RevokeVpcEndpointAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartDomainMaintenanceCommand */ @@ -4730,173 +2756,59 @@ export const de_StartDomainMaintenanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartDomainMaintenanceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - MaintenanceId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartDomainMaintenanceCommandError - */ -const de_StartDomainMaintenanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartServiceSoftwareUpdateCommand - */ -export const de_StartServiceSoftwareUpdateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartServiceSoftwareUpdateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ServiceSoftwareOptions: (_) => de_ServiceSoftwareOptions(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartServiceSoftwareUpdateCommandError - */ -const de_StartServiceSoftwareUpdateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + MaintenanceId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateDataSourceCommand + * deserializeAws_restJson1StartServiceSoftwareUpdateCommand */ -export const de_UpdateDataSourceCommand = async ( +export const de_StartServiceSoftwareUpdateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Message: __expectString, + ServiceSoftwareOptions: (_) => de_ServiceSoftwareOptions(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateDataSourceCommandError + * deserializeAws_restJson1UpdateDataSourceCommand */ -const de_UpdateDataSourceCommandError = async ( +export const de_UpdateDataSourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "DependencyFailureException": - case "com.amazonaws.opensearch#DependencyFailureException": - throw await de_DependencyFailureExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Message: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4907,7 +2819,7 @@ export const de_UpdateDomainConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDomainConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4922,47 +2834,6 @@ export const de_UpdateDomainConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDomainConfigCommandError - */ -const de_UpdateDomainConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidTypeException": - case "com.amazonaws.opensearch#InvalidTypeException": - throw await de_InvalidTypeExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.opensearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePackageCommand */ @@ -4971,7 +2842,7 @@ export const de_UpdatePackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4984,47 +2855,6 @@ export const de_UpdatePackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePackageCommandError - */ -const de_UpdatePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.opensearch#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.opensearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateScheduledActionCommand */ @@ -5033,7 +2863,7 @@ export const de_UpdateScheduledActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateScheduledActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5046,50 +2876,6 @@ export const de_UpdateScheduledActionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateScheduledActionCommandError - */ -const de_UpdateScheduledActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.opensearch#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.opensearch#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "SlotNotAvailableException": - case "com.amazonaws.opensearch#SlotNotAvailableException": - throw await de_SlotNotAvailableExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVpcEndpointCommand */ @@ -5098,7 +2884,7 @@ export const de_UpdateVpcEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVpcEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5111,47 +2897,6 @@ export const de_UpdateVpcEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateVpcEndpointCommandError - */ -const de_UpdateVpcEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.opensearch#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DisabledOperationException": - case "com.amazonaws.opensearch#DisabledOperationException": - throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearch#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearch#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpgradeDomainCommand */ @@ -5160,7 +2905,7 @@ export const de_UpgradeDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpgradeDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5179,43 +2924,61 @@ export const de_UpgradeDomainCommand = async ( }; /** - * deserializeAws_restJson1UpgradeDomainCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpgradeDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "BaseException": - case "com.amazonaws.opensearch#BaseException": - throw await de_BaseExceptionRes(parsedOutput, context); case "DisabledOperationException": case "com.amazonaws.opensearch#DisabledOperationException": throw await de_DisabledOperationExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.opensearch#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.opensearch#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.opensearch#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.opensearch#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "BaseException": + case "com.amazonaws.opensearch#BaseException": + throw await de_BaseExceptionRes(parsedOutput, context); + case "DependencyFailureException": + case "com.amazonaws.opensearch#DependencyFailureException": + throw await de_DependencyFailureExceptionRes(parsedOutput, context); + case "InternalException": + case "com.amazonaws.opensearch#InternalException": + throw await de_InternalExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.opensearch#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.opensearch#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.opensearch#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InvalidTypeException": + case "com.amazonaws.opensearch#InvalidTypeException": + throw await de_InvalidTypeExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.opensearch#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidPaginationTokenException": + case "com.amazonaws.opensearch#InvalidPaginationTokenException": + throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); + case "SlotNotAvailableException": + case "com.amazonaws.opensearch#SlotNotAvailableException": + throw await de_SlotNotAvailableExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts b/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts index 04053d50d7f2..e4448c6431d1 100644 --- a/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts +++ b/clients/client-opensearchserverless/src/protocols/Aws_json1_0.ts @@ -661,7 +661,7 @@ export const de_BatchGetCollectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetCollectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -673,35 +673,6 @@ export const de_BatchGetCollectionCommand = async ( return response; }; -/** - * deserializeAws_json1_0BatchGetCollectionCommandError - */ -const de_BatchGetCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0BatchGetEffectiveLifecyclePolicyCommand */ @@ -710,7 +681,7 @@ export const de_BatchGetEffectiveLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetEffectiveLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -722,35 +693,6 @@ export const de_BatchGetEffectiveLifecyclePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0BatchGetEffectiveLifecyclePolicyCommandError - */ -const de_BatchGetEffectiveLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0BatchGetLifecyclePolicyCommand */ @@ -759,7 +701,7 @@ export const de_BatchGetLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -771,35 +713,6 @@ export const de_BatchGetLifecyclePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0BatchGetLifecyclePolicyCommandError - */ -const de_BatchGetLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0BatchGetVpcEndpointCommand */ @@ -808,7 +721,7 @@ export const de_BatchGetVpcEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetVpcEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -820,35 +733,6 @@ export const de_BatchGetVpcEndpointCommand = async ( return response; }; -/** - * deserializeAws_json1_0BatchGetVpcEndpointCommandError - */ -const de_BatchGetVpcEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateAccessPolicyCommand */ @@ -857,7 +741,7 @@ export const de_CreateAccessPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAccessPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -869,41 +753,6 @@ export const de_CreateAccessPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateAccessPolicyCommandError - */ -const de_CreateAccessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateCollectionCommand */ @@ -912,7 +761,7 @@ export const de_CreateCollectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCollectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -924,44 +773,6 @@ export const de_CreateCollectionCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateCollectionCommandError - */ -const de_CreateCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "OcuLimitExceededException": - case "com.amazonaws.opensearchserverless#OcuLimitExceededException": - throw await de_OcuLimitExceededExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateLifecyclePolicyCommand */ @@ -970,7 +781,7 @@ export const de_CreateLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -982,41 +793,6 @@ export const de_CreateLifecyclePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateLifecyclePolicyCommandError - */ -const de_CreateLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateSecurityConfigCommand */ @@ -1025,7 +801,7 @@ export const de_CreateSecurityConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSecurityConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1038,54 +814,39 @@ export const de_CreateSecurityConfigCommand = async ( }; /** - * deserializeAws_json1_0CreateSecurityConfigCommandError + * deserializeAws_json1_0CreateSecurityPolicyCommand */ -const de_CreateSecurityConfigCommandError = async ( +export const de_CreateSecurityPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateSecurityPolicyResponse(data, context); + const response: CreateSecurityPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0CreateSecurityPolicyCommand + * deserializeAws_json1_0CreateVpcEndpointCommand */ -export const de_CreateSecurityPolicyCommand = async ( +export const de_CreateVpcEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateSecurityPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateSecurityPolicyResponse(data, context); - const response: CreateSecurityPolicyCommandOutput = { + contents = _json(data); + const response: CreateVpcEndpointCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1093,104 +854,14 @@ export const de_CreateSecurityPolicyCommand = async ( }; /** - * deserializeAws_json1_0CreateSecurityPolicyCommandError + * deserializeAws_json1_0DeleteAccessPolicyCommand */ -const de_CreateSecurityPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0CreateVpcEndpointCommand - */ -export const de_CreateVpcEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateVpcEndpointCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateVpcEndpointCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0CreateVpcEndpointCommandError - */ -const de_CreateVpcEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteAccessPolicyCommand - */ -export const de_DeleteAccessPolicyCommand = async ( +export const de_DeleteAccessPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAccessPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1202,41 +873,6 @@ export const de_DeleteAccessPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteAccessPolicyCommandError - */ -const de_DeleteAccessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteCollectionCommand */ @@ -1245,7 +881,7 @@ export const de_DeleteCollectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCollectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1257,41 +893,6 @@ export const de_DeleteCollectionCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteCollectionCommandError - */ -const de_DeleteCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteLifecyclePolicyCommand */ @@ -1300,7 +901,7 @@ export const de_DeleteLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1312,41 +913,6 @@ export const de_DeleteLifecyclePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteLifecyclePolicyCommandError - */ -const de_DeleteLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteSecurityConfigCommand */ @@ -1355,7 +921,7 @@ export const de_DeleteSecurityConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSecurityConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1367,41 +933,6 @@ export const de_DeleteSecurityConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteSecurityConfigCommandError - */ -const de_DeleteSecurityConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteSecurityPolicyCommand */ @@ -1410,7 +941,7 @@ export const de_DeleteSecurityPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSecurityPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1422,459 +953,40 @@ export const de_DeleteSecurityPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteSecurityPolicyCommandError - */ -const de_DeleteSecurityPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteVpcEndpointCommand */ export const de_DeleteVpcEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteVpcEndpointCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteVpcEndpointCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteVpcEndpointCommandError - */ -const de_DeleteVpcEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetAccessPolicyCommand - */ -export const de_GetAccessPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetAccessPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetAccessPolicyResponse(data, context); - const response: GetAccessPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetAccessPolicyCommandError - */ -const de_GetAccessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetAccountSettingsCommand - */ -export const de_GetAccountSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetAccountSettingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetAccountSettingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetAccountSettingsCommandError - */ -const de_GetAccountSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetPoliciesStatsCommand - */ -export const de_GetPoliciesStatsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetPoliciesStatsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetPoliciesStatsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetPoliciesStatsCommandError - */ -const de_GetPoliciesStatsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetSecurityConfigCommand - */ -export const de_GetSecurityConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSecurityConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetSecurityConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetSecurityConfigCommandError - */ -const de_GetSecurityConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetSecurityPolicyCommand - */ -export const de_GetSecurityPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSecurityPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetSecurityPolicyResponse(data, context); - const response: GetSecurityPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetSecurityPolicyCommandError - */ -const de_GetSecurityPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListAccessPoliciesCommand - */ -export const de_ListAccessPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAccessPoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListAccessPoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListAccessPoliciesCommandError - */ -const de_ListAccessPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListCollectionsCommand - */ -export const de_ListCollectionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListCollectionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListCollectionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListCollectionsCommandError - */ -const de_ListCollectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteVpcEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListLifecyclePoliciesCommand + * deserializeAws_json1_0GetAccessPolicyCommand */ -export const de_ListLifecyclePoliciesCommand = async ( +export const de_GetAccessPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListLifecyclePoliciesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListLifecyclePoliciesCommandOutput = { + contents = de_GetAccessPolicyResponse(data, context); + const response: GetAccessPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1882,48 +994,39 @@ export const de_ListLifecyclePoliciesCommand = async ( }; /** - * deserializeAws_json1_0ListLifecyclePoliciesCommandError + * deserializeAws_json1_0GetAccountSettingsCommand */ -const de_ListLifecyclePoliciesCommandError = async ( +export const de_GetAccountSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetAccountSettingsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListSecurityConfigsCommand + * deserializeAws_json1_0GetPoliciesStatsCommand */ -export const de_ListSecurityConfigsCommand = async ( +export const de_GetPoliciesStatsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSecurityConfigsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListSecurityConfigsCommandOutput = { + const response: GetPoliciesStatsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1931,48 +1034,39 @@ export const de_ListSecurityConfigsCommand = async ( }; /** - * deserializeAws_json1_0ListSecurityConfigsCommandError + * deserializeAws_json1_0GetSecurityConfigCommand */ -const de_ListSecurityConfigsCommandError = async ( +export const de_GetSecurityConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetSecurityConfigCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListSecurityPoliciesCommand + * deserializeAws_json1_0GetSecurityPolicyCommand */ -export const de_ListSecurityPoliciesCommand = async ( +export const de_GetSecurityPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSecurityPoliciesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListSecurityPoliciesCommandOutput = { + contents = de_GetSecurityPolicyResponse(data, context); + const response: GetSecurityPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1980,48 +1074,39 @@ export const de_ListSecurityPoliciesCommand = async ( }; /** - * deserializeAws_json1_0ListSecurityPoliciesCommandError + * deserializeAws_json1_0ListAccessPoliciesCommand */ -const de_ListSecurityPoliciesCommandError = async ( +export const de_ListAccessPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListAccessPoliciesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListTagsForResourceCommand + * deserializeAws_json1_0ListCollectionsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListCollectionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + const response: ListCollectionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2029,51 +1114,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_0ListTagsForResourceCommandError + * deserializeAws_json1_0ListLifecyclePoliciesCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListLifecyclePoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListLifecyclePoliciesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListVpcEndpointsCommand + * deserializeAws_json1_0ListSecurityConfigsCommand */ -export const de_ListVpcEndpointsCommand = async ( +export const de_ListSecurityConfigsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListVpcEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListVpcEndpointsCommandOutput = { + const response: ListSecurityConfigsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2081,48 +1154,39 @@ export const de_ListVpcEndpointsCommand = async ( }; /** - * deserializeAws_json1_0ListVpcEndpointsCommandError + * deserializeAws_json1_0ListSecurityPoliciesCommand */ -const de_ListVpcEndpointsCommandError = async ( +export const de_ListSecurityPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListSecurityPoliciesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0TagResourceCommand + * deserializeAws_json1_0ListTagsForResourceCommand */ -export const de_TagResourceCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2130,57 +1194,39 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_0TagResourceCommandError + * deserializeAws_json1_0ListVpcEndpointsCommand */ -const de_TagResourceCommandError = async ( +export const de_ListVpcEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListVpcEndpointsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0UntagResourceCommand + * deserializeAws_json1_0TagResourceCommand */ -export const de_UntagResourceCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UntagResourceCommandOutput = { + const response: TagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2188,38 +1234,23 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_0UntagResourceCommandError + * deserializeAws_json1_0UntagResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2230,7 +1261,7 @@ export const de_UpdateAccessPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateAccessPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2242,41 +1273,6 @@ export const de_UpdateAccessPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateAccessPolicyCommandError - */ -const de_UpdateAccessPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateAccountSettingsCommand */ @@ -2285,7 +1281,7 @@ export const de_UpdateAccountSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateAccountSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2297,35 +1293,6 @@ export const de_UpdateAccountSettingsCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateAccountSettingsCommandError - */ -const de_UpdateAccountSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateCollectionCommand */ @@ -2334,7 +1301,7 @@ export const de_UpdateCollectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateCollectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2346,38 +1313,6 @@ export const de_UpdateCollectionCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateCollectionCommandError - */ -const de_UpdateCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateLifecyclePolicyCommand */ @@ -2386,7 +1321,7 @@ export const de_UpdateLifecyclePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLifecyclePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2398,44 +1333,6 @@ export const de_UpdateLifecyclePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateLifecyclePolicyCommandError - */ -const de_UpdateLifecyclePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateSecurityConfigCommand */ @@ -2444,7 +1341,7 @@ export const de_UpdateSecurityConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSecurityConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2456,41 +1353,6 @@ export const de_UpdateSecurityConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateSecurityConfigCommandError - */ -const de_UpdateSecurityConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateSecurityPolicyCommand */ @@ -2499,7 +1361,7 @@ export const de_UpdateSecurityPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSecurityPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2511,44 +1373,6 @@ export const de_UpdateSecurityPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateSecurityPolicyCommandError - */ -const de_UpdateSecurityPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.opensearchserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opensearchserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opensearchserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateVpcEndpointCommand */ @@ -2557,7 +1381,7 @@ export const de_UpdateVpcEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateVpcEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2570,34 +1394,40 @@ export const de_UpdateVpcEndpointCommand = async ( }; /** - * deserializeAws_json1_0UpdateVpcEndpointCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateVpcEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ConflictException": - case "com.amazonaws.opensearchserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.opensearchserverless#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.opensearchserverless#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.opensearchserverless#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.opensearchserverless#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "OcuLimitExceededException": + case "com.amazonaws.opensearchserverless#OcuLimitExceededException": + throw await de_OcuLimitExceededExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.opensearchserverless#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-opsworks/src/protocols/Aws_json1_1.ts b/clients/client-opsworks/src/protocols/Aws_json1_1.ts index 41d87e39c294..22b9ad6ebea5 100644 --- a/clients/client-opsworks/src/protocols/Aws_json1_1.ts +++ b/clients/client-opsworks/src/protocols/Aws_json1_1.ts @@ -1240,7 +1240,7 @@ export const de_AssignInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssignInstanceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AssignInstanceCommandOutput = { @@ -1249,35 +1249,6 @@ export const de_AssignInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssignInstanceCommandError - */ -const de_AssignInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssignVolumeCommand */ @@ -1286,7 +1257,7 @@ export const de_AssignVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssignVolumeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AssignVolumeCommandOutput = { @@ -1295,35 +1266,6 @@ export const de_AssignVolumeCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssignVolumeCommandError - */ -const de_AssignVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateElasticIpCommand */ @@ -1332,7 +1274,7 @@ export const de_AssociateElasticIpCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateElasticIpCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AssociateElasticIpCommandOutput = { @@ -1341,35 +1283,6 @@ export const de_AssociateElasticIpCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateElasticIpCommandError - */ -const de_AssociateElasticIpCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AttachElasticLoadBalancerCommand */ @@ -1378,7 +1291,7 @@ export const de_AttachElasticLoadBalancerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachElasticLoadBalancerCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AttachElasticLoadBalancerCommandOutput = { @@ -1387,35 +1300,6 @@ export const de_AttachElasticLoadBalancerCommand = async ( return response; }; -/** - * deserializeAws_json1_1AttachElasticLoadBalancerCommandError - */ -const de_AttachElasticLoadBalancerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CloneStackCommand */ @@ -1424,7 +1308,7 @@ export const de_CloneStackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CloneStackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1436,35 +1320,6 @@ export const de_CloneStackCommand = async ( return response; }; -/** - * deserializeAws_json1_1CloneStackCommandError - */ -const de_CloneStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAppCommand */ @@ -1473,7 +1328,7 @@ export const de_CreateAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAppCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1485,35 +1340,6 @@ export const de_CreateAppCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAppCommandError - */ -const de_CreateAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDeploymentCommand */ @@ -1522,7 +1348,7 @@ export const de_CreateDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDeploymentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1534,35 +1360,6 @@ export const de_CreateDeploymentCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDeploymentCommandError - */ -const de_CreateDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateInstanceCommand */ @@ -1571,7 +1368,7 @@ export const de_CreateInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1583,35 +1380,6 @@ export const de_CreateInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateInstanceCommandError - */ -const de_CreateInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLayerCommand */ @@ -1620,7 +1388,7 @@ export const de_CreateLayerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLayerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1633,48 +1401,39 @@ export const de_CreateLayerCommand = async ( }; /** - * deserializeAws_json1_1CreateLayerCommandError + * deserializeAws_json1_1CreateStackCommand */ -const de_CreateLayerCommandError = async ( +export const de_CreateStackCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateStackCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateStackCommand + * deserializeAws_json1_1CreateUserProfileCommand */ -export const de_CreateStackCommand = async ( +export const de_CreateUserProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateStackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateStackCommandOutput = { + const response: CreateUserProfileCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1682,86 +1441,14 @@ export const de_CreateStackCommand = async ( }; /** - * deserializeAws_json1_1CreateStackCommandError + * deserializeAws_json1_1DeleteAppCommand */ -const de_CreateStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateUserProfileCommand - */ -export const de_CreateUserProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateUserProfileCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateUserProfileCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateUserProfileCommandError - */ -const de_CreateUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteAppCommand - */ -export const de_DeleteAppCommand = async ( +export const de_DeleteAppCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAppCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteAppCommandOutput = { @@ -1770,35 +1457,6 @@ export const de_DeleteAppCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAppCommandError - */ -const de_DeleteAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteInstanceCommand */ @@ -1807,7 +1465,7 @@ export const de_DeleteInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteInstanceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteInstanceCommandOutput = { @@ -1816,35 +1474,6 @@ export const de_DeleteInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteInstanceCommandError - */ -const de_DeleteInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteLayerCommand */ @@ -1853,7 +1482,7 @@ export const de_DeleteLayerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLayerCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteLayerCommandOutput = { @@ -1862,35 +1491,6 @@ export const de_DeleteLayerCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteLayerCommandError - */ -const de_DeleteLayerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteStackCommand */ @@ -1899,7 +1499,7 @@ export const de_DeleteStackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteStackCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteStackCommandOutput = { @@ -1908,35 +1508,6 @@ export const de_DeleteStackCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteStackCommandError - */ -const de_DeleteStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteUserProfileCommand */ @@ -1945,7 +1516,7 @@ export const de_DeleteUserProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteUserProfileCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteUserProfileCommandOutput = { @@ -1954,35 +1525,6 @@ export const de_DeleteUserProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteUserProfileCommandError - */ -const de_DeleteUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeregisterEcsClusterCommand */ @@ -1991,7 +1533,7 @@ export const de_DeregisterEcsClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterEcsClusterCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeregisterEcsClusterCommandOutput = { @@ -2000,35 +1542,6 @@ export const de_DeregisterEcsClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeregisterEcsClusterCommandError - */ -const de_DeregisterEcsClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeregisterElasticIpCommand */ @@ -2037,7 +1550,7 @@ export const de_DeregisterElasticIpCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterElasticIpCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeregisterElasticIpCommandOutput = { @@ -2047,135 +1560,48 @@ export const de_DeregisterElasticIpCommand = async ( }; /** - * deserializeAws_json1_1DeregisterElasticIpCommandError + * deserializeAws_json1_1DeregisterInstanceCommand */ -const de_DeregisterElasticIpCommandError = async ( +export const de_DeregisterInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeregisterInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeregisterInstanceCommand + * deserializeAws_json1_1DeregisterRdsDbInstanceCommand */ -export const de_DeregisterInstanceCommand = async ( +export const de_DeregisterRdsDbInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeregisterInstanceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeregisterInstanceCommandOutput = { + const response: DeregisterRdsDbInstanceCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeregisterInstanceCommandError + * deserializeAws_json1_1DeregisterVolumeCommand */ -const de_DeregisterInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeregisterRdsDbInstanceCommand - */ -export const de_DeregisterRdsDbInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeregisterRdsDbInstanceCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeregisterRdsDbInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeregisterRdsDbInstanceCommandError - */ -const de_DeregisterRdsDbInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeregisterVolumeCommand - */ -export const de_DeregisterVolumeCommand = async ( +export const de_DeregisterVolumeCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterVolumeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeregisterVolumeCommandOutput = { @@ -2184,35 +1610,6 @@ export const de_DeregisterVolumeCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeregisterVolumeCommandError - */ -const de_DeregisterVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAgentVersionsCommand */ @@ -2221,7 +1618,7 @@ export const de_DescribeAgentVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAgentVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2233,35 +1630,6 @@ export const de_DescribeAgentVersionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAgentVersionsCommandError - */ -const de_DescribeAgentVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAppsCommand */ @@ -2270,7 +1638,7 @@ export const de_DescribeAppsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAppsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2282,35 +1650,6 @@ export const de_DescribeAppsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAppsCommandError - */ -const de_DescribeAppsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeCommandsCommand */ @@ -2319,7 +1658,7 @@ export const de_DescribeCommandsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCommandsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2331,35 +1670,6 @@ export const de_DescribeCommandsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeCommandsCommandError - */ -const de_DescribeCommandsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeDeploymentsCommand */ @@ -2368,7 +1678,7 @@ export const de_DescribeDeploymentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDeploymentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2380,35 +1690,6 @@ export const de_DescribeDeploymentsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDeploymentsCommandError - */ -const de_DescribeDeploymentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEcsClustersCommand */ @@ -2417,7 +1698,7 @@ export const de_DescribeEcsClustersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEcsClustersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2429,35 +1710,6 @@ export const de_DescribeEcsClustersCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEcsClustersCommandError - */ -const de_DescribeEcsClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeElasticIpsCommand */ @@ -2466,7 +1718,7 @@ export const de_DescribeElasticIpsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeElasticIpsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2478,35 +1730,6 @@ export const de_DescribeElasticIpsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeElasticIpsCommandError - */ -const de_DescribeElasticIpsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeElasticLoadBalancersCommand */ @@ -2515,7 +1738,7 @@ export const de_DescribeElasticLoadBalancersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeElasticLoadBalancersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2528,43 +1751,14 @@ export const de_DescribeElasticLoadBalancersCommand = async ( }; /** - * deserializeAws_json1_1DescribeElasticLoadBalancersCommandError + * deserializeAws_json1_1DescribeInstancesCommand */ -const de_DescribeElasticLoadBalancersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeInstancesCommand - */ -export const de_DescribeInstancesCommand = async ( +export const de_DescribeInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2576,35 +1770,6 @@ export const de_DescribeInstancesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeInstancesCommandError - */ -const de_DescribeInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLayersCommand */ @@ -2613,7 +1778,7 @@ export const de_DescribeLayersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLayersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2625,35 +1790,6 @@ export const de_DescribeLayersCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLayersCommandError - */ -const de_DescribeLayersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLoadBasedAutoScalingCommand */ @@ -2662,7 +1798,7 @@ export const de_DescribeLoadBasedAutoScalingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLoadBasedAutoScalingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2674,35 +1810,6 @@ export const de_DescribeLoadBasedAutoScalingCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLoadBasedAutoScalingCommandError - */ -const de_DescribeLoadBasedAutoScalingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeMyUserProfileCommand */ @@ -2711,7 +1818,7 @@ export const de_DescribeMyUserProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeMyUserProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2723,26 +1830,6 @@ export const de_DescribeMyUserProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeMyUserProfileCommandError - */ -const de_DescribeMyUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribeOperatingSystemsCommand */ @@ -2751,7 +1838,7 @@ export const de_DescribeOperatingSystemsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeOperatingSystemsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2763,26 +1850,6 @@ export const de_DescribeOperatingSystemsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeOperatingSystemsCommandError - */ -const de_DescribeOperatingSystemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribePermissionsCommand */ @@ -2791,7 +1858,7 @@ export const de_DescribePermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePermissionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2803,35 +1870,6 @@ export const de_DescribePermissionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribePermissionsCommandError - */ -const de_DescribePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeRaidArraysCommand */ @@ -2840,7 +1878,7 @@ export const de_DescribeRaidArraysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRaidArraysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2852,35 +1890,6 @@ export const de_DescribeRaidArraysCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeRaidArraysCommandError - */ -const de_DescribeRaidArraysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeRdsDbInstancesCommand */ @@ -2889,7 +1898,7 @@ export const de_DescribeRdsDbInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRdsDbInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2901,35 +1910,6 @@ export const de_DescribeRdsDbInstancesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeRdsDbInstancesCommandError - */ -const de_DescribeRdsDbInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeServiceErrorsCommand */ @@ -2938,7 +1918,7 @@ export const de_DescribeServiceErrorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeServiceErrorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2951,48 +1931,39 @@ export const de_DescribeServiceErrorsCommand = async ( }; /** - * deserializeAws_json1_1DescribeServiceErrorsCommandError + * deserializeAws_json1_1DescribeStackProvisioningParametersCommand */ -const de_DescribeServiceErrorsCommandError = async ( +export const de_DescribeStackProvisioningParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeStackProvisioningParametersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeStackProvisioningParametersCommand + * deserializeAws_json1_1DescribeStacksCommand */ -export const de_DescribeStackProvisioningParametersCommand = async ( +export const de_DescribeStacksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeStackProvisioningParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeStackProvisioningParametersCommandOutput = { + const response: DescribeStacksCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3000,92 +1971,14 @@ export const de_DescribeStackProvisioningParametersCommand = async ( }; /** - * deserializeAws_json1_1DescribeStackProvisioningParametersCommandError + * deserializeAws_json1_1DescribeStackSummaryCommand */ -const de_DescribeStackProvisioningParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeStacksCommand - */ -export const de_DescribeStacksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeStacksCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeStacksCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeStacksCommandError - */ -const de_DescribeStacksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeStackSummaryCommand - */ -export const de_DescribeStackSummaryCommand = async ( +export const de_DescribeStackSummaryCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStackSummaryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3097,35 +1990,6 @@ export const de_DescribeStackSummaryCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeStackSummaryCommandError - */ -const de_DescribeStackSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTimeBasedAutoScalingCommand */ @@ -3134,7 +1998,7 @@ export const de_DescribeTimeBasedAutoScalingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTimeBasedAutoScalingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3146,35 +2010,6 @@ export const de_DescribeTimeBasedAutoScalingCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTimeBasedAutoScalingCommandError - */ -const de_DescribeTimeBasedAutoScalingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeUserProfilesCommand */ @@ -3183,7 +2018,7 @@ export const de_DescribeUserProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeUserProfilesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3195,35 +2030,6 @@ export const de_DescribeUserProfilesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeUserProfilesCommandError - */ -const de_DescribeUserProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeVolumesCommand */ @@ -3232,7 +2038,7 @@ export const de_DescribeVolumesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVolumesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3244,35 +2050,6 @@ export const de_DescribeVolumesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeVolumesCommandError - */ -const de_DescribeVolumesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DetachElasticLoadBalancerCommand */ @@ -3281,7 +2058,7 @@ export const de_DetachElasticLoadBalancerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetachElasticLoadBalancerCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DetachElasticLoadBalancerCommandOutput = { @@ -3290,32 +2067,6 @@ export const de_DetachElasticLoadBalancerCommand = async ( return response; }; -/** - * deserializeAws_json1_1DetachElasticLoadBalancerCommandError - */ -const de_DetachElasticLoadBalancerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisassociateElasticIpCommand */ @@ -3324,7 +2075,7 @@ export const de_DisassociateElasticIpCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateElasticIpCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DisassociateElasticIpCommandOutput = { @@ -3333,35 +2084,6 @@ export const de_DisassociateElasticIpCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateElasticIpCommandError - */ -const de_DisassociateElasticIpCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetHostnameSuggestionCommand */ @@ -3370,7 +2092,7 @@ export const de_GetHostnameSuggestionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetHostnameSuggestionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3382,35 +2104,6 @@ export const de_GetHostnameSuggestionCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetHostnameSuggestionCommandError - */ -const de_GetHostnameSuggestionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GrantAccessCommand */ @@ -3419,7 +2112,7 @@ export const de_GrantAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GrantAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3432,43 +2125,14 @@ export const de_GrantAccessCommand = async ( }; /** - * deserializeAws_json1_1GrantAccessCommandError + * deserializeAws_json1_1ListTagsCommand */ -const de_GrantAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsCommand - */ -export const de_ListTagsCommand = async ( +export const de_ListTagsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3480,35 +2144,6 @@ export const de_ListTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsCommandError - */ -const de_ListTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RebootInstanceCommand */ @@ -3517,7 +2152,7 @@ export const de_RebootInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RebootInstanceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RebootInstanceCommandOutput = { @@ -3526,35 +2161,6 @@ export const de_RebootInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1RebootInstanceCommandError - */ -const de_RebootInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RegisterEcsClusterCommand */ @@ -3563,7 +2169,7 @@ export const de_RegisterEcsClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterEcsClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3575,35 +2181,6 @@ export const de_RegisterEcsClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1RegisterEcsClusterCommandError - */ -const de_RegisterEcsClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RegisterElasticIpCommand */ @@ -3612,7 +2189,7 @@ export const de_RegisterElasticIpCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterElasticIpCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3624,35 +2201,6 @@ export const de_RegisterElasticIpCommand = async ( return response; }; -/** - * deserializeAws_json1_1RegisterElasticIpCommandError - */ -const de_RegisterElasticIpCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RegisterInstanceCommand */ @@ -3661,7 +2209,7 @@ export const de_RegisterInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3673,35 +2221,6 @@ export const de_RegisterInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1RegisterInstanceCommandError - */ -const de_RegisterInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RegisterRdsDbInstanceCommand */ @@ -3710,7 +2229,7 @@ export const de_RegisterRdsDbInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterRdsDbInstanceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RegisterRdsDbInstanceCommandOutput = { @@ -3719,35 +2238,6 @@ export const de_RegisterRdsDbInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1RegisterRdsDbInstanceCommandError - */ -const de_RegisterRdsDbInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RegisterVolumeCommand */ @@ -3756,7 +2246,7 @@ export const de_RegisterVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterVolumeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3768,35 +2258,6 @@ export const de_RegisterVolumeCommand = async ( return response; }; -/** - * deserializeAws_json1_1RegisterVolumeCommandError - */ -const de_RegisterVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SetLoadBasedAutoScalingCommand */ @@ -3805,7 +2266,7 @@ export const de_SetLoadBasedAutoScalingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetLoadBasedAutoScalingCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SetLoadBasedAutoScalingCommandOutput = { @@ -3814,35 +2275,6 @@ export const de_SetLoadBasedAutoScalingCommand = async ( return response; }; -/** - * deserializeAws_json1_1SetLoadBasedAutoScalingCommandError - */ -const de_SetLoadBasedAutoScalingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SetPermissionCommand */ @@ -3851,7 +2283,7 @@ export const de_SetPermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetPermissionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SetPermissionCommandOutput = { @@ -3860,35 +2292,6 @@ export const de_SetPermissionCommand = async ( return response; }; -/** - * deserializeAws_json1_1SetPermissionCommandError - */ -const de_SetPermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SetTimeBasedAutoScalingCommand */ @@ -3897,7 +2300,7 @@ export const de_SetTimeBasedAutoScalingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetTimeBasedAutoScalingCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SetTimeBasedAutoScalingCommandOutput = { @@ -3906,35 +2309,6 @@ export const de_SetTimeBasedAutoScalingCommand = async ( return response; }; -/** - * deserializeAws_json1_1SetTimeBasedAutoScalingCommandError - */ -const de_SetTimeBasedAutoScalingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartInstanceCommand */ @@ -3943,7 +2317,7 @@ export const de_StartInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartInstanceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StartInstanceCommandOutput = { @@ -3952,35 +2326,6 @@ export const de_StartInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartInstanceCommandError - */ -const de_StartInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartStackCommand */ @@ -3989,7 +2334,7 @@ export const de_StartStackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartStackCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StartStackCommandOutput = { @@ -3998,35 +2343,6 @@ export const de_StartStackCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartStackCommandError - */ -const de_StartStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopInstanceCommand */ @@ -4035,7 +2351,7 @@ export const de_StopInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopInstanceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopInstanceCommandOutput = { @@ -4044,35 +2360,6 @@ export const de_StopInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopInstanceCommandError - */ -const de_StopInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopStackCommand */ @@ -4081,7 +2368,7 @@ export const de_StopStackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopStackCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopStackCommandOutput = { @@ -4090,35 +2377,6 @@ export const de_StopStackCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopStackCommandError - */ -const de_StopStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -4127,226 +2385,81 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - await collectBody(output.body, context); - const response: TagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UnassignInstanceCommand - */ -export const de_UnassignInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UnassignInstanceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UnassignInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1UnassignInstanceCommandError - */ -const de_UnassignInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UnassignVolumeCommand - */ -export const de_UnassignVolumeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UnassignVolumeCommandError(output, context); - } - await collectBody(output.body, context); - const response: UnassignVolumeCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1UnassignVolumeCommandError - */ -const de_UnassignVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1UntagResourceCommand + * deserializeAws_json1_1UnassignInstanceCommand */ -export const de_UntagResourceCommand = async ( +export const de_UnassignInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UntagResourceCommandOutput = { + const response: UnassignInstanceCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserializeAws_json1_1UnassignVolumeCommand */ -const de_UntagResourceCommandError = async ( +export const de_UnassignVolumeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UnassignVolumeCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1UpdateAppCommand + * deserializeAws_json1_1UntagResourceCommand */ -export const de_UpdateAppCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateAppCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UpdateAppCommandOutput = { + const response: UntagResourceCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1UpdateAppCommandError + * deserializeAws_json1_1UpdateAppCommand */ -const de_UpdateAppCommandError = async ( +export const de_UpdateAppCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UpdateAppCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** @@ -4357,7 +2470,7 @@ export const de_UpdateElasticIpCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateElasticIpCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateElasticIpCommandOutput = { @@ -4366,35 +2479,6 @@ export const de_UpdateElasticIpCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateElasticIpCommandError - */ -const de_UpdateElasticIpCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateInstanceCommand */ @@ -4403,7 +2487,7 @@ export const de_UpdateInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateInstanceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateInstanceCommandOutput = { @@ -4412,35 +2496,6 @@ export const de_UpdateInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateInstanceCommandError - */ -const de_UpdateInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateLayerCommand */ @@ -4449,7 +2504,7 @@ export const de_UpdateLayerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLayerCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateLayerCommandOutput = { @@ -4458,35 +2513,6 @@ export const de_UpdateLayerCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateLayerCommandError - */ -const de_UpdateLayerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateMyUserProfileCommand */ @@ -4495,7 +2521,7 @@ export const de_UpdateMyUserProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateMyUserProfileCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateMyUserProfileCommandOutput = { @@ -4504,32 +2530,6 @@ export const de_UpdateMyUserProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateMyUserProfileCommandError - */ -const de_UpdateMyUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateRdsDbInstanceCommand */ @@ -4538,7 +2538,7 @@ export const de_UpdateRdsDbInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRdsDbInstanceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateRdsDbInstanceCommandOutput = { @@ -4547,35 +2547,6 @@ export const de_UpdateRdsDbInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateRdsDbInstanceCommandError - */ -const de_UpdateRdsDbInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateStackCommand */ @@ -4584,7 +2555,7 @@ export const de_UpdateStackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateStackCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateStackCommandOutput = { @@ -4593,35 +2564,6 @@ export const de_UpdateStackCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateStackCommandError - */ -const de_UpdateStackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateUserProfileCommand */ @@ -4630,7 +2572,7 @@ export const de_UpdateUserProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateUserProfileCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateUserProfileCommandOutput = { @@ -4639,35 +2581,6 @@ export const de_UpdateUserProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateUserProfileCommandError - */ -const de_UpdateUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateVolumeCommand */ @@ -4676,7 +2589,7 @@ export const de_UpdateVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateVolumeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateVolumeCommandOutput = { @@ -4686,12 +2599,9 @@ export const de_UpdateVolumeCommand = async ( }; /** - * deserializeAws_json1_1UpdateVolumeCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4710,7 +2620,7 @@ const de_UpdateVolumeCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts b/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts index 0ac16501ed7d..0790d9054f67 100644 --- a/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts +++ b/clients/client-opsworkscm/src/protocols/Aws_json1_1.ts @@ -352,7 +352,7 @@ export const de_AssociateNodeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateNodeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -364,38 +364,6 @@ export const de_AssociateNodeCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateNodeCommandError - */ -const de_AssociateNodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidStateException": - case "com.amazonaws.opsworkscm#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateBackupCommand */ @@ -404,7 +372,7 @@ export const de_CreateBackupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBackupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -416,41 +384,6 @@ export const de_CreateBackupCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateBackupCommandError - */ -const de_CreateBackupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidStateException": - case "com.amazonaws.opsworkscm#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.opsworkscm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateServerCommand */ @@ -459,7 +392,7 @@ export const de_CreateServerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateServerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -471,41 +404,6 @@ export const de_CreateServerCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateServerCommandError - */ -const de_CreateServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededException": - case "com.amazonaws.opsworkscm#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.opsworkscm#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteBackupCommand */ @@ -514,7 +412,7 @@ export const de_DeleteBackupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteBackupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -526,38 +424,6 @@ export const de_DeleteBackupCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteBackupCommandError - */ -const de_DeleteBackupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidStateException": - case "com.amazonaws.opsworkscm#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteServerCommand */ @@ -566,7 +432,7 @@ export const de_DeleteServerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteServerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -578,38 +444,6 @@ export const de_DeleteServerCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteServerCommandError - */ -const de_DeleteServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidStateException": - case "com.amazonaws.opsworkscm#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAccountAttributesCommand */ @@ -618,7 +452,7 @@ export const de_DescribeAccountAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAccountAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -630,26 +464,6 @@ export const de_DescribeAccountAttributesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAccountAttributesCommandError - */ -const de_DescribeAccountAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribeBackupsCommand */ @@ -658,7 +472,7 @@ export const de_DescribeBackupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBackupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -670,38 +484,6 @@ export const de_DescribeBackupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeBackupsCommandError - */ -const de_DescribeBackupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.opsworkscm#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEventsCommand */ @@ -710,7 +492,7 @@ export const de_DescribeEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -722,38 +504,6 @@ export const de_DescribeEventsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEventsCommandError - */ -const de_DescribeEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.opsworkscm#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeNodeAssociationStatusCommand */ @@ -762,7 +512,7 @@ export const de_DescribeNodeAssociationStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNodeAssociationStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -770,105 +520,24 @@ export const de_DescribeNodeAssociationStatusCommand = async ( const response: DescribeNodeAssociationStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeNodeAssociationStatusCommandError - */ -const de_DescribeNodeAssociationStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeServersCommand - */ -export const de_DescribeServersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeServersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeServersResponse(data, context); - const response: DescribeServersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeServersCommandError - */ -const de_DescribeServersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.opsworkscm#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }; + return response; }; /** - * deserializeAws_json1_1DisassociateNodeCommand + * deserializeAws_json1_1DescribeServersCommand */ -export const de_DisassociateNodeCommand = async ( +export const de_DescribeServersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateNodeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DisassociateNodeCommandOutput = { + contents = de_DescribeServersResponse(data, context); + const response: DescribeServersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -876,35 +545,23 @@ export const de_DisassociateNodeCommand = async ( }; /** - * deserializeAws_json1_1DisassociateNodeCommandError + * deserializeAws_json1_1DisassociateNodeCommand */ -const de_DisassociateNodeCommandError = async ( +export const de_DisassociateNodeCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidStateException": - case "com.amazonaws.opsworkscm#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisassociateNodeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -915,7 +572,7 @@ export const de_ExportServerEngineAttributeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExportServerEngineAttributeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -927,38 +584,6 @@ export const de_ExportServerEngineAttributeCommand = async ( return response; }; -/** - * deserializeAws_json1_1ExportServerEngineAttributeCommandError - */ -const de_ExportServerEngineAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidStateException": - case "com.amazonaws.opsworkscm#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -967,7 +592,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -979,35 +604,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RestoreServerCommand */ @@ -1016,7 +612,7 @@ export const de_RestoreServerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreServerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1028,38 +624,6 @@ export const de_RestoreServerCommand = async ( return response; }; -/** - * deserializeAws_json1_1RestoreServerCommandError - */ -const de_RestoreServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidStateException": - case "com.amazonaws.opsworkscm#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartMaintenanceCommand */ @@ -1068,7 +632,7 @@ export const de_StartMaintenanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartMaintenanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1080,38 +644,6 @@ export const de_StartMaintenanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartMaintenanceCommandError - */ -const de_StartMaintenanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidStateException": - case "com.amazonaws.opsworkscm#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -1120,7 +652,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1132,38 +664,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidStateException": - case "com.amazonaws.opsworkscm#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -1172,7 +672,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1184,38 +684,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidStateException": - case "com.amazonaws.opsworkscm#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateServerCommand */ @@ -1224,7 +692,7 @@ export const de_UpdateServerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateServerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1236,38 +704,6 @@ export const de_UpdateServerCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateServerCommandError - */ -const de_UpdateServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidStateException": - case "com.amazonaws.opsworkscm#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.opsworkscm#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.opsworkscm#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateServerEngineAttributesCommand */ @@ -1276,7 +712,7 @@ export const de_UpdateServerEngineAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateServerEngineAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1289,12 +725,9 @@ export const de_UpdateServerEngineAttributesCommand = async ( }; /** - * deserializeAws_json1_1UpdateServerEngineAttributesCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateServerEngineAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1310,13 +743,22 @@ const de_UpdateServerEngineAttributesCommandError = async ( case "ValidationException": case "com.amazonaws.opsworkscm#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.opsworkscm#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.opsworkscm#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.opsworkscm#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-organizations/src/protocols/Aws_json1_1.ts b/clients/client-organizations/src/protocols/Aws_json1_1.ts index 272b1014ba94..e18d8f8d56ae 100644 --- a/clients/client-organizations/src/protocols/Aws_json1_1.ts +++ b/clients/client-organizations/src/protocols/Aws_json1_1.ts @@ -1004,7 +1004,7 @@ export const de_AcceptHandshakeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptHandshakeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1016,62 +1016,6 @@ export const de_AcceptHandshakeCommand = async ( return response; }; -/** - * deserializeAws_json1_1AcceptHandshakeCommandError - */ -const de_AcceptHandshakeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccessDeniedForDependencyException": - case "com.amazonaws.organizations#AccessDeniedForDependencyException": - throw await de_AccessDeniedForDependencyExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "HandshakeAlreadyInStateException": - case "com.amazonaws.organizations#HandshakeAlreadyInStateException": - throw await de_HandshakeAlreadyInStateExceptionRes(parsedOutput, context); - case "HandshakeConstraintViolationException": - case "com.amazonaws.organizations#HandshakeConstraintViolationException": - throw await de_HandshakeConstraintViolationExceptionRes(parsedOutput, context); - case "HandshakeNotFoundException": - case "com.amazonaws.organizations#HandshakeNotFoundException": - throw await de_HandshakeNotFoundExceptionRes(parsedOutput, context); - case "InvalidHandshakeTransitionException": - case "com.amazonaws.organizations#InvalidHandshakeTransitionException": - throw await de_InvalidHandshakeTransitionExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AttachPolicyCommand */ @@ -1080,7 +1024,7 @@ export const de_AttachPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachPolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AttachPolicyCommandOutput = { @@ -1089,68 +1033,6 @@ export const de_AttachPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1AttachPolicyCommandError - */ -const de_AttachPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "DuplicatePolicyAttachmentException": - case "com.amazonaws.organizations#DuplicatePolicyAttachmentException": - throw await de_DuplicatePolicyAttachmentExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "PolicyChangesInProgressException": - case "com.amazonaws.organizations#PolicyChangesInProgressException": - throw await de_PolicyChangesInProgressExceptionRes(parsedOutput, context); - case "PolicyNotFoundException": - case "com.amazonaws.organizations#PolicyNotFoundException": - throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); - case "PolicyTypeNotEnabledException": - case "com.amazonaws.organizations#PolicyTypeNotEnabledException": - throw await de_PolicyTypeNotEnabledExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TargetNotFoundException": - case "com.amazonaws.organizations#TargetNotFoundException": - throw await de_TargetNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelHandshakeCommand */ @@ -1159,7 +1041,7 @@ export const de_CancelHandshakeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelHandshakeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1171,53 +1053,6 @@ export const de_CancelHandshakeCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelHandshakeCommandError - */ -const de_CancelHandshakeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "HandshakeAlreadyInStateException": - case "com.amazonaws.organizations#HandshakeAlreadyInStateException": - throw await de_HandshakeAlreadyInStateExceptionRes(parsedOutput, context); - case "HandshakeNotFoundException": - case "com.amazonaws.organizations#HandshakeNotFoundException": - throw await de_HandshakeNotFoundExceptionRes(parsedOutput, context); - case "InvalidHandshakeTransitionException": - case "com.amazonaws.organizations#InvalidHandshakeTransitionException": - throw await de_InvalidHandshakeTransitionExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CloseAccountCommand */ @@ -1226,7 +1061,7 @@ export const de_CloseAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CloseAccountCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CloseAccountCommandOutput = { @@ -1235,62 +1070,6 @@ export const de_CloseAccountCommand = async ( return response; }; -/** - * deserializeAws_json1_1CloseAccountCommandError - */ -const de_CloseAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountAlreadyClosedException": - case "com.amazonaws.organizations#AccountAlreadyClosedException": - throw await de_AccountAlreadyClosedExceptionRes(parsedOutput, context); - case "AccountNotFoundException": - case "com.amazonaws.organizations#AccountNotFoundException": - throw await de_AccountNotFoundExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.organizations#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAccountCommand */ @@ -1299,7 +1078,7 @@ export const de_CreateAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1311,56 +1090,6 @@ export const de_CreateAccountCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAccountCommandError - */ -const de_CreateAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "FinalizingOrganizationException": - case "com.amazonaws.organizations#FinalizingOrganizationException": - throw await de_FinalizingOrganizationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateGovCloudAccountCommand */ @@ -1369,7 +1098,7 @@ export const de_CreateGovCloudAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateGovCloudAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1381,56 +1110,6 @@ export const de_CreateGovCloudAccountCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateGovCloudAccountCommandError - */ -const de_CreateGovCloudAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "FinalizingOrganizationException": - case "com.amazonaws.organizations#FinalizingOrganizationException": - throw await de_FinalizingOrganizationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateOrganizationCommand */ @@ -1439,7 +1118,7 @@ export const de_CreateOrganizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateOrganizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1451,53 +1130,6 @@ export const de_CreateOrganizationCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateOrganizationCommandError - */ -const de_CreateOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccessDeniedForDependencyException": - case "com.amazonaws.organizations#AccessDeniedForDependencyException": - throw await de_AccessDeniedForDependencyExceptionRes(parsedOutput, context); - case "AlreadyInOrganizationException": - case "com.amazonaws.organizations#AlreadyInOrganizationException": - throw await de_AlreadyInOrganizationExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateOrganizationalUnitCommand */ @@ -1506,7 +1138,7 @@ export const de_CreateOrganizationalUnitCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateOrganizationalUnitCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1518,56 +1150,6 @@ export const de_CreateOrganizationalUnitCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateOrganizationalUnitCommandError - */ -const de_CreateOrganizationalUnitCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "DuplicateOrganizationalUnitException": - case "com.amazonaws.organizations#DuplicateOrganizationalUnitException": - throw await de_DuplicateOrganizationalUnitExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ParentNotFoundException": - case "com.amazonaws.organizations#ParentNotFoundException": - throw await de_ParentNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePolicyCommand */ @@ -1576,7 +1158,7 @@ export const de_CreatePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1588,62 +1170,6 @@ export const de_CreatePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePolicyCommandError - */ -const de_CreatePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "DuplicatePolicyException": - case "com.amazonaws.organizations#DuplicatePolicyException": - throw await de_DuplicatePolicyExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "MalformedPolicyDocumentException": - case "com.amazonaws.organizations#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "PolicyTypeNotAvailableForOrganizationException": - case "com.amazonaws.organizations#PolicyTypeNotAvailableForOrganizationException": - throw await de_PolicyTypeNotAvailableForOrganizationExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeclineHandshakeCommand */ @@ -1652,7 +1178,7 @@ export const de_DeclineHandshakeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeclineHandshakeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1665,1766 +1191,104 @@ export const de_DeclineHandshakeCommand = async ( }; /** - * deserializeAws_json1_1DeclineHandshakeCommandError + * deserializeAws_json1_1DeleteOrganizationCommand */ -const de_DeclineHandshakeCommandError = async ( +export const de_DeleteOrganizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "HandshakeAlreadyInStateException": - case "com.amazonaws.organizations#HandshakeAlreadyInStateException": - throw await de_HandshakeAlreadyInStateExceptionRes(parsedOutput, context); - case "HandshakeNotFoundException": - case "com.amazonaws.organizations#HandshakeNotFoundException": - throw await de_HandshakeNotFoundExceptionRes(parsedOutput, context); - case "InvalidHandshakeTransitionException": - case "com.amazonaws.organizations#InvalidHandshakeTransitionException": - throw await de_InvalidHandshakeTransitionExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteOrganizationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteOrganizationCommand + * deserializeAws_json1_1DeleteOrganizationalUnitCommand */ -export const de_DeleteOrganizationCommand = async ( +export const de_DeleteOrganizationalUnitCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteOrganizationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteOrganizationCommandOutput = { + const response: DeleteOrganizationalUnitCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteOrganizationCommandError + * deserializeAws_json1_1DeletePolicyCommand */ -const de_DeleteOrganizationCommandError = async ( +export const de_DeletePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OrganizationNotEmptyException": - case "com.amazonaws.organizations#OrganizationNotEmptyException": - throw await de_OrganizationNotEmptyExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteOrganizationalUnitCommand - */ -export const de_DeleteOrganizationalUnitCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteOrganizationalUnitCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteOrganizationalUnitCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteOrganizationalUnitCommandError - */ -const de_DeleteOrganizationalUnitCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OrganizationalUnitNotEmptyException": - case "com.amazonaws.organizations#OrganizationalUnitNotEmptyException": - throw await de_OrganizationalUnitNotEmptyExceptionRes(parsedOutput, context); - case "OrganizationalUnitNotFoundException": - case "com.amazonaws.organizations#OrganizationalUnitNotFoundException": - throw await de_OrganizationalUnitNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeletePolicyCommand - */ -export const de_DeletePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeletePolicyCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeletePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeletePolicyCommandError - */ -const de_DeletePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "PolicyInUseException": - case "com.amazonaws.organizations#PolicyInUseException": - throw await de_PolicyInUseExceptionRes(parsedOutput, context); - case "PolicyNotFoundException": - case "com.amazonaws.organizations#PolicyNotFoundException": - throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteResourcePolicyCommand - */ -export const de_DeleteResourcePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteResourcePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "ResourcePolicyNotFoundException": - case "com.amazonaws.organizations#ResourcePolicyNotFoundException": - throw await de_ResourcePolicyNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeregisterDelegatedAdministratorCommand - */ -export const de_DeregisterDelegatedAdministratorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeregisterDelegatedAdministratorCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeregisterDelegatedAdministratorCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeregisterDelegatedAdministratorCommandError - */ -const de_DeregisterDelegatedAdministratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountNotFoundException": - case "com.amazonaws.organizations#AccountNotFoundException": - throw await de_AccountNotFoundExceptionRes(parsedOutput, context); - case "AccountNotRegisteredException": - case "com.amazonaws.organizations#AccountNotRegisteredException": - throw await de_AccountNotRegisteredExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAccountCommand - */ -export const de_DescribeAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAccountCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeAccountResponse(data, context); - const response: DescribeAccountCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAccountCommandError - */ -const de_DescribeAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountNotFoundException": - case "com.amazonaws.organizations#AccountNotFoundException": - throw await de_AccountNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeCreateAccountStatusCommand - */ -export const de_DescribeCreateAccountStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeCreateAccountStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeCreateAccountStatusResponse(data, context); - const response: DescribeCreateAccountStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeCreateAccountStatusCommandError - */ -const de_DescribeCreateAccountStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "CreateAccountStatusNotFoundException": - case "com.amazonaws.organizations#CreateAccountStatusNotFoundException": - throw await de_CreateAccountStatusNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeEffectivePolicyCommand - */ -export const de_DescribeEffectivePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeEffectivePolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeEffectivePolicyResponse(data, context); - const response: DescribeEffectivePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeEffectivePolicyCommandError - */ -const de_DescribeEffectivePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "EffectivePolicyNotFoundException": - case "com.amazonaws.organizations#EffectivePolicyNotFoundException": - throw await de_EffectivePolicyNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TargetNotFoundException": - case "com.amazonaws.organizations#TargetNotFoundException": - throw await de_TargetNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeHandshakeCommand - */ -export const de_DescribeHandshakeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeHandshakeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeHandshakeResponse(data, context); - const response: DescribeHandshakeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeHandshakeCommandError - */ -const de_DescribeHandshakeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "HandshakeNotFoundException": - case "com.amazonaws.organizations#HandshakeNotFoundException": - throw await de_HandshakeNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeOrganizationCommand - */ -export const de_DescribeOrganizationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeOrganizationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeOrganizationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeOrganizationCommandError - */ -const de_DescribeOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeOrganizationalUnitCommand - */ -export const de_DescribeOrganizationalUnitCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeOrganizationalUnitCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeOrganizationalUnitCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeOrganizationalUnitCommandError - */ -const de_DescribeOrganizationalUnitCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OrganizationalUnitNotFoundException": - case "com.amazonaws.organizations#OrganizationalUnitNotFoundException": - throw await de_OrganizationalUnitNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribePolicyCommand - */ -export const de_DescribePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribePolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribePolicyCommandError - */ -const de_DescribePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "PolicyNotFoundException": - case "com.amazonaws.organizations#PolicyNotFoundException": - throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeResourcePolicyCommand - */ -export const de_DescribeResourcePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeResourcePolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeResourcePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeResourcePolicyCommandError - */ -const de_DescribeResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "ResourcePolicyNotFoundException": - case "com.amazonaws.organizations#ResourcePolicyNotFoundException": - throw await de_ResourcePolicyNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetachPolicyCommand - */ -export const de_DetachPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetachPolicyCommandError(output, context); - } - await collectBody(output.body, context); - const response: DetachPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DetachPolicyCommandError - */ -const de_DetachPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "PolicyChangesInProgressException": - case "com.amazonaws.organizations#PolicyChangesInProgressException": - throw await de_PolicyChangesInProgressExceptionRes(parsedOutput, context); - case "PolicyNotAttachedException": - case "com.amazonaws.organizations#PolicyNotAttachedException": - throw await de_PolicyNotAttachedExceptionRes(parsedOutput, context); - case "PolicyNotFoundException": - case "com.amazonaws.organizations#PolicyNotFoundException": - throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TargetNotFoundException": - case "com.amazonaws.organizations#TargetNotFoundException": - throw await de_TargetNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisableAWSServiceAccessCommand - */ -export const de_DisableAWSServiceAccessCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisableAWSServiceAccessCommandError(output, context); - } - await collectBody(output.body, context); - const response: DisableAWSServiceAccessCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DisableAWSServiceAccessCommandError - */ -const de_DisableAWSServiceAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisablePolicyTypeCommand - */ -export const de_DisablePolicyTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisablePolicyTypeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DisablePolicyTypeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisablePolicyTypeCommandError - */ -const de_DisablePolicyTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "PolicyChangesInProgressException": - case "com.amazonaws.organizations#PolicyChangesInProgressException": - throw await de_PolicyChangesInProgressExceptionRes(parsedOutput, context); - case "PolicyTypeNotEnabledException": - case "com.amazonaws.organizations#PolicyTypeNotEnabledException": - throw await de_PolicyTypeNotEnabledExceptionRes(parsedOutput, context); - case "RootNotFoundException": - case "com.amazonaws.organizations#RootNotFoundException": - throw await de_RootNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1EnableAllFeaturesCommand - */ -export const de_EnableAllFeaturesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_EnableAllFeaturesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_EnableAllFeaturesResponse(data, context); - const response: EnableAllFeaturesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1EnableAllFeaturesCommandError - */ -const de_EnableAllFeaturesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "HandshakeConstraintViolationException": - case "com.amazonaws.organizations#HandshakeConstraintViolationException": - throw await de_HandshakeConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1EnableAWSServiceAccessCommand - */ -export const de_EnableAWSServiceAccessCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_EnableAWSServiceAccessCommandError(output, context); - } - await collectBody(output.body, context); - const response: EnableAWSServiceAccessCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1EnableAWSServiceAccessCommandError - */ -const de_EnableAWSServiceAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1EnablePolicyTypeCommand - */ -export const de_EnablePolicyTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_EnablePolicyTypeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: EnablePolicyTypeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1EnablePolicyTypeCommandError - */ -const de_EnablePolicyTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "PolicyChangesInProgressException": - case "com.amazonaws.organizations#PolicyChangesInProgressException": - throw await de_PolicyChangesInProgressExceptionRes(parsedOutput, context); - case "PolicyTypeAlreadyEnabledException": - case "com.amazonaws.organizations#PolicyTypeAlreadyEnabledException": - throw await de_PolicyTypeAlreadyEnabledExceptionRes(parsedOutput, context); - case "PolicyTypeNotAvailableForOrganizationException": - case "com.amazonaws.organizations#PolicyTypeNotAvailableForOrganizationException": - throw await de_PolicyTypeNotAvailableForOrganizationExceptionRes(parsedOutput, context); - case "RootNotFoundException": - case "com.amazonaws.organizations#RootNotFoundException": - throw await de_RootNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1InviteAccountToOrganizationCommand - */ -export const de_InviteAccountToOrganizationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_InviteAccountToOrganizationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_InviteAccountToOrganizationResponse(data, context); - const response: InviteAccountToOrganizationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1InviteAccountToOrganizationCommandError - */ -const de_InviteAccountToOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountOwnerNotVerifiedException": - case "com.amazonaws.organizations#AccountOwnerNotVerifiedException": - throw await de_AccountOwnerNotVerifiedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "DuplicateHandshakeException": - case "com.amazonaws.organizations#DuplicateHandshakeException": - throw await de_DuplicateHandshakeExceptionRes(parsedOutput, context); - case "FinalizingOrganizationException": - case "com.amazonaws.organizations#FinalizingOrganizationException": - throw await de_FinalizingOrganizationExceptionRes(parsedOutput, context); - case "HandshakeConstraintViolationException": - case "com.amazonaws.organizations#HandshakeConstraintViolationException": - throw await de_HandshakeConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1LeaveOrganizationCommand - */ -export const de_LeaveOrganizationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_LeaveOrganizationCommandError(output, context); - } - await collectBody(output.body, context); - const response: LeaveOrganizationCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1LeaveOrganizationCommandError - */ -const de_LeaveOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountNotFoundException": - case "com.amazonaws.organizations#AccountNotFoundException": - throw await de_AccountNotFoundExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "MasterCannotLeaveOrganizationException": - case "com.amazonaws.organizations#MasterCannotLeaveOrganizationException": - throw await de_MasterCannotLeaveOrganizationExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAccountsCommand - */ -export const de_ListAccountsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAccountsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListAccountsResponse(data, context); - const response: ListAccountsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAccountsCommandError - */ -const de_ListAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAccountsForParentCommand - */ -export const de_ListAccountsForParentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAccountsForParentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListAccountsForParentResponse(data, context); - const response: ListAccountsForParentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAccountsForParentCommandError - */ -const de_ListAccountsForParentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ParentNotFoundException": - case "com.amazonaws.organizations#ParentNotFoundException": - throw await de_ParentNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAWSServiceAccessForOrganizationCommand - */ -export const de_ListAWSServiceAccessForOrganizationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAWSServiceAccessForOrganizationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListAWSServiceAccessForOrganizationResponse(data, context); - const response: ListAWSServiceAccessForOrganizationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAWSServiceAccessForOrganizationCommandError - */ -const de_ListAWSServiceAccessForOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListChildrenCommand - */ -export const de_ListChildrenCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListChildrenCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListChildrenCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListChildrenCommandError - */ -const de_ListChildrenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ParentNotFoundException": - case "com.amazonaws.organizations#ParentNotFoundException": - throw await de_ParentNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeletePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListCreateAccountStatusCommand + * deserializeAws_json1_1DeleteResourcePolicyCommand */ -export const de_ListCreateAccountStatusCommand = async ( +export const de_DeleteResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListCreateAccountStatusCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListCreateAccountStatusResponse(data, context); - const response: ListCreateAccountStatusCommandOutput = { + await collectBody(output.body, context); + const response: DeleteResourcePolicyCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1ListCreateAccountStatusCommandError + * deserializeAws_json1_1DeregisterDelegatedAdministratorCommand */ -const de_ListCreateAccountStatusCommandError = async ( +export const de_DeregisterDelegatedAdministratorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeregisterDelegatedAdministratorCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListDelegatedAdministratorsCommand + * deserializeAws_json1_1DescribeAccountCommand */ -export const de_ListDelegatedAdministratorsCommand = async ( +export const de_DescribeAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDelegatedAdministratorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListDelegatedAdministratorsResponse(data, context); - const response: ListDelegatedAdministratorsCommandOutput = { + contents = de_DescribeAccountResponse(data, context); + const response: DescribeAccountCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3432,63 +1296,39 @@ export const de_ListDelegatedAdministratorsCommand = async ( }; /** - * deserializeAws_json1_1ListDelegatedAdministratorsCommandError + * deserializeAws_json1_1DescribeCreateAccountStatusCommand */ -const de_ListDelegatedAdministratorsCommandError = async ( +export const de_DescribeCreateAccountStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeCreateAccountStatusResponse(data, context); + const response: DescribeCreateAccountStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListDelegatedServicesForAccountCommand + * deserializeAws_json1_1DescribeEffectivePolicyCommand */ -export const de_ListDelegatedServicesForAccountCommand = async ( +export const de_DescribeEffectivePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDelegatedServicesForAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListDelegatedServicesForAccountResponse(data, context); - const response: ListDelegatedServicesForAccountCommandOutput = { + contents = de_DescribeEffectivePolicyResponse(data, context); + const response: DescribeEffectivePolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3496,69 +1336,39 @@ export const de_ListDelegatedServicesForAccountCommand = async ( }; /** - * deserializeAws_json1_1ListDelegatedServicesForAccountCommandError + * deserializeAws_json1_1DescribeHandshakeCommand */ -const de_ListDelegatedServicesForAccountCommandError = async ( +export const de_DescribeHandshakeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountNotFoundException": - case "com.amazonaws.organizations#AccountNotFoundException": - throw await de_AccountNotFoundExceptionRes(parsedOutput, context); - case "AccountNotRegisteredException": - case "com.amazonaws.organizations#AccountNotRegisteredException": - throw await de_AccountNotRegisteredExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeHandshakeResponse(data, context); + const response: DescribeHandshakeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListHandshakesForAccountCommand + * deserializeAws_json1_1DescribeOrganizationCommand */ -export const de_ListHandshakesForAccountCommand = async ( +export const de_DescribeOrganizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListHandshakesForAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListHandshakesForAccountResponse(data, context); - const response: ListHandshakesForAccountCommandOutput = { + contents = _json(data); + const response: DescribeOrganizationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3566,57 +1376,59 @@ export const de_ListHandshakesForAccountCommand = async ( }; /** - * deserializeAws_json1_1ListHandshakesForAccountCommandError + * deserializeAws_json1_1DescribeOrganizationalUnitCommand */ -const de_ListHandshakesForAccountCommandError = async ( +export const de_DescribeOrganizationalUnitCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeOrganizationalUnitCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DescribePolicyCommand + */ +export const de_DescribePolicyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListHandshakesForOrganizationCommand + * deserializeAws_json1_1DescribeResourcePolicyCommand */ -export const de_ListHandshakesForOrganizationCommand = async ( +export const de_DescribeResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListHandshakesForOrganizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListHandshakesForOrganizationResponse(data, context); - const response: ListHandshakesForOrganizationCommandOutput = { + contents = _json(data); + const response: DescribeResourcePolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3624,121 +1436,73 @@ export const de_ListHandshakesForOrganizationCommand = async ( }; /** - * deserializeAws_json1_1ListHandshakesForOrganizationCommandError + * deserializeAws_json1_1DetachPolicyCommand */ -const de_ListHandshakesForOrganizationCommandError = async ( +export const de_DetachPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DetachPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListOrganizationalUnitsForParentCommand + * deserializeAws_json1_1DisableAWSServiceAccessCommand */ -export const de_ListOrganizationalUnitsForParentCommand = async ( +export const de_DisableAWSServiceAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListOrganizationalUnitsForParentCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListOrganizationalUnitsForParentCommandOutput = { + await collectBody(output.body, context); + const response: DisableAWSServiceAccessCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1ListOrganizationalUnitsForParentCommandError + * deserializeAws_json1_1DisablePolicyTypeCommand */ -const de_ListOrganizationalUnitsForParentCommandError = async ( +export const de_DisablePolicyTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ParentNotFoundException": - case "com.amazonaws.organizations#ParentNotFoundException": - throw await de_ParentNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisablePolicyTypeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListParentsCommand + * deserializeAws_json1_1EnableAllFeaturesCommand */ -export const de_ListParentsCommand = async ( +export const de_EnableAllFeaturesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListParentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListParentsCommandOutput = { + contents = de_EnableAllFeaturesResponse(data, context); + const response: EnableAllFeaturesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3746,60 +1510,36 @@ export const de_ListParentsCommand = async ( }; /** - * deserializeAws_json1_1ListParentsCommandError + * deserializeAws_json1_1EnableAWSServiceAccessCommand */ -const de_ListParentsCommandError = async ( +export const de_EnableAWSServiceAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ChildNotFoundException": - case "com.amazonaws.organizations#ChildNotFoundException": - throw await de_ChildNotFoundExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: EnableAWSServiceAccessCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListPoliciesCommand + * deserializeAws_json1_1EnablePolicyTypeCommand */ -export const de_ListPoliciesCommand = async ( +export const de_EnablePolicyTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListPoliciesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListPoliciesCommandOutput = { + const response: EnablePolicyTypeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3807,60 +1547,19 @@ export const de_ListPoliciesCommand = async ( }; /** - * deserializeAws_json1_1ListPoliciesCommandError - */ -const de_ListPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListPoliciesForTargetCommand + * deserializeAws_json1_1InviteAccountToOrganizationCommand */ -export const de_ListPoliciesForTargetCommand = async ( +export const de_InviteAccountToOrganizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListPoliciesForTargetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListPoliciesForTargetCommandOutput = { + contents = de_InviteAccountToOrganizationResponse(data, context); + const response: InviteAccountToOrganizationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3868,63 +1567,56 @@ export const de_ListPoliciesForTargetCommand = async ( }; /** - * deserializeAws_json1_1ListPoliciesForTargetCommandError + * deserializeAws_json1_1LeaveOrganizationCommand */ -const de_ListPoliciesForTargetCommandError = async ( +export const de_LeaveOrganizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: LeaveOrganizationCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TargetNotFoundException": - case "com.amazonaws.organizations#TargetNotFoundException": - throw await de_TargetNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1ListAccountsCommand + */ +export const de_ListAccountsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListAccountsResponse(data, context); + const response: ListAccountsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListRootsCommand + * deserializeAws_json1_1ListAccountsForParentCommand */ -export const de_ListRootsCommand = async ( +export const de_ListAccountsForParentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListRootsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListRootsCommandOutput = { + contents = de_ListAccountsForParentResponse(data, context); + const response: ListAccountsForParentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3932,57 +1624,39 @@ export const de_ListRootsCommand = async ( }; /** - * deserializeAws_json1_1ListRootsCommandError + * deserializeAws_json1_1ListAWSServiceAccessForOrganizationCommand */ -const de_ListRootsCommandError = async ( +export const de_ListAWSServiceAccessForOrganizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListAWSServiceAccessForOrganizationResponse(data, context); + const response: ListAWSServiceAccessForOrganizationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1ListChildrenCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListChildrenCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + const response: ListChildrenCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3990,60 +1664,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1ListCreateAccountStatusCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListCreateAccountStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TargetNotFoundException": - case "com.amazonaws.organizations#TargetNotFoundException": - throw await de_TargetNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListCreateAccountStatusResponse(data, context); + const response: ListCreateAccountStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTargetsForPolicyCommand + * deserializeAws_json1_1ListDelegatedAdministratorsCommand */ -export const de_ListTargetsForPolicyCommand = async ( +export const de_ListDelegatedAdministratorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTargetsForPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTargetsForPolicyCommandOutput = { + contents = de_ListDelegatedAdministratorsResponse(data, context); + const response: ListDelegatedAdministratorsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4051,133 +1704,99 @@ export const de_ListTargetsForPolicyCommand = async ( }; /** - * deserializeAws_json1_1ListTargetsForPolicyCommandError + * deserializeAws_json1_1ListDelegatedServicesForAccountCommand */ -const de_ListTargetsForPolicyCommandError = async ( +export const de_ListDelegatedServicesForAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "PolicyNotFoundException": - case "com.amazonaws.organizations#PolicyNotFoundException": - throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDelegatedServicesForAccountResponse(data, context); + const response: ListDelegatedServicesForAccountCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1MoveAccountCommand + * deserializeAws_json1_1ListHandshakesForAccountCommand */ -export const de_MoveAccountCommand = async ( +export const de_ListHandshakesForAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_MoveAccountCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: MoveAccountCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListHandshakesForAccountResponse(data, context); + const response: ListHandshakesForAccountCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1MoveAccountCommandError + * deserializeAws_json1_1ListHandshakesForOrganizationCommand */ -const de_MoveAccountCommandError = async ( +export const de_ListHandshakesForOrganizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListHandshakesForOrganizationResponse(data, context); + const response: ListHandshakesForOrganizationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountNotFoundException": - case "com.amazonaws.organizations#AccountNotFoundException": - throw await de_AccountNotFoundExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "DestinationParentNotFoundException": - case "com.amazonaws.organizations#DestinationParentNotFoundException": - throw await de_DestinationParentNotFoundExceptionRes(parsedOutput, context); - case "DuplicateAccountException": - case "com.amazonaws.organizations#DuplicateAccountException": - throw await de_DuplicateAccountExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "SourceParentNotFoundException": - case "com.amazonaws.organizations#SourceParentNotFoundException": - throw await de_SourceParentNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1ListOrganizationalUnitsForParentCommand + */ +export const de_ListOrganizationalUnitsForParentCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListOrganizationalUnitsForParentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutResourcePolicyCommand + * deserializeAws_json1_1ListParentsCommand */ -export const de_PutResourcePolicyCommand = async ( +export const de_ListParentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutResourcePolicyCommandOutput = { + const response: ListParentsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4185,315 +1804,208 @@ export const de_PutResourcePolicyCommand = async ( }; /** - * deserializeAws_json1_1PutResourcePolicyCommandError + * deserializeAws_json1_1ListPoliciesCommand */ -const de_PutResourcePolicyCommandError = async ( +export const de_ListPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListPoliciesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RegisterDelegatedAdministratorCommand + * deserializeAws_json1_1ListPoliciesForTargetCommand */ -export const de_RegisterDelegatedAdministratorCommand = async ( +export const de_ListPoliciesForTargetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RegisterDelegatedAdministratorCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: RegisterDelegatedAdministratorCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListPoliciesForTargetCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1RegisterDelegatedAdministratorCommandError + * deserializeAws_json1_1ListRootsCommand */ -const de_RegisterDelegatedAdministratorCommandError = async ( +export const de_ListRootsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountAlreadyRegisteredException": - case "com.amazonaws.organizations#AccountAlreadyRegisteredException": - throw await de_AccountAlreadyRegisteredExceptionRes(parsedOutput, context); - case "AccountNotFoundException": - case "com.amazonaws.organizations#AccountNotFoundException": - throw await de_AccountNotFoundExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedAPIEndpointException": - case "com.amazonaws.organizations#UnsupportedAPIEndpointException": - throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListRootsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1RemoveAccountFromOrganizationCommand + * deserializeAws_json1_1ListTagsForResourceCommand */ -export const de_RemoveAccountFromOrganizationCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RemoveAccountFromOrganizationCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: RemoveAccountFromOrganizationCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1RemoveAccountFromOrganizationCommandError + * deserializeAws_json1_1ListTargetsForPolicyCommand */ -const de_RemoveAccountFromOrganizationCommandError = async ( +export const de_ListTargetsForPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AccountNotFoundException": - case "com.amazonaws.organizations#AccountNotFoundException": - throw await de_AccountNotFoundExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "MasterCannotLeaveOrganizationException": - case "com.amazonaws.organizations#MasterCannotLeaveOrganizationException": - throw await de_MasterCannotLeaveOrganizationExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTargetsForPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1MoveAccountCommand */ -export const de_TagResourceCommand = async ( +export const de_MoveAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: TagResourceCommandOutput = { + const response: MoveAccountCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1PutResourcePolicyCommand */ -const de_TagResourceCommandError = async ( +export const de_PutResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutResourcePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TargetNotFoundException": - case "com.amazonaws.organizations#TargetNotFoundException": - throw await de_TargetNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1RegisterDelegatedAdministratorCommand + */ +export const de_RegisterDelegatedAdministratorCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: RegisterDelegatedAdministratorCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1UntagResourceCommand + * deserializeAws_json1_1RemoveAccountFromOrganizationCommand */ -export const de_UntagResourceCommand = async ( +export const de_RemoveAccountFromOrganizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UntagResourceCommandOutput = { + const response: RemoveAccountFromOrganizationCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserializeAws_json1_1TagResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TargetNotFoundException": - case "com.amazonaws.organizations#TargetNotFoundException": - throw await de_TargetNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1UntagResourceCommand + */ +export const de_UntagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** @@ -4504,7 +2016,7 @@ export const de_UpdateOrganizationalUnitCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateOrganizationalUnitCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4516,53 +2028,6 @@ export const de_UpdateOrganizationalUnitCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateOrganizationalUnitCommandError - */ -const de_UpdateOrganizationalUnitCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSOrganizationsNotInUseException": - case "com.amazonaws.organizations#AWSOrganizationsNotInUseException": - throw await de_AWSOrganizationsNotInUseExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.organizations#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.organizations#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "DuplicateOrganizationalUnitException": - case "com.amazonaws.organizations#DuplicateOrganizationalUnitException": - throw await de_DuplicateOrganizationalUnitExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.organizations#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "OrganizationalUnitNotFoundException": - case "com.amazonaws.organizations#OrganizationalUnitNotFoundException": - throw await de_OrganizationalUnitNotFoundExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.organizations#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.organizations#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdatePolicyCommand */ @@ -4571,7 +2036,7 @@ export const de_UpdatePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4584,12 +2049,9 @@ export const de_UpdatePolicyCommand = async ( }; /** - * deserializeAws_json1_1UpdatePolicyCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdatePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4602,43 +2064,148 @@ const de_UpdatePolicyCommandError = async ( case "AccessDeniedException": case "com.amazonaws.organizations#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "AccessDeniedForDependencyException": + case "com.amazonaws.organizations#AccessDeniedForDependencyException": + throw await de_AccessDeniedForDependencyExceptionRes(parsedOutput, context); case "ConcurrentModificationException": case "com.amazonaws.organizations#ConcurrentModificationException": throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.organizations#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "DuplicatePolicyException": - case "com.amazonaws.organizations#DuplicatePolicyException": - throw await de_DuplicatePolicyExceptionRes(parsedOutput, context); + case "HandshakeAlreadyInStateException": + case "com.amazonaws.organizations#HandshakeAlreadyInStateException": + throw await de_HandshakeAlreadyInStateExceptionRes(parsedOutput, context); + case "HandshakeConstraintViolationException": + case "com.amazonaws.organizations#HandshakeConstraintViolationException": + throw await de_HandshakeConstraintViolationExceptionRes(parsedOutput, context); + case "HandshakeNotFoundException": + case "com.amazonaws.organizations#HandshakeNotFoundException": + throw await de_HandshakeNotFoundExceptionRes(parsedOutput, context); + case "InvalidHandshakeTransitionException": + case "com.amazonaws.organizations#InvalidHandshakeTransitionException": + throw await de_InvalidHandshakeTransitionExceptionRes(parsedOutput, context); case "InvalidInputException": case "com.amazonaws.organizations#InvalidInputException": throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "MalformedPolicyDocumentException": - case "com.amazonaws.organizations#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "PolicyChangesInProgressException": - case "com.amazonaws.organizations#PolicyChangesInProgressException": - throw await de_PolicyChangesInProgressExceptionRes(parsedOutput, context); - case "PolicyNotFoundException": - case "com.amazonaws.organizations#PolicyNotFoundException": - throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); case "ServiceException": case "com.amazonaws.organizations#ServiceException": throw await de_ServiceExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.organizations#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "ConstraintViolationException": + case "com.amazonaws.organizations#ConstraintViolationException": + throw await de_ConstraintViolationExceptionRes(parsedOutput, context); + case "DuplicatePolicyAttachmentException": + case "com.amazonaws.organizations#DuplicatePolicyAttachmentException": + throw await de_DuplicatePolicyAttachmentExceptionRes(parsedOutput, context); + case "PolicyChangesInProgressException": + case "com.amazonaws.organizations#PolicyChangesInProgressException": + throw await de_PolicyChangesInProgressExceptionRes(parsedOutput, context); + case "PolicyNotFoundException": + case "com.amazonaws.organizations#PolicyNotFoundException": + throw await de_PolicyNotFoundExceptionRes(parsedOutput, context); + case "PolicyTypeNotEnabledException": + case "com.amazonaws.organizations#PolicyTypeNotEnabledException": + throw await de_PolicyTypeNotEnabledExceptionRes(parsedOutput, context); + case "TargetNotFoundException": + case "com.amazonaws.organizations#TargetNotFoundException": + throw await de_TargetNotFoundExceptionRes(parsedOutput, context); case "UnsupportedAPIEndpointException": case "com.amazonaws.organizations#UnsupportedAPIEndpointException": throw await de_UnsupportedAPIEndpointExceptionRes(parsedOutput, context); + case "AccountAlreadyClosedException": + case "com.amazonaws.organizations#AccountAlreadyClosedException": + throw await de_AccountAlreadyClosedExceptionRes(parsedOutput, context); + case "AccountNotFoundException": + case "com.amazonaws.organizations#AccountNotFoundException": + throw await de_AccountNotFoundExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.organizations#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "FinalizingOrganizationException": + case "com.amazonaws.organizations#FinalizingOrganizationException": + throw await de_FinalizingOrganizationExceptionRes(parsedOutput, context); + case "AlreadyInOrganizationException": + case "com.amazonaws.organizations#AlreadyInOrganizationException": + throw await de_AlreadyInOrganizationExceptionRes(parsedOutput, context); + case "DuplicateOrganizationalUnitException": + case "com.amazonaws.organizations#DuplicateOrganizationalUnitException": + throw await de_DuplicateOrganizationalUnitExceptionRes(parsedOutput, context); + case "ParentNotFoundException": + case "com.amazonaws.organizations#ParentNotFoundException": + throw await de_ParentNotFoundExceptionRes(parsedOutput, context); + case "DuplicatePolicyException": + case "com.amazonaws.organizations#DuplicatePolicyException": + throw await de_DuplicatePolicyExceptionRes(parsedOutput, context); + case "MalformedPolicyDocumentException": + case "com.amazonaws.organizations#MalformedPolicyDocumentException": + throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); + case "PolicyTypeNotAvailableForOrganizationException": + case "com.amazonaws.organizations#PolicyTypeNotAvailableForOrganizationException": + throw await de_PolicyTypeNotAvailableForOrganizationExceptionRes(parsedOutput, context); + case "OrganizationNotEmptyException": + case "com.amazonaws.organizations#OrganizationNotEmptyException": + throw await de_OrganizationNotEmptyExceptionRes(parsedOutput, context); + case "OrganizationalUnitNotEmptyException": + case "com.amazonaws.organizations#OrganizationalUnitNotEmptyException": + throw await de_OrganizationalUnitNotEmptyExceptionRes(parsedOutput, context); + case "OrganizationalUnitNotFoundException": + case "com.amazonaws.organizations#OrganizationalUnitNotFoundException": + throw await de_OrganizationalUnitNotFoundExceptionRes(parsedOutput, context); + case "PolicyInUseException": + case "com.amazonaws.organizations#PolicyInUseException": + throw await de_PolicyInUseExceptionRes(parsedOutput, context); + case "ResourcePolicyNotFoundException": + case "com.amazonaws.organizations#ResourcePolicyNotFoundException": + throw await de_ResourcePolicyNotFoundExceptionRes(parsedOutput, context); + case "AccountNotRegisteredException": + case "com.amazonaws.organizations#AccountNotRegisteredException": + throw await de_AccountNotRegisteredExceptionRes(parsedOutput, context); + case "CreateAccountStatusNotFoundException": + case "com.amazonaws.organizations#CreateAccountStatusNotFoundException": + throw await de_CreateAccountStatusNotFoundExceptionRes(parsedOutput, context); + case "EffectivePolicyNotFoundException": + case "com.amazonaws.organizations#EffectivePolicyNotFoundException": + throw await de_EffectivePolicyNotFoundExceptionRes(parsedOutput, context); + case "PolicyNotAttachedException": + case "com.amazonaws.organizations#PolicyNotAttachedException": + throw await de_PolicyNotAttachedExceptionRes(parsedOutput, context); + case "RootNotFoundException": + case "com.amazonaws.organizations#RootNotFoundException": + throw await de_RootNotFoundExceptionRes(parsedOutput, context); + case "PolicyTypeAlreadyEnabledException": + case "com.amazonaws.organizations#PolicyTypeAlreadyEnabledException": + throw await de_PolicyTypeAlreadyEnabledExceptionRes(parsedOutput, context); + case "AccountOwnerNotVerifiedException": + case "com.amazonaws.organizations#AccountOwnerNotVerifiedException": + throw await de_AccountOwnerNotVerifiedExceptionRes(parsedOutput, context); + case "DuplicateHandshakeException": + case "com.amazonaws.organizations#DuplicateHandshakeException": + throw await de_DuplicateHandshakeExceptionRes(parsedOutput, context); + case "MasterCannotLeaveOrganizationException": + case "com.amazonaws.organizations#MasterCannotLeaveOrganizationException": + throw await de_MasterCannotLeaveOrganizationExceptionRes(parsedOutput, context); + case "ChildNotFoundException": + case "com.amazonaws.organizations#ChildNotFoundException": + throw await de_ChildNotFoundExceptionRes(parsedOutput, context); + case "DestinationParentNotFoundException": + case "com.amazonaws.organizations#DestinationParentNotFoundException": + throw await de_DestinationParentNotFoundExceptionRes(parsedOutput, context); + case "DuplicateAccountException": + case "com.amazonaws.organizations#DuplicateAccountException": + throw await de_DuplicateAccountExceptionRes(parsedOutput, context); + case "SourceParentNotFoundException": + case "com.amazonaws.organizations#SourceParentNotFoundException": + throw await de_SourceParentNotFoundExceptionRes(parsedOutput, context); + case "AccountAlreadyRegisteredException": + case "com.amazonaws.organizations#AccountAlreadyRegisteredException": + throw await de_AccountAlreadyRegisteredExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-osis/src/protocols/Aws_restJson1.ts b/clients/client-osis/src/protocols/Aws_restJson1.ts index 98535f40a0f0..21ba05203997 100644 --- a/clients/client-osis/src/protocols/Aws_restJson1.ts +++ b/clients/client-osis/src/protocols/Aws_restJson1.ts @@ -361,7 +361,7 @@ export const de_CreatePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -374,47 +374,6 @@ export const de_CreatePipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePipelineCommandError - */ -const de_CreatePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.osis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.osis#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.osis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.osis#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.osis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.osis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePipelineCommand */ @@ -423,7 +382,7 @@ export const de_DeletePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -432,44 +391,6 @@ export const de_DeletePipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePipelineCommandError - */ -const de_DeletePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.osis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.osis#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.osis#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.osis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.osis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPipelineCommand */ @@ -478,7 +399,7 @@ export const de_GetPipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -491,41 +412,6 @@ export const de_GetPipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetPipelineCommandError - */ -const de_GetPipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.osis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.osis#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.osis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.osis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPipelineBlueprintCommand */ @@ -534,7 +420,7 @@ export const de_GetPipelineBlueprintCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPipelineBlueprintCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -547,41 +433,6 @@ export const de_GetPipelineBlueprintCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetPipelineBlueprintCommandError - */ -const de_GetPipelineBlueprintCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.osis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.osis#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.osis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.osis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPipelineChangeProgressCommand */ @@ -590,7 +441,7 @@ export const de_GetPipelineChangeProgressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPipelineChangeProgressCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -603,41 +454,6 @@ export const de_GetPipelineChangeProgressCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetPipelineChangeProgressCommandError - */ -const de_GetPipelineChangeProgressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.osis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.osis#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.osis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.osis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPipelineBlueprintsCommand */ @@ -646,7 +462,7 @@ export const de_ListPipelineBlueprintsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPipelineBlueprintsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -659,41 +475,6 @@ export const de_ListPipelineBlueprintsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListPipelineBlueprintsCommandError - */ -const de_ListPipelineBlueprintsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.osis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.osis#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.osis#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.osis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPipelinesCommand */ @@ -702,7 +483,7 @@ export const de_ListPipelinesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPipelinesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -716,41 +497,6 @@ export const de_ListPipelinesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListPipelinesCommandError - */ -const de_ListPipelinesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.osis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.osis#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.osis#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.osis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -759,7 +505,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -772,41 +518,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.osis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.osis#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.osis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.osis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartPipelineCommand */ @@ -815,7 +526,7 @@ export const de_StartPipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartPipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -828,44 +539,6 @@ export const de_StartPipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartPipelineCommandError - */ -const de_StartPipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.osis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.osis#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.osis#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.osis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.osis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopPipelineCommand */ @@ -874,7 +547,7 @@ export const de_StopPipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopPipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -887,44 +560,6 @@ export const de_StopPipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopPipelineCommandError - */ -const de_StopPipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.osis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.osis#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.osis#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.osis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.osis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -933,7 +568,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -942,44 +577,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.osis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.osis#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.osis#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.osis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.osis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -988,7 +585,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -997,41 +594,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.osis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.osis#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.osis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.osis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePipelineCommand */ @@ -1040,7 +602,7 @@ export const de_UpdatePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1053,44 +615,6 @@ export const de_UpdatePipelineCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePipelineCommandError - */ -const de_UpdatePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.osis#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.osis#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.osis#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.osis#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.osis#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ValidatePipelineCommand */ @@ -1099,7 +623,7 @@ export const de_ValidatePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ValidatePipelineCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1114,12 +638,9 @@ export const de_ValidatePipelineCommand = async ( }; /** - * deserializeAws_restJson1ValidatePipelineCommandError + * deserialize_Aws_restJson1CommandError */ -const de_ValidatePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1132,16 +653,31 @@ const de_ValidatePipelineCommandError = async ( case "InternalException": case "com.amazonaws.osis#InternalException": throw await de_InternalExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.osis#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.osis#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.osis#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.osis#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.osis#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InvalidPaginationTokenException": + case "com.amazonaws.osis#InvalidPaginationTokenException": + throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-outposts/src/protocols/Aws_restJson1.ts b/clients/client-outposts/src/protocols/Aws_restJson1.ts index 2fbe9a59ecdb..133eedfd91bb 100644 --- a/clients/client-outposts/src/protocols/Aws_restJson1.ts +++ b/clients/client-outposts/src/protocols/Aws_restJson1.ts @@ -644,7 +644,7 @@ export const de_CancelOrderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelOrderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -653,44 +653,6 @@ export const de_CancelOrderCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelOrderCommandError - */ -const de_CancelOrderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.outposts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateOrderCommand */ @@ -699,7 +661,7 @@ export const de_CreateOrderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateOrderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -712,47 +674,6 @@ export const de_CreateOrderCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateOrderCommandError - */ -const de_CreateOrderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.outposts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.outposts#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateOutpostCommand */ @@ -761,7 +682,7 @@ export const de_CreateOutpostCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateOutpostCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -774,47 +695,6 @@ export const de_CreateOutpostCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateOutpostCommandError - */ -const de_CreateOutpostCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.outposts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.outposts#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSiteCommand */ @@ -823,7 +703,7 @@ export const de_CreateSiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -836,44 +716,6 @@ export const de_CreateSiteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSiteCommandError - */ -const de_CreateSiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.outposts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.outposts#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteOutpostCommand */ @@ -882,7 +724,7 @@ export const de_DeleteOutpostCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteOutpostCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -891,44 +733,6 @@ export const de_DeleteOutpostCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteOutpostCommandError - */ -const de_DeleteOutpostCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.outposts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSiteCommand */ @@ -937,7 +741,7 @@ export const de_DeleteSiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -946,44 +750,6 @@ export const de_DeleteSiteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSiteCommandError - */ -const de_DeleteSiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.outposts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCatalogItemCommand */ @@ -992,7 +758,7 @@ export const de_GetCatalogItemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCatalogItemCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1005,38 +771,6 @@ export const de_GetCatalogItemCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCatalogItemCommandError - */ -const de_GetCatalogItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConnectionCommand */ @@ -1045,7 +779,7 @@ export const de_GetConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1060,49 +794,14 @@ export const de_GetConnectionCommand = async ( }; /** - * deserializeAws_restJson1GetConnectionCommandError + * deserializeAws_restJson1GetOrderCommand */ -const de_GetConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetOrderCommand - */ -export const de_GetOrderCommand = async ( +export const de_GetOrderCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOrderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1115,38 +814,6 @@ export const de_GetOrderCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetOrderCommandError - */ -const de_GetOrderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetOutpostCommand */ @@ -1155,7 +822,7 @@ export const de_GetOutpostCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOutpostCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1168,41 +835,6 @@ export const de_GetOutpostCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetOutpostCommandError - */ -const de_GetOutpostCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetOutpostInstanceTypesCommand */ @@ -1211,7 +843,7 @@ export const de_GetOutpostInstanceTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOutpostInstanceTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1227,41 +859,6 @@ export const de_GetOutpostInstanceTypesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetOutpostInstanceTypesCommandError - */ -const de_GetOutpostInstanceTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSiteCommand */ @@ -1270,7 +867,7 @@ export const de_GetSiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1283,41 +880,6 @@ export const de_GetSiteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSiteCommandError - */ -const de_GetSiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSiteAddressCommand */ @@ -1326,7 +888,7 @@ export const de_GetSiteAddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSiteAddressCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1341,41 +903,6 @@ export const de_GetSiteAddressCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSiteAddressCommandError - */ -const de_GetSiteAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssetsCommand */ @@ -1384,7 +911,7 @@ export const de_ListAssetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1398,41 +925,6 @@ export const de_ListAssetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssetsCommandError - */ -const de_ListAssetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCatalogItemsCommand */ @@ -1441,7 +933,7 @@ export const de_ListCatalogItemsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCatalogItemsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1455,38 +947,6 @@ export const de_ListCatalogItemsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCatalogItemsCommandError - */ -const de_ListCatalogItemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListOrdersCommand */ @@ -1495,7 +955,7 @@ export const de_ListOrdersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOrdersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1509,200 +969,69 @@ export const de_ListOrdersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListOrdersCommandError - */ -const de_ListOrdersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListOutpostsCommand */ export const de_ListOutpostsCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOutpostsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Outposts: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListOutpostsCommandError - */ -const de_ListOutpostsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSitesCommand - */ -export const de_ListSitesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSitesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Sites: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSitesCommandError - */ -const de_ListSitesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Outposts: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListSitesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListSitesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: _json, + NextToken: __expectString, + Sites: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1713,7 +1042,7 @@ export const de_StartConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1727,41 +1056,6 @@ export const de_StartConnectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartConnectionCommandError - */ -const de_StartConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1770,7 +1064,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1779,38 +1073,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1819,7 +1081,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1828,38 +1090,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateOutpostCommand */ @@ -1868,7 +1098,7 @@ export const de_UpdateOutpostCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateOutpostCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1881,44 +1111,6 @@ export const de_UpdateOutpostCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateOutpostCommandError - */ -const de_UpdateOutpostCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.outposts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSiteCommand */ @@ -1927,7 +1119,7 @@ export const de_UpdateSiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1940,44 +1132,6 @@ export const de_UpdateSiteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSiteCommandError - */ -const de_UpdateSiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.outposts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSiteAddressCommand */ @@ -1986,7 +1140,7 @@ export const de_UpdateSiteAddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSiteAddressCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2000,44 +1154,6 @@ export const de_UpdateSiteAddressCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSiteAddressCommandError - */ -const de_UpdateSiteAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.outposts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.outposts#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSiteRackPhysicalPropertiesCommand */ @@ -2046,7 +1162,7 @@ export const de_UpdateSiteRackPhysicalPropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSiteRackPhysicalPropertiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2060,12 +1176,9 @@ export const de_UpdateSiteRackPhysicalPropertiesCommand = async ( }; /** - * deserializeAws_restJson1UpdateSiteRackPhysicalPropertiesCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateSiteRackPhysicalPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2087,13 +1200,16 @@ const de_UpdateSiteRackPhysicalPropertiesCommandError = async ( case "ValidationException": case "com.amazonaws.outposts#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.outposts#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-panorama/src/protocols/Aws_restJson1.ts b/clients/client-panorama/src/protocols/Aws_restJson1.ts index 9b6fdad5c995..ee438b4b843b 100644 --- a/clients/client-panorama/src/protocols/Aws_restJson1.ts +++ b/clients/client-panorama/src/protocols/Aws_restJson1.ts @@ -859,7 +859,7 @@ export const de_CreateApplicationInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateApplicationInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -872,41 +872,6 @@ export const de_CreateApplicationInstanceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApplicationInstanceCommandError - */ -const de_CreateApplicationInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.panorama#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateJobForDevicesCommand */ @@ -915,7 +880,7 @@ export const de_CreateJobForDevicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateJobForDevicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -928,44 +893,6 @@ export const de_CreateJobForDevicesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateJobForDevicesCommandError - */ -const de_CreateJobForDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateNodeFromTemplateJobCommand */ @@ -974,7 +901,7 @@ export const de_CreateNodeFromTemplateJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateNodeFromTemplateJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -987,41 +914,6 @@ export const de_CreateNodeFromTemplateJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateNodeFromTemplateJobCommandError - */ -const de_CreateNodeFromTemplateJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePackageCommand */ @@ -1030,7 +922,7 @@ export const de_CreatePackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1045,41 +937,6 @@ export const de_CreatePackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePackageCommandError - */ -const de_CreatePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePackageImportJobCommand */ @@ -1088,7 +945,7 @@ export const de_CreatePackageImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePackageImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1101,41 +958,6 @@ export const de_CreatePackageImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePackageImportJobCommandError - */ -const de_CreatePackageImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDeviceCommand */ @@ -1144,7 +966,7 @@ export const de_DeleteDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1157,44 +979,6 @@ export const de_DeleteDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDeviceCommandError - */ -const de_DeleteDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePackageCommand */ @@ -1203,7 +987,7 @@ export const de_DeletePackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1212,44 +996,6 @@ export const de_DeletePackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePackageCommandError - */ -const de_DeletePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeregisterPackageVersionCommand */ @@ -1258,7 +1004,7 @@ export const de_DeregisterPackageVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeregisterPackageVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1268,52 +1014,14 @@ export const de_DeregisterPackageVersionCommand = async ( }; /** - * deserializeAws_restJson1DeregisterPackageVersionCommandError + * deserializeAws_restJson1DescribeApplicationInstanceCommand */ -const de_DeregisterPackageVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeApplicationInstanceCommand - */ -export const de_DescribeApplicationInstanceCommand = async ( +export const de_DescribeApplicationInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeApplicationInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1340,44 +1048,6 @@ export const de_DescribeApplicationInstanceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeApplicationInstanceCommandError - */ -const de_DescribeApplicationInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeApplicationInstanceDetailsCommand */ @@ -1386,7 +1056,7 @@ export const de_DescribeApplicationInstanceDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeApplicationInstanceDetailsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1406,44 +1076,6 @@ export const de_DescribeApplicationInstanceDetailsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeApplicationInstanceDetailsCommandError - */ -const de_DescribeApplicationInstanceDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDeviceCommand */ @@ -1452,7 +1084,7 @@ export const de_DescribeDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1484,41 +1116,6 @@ export const de_DescribeDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDeviceCommandError - */ -const de_DescribeDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDeviceJobCommand */ @@ -1527,7 +1124,7 @@ export const de_DescribeDeviceJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDeviceJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1548,44 +1145,6 @@ export const de_DescribeDeviceJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDeviceJobCommandError - */ -const de_DescribeDeviceJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeNodeCommand */ @@ -1594,7 +1153,7 @@ export const de_DescribeNodeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeNodeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1620,44 +1179,6 @@ export const de_DescribeNodeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeNodeCommandError - */ -const de_DescribeNodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeNodeFromTemplateJobCommand */ @@ -1666,7 +1187,7 @@ export const de_DescribeNodeFromTemplateJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeNodeFromTemplateJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1690,41 +1211,6 @@ export const de_DescribeNodeFromTemplateJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeNodeFromTemplateJobCommandError - */ -const de_DescribeNodeFromTemplateJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribePackageCommand */ @@ -1733,7 +1219,7 @@ export const de_DescribePackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1753,44 +1239,6 @@ export const de_DescribePackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribePackageCommandError - */ -const de_DescribePackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribePackageImportJobCommand */ @@ -1799,7 +1247,7 @@ export const de_DescribePackageImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePackageImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1823,49 +1271,14 @@ export const de_DescribePackageImportJobCommand = async ( }; /** - * deserializeAws_restJson1DescribePackageImportJobCommandError - */ -const de_DescribePackageImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribePackageVersionCommand + * deserializeAws_restJson1DescribePackageVersionCommand */ export const de_DescribePackageVersionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePackageVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1887,44 +1300,6 @@ export const de_DescribePackageVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribePackageVersionCommandError - */ -const de_DescribePackageVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationInstanceDependenciesCommand */ @@ -1933,7 +1308,7 @@ export const de_ListApplicationInstanceDependenciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationInstanceDependenciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1947,35 +1322,6 @@ export const de_ListApplicationInstanceDependenciesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationInstanceDependenciesCommandError - */ -const de_ListApplicationInstanceDependenciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationInstanceNodeInstancesCommand */ @@ -1984,7 +1330,7 @@ export const de_ListApplicationInstanceNodeInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationInstanceNodeInstancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1998,35 +1344,6 @@ export const de_ListApplicationInstanceNodeInstancesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationInstanceNodeInstancesCommandError - */ -const de_ListApplicationInstanceNodeInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationInstancesCommand */ @@ -2035,7 +1352,7 @@ export const de_ListApplicationInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationInstancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2049,35 +1366,6 @@ export const de_ListApplicationInstancesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationInstancesCommandError - */ -const de_ListApplicationInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDevicesCommand */ @@ -2086,7 +1374,7 @@ export const de_ListDevicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDevicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2100,41 +1388,6 @@ export const de_ListDevicesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDevicesCommandError - */ -const de_ListDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDevicesJobsCommand */ @@ -2143,7 +1396,7 @@ export const de_ListDevicesJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDevicesJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2157,44 +1410,6 @@ export const de_ListDevicesJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDevicesJobsCommandError - */ -const de_ListDevicesJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListNodeFromTemplateJobsCommand */ @@ -2203,7 +1418,7 @@ export const de_ListNodeFromTemplateJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNodeFromTemplateJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2217,41 +1432,6 @@ export const de_ListNodeFromTemplateJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListNodeFromTemplateJobsCommandError - */ -const de_ListNodeFromTemplateJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListNodesCommand */ @@ -2260,7 +1440,7 @@ export const de_ListNodesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNodesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2274,38 +1454,6 @@ export const de_ListNodesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListNodesCommandError - */ -const de_ListNodesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPackageImportJobsCommand */ @@ -2314,7 +1462,7 @@ export const de_ListPackageImportJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPackageImportJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2322,158 +1470,53 @@ export const de_ListPackageImportJobsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { NextToken: __expectString, - PackageImportJobs: (_) => de_PackageImportJobList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPackageImportJobsCommandError - */ -const de_ListPackageImportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPackagesCommand - */ -export const de_ListPackagesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPackagesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Packages: (_) => de_PackageList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPackagesCommandError - */ -const de_ListPackagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + PackageImportJobs: (_) => de_PackageImportJobList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListPackagesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListPackagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: _json, + NextToken: __expectString, + Packages: (_) => de_PackageList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2484,7 +1527,7 @@ export const de_ProvisionDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ProvisionDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2501,44 +1544,6 @@ export const de_ProvisionDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ProvisionDeviceCommandError - */ -const de_ProvisionDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.panorama#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RegisterPackageVersionCommand */ @@ -2547,7 +1552,7 @@ export const de_RegisterPackageVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterPackageVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2556,41 +1561,6 @@ export const de_RegisterPackageVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RegisterPackageVersionCommandError - */ -const de_RegisterPackageVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RemoveApplicationInstanceCommand */ @@ -2599,7 +1569,7 @@ export const de_RemoveApplicationInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveApplicationInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2608,44 +1578,6 @@ export const de_RemoveApplicationInstanceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RemoveApplicationInstanceCommandError - */ -const de_RemoveApplicationInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SignalApplicationInstanceNodeInstancesCommand */ @@ -2654,7 +1586,7 @@ export const de_SignalApplicationInstanceNodeInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SignalApplicationInstanceNodeInstancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2667,41 +1599,6 @@ export const de_SignalApplicationInstanceNodeInstancesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SignalApplicationInstanceNodeInstancesCommandError - */ -const de_SignalApplicationInstanceNodeInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.panorama#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.panorama#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2710,7 +1607,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2719,38 +1616,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2759,7 +1624,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2768,38 +1633,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.panorama#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.panorama#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDeviceMetadataCommand */ @@ -2808,7 +1641,7 @@ export const de_UpdateDeviceMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDeviceMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2822,12 +1655,9 @@ export const de_UpdateDeviceMetadataCommand = async ( }; /** - * deserializeAws_restJson1UpdateDeviceMetadataCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateDeviceMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2837,25 +1667,28 @@ const de_UpdateDeviceMetadataCommandError = async ( case "AccessDeniedException": case "com.amazonaws.panorama#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.panorama#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.panorama#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.panorama#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.panorama#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.panorama#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.panorama#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.panorama#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-payment-cryptography-data/src/protocols/Aws_restJson1.ts b/clients/client-payment-cryptography-data/src/protocols/Aws_restJson1.ts index 9e9fa4bb9d4c..bb9480c7f917 100644 --- a/clients/client-payment-cryptography-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-payment-cryptography-data/src/protocols/Aws_restJson1.ts @@ -387,7 +387,7 @@ export const de_DecryptDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DecryptDataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -402,44 +402,6 @@ export const de_DecryptDataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DecryptDataCommandError - */ -const de_DecryptDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptographydata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptographydata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptographydata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptographydata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1EncryptDataCommand */ @@ -448,7 +410,7 @@ export const de_EncryptDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EncryptDataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -463,44 +425,6 @@ export const de_EncryptDataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1EncryptDataCommandError - */ -const de_EncryptDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptographydata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptographydata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptographydata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptographydata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GenerateCardValidationDataCommand */ @@ -509,7 +433,7 @@ export const de_GenerateCardValidationDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GenerateCardValidationDataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -524,44 +448,6 @@ export const de_GenerateCardValidationDataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GenerateCardValidationDataCommandError - */ -const de_GenerateCardValidationDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptographydata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptographydata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptographydata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptographydata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GenerateMacCommand */ @@ -570,7 +456,7 @@ export const de_GenerateMacCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GenerateMacCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -585,44 +471,6 @@ export const de_GenerateMacCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GenerateMacCommandError - */ -const de_GenerateMacCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptographydata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptographydata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptographydata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptographydata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GeneratePinDataCommand */ @@ -631,7 +479,7 @@ export const de_GeneratePinDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GeneratePinDataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -649,44 +497,6 @@ export const de_GeneratePinDataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GeneratePinDataCommandError - */ -const de_GeneratePinDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptographydata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptographydata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptographydata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptographydata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ReEncryptDataCommand */ @@ -695,7 +505,7 @@ export const de_ReEncryptDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ReEncryptDataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -710,44 +520,6 @@ export const de_ReEncryptDataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ReEncryptDataCommandError - */ -const de_ReEncryptDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptographydata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptographydata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptographydata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptographydata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TranslatePinDataCommand */ @@ -756,7 +528,7 @@ export const de_TranslatePinDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TranslatePinDataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -771,44 +543,6 @@ export const de_TranslatePinDataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TranslatePinDataCommandError - */ -const de_TranslatePinDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptographydata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptographydata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptographydata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptographydata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1VerifyAuthRequestCryptogramCommand */ @@ -817,7 +551,7 @@ export const de_VerifyAuthRequestCryptogramCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_VerifyAuthRequestCryptogramCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -832,47 +566,6 @@ export const de_VerifyAuthRequestCryptogramCommand = async ( return contents; }; -/** - * deserializeAws_restJson1VerifyAuthRequestCryptogramCommandError - */ -const de_VerifyAuthRequestCryptogramCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptographydata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptographydata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptographydata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptographydata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - case "VerificationFailedException": - case "com.amazonaws.paymentcryptographydata#VerificationFailedException": - throw await de_VerificationFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1VerifyCardValidationDataCommand */ @@ -881,7 +574,7 @@ export const de_VerifyCardValidationDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_VerifyCardValidationDataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -895,47 +588,6 @@ export const de_VerifyCardValidationDataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1VerifyCardValidationDataCommandError - */ -const de_VerifyCardValidationDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptographydata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptographydata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptographydata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptographydata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - case "VerificationFailedException": - case "com.amazonaws.paymentcryptographydata#VerificationFailedException": - throw await de_VerificationFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1VerifyMacCommand */ @@ -944,7 +596,7 @@ export const de_VerifyMacCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_VerifyMacCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -958,47 +610,6 @@ export const de_VerifyMacCommand = async ( return contents; }; -/** - * deserializeAws_restJson1VerifyMacCommandError - */ -const de_VerifyMacCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptographydata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptographydata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptographydata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptographydata#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptographydata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - case "VerificationFailedException": - case "com.amazonaws.paymentcryptographydata#VerificationFailedException": - throw await de_VerificationFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1VerifyPinDataCommand */ @@ -1007,7 +618,7 @@ export const de_VerifyPinDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_VerifyPinDataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1024,12 +635,9 @@ export const de_VerifyPinDataCommand = async ( }; /** - * deserializeAws_restJson1VerifyPinDataCommandError + * deserialize_Aws_restJson1CommandError */ -const de_VerifyPinDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1060,7 +668,7 @@ const de_VerifyPinDataCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-payment-cryptography/src/protocols/Aws_json1_0.ts b/clients/client-payment-cryptography/src/protocols/Aws_json1_0.ts index 1d414c70f816..cc15f88d6242 100644 --- a/clients/client-payment-cryptography/src/protocols/Aws_json1_0.ts +++ b/clients/client-payment-cryptography/src/protocols/Aws_json1_0.ts @@ -373,7 +373,7 @@ export const de_CreateAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -385,53 +385,6 @@ export const de_CreateAliasCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateAliasCommandError - */ -const de_CreateAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.paymentcryptography#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateKeyCommand */ @@ -440,7 +393,7 @@ export const de_CreateKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -452,53 +405,6 @@ export const de_CreateKeyCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateKeyCommandError - */ -const de_CreateKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.paymentcryptography#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteAliasCommand */ @@ -507,7 +413,7 @@ export const de_DeleteAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -519,50 +425,6 @@ export const de_DeleteAliasCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteAliasCommandError - */ -const de_DeleteAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.paymentcryptography#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteKeyCommand */ @@ -571,7 +433,7 @@ export const de_DeleteKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -583,50 +445,6 @@ export const de_DeleteKeyCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteKeyCommandError - */ -const de_DeleteKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.paymentcryptography#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ExportKeyCommand */ @@ -635,7 +453,7 @@ export const de_ExportKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExportKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -647,50 +465,6 @@ export const de_ExportKeyCommand = async ( return response; }; -/** - * deserializeAws_json1_0ExportKeyCommandError - */ -const de_ExportKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.paymentcryptography#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetAliasCommand */ @@ -699,7 +473,7 @@ export const de_GetAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -711,47 +485,6 @@ export const de_GetAliasCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetAliasCommandError - */ -const de_GetAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetKeyCommand */ @@ -760,7 +493,7 @@ export const de_GetKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -773,52 +506,14 @@ export const de_GetKeyCommand = async ( }; /** - * deserializeAws_json1_0GetKeyCommandError - */ -const de_GetKeyCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetParametersForExportCommand + * deserializeAws_json1_0GetParametersForExportCommand */ export const de_GetParametersForExportCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetParametersForExportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -830,53 +525,6 @@ export const de_GetParametersForExportCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetParametersForExportCommandError - */ -const de_GetParametersForExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.paymentcryptography#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetParametersForImportCommand */ @@ -885,7 +533,7 @@ export const de_GetParametersForImportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetParametersForImportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -897,53 +545,6 @@ export const de_GetParametersForImportCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetParametersForImportCommandError - */ -const de_GetParametersForImportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.paymentcryptography#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetPublicKeyCertificateCommand */ @@ -952,7 +553,7 @@ export const de_GetPublicKeyCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPublicKeyCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -964,47 +565,6 @@ export const de_GetPublicKeyCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetPublicKeyCertificateCommandError - */ -const de_GetPublicKeyCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ImportKeyCommand */ @@ -1013,7 +573,7 @@ export const de_ImportKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1025,53 +585,6 @@ export const de_ImportKeyCommand = async ( return response; }; -/** - * deserializeAws_json1_0ImportKeyCommandError - */ -const de_ImportKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.paymentcryptography#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListAliasesCommand */ @@ -1080,195 +593,32 @@ export const de_ListAliasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAliasesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListAliasesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListAliasesCommandError - */ -const de_ListAliasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListKeysCommand - */ -export const de_ListKeysCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListKeysCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListKeysCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListKeysCommandError - */ -const de_ListKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const response: ListAliasesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0RestoreKeyCommand + * deserializeAws_json1_0ListKeysCommand */ -export const de_RestoreKeyCommand = async ( +export const de_ListKeysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RestoreKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RestoreKeyOutput(data, context); - const response: RestoreKeyCommandOutput = { + contents = _json(data); + const response: ListKeysCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1276,66 +626,39 @@ export const de_RestoreKeyCommand = async ( }; /** - * deserializeAws_json1_0RestoreKeyCommandError + * deserializeAws_json1_0ListTagsForResourceCommand */ -const de_RestoreKeyCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.paymentcryptography#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0StartKeyUsageCommand + * deserializeAws_json1_0RestoreKeyCommand */ -export const de_StartKeyUsageCommand = async ( +export const de_RestoreKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartKeyUsageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_StartKeyUsageOutput(data, context); - const response: StartKeyUsageCommandOutput = { + contents = de_RestoreKeyOutput(data, context); + const response: RestoreKeyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1343,50 +666,23 @@ export const de_StartKeyUsageCommand = async ( }; /** - * deserializeAws_json1_0StartKeyUsageCommandError + * deserializeAws_json1_0StartKeyUsageCommand */ -const de_StartKeyUsageCommandError = async ( +export const de_StartKeyUsageCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.paymentcryptography#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StartKeyUsageOutput(data, context); + const response: StartKeyUsageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1397,7 +693,7 @@ export const de_StopKeyUsageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopKeyUsageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1409,53 +705,6 @@ export const de_StopKeyUsageCommand = async ( return response; }; -/** - * deserializeAws_json1_0StopKeyUsageCommandError - */ -const de_StopKeyUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.paymentcryptography#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TagResourceCommand */ @@ -1464,7 +713,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1476,53 +725,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.paymentcryptography#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UntagResourceCommand */ @@ -1531,7 +733,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1543,50 +745,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.paymentcryptography#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.paymentcryptography#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.paymentcryptography#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.paymentcryptography#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.paymentcryptography#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.paymentcryptography#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.paymentcryptography#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateAliasCommand */ @@ -1595,7 +753,7 @@ export const de_UpdateAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1608,12 +766,9 @@ export const de_UpdateAliasCommand = async ( }; /** - * deserializeAws_json1_0UpdateAliasCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1632,6 +787,9 @@ const de_UpdateAliasCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.paymentcryptography#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.paymentcryptography#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ServiceUnavailableException": case "com.amazonaws.paymentcryptography#ServiceUnavailableException": throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); @@ -1647,7 +805,7 @@ const de_UpdateAliasCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-pca-connector-ad/src/protocols/Aws_restJson1.ts b/clients/client-pca-connector-ad/src/protocols/Aws_restJson1.ts index 243eb416e95c..1f22897c7186 100644 --- a/clients/client-pca-connector-ad/src/protocols/Aws_restJson1.ts +++ b/clients/client-pca-connector-ad/src/protocols/Aws_restJson1.ts @@ -651,7 +651,7 @@ export const de_CreateConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -664,50 +664,6 @@ export const de_CreateConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConnectorCommandError - */ -const de_CreateConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pcaconnectorad#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pcaconnectorad#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDirectoryRegistrationCommand */ @@ -716,7 +672,7 @@ export const de_CreateDirectoryRegistrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateDirectoryRegistrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -729,47 +685,6 @@ export const de_CreateDirectoryRegistrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDirectoryRegistrationCommandError - */ -const de_CreateDirectoryRegistrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pcaconnectorad#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateServicePrincipalNameCommand */ @@ -778,7 +693,7 @@ export const de_CreateServicePrincipalNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateServicePrincipalNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -787,47 +702,6 @@ export const de_CreateServicePrincipalNameCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateServicePrincipalNameCommandError - */ -const de_CreateServicePrincipalNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pcaconnectorad#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateTemplateCommand */ @@ -836,7 +710,7 @@ export const de_CreateTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -849,50 +723,6 @@ export const de_CreateTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTemplateCommandError - */ -const de_CreateTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pcaconnectorad#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pcaconnectorad#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateTemplateGroupAccessControlEntryCommand */ @@ -901,7 +731,7 @@ export const de_CreateTemplateGroupAccessControlEntryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTemplateGroupAccessControlEntryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -910,50 +740,6 @@ export const de_CreateTemplateGroupAccessControlEntryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTemplateGroupAccessControlEntryCommandError - */ -const de_CreateTemplateGroupAccessControlEntryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pcaconnectorad#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pcaconnectorad#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteConnectorCommand */ @@ -962,7 +748,7 @@ export const de_DeleteConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -971,47 +757,6 @@ export const de_DeleteConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteConnectorCommandError - */ -const de_DeleteConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pcaconnectorad#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDirectoryRegistrationCommand */ @@ -1020,7 +765,7 @@ export const de_DeleteDirectoryRegistrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteDirectoryRegistrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1029,44 +774,6 @@ export const de_DeleteDirectoryRegistrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDirectoryRegistrationCommandError - */ -const de_DeleteDirectoryRegistrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pcaconnectorad#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteServicePrincipalNameCommand */ @@ -1075,7 +782,7 @@ export const de_DeleteServicePrincipalNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteServicePrincipalNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1084,44 +791,6 @@ export const de_DeleteServicePrincipalNameCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteServicePrincipalNameCommandError - */ -const de_DeleteServicePrincipalNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pcaconnectorad#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteTemplateCommand */ @@ -1130,112 +799,30 @@ export const de_DeleteTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); await collectBody(output.body, context); return contents; -}; - -/** - * deserializeAws_restJson1DeleteTemplateCommandError - */ -const de_DeleteTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pcaconnectorad#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteTemplateGroupAccessControlEntryCommand - */ -export const de_DeleteTemplateGroupAccessControlEntryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTemplateGroupAccessControlEntryCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteTemplateGroupAccessControlEntryCommandError - */ -const de_DeleteTemplateGroupAccessControlEntryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pcaconnectorad#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +}; + +/** + * deserializeAws_restJson1DeleteTemplateGroupAccessControlEntryCommand + */ +export const de_DeleteTemplateGroupAccessControlEntryCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -1246,7 +833,7 @@ export const de_GetConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConnectorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1259,44 +846,6 @@ export const de_GetConnectorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetConnectorCommandError - */ -const de_GetConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDirectoryRegistrationCommand */ @@ -1305,7 +854,7 @@ export const de_GetDirectoryRegistrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDirectoryRegistrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1318,44 +867,6 @@ export const de_GetDirectoryRegistrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDirectoryRegistrationCommandError - */ -const de_GetDirectoryRegistrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetServicePrincipalNameCommand */ @@ -1364,7 +875,7 @@ export const de_GetServicePrincipalNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetServicePrincipalNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1377,44 +888,6 @@ export const de_GetServicePrincipalNameCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetServicePrincipalNameCommandError - */ -const de_GetServicePrincipalNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTemplateCommand */ @@ -1423,7 +896,7 @@ export const de_GetTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1436,44 +909,6 @@ export const de_GetTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTemplateCommandError - */ -const de_GetTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTemplateGroupAccessControlEntryCommand */ @@ -1482,7 +917,7 @@ export const de_GetTemplateGroupAccessControlEntryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTemplateGroupAccessControlEntryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1495,44 +930,6 @@ export const de_GetTemplateGroupAccessControlEntryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTemplateGroupAccessControlEntryCommandError - */ -const de_GetTemplateGroupAccessControlEntryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListConnectorsCommand */ @@ -1541,7 +938,7 @@ export const de_ListConnectorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConnectorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1555,41 +952,6 @@ export const de_ListConnectorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListConnectorsCommandError - */ -const de_ListConnectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDirectoryRegistrationsCommand */ @@ -1598,7 +960,7 @@ export const de_ListDirectoryRegistrationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDirectoryRegistrationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1608,43 +970,8 @@ export const de_ListDirectoryRegistrationsCommand = async ( DirectoryRegistrations: (_) => de_DirectoryRegistrationList(_, context), NextToken: __expectString, }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDirectoryRegistrationsCommandError - */ -const de_ListDirectoryRegistrationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Object.assign(contents, doc); + return contents; }; /** @@ -1655,7 +982,7 @@ export const de_ListServicePrincipalNamesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListServicePrincipalNamesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1669,44 +996,6 @@ export const de_ListServicePrincipalNamesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListServicePrincipalNamesCommandError - */ -const de_ListServicePrincipalNamesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1715,7 +1004,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1728,44 +1017,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTemplateGroupAccessControlEntriesCommand */ @@ -1774,7 +1025,7 @@ export const de_ListTemplateGroupAccessControlEntriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTemplateGroupAccessControlEntriesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1788,44 +1039,6 @@ export const de_ListTemplateGroupAccessControlEntriesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTemplateGroupAccessControlEntriesCommandError - */ -const de_ListTemplateGroupAccessControlEntriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTemplatesCommand */ @@ -1834,7 +1047,7 @@ export const de_ListTemplatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1848,44 +1061,6 @@ export const de_ListTemplatesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTemplatesCommandError - */ -const de_ListTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1894,7 +1069,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1903,44 +1078,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1949,7 +1086,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1958,44 +1095,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTemplateCommand */ @@ -2004,7 +1103,7 @@ export const de_UpdateTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2013,47 +1112,6 @@ export const de_UpdateTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateTemplateCommandError - */ -const de_UpdateTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pcaconnectorad#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pcaconnectorad#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pcaconnectorad#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pcaconnectorad#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pcaconnectorad#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTemplateGroupAccessControlEntryCommand */ @@ -2062,7 +1120,7 @@ export const de_UpdateTemplateGroupAccessControlEntryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTemplateGroupAccessControlEntryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2072,12 +1130,9 @@ export const de_UpdateTemplateGroupAccessControlEntryCommand = async ( }; /** - * deserializeAws_restJson1UpdateTemplateGroupAccessControlEntryCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateTemplateGroupAccessControlEntryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2096,6 +1151,9 @@ const de_UpdateTemplateGroupAccessControlEntryCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.pcaconnectorad#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.pcaconnectorad#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.pcaconnectorad#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -2108,7 +1166,7 @@ const de_UpdateTemplateGroupAccessControlEntryCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-personalize-events/src/protocols/Aws_restJson1.ts b/clients/client-personalize-events/src/protocols/Aws_restJson1.ts index 92c13ac99b3d..c3f0ad87675d 100644 --- a/clients/client-personalize-events/src/protocols/Aws_restJson1.ts +++ b/clients/client-personalize-events/src/protocols/Aws_restJson1.ts @@ -164,7 +164,7 @@ export const de_PutActionInteractionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutActionInteractionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -173,38 +173,6 @@ export const de_PutActionInteractionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutActionInteractionsCommandError - */ -const de_PutActionInteractionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalizeevents#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalizeevents#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalizeevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutActionsCommand */ @@ -213,7 +181,7 @@ export const de_PutActionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutActionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -222,38 +190,6 @@ export const de_PutActionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutActionsCommandError - */ -const de_PutActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalizeevents#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalizeevents#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalizeevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutEventsCommand */ @@ -262,7 +198,7 @@ export const de_PutEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -271,32 +207,6 @@ export const de_PutEventsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutEventsCommandError - */ -const de_PutEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalizeevents#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutItemsCommand */ @@ -305,7 +215,7 @@ export const de_PutItemsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutItemsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -314,38 +224,6 @@ export const de_PutItemsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutItemsCommandError - */ -const de_PutItemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalizeevents#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalizeevents#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalizeevents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutUsersCommand */ @@ -354,7 +232,7 @@ export const de_PutUsersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutUsersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -364,12 +242,9 @@ export const de_PutUsersCommand = async ( }; /** - * deserializeAws_restJson1PutUsersCommandError + * deserialize_Aws_restJson1CommandError */ -const de_PutUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -391,7 +266,7 @@ const de_PutUsersCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts b/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts index 8efb1787e601..70c41773e067 100644 --- a/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-personalize-runtime/src/protocols/Aws_restJson1.ts @@ -130,7 +130,7 @@ export const de_GetActionRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetActionRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -144,35 +144,6 @@ export const de_GetActionRecommendationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetActionRecommendationsCommandError - */ -const de_GetActionRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalizeruntime#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalizeruntime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetPersonalizedRankingCommand */ @@ -181,7 +152,7 @@ export const de_GetPersonalizedRankingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPersonalizedRankingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -195,35 +166,6 @@ export const de_GetPersonalizedRankingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetPersonalizedRankingCommandError - */ -const de_GetPersonalizedRankingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalizeruntime#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalizeruntime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRecommendationsCommand */ @@ -232,7 +174,7 @@ export const de_GetRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -247,12 +189,9 @@ export const de_GetRecommendationsCommand = async ( }; /** - * deserializeAws_restJson1GetRecommendationsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_GetRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -271,7 +210,7 @@ const de_GetRecommendationsCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-personalize/src/protocols/Aws_json1_1.ts b/clients/client-personalize/src/protocols/Aws_json1_1.ts index 5cf3d398d832..7cdda0c5b65d 100644 --- a/clients/client-personalize/src/protocols/Aws_json1_1.ts +++ b/clients/client-personalize/src/protocols/Aws_json1_1.ts @@ -1224,7 +1224,7 @@ export const de_CreateBatchInferenceJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBatchInferenceJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1236,47 +1236,6 @@ export const de_CreateBatchInferenceJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateBatchInferenceJobCommandError - */ -const de_CreateBatchInferenceJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.personalize#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.personalize#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.personalize#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateBatchSegmentJobCommand */ @@ -1285,7 +1244,7 @@ export const de_CreateBatchSegmentJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBatchSegmentJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1297,47 +1256,6 @@ export const de_CreateBatchSegmentJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateBatchSegmentJobCommandError - */ -const de_CreateBatchSegmentJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.personalize#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.personalize#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.personalize#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateCampaignCommand */ @@ -1346,7 +1264,7 @@ export const de_CreateCampaignCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCampaignCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1358,47 +1276,6 @@ export const de_CreateCampaignCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCampaignCommandError - */ -const de_CreateCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.personalize#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.personalize#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.personalize#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDatasetCommand */ @@ -1407,7 +1284,7 @@ export const de_CreateDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDatasetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1419,47 +1296,6 @@ export const de_CreateDatasetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDatasetCommandError - */ -const de_CreateDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.personalize#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.personalize#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.personalize#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDatasetExportJobCommand */ @@ -1468,7 +1304,7 @@ export const de_CreateDatasetExportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDatasetExportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1481,60 +1317,39 @@ export const de_CreateDatasetExportJobCommand = async ( }; /** - * deserializeAws_json1_1CreateDatasetExportJobCommandError + * deserializeAws_json1_1CreateDatasetGroupCommand */ -const de_CreateDatasetExportJobCommandError = async ( +export const de_CreateDatasetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.personalize#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.personalize#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.personalize#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateDatasetGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateDatasetGroupCommand + * deserializeAws_json1_1CreateDatasetImportJobCommand */ -export const de_CreateDatasetGroupCommand = async ( +export const de_CreateDatasetImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDatasetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateDatasetGroupCommandOutput = { + const response: CreateDatasetImportJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1542,54 +1357,39 @@ export const de_CreateDatasetGroupCommand = async ( }; /** - * deserializeAws_json1_1CreateDatasetGroupCommandError + * deserializeAws_json1_1CreateEventTrackerCommand */ -const de_CreateDatasetGroupCommandError = async ( +export const de_CreateEventTrackerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.personalize#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.personalize#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.personalize#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateEventTrackerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateDatasetImportJobCommand + * deserializeAws_json1_1CreateFilterCommand */ -export const de_CreateDatasetImportJobCommand = async ( +export const de_CreateFilterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDatasetImportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateDatasetImportJobCommandOutput = { + const response: CreateFilterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1597,1501 +1397,19 @@ export const de_CreateDatasetImportJobCommand = async ( }; /** - * deserializeAws_json1_1CreateDatasetImportJobCommandError + * deserializeAws_json1_1CreateMetricAttributionCommand */ -const de_CreateDatasetImportJobCommandError = async ( +export const de_CreateMetricAttributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.personalize#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.personalize#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.personalize#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateEventTrackerCommand - */ -export const de_CreateEventTrackerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateEventTrackerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateEventTrackerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateEventTrackerCommandError - */ -const de_CreateEventTrackerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.personalize#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.personalize#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.personalize#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateFilterCommand - */ -export const de_CreateFilterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateFilterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateFilterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateFilterCommandError - */ -const de_CreateFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.personalize#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.personalize#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.personalize#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateMetricAttributionCommand - */ -export const de_CreateMetricAttributionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateMetricAttributionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateMetricAttributionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateMetricAttributionCommandError - */ -const de_CreateMetricAttributionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.personalize#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.personalize#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateRecommenderCommand - */ -export const de_CreateRecommenderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateRecommenderCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateRecommenderCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateRecommenderCommandError - */ -const de_CreateRecommenderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.personalize#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.personalize#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.personalize#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateSchemaCommand - */ -export const de_CreateSchemaCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateSchemaCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateSchemaCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateSchemaCommandError - */ -const de_CreateSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.personalize#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.personalize#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateSolutionCommand - */ -export const de_CreateSolutionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateSolutionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateSolutionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateSolutionCommandError - */ -const de_CreateSolutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.personalize#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.personalize#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.personalize#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateSolutionVersionCommand - */ -export const de_CreateSolutionVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateSolutionVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateSolutionVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateSolutionVersionCommandError - */ -const de_CreateSolutionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.personalize#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.personalize#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.personalize#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteCampaignCommand - */ -export const de_DeleteCampaignCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteCampaignCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteCampaignCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteCampaignCommandError - */ -const de_DeleteCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDatasetCommand - */ -export const de_DeleteDatasetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDatasetCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteDatasetCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDatasetCommandError - */ -const de_DeleteDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDatasetGroupCommand - */ -export const de_DeleteDatasetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDatasetGroupCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteDatasetGroupCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDatasetGroupCommandError - */ -const de_DeleteDatasetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteEventTrackerCommand - */ -export const de_DeleteEventTrackerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteEventTrackerCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteEventTrackerCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteEventTrackerCommandError - */ -const de_DeleteEventTrackerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteFilterCommand - */ -export const de_DeleteFilterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteFilterCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteFilterCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteFilterCommandError - */ -const de_DeleteFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteMetricAttributionCommand - */ -export const de_DeleteMetricAttributionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteMetricAttributionCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteMetricAttributionCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteMetricAttributionCommandError - */ -const de_DeleteMetricAttributionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteRecommenderCommand - */ -export const de_DeleteRecommenderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteRecommenderCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteRecommenderCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteRecommenderCommandError - */ -const de_DeleteRecommenderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteSchemaCommand - */ -export const de_DeleteSchemaCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteSchemaCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteSchemaCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteSchemaCommandError - */ -const de_DeleteSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteSolutionCommand - */ -export const de_DeleteSolutionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteSolutionCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteSolutionCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteSolutionCommandError - */ -const de_DeleteSolutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAlgorithmCommand - */ -export const de_DescribeAlgorithmCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAlgorithmCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeAlgorithmResponse(data, context); - const response: DescribeAlgorithmCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAlgorithmCommandError - */ -const de_DescribeAlgorithmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeBatchInferenceJobCommand - */ -export const de_DescribeBatchInferenceJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeBatchInferenceJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeBatchInferenceJobResponse(data, context); - const response: DescribeBatchInferenceJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeBatchInferenceJobCommandError - */ -const de_DescribeBatchInferenceJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeBatchSegmentJobCommand - */ -export const de_DescribeBatchSegmentJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeBatchSegmentJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeBatchSegmentJobResponse(data, context); - const response: DescribeBatchSegmentJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeBatchSegmentJobCommandError - */ -const de_DescribeBatchSegmentJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeCampaignCommand - */ -export const de_DescribeCampaignCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeCampaignCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeCampaignResponse(data, context); - const response: DescribeCampaignCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeCampaignCommandError - */ -const de_DescribeCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDatasetCommand - */ -export const de_DescribeDatasetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDatasetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeDatasetResponse(data, context); - const response: DescribeDatasetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeDatasetCommandError - */ -const de_DescribeDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDatasetExportJobCommand - */ -export const de_DescribeDatasetExportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDatasetExportJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeDatasetExportJobResponse(data, context); - const response: DescribeDatasetExportJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeDatasetExportJobCommandError - */ -const de_DescribeDatasetExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDatasetGroupCommand - */ -export const de_DescribeDatasetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDatasetGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeDatasetGroupResponse(data, context); - const response: DescribeDatasetGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeDatasetGroupCommandError - */ -const de_DescribeDatasetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDatasetImportJobCommand - */ -export const de_DescribeDatasetImportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDatasetImportJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeDatasetImportJobResponse(data, context); - const response: DescribeDatasetImportJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeDatasetImportJobCommandError - */ -const de_DescribeDatasetImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeEventTrackerCommand - */ -export const de_DescribeEventTrackerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeEventTrackerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeEventTrackerResponse(data, context); - const response: DescribeEventTrackerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeEventTrackerCommandError - */ -const de_DescribeEventTrackerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFeatureTransformationCommand - */ -export const de_DescribeFeatureTransformationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFeatureTransformationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeFeatureTransformationResponse(data, context); - const response: DescribeFeatureTransformationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFeatureTransformationCommandError - */ -const de_DescribeFeatureTransformationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeFilterCommand - */ -export const de_DescribeFilterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeFilterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeFilterResponse(data, context); - const response: DescribeFilterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeFilterCommandError - */ -const de_DescribeFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeMetricAttributionCommand - */ -export const de_DescribeMetricAttributionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeMetricAttributionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeMetricAttributionResponse(data, context); - const response: DescribeMetricAttributionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeMetricAttributionCommandError - */ -const de_DescribeMetricAttributionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeRecipeCommand - */ -export const de_DescribeRecipeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeRecipeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeRecipeResponse(data, context); - const response: DescribeRecipeCommandOutput = { + contents = _json(data); + const response: CreateMetricAttributionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3099,48 +1417,19 @@ export const de_DescribeRecipeCommand = async ( }; /** - * deserializeAws_json1_1DescribeRecipeCommandError - */ -const de_DescribeRecipeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeRecommenderCommand + * deserializeAws_json1_1CreateRecommenderCommand */ -export const de_DescribeRecommenderCommand = async ( +export const de_CreateRecommenderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeRecommenderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeRecommenderResponse(data, context); - const response: DescribeRecommenderCommandOutput = { + contents = _json(data); + const response: CreateRecommenderCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3148,48 +1437,39 @@ export const de_DescribeRecommenderCommand = async ( }; /** - * deserializeAws_json1_1DescribeRecommenderCommandError + * deserializeAws_json1_1CreateSchemaCommand */ -const de_DescribeRecommenderCommandError = async ( +export const de_CreateSchemaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateSchemaCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeSchemaCommand + * deserializeAws_json1_1CreateSolutionCommand */ -export const de_DescribeSchemaCommand = async ( +export const de_CreateSolutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeSchemaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeSchemaResponse(data, context); - const response: DescribeSchemaCommandOutput = { + contents = _json(data); + const response: CreateSolutionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3197,247 +1477,192 @@ export const de_DescribeSchemaCommand = async ( }; /** - * deserializeAws_json1_1DescribeSchemaCommandError + * deserializeAws_json1_1CreateSolutionVersionCommand */ -const de_DescribeSchemaCommandError = async ( +export const de_CreateSolutionVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateSolutionVersionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeSolutionCommand + * deserializeAws_json1_1DeleteCampaignCommand */ -export const de_DescribeSolutionCommand = async ( +export const de_DeleteCampaignCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeSolutionCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeSolutionResponse(data, context); - const response: DescribeSolutionCommandOutput = { + await collectBody(output.body, context); + const response: DeleteCampaignCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1DescribeSolutionCommandError + * deserializeAws_json1_1DeleteDatasetCommand */ -const de_DescribeSolutionCommandError = async ( +export const de_DeleteDatasetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteDatasetCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DescribeSolutionVersionCommand + * deserializeAws_json1_1DeleteDatasetGroupCommand */ -export const de_DescribeSolutionVersionCommand = async ( +export const de_DeleteDatasetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeSolutionVersionCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeSolutionVersionResponse(data, context); - const response: DescribeSolutionVersionCommandOutput = { + await collectBody(output.body, context); + const response: DeleteDatasetGroupCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1DescribeSolutionVersionCommandError + * deserializeAws_json1_1DeleteEventTrackerCommand */ -const de_DescribeSolutionVersionCommandError = async ( +export const de_DeleteEventTrackerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteEventTrackerCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1GetSolutionMetricsCommand + * deserializeAws_json1_1DeleteFilterCommand */ -export const de_GetSolutionMetricsCommand = async ( +export const de_DeleteFilterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetSolutionMetricsCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetSolutionMetricsResponse(data, context); - const response: GetSolutionMetricsCommandOutput = { + await collectBody(output.body, context); + const response: DeleteFilterCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1GetSolutionMetricsCommandError + * deserializeAws_json1_1DeleteMetricAttributionCommand */ -const de_GetSolutionMetricsCommandError = async ( +export const de_DeleteMetricAttributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteMetricAttributionCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListBatchInferenceJobsCommand + * deserializeAws_json1_1DeleteRecommenderCommand */ -export const de_ListBatchInferenceJobsCommand = async ( +export const de_DeleteRecommenderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListBatchInferenceJobsCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListBatchInferenceJobsResponse(data, context); - const response: ListBatchInferenceJobsCommandOutput = { + await collectBody(output.body, context); + const response: DeleteRecommenderCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1ListBatchInferenceJobsCommandError + * deserializeAws_json1_1DeleteSchemaCommand */ -const de_ListBatchInferenceJobsCommandError = async ( +export const de_DeleteSchemaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeleteSchemaCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DeleteSolutionCommand + */ +export const de_DeleteSolutionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteSolutionCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListBatchSegmentJobsCommand + * deserializeAws_json1_1DescribeAlgorithmCommand */ -export const de_ListBatchSegmentJobsCommand = async ( +export const de_DescribeAlgorithmCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListBatchSegmentJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListBatchSegmentJobsResponse(data, context); - const response: ListBatchSegmentJobsCommandOutput = { + contents = de_DescribeAlgorithmResponse(data, context); + const response: DescribeAlgorithmCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3445,48 +1670,39 @@ export const de_ListBatchSegmentJobsCommand = async ( }; /** - * deserializeAws_json1_1ListBatchSegmentJobsCommandError + * deserializeAws_json1_1DescribeBatchInferenceJobCommand */ -const de_ListBatchSegmentJobsCommandError = async ( +export const de_DescribeBatchInferenceJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeBatchInferenceJobResponse(data, context); + const response: DescribeBatchInferenceJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListCampaignsCommand + * deserializeAws_json1_1DescribeBatchSegmentJobCommand */ -export const de_ListCampaignsCommand = async ( +export const de_DescribeBatchSegmentJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListCampaignsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListCampaignsResponse(data, context); - const response: ListCampaignsCommandOutput = { + contents = de_DescribeBatchSegmentJobResponse(data, context); + const response: DescribeBatchSegmentJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3494,48 +1710,39 @@ export const de_ListCampaignsCommand = async ( }; /** - * deserializeAws_json1_1ListCampaignsCommandError + * deserializeAws_json1_1DescribeCampaignCommand */ -const de_ListCampaignsCommandError = async ( +export const de_DescribeCampaignCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeCampaignResponse(data, context); + const response: DescribeCampaignCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListDatasetExportJobsCommand + * deserializeAws_json1_1DescribeDatasetCommand */ -export const de_ListDatasetExportJobsCommand = async ( +export const de_DescribeDatasetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDatasetExportJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListDatasetExportJobsResponse(data, context); - const response: ListDatasetExportJobsCommandOutput = { + contents = de_DescribeDatasetResponse(data, context); + const response: DescribeDatasetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3543,48 +1750,39 @@ export const de_ListDatasetExportJobsCommand = async ( }; /** - * deserializeAws_json1_1ListDatasetExportJobsCommandError + * deserializeAws_json1_1DescribeDatasetExportJobCommand */ -const de_ListDatasetExportJobsCommandError = async ( +export const de_DescribeDatasetExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDatasetExportJobResponse(data, context); + const response: DescribeDatasetExportJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListDatasetGroupsCommand + * deserializeAws_json1_1DescribeDatasetGroupCommand */ -export const de_ListDatasetGroupsCommand = async ( +export const de_DescribeDatasetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDatasetGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListDatasetGroupsResponse(data, context); - const response: ListDatasetGroupsCommandOutput = { + contents = de_DescribeDatasetGroupResponse(data, context); + const response: DescribeDatasetGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3592,45 +1790,39 @@ export const de_ListDatasetGroupsCommand = async ( }; /** - * deserializeAws_json1_1ListDatasetGroupsCommandError + * deserializeAws_json1_1DescribeDatasetImportJobCommand */ -const de_ListDatasetGroupsCommandError = async ( +export const de_DescribeDatasetImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDatasetImportJobResponse(data, context); + const response: DescribeDatasetImportJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListDatasetImportJobsCommand + * deserializeAws_json1_1DescribeEventTrackerCommand */ -export const de_ListDatasetImportJobsCommand = async ( +export const de_DescribeEventTrackerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDatasetImportJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListDatasetImportJobsResponse(data, context); - const response: ListDatasetImportJobsCommandOutput = { + contents = de_DescribeEventTrackerResponse(data, context); + const response: DescribeEventTrackerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3638,48 +1830,39 @@ export const de_ListDatasetImportJobsCommand = async ( }; /** - * deserializeAws_json1_1ListDatasetImportJobsCommandError + * deserializeAws_json1_1DescribeFeatureTransformationCommand */ -const de_ListDatasetImportJobsCommandError = async ( +export const de_DescribeFeatureTransformationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeFeatureTransformationResponse(data, context); + const response: DescribeFeatureTransformationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListDatasetsCommand + * deserializeAws_json1_1DescribeFilterCommand */ -export const de_ListDatasetsCommand = async ( +export const de_DescribeFilterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDatasetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListDatasetsResponse(data, context); - const response: ListDatasetsCommandOutput = { + contents = de_DescribeFilterResponse(data, context); + const response: DescribeFilterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3687,48 +1870,39 @@ export const de_ListDatasetsCommand = async ( }; /** - * deserializeAws_json1_1ListDatasetsCommandError + * deserializeAws_json1_1DescribeMetricAttributionCommand */ -const de_ListDatasetsCommandError = async ( +export const de_DescribeMetricAttributionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeMetricAttributionResponse(data, context); + const response: DescribeMetricAttributionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListEventTrackersCommand + * deserializeAws_json1_1DescribeRecipeCommand */ -export const de_ListEventTrackersCommand = async ( +export const de_DescribeRecipeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListEventTrackersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListEventTrackersResponse(data, context); - const response: ListEventTrackersCommandOutput = { + contents = de_DescribeRecipeResponse(data, context); + const response: DescribeRecipeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3736,48 +1910,39 @@ export const de_ListEventTrackersCommand = async ( }; /** - * deserializeAws_json1_1ListEventTrackersCommandError + * deserializeAws_json1_1DescribeRecommenderCommand */ -const de_ListEventTrackersCommandError = async ( +export const de_DescribeRecommenderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeRecommenderResponse(data, context); + const response: DescribeRecommenderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListFiltersCommand + * deserializeAws_json1_1DescribeSchemaCommand */ -export const de_ListFiltersCommand = async ( +export const de_DescribeSchemaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListFiltersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListFiltersResponse(data, context); - const response: ListFiltersCommandOutput = { + contents = de_DescribeSchemaResponse(data, context); + const response: DescribeSchemaCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3785,48 +1950,39 @@ export const de_ListFiltersCommand = async ( }; /** - * deserializeAws_json1_1ListFiltersCommandError + * deserializeAws_json1_1DescribeSolutionCommand */ -const de_ListFiltersCommandError = async ( +export const de_DescribeSolutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeSolutionResponse(data, context); + const response: DescribeSolutionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListMetricAttributionMetricsCommand + * deserializeAws_json1_1DescribeSolutionVersionCommand */ -export const de_ListMetricAttributionMetricsCommand = async ( +export const de_DescribeSolutionVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListMetricAttributionMetricsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListMetricAttributionMetricsCommandOutput = { + contents = de_DescribeSolutionVersionResponse(data, context); + const response: DescribeSolutionVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3834,48 +1990,39 @@ export const de_ListMetricAttributionMetricsCommand = async ( }; /** - * deserializeAws_json1_1ListMetricAttributionMetricsCommandError + * deserializeAws_json1_1GetSolutionMetricsCommand */ -const de_ListMetricAttributionMetricsCommandError = async ( +export const de_GetSolutionMetricsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetSolutionMetricsResponse(data, context); + const response: GetSolutionMetricsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListMetricAttributionsCommand + * deserializeAws_json1_1ListBatchInferenceJobsCommand */ -export const de_ListMetricAttributionsCommand = async ( +export const de_ListBatchInferenceJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListMetricAttributionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListMetricAttributionsResponse(data, context); - const response: ListMetricAttributionsCommandOutput = { + contents = de_ListBatchInferenceJobsResponse(data, context); + const response: ListBatchInferenceJobsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3883,48 +2030,39 @@ export const de_ListMetricAttributionsCommand = async ( }; /** - * deserializeAws_json1_1ListMetricAttributionsCommandError + * deserializeAws_json1_1ListBatchSegmentJobsCommand */ -const de_ListMetricAttributionsCommandError = async ( +export const de_ListBatchSegmentJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListBatchSegmentJobsResponse(data, context); + const response: ListBatchSegmentJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListRecipesCommand + * deserializeAws_json1_1ListCampaignsCommand */ -export const de_ListRecipesCommand = async ( +export const de_ListCampaignsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListRecipesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListRecipesResponse(data, context); - const response: ListRecipesCommandOutput = { + contents = de_ListCampaignsResponse(data, context); + const response: ListCampaignsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3932,48 +2070,59 @@ export const de_ListRecipesCommand = async ( }; /** - * deserializeAws_json1_1ListRecipesCommandError + * deserializeAws_json1_1ListDatasetExportJobsCommand */ -const de_ListRecipesCommandError = async ( +export const de_ListDatasetExportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDatasetExportJobsResponse(data, context); + const response: ListDatasetExportJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1ListDatasetGroupsCommand + */ +export const de_ListDatasetGroupsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDatasetGroupsResponse(data, context); + const response: ListDatasetGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListRecommendersCommand + * deserializeAws_json1_1ListDatasetImportJobsCommand */ -export const de_ListRecommendersCommand = async ( +export const de_ListDatasetImportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListRecommendersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListRecommendersResponse(data, context); - const response: ListRecommendersCommandOutput = { + contents = de_ListDatasetImportJobsResponse(data, context); + const response: ListDatasetImportJobsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3981,48 +2130,39 @@ export const de_ListRecommendersCommand = async ( }; /** - * deserializeAws_json1_1ListRecommendersCommandError + * deserializeAws_json1_1ListDatasetsCommand */ -const de_ListRecommendersCommandError = async ( +export const de_ListDatasetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDatasetsResponse(data, context); + const response: ListDatasetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListSchemasCommand + * deserializeAws_json1_1ListEventTrackersCommand */ -export const de_ListSchemasCommand = async ( +export const de_ListEventTrackersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSchemasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListSchemasResponse(data, context); - const response: ListSchemasCommandOutput = { + contents = de_ListEventTrackersResponse(data, context); + const response: ListEventTrackersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4030,45 +2170,39 @@ export const de_ListSchemasCommand = async ( }; /** - * deserializeAws_json1_1ListSchemasCommandError + * deserializeAws_json1_1ListFiltersCommand */ -const de_ListSchemasCommandError = async ( +export const de_ListFiltersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListFiltersResponse(data, context); + const response: ListFiltersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListSolutionsCommand + * deserializeAws_json1_1ListMetricAttributionMetricsCommand */ -export const de_ListSolutionsCommand = async ( +export const de_ListMetricAttributionMetricsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSolutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListSolutionsResponse(data, context); - const response: ListSolutionsCommandOutput = { + contents = _json(data); + const response: ListMetricAttributionMetricsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4076,48 +2210,39 @@ export const de_ListSolutionsCommand = async ( }; /** - * deserializeAws_json1_1ListSolutionsCommandError + * deserializeAws_json1_1ListMetricAttributionsCommand */ -const de_ListSolutionsCommandError = async ( +export const de_ListMetricAttributionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListMetricAttributionsResponse(data, context); + const response: ListMetricAttributionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListSolutionVersionsCommand + * deserializeAws_json1_1ListRecipesCommand */ -export const de_ListSolutionVersionsCommand = async ( +export const de_ListRecipesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSolutionVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListSolutionVersionsResponse(data, context); - const response: ListSolutionVersionsCommandOutput = { + contents = de_ListRecipesResponse(data, context); + const response: ListRecipesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4125,51 +2250,39 @@ export const de_ListSolutionVersionsCommand = async ( }; /** - * deserializeAws_json1_1ListSolutionVersionsCommandError + * deserializeAws_json1_1ListRecommendersCommand */ -const de_ListSolutionVersionsCommandError = async ( +export const de_ListRecommendersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.personalize#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListRecommendersResponse(data, context); + const response: ListRecommendersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1ListSchemasCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListSchemasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_ListSchemasResponse(data, context); + const response: ListSchemasCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4177,51 +2290,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1ListSolutionsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListSolutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListSolutionsResponse(data, context); + const response: ListSolutionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartRecommenderCommand + * deserializeAws_json1_1ListSolutionVersionsCommand */ -export const de_StartRecommenderCommand = async ( +export const de_ListSolutionVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartRecommenderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartRecommenderCommandOutput = { + contents = de_ListSolutionVersionsResponse(data, context); + const response: ListSolutionVersionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4229,51 +2330,39 @@ export const de_StartRecommenderCommand = async ( }; /** - * deserializeAws_json1_1StartRecommenderCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_StartRecommenderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_ListTagsForResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopRecommenderCommand + * deserializeAws_json1_1StartRecommenderCommand */ -export const de_StopRecommenderCommand = async ( +export const de_StartRecommenderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopRecommenderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopRecommenderCommandOutput = { + const response: StartRecommenderCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4281,35 +2370,23 @@ export const de_StopRecommenderCommand = async ( }; /** - * deserializeAws_json1_1StopRecommenderCommandError + * deserializeAws_json1_1StopRecommenderCommand */ -const de_StopRecommenderCommandError = async ( +export const de_StopRecommenderCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StopRecommenderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -4320,7 +2397,7 @@ export const de_StopSolutionVersionCreationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopSolutionVersionCreationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopSolutionVersionCreationCommandOutput = { @@ -4329,38 +2406,6 @@ export const de_StopSolutionVersionCreationCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopSolutionVersionCreationCommandError - */ -const de_StopSolutionVersionCreationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -4369,7 +2414,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4381,44 +2426,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.personalize#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.personalize#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -4427,7 +2434,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4439,41 +2446,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagKeysException": - case "com.amazonaws.personalize#TooManyTagKeysException": - throw await de_TooManyTagKeysExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateCampaignCommand */ @@ -4482,7 +2454,7 @@ export const de_UpdateCampaignCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateCampaignCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4494,38 +2466,6 @@ export const de_UpdateCampaignCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateCampaignCommandError - */ -const de_UpdateCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDatasetCommand */ @@ -4534,7 +2474,7 @@ export const de_UpdateDatasetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDatasetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4546,38 +2486,6 @@ export const de_UpdateDatasetCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDatasetCommandError - */ -const de_UpdateDatasetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateMetricAttributionCommand */ @@ -4586,7 +2494,7 @@ export const de_UpdateMetricAttributionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateMetricAttributionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4598,41 +2506,6 @@ export const de_UpdateMetricAttributionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateMetricAttributionCommandError - */ -const de_UpdateMetricAttributionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInputException": - case "com.amazonaws.personalize#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.personalize#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.personalize#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.personalize#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateRecommenderCommand */ @@ -4641,7 +2514,7 @@ export const de_UpdateRecommenderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRecommenderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4654,12 +2527,9 @@ export const de_UpdateRecommenderCommand = async ( }; /** - * deserializeAws_json1_1UpdateRecommenderCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateRecommenderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4669,19 +2539,34 @@ const de_UpdateRecommenderCommandError = async ( case "InvalidInputException": case "com.amazonaws.personalize#InvalidInputException": throw await de_InvalidInputExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.personalize#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.personalize#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); case "ResourceInUseException": case "com.amazonaws.personalize#ResourceInUseException": throw await de_ResourceInUseExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.personalize#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.personalize#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.personalize#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "TooManyTagKeysException": + case "com.amazonaws.personalize#TooManyTagKeysException": + throw await de_TooManyTagKeysExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-pi/src/protocols/Aws_json1_1.ts b/clients/client-pi/src/protocols/Aws_json1_1.ts index f339d7875705..20e93d5ea891 100644 --- a/clients/client-pi/src/protocols/Aws_json1_1.ts +++ b/clients/client-pi/src/protocols/Aws_json1_1.ts @@ -274,7 +274,7 @@ export const de_CreatePerformanceAnalysisReportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePerformanceAnalysisReportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -286,38 +286,6 @@ export const de_CreatePerformanceAnalysisReportCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePerformanceAnalysisReportCommandError - */ -const de_CreatePerformanceAnalysisReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.pi#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.pi#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.pi#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeletePerformanceAnalysisReportCommand */ @@ -326,7 +294,7 @@ export const de_DeletePerformanceAnalysisReportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePerformanceAnalysisReportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -338,38 +306,6 @@ export const de_DeletePerformanceAnalysisReportCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeletePerformanceAnalysisReportCommandError - */ -const de_DeletePerformanceAnalysisReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.pi#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.pi#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.pi#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeDimensionKeysCommand */ @@ -378,7 +314,7 @@ export const de_DescribeDimensionKeysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDimensionKeysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -390,38 +326,6 @@ export const de_DescribeDimensionKeysCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDimensionKeysCommandError - */ -const de_DescribeDimensionKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.pi#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.pi#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.pi#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetDimensionKeyDetailsCommand */ @@ -430,7 +334,7 @@ export const de_GetDimensionKeyDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDimensionKeyDetailsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -442,38 +346,6 @@ export const de_GetDimensionKeyDetailsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetDimensionKeyDetailsCommandError - */ -const de_GetDimensionKeyDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.pi#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.pi#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.pi#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetPerformanceAnalysisReportCommand */ @@ -482,7 +354,7 @@ export const de_GetPerformanceAnalysisReportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPerformanceAnalysisReportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -494,38 +366,6 @@ export const de_GetPerformanceAnalysisReportCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetPerformanceAnalysisReportCommandError - */ -const de_GetPerformanceAnalysisReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.pi#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.pi#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.pi#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetResourceMetadataCommand */ @@ -534,7 +374,7 @@ export const de_GetResourceMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetResourceMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -546,38 +386,6 @@ export const de_GetResourceMetadataCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetResourceMetadataCommandError - */ -const de_GetResourceMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.pi#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.pi#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.pi#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetResourceMetricsCommand */ @@ -586,7 +394,7 @@ export const de_GetResourceMetricsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetResourceMetricsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -598,38 +406,6 @@ export const de_GetResourceMetricsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetResourceMetricsCommandError - */ -const de_GetResourceMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.pi#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.pi#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.pi#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAvailableResourceDimensionsCommand */ @@ -638,7 +414,7 @@ export const de_ListAvailableResourceDimensionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAvailableResourceDimensionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -650,38 +426,6 @@ export const de_ListAvailableResourceDimensionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAvailableResourceDimensionsCommandError - */ -const de_ListAvailableResourceDimensionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.pi#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.pi#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.pi#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAvailableResourceMetricsCommand */ @@ -690,7 +434,7 @@ export const de_ListAvailableResourceMetricsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAvailableResourceMetricsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -702,38 +446,6 @@ export const de_ListAvailableResourceMetricsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAvailableResourceMetricsCommandError - */ -const de_ListAvailableResourceMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.pi#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.pi#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.pi#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPerformanceAnalysisReportsCommand */ @@ -742,7 +454,7 @@ export const de_ListPerformanceAnalysisReportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPerformanceAnalysisReportsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -754,38 +466,6 @@ export const de_ListPerformanceAnalysisReportsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPerformanceAnalysisReportsCommandError - */ -const de_ListPerformanceAnalysisReportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.pi#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.pi#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.pi#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -794,7 +474,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -806,38 +486,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.pi#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.pi#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.pi#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -846,7 +494,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -858,38 +506,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.pi#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.pi#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.pi#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -898,7 +514,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -911,12 +527,9 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -938,7 +551,7 @@ const de_UntagResourceCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts b/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts index e788fcce61d9..ee59edafed00 100644 --- a/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts +++ b/clients/client-pinpoint-email/src/protocols/Aws_restJson1.ts @@ -1106,7 +1106,7 @@ export const de_CreateConfigurationSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConfigurationSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1115,47 +1115,6 @@ export const de_CreateConfigurationSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConfigurationSetCommandError - */ -const de_CreateConfigurationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.pinpointemail#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.pinpointemail#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.pinpointemail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConfigurationSetEventDestinationCommand */ @@ -1164,7 +1123,7 @@ export const de_CreateConfigurationSetEventDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConfigurationSetEventDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1173,44 +1132,6 @@ export const de_CreateConfigurationSetEventDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConfigurationSetEventDestinationCommandError - */ -const de_CreateConfigurationSetEventDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.pinpointemail#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.pinpointemail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDedicatedIpPoolCommand */ @@ -1219,7 +1140,7 @@ export const de_CreateDedicatedIpPoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDedicatedIpPoolCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1228,44 +1149,6 @@ export const de_CreateDedicatedIpPoolCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDedicatedIpPoolCommandError - */ -const de_CreateDedicatedIpPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.pinpointemail#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.pinpointemail#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.pinpointemail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDeliverabilityTestReportCommand */ @@ -1274,7 +1157,7 @@ export const de_CreateDeliverabilityTestReportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDeliverabilityTestReportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1288,56 +1171,6 @@ export const de_CreateDeliverabilityTestReportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDeliverabilityTestReportCommandError - */ -const de_CreateDeliverabilityTestReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountSuspendedException": - case "com.amazonaws.pinpointemail#AccountSuspendedException": - throw await de_AccountSuspendedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.pinpointemail#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.pinpointemail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MailFromDomainNotVerifiedException": - case "com.amazonaws.pinpointemail#MailFromDomainNotVerifiedException": - throw await de_MailFromDomainNotVerifiedExceptionRes(parsedOutput, context); - case "MessageRejected": - case "com.amazonaws.pinpointemail#MessageRejected": - throw await de_MessageRejectedRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "SendingPausedException": - case "com.amazonaws.pinpointemail#SendingPausedException": - throw await de_SendingPausedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateEmailIdentityCommand */ @@ -1346,7 +1179,7 @@ export const de_CreateEmailIdentityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEmailIdentityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1361,41 +1194,6 @@ export const de_CreateEmailIdentityCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEmailIdentityCommandError - */ -const de_CreateEmailIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.pinpointemail#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.pinpointemail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteConfigurationSetCommand */ @@ -1404,7 +1202,7 @@ export const de_DeleteConfigurationSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConfigurationSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1413,41 +1211,6 @@ export const de_DeleteConfigurationSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteConfigurationSetCommandError - */ -const de_DeleteConfigurationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.pinpointemail#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommand */ @@ -1456,7 +1219,7 @@ export const de_DeleteConfigurationSetEventDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConfigurationSetEventDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1466,46 +1229,31 @@ export const de_DeleteConfigurationSetEventDestinationCommand = async ( }; /** - * deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommandError + * deserializeAws_restJson1DeleteDedicatedIpPoolCommand */ -const de_DeleteConfigurationSetEventDestinationCommandError = async ( +export const de_DeleteDedicatedIpPoolCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteDedicatedIpPoolCommand + * deserializeAws_restJson1DeleteEmailIdentityCommand */ -export const de_DeleteDedicatedIpPoolCommand = async ( +export const de_DeleteEmailIdentityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDedicatedIpPoolCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1514,93 +1262,6 @@ export const de_DeleteDedicatedIpPoolCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDedicatedIpPoolCommandError - */ -const de_DeleteDedicatedIpPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.pinpointemail#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteEmailIdentityCommand - */ -export const de_DeleteEmailIdentityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEmailIdentityCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteEmailIdentityCommandError - */ -const de_DeleteEmailIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.pinpointemail#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAccountCommand */ @@ -1609,7 +1270,7 @@ export const de_GetAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1626,35 +1287,6 @@ export const de_GetAccountCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAccountCommandError - */ -const de_GetAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBlacklistReportsCommand */ @@ -1663,7 +1295,7 @@ export const de_GetBlacklistReportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBlacklistReportsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1676,38 +1308,6 @@ export const de_GetBlacklistReportsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBlacklistReportsCommandError - */ -const de_GetBlacklistReportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConfigurationSetCommand */ @@ -1716,7 +1316,7 @@ export const de_GetConfigurationSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfigurationSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1734,38 +1334,6 @@ export const de_GetConfigurationSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetConfigurationSetCommandError - */ -const de_GetConfigurationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConfigurationSetEventDestinationsCommand */ @@ -1774,7 +1342,7 @@ export const de_GetConfigurationSetEventDestinationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfigurationSetEventDestinationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1787,38 +1355,6 @@ export const de_GetConfigurationSetEventDestinationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetConfigurationSetEventDestinationsCommandError - */ -const de_GetConfigurationSetEventDestinationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDedicatedIpCommand */ @@ -1827,7 +1363,7 @@ export const de_GetDedicatedIpCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDedicatedIpCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1840,38 +1376,6 @@ export const de_GetDedicatedIpCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDedicatedIpCommandError - */ -const de_GetDedicatedIpCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDedicatedIpsCommand */ @@ -1880,7 +1384,7 @@ export const de_GetDedicatedIpsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDedicatedIpsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1894,38 +1398,6 @@ export const de_GetDedicatedIpsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDedicatedIpsCommandError - */ -const de_GetDedicatedIpsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDeliverabilityDashboardOptionsCommand */ @@ -1934,7 +1406,7 @@ export const de_GetDeliverabilityDashboardOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeliverabilityDashboardOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1952,46 +1424,14 @@ export const de_GetDeliverabilityDashboardOptionsCommand = async ( }; /** - * deserializeAws_restJson1GetDeliverabilityDashboardOptionsCommandError + * deserializeAws_restJson1GetDeliverabilityTestReportCommand */ -const de_GetDeliverabilityDashboardOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.pinpointemail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDeliverabilityTestReportCommand - */ -export const de_GetDeliverabilityTestReportCommand = async ( +export const de_GetDeliverabilityTestReportCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeliverabilityTestReportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2008,38 +1448,6 @@ export const de_GetDeliverabilityTestReportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeliverabilityTestReportCommandError - */ -const de_GetDeliverabilityTestReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDomainDeliverabilityCampaignCommand */ @@ -2048,7 +1456,7 @@ export const de_GetDomainDeliverabilityCampaignCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDomainDeliverabilityCampaignCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2061,38 +1469,6 @@ export const de_GetDomainDeliverabilityCampaignCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDomainDeliverabilityCampaignCommandError - */ -const de_GetDomainDeliverabilityCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDomainStatisticsReportCommand */ @@ -2101,7 +1477,7 @@ export const de_GetDomainStatisticsReportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDomainStatisticsReportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2115,38 +1491,6 @@ export const de_GetDomainStatisticsReportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDomainStatisticsReportCommandError - */ -const de_GetDomainStatisticsReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEmailIdentityCommand */ @@ -2155,7 +1499,7 @@ export const de_GetEmailIdentityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEmailIdentityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2173,38 +1517,6 @@ export const de_GetEmailIdentityCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEmailIdentityCommandError - */ -const de_GetEmailIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListConfigurationSetsCommand */ @@ -2213,7 +1525,7 @@ export const de_ListConfigurationSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConfigurationSetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2227,35 +1539,6 @@ export const de_ListConfigurationSetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListConfigurationSetsCommandError - */ -const de_ListConfigurationSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDedicatedIpPoolsCommand */ @@ -2264,7 +1547,7 @@ export const de_ListDedicatedIpPoolsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDedicatedIpPoolsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2278,35 +1561,6 @@ export const de_ListDedicatedIpPoolsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDedicatedIpPoolsCommandError - */ -const de_ListDedicatedIpPoolsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDeliverabilityTestReportsCommand */ @@ -2315,7 +1569,7 @@ export const de_ListDeliverabilityTestReportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeliverabilityTestReportsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2329,38 +1583,6 @@ export const de_ListDeliverabilityTestReportsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDeliverabilityTestReportsCommandError - */ -const de_ListDeliverabilityTestReportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDomainDeliverabilityCampaignsCommand */ @@ -2369,7 +1591,7 @@ export const de_ListDomainDeliverabilityCampaignsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDomainDeliverabilityCampaignsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2383,38 +1605,6 @@ export const de_ListDomainDeliverabilityCampaignsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDomainDeliverabilityCampaignsCommandError - */ -const de_ListDomainDeliverabilityCampaignsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEmailIdentitiesCommand */ @@ -2423,7 +1613,7 @@ export const de_ListEmailIdentitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEmailIdentitiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2438,43 +1628,14 @@ export const de_ListEmailIdentitiesCommand = async ( }; /** - * deserializeAws_restJson1ListEmailIdentitiesCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListEmailIdentitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2487,38 +1648,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommand */ @@ -2527,7 +1656,7 @@ export const de_PutAccountDedicatedIpWarmupAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAccountDedicatedIpWarmupAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2536,35 +1665,6 @@ export const de_PutAccountDedicatedIpWarmupAttributesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommandError - */ -const de_PutAccountDedicatedIpWarmupAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutAccountSendingAttributesCommand */ @@ -2573,7 +1673,7 @@ export const de_PutAccountSendingAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAccountSendingAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2582,35 +1682,6 @@ export const de_PutAccountSendingAttributesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutAccountSendingAttributesCommandError - */ -const de_PutAccountSendingAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutConfigurationSetDeliveryOptionsCommand */ @@ -2619,7 +1690,7 @@ export const de_PutConfigurationSetDeliveryOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutConfigurationSetDeliveryOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2628,38 +1699,6 @@ export const de_PutConfigurationSetDeliveryOptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutConfigurationSetDeliveryOptionsCommandError - */ -const de_PutConfigurationSetDeliveryOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutConfigurationSetReputationOptionsCommand */ @@ -2668,7 +1707,7 @@ export const de_PutConfigurationSetReputationOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutConfigurationSetReputationOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2677,38 +1716,6 @@ export const de_PutConfigurationSetReputationOptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutConfigurationSetReputationOptionsCommandError - */ -const de_PutConfigurationSetReputationOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutConfigurationSetSendingOptionsCommand */ @@ -2717,7 +1724,7 @@ export const de_PutConfigurationSetSendingOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutConfigurationSetSendingOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2726,38 +1733,6 @@ export const de_PutConfigurationSetSendingOptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutConfigurationSetSendingOptionsCommandError - */ -const de_PutConfigurationSetSendingOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutConfigurationSetTrackingOptionsCommand */ @@ -2766,7 +1741,7 @@ export const de_PutConfigurationSetTrackingOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutConfigurationSetTrackingOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2775,38 +1750,6 @@ export const de_PutConfigurationSetTrackingOptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutConfigurationSetTrackingOptionsCommandError - */ -const de_PutConfigurationSetTrackingOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutDedicatedIpInPoolCommand */ @@ -2815,7 +1758,7 @@ export const de_PutDedicatedIpInPoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutDedicatedIpInPoolCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2824,96 +1767,15 @@ export const de_PutDedicatedIpInPoolCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutDedicatedIpInPoolCommandError - */ -const de_PutDedicatedIpInPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutDedicatedIpWarmupAttributesCommand */ export const de_PutDedicatedIpWarmupAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutDedicatedIpWarmupAttributesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1PutDedicatedIpWarmupAttributesCommandError - */ -const de_PutDedicatedIpWarmupAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutDeliverabilityDashboardOptionCommand - */ -export const de_PutDeliverabilityDashboardOptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutDeliverabilityDashboardOptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2923,41 +1785,20 @@ export const de_PutDeliverabilityDashboardOptionCommand = async ( }; /** - * deserializeAws_restJson1PutDeliverabilityDashboardOptionCommandError + * deserializeAws_restJson1PutDeliverabilityDashboardOptionCommand */ -const de_PutDeliverabilityDashboardOptionCommandError = async ( +export const de_PutDeliverabilityDashboardOptionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.pinpointemail#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.pinpointemail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -2968,7 +1809,7 @@ export const de_PutEmailIdentityDkimAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutEmailIdentityDkimAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2977,38 +1818,6 @@ export const de_PutEmailIdentityDkimAttributesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutEmailIdentityDkimAttributesCommandError - */ -const de_PutEmailIdentityDkimAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutEmailIdentityFeedbackAttributesCommand */ @@ -3017,7 +1826,7 @@ export const de_PutEmailIdentityFeedbackAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutEmailIdentityFeedbackAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3026,38 +1835,6 @@ export const de_PutEmailIdentityFeedbackAttributesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutEmailIdentityFeedbackAttributesCommandError - */ -const de_PutEmailIdentityFeedbackAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutEmailIdentityMailFromAttributesCommand */ @@ -3066,7 +1843,7 @@ export const de_PutEmailIdentityMailFromAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutEmailIdentityMailFromAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3075,38 +1852,6 @@ export const de_PutEmailIdentityMailFromAttributesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutEmailIdentityMailFromAttributesCommandError - */ -const de_PutEmailIdentityMailFromAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SendEmailCommand */ @@ -3115,7 +1860,7 @@ export const de_SendEmailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendEmailCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3128,53 +1873,6 @@ export const de_SendEmailCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SendEmailCommandError - */ -const de_SendEmailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountSuspendedException": - case "com.amazonaws.pinpointemail#AccountSuspendedException": - throw await de_AccountSuspendedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.pinpointemail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MailFromDomainNotVerifiedException": - case "com.amazonaws.pinpointemail#MailFromDomainNotVerifiedException": - throw await de_MailFromDomainNotVerifiedExceptionRes(parsedOutput, context); - case "MessageRejected": - case "com.amazonaws.pinpointemail#MessageRejected": - throw await de_MessageRejectedRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "SendingPausedException": - case "com.amazonaws.pinpointemail#SendingPausedException": - throw await de_SendingPausedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -3183,7 +1881,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3192,41 +1890,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.pinpointemail#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -3235,7 +1898,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3244,41 +1907,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointemail#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.pinpointemail#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointemail#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointemail#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommand */ @@ -3287,7 +1915,7 @@ export const de_UpdateConfigurationSetEventDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConfigurationSetEventDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3297,34 +1925,52 @@ export const de_UpdateConfigurationSetEventDestinationCommand = async ( }; /** - * deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateConfigurationSetEventDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AlreadyExistsException": + case "com.amazonaws.pinpointemail#AlreadyExistsException": + throw await de_AlreadyExistsExceptionRes(parsedOutput, context); case "BadRequestException": case "com.amazonaws.pinpointemail#BadRequestException": throw await de_BadRequestExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.pinpointemail#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.pinpointemail#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "NotFoundException": case "com.amazonaws.pinpointemail#NotFoundException": throw await de_NotFoundExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.pinpointemail#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "AccountSuspendedException": + case "com.amazonaws.pinpointemail#AccountSuspendedException": + throw await de_AccountSuspendedExceptionRes(parsedOutput, context); + case "MailFromDomainNotVerifiedException": + case "com.amazonaws.pinpointemail#MailFromDomainNotVerifiedException": + throw await de_MailFromDomainNotVerifiedExceptionRes(parsedOutput, context); + case "MessageRejected": + case "com.amazonaws.pinpointemail#MessageRejected": + throw await de_MessageRejectedRes(parsedOutput, context); + case "SendingPausedException": + case "com.amazonaws.pinpointemail#SendingPausedException": + throw await de_SendingPausedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts b/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts index 3591921887e2..95cb8697991f 100644 --- a/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts +++ b/clients/client-pinpoint-sms-voice-v2/src/protocols/Aws_json1_0.ts @@ -1273,7 +1273,7 @@ export const de_AssociateOriginationIdentityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateOriginationIdentityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1285,50 +1285,6 @@ export const de_AssociateOriginationIdentityCommand = async ( return response; }; -/** - * deserializeAws_json1_0AssociateOriginationIdentityCommandError - */ -const de_AssociateOriginationIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateConfigurationSetCommand */ @@ -1337,7 +1293,7 @@ export const de_CreateConfigurationSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateConfigurationSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1349,47 +1305,6 @@ export const de_CreateConfigurationSetCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateConfigurationSetCommandError - */ -const de_CreateConfigurationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateEventDestinationCommand */ @@ -1398,7 +1313,7 @@ export const de_CreateEventDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEventDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1410,50 +1325,6 @@ export const de_CreateEventDestinationCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateEventDestinationCommandError - */ -const de_CreateEventDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateOptOutListCommand */ @@ -1462,7 +1333,7 @@ export const de_CreateOptOutListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateOptOutListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1474,47 +1345,6 @@ export const de_CreateOptOutListCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateOptOutListCommandError - */ -const de_CreateOptOutListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreatePoolCommand */ @@ -1523,7 +1353,7 @@ export const de_CreatePoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1535,50 +1365,6 @@ export const de_CreatePoolCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreatePoolCommandError - */ -const de_CreatePoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateRegistrationCommand */ @@ -1587,7 +1373,7 @@ export const de_CreateRegistrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRegistrationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1600,60 +1386,39 @@ export const de_CreateRegistrationCommand = async ( }; /** - * deserializeAws_json1_0CreateRegistrationCommandError + * deserializeAws_json1_0CreateRegistrationAssociationCommand */ -const de_CreateRegistrationCommandError = async ( +export const de_CreateRegistrationAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateRegistrationAssociationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0CreateRegistrationAssociationCommand + * deserializeAws_json1_0CreateRegistrationAttachmentCommand */ -export const de_CreateRegistrationAssociationCommand = async ( +export const de_CreateRegistrationAttachmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateRegistrationAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: CreateRegistrationAssociationCommandOutput = { + contents = de_CreateRegistrationAttachmentResult(data, context); + const response: CreateRegistrationAttachmentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1661,119 +1426,14 @@ export const de_CreateRegistrationAssociationCommand = async ( }; /** - * deserializeAws_json1_0CreateRegistrationAssociationCommandError + * deserializeAws_json1_0CreateRegistrationVersionCommand */ -const de_CreateRegistrationAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0CreateRegistrationAttachmentCommand - */ -export const de_CreateRegistrationAttachmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateRegistrationAttachmentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateRegistrationAttachmentResult(data, context); - const response: CreateRegistrationAttachmentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0CreateRegistrationAttachmentCommandError - */ -const de_CreateRegistrationAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0CreateRegistrationVersionCommand - */ -export const de_CreateRegistrationVersionCommand = async ( +export const de_CreateRegistrationVersionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRegistrationVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1785,50 +1445,6 @@ export const de_CreateRegistrationVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateRegistrationVersionCommandError - */ -const de_CreateRegistrationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateVerifiedDestinationNumberCommand */ @@ -1837,7 +1453,7 @@ export const de_CreateVerifiedDestinationNumberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVerifiedDestinationNumberCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1849,1633 +1465,40 @@ export const de_CreateVerifiedDestinationNumberCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateVerifiedDestinationNumberCommandError - */ -const de_CreateVerifiedDestinationNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteConfigurationSetCommand - */ -export const de_DeleteConfigurationSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteConfigurationSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteConfigurationSetResult(data, context); - const response: DeleteConfigurationSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteConfigurationSetCommandError - */ -const de_DeleteConfigurationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteDefaultMessageTypeCommand - */ -export const de_DeleteDefaultMessageTypeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDefaultMessageTypeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteDefaultMessageTypeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteDefaultMessageTypeCommandError - */ -const de_DeleteDefaultMessageTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteDefaultSenderIdCommand - */ -export const de_DeleteDefaultSenderIdCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDefaultSenderIdCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteDefaultSenderIdCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteDefaultSenderIdCommandError - */ -const de_DeleteDefaultSenderIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteEventDestinationCommand - */ -export const de_DeleteEventDestinationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteEventDestinationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteEventDestinationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteEventDestinationCommandError - */ -const de_DeleteEventDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteKeywordCommand - */ -export const de_DeleteKeywordCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteKeywordCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteKeywordCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteKeywordCommandError - */ -const de_DeleteKeywordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteOptedOutNumberCommand - */ -export const de_DeleteOptedOutNumberCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteOptedOutNumberCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteOptedOutNumberResult(data, context); - const response: DeleteOptedOutNumberCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteOptedOutNumberCommandError - */ -const de_DeleteOptedOutNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteOptOutListCommand - */ -export const de_DeleteOptOutListCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteOptOutListCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteOptOutListResult(data, context); - const response: DeleteOptOutListCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteOptOutListCommandError - */ -const de_DeleteOptOutListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeletePoolCommand - */ -export const de_DeletePoolCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeletePoolCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeletePoolResult(data, context); - const response: DeletePoolCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeletePoolCommandError - */ -const de_DeletePoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteRegistrationCommand - */ -export const de_DeleteRegistrationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteRegistrationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteRegistrationResult(data, context); - const response: DeleteRegistrationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteRegistrationCommandError - */ -const de_DeleteRegistrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteRegistrationAttachmentCommand - */ -export const de_DeleteRegistrationAttachmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteRegistrationAttachmentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteRegistrationAttachmentResult(data, context); - const response: DeleteRegistrationAttachmentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteRegistrationAttachmentCommandError - */ -const de_DeleteRegistrationAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteRegistrationFieldValueCommand - */ -export const de_DeleteRegistrationFieldValueCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteRegistrationFieldValueCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteRegistrationFieldValueCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteRegistrationFieldValueCommandError - */ -const de_DeleteRegistrationFieldValueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteTextMessageSpendLimitOverrideCommand - */ -export const de_DeleteTextMessageSpendLimitOverrideCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteTextMessageSpendLimitOverrideCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteTextMessageSpendLimitOverrideCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteTextMessageSpendLimitOverrideCommandError - */ -const de_DeleteTextMessageSpendLimitOverrideCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteVerifiedDestinationNumberCommand - */ -export const de_DeleteVerifiedDestinationNumberCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteVerifiedDestinationNumberCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteVerifiedDestinationNumberResult(data, context); - const response: DeleteVerifiedDestinationNumberCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteVerifiedDestinationNumberCommandError - */ -const de_DeleteVerifiedDestinationNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteVoiceMessageSpendLimitOverrideCommand - */ -export const de_DeleteVoiceMessageSpendLimitOverrideCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteVoiceMessageSpendLimitOverrideCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteVoiceMessageSpendLimitOverrideCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteVoiceMessageSpendLimitOverrideCommandError - */ -const de_DeleteVoiceMessageSpendLimitOverrideCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeAccountAttributesCommand - */ -export const de_DescribeAccountAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAccountAttributesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeAccountAttributesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeAccountAttributesCommandError - */ -const de_DescribeAccountAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeAccountLimitsCommand - */ -export const de_DescribeAccountLimitsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAccountLimitsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeAccountLimitsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeAccountLimitsCommandError - */ -const de_DescribeAccountLimitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeConfigurationSetsCommand - */ -export const de_DescribeConfigurationSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeConfigurationSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeConfigurationSetsResult(data, context); - const response: DescribeConfigurationSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeConfigurationSetsCommandError - */ -const de_DescribeConfigurationSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeKeywordsCommand - */ -export const de_DescribeKeywordsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeKeywordsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeKeywordsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeKeywordsCommandError - */ -const de_DescribeKeywordsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeOptedOutNumbersCommand - */ -export const de_DescribeOptedOutNumbersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeOptedOutNumbersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeOptedOutNumbersResult(data, context); - const response: DescribeOptedOutNumbersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeOptedOutNumbersCommandError - */ -const de_DescribeOptedOutNumbersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeOptOutListsCommand - */ -export const de_DescribeOptOutListsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeOptOutListsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeOptOutListsResult(data, context); - const response: DescribeOptOutListsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeOptOutListsCommandError - */ -const de_DescribeOptOutListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribePhoneNumbersCommand - */ -export const de_DescribePhoneNumbersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribePhoneNumbersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribePhoneNumbersResult(data, context); - const response: DescribePhoneNumbersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribePhoneNumbersCommandError - */ -const de_DescribePhoneNumbersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribePoolsCommand - */ -export const de_DescribePoolsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribePoolsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribePoolsResult(data, context); - const response: DescribePoolsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribePoolsCommandError - */ -const de_DescribePoolsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeRegistrationAttachmentsCommand - */ -export const de_DescribeRegistrationAttachmentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeRegistrationAttachmentsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeRegistrationAttachmentsResult(data, context); - const response: DescribeRegistrationAttachmentsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeRegistrationAttachmentsCommandError - */ -const de_DescribeRegistrationAttachmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeRegistrationFieldDefinitionsCommand - */ -export const de_DescribeRegistrationFieldDefinitionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeRegistrationFieldDefinitionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeRegistrationFieldDefinitionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeRegistrationFieldDefinitionsCommandError - */ -const de_DescribeRegistrationFieldDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeRegistrationFieldValuesCommand - */ -export const de_DescribeRegistrationFieldValuesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeRegistrationFieldValuesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeRegistrationFieldValuesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeRegistrationFieldValuesCommandError - */ -const de_DescribeRegistrationFieldValuesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeRegistrationsCommand - */ -export const de_DescribeRegistrationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeRegistrationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeRegistrationsResult(data, context); - const response: DescribeRegistrationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeRegistrationsCommandError - */ -const de_DescribeRegistrationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeRegistrationSectionDefinitionsCommand - */ -export const de_DescribeRegistrationSectionDefinitionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeRegistrationSectionDefinitionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeRegistrationSectionDefinitionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeRegistrationSectionDefinitionsCommandError - */ -const de_DescribeRegistrationSectionDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + */ +export const de_DeleteConfigurationSetCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteConfigurationSetResult(data, context); + const response: DeleteConfigurationSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DescribeRegistrationTypeDefinitionsCommand + * deserializeAws_json1_0DeleteDefaultMessageTypeCommand */ -export const de_DescribeRegistrationTypeDefinitionsCommand = async ( +export const de_DeleteDefaultMessageTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeRegistrationTypeDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeRegistrationTypeDefinitionsCommandOutput = { + const response: DeleteDefaultMessageTypeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3483,54 +1506,39 @@ export const de_DescribeRegistrationTypeDefinitionsCommand = async ( }; /** - * deserializeAws_json1_0DescribeRegistrationTypeDefinitionsCommandError + * deserializeAws_json1_0DeleteDefaultSenderIdCommand */ -const de_DescribeRegistrationTypeDefinitionsCommandError = async ( +export const de_DeleteDefaultSenderIdCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteDefaultSenderIdCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DescribeRegistrationVersionsCommand + * deserializeAws_json1_0DeleteEventDestinationCommand */ -export const de_DescribeRegistrationVersionsCommand = async ( +export const de_DeleteEventDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeRegistrationVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeRegistrationVersionsResult(data, context); - const response: DescribeRegistrationVersionsCommandOutput = { + contents = _json(data); + const response: DeleteEventDestinationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3538,57 +1546,39 @@ export const de_DescribeRegistrationVersionsCommand = async ( }; /** - * deserializeAws_json1_0DescribeRegistrationVersionsCommandError + * deserializeAws_json1_0DeleteKeywordCommand */ -const de_DescribeRegistrationVersionsCommandError = async ( +export const de_DeleteKeywordCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteKeywordCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DescribeSenderIdsCommand + * deserializeAws_json1_0DeleteOptedOutNumberCommand */ -export const de_DescribeSenderIdsCommand = async ( +export const de_DeleteOptedOutNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeSenderIdsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeSenderIdsCommandOutput = { + contents = de_DeleteOptedOutNumberResult(data, context); + const response: DeleteOptedOutNumberCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3596,57 +1586,39 @@ export const de_DescribeSenderIdsCommand = async ( }; /** - * deserializeAws_json1_0DescribeSenderIdsCommandError + * deserializeAws_json1_0DeleteOptOutListCommand */ -const de_DescribeSenderIdsCommandError = async ( +export const de_DeleteOptOutListCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteOptOutListResult(data, context); + const response: DeleteOptOutListCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DescribeSpendLimitsCommand + * deserializeAws_json1_0DeletePoolCommand */ -export const de_DescribeSpendLimitsCommand = async ( +export const de_DeletePoolCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeSpendLimitsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeSpendLimitsCommandOutput = { + contents = de_DeletePoolResult(data, context); + const response: DeletePoolCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3654,54 +1626,39 @@ export const de_DescribeSpendLimitsCommand = async ( }; /** - * deserializeAws_json1_0DescribeSpendLimitsCommandError + * deserializeAws_json1_0DeleteRegistrationCommand */ -const de_DescribeSpendLimitsCommandError = async ( +export const de_DeleteRegistrationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteRegistrationResult(data, context); + const response: DeleteRegistrationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DescribeVerifiedDestinationNumbersCommand + * deserializeAws_json1_0DeleteRegistrationAttachmentCommand */ -export const de_DescribeVerifiedDestinationNumbersCommand = async ( +export const de_DeleteRegistrationAttachmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeVerifiedDestinationNumbersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeVerifiedDestinationNumbersResult(data, context); - const response: DescribeVerifiedDestinationNumbersCommandOutput = { + contents = de_DeleteRegistrationAttachmentResult(data, context); + const response: DeleteRegistrationAttachmentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3709,57 +1666,39 @@ export const de_DescribeVerifiedDestinationNumbersCommand = async ( }; /** - * deserializeAws_json1_0DescribeVerifiedDestinationNumbersCommandError + * deserializeAws_json1_0DeleteRegistrationFieldValueCommand */ -const de_DescribeVerifiedDestinationNumbersCommandError = async ( +export const de_DeleteRegistrationFieldValueCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteRegistrationFieldValueCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DisassociateOriginationIdentityCommand + * deserializeAws_json1_0DeleteTextMessageSpendLimitOverrideCommand */ -export const de_DisassociateOriginationIdentityCommand = async ( +export const de_DeleteTextMessageSpendLimitOverrideCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateOriginationIdentityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateOriginationIdentityCommandOutput = { + const response: DeleteTextMessageSpendLimitOverrideCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3767,60 +1706,39 @@ export const de_DisassociateOriginationIdentityCommand = async ( }; /** - * deserializeAws_json1_0DisassociateOriginationIdentityCommandError + * deserializeAws_json1_0DeleteVerifiedDestinationNumberCommand */ -const de_DisassociateOriginationIdentityCommandError = async ( +export const de_DeleteVerifiedDestinationNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteVerifiedDestinationNumberResult(data, context); + const response: DeleteVerifiedDestinationNumberCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DiscardRegistrationVersionCommand + * deserializeAws_json1_0DeleteVoiceMessageSpendLimitOverrideCommand */ -export const de_DiscardRegistrationVersionCommand = async ( +export const de_DeleteVoiceMessageSpendLimitOverrideCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DiscardRegistrationVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DiscardRegistrationVersionResult(data, context); - const response: DiscardRegistrationVersionCommandOutput = { + contents = _json(data); + const response: DeleteVoiceMessageSpendLimitOverrideCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3828,60 +1746,39 @@ export const de_DiscardRegistrationVersionCommand = async ( }; /** - * deserializeAws_json1_0DiscardRegistrationVersionCommandError + * deserializeAws_json1_0DescribeAccountAttributesCommand */ -const de_DiscardRegistrationVersionCommandError = async ( +export const de_DescribeAccountAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeAccountAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListPoolOriginationIdentitiesCommand + * deserializeAws_json1_0DescribeAccountLimitsCommand */ -export const de_ListPoolOriginationIdentitiesCommand = async ( +export const de_DescribeAccountLimitsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListPoolOriginationIdentitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListPoolOriginationIdentitiesCommandOutput = { + const response: DescribeAccountLimitsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3889,57 +1786,39 @@ export const de_ListPoolOriginationIdentitiesCommand = async ( }; /** - * deserializeAws_json1_0ListPoolOriginationIdentitiesCommandError + * deserializeAws_json1_0DescribeConfigurationSetsCommand */ -const de_ListPoolOriginationIdentitiesCommandError = async ( +export const de_DescribeConfigurationSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeConfigurationSetsResult(data, context); + const response: DescribeConfigurationSetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListRegistrationAssociationsCommand + * deserializeAws_json1_0DescribeKeywordsCommand */ -export const de_ListRegistrationAssociationsCommand = async ( +export const de_DescribeKeywordsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListRegistrationAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListRegistrationAssociationsCommandOutput = { + const response: DescribeKeywordsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3947,57 +1826,39 @@ export const de_ListRegistrationAssociationsCommand = async ( }; /** - * deserializeAws_json1_0ListRegistrationAssociationsCommandError + * deserializeAws_json1_0DescribeOptedOutNumbersCommand */ -const de_ListRegistrationAssociationsCommandError = async ( +export const de_DescribeOptedOutNumbersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeOptedOutNumbersResult(data, context); + const response: DescribeOptedOutNumbersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListTagsForResourceCommand + * deserializeAws_json1_0DescribeOptOutListsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_DescribeOptOutListsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_DescribeOptOutListsResult(data, context); + const response: DescribeOptOutListsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4005,57 +1866,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_0ListTagsForResourceCommandError + * deserializeAws_json1_0DescribePhoneNumbersCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_DescribePhoneNumbersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribePhoneNumbersResult(data, context); + const response: DescribePhoneNumbersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0PutKeywordCommand + * deserializeAws_json1_0DescribePoolsCommand */ -export const de_PutKeywordCommand = async ( +export const de_DescribePoolsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutKeywordCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: PutKeywordCommandOutput = { + contents = de_DescribePoolsResult(data, context); + const response: DescribePoolsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4063,63 +1906,19 @@ export const de_PutKeywordCommand = async ( }; /** - * deserializeAws_json1_0PutKeywordCommandError - */ -const de_PutKeywordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0PutOptedOutNumberCommand + * deserializeAws_json1_0DescribeRegistrationAttachmentsCommand */ -export const de_PutOptedOutNumberCommand = async ( +export const de_DescribeRegistrationAttachmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutOptedOutNumberCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_PutOptedOutNumberResult(data, context); - const response: PutOptedOutNumberCommandOutput = { + contents = de_DescribeRegistrationAttachmentsResult(data, context); + const response: DescribeRegistrationAttachmentsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4127,57 +1926,39 @@ export const de_PutOptedOutNumberCommand = async ( }; /** - * deserializeAws_json1_0PutOptedOutNumberCommandError + * deserializeAws_json1_0DescribeRegistrationFieldDefinitionsCommand */ -const de_PutOptedOutNumberCommandError = async ( +export const de_DescribeRegistrationFieldDefinitionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeRegistrationFieldDefinitionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0PutRegistrationFieldValueCommand + * deserializeAws_json1_0DescribeRegistrationFieldValuesCommand */ -export const de_PutRegistrationFieldValueCommand = async ( +export const de_DescribeRegistrationFieldValuesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutRegistrationFieldValueCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutRegistrationFieldValueCommandOutput = { + const response: DescribeRegistrationFieldValuesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4185,60 +1966,39 @@ export const de_PutRegistrationFieldValueCommand = async ( }; /** - * deserializeAws_json1_0PutRegistrationFieldValueCommandError + * deserializeAws_json1_0DescribeRegistrationsCommand */ -const de_PutRegistrationFieldValueCommandError = async ( +export const de_DescribeRegistrationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeRegistrationsResult(data, context); + const response: DescribeRegistrationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ReleasePhoneNumberCommand + * deserializeAws_json1_0DescribeRegistrationSectionDefinitionsCommand */ -export const de_ReleasePhoneNumberCommand = async ( +export const de_DescribeRegistrationSectionDefinitionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ReleasePhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ReleasePhoneNumberResult(data, context); - const response: ReleasePhoneNumberCommandOutput = { + contents = _json(data); + const response: DescribeRegistrationSectionDefinitionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4246,60 +2006,39 @@ export const de_ReleasePhoneNumberCommand = async ( }; /** - * deserializeAws_json1_0ReleasePhoneNumberCommandError + * deserializeAws_json1_0DescribeRegistrationTypeDefinitionsCommand */ -const de_ReleasePhoneNumberCommandError = async ( +export const de_DescribeRegistrationTypeDefinitionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeRegistrationTypeDefinitionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ReleaseSenderIdCommand + * deserializeAws_json1_0DescribeRegistrationVersionsCommand */ -export const de_ReleaseSenderIdCommand = async ( +export const de_DescribeRegistrationVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ReleaseSenderIdCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ReleaseSenderIdCommandOutput = { + contents = de_DescribeRegistrationVersionsResult(data, context); + const response: DescribeRegistrationVersionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4307,60 +2046,39 @@ export const de_ReleaseSenderIdCommand = async ( }; /** - * deserializeAws_json1_0ReleaseSenderIdCommandError + * deserializeAws_json1_0DescribeSenderIdsCommand */ -const de_ReleaseSenderIdCommandError = async ( +export const de_DescribeSenderIdsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeSenderIdsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0RequestPhoneNumberCommand + * deserializeAws_json1_0DescribeSpendLimitsCommand */ -export const de_RequestPhoneNumberCommand = async ( +export const de_DescribeSpendLimitsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RequestPhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RequestPhoneNumberResult(data, context); - const response: RequestPhoneNumberCommandOutput = { + contents = _json(data); + const response: DescribeSpendLimitsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4368,63 +2086,39 @@ export const de_RequestPhoneNumberCommand = async ( }; /** - * deserializeAws_json1_0RequestPhoneNumberCommandError + * deserializeAws_json1_0DescribeVerifiedDestinationNumbersCommand */ -const de_RequestPhoneNumberCommandError = async ( +export const de_DescribeVerifiedDestinationNumbersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeVerifiedDestinationNumbersResult(data, context); + const response: DescribeVerifiedDestinationNumbersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0RequestSenderIdCommand + * deserializeAws_json1_0DisassociateOriginationIdentityCommand */ -export const de_RequestSenderIdCommand = async ( +export const de_DisassociateOriginationIdentityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RequestSenderIdCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: RequestSenderIdCommandOutput = { + const response: DisassociateOriginationIdentityCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4432,60 +2126,39 @@ export const de_RequestSenderIdCommand = async ( }; /** - * deserializeAws_json1_0RequestSenderIdCommandError + * deserializeAws_json1_0DiscardRegistrationVersionCommand */ -const de_RequestSenderIdCommandError = async ( +export const de_DiscardRegistrationVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DiscardRegistrationVersionResult(data, context); + const response: DiscardRegistrationVersionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0SendDestinationNumberVerificationCodeCommand + * deserializeAws_json1_0ListPoolOriginationIdentitiesCommand */ -export const de_SendDestinationNumberVerificationCodeCommand = async ( +export const de_ListPoolOriginationIdentitiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SendDestinationNumberVerificationCodeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: SendDestinationNumberVerificationCodeCommandOutput = { + const response: ListPoolOriginationIdentitiesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4493,63 +2166,19 @@ export const de_SendDestinationNumberVerificationCodeCommand = async ( }; /** - * deserializeAws_json1_0SendDestinationNumberVerificationCodeCommandError - */ -const de_SendDestinationNumberVerificationCodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0SendTextMessageCommand + * deserializeAws_json1_0ListRegistrationAssociationsCommand */ -export const de_SendTextMessageCommand = async ( +export const de_ListRegistrationAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SendTextMessageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: SendTextMessageCommandOutput = { + const response: ListRegistrationAssociationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4557,63 +2186,39 @@ export const de_SendTextMessageCommand = async ( }; /** - * deserializeAws_json1_0SendTextMessageCommandError + * deserializeAws_json1_0ListTagsForResourceCommand */ -const de_SendTextMessageCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0SendVoiceMessageCommand + * deserializeAws_json1_0PutKeywordCommand */ -export const de_SendVoiceMessageCommand = async ( +export const de_PutKeywordCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SendVoiceMessageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: SendVoiceMessageCommandOutput = { + const response: PutKeywordCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4621,63 +2226,39 @@ export const de_SendVoiceMessageCommand = async ( }; /** - * deserializeAws_json1_0SendVoiceMessageCommandError + * deserializeAws_json1_0PutOptedOutNumberCommand */ -const de_SendVoiceMessageCommandError = async ( +export const de_PutOptedOutNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_PutOptedOutNumberResult(data, context); + const response: PutOptedOutNumberCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0SetDefaultMessageTypeCommand + * deserializeAws_json1_0PutRegistrationFieldValueCommand */ -export const de_SetDefaultMessageTypeCommand = async ( +export const de_PutRegistrationFieldValueCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetDefaultMessageTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: SetDefaultMessageTypeCommandOutput = { + const response: PutRegistrationFieldValueCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4685,57 +2266,39 @@ export const de_SetDefaultMessageTypeCommand = async ( }; /** - * deserializeAws_json1_0SetDefaultMessageTypeCommandError + * deserializeAws_json1_0ReleasePhoneNumberCommand */ -const de_SetDefaultMessageTypeCommandError = async ( +export const de_ReleasePhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ReleasePhoneNumberResult(data, context); + const response: ReleasePhoneNumberCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0SetDefaultSenderIdCommand + * deserializeAws_json1_0ReleaseSenderIdCommand */ -export const de_SetDefaultSenderIdCommand = async ( +export const de_ReleaseSenderIdCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetDefaultSenderIdCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: SetDefaultSenderIdCommandOutput = { + const response: ReleaseSenderIdCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4743,57 +2306,39 @@ export const de_SetDefaultSenderIdCommand = async ( }; /** - * deserializeAws_json1_0SetDefaultSenderIdCommandError + * deserializeAws_json1_0RequestPhoneNumberCommand */ -const de_SetDefaultSenderIdCommandError = async ( +export const de_RequestPhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RequestPhoneNumberResult(data, context); + const response: RequestPhoneNumberCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0SetTextMessageSpendLimitOverrideCommand + * deserializeAws_json1_0RequestSenderIdCommand */ -export const de_SetTextMessageSpendLimitOverrideCommand = async ( +export const de_RequestSenderIdCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetTextMessageSpendLimitOverrideCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: SetTextMessageSpendLimitOverrideCommandOutput = { + const response: RequestSenderIdCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4801,54 +2346,39 @@ export const de_SetTextMessageSpendLimitOverrideCommand = async ( }; /** - * deserializeAws_json1_0SetTextMessageSpendLimitOverrideCommandError + * deserializeAws_json1_0SendDestinationNumberVerificationCodeCommand */ -const de_SetTextMessageSpendLimitOverrideCommandError = async ( +export const de_SendDestinationNumberVerificationCodeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: SendDestinationNumberVerificationCodeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0SetVoiceMessageSpendLimitOverrideCommand + * deserializeAws_json1_0SendTextMessageCommand */ -export const de_SetVoiceMessageSpendLimitOverrideCommand = async ( +export const de_SendTextMessageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetVoiceMessageSpendLimitOverrideCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: SetVoiceMessageSpendLimitOverrideCommandOutput = { + const response: SendTextMessageCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4856,54 +2386,39 @@ export const de_SetVoiceMessageSpendLimitOverrideCommand = async ( }; /** - * deserializeAws_json1_0SetVoiceMessageSpendLimitOverrideCommandError + * deserializeAws_json1_0SendVoiceMessageCommand */ -const de_SetVoiceMessageSpendLimitOverrideCommandError = async ( +export const de_SendVoiceMessageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: SendVoiceMessageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0SubmitRegistrationVersionCommand + * deserializeAws_json1_0SetDefaultMessageTypeCommand */ -export const de_SubmitRegistrationVersionCommand = async ( +export const de_SetDefaultMessageTypeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SubmitRegistrationVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_SubmitRegistrationVersionResult(data, context); - const response: SubmitRegistrationVersionCommandOutput = { + contents = _json(data); + const response: SetDefaultMessageTypeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4911,60 +2426,59 @@ export const de_SubmitRegistrationVersionCommand = async ( }; /** - * deserializeAws_json1_0SubmitRegistrationVersionCommandError + * deserializeAws_json1_0SetDefaultSenderIdCommand */ -const de_SubmitRegistrationVersionCommandError = async ( +export const de_SetDefaultSenderIdCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: SetDefaultSenderIdCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_0SetTextMessageSpendLimitOverrideCommand + */ +export const de_SetTextMessageSpendLimitOverrideCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: SetTextMessageSpendLimitOverrideCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0TagResourceCommand + * deserializeAws_json1_0SetVoiceMessageSpendLimitOverrideCommand */ -export const de_TagResourceCommand = async ( +export const de_SetVoiceMessageSpendLimitOverrideCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: SetVoiceMessageSpendLimitOverrideCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4972,60 +2486,39 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_0TagResourceCommandError + * deserializeAws_json1_0SubmitRegistrationVersionCommand */ -const de_TagResourceCommandError = async ( +export const de_SubmitRegistrationVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SubmitRegistrationVersionResult(data, context); + const response: SubmitRegistrationVersionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0UntagResourceCommand + * deserializeAws_json1_0TagResourceCommand */ -export const de_UntagResourceCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UntagResourceCommandOutput = { + const response: TagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5033,41 +2526,23 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_0UntagResourceCommandError + * deserializeAws_json1_0UntagResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -5078,7 +2553,7 @@ export const de_UpdateEventDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateEventDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5090,47 +2565,6 @@ export const de_UpdateEventDestinationCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateEventDestinationCommandError - */ -const de_UpdateEventDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdatePhoneNumberCommand */ @@ -5139,7 +2573,7 @@ export const de_UpdatePhoneNumberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5151,47 +2585,6 @@ export const de_UpdatePhoneNumberCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdatePhoneNumberCommandError - */ -const de_UpdatePhoneNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdatePoolCommand */ @@ -5200,7 +2593,7 @@ export const de_UpdatePoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5212,47 +2605,6 @@ export const de_UpdatePoolCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdatePoolCommandError - */ -const de_UpdatePoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpointsmsvoicev2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateSenderIdCommand */ @@ -5261,7 +2613,7 @@ export const de_UpdateSenderIdCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSenderIdCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5273,44 +2625,6 @@ export const de_UpdateSenderIdCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateSenderIdCommandError - */ -const de_UpdateSenderIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pinpointsmsvoicev2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.pinpointsmsvoicev2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pinpointsmsvoicev2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0VerifyDestinationNumberCommand */ @@ -5319,7 +2633,7 @@ export const de_VerifyDestinationNumberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_VerifyDestinationNumberCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5332,12 +2646,9 @@ export const de_VerifyDestinationNumberCommand = async ( }; /** - * deserializeAws_json1_0VerifyDestinationNumberCommandError + * deserialize_Aws_json1_0CommandError */ -const de_VerifyDestinationNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5356,6 +2667,9 @@ const de_VerifyDestinationNumberCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.pinpointsmsvoicev2#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.pinpointsmsvoicev2#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.pinpointsmsvoicev2#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -5368,7 +2682,7 @@ const de_VerifyDestinationNumberCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts b/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts index 697e681008f2..d10c4e0851e7 100644 --- a/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts +++ b/clients/client-pinpoint-sms-voice/src/protocols/Aws_restJson1.ts @@ -240,7 +240,7 @@ export const de_CreateConfigurationSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConfigurationSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -249,44 +249,6 @@ export const de_CreateConfigurationSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConfigurationSetCommandError - */ -const de_CreateConfigurationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.pinpointsmsvoice#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.pinpointsmsvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.pinpointsmsvoice#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.pinpointsmsvoice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointsmsvoice#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConfigurationSetEventDestinationCommand */ @@ -295,7 +257,7 @@ export const de_CreateConfigurationSetEventDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConfigurationSetEventDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -304,47 +266,6 @@ export const de_CreateConfigurationSetEventDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConfigurationSetEventDestinationCommandError - */ -const de_CreateConfigurationSetEventDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.pinpointsmsvoice#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.pinpointsmsvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.pinpointsmsvoice#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.pinpointsmsvoice#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointsmsvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointsmsvoice#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteConfigurationSetCommand */ @@ -353,7 +274,7 @@ export const de_DeleteConfigurationSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConfigurationSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -362,41 +283,6 @@ export const de_DeleteConfigurationSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteConfigurationSetCommandError - */ -const de_DeleteConfigurationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointsmsvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.pinpointsmsvoice#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointsmsvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointsmsvoice#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommand */ @@ -405,7 +291,7 @@ export const de_DeleteConfigurationSetEventDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConfigurationSetEventDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -414,41 +300,6 @@ export const de_DeleteConfigurationSetEventDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommandError - */ -const de_DeleteConfigurationSetEventDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointsmsvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.pinpointsmsvoice#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointsmsvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointsmsvoice#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConfigurationSetEventDestinationsCommand */ @@ -457,7 +308,7 @@ export const de_GetConfigurationSetEventDestinationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfigurationSetEventDestinationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -470,41 +321,6 @@ export const de_GetConfigurationSetEventDestinationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetConfigurationSetEventDestinationsCommandError - */ -const de_GetConfigurationSetEventDestinationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointsmsvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.pinpointsmsvoice#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointsmsvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointsmsvoice#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListConfigurationSetsCommand */ @@ -513,7 +329,7 @@ export const de_ListConfigurationSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConfigurationSetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -527,38 +343,6 @@ export const de_ListConfigurationSetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListConfigurationSetsCommandError - */ -const de_ListConfigurationSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointsmsvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.pinpointsmsvoice#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointsmsvoice#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SendVoiceMessageCommand */ @@ -567,7 +351,7 @@ export const de_SendVoiceMessageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendVoiceMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -580,38 +364,6 @@ export const de_SendVoiceMessageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SendVoiceMessageCommandError - */ -const de_SendVoiceMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpointsmsvoice#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.pinpointsmsvoice#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpointsmsvoice#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommand */ @@ -620,7 +372,7 @@ export const de_UpdateConfigurationSetEventDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConfigurationSetEventDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -630,37 +382,40 @@ export const de_UpdateConfigurationSetEventDestinationCommand = async ( }; /** - * deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateConfigurationSetEventDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AlreadyExistsException": + case "com.amazonaws.pinpointsmsvoice#AlreadyExistsException": + throw await de_AlreadyExistsExceptionRes(parsedOutput, context); case "BadRequestException": case "com.amazonaws.pinpointsmsvoice#BadRequestException": throw await de_BadRequestExceptionRes(parsedOutput, context); case "InternalServiceErrorException": case "com.amazonaws.pinpointsmsvoice#InternalServiceErrorException": throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpointsmsvoice#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.pinpointsmsvoice#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.pinpointsmsvoice#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.pinpointsmsvoice#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-pinpoint/src/protocols/Aws_restJson1.ts b/clients/client-pinpoint/src/protocols/Aws_restJson1.ts index eaeb89ce1a4c..ed110f1a851a 100644 --- a/clients/client-pinpoint/src/protocols/Aws_restJson1.ts +++ b/clients/client-pinpoint/src/protocols/Aws_restJson1.ts @@ -2995,7 +2995,7 @@ export const de_CreateAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAppCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3005,50 +3005,6 @@ export const de_CreateAppCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAppCommandError - */ -const de_CreateAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCampaignCommand */ @@ -3057,7 +3013,7 @@ export const de_CreateCampaignCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateCampaignCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3067,50 +3023,6 @@ export const de_CreateCampaignCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCampaignCommandError - */ -const de_CreateCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateEmailTemplateCommand */ @@ -3119,7 +3031,7 @@ export const de_CreateEmailTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateEmailTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3129,44 +3041,6 @@ export const de_CreateEmailTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEmailTemplateCommandError - */ -const de_CreateEmailTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateExportJobCommand */ @@ -3175,7 +3049,7 @@ export const de_CreateExportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CreateExportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3185,50 +3059,6 @@ export const de_CreateExportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateExportJobCommandError - */ -const de_CreateExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateImportJobCommand */ @@ -3237,7 +3067,7 @@ export const de_CreateImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3247,50 +3077,6 @@ export const de_CreateImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateImportJobCommandError - */ -const de_CreateImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateInAppTemplateCommand */ @@ -3299,7 +3085,7 @@ export const de_CreateInAppTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateInAppTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3310,6016 +3096,1765 @@ export const de_CreateInAppTemplateCommand = async ( }; /** - * deserializeAws_restJson1CreateInAppTemplateCommandError + * deserializeAws_restJson1CreateJourneyCommand */ -const de_CreateInAppTemplateCommandError = async ( +export const de_CreateJourneyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.JourneyResponse = de_JourneyResponse(data, context); + return contents; }; /** - * deserializeAws_restJson1CreateJourneyCommand + * deserializeAws_restJson1CreatePushTemplateCommand */ -export const de_CreateJourneyCommand = async ( +export const de_CreatePushTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateJourneyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.JourneyResponse = de_JourneyResponse(data, context); + contents.CreateTemplateMessageBody = _json(data); return contents; }; /** - * deserializeAws_restJson1CreateJourneyCommandError + * deserializeAws_restJson1CreateRecommenderConfigurationCommand */ -const de_CreateJourneyCommandError = async ( +export const de_CreateRecommenderConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.RecommenderConfigurationResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1CreatePushTemplateCommand + * deserializeAws_restJson1CreateSegmentCommand */ -export const de_CreatePushTemplateCommand = async ( +export const de_CreateSegmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreatePushTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CreateTemplateMessageBody = _json(data); + contents.SegmentResponse = de_SegmentResponse(data, context); return contents; }; /** - * deserializeAws_restJson1CreatePushTemplateCommandError + * deserializeAws_restJson1CreateSmsTemplateCommand */ -const de_CreatePushTemplateCommandError = async ( +export const de_CreateSmsTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.CreateTemplateMessageBody = _json(data); + return contents; }; /** - * deserializeAws_restJson1CreateRecommenderConfigurationCommand + * deserializeAws_restJson1CreateVoiceTemplateCommand */ -export const de_CreateRecommenderConfigurationCommand = async ( +export const de_CreateVoiceTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateRecommenderConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.RecommenderConfigurationResponse = _json(data); + contents.CreateTemplateMessageBody = _json(data); return contents; }; /** - * deserializeAws_restJson1CreateRecommenderConfigurationCommandError + * deserializeAws_restJson1DeleteAdmChannelCommand */ -const de_CreateRecommenderConfigurationCommandError = async ( +export const de_DeleteAdmChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.ADMChannelResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1CreateSegmentCommand + * deserializeAws_restJson1DeleteApnsChannelCommand */ -export const de_CreateSegmentCommand = async ( +export const de_DeleteApnsChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSegmentCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.SegmentResponse = de_SegmentResponse(data, context); + contents.APNSChannelResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1CreateSegmentCommandError + * deserializeAws_restJson1DeleteApnsSandboxChannelCommand */ -const de_CreateSegmentCommandError = async ( +export const de_DeleteApnsSandboxChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.APNSSandboxChannelResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1CreateSmsTemplateCommand + * deserializeAws_restJson1DeleteApnsVoipChannelCommand */ -export const de_CreateSmsTemplateCommand = async ( +export const de_DeleteApnsVoipChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSmsTemplateCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CreateTemplateMessageBody = _json(data); + contents.APNSVoipChannelResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1CreateSmsTemplateCommandError + * deserializeAws_restJson1DeleteApnsVoipSandboxChannelCommand */ -const de_CreateSmsTemplateCommandError = async ( +export const de_DeleteApnsVoipSandboxChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.APNSVoipSandboxChannelResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1CreateVoiceTemplateCommand + * deserializeAws_restJson1DeleteAppCommand */ -export const de_CreateVoiceTemplateCommand = async ( +export const de_DeleteAppCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateVoiceTemplateCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CreateTemplateMessageBody = _json(data); + contents.ApplicationResponse = de_ApplicationResponse(data, context); return contents; }; /** - * deserializeAws_restJson1CreateVoiceTemplateCommandError + * deserializeAws_restJson1DeleteBaiduChannelCommand */ -const de_CreateVoiceTemplateCommandError = async ( +export const de_DeleteBaiduChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.BaiduChannelResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1DeleteAdmChannelCommand + * deserializeAws_restJson1DeleteCampaignCommand */ -export const de_DeleteAdmChannelCommand = async ( +export const de_DeleteCampaignCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAdmChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ADMChannelResponse = _json(data); + contents.CampaignResponse = de_CampaignResponse(data, context); return contents; }; /** - * deserializeAws_restJson1DeleteAdmChannelCommandError + * deserializeAws_restJson1DeleteEmailChannelCommand */ -const de_DeleteAdmChannelCommandError = async ( +export const de_DeleteEmailChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.EmailChannelResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1DeleteApnsChannelCommand + * deserializeAws_restJson1DeleteEmailTemplateCommand */ -export const de_DeleteApnsChannelCommand = async ( +export const de_DeleteEmailTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteApnsChannelCommandError(output, context); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.APNSChannelResponse = _json(data); + contents.MessageBody = _json(data); return contents; }; /** - * deserializeAws_restJson1DeleteApnsChannelCommandError + * deserializeAws_restJson1DeleteEndpointCommand */ -const de_DeleteApnsChannelCommandError = async ( +export const de_DeleteEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.EndpointResponse = de_EndpointResponse(data, context); + return contents; }; /** - * deserializeAws_restJson1DeleteApnsSandboxChannelCommand + * deserializeAws_restJson1DeleteEventStreamCommand */ -export const de_DeleteApnsSandboxChannelCommand = async ( +export const de_DeleteEventStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteApnsSandboxChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.APNSSandboxChannelResponse = _json(data); + contents.EventStream = _json(data); return contents; }; /** - * deserializeAws_restJson1DeleteApnsSandboxChannelCommandError + * deserializeAws_restJson1DeleteGcmChannelCommand */ -const de_DeleteApnsSandboxChannelCommandError = async ( +export const de_DeleteGcmChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.GCMChannelResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1DeleteApnsVoipChannelCommand + * deserializeAws_restJson1DeleteInAppTemplateCommand */ -export const de_DeleteApnsVoipChannelCommand = async ( +export const de_DeleteInAppTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteApnsVoipChannelCommandError(output, context); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.APNSVoipChannelResponse = _json(data); + contents.MessageBody = _json(data); return contents; }; /** - * deserializeAws_restJson1DeleteApnsVoipChannelCommandError + * deserializeAws_restJson1DeleteJourneyCommand */ -const de_DeleteApnsVoipChannelCommandError = async ( +export const de_DeleteJourneyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.JourneyResponse = de_JourneyResponse(data, context); + return contents; }; /** - * deserializeAws_restJson1DeleteApnsVoipSandboxChannelCommand + * deserializeAws_restJson1DeletePushTemplateCommand */ -export const de_DeleteApnsVoipSandboxChannelCommand = async ( +export const de_DeletePushTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteApnsVoipSandboxChannelCommandError(output, context); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.APNSVoipSandboxChannelResponse = _json(data); + contents.MessageBody = _json(data); return contents; }; /** - * deserializeAws_restJson1DeleteApnsVoipSandboxChannelCommandError + * deserializeAws_restJson1DeleteRecommenderConfigurationCommand */ -const de_DeleteApnsVoipSandboxChannelCommandError = async ( +export const de_DeleteRecommenderConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.RecommenderConfigurationResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1DeleteAppCommand + * deserializeAws_restJson1DeleteSegmentCommand */ -export const de_DeleteAppCommand = async ( +export const de_DeleteSegmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAppCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ApplicationResponse = de_ApplicationResponse(data, context); + contents.SegmentResponse = de_SegmentResponse(data, context); return contents; }; /** - * deserializeAws_restJson1DeleteAppCommandError + * deserializeAws_restJson1DeleteSmsChannelCommand */ -const de_DeleteAppCommandError = async ( +export const de_DeleteSmsChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.SMSChannelResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1DeleteBaiduChannelCommand + * deserializeAws_restJson1DeleteSmsTemplateCommand */ -export const de_DeleteBaiduChannelCommand = async ( +export const de_DeleteSmsTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBaiduChannelCommandError(output, context); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.BaiduChannelResponse = _json(data); + contents.MessageBody = _json(data); return contents; }; /** - * deserializeAws_restJson1DeleteBaiduChannelCommandError + * deserializeAws_restJson1DeleteUserEndpointsCommand */ -const de_DeleteBaiduChannelCommandError = async ( +export const de_DeleteUserEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.EndpointsResponse = de_EndpointsResponse(data, context); + return contents; }; /** - * deserializeAws_restJson1DeleteCampaignCommand + * deserializeAws_restJson1DeleteVoiceChannelCommand */ -export const de_DeleteCampaignCommand = async ( +export const de_DeleteVoiceChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCampaignCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CampaignResponse = de_CampaignResponse(data, context); + contents.VoiceChannelResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1DeleteCampaignCommandError + * deserializeAws_restJson1DeleteVoiceTemplateCommand */ -const de_DeleteCampaignCommandError = async ( +export const de_DeleteVoiceTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.MessageBody = _json(data); + return contents; }; /** - * deserializeAws_restJson1DeleteEmailChannelCommand + * deserializeAws_restJson1GetAdmChannelCommand */ -export const de_DeleteEmailChannelCommand = async ( +export const de_GetAdmChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEmailChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.EmailChannelResponse = _json(data); + contents.ADMChannelResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1DeleteEmailChannelCommandError + * deserializeAws_restJson1GetApnsChannelCommand */ -const de_DeleteEmailChannelCommandError = async ( +export const de_GetApnsChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.APNSChannelResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1DeleteEmailTemplateCommand + * deserializeAws_restJson1GetApnsSandboxChannelCommand */ -export const de_DeleteEmailTemplateCommand = async ( +export const de_GetApnsSandboxChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteEmailTemplateCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.MessageBody = _json(data); + contents.APNSSandboxChannelResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1DeleteEmailTemplateCommandError + * deserializeAws_restJson1GetApnsVoipChannelCommand */ -const de_DeleteEmailTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteEndpointCommand - */ -export const de_DeleteEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteEndpointCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.EndpointResponse = de_EndpointResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteEndpointCommandError - */ -const de_DeleteEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteEventStreamCommand - */ -export const de_DeleteEventStreamCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEventStreamCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.EventStream = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteEventStreamCommandError - */ -const de_DeleteEventStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteGcmChannelCommand - */ -export const de_DeleteGcmChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGcmChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.GCMChannelResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteGcmChannelCommandError - */ -const de_DeleteGcmChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteInAppTemplateCommand - */ -export const de_DeleteInAppTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteInAppTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.MessageBody = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteInAppTemplateCommandError - */ -const de_DeleteInAppTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteJourneyCommand - */ -export const de_DeleteJourneyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteJourneyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.JourneyResponse = de_JourneyResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteJourneyCommandError - */ -const de_DeleteJourneyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePushTemplateCommand - */ -export const de_DeletePushTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeletePushTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.MessageBody = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1DeletePushTemplateCommandError - */ -const de_DeletePushTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRecommenderConfigurationCommand - */ -export const de_DeleteRecommenderConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRecommenderConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.RecommenderConfigurationResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRecommenderConfigurationCommandError - */ -const de_DeleteRecommenderConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSegmentCommand - */ -export const de_DeleteSegmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSegmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.SegmentResponse = de_SegmentResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSegmentCommandError - */ -const de_DeleteSegmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSmsChannelCommand - */ -export const de_DeleteSmsChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSmsChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.SMSChannelResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSmsChannelCommandError - */ -const de_DeleteSmsChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSmsTemplateCommand - */ -export const de_DeleteSmsTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteSmsTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.MessageBody = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSmsTemplateCommandError - */ -const de_DeleteSmsTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteUserEndpointsCommand - */ -export const de_DeleteUserEndpointsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteUserEndpointsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.EndpointsResponse = de_EndpointsResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteUserEndpointsCommandError - */ -const de_DeleteUserEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVoiceChannelCommand - */ -export const de_DeleteVoiceChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteVoiceChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.VoiceChannelResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVoiceChannelCommandError - */ -const de_DeleteVoiceChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVoiceTemplateCommand - */ -export const de_DeleteVoiceTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeleteVoiceTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.MessageBody = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVoiceTemplateCommandError - */ -const de_DeleteVoiceTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAdmChannelCommand - */ -export const de_GetAdmChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAdmChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ADMChannelResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetAdmChannelCommandError - */ -const de_GetAdmChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetApnsChannelCommand - */ -export const de_GetApnsChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApnsChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.APNSChannelResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetApnsChannelCommandError - */ -const de_GetApnsChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetApnsSandboxChannelCommand - */ -export const de_GetApnsSandboxChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApnsSandboxChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.APNSSandboxChannelResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetApnsSandboxChannelCommandError - */ -const de_GetApnsSandboxChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetApnsVoipChannelCommand - */ -export const de_GetApnsVoipChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApnsVoipChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.APNSVoipChannelResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetApnsVoipChannelCommandError - */ -const de_GetApnsVoipChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetApnsVoipSandboxChannelCommand - */ -export const de_GetApnsVoipSandboxChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApnsVoipSandboxChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.APNSVoipSandboxChannelResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetApnsVoipSandboxChannelCommandError - */ -const de_GetApnsVoipSandboxChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAppCommand - */ -export const de_GetAppCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAppCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ApplicationResponse = de_ApplicationResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetAppCommandError - */ -const de_GetAppCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetApplicationDateRangeKpiCommand - */ -export const de_GetApplicationDateRangeKpiCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApplicationDateRangeKpiCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ApplicationDateRangeKpiResponse = de_ApplicationDateRangeKpiResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetApplicationDateRangeKpiCommandError - */ -const de_GetApplicationDateRangeKpiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetApplicationSettingsCommand - */ -export const de_GetApplicationSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApplicationSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ApplicationSettingsResource = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetApplicationSettingsCommandError - */ -const de_GetApplicationSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAppsCommand - */ -export const de_GetAppsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAppsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ApplicationsResponse = de_ApplicationsResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetAppsCommandError - */ -const de_GetAppsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetBaiduChannelCommand - */ -export const de_GetBaiduChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBaiduChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.BaiduChannelResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetBaiduChannelCommandError - */ -const de_GetBaiduChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCampaignCommand - */ -export const de_GetCampaignCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCampaignCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CampaignResponse = de_CampaignResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetCampaignCommandError - */ -const de_GetCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCampaignActivitiesCommand - */ -export const de_GetCampaignActivitiesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCampaignActivitiesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ActivitiesResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetCampaignActivitiesCommandError - */ -const de_GetCampaignActivitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCampaignDateRangeKpiCommand - */ -export const de_GetCampaignDateRangeKpiCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCampaignDateRangeKpiCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CampaignDateRangeKpiResponse = de_CampaignDateRangeKpiResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetCampaignDateRangeKpiCommandError - */ -const de_GetCampaignDateRangeKpiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCampaignsCommand - */ -export const de_GetCampaignsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCampaignsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CampaignsResponse = de_CampaignsResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetCampaignsCommandError - */ -const de_GetCampaignsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCampaignVersionCommand - */ -export const de_GetCampaignVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCampaignVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CampaignResponse = de_CampaignResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetCampaignVersionCommandError - */ -const de_GetCampaignVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCampaignVersionsCommand - */ -export const de_GetCampaignVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCampaignVersionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.CampaignsResponse = de_CampaignsResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetCampaignVersionsCommandError - */ -const de_GetCampaignVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetChannelsCommand - */ -export const de_GetChannelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChannelsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ChannelsResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetChannelsCommandError - */ -const de_GetChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEmailChannelCommand - */ -export const de_GetEmailChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEmailChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.EmailChannelResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetEmailChannelCommandError - */ -const de_GetEmailChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEmailTemplateCommand - */ -export const de_GetEmailTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEmailTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.EmailTemplateResponse = de_EmailTemplateResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetEmailTemplateCommandError - */ -const de_GetEmailTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEndpointCommand - */ -export const de_GetEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEndpointCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.EndpointResponse = de_EndpointResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetEndpointCommandError - */ -const de_GetEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEventStreamCommand - */ -export const de_GetEventStreamCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEventStreamCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.EventStream = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetEventStreamCommandError - */ -const de_GetEventStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetExportJobCommand - */ -export const de_GetExportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetExportJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ExportJobResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetExportJobCommandError - */ -const de_GetExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetExportJobsCommand - */ -export const de_GetExportJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetExportJobsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ExportJobsResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetExportJobsCommandError - */ -const de_GetExportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetGcmChannelCommand - */ -export const de_GetGcmChannelCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGcmChannelCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.GCMChannelResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetGcmChannelCommandError - */ -const de_GetGcmChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetImportJobCommand - */ -export const de_GetImportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImportJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ImportJobResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetImportJobCommandError - */ -const de_GetImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetImportJobsCommand - */ -export const de_GetImportJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImportJobsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ImportJobsResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetImportJobsCommandError - */ -const de_GetImportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetInAppMessagesCommand - */ -export const de_GetInAppMessagesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInAppMessagesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.InAppMessagesResponse = de_InAppMessagesResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetInAppMessagesCommandError - */ -const de_GetInAppMessagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetInAppTemplateCommand - */ -export const de_GetInAppTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInAppTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.InAppTemplateResponse = de_InAppTemplateResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetInAppTemplateCommandError - */ -const de_GetInAppTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetJourneyCommand - */ -export const de_GetJourneyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJourneyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.JourneyResponse = de_JourneyResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetJourneyCommandError - */ -const de_GetJourneyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetJourneyDateRangeKpiCommand - */ -export const de_GetJourneyDateRangeKpiCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJourneyDateRangeKpiCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.JourneyDateRangeKpiResponse = de_JourneyDateRangeKpiResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetJourneyDateRangeKpiCommandError - */ -const de_GetJourneyDateRangeKpiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetJourneyExecutionActivityMetricsCommand - */ -export const de_GetJourneyExecutionActivityMetricsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJourneyExecutionActivityMetricsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.JourneyExecutionActivityMetricsResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetJourneyExecutionActivityMetricsCommandError - */ -const de_GetJourneyExecutionActivityMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetJourneyExecutionMetricsCommand - */ -export const de_GetJourneyExecutionMetricsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJourneyExecutionMetricsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.JourneyExecutionMetricsResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetJourneyExecutionMetricsCommandError - */ -const de_GetJourneyExecutionMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetJourneyRunExecutionActivityMetricsCommand - */ -export const de_GetJourneyRunExecutionActivityMetricsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJourneyRunExecutionActivityMetricsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.JourneyRunExecutionActivityMetricsResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetJourneyRunExecutionActivityMetricsCommandError - */ -const de_GetJourneyRunExecutionActivityMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetJourneyRunExecutionMetricsCommand - */ -export const de_GetJourneyRunExecutionMetricsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJourneyRunExecutionMetricsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.JourneyRunExecutionMetricsResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetJourneyRunExecutionMetricsCommandError - */ -const de_GetJourneyRunExecutionMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetJourneyRunsCommand - */ -export const de_GetJourneyRunsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJourneyRunsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.JourneyRunsResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetJourneyRunsCommandError - */ -const de_GetJourneyRunsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPushTemplateCommand - */ -export const de_GetPushTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPushTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.PushNotificationTemplateResponse = de_PushNotificationTemplateResponse(data, context); - return contents; -}; - -/** - * deserializeAws_restJson1GetPushTemplateCommandError - */ -const de_GetPushTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRecommenderConfigurationCommand - */ -export const de_GetRecommenderConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRecommenderConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.RecommenderConfigurationResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1GetRecommenderConfigurationCommandError - */ -const de_GetRecommenderConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRecommenderConfigurationsCommand - */ -export const de_GetRecommenderConfigurationsCommand = async ( +export const de_GetApnsVoipChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRecommenderConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ListRecommenderConfigurationsResponse = _json(data); + contents.APNSVoipChannelResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1GetRecommenderConfigurationsCommandError - */ -const de_GetRecommenderConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSegmentCommand + * deserializeAws_restJson1GetApnsVoipSandboxChannelCommand */ -export const de_GetSegmentCommand = async ( +export const de_GetApnsVoipSandboxChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSegmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.SegmentResponse = de_SegmentResponse(data, context); + contents.APNSVoipSandboxChannelResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1GetSegmentCommandError + * deserializeAws_restJson1GetAppCommand */ -const de_GetSegmentCommandError = async ( +export const de_GetAppCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.ApplicationResponse = de_ApplicationResponse(data, context); + return contents; }; /** - * deserializeAws_restJson1GetSegmentExportJobsCommand + * deserializeAws_restJson1GetApplicationDateRangeKpiCommand */ -export const de_GetSegmentExportJobsCommand = async ( +export const de_GetApplicationDateRangeKpiCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSegmentExportJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ExportJobsResponse = _json(data); + contents.ApplicationDateRangeKpiResponse = de_ApplicationDateRangeKpiResponse(data, context); return contents; }; /** - * deserializeAws_restJson1GetSegmentExportJobsCommandError + * deserializeAws_restJson1GetApplicationSettingsCommand */ -const de_GetSegmentExportJobsCommandError = async ( +export const de_GetApplicationSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.ApplicationSettingsResource = _json(data); + return contents; }; /** - * deserializeAws_restJson1GetSegmentImportJobsCommand + * deserializeAws_restJson1GetAppsCommand */ -export const de_GetSegmentImportJobsCommand = async ( +export const de_GetAppsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSegmentImportJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ImportJobsResponse = _json(data); + contents.ApplicationsResponse = de_ApplicationsResponse(data, context); return contents; }; /** - * deserializeAws_restJson1GetSegmentImportJobsCommandError + * deserializeAws_restJson1GetBaiduChannelCommand */ -const de_GetSegmentImportJobsCommandError = async ( +export const de_GetBaiduChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.BaiduChannelResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1GetSegmentsCommand + * deserializeAws_restJson1GetCampaignCommand */ -export const de_GetSegmentsCommand = async ( +export const de_GetCampaignCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSegmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.SegmentsResponse = de_SegmentsResponse(data, context); + contents.CampaignResponse = de_CampaignResponse(data, context); return contents; }; /** - * deserializeAws_restJson1GetSegmentsCommandError + * deserializeAws_restJson1GetCampaignActivitiesCommand */ -const de_GetSegmentsCommandError = async ( +export const de_GetCampaignActivitiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.ActivitiesResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1GetSegmentVersionCommand + * deserializeAws_restJson1GetCampaignDateRangeKpiCommand */ -export const de_GetSegmentVersionCommand = async ( +export const de_GetCampaignDateRangeKpiCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSegmentVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.SegmentResponse = de_SegmentResponse(data, context); + contents.CampaignDateRangeKpiResponse = de_CampaignDateRangeKpiResponse(data, context); return contents; }; /** - * deserializeAws_restJson1GetSegmentVersionCommandError + * deserializeAws_restJson1GetCampaignsCommand */ -const de_GetSegmentVersionCommandError = async ( +export const de_GetCampaignsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.CampaignsResponse = de_CampaignsResponse(data, context); + return contents; }; /** - * deserializeAws_restJson1GetSegmentVersionsCommand + * deserializeAws_restJson1GetCampaignVersionCommand */ -export const de_GetSegmentVersionsCommand = async ( +export const de_GetCampaignVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSegmentVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.SegmentsResponse = de_SegmentsResponse(data, context); + contents.CampaignResponse = de_CampaignResponse(data, context); return contents; }; /** - * deserializeAws_restJson1GetSegmentVersionsCommandError + * deserializeAws_restJson1GetCampaignVersionsCommand */ -const de_GetSegmentVersionsCommandError = async ( +export const de_GetCampaignVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.CampaignsResponse = de_CampaignsResponse(data, context); + return contents; }; /** - * deserializeAws_restJson1GetSmsChannelCommand + * deserializeAws_restJson1GetChannelsCommand */ -export const de_GetSmsChannelCommand = async ( +export const de_GetChannelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSmsChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.SMSChannelResponse = _json(data); + contents.ChannelsResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1GetSmsChannelCommandError + * deserializeAws_restJson1GetEmailChannelCommand */ -const de_GetSmsChannelCommandError = async ( +export const de_GetEmailChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.EmailChannelResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1GetSmsTemplateCommand + * deserializeAws_restJson1GetEmailTemplateCommand */ -export const de_GetSmsTemplateCommand = async ( +export const de_GetEmailTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSmsTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.SMSTemplateResponse = de_SMSTemplateResponse(data, context); + contents.EmailTemplateResponse = de_EmailTemplateResponse(data, context); return contents; }; /** - * deserializeAws_restJson1GetSmsTemplateCommandError + * deserializeAws_restJson1GetEndpointCommand */ -const de_GetSmsTemplateCommandError = async ( +export const de_GetEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.EndpointResponse = de_EndpointResponse(data, context); + return contents; }; /** - * deserializeAws_restJson1GetUserEndpointsCommand + * deserializeAws_restJson1GetEventStreamCommand */ -export const de_GetUserEndpointsCommand = async ( +export const de_GetEventStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUserEndpointsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.EndpointsResponse = de_EndpointsResponse(data, context); + contents.EventStream = _json(data); return contents; }; /** - * deserializeAws_restJson1GetUserEndpointsCommandError + * deserializeAws_restJson1GetExportJobCommand */ -const de_GetUserEndpointsCommandError = async ( +export const de_GetExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.ExportJobResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1GetVoiceChannelCommand + * deserializeAws_restJson1GetExportJobsCommand */ -export const de_GetVoiceChannelCommand = async ( +export const de_GetExportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.VoiceChannelResponse = _json(data); + contents.ExportJobsResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1GetVoiceChannelCommandError + * deserializeAws_restJson1GetGcmChannelCommand */ -const de_GetVoiceChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_GetGcmChannelCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.GCMChannelResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1GetVoiceTemplateCommand + * deserializeAws_restJson1GetImportJobCommand */ -export const de_GetVoiceTemplateCommand = async ( +export const de_GetImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVoiceTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.VoiceTemplateResponse = de_VoiceTemplateResponse(data, context); + contents.ImportJobResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1GetVoiceTemplateCommandError + * deserializeAws_restJson1GetImportJobsCommand */ -const de_GetVoiceTemplateCommandError = async ( +export const de_GetImportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.ImportJobsResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1ListJourneysCommand + * deserializeAws_restJson1GetInAppMessagesCommand */ -export const de_ListJourneysCommand = async ( +export const de_GetInAppMessagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJourneysCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.JourneysResponse = de_JourneysResponse(data, context); + contents.InAppMessagesResponse = de_InAppMessagesResponse(data, context); return contents; }; /** - * deserializeAws_restJson1ListJourneysCommandError + * deserializeAws_restJson1GetInAppTemplateCommand */ -const de_ListJourneysCommandError = async ( +export const de_GetInAppTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.InAppTemplateResponse = de_InAppTemplateResponse(data, context); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1GetJourneyCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_GetJourneyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.TagsModel = de_TagsModel(data, context); + contents.JourneyResponse = de_JourneyResponse(data, context); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1GetJourneyDateRangeKpiCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_GetJourneyDateRangeKpiCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.JourneyDateRangeKpiResponse = de_JourneyDateRangeKpiResponse(data, context); + return contents; }; /** - * deserializeAws_restJson1ListTemplatesCommand + * deserializeAws_restJson1GetJourneyExecutionActivityMetricsCommand */ -export const de_ListTemplatesCommand = async ( +export const de_GetJourneyExecutionActivityMetricsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.TemplatesResponse = de_TemplatesResponse(data, context); + contents.JourneyExecutionActivityMetricsResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1ListTemplatesCommandError + * deserializeAws_restJson1GetJourneyExecutionMetricsCommand */ -const de_ListTemplatesCommandError = async ( +export const de_GetJourneyExecutionMetricsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.JourneyExecutionMetricsResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1ListTemplateVersionsCommand + * deserializeAws_restJson1GetJourneyRunExecutionActivityMetricsCommand */ -export const de_ListTemplateVersionsCommand = async ( +export const de_GetJourneyRunExecutionActivityMetricsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTemplateVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.TemplateVersionsResponse = _json(data); + contents.JourneyRunExecutionActivityMetricsResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1ListTemplateVersionsCommandError + * deserializeAws_restJson1GetJourneyRunExecutionMetricsCommand */ -const de_ListTemplateVersionsCommandError = async ( +export const de_GetJourneyRunExecutionMetricsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.JourneyRunExecutionMetricsResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1PhoneNumberValidateCommand + * deserializeAws_restJson1GetJourneyRunsCommand + */ +export const de_GetJourneyRunsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.JourneyRunsResponse = _json(data); + return contents; +}; + +/** + * deserializeAws_restJson1GetPushTemplateCommand */ -export const de_PhoneNumberValidateCommand = async ( +export const de_GetPushTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PhoneNumberValidateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.NumberValidateResponse = _json(data); + contents.PushNotificationTemplateResponse = de_PushNotificationTemplateResponse(data, context); return contents; }; /** - * deserializeAws_restJson1PhoneNumberValidateCommandError + * deserializeAws_restJson1GetRecommenderConfigurationCommand */ -const de_PhoneNumberValidateCommandError = async ( +export const de_GetRecommenderConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.RecommenderConfigurationResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1PutEventsCommand + * deserializeAws_restJson1GetRecommenderConfigurationsCommand */ -export const de_PutEventsCommand = async ( +export const de_GetRecommenderConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_PutEventsCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.EventsResponse = _json(data); + contents.ListRecommenderConfigurationsResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1PutEventsCommandError + * deserializeAws_restJson1GetSegmentCommand */ -const de_PutEventsCommandError = async ( +export const de_GetSegmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.SegmentResponse = de_SegmentResponse(data, context); + return contents; }; /** - * deserializeAws_restJson1PutEventStreamCommand + * deserializeAws_restJson1GetSegmentExportJobsCommand */ -export const de_PutEventStreamCommand = async ( +export const de_GetSegmentExportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutEventStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.EventStream = _json(data); + contents.ExportJobsResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1PutEventStreamCommandError + * deserializeAws_restJson1GetSegmentImportJobsCommand */ -const de_PutEventStreamCommandError = async ( +export const de_GetSegmentImportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.ImportJobsResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1RemoveAttributesCommand + * deserializeAws_restJson1GetSegmentsCommand */ -export const de_RemoveAttributesCommand = async ( +export const de_GetSegmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.AttributesResource = _json(data); + contents.SegmentsResponse = de_SegmentsResponse(data, context); return contents; }; /** - * deserializeAws_restJson1RemoveAttributesCommandError + * deserializeAws_restJson1GetSegmentVersionCommand */ -const de_RemoveAttributesCommandError = async ( +export const de_GetSegmentVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.SegmentResponse = de_SegmentResponse(data, context); + return contents; }; /** - * deserializeAws_restJson1SendMessagesCommand + * deserializeAws_restJson1GetSegmentVersionsCommand */ -export const de_SendMessagesCommand = async ( +export const de_GetSegmentVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendMessagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.MessageResponse = _json(data); + contents.SegmentsResponse = de_SegmentsResponse(data, context); return contents; }; /** - * deserializeAws_restJson1SendMessagesCommandError + * deserializeAws_restJson1GetSmsChannelCommand */ -const de_SendMessagesCommandError = async ( +export const de_GetSmsChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.SMSChannelResponse = _json(data); + return contents; +}; + +/** + * deserializeAws_restJson1GetSmsTemplateCommand + */ +export const de_GetSmsTemplateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.SMSTemplateResponse = de_SMSTemplateResponse(data, context); + return contents; }; /** - * deserializeAws_restJson1SendOTPMessageCommand + * deserializeAws_restJson1GetUserEndpointsCommand */ -export const de_SendOTPMessageCommand = async ( +export const de_GetUserEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendOTPMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.MessageResponse = _json(data); + contents.EndpointsResponse = de_EndpointsResponse(data, context); return contents; }; /** - * deserializeAws_restJson1SendOTPMessageCommandError + * deserializeAws_restJson1GetVoiceChannelCommand */ -const de_SendOTPMessageCommandError = async ( +export const de_GetVoiceChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.VoiceChannelResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1SendUsersMessagesCommand + * deserializeAws_restJson1GetVoiceTemplateCommand */ -export const de_SendUsersMessagesCommand = async ( +export const de_GetVoiceTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendUsersMessagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.SendUsersMessageResponse = _json(data); + contents.VoiceTemplateResponse = de_VoiceTemplateResponse(data, context); return contents; }; /** - * deserializeAws_restJson1SendUsersMessagesCommandError + * deserializeAws_restJson1ListJourneysCommand */ -const de_SendUsersMessagesCommandError = async ( +export const de_ListJourneysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.JourneysResponse = de_JourneysResponse(data, context); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_TagResourceCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.TagsModel = de_TagsModel(data, context); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1ListTemplatesCommand */ -const de_TagResourceCommandError = async ( +export const de_ListTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.TemplatesResponse = de_TemplatesResponse(data, context); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1ListTemplateVersionsCommand */ -export const de_UntagResourceCommand = async ( +export const de_ListTemplateVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.TemplateVersionsResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1PhoneNumberValidateCommand */ -const de_UntagResourceCommandError = async ( +export const de_PhoneNumberValidateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.NumberValidateResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1UpdateAdmChannelCommand + * deserializeAws_restJson1PutEventsCommand */ -export const de_UpdateAdmChannelCommand = async ( +export const de_PutEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.EventsResponse = _json(data); + return contents; +}; + +/** + * deserializeAws_restJson1PutEventStreamCommand + */ +export const de_PutEventStreamCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAdmChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ADMChannelResponse = _json(data); + contents.EventStream = _json(data); return contents; }; /** - * deserializeAws_restJson1UpdateAdmChannelCommandError + * deserializeAws_restJson1RemoveAttributesCommand */ -const de_UpdateAdmChannelCommandError = async ( +export const de_RemoveAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.AttributesResource = _json(data); + return contents; }; /** - * deserializeAws_restJson1UpdateApnsChannelCommand + * deserializeAws_restJson1SendMessagesCommand */ -export const de_UpdateApnsChannelCommand = async ( +export const de_SendMessagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApnsChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.APNSChannelResponse = _json(data); + contents.MessageResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1UpdateApnsChannelCommandError + * deserializeAws_restJson1SendOTPMessageCommand */ -const de_UpdateApnsChannelCommandError = async ( +export const de_SendOTPMessageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.MessageResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1UpdateApnsSandboxChannelCommand + * deserializeAws_restJson1SendUsersMessagesCommand */ -export const de_UpdateApnsSandboxChannelCommand = async ( +export const de_SendUsersMessagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApnsSandboxChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.APNSSandboxChannelResponse = _json(data); + contents.SendUsersMessageResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1UpdateApnsSandboxChannelCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_UpdateApnsSandboxChannelCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateApnsVoipChannelCommand + * deserializeAws_restJson1UntagResourceCommand */ -export const de_UpdateApnsVoipChannelCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApnsVoipChannelCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.APNSVoipChannelResponse = _json(data); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1UpdateApnsVoipChannelCommandError + * deserializeAws_restJson1UpdateAdmChannelCommand */ -const de_UpdateApnsVoipChannelCommandError = async ( +export const de_UpdateAdmChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.ADMChannelResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1UpdateApnsVoipSandboxChannelCommand + * deserializeAws_restJson1UpdateApnsChannelCommand */ -export const de_UpdateApnsVoipSandboxChannelCommand = async ( +export const de_UpdateApnsChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApnsVoipSandboxChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.APNSVoipSandboxChannelResponse = _json(data); + contents.APNSChannelResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1UpdateApnsVoipSandboxChannelCommandError + * deserializeAws_restJson1UpdateApnsSandboxChannelCommand */ -const de_UpdateApnsVoipSandboxChannelCommandError = async ( +export const de_UpdateApnsSandboxChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.APNSSandboxChannelResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1UpdateApplicationSettingsCommand + * deserializeAws_restJson1UpdateApnsVoipChannelCommand */ -export const de_UpdateApplicationSettingsCommand = async ( +export const de_UpdateApnsVoipChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApplicationSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.ApplicationSettingsResource = _json(data); + contents.APNSVoipChannelResponse = _json(data); return contents; }; /** - * deserializeAws_restJson1UpdateApplicationSettingsCommandError + * deserializeAws_restJson1UpdateApnsVoipSandboxChannelCommand */ -const de_UpdateApplicationSettingsCommandError = async ( +export const de_UpdateApnsVoipSandboxChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.APNSVoipSandboxChannelResponse = _json(data); + return contents; }; /** - * deserializeAws_restJson1UpdateBaiduChannelCommand + * deserializeAws_restJson1UpdateApplicationSettingsCommand */ -export const de_UpdateBaiduChannelCommand = async ( +export const de_UpdateApplicationSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBaiduChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.BaiduChannelResponse = _json(data); + contents.ApplicationSettingsResource = _json(data); return contents; }; /** - * deserializeAws_restJson1UpdateBaiduChannelCommandError + * deserializeAws_restJson1UpdateBaiduChannelCommand */ -const de_UpdateBaiduChannelCommandError = async ( +export const de_UpdateBaiduChannelCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.BaiduChannelResponse = _json(data); + return contents; }; /** @@ -9330,7 +4865,7 @@ export const de_UpdateCampaignCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCampaignCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9340,50 +4875,6 @@ export const de_UpdateCampaignCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateCampaignCommandError - */ -const de_UpdateCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEmailChannelCommand */ @@ -9392,7 +4883,7 @@ export const de_UpdateEmailChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEmailChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9402,50 +4893,6 @@ export const de_UpdateEmailChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEmailChannelCommandError - */ -const de_UpdateEmailChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEmailTemplateCommand */ @@ -9454,7 +4901,7 @@ export const de_UpdateEmailTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateEmailTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9464,50 +4911,6 @@ export const de_UpdateEmailTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEmailTemplateCommandError - */ -const de_UpdateEmailTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEndpointCommand */ @@ -9516,7 +4919,7 @@ export const de_UpdateEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9526,50 +4929,6 @@ export const de_UpdateEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEndpointCommandError - */ -const de_UpdateEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEndpointsBatchCommand */ @@ -9578,58 +4937,14 @@ export const de_UpdateEndpointsBatchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateEndpointsBatchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.MessageBody = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateEndpointsBatchCommandError - */ -const de_UpdateEndpointsBatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.MessageBody = _json(data); + return contents; }; /** @@ -9640,7 +4955,7 @@ export const de_UpdateGcmChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGcmChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9650,50 +4965,6 @@ export const de_UpdateGcmChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateGcmChannelCommandError - */ -const de_UpdateGcmChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateInAppTemplateCommand */ @@ -9702,7 +4973,7 @@ export const de_UpdateInAppTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateInAppTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9712,50 +4983,6 @@ export const de_UpdateInAppTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateInAppTemplateCommandError - */ -const de_UpdateInAppTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateJourneyCommand */ @@ -9764,7 +4991,7 @@ export const de_UpdateJourneyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateJourneyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9774,53 +5001,6 @@ export const de_UpdateJourneyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateJourneyCommandError - */ -const de_UpdateJourneyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.pinpoint#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateJourneyStateCommand */ @@ -9829,7 +5009,7 @@ export const de_UpdateJourneyStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateJourneyStateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9839,50 +5019,6 @@ export const de_UpdateJourneyStateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateJourneyStateCommandError - */ -const de_UpdateJourneyStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePushTemplateCommand */ @@ -9891,7 +5027,7 @@ export const de_UpdatePushTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdatePushTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -9901,50 +5037,6 @@ export const de_UpdatePushTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePushTemplateCommandError - */ -const de_UpdatePushTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRecommenderConfigurationCommand */ @@ -9953,58 +5045,14 @@ export const de_UpdateRecommenderConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRecommenderConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.RecommenderConfigurationResponse = _json(data); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateRecommenderConfigurationCommandError - */ -const de_UpdateRecommenderConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.RecommenderConfigurationResponse = _json(data); + return contents; }; /** @@ -10015,7 +5063,7 @@ export const de_UpdateSegmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSegmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -10025,50 +5073,6 @@ export const de_UpdateSegmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSegmentCommandError - */ -const de_UpdateSegmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSmsChannelCommand */ @@ -10077,7 +5081,7 @@ export const de_UpdateSmsChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSmsChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -10087,50 +5091,6 @@ export const de_UpdateSmsChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSmsChannelCommandError - */ -const de_UpdateSmsChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSmsTemplateCommand */ @@ -10139,7 +5099,7 @@ export const de_UpdateSmsTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateSmsTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -10149,50 +5109,6 @@ export const de_UpdateSmsTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSmsTemplateCommandError - */ -const de_UpdateSmsTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTemplateActiveVersionCommand */ @@ -10201,7 +5117,7 @@ export const de_UpdateTemplateActiveVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTemplateActiveVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -10211,50 +5127,6 @@ export const de_UpdateTemplateActiveVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateTemplateActiveVersionCommandError - */ -const de_UpdateTemplateActiveVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVoiceChannelCommand */ @@ -10263,7 +5135,7 @@ export const de_UpdateVoiceChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVoiceChannelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -10273,50 +5145,6 @@ export const de_UpdateVoiceChannelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateVoiceChannelCommandError - */ -const de_UpdateVoiceChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVoiceTemplateCommand */ @@ -10325,7 +5153,7 @@ export const de_UpdateVoiceTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_UpdateVoiceTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -10335,50 +5163,6 @@ export const de_UpdateVoiceTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateVoiceTemplateCommandError - */ -const de_UpdateVoiceTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.pinpoint#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.pinpoint#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.pinpoint#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.pinpoint#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pinpoint#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PayloadTooLargeException": - case "com.amazonaws.pinpoint#PayloadTooLargeException": - throw await de_PayloadTooLargeExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.pinpoint#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1VerifyOTPMessageCommand */ @@ -10387,7 +5171,7 @@ export const de_VerifyOTPMessageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_VerifyOTPMessageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -10398,12 +5182,9 @@ export const de_VerifyOTPMessageCommand = async ( }; /** - * deserializeAws_restJson1VerifyOTPMessageCommandError + * deserialize_Aws_restJson1CommandError */ -const de_VerifyOTPMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -10431,13 +5212,16 @@ const de_VerifyOTPMessageCommandError = async ( case "TooManyRequestsException": case "com.amazonaws.pinpoint#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.pinpoint#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-pipes/src/protocols/Aws_restJson1.ts b/clients/client-pipes/src/protocols/Aws_restJson1.ts index 78e482bcd3a4..f48a83cbaa78 100644 --- a/clients/client-pipes/src/protocols/Aws_restJson1.ts +++ b/clients/client-pipes/src/protocols/Aws_restJson1.ts @@ -331,7 +331,7 @@ export const de_CreatePipeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -349,47 +349,6 @@ export const de_CreatePipeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePipeCommandError - */ -const de_CreatePipeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.pipes#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.pipes#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pipes#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.pipes#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pipes#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pipes#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePipeCommand */ @@ -398,7 +357,7 @@ export const de_DeletePipeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -416,44 +375,6 @@ export const de_DeletePipeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePipeCommandError - */ -const de_DeletePipeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.pipes#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.pipes#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pipes#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pipes#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pipes#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribePipeCommand */ @@ -462,7 +383,7 @@ export const de_DescribePipeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribePipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -491,41 +412,6 @@ export const de_DescribePipeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribePipeCommandError - */ -const de_DescribePipeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.pipes#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pipes#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pipes#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pipes#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListPipesCommand */ @@ -534,7 +420,7 @@ export const de_ListPipesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPipesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -548,38 +434,6 @@ export const de_ListPipesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListPipesCommandError - */ -const de_ListPipesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.pipes#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pipes#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pipes#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -588,7 +442,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -601,38 +455,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.pipes#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pipes#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pipes#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartPipeCommand */ @@ -641,7 +463,7 @@ export const de_StartPipeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartPipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -659,44 +481,6 @@ export const de_StartPipeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartPipeCommandError - */ -const de_StartPipeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.pipes#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.pipes#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pipes#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pipes#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pipes#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopPipeCommand */ @@ -705,7 +489,7 @@ export const de_StopPipeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopPipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -723,44 +507,6 @@ export const de_StopPipeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopPipeCommandError - */ -const de_StopPipeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.pipes#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.pipes#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pipes#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.pipes#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pipes#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -769,7 +515,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -778,38 +524,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.pipes#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pipes#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pipes#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -818,7 +532,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -827,38 +541,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.pipes#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pipes#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.pipes#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePipeCommand */ @@ -867,7 +549,7 @@ export const de_UpdatePipeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePipeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -886,12 +568,9 @@ export const de_UpdatePipeCommand = async ( }; /** - * deserializeAws_restJson1UpdatePipeCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdatePipeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -907,6 +586,9 @@ const de_UpdatePipeCommandError = async ( case "NotFoundException": case "com.amazonaws.pipes#NotFoundException": throw await de_NotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.pipes#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.pipes#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -919,7 +601,7 @@ const de_UpdatePipeCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-polly/src/protocols/Aws_restJson1.ts b/clients/client-polly/src/protocols/Aws_restJson1.ts index 4727fb1c6a21..5d3519836c44 100644 --- a/clients/client-polly/src/protocols/Aws_restJson1.ts +++ b/clients/client-polly/src/protocols/Aws_restJson1.ts @@ -273,7 +273,7 @@ export const de_DeleteLexiconCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLexiconCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -282,35 +282,6 @@ export const de_DeleteLexiconCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLexiconCommandError - */ -const de_DeleteLexiconCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LexiconNotFoundException": - case "com.amazonaws.polly#LexiconNotFoundException": - throw await de_LexiconNotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.polly#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeVoicesCommand */ @@ -319,7 +290,7 @@ export const de_DescribeVoicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeVoicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -333,35 +304,6 @@ export const de_DescribeVoicesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeVoicesCommandError - */ -const de_DescribeVoicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.polly#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.polly#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetLexiconCommand */ @@ -370,7 +312,7 @@ export const de_GetLexiconCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLexiconCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -384,35 +326,6 @@ export const de_GetLexiconCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetLexiconCommandError - */ -const de_GetLexiconCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LexiconNotFoundException": - case "com.amazonaws.polly#LexiconNotFoundException": - throw await de_LexiconNotFoundExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.polly#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSpeechSynthesisTaskCommand */ @@ -421,7 +334,7 @@ export const de_GetSpeechSynthesisTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSpeechSynthesisTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -434,38 +347,6 @@ export const de_GetSpeechSynthesisTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSpeechSynthesisTaskCommandError - */ -const de_GetSpeechSynthesisTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidTaskIdException": - case "com.amazonaws.polly#InvalidTaskIdException": - throw await de_InvalidTaskIdExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.polly#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "SynthesisTaskNotFoundException": - case "com.amazonaws.polly#SynthesisTaskNotFoundException": - throw await de_SynthesisTaskNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListLexiconsCommand */ @@ -474,7 +355,7 @@ export const de_ListLexiconsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLexiconsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -488,35 +369,6 @@ export const de_ListLexiconsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListLexiconsCommandError - */ -const de_ListLexiconsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.polly#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.polly#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSpeechSynthesisTasksCommand */ @@ -525,7 +377,7 @@ export const de_ListSpeechSynthesisTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSpeechSynthesisTasksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -539,35 +391,6 @@ export const de_ListSpeechSynthesisTasksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSpeechSynthesisTasksCommandError - */ -const de_ListSpeechSynthesisTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.polly#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.polly#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutLexiconCommand */ @@ -576,7 +399,7 @@ export const de_PutLexiconCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutLexiconCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -585,50 +408,6 @@ export const de_PutLexiconCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutLexiconCommandError - */ -const de_PutLexiconCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLexiconException": - case "com.amazonaws.polly#InvalidLexiconException": - throw await de_InvalidLexiconExceptionRes(parsedOutput, context); - case "LexiconSizeExceededException": - case "com.amazonaws.polly#LexiconSizeExceededException": - throw await de_LexiconSizeExceededExceptionRes(parsedOutput, context); - case "MaxLexemeLengthExceededException": - case "com.amazonaws.polly#MaxLexemeLengthExceededException": - throw await de_MaxLexemeLengthExceededExceptionRes(parsedOutput, context); - case "MaxLexiconsNumberExceededException": - case "com.amazonaws.polly#MaxLexiconsNumberExceededException": - throw await de_MaxLexiconsNumberExceededExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.polly#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "UnsupportedPlsAlphabetException": - case "com.amazonaws.polly#UnsupportedPlsAlphabetException": - throw await de_UnsupportedPlsAlphabetExceptionRes(parsedOutput, context); - case "UnsupportedPlsLanguageException": - case "com.amazonaws.polly#UnsupportedPlsLanguageException": - throw await de_UnsupportedPlsLanguageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartSpeechSynthesisTaskCommand */ @@ -637,7 +416,7 @@ export const de_StartSpeechSynthesisTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartSpeechSynthesisTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -650,65 +429,6 @@ export const de_StartSpeechSynthesisTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartSpeechSynthesisTaskCommandError - */ -const de_StartSpeechSynthesisTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EngineNotSupportedException": - case "com.amazonaws.polly#EngineNotSupportedException": - throw await de_EngineNotSupportedExceptionRes(parsedOutput, context); - case "InvalidS3BucketException": - case "com.amazonaws.polly#InvalidS3BucketException": - throw await de_InvalidS3BucketExceptionRes(parsedOutput, context); - case "InvalidS3KeyException": - case "com.amazonaws.polly#InvalidS3KeyException": - throw await de_InvalidS3KeyExceptionRes(parsedOutput, context); - case "InvalidSampleRateException": - case "com.amazonaws.polly#InvalidSampleRateException": - throw await de_InvalidSampleRateExceptionRes(parsedOutput, context); - case "InvalidSnsTopicArnException": - case "com.amazonaws.polly#InvalidSnsTopicArnException": - throw await de_InvalidSnsTopicArnExceptionRes(parsedOutput, context); - case "InvalidSsmlException": - case "com.amazonaws.polly#InvalidSsmlException": - throw await de_InvalidSsmlExceptionRes(parsedOutput, context); - case "LanguageNotSupportedException": - case "com.amazonaws.polly#LanguageNotSupportedException": - throw await de_LanguageNotSupportedExceptionRes(parsedOutput, context); - case "LexiconNotFoundException": - case "com.amazonaws.polly#LexiconNotFoundException": - throw await de_LexiconNotFoundExceptionRes(parsedOutput, context); - case "MarksNotSupportedForFormatException": - case "com.amazonaws.polly#MarksNotSupportedForFormatException": - throw await de_MarksNotSupportedForFormatExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.polly#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); - case "SsmlMarksNotSupportedForTextTypeException": - case "com.amazonaws.polly#SsmlMarksNotSupportedForTextTypeException": - throw await de_SsmlMarksNotSupportedForTextTypeExceptionRes(parsedOutput, context); - case "TextLengthExceededException": - case "com.amazonaws.polly#TextLengthExceededException": - throw await de_TextLengthExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SynthesizeSpeechCommand */ @@ -717,7 +437,7 @@ export const de_SynthesizeSpeechCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SynthesizeSpeechCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -731,39 +451,72 @@ export const de_SynthesizeSpeechCommand = async ( }; /** - * deserializeAws_restJson1SynthesizeSpeechCommandError + * deserialize_Aws_restJson1CommandError */ -const de_SynthesizeSpeechCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "LexiconNotFoundException": + case "com.amazonaws.polly#LexiconNotFoundException": + throw await de_LexiconNotFoundExceptionRes(parsedOutput, context); + case "ServiceFailureException": + case "com.amazonaws.polly#ServiceFailureException": + throw await de_ServiceFailureExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.polly#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "InvalidTaskIdException": + case "com.amazonaws.polly#InvalidTaskIdException": + throw await de_InvalidTaskIdExceptionRes(parsedOutput, context); + case "SynthesisTaskNotFoundException": + case "com.amazonaws.polly#SynthesisTaskNotFoundException": + throw await de_SynthesisTaskNotFoundExceptionRes(parsedOutput, context); + case "InvalidLexiconException": + case "com.amazonaws.polly#InvalidLexiconException": + throw await de_InvalidLexiconExceptionRes(parsedOutput, context); + case "LexiconSizeExceededException": + case "com.amazonaws.polly#LexiconSizeExceededException": + throw await de_LexiconSizeExceededExceptionRes(parsedOutput, context); + case "MaxLexemeLengthExceededException": + case "com.amazonaws.polly#MaxLexemeLengthExceededException": + throw await de_MaxLexemeLengthExceededExceptionRes(parsedOutput, context); + case "MaxLexiconsNumberExceededException": + case "com.amazonaws.polly#MaxLexiconsNumberExceededException": + throw await de_MaxLexiconsNumberExceededExceptionRes(parsedOutput, context); + case "UnsupportedPlsAlphabetException": + case "com.amazonaws.polly#UnsupportedPlsAlphabetException": + throw await de_UnsupportedPlsAlphabetExceptionRes(parsedOutput, context); + case "UnsupportedPlsLanguageException": + case "com.amazonaws.polly#UnsupportedPlsLanguageException": + throw await de_UnsupportedPlsLanguageExceptionRes(parsedOutput, context); case "EngineNotSupportedException": case "com.amazonaws.polly#EngineNotSupportedException": throw await de_EngineNotSupportedExceptionRes(parsedOutput, context); + case "InvalidS3BucketException": + case "com.amazonaws.polly#InvalidS3BucketException": + throw await de_InvalidS3BucketExceptionRes(parsedOutput, context); + case "InvalidS3KeyException": + case "com.amazonaws.polly#InvalidS3KeyException": + throw await de_InvalidS3KeyExceptionRes(parsedOutput, context); case "InvalidSampleRateException": case "com.amazonaws.polly#InvalidSampleRateException": throw await de_InvalidSampleRateExceptionRes(parsedOutput, context); + case "InvalidSnsTopicArnException": + case "com.amazonaws.polly#InvalidSnsTopicArnException": + throw await de_InvalidSnsTopicArnExceptionRes(parsedOutput, context); case "InvalidSsmlException": case "com.amazonaws.polly#InvalidSsmlException": throw await de_InvalidSsmlExceptionRes(parsedOutput, context); case "LanguageNotSupportedException": case "com.amazonaws.polly#LanguageNotSupportedException": throw await de_LanguageNotSupportedExceptionRes(parsedOutput, context); - case "LexiconNotFoundException": - case "com.amazonaws.polly#LexiconNotFoundException": - throw await de_LexiconNotFoundExceptionRes(parsedOutput, context); case "MarksNotSupportedForFormatException": case "com.amazonaws.polly#MarksNotSupportedForFormatException": throw await de_MarksNotSupportedForFormatExceptionRes(parsedOutput, context); - case "ServiceFailureException": - case "com.amazonaws.polly#ServiceFailureException": - throw await de_ServiceFailureExceptionRes(parsedOutput, context); case "SsmlMarksNotSupportedForTextTypeException": case "com.amazonaws.polly#SsmlMarksNotSupportedForTextTypeException": throw await de_SsmlMarksNotSupportedForTextTypeExceptionRes(parsedOutput, context); @@ -776,7 +529,7 @@ const de_SynthesizeSpeechCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-pricing/src/protocols/Aws_json1_1.ts b/clients/client-pricing/src/protocols/Aws_json1_1.ts index 6a9f68777dad..8767b8bee21d 100644 --- a/clients/client-pricing/src/protocols/Aws_json1_1.ts +++ b/clients/client-pricing/src/protocols/Aws_json1_1.ts @@ -114,7 +114,7 @@ export const de_DescribeServicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeServicesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -126,44 +126,6 @@ export const de_DescribeServicesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeServicesCommandError - */ -const de_DescribeServicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExpiredNextTokenException": - case "com.amazonaws.pricing#ExpiredNextTokenException": - throw await de_ExpiredNextTokenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.pricing#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.pricing#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.pricing#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pricing#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAttributeValuesCommand */ @@ -172,7 +134,7 @@ export const de_GetAttributeValuesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAttributeValuesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -184,44 +146,6 @@ export const de_GetAttributeValuesCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAttributeValuesCommandError - */ -const de_GetAttributeValuesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExpiredNextTokenException": - case "com.amazonaws.pricing#ExpiredNextTokenException": - throw await de_ExpiredNextTokenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.pricing#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.pricing#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.pricing#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pricing#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetPriceListFileUrlCommand */ @@ -230,7 +154,7 @@ export const de_GetPriceListFileUrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPriceListFileUrlCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -242,41 +166,6 @@ export const de_GetPriceListFileUrlCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetPriceListFileUrlCommandError - */ -const de_GetPriceListFileUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pricing#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.pricing#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.pricing#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pricing#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetProductsCommand */ @@ -285,7 +174,7 @@ export const de_GetProductsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetProductsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -297,44 +186,6 @@ export const de_GetProductsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetProductsCommandError - */ -const de_GetProductsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExpiredNextTokenException": - case "com.amazonaws.pricing#ExpiredNextTokenException": - throw await de_ExpiredNextTokenExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.pricing#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.pricing#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.pricing#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.pricing#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPriceListsCommand */ @@ -343,7 +194,7 @@ export const de_ListPriceListsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPriceListsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -356,21 +207,15 @@ export const de_ListPriceListsCommand = async ( }; /** - * deserializeAws_json1_1ListPriceListsCommandError + * deserialize_Aws_json1_1CommandError */ -const de_ListPriceListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.pricing#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); case "ExpiredNextTokenException": case "com.amazonaws.pricing#ExpiredNextTokenException": throw await de_ExpiredNextTokenExceptionRes(parsedOutput, context); @@ -386,13 +231,16 @@ const de_ListPriceListsCommandError = async ( case "NotFoundException": case "com.amazonaws.pricing#NotFoundException": throw await de_NotFoundExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.pricing#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts b/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts index 0101ba967b68..00ad8a895b70 100644 --- a/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts +++ b/clients/client-privatenetworks/src/protocols/Aws_restJson1.ts @@ -684,7 +684,7 @@ export const de_AcknowledgeOrderReceiptCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcknowledgeOrderReceiptCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -697,38 +697,6 @@ export const de_AcknowledgeOrderReceiptCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcknowledgeOrderReceiptCommandError - */ -const de_AcknowledgeOrderReceiptCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ActivateDeviceIdentifierCommand */ @@ -737,7 +705,7 @@ export const de_ActivateDeviceIdentifierCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ActivateDeviceIdentifierCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -751,38 +719,6 @@ export const de_ActivateDeviceIdentifierCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ActivateDeviceIdentifierCommandError - */ -const de_ActivateDeviceIdentifierCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ActivateNetworkSiteCommand */ @@ -791,7 +727,7 @@ export const de_ActivateNetworkSiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ActivateNetworkSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -804,38 +740,6 @@ export const de_ActivateNetworkSiteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ActivateNetworkSiteCommandError - */ -const de_ActivateNetworkSiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ConfigureAccessPointCommand */ @@ -844,7 +748,7 @@ export const de_ConfigureAccessPointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ConfigureAccessPointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -857,38 +761,6 @@ export const de_ConfigureAccessPointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ConfigureAccessPointCommandError - */ -const de_ConfigureAccessPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateNetworkCommand */ @@ -897,7 +769,7 @@ export const de_CreateNetworkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -911,38 +783,6 @@ export const de_CreateNetworkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateNetworkCommandError - */ -const de_CreateNetworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.privatenetworks#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateNetworkSiteCommand */ @@ -951,7 +791,7 @@ export const de_CreateNetworkSiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateNetworkSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -965,38 +805,6 @@ export const de_CreateNetworkSiteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateNetworkSiteCommandError - */ -const de_CreateNetworkSiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeactivateDeviceIdentifierCommand */ @@ -1005,7 +813,7 @@ export const de_DeactivateDeviceIdentifierCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeactivateDeviceIdentifierCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1018,38 +826,6 @@ export const de_DeactivateDeviceIdentifierCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeactivateDeviceIdentifierCommandError - */ -const de_DeactivateDeviceIdentifierCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteNetworkCommand */ @@ -1058,7 +834,7 @@ export const de_DeleteNetworkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1071,41 +847,6 @@ export const de_DeleteNetworkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteNetworkCommandError - */ -const de_DeleteNetworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.privatenetworks#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteNetworkSiteCommand */ @@ -1114,7 +855,7 @@ export const de_DeleteNetworkSiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteNetworkSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1127,41 +868,6 @@ export const de_DeleteNetworkSiteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteNetworkSiteCommandError - */ -const de_DeleteNetworkSiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.privatenetworks#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDeviceIdentifierCommand */ @@ -1170,7 +876,7 @@ export const de_GetDeviceIdentifierCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeviceIdentifierCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1184,38 +890,6 @@ export const de_GetDeviceIdentifierCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeviceIdentifierCommandError - */ -const de_GetDeviceIdentifierCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetNetworkCommand */ @@ -1224,7 +898,7 @@ export const de_GetNetworkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1238,38 +912,6 @@ export const de_GetNetworkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetNetworkCommandError - */ -const de_GetNetworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetNetworkResourceCommand */ @@ -1278,7 +920,7 @@ export const de_GetNetworkResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetNetworkResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1292,38 +934,6 @@ export const de_GetNetworkResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetNetworkResourceCommandError - */ -const de_GetNetworkResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetNetworkSiteCommand */ @@ -1332,7 +942,7 @@ export const de_GetNetworkSiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetNetworkSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1346,38 +956,6 @@ export const de_GetNetworkSiteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetNetworkSiteCommandError - */ -const de_GetNetworkSiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetOrderCommand */ @@ -1386,7 +964,7 @@ export const de_GetOrderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOrderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1400,38 +978,6 @@ export const de_GetOrderCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetOrderCommandError - */ -const de_GetOrderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDeviceIdentifiersCommand */ @@ -1440,7 +986,7 @@ export const de_ListDeviceIdentifiersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeviceIdentifiersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1454,38 +1000,6 @@ export const de_ListDeviceIdentifiersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDeviceIdentifiersCommandError - */ -const de_ListDeviceIdentifiersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListNetworkResourcesCommand */ @@ -1494,7 +1008,7 @@ export const de_ListNetworkResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNetworkResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1508,38 +1022,6 @@ export const de_ListNetworkResourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListNetworkResourcesCommandError - */ -const de_ListNetworkResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListNetworksCommand */ @@ -1548,7 +1030,7 @@ export const de_ListNetworksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNetworksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1557,41 +1039,9 @@ export const de_ListNetworksCommand = async ( const doc = take(data, { networks: (_) => de_NetworkList(_, context), nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListNetworksCommandError - */ -const de_ListNetworksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1602,7 +1052,7 @@ export const de_ListNetworkSitesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNetworkSitesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1616,38 +1066,6 @@ export const de_ListNetworkSitesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListNetworkSitesCommandError - */ -const de_ListNetworkSitesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListOrdersCommand */ @@ -1656,7 +1074,7 @@ export const de_ListOrdersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOrdersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1670,38 +1088,6 @@ export const de_ListOrdersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListOrdersCommandError - */ -const de_ListOrdersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1710,7 +1096,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1723,50 +1109,12 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.privatenetworks#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.privatenetworks#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PingCommand */ export const de_PingCommand = async (output: __HttpResponse, context: __SerdeContext): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1779,29 +1127,6 @@ export const de_PingCommand = async (output: __HttpResponse, context: __SerdeCon return contents; }; -/** - * deserializeAws_restJson1PingCommandError - */ -const de_PingCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartNetworkResourceUpdateCommand */ @@ -1810,7 +1135,7 @@ export const de_StartNetworkResourceUpdateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartNetworkResourceUpdateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1823,38 +1148,6 @@ export const de_StartNetworkResourceUpdateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartNetworkResourceUpdateCommandError - */ -const de_StartNetworkResourceUpdateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1863,7 +1156,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1872,44 +1165,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.privatenetworks#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.privatenetworks#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1918,7 +1173,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1927,44 +1182,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.privatenetworks#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.privatenetworks#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateNetworkSiteCommand */ @@ -1973,7 +1190,7 @@ export const de_UpdateNetworkSiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateNetworkSiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1987,38 +1204,6 @@ export const de_UpdateNetworkSiteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateNetworkSiteCommandError - */ -const de_UpdateNetworkSiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.privatenetworks#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.privatenetworks#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.privatenetworks#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateNetworkSitePlanCommand */ @@ -2027,7 +1212,7 @@ export const de_UpdateNetworkSitePlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateNetworkSitePlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2042,12 +1227,9 @@ export const de_UpdateNetworkSitePlanCommand = async ( }; /** - * deserializeAws_restJson1UpdateNetworkSitePlanCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateNetworkSitePlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2063,13 +1245,22 @@ const de_UpdateNetworkSitePlanCommandError = async ( case "ValidationException": case "com.amazonaws.privatenetworks#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.privatenetworks#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.privatenetworks#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.privatenetworks#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-proton/src/protocols/Aws_json1_0.ts b/clients/client-proton/src/protocols/Aws_json1_0.ts index ffafb031a03f..224d2628abcf 100644 --- a/clients/client-proton/src/protocols/Aws_json1_0.ts +++ b/clients/client-proton/src/protocols/Aws_json1_0.ts @@ -1625,7 +1625,7 @@ export const de_AcceptEnvironmentAccountConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptEnvironmentAccountConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1637,47 +1637,6 @@ export const de_AcceptEnvironmentAccountConnectionCommand = async ( return response; }; -/** - * deserializeAws_json1_0AcceptEnvironmentAccountConnectionCommandError - */ -const de_AcceptEnvironmentAccountConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CancelComponentDeploymentCommand */ @@ -1686,7 +1645,7 @@ export const de_CancelComponentDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelComponentDeploymentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1698,47 +1657,6 @@ export const de_CancelComponentDeploymentCommand = async ( return response; }; -/** - * deserializeAws_json1_0CancelComponentDeploymentCommandError - */ -const de_CancelComponentDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CancelEnvironmentDeploymentCommand */ @@ -1747,7 +1665,7 @@ export const de_CancelEnvironmentDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelEnvironmentDeploymentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1759,47 +1677,6 @@ export const de_CancelEnvironmentDeploymentCommand = async ( return response; }; -/** - * deserializeAws_json1_0CancelEnvironmentDeploymentCommandError - */ -const de_CancelEnvironmentDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CancelServiceInstanceDeploymentCommand */ @@ -1808,7 +1685,7 @@ export const de_CancelServiceInstanceDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelServiceInstanceDeploymentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1820,47 +1697,6 @@ export const de_CancelServiceInstanceDeploymentCommand = async ( return response; }; -/** - * deserializeAws_json1_0CancelServiceInstanceDeploymentCommandError - */ -const de_CancelServiceInstanceDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CancelServicePipelineDeploymentCommand */ @@ -1869,7 +1705,7 @@ export const de_CancelServicePipelineDeploymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelServicePipelineDeploymentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1881,47 +1717,6 @@ export const de_CancelServicePipelineDeploymentCommand = async ( return response; }; -/** - * deserializeAws_json1_0CancelServicePipelineDeploymentCommandError - */ -const de_CancelServicePipelineDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateComponentCommand */ @@ -1930,7 +1725,7 @@ export const de_CreateComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateComponentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1943,63 +1738,39 @@ export const de_CreateComponentCommand = async ( }; /** - * deserializeAws_json1_0CreateComponentCommandError + * deserializeAws_json1_0CreateEnvironmentCommand */ -const de_CreateComponentCommandError = async ( +export const de_CreateEnvironmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.proton#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateEnvironmentOutput(data, context); + const response: CreateEnvironmentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0CreateEnvironmentCommand + * deserializeAws_json1_0CreateEnvironmentAccountConnectionCommand */ -export const de_CreateEnvironmentCommand = async ( +export const de_CreateEnvironmentAccountConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateEnvironmentOutput(data, context); - const response: CreateEnvironmentCommandOutput = { + contents = de_CreateEnvironmentAccountConnectionOutput(data, context); + const response: CreateEnvironmentAccountConnectionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2007,2336 +1778,19 @@ export const de_CreateEnvironmentCommand = async ( }; /** - * deserializeAws_json1_0CreateEnvironmentCommandError + * deserializeAws_json1_0CreateEnvironmentTemplateCommand */ -const de_CreateEnvironmentCommandError = async ( +export const de_CreateEnvironmentTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.proton#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0CreateEnvironmentAccountConnectionCommand - */ -export const de_CreateEnvironmentAccountConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateEnvironmentAccountConnectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateEnvironmentAccountConnectionOutput(data, context); - const response: CreateEnvironmentAccountConnectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0CreateEnvironmentAccountConnectionCommandError - */ -const de_CreateEnvironmentAccountConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.proton#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0CreateEnvironmentTemplateCommand - */ -export const de_CreateEnvironmentTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateEnvironmentTemplateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateEnvironmentTemplateOutput(data, context); - const response: CreateEnvironmentTemplateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0CreateEnvironmentTemplateCommandError - */ -const de_CreateEnvironmentTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.proton#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0CreateEnvironmentTemplateVersionCommand - */ -export const de_CreateEnvironmentTemplateVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateEnvironmentTemplateVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateEnvironmentTemplateVersionOutput(data, context); - const response: CreateEnvironmentTemplateVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0CreateEnvironmentTemplateVersionCommandError - */ -const de_CreateEnvironmentTemplateVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.proton#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0CreateRepositoryCommand - */ -export const de_CreateRepositoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateRepositoryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateRepositoryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0CreateRepositoryCommandError - */ -const de_CreateRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.proton#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0CreateServiceCommand - */ -export const de_CreateServiceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateServiceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateServiceOutput(data, context); - const response: CreateServiceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0CreateServiceCommandError - */ -const de_CreateServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.proton#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0CreateServiceInstanceCommand - */ -export const de_CreateServiceInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateServiceInstanceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateServiceInstanceOutput(data, context); - const response: CreateServiceInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0CreateServiceInstanceCommandError - */ -const de_CreateServiceInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0CreateServiceSyncConfigCommand - */ -export const de_CreateServiceSyncConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateServiceSyncConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateServiceSyncConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0CreateServiceSyncConfigCommandError - */ -const de_CreateServiceSyncConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.proton#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0CreateServiceTemplateCommand - */ -export const de_CreateServiceTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateServiceTemplateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateServiceTemplateOutput(data, context); - const response: CreateServiceTemplateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0CreateServiceTemplateCommandError - */ -const de_CreateServiceTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.proton#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0CreateServiceTemplateVersionCommand - */ -export const de_CreateServiceTemplateVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateServiceTemplateVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateServiceTemplateVersionOutput(data, context); - const response: CreateServiceTemplateVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0CreateServiceTemplateVersionCommandError - */ -const de_CreateServiceTemplateVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.proton#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0CreateTemplateSyncConfigCommand - */ -export const de_CreateTemplateSyncConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateTemplateSyncConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateTemplateSyncConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0CreateTemplateSyncConfigCommandError - */ -const de_CreateTemplateSyncConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.proton#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteComponentCommand - */ -export const de_DeleteComponentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteComponentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteComponentOutput(data, context); - const response: DeleteComponentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteComponentCommandError - */ -const de_DeleteComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteDeploymentCommand - */ -export const de_DeleteDeploymentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDeploymentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteDeploymentOutput(data, context); - const response: DeleteDeploymentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteDeploymentCommandError - */ -const de_DeleteDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteEnvironmentCommand - */ -export const de_DeleteEnvironmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteEnvironmentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteEnvironmentOutput(data, context); - const response: DeleteEnvironmentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteEnvironmentCommandError - */ -const de_DeleteEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteEnvironmentAccountConnectionCommand - */ -export const de_DeleteEnvironmentAccountConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteEnvironmentAccountConnectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteEnvironmentAccountConnectionOutput(data, context); - const response: DeleteEnvironmentAccountConnectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteEnvironmentAccountConnectionCommandError - */ -const de_DeleteEnvironmentAccountConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteEnvironmentTemplateCommand - */ -export const de_DeleteEnvironmentTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteEnvironmentTemplateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteEnvironmentTemplateOutput(data, context); - const response: DeleteEnvironmentTemplateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteEnvironmentTemplateCommandError - */ -const de_DeleteEnvironmentTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteEnvironmentTemplateVersionCommand - */ -export const de_DeleteEnvironmentTemplateVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteEnvironmentTemplateVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteEnvironmentTemplateVersionOutput(data, context); - const response: DeleteEnvironmentTemplateVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteEnvironmentTemplateVersionCommandError - */ -const de_DeleteEnvironmentTemplateVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteRepositoryCommand - */ -export const de_DeleteRepositoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteRepositoryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteRepositoryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteRepositoryCommandError - */ -const de_DeleteRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteServiceCommand - */ -export const de_DeleteServiceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteServiceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteServiceOutput(data, context); - const response: DeleteServiceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteServiceCommandError - */ -const de_DeleteServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteServiceSyncConfigCommand - */ -export const de_DeleteServiceSyncConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteServiceSyncConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteServiceSyncConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteServiceSyncConfigCommandError - */ -const de_DeleteServiceSyncConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteServiceTemplateCommand - */ -export const de_DeleteServiceTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteServiceTemplateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteServiceTemplateOutput(data, context); - const response: DeleteServiceTemplateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteServiceTemplateCommandError - */ -const de_DeleteServiceTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteServiceTemplateVersionCommand - */ -export const de_DeleteServiceTemplateVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteServiceTemplateVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteServiceTemplateVersionOutput(data, context); - const response: DeleteServiceTemplateVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteServiceTemplateVersionCommandError - */ -const de_DeleteServiceTemplateVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteTemplateSyncConfigCommand - */ -export const de_DeleteTemplateSyncConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteTemplateSyncConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteTemplateSyncConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeleteTemplateSyncConfigCommandError - */ -const de_DeleteTemplateSyncConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetAccountSettingsCommand - */ -export const de_GetAccountSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetAccountSettingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetAccountSettingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetAccountSettingsCommandError - */ -const de_GetAccountSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetComponentCommand - */ -export const de_GetComponentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetComponentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetComponentOutput(data, context); - const response: GetComponentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetComponentCommandError - */ -const de_GetComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetDeploymentCommand - */ -export const de_GetDeploymentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDeploymentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDeploymentOutput(data, context); - const response: GetDeploymentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetDeploymentCommandError - */ -const de_GetDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetEnvironmentCommand - */ -export const de_GetEnvironmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetEnvironmentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetEnvironmentOutput(data, context); - const response: GetEnvironmentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetEnvironmentCommandError - */ -const de_GetEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetEnvironmentAccountConnectionCommand - */ -export const de_GetEnvironmentAccountConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetEnvironmentAccountConnectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetEnvironmentAccountConnectionOutput(data, context); - const response: GetEnvironmentAccountConnectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetEnvironmentAccountConnectionCommandError - */ -const de_GetEnvironmentAccountConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetEnvironmentTemplateCommand - */ -export const de_GetEnvironmentTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetEnvironmentTemplateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetEnvironmentTemplateOutput(data, context); - const response: GetEnvironmentTemplateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetEnvironmentTemplateCommandError - */ -const de_GetEnvironmentTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetEnvironmentTemplateVersionCommand - */ -export const de_GetEnvironmentTemplateVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetEnvironmentTemplateVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetEnvironmentTemplateVersionOutput(data, context); - const response: GetEnvironmentTemplateVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetEnvironmentTemplateVersionCommandError - */ -const de_GetEnvironmentTemplateVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetRepositoryCommand - */ -export const de_GetRepositoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRepositoryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetRepositoryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetRepositoryCommandError - */ -const de_GetRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetRepositorySyncStatusCommand - */ -export const de_GetRepositorySyncStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRepositorySyncStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetRepositorySyncStatusOutput(data, context); - const response: GetRepositorySyncStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetRepositorySyncStatusCommandError - */ -const de_GetRepositorySyncStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetResourcesSummaryCommand - */ -export const de_GetResourcesSummaryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetResourcesSummaryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetResourcesSummaryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetResourcesSummaryCommandError - */ -const de_GetResourcesSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetServiceCommand - */ -export const de_GetServiceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetServiceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetServiceOutput(data, context); - const response: GetServiceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetServiceCommandError - */ -const de_GetServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetServiceInstanceCommand - */ -export const de_GetServiceInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetServiceInstanceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetServiceInstanceOutput(data, context); - const response: GetServiceInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetServiceInstanceCommandError - */ -const de_GetServiceInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetServiceInstanceSyncStatusCommand - */ -export const de_GetServiceInstanceSyncStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetServiceInstanceSyncStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetServiceInstanceSyncStatusOutput(data, context); - const response: GetServiceInstanceSyncStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetServiceInstanceSyncStatusCommandError - */ -const de_GetServiceInstanceSyncStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetServiceSyncBlockerSummaryCommand - */ -export const de_GetServiceSyncBlockerSummaryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetServiceSyncBlockerSummaryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetServiceSyncBlockerSummaryOutput(data, context); - const response: GetServiceSyncBlockerSummaryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetServiceSyncBlockerSummaryCommandError - */ -const de_GetServiceSyncBlockerSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetServiceSyncConfigCommand - */ -export const de_GetServiceSyncConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetServiceSyncConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetServiceSyncConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetServiceSyncConfigCommandError - */ -const de_GetServiceSyncConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetServiceTemplateCommand - */ -export const de_GetServiceTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetServiceTemplateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetServiceTemplateOutput(data, context); - const response: GetServiceTemplateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0GetServiceTemplateCommandError - */ -const de_GetServiceTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetServiceTemplateVersionCommand - */ -export const de_GetServiceTemplateVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetServiceTemplateVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetServiceTemplateVersionOutput(data, context); - const response: GetServiceTemplateVersionCommandOutput = { + contents = de_CreateEnvironmentTemplateOutput(data, context); + const response: CreateEnvironmentTemplateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4344,57 +1798,39 @@ export const de_GetServiceTemplateVersionCommand = async ( }; /** - * deserializeAws_json1_0GetServiceTemplateVersionCommandError + * deserializeAws_json1_0CreateEnvironmentTemplateVersionCommand */ -const de_GetServiceTemplateVersionCommandError = async ( +export const de_CreateEnvironmentTemplateVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateEnvironmentTemplateVersionOutput(data, context); + const response: CreateEnvironmentTemplateVersionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0GetTemplateSyncConfigCommand + * deserializeAws_json1_0CreateRepositoryCommand */ -export const de_GetTemplateSyncConfigCommand = async ( +export const de_CreateRepositoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetTemplateSyncConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetTemplateSyncConfigCommandOutput = { + const response: CreateRepositoryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4402,57 +1838,19 @@ export const de_GetTemplateSyncConfigCommand = async ( }; /** - * deserializeAws_json1_0GetTemplateSyncConfigCommandError - */ -const de_GetTemplateSyncConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0GetTemplateSyncStatusCommand + * deserializeAws_json1_0CreateServiceCommand */ -export const de_GetTemplateSyncStatusCommand = async ( +export const de_CreateServiceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetTemplateSyncStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetTemplateSyncStatusOutput(data, context); - const response: GetTemplateSyncStatusCommandOutput = { + contents = de_CreateServiceOutput(data, context); + const response: CreateServiceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4460,57 +1858,39 @@ export const de_GetTemplateSyncStatusCommand = async ( }; /** - * deserializeAws_json1_0GetTemplateSyncStatusCommandError + * deserializeAws_json1_0CreateServiceInstanceCommand */ -const de_GetTemplateSyncStatusCommandError = async ( +export const de_CreateServiceInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateServiceInstanceOutput(data, context); + const response: CreateServiceInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListComponentOutputsCommand + * deserializeAws_json1_0CreateServiceSyncConfigCommand */ -export const de_ListComponentOutputsCommand = async ( +export const de_CreateServiceSyncConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListComponentOutputsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListComponentOutputsCommandOutput = { + const response: CreateServiceSyncConfigCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4518,57 +1898,39 @@ export const de_ListComponentOutputsCommand = async ( }; /** - * deserializeAws_json1_0ListComponentOutputsCommandError + * deserializeAws_json1_0CreateServiceTemplateCommand */ -const de_ListComponentOutputsCommandError = async ( +export const de_CreateServiceTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateServiceTemplateOutput(data, context); + const response: CreateServiceTemplateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListComponentProvisionedResourcesCommand + * deserializeAws_json1_0CreateServiceTemplateVersionCommand */ -export const de_ListComponentProvisionedResourcesCommand = async ( +export const de_CreateServiceTemplateVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListComponentProvisionedResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListComponentProvisionedResourcesCommandOutput = { + contents = de_CreateServiceTemplateVersionOutput(data, context); + const response: CreateServiceTemplateVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4576,57 +1938,39 @@ export const de_ListComponentProvisionedResourcesCommand = async ( }; /** - * deserializeAws_json1_0ListComponentProvisionedResourcesCommandError + * deserializeAws_json1_0CreateTemplateSyncConfigCommand */ -const de_ListComponentProvisionedResourcesCommandError = async ( +export const de_CreateTemplateSyncConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateTemplateSyncConfigCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListComponentsCommand + * deserializeAws_json1_0DeleteComponentCommand */ -export const de_ListComponentsCommand = async ( +export const de_DeleteComponentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListComponentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListComponentsOutput(data, context); - const response: ListComponentsCommandOutput = { + contents = de_DeleteComponentOutput(data, context); + const response: DeleteComponentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4634,54 +1978,39 @@ export const de_ListComponentsCommand = async ( }; /** - * deserializeAws_json1_0ListComponentsCommandError + * deserializeAws_json1_0DeleteDeploymentCommand */ -const de_ListComponentsCommandError = async ( +export const de_DeleteDeploymentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteDeploymentOutput(data, context); + const response: DeleteDeploymentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListDeploymentsCommand + * deserializeAws_json1_0DeleteEnvironmentCommand */ -export const de_ListDeploymentsCommand = async ( +export const de_DeleteEnvironmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListDeploymentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListDeploymentsOutput(data, context); - const response: ListDeploymentsCommandOutput = { + contents = de_DeleteEnvironmentOutput(data, context); + const response: DeleteEnvironmentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4689,57 +2018,39 @@ export const de_ListDeploymentsCommand = async ( }; /** - * deserializeAws_json1_0ListDeploymentsCommandError + * deserializeAws_json1_0DeleteEnvironmentAccountConnectionCommand */ -const de_ListDeploymentsCommandError = async ( +export const de_DeleteEnvironmentAccountConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteEnvironmentAccountConnectionOutput(data, context); + const response: DeleteEnvironmentAccountConnectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListEnvironmentAccountConnectionsCommand + * deserializeAws_json1_0DeleteEnvironmentTemplateCommand */ -export const de_ListEnvironmentAccountConnectionsCommand = async ( +export const de_DeleteEnvironmentTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListEnvironmentAccountConnectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListEnvironmentAccountConnectionsOutput(data, context); - const response: ListEnvironmentAccountConnectionsCommandOutput = { + contents = de_DeleteEnvironmentTemplateOutput(data, context); + const response: DeleteEnvironmentTemplateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4747,54 +2058,39 @@ export const de_ListEnvironmentAccountConnectionsCommand = async ( }; /** - * deserializeAws_json1_0ListEnvironmentAccountConnectionsCommandError + * deserializeAws_json1_0DeleteEnvironmentTemplateVersionCommand */ -const de_ListEnvironmentAccountConnectionsCommandError = async ( +export const de_DeleteEnvironmentTemplateVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteEnvironmentTemplateVersionOutput(data, context); + const response: DeleteEnvironmentTemplateVersionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListEnvironmentOutputsCommand + * deserializeAws_json1_0DeleteRepositoryCommand */ -export const de_ListEnvironmentOutputsCommand = async ( +export const de_DeleteRepositoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListEnvironmentOutputsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListEnvironmentOutputsCommandOutput = { + const response: DeleteRepositoryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4802,57 +2098,39 @@ export const de_ListEnvironmentOutputsCommand = async ( }; /** - * deserializeAws_json1_0ListEnvironmentOutputsCommandError + * deserializeAws_json1_0DeleteServiceCommand */ -const de_ListEnvironmentOutputsCommandError = async ( +export const de_DeleteServiceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteServiceOutput(data, context); + const response: DeleteServiceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListEnvironmentProvisionedResourcesCommand + * deserializeAws_json1_0DeleteServiceSyncConfigCommand */ -export const de_ListEnvironmentProvisionedResourcesCommand = async ( +export const de_DeleteServiceSyncConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListEnvironmentProvisionedResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListEnvironmentProvisionedResourcesCommandOutput = { + const response: DeleteServiceSyncConfigCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4860,57 +2138,59 @@ export const de_ListEnvironmentProvisionedResourcesCommand = async ( }; /** - * deserializeAws_json1_0ListEnvironmentProvisionedResourcesCommandError + * deserializeAws_json1_0DeleteServiceTemplateCommand */ -const de_ListEnvironmentProvisionedResourcesCommandError = async ( +export const de_DeleteServiceTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteServiceTemplateOutput(data, context); + const response: DeleteServiceTemplateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_0DeleteServiceTemplateVersionCommand + */ +export const de_DeleteServiceTemplateVersionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteServiceTemplateVersionOutput(data, context); + const response: DeleteServiceTemplateVersionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListEnvironmentsCommand + * deserializeAws_json1_0DeleteTemplateSyncConfigCommand */ -export const de_ListEnvironmentsCommand = async ( +export const de_DeleteTemplateSyncConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListEnvironmentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListEnvironmentsOutput(data, context); - const response: ListEnvironmentsCommandOutput = { + contents = _json(data); + const response: DeleteTemplateSyncConfigCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4918,57 +2198,39 @@ export const de_ListEnvironmentsCommand = async ( }; /** - * deserializeAws_json1_0ListEnvironmentsCommandError + * deserializeAws_json1_0GetAccountSettingsCommand */ -const de_ListEnvironmentsCommandError = async ( +export const de_GetAccountSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetAccountSettingsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListEnvironmentTemplatesCommand + * deserializeAws_json1_0GetComponentCommand */ -export const de_ListEnvironmentTemplatesCommand = async ( +export const de_GetComponentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListEnvironmentTemplatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListEnvironmentTemplatesOutput(data, context); - const response: ListEnvironmentTemplatesCommandOutput = { + contents = de_GetComponentOutput(data, context); + const response: GetComponentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4976,54 +2238,39 @@ export const de_ListEnvironmentTemplatesCommand = async ( }; /** - * deserializeAws_json1_0ListEnvironmentTemplatesCommandError + * deserializeAws_json1_0GetDeploymentCommand */ -const de_ListEnvironmentTemplatesCommandError = async ( +export const de_GetDeploymentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetDeploymentOutput(data, context); + const response: GetDeploymentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListEnvironmentTemplateVersionsCommand + * deserializeAws_json1_0GetEnvironmentCommand */ -export const de_ListEnvironmentTemplateVersionsCommand = async ( +export const de_GetEnvironmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListEnvironmentTemplateVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListEnvironmentTemplateVersionsOutput(data, context); - const response: ListEnvironmentTemplateVersionsCommandOutput = { + contents = de_GetEnvironmentOutput(data, context); + const response: GetEnvironmentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5031,57 +2278,39 @@ export const de_ListEnvironmentTemplateVersionsCommand = async ( }; /** - * deserializeAws_json1_0ListEnvironmentTemplateVersionsCommandError + * deserializeAws_json1_0GetEnvironmentAccountConnectionCommand */ -const de_ListEnvironmentTemplateVersionsCommandError = async ( +export const de_GetEnvironmentAccountConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetEnvironmentAccountConnectionOutput(data, context); + const response: GetEnvironmentAccountConnectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListRepositoriesCommand + * deserializeAws_json1_0GetEnvironmentTemplateCommand */ -export const de_ListRepositoriesCommand = async ( +export const de_GetEnvironmentTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListRepositoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListRepositoriesCommandOutput = { + contents = de_GetEnvironmentTemplateOutput(data, context); + const response: GetEnvironmentTemplateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5089,57 +2318,39 @@ export const de_ListRepositoriesCommand = async ( }; /** - * deserializeAws_json1_0ListRepositoriesCommandError + * deserializeAws_json1_0GetEnvironmentTemplateVersionCommand */ -const de_ListRepositoriesCommandError = async ( +export const de_GetEnvironmentTemplateVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetEnvironmentTemplateVersionOutput(data, context); + const response: GetEnvironmentTemplateVersionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListRepositorySyncDefinitionsCommand + * deserializeAws_json1_0GetRepositoryCommand */ -export const de_ListRepositorySyncDefinitionsCommand = async ( +export const de_GetRepositoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListRepositorySyncDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListRepositorySyncDefinitionsCommandOutput = { + const response: GetRepositoryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5147,54 +2358,59 @@ export const de_ListRepositorySyncDefinitionsCommand = async ( }; /** - * deserializeAws_json1_0ListRepositorySyncDefinitionsCommandError + * deserializeAws_json1_0GetRepositorySyncStatusCommand */ -const de_ListRepositorySyncDefinitionsCommandError = async ( +export const de_GetRepositorySyncStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetRepositorySyncStatusOutput(data, context); + const response: GetRepositorySyncStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_0GetResourcesSummaryCommand + */ +export const de_GetResourcesSummaryCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetResourcesSummaryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListServiceInstanceOutputsCommand + * deserializeAws_json1_0GetServiceCommand */ -export const de_ListServiceInstanceOutputsCommand = async ( +export const de_GetServiceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListServiceInstanceOutputsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListServiceInstanceOutputsCommandOutput = { + contents = de_GetServiceOutput(data, context); + const response: GetServiceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5202,57 +2418,39 @@ export const de_ListServiceInstanceOutputsCommand = async ( }; /** - * deserializeAws_json1_0ListServiceInstanceOutputsCommandError + * deserializeAws_json1_0GetServiceInstanceCommand */ -const de_ListServiceInstanceOutputsCommandError = async ( +export const de_GetServiceInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetServiceInstanceOutput(data, context); + const response: GetServiceInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListServiceInstanceProvisionedResourcesCommand + * deserializeAws_json1_0GetServiceInstanceSyncStatusCommand */ -export const de_ListServiceInstanceProvisionedResourcesCommand = async ( +export const de_GetServiceInstanceSyncStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListServiceInstanceProvisionedResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListServiceInstanceProvisionedResourcesCommandOutput = { + contents = de_GetServiceInstanceSyncStatusOutput(data, context); + const response: GetServiceInstanceSyncStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5260,57 +2458,39 @@ export const de_ListServiceInstanceProvisionedResourcesCommand = async ( }; /** - * deserializeAws_json1_0ListServiceInstanceProvisionedResourcesCommandError + * deserializeAws_json1_0GetServiceSyncBlockerSummaryCommand */ -const de_ListServiceInstanceProvisionedResourcesCommandError = async ( +export const de_GetServiceSyncBlockerSummaryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetServiceSyncBlockerSummaryOutput(data, context); + const response: GetServiceSyncBlockerSummaryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListServiceInstancesCommand + * deserializeAws_json1_0GetServiceSyncConfigCommand */ -export const de_ListServiceInstancesCommand = async ( +export const de_GetServiceSyncConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListServiceInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListServiceInstancesOutput(data, context); - const response: ListServiceInstancesCommandOutput = { + contents = _json(data); + const response: GetServiceSyncConfigCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5318,57 +2498,39 @@ export const de_ListServiceInstancesCommand = async ( }; /** - * deserializeAws_json1_0ListServiceInstancesCommandError + * deserializeAws_json1_0GetServiceTemplateCommand */ -const de_ListServiceInstancesCommandError = async ( +export const de_GetServiceTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetServiceTemplateOutput(data, context); + const response: GetServiceTemplateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListServicePipelineOutputsCommand + * deserializeAws_json1_0GetServiceTemplateVersionCommand */ -export const de_ListServicePipelineOutputsCommand = async ( +export const de_GetServiceTemplateVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListServicePipelineOutputsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListServicePipelineOutputsCommandOutput = { + contents = de_GetServiceTemplateVersionOutput(data, context); + const response: GetServiceTemplateVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5376,57 +2538,39 @@ export const de_ListServicePipelineOutputsCommand = async ( }; /** - * deserializeAws_json1_0ListServicePipelineOutputsCommandError + * deserializeAws_json1_0GetTemplateSyncConfigCommand */ -const de_ListServicePipelineOutputsCommandError = async ( +export const de_GetTemplateSyncConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetTemplateSyncConfigCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListServicePipelineProvisionedResourcesCommand + * deserializeAws_json1_0GetTemplateSyncStatusCommand */ -export const de_ListServicePipelineProvisionedResourcesCommand = async ( +export const de_GetTemplateSyncStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListServicePipelineProvisionedResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListServicePipelineProvisionedResourcesCommandOutput = { + contents = de_GetTemplateSyncStatusOutput(data, context); + const response: GetTemplateSyncStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5434,57 +2578,39 @@ export const de_ListServicePipelineProvisionedResourcesCommand = async ( }; /** - * deserializeAws_json1_0ListServicePipelineProvisionedResourcesCommandError + * deserializeAws_json1_0ListComponentOutputsCommand */ -const de_ListServicePipelineProvisionedResourcesCommandError = async ( +export const de_ListComponentOutputsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListComponentOutputsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListServicesCommand + * deserializeAws_json1_0ListComponentProvisionedResourcesCommand */ -export const de_ListServicesCommand = async ( +export const de_ListComponentProvisionedResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListServicesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListServicesOutput(data, context); - const response: ListServicesCommandOutput = { + contents = _json(data); + const response: ListComponentProvisionedResourcesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5492,54 +2618,39 @@ export const de_ListServicesCommand = async ( }; /** - * deserializeAws_json1_0ListServicesCommandError + * deserializeAws_json1_0ListComponentsCommand */ -const de_ListServicesCommandError = async ( +export const de_ListComponentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListComponentsOutput(data, context); + const response: ListComponentsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListServiceTemplatesCommand + * deserializeAws_json1_0ListDeploymentsCommand */ -export const de_ListServiceTemplatesCommand = async ( +export const de_ListDeploymentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListServiceTemplatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListServiceTemplatesOutput(data, context); - const response: ListServiceTemplatesCommandOutput = { + contents = de_ListDeploymentsOutput(data, context); + const response: ListDeploymentsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5547,54 +2658,39 @@ export const de_ListServiceTemplatesCommand = async ( }; /** - * deserializeAws_json1_0ListServiceTemplatesCommandError + * deserializeAws_json1_0ListEnvironmentAccountConnectionsCommand */ -const de_ListServiceTemplatesCommandError = async ( +export const de_ListEnvironmentAccountConnectionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListEnvironmentAccountConnectionsOutput(data, context); + const response: ListEnvironmentAccountConnectionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListServiceTemplateVersionsCommand + * deserializeAws_json1_0ListEnvironmentOutputsCommand */ -export const de_ListServiceTemplateVersionsCommand = async ( +export const de_ListEnvironmentOutputsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListServiceTemplateVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListServiceTemplateVersionsOutput(data, context); - const response: ListServiceTemplateVersionsCommandOutput = { + contents = _json(data); + const response: ListEnvironmentOutputsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5602,57 +2698,39 @@ export const de_ListServiceTemplateVersionsCommand = async ( }; /** - * deserializeAws_json1_0ListServiceTemplateVersionsCommandError + * deserializeAws_json1_0ListEnvironmentProvisionedResourcesCommand */ -const de_ListServiceTemplateVersionsCommandError = async ( +export const de_ListEnvironmentProvisionedResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListEnvironmentProvisionedResourcesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListTagsForResourceCommand + * deserializeAws_json1_0ListEnvironmentsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListEnvironmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_ListEnvironmentsOutput(data, context); + const response: ListEnvironmentsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5660,57 +2738,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_0ListTagsForResourceCommandError + * deserializeAws_json1_0ListEnvironmentTemplatesCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListEnvironmentTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListEnvironmentTemplatesOutput(data, context); + const response: ListEnvironmentTemplatesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0NotifyResourceDeploymentStatusChangeCommand + * deserializeAws_json1_0ListEnvironmentTemplateVersionsCommand */ -export const de_NotifyResourceDeploymentStatusChangeCommand = async ( +export const de_ListEnvironmentTemplateVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_NotifyResourceDeploymentStatusChangeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: NotifyResourceDeploymentStatusChangeCommandOutput = { + contents = de_ListEnvironmentTemplateVersionsOutput(data, context); + const response: ListEnvironmentTemplateVersionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5718,63 +2778,39 @@ export const de_NotifyResourceDeploymentStatusChangeCommand = async ( }; /** - * deserializeAws_json1_0NotifyResourceDeploymentStatusChangeCommandError + * deserializeAws_json1_0ListRepositoriesCommand */ -const de_NotifyResourceDeploymentStatusChangeCommandError = async ( +export const de_ListRepositoriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.proton#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListRepositoriesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0RejectEnvironmentAccountConnectionCommand + * deserializeAws_json1_0ListRepositorySyncDefinitionsCommand */ -export const de_RejectEnvironmentAccountConnectionCommand = async ( +export const de_ListRepositorySyncDefinitionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RejectEnvironmentAccountConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_RejectEnvironmentAccountConnectionOutput(data, context); - const response: RejectEnvironmentAccountConnectionCommandOutput = { + contents = _json(data); + const response: ListRepositorySyncDefinitionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5782,60 +2818,39 @@ export const de_RejectEnvironmentAccountConnectionCommand = async ( }; /** - * deserializeAws_json1_0RejectEnvironmentAccountConnectionCommandError + * deserializeAws_json1_0ListServiceInstanceOutputsCommand */ -const de_RejectEnvironmentAccountConnectionCommandError = async ( +export const de_ListServiceInstanceOutputsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListServiceInstanceOutputsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0TagResourceCommand + * deserializeAws_json1_0ListServiceInstanceProvisionedResourcesCommand */ -export const de_TagResourceCommand = async ( +export const de_ListServiceInstanceProvisionedResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: ListServiceInstanceProvisionedResourcesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5843,60 +2858,39 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_0TagResourceCommandError + * deserializeAws_json1_0ListServiceInstancesCommand */ -const de_TagResourceCommandError = async ( +export const de_ListServiceInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListServiceInstancesOutput(data, context); + const response: ListServiceInstancesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0UntagResourceCommand + * deserializeAws_json1_0ListServicePipelineOutputsCommand */ -export const de_UntagResourceCommand = async ( +export const de_ListServicePipelineOutputsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UntagResourceCommandOutput = { + const response: ListServicePipelineOutputsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5904,60 +2898,39 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_0UntagResourceCommandError + * deserializeAws_json1_0ListServicePipelineProvisionedResourcesCommand */ -const de_UntagResourceCommandError = async ( +export const de_ListServicePipelineProvisionedResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListServicePipelineProvisionedResourcesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0UpdateAccountSettingsCommand + * deserializeAws_json1_0ListServicesCommand */ -export const de_UpdateAccountSettingsCommand = async ( +export const de_ListServicesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateAccountSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: UpdateAccountSettingsCommandOutput = { + contents = de_ListServicesOutput(data, context); + const response: ListServicesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5965,57 +2938,39 @@ export const de_UpdateAccountSettingsCommand = async ( }; /** - * deserializeAws_json1_0UpdateAccountSettingsCommandError + * deserializeAws_json1_0ListServiceTemplatesCommand */ -const de_UpdateAccountSettingsCommandError = async ( +export const de_ListServiceTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListServiceTemplatesOutput(data, context); + const response: ListServiceTemplatesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0UpdateComponentCommand + * deserializeAws_json1_0ListServiceTemplateVersionsCommand */ -export const de_UpdateComponentCommand = async ( +export const de_ListServiceTemplateVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateComponentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateComponentOutput(data, context); - const response: UpdateComponentCommandOutput = { + contents = de_ListServiceTemplateVersionsOutput(data, context); + const response: ListServiceTemplateVersionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6023,63 +2978,39 @@ export const de_UpdateComponentCommand = async ( }; /** - * deserializeAws_json1_0UpdateComponentCommandError + * deserializeAws_json1_0ListTagsForResourceCommand */ -const de_UpdateComponentCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.proton#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0UpdateEnvironmentCommand + * deserializeAws_json1_0NotifyResourceDeploymentStatusChangeCommand */ -export const de_UpdateEnvironmentCommand = async ( +export const de_NotifyResourceDeploymentStatusChangeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateEnvironmentOutput(data, context); - const response: UpdateEnvironmentCommandOutput = { + contents = _json(data); + const response: NotifyResourceDeploymentStatusChangeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6087,60 +3018,39 @@ export const de_UpdateEnvironmentCommand = async ( }; /** - * deserializeAws_json1_0UpdateEnvironmentCommandError + * deserializeAws_json1_0RejectEnvironmentAccountConnectionCommand */ -const de_UpdateEnvironmentCommandError = async ( +export const de_RejectEnvironmentAccountConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RejectEnvironmentAccountConnectionOutput(data, context); + const response: RejectEnvironmentAccountConnectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0UpdateEnvironmentAccountConnectionCommand + * deserializeAws_json1_0TagResourceCommand */ -export const de_UpdateEnvironmentAccountConnectionCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateEnvironmentAccountConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateEnvironmentAccountConnectionOutput(data, context); - const response: UpdateEnvironmentAccountConnectionCommandOutput = { + contents = _json(data); + const response: TagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6148,60 +3058,39 @@ export const de_UpdateEnvironmentAccountConnectionCommand = async ( }; /** - * deserializeAws_json1_0UpdateEnvironmentAccountConnectionCommandError + * deserializeAws_json1_0UntagResourceCommand */ -const de_UpdateEnvironmentAccountConnectionCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0UpdateEnvironmentTemplateCommand + * deserializeAws_json1_0UpdateAccountSettingsCommand */ -export const de_UpdateEnvironmentTemplateCommand = async ( +export const de_UpdateAccountSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateEnvironmentTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateEnvironmentTemplateOutput(data, context); - const response: UpdateEnvironmentTemplateCommandOutput = { + contents = _json(data); + const response: UpdateAccountSettingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6209,60 +3098,39 @@ export const de_UpdateEnvironmentTemplateCommand = async ( }; /** - * deserializeAws_json1_0UpdateEnvironmentTemplateCommandError + * deserializeAws_json1_0UpdateComponentCommand */ -const de_UpdateEnvironmentTemplateCommandError = async ( +export const de_UpdateComponentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateComponentOutput(data, context); + const response: UpdateComponentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0UpdateEnvironmentTemplateVersionCommand + * deserializeAws_json1_0UpdateEnvironmentCommand */ -export const de_UpdateEnvironmentTemplateVersionCommand = async ( +export const de_UpdateEnvironmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateEnvironmentTemplateVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateEnvironmentTemplateVersionOutput(data, context); - const response: UpdateEnvironmentTemplateVersionCommandOutput = { + contents = de_UpdateEnvironmentOutput(data, context); + const response: UpdateEnvironmentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6270,60 +3138,39 @@ export const de_UpdateEnvironmentTemplateVersionCommand = async ( }; /** - * deserializeAws_json1_0UpdateEnvironmentTemplateVersionCommandError + * deserializeAws_json1_0UpdateEnvironmentAccountConnectionCommand */ -const de_UpdateEnvironmentTemplateVersionCommandError = async ( +export const de_UpdateEnvironmentAccountConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateEnvironmentAccountConnectionOutput(data, context); + const response: UpdateEnvironmentAccountConnectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0UpdateServiceCommand + * deserializeAws_json1_0UpdateEnvironmentTemplateCommand */ -export const de_UpdateServiceCommand = async ( +export const de_UpdateEnvironmentTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateServiceOutput(data, context); - const response: UpdateServiceCommandOutput = { + contents = de_UpdateEnvironmentTemplateOutput(data, context); + const response: UpdateEnvironmentTemplateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6331,63 +3178,39 @@ export const de_UpdateServiceCommand = async ( }; /** - * deserializeAws_json1_0UpdateServiceCommandError + * deserializeAws_json1_0UpdateEnvironmentTemplateVersionCommand */ -const de_UpdateServiceCommandError = async ( +export const de_UpdateEnvironmentTemplateVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.proton#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateEnvironmentTemplateVersionOutput(data, context); + const response: UpdateEnvironmentTemplateVersionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0UpdateServiceInstanceCommand + * deserializeAws_json1_0UpdateServiceCommand */ -export const de_UpdateServiceInstanceCommand = async ( +export const de_UpdateServiceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateServiceInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateServiceInstanceOutput(data, context); - const response: UpdateServiceInstanceCommandOutput = { + contents = de_UpdateServiceOutput(data, context); + const response: UpdateServiceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6395,44 +3218,23 @@ export const de_UpdateServiceInstanceCommand = async ( }; /** - * deserializeAws_json1_0UpdateServiceInstanceCommandError + * deserializeAws_json1_0UpdateServiceInstanceCommand */ -const de_UpdateServiceInstanceCommandError = async ( +export const de_UpdateServiceInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateServiceInstanceOutput(data, context); + const response: UpdateServiceInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -6443,7 +3245,7 @@ export const de_UpdateServicePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateServicePipelineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6455,47 +3257,6 @@ export const de_UpdateServicePipelineCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateServicePipelineCommandError - */ -const de_UpdateServicePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateServiceSyncBlockerCommand */ @@ -6504,7 +3265,7 @@ export const de_UpdateServiceSyncBlockerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateServiceSyncBlockerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6516,47 +3277,6 @@ export const de_UpdateServiceSyncBlockerCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateServiceSyncBlockerCommandError - */ -const de_UpdateServiceSyncBlockerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateServiceSyncConfigCommand */ @@ -6565,7 +3285,7 @@ export const de_UpdateServiceSyncConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateServiceSyncConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6577,47 +3297,6 @@ export const de_UpdateServiceSyncConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateServiceSyncConfigCommandError - */ -const de_UpdateServiceSyncConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateServiceTemplateCommand */ @@ -6626,7 +3305,7 @@ export const de_UpdateServiceTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateServiceTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6638,47 +3317,6 @@ export const de_UpdateServiceTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateServiceTemplateCommandError - */ -const de_UpdateServiceTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateServiceTemplateVersionCommand */ @@ -6687,7 +3325,7 @@ export const de_UpdateServiceTemplateVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateServiceTemplateVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6699,47 +3337,6 @@ export const de_UpdateServiceTemplateVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateServiceTemplateVersionCommandError - */ -const de_UpdateServiceTemplateVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.proton#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.proton#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.proton#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.proton#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.proton#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.proton#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateTemplateSyncConfigCommand */ @@ -6748,7 +3345,7 @@ export const de_UpdateTemplateSyncConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTemplateSyncConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6761,12 +3358,9 @@ export const de_UpdateTemplateSyncConfigCommand = async ( }; /** - * deserializeAws_json1_0UpdateTemplateSyncConfigCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateTemplateSyncConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -6791,13 +3385,16 @@ const de_UpdateTemplateSyncConfigCommandError = async ( case "ValidationException": case "com.amazonaws.proton#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.proton#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-qbusiness/src/protocols/Aws_restJson1.ts b/clients/client-qbusiness/src/protocols/Aws_restJson1.ts index ee288df099a2..98e11f3cea91 100644 --- a/clients/client-qbusiness/src/protocols/Aws_restJson1.ts +++ b/clients/client-qbusiness/src/protocols/Aws_restJson1.ts @@ -1420,7 +1420,7 @@ export const de_BatchDeleteDocumentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDeleteDocumentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1433,47 +1433,6 @@ export const de_BatchDeleteDocumentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDeleteDocumentCommandError - */ -const de_BatchDeleteDocumentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchPutDocumentCommand */ @@ -1482,7 +1441,7 @@ export const de_BatchPutDocumentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchPutDocumentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1495,50 +1454,6 @@ export const de_BatchPutDocumentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchPutDocumentCommandError - */ -const de_BatchPutDocumentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qbusiness#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ChatSyncCommand */ @@ -1547,7 +1462,7 @@ export const de_ChatSyncCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ChatSyncCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1566,50 +1481,6 @@ export const de_ChatSyncCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ChatSyncCommandError - */ -const de_ChatSyncCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LicenseNotFoundException": - case "com.amazonaws.qbusiness#LicenseNotFoundException": - throw await de_LicenseNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateApplicationCommand */ @@ -1618,7 +1489,7 @@ export const de_CreateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1632,50 +1503,6 @@ export const de_CreateApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qbusiness#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDataSourceCommand */ @@ -1684,7 +1511,7 @@ export const de_CreateDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1698,50 +1525,6 @@ export const de_CreateDataSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDataSourceCommandError - */ -const de_CreateDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qbusiness#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateIndexCommand */ @@ -1750,7 +1533,7 @@ export const de_CreateIndexCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateIndexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1764,50 +1547,6 @@ export const de_CreateIndexCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateIndexCommandError - */ -const de_CreateIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qbusiness#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePluginCommand */ @@ -1816,7 +1555,7 @@ export const de_CreatePluginCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePluginCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1831,58 +1570,14 @@ export const de_CreatePluginCommand = async ( }; /** - * deserializeAws_restJson1CreatePluginCommandError + * deserializeAws_restJson1CreateRetrieverCommand */ -const de_CreatePluginCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qbusiness#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateRetrieverCommand - */ -export const de_CreateRetrieverCommand = async ( +export const de_CreateRetrieverCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRetrieverCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1896,50 +1591,6 @@ export const de_CreateRetrieverCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRetrieverCommandError - */ -const de_CreateRetrieverCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qbusiness#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateUserCommand */ @@ -1948,7 +1599,7 @@ export const de_CreateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1957,50 +1608,6 @@ export const de_CreateUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateUserCommandError - */ -const de_CreateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qbusiness#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWebExperienceCommand */ @@ -2009,7 +1616,7 @@ export const de_CreateWebExperienceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWebExperienceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2024,58 +1631,31 @@ export const de_CreateWebExperienceCommand = async ( }; /** - * deserializeAws_restJson1CreateWebExperienceCommandError + * deserializeAws_restJson1DeleteApplicationCommand */ -const de_CreateWebExperienceCommandError = async ( +export const de_DeleteApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qbusiness#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteApplicationCommand + * deserializeAws_restJson1DeleteChatControlsConfigurationCommand */ -export const de_DeleteApplicationCommand = async ( +export const de_DeleteChatControlsConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2085,55 +1665,31 @@ export const de_DeleteApplicationCommand = async ( }; /** - * deserializeAws_restJson1DeleteApplicationCommandError + * deserializeAws_restJson1DeleteConversationCommand */ -const de_DeleteApplicationCommandError = async ( +export const de_DeleteConversationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteChatControlsConfigurationCommand + * deserializeAws_restJson1DeleteDataSourceCommand */ -export const de_DeleteChatControlsConfigurationCommand = async ( +export const de_DeleteDataSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteChatControlsConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2143,52 +1699,31 @@ export const de_DeleteChatControlsConfigurationCommand = async ( }; /** - * deserializeAws_restJson1DeleteChatControlsConfigurationCommandError + * deserializeAws_restJson1DeleteGroupCommand */ -const de_DeleteChatControlsConfigurationCommandError = async ( +export const de_DeleteGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteConversationCommand + * deserializeAws_restJson1DeleteIndexCommand */ -export const de_DeleteConversationCommand = async ( +export const de_DeleteIndexCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConversationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2198,2029 +1733,604 @@ export const de_DeleteConversationCommand = async ( }; /** - * deserializeAws_restJson1DeleteConversationCommandError + * deserializeAws_restJson1DeletePluginCommand */ -const de_DeleteConversationCommandError = async ( +export const de_DeletePluginCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LicenseNotFoundException": - case "com.amazonaws.qbusiness#LicenseNotFoundException": - throw await de_LicenseNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDataSourceCommand - */ -export const de_DeleteDataSourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDataSourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteDataSourceCommandError - */ -const de_DeleteDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteGroupCommand - */ -export const de_DeleteGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteGroupCommandError - */ -const de_DeleteGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteIndexCommand - */ -export const de_DeleteIndexCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteIndexCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteIndexCommandError - */ -const de_DeleteIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePluginCommand - */ -export const de_DeletePluginCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePluginCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeletePluginCommandError - */ -const de_DeletePluginCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRetrieverCommand - */ -export const de_DeleteRetrieverCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRetrieverCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRetrieverCommandError - */ -const de_DeleteRetrieverCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteUserCommand - */ -export const de_DeleteUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteUserCommandError - */ -const de_DeleteUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteWebExperienceCommand - */ -export const de_DeleteWebExperienceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteWebExperienceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteWebExperienceCommandError - */ -const de_DeleteWebExperienceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetApplicationCommand - */ -export const de_GetApplicationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApplicationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - applicationArn: __expectString, - applicationId: __expectString, - attachmentsConfiguration: _json, - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - description: __expectString, - displayName: __expectString, - encryptionConfiguration: _json, - error: _json, - roleArn: __expectString, - status: __expectString, - updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetApplicationCommandError - */ -const de_GetApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetChatControlsConfigurationCommand - */ -export const de_GetChatControlsConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChatControlsConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - blockedPhrases: _json, - nextToken: __expectString, - responseScope: __expectString, - topicConfigurations: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetChatControlsConfigurationCommandError - */ -const de_GetChatControlsConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDataSourceCommand - */ -export const de_GetDataSourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataSourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - applicationId: __expectString, - configuration: (_) => de_DataSourceConfiguration(_, context), - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - dataSourceArn: __expectString, - dataSourceId: __expectString, - description: __expectString, - displayName: __expectString, - documentEnrichmentConfiguration: (_) => de_DocumentEnrichmentConfiguration(_, context), - error: _json, - indexId: __expectString, - roleArn: __expectString, - status: __expectString, - syncSchedule: __expectString, - type: __expectString, - updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - vpcConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDataSourceCommandError - */ -const de_GetDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetGroupCommand - */ -export const de_GetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - status: (_) => de_GroupStatusDetail(_, context), - statusHistory: (_) => de_GroupStatusDetails(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetGroupCommandError - */ -const de_GetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetIndexCommand - */ -export const de_GetIndexCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIndexCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - applicationId: __expectString, - capacityConfiguration: _json, - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - description: __expectString, - displayName: __expectString, - documentAttributeConfigurations: _json, - error: _json, - indexArn: __expectString, - indexId: __expectString, - indexStatistics: _json, - status: __expectString, - updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetIndexCommandError - */ -const de_GetIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPluginCommand - */ -export const de_GetPluginCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPluginCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - applicationId: __expectString, - authConfiguration: (_) => _json(__expectUnion(_)), - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - displayName: __expectString, - pluginArn: __expectString, - pluginId: __expectString, - serverUrl: __expectString, - state: __expectString, - type: __expectString, - updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPluginCommandError - */ -const de_GetPluginCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRetrieverCommand - */ -export const de_GetRetrieverCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRetrieverCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - applicationId: __expectString, - configuration: (_) => _json(__expectUnion(_)), - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - displayName: __expectString, - retrieverArn: __expectString, - retrieverId: __expectString, - roleArn: __expectString, - status: __expectString, - type: __expectString, - updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRetrieverCommandError - */ -const de_GetRetrieverCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetUserCommand - */ -export const de_GetUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - userAliases: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetUserCommandError - */ -const de_GetUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetWebExperienceCommand - */ -export const de_GetWebExperienceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWebExperienceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - applicationId: __expectString, - authenticationConfiguration: (_) => _json(__expectUnion(_)), - createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - defaultEndpoint: __expectString, - error: _json, - samplePromptsControlMode: __expectString, - status: __expectString, - subtitle: __expectString, - title: __expectString, - updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - webExperienceArn: __expectString, - webExperienceId: __expectString, - welcomeMessage: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetWebExperienceCommandError - */ -const de_GetWebExperienceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListApplicationsCommand - */ -export const de_ListApplicationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - applications: (_) => de_Applications(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListApplicationsCommandError - */ -const de_ListApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListConversationsCommand + * deserializeAws_restJson1DeleteRetrieverCommand */ -export const de_ListConversationsCommand = async ( +export const de_DeleteRetrieverCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConversationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - conversations: (_) => de_Conversations(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListConversationsCommandError - */ -const de_ListConversationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LicenseNotFoundException": - case "com.amazonaws.qbusiness#LicenseNotFoundException": - throw await de_LicenseNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDataSourcesCommand + * deserializeAws_restJson1DeleteUserCommand */ -export const de_ListDataSourcesCommand = async ( +export const de_DeleteUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataSourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - dataSources: (_) => de_DataSources(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListDataSourcesCommandError - */ -const de_ListDataSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDataSourceSyncJobsCommand + * deserializeAws_restJson1DeleteWebExperienceCommand */ -export const de_ListDataSourceSyncJobsCommand = async ( +export const de_DeleteWebExperienceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataSourceSyncJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - history: (_) => de_DataSourceSyncJobs(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListDataSourceSyncJobsCommandError - */ -const de_ListDataSourceSyncJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDocumentsCommand + * deserializeAws_restJson1GetApplicationCommand */ -export const de_ListDocumentsCommand = async ( +export const de_GetApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDocumentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - documentDetailList: (_) => de_DocumentDetailList(_, context), - nextToken: __expectString, + applicationArn: __expectString, + applicationId: __expectString, + attachmentsConfiguration: _json, + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + description: __expectString, + displayName: __expectString, + encryptionConfiguration: _json, + error: _json, + roleArn: __expectString, + status: __expectString, + updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListDocumentsCommandError - */ -const de_ListDocumentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListGroupsCommand + * deserializeAws_restJson1GetChatControlsConfigurationCommand */ -export const de_ListGroupsCommand = async ( +export const de_GetChatControlsConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: _json, + blockedPhrases: _json, nextToken: __expectString, + responseScope: __expectString, + topicConfigurations: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListGroupsCommandError + * deserializeAws_restJson1GetDataSourceCommand */ -const de_ListGroupsCommandError = async ( +export const de_GetDataSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + applicationId: __expectString, + configuration: (_) => de_DataSourceConfiguration(_, context), + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + dataSourceArn: __expectString, + dataSourceId: __expectString, + description: __expectString, + displayName: __expectString, + documentEnrichmentConfiguration: (_) => de_DocumentEnrichmentConfiguration(_, context), + error: _json, + indexId: __expectString, + roleArn: __expectString, + status: __expectString, + syncSchedule: __expectString, + type: __expectString, + updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + vpcConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListIndicesCommand + * deserializeAws_restJson1GetGroupCommand */ -export const de_ListIndicesCommand = async ( +export const de_GetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIndicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - indices: (_) => de_Indices(_, context), - nextToken: __expectString, + status: (_) => de_GroupStatusDetail(_, context), + statusHistory: (_) => de_GroupStatusDetails(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListIndicesCommandError + * deserializeAws_restJson1GetIndexCommand */ -const de_ListIndicesCommandError = async ( +export const de_GetIndexCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + applicationId: __expectString, + capacityConfiguration: _json, + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + description: __expectString, + displayName: __expectString, + documentAttributeConfigurations: _json, + error: _json, + indexArn: __expectString, + indexId: __expectString, + indexStatistics: _json, + status: __expectString, + updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListMessagesCommand + * deserializeAws_restJson1GetPluginCommand */ -export const de_ListMessagesCommand = async ( +export const de_GetPluginCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMessagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - messages: (_) => de_Messages(_, context), - nextToken: __expectString, + applicationId: __expectString, + authConfiguration: (_) => _json(__expectUnion(_)), + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + displayName: __expectString, + pluginArn: __expectString, + pluginId: __expectString, + serverUrl: __expectString, + state: __expectString, + type: __expectString, + updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListMessagesCommandError + * deserializeAws_restJson1GetRetrieverCommand */ -const de_ListMessagesCommandError = async ( +export const de_GetRetrieverCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "LicenseNotFoundException": - case "com.amazonaws.qbusiness#LicenseNotFoundException": - throw await de_LicenseNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + applicationId: __expectString, + configuration: (_) => _json(__expectUnion(_)), + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + displayName: __expectString, + retrieverArn: __expectString, + retrieverId: __expectString, + roleArn: __expectString, + status: __expectString, + type: __expectString, + updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPluginsCommand + * deserializeAws_restJson1GetUserCommand */ -export const de_ListPluginsCommand = async ( +export const de_GetUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPluginsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - plugins: (_) => de_Plugins(_, context), + userAliases: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPluginsCommandError + * deserializeAws_restJson1GetWebExperienceCommand */ -const de_ListPluginsCommandError = async ( +export const de_GetWebExperienceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + applicationId: __expectString, + authenticationConfiguration: (_) => _json(__expectUnion(_)), + createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + defaultEndpoint: __expectString, + error: _json, + samplePromptsControlMode: __expectString, + status: __expectString, + subtitle: __expectString, + title: __expectString, + updatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + webExperienceArn: __expectString, + webExperienceId: __expectString, + welcomeMessage: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRetrieversCommand + * deserializeAws_restJson1ListApplicationsCommand */ -export const de_ListRetrieversCommand = async ( +export const de_ListApplicationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRetrieversCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + applications: (_) => de_Applications(_, context), nextToken: __expectString, - retrievers: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRetrieversCommandError - */ -const de_ListRetrieversCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListConversationsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListConversationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + conversations: (_) => de_Conversations(_, context), + nextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListWebExperiencesCommand + * deserializeAws_restJson1ListDataSourcesCommand */ -export const de_ListWebExperiencesCommand = async ( +export const de_ListDataSourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWebExperiencesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + dataSources: (_) => de_DataSources(_, context), nextToken: __expectString, - webExperiences: (_) => de_WebExperiences(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListWebExperiencesCommandError + * deserializeAws_restJson1ListDataSourceSyncJobsCommand */ -const de_ListWebExperiencesCommandError = async ( +export const de_ListDataSourceSyncJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + history: (_) => de_DataSourceSyncJobs(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutFeedbackCommand + * deserializeAws_restJson1ListDocumentsCommand */ -export const de_PutFeedbackCommand = async ( +export const de_ListDocumentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutFeedbackCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + documentDetailList: (_) => de_DocumentDetailList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutFeedbackCommandError + * deserializeAws_restJson1ListGroupsCommand */ -const de_PutFeedbackCommandError = async ( +export const de_ListGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutGroupCommand + * deserializeAws_restJson1ListIndicesCommand */ -export const de_PutGroupCommand = async ( +export const de_ListIndicesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + indices: (_) => de_Indices(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutGroupCommandError + * deserializeAws_restJson1ListMessagesCommand */ -const de_PutGroupCommandError = async ( +export const de_ListMessagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qbusiness#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + messages: (_) => de_Messages(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StartDataSourceSyncJobCommand + * deserializeAws_restJson1ListPluginsCommand */ -export const de_StartDataSourceSyncJobCommand = async ( +export const de_ListPluginsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartDataSourceSyncJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - executionId: __expectString, + nextToken: __expectString, + plugins: (_) => de_Plugins(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartDataSourceSyncJobCommandError + * deserializeAws_restJson1ListRetrieversCommand */ -const de_StartDataSourceSyncJobCommandError = async ( +export const de_ListRetrieversCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qbusiness#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + retrievers: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1StopDataSourceSyncJobCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_StopDataSourceSyncJobCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopDataSourceSyncJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StopDataSourceSyncJobCommandError + * deserializeAws_restJson1ListWebExperiencesCommand */ -const de_StopDataSourceSyncJobCommandError = async ( +export const de_ListWebExperiencesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + webExperiences: (_) => de_WebExperiences(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1PutFeedbackCommand */ -export const de_TagResourceCommand = async ( +export const de_PutFeedbackCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4230,110 +2340,69 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1PutGroupCommand */ -const de_TagResourceCommandError = async ( +export const de_PutGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1StartDataSourceSyncJobCommand */ -export const de_UntagResourceCommand = async ( +export const de_StartDataSourceSyncJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + executionId: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1StopDataSourceSyncJobCommand */ -const de_UntagResourceCommandError = async ( +export const de_StopDataSourceSyncJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateApplicationCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UpdateApplicationCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4343,55 +2412,31 @@ export const de_UpdateApplicationCommand = async ( }; /** - * deserializeAws_restJson1UpdateApplicationCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UpdateApplicationCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateChatControlsConfigurationCommand + * deserializeAws_restJson1UpdateApplicationCommand */ -export const de_UpdateChatControlsConfigurationCommand = async ( +export const de_UpdateApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateChatControlsConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4401,47 +2446,20 @@ export const de_UpdateChatControlsConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateChatControlsConfigurationCommandError + * deserializeAws_restJson1UpdateChatControlsConfigurationCommand */ -const de_UpdateChatControlsConfigurationCommandError = async ( +export const de_UpdateChatControlsConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qbusiness#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -4452,7 +2470,7 @@ export const de_UpdateDataSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4461,47 +2479,6 @@ export const de_UpdateDataSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDataSourceCommandError - */ -const de_UpdateDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateIndexCommand */ @@ -4510,7 +2487,7 @@ export const de_UpdateIndexCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIndexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4519,50 +2496,6 @@ export const de_UpdateIndexCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateIndexCommandError - */ -const de_UpdateIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qbusiness#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePluginCommand */ @@ -4571,7 +2504,7 @@ export const de_UpdatePluginCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePluginCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4580,50 +2513,6 @@ export const de_UpdatePluginCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePluginCommandError - */ -const de_UpdatePluginCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qbusiness#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRetrieverCommand */ @@ -4632,7 +2521,7 @@ export const de_UpdateRetrieverCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRetrieverCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4641,50 +2530,6 @@ export const de_UpdateRetrieverCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRetrieverCommandError - */ -const de_UpdateRetrieverCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qbusiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qbusiness#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateUserCommand */ @@ -4693,7 +2538,7 @@ export const de_UpdateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4708,47 +2553,6 @@ export const de_UpdateUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateUserCommandError - */ -const de_UpdateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qbusiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.qbusiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qbusiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qbusiness#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.qbusiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qbusiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWebExperienceCommand */ @@ -4757,7 +2561,7 @@ export const de_UpdateWebExperienceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateWebExperienceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4767,12 +2571,9 @@ export const de_UpdateWebExperienceCommand = async ( }; /** - * deserializeAws_restJson1UpdateWebExperienceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateWebExperienceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4797,13 +2598,19 @@ const de_UpdateWebExperienceCommandError = async ( case "ValidationException": case "com.amazonaws.qbusiness#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.qbusiness#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "LicenseNotFoundException": + case "com.amazonaws.qbusiness#LicenseNotFoundException": + throw await de_LicenseNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-qconnect/src/protocols/Aws_restJson1.ts b/clients/client-qconnect/src/protocols/Aws_restJson1.ts index 0173c674020f..08c1f3ec8c86 100644 --- a/clients/client-qconnect/src/protocols/Aws_restJson1.ts +++ b/clients/client-qconnect/src/protocols/Aws_restJson1.ts @@ -1081,7 +1081,7 @@ export const de_CreateAssistantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAssistantCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1094,41 +1094,6 @@ export const de_CreateAssistantCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAssistantCommandError - */ -const de_CreateAssistantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qconnect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAssistantAssociationCommand */ @@ -1137,7 +1102,7 @@ export const de_CreateAssistantAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAssistantAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1150,44 +1115,6 @@ export const de_CreateAssistantAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAssistantAssociationCommandError - */ -const de_CreateAssistantAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qconnect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateContentCommand */ @@ -1196,7 +1123,7 @@ export const de_CreateContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1209,44 +1136,6 @@ export const de_CreateContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateContentCommandError - */ -const de_CreateContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qconnect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateKnowledgeBaseCommand */ @@ -1255,7 +1144,7 @@ export const de_CreateKnowledgeBaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateKnowledgeBaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1268,41 +1157,6 @@ export const de_CreateKnowledgeBaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateKnowledgeBaseCommandError - */ -const de_CreateKnowledgeBaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qconnect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateQuickResponseCommand */ @@ -1311,7 +1165,7 @@ export const de_CreateQuickResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateQuickResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1324,44 +1178,6 @@ export const de_CreateQuickResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateQuickResponseCommandError - */ -const de_CreateQuickResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qconnect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSessionCommand */ @@ -1370,7 +1186,7 @@ export const de_CreateSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1383,38 +1199,6 @@ export const de_CreateSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSessionCommandError - */ -const de_CreateSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.qconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAssistantCommand */ @@ -1423,7 +1207,7 @@ export const de_DeleteAssistantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAssistantCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1432,38 +1216,6 @@ export const de_DeleteAssistantCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAssistantCommandError - */ -const de_DeleteAssistantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAssistantAssociationCommand */ @@ -1472,7 +1224,7 @@ export const de_DeleteAssistantAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAssistantAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1481,38 +1233,6 @@ export const de_DeleteAssistantAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAssistantAssociationCommandError - */ -const de_DeleteAssistantAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteContentCommand */ @@ -1521,7 +1241,7 @@ export const de_DeleteContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1530,38 +1250,6 @@ export const de_DeleteContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteContentCommandError - */ -const de_DeleteContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteImportJobCommand */ @@ -1570,7 +1258,7 @@ export const de_DeleteImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1579,41 +1267,6 @@ export const de_DeleteImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteImportJobCommandError - */ -const de_DeleteImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteKnowledgeBaseCommand */ @@ -1622,7 +1275,7 @@ export const de_DeleteKnowledgeBaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteKnowledgeBaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1631,41 +1284,6 @@ export const de_DeleteKnowledgeBaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteKnowledgeBaseCommandError - */ -const de_DeleteKnowledgeBaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteQuickResponseCommand */ @@ -1674,7 +1292,7 @@ export const de_DeleteQuickResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteQuickResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1683,38 +1301,6 @@ export const de_DeleteQuickResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteQuickResponseCommandError - */ -const de_DeleteQuickResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAssistantCommand */ @@ -1723,7 +1309,7 @@ export const de_GetAssistantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssistantCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1736,38 +1322,6 @@ export const de_GetAssistantCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAssistantCommandError - */ -const de_GetAssistantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAssistantAssociationCommand */ @@ -1776,7 +1330,7 @@ export const de_GetAssistantAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssistantAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1789,38 +1343,6 @@ export const de_GetAssistantAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAssistantAssociationCommandError - */ -const de_GetAssistantAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetContentCommand */ @@ -1829,7 +1351,7 @@ export const de_GetContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1842,38 +1364,6 @@ export const de_GetContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetContentCommandError - */ -const de_GetContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetContentSummaryCommand */ @@ -1882,7 +1372,7 @@ export const de_GetContentSummaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetContentSummaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1896,152 +1386,56 @@ export const de_GetContentSummaryCommand = async ( }; /** - * deserializeAws_restJson1GetContentSummaryCommandError + * deserializeAws_restJson1GetImportJobCommand */ -const de_GetContentSummaryCommandError = async ( +export const de_GetImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + importJob: (_) => de_ImportJobData(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetImportJobCommand + * deserializeAws_restJson1GetKnowledgeBaseCommand */ -export const de_GetImportJobCommand = async ( +export const de_GetKnowledgeBaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - importJob: (_) => de_ImportJobData(_, context), + knowledgeBase: (_) => de_KnowledgeBaseData(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetImportJobCommandError + * deserializeAws_restJson1GetQuickResponseCommand */ -const de_GetImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetKnowledgeBaseCommand - */ -export const de_GetKnowledgeBaseCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetKnowledgeBaseCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - knowledgeBase: (_) => de_KnowledgeBaseData(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetKnowledgeBaseCommandError - */ -const de_GetKnowledgeBaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetQuickResponseCommand - */ -export const de_GetQuickResponseCommand = async ( +export const de_GetQuickResponseCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetQuickResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2054,38 +1448,6 @@ export const de_GetQuickResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetQuickResponseCommandError - */ -const de_GetQuickResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRecommendationsCommand */ @@ -2094,7 +1456,7 @@ export const de_GetRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2108,38 +1470,6 @@ export const de_GetRecommendationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRecommendationsCommandError - */ -const de_GetRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSessionCommand */ @@ -2148,7 +1478,7 @@ export const de_GetSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2161,38 +1491,6 @@ export const de_GetSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSessionCommandError - */ -const de_GetSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssistantAssociationsCommand */ @@ -2201,7 +1499,7 @@ export const de_ListAssistantAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssistantAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2215,38 +1513,6 @@ export const de_ListAssistantAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssistantAssociationsCommandError - */ -const de_ListAssistantAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssistantsCommand */ @@ -2255,7 +1521,7 @@ export const de_ListAssistantsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssistantsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2269,35 +1535,6 @@ export const de_ListAssistantsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssistantsCommandError - */ -const de_ListAssistantsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListContentsCommand */ @@ -2306,7 +1543,7 @@ export const de_ListContentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListContentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2320,38 +1557,6 @@ export const de_ListContentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListContentsCommandError - */ -const de_ListContentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListImportJobsCommand */ @@ -2360,7 +1565,7 @@ export const de_ListImportJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImportJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2375,43 +1580,14 @@ export const de_ListImportJobsCommand = async ( }; /** - * deserializeAws_restJson1ListImportJobsCommandError + * deserializeAws_restJson1ListKnowledgeBasesCommand */ -const de_ListImportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListKnowledgeBasesCommand - */ -export const de_ListKnowledgeBasesCommand = async ( +export const de_ListKnowledgeBasesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKnowledgeBasesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2425,35 +1601,6 @@ export const de_ListKnowledgeBasesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListKnowledgeBasesCommandError - */ -const de_ListKnowledgeBasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListQuickResponsesCommand */ @@ -2462,7 +1609,7 @@ export const de_ListQuickResponsesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListQuickResponsesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2476,38 +1623,6 @@ export const de_ListQuickResponsesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListQuickResponsesCommandError - */ -const de_ListQuickResponsesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -2516,7 +1631,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2529,32 +1644,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1NotifyRecommendationsReceivedCommand */ @@ -2563,7 +1652,7 @@ export const de_NotifyRecommendationsReceivedCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_NotifyRecommendationsReceivedCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2577,38 +1666,6 @@ export const de_NotifyRecommendationsReceivedCommand = async ( return contents; }; -/** - * deserializeAws_restJson1NotifyRecommendationsReceivedCommandError - */ -const de_NotifyRecommendationsReceivedCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutFeedbackCommand */ @@ -2617,7 +1674,7 @@ export const de_PutFeedbackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutFeedbackCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2634,38 +1691,6 @@ export const de_PutFeedbackCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutFeedbackCommandError - */ -const de_PutFeedbackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1QueryAssistantCommand */ @@ -2674,7 +1699,7 @@ export const de_QueryAssistantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_QueryAssistantCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2688,41 +1713,6 @@ export const de_QueryAssistantCommand = async ( return contents; }; -/** - * deserializeAws_restJson1QueryAssistantCommandError - */ -const de_QueryAssistantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.qconnect#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand */ @@ -2731,7 +1721,7 @@ export const de_RemoveKnowledgeBaseTemplateUriCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_RemoveKnowledgeBaseTemplateUriCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2740,158 +1730,37 @@ export const de_RemoveKnowledgeBaseTemplateUriCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommandError - */ -const de_RemoveKnowledgeBaseTemplateUriCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchContentCommand - */ -export const de_SearchContentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchContentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - contentSummaries: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SearchContentCommandError - */ -const de_SearchContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchQuickResponsesCommand - */ -export const de_SearchQuickResponsesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchQuickResponsesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - results: (_) => de_QuickResponseSearchResultsList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SearchQuickResponsesCommandError - */ -const de_SearchQuickResponsesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.qconnect#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + */ +export const de_SearchContentCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + contentSummaries: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SearchSessionsCommand + * deserializeAws_restJson1SearchQuickResponsesCommand */ -export const de_SearchSessionsCommand = async ( +export const de_SearchQuickResponsesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchSessionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2899,42 +1768,32 @@ export const de_SearchSessionsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - sessionSummaries: _json, + results: (_) => de_QuickResponseSearchResultsList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SearchSessionsCommandError + * deserializeAws_restJson1SearchSessionsCommand */ -const de_SearchSessionsCommandError = async ( +export const de_SearchSessionsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + sessionSummaries: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2945,7 +1804,7 @@ export const de_StartContentUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartContentUploadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2961,38 +1820,6 @@ export const de_StartContentUploadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartContentUploadCommandError - */ -const de_StartContentUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartImportJobCommand */ @@ -3001,7 +1828,7 @@ export const de_StartImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3014,44 +1841,6 @@ export const de_StartImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartImportJobCommandError - */ -const de_StartImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.qconnect#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.qconnect#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -3060,7 +1849,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3069,35 +1858,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.qconnect#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -3106,7 +1866,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3115,32 +1875,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateContentCommand */ @@ -3149,7 +1883,7 @@ export const de_UpdateContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3162,41 +1896,6 @@ export const de_UpdateContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateContentCommandError - */ -const de_UpdateContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.qconnect#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommand */ @@ -3205,7 +1904,7 @@ export const de_UpdateKnowledgeBaseTemplateUriCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateKnowledgeBaseTemplateUriCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3218,38 +1917,6 @@ export const de_UpdateKnowledgeBaseTemplateUriCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommandError - */ -const de_UpdateKnowledgeBaseTemplateUriCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.qconnect#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.qconnect#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateQuickResponseCommand */ @@ -3258,7 +1925,7 @@ export const de_UpdateQuickResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateQuickResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3272,12 +1939,9 @@ export const de_UpdateQuickResponseCommand = async ( }; /** - * deserializeAws_restJson1UpdateQuickResponseCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateQuickResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3290,22 +1954,31 @@ const de_UpdateQuickResponseCommandError = async ( case "ConflictException": case "com.amazonaws.qconnect#ConflictException": throw await de_ConflictExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.qconnect#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qconnect#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.qconnect#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.qconnect#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.qconnect#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "RequestTimeoutException": + case "com.amazonaws.qconnect#RequestTimeoutException": + throw await de_RequestTimeoutExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.qconnect#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "PreconditionFailedException": + case "com.amazonaws.qconnect#PreconditionFailedException": + throw await de_PreconditionFailedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-qldb-session/src/protocols/Aws_json1_0.ts b/clients/client-qldb-session/src/protocols/Aws_json1_0.ts index e1d4e904a855..35ade6b1883b 100644 --- a/clients/client-qldb-session/src/protocols/Aws_json1_0.ts +++ b/clients/client-qldb-session/src/protocols/Aws_json1_0.ts @@ -61,7 +61,7 @@ export const de_SendCommandCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendCommandCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -74,12 +74,9 @@ export const de_SendCommandCommand = async ( }; /** - * deserializeAws_json1_0SendCommandCommandError + * deserialize_Aws_json1_0CommandError */ -const de_SendCommandCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -110,7 +107,7 @@ const de_SendCommandCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-qldb/src/protocols/Aws_restJson1.ts b/clients/client-qldb/src/protocols/Aws_restJson1.ts index 6b3b97580dda..a1ea73c18874 100644 --- a/clients/client-qldb/src/protocols/Aws_restJson1.ts +++ b/clients/client-qldb/src/protocols/Aws_restJson1.ts @@ -511,7 +511,7 @@ export const de_CancelJournalKinesisStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelJournalKinesisStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -524,38 +524,6 @@ export const de_CancelJournalKinesisStreamCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelJournalKinesisStreamCommandError - */ -const de_CancelJournalKinesisStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.qldb#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qldb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourcePreconditionNotMetException": - case "com.amazonaws.qldb#ResourcePreconditionNotMetException": - throw await de_ResourcePreconditionNotMetExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLedgerCommand */ @@ -564,7 +532,7 @@ export const de_CreateLedgerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLedgerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -583,41 +551,6 @@ export const de_CreateLedgerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLedgerCommandError - */ -const de_CreateLedgerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.qldb#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.qldb#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.qldb#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.qldb#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteLedgerCommand */ @@ -626,7 +559,7 @@ export const de_DeleteLedgerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLedgerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -635,41 +568,6 @@ export const de_DeleteLedgerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteLedgerCommandError - */ -const de_DeleteLedgerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.qldb#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.qldb#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qldb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourcePreconditionNotMetException": - case "com.amazonaws.qldb#ResourcePreconditionNotMetException": - throw await de_ResourcePreconditionNotMetExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeJournalKinesisStreamCommand */ @@ -678,7 +576,7 @@ export const de_DescribeJournalKinesisStreamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJournalKinesisStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -691,38 +589,6 @@ export const de_DescribeJournalKinesisStreamCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeJournalKinesisStreamCommandError - */ -const de_DescribeJournalKinesisStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.qldb#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qldb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourcePreconditionNotMetException": - case "com.amazonaws.qldb#ResourcePreconditionNotMetException": - throw await de_ResourcePreconditionNotMetExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeJournalS3ExportCommand */ @@ -731,7 +597,7 @@ export const de_DescribeJournalS3ExportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJournalS3ExportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -744,32 +610,6 @@ export const de_DescribeJournalS3ExportCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeJournalS3ExportCommandError - */ -const de_DescribeJournalS3ExportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.qldb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeLedgerCommand */ @@ -778,7 +618,7 @@ export const de_DescribeLedgerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeLedgerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -797,35 +637,6 @@ export const de_DescribeLedgerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeLedgerCommandError - */ -const de_DescribeLedgerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.qldb#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qldb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExportJournalToS3Command */ @@ -834,7 +645,7 @@ export const de_ExportJournalToS3Command = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExportJournalToS3CommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -847,35 +658,6 @@ export const de_ExportJournalToS3Command = async ( return contents; }; -/** - * deserializeAws_restJson1ExportJournalToS3CommandError - */ -const de_ExportJournalToS3CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.qldb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourcePreconditionNotMetException": - case "com.amazonaws.qldb#ResourcePreconditionNotMetException": - throw await de_ResourcePreconditionNotMetExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBlockCommand */ @@ -884,7 +666,7 @@ export const de_GetBlockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBlockCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -898,38 +680,6 @@ export const de_GetBlockCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetBlockCommandError - */ -const de_GetBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.qldb#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qldb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourcePreconditionNotMetException": - case "com.amazonaws.qldb#ResourcePreconditionNotMetException": - throw await de_ResourcePreconditionNotMetExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDigestCommand */ @@ -938,7 +688,7 @@ export const de_GetDigestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDigestCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -952,38 +702,6 @@ export const de_GetDigestCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDigestCommandError - */ -const de_GetDigestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.qldb#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qldb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourcePreconditionNotMetException": - case "com.amazonaws.qldb#ResourcePreconditionNotMetException": - throw await de_ResourcePreconditionNotMetExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRevisionCommand */ @@ -992,7 +710,7 @@ export const de_GetRevisionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRevisionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1006,38 +724,6 @@ export const de_GetRevisionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRevisionCommandError - */ -const de_GetRevisionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.qldb#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qldb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourcePreconditionNotMetException": - case "com.amazonaws.qldb#ResourcePreconditionNotMetException": - throw await de_ResourcePreconditionNotMetExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListJournalKinesisStreamsForLedgerCommand */ @@ -1046,7 +732,7 @@ export const de_ListJournalKinesisStreamsForLedgerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJournalKinesisStreamsForLedgerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1060,38 +746,6 @@ export const de_ListJournalKinesisStreamsForLedgerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListJournalKinesisStreamsForLedgerCommandError - */ -const de_ListJournalKinesisStreamsForLedgerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.qldb#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qldb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourcePreconditionNotMetException": - case "com.amazonaws.qldb#ResourcePreconditionNotMetException": - throw await de_ResourcePreconditionNotMetExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListJournalS3ExportsCommand */ @@ -1100,7 +754,7 @@ export const de_ListJournalS3ExportsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJournalS3ExportsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1114,26 +768,6 @@ export const de_ListJournalS3ExportsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListJournalS3ExportsCommandError - */ -const de_ListJournalS3ExportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListJournalS3ExportsForLedgerCommand */ @@ -1142,7 +776,7 @@ export const de_ListJournalS3ExportsForLedgerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJournalS3ExportsForLedgerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1156,26 +790,6 @@ export const de_ListJournalS3ExportsForLedgerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListJournalS3ExportsForLedgerCommandError - */ -const de_ListJournalS3ExportsForLedgerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListLedgersCommand */ @@ -1184,7 +798,7 @@ export const de_ListLedgersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLedgersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1198,26 +812,6 @@ export const de_ListLedgersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListLedgersCommandError - */ -const de_ListLedgersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1226,7 +820,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1239,35 +833,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.qldb#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qldb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StreamJournalToKinesisCommand */ @@ -1276,7 +841,7 @@ export const de_StreamJournalToKinesisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StreamJournalToKinesisCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1289,38 +854,6 @@ export const de_StreamJournalToKinesisCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StreamJournalToKinesisCommandError - */ -const de_StreamJournalToKinesisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.qldb#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qldb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourcePreconditionNotMetException": - case "com.amazonaws.qldb#ResourcePreconditionNotMetException": - throw await de_ResourcePreconditionNotMetExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1329,7 +862,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1338,35 +871,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.qldb#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qldb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1375,7 +879,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1384,35 +888,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.qldb#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qldb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLedgerCommand */ @@ -1421,7 +896,7 @@ export const de_UpdateLedgerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLedgerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1439,35 +914,6 @@ export const de_UpdateLedgerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateLedgerCommandError - */ -const de_UpdateLedgerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.qldb#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.qldb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateLedgerPermissionsModeCommand */ @@ -1476,7 +922,7 @@ export const de_UpdateLedgerPermissionsModeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLedgerPermissionsModeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1492,12 +938,9 @@ export const de_UpdateLedgerPermissionsModeCommand = async ( }; /** - * deserializeAws_restJson1UpdateLedgerPermissionsModeCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateLedgerPermissionsModeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1510,13 +953,25 @@ const de_UpdateLedgerPermissionsModeCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.qldb#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ResourcePreconditionNotMetException": + case "com.amazonaws.qldb#ResourcePreconditionNotMetException": + throw await de_ResourcePreconditionNotMetExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.qldb#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.qldb#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.qldb#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-quicksight/src/protocols/Aws_restJson1.ts b/clients/client-quicksight/src/protocols/Aws_restJson1.ts index bf4808cc0b95..f6b8359b180f 100644 --- a/clients/client-quicksight/src/protocols/Aws_restJson1.ts +++ b/clients/client-quicksight/src/protocols/Aws_restJson1.ts @@ -4984,7 +4984,7 @@ export const de_CancelIngestionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelIngestionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5002,47 +5002,6 @@ export const de_CancelIngestionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelIngestionCommandError - */ -const de_CancelIngestionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAccountCustomizationCommand */ @@ -5051,7 +5010,7 @@ export const de_CreateAccountCustomizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAccountCustomizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5071,53 +5030,6 @@ export const de_CreateAccountCustomizationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAccountCustomizationCommandError - */ -const de_CreateAccountCustomizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAccountSubscriptionCommand */ @@ -5126,7 +5038,7 @@ export const de_CreateAccountSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAccountSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5143,56 +5055,6 @@ export const de_CreateAccountSubscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAccountSubscriptionCommandError - */ -const de_CreateAccountSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAnalysisCommand */ @@ -5201,7 +5063,7 @@ export const de_CreateAnalysisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAnalysisCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5220,53 +5082,6 @@ export const de_CreateAnalysisCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAnalysisCommandError - */ -const de_CreateAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDashboardCommand */ @@ -5275,7 +5090,7 @@ export const de_CreateDashboardCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDashboardCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5296,61 +5111,42 @@ export const de_CreateDashboardCommand = async ( }; /** - * deserializeAws_restJson1CreateDashboardCommandError + * deserializeAws_restJson1CreateDataSetCommand */ -const de_CreateDashboardCommandError = async ( +export const de_CreateDataSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + DataSetId: __expectString, + IngestionArn: __expectString, + IngestionId: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1CreateDataSetCommand + * deserializeAws_restJson1CreateDataSourceCommand */ -export const de_CreateDataSetCommand = async ( +export const de_CreateDataSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDataSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5358,9 +5154,8 @@ export const de_CreateDataSetCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { Arn: __expectString, - DataSetId: __expectString, - IngestionArn: __expectString, - IngestionId: __expectString, + CreationStatus: __expectString, + DataSourceId: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -5371,64 +5166,14 @@ export const de_CreateDataSetCommand = async ( }; /** - * deserializeAws_restJson1CreateDataSetCommandError + * deserializeAws_restJson1CreateFolderCommand */ -const de_CreateDataSetCommandError = async ( +export const de_CreateFolderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateDataSourceCommand - */ -export const de_CreateDataSourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5436,8 +5181,7 @@ export const de_CreateDataSourceCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { Arn: __expectString, - CreationStatus: __expectString, - DataSourceId: __expectString, + FolderId: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -5448,69 +5192,44 @@ export const de_CreateDataSourceCommand = async ( }; /** - * deserializeAws_restJson1CreateDataSourceCommandError + * deserializeAws_restJson1CreateFolderMembershipCommand */ -const de_CreateDataSourceCommandError = async ( +export const de_CreateFolderMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + FolderMember: _json, + RequestId: __expectString, + Status: __expectInt32, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateFolderCommand + * deserializeAws_restJson1CreateGroupCommand */ -export const de_CreateFolderCommand = async ( +export const de_CreateGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFolderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - FolderId: __expectString, + Group: _json, RequestId: __expectString, }); Object.assign(contents, doc); @@ -5521,141 +5240,106 @@ export const de_CreateFolderCommand = async ( }; /** - * deserializeAws_restJson1CreateFolderCommandError + * deserializeAws_restJson1CreateGroupMembershipCommand */ -const de_CreateFolderCommandError = async ( +export const de_CreateGroupMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + GroupMember: _json, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1CreateFolderMembershipCommand + * deserializeAws_restJson1CreateIAMPolicyAssignmentCommand */ -export const de_CreateFolderMembershipCommand = async ( +export const de_CreateIAMPolicyAssignmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFolderMembershipCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - FolderMember: _json, + AssignmentId: __expectString, + AssignmentName: __expectString, + AssignmentStatus: __expectString, + Identities: _json, + PolicyArn: __expectString, RequestId: __expectString, - Status: __expectInt32, }); Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); return contents; }; /** - * deserializeAws_restJson1CreateFolderMembershipCommandError + * deserializeAws_restJson1CreateIngestionCommand */ -const de_CreateFolderMembershipCommandError = async ( +export const de_CreateIngestionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + IngestionId: __expectString, + IngestionStatus: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1CreateGroupCommand + * deserializeAws_restJson1CreateNamespaceCommand */ -export const de_CreateGroupCommand = async ( +export const de_CreateNamespaceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Group: _json, + Arn: __expectString, + CapacityRegion: __expectString, + CreationStatus: __expectString, + IdentityStore: __expectString, + Name: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -5666,71 +5350,46 @@ export const de_CreateGroupCommand = async ( }; /** - * deserializeAws_restJson1CreateGroupCommandError + * deserializeAws_restJson1CreateRefreshScheduleCommand */ -const de_CreateGroupCommandError = async ( +export const de_CreateRefreshScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + RequestId: __expectString, + ScheduleId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1CreateGroupMembershipCommand + * deserializeAws_restJson1CreateRoleMembershipCommand */ -export const de_CreateGroupMembershipCommand = async ( +export const de_CreateRoleMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateGroupMembershipCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - GroupMember: _json, RequestId: __expectString, }); Object.assign(contents, doc); @@ -5741,70 +5400,50 @@ export const de_CreateGroupMembershipCommand = async ( }; /** - * deserializeAws_restJson1CreateGroupMembershipCommandError + * deserializeAws_restJson1CreateTemplateCommand */ -const de_CreateGroupMembershipCommandError = async ( +export const de_CreateTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + CreationStatus: __expectString, + RequestId: __expectString, + TemplateId: __expectString, + VersionArn: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1CreateIAMPolicyAssignmentCommand + * deserializeAws_restJson1CreateTemplateAliasCommand */ -export const de_CreateIAMPolicyAssignmentCommand = async ( +export const de_CreateTemplateAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateIAMPolicyAssignmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AssignmentId: __expectString, - AssignmentName: __expectString, - AssignmentStatus: __expectString, - Identities: _json, - PolicyArn: __expectString, RequestId: __expectString, + TemplateAlias: _json, }); Object.assign(contents, doc); map(contents, { @@ -5814,68 +5453,50 @@ export const de_CreateIAMPolicyAssignmentCommand = async ( }; /** - * deserializeAws_restJson1CreateIAMPolicyAssignmentCommandError + * deserializeAws_restJson1CreateThemeCommand */ -const de_CreateIAMPolicyAssignmentCommandError = async ( +export const de_CreateThemeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentUpdatingException": - case "com.amazonaws.quicksight#ConcurrentUpdatingException": - throw await de_ConcurrentUpdatingExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + CreationStatus: __expectString, + RequestId: __expectString, + ThemeId: __expectString, + VersionArn: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1CreateIngestionCommand + * deserializeAws_restJson1CreateThemeAliasCommand */ -export const de_CreateIngestionCommand = async ( +export const de_CreateThemeAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateIngestionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - IngestionId: __expectString, - IngestionStatus: __expectString, RequestId: __expectString, + ThemeAlias: _json, }); Object.assign(contents, doc); map(contents, { @@ -5885,70 +5506,51 @@ export const de_CreateIngestionCommand = async ( }; /** - * deserializeAws_restJson1CreateIngestionCommandError + * deserializeAws_restJson1CreateTopicCommand */ -const de_CreateIngestionCommandError = async ( +export const de_CreateTopicCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + RefreshArn: __expectString, + RequestId: __expectString, + TopicId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1CreateNamespaceCommand + * deserializeAws_restJson1CreateTopicRefreshScheduleCommand */ -export const de_CreateNamespaceCommand = async ( +export const de_CreateTopicRefreshScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateNamespaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - CapacityRegion: __expectString, - CreationStatus: __expectString, - IdentityStore: __expectString, - Name: __expectString, + DatasetArn: __expectString, RequestId: __expectString, + TopicArn: __expectString, + TopicId: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -5958,76 +5560,49 @@ export const de_CreateNamespaceCommand = async ( }; /** - * deserializeAws_restJson1CreateNamespaceCommandError + * deserializeAws_restJson1CreateVPCConnectionCommand */ -const de_CreateNamespaceCommandError = async ( +export const de_CreateVPCConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + AvailabilityStatus: __expectString, + CreationStatus: __expectString, + RequestId: __expectString, + VPCConnectionId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1CreateRefreshScheduleCommand + * deserializeAws_restJson1DeleteAccountCustomizationCommand */ -export const de_CreateRefreshScheduleCommand = async ( +export const de_DeleteAccountCustomizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRefreshScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, RequestId: __expectString, - ScheduleId: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -6037,67 +5612,47 @@ export const de_CreateRefreshScheduleCommand = async ( }; /** - * deserializeAws_restJson1CreateRefreshScheduleCommandError + * deserializeAws_restJson1DeleteAccountSubscriptionCommand */ -const de_CreateRefreshScheduleCommandError = async ( +export const de_DeleteAccountSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1CreateRoleMembershipCommand + * deserializeAws_restJson1DeleteAnalysisCommand */ -export const de_CreateRoleMembershipCommand = async ( +export const de_DeleteAnalysisCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRoleMembershipCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + AnalysisId: __expectString, + Arn: __expectString, + DeletionTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), RequestId: __expectString, }); Object.assign(contents, doc); @@ -6108,58 +5663,40 @@ export const de_CreateRoleMembershipCommand = async ( }; /** - * deserializeAws_restJson1CreateRoleMembershipCommandError + * deserializeAws_restJson1DeleteDashboardCommand */ -const de_CreateRoleMembershipCommandError = async ( +export const de_DeleteDashboardCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + DashboardId: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1CreateTemplateCommand + * deserializeAws_restJson1DeleteDataSetCommand */ -export const de_CreateTemplateCommand = async ( +export const de_DeleteDataSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6167,10 +5704,8 @@ export const de_CreateTemplateCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { Arn: __expectString, - CreationStatus: __expectString, + DataSetId: __expectString, RequestId: __expectString, - TemplateId: __expectString, - VersionArn: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -6180,72 +5715,47 @@ export const de_CreateTemplateCommand = async ( }; /** - * deserializeAws_restJson1CreateTemplateCommandError + * deserializeAws_restJson1DeleteDataSetRefreshPropertiesCommand */ -const de_CreateTemplateCommandError = async ( +export const de_DeleteDataSetRefreshPropertiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1CreateTemplateAliasCommand + * deserializeAws_restJson1DeleteDataSourceCommand */ -export const de_CreateTemplateAliasCommand = async ( +export const de_DeleteDataSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTemplateAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + Arn: __expectString, + DataSourceId: __expectString, RequestId: __expectString, - TemplateAlias: _json, }); Object.assign(contents, doc); map(contents, { @@ -6255,133 +5765,86 @@ export const de_CreateTemplateAliasCommand = async ( }; /** - * deserializeAws_restJson1CreateTemplateAliasCommandError + * deserializeAws_restJson1DeleteFolderCommand */ -const de_CreateTemplateAliasCommandError = async ( +export const de_DeleteFolderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + FolderId: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1CreateThemeCommand + * deserializeAws_restJson1DeleteFolderMembershipCommand */ -export const de_CreateThemeCommand = async ( +export const de_DeleteFolderMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateThemeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - CreationStatus: __expectString, RequestId: __expectString, - ThemeId: __expectString, - VersionArn: __expectString, + Status: __expectInt32, }); Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); return contents; }; /** - * deserializeAws_restJson1CreateThemeCommandError + * deserializeAws_restJson1DeleteGroupCommand */ -const de_CreateThemeCommandError = async ( +export const de_DeleteGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1CreateThemeAliasCommand + * deserializeAws_restJson1DeleteGroupMembershipCommand */ -export const de_CreateThemeAliasCommand = async ( +export const de_DeleteGroupMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateThemeAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6389,7 +5852,6 @@ export const de_CreateThemeAliasCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { RequestId: __expectString, - ThemeAlias: _json, }); Object.assign(contents, doc); map(contents, { @@ -6399,71 +5861,46 @@ export const de_CreateThemeAliasCommand = async ( }; /** - * deserializeAws_restJson1CreateThemeAliasCommandError + * deserializeAws_restJson1DeleteIAMPolicyAssignmentCommand */ -const de_CreateThemeAliasCommandError = async ( +export const de_DeleteIAMPolicyAssignmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AssignmentName: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1CreateTopicCommand + * deserializeAws_restJson1DeleteIdentityPropagationConfigCommand */ -export const de_CreateTopicCommand = async ( +export const de_DeleteIdentityPropagationConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTopicCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - RefreshArn: __expectString, RequestId: __expectString, - TopicId: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -6473,71 +5910,47 @@ export const de_CreateTopicCommand = async ( }; /** - * deserializeAws_restJson1CreateTopicCommandError + * deserializeAws_restJson1DeleteNamespaceCommand */ -const de_CreateTopicCommandError = async ( +export const de_DeleteNamespaceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1CreateTopicRefreshScheduleCommand + * deserializeAws_restJson1DeleteRefreshScheduleCommand */ -export const de_CreateTopicRefreshScheduleCommand = async ( +export const de_DeleteRefreshScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTopicRefreshScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DatasetArn: __expectString, + Arn: __expectString, RequestId: __expectString, - TopicArn: __expectString, - TopicId: __expectString, + ScheduleId: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -6547,72 +5960,43 @@ export const de_CreateTopicRefreshScheduleCommand = async ( }; /** - * deserializeAws_restJson1CreateTopicRefreshScheduleCommandError + * deserializeAws_restJson1DeleteRoleCustomPermissionCommand */ -const de_CreateTopicRefreshScheduleCommandError = async ( +export const de_DeleteRoleCustomPermissionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RequestId: __expectString, + Status: __expectInt32, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateVPCConnectionCommand + * deserializeAws_restJson1DeleteRoleMembershipCommand */ -export const de_CreateVPCConnectionCommand = async ( +export const de_DeleteRoleMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateVPCConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - AvailabilityStatus: __expectString, - CreationStatus: __expectString, RequestId: __expectString, - VPCConnectionId: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -6622,68 +6006,50 @@ export const de_CreateVPCConnectionCommand = async ( }; /** - * deserializeAws_restJson1CreateVPCConnectionCommandError + * deserializeAws_restJson1DeleteTemplateCommand */ -const de_CreateVPCConnectionCommandError = async ( +export const de_DeleteTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + RequestId: __expectString, + TemplateId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1DeleteAccountCustomizationCommand + * deserializeAws_restJson1DeleteTemplateAliasCommand */ -export const de_DeleteAccountCustomizationCommand = async ( +export const de_DeleteTemplateAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAccountCustomizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + AliasName: __expectString, + Arn: __expectString, RequestId: __expectString, + TemplateId: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -6693,71 +6059,50 @@ export const de_DeleteAccountCustomizationCommand = async ( }; /** - * deserializeAws_restJson1DeleteAccountCustomizationCommandError + * deserializeAws_restJson1DeleteThemeCommand */ -const de_DeleteAccountCustomizationCommandError = async ( +export const de_DeleteThemeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + RequestId: __expectString, + ThemeId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1DeleteAccountSubscriptionCommand + * deserializeAws_restJson1DeleteThemeAliasCommand */ -export const de_DeleteAccountSubscriptionCommand = async ( +export const de_DeleteThemeAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAccountSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + AliasName: __expectString, + Arn: __expectString, RequestId: __expectString, + ThemeId: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -6767,68 +6112,50 @@ export const de_DeleteAccountSubscriptionCommand = async ( }; /** - * deserializeAws_restJson1DeleteAccountSubscriptionCommandError + * deserializeAws_restJson1DeleteTopicCommand */ -const de_DeleteAccountSubscriptionCommandError = async ( +export const de_DeleteTopicCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + RequestId: __expectString, + TopicId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1DeleteAnalysisCommand + * deserializeAws_restJson1DeleteTopicRefreshScheduleCommand */ -export const de_DeleteAnalysisCommand = async ( +export const de_DeleteTopicRefreshScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAnalysisCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AnalysisId: __expectString, - Arn: __expectString, - DeletionTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + DatasetArn: __expectString, RequestId: __expectString, + TopicArn: __expectString, + TopicId: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -6838,63 +6165,20 @@ export const de_DeleteAnalysisCommand = async ( }; /** - * deserializeAws_restJson1DeleteAnalysisCommandError + * deserializeAws_restJson1DeleteUserCommand */ -const de_DeleteAnalysisCommandError = async ( +export const de_DeleteUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDashboardCommand - */ -export const de_DeleteDashboardCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDashboardCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - DashboardId: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -6905,55 +6189,38 @@ export const de_DeleteDashboardCommand = async ( }; /** - * deserializeAws_restJson1DeleteDashboardCommandError + * deserializeAws_restJson1DeleteUserByPrincipalIdCommand */ -const de_DeleteDashboardCommandError = async ( +export const de_DeleteUserByPrincipalIdCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1DeleteDataSetCommand + * deserializeAws_restJson1DeleteVPCConnectionCommand */ -export const de_DeleteDataSetCommand = async ( +export const de_DeleteVPCConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDataSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6961,8 +6228,10 @@ export const de_DeleteDataSetCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { Arn: __expectString, - DataSetId: __expectString, + AvailabilityStatus: __expectString, + DeletionStatus: __expectString, RequestId: __expectString, + VPCConnectionId: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -6972,58 +6241,24 @@ export const de_DeleteDataSetCommand = async ( }; /** - * deserializeAws_restJson1DeleteDataSetCommandError - */ -const de_DeleteDataSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDataSetRefreshPropertiesCommand + * deserializeAws_restJson1DescribeAccountCustomizationCommand */ -export const de_DeleteDataSetRefreshPropertiesCommand = async ( +export const de_DescribeAccountCustomizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDataSetRefreshPropertiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + AccountCustomization: _json, + Arn: __expectString, + AwsAccountId: __expectString, + Namespace: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -7034,66 +6269,21 @@ export const de_DeleteDataSetRefreshPropertiesCommand = async ( }; /** - * deserializeAws_restJson1DeleteDataSetRefreshPropertiesCommandError - */ -const de_DeleteDataSetRefreshPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDataSourceCommand + * deserializeAws_restJson1DescribeAccountSettingsCommand */ -export const de_DeleteDataSourceCommand = async ( +export const de_DescribeAccountSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - DataSourceId: __expectString, + AccountSettings: _json, RequestId: __expectString, }); Object.assign(contents, doc); @@ -7104,60 +6294,46 @@ export const de_DeleteDataSourceCommand = async ( }; /** - * deserializeAws_restJson1DeleteDataSourceCommandError + * deserializeAws_restJson1DescribeAccountSubscriptionCommand */ -const de_DeleteDataSourceCommandError = async ( +export const de_DescribeAccountSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AccountInfo: _json, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1DeleteFolderCommand + * deserializeAws_restJson1DescribeAnalysisCommand */ -export const de_DeleteFolderCommand = async ( +export const de_DescribeAnalysisCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFolderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - FolderId: __expectString, + Analysis: (_) => de_Analysis(_, context), RequestId: __expectString, }); Object.assign(contents, doc); @@ -7168,4832 +6344,27 @@ export const de_DeleteFolderCommand = async ( }; /** - * deserializeAws_restJson1DeleteFolderCommandError + * deserializeAws_restJson1DescribeAnalysisDefinitionCommand */ -const de_DeleteFolderCommandError = async ( +export const de_DescribeAnalysisDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteFolderMembershipCommand - */ -export const de_DeleteFolderMembershipCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFolderMembershipCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RequestId: __expectString, - Status: __expectInt32, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteFolderMembershipCommandError - */ -const de_DeleteFolderMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteGroupCommand - */ -export const de_DeleteGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteGroupCommandError - */ -const de_DeleteGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteGroupMembershipCommand - */ -export const de_DeleteGroupMembershipCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGroupMembershipCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteGroupMembershipCommandError - */ -const de_DeleteGroupMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteIAMPolicyAssignmentCommand - */ -export const de_DeleteIAMPolicyAssignmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteIAMPolicyAssignmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AssignmentName: __expectString, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteIAMPolicyAssignmentCommandError - */ -const de_DeleteIAMPolicyAssignmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentUpdatingException": - case "com.amazonaws.quicksight#ConcurrentUpdatingException": - throw await de_ConcurrentUpdatingExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteIdentityPropagationConfigCommand - */ -export const de_DeleteIdentityPropagationConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteIdentityPropagationConfigCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteIdentityPropagationConfigCommandError - */ -const de_DeleteIdentityPropagationConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteNamespaceCommand - */ -export const de_DeleteNamespaceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteNamespaceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteNamespaceCommandError - */ -const de_DeleteNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRefreshScheduleCommand - */ -export const de_DeleteRefreshScheduleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRefreshScheduleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - RequestId: __expectString, - ScheduleId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRefreshScheduleCommandError - */ -const de_DeleteRefreshScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRoleCustomPermissionCommand - */ -export const de_DeleteRoleCustomPermissionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRoleCustomPermissionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RequestId: __expectString, - Status: __expectInt32, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRoleCustomPermissionCommandError - */ -const de_DeleteRoleCustomPermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRoleMembershipCommand - */ -export const de_DeleteRoleMembershipCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRoleMembershipCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRoleMembershipCommandError - */ -const de_DeleteRoleMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteTemplateCommand - */ -export const de_DeleteTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - RequestId: __expectString, - TemplateId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteTemplateCommandError - */ -const de_DeleteTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteTemplateAliasCommand - */ -export const de_DeleteTemplateAliasCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTemplateAliasCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AliasName: __expectString, - Arn: __expectString, - RequestId: __expectString, - TemplateId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteTemplateAliasCommandError - */ -const de_DeleteTemplateAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteThemeCommand - */ -export const de_DeleteThemeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteThemeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - RequestId: __expectString, - ThemeId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteThemeCommandError - */ -const de_DeleteThemeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteThemeAliasCommand - */ -export const de_DeleteThemeAliasCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteThemeAliasCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AliasName: __expectString, - Arn: __expectString, - RequestId: __expectString, - ThemeId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteThemeAliasCommandError - */ -const de_DeleteThemeAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteTopicCommand - */ -export const de_DeleteTopicCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTopicCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - RequestId: __expectString, - TopicId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteTopicCommandError - */ -const de_DeleteTopicCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteTopicRefreshScheduleCommand - */ -export const de_DeleteTopicRefreshScheduleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTopicRefreshScheduleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DatasetArn: __expectString, - RequestId: __expectString, - TopicArn: __expectString, - TopicId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteTopicRefreshScheduleCommandError - */ -const de_DeleteTopicRefreshScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteUserCommand - */ -export const de_DeleteUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteUserCommandError - */ -const de_DeleteUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteUserByPrincipalIdCommand - */ -export const de_DeleteUserByPrincipalIdCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteUserByPrincipalIdCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteUserByPrincipalIdCommandError - */ -const de_DeleteUserByPrincipalIdCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteVPCConnectionCommand - */ -export const de_DeleteVPCConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteVPCConnectionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - AvailabilityStatus: __expectString, - DeletionStatus: __expectString, - RequestId: __expectString, - VPCConnectionId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteVPCConnectionCommandError - */ -const de_DeleteVPCConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAccountCustomizationCommand - */ -export const de_DescribeAccountCustomizationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAccountCustomizationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AccountCustomization: _json, - Arn: __expectString, - AwsAccountId: __expectString, - Namespace: __expectString, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAccountCustomizationCommandError - */ -const de_DescribeAccountCustomizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAccountSettingsCommand - */ -export const de_DescribeAccountSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAccountSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AccountSettings: _json, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAccountSettingsCommandError - */ -const de_DescribeAccountSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAccountSubscriptionCommand - */ -export const de_DescribeAccountSubscriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAccountSubscriptionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AccountInfo: _json, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAccountSubscriptionCommandError - */ -const de_DescribeAccountSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAnalysisCommand - */ -export const de_DescribeAnalysisCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAnalysisCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Analysis: (_) => de_Analysis(_, context), - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAnalysisCommandError - */ -const de_DescribeAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAnalysisDefinitionCommand - */ -export const de_DescribeAnalysisDefinitionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAnalysisDefinitionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AnalysisId: __expectString, - Definition: (_) => de_AnalysisDefinition(_, context), - Errors: _json, - Name: __expectString, - RequestId: __expectString, - ResourceStatus: __expectString, - ThemeArn: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAnalysisDefinitionCommandError - */ -const de_DescribeAnalysisDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAnalysisPermissionsCommand - */ -export const de_DescribeAnalysisPermissionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAnalysisPermissionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AnalysisArn: __expectString, - AnalysisId: __expectString, - Permissions: _json, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAnalysisPermissionsCommandError - */ -const de_DescribeAnalysisPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAssetBundleExportJobCommand - */ -export const de_DescribeAssetBundleExportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAssetBundleExportJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - AssetBundleExportJobId: __expectString, - AwsAccountId: __expectString, - CloudFormationOverridePropertyConfiguration: _json, - CreatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - DownloadUrl: __expectString, - Errors: _json, - ExportFormat: __expectString, - IncludeAllDependencies: __expectBoolean, - IncludePermissions: __expectBoolean, - IncludeTags: __expectBoolean, - JobStatus: __expectString, - RequestId: __expectString, - ResourceArns: _json, - ValidationStrategy: _json, - Warnings: _json, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAssetBundleExportJobCommandError - */ -const de_DescribeAssetBundleExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAssetBundleImportJobCommand - */ -export const de_DescribeAssetBundleImportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAssetBundleImportJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - AssetBundleImportJobId: __expectString, - AssetBundleImportSource: _json, - AwsAccountId: __expectString, - CreatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - Errors: _json, - FailureAction: __expectString, - JobStatus: __expectString, - OverrideParameters: (_) => de_AssetBundleImportJobOverrideParameters(_, context), - OverridePermissions: _json, - OverrideTags: _json, - OverrideValidationStrategy: _json, - RequestId: __expectString, - RollbackErrors: _json, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAssetBundleImportJobCommandError - */ -const de_DescribeAssetBundleImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDashboardCommand - */ -export const de_DescribeDashboardCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDashboardCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Dashboard: (_) => de_Dashboard(_, context), - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeDashboardCommandError - */ -const de_DescribeDashboardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDashboardDefinitionCommand - */ -export const de_DescribeDashboardDefinitionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDashboardDefinitionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DashboardId: __expectString, - DashboardPublishOptions: _json, - Definition: (_) => de_DashboardVersionDefinition(_, context), - Errors: _json, - Name: __expectString, - RequestId: __expectString, - ResourceStatus: __expectString, - ThemeArn: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeDashboardDefinitionCommandError - */ -const de_DescribeDashboardDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDashboardPermissionsCommand - */ -export const de_DescribeDashboardPermissionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDashboardPermissionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DashboardArn: __expectString, - DashboardId: __expectString, - LinkSharingConfiguration: _json, - Permissions: _json, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeDashboardPermissionsCommandError - */ -const de_DescribeDashboardPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDashboardSnapshotJobCommand - */ -export const de_DescribeDashboardSnapshotJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDashboardSnapshotJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - AwsAccountId: __expectString, - CreatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - DashboardId: __expectString, - JobStatus: __expectString, - LastUpdatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - RequestId: __expectString, - SnapshotConfiguration: (_) => de_SnapshotConfiguration(_, context), - SnapshotJobId: __expectString, - Status: __expectInt32, - UserConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeDashboardSnapshotJobCommandError - */ -const de_DescribeDashboardSnapshotJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDashboardSnapshotJobResultCommand - */ -export const de_DescribeDashboardSnapshotJobResultCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDashboardSnapshotJobResultCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - CreatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - ErrorInfo: _json, - JobStatus: __expectString, - LastUpdatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - RequestId: __expectString, - Result: _json, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeDashboardSnapshotJobResultCommandError - */ -const de_DescribeDashboardSnapshotJobResultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDataSetCommand - */ -export const de_DescribeDataSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDataSetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DataSet: (_) => de_DataSet(_, context), - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeDataSetCommandError - */ -const de_DescribeDataSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDataSetPermissionsCommand - */ -export const de_DescribeDataSetPermissionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDataSetPermissionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DataSetArn: __expectString, - DataSetId: __expectString, - Permissions: _json, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeDataSetPermissionsCommandError - */ -const de_DescribeDataSetPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDataSetRefreshPropertiesCommand - */ -export const de_DescribeDataSetRefreshPropertiesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDataSetRefreshPropertiesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DataSetRefreshProperties: _json, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeDataSetRefreshPropertiesCommandError - */ -const de_DescribeDataSetRefreshPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDataSourceCommand - */ -export const de_DescribeDataSourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDataSourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DataSource: (_) => de_DataSource(_, context), - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeDataSourceCommandError - */ -const de_DescribeDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDataSourcePermissionsCommand - */ -export const de_DescribeDataSourcePermissionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDataSourcePermissionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DataSourceArn: __expectString, - DataSourceId: __expectString, - Permissions: _json, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeDataSourcePermissionsCommandError - */ -const de_DescribeDataSourcePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeFolderCommand - */ -export const de_DescribeFolderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFolderCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Folder: (_) => de_Folder(_, context), - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeFolderCommandError - */ -const de_DescribeFolderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeFolderPermissionsCommand - */ -export const de_DescribeFolderPermissionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFolderPermissionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - FolderId: __expectString, - NextToken: __expectString, - Permissions: _json, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeFolderPermissionsCommandError - */ -const de_DescribeFolderPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeFolderResolvedPermissionsCommand - */ -export const de_DescribeFolderResolvedPermissionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFolderResolvedPermissionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - FolderId: __expectString, - NextToken: __expectString, - Permissions: _json, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeFolderResolvedPermissionsCommandError - */ -const de_DescribeFolderResolvedPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeGroupCommand - */ -export const de_DescribeGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Group: _json, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeGroupCommandError - */ -const de_DescribeGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeGroupMembershipCommand - */ -export const de_DescribeGroupMembershipCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeGroupMembershipCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - GroupMember: _json, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeGroupMembershipCommandError - */ -const de_DescribeGroupMembershipCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeIAMPolicyAssignmentCommand - */ -export const de_DescribeIAMPolicyAssignmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeIAMPolicyAssignmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - IAMPolicyAssignment: _json, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeIAMPolicyAssignmentCommandError - */ -const de_DescribeIAMPolicyAssignmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeIngestionCommand - */ -export const de_DescribeIngestionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeIngestionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Ingestion: (_) => de_Ingestion(_, context), - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeIngestionCommandError - */ -const de_DescribeIngestionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeIpRestrictionCommand - */ -export const de_DescribeIpRestrictionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeIpRestrictionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AwsAccountId: __expectString, - Enabled: __expectBoolean, - IpRestrictionRuleMap: _json, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeIpRestrictionCommandError - */ -const de_DescribeIpRestrictionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeNamespaceCommand - */ -export const de_DescribeNamespaceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeNamespaceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Namespace: _json, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeNamespaceCommandError - */ -const de_DescribeNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeRefreshScheduleCommand - */ -export const de_DescribeRefreshScheduleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRefreshScheduleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - RefreshSchedule: (_) => de_RefreshSchedule(_, context), - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeRefreshScheduleCommandError - */ -const de_DescribeRefreshScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeRoleCustomPermissionCommand - */ -export const de_DescribeRoleCustomPermissionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRoleCustomPermissionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CustomPermissionsName: __expectString, - RequestId: __expectString, - Status: __expectInt32, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeRoleCustomPermissionCommandError - */ -const de_DescribeRoleCustomPermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeTemplateCommand - */ -export const de_DescribeTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RequestId: __expectString, - Template: (_) => de_Template(_, context), - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeTemplateCommandError - */ -const de_DescribeTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeTemplateAliasCommand - */ -export const de_DescribeTemplateAliasCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTemplateAliasCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RequestId: __expectString, - TemplateAlias: _json, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeTemplateAliasCommandError - */ -const de_DescribeTemplateAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeTemplateDefinitionCommand - */ -export const de_DescribeTemplateDefinitionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTemplateDefinitionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Definition: (_) => de_TemplateVersionDefinition(_, context), - Errors: _json, - Name: __expectString, - RequestId: __expectString, - ResourceStatus: __expectString, - TemplateId: __expectString, - ThemeArn: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeTemplateDefinitionCommandError - */ -const de_DescribeTemplateDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeTemplatePermissionsCommand - */ -export const de_DescribeTemplatePermissionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTemplatePermissionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Permissions: _json, - RequestId: __expectString, - TemplateArn: __expectString, - TemplateId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeTemplatePermissionsCommandError - */ -const de_DescribeTemplatePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeThemeCommand - */ -export const de_DescribeThemeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeThemeCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RequestId: __expectString, - Theme: (_) => de_Theme(_, context), - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeThemeCommandError - */ -const de_DescribeThemeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeThemeAliasCommand - */ -export const de_DescribeThemeAliasCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeThemeAliasCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RequestId: __expectString, - ThemeAlias: _json, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeThemeAliasCommandError - */ -const de_DescribeThemeAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeThemePermissionsCommand - */ -export const de_DescribeThemePermissionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeThemePermissionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Permissions: _json, - RequestId: __expectString, - ThemeArn: __expectString, - ThemeId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeThemePermissionsCommandError - */ -const de_DescribeThemePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeTopicCommand - */ -export const de_DescribeTopicCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTopicCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Arn: __expectString, - RequestId: __expectString, - Topic: _json, - TopicId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeTopicCommandError - */ -const de_DescribeTopicCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeTopicPermissionsCommand - */ -export const de_DescribeTopicPermissionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTopicPermissionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Permissions: _json, - RequestId: __expectString, - TopicArn: __expectString, - TopicId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeTopicPermissionsCommandError - */ -const de_DescribeTopicPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeTopicRefreshCommand - */ -export const de_DescribeTopicRefreshCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTopicRefreshCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RefreshDetails: _json, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeTopicRefreshCommandError - */ -const de_DescribeTopicRefreshCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeTopicRefreshScheduleCommand - */ -export const de_DescribeTopicRefreshScheduleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTopicRefreshScheduleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DatasetArn: __expectString, - RefreshSchedule: (_) => de_TopicRefreshSchedule(_, context), - RequestId: __expectString, - TopicArn: __expectString, - TopicId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeTopicRefreshScheduleCommandError - */ -const de_DescribeTopicRefreshScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeUserCommand - */ -export const de_DescribeUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RequestId: __expectString, - User: _json, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeUserCommandError - */ -const de_DescribeUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeVPCConnectionCommand - */ -export const de_DescribeVPCConnectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeVPCConnectionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - RequestId: __expectString, - Status: __expectInt32, - VPCConnection: (_) => de_VPCConnection(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeVPCConnectionCommandError - */ -const de_DescribeVPCConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GenerateEmbedUrlForAnonymousUserCommand - */ -export const de_GenerateEmbedUrlForAnonymousUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GenerateEmbedUrlForAnonymousUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AnonymousUserArn: __expectString, - EmbedUrl: __expectString, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1GenerateEmbedUrlForAnonymousUserCommandError - */ -const de_GenerateEmbedUrlForAnonymousUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "SessionLifetimeInMinutesInvalidException": - case "com.amazonaws.quicksight#SessionLifetimeInMinutesInvalidException": - throw await de_SessionLifetimeInMinutesInvalidExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedPricingPlanException": - case "com.amazonaws.quicksight#UnsupportedPricingPlanException": - throw await de_UnsupportedPricingPlanExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GenerateEmbedUrlForRegisteredUserCommand - */ -export const de_GenerateEmbedUrlForRegisteredUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GenerateEmbedUrlForRegisteredUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - EmbedUrl: __expectString, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1GenerateEmbedUrlForRegisteredUserCommandError - */ -const de_GenerateEmbedUrlForRegisteredUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "QuickSightUserNotFoundException": - case "com.amazonaws.quicksight#QuickSightUserNotFoundException": - throw await de_QuickSightUserNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "SessionLifetimeInMinutesInvalidException": - case "com.amazonaws.quicksight#SessionLifetimeInMinutesInvalidException": - throw await de_SessionLifetimeInMinutesInvalidExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedPricingPlanException": - case "com.amazonaws.quicksight#UnsupportedPricingPlanException": - throw await de_UnsupportedPricingPlanExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDashboardEmbedUrlCommand - */ -export const de_GetDashboardEmbedUrlCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDashboardEmbedUrlCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - EmbedUrl: __expectString, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1GetDashboardEmbedUrlCommandError - */ -const de_GetDashboardEmbedUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DomainNotWhitelistedException": - case "com.amazonaws.quicksight#DomainNotWhitelistedException": - throw await de_DomainNotWhitelistedExceptionRes(parsedOutput, context); - case "IdentityTypeNotSupportedException": - case "com.amazonaws.quicksight#IdentityTypeNotSupportedException": - throw await de_IdentityTypeNotSupportedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "QuickSightUserNotFoundException": - case "com.amazonaws.quicksight#QuickSightUserNotFoundException": - throw await de_QuickSightUserNotFoundExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "SessionLifetimeInMinutesInvalidException": - case "com.amazonaws.quicksight#SessionLifetimeInMinutesInvalidException": - throw await de_SessionLifetimeInMinutesInvalidExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedPricingPlanException": - case "com.amazonaws.quicksight#UnsupportedPricingPlanException": - throw await de_UnsupportedPricingPlanExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSessionEmbedUrlCommand - */ -export const de_GetSessionEmbedUrlCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSessionEmbedUrlCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - EmbedUrl: __expectString, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1GetSessionEmbedUrlCommandError - */ -const de_GetSessionEmbedUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "QuickSightUserNotFoundException": - case "com.amazonaws.quicksight#QuickSightUserNotFoundException": - throw await de_QuickSightUserNotFoundExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "SessionLifetimeInMinutesInvalidException": - case "com.amazonaws.quicksight#SessionLifetimeInMinutesInvalidException": - throw await de_SessionLifetimeInMinutesInvalidExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAnalysesCommand - */ -export const de_ListAnalysesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnalysesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AnalysisSummaryList: (_) => de_AnalysisSummaryList(_, context), - NextToken: __expectString, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1ListAnalysesCommandError - */ -const de_ListAnalysesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAssetBundleExportJobsCommand - */ -export const de_ListAssetBundleExportJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssetBundleExportJobsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AssetBundleExportJobSummaryList: (_) => de_AssetBundleExportJobSummaryList(_, context), - NextToken: __expectString, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1ListAssetBundleExportJobsCommandError - */ -const de_ListAssetBundleExportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAssetBundleImportJobsCommand - */ -export const de_ListAssetBundleImportJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssetBundleImportJobsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AssetBundleImportJobSummaryList: (_) => de_AssetBundleImportJobSummaryList(_, context), - NextToken: __expectString, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1ListAssetBundleImportJobsCommandError - */ -const de_ListAssetBundleImportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDashboardsCommand - */ -export const de_ListDashboardsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDashboardsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DashboardSummaryList: (_) => de_DashboardSummaryList(_, context), - NextToken: __expectString, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1ListDashboardsCommandError - */ -const de_ListDashboardsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDashboardVersionsCommand - */ -export const de_ListDashboardVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDashboardVersionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DashboardVersionSummaryList: (_) => de_DashboardVersionSummaryList(_, context), - NextToken: __expectString, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1ListDashboardVersionsCommandError - */ -const de_ListDashboardVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDataSetsCommand - */ -export const de_ListDataSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataSetsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DataSetSummaries: (_) => de_DataSetSummaryList(_, context), - NextToken: __expectString, - RequestId: __expectString, - }); - Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1ListDataSetsCommandError - */ -const de_ListDataSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDataSourcesCommand - */ -export const de_ListDataSourcesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataSourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DataSources: (_) => de_DataSourceList(_, context), - NextToken: __expectString, + AnalysisId: __expectString, + Definition: (_) => de_AnalysisDefinition(_, context), + Errors: _json, + Name: __expectString, RequestId: __expectString, + ResourceStatus: __expectString, + ThemeArn: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -12003,60 +6374,23 @@ export const de_ListDataSourcesCommand = async ( }; /** - * deserializeAws_restJson1ListDataSourcesCommandError - */ -const de_ListDataSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListFolderMembersCommand + * deserializeAws_restJson1DescribeAnalysisPermissionsCommand */ -export const de_ListFolderMembersCommand = async ( +export const de_DescribeAnalysisPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFolderMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - FolderMemberList: _json, - NextToken: __expectString, + AnalysisArn: __expectString, + AnalysisId: __expectString, + Permissions: _json, RequestId: __expectString, }); Object.assign(contents, doc); @@ -12067,67 +6401,36 @@ export const de_ListFolderMembersCommand = async ( }; /** - * deserializeAws_restJson1ListFolderMembersCommandError - */ -const de_ListFolderMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListFoldersCommand + * deserializeAws_restJson1DescribeAssetBundleExportJobCommand */ -export const de_ListFoldersCommand = async ( +export const de_DescribeAssetBundleExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFoldersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - FolderSummaryList: (_) => de_FolderSummaryList(_, context), - NextToken: __expectString, + Arn: __expectString, + AssetBundleExportJobId: __expectString, + AwsAccountId: __expectString, + CloudFormationOverridePropertyConfiguration: _json, + CreatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + DownloadUrl: __expectString, + Errors: _json, + ExportFormat: __expectString, + IncludeAllDependencies: __expectBoolean, + IncludePermissions: __expectBoolean, + IncludeTags: __expectBoolean, + JobStatus: __expectString, RequestId: __expectString, + ResourceArns: _json, + ValidationStrategy: _json, + Warnings: _json, }); Object.assign(contents, doc); map(contents, { @@ -12137,139 +6440,58 @@ export const de_ListFoldersCommand = async ( }; /** - * deserializeAws_restJson1ListFoldersCommandError - */ -const de_ListFoldersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListGroupMembershipsCommand + * deserializeAws_restJson1DescribeAssetBundleImportJobCommand */ -export const de_ListGroupMembershipsCommand = async ( +export const de_DescribeAssetBundleImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGroupMembershipsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - GroupMemberList: _json, - NextToken: __expectString, + Arn: __expectString, + AssetBundleImportJobId: __expectString, + AssetBundleImportSource: _json, + AwsAccountId: __expectString, + CreatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Errors: _json, + FailureAction: __expectString, + JobStatus: __expectString, + OverrideParameters: (_) => de_AssetBundleImportJobOverrideParameters(_, context), + OverridePermissions: _json, + OverrideTags: _json, + OverrideValidationStrategy: _json, RequestId: __expectString, + RollbackErrors: _json, }); Object.assign(contents, doc); map(contents, { - Status: [, output.statusCode], - }); - return contents; -}; - -/** - * deserializeAws_restJson1ListGroupMembershipsCommandError - */ -const de_ListGroupMembershipsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1ListGroupsCommand + * deserializeAws_restJson1DescribeDashboardCommand */ -export const de_ListGroupsCommand = async ( +export const de_DescribeDashboardCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - GroupList: _json, - NextToken: __expectString, + Dashboard: (_) => de_Dashboard(_, context), RequestId: __expectString, }); Object.assign(contents, doc); @@ -12280,69 +6502,55 @@ export const de_ListGroupsCommand = async ( }; /** - * deserializeAws_restJson1ListGroupsCommandError + * deserializeAws_restJson1DescribeDashboardDefinitionCommand */ -const de_ListGroupsCommandError = async ( +export const de_DescribeDashboardDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DashboardId: __expectString, + DashboardPublishOptions: _json, + Definition: (_) => de_DashboardVersionDefinition(_, context), + Errors: _json, + Name: __expectString, + RequestId: __expectString, + ResourceStatus: __expectString, + ThemeArn: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1ListIAMPolicyAssignmentsCommand + * deserializeAws_restJson1DescribeDashboardPermissionsCommand */ -export const de_ListIAMPolicyAssignmentsCommand = async ( +export const de_DescribeDashboardPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIAMPolicyAssignmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - IAMPolicyAssignments: _json, - NextToken: __expectString, + DashboardArn: __expectString, + DashboardId: __expectString, + LinkSharingConfiguration: _json, + Permissions: _json, RequestId: __expectString, }); Object.assign(contents, doc); @@ -12353,64 +6561,58 @@ export const de_ListIAMPolicyAssignmentsCommand = async ( }; /** - * deserializeAws_restJson1ListIAMPolicyAssignmentsCommandError + * deserializeAws_restJson1DescribeDashboardSnapshotJobCommand */ -const de_ListIAMPolicyAssignmentsCommandError = async ( +export const de_DescribeDashboardSnapshotJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + AwsAccountId: __expectString, + CreatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + DashboardId: __expectString, + JobStatus: __expectString, + LastUpdatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + RequestId: __expectString, + SnapshotConfiguration: (_) => de_SnapshotConfiguration(_, context), + SnapshotJobId: __expectString, + Status: __expectInt32, + UserConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListIAMPolicyAssignmentsForUserCommand + * deserializeAws_restJson1DescribeDashboardSnapshotJobResultCommand */ -export const de_ListIAMPolicyAssignmentsForUserCommand = async ( +export const de_DescribeDashboardSnapshotJobResultCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIAMPolicyAssignmentsForUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ActiveAssignments: _json, - NextToken: __expectString, + Arn: __expectString, + CreatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + ErrorInfo: _json, + JobStatus: __expectString, + LastUpdatedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), RequestId: __expectString, + Result: _json, }); Object.assign(contents, doc); map(contents, { @@ -12420,67 +6622,49 @@ export const de_ListIAMPolicyAssignmentsForUserCommand = async ( }; /** - * deserializeAws_restJson1ListIAMPolicyAssignmentsForUserCommandError + * deserializeAws_restJson1DescribeDataSetCommand */ -const de_ListIAMPolicyAssignmentsForUserCommandError = async ( +export const de_DescribeDataSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentUpdatingException": - case "com.amazonaws.quicksight#ConcurrentUpdatingException": - throw await de_ConcurrentUpdatingExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DataSet: (_) => de_DataSet(_, context), + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1ListIdentityPropagationConfigsCommand + * deserializeAws_restJson1DescribeDataSetPermissionsCommand */ -export const de_ListIdentityPropagationConfigsCommand = async ( +export const de_DescribeDataSetPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIdentityPropagationConfigsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, + DataSetArn: __expectString, + DataSetId: __expectString, + Permissions: _json, RequestId: __expectString, - Services: _json, }); Object.assign(contents, doc); map(contents, { @@ -12490,60 +6674,46 @@ export const de_ListIdentityPropagationConfigsCommand = async ( }; /** - * deserializeAws_restJson1ListIdentityPropagationConfigsCommandError + * deserializeAws_restJson1DescribeDataSetRefreshPropertiesCommand */ -const de_ListIdentityPropagationConfigsCommandError = async ( +export const de_DescribeDataSetRefreshPropertiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DataSetRefreshProperties: _json, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1ListIngestionsCommand + * deserializeAws_restJson1DescribeDataSourceCommand */ -export const de_ListIngestionsCommand = async ( +export const de_DescribeDataSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIngestionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Ingestions: (_) => de_Ingestions(_, context), - NextToken: __expectString, + DataSource: (_) => de_DataSource(_, context), RequestId: __expectString, }); Object.assign(contents, doc); @@ -12554,66 +6724,48 @@ export const de_ListIngestionsCommand = async ( }; /** - * deserializeAws_restJson1ListIngestionsCommandError + * deserializeAws_restJson1DescribeDataSourcePermissionsCommand */ -const de_ListIngestionsCommandError = async ( +export const de_DescribeDataSourcePermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DataSourceArn: __expectString, + DataSourceId: __expectString, + Permissions: _json, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1ListNamespacesCommand + * deserializeAws_restJson1DescribeFolderCommand */ -export const de_ListNamespacesCommand = async ( +export const de_DescribeFolderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNamespacesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Namespaces: _json, - NextToken: __expectString, + Folder: (_) => de_Folder(_, context), RequestId: __expectString, }); Object.assign(contents, doc); @@ -12624,68 +6776,52 @@ export const de_ListNamespacesCommand = async ( }; /** - * deserializeAws_restJson1ListNamespacesCommandError + * deserializeAws_restJson1DescribeFolderPermissionsCommand */ -const de_ListNamespacesCommandError = async ( +export const de_DescribeFolderPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + FolderId: __expectString, + NextToken: __expectString, + Permissions: _json, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1ListRefreshSchedulesCommand + * deserializeAws_restJson1DescribeFolderResolvedPermissionsCommand */ -export const de_ListRefreshSchedulesCommand = async ( +export const de_DescribeFolderResolvedPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRefreshSchedulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - RefreshSchedules: (_) => de_RefreshSchedules(_, context), + Arn: __expectString, + FolderId: __expectString, + NextToken: __expectString, + Permissions: _json, RequestId: __expectString, }); Object.assign(contents, doc); @@ -12696,63 +6832,46 @@ export const de_ListRefreshSchedulesCommand = async ( }; /** - * deserializeAws_restJson1ListRefreshSchedulesCommandError + * deserializeAws_restJson1DescribeGroupCommand */ -const de_ListRefreshSchedulesCommandError = async ( +export const de_DescribeGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Group: _json, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1ListRoleMembershipsCommand + * deserializeAws_restJson1DescribeGroupMembershipCommand */ -export const de_ListRoleMembershipsCommand = async ( +export const de_DescribeGroupMembershipCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRoleMembershipsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - MembersList: _json, - NextToken: __expectString, + GroupMember: _json, RequestId: __expectString, }); Object.assign(contents, doc); @@ -12763,72 +6882,74 @@ export const de_ListRoleMembershipsCommand = async ( }; /** - * deserializeAws_restJson1ListRoleMembershipsCommandError + * deserializeAws_restJson1DescribeIAMPolicyAssignmentCommand */ -const de_ListRoleMembershipsCommandError = async ( +export const de_DescribeIAMPolicyAssignmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + IAMPolicyAssignment: _json, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; +}; + +/** + * deserializeAws_restJson1DescribeIngestionCommand + */ +export const de_DescribeIngestionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Ingestion: (_) => de_Ingestion(_, context), + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1DescribeIpRestrictionCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_DescribeIpRestrictionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + AwsAccountId: __expectString, + Enabled: __expectBoolean, + IpRestrictionRuleMap: _json, RequestId: __expectString, - Tags: _json, }); Object.assign(contents, doc); map(contents, { @@ -12838,61 +6959,48 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1DescribeNamespaceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_DescribeNamespaceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Namespace: _json, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1ListTemplateAliasesCommand + * deserializeAws_restJson1DescribeRefreshScheduleCommand */ -export const de_ListTemplateAliasesCommand = async ( +export const de_DescribeRefreshScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTemplateAliasesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, + Arn: __expectString, + RefreshSchedule: (_) => de_RefreshSchedule(_, context), RequestId: __expectString, - TemplateAliasList: _json, }); Object.assign(contents, doc); map(contents, { @@ -12902,61 +7010,45 @@ export const de_ListTemplateAliasesCommand = async ( }; /** - * deserializeAws_restJson1ListTemplateAliasesCommandError + * deserializeAws_restJson1DescribeRoleCustomPermissionCommand */ -const de_ListTemplateAliasesCommandError = async ( +export const de_DescribeRoleCustomPermissionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CustomPermissionsName: __expectString, + RequestId: __expectString, + Status: __expectInt32, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTemplatesCommand + * deserializeAws_restJson1DescribeTemplateCommand */ -export const de_ListTemplatesCommand = async ( +export const de_DescribeTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, RequestId: __expectString, - TemplateSummaryList: (_) => de_TemplateSummaryList(_, context), + Template: (_) => de_Template(_, context), }); Object.assign(contents, doc); map(contents, { @@ -12966,64 +7058,52 @@ export const de_ListTemplatesCommand = async ( }; /** - * deserializeAws_restJson1ListTemplatesCommandError + * deserializeAws_restJson1DescribeTemplateAliasCommand */ -const de_ListTemplatesCommandError = async ( +export const de_DescribeTemplateAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RequestId: __expectString, + TemplateAlias: _json, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1ListTemplateVersionsCommand + * deserializeAws_restJson1DescribeTemplateDefinitionCommand */ -export const de_ListTemplateVersionsCommand = async ( +export const de_DescribeTemplateDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTemplateVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, + Definition: (_) => de_TemplateVersionDefinition(_, context), + Errors: _json, + Name: __expectString, RequestId: __expectString, - TemplateVersionSummaryList: (_) => de_TemplateVersionSummaryList(_, context), + ResourceStatus: __expectString, + TemplateId: __expectString, + ThemeArn: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -13033,64 +7113,49 @@ export const de_ListTemplateVersionsCommand = async ( }; /** - * deserializeAws_restJson1ListTemplateVersionsCommandError + * deserializeAws_restJson1DescribeTemplatePermissionsCommand */ -const de_ListTemplateVersionsCommandError = async ( +export const de_DescribeTemplatePermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Permissions: _json, + RequestId: __expectString, + TemplateArn: __expectString, + TemplateId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1ListThemeAliasesCommand + * deserializeAws_restJson1DescribeThemeCommand */ -export const de_ListThemeAliasesCommand = async ( +export const de_DescribeThemeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListThemeAliasesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, RequestId: __expectString, - ThemeAliasList: _json, + Theme: (_) => de_Theme(_, context), }); Object.assign(contents, doc); map(contents, { @@ -13100,67 +7165,22 @@ export const de_ListThemeAliasesCommand = async ( }; /** - * deserializeAws_restJson1ListThemeAliasesCommandError - */ -const de_ListThemeAliasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListThemesCommand + * deserializeAws_restJson1DescribeThemeAliasCommand */ -export const de_ListThemesCommand = async ( +export const de_DescribeThemeAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListThemesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, RequestId: __expectString, - ThemeSummaryList: (_) => de_ThemeSummaryList(_, context), + ThemeAlias: _json, }); Object.assign(contents, doc); map(contents, { @@ -13170,67 +7190,24 @@ export const de_ListThemesCommand = async ( }; /** - * deserializeAws_restJson1ListThemesCommandError - */ -const de_ListThemesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListThemeVersionsCommand + * deserializeAws_restJson1DescribeThemePermissionsCommand */ -export const de_ListThemeVersionsCommand = async ( +export const de_DescribeThemePermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListThemeVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, + Permissions: _json, RequestId: __expectString, - ThemeVersionSummaryList: (_) => de_ThemeVersionSummaryList(_, context), + ThemeArn: __expectString, + ThemeId: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -13240,65 +7217,48 @@ export const de_ListThemeVersionsCommand = async ( }; /** - * deserializeAws_restJson1ListThemeVersionsCommandError + * deserializeAws_restJson1DescribeTopicCommand */ -const de_ListThemeVersionsCommandError = async ( +export const de_DescribeTopicCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + RequestId: __expectString, + Topic: _json, + TopicId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1ListTopicRefreshSchedulesCommand + * deserializeAws_restJson1DescribeTopicPermissionsCommand */ -export const de_ListTopicRefreshSchedulesCommand = async ( +export const de_DescribeTopicPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTopicRefreshSchedulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - RefreshSchedules: (_) => de_TopicRefreshScheduleSummaries(_, context), + Permissions: _json, RequestId: __expectString, TopicArn: __expectString, TopicId: __expectString, @@ -13311,70 +7271,22 @@ export const de_ListTopicRefreshSchedulesCommand = async ( }; /** - * deserializeAws_restJson1ListTopicRefreshSchedulesCommandError - */ -const de_ListTopicRefreshSchedulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTopicsCommand + * deserializeAws_restJson1DescribeTopicRefreshCommand */ -export const de_ListTopicsCommand = async ( +export const de_DescribeTopicRefreshCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTopicsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, + RefreshDetails: _json, RequestId: __expectString, - TopicsSummaries: _json, }); Object.assign(contents, doc); map(contents, { @@ -13384,61 +7296,50 @@ export const de_ListTopicsCommand = async ( }; /** - * deserializeAws_restJson1ListTopicsCommandError + * deserializeAws_restJson1DescribeTopicRefreshScheduleCommand */ -const de_ListTopicsCommandError = async ( +export const de_DescribeTopicRefreshScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DatasetArn: __expectString, + RefreshSchedule: (_) => de_TopicRefreshSchedule(_, context), + RequestId: __expectString, + TopicArn: __expectString, + TopicId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1ListUserGroupsCommand + * deserializeAws_restJson1DescribeUserCommand */ -export const de_ListUserGroupsCommand = async ( +export const de_DescribeUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUserGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - GroupList: _json, - NextToken: __expectString, RequestId: __expectString, + User: _json, }); Object.assign(contents, doc); map(contents, { @@ -13448,67 +7349,46 @@ export const de_ListUserGroupsCommand = async ( }; /** - * deserializeAws_restJson1ListUserGroupsCommandError + * deserializeAws_restJson1DescribeVPCConnectionCommand */ -const de_ListUserGroupsCommandError = async ( +export const de_DescribeVPCConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RequestId: __expectString, + Status: __expectInt32, + VPCConnection: (_) => de_VPCConnection(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListUsersCommand + * deserializeAws_restJson1GenerateEmbedUrlForAnonymousUserCommand */ -export const de_ListUsersCommand = async ( +export const de_GenerateEmbedUrlForAnonymousUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUsersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, + AnonymousUserArn: __expectString, + EmbedUrl: __expectString, RequestId: __expectString, - UserList: _json, }); Object.assign(contents, doc); map(contents, { @@ -13518,70 +7398,47 @@ export const de_ListUsersCommand = async ( }; /** - * deserializeAws_restJson1ListUsersCommandError + * deserializeAws_restJson1GenerateEmbedUrlForRegisteredUserCommand */ -const de_ListUsersCommandError = async ( +export const de_GenerateEmbedUrlForRegisteredUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EmbedUrl: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1ListVPCConnectionsCommand + * deserializeAws_restJson1GetDashboardEmbedUrlCommand */ -export const de_ListVPCConnectionsCommand = async ( +export const de_GetDashboardEmbedUrlCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVPCConnectionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, + EmbedUrl: __expectString, RequestId: __expectString, - VPCConnectionSummaries: (_) => de_VPCConnectionSummaryList(_, context), }); Object.assign(contents, doc); map(contents, { @@ -13591,61 +7448,47 @@ export const de_ListVPCConnectionsCommand = async ( }; /** - * deserializeAws_restJson1ListVPCConnectionsCommandError + * deserializeAws_restJson1GetSessionEmbedUrlCommand */ -const de_ListVPCConnectionsCommandError = async ( +export const de_GetSessionEmbedUrlCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EmbedUrl: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1PutDataSetRefreshPropertiesCommand + * deserializeAws_restJson1ListAnalysesCommand */ -export const de_PutDataSetRefreshPropertiesCommand = async ( +export const de_ListAnalysesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutDataSetRefreshPropertiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + AnalysisSummaryList: (_) => de_AnalysisSummaryList(_, context), + NextToken: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -13656,70 +7499,49 @@ export const de_PutDataSetRefreshPropertiesCommand = async ( }; /** - * deserializeAws_restJson1PutDataSetRefreshPropertiesCommandError + * deserializeAws_restJson1ListAssetBundleExportJobsCommand */ -const de_PutDataSetRefreshPropertiesCommandError = async ( +export const de_ListAssetBundleExportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AssetBundleExportJobSummaryList: (_) => de_AssetBundleExportJobSummaryList(_, context), + NextToken: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1RegisterUserCommand + * deserializeAws_restJson1ListAssetBundleImportJobsCommand */ -export const de_RegisterUserCommand = async ( +export const de_ListAssetBundleImportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + AssetBundleImportJobSummaryList: (_) => de_AssetBundleImportJobSummaryList(_, context), + NextToken: __expectString, RequestId: __expectString, - User: _json, - UserInvitationUrl: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -13729,72 +7551,22 @@ export const de_RegisterUserCommand = async ( }; /** - * deserializeAws_restJson1RegisterUserCommandError - */ -const de_RegisterUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RestoreAnalysisCommand + * deserializeAws_restJson1ListDashboardsCommand */ -export const de_RestoreAnalysisCommand = async ( +export const de_ListDashboardsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RestoreAnalysisCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AnalysisId: __expectString, - Arn: __expectString, + DashboardSummaryList: (_) => de_DashboardSummaryList(_, context), + NextToken: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -13805,62 +7577,21 @@ export const de_RestoreAnalysisCommand = async ( }; /** - * deserializeAws_restJson1RestoreAnalysisCommandError - */ -const de_RestoreAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchAnalysesCommand + * deserializeAws_restJson1ListDashboardVersionsCommand */ -export const de_SearchAnalysesCommand = async ( +export const de_ListDashboardVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchAnalysesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AnalysisSummaryList: (_) => de_AnalysisSummaryList(_, context), + DashboardVersionSummaryList: (_) => de_DashboardVersionSummaryList(_, context), NextToken: __expectString, RequestId: __expectString, }); @@ -13872,62 +7603,21 @@ export const de_SearchAnalysesCommand = async ( }; /** - * deserializeAws_restJson1SearchAnalysesCommandError - */ -const de_SearchAnalysesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchDashboardsCommand + * deserializeAws_restJson1ListDataSetsCommand */ -export const de_SearchDashboardsCommand = async ( +export const de_ListDataSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchDashboardsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DashboardSummaryList: (_) => de_DashboardSummaryList(_, context), + DataSetSummaries: (_) => de_DataSetSummaryList(_, context), NextToken: __expectString, RequestId: __expectString, }); @@ -13939,62 +7629,47 @@ export const de_SearchDashboardsCommand = async ( }; /** - * deserializeAws_restJson1SearchDashboardsCommandError + * deserializeAws_restJson1ListDataSourcesCommand */ -const de_SearchDashboardsCommandError = async ( +export const de_ListDataSourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DataSources: (_) => de_DataSourceList(_, context), + NextToken: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1SearchDataSetsCommand + * deserializeAws_restJson1ListFolderMembersCommand */ -export const de_SearchDataSetsCommand = async ( +export const de_ListFolderMembersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchDataSetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DataSetSummaries: (_) => de_DataSetSummaryList(_, context), + FolderMemberList: _json, NextToken: __expectString, RequestId: __expectString, }); @@ -14006,62 +7681,47 @@ export const de_SearchDataSetsCommand = async ( }; /** - * deserializeAws_restJson1SearchDataSetsCommandError + * deserializeAws_restJson1ListFoldersCommand */ -const de_SearchDataSetsCommandError = async ( +export const de_ListFoldersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + FolderSummaryList: (_) => de_FolderSummaryList(_, context), + NextToken: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1SearchDataSourcesCommand + * deserializeAws_restJson1ListGroupMembershipsCommand */ -export const de_SearchDataSourcesCommand = async ( +export const de_ListGroupMembershipsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchDataSourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DataSourceSummaries: (_) => de_DataSourceSummaryList(_, context), + GroupMemberList: _json, NextToken: __expectString, RequestId: __expectString, }); @@ -14073,62 +7733,47 @@ export const de_SearchDataSourcesCommand = async ( }; /** - * deserializeAws_restJson1SearchDataSourcesCommandError + * deserializeAws_restJson1ListGroupsCommand */ -const de_SearchDataSourcesCommandError = async ( +export const de_ListGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + GroupList: _json, + NextToken: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1SearchFoldersCommand + * deserializeAws_restJson1ListIAMPolicyAssignmentsCommand */ -export const de_SearchFoldersCommand = async ( +export const de_ListIAMPolicyAssignmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchFoldersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - FolderSummaryList: (_) => de_FolderSummaryList(_, context), + IAMPolicyAssignments: _json, NextToken: __expectString, RequestId: __expectString, }); @@ -14140,70 +7785,49 @@ export const de_SearchFoldersCommand = async ( }; /** - * deserializeAws_restJson1SearchFoldersCommandError + * deserializeAws_restJson1ListIAMPolicyAssignmentsForUserCommand */ -const de_SearchFoldersCommandError = async ( +export const de_ListIAMPolicyAssignmentsForUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.quicksight#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ActiveAssignments: _json, + NextToken: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1SearchGroupsCommand + * deserializeAws_restJson1ListIdentityPropagationConfigsCommand */ -export const de_SearchGroupsCommand = async ( +export const de_ListIdentityPropagationConfigsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - GroupList: _json, NextToken: __expectString, RequestId: __expectString, + Services: _json, }); Object.assign(contents, doc); map(contents, { @@ -14213,69 +7837,48 @@ export const de_SearchGroupsCommand = async ( }; /** - * deserializeAws_restJson1SearchGroupsCommandError + * deserializeAws_restJson1ListIngestionsCommand */ -const de_SearchGroupsCommandError = async ( +export const de_ListIngestionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.quicksight#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Ingestions: (_) => de_Ingestions(_, context), + NextToken: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1StartAssetBundleExportJobCommand + * deserializeAws_restJson1ListNamespacesCommand */ -export const de_StartAssetBundleExportJobCommand = async ( +export const de_ListNamespacesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartAssetBundleExportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - AssetBundleExportJobId: __expectString, + Namespaces: _json, + NextToken: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -14286,66 +7889,47 @@ export const de_StartAssetBundleExportJobCommand = async ( }; /** - * deserializeAws_restJson1StartAssetBundleExportJobCommandError + * deserializeAws_restJson1ListRefreshSchedulesCommand */ -const de_StartAssetBundleExportJobCommandError = async ( +export const de_ListRefreshSchedulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RefreshSchedules: (_) => de_RefreshSchedules(_, context), + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1StartAssetBundleImportJobCommand + * deserializeAws_restJson1ListRoleMembershipsCommand */ -export const de_StartAssetBundleImportJobCommand = async ( +export const de_ListRoleMembershipsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartAssetBundleImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - AssetBundleImportJobId: __expectString, + MembersList: _json, + NextToken: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -14356,67 +7940,22 @@ export const de_StartAssetBundleImportJobCommand = async ( }; /** - * deserializeAws_restJson1StartAssetBundleImportJobCommandError - */ -const de_StartAssetBundleImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartDashboardSnapshotJobCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_StartDashboardSnapshotJobCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartDashboardSnapshotJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, RequestId: __expectString, - SnapshotJobId: __expectString, + Tags: _json, }); Object.assign(contents, doc); map(contents, { @@ -14426,71 +7965,23 @@ export const de_StartDashboardSnapshotJobCommand = async ( }; /** - * deserializeAws_restJson1StartDashboardSnapshotJobCommandError - */ -const de_StartDashboardSnapshotJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedPricingPlanException": - case "com.amazonaws.quicksight#UnsupportedPricingPlanException": - throw await de_UnsupportedPricingPlanExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListTemplateAliasesCommand */ -export const de_TagResourceCommand = async ( +export const de_ListTemplateAliasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + NextToken: __expectString, RequestId: __expectString, + TemplateAliasList: _json, }); Object.assign(contents, doc); map(contents, { @@ -14500,62 +7991,23 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1ListTemplatesCommand */ -export const de_UntagResourceCommand = async ( +export const de_ListTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + NextToken: __expectString, RequestId: __expectString, + TemplateSummaryList: (_) => de_TemplateSummaryList(_, context), }); Object.assign(contents, doc); map(contents, { @@ -14565,63 +8017,49 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1ListTemplateVersionsCommand */ -const de_UntagResourceCommandError = async ( +export const de_ListTemplateVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + RequestId: __expectString, + TemplateVersionSummaryList: (_) => de_TemplateVersionSummaryList(_, context), + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateAccountCustomizationCommand + * deserializeAws_restJson1ListThemeAliasesCommand */ -export const de_UpdateAccountCustomizationCommand = async ( +export const de_ListThemeAliasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAccountCustomizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AccountCustomization: _json, - Arn: __expectString, - AwsAccountId: __expectString, - Namespace: __expectString, + NextToken: __expectString, RequestId: __expectString, + ThemeAliasList: _json, }); Object.assign(contents, doc); map(contents, { @@ -14631,65 +8069,49 @@ export const de_UpdateAccountCustomizationCommand = async ( }; /** - * deserializeAws_restJson1UpdateAccountCustomizationCommandError + * deserializeAws_restJson1ListThemesCommand */ -const de_UpdateAccountCustomizationCommandError = async ( +export const de_ListThemesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + RequestId: __expectString, + ThemeSummaryList: (_) => de_ThemeSummaryList(_, context), + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateAccountSettingsCommand + * deserializeAws_restJson1ListThemeVersionsCommand */ -export const de_UpdateAccountSettingsCommand = async ( +export const de_ListThemeVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAccountSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + NextToken: __expectString, RequestId: __expectString, + ThemeVersionSummaryList: (_) => de_ThemeVersionSummaryList(_, context), }); Object.assign(contents, doc); map(contents, { @@ -14699,65 +8121,50 @@ export const de_UpdateAccountSettingsCommand = async ( }; /** - * deserializeAws_restJson1UpdateAccountSettingsCommandError + * deserializeAws_restJson1ListTopicRefreshSchedulesCommand */ -const de_UpdateAccountSettingsCommandError = async ( +export const de_ListTopicRefreshSchedulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RefreshSchedules: (_) => de_TopicRefreshScheduleSummaries(_, context), + RequestId: __expectString, + TopicArn: __expectString, + TopicId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateAnalysisCommand + * deserializeAws_restJson1ListTopicsCommand */ -export const de_UpdateAnalysisCommand = async ( +export const de_ListTopicsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAnalysisCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AnalysisId: __expectString, - Arn: __expectString, + NextToken: __expectString, RequestId: __expectString, - UpdateStatus: __expectString, + TopicsSummaries: _json, }); Object.assign(contents, doc); map(contents, { @@ -14767,68 +8174,49 @@ export const de_UpdateAnalysisCommand = async ( }; /** - * deserializeAws_restJson1UpdateAnalysisCommandError + * deserializeAws_restJson1ListUserGroupsCommand */ -const de_UpdateAnalysisCommandError = async ( +export const de_ListUserGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + GroupList: _json, + NextToken: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateAnalysisPermissionsCommand + * deserializeAws_restJson1ListUsersCommand */ -export const de_UpdateAnalysisPermissionsCommand = async ( +export const de_ListUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAnalysisPermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AnalysisArn: __expectString, - AnalysisId: __expectString, - Permissions: _json, + NextToken: __expectString, RequestId: __expectString, + UserList: _json, }); Object.assign(contents, doc); map(contents, { @@ -14838,136 +8226,98 @@ export const de_UpdateAnalysisPermissionsCommand = async ( }; /** - * deserializeAws_restJson1UpdateAnalysisPermissionsCommandError + * deserializeAws_restJson1ListVPCConnectionsCommand */ -const de_UpdateAnalysisPermissionsCommandError = async ( +export const de_ListVPCConnectionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + RequestId: __expectString, + VPCConnectionSummaries: (_) => de_VPCConnectionSummaryList(_, context), + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateDashboardCommand + * deserializeAws_restJson1PutDataSetRefreshPropertiesCommand */ -export const de_UpdateDashboardCommand = async ( +export const de_PutDataSetRefreshPropertiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDashboardCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - CreationStatus: __expectString, - DashboardId: __expectString, RequestId: __expectString, - Status: __expectInt32, - VersionArn: __expectString, }); Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); return contents; }; /** - * deserializeAws_restJson1UpdateDashboardCommandError + * deserializeAws_restJson1RegisterUserCommand */ -const de_UpdateDashboardCommandError = async ( +export const de_RegisterUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RequestId: __expectString, + User: _json, + UserInvitationUrl: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateDashboardLinksCommand + * deserializeAws_restJson1RestoreAnalysisCommand */ -export const de_UpdateDashboardLinksCommand = async ( +export const de_RestoreAnalysisCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDashboardLinksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DashboardArn: __expectString, - LinkEntities: _json, + AnalysisId: __expectString, + Arn: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -14978,68 +8328,48 @@ export const de_UpdateDashboardLinksCommand = async ( }; /** - * deserializeAws_restJson1UpdateDashboardLinksCommandError + * deserializeAws_restJson1SearchAnalysesCommand */ -const de_UpdateDashboardLinksCommandError = async ( +export const de_SearchAnalysesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AnalysisSummaryList: (_) => de_AnalysisSummaryList(_, context), + NextToken: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateDashboardPermissionsCommand + * deserializeAws_restJson1SearchDashboardsCommand */ -export const de_UpdateDashboardPermissionsCommand = async ( +export const de_SearchDashboardsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDashboardPermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DashboardArn: __expectString, - DashboardId: __expectString, - LinkSharingConfiguration: _json, - Permissions: _json, + DashboardSummaryList: (_) => de_DashboardSummaryList(_, context), + NextToken: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -15050,66 +8380,48 @@ export const de_UpdateDashboardPermissionsCommand = async ( }; /** - * deserializeAws_restJson1UpdateDashboardPermissionsCommandError + * deserializeAws_restJson1SearchDataSetsCommand */ -const de_UpdateDashboardPermissionsCommandError = async ( +export const de_SearchDataSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DataSetSummaries: (_) => de_DataSetSummaryList(_, context), + NextToken: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateDashboardPublishedVersionCommand + * deserializeAws_restJson1SearchDataSourcesCommand */ -export const de_UpdateDashboardPublishedVersionCommand = async ( +export const de_SearchDataSourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDashboardPublishedVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DashboardArn: __expectString, - DashboardId: __expectString, + DataSourceSummaries: (_) => de_DataSourceSummaryList(_, context), + NextToken: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -15120,65 +8432,48 @@ export const de_UpdateDashboardPublishedVersionCommand = async ( }; /** - * deserializeAws_restJson1UpdateDashboardPublishedVersionCommandError + * deserializeAws_restJson1SearchFoldersCommand */ -const de_UpdateDashboardPublishedVersionCommandError = async ( +export const de_SearchFoldersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + FolderSummaryList: (_) => de_FolderSummaryList(_, context), + NextToken: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateDataSetCommand + * deserializeAws_restJson1SearchGroupsCommand */ -export const de_UpdateDataSetCommand = async ( +export const de_SearchGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDataSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - DataSetId: __expectString, - IngestionArn: __expectString, - IngestionId: __expectString, + GroupList: _json, + NextToken: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -15189,69 +8484,48 @@ export const de_UpdateDataSetCommand = async ( }; /** - * deserializeAws_restJson1UpdateDataSetCommandError + * deserializeAws_restJson1StartAssetBundleExportJobCommand */ -const de_UpdateDataSetCommandError = async ( +export const de_StartAssetBundleExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + AssetBundleExportJobId: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateDataSetPermissionsCommand + * deserializeAws_restJson1StartAssetBundleImportJobCommand */ -export const de_UpdateDataSetPermissionsCommand = async ( +export const de_StartAssetBundleImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDataSetPermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DataSetArn: __expectString, - DataSetId: __expectString, + Arn: __expectString, + AssetBundleImportJobId: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -15262,55 +8536,14 @@ export const de_UpdateDataSetPermissionsCommand = async ( }; /** - * deserializeAws_restJson1UpdateDataSetPermissionsCommandError - */ -const de_UpdateDataSetPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateDataSourceCommand + * deserializeAws_restJson1StartDashboardSnapshotJobCommand */ -export const de_UpdateDataSourceCommand = async ( +export const de_StartDashboardSnapshotJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDataSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -15318,9 +8551,8 @@ export const de_UpdateDataSourceCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { Arn: __expectString, - DataSourceId: __expectString, RequestId: __expectString, - UpdateStatus: __expectString, + SnapshotJobId: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -15330,63 +8562,20 @@ export const de_UpdateDataSourceCommand = async ( }; /** - * deserializeAws_restJson1UpdateDataSourceCommandError - */ -const de_UpdateDataSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateDataSourcePermissionsCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UpdateDataSourcePermissionsCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDataSourcePermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DataSourceArn: __expectString, - DataSourceId: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -15397,63 +8586,48 @@ export const de_UpdateDataSourcePermissionsCommand = async ( }; /** - * deserializeAws_restJson1UpdateDataSourcePermissionsCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UpdateDataSourcePermissionsCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateFolderCommand + * deserializeAws_restJson1UpdateAccountCustomizationCommand */ -export const de_UpdateFolderCommand = async ( +export const de_UpdateAccountCustomizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFolderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + AccountCustomization: _json, Arn: __expectString, - FolderId: __expectString, + AwsAccountId: __expectString, + Namespace: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -15464,137 +8638,74 @@ export const de_UpdateFolderCommand = async ( }; /** - * deserializeAws_restJson1UpdateFolderCommandError - */ -const de_UpdateFolderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateFolderPermissionsCommand + * deserializeAws_restJson1UpdateAccountSettingsCommand */ -export const de_UpdateFolderPermissionsCommand = async ( +export const de_UpdateAccountSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFolderPermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - FolderId: __expectString, - Permissions: _json, RequestId: __expectString, - Status: __expectInt32, }); Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); return contents; }; /** - * deserializeAws_restJson1UpdateFolderPermissionsCommandError + * deserializeAws_restJson1UpdateAnalysisCommand */ -const de_UpdateFolderPermissionsCommandError = async ( +export const de_UpdateAnalysisCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AnalysisId: __expectString, + Arn: __expectString, + RequestId: __expectString, + UpdateStatus: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateGroupCommand + * deserializeAws_restJson1UpdateAnalysisPermissionsCommand */ -export const de_UpdateGroupCommand = async ( +export const de_UpdateAnalysisPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Group: _json, + AnalysisArn: __expectString, + AnalysisId: __expectString, + Permissions: _json, RequestId: __expectString, }); Object.assign(contents, doc); @@ -15605,69 +8716,48 @@ export const de_UpdateGroupCommand = async ( }; /** - * deserializeAws_restJson1UpdateGroupCommandError + * deserializeAws_restJson1UpdateDashboardCommand */ -const de_UpdateGroupCommandError = async ( +export const de_UpdateDashboardCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + CreationStatus: __expectString, + DashboardId: __expectString, + RequestId: __expectString, + Status: __expectInt32, + VersionArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateIAMPolicyAssignmentCommand + * deserializeAws_restJson1UpdateDashboardLinksCommand */ -export const de_UpdateIAMPolicyAssignmentCommand = async ( +export const de_UpdateDashboardLinksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIAMPolicyAssignmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AssignmentId: __expectString, - AssignmentName: __expectString, - AssignmentStatus: __expectString, - Identities: _json, - PolicyArn: __expectString, + DashboardArn: __expectString, + LinkEntities: _json, RequestId: __expectString, }); Object.assign(contents, doc); @@ -15678,64 +8768,50 @@ export const de_UpdateIAMPolicyAssignmentCommand = async ( }; /** - * deserializeAws_restJson1UpdateIAMPolicyAssignmentCommandError + * deserializeAws_restJson1UpdateDashboardPermissionsCommand */ -const de_UpdateIAMPolicyAssignmentCommandError = async ( +export const de_UpdateDashboardPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConcurrentUpdatingException": - case "com.amazonaws.quicksight#ConcurrentUpdatingException": - throw await de_ConcurrentUpdatingExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DashboardArn: __expectString, + DashboardId: __expectString, + LinkSharingConfiguration: _json, + Permissions: _json, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateIdentityPropagationConfigCommand + * deserializeAws_restJson1UpdateDashboardPublishedVersionCommand */ -export const de_UpdateIdentityPropagationConfigCommand = async ( +export const de_UpdateDashboardPublishedVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIdentityPropagationConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + DashboardArn: __expectString, + DashboardId: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -15746,59 +8822,50 @@ export const de_UpdateIdentityPropagationConfigCommand = async ( }; /** - * deserializeAws_restJson1UpdateIdentityPropagationConfigCommandError + * deserializeAws_restJson1UpdateDataSetCommand */ -const de_UpdateIdentityPropagationConfigCommandError = async ( +export const de_UpdateDataSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + DataSetId: __expectString, + IngestionArn: __expectString, + IngestionId: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateIpRestrictionCommand + * deserializeAws_restJson1UpdateDataSetPermissionsCommand */ -export const de_UpdateIpRestrictionCommand = async ( +export const de_UpdateDataSetPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIpRestrictionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AwsAccountId: __expectString, + DataSetArn: __expectString, + DataSetId: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -15809,61 +8876,49 @@ export const de_UpdateIpRestrictionCommand = async ( }; /** - * deserializeAws_restJson1UpdateIpRestrictionCommandError + * deserializeAws_restJson1UpdateDataSourceCommand */ -const de_UpdateIpRestrictionCommandError = async ( +export const de_UpdateDataSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + DataSourceId: __expectString, + RequestId: __expectString, + UpdateStatus: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdatePublicSharingSettingsCommand + * deserializeAws_restJson1UpdateDataSourcePermissionsCommand */ -export const de_UpdatePublicSharingSettingsCommand = async ( +export const de_UpdateDataSourcePermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePublicSharingSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + DataSourceArn: __expectString, + DataSourceId: __expectString, RequestId: __expectString, }); Object.assign(contents, doc); @@ -15874,55 +8929,40 @@ export const de_UpdatePublicSharingSettingsCommand = async ( }; /** - * deserializeAws_restJson1UpdatePublicSharingSettingsCommandError + * deserializeAws_restJson1UpdateFolderCommand */ -const de_UpdatePublicSharingSettingsCommandError = async ( +export const de_UpdateFolderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedPricingPlanException": - case "com.amazonaws.quicksight#UnsupportedPricingPlanException": - throw await de_UnsupportedPricingPlanExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + FolderId: __expectString, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateRefreshScheduleCommand + * deserializeAws_restJson1UpdateFolderPermissionsCommand */ -export const de_UpdateRefreshScheduleCommand = async ( +export const de_UpdateFolderPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRefreshScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -15930,146 +8970,110 @@ export const de_UpdateRefreshScheduleCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { Arn: __expectString, + FolderId: __expectString, + Permissions: _json, RequestId: __expectString, - ScheduleId: __expectString, + Status: __expectInt32, }); Object.assign(contents, doc); - map(contents, { - Status: [, output.statusCode], - }); return contents; }; /** - * deserializeAws_restJson1UpdateRefreshScheduleCommandError + * deserializeAws_restJson1UpdateGroupCommand */ -const de_UpdateRefreshScheduleCommandError = async ( +export const de_UpdateGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Group: _json, + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateRoleCustomPermissionCommand + * deserializeAws_restJson1UpdateIAMPolicyAssignmentCommand */ -export const de_UpdateRoleCustomPermissionCommand = async ( +export const de_UpdateIAMPolicyAssignmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRoleCustomPermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + AssignmentId: __expectString, + AssignmentName: __expectString, + AssignmentStatus: __expectString, + Identities: _json, + PolicyArn: __expectString, RequestId: __expectString, - Status: __expectInt32, }); Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); return contents; }; /** - * deserializeAws_restJson1UpdateRoleCustomPermissionCommandError + * deserializeAws_restJson1UpdateIdentityPropagationConfigCommand */ -const de_UpdateRoleCustomPermissionCommandError = async ( +export const de_UpdateIdentityPropagationConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateTemplateCommand + * deserializeAws_restJson1UpdateIpRestrictionCommand */ -export const de_UpdateTemplateCommand = async ( +export const de_UpdateIpRestrictionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - CreationStatus: __expectString, + AwsAccountId: __expectString, RequestId: __expectString, - TemplateId: __expectString, - VersionArn: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -16079,69 +9083,47 @@ export const de_UpdateTemplateCommand = async ( }; /** - * deserializeAws_restJson1UpdateTemplateCommandError + * deserializeAws_restJson1UpdatePublicSharingSettingsCommand */ -const de_UpdateTemplateCommandError = async ( +export const de_UpdatePublicSharingSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RequestId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateTemplateAliasCommand + * deserializeAws_restJson1UpdateRefreshScheduleCommand */ -export const de_UpdateTemplateAliasCommand = async ( +export const de_UpdateRefreshScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTemplateAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + Arn: __expectString, RequestId: __expectString, - TemplateAlias: _json, + ScheduleId: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -16151,62 +9133,47 @@ export const de_UpdateTemplateAliasCommand = async ( }; /** - * deserializeAws_restJson1UpdateTemplateAliasCommandError + * deserializeAws_restJson1UpdateRoleCustomPermissionCommand */ -const de_UpdateTemplateAliasCommandError = async ( +export const de_UpdateRoleCustomPermissionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RequestId: __expectString, + Status: __expectInt32, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateTemplatePermissionsCommand + * deserializeAws_restJson1UpdateTemplateCommand */ -export const de_UpdateTemplatePermissionsCommand = async ( +export const de_UpdateTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTemplatePermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Permissions: _json, + Arn: __expectString, + CreationStatus: __expectString, RequestId: __expectString, - TemplateArn: __expectString, TemplateId: __expectString, + VersionArn: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -16216,69 +9183,22 @@ export const de_UpdateTemplatePermissionsCommand = async ( }; /** - * deserializeAws_restJson1UpdateTemplatePermissionsCommandError - */ -const de_UpdateTemplatePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateThemeCommand + * deserializeAws_restJson1UpdateTemplateAliasCommand */ -export const de_UpdateThemeCommand = async ( +export const de_UpdateTemplateAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateThemeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - CreationStatus: __expectString, RequestId: __expectString, - ThemeId: __expectString, - VersionArn: __expectString, + TemplateAlias: _json, }); Object.assign(contents, doc); map(contents, { @@ -16288,69 +9208,24 @@ export const de_UpdateThemeCommand = async ( }; /** - * deserializeAws_restJson1UpdateThemeCommandError - */ -const de_UpdateThemeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateThemeAliasCommand + * deserializeAws_restJson1UpdateTemplatePermissionsCommand */ -export const de_UpdateThemeAliasCommand = async ( +export const de_UpdateTemplatePermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateThemeAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + Permissions: _json, RequestId: __expectString, - ThemeAlias: _json, + TemplateArn: __expectString, + TemplateId: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -16360,68 +9235,25 @@ export const de_UpdateThemeAliasCommand = async ( }; /** - * deserializeAws_restJson1UpdateThemeAliasCommandError - */ -const de_UpdateThemeAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateThemePermissionsCommand + * deserializeAws_restJson1UpdateThemeCommand */ -export const de_UpdateThemePermissionsCommand = async ( +export const de_UpdateThemeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateThemePermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Permissions: _json, + Arn: __expectString, + CreationStatus: __expectString, RequestId: __expectString, - ThemeArn: __expectString, ThemeId: __expectString, + VersionArn: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -16431,68 +9263,49 @@ export const de_UpdateThemePermissionsCommand = async ( }; /** - * deserializeAws_restJson1UpdateThemePermissionsCommandError + * deserializeAws_restJson1UpdateThemeAliasCommand */ -const de_UpdateThemePermissionsCommandError = async ( +export const de_UpdateThemeAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RequestId: __expectString, + ThemeAlias: _json, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** - * deserializeAws_restJson1UpdateTopicCommand + * deserializeAws_restJson1UpdateThemePermissionsCommand */ -export const de_UpdateTopicCommand = async ( +export const de_UpdateThemePermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTopicCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - RefreshArn: __expectString, + Permissions: _json, RequestId: __expectString, - TopicId: __expectString, + ThemeArn: __expectString, + ThemeId: __expectString, }); Object.assign(contents, doc); map(contents, { @@ -16502,50 +9315,30 @@ export const de_UpdateTopicCommand = async ( }; /** - * deserializeAws_restJson1UpdateTopicCommandError + * deserializeAws_restJson1UpdateTopicCommand */ -const de_UpdateTopicCommandError = async ( +export const de_UpdateTopicCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + RefreshArn: __expectString, + RequestId: __expectString, + TopicId: __expectString, + }); + Object.assign(contents, doc); + map(contents, { + Status: [, output.statusCode], + }); + return contents; }; /** @@ -16556,7 +9349,7 @@ export const de_UpdateTopicPermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTopicPermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -16575,53 +9368,6 @@ export const de_UpdateTopicPermissionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateTopicPermissionsCommandError - */ -const de_UpdateTopicPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedUserEditionException": - case "com.amazonaws.quicksight#UnsupportedUserEditionException": - throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTopicRefreshScheduleCommand */ @@ -16630,7 +9376,7 @@ export const de_UpdateTopicRefreshScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTopicRefreshScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -16649,53 +9395,6 @@ export const de_UpdateTopicRefreshScheduleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateTopicRefreshScheduleCommandError - */ -const de_UpdateTopicRefreshScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.quicksight#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateUserCommand */ @@ -16704,7 +9403,7 @@ export const de_UpdateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -16721,50 +9420,6 @@ export const de_UpdateUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateUserCommandError - */ -const de_UpdateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.quicksight#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.quicksight#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.quicksight#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.quicksight#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.quicksight#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.quicksight#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.quicksight#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateVPCConnectionCommand */ @@ -16773,7 +9428,7 @@ export const de_UpdateVPCConnectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateVPCConnectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -16794,12 +9449,9 @@ export const de_UpdateVPCConnectionCommand = async ( }; /** - * deserializeAws_restJson1UpdateVPCConnectionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateVPCConnectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -16809,34 +9461,67 @@ const de_UpdateVPCConnectionCommandError = async ( case "AccessDeniedException": case "com.amazonaws.quicksight#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.quicksight#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalFailureException": case "com.amazonaws.quicksight#InternalFailureException": throw await de_InternalFailureExceptionRes(parsedOutput, context); case "InvalidParameterValueException": case "com.amazonaws.quicksight#InvalidParameterValueException": throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.quicksight#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceExistsException": + case "com.amazonaws.quicksight#ResourceExistsException": + throw await de_ResourceExistsExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.quicksight#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.quicksight#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.quicksight#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ResourceUnavailableException": + case "com.amazonaws.quicksight#ResourceUnavailableException": + throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); + case "PreconditionNotMetException": + case "com.amazonaws.quicksight#PreconditionNotMetException": + throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.quicksight#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "UnsupportedUserEditionException": case "com.amazonaws.quicksight#UnsupportedUserEditionException": throw await de_UnsupportedUserEditionExceptionRes(parsedOutput, context); + case "ConcurrentUpdatingException": + case "com.amazonaws.quicksight#ConcurrentUpdatingException": + throw await de_ConcurrentUpdatingExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.quicksight#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "SessionLifetimeInMinutesInvalidException": + case "com.amazonaws.quicksight#SessionLifetimeInMinutesInvalidException": + throw await de_SessionLifetimeInMinutesInvalidExceptionRes(parsedOutput, context); + case "UnsupportedPricingPlanException": + case "com.amazonaws.quicksight#UnsupportedPricingPlanException": + throw await de_UnsupportedPricingPlanExceptionRes(parsedOutput, context); + case "QuickSightUserNotFoundException": + case "com.amazonaws.quicksight#QuickSightUserNotFoundException": + throw await de_QuickSightUserNotFoundExceptionRes(parsedOutput, context); + case "DomainNotWhitelistedException": + case "com.amazonaws.quicksight#DomainNotWhitelistedException": + throw await de_DomainNotWhitelistedExceptionRes(parsedOutput, context); + case "IdentityTypeNotSupportedException": + case "com.amazonaws.quicksight#IdentityTypeNotSupportedException": + throw await de_IdentityTypeNotSupportedExceptionRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.quicksight#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-ram/src/protocols/Aws_restJson1.ts b/clients/client-ram/src/protocols/Aws_restJson1.ts index 15f2126ae09a..b8b80ca43a3a 100644 --- a/clients/client-ram/src/protocols/Aws_restJson1.ts +++ b/clients/client-ram/src/protocols/Aws_restJson1.ts @@ -1010,7 +1010,7 @@ export const de_AcceptResourceShareInvitationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptResourceShareInvitationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1024,59 +1024,6 @@ export const de_AcceptResourceShareInvitationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptResourceShareInvitationCommandError - */ -const de_AcceptResourceShareInvitationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.ram#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientTokenException": - case "com.amazonaws.ram#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceShareInvitationAlreadyAcceptedException": - case "com.amazonaws.ram#ResourceShareInvitationAlreadyAcceptedException": - throw await de_ResourceShareInvitationAlreadyAcceptedExceptionRes(parsedOutput, context); - case "ResourceShareInvitationAlreadyRejectedException": - case "com.amazonaws.ram#ResourceShareInvitationAlreadyRejectedException": - throw await de_ResourceShareInvitationAlreadyRejectedExceptionRes(parsedOutput, context); - case "ResourceShareInvitationArnNotFoundException": - case "com.amazonaws.ram#ResourceShareInvitationArnNotFoundException": - throw await de_ResourceShareInvitationArnNotFoundExceptionRes(parsedOutput, context); - case "ResourceShareInvitationExpiredException": - case "com.amazonaws.ram#ResourceShareInvitationExpiredException": - throw await de_ResourceShareInvitationExpiredExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateResourceShareCommand */ @@ -1085,7 +1032,7 @@ export const de_AssociateResourceShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateResourceShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1099,62 +1046,6 @@ export const de_AssociateResourceShareCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateResourceShareCommandError - */ -const de_AssociateResourceShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.ram#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientTokenException": - case "com.amazonaws.ram#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidStateTransitionException": - case "com.amazonaws.ram#InvalidStateTransitionException": - throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceShareLimitExceededException": - case "com.amazonaws.ram#ResourceShareLimitExceededException": - throw await de_ResourceShareLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ram#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateResourceSharePermissionCommand */ @@ -1163,7 +1054,7 @@ export const de_AssociateResourceSharePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateResourceSharePermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1177,50 +1068,6 @@ export const de_AssociateResourceSharePermissionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateResourceSharePermissionCommandError - */ -const de_AssociateResourceSharePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidClientTokenException": - case "com.amazonaws.ram#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePermissionCommand */ @@ -1229,7 +1076,7 @@ export const de_CreatePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1243,59 +1090,6 @@ export const de_CreatePermissionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePermissionCommandError - */ -const de_CreatePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.ram#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientTokenException": - case "com.amazonaws.ram#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPolicyException": - case "com.amazonaws.ram#InvalidPolicyException": - throw await de_InvalidPolicyExceptionRes(parsedOutput, context); - case "MalformedPolicyTemplateException": - case "com.amazonaws.ram#MalformedPolicyTemplateException": - throw await de_MalformedPolicyTemplateExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "PermissionAlreadyExistsException": - case "com.amazonaws.ram#PermissionAlreadyExistsException": - throw await de_PermissionAlreadyExistsExceptionRes(parsedOutput, context); - case "PermissionLimitExceededException": - case "com.amazonaws.ram#PermissionLimitExceededException": - throw await de_PermissionLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreatePermissionVersionCommand */ @@ -1304,7 +1098,7 @@ export const de_CreatePermissionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePermissionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1318,59 +1112,6 @@ export const de_CreatePermissionVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreatePermissionVersionCommandError - */ -const de_CreatePermissionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.ram#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientTokenException": - case "com.amazonaws.ram#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPolicyException": - case "com.amazonaws.ram#InvalidPolicyException": - throw await de_InvalidPolicyExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "MalformedPolicyTemplateException": - case "com.amazonaws.ram#MalformedPolicyTemplateException": - throw await de_MalformedPolicyTemplateExceptionRes(parsedOutput, context); - case "PermissionVersionsLimitExceededException": - case "com.amazonaws.ram#PermissionVersionsLimitExceededException": - throw await de_PermissionVersionsLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateResourceShareCommand */ @@ -1379,7 +1120,7 @@ export const de_CreateResourceShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateResourceShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1394,73 +1135,14 @@ export const de_CreateResourceShareCommand = async ( }; /** - * deserializeAws_restJson1CreateResourceShareCommandError + * deserializeAws_restJson1DeletePermissionCommand */ -const de_CreateResourceShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.ram#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientTokenException": - case "com.amazonaws.ram#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidStateTransitionException": - case "com.amazonaws.ram#InvalidStateTransitionException": - throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceShareLimitExceededException": - case "com.amazonaws.ram#ResourceShareLimitExceededException": - throw await de_ResourceShareLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TagLimitExceededException": - case "com.amazonaws.ram#TagLimitExceededException": - throw await de_TagLimitExceededExceptionRes(parsedOutput, context); - case "TagPolicyViolationException": - case "com.amazonaws.ram#TagPolicyViolationException": - throw await de_TagPolicyViolationExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePermissionCommand - */ -export const de_DeletePermissionCommand = async ( +export const de_DeletePermissionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1475,50 +1157,6 @@ export const de_DeletePermissionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePermissionCommandError - */ -const de_DeletePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.ram#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientTokenException": - case "com.amazonaws.ram#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeletePermissionVersionCommand */ @@ -1527,7 +1165,7 @@ export const de_DeletePermissionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePermissionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1542,53 +1180,6 @@ export const de_DeletePermissionVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeletePermissionVersionCommandError - */ -const de_DeletePermissionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.ram#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientTokenException": - case "com.amazonaws.ram#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteResourceShareCommand */ @@ -1597,7 +1188,7 @@ export const de_DeleteResourceShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteResourceShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1611,56 +1202,6 @@ export const de_DeleteResourceShareCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteResourceShareCommandError - */ -const de_DeleteResourceShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.ram#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientTokenException": - case "com.amazonaws.ram#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidStateTransitionException": - case "com.amazonaws.ram#InvalidStateTransitionException": - throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateResourceShareCommand */ @@ -1669,7 +1210,7 @@ export const de_DisassociateResourceShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateResourceShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1684,74 +1225,42 @@ export const de_DisassociateResourceShareCommand = async ( }; /** - * deserializeAws_restJson1DisassociateResourceShareCommandError + * deserializeAws_restJson1DisassociateResourceSharePermissionCommand */ -const de_DisassociateResourceShareCommandError = async ( +export const de_DisassociateResourceSharePermissionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.ram#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientTokenException": - case "com.amazonaws.ram#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidStateTransitionException": - case "com.amazonaws.ram#InvalidStateTransitionException": - throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceShareLimitExceededException": - case "com.amazonaws.ram#ResourceShareLimitExceededException": - throw await de_ResourceShareLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + clientToken: __expectString, + returnValue: __expectBoolean, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DisassociateResourceSharePermissionCommand + * deserializeAws_restJson1EnableSharingWithAwsOrganizationCommand */ -export const de_DisassociateResourceSharePermissionCommand = async ( +export const de_EnableSharingWithAwsOrganizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateResourceSharePermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - clientToken: __expectString, returnValue: __expectBoolean, }); Object.assign(contents, doc); @@ -1759,176 +1268,123 @@ export const de_DisassociateResourceSharePermissionCommand = async ( }; /** - * deserializeAws_restJson1DisassociateResourceSharePermissionCommandError + * deserializeAws_restJson1GetPermissionCommand */ -const de_DisassociateResourceSharePermissionCommandError = async ( +export const de_GetPermissionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidClientTokenException": - case "com.amazonaws.ram#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidStateTransitionException": - case "com.amazonaws.ram#InvalidStateTransitionException": - throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + permission: (_) => de_ResourceSharePermissionDetail(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1EnableSharingWithAwsOrganizationCommand + * deserializeAws_restJson1GetResourcePoliciesCommand */ -export const de_EnableSharingWithAwsOrganizationCommand = async ( +export const de_GetResourcePoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableSharingWithAwsOrganizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - returnValue: __expectBoolean, + nextToken: __expectString, + policies: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1EnableSharingWithAwsOrganizationCommandError + * deserializeAws_restJson1GetResourceShareAssociationsCommand */ -const de_EnableSharingWithAwsOrganizationCommandError = async ( +export const de_GetResourceShareAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + resourceShareAssociations: (_) => de_ResourceShareAssociationList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetPermissionCommand + * deserializeAws_restJson1GetResourceShareInvitationsCommand */ -export const de_GetPermissionCommand = async ( +export const de_GetResourceShareInvitationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - permission: (_) => de_ResourceSharePermissionDetail(_, context), + nextToken: __expectString, + resourceShareInvitations: (_) => de_ResourceShareInvitationList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetPermissionCommandError + * deserializeAws_restJson1GetResourceSharesCommand */ -const de_GetPermissionCommandError = async ( +export const de_GetResourceSharesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + resourceShares: (_) => de_ResourceShareList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetResourcePoliciesCommand + * deserializeAws_restJson1ListPendingInvitationResourcesCommand */ -export const de_GetResourcePoliciesCommand = async ( +export const de_ListPendingInvitationResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourcePoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1936,62 +1392,43 @@ export const de_GetResourcePoliciesCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - policies: _json, + resources: (_) => de_ResourceList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetResourcePoliciesCommandError + * deserializeAws_restJson1ListPermissionAssociationsCommand */ -const de_GetResourcePoliciesCommandError = async ( +export const de_ListPermissionAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.ram#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "ResourceArnNotFoundException": - case "com.amazonaws.ram#ResourceArnNotFoundException": - throw await de_ResourceArnNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + permissions: (_) => de_AssociatedPermissionList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetResourceShareAssociationsCommand + * deserializeAws_restJson1ListPermissionsCommand */ -export const de_GetResourceShareAssociationsCommand = async ( +export const de_ListPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourceShareAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1999,65 +1436,43 @@ export const de_GetResourceShareAssociationsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - resourceShareAssociations: (_) => de_ResourceShareAssociationList(_, context), + permissions: (_) => de_ResourceSharePermissionList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetResourceShareAssociationsCommandError + * deserializeAws_restJson1ListPermissionVersionsCommand */ -const de_GetResourceShareAssociationsCommandError = async ( +export const de_ListPermissionVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.ram#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + permissions: (_) => de_ResourceSharePermissionList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetResourceShareInvitationsCommand + * deserializeAws_restJson1ListPrincipalsCommand */ -export const de_GetResourceShareInvitationsCommand = async ( +export const de_ListPrincipalsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourceShareInvitationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2065,68 +1480,21 @@ export const de_GetResourceShareInvitationsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - resourceShareInvitations: (_) => de_ResourceShareInvitationList(_, context), + principals: (_) => de_PrincipalList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetResourceShareInvitationsCommandError + * deserializeAws_restJson1ListReplacePermissionAssociationsWorkCommand */ -const de_GetResourceShareInvitationsCommandError = async ( +export const de_ListReplacePermissionAssociationsWorkCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidMaxResultsException": - case "com.amazonaws.ram#InvalidMaxResultsException": - throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.ram#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "ResourceShareInvitationArnNotFoundException": - case "com.amazonaws.ram#ResourceShareInvitationArnNotFoundException": - throw await de_ResourceShareInvitationArnNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetResourceSharesCommand - */ -export const de_GetResourceSharesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourceSharesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2134,62 +1502,21 @@ export const de_GetResourceSharesCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - resourceShares: (_) => de_ResourceShareList(_, context), + replacePermissionAssociationsWorks: (_) => de_ReplacePermissionAssociationsWorkList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetResourceSharesCommandError - */ -const de_GetResourceSharesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.ram#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPendingInvitationResourcesCommand + * deserializeAws_restJson1ListResourcesCommand */ -export const de_ListPendingInvitationResourcesCommand = async ( +export const de_ListResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPendingInvitationResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2204,64 +1531,14 @@ export const de_ListPendingInvitationResourcesCommand = async ( }; /** - * deserializeAws_restJson1ListPendingInvitationResourcesCommandError - */ -const de_ListPendingInvitationResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.ram#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.ram#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "ResourceShareInvitationAlreadyRejectedException": - case "com.amazonaws.ram#ResourceShareInvitationAlreadyRejectedException": - throw await de_ResourceShareInvitationAlreadyRejectedExceptionRes(parsedOutput, context); - case "ResourceShareInvitationArnNotFoundException": - case "com.amazonaws.ram#ResourceShareInvitationArnNotFoundException": - throw await de_ResourceShareInvitationArnNotFoundExceptionRes(parsedOutput, context); - case "ResourceShareInvitationExpiredException": - case "com.amazonaws.ram#ResourceShareInvitationExpiredException": - throw await de_ResourceShareInvitationExpiredExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPermissionAssociationsCommand + * deserializeAws_restJson1ListResourceSharePermissionsCommand */ -export const de_ListPermissionAssociationsCommand = async ( +export const de_ListResourceSharePermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPermissionAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2269,59 +1546,21 @@ export const de_ListPermissionAssociationsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - permissions: (_) => de_AssociatedPermissionList(_, context), + permissions: (_) => de_ResourceSharePermissionList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPermissionAssociationsCommandError - */ -const de_ListPermissionAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.ram#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPermissionsCommand + * deserializeAws_restJson1ListResourceTypesCommand */ -export const de_ListPermissionsCommand = async ( +export const de_ListResourceTypesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2329,649 +1568,64 @@ export const de_ListPermissionsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - permissions: (_) => de_ResourceSharePermissionList(_, context), + resourceTypes: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPermissionsCommandError - */ -const de_ListPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.ram#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPermissionVersionsCommand + * deserializeAws_restJson1PromotePermissionCreatedFromPolicyCommand */ -export const de_ListPermissionVersionsCommand = async ( +export const de_PromotePermissionCreatedFromPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPermissionVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - permissions: (_) => de_ResourceSharePermissionList(_, context), + clientToken: __expectString, + permission: (_) => de_ResourceSharePermissionSummary(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPermissionVersionsCommandError + * deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommand */ -const de_ListPermissionVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.ram#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListPrincipalsCommand - */ -export const de_ListPrincipalsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPrincipalsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - principals: (_) => de_PrincipalList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListPrincipalsCommandError - */ -const de_ListPrincipalsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.ram#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListReplacePermissionAssociationsWorkCommand - */ -export const de_ListReplacePermissionAssociationsWorkCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReplacePermissionAssociationsWorkCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - replacePermissionAssociationsWorks: (_) => de_ReplacePermissionAssociationsWorkList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListReplacePermissionAssociationsWorkCommandError - */ -const de_ListReplacePermissionAssociationsWorkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.ram#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListResourcesCommand - */ -export const de_ListResourcesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResourcesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - resources: (_) => de_ResourceList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListResourcesCommandError - */ -const de_ListResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.ram#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidResourceTypeException": - case "com.amazonaws.ram#InvalidResourceTypeException": - throw await de_InvalidResourceTypeExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListResourceSharePermissionsCommand - */ -export const de_ListResourceSharePermissionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResourceSharePermissionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - permissions: (_) => de_ResourceSharePermissionList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListResourceSharePermissionsCommandError - */ -const de_ListResourceSharePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.ram#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListResourceTypesCommand - */ -export const de_ListResourceTypesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResourceTypesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - resourceTypes: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListResourceTypesCommandError - */ -const de_ListResourceTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.ram#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PromotePermissionCreatedFromPolicyCommand - */ -export const de_PromotePermissionCreatedFromPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PromotePermissionCreatedFromPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - clientToken: __expectString, - permission: (_) => de_ResourceSharePermissionSummary(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PromotePermissionCreatedFromPolicyCommandError - */ -const de_PromotePermissionCreatedFromPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.ram#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommand - */ -export const de_PromoteResourceShareCreatedFromPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PromoteResourceShareCreatedFromPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - returnValue: __expectBoolean, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PromoteResourceShareCreatedFromPolicyCommandError - */ -const de_PromoteResourceShareCreatedFromPolicyCommandError = async ( +export const de_PromoteResourceShareCreatedFromPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidStateTransitionException": - case "com.amazonaws.ram#InvalidStateTransitionException": - throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.ram#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceShareLimitExceededException": - case "com.amazonaws.ram#ResourceShareLimitExceededException": - throw await de_ResourceShareLimitExceededExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - case "UnmatchedPolicyPermissionException": - case "com.amazonaws.ram#UnmatchedPolicyPermissionException": - throw await de_UnmatchedPolicyPermissionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RejectResourceShareInvitationCommand - */ -export const de_RejectResourceShareInvitationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RejectResourceShareInvitationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - clientToken: __expectString, - resourceShareInvitation: (_) => de_ResourceShareInvitation(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1RejectResourceShareInvitationCommandError - */ -const de_RejectResourceShareInvitationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.ram#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientTokenException": - case "com.amazonaws.ram#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ResourceShareInvitationAlreadyAcceptedException": - case "com.amazonaws.ram#ResourceShareInvitationAlreadyAcceptedException": - throw await de_ResourceShareInvitationAlreadyAcceptedExceptionRes(parsedOutput, context); - case "ResourceShareInvitationAlreadyRejectedException": - case "com.amazonaws.ram#ResourceShareInvitationAlreadyRejectedException": - throw await de_ResourceShareInvitationAlreadyRejectedExceptionRes(parsedOutput, context); - case "ResourceShareInvitationArnNotFoundException": - case "com.amazonaws.ram#ResourceShareInvitationArnNotFoundException": - throw await de_ResourceShareInvitationArnNotFoundExceptionRes(parsedOutput, context); - case "ResourceShareInvitationExpiredException": - case "com.amazonaws.ram#ResourceShareInvitationExpiredException": - throw await de_ResourceShareInvitationExpiredExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + returnValue: __expectBoolean, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ReplacePermissionAssociationsCommand + * deserializeAws_restJson1RejectResourceShareInvitationCommand */ -export const de_ReplacePermissionAssociationsCommand = async ( +export const de_RejectResourceShareInvitationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ReplacePermissionAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2979,57 +1633,32 @@ export const de_ReplacePermissionAssociationsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { clientToken: __expectString, - replacePermissionAssociationsWork: (_) => de_ReplacePermissionAssociationsWork(_, context), + resourceShareInvitation: (_) => de_ResourceShareInvitation(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ReplacePermissionAssociationsCommandError + * deserializeAws_restJson1ReplacePermissionAssociationsCommand */ -const de_ReplacePermissionAssociationsCommandError = async ( +export const de_ReplacePermissionAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.ram#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientTokenException": - case "com.amazonaws.ram#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.ram#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + clientToken: __expectString, + replacePermissionAssociationsWork: (_) => de_ReplacePermissionAssociationsWork(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3040,7 +1669,7 @@ export const de_SetDefaultPermissionVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SetDefaultPermissionVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3054,50 +1683,6 @@ export const de_SetDefaultPermissionVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SetDefaultPermissionVersionCommandError - */ -const de_SetDefaultPermissionVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.ram#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InvalidClientTokenException": - case "com.amazonaws.ram#InvalidClientTokenException": - throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -3106,7 +1691,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3115,53 +1700,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "ResourceArnNotFoundException": - case "com.amazonaws.ram#ResourceArnNotFoundException": - throw await de_ResourceArnNotFoundExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TagLimitExceededException": - case "com.amazonaws.ram#TagLimitExceededException": - throw await de_TagLimitExceededExceptionRes(parsedOutput, context); - case "TagPolicyViolationException": - case "com.amazonaws.ram#TagPolicyViolationException": - throw await de_TagPolicyViolationExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -3170,7 +1708,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3179,44 +1717,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MalformedArnException": - case "com.amazonaws.ram#MalformedArnException": - throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "ServerInternalException": - case "com.amazonaws.ram#ServerInternalException": - throw await de_ServerInternalExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.ram#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.ram#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateResourceShareCommand */ @@ -3225,7 +1725,7 @@ export const de_UpdateResourceShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateResourceShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3240,12 +1740,9 @@ export const de_UpdateResourceShareCommand = async ( }; /** - * deserializeAws_restJson1UpdateResourceShareCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateResourceShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3258,34 +1755,91 @@ const de_UpdateResourceShareCommandError = async ( case "InvalidClientTokenException": case "com.amazonaws.ram#InvalidClientTokenException": throw await de_InvalidClientTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.ram#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); case "MalformedArnException": case "com.amazonaws.ram#MalformedArnException": throw await de_MalformedArnExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.ram#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); case "OperationNotPermittedException": case "com.amazonaws.ram#OperationNotPermittedException": throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); + case "ResourceShareInvitationAlreadyAcceptedException": + case "com.amazonaws.ram#ResourceShareInvitationAlreadyAcceptedException": + throw await de_ResourceShareInvitationAlreadyAcceptedExceptionRes(parsedOutput, context); + case "ResourceShareInvitationAlreadyRejectedException": + case "com.amazonaws.ram#ResourceShareInvitationAlreadyRejectedException": + throw await de_ResourceShareInvitationAlreadyRejectedExceptionRes(parsedOutput, context); + case "ResourceShareInvitationArnNotFoundException": + case "com.amazonaws.ram#ResourceShareInvitationArnNotFoundException": + throw await de_ResourceShareInvitationArnNotFoundExceptionRes(parsedOutput, context); + case "ResourceShareInvitationExpiredException": + case "com.amazonaws.ram#ResourceShareInvitationExpiredException": + throw await de_ResourceShareInvitationExpiredExceptionRes(parsedOutput, context); case "ServerInternalException": case "com.amazonaws.ram#ServerInternalException": throw await de_ServerInternalExceptionRes(parsedOutput, context); case "ServiceUnavailableException": case "com.amazonaws.ram#ServiceUnavailableException": throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.ram#InvalidParameterException": + throw await de_InvalidParameterExceptionRes(parsedOutput, context); + case "InvalidStateTransitionException": + case "com.amazonaws.ram#InvalidStateTransitionException": + throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context); + case "ResourceShareLimitExceededException": + case "com.amazonaws.ram#ResourceShareLimitExceededException": + throw await de_ResourceShareLimitExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.ram#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); case "UnknownResourceException": case "com.amazonaws.ram#UnknownResourceException": throw await de_UnknownResourceExceptionRes(parsedOutput, context); + case "InvalidPolicyException": + case "com.amazonaws.ram#InvalidPolicyException": + throw await de_InvalidPolicyExceptionRes(parsedOutput, context); + case "MalformedPolicyTemplateException": + case "com.amazonaws.ram#MalformedPolicyTemplateException": + throw await de_MalformedPolicyTemplateExceptionRes(parsedOutput, context); + case "PermissionAlreadyExistsException": + case "com.amazonaws.ram#PermissionAlreadyExistsException": + throw await de_PermissionAlreadyExistsExceptionRes(parsedOutput, context); + case "PermissionLimitExceededException": + case "com.amazonaws.ram#PermissionLimitExceededException": + throw await de_PermissionLimitExceededExceptionRes(parsedOutput, context); + case "PermissionVersionsLimitExceededException": + case "com.amazonaws.ram#PermissionVersionsLimitExceededException": + throw await de_PermissionVersionsLimitExceededExceptionRes(parsedOutput, context); + case "TagLimitExceededException": + case "com.amazonaws.ram#TagLimitExceededException": + throw await de_TagLimitExceededExceptionRes(parsedOutput, context); + case "TagPolicyViolationException": + case "com.amazonaws.ram#TagPolicyViolationException": + throw await de_TagPolicyViolationExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.ram#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "ResourceArnNotFoundException": + case "com.amazonaws.ram#ResourceArnNotFoundException": + throw await de_ResourceArnNotFoundExceptionRes(parsedOutput, context); + case "InvalidMaxResultsException": + case "com.amazonaws.ram#InvalidMaxResultsException": + throw await de_InvalidMaxResultsExceptionRes(parsedOutput, context); + case "MissingRequiredParameterException": + case "com.amazonaws.ram#MissingRequiredParameterException": + throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); + case "InvalidResourceTypeException": + case "com.amazonaws.ram#InvalidResourceTypeException": + throw await de_InvalidResourceTypeExceptionRes(parsedOutput, context); + case "UnmatchedPolicyPermissionException": + case "com.amazonaws.ram#UnmatchedPolicyPermissionException": + throw await de_UnmatchedPolicyPermissionExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-rbin/src/protocols/Aws_restJson1.ts b/clients/client-rbin/src/protocols/Aws_restJson1.ts index 982d6e669f42..0818045b94ac 100644 --- a/clients/client-rbin/src/protocols/Aws_restJson1.ts +++ b/clients/client-rbin/src/protocols/Aws_restJson1.ts @@ -268,7 +268,7 @@ export const de_CreateRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -290,38 +290,6 @@ export const de_CreateRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRuleCommandError - */ -const de_CreateRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.rbin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.rbin#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rbin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRuleCommand */ @@ -330,7 +298,7 @@ export const de_DeleteRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -339,41 +307,6 @@ export const de_DeleteRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRuleCommandError - */ -const de_DeleteRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.rbin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rbin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rbin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rbin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRuleCommand */ @@ -382,7 +315,7 @@ export const de_GetRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -404,38 +337,6 @@ export const de_GetRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRuleCommandError - */ -const de_GetRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.rbin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rbin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rbin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRulesCommand */ @@ -444,7 +345,7 @@ export const de_ListRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -458,35 +359,6 @@ export const de_ListRulesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRulesCommandError - */ -const de_ListRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.rbin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rbin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -495,7 +367,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -508,38 +380,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.rbin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rbin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rbin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1LockRuleCommand */ @@ -548,7 +388,7 @@ export const de_LockRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_LockRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -569,41 +409,6 @@ export const de_LockRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1LockRuleCommandError - */ -const de_LockRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.rbin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rbin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rbin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rbin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -612,7 +417,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -621,41 +426,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.rbin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rbin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.rbin#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rbin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UnlockRuleCommand */ @@ -664,7 +434,7 @@ export const de_UnlockRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UnlockRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -686,41 +456,6 @@ export const de_UnlockRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UnlockRuleCommandError - */ -const de_UnlockRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.rbin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rbin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rbin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rbin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -729,7 +464,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -738,38 +473,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.rbin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rbin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rbin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRuleCommand */ @@ -778,7 +481,7 @@ export const de_UpdateRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -800,40 +503,37 @@ export const de_UpdateRuleCommand = async ( }; /** - * deserializeAws_restJson1UpdateRuleCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ConflictException": - case "com.amazonaws.rbin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.rbin#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rbin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ServiceQuotaExceededException": case "com.amazonaws.rbin#ServiceQuotaExceededException": throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.rbin#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.rbin#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.rbin#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-rds-data/src/protocols/Aws_restJson1.ts b/clients/client-rds-data/src/protocols/Aws_restJson1.ts index a11cac2d7517..67d4dc6ec24f 100644 --- a/clients/client-rds-data/src/protocols/Aws_restJson1.ts +++ b/clients/client-rds-data/src/protocols/Aws_restJson1.ts @@ -233,7 +233,7 @@ export const de_BatchExecuteStatementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchExecuteStatementCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -246,68 +246,6 @@ export const de_BatchExecuteStatementCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchExecuteStatementCommandError - */ -const de_BatchExecuteStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rdsdata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.rdsdata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "DatabaseErrorException": - case "com.amazonaws.rdsdata#DatabaseErrorException": - throw await de_DatabaseErrorExceptionRes(parsedOutput, context); - case "DatabaseNotFoundException": - case "com.amazonaws.rdsdata#DatabaseNotFoundException": - throw await de_DatabaseNotFoundExceptionRes(parsedOutput, context); - case "DatabaseUnavailableException": - case "com.amazonaws.rdsdata#DatabaseUnavailableException": - throw await de_DatabaseUnavailableExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.rdsdata#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "HttpEndpointNotEnabledException": - case "com.amazonaws.rdsdata#HttpEndpointNotEnabledException": - throw await de_HttpEndpointNotEnabledExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.rdsdata#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidSecretException": - case "com.amazonaws.rdsdata#InvalidSecretException": - throw await de_InvalidSecretExceptionRes(parsedOutput, context); - case "SecretsErrorException": - case "com.amazonaws.rdsdata#SecretsErrorException": - throw await de_SecretsErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableError": - case "com.amazonaws.rdsdata#ServiceUnavailableError": - throw await de_ServiceUnavailableErrorRes(parsedOutput, context); - case "StatementTimeoutException": - case "com.amazonaws.rdsdata#StatementTimeoutException": - throw await de_StatementTimeoutExceptionRes(parsedOutput, context); - case "TransactionNotFoundException": - case "com.amazonaws.rdsdata#TransactionNotFoundException": - throw await de_TransactionNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BeginTransactionCommand */ @@ -316,7 +254,7 @@ export const de_BeginTransactionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BeginTransactionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -329,68 +267,6 @@ export const de_BeginTransactionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BeginTransactionCommandError - */ -const de_BeginTransactionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rdsdata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.rdsdata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "DatabaseErrorException": - case "com.amazonaws.rdsdata#DatabaseErrorException": - throw await de_DatabaseErrorExceptionRes(parsedOutput, context); - case "DatabaseNotFoundException": - case "com.amazonaws.rdsdata#DatabaseNotFoundException": - throw await de_DatabaseNotFoundExceptionRes(parsedOutput, context); - case "DatabaseUnavailableException": - case "com.amazonaws.rdsdata#DatabaseUnavailableException": - throw await de_DatabaseUnavailableExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.rdsdata#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "HttpEndpointNotEnabledException": - case "com.amazonaws.rdsdata#HttpEndpointNotEnabledException": - throw await de_HttpEndpointNotEnabledExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.rdsdata#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidSecretException": - case "com.amazonaws.rdsdata#InvalidSecretException": - throw await de_InvalidSecretExceptionRes(parsedOutput, context); - case "SecretsErrorException": - case "com.amazonaws.rdsdata#SecretsErrorException": - throw await de_SecretsErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableError": - case "com.amazonaws.rdsdata#ServiceUnavailableError": - throw await de_ServiceUnavailableErrorRes(parsedOutput, context); - case "StatementTimeoutException": - case "com.amazonaws.rdsdata#StatementTimeoutException": - throw await de_StatementTimeoutExceptionRes(parsedOutput, context); - case "TransactionNotFoundException": - case "com.amazonaws.rdsdata#TransactionNotFoundException": - throw await de_TransactionNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CommitTransactionCommand */ @@ -399,7 +275,7 @@ export const de_CommitTransactionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CommitTransactionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -412,71 +288,6 @@ export const de_CommitTransactionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CommitTransactionCommandError - */ -const de_CommitTransactionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rdsdata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.rdsdata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "DatabaseErrorException": - case "com.amazonaws.rdsdata#DatabaseErrorException": - throw await de_DatabaseErrorExceptionRes(parsedOutput, context); - case "DatabaseNotFoundException": - case "com.amazonaws.rdsdata#DatabaseNotFoundException": - throw await de_DatabaseNotFoundExceptionRes(parsedOutput, context); - case "DatabaseUnavailableException": - case "com.amazonaws.rdsdata#DatabaseUnavailableException": - throw await de_DatabaseUnavailableExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.rdsdata#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "HttpEndpointNotEnabledException": - case "com.amazonaws.rdsdata#HttpEndpointNotEnabledException": - throw await de_HttpEndpointNotEnabledExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.rdsdata#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidSecretException": - case "com.amazonaws.rdsdata#InvalidSecretException": - throw await de_InvalidSecretExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.rdsdata#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "SecretsErrorException": - case "com.amazonaws.rdsdata#SecretsErrorException": - throw await de_SecretsErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableError": - case "com.amazonaws.rdsdata#ServiceUnavailableError": - throw await de_ServiceUnavailableErrorRes(parsedOutput, context); - case "StatementTimeoutException": - case "com.amazonaws.rdsdata#StatementTimeoutException": - throw await de_StatementTimeoutExceptionRes(parsedOutput, context); - case "TransactionNotFoundException": - case "com.amazonaws.rdsdata#TransactionNotFoundException": - throw await de_TransactionNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExecuteSqlCommand */ @@ -485,7 +296,7 @@ export const de_ExecuteSqlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExecuteSqlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -498,44 +309,6 @@ export const de_ExecuteSqlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExecuteSqlCommandError - */ -const de_ExecuteSqlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rdsdata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.rdsdata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.rdsdata#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.rdsdata#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableError": - case "com.amazonaws.rdsdata#ServiceUnavailableError": - throw await de_ServiceUnavailableErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExecuteStatementCommand */ @@ -544,7 +317,7 @@ export const de_ExecuteStatementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExecuteStatementCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -561,71 +334,6 @@ export const de_ExecuteStatementCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExecuteStatementCommandError - */ -const de_ExecuteStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rdsdata#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.rdsdata#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "DatabaseErrorException": - case "com.amazonaws.rdsdata#DatabaseErrorException": - throw await de_DatabaseErrorExceptionRes(parsedOutput, context); - case "DatabaseNotFoundException": - case "com.amazonaws.rdsdata#DatabaseNotFoundException": - throw await de_DatabaseNotFoundExceptionRes(parsedOutput, context); - case "DatabaseUnavailableException": - case "com.amazonaws.rdsdata#DatabaseUnavailableException": - throw await de_DatabaseUnavailableExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.rdsdata#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "HttpEndpointNotEnabledException": - case "com.amazonaws.rdsdata#HttpEndpointNotEnabledException": - throw await de_HttpEndpointNotEnabledExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.rdsdata#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidSecretException": - case "com.amazonaws.rdsdata#InvalidSecretException": - throw await de_InvalidSecretExceptionRes(parsedOutput, context); - case "SecretsErrorException": - case "com.amazonaws.rdsdata#SecretsErrorException": - throw await de_SecretsErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableError": - case "com.amazonaws.rdsdata#ServiceUnavailableError": - throw await de_ServiceUnavailableErrorRes(parsedOutput, context); - case "StatementTimeoutException": - case "com.amazonaws.rdsdata#StatementTimeoutException": - throw await de_StatementTimeoutExceptionRes(parsedOutput, context); - case "TransactionNotFoundException": - case "com.amazonaws.rdsdata#TransactionNotFoundException": - throw await de_TransactionNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedResultException": - case "com.amazonaws.rdsdata#UnsupportedResultException": - throw await de_UnsupportedResultExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RollbackTransactionCommand */ @@ -634,7 +342,7 @@ export const de_RollbackTransactionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RollbackTransactionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -648,12 +356,9 @@ export const de_RollbackTransactionCommand = async ( }; /** - * deserializeAws_restJson1RollbackTransactionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_RollbackTransactionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -687,9 +392,6 @@ const de_RollbackTransactionCommandError = async ( case "InvalidSecretException": case "com.amazonaws.rdsdata#InvalidSecretException": throw await de_InvalidSecretExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.rdsdata#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); case "SecretsErrorException": case "com.amazonaws.rdsdata#SecretsErrorException": throw await de_SecretsErrorExceptionRes(parsedOutput, context); @@ -702,13 +404,19 @@ const de_RollbackTransactionCommandError = async ( case "TransactionNotFoundException": case "com.amazonaws.rdsdata#TransactionNotFoundException": throw await de_TransactionNotFoundExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.rdsdata#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); + case "UnsupportedResultException": + case "com.amazonaws.rdsdata#UnsupportedResultException": + throw await de_UnsupportedResultExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-rds/src/protocols/Aws_query.ts b/clients/client-rds/src/protocols/Aws_query.ts index 54abfab6e776..183494c5f2a9 100644 --- a/clients/client-rds/src/protocols/Aws_query.ts +++ b/clients/client-rds/src/protocols/Aws_query.ts @@ -3849,7 +3849,7 @@ export const de_AddRoleToDBClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddRoleToDBClusterCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AddRoleToDBClusterCommandOutput = { @@ -3858,41 +3858,6 @@ export const de_AddRoleToDBClusterCommand = async ( return response; }; -/** - * deserializeAws_queryAddRoleToDBClusterCommandError - */ -const de_AddRoleToDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterRoleAlreadyExists": - case "com.amazonaws.rds#DBClusterRoleAlreadyExistsFault": - throw await de_DBClusterRoleAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterRoleQuotaExceeded": - case "com.amazonaws.rds#DBClusterRoleQuotaExceededFault": - throw await de_DBClusterRoleQuotaExceededFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAddRoleToDBInstanceCommand */ @@ -3901,7 +3866,7 @@ export const de_AddRoleToDBInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddRoleToDBInstanceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AddRoleToDBInstanceCommandOutput = { @@ -3910,41 +3875,6 @@ export const de_AddRoleToDBInstanceCommand = async ( return response; }; -/** - * deserializeAws_queryAddRoleToDBInstanceCommandError - */ -const de_AddRoleToDBInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBInstanceRoleAlreadyExists": - case "com.amazonaws.rds#DBInstanceRoleAlreadyExistsFault": - throw await de_DBInstanceRoleAlreadyExistsFaultRes(parsedOutput, context); - case "DBInstanceRoleQuotaExceeded": - case "com.amazonaws.rds#DBInstanceRoleQuotaExceededFault": - throw await de_DBInstanceRoleQuotaExceededFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAddSourceIdentifierToSubscriptionCommand */ @@ -3953,7 +3883,7 @@ export const de_AddSourceIdentifierToSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddSourceIdentifierToSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3965,35 +3895,6 @@ export const de_AddSourceIdentifierToSubscriptionCommand = async ( return response; }; -/** - * deserializeAws_queryAddSourceIdentifierToSubscriptionCommandError - */ -const de_AddSourceIdentifierToSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "SourceNotFound": - case "com.amazonaws.rds#SourceNotFoundFault": - throw await de_SourceNotFoundFaultRes(parsedOutput, context); - case "SubscriptionNotFound": - case "com.amazonaws.rds#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAddTagsToResourceCommand */ @@ -4002,7 +3903,7 @@ export const de_AddTagsToResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsToResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AddTagsToResourceCommandOutput = { @@ -4011,56 +3912,6 @@ export const de_AddTagsToResourceCommand = async ( return response; }; -/** - * deserializeAws_queryAddTagsToResourceCommandError - */ -const de_AddTagsToResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BlueGreenDeploymentNotFoundFault": - case "com.amazonaws.rds#BlueGreenDeploymentNotFoundFault": - throw await de_BlueGreenDeploymentNotFoundFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBProxyNotFoundFault": - case "com.amazonaws.rds#DBProxyNotFoundFault": - throw await de_DBProxyNotFoundFaultRes(parsedOutput, context); - case "DBProxyTargetGroupNotFoundFault": - case "com.amazonaws.rds#DBProxyTargetGroupNotFoundFault": - throw await de_DBProxyTargetGroupNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotNotFound": - case "com.amazonaws.rds#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotTenantDatabaseNotFoundFault": - case "com.amazonaws.rds#DBSnapshotTenantDatabaseNotFoundFault": - throw await de_DBSnapshotTenantDatabaseNotFoundFaultRes(parsedOutput, context); - case "IntegrationNotFoundFault": - case "com.amazonaws.rds#IntegrationNotFoundFault": - throw await de_IntegrationNotFoundFaultRes(parsedOutput, context); - case "TenantDatabaseNotFound": - case "com.amazonaws.rds#TenantDatabaseNotFoundFault": - throw await de_TenantDatabaseNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryApplyPendingMaintenanceActionCommand */ @@ -4069,7 +3920,7 @@ export const de_ApplyPendingMaintenanceActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ApplyPendingMaintenanceActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4081,38 +3932,6 @@ export const de_ApplyPendingMaintenanceActionCommand = async ( return response; }; -/** - * deserializeAws_queryApplyPendingMaintenanceActionCommandError - */ -const de_ApplyPendingMaintenanceActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.rds#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAuthorizeDBSecurityGroupIngressCommand */ @@ -4121,7 +3940,7 @@ export const de_AuthorizeDBSecurityGroupIngressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AuthorizeDBSecurityGroupIngressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4133,41 +3952,6 @@ export const de_AuthorizeDBSecurityGroupIngressCommand = async ( return response; }; -/** - * deserializeAws_queryAuthorizeDBSecurityGroupIngressCommandError - */ -const de_AuthorizeDBSecurityGroupIngressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationAlreadyExists": - case "com.amazonaws.rds#AuthorizationAlreadyExistsFault": - throw await de_AuthorizationAlreadyExistsFaultRes(parsedOutput, context); - case "AuthorizationQuotaExceeded": - case "com.amazonaws.rds#AuthorizationQuotaExceededFault": - throw await de_AuthorizationQuotaExceededFaultRes(parsedOutput, context); - case "DBSecurityGroupNotFound": - case "com.amazonaws.rds#DBSecurityGroupNotFoundFault": - throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBSecurityGroupState": - case "com.amazonaws.rds#InvalidDBSecurityGroupStateFault": - throw await de_InvalidDBSecurityGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryBacktrackDBClusterCommand */ @@ -4176,7 +3960,7 @@ export const de_BacktrackDBClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BacktrackDBClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4189,48 +3973,39 @@ export const de_BacktrackDBClusterCommand = async ( }; /** - * deserializeAws_queryBacktrackDBClusterCommandError + * deserializeAws_queryCancelExportTaskCommand */ -const de_BacktrackDBClusterCommandError = async ( +export const de_CancelExportTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ExportTask(data.CancelExportTaskResult, context); + const response: CancelExportTaskCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCancelExportTaskCommand + * deserializeAws_queryCopyDBClusterParameterGroupCommand */ -export const de_CancelExportTaskCommand = async ( +export const de_CopyDBClusterParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CancelExportTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ExportTask(data.CancelExportTaskResult, context); - const response: CancelExportTaskCommandOutput = { + contents = de_CopyDBClusterParameterGroupResult(data.CopyDBClusterParameterGroupResult, context); + const response: CopyDBClusterParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4238,48 +4013,39 @@ export const de_CancelExportTaskCommand = async ( }; /** - * deserializeAws_queryCancelExportTaskCommandError + * deserializeAws_queryCopyDBClusterSnapshotCommand */ -const de_CancelExportTaskCommandError = async ( +export const de_CopyDBClusterSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExportTaskNotFound": - case "com.amazonaws.rds#ExportTaskNotFoundFault": - throw await de_ExportTaskNotFoundFaultRes(parsedOutput, context); - case "InvalidExportTaskStateFault": - case "com.amazonaws.rds#InvalidExportTaskStateFault": - throw await de_InvalidExportTaskStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CopyDBClusterSnapshotResult(data.CopyDBClusterSnapshotResult, context); + const response: CopyDBClusterSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCopyDBClusterParameterGroupCommand + * deserializeAws_queryCopyDBParameterGroupCommand */ -export const de_CopyDBClusterParameterGroupCommand = async ( +export const de_CopyDBParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CopyDBClusterParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CopyDBClusterParameterGroupResult(data.CopyDBClusterParameterGroupResult, context); - const response: CopyDBClusterParameterGroupCommandOutput = { + contents = de_CopyDBParameterGroupResult(data.CopyDBParameterGroupResult, context); + const response: CopyDBParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4287,51 +4053,39 @@ export const de_CopyDBClusterParameterGroupCommand = async ( }; /** - * deserializeAws_queryCopyDBClusterParameterGroupCommandError + * deserializeAws_queryCopyDBSnapshotCommand */ -const de_CopyDBClusterParameterGroupCommandError = async ( +export const de_CopyDBSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupAlreadyExists": - case "com.amazonaws.rds#DBParameterGroupAlreadyExistsFault": - throw await de_DBParameterGroupAlreadyExistsFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBParameterGroupQuotaExceeded": - case "com.amazonaws.rds#DBParameterGroupQuotaExceededFault": - throw await de_DBParameterGroupQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CopyDBSnapshotResult(data.CopyDBSnapshotResult, context); + const response: CopyDBSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCopyDBClusterSnapshotCommand + * deserializeAws_queryCopyOptionGroupCommand */ -export const de_CopyDBClusterSnapshotCommand = async ( +export const de_CopyOptionGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CopyDBClusterSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CopyDBClusterSnapshotResult(data.CopyDBClusterSnapshotResult, context); - const response: CopyDBClusterSnapshotCommandOutput = { + contents = de_CopyOptionGroupResult(data.CopyOptionGroupResult, context); + const response: CopyOptionGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4339,60 +4093,39 @@ export const de_CopyDBClusterSnapshotCommand = async ( }; /** - * deserializeAws_queryCopyDBClusterSnapshotCommandError + * deserializeAws_queryCreateBlueGreenDeploymentCommand */ -const de_CopyDBClusterSnapshotCommandError = async ( +export const de_CreateBlueGreenDeploymentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterSnapshotAlreadyExistsFault": - case "com.amazonaws.rds#DBClusterSnapshotAlreadyExistsFault": - throw await de_DBClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.rds#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.rds#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "SnapshotQuotaExceeded": - case "com.amazonaws.rds#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateBlueGreenDeploymentResponse(data.CreateBlueGreenDeploymentResult, context); + const response: CreateBlueGreenDeploymentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCopyDBParameterGroupCommand + * deserializeAws_queryCreateCustomDBEngineVersionCommand */ -export const de_CopyDBParameterGroupCommand = async ( +export const de_CreateCustomDBEngineVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CopyDBParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CopyDBParameterGroupResult(data.CopyDBParameterGroupResult, context); - const response: CopyDBParameterGroupCommandOutput = { + contents = de_DBEngineVersion(data.CreateCustomDBEngineVersionResult, context); + const response: CreateCustomDBEngineVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4400,51 +4133,39 @@ export const de_CopyDBParameterGroupCommand = async ( }; /** - * deserializeAws_queryCopyDBParameterGroupCommandError + * deserializeAws_queryCreateDBClusterCommand */ -const de_CopyDBParameterGroupCommandError = async ( +export const de_CreateDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupAlreadyExists": - case "com.amazonaws.rds#DBParameterGroupAlreadyExistsFault": - throw await de_DBParameterGroupAlreadyExistsFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBParameterGroupQuotaExceeded": - case "com.amazonaws.rds#DBParameterGroupQuotaExceededFault": - throw await de_DBParameterGroupQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateDBClusterResult(data.CreateDBClusterResult, context); + const response: CreateDBClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCopyDBSnapshotCommand + * deserializeAws_queryCreateDBClusterEndpointCommand */ -export const de_CopyDBSnapshotCommand = async ( +export const de_CreateDBClusterEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CopyDBSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CopyDBSnapshotResult(data.CopyDBSnapshotResult, context); - const response: CopyDBSnapshotCommandOutput = { + contents = de_DBClusterEndpoint(data.CreateDBClusterEndpointResult, context); + const response: CreateDBClusterEndpointCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4452,60 +4173,39 @@ export const de_CopyDBSnapshotCommand = async ( }; /** - * deserializeAws_queryCopyDBSnapshotCommandError + * deserializeAws_queryCreateDBClusterParameterGroupCommand */ -const de_CopyDBSnapshotCommandError = async ( +export const de_CreateDBClusterParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomAvailabilityZoneNotFound": - case "com.amazonaws.rds#CustomAvailabilityZoneNotFoundFault": - throw await de_CustomAvailabilityZoneNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotAlreadyExists": - case "com.amazonaws.rds#DBSnapshotAlreadyExistsFault": - throw await de_DBSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "DBSnapshotNotFound": - case "com.amazonaws.rds#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidDBSnapshotState": - case "com.amazonaws.rds#InvalidDBSnapshotStateFault": - throw await de_InvalidDBSnapshotStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "SnapshotQuotaExceeded": - case "com.amazonaws.rds#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateDBClusterParameterGroupResult(data.CreateDBClusterParameterGroupResult, context); + const response: CreateDBClusterParameterGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCopyOptionGroupCommand + * deserializeAws_queryCreateDBClusterSnapshotCommand */ -export const de_CopyOptionGroupCommand = async ( +export const de_CreateDBClusterSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CopyOptionGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CopyOptionGroupResult(data.CopyOptionGroupResult, context); - const response: CopyOptionGroupCommandOutput = { + contents = de_CreateDBClusterSnapshotResult(data.CreateDBClusterSnapshotResult, context); + const response: CreateDBClusterSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4513,51 +4213,39 @@ export const de_CopyOptionGroupCommand = async ( }; /** - * deserializeAws_queryCopyOptionGroupCommandError + * deserializeAws_queryCreateDBInstanceCommand */ -const de_CopyOptionGroupCommandError = async ( +export const de_CreateDBInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateDBInstanceResult(data.CreateDBInstanceResult, context); + const response: CreateDBInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OptionGroupAlreadyExistsFault": - case "com.amazonaws.rds#OptionGroupAlreadyExistsFault": - throw await de_OptionGroupAlreadyExistsFaultRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.rds#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - case "OptionGroupQuotaExceededFault": - case "com.amazonaws.rds#OptionGroupQuotaExceededFault": - throw await de_OptionGroupQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + return response; }; /** - * deserializeAws_queryCreateBlueGreenDeploymentCommand + * deserializeAws_queryCreateDBInstanceReadReplicaCommand */ -export const de_CreateBlueGreenDeploymentCommand = async ( +export const de_CreateDBInstanceReadReplicaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateBlueGreenDeploymentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateBlueGreenDeploymentResponse(data.CreateBlueGreenDeploymentResult, context); - const response: CreateBlueGreenDeploymentCommandOutput = { + contents = de_CreateDBInstanceReadReplicaResult(data.CreateDBInstanceReadReplicaResult, context); + const response: CreateDBInstanceReadReplicaCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4565,75 +4253,39 @@ export const de_CreateBlueGreenDeploymentCommand = async ( }; /** - * deserializeAws_queryCreateBlueGreenDeploymentCommandError + * deserializeAws_queryCreateDBParameterGroupCommand */ -const de_CreateBlueGreenDeploymentCommandError = async ( +export const de_CreateDBParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BlueGreenDeploymentAlreadyExistsFault": - case "com.amazonaws.rds#BlueGreenDeploymentAlreadyExistsFault": - throw await de_BlueGreenDeploymentAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterParameterGroupNotFound": - case "com.amazonaws.rds#DBClusterParameterGroupNotFoundFault": - throw await de_DBClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBClusterQuotaExceededFault": - case "com.amazonaws.rds#DBClusterQuotaExceededFault": - throw await de_DBClusterQuotaExceededFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InstanceQuotaExceeded": - case "com.amazonaws.rds#InstanceQuotaExceededFault": - throw await de_InstanceQuotaExceededFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "SourceClusterNotSupportedFault": - case "com.amazonaws.rds#SourceClusterNotSupportedFault": - throw await de_SourceClusterNotSupportedFaultRes(parsedOutput, context); - case "SourceDatabaseNotSupportedFault": - case "com.amazonaws.rds#SourceDatabaseNotSupportedFault": - throw await de_SourceDatabaseNotSupportedFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateDBParameterGroupResult(data.CreateDBParameterGroupResult, context); + const response: CreateDBParameterGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateCustomDBEngineVersionCommand + * deserializeAws_queryCreateDBProxyCommand */ -export const de_CreateCustomDBEngineVersionCommand = async ( +export const de_CreateDBProxyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateCustomDBEngineVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBEngineVersion(data.CreateCustomDBEngineVersionResult, context); - const response: CreateCustomDBEngineVersionCommandOutput = { + contents = de_CreateDBProxyResponse(data.CreateDBProxyResult, context); + const response: CreateDBProxyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4641,57 +4293,39 @@ export const de_CreateCustomDBEngineVersionCommand = async ( }; /** - * deserializeAws_queryCreateCustomDBEngineVersionCommandError + * deserializeAws_queryCreateDBProxyEndpointCommand */ -const de_CreateCustomDBEngineVersionCommandError = async ( +export const de_CreateDBProxyEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CreateCustomDBEngineVersionFault": - case "com.amazonaws.rds#CreateCustomDBEngineVersionFault": - throw await de_CreateCustomDBEngineVersionFaultRes(parsedOutput, context); - case "CustomDBEngineVersionAlreadyExistsFault": - case "com.amazonaws.rds#CustomDBEngineVersionAlreadyExistsFault": - throw await de_CustomDBEngineVersionAlreadyExistsFaultRes(parsedOutput, context); - case "CustomDBEngineVersionQuotaExceededFault": - case "com.amazonaws.rds#CustomDBEngineVersionQuotaExceededFault": - throw await de_CustomDBEngineVersionQuotaExceededFaultRes(parsedOutput, context); - case "Ec2ImagePropertiesNotSupportedFault": - case "com.amazonaws.rds#Ec2ImagePropertiesNotSupportedFault": - throw await de_Ec2ImagePropertiesNotSupportedFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateDBProxyEndpointResponse(data.CreateDBProxyEndpointResult, context); + const response: CreateDBProxyEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateDBClusterCommand + * deserializeAws_queryCreateDBSecurityGroupCommand */ -export const de_CreateDBClusterCommand = async ( +export const de_CreateDBSecurityGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBClusterResult(data.CreateDBClusterResult, context); - const response: CreateDBClusterCommandOutput = { + contents = de_CreateDBSecurityGroupResult(data.CreateDBSecurityGroupResult, context); + const response: CreateDBSecurityGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4699,105 +4333,39 @@ export const de_CreateDBClusterCommand = async ( }; /** - * deserializeAws_queryCreateDBClusterCommandError + * deserializeAws_queryCreateDBShardGroupCommand */ -const de_CreateDBClusterCommandError = async ( +export const de_CreateDBShardGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterAlreadyExistsFault": - case "com.amazonaws.rds#DBClusterAlreadyExistsFault": - throw await de_DBClusterAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterParameterGroupNotFound": - case "com.amazonaws.rds#DBClusterParameterGroupNotFoundFault": - throw await de_DBClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBClusterQuotaExceededFault": - case "com.amazonaws.rds#DBClusterQuotaExceededFault": - throw await de_DBClusterQuotaExceededFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.rds#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.rds#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "DomainNotFoundFault": - case "com.amazonaws.rds#DomainNotFoundFault": - throw await de_DomainNotFoundFaultRes(parsedOutput, context); - case "GlobalClusterNotFoundFault": - case "com.amazonaws.rds#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - case "InsufficientDBInstanceCapacity": - case "com.amazonaws.rds#InsufficientDBInstanceCapacityFault": - throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); - case "InsufficientStorageClusterCapacity": - case "com.amazonaws.rds#InsufficientStorageClusterCapacityFault": - throw await de_InsufficientStorageClusterCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "InvalidDBSubnetGroupFault": - case "com.amazonaws.rds#InvalidDBSubnetGroupFault": - throw await de_InvalidDBSubnetGroupFaultRes(parsedOutput, context); - case "InvalidDBSubnetGroupStateFault": - case "com.amazonaws.rds#InvalidDBSubnetGroupStateFault": - throw await de_InvalidDBSubnetGroupStateFaultRes(parsedOutput, context); - case "InvalidGlobalClusterStateFault": - case "com.amazonaws.rds#InvalidGlobalClusterStateFault": - throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.rds#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.rds#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.rds#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.rds#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBShardGroup(data.CreateDBShardGroupResult, context); + const response: CreateDBShardGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateDBClusterEndpointCommand + * deserializeAws_queryCreateDBSnapshotCommand */ -export const de_CreateDBClusterEndpointCommand = async ( +export const de_CreateDBSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBClusterEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBClusterEndpoint(data.CreateDBClusterEndpointResult, context); - const response: CreateDBClusterEndpointCommandOutput = { + contents = de_CreateDBSnapshotResult(data.CreateDBSnapshotResult, context); + const response: CreateDBSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4805,60 +4373,39 @@ export const de_CreateDBClusterEndpointCommand = async ( }; /** - * deserializeAws_queryCreateDBClusterEndpointCommandError + * deserializeAws_queryCreateDBSubnetGroupCommand */ -const de_CreateDBClusterEndpointCommandError = async ( +export const de_CreateDBSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateDBSubnetGroupResult(data.CreateDBSubnetGroupResult, context); + const response: CreateDBSubnetGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterEndpointAlreadyExistsFault": - case "com.amazonaws.rds#DBClusterEndpointAlreadyExistsFault": - throw await de_DBClusterEndpointAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterEndpointQuotaExceededFault": - case "com.amazonaws.rds#DBClusterEndpointQuotaExceededFault": - throw await de_DBClusterEndpointQuotaExceededFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + return response; }; /** - * deserializeAws_queryCreateDBClusterParameterGroupCommand + * deserializeAws_queryCreateEventSubscriptionCommand */ -export const de_CreateDBClusterParameterGroupCommand = async ( +export const de_CreateEventSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBClusterParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBClusterParameterGroupResult(data.CreateDBClusterParameterGroupResult, context); - const response: CreateDBClusterParameterGroupCommandOutput = { + contents = de_CreateEventSubscriptionResult(data.CreateEventSubscriptionResult, context); + const response: CreateEventSubscriptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4866,48 +4413,39 @@ export const de_CreateDBClusterParameterGroupCommand = async ( }; /** - * deserializeAws_queryCreateDBClusterParameterGroupCommandError + * deserializeAws_queryCreateGlobalClusterCommand */ -const de_CreateDBClusterParameterGroupCommandError = async ( +export const de_CreateGlobalClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupAlreadyExists": - case "com.amazonaws.rds#DBParameterGroupAlreadyExistsFault": - throw await de_DBParameterGroupAlreadyExistsFaultRes(parsedOutput, context); - case "DBParameterGroupQuotaExceeded": - case "com.amazonaws.rds#DBParameterGroupQuotaExceededFault": - throw await de_DBParameterGroupQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateGlobalClusterResult(data.CreateGlobalClusterResult, context); + const response: CreateGlobalClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateDBClusterSnapshotCommand + * deserializeAws_queryCreateIntegrationCommand */ -export const de_CreateDBClusterSnapshotCommand = async ( +export const de_CreateIntegrationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBClusterSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBClusterSnapshotResult(data.CreateDBClusterSnapshotResult, context); - const response: CreateDBClusterSnapshotCommandOutput = { + contents = de_Integration(data.CreateIntegrationResult, context); + const response: CreateIntegrationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4915,57 +4453,39 @@ export const de_CreateDBClusterSnapshotCommand = async ( }; /** - * deserializeAws_queryCreateDBClusterSnapshotCommandError + * deserializeAws_queryCreateOptionGroupCommand */ -const de_CreateDBClusterSnapshotCommandError = async ( +export const de_CreateOptionGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterSnapshotAlreadyExistsFault": - case "com.amazonaws.rds#DBClusterSnapshotAlreadyExistsFault": - throw await de_DBClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.rds#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "SnapshotQuotaExceeded": - case "com.amazonaws.rds#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateOptionGroupResult(data.CreateOptionGroupResult, context); + const response: CreateOptionGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateDBInstanceCommand + * deserializeAws_queryCreateTenantDatabaseCommand */ -export const de_CreateDBInstanceCommand = async ( +export const de_CreateTenantDatabaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBInstanceResult(data.CreateDBInstanceResult, context); - const response: CreateDBInstanceCommandOutput = { + contents = de_CreateTenantDatabaseResult(data.CreateTenantDatabaseResult, context); + const response: CreateTenantDatabaseCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4973,108 +4493,39 @@ export const de_CreateDBInstanceCommand = async ( }; /** - * deserializeAws_queryCreateDBInstanceCommandError + * deserializeAws_queryDeleteBlueGreenDeploymentCommand */ -const de_CreateDBInstanceCommandError = async ( +export const de_DeleteBlueGreenDeploymentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationNotFound": - case "com.amazonaws.rds#AuthorizationNotFoundFault": - throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); - case "BackupPolicyNotFoundFault": - case "com.amazonaws.rds#BackupPolicyNotFoundFault": - throw await de_BackupPolicyNotFoundFaultRes(parsedOutput, context); - case "CertificateNotFound": - case "com.amazonaws.rds#CertificateNotFoundFault": - throw await de_CertificateNotFoundFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceAlreadyExists": - case "com.amazonaws.rds#DBInstanceAlreadyExistsFault": - throw await de_DBInstanceAlreadyExistsFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBSecurityGroupNotFound": - case "com.amazonaws.rds#DBSecurityGroupNotFoundFault": - throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.rds#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.rds#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "DomainNotFoundFault": - case "com.amazonaws.rds#DomainNotFoundFault": - throw await de_DomainNotFoundFaultRes(parsedOutput, context); - case "InstanceQuotaExceeded": - case "com.amazonaws.rds#InstanceQuotaExceededFault": - throw await de_InstanceQuotaExceededFaultRes(parsedOutput, context); - case "InsufficientDBInstanceCapacity": - case "com.amazonaws.rds#InsufficientDBInstanceCapacityFault": - throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.rds#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.rds#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "NetworkTypeNotSupported": - case "com.amazonaws.rds#NetworkTypeNotSupported": - throw await de_NetworkTypeNotSupportedRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.rds#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - case "ProvisionedIopsNotAvailableInAZFault": - case "com.amazonaws.rds#ProvisionedIopsNotAvailableInAZFault": - throw await de_ProvisionedIopsNotAvailableInAZFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.rds#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - case "StorageTypeNotSupported": - case "com.amazonaws.rds#StorageTypeNotSupportedFault": - throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); - case "TenantDatabaseQuotaExceeded": - case "com.amazonaws.rds#TenantDatabaseQuotaExceededFault": - throw await de_TenantDatabaseQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteBlueGreenDeploymentResponse(data.DeleteBlueGreenDeploymentResult, context); + const response: DeleteBlueGreenDeploymentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateDBInstanceReadReplicaCommand + * deserializeAws_queryDeleteCustomDBEngineVersionCommand */ -export const de_CreateDBInstanceReadReplicaCommand = async ( +export const de_DeleteCustomDBEngineVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBInstanceReadReplicaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBInstanceReadReplicaResult(data.CreateDBInstanceReadReplicaResult, context); - const response: CreateDBInstanceReadReplicaCommandOutput = { + contents = de_DBEngineVersion(data.DeleteCustomDBEngineVersionResult, context); + const response: DeleteCustomDBEngineVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5082,111 +4533,39 @@ export const de_CreateDBInstanceReadReplicaCommand = async ( }; /** - * deserializeAws_queryCreateDBInstanceReadReplicaCommandError + * deserializeAws_queryDeleteDBClusterCommand */ -const de_CreateDBInstanceReadReplicaCommandError = async ( +export const de_DeleteDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteDBClusterResult(data.DeleteDBClusterResult, context); + const response: DeleteDBClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceAlreadyExists": - case "com.amazonaws.rds#DBInstanceAlreadyExistsFault": - throw await de_DBInstanceAlreadyExistsFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBSecurityGroupNotFound": - case "com.amazonaws.rds#DBSecurityGroupNotFoundFault": - throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.rds#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupNotAllowedFault": - case "com.amazonaws.rds#DBSubnetGroupNotAllowedFault": - throw await de_DBSubnetGroupNotAllowedFaultRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.rds#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "DomainNotFoundFault": - case "com.amazonaws.rds#DomainNotFoundFault": - throw await de_DomainNotFoundFaultRes(parsedOutput, context); - case "InstanceQuotaExceeded": - case "com.amazonaws.rds#InstanceQuotaExceededFault": - throw await de_InstanceQuotaExceededFaultRes(parsedOutput, context); - case "InsufficientDBInstanceCapacity": - case "com.amazonaws.rds#InsufficientDBInstanceCapacityFault": - throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "InvalidDBSubnetGroupFault": - case "com.amazonaws.rds#InvalidDBSubnetGroupFault": - throw await de_InvalidDBSubnetGroupFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.rds#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.rds#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "NetworkTypeNotSupported": - case "com.amazonaws.rds#NetworkTypeNotSupported": - throw await de_NetworkTypeNotSupportedRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.rds#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - case "ProvisionedIopsNotAvailableInAZFault": - case "com.amazonaws.rds#ProvisionedIopsNotAvailableInAZFault": - throw await de_ProvisionedIopsNotAvailableInAZFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.rds#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - case "StorageTypeNotSupported": - case "com.amazonaws.rds#StorageTypeNotSupportedFault": - throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); - case "TenantDatabaseQuotaExceeded": - case "com.amazonaws.rds#TenantDatabaseQuotaExceededFault": - throw await de_TenantDatabaseQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + return response; }; /** - * deserializeAws_queryCreateDBParameterGroupCommand + * deserializeAws_queryDeleteDBClusterAutomatedBackupCommand */ -export const de_CreateDBParameterGroupCommand = async ( +export const de_DeleteDBClusterAutomatedBackupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBParameterGroupResult(data.CreateDBParameterGroupResult, context); - const response: CreateDBParameterGroupCommandOutput = { + contents = de_DeleteDBClusterAutomatedBackupResult(data.DeleteDBClusterAutomatedBackupResult, context); + const response: DeleteDBClusterAutomatedBackupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5194,48 +4573,19 @@ export const de_CreateDBParameterGroupCommand = async ( }; /** - * deserializeAws_queryCreateDBParameterGroupCommandError - */ -const de_CreateDBParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupAlreadyExists": - case "com.amazonaws.rds#DBParameterGroupAlreadyExistsFault": - throw await de_DBParameterGroupAlreadyExistsFaultRes(parsedOutput, context); - case "DBParameterGroupQuotaExceeded": - case "com.amazonaws.rds#DBParameterGroupQuotaExceededFault": - throw await de_DBParameterGroupQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryCreateDBProxyCommand + * deserializeAws_queryDeleteDBClusterEndpointCommand */ -export const de_CreateDBProxyCommand = async ( +export const de_DeleteDBClusterEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBProxyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBProxyResponse(data.CreateDBProxyResult, context); - const response: CreateDBProxyCommandOutput = { + contents = de_DBClusterEndpoint(data.DeleteDBClusterEndpointResult, context); + const response: DeleteDBClusterEndpointCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5243,51 +4593,36 @@ export const de_CreateDBProxyCommand = async ( }; /** - * deserializeAws_queryCreateDBProxyCommandError + * deserializeAws_queryDeleteDBClusterParameterGroupCommand */ -const de_CreateDBProxyCommandError = async ( +export const de_DeleteDBClusterParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBProxyAlreadyExistsFault": - case "com.amazonaws.rds#DBProxyAlreadyExistsFault": - throw await de_DBProxyAlreadyExistsFaultRes(parsedOutput, context); - case "DBProxyQuotaExceededFault": - case "com.amazonaws.rds#DBProxyQuotaExceededFault": - throw await de_DBProxyQuotaExceededFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.rds#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteDBClusterParameterGroupCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateDBProxyEndpointCommand + * deserializeAws_queryDeleteDBClusterSnapshotCommand */ -export const de_CreateDBProxyEndpointCommand = async ( +export const de_DeleteDBClusterSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBProxyEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBProxyEndpointResponse(data.CreateDBProxyEndpointResult, context); - const response: CreateDBProxyEndpointCommandOutput = { + contents = de_DeleteDBClusterSnapshotResult(data.DeleteDBClusterSnapshotResult, context); + const response: DeleteDBClusterSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5295,57 +4630,39 @@ export const de_CreateDBProxyEndpointCommand = async ( }; /** - * deserializeAws_queryCreateDBProxyEndpointCommandError + * deserializeAws_queryDeleteDBInstanceCommand */ -const de_CreateDBProxyEndpointCommandError = async ( +export const de_DeleteDBInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBProxyEndpointAlreadyExistsFault": - case "com.amazonaws.rds#DBProxyEndpointAlreadyExistsFault": - throw await de_DBProxyEndpointAlreadyExistsFaultRes(parsedOutput, context); - case "DBProxyEndpointQuotaExceededFault": - case "com.amazonaws.rds#DBProxyEndpointQuotaExceededFault": - throw await de_DBProxyEndpointQuotaExceededFaultRes(parsedOutput, context); - case "DBProxyNotFoundFault": - case "com.amazonaws.rds#DBProxyNotFoundFault": - throw await de_DBProxyNotFoundFaultRes(parsedOutput, context); - case "InvalidDBProxyStateFault": - case "com.amazonaws.rds#InvalidDBProxyStateFault": - throw await de_InvalidDBProxyStateFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.rds#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteDBInstanceResult(data.DeleteDBInstanceResult, context); + const response: DeleteDBInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateDBSecurityGroupCommand + * deserializeAws_queryDeleteDBInstanceAutomatedBackupCommand */ -export const de_CreateDBSecurityGroupCommand = async ( +export const de_DeleteDBInstanceAutomatedBackupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBSecurityGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBSecurityGroupResult(data.CreateDBSecurityGroupResult, context); - const response: CreateDBSecurityGroupCommandOutput = { + contents = de_DeleteDBInstanceAutomatedBackupResult(data.DeleteDBInstanceAutomatedBackupResult, context); + const response: DeleteDBInstanceAutomatedBackupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5353,51 +4670,36 @@ export const de_CreateDBSecurityGroupCommand = async ( }; /** - * deserializeAws_queryCreateDBSecurityGroupCommandError + * deserializeAws_queryDeleteDBParameterGroupCommand */ -const de_CreateDBSecurityGroupCommandError = async ( +export const de_DeleteDBParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSecurityGroupAlreadyExists": - case "com.amazonaws.rds#DBSecurityGroupAlreadyExistsFault": - throw await de_DBSecurityGroupAlreadyExistsFaultRes(parsedOutput, context); - case "DBSecurityGroupNotSupported": - case "com.amazonaws.rds#DBSecurityGroupNotSupportedFault": - throw await de_DBSecurityGroupNotSupportedFaultRes(parsedOutput, context); - case "QuotaExceeded.DBSecurityGroup": - case "com.amazonaws.rds#DBSecurityGroupQuotaExceededFault": - throw await de_DBSecurityGroupQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteDBParameterGroupCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateDBShardGroupCommand + * deserializeAws_queryDeleteDBProxyCommand */ -export const de_CreateDBShardGroupCommand = async ( +export const de_DeleteDBProxyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBShardGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBShardGroup(data.CreateDBShardGroupResult, context); - const response: CreateDBShardGroupCommandOutput = { + contents = de_DeleteDBProxyResponse(data.DeleteDBProxyResult, context); + const response: DeleteDBProxyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5405,118 +4707,76 @@ export const de_CreateDBShardGroupCommand = async ( }; /** - * deserializeAws_queryCreateDBShardGroupCommandError + * deserializeAws_queryDeleteDBProxyEndpointCommand */ -const de_CreateDBShardGroupCommandError = async ( +export const de_DeleteDBProxyEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBShardGroupAlreadyExists": - case "com.amazonaws.rds#DBShardGroupAlreadyExistsFault": - throw await de_DBShardGroupAlreadyExistsFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidMaxAcu": - case "com.amazonaws.rds#InvalidMaxAcuFault": - throw await de_InvalidMaxAcuFaultRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.rds#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "MaxDBShardGroupLimitReached": - case "com.amazonaws.rds#MaxDBShardGroupLimitReached": - throw await de_MaxDBShardGroupLimitReachedRes(parsedOutput, context); - case "UnsupportedDBEngineVersion": - case "com.amazonaws.rds#UnsupportedDBEngineVersionFault": - throw await de_UnsupportedDBEngineVersionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteDBProxyEndpointResponse(data.DeleteDBProxyEndpointResult, context); + const response: DeleteDBProxyEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateDBSnapshotCommand + * deserializeAws_queryDeleteDBSecurityGroupCommand */ -export const de_CreateDBSnapshotCommand = async ( +export const de_DeleteDBSecurityGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBSnapshotCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateDBSnapshotResult(data.CreateDBSnapshotResult, context); - const response: CreateDBSnapshotCommandOutput = { + await collectBody(output.body, context); + const response: DeleteDBSecurityGroupCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_queryCreateDBSnapshotCommandError + * deserializeAws_queryDeleteDBShardGroupCommand */ -const de_CreateDBSnapshotCommandError = async ( +export const de_DeleteDBShardGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotAlreadyExists": - case "com.amazonaws.rds#DBSnapshotAlreadyExistsFault": - throw await de_DBSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "SnapshotQuotaExceeded": - case "com.amazonaws.rds#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBShardGroup(data.DeleteDBShardGroupResult, context); + const response: DeleteDBShardGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateDBSubnetGroupCommand + * deserializeAws_queryDeleteDBSnapshotCommand */ -export const de_CreateDBSubnetGroupCommand = async ( +export const de_DeleteDBSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDBSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDBSubnetGroupResult(data.CreateDBSubnetGroupResult, context); - const response: CreateDBSubnetGroupCommandOutput = { + contents = de_DeleteDBSnapshotResult(data.DeleteDBSnapshotResult, context); + const response: DeleteDBSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5524,57 +4784,36 @@ export const de_CreateDBSubnetGroupCommand = async ( }; /** - * deserializeAws_queryCreateDBSubnetGroupCommandError + * deserializeAws_queryDeleteDBSubnetGroupCommand */ -const de_CreateDBSubnetGroupCommandError = async ( +export const de_DeleteDBSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSubnetGroupAlreadyExists": - case "com.amazonaws.rds#DBSubnetGroupAlreadyExistsFault": - throw await de_DBSubnetGroupAlreadyExistsFaultRes(parsedOutput, context); - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.rds#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupQuotaExceeded": - case "com.amazonaws.rds#DBSubnetGroupQuotaExceededFault": - throw await de_DBSubnetGroupQuotaExceededFaultRes(parsedOutput, context); - case "DBSubnetQuotaExceededFault": - case "com.amazonaws.rds#DBSubnetQuotaExceededFault": - throw await de_DBSubnetQuotaExceededFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.rds#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteDBSubnetGroupCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateEventSubscriptionCommand + * deserializeAws_queryDeleteEventSubscriptionCommand */ -export const de_CreateEventSubscriptionCommand = async ( +export const de_DeleteEventSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateEventSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateEventSubscriptionResult(data.CreateEventSubscriptionResult, context); - const response: CreateEventSubscriptionCommandOutput = { + contents = de_DeleteEventSubscriptionResult(data.DeleteEventSubscriptionResult, context); + const response: DeleteEventSubscriptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5582,63 +4821,39 @@ export const de_CreateEventSubscriptionCommand = async ( }; /** - * deserializeAws_queryCreateEventSubscriptionCommandError + * deserializeAws_queryDeleteGlobalClusterCommand */ -const de_CreateEventSubscriptionCommandError = async ( +export const de_DeleteGlobalClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EventSubscriptionQuotaExceeded": - case "com.amazonaws.rds#EventSubscriptionQuotaExceededFault": - throw await de_EventSubscriptionQuotaExceededFaultRes(parsedOutput, context); - case "SNSInvalidTopic": - case "com.amazonaws.rds#SNSInvalidTopicFault": - throw await de_SNSInvalidTopicFaultRes(parsedOutput, context); - case "SNSNoAuthorization": - case "com.amazonaws.rds#SNSNoAuthorizationFault": - throw await de_SNSNoAuthorizationFaultRes(parsedOutput, context); - case "SNSTopicArnNotFound": - case "com.amazonaws.rds#SNSTopicArnNotFoundFault": - throw await de_SNSTopicArnNotFoundFaultRes(parsedOutput, context); - case "SourceNotFound": - case "com.amazonaws.rds#SourceNotFoundFault": - throw await de_SourceNotFoundFaultRes(parsedOutput, context); - case "SubscriptionAlreadyExist": - case "com.amazonaws.rds#SubscriptionAlreadyExistFault": - throw await de_SubscriptionAlreadyExistFaultRes(parsedOutput, context); - case "SubscriptionCategoryNotFound": - case "com.amazonaws.rds#SubscriptionCategoryNotFoundFault": - throw await de_SubscriptionCategoryNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteGlobalClusterResult(data.DeleteGlobalClusterResult, context); + const response: DeleteGlobalClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateGlobalClusterCommand + * deserializeAws_queryDeleteIntegrationCommand */ -export const de_CreateGlobalClusterCommand = async ( +export const de_DeleteIntegrationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateGlobalClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateGlobalClusterResult(data.CreateGlobalClusterResult, context); - const response: CreateGlobalClusterCommandOutput = { + contents = de_Integration(data.DeleteIntegrationResult, context); + const response: DeleteIntegrationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5646,54 +4861,36 @@ export const de_CreateGlobalClusterCommand = async ( }; /** - * deserializeAws_queryCreateGlobalClusterCommandError + * deserializeAws_queryDeleteOptionGroupCommand */ -const de_CreateGlobalClusterCommandError = async ( +export const de_DeleteOptionGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "GlobalClusterAlreadyExistsFault": - case "com.amazonaws.rds#GlobalClusterAlreadyExistsFault": - throw await de_GlobalClusterAlreadyExistsFaultRes(parsedOutput, context); - case "GlobalClusterQuotaExceededFault": - case "com.amazonaws.rds#GlobalClusterQuotaExceededFault": - throw await de_GlobalClusterQuotaExceededFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteOptionGroupCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateIntegrationCommand + * deserializeAws_queryDeleteTenantDatabaseCommand */ -export const de_CreateIntegrationCommand = async ( +export const de_DeleteTenantDatabaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateIntegrationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_Integration(data.CreateIntegrationResult, context); - const response: CreateIntegrationCommandOutput = { + contents = de_DeleteTenantDatabaseResult(data.DeleteTenantDatabaseResult, context); + const response: DeleteTenantDatabaseCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5701,60 +4898,39 @@ export const de_CreateIntegrationCommand = async ( }; /** - * deserializeAws_queryCreateIntegrationCommandError + * deserializeAws_queryDeregisterDBProxyTargetsCommand */ -const de_CreateIntegrationCommandError = async ( +export const de_DeregisterDBProxyTargetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "IntegrationAlreadyExistsFault": - case "com.amazonaws.rds#IntegrationAlreadyExistsFault": - throw await de_IntegrationAlreadyExistsFaultRes(parsedOutput, context); - case "IntegrationConflictOperationFault": - case "com.amazonaws.rds#IntegrationConflictOperationFault": - throw await de_IntegrationConflictOperationFaultRes(parsedOutput, context); - case "IntegrationQuotaExceededFault": - case "com.amazonaws.rds#IntegrationQuotaExceededFault": - throw await de_IntegrationQuotaExceededFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeregisterDBProxyTargetsResponse(data.DeregisterDBProxyTargetsResult, context); + const response: DeregisterDBProxyTargetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateOptionGroupCommand + * deserializeAws_queryDescribeAccountAttributesCommand */ -export const de_CreateOptionGroupCommand = async ( +export const de_DescribeAccountAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateOptionGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateOptionGroupResult(data.CreateOptionGroupResult, context); - const response: CreateOptionGroupCommandOutput = { + contents = de_AccountAttributesMessage(data.DescribeAccountAttributesResult, context); + const response: DescribeAccountAttributesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5762,48 +4938,39 @@ export const de_CreateOptionGroupCommand = async ( }; /** - * deserializeAws_queryCreateOptionGroupCommandError + * deserializeAws_queryDescribeBlueGreenDeploymentsCommand */ -const de_CreateOptionGroupCommandError = async ( +export const de_DescribeBlueGreenDeploymentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OptionGroupAlreadyExistsFault": - case "com.amazonaws.rds#OptionGroupAlreadyExistsFault": - throw await de_OptionGroupAlreadyExistsFaultRes(parsedOutput, context); - case "OptionGroupQuotaExceededFault": - case "com.amazonaws.rds#OptionGroupQuotaExceededFault": - throw await de_OptionGroupQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeBlueGreenDeploymentsResponse(data.DescribeBlueGreenDeploymentsResult, context); + const response: DescribeBlueGreenDeploymentsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateTenantDatabaseCommand + * deserializeAws_queryDescribeCertificatesCommand */ -export const de_CreateTenantDatabaseCommand = async ( +export const de_DescribeCertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateTenantDatabaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateTenantDatabaseResult(data.CreateTenantDatabaseResult, context); - const response: CreateTenantDatabaseCommandOutput = { + contents = de_CertificateMessage(data.DescribeCertificatesResult, context); + const response: DescribeCertificatesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5811,54 +4978,39 @@ export const de_CreateTenantDatabaseCommand = async ( }; /** - * deserializeAws_queryCreateTenantDatabaseCommandError + * deserializeAws_queryDescribeDBClusterAutomatedBackupsCommand */ -const de_CreateTenantDatabaseCommandError = async ( +export const de_DescribeDBClusterAutomatedBackupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "TenantDatabaseAlreadyExists": - case "com.amazonaws.rds#TenantDatabaseAlreadyExistsFault": - throw await de_TenantDatabaseAlreadyExistsFaultRes(parsedOutput, context); - case "TenantDatabaseQuotaExceeded": - case "com.amazonaws.rds#TenantDatabaseQuotaExceededFault": - throw await de_TenantDatabaseQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBClusterAutomatedBackupMessage(data.DescribeDBClusterAutomatedBackupsResult, context); + const response: DescribeDBClusterAutomatedBackupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteBlueGreenDeploymentCommand + * deserializeAws_queryDescribeDBClusterBacktracksCommand */ -export const de_DeleteBlueGreenDeploymentCommand = async ( +export const de_DescribeDBClusterBacktracksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteBlueGreenDeploymentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteBlueGreenDeploymentResponse(data.DeleteBlueGreenDeploymentResult, context); - const response: DeleteBlueGreenDeploymentCommandOutput = { + contents = de_DBClusterBacktrackMessage(data.DescribeDBClusterBacktracksResult, context); + const response: DescribeDBClusterBacktracksCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5866,48 +5018,39 @@ export const de_DeleteBlueGreenDeploymentCommand = async ( }; /** - * deserializeAws_queryDeleteBlueGreenDeploymentCommandError + * deserializeAws_queryDescribeDBClusterEndpointsCommand */ -const de_DeleteBlueGreenDeploymentCommandError = async ( +export const de_DescribeDBClusterEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BlueGreenDeploymentNotFoundFault": - case "com.amazonaws.rds#BlueGreenDeploymentNotFoundFault": - throw await de_BlueGreenDeploymentNotFoundFaultRes(parsedOutput, context); - case "InvalidBlueGreenDeploymentStateFault": - case "com.amazonaws.rds#InvalidBlueGreenDeploymentStateFault": - throw await de_InvalidBlueGreenDeploymentStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBClusterEndpointMessage(data.DescribeDBClusterEndpointsResult, context); + const response: DescribeDBClusterEndpointsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteCustomDBEngineVersionCommand + * deserializeAws_queryDescribeDBClusterParameterGroupsCommand */ -export const de_DeleteCustomDBEngineVersionCommand = async ( +export const de_DescribeDBClusterParameterGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteCustomDBEngineVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBEngineVersion(data.DeleteCustomDBEngineVersionResult, context); - const response: DeleteCustomDBEngineVersionCommandOutput = { + contents = de_DBClusterParameterGroupsMessage(data.DescribeDBClusterParameterGroupsResult, context); + const response: DescribeDBClusterParameterGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5915,48 +5058,39 @@ export const de_DeleteCustomDBEngineVersionCommand = async ( }; /** - * deserializeAws_queryDeleteCustomDBEngineVersionCommandError + * deserializeAws_queryDescribeDBClusterParametersCommand */ -const de_DeleteCustomDBEngineVersionCommandError = async ( +export const de_DescribeDBClusterParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomDBEngineVersionNotFoundFault": - case "com.amazonaws.rds#CustomDBEngineVersionNotFoundFault": - throw await de_CustomDBEngineVersionNotFoundFaultRes(parsedOutput, context); - case "InvalidCustomDBEngineVersionStateFault": - case "com.amazonaws.rds#InvalidCustomDBEngineVersionStateFault": - throw await de_InvalidCustomDBEngineVersionStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBClusterParameterGroupDetails(data.DescribeDBClusterParametersResult, context); + const response: DescribeDBClusterParametersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBClusterCommand + * deserializeAws_queryDescribeDBClustersCommand */ -export const de_DeleteDBClusterCommand = async ( +export const de_DescribeDBClustersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDBClusterResult(data.DeleteDBClusterResult, context); - const response: DeleteDBClusterCommandOutput = { + contents = de_DBClusterMessage(data.DescribeDBClustersResult, context); + const response: DescribeDBClustersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5964,60 +5098,39 @@ export const de_DeleteDBClusterCommand = async ( }; /** - * deserializeAws_queryDeleteDBClusterCommandError + * deserializeAws_queryDescribeDBClusterSnapshotAttributesCommand */ -const de_DeleteDBClusterCommandError = async ( +export const de_DescribeDBClusterSnapshotAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDBClusterSnapshotAttributesResult(data.DescribeDBClusterSnapshotAttributesResult, context); + const response: DescribeDBClusterSnapshotAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterAutomatedBackupQuotaExceededFault": - case "com.amazonaws.rds#DBClusterAutomatedBackupQuotaExceededFault": - throw await de_DBClusterAutomatedBackupQuotaExceededFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterSnapshotAlreadyExistsFault": - case "com.amazonaws.rds#DBClusterSnapshotAlreadyExistsFault": - throw await de_DBClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.rds#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "SnapshotQuotaExceeded": - case "com.amazonaws.rds#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + return response; }; /** - * deserializeAws_queryDeleteDBClusterAutomatedBackupCommand + * deserializeAws_queryDescribeDBClusterSnapshotsCommand */ -export const de_DeleteDBClusterAutomatedBackupCommand = async ( +export const de_DescribeDBClusterSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBClusterAutomatedBackupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDBClusterAutomatedBackupResult(data.DeleteDBClusterAutomatedBackupResult, context); - const response: DeleteDBClusterAutomatedBackupCommandOutput = { + contents = de_DBClusterSnapshotMessage(data.DescribeDBClusterSnapshotsResult, context); + const response: DescribeDBClusterSnapshotsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6025,48 +5138,39 @@ export const de_DeleteDBClusterAutomatedBackupCommand = async ( }; /** - * deserializeAws_queryDeleteDBClusterAutomatedBackupCommandError + * deserializeAws_queryDescribeDBEngineVersionsCommand */ -const de_DeleteDBClusterAutomatedBackupCommandError = async ( +export const de_DescribeDBEngineVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterAutomatedBackupNotFoundFault": - case "com.amazonaws.rds#DBClusterAutomatedBackupNotFoundFault": - throw await de_DBClusterAutomatedBackupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterAutomatedBackupStateFault": - case "com.amazonaws.rds#InvalidDBClusterAutomatedBackupStateFault": - throw await de_InvalidDBClusterAutomatedBackupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBEngineVersionMessage(data.DescribeDBEngineVersionsResult, context); + const response: DescribeDBEngineVersionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBClusterEndpointCommand + * deserializeAws_queryDescribeDBInstanceAutomatedBackupsCommand */ -export const de_DeleteDBClusterEndpointCommand = async ( +export const de_DescribeDBInstanceAutomatedBackupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBClusterEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBClusterEndpoint(data.DeleteDBClusterEndpointResult, context); - const response: DeleteDBClusterEndpointCommandOutput = { + contents = de_DBInstanceAutomatedBackupMessage(data.DescribeDBInstanceAutomatedBackupsResult, context); + const response: DescribeDBInstanceAutomatedBackupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6074,97 +5178,79 @@ export const de_DeleteDBClusterEndpointCommand = async ( }; /** - * deserializeAws_queryDeleteDBClusterEndpointCommandError + * deserializeAws_queryDescribeDBInstancesCommand */ -const de_DeleteDBClusterEndpointCommandError = async ( +export const de_DescribeDBInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterEndpointNotFoundFault": - case "com.amazonaws.rds#DBClusterEndpointNotFoundFault": - throw await de_DBClusterEndpointNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterEndpointStateFault": - case "com.amazonaws.rds#InvalidDBClusterEndpointStateFault": - throw await de_InvalidDBClusterEndpointStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBInstanceMessage(data.DescribeDBInstancesResult, context); + const response: DescribeDBInstancesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBClusterParameterGroupCommand + * deserializeAws_queryDescribeDBLogFilesCommand */ -export const de_DeleteDBClusterParameterGroupCommand = async ( +export const de_DescribeDBLogFilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBClusterParameterGroupCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteDBClusterParameterGroupCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDBLogFilesResponse(data.DescribeDBLogFilesResult, context); + const response: DescribeDBLogFilesCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteDBClusterParameterGroupCommandError + * deserializeAws_queryDescribeDBParameterGroupsCommand */ -const de_DeleteDBClusterParameterGroupCommandError = async ( +export const de_DescribeDBParameterGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBParameterGroupState": - case "com.amazonaws.rds#InvalidDBParameterGroupStateFault": - throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBParameterGroupsMessage(data.DescribeDBParameterGroupsResult, context); + const response: DescribeDBParameterGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBClusterSnapshotCommand + * deserializeAws_queryDescribeDBParametersCommand */ -export const de_DeleteDBClusterSnapshotCommand = async ( +export const de_DescribeDBParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBClusterSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDBClusterSnapshotResult(data.DeleteDBClusterSnapshotResult, context); - const response: DeleteDBClusterSnapshotCommandOutput = { + contents = de_DBParameterGroupDetails(data.DescribeDBParametersResult, context); + const response: DescribeDBParametersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6172,48 +5258,39 @@ export const de_DeleteDBClusterSnapshotCommand = async ( }; /** - * deserializeAws_queryDeleteDBClusterSnapshotCommandError + * deserializeAws_queryDescribeDBProxiesCommand */ -const de_DeleteDBClusterSnapshotCommandError = async ( +export const de_DescribeDBProxiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.rds#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.rds#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDBProxiesResponse(data.DescribeDBProxiesResult, context); + const response: DescribeDBProxiesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBInstanceCommand + * deserializeAws_queryDescribeDBProxyEndpointsCommand */ -export const de_DeleteDBInstanceCommand = async ( +export const de_DescribeDBProxyEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDBInstanceResult(data.DeleteDBInstanceResult, context); - const response: DeleteDBInstanceCommandOutput = { + contents = de_DescribeDBProxyEndpointsResponse(data.DescribeDBProxyEndpointsResult, context); + const response: DescribeDBProxyEndpointsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6221,60 +5298,39 @@ export const de_DeleteDBInstanceCommand = async ( }; /** - * deserializeAws_queryDeleteDBInstanceCommandError + * deserializeAws_queryDescribeDBProxyTargetGroupsCommand */ -const de_DeleteDBInstanceCommandError = async ( +export const de_DescribeDBProxyTargetGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceAutomatedBackupQuotaExceeded": - case "com.amazonaws.rds#DBInstanceAutomatedBackupQuotaExceededFault": - throw await de_DBInstanceAutomatedBackupQuotaExceededFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotAlreadyExists": - case "com.amazonaws.rds#DBSnapshotAlreadyExistsFault": - throw await de_DBSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "SnapshotQuotaExceeded": - case "com.amazonaws.rds#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDBProxyTargetGroupsResponse(data.DescribeDBProxyTargetGroupsResult, context); + const response: DescribeDBProxyTargetGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBInstanceAutomatedBackupCommand + * deserializeAws_queryDescribeDBProxyTargetsCommand */ -export const de_DeleteDBInstanceAutomatedBackupCommand = async ( +export const de_DescribeDBProxyTargetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBInstanceAutomatedBackupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDBInstanceAutomatedBackupResult(data.DeleteDBInstanceAutomatedBackupResult, context); - const response: DeleteDBInstanceAutomatedBackupCommandOutput = { + contents = de_DescribeDBProxyTargetsResponse(data.DescribeDBProxyTargetsResult, context); + const response: DescribeDBProxyTargetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6282,94 +5338,59 @@ export const de_DeleteDBInstanceAutomatedBackupCommand = async ( }; /** - * deserializeAws_queryDeleteDBInstanceAutomatedBackupCommandError + * deserializeAws_queryDescribeDBRecommendationsCommand */ -const de_DeleteDBInstanceAutomatedBackupCommandError = async ( +export const de_DescribeDBRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceAutomatedBackupNotFound": - case "com.amazonaws.rds#DBInstanceAutomatedBackupNotFoundFault": - throw await de_DBInstanceAutomatedBackupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBInstanceAutomatedBackupState": - case "com.amazonaws.rds#InvalidDBInstanceAutomatedBackupStateFault": - throw await de_InvalidDBInstanceAutomatedBackupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteDBParameterGroupCommand - */ -export const de_DeleteDBParameterGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBParameterGroupCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteDBParameterGroupCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBRecommendationsMessage(data.DescribeDBRecommendationsResult, context); + const response: DescribeDBRecommendationsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteDBParameterGroupCommandError + * deserializeAws_queryDescribeDBSecurityGroupsCommand */ -const de_DeleteDBParameterGroupCommandError = async ( +export const de_DescribeDBSecurityGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBParameterGroupState": - case "com.amazonaws.rds#InvalidDBParameterGroupStateFault": - throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBSecurityGroupMessage(data.DescribeDBSecurityGroupsResult, context); + const response: DescribeDBSecurityGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBProxyCommand + * deserializeAws_queryDescribeDBShardGroupsCommand */ -export const de_DeleteDBProxyCommand = async ( +export const de_DescribeDBShardGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBProxyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDBProxyResponse(data.DeleteDBProxyResult, context); - const response: DeleteDBProxyCommandOutput = { + contents = de_DescribeDBShardGroupsResponse(data.DescribeDBShardGroupsResult, context); + const response: DescribeDBShardGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6377,48 +5398,39 @@ export const de_DeleteDBProxyCommand = async ( }; /** - * deserializeAws_queryDeleteDBProxyCommandError + * deserializeAws_queryDescribeDBSnapshotAttributesCommand */ -const de_DeleteDBProxyCommandError = async ( +export const de_DescribeDBSnapshotAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBProxyNotFoundFault": - case "com.amazonaws.rds#DBProxyNotFoundFault": - throw await de_DBProxyNotFoundFaultRes(parsedOutput, context); - case "InvalidDBProxyStateFault": - case "com.amazonaws.rds#InvalidDBProxyStateFault": - throw await de_InvalidDBProxyStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDBSnapshotAttributesResult(data.DescribeDBSnapshotAttributesResult, context); + const response: DescribeDBSnapshotAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBProxyEndpointCommand + * deserializeAws_queryDescribeDBSnapshotsCommand */ -export const de_DeleteDBProxyEndpointCommand = async ( +export const de_DescribeDBSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBProxyEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDBProxyEndpointResponse(data.DeleteDBProxyEndpointResult, context); - const response: DeleteDBProxyEndpointCommandOutput = { + contents = de_DBSnapshotMessage(data.DescribeDBSnapshotsResult, context); + const response: DescribeDBSnapshotsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6426,94 +5438,82 @@ export const de_DeleteDBProxyEndpointCommand = async ( }; /** - * deserializeAws_queryDeleteDBProxyEndpointCommandError + * deserializeAws_queryDescribeDBSnapshotTenantDatabasesCommand */ -const de_DeleteDBProxyEndpointCommandError = async ( +export const de_DescribeDBSnapshotTenantDatabasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBProxyEndpointNotFoundFault": - case "com.amazonaws.rds#DBProxyEndpointNotFoundFault": - throw await de_DBProxyEndpointNotFoundFaultRes(parsedOutput, context); - case "InvalidDBProxyEndpointStateFault": - case "com.amazonaws.rds#InvalidDBProxyEndpointStateFault": - throw await de_InvalidDBProxyEndpointStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBSnapshotTenantDatabasesMessage(data.DescribeDBSnapshotTenantDatabasesResult, context); + const response: DescribeDBSnapshotTenantDatabasesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBSecurityGroupCommand + * deserializeAws_queryDescribeDBSubnetGroupsCommand */ -export const de_DeleteDBSecurityGroupCommand = async ( +export const de_DescribeDBSubnetGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBSecurityGroupCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteDBSecurityGroupCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBSubnetGroupMessage(data.DescribeDBSubnetGroupsResult, context); + const response: DescribeDBSubnetGroupsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteDBSecurityGroupCommandError + * deserializeAws_queryDescribeEngineDefaultClusterParametersCommand */ -const de_DeleteDBSecurityGroupCommandError = async ( +export const de_DescribeEngineDefaultClusterParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSecurityGroupNotFound": - case "com.amazonaws.rds#DBSecurityGroupNotFoundFault": - throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBSecurityGroupState": - case "com.amazonaws.rds#InvalidDBSecurityGroupStateFault": - throw await de_InvalidDBSecurityGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeEngineDefaultClusterParametersResult( + data.DescribeEngineDefaultClusterParametersResult, + context + ); + const response: DescribeEngineDefaultClusterParametersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBShardGroupCommand + * deserializeAws_queryDescribeEngineDefaultParametersCommand */ -export const de_DeleteDBShardGroupCommand = async ( +export const de_DescribeEngineDefaultParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBShardGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBShardGroup(data.DeleteDBShardGroupResult, context); - const response: DeleteDBShardGroupCommandOutput = { + contents = de_DescribeEngineDefaultParametersResult(data.DescribeEngineDefaultParametersResult, context); + const response: DescribeEngineDefaultParametersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6521,51 +5521,39 @@ export const de_DeleteDBShardGroupCommand = async ( }; /** - * deserializeAws_queryDeleteDBShardGroupCommandError + * deserializeAws_queryDescribeEventCategoriesCommand */ -const de_DeleteDBShardGroupCommandError = async ( +export const de_DescribeEventCategoriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBShardGroupNotFound": - case "com.amazonaws.rds#DBShardGroupNotFoundFault": - throw await de_DBShardGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBShardGroupState": - case "com.amazonaws.rds#InvalidDBShardGroupStateFault": - throw await de_InvalidDBShardGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EventCategoriesMessage(data.DescribeEventCategoriesResult, context); + const response: DescribeEventCategoriesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteDBSnapshotCommand + * deserializeAws_queryDescribeEventsCommand */ -export const de_DeleteDBSnapshotCommand = async ( +export const de_DescribeEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteDBSnapshotResult(data.DeleteDBSnapshotResult, context); - const response: DeleteDBSnapshotCommandOutput = { + contents = de_EventsMessage(data.DescribeEventsResult, context); + const response: DescribeEventsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6573,97 +5561,39 @@ export const de_DeleteDBSnapshotCommand = async ( }; /** - * deserializeAws_queryDeleteDBSnapshotCommandError + * deserializeAws_queryDescribeEventSubscriptionsCommand */ -const de_DeleteDBSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSnapshotNotFound": - case "com.amazonaws.rds#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidDBSnapshotState": - case "com.amazonaws.rds#InvalidDBSnapshotStateFault": - throw await de_InvalidDBSnapshotStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteDBSubnetGroupCommand - */ -export const de_DeleteDBSubnetGroupCommand = async ( +export const de_DescribeEventSubscriptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDBSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteDBSubnetGroupCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EventSubscriptionsMessage(data.DescribeEventSubscriptionsResult, context); + const response: DescribeEventSubscriptionsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteDBSubnetGroupCommandError - */ -const de_DeleteDBSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.rds#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBSubnetGroupStateFault": - case "com.amazonaws.rds#InvalidDBSubnetGroupStateFault": - throw await de_InvalidDBSubnetGroupStateFaultRes(parsedOutput, context); - case "InvalidDBSubnetStateFault": - case "com.amazonaws.rds#InvalidDBSubnetStateFault": - throw await de_InvalidDBSubnetStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteEventSubscriptionCommand + * deserializeAws_queryDescribeExportTasksCommand */ -export const de_DeleteEventSubscriptionCommand = async ( +export const de_DescribeExportTasksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteEventSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteEventSubscriptionResult(data.DeleteEventSubscriptionResult, context); - const response: DeleteEventSubscriptionCommandOutput = { + contents = de_ExportTasksMessage(data.DescribeExportTasksResult, context); + const response: DescribeExportTasksCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6671,48 +5601,39 @@ export const de_DeleteEventSubscriptionCommand = async ( }; /** - * deserializeAws_queryDeleteEventSubscriptionCommandError + * deserializeAws_queryDescribeGlobalClustersCommand */ -const de_DeleteEventSubscriptionCommandError = async ( +export const de_DescribeGlobalClustersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidEventSubscriptionState": - case "com.amazonaws.rds#InvalidEventSubscriptionStateFault": - throw await de_InvalidEventSubscriptionStateFaultRes(parsedOutput, context); - case "SubscriptionNotFound": - case "com.amazonaws.rds#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GlobalClustersMessage(data.DescribeGlobalClustersResult, context); + const response: DescribeGlobalClustersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteGlobalClusterCommand + * deserializeAws_queryDescribeIntegrationsCommand */ -export const de_DeleteGlobalClusterCommand = async ( +export const de_DescribeIntegrationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteGlobalClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteGlobalClusterResult(data.DeleteGlobalClusterResult, context); - const response: DeleteGlobalClusterCommandOutput = { + contents = de_DescribeIntegrationsResponse(data.DescribeIntegrationsResult, context); + const response: DescribeIntegrationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6720,48 +5641,39 @@ export const de_DeleteGlobalClusterCommand = async ( }; /** - * deserializeAws_queryDeleteGlobalClusterCommandError + * deserializeAws_queryDescribeOptionGroupOptionsCommand */ -const de_DeleteGlobalClusterCommandError = async ( +export const de_DescribeOptionGroupOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalClusterNotFoundFault": - case "com.amazonaws.rds#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidGlobalClusterStateFault": - case "com.amazonaws.rds#InvalidGlobalClusterStateFault": - throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_OptionGroupOptionsMessage(data.DescribeOptionGroupOptionsResult, context); + const response: DescribeOptionGroupOptionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteIntegrationCommand + * deserializeAws_queryDescribeOptionGroupsCommand */ -export const de_DeleteIntegrationCommand = async ( +export const de_DescribeOptionGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteIntegrationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_Integration(data.DeleteIntegrationResult, context); - const response: DeleteIntegrationCommandOutput = { + contents = de_OptionGroups(data.DescribeOptionGroupsResult, context); + const response: DescribeOptionGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6769,97 +5681,79 @@ export const de_DeleteIntegrationCommand = async ( }; /** - * deserializeAws_queryDeleteIntegrationCommandError + * deserializeAws_queryDescribeOrderableDBInstanceOptionsCommand */ -const de_DeleteIntegrationCommandError = async ( +export const de_DescribeOrderableDBInstanceOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IntegrationConflictOperationFault": - case "com.amazonaws.rds#IntegrationConflictOperationFault": - throw await de_IntegrationConflictOperationFaultRes(parsedOutput, context); - case "IntegrationNotFoundFault": - case "com.amazonaws.rds#IntegrationNotFoundFault": - throw await de_IntegrationNotFoundFaultRes(parsedOutput, context); - case "InvalidIntegrationStateFault": - case "com.amazonaws.rds#InvalidIntegrationStateFault": - throw await de_InvalidIntegrationStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_OrderableDBInstanceOptionsMessage(data.DescribeOrderableDBInstanceOptionsResult, context); + const response: DescribeOrderableDBInstanceOptionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteOptionGroupCommand + * deserializeAws_queryDescribePendingMaintenanceActionsCommand */ -export const de_DeleteOptionGroupCommand = async ( +export const de_DescribePendingMaintenanceActionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteOptionGroupCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteOptionGroupCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_PendingMaintenanceActionsMessage(data.DescribePendingMaintenanceActionsResult, context); + const response: DescribePendingMaintenanceActionsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteOptionGroupCommandError + * deserializeAws_queryDescribeReservedDBInstancesCommand */ -const de_DeleteOptionGroupCommandError = async ( +export const de_DescribeReservedDBInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidOptionGroupStateFault": - case "com.amazonaws.rds#InvalidOptionGroupStateFault": - throw await de_InvalidOptionGroupStateFaultRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.rds#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ReservedDBInstanceMessage(data.DescribeReservedDBInstancesResult, context); + const response: DescribeReservedDBInstancesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteTenantDatabaseCommand + * deserializeAws_queryDescribeReservedDBInstancesOfferingsCommand */ -export const de_DeleteTenantDatabaseCommand = async ( +export const de_DescribeReservedDBInstancesOfferingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteTenantDatabaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteTenantDatabaseResult(data.DeleteTenantDatabaseResult, context); - const response: DeleteTenantDatabaseCommandOutput = { + contents = de_ReservedDBInstancesOfferingMessage(data.DescribeReservedDBInstancesOfferingsResult, context); + const response: DescribeReservedDBInstancesOfferingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6867,51 +5761,39 @@ export const de_DeleteTenantDatabaseCommand = async ( }; /** - * deserializeAws_queryDeleteTenantDatabaseCommandError + * deserializeAws_queryDescribeSourceRegionsCommand */ -const de_DeleteTenantDatabaseCommandError = async ( +export const de_DescribeSourceRegionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "TenantDatabaseNotFound": - case "com.amazonaws.rds#TenantDatabaseNotFoundFault": - throw await de_TenantDatabaseNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SourceRegionMessage(data.DescribeSourceRegionsResult, context); + const response: DescribeSourceRegionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeregisterDBProxyTargetsCommand + * deserializeAws_queryDescribeTenantDatabasesCommand */ -export const de_DeregisterDBProxyTargetsCommand = async ( +export const de_DescribeTenantDatabasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeregisterDBProxyTargetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeregisterDBProxyTargetsResponse(data.DeregisterDBProxyTargetsResult, context); - const response: DeregisterDBProxyTargetsCommandOutput = { + contents = de_TenantDatabasesMessage(data.DescribeTenantDatabasesResult, context); + const response: DescribeTenantDatabasesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6919,54 +5801,39 @@ export const de_DeregisterDBProxyTargetsCommand = async ( }; /** - * deserializeAws_queryDeregisterDBProxyTargetsCommandError + * deserializeAws_queryDescribeValidDBInstanceModificationsCommand */ -const de_DeregisterDBProxyTargetsCommandError = async ( +export const de_DescribeValidDBInstanceModificationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBProxyNotFoundFault": - case "com.amazonaws.rds#DBProxyNotFoundFault": - throw await de_DBProxyNotFoundFaultRes(parsedOutput, context); - case "DBProxyTargetGroupNotFoundFault": - case "com.amazonaws.rds#DBProxyTargetGroupNotFoundFault": - throw await de_DBProxyTargetGroupNotFoundFaultRes(parsedOutput, context); - case "DBProxyTargetNotFoundFault": - case "com.amazonaws.rds#DBProxyTargetNotFoundFault": - throw await de_DBProxyTargetNotFoundFaultRes(parsedOutput, context); - case "InvalidDBProxyStateFault": - case "com.amazonaws.rds#InvalidDBProxyStateFault": - throw await de_InvalidDBProxyStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeValidDBInstanceModificationsResult(data.DescribeValidDBInstanceModificationsResult, context); + const response: DescribeValidDBInstanceModificationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeAccountAttributesCommand + * deserializeAws_queryDisableHttpEndpointCommand */ -export const de_DescribeAccountAttributesCommand = async ( +export const de_DisableHttpEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeAccountAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_AccountAttributesMessage(data.DescribeAccountAttributesResult, context); - const response: DescribeAccountAttributesCommandOutput = { + contents = de_DisableHttpEndpointResponse(data.DisableHttpEndpointResult, context); + const response: DisableHttpEndpointCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6974,39 +5841,39 @@ export const de_DescribeAccountAttributesCommand = async ( }; /** - * deserializeAws_queryDescribeAccountAttributesCommandError + * deserializeAws_queryDownloadDBLogFilePortionCommand */ -const de_DescribeAccountAttributesCommandError = async ( +export const de_DownloadDBLogFilePortionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DownloadDBLogFilePortionDetails(data.DownloadDBLogFilePortionResult, context); + const response: DownloadDBLogFilePortionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** - * deserializeAws_queryDescribeBlueGreenDeploymentsCommand + * deserializeAws_queryEnableHttpEndpointCommand */ -export const de_DescribeBlueGreenDeploymentsCommand = async ( +export const de_EnableHttpEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeBlueGreenDeploymentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeBlueGreenDeploymentsResponse(data.DescribeBlueGreenDeploymentsResult, context); - const response: DescribeBlueGreenDeploymentsCommandOutput = { + contents = de_EnableHttpEndpointResponse(data.EnableHttpEndpointResult, context); + const response: EnableHttpEndpointCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7014,45 +5881,39 @@ export const de_DescribeBlueGreenDeploymentsCommand = async ( }; /** - * deserializeAws_queryDescribeBlueGreenDeploymentsCommandError + * deserializeAws_queryFailoverDBClusterCommand */ -const de_DescribeBlueGreenDeploymentsCommandError = async ( +export const de_FailoverDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BlueGreenDeploymentNotFoundFault": - case "com.amazonaws.rds#BlueGreenDeploymentNotFoundFault": - throw await de_BlueGreenDeploymentNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_FailoverDBClusterResult(data.FailoverDBClusterResult, context); + const response: FailoverDBClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeCertificatesCommand + * deserializeAws_queryFailoverGlobalClusterCommand */ -export const de_DescribeCertificatesCommand = async ( +export const de_FailoverGlobalClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeCertificatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CertificateMessage(data.DescribeCertificatesResult, context); - const response: DescribeCertificatesCommandOutput = { + contents = de_FailoverGlobalClusterResult(data.FailoverGlobalClusterResult, context); + const response: FailoverGlobalClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7060,45 +5921,39 @@ export const de_DescribeCertificatesCommand = async ( }; /** - * deserializeAws_queryDescribeCertificatesCommandError + * deserializeAws_queryListTagsForResourceCommand */ -const de_DescribeCertificatesCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateNotFound": - case "com.amazonaws.rds#CertificateNotFoundFault": - throw await de_CertificateNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_TagListMessage(data.ListTagsForResourceResult, context); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBClusterAutomatedBackupsCommand + * deserializeAws_queryModifyActivityStreamCommand */ -export const de_DescribeDBClusterAutomatedBackupsCommand = async ( +export const de_ModifyActivityStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterAutomatedBackupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBClusterAutomatedBackupMessage(data.DescribeDBClusterAutomatedBackupsResult, context); - const response: DescribeDBClusterAutomatedBackupsCommandOutput = { + contents = de_ModifyActivityStreamResponse(data.ModifyActivityStreamResult, context); + const response: ModifyActivityStreamCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7106,45 +5961,39 @@ export const de_DescribeDBClusterAutomatedBackupsCommand = async ( }; /** - * deserializeAws_queryDescribeDBClusterAutomatedBackupsCommandError + * deserializeAws_queryModifyCertificatesCommand */ -const de_DescribeDBClusterAutomatedBackupsCommandError = async ( +export const de_ModifyCertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterAutomatedBackupNotFoundFault": - case "com.amazonaws.rds#DBClusterAutomatedBackupNotFoundFault": - throw await de_DBClusterAutomatedBackupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyCertificatesResult(data.ModifyCertificatesResult, context); + const response: ModifyCertificatesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBClusterBacktracksCommand + * deserializeAws_queryModifyCurrentDBClusterCapacityCommand */ -export const de_DescribeDBClusterBacktracksCommand = async ( +export const de_ModifyCurrentDBClusterCapacityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterBacktracksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBClusterBacktrackMessage(data.DescribeDBClusterBacktracksResult, context); - const response: DescribeDBClusterBacktracksCommandOutput = { + contents = de_DBClusterCapacityInfo(data.ModifyCurrentDBClusterCapacityResult, context); + const response: ModifyCurrentDBClusterCapacityCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7152,48 +6001,39 @@ export const de_DescribeDBClusterBacktracksCommand = async ( }; /** - * deserializeAws_queryDescribeDBClusterBacktracksCommandError + * deserializeAws_queryModifyCustomDBEngineVersionCommand */ -const de_DescribeDBClusterBacktracksCommandError = async ( +export const de_ModifyCustomDBEngineVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBEngineVersion(data.ModifyCustomDBEngineVersionResult, context); + const response: ModifyCustomDBEngineVersionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterBacktrackNotFoundFault": - case "com.amazonaws.rds#DBClusterBacktrackNotFoundFault": - throw await de_DBClusterBacktrackNotFoundFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + return response; }; /** - * deserializeAws_queryDescribeDBClusterEndpointsCommand + * deserializeAws_queryModifyDBClusterCommand */ -export const de_DescribeDBClusterEndpointsCommand = async ( +export const de_ModifyDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBClusterEndpointMessage(data.DescribeDBClusterEndpointsResult, context); - const response: DescribeDBClusterEndpointsCommandOutput = { + contents = de_ModifyDBClusterResult(data.ModifyDBClusterResult, context); + const response: ModifyDBClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7201,45 +6041,39 @@ export const de_DescribeDBClusterEndpointsCommand = async ( }; /** - * deserializeAws_queryDescribeDBClusterEndpointsCommandError + * deserializeAws_queryModifyDBClusterEndpointCommand */ -const de_DescribeDBClusterEndpointsCommandError = async ( +export const de_ModifyDBClusterEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBClusterEndpoint(data.ModifyDBClusterEndpointResult, context); + const response: ModifyDBClusterEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBClusterParameterGroupsCommand + * deserializeAws_queryModifyDBClusterParameterGroupCommand */ -export const de_DescribeDBClusterParameterGroupsCommand = async ( +export const de_ModifyDBClusterParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterParameterGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBClusterParameterGroupsMessage(data.DescribeDBClusterParameterGroupsResult, context); - const response: DescribeDBClusterParameterGroupsCommandOutput = { + contents = de_DBClusterParameterGroupNameMessage(data.ModifyDBClusterParameterGroupResult, context); + const response: ModifyDBClusterParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7247,45 +6081,39 @@ export const de_DescribeDBClusterParameterGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeDBClusterParameterGroupsCommandError + * deserializeAws_queryModifyDBClusterSnapshotAttributeCommand */ -const de_DescribeDBClusterParameterGroupsCommandError = async ( +export const de_ModifyDBClusterSnapshotAttributeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyDBClusterSnapshotAttributeResult(data.ModifyDBClusterSnapshotAttributeResult, context); + const response: ModifyDBClusterSnapshotAttributeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBClusterParametersCommand + * deserializeAws_queryModifyDBInstanceCommand */ -export const de_DescribeDBClusterParametersCommand = async ( +export const de_ModifyDBInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBClusterParameterGroupDetails(data.DescribeDBClusterParametersResult, context); - const response: DescribeDBClusterParametersCommandOutput = { + contents = de_ModifyDBInstanceResult(data.ModifyDBInstanceResult, context); + const response: ModifyDBInstanceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7293,45 +6121,39 @@ export const de_DescribeDBClusterParametersCommand = async ( }; /** - * deserializeAws_queryDescribeDBClusterParametersCommandError + * deserializeAws_queryModifyDBParameterGroupCommand */ -const de_DescribeDBClusterParametersCommandError = async ( +export const de_ModifyDBParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBParameterGroupNameMessage(data.ModifyDBParameterGroupResult, context); + const response: ModifyDBParameterGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBClustersCommand + * deserializeAws_queryModifyDBProxyCommand */ -export const de_DescribeDBClustersCommand = async ( +export const de_ModifyDBProxyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClustersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBClusterMessage(data.DescribeDBClustersResult, context); - const response: DescribeDBClustersCommandOutput = { + contents = de_ModifyDBProxyResponse(data.ModifyDBProxyResult, context); + const response: ModifyDBProxyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7339,45 +6161,39 @@ export const de_DescribeDBClustersCommand = async ( }; /** - * deserializeAws_queryDescribeDBClustersCommandError + * deserializeAws_queryModifyDBProxyEndpointCommand */ -const de_DescribeDBClustersCommandError = async ( +export const de_ModifyDBProxyEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyDBProxyEndpointResponse(data.ModifyDBProxyEndpointResult, context); + const response: ModifyDBProxyEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBClusterSnapshotAttributesCommand + * deserializeAws_queryModifyDBProxyTargetGroupCommand */ -export const de_DescribeDBClusterSnapshotAttributesCommand = async ( +export const de_ModifyDBProxyTargetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterSnapshotAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDBClusterSnapshotAttributesResult(data.DescribeDBClusterSnapshotAttributesResult, context); - const response: DescribeDBClusterSnapshotAttributesCommandOutput = { + contents = de_ModifyDBProxyTargetGroupResponse(data.ModifyDBProxyTargetGroupResult, context); + const response: ModifyDBProxyTargetGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7385,45 +6201,39 @@ export const de_DescribeDBClusterSnapshotAttributesCommand = async ( }; /** - * deserializeAws_queryDescribeDBClusterSnapshotAttributesCommandError + * deserializeAws_queryModifyDBRecommendationCommand */ -const de_DescribeDBClusterSnapshotAttributesCommandError = async ( +export const de_ModifyDBRecommendationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.rds#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBRecommendationMessage(data.ModifyDBRecommendationResult, context); + const response: ModifyDBRecommendationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBClusterSnapshotsCommand + * deserializeAws_queryModifyDBShardGroupCommand */ -export const de_DescribeDBClusterSnapshotsCommand = async ( +export const de_ModifyDBShardGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBClusterSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBClusterSnapshotMessage(data.DescribeDBClusterSnapshotsResult, context); - const response: DescribeDBClusterSnapshotsCommandOutput = { + contents = de_DBShardGroup(data.ModifyDBShardGroupResult, context); + const response: ModifyDBShardGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7431,45 +6241,39 @@ export const de_DescribeDBClusterSnapshotsCommand = async ( }; /** - * deserializeAws_queryDescribeDBClusterSnapshotsCommandError + * deserializeAws_queryModifyDBSnapshotCommand */ -const de_DescribeDBClusterSnapshotsCommandError = async ( +export const de_ModifyDBSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.rds#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyDBSnapshotResult(data.ModifyDBSnapshotResult, context); + const response: ModifyDBSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBEngineVersionsCommand + * deserializeAws_queryModifyDBSnapshotAttributeCommand */ -export const de_DescribeDBEngineVersionsCommand = async ( +export const de_ModifyDBSnapshotAttributeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBEngineVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBEngineVersionMessage(data.DescribeDBEngineVersionsResult, context); - const response: DescribeDBEngineVersionsCommandOutput = { + contents = de_ModifyDBSnapshotAttributeResult(data.ModifyDBSnapshotAttributeResult, context); + const response: ModifyDBSnapshotAttributeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7477,39 +6281,19 @@ export const de_DescribeDBEngineVersionsCommand = async ( }; /** - * deserializeAws_queryDescribeDBEngineVersionsCommandError + * deserializeAws_queryModifyDBSubnetGroupCommand */ -const de_DescribeDBEngineVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryDescribeDBInstanceAutomatedBackupsCommand - */ -export const de_DescribeDBInstanceAutomatedBackupsCommand = async ( +export const de_ModifyDBSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBInstanceAutomatedBackupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBInstanceAutomatedBackupMessage(data.DescribeDBInstanceAutomatedBackupsResult, context); - const response: DescribeDBInstanceAutomatedBackupsCommandOutput = { + contents = de_ModifyDBSubnetGroupResult(data.ModifyDBSubnetGroupResult, context); + const response: ModifyDBSubnetGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7517,45 +6301,39 @@ export const de_DescribeDBInstanceAutomatedBackupsCommand = async ( }; /** - * deserializeAws_queryDescribeDBInstanceAutomatedBackupsCommandError + * deserializeAws_queryModifyEventSubscriptionCommand */ -const de_DescribeDBInstanceAutomatedBackupsCommandError = async ( +export const de_ModifyEventSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceAutomatedBackupNotFound": - case "com.amazonaws.rds#DBInstanceAutomatedBackupNotFoundFault": - throw await de_DBInstanceAutomatedBackupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyEventSubscriptionResult(data.ModifyEventSubscriptionResult, context); + const response: ModifyEventSubscriptionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBInstancesCommand + * deserializeAws_queryModifyGlobalClusterCommand */ -export const de_DescribeDBInstancesCommand = async ( +export const de_ModifyGlobalClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBInstanceMessage(data.DescribeDBInstancesResult, context); - const response: DescribeDBInstancesCommandOutput = { + contents = de_ModifyGlobalClusterResult(data.ModifyGlobalClusterResult, context); + const response: ModifyGlobalClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7563,45 +6341,39 @@ export const de_DescribeDBInstancesCommand = async ( }; /** - * deserializeAws_queryDescribeDBInstancesCommandError + * deserializeAws_queryModifyOptionGroupCommand */ -const de_DescribeDBInstancesCommandError = async ( +export const de_ModifyOptionGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyOptionGroupResult(data.ModifyOptionGroupResult, context); + const response: ModifyOptionGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBLogFilesCommand + * deserializeAws_queryModifyTenantDatabaseCommand */ -export const de_DescribeDBLogFilesCommand = async ( +export const de_ModifyTenantDatabaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBLogFilesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDBLogFilesResponse(data.DescribeDBLogFilesResult, context); - const response: DescribeDBLogFilesCommandOutput = { + contents = de_ModifyTenantDatabaseResult(data.ModifyTenantDatabaseResult, context); + const response: ModifyTenantDatabaseCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7609,45 +6381,39 @@ export const de_DescribeDBLogFilesCommand = async ( }; /** - * deserializeAws_queryDescribeDBLogFilesCommandError + * deserializeAws_queryPromoteReadReplicaCommand */ -const de_DescribeDBLogFilesCommandError = async ( +export const de_PromoteReadReplicaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_PromoteReadReplicaResult(data.PromoteReadReplicaResult, context); + const response: PromoteReadReplicaCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBParameterGroupsCommand + * deserializeAws_queryPromoteReadReplicaDBClusterCommand */ -export const de_DescribeDBParameterGroupsCommand = async ( +export const de_PromoteReadReplicaDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBParameterGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBParameterGroupsMessage(data.DescribeDBParameterGroupsResult, context); - const response: DescribeDBParameterGroupsCommandOutput = { + contents = de_PromoteReadReplicaDBClusterResult(data.PromoteReadReplicaDBClusterResult, context); + const response: PromoteReadReplicaDBClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7655,45 +6421,39 @@ export const de_DescribeDBParameterGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeDBParameterGroupsCommandError + * deserializeAws_queryPurchaseReservedDBInstancesOfferingCommand */ -const de_DescribeDBParameterGroupsCommandError = async ( +export const de_PurchaseReservedDBInstancesOfferingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_PurchaseReservedDBInstancesOfferingResult(data.PurchaseReservedDBInstancesOfferingResult, context); + const response: PurchaseReservedDBInstancesOfferingCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBParametersCommand + * deserializeAws_queryRebootDBClusterCommand */ -export const de_DescribeDBParametersCommand = async ( +export const de_RebootDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBParameterGroupDetails(data.DescribeDBParametersResult, context); - const response: DescribeDBParametersCommandOutput = { + contents = de_RebootDBClusterResult(data.RebootDBClusterResult, context); + const response: RebootDBClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7701,45 +6461,39 @@ export const de_DescribeDBParametersCommand = async ( }; /** - * deserializeAws_queryDescribeDBParametersCommandError + * deserializeAws_queryRebootDBInstanceCommand */ -const de_DescribeDBParametersCommandError = async ( +export const de_RebootDBInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RebootDBInstanceResult(data.RebootDBInstanceResult, context); + const response: RebootDBInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBProxiesCommand + * deserializeAws_queryRebootDBShardGroupCommand */ -export const de_DescribeDBProxiesCommand = async ( +export const de_RebootDBShardGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBProxiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDBProxiesResponse(data.DescribeDBProxiesResult, context); - const response: DescribeDBProxiesCommandOutput = { + contents = de_DBShardGroup(data.RebootDBShardGroupResult, context); + const response: RebootDBShardGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7747,45 +6501,39 @@ export const de_DescribeDBProxiesCommand = async ( }; /** - * deserializeAws_queryDescribeDBProxiesCommandError + * deserializeAws_queryRegisterDBProxyTargetsCommand */ -const de_DescribeDBProxiesCommandError = async ( +export const de_RegisterDBProxyTargetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBProxyNotFoundFault": - case "com.amazonaws.rds#DBProxyNotFoundFault": - throw await de_DBProxyNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RegisterDBProxyTargetsResponse(data.RegisterDBProxyTargetsResult, context); + const response: RegisterDBProxyTargetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBProxyEndpointsCommand + * deserializeAws_queryRemoveFromGlobalClusterCommand */ -export const de_DescribeDBProxyEndpointsCommand = async ( +export const de_RemoveFromGlobalClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBProxyEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDBProxyEndpointsResponse(data.DescribeDBProxyEndpointsResult, context); - const response: DescribeDBProxyEndpointsCommandOutput = { + contents = de_RemoveFromGlobalClusterResult(data.RemoveFromGlobalClusterResult, context); + const response: RemoveFromGlobalClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7793,48 +6541,56 @@ export const de_DescribeDBProxyEndpointsCommand = async ( }; /** - * deserializeAws_queryDescribeDBProxyEndpointsCommandError + * deserializeAws_queryRemoveRoleFromDBClusterCommand */ -const de_DescribeDBProxyEndpointsCommandError = async ( +export const de_RemoveRoleFromDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: RemoveRoleFromDBClusterCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBProxyEndpointNotFoundFault": - case "com.amazonaws.rds#DBProxyEndpointNotFoundFault": - throw await de_DBProxyEndpointNotFoundFaultRes(parsedOutput, context); - case "DBProxyNotFoundFault": - case "com.amazonaws.rds#DBProxyNotFoundFault": - throw await de_DBProxyNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_queryRemoveRoleFromDBInstanceCommand + */ +export const de_RemoveRoleFromDBInstanceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: RemoveRoleFromDBInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryDescribeDBProxyTargetGroupsCommand + * deserializeAws_queryRemoveSourceIdentifierFromSubscriptionCommand */ -export const de_DescribeDBProxyTargetGroupsCommand = async ( +export const de_RemoveSourceIdentifierFromSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBProxyTargetGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDBProxyTargetGroupsResponse(data.DescribeDBProxyTargetGroupsResult, context); - const response: DescribeDBProxyTargetGroupsCommandOutput = { + contents = de_RemoveSourceIdentifierFromSubscriptionResult( + data.RemoveSourceIdentifierFromSubscriptionResult, + context + ); + const response: RemoveSourceIdentifierFromSubscriptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7842,51 +6598,36 @@ export const de_DescribeDBProxyTargetGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeDBProxyTargetGroupsCommandError + * deserializeAws_queryRemoveTagsFromResourceCommand */ -const de_DescribeDBProxyTargetGroupsCommandError = async ( +export const de_RemoveTagsFromResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBProxyNotFoundFault": - case "com.amazonaws.rds#DBProxyNotFoundFault": - throw await de_DBProxyNotFoundFaultRes(parsedOutput, context); - case "DBProxyTargetGroupNotFoundFault": - case "com.amazonaws.rds#DBProxyTargetGroupNotFoundFault": - throw await de_DBProxyTargetGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBProxyStateFault": - case "com.amazonaws.rds#InvalidDBProxyStateFault": - throw await de_InvalidDBProxyStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: RemoveTagsFromResourceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryDescribeDBProxyTargetsCommand + * deserializeAws_queryResetDBClusterParameterGroupCommand */ -export const de_DescribeDBProxyTargetsCommand = async ( +export const de_ResetDBClusterParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBProxyTargetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDBProxyTargetsResponse(data.DescribeDBProxyTargetsResult, context); - const response: DescribeDBProxyTargetsCommandOutput = { + contents = de_DBClusterParameterGroupNameMessage(data.ResetDBClusterParameterGroupResult, context); + const response: ResetDBClusterParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7894,54 +6635,39 @@ export const de_DescribeDBProxyTargetsCommand = async ( }; /** - * deserializeAws_queryDescribeDBProxyTargetsCommandError + * deserializeAws_queryResetDBParameterGroupCommand */ -const de_DescribeDBProxyTargetsCommandError = async ( +export const de_ResetDBParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBProxyNotFoundFault": - case "com.amazonaws.rds#DBProxyNotFoundFault": - throw await de_DBProxyNotFoundFaultRes(parsedOutput, context); - case "DBProxyTargetGroupNotFoundFault": - case "com.amazonaws.rds#DBProxyTargetGroupNotFoundFault": - throw await de_DBProxyTargetGroupNotFoundFaultRes(parsedOutput, context); - case "DBProxyTargetNotFoundFault": - case "com.amazonaws.rds#DBProxyTargetNotFoundFault": - throw await de_DBProxyTargetNotFoundFaultRes(parsedOutput, context); - case "InvalidDBProxyStateFault": - case "com.amazonaws.rds#InvalidDBProxyStateFault": - throw await de_InvalidDBProxyStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DBParameterGroupNameMessage(data.ResetDBParameterGroupResult, context); + const response: ResetDBParameterGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBRecommendationsCommand + * deserializeAws_queryRestoreDBClusterFromS3Command */ -export const de_DescribeDBRecommendationsCommand = async ( +export const de_RestoreDBClusterFromS3Command = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBRecommendationsMessage(data.DescribeDBRecommendationsResult, context); - const response: DescribeDBRecommendationsCommandOutput = { + contents = de_RestoreDBClusterFromS3Result(data.RestoreDBClusterFromS3Result, context); + const response: RestoreDBClusterFromS3CommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7949,39 +6675,39 @@ export const de_DescribeDBRecommendationsCommand = async ( }; /** - * deserializeAws_queryDescribeDBRecommendationsCommandError + * deserializeAws_queryRestoreDBClusterFromSnapshotCommand */ -const de_DescribeDBRecommendationsCommandError = async ( +export const de_RestoreDBClusterFromSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RestoreDBClusterFromSnapshotResult(data.RestoreDBClusterFromSnapshotResult, context); + const response: RestoreDBClusterFromSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** - * deserializeAws_queryDescribeDBSecurityGroupsCommand + * deserializeAws_queryRestoreDBClusterToPointInTimeCommand */ -export const de_DescribeDBSecurityGroupsCommand = async ( +export const de_RestoreDBClusterToPointInTimeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBSecurityGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBSecurityGroupMessage(data.DescribeDBSecurityGroupsResult, context); - const response: DescribeDBSecurityGroupsCommandOutput = { + contents = de_RestoreDBClusterToPointInTimeResult(data.RestoreDBClusterToPointInTimeResult, context); + const response: RestoreDBClusterToPointInTimeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -7989,45 +6715,39 @@ export const de_DescribeDBSecurityGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeDBSecurityGroupsCommandError + * deserializeAws_queryRestoreDBInstanceFromDBSnapshotCommand */ -const de_DescribeDBSecurityGroupsCommandError = async ( +export const de_RestoreDBInstanceFromDBSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSecurityGroupNotFound": - case "com.amazonaws.rds#DBSecurityGroupNotFoundFault": - throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RestoreDBInstanceFromDBSnapshotResult(data.RestoreDBInstanceFromDBSnapshotResult, context); + const response: RestoreDBInstanceFromDBSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBShardGroupsCommand + * deserializeAws_queryRestoreDBInstanceFromS3Command */ -export const de_DescribeDBShardGroupsCommand = async ( +export const de_RestoreDBInstanceFromS3Command = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBShardGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDBShardGroupsResponse(data.DescribeDBShardGroupsResult, context); - const response: DescribeDBShardGroupsCommandOutput = { + contents = de_RestoreDBInstanceFromS3Result(data.RestoreDBInstanceFromS3Result, context); + const response: RestoreDBInstanceFromS3CommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8035,48 +6755,39 @@ export const de_DescribeDBShardGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeDBShardGroupsCommandError + * deserializeAws_queryRestoreDBInstanceToPointInTimeCommand */ -const de_DescribeDBShardGroupsCommandError = async ( +export const de_RestoreDBInstanceToPointInTimeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBShardGroupNotFound": - case "com.amazonaws.rds#DBShardGroupNotFoundFault": - throw await de_DBShardGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RestoreDBInstanceToPointInTimeResult(data.RestoreDBInstanceToPointInTimeResult, context); + const response: RestoreDBInstanceToPointInTimeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDBSnapshotAttributesCommand + * deserializeAws_queryRevokeDBSecurityGroupIngressCommand */ -export const de_DescribeDBSnapshotAttributesCommand = async ( +export const de_RevokeDBSecurityGroupIngressCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBSnapshotAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDBSnapshotAttributesResult(data.DescribeDBSnapshotAttributesResult, context); - const response: DescribeDBSnapshotAttributesCommandOutput = { + contents = de_RevokeDBSecurityGroupIngressResult(data.RevokeDBSecurityGroupIngressResult, context); + const response: RevokeDBSecurityGroupIngressCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8084,45 +6795,19 @@ export const de_DescribeDBSnapshotAttributesCommand = async ( }; /** - * deserializeAws_queryDescribeDBSnapshotAttributesCommandError + * deserializeAws_queryStartActivityStreamCommand */ -const de_DescribeDBSnapshotAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSnapshotNotFound": - case "com.amazonaws.rds#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeDBSnapshotsCommand - */ -export const de_DescribeDBSnapshotsCommand = async ( +export const de_StartActivityStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBSnapshotMessage(data.DescribeDBSnapshotsResult, context); - const response: DescribeDBSnapshotsCommandOutput = { + contents = de_StartActivityStreamResponse(data.StartActivityStreamResult, context); + const response: StartActivityStreamCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8130,45 +6815,19 @@ export const de_DescribeDBSnapshotsCommand = async ( }; /** - * deserializeAws_queryDescribeDBSnapshotsCommandError - */ -const de_DescribeDBSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSnapshotNotFound": - case "com.amazonaws.rds#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeDBSnapshotTenantDatabasesCommand + * deserializeAws_queryStartDBClusterCommand */ -export const de_DescribeDBSnapshotTenantDatabasesCommand = async ( +export const de_StartDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBSnapshotTenantDatabasesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBSnapshotTenantDatabasesMessage(data.DescribeDBSnapshotTenantDatabasesResult, context); - const response: DescribeDBSnapshotTenantDatabasesCommandOutput = { + contents = de_StartDBClusterResult(data.StartDBClusterResult, context); + const response: StartDBClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8176,45 +6835,19 @@ export const de_DescribeDBSnapshotTenantDatabasesCommand = async ( }; /** - * deserializeAws_queryDescribeDBSnapshotTenantDatabasesCommandError - */ -const de_DescribeDBSnapshotTenantDatabasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSnapshotNotFound": - case "com.amazonaws.rds#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeDBSubnetGroupsCommand + * deserializeAws_queryStartDBInstanceCommand */ -export const de_DescribeDBSubnetGroupsCommand = async ( +export const de_StartDBInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDBSubnetGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DBSubnetGroupMessage(data.DescribeDBSubnetGroupsResult, context); - const response: DescribeDBSubnetGroupsCommandOutput = { + contents = de_StartDBInstanceResult(data.StartDBInstanceResult, context); + const response: StartDBInstanceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8222,48 +6855,22 @@ export const de_DescribeDBSubnetGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeDBSubnetGroupsCommandError - */ -const de_DescribeDBSubnetGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.rds#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeEngineDefaultClusterParametersCommand + * deserializeAws_queryStartDBInstanceAutomatedBackupsReplicationCommand */ -export const de_DescribeEngineDefaultClusterParametersCommand = async ( +export const de_StartDBInstanceAutomatedBackupsReplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEngineDefaultClusterParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEngineDefaultClusterParametersResult( - data.DescribeEngineDefaultClusterParametersResult, + contents = de_StartDBInstanceAutomatedBackupsReplicationResult( + data.StartDBInstanceAutomatedBackupsReplicationResult, context ); - const response: DescribeEngineDefaultClusterParametersCommandOutput = { + const response: StartDBInstanceAutomatedBackupsReplicationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8271,39 +6878,39 @@ export const de_DescribeEngineDefaultClusterParametersCommand = async ( }; /** - * deserializeAws_queryDescribeEngineDefaultClusterParametersCommandError + * deserializeAws_queryStartExportTaskCommand */ -const de_DescribeEngineDefaultClusterParametersCommandError = async ( +export const de_StartExportTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ExportTask(data.StartExportTaskResult, context); + const response: StartExportTaskCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** - * deserializeAws_queryDescribeEngineDefaultParametersCommand + * deserializeAws_queryStopActivityStreamCommand */ -export const de_DescribeEngineDefaultParametersCommand = async ( +export const de_StopActivityStreamCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEngineDefaultParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEngineDefaultParametersResult(data.DescribeEngineDefaultParametersResult, context); - const response: DescribeEngineDefaultParametersCommandOutput = { + contents = de_StopActivityStreamResponse(data.StopActivityStreamResult, context); + const response: StopActivityStreamCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8311,39 +6918,39 @@ export const de_DescribeEngineDefaultParametersCommand = async ( }; /** - * deserializeAws_queryDescribeEngineDefaultParametersCommandError + * deserializeAws_queryStopDBClusterCommand */ -const de_DescribeEngineDefaultParametersCommandError = async ( +export const de_StopDBClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StopDBClusterResult(data.StopDBClusterResult, context); + const response: StopDBClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** - * deserializeAws_queryDescribeEventCategoriesCommand + * deserializeAws_queryStopDBInstanceCommand */ -export const de_DescribeEventCategoriesCommand = async ( +export const de_StopDBInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventCategoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_EventCategoriesMessage(data.DescribeEventCategoriesResult, context); - const response: DescribeEventCategoriesCommandOutput = { + contents = de_StopDBInstanceResult(data.StopDBInstanceResult, context); + const response: StopDBInstanceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8351,39 +6958,42 @@ export const de_DescribeEventCategoriesCommand = async ( }; /** - * deserializeAws_queryDescribeEventCategoriesCommandError + * deserializeAws_queryStopDBInstanceAutomatedBackupsReplicationCommand */ -const de_DescribeEventCategoriesCommandError = async ( +export const de_StopDBInstanceAutomatedBackupsReplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StopDBInstanceAutomatedBackupsReplicationResult( + data.StopDBInstanceAutomatedBackupsReplicationResult, + context + ); + const response: StopDBInstanceAutomatedBackupsReplicationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** - * deserializeAws_queryDescribeEventsCommand + * deserializeAws_querySwitchoverBlueGreenDeploymentCommand */ -export const de_DescribeEventsCommand = async ( +export const de_SwitchoverBlueGreenDeploymentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_EventsMessage(data.DescribeEventsResult, context); - const response: DescribeEventsCommandOutput = { + contents = de_SwitchoverBlueGreenDeploymentResponse(data.SwitchoverBlueGreenDeploymentResult, context); + const response: SwitchoverBlueGreenDeploymentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8391,39 +7001,39 @@ export const de_DescribeEventsCommand = async ( }; /** - * deserializeAws_queryDescribeEventsCommandError + * deserializeAws_querySwitchoverGlobalClusterCommand */ -const de_DescribeEventsCommandError = async ( +export const de_SwitchoverGlobalClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SwitchoverGlobalClusterResult(data.SwitchoverGlobalClusterResult, context); + const response: SwitchoverGlobalClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** - * deserializeAws_queryDescribeEventSubscriptionsCommand + * deserializeAws_querySwitchoverReadReplicaCommand */ -export const de_DescribeEventSubscriptionsCommand = async ( +export const de_SwitchoverReadReplicaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventSubscriptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_EventSubscriptionsMessage(data.DescribeEventSubscriptionsResult, context); - const response: DescribeEventSubscriptionsCommandOutput = { + contents = de_SwitchoverReadReplicaResult(data.SwitchoverReadReplicaResult, context); + const response: SwitchoverReadReplicaCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8431,4223 +7041,457 @@ export const de_DescribeEventSubscriptionsCommand = async ( }; /** - * deserializeAws_queryDescribeEventSubscriptionsCommandError + * deserialize_Aws_queryCommandError */ -const de_DescribeEventSubscriptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { - case "SubscriptionNotFound": + case "DBClusterNotFoundFault": + case "com.amazonaws.rds#DBClusterNotFoundFault": + throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); + case "DBClusterRoleAlreadyExists": + case "com.amazonaws.rds#DBClusterRoleAlreadyExistsFault": + throw await de_DBClusterRoleAlreadyExistsFaultRes(parsedOutput, context); + case "DBClusterRoleQuotaExceeded": + case "com.amazonaws.rds#DBClusterRoleQuotaExceededFault": + throw await de_DBClusterRoleQuotaExceededFaultRes(parsedOutput, context); + case "InvalidDBClusterStateFault": + case "com.amazonaws.rds#InvalidDBClusterStateFault": + throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); + case "DBInstanceNotFound": + case "com.amazonaws.rds#DBInstanceNotFoundFault": + throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); + case "DBInstanceRoleAlreadyExists": + case "com.amazonaws.rds#DBInstanceRoleAlreadyExistsFault": + throw await de_DBInstanceRoleAlreadyExistsFaultRes(parsedOutput, context); + case "DBInstanceRoleQuotaExceeded": + case "com.amazonaws.rds#DBInstanceRoleQuotaExceededFault": + throw await de_DBInstanceRoleQuotaExceededFaultRes(parsedOutput, context); + case "InvalidDBInstanceState": + case "com.amazonaws.rds#InvalidDBInstanceStateFault": + throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); + case "SourceNotFound": + case "com.amazonaws.rds#SourceNotFoundFault": + throw await de_SourceNotFoundFaultRes(parsedOutput, context); + case "SubscriptionNotFound": case "com.amazonaws.rds#SubscriptionNotFoundFault": throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeExportTasksCommand - */ -export const de_DescribeExportTasksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeExportTasksCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ExportTasksMessage(data.DescribeExportTasksResult, context); - const response: DescribeExportTasksCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeExportTasksCommandError - */ -const de_DescribeExportTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { + case "BlueGreenDeploymentNotFoundFault": + case "com.amazonaws.rds#BlueGreenDeploymentNotFoundFault": + throw await de_BlueGreenDeploymentNotFoundFaultRes(parsedOutput, context); + case "DBProxyNotFoundFault": + case "com.amazonaws.rds#DBProxyNotFoundFault": + throw await de_DBProxyNotFoundFaultRes(parsedOutput, context); + case "DBProxyTargetGroupNotFoundFault": + case "com.amazonaws.rds#DBProxyTargetGroupNotFoundFault": + throw await de_DBProxyTargetGroupNotFoundFaultRes(parsedOutput, context); + case "DBSnapshotNotFound": + case "com.amazonaws.rds#DBSnapshotNotFoundFault": + throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); + case "DBSnapshotTenantDatabaseNotFoundFault": + case "com.amazonaws.rds#DBSnapshotTenantDatabaseNotFoundFault": + throw await de_DBSnapshotTenantDatabaseNotFoundFaultRes(parsedOutput, context); + case "IntegrationNotFoundFault": + case "com.amazonaws.rds#IntegrationNotFoundFault": + throw await de_IntegrationNotFoundFaultRes(parsedOutput, context); + case "TenantDatabaseNotFound": + case "com.amazonaws.rds#TenantDatabaseNotFoundFault": + throw await de_TenantDatabaseNotFoundFaultRes(parsedOutput, context); + case "ResourceNotFoundFault": + case "com.amazonaws.rds#ResourceNotFoundFault": + throw await de_ResourceNotFoundFaultRes(parsedOutput, context); + case "AuthorizationAlreadyExists": + case "com.amazonaws.rds#AuthorizationAlreadyExistsFault": + throw await de_AuthorizationAlreadyExistsFaultRes(parsedOutput, context); + case "AuthorizationQuotaExceeded": + case "com.amazonaws.rds#AuthorizationQuotaExceededFault": + throw await de_AuthorizationQuotaExceededFaultRes(parsedOutput, context); + case "DBSecurityGroupNotFound": + case "com.amazonaws.rds#DBSecurityGroupNotFoundFault": + throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); + case "InvalidDBSecurityGroupState": + case "com.amazonaws.rds#InvalidDBSecurityGroupStateFault": + throw await de_InvalidDBSecurityGroupStateFaultRes(parsedOutput, context); case "ExportTaskNotFound": case "com.amazonaws.rds#ExportTaskNotFoundFault": throw await de_ExportTaskNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeGlobalClustersCommand - */ -export const de_DescribeGlobalClustersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeGlobalClustersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GlobalClustersMessage(data.DescribeGlobalClustersResult, context); - const response: DescribeGlobalClustersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeGlobalClustersCommandError - */ -const de_DescribeGlobalClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { + case "InvalidExportTaskStateFault": + case "com.amazonaws.rds#InvalidExportTaskStateFault": + throw await de_InvalidExportTaskStateFaultRes(parsedOutput, context); + case "DBParameterGroupAlreadyExists": + case "com.amazonaws.rds#DBParameterGroupAlreadyExistsFault": + throw await de_DBParameterGroupAlreadyExistsFaultRes(parsedOutput, context); + case "DBParameterGroupNotFound": + case "com.amazonaws.rds#DBParameterGroupNotFoundFault": + throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); + case "DBParameterGroupQuotaExceeded": + case "com.amazonaws.rds#DBParameterGroupQuotaExceededFault": + throw await de_DBParameterGroupQuotaExceededFaultRes(parsedOutput, context); + case "DBClusterSnapshotAlreadyExistsFault": + case "com.amazonaws.rds#DBClusterSnapshotAlreadyExistsFault": + throw await de_DBClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); + case "DBClusterSnapshotNotFoundFault": + case "com.amazonaws.rds#DBClusterSnapshotNotFoundFault": + throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); + case "InvalidDBClusterSnapshotStateFault": + case "com.amazonaws.rds#InvalidDBClusterSnapshotStateFault": + throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); + case "KMSKeyNotAccessibleFault": + case "com.amazonaws.rds#KMSKeyNotAccessibleFault": + throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); + case "SnapshotQuotaExceeded": + case "com.amazonaws.rds#SnapshotQuotaExceededFault": + throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); + case "CustomAvailabilityZoneNotFound": + case "com.amazonaws.rds#CustomAvailabilityZoneNotFoundFault": + throw await de_CustomAvailabilityZoneNotFoundFaultRes(parsedOutput, context); + case "DBSnapshotAlreadyExists": + case "com.amazonaws.rds#DBSnapshotAlreadyExistsFault": + throw await de_DBSnapshotAlreadyExistsFaultRes(parsedOutput, context); + case "InvalidDBSnapshotState": + case "com.amazonaws.rds#InvalidDBSnapshotStateFault": + throw await de_InvalidDBSnapshotStateFaultRes(parsedOutput, context); + case "OptionGroupAlreadyExistsFault": + case "com.amazonaws.rds#OptionGroupAlreadyExistsFault": + throw await de_OptionGroupAlreadyExistsFaultRes(parsedOutput, context); + case "OptionGroupNotFoundFault": + case "com.amazonaws.rds#OptionGroupNotFoundFault": + throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); + case "OptionGroupQuotaExceededFault": + case "com.amazonaws.rds#OptionGroupQuotaExceededFault": + throw await de_OptionGroupQuotaExceededFaultRes(parsedOutput, context); + case "BlueGreenDeploymentAlreadyExistsFault": + case "com.amazonaws.rds#BlueGreenDeploymentAlreadyExistsFault": + throw await de_BlueGreenDeploymentAlreadyExistsFaultRes(parsedOutput, context); + case "DBClusterParameterGroupNotFound": + case "com.amazonaws.rds#DBClusterParameterGroupNotFoundFault": + throw await de_DBClusterParameterGroupNotFoundFaultRes(parsedOutput, context); + case "DBClusterQuotaExceededFault": + case "com.amazonaws.rds#DBClusterQuotaExceededFault": + throw await de_DBClusterQuotaExceededFaultRes(parsedOutput, context); + case "InstanceQuotaExceeded": + case "com.amazonaws.rds#InstanceQuotaExceededFault": + throw await de_InstanceQuotaExceededFaultRes(parsedOutput, context); + case "SourceClusterNotSupportedFault": + case "com.amazonaws.rds#SourceClusterNotSupportedFault": + throw await de_SourceClusterNotSupportedFaultRes(parsedOutput, context); + case "SourceDatabaseNotSupportedFault": + case "com.amazonaws.rds#SourceDatabaseNotSupportedFault": + throw await de_SourceDatabaseNotSupportedFaultRes(parsedOutput, context); + case "CreateCustomDBEngineVersionFault": + case "com.amazonaws.rds#CreateCustomDBEngineVersionFault": + throw await de_CreateCustomDBEngineVersionFaultRes(parsedOutput, context); + case "CustomDBEngineVersionAlreadyExistsFault": + case "com.amazonaws.rds#CustomDBEngineVersionAlreadyExistsFault": + throw await de_CustomDBEngineVersionAlreadyExistsFaultRes(parsedOutput, context); + case "CustomDBEngineVersionQuotaExceededFault": + case "com.amazonaws.rds#CustomDBEngineVersionQuotaExceededFault": + throw await de_CustomDBEngineVersionQuotaExceededFaultRes(parsedOutput, context); + case "Ec2ImagePropertiesNotSupportedFault": + case "com.amazonaws.rds#Ec2ImagePropertiesNotSupportedFault": + throw await de_Ec2ImagePropertiesNotSupportedFaultRes(parsedOutput, context); + case "DBClusterAlreadyExistsFault": + case "com.amazonaws.rds#DBClusterAlreadyExistsFault": + throw await de_DBClusterAlreadyExistsFaultRes(parsedOutput, context); + case "DBSubnetGroupDoesNotCoverEnoughAZs": + case "com.amazonaws.rds#DBSubnetGroupDoesNotCoverEnoughAZs": + throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); + case "DBSubnetGroupNotFoundFault": + case "com.amazonaws.rds#DBSubnetGroupNotFoundFault": + throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); + case "DomainNotFoundFault": + case "com.amazonaws.rds#DomainNotFoundFault": + throw await de_DomainNotFoundFaultRes(parsedOutput, context); case "GlobalClusterNotFoundFault": case "com.amazonaws.rds#GlobalClusterNotFoundFault": throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeIntegrationsCommand - */ -export const de_DescribeIntegrationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeIntegrationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeIntegrationsResponse(data.DescribeIntegrationsResult, context); - const response: DescribeIntegrationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeIntegrationsCommandError - */ -const de_DescribeIntegrationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IntegrationNotFoundFault": - case "com.amazonaws.rds#IntegrationNotFoundFault": - throw await de_IntegrationNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeOptionGroupOptionsCommand - */ -export const de_DescribeOptionGroupOptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeOptionGroupOptionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_OptionGroupOptionsMessage(data.DescribeOptionGroupOptionsResult, context); - const response: DescribeOptionGroupOptionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeOptionGroupOptionsCommandError - */ -const de_DescribeOptionGroupOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryDescribeOptionGroupsCommand - */ -export const de_DescribeOptionGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeOptionGroupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_OptionGroups(data.DescribeOptionGroupsResult, context); - const response: DescribeOptionGroupsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeOptionGroupsCommandError - */ -const de_DescribeOptionGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OptionGroupNotFoundFault": - case "com.amazonaws.rds#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeOrderableDBInstanceOptionsCommand - */ -export const de_DescribeOrderableDBInstanceOptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeOrderableDBInstanceOptionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_OrderableDBInstanceOptionsMessage(data.DescribeOrderableDBInstanceOptionsResult, context); - const response: DescribeOrderableDBInstanceOptionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeOrderableDBInstanceOptionsCommandError - */ -const de_DescribeOrderableDBInstanceOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryDescribePendingMaintenanceActionsCommand - */ -export const de_DescribePendingMaintenanceActionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribePendingMaintenanceActionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PendingMaintenanceActionsMessage(data.DescribePendingMaintenanceActionsResult, context); - const response: DescribePendingMaintenanceActionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribePendingMaintenanceActionsCommandError - */ -const de_DescribePendingMaintenanceActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.rds#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeReservedDBInstancesCommand - */ -export const de_DescribeReservedDBInstancesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeReservedDBInstancesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ReservedDBInstanceMessage(data.DescribeReservedDBInstancesResult, context); - const response: DescribeReservedDBInstancesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeReservedDBInstancesCommandError - */ -const de_DescribeReservedDBInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ReservedDBInstanceNotFound": - case "com.amazonaws.rds#ReservedDBInstanceNotFoundFault": - throw await de_ReservedDBInstanceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeReservedDBInstancesOfferingsCommand - */ -export const de_DescribeReservedDBInstancesOfferingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeReservedDBInstancesOfferingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ReservedDBInstancesOfferingMessage(data.DescribeReservedDBInstancesOfferingsResult, context); - const response: DescribeReservedDBInstancesOfferingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeReservedDBInstancesOfferingsCommandError - */ -const de_DescribeReservedDBInstancesOfferingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ReservedDBInstancesOfferingNotFound": - case "com.amazonaws.rds#ReservedDBInstancesOfferingNotFoundFault": - throw await de_ReservedDBInstancesOfferingNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeSourceRegionsCommand - */ -export const de_DescribeSourceRegionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeSourceRegionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SourceRegionMessage(data.DescribeSourceRegionsResult, context); - const response: DescribeSourceRegionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeSourceRegionsCommandError - */ -const de_DescribeSourceRegionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryDescribeTenantDatabasesCommand - */ -export const de_DescribeTenantDatabasesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeTenantDatabasesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_TenantDatabasesMessage(data.DescribeTenantDatabasesResult, context); - const response: DescribeTenantDatabasesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeTenantDatabasesCommandError - */ -const de_DescribeTenantDatabasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeValidDBInstanceModificationsCommand - */ -export const de_DescribeValidDBInstanceModificationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeValidDBInstanceModificationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeValidDBInstanceModificationsResult(data.DescribeValidDBInstanceModificationsResult, context); - const response: DescribeValidDBInstanceModificationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeValidDBInstanceModificationsCommandError - */ -const de_DescribeValidDBInstanceModificationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDisableHttpEndpointCommand - */ -export const de_DisableHttpEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisableHttpEndpointCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DisableHttpEndpointResponse(data.DisableHttpEndpointResult, context); - const response: DisableHttpEndpointCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDisableHttpEndpointCommandError - */ -const de_DisableHttpEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.rds#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.rds#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDownloadDBLogFilePortionCommand - */ -export const de_DownloadDBLogFilePortionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DownloadDBLogFilePortionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DownloadDBLogFilePortionDetails(data.DownloadDBLogFilePortionResult, context); - const response: DownloadDBLogFilePortionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDownloadDBLogFilePortionCommandError - */ -const de_DownloadDBLogFilePortionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBLogFileNotFoundFault": - case "com.amazonaws.rds#DBLogFileNotFoundFault": - throw await de_DBLogFileNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryEnableHttpEndpointCommand - */ -export const de_EnableHttpEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_EnableHttpEndpointCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_EnableHttpEndpointResponse(data.EnableHttpEndpointResult, context); - const response: EnableHttpEndpointCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryEnableHttpEndpointCommandError - */ -const de_EnableHttpEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceStateFault": - case "com.amazonaws.rds#InvalidResourceStateFault": - throw await de_InvalidResourceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.rds#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryFailoverDBClusterCommand - */ -export const de_FailoverDBClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_FailoverDBClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_FailoverDBClusterResult(data.FailoverDBClusterResult, context); - const response: FailoverDBClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryFailoverDBClusterCommandError - */ -const de_FailoverDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryFailoverGlobalClusterCommand - */ -export const de_FailoverGlobalClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_FailoverGlobalClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_FailoverGlobalClusterResult(data.FailoverGlobalClusterResult, context); - const response: FailoverGlobalClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryFailoverGlobalClusterCommandError - */ -const de_FailoverGlobalClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "GlobalClusterNotFoundFault": - case "com.amazonaws.rds#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidGlobalClusterStateFault": - case "com.amazonaws.rds#InvalidGlobalClusterStateFault": - throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_TagListMessage(data.ListTagsForResourceResult, context); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BlueGreenDeploymentNotFoundFault": - case "com.amazonaws.rds#BlueGreenDeploymentNotFoundFault": - throw await de_BlueGreenDeploymentNotFoundFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBProxyNotFoundFault": - case "com.amazonaws.rds#DBProxyNotFoundFault": - throw await de_DBProxyNotFoundFaultRes(parsedOutput, context); - case "DBProxyTargetGroupNotFoundFault": - case "com.amazonaws.rds#DBProxyTargetGroupNotFoundFault": - throw await de_DBProxyTargetGroupNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotNotFound": - case "com.amazonaws.rds#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotTenantDatabaseNotFoundFault": - case "com.amazonaws.rds#DBSnapshotTenantDatabaseNotFoundFault": - throw await de_DBSnapshotTenantDatabaseNotFoundFaultRes(parsedOutput, context); - case "IntegrationNotFoundFault": - case "com.amazonaws.rds#IntegrationNotFoundFault": - throw await de_IntegrationNotFoundFaultRes(parsedOutput, context); - case "TenantDatabaseNotFound": - case "com.amazonaws.rds#TenantDatabaseNotFoundFault": - throw await de_TenantDatabaseNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyActivityStreamCommand - */ -export const de_ModifyActivityStreamCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyActivityStreamCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyActivityStreamResponse(data.ModifyActivityStreamResult, context); - const response: ModifyActivityStreamCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyActivityStreamCommandError - */ -const de_ModifyActivityStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.rds#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyCertificatesCommand - */ -export const de_ModifyCertificatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyCertificatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyCertificatesResult(data.ModifyCertificatesResult, context); - const response: ModifyCertificatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyCertificatesCommandError - */ -const de_ModifyCertificatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CertificateNotFound": - case "com.amazonaws.rds#CertificateNotFoundFault": - throw await de_CertificateNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyCurrentDBClusterCapacityCommand - */ -export const de_ModifyCurrentDBClusterCapacityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyCurrentDBClusterCapacityCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DBClusterCapacityInfo(data.ModifyCurrentDBClusterCapacityResult, context); - const response: ModifyCurrentDBClusterCapacityCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyCurrentDBClusterCapacityCommandError - */ -const de_ModifyCurrentDBClusterCapacityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterCapacityFault": - case "com.amazonaws.rds#InvalidDBClusterCapacityFault": - throw await de_InvalidDBClusterCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyCustomDBEngineVersionCommand - */ -export const de_ModifyCustomDBEngineVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyCustomDBEngineVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DBEngineVersion(data.ModifyCustomDBEngineVersionResult, context); - const response: ModifyCustomDBEngineVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyCustomDBEngineVersionCommandError - */ -const de_ModifyCustomDBEngineVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomDBEngineVersionNotFoundFault": - case "com.amazonaws.rds#CustomDBEngineVersionNotFoundFault": - throw await de_CustomDBEngineVersionNotFoundFaultRes(parsedOutput, context); - case "InvalidCustomDBEngineVersionStateFault": - case "com.amazonaws.rds#InvalidCustomDBEngineVersionStateFault": - throw await de_InvalidCustomDBEngineVersionStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBClusterCommand - */ -export const de_ModifyDBClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyDBClusterResult(data.ModifyDBClusterResult, context); - const response: ModifyDBClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBClusterCommandError - */ -const de_ModifyDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterAlreadyExistsFault": - case "com.amazonaws.rds#DBClusterAlreadyExistsFault": - throw await de_DBClusterAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterParameterGroupNotFound": - case "com.amazonaws.rds#DBClusterParameterGroupNotFoundFault": - throw await de_DBClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBInstanceAlreadyExists": - case "com.amazonaws.rds#DBInstanceAlreadyExistsFault": - throw await de_DBInstanceAlreadyExistsFaultRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.rds#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "DomainNotFoundFault": - case "com.amazonaws.rds#DomainNotFoundFault": - throw await de_DomainNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "InvalidDBSecurityGroupState": - case "com.amazonaws.rds#InvalidDBSecurityGroupStateFault": - throw await de_InvalidDBSecurityGroupStateFaultRes(parsedOutput, context); - case "InvalidDBSubnetGroupStateFault": - case "com.amazonaws.rds#InvalidDBSubnetGroupStateFault": - throw await de_InvalidDBSubnetGroupStateFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.rds#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.rds#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.rds#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.rds#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - case "StorageTypeNotAvailableFault": - case "com.amazonaws.rds#StorageTypeNotAvailableFault": - throw await de_StorageTypeNotAvailableFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBClusterEndpointCommand - */ -export const de_ModifyDBClusterEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBClusterEndpointCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DBClusterEndpoint(data.ModifyDBClusterEndpointResult, context); - const response: ModifyDBClusterEndpointCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBClusterEndpointCommandError - */ -const de_ModifyDBClusterEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterEndpointNotFoundFault": - case "com.amazonaws.rds#DBClusterEndpointNotFoundFault": - throw await de_DBClusterEndpointNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterEndpointStateFault": - case "com.amazonaws.rds#InvalidDBClusterEndpointStateFault": - throw await de_InvalidDBClusterEndpointStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBClusterParameterGroupCommand - */ -export const de_ModifyDBClusterParameterGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBClusterParameterGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DBClusterParameterGroupNameMessage(data.ModifyDBClusterParameterGroupResult, context); - const response: ModifyDBClusterParameterGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBClusterParameterGroupCommandError - */ -const de_ModifyDBClusterParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBParameterGroupState": - case "com.amazonaws.rds#InvalidDBParameterGroupStateFault": - throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBClusterSnapshotAttributeCommand - */ -export const de_ModifyDBClusterSnapshotAttributeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBClusterSnapshotAttributeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyDBClusterSnapshotAttributeResult(data.ModifyDBClusterSnapshotAttributeResult, context); - const response: ModifyDBClusterSnapshotAttributeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBClusterSnapshotAttributeCommandError - */ -const de_ModifyDBClusterSnapshotAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.rds#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.rds#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "SharedSnapshotQuotaExceeded": - case "com.amazonaws.rds#SharedSnapshotQuotaExceededFault": - throw await de_SharedSnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBInstanceCommand - */ -export const de_ModifyDBInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBInstanceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyDBInstanceResult(data.ModifyDBInstanceResult, context); - const response: ModifyDBInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBInstanceCommandError - */ -const de_ModifyDBInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationNotFound": - case "com.amazonaws.rds#AuthorizationNotFoundFault": - throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); - case "BackupPolicyNotFoundFault": - case "com.amazonaws.rds#BackupPolicyNotFoundFault": - throw await de_BackupPolicyNotFoundFaultRes(parsedOutput, context); - case "CertificateNotFound": - case "com.amazonaws.rds#CertificateNotFoundFault": - throw await de_CertificateNotFoundFaultRes(parsedOutput, context); - case "DBInstanceAlreadyExists": - case "com.amazonaws.rds#DBInstanceAlreadyExistsFault": - throw await de_DBInstanceAlreadyExistsFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBSecurityGroupNotFound": - case "com.amazonaws.rds#DBSecurityGroupNotFoundFault": - throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "DBUpgradeDependencyFailure": - case "com.amazonaws.rds#DBUpgradeDependencyFailureFault": - throw await de_DBUpgradeDependencyFailureFaultRes(parsedOutput, context); - case "DomainNotFoundFault": - case "com.amazonaws.rds#DomainNotFoundFault": - throw await de_DomainNotFoundFaultRes(parsedOutput, context); - case "InsufficientDBInstanceCapacity": - case "com.amazonaws.rds#InsufficientDBInstanceCapacityFault": - throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "InvalidDBSecurityGroupState": - case "com.amazonaws.rds#InvalidDBSecurityGroupStateFault": - throw await de_InvalidDBSecurityGroupStateFaultRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.rds#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "NetworkTypeNotSupported": - case "com.amazonaws.rds#NetworkTypeNotSupported": - throw await de_NetworkTypeNotSupportedRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.rds#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - case "ProvisionedIopsNotAvailableInAZFault": - case "com.amazonaws.rds#ProvisionedIopsNotAvailableInAZFault": - throw await de_ProvisionedIopsNotAvailableInAZFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.rds#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - case "StorageTypeNotSupported": - case "com.amazonaws.rds#StorageTypeNotSupportedFault": - throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); - case "TenantDatabaseQuotaExceeded": - case "com.amazonaws.rds#TenantDatabaseQuotaExceededFault": - throw await de_TenantDatabaseQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBParameterGroupCommand - */ -export const de_ModifyDBParameterGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBParameterGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DBParameterGroupNameMessage(data.ModifyDBParameterGroupResult, context); - const response: ModifyDBParameterGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBParameterGroupCommandError - */ -const de_ModifyDBParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBParameterGroupState": - case "com.amazonaws.rds#InvalidDBParameterGroupStateFault": - throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBProxyCommand - */ -export const de_ModifyDBProxyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBProxyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyDBProxyResponse(data.ModifyDBProxyResult, context); - const response: ModifyDBProxyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBProxyCommandError - */ -const de_ModifyDBProxyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBProxyAlreadyExistsFault": - case "com.amazonaws.rds#DBProxyAlreadyExistsFault": - throw await de_DBProxyAlreadyExistsFaultRes(parsedOutput, context); - case "DBProxyNotFoundFault": - case "com.amazonaws.rds#DBProxyNotFoundFault": - throw await de_DBProxyNotFoundFaultRes(parsedOutput, context); - case "InvalidDBProxyStateFault": - case "com.amazonaws.rds#InvalidDBProxyStateFault": - throw await de_InvalidDBProxyStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBProxyEndpointCommand - */ -export const de_ModifyDBProxyEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBProxyEndpointCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyDBProxyEndpointResponse(data.ModifyDBProxyEndpointResult, context); - const response: ModifyDBProxyEndpointCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBProxyEndpointCommandError - */ -const de_ModifyDBProxyEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBProxyEndpointAlreadyExistsFault": - case "com.amazonaws.rds#DBProxyEndpointAlreadyExistsFault": - throw await de_DBProxyEndpointAlreadyExistsFaultRes(parsedOutput, context); - case "DBProxyEndpointNotFoundFault": - case "com.amazonaws.rds#DBProxyEndpointNotFoundFault": - throw await de_DBProxyEndpointNotFoundFaultRes(parsedOutput, context); - case "InvalidDBProxyEndpointStateFault": - case "com.amazonaws.rds#InvalidDBProxyEndpointStateFault": - throw await de_InvalidDBProxyEndpointStateFaultRes(parsedOutput, context); - case "InvalidDBProxyStateFault": - case "com.amazonaws.rds#InvalidDBProxyStateFault": - throw await de_InvalidDBProxyStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBProxyTargetGroupCommand - */ -export const de_ModifyDBProxyTargetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBProxyTargetGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyDBProxyTargetGroupResponse(data.ModifyDBProxyTargetGroupResult, context); - const response: ModifyDBProxyTargetGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBProxyTargetGroupCommandError - */ -const de_ModifyDBProxyTargetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBProxyNotFoundFault": - case "com.amazonaws.rds#DBProxyNotFoundFault": - throw await de_DBProxyNotFoundFaultRes(parsedOutput, context); - case "DBProxyTargetGroupNotFoundFault": - case "com.amazonaws.rds#DBProxyTargetGroupNotFoundFault": - throw await de_DBProxyTargetGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBProxyStateFault": - case "com.amazonaws.rds#InvalidDBProxyStateFault": - throw await de_InvalidDBProxyStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBRecommendationCommand - */ -export const de_ModifyDBRecommendationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBRecommendationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DBRecommendationMessage(data.ModifyDBRecommendationResult, context); - const response: ModifyDBRecommendationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBRecommendationCommandError - */ -const de_ModifyDBRecommendationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryModifyDBShardGroupCommand - */ -export const de_ModifyDBShardGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBShardGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DBShardGroup(data.ModifyDBShardGroupResult, context); - const response: ModifyDBShardGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBShardGroupCommandError - */ -const de_ModifyDBShardGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBShardGroupAlreadyExists": - case "com.amazonaws.rds#DBShardGroupAlreadyExistsFault": - throw await de_DBShardGroupAlreadyExistsFaultRes(parsedOutput, context); - case "DBShardGroupNotFound": - case "com.amazonaws.rds#DBShardGroupNotFoundFault": - throw await de_DBShardGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidMaxAcu": - case "com.amazonaws.rds#InvalidMaxAcuFault": - throw await de_InvalidMaxAcuFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBSnapshotCommand - */ -export const de_ModifyDBSnapshotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBSnapshotCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyDBSnapshotResult(data.ModifyDBSnapshotResult, context); - const response: ModifyDBSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBSnapshotCommandError - */ -const de_ModifyDBSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSnapshotNotFound": - case "com.amazonaws.rds#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBSnapshotAttributeCommand - */ -export const de_ModifyDBSnapshotAttributeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBSnapshotAttributeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyDBSnapshotAttributeResult(data.ModifyDBSnapshotAttributeResult, context); - const response: ModifyDBSnapshotAttributeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBSnapshotAttributeCommandError - */ -const de_ModifyDBSnapshotAttributeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSnapshotNotFound": - case "com.amazonaws.rds#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidDBSnapshotState": - case "com.amazonaws.rds#InvalidDBSnapshotStateFault": - throw await de_InvalidDBSnapshotStateFaultRes(parsedOutput, context); - case "SharedSnapshotQuotaExceeded": - case "com.amazonaws.rds#SharedSnapshotQuotaExceededFault": - throw await de_SharedSnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyDBSubnetGroupCommand - */ -export const de_ModifyDBSubnetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDBSubnetGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyDBSubnetGroupResult(data.ModifyDBSubnetGroupResult, context); - const response: ModifyDBSubnetGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyDBSubnetGroupCommandError - */ -const de_ModifyDBSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.rds#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.rds#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "DBSubnetQuotaExceededFault": - case "com.amazonaws.rds#DBSubnetQuotaExceededFault": - throw await de_DBSubnetQuotaExceededFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.rds#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "SubnetAlreadyInUse": - case "com.amazonaws.rds#SubnetAlreadyInUse": - throw await de_SubnetAlreadyInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyEventSubscriptionCommand - */ -export const de_ModifyEventSubscriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyEventSubscriptionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyEventSubscriptionResult(data.ModifyEventSubscriptionResult, context); - const response: ModifyEventSubscriptionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyEventSubscriptionCommandError - */ -const de_ModifyEventSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EventSubscriptionQuotaExceeded": - case "com.amazonaws.rds#EventSubscriptionQuotaExceededFault": - throw await de_EventSubscriptionQuotaExceededFaultRes(parsedOutput, context); - case "SNSInvalidTopic": - case "com.amazonaws.rds#SNSInvalidTopicFault": - throw await de_SNSInvalidTopicFaultRes(parsedOutput, context); - case "SNSNoAuthorization": - case "com.amazonaws.rds#SNSNoAuthorizationFault": - throw await de_SNSNoAuthorizationFaultRes(parsedOutput, context); - case "SNSTopicArnNotFound": - case "com.amazonaws.rds#SNSTopicArnNotFoundFault": - throw await de_SNSTopicArnNotFoundFaultRes(parsedOutput, context); - case "SubscriptionCategoryNotFound": - case "com.amazonaws.rds#SubscriptionCategoryNotFoundFault": - throw await de_SubscriptionCategoryNotFoundFaultRes(parsedOutput, context); - case "SubscriptionNotFound": - case "com.amazonaws.rds#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyGlobalClusterCommand - */ -export const de_ModifyGlobalClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyGlobalClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyGlobalClusterResult(data.ModifyGlobalClusterResult, context); - const response: ModifyGlobalClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyGlobalClusterCommandError - */ -const de_ModifyGlobalClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "GlobalClusterNotFoundFault": - case "com.amazonaws.rds#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "InvalidGlobalClusterStateFault": - case "com.amazonaws.rds#InvalidGlobalClusterStateFault": - throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyOptionGroupCommand - */ -export const de_ModifyOptionGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyOptionGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyOptionGroupResult(data.ModifyOptionGroupResult, context); - const response: ModifyOptionGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyOptionGroupCommandError - */ -const de_ModifyOptionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidOptionGroupStateFault": - case "com.amazonaws.rds#InvalidOptionGroupStateFault": - throw await de_InvalidOptionGroupStateFaultRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.rds#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyTenantDatabaseCommand - */ -export const de_ModifyTenantDatabaseCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyTenantDatabaseCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyTenantDatabaseResult(data.ModifyTenantDatabaseResult, context); - const response: ModifyTenantDatabaseCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyTenantDatabaseCommandError - */ -const de_ModifyTenantDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "TenantDatabaseAlreadyExists": - case "com.amazonaws.rds#TenantDatabaseAlreadyExistsFault": - throw await de_TenantDatabaseAlreadyExistsFaultRes(parsedOutput, context); - case "TenantDatabaseNotFound": - case "com.amazonaws.rds#TenantDatabaseNotFoundFault": - throw await de_TenantDatabaseNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPromoteReadReplicaCommand - */ -export const de_PromoteReadReplicaCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PromoteReadReplicaCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PromoteReadReplicaResult(data.PromoteReadReplicaResult, context); - const response: PromoteReadReplicaCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryPromoteReadReplicaCommandError - */ -const de_PromoteReadReplicaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPromoteReadReplicaDBClusterCommand - */ -export const de_PromoteReadReplicaDBClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PromoteReadReplicaDBClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PromoteReadReplicaDBClusterResult(data.PromoteReadReplicaDBClusterResult, context); - const response: PromoteReadReplicaDBClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryPromoteReadReplicaDBClusterCommandError - */ -const de_PromoteReadReplicaDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPurchaseReservedDBInstancesOfferingCommand - */ -export const de_PurchaseReservedDBInstancesOfferingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PurchaseReservedDBInstancesOfferingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PurchaseReservedDBInstancesOfferingResult(data.PurchaseReservedDBInstancesOfferingResult, context); - const response: PurchaseReservedDBInstancesOfferingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryPurchaseReservedDBInstancesOfferingCommandError - */ -const de_PurchaseReservedDBInstancesOfferingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ReservedDBInstanceAlreadyExists": - case "com.amazonaws.rds#ReservedDBInstanceAlreadyExistsFault": - throw await de_ReservedDBInstanceAlreadyExistsFaultRes(parsedOutput, context); - case "ReservedDBInstanceQuotaExceeded": - case "com.amazonaws.rds#ReservedDBInstanceQuotaExceededFault": - throw await de_ReservedDBInstanceQuotaExceededFaultRes(parsedOutput, context); - case "ReservedDBInstancesOfferingNotFound": - case "com.amazonaws.rds#ReservedDBInstancesOfferingNotFoundFault": - throw await de_ReservedDBInstancesOfferingNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRebootDBClusterCommand - */ -export const de_RebootDBClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RebootDBClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RebootDBClusterResult(data.RebootDBClusterResult, context); - const response: RebootDBClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRebootDBClusterCommandError - */ -const de_RebootDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRebootDBInstanceCommand - */ -export const de_RebootDBInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RebootDBInstanceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RebootDBInstanceResult(data.RebootDBInstanceResult, context); - const response: RebootDBInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRebootDBInstanceCommandError - */ -const de_RebootDBInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRebootDBShardGroupCommand - */ -export const de_RebootDBShardGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RebootDBShardGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DBShardGroup(data.RebootDBShardGroupResult, context); - const response: RebootDBShardGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRebootDBShardGroupCommandError - */ -const de_RebootDBShardGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBShardGroupNotFound": - case "com.amazonaws.rds#DBShardGroupNotFoundFault": - throw await de_DBShardGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBShardGroupState": - case "com.amazonaws.rds#InvalidDBShardGroupStateFault": - throw await de_InvalidDBShardGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRegisterDBProxyTargetsCommand - */ -export const de_RegisterDBProxyTargetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RegisterDBProxyTargetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RegisterDBProxyTargetsResponse(data.RegisterDBProxyTargetsResult, context); - const response: RegisterDBProxyTargetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRegisterDBProxyTargetsCommandError - */ -const de_RegisterDBProxyTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBProxyNotFoundFault": - case "com.amazonaws.rds#DBProxyNotFoundFault": - throw await de_DBProxyNotFoundFaultRes(parsedOutput, context); - case "DBProxyTargetAlreadyRegisteredFault": - case "com.amazonaws.rds#DBProxyTargetAlreadyRegisteredFault": - throw await de_DBProxyTargetAlreadyRegisteredFaultRes(parsedOutput, context); - case "DBProxyTargetGroupNotFoundFault": - case "com.amazonaws.rds#DBProxyTargetGroupNotFoundFault": - throw await de_DBProxyTargetGroupNotFoundFaultRes(parsedOutput, context); - case "InsufficientAvailableIPsInSubnetFault": - case "com.amazonaws.rds#InsufficientAvailableIPsInSubnetFault": - throw await de_InsufficientAvailableIPsInSubnetFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "InvalidDBProxyStateFault": - case "com.amazonaws.rds#InvalidDBProxyStateFault": - throw await de_InvalidDBProxyStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRemoveFromGlobalClusterCommand - */ -export const de_RemoveFromGlobalClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveFromGlobalClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RemoveFromGlobalClusterResult(data.RemoveFromGlobalClusterResult, context); - const response: RemoveFromGlobalClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRemoveFromGlobalClusterCommandError - */ -const de_RemoveFromGlobalClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "GlobalClusterNotFoundFault": - case "com.amazonaws.rds#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidGlobalClusterStateFault": - case "com.amazonaws.rds#InvalidGlobalClusterStateFault": - throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRemoveRoleFromDBClusterCommand - */ -export const de_RemoveRoleFromDBClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveRoleFromDBClusterCommandError(output, context); - } - await collectBody(output.body, context); - const response: RemoveRoleFromDBClusterCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryRemoveRoleFromDBClusterCommandError - */ -const de_RemoveRoleFromDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterRoleNotFound": - case "com.amazonaws.rds#DBClusterRoleNotFoundFault": - throw await de_DBClusterRoleNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRemoveRoleFromDBInstanceCommand - */ -export const de_RemoveRoleFromDBInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveRoleFromDBInstanceCommandError(output, context); - } - await collectBody(output.body, context); - const response: RemoveRoleFromDBInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryRemoveRoleFromDBInstanceCommandError - */ -const de_RemoveRoleFromDBInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBInstanceRoleNotFound": - case "com.amazonaws.rds#DBInstanceRoleNotFoundFault": - throw await de_DBInstanceRoleNotFoundFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRemoveSourceIdentifierFromSubscriptionCommand - */ -export const de_RemoveSourceIdentifierFromSubscriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveSourceIdentifierFromSubscriptionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RemoveSourceIdentifierFromSubscriptionResult( - data.RemoveSourceIdentifierFromSubscriptionResult, - context - ); - const response: RemoveSourceIdentifierFromSubscriptionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRemoveSourceIdentifierFromSubscriptionCommandError - */ -const de_RemoveSourceIdentifierFromSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "SourceNotFound": - case "com.amazonaws.rds#SourceNotFoundFault": - throw await de_SourceNotFoundFaultRes(parsedOutput, context); - case "SubscriptionNotFound": - case "com.amazonaws.rds#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRemoveTagsFromResourceCommand - */ -export const de_RemoveTagsFromResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveTagsFromResourceCommandError(output, context); - } - await collectBody(output.body, context); - const response: RemoveTagsFromResourceCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryRemoveTagsFromResourceCommandError - */ -const de_RemoveTagsFromResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BlueGreenDeploymentNotFoundFault": - case "com.amazonaws.rds#BlueGreenDeploymentNotFoundFault": - throw await de_BlueGreenDeploymentNotFoundFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBProxyNotFoundFault": - case "com.amazonaws.rds#DBProxyNotFoundFault": - throw await de_DBProxyNotFoundFaultRes(parsedOutput, context); - case "DBProxyTargetGroupNotFoundFault": - case "com.amazonaws.rds#DBProxyTargetGroupNotFoundFault": - throw await de_DBProxyTargetGroupNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotNotFound": - case "com.amazonaws.rds#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotTenantDatabaseNotFoundFault": - case "com.amazonaws.rds#DBSnapshotTenantDatabaseNotFoundFault": - throw await de_DBSnapshotTenantDatabaseNotFoundFaultRes(parsedOutput, context); - case "IntegrationNotFoundFault": - case "com.amazonaws.rds#IntegrationNotFoundFault": - throw await de_IntegrationNotFoundFaultRes(parsedOutput, context); - case "TenantDatabaseNotFound": - case "com.amazonaws.rds#TenantDatabaseNotFoundFault": - throw await de_TenantDatabaseNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryResetDBClusterParameterGroupCommand - */ -export const de_ResetDBClusterParameterGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ResetDBClusterParameterGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DBClusterParameterGroupNameMessage(data.ResetDBClusterParameterGroupResult, context); - const response: ResetDBClusterParameterGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryResetDBClusterParameterGroupCommandError - */ -const de_ResetDBClusterParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBParameterGroupState": - case "com.amazonaws.rds#InvalidDBParameterGroupStateFault": - throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryResetDBParameterGroupCommand - */ -export const de_ResetDBParameterGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ResetDBParameterGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DBParameterGroupNameMessage(data.ResetDBParameterGroupResult, context); - const response: ResetDBParameterGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryResetDBParameterGroupCommandError - */ -const de_ResetDBParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBParameterGroupState": - case "com.amazonaws.rds#InvalidDBParameterGroupStateFault": - throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRestoreDBClusterFromS3Command - */ -export const de_RestoreDBClusterFromS3Command = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RestoreDBClusterFromS3CommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RestoreDBClusterFromS3Result(data.RestoreDBClusterFromS3Result, context); - const response: RestoreDBClusterFromS3CommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRestoreDBClusterFromS3CommandError - */ -const de_RestoreDBClusterFromS3CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterAlreadyExistsFault": - case "com.amazonaws.rds#DBClusterAlreadyExistsFault": - throw await de_DBClusterAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterParameterGroupNotFound": - case "com.amazonaws.rds#DBClusterParameterGroupNotFoundFault": - throw await de_DBClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBClusterQuotaExceededFault": - case "com.amazonaws.rds#DBClusterQuotaExceededFault": - throw await de_DBClusterQuotaExceededFaultRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.rds#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "DomainNotFoundFault": - case "com.amazonaws.rds#DomainNotFoundFault": - throw await de_DomainNotFoundFaultRes(parsedOutput, context); - case "InsufficientStorageClusterCapacity": - case "com.amazonaws.rds#InsufficientStorageClusterCapacityFault": - throw await de_InsufficientStorageClusterCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBSubnetGroupStateFault": - case "com.amazonaws.rds#InvalidDBSubnetGroupStateFault": - throw await de_InvalidDBSubnetGroupStateFaultRes(parsedOutput, context); - case "InvalidS3BucketFault": - case "com.amazonaws.rds#InvalidS3BucketFault": - throw await de_InvalidS3BucketFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.rds#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.rds#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.rds#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - case "StorageTypeNotSupported": - case "com.amazonaws.rds#StorageTypeNotSupportedFault": - throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRestoreDBClusterFromSnapshotCommand - */ -export const de_RestoreDBClusterFromSnapshotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RestoreDBClusterFromSnapshotCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RestoreDBClusterFromSnapshotResult(data.RestoreDBClusterFromSnapshotResult, context); - const response: RestoreDBClusterFromSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRestoreDBClusterFromSnapshotCommandError - */ -const de_RestoreDBClusterFromSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterAlreadyExistsFault": - case "com.amazonaws.rds#DBClusterAlreadyExistsFault": - throw await de_DBClusterAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterParameterGroupNotFound": - case "com.amazonaws.rds#DBClusterParameterGroupNotFoundFault": - throw await de_DBClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBClusterQuotaExceededFault": - case "com.amazonaws.rds#DBClusterQuotaExceededFault": - throw await de_DBClusterQuotaExceededFaultRes(parsedOutput, context); - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.rds#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotNotFound": - case "com.amazonaws.rds#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.rds#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.rds#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "DomainNotFoundFault": - case "com.amazonaws.rds#DomainNotFoundFault": - throw await de_DomainNotFoundFaultRes(parsedOutput, context); - case "InsufficientDBClusterCapacityFault": - case "com.amazonaws.rds#InsufficientDBClusterCapacityFault": - throw await de_InsufficientDBClusterCapacityFaultRes(parsedOutput, context); - case "InsufficientDBInstanceCapacity": - case "com.amazonaws.rds#InsufficientDBInstanceCapacityFault": - throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); - case "InsufficientStorageClusterCapacity": - case "com.amazonaws.rds#InsufficientStorageClusterCapacityFault": - throw await de_InsufficientStorageClusterCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.rds#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "InvalidDBSnapshotState": - case "com.amazonaws.rds#InvalidDBSnapshotStateFault": - throw await de_InvalidDBSnapshotStateFaultRes(parsedOutput, context); - case "InvalidRestoreFault": - case "com.amazonaws.rds#InvalidRestoreFault": - throw await de_InvalidRestoreFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.rds#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.rds#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.rds#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.rds#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRestoreDBClusterToPointInTimeCommand - */ -export const de_RestoreDBClusterToPointInTimeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RestoreDBClusterToPointInTimeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RestoreDBClusterToPointInTimeResult(data.RestoreDBClusterToPointInTimeResult, context); - const response: RestoreDBClusterToPointInTimeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRestoreDBClusterToPointInTimeCommandError - */ -const de_RestoreDBClusterToPointInTimeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterAlreadyExistsFault": - case "com.amazonaws.rds#DBClusterAlreadyExistsFault": - throw await de_DBClusterAlreadyExistsFaultRes(parsedOutput, context); - case "DBClusterAutomatedBackupNotFoundFault": - case "com.amazonaws.rds#DBClusterAutomatedBackupNotFoundFault": - throw await de_DBClusterAutomatedBackupNotFoundFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterParameterGroupNotFound": - case "com.amazonaws.rds#DBClusterParameterGroupNotFoundFault": - throw await de_DBClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBClusterQuotaExceededFault": - case "com.amazonaws.rds#DBClusterQuotaExceededFault": - throw await de_DBClusterQuotaExceededFaultRes(parsedOutput, context); - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.rds#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.rds#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "DomainNotFoundFault": - case "com.amazonaws.rds#DomainNotFoundFault": - throw await de_DomainNotFoundFaultRes(parsedOutput, context); - case "InsufficientDBClusterCapacityFault": - case "com.amazonaws.rds#InsufficientDBClusterCapacityFault": - throw await de_InsufficientDBClusterCapacityFaultRes(parsedOutput, context); - case "InsufficientDBInstanceCapacity": - case "com.amazonaws.rds#InsufficientDBInstanceCapacityFault": - throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); - case "InsufficientStorageClusterCapacity": - case "com.amazonaws.rds#InsufficientStorageClusterCapacityFault": - throw await de_InsufficientStorageClusterCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterSnapshotStateFault": - case "com.amazonaws.rds#InvalidDBClusterSnapshotStateFault": - throw await de_InvalidDBClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBSnapshotState": - case "com.amazonaws.rds#InvalidDBSnapshotStateFault": - throw await de_InvalidDBSnapshotStateFaultRes(parsedOutput, context); - case "InvalidRestoreFault": - case "com.amazonaws.rds#InvalidRestoreFault": - throw await de_InvalidRestoreFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.rds#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.rds#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.rds#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.rds#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRestoreDBInstanceFromDBSnapshotCommand - */ -export const de_RestoreDBInstanceFromDBSnapshotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RestoreDBInstanceFromDBSnapshotCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RestoreDBInstanceFromDBSnapshotResult(data.RestoreDBInstanceFromDBSnapshotResult, context); - const response: RestoreDBInstanceFromDBSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRestoreDBInstanceFromDBSnapshotCommandError - */ -const de_RestoreDBInstanceFromDBSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationNotFound": - case "com.amazonaws.rds#AuthorizationNotFoundFault": - throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); - case "BackupPolicyNotFoundFault": - case "com.amazonaws.rds#BackupPolicyNotFoundFault": - throw await de_BackupPolicyNotFoundFaultRes(parsedOutput, context); - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.rds#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "DBInstanceAlreadyExists": - case "com.amazonaws.rds#DBInstanceAlreadyExistsFault": - throw await de_DBInstanceAlreadyExistsFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBSecurityGroupNotFound": - case "com.amazonaws.rds#DBSecurityGroupNotFoundFault": - throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotNotFound": - case "com.amazonaws.rds#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.rds#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.rds#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "DomainNotFoundFault": - case "com.amazonaws.rds#DomainNotFoundFault": - throw await de_DomainNotFoundFaultRes(parsedOutput, context); - case "InstanceQuotaExceeded": - case "com.amazonaws.rds#InstanceQuotaExceededFault": - throw await de_InstanceQuotaExceededFaultRes(parsedOutput, context); - case "InsufficientDBInstanceCapacity": - case "com.amazonaws.rds#InsufficientDBInstanceCapacityFault": - throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); - case "InvalidDBSnapshotState": - case "com.amazonaws.rds#InvalidDBSnapshotStateFault": - throw await de_InvalidDBSnapshotStateFaultRes(parsedOutput, context); - case "InvalidRestoreFault": - case "com.amazonaws.rds#InvalidRestoreFault": - throw await de_InvalidRestoreFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.rds#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.rds#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "NetworkTypeNotSupported": - case "com.amazonaws.rds#NetworkTypeNotSupported": - throw await de_NetworkTypeNotSupportedRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.rds#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - case "ProvisionedIopsNotAvailableInAZFault": - case "com.amazonaws.rds#ProvisionedIopsNotAvailableInAZFault": - throw await de_ProvisionedIopsNotAvailableInAZFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.rds#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - case "StorageTypeNotSupported": - case "com.amazonaws.rds#StorageTypeNotSupportedFault": - throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); - case "TenantDatabaseQuotaExceeded": - case "com.amazonaws.rds#TenantDatabaseQuotaExceededFault": - throw await de_TenantDatabaseQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRestoreDBInstanceFromS3Command - */ -export const de_RestoreDBInstanceFromS3Command = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RestoreDBInstanceFromS3CommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RestoreDBInstanceFromS3Result(data.RestoreDBInstanceFromS3Result, context); - const response: RestoreDBInstanceFromS3CommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRestoreDBInstanceFromS3CommandError - */ -const de_RestoreDBInstanceFromS3CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationNotFound": - case "com.amazonaws.rds#AuthorizationNotFoundFault": - throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); - case "BackupPolicyNotFoundFault": - case "com.amazonaws.rds#BackupPolicyNotFoundFault": - throw await de_BackupPolicyNotFoundFaultRes(parsedOutput, context); - case "DBInstanceAlreadyExists": - case "com.amazonaws.rds#DBInstanceAlreadyExistsFault": - throw await de_DBInstanceAlreadyExistsFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBSecurityGroupNotFound": - case "com.amazonaws.rds#DBSecurityGroupNotFoundFault": - throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.rds#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.rds#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InstanceQuotaExceeded": - case "com.amazonaws.rds#InstanceQuotaExceededFault": - throw await de_InstanceQuotaExceededFaultRes(parsedOutput, context); - case "InsufficientDBInstanceCapacity": - case "com.amazonaws.rds#InsufficientDBInstanceCapacityFault": - throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); - case "InvalidS3BucketFault": - case "com.amazonaws.rds#InvalidS3BucketFault": - throw await de_InvalidS3BucketFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.rds#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.rds#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "NetworkTypeNotSupported": - case "com.amazonaws.rds#NetworkTypeNotSupported": - throw await de_NetworkTypeNotSupportedRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.rds#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - case "ProvisionedIopsNotAvailableInAZFault": - case "com.amazonaws.rds#ProvisionedIopsNotAvailableInAZFault": - throw await de_ProvisionedIopsNotAvailableInAZFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.rds#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - case "StorageTypeNotSupported": - case "com.amazonaws.rds#StorageTypeNotSupportedFault": - throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRestoreDBInstanceToPointInTimeCommand - */ -export const de_RestoreDBInstanceToPointInTimeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RestoreDBInstanceToPointInTimeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RestoreDBInstanceToPointInTimeResult(data.RestoreDBInstanceToPointInTimeResult, context); - const response: RestoreDBInstanceToPointInTimeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRestoreDBInstanceToPointInTimeCommandError - */ -const de_RestoreDBInstanceToPointInTimeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationNotFound": - case "com.amazonaws.rds#AuthorizationNotFoundFault": - throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); - case "BackupPolicyNotFoundFault": - case "com.amazonaws.rds#BackupPolicyNotFoundFault": - throw await de_BackupPolicyNotFoundFaultRes(parsedOutput, context); - case "DBInstanceAlreadyExists": - case "com.amazonaws.rds#DBInstanceAlreadyExistsFault": - throw await de_DBInstanceAlreadyExistsFaultRes(parsedOutput, context); - case "DBInstanceAutomatedBackupNotFound": - case "com.amazonaws.rds#DBInstanceAutomatedBackupNotFoundFault": - throw await de_DBInstanceAutomatedBackupNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBParameterGroupNotFound": - case "com.amazonaws.rds#DBParameterGroupNotFoundFault": - throw await de_DBParameterGroupNotFoundFaultRes(parsedOutput, context); - case "DBSecurityGroupNotFound": - case "com.amazonaws.rds#DBSecurityGroupNotFoundFault": - throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.rds#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.rds#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "DomainNotFoundFault": - case "com.amazonaws.rds#DomainNotFoundFault": - throw await de_DomainNotFoundFaultRes(parsedOutput, context); - case "InstanceQuotaExceeded": - case "com.amazonaws.rds#InstanceQuotaExceededFault": - throw await de_InstanceQuotaExceededFaultRes(parsedOutput, context); - case "InsufficientDBInstanceCapacity": - case "com.amazonaws.rds#InsufficientDBInstanceCapacityFault": - throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "InvalidRestoreFault": - case "com.amazonaws.rds#InvalidRestoreFault": - throw await de_InvalidRestoreFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.rds#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.rds#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "NetworkTypeNotSupported": - case "com.amazonaws.rds#NetworkTypeNotSupported": - throw await de_NetworkTypeNotSupportedRes(parsedOutput, context); - case "OptionGroupNotFoundFault": - case "com.amazonaws.rds#OptionGroupNotFoundFault": - throw await de_OptionGroupNotFoundFaultRes(parsedOutput, context); - case "PointInTimeRestoreNotEnabled": - case "com.amazonaws.rds#PointInTimeRestoreNotEnabledFault": - throw await de_PointInTimeRestoreNotEnabledFaultRes(parsedOutput, context); - case "ProvisionedIopsNotAvailableInAZFault": - case "com.amazonaws.rds#ProvisionedIopsNotAvailableInAZFault": - throw await de_ProvisionedIopsNotAvailableInAZFaultRes(parsedOutput, context); - case "StorageQuotaExceeded": - case "com.amazonaws.rds#StorageQuotaExceededFault": - throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); - case "StorageTypeNotSupported": - case "com.amazonaws.rds#StorageTypeNotSupportedFault": - throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); - case "TenantDatabaseQuotaExceeded": - case "com.amazonaws.rds#TenantDatabaseQuotaExceededFault": - throw await de_TenantDatabaseQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRevokeDBSecurityGroupIngressCommand - */ -export const de_RevokeDBSecurityGroupIngressCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RevokeDBSecurityGroupIngressCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RevokeDBSecurityGroupIngressResult(data.RevokeDBSecurityGroupIngressResult, context); - const response: RevokeDBSecurityGroupIngressCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRevokeDBSecurityGroupIngressCommandError - */ -const de_RevokeDBSecurityGroupIngressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationNotFound": - case "com.amazonaws.rds#AuthorizationNotFoundFault": - throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); - case "DBSecurityGroupNotFound": - case "com.amazonaws.rds#DBSecurityGroupNotFoundFault": - throw await de_DBSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidDBSecurityGroupState": - case "com.amazonaws.rds#InvalidDBSecurityGroupStateFault": - throw await de_InvalidDBSecurityGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryStartActivityStreamCommand - */ -export const de_StartActivityStreamCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartActivityStreamCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_StartActivityStreamResponse(data.StartActivityStreamResult, context); - const response: StartActivityStreamCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryStartActivityStreamCommandError - */ -const de_StartActivityStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.rds#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryStartDBClusterCommand - */ -export const de_StartDBClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartDBClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_StartDBClusterResult(data.StartDBClusterResult, context); - const response: StartDBClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryStartDBClusterCommandError - */ -const de_StartDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryStartDBInstanceCommand - */ -export const de_StartDBInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartDBInstanceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_StartDBInstanceResult(data.StartDBInstanceResult, context); - const response: StartDBInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryStartDBInstanceCommandError - */ -const de_StartDBInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationNotFound": - case "com.amazonaws.rds#AuthorizationNotFoundFault": - throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBSubnetGroupDoesNotCoverEnoughAZs": - case "com.amazonaws.rds#DBSubnetGroupDoesNotCoverEnoughAZs": - throw await de_DBSubnetGroupDoesNotCoverEnoughAZsRes(parsedOutput, context); - case "DBSubnetGroupNotFoundFault": - case "com.amazonaws.rds#DBSubnetGroupNotFoundFault": - throw await de_DBSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InsufficientDBInstanceCapacity": - case "com.amazonaws.rds#InsufficientDBInstanceCapacityFault": - throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.rds#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.rds#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryStartDBInstanceAutomatedBackupsReplicationCommand - */ -export const de_StartDBInstanceAutomatedBackupsReplicationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartDBInstanceAutomatedBackupsReplicationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_StartDBInstanceAutomatedBackupsReplicationResult( - data.StartDBInstanceAutomatedBackupsReplicationResult, - context - ); - const response: StartDBInstanceAutomatedBackupsReplicationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryStartDBInstanceAutomatedBackupsReplicationCommandError - */ -const de_StartDBInstanceAutomatedBackupsReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceAutomatedBackupQuotaExceeded": - case "com.amazonaws.rds#DBInstanceAutomatedBackupQuotaExceededFault": - throw await de_DBInstanceAutomatedBackupQuotaExceededFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - case "StorageTypeNotSupported": - case "com.amazonaws.rds#StorageTypeNotSupportedFault": - throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryStartExportTaskCommand - */ -export const de_StartExportTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartExportTaskCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ExportTask(data.StartExportTaskResult, context); - const response: StartExportTaskCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryStartExportTaskCommandError - */ -const de_StartExportTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBClusterSnapshotNotFoundFault": - case "com.amazonaws.rds#DBClusterSnapshotNotFoundFault": - throw await de_DBClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotNotFound": - case "com.amazonaws.rds#DBSnapshotNotFoundFault": - throw await de_DBSnapshotNotFoundFaultRes(parsedOutput, context); - case "ExportTaskAlreadyExists": - case "com.amazonaws.rds#ExportTaskAlreadyExistsFault": - throw await de_ExportTaskAlreadyExistsFaultRes(parsedOutput, context); - case "IamRoleMissingPermissions": - case "com.amazonaws.rds#IamRoleMissingPermissionsFault": - throw await de_IamRoleMissingPermissionsFaultRes(parsedOutput, context); - case "IamRoleNotFound": - case "com.amazonaws.rds#IamRoleNotFoundFault": - throw await de_IamRoleNotFoundFaultRes(parsedOutput, context); - case "InvalidExportOnly": - case "com.amazonaws.rds#InvalidExportOnlyFault": - throw await de_InvalidExportOnlyFaultRes(parsedOutput, context); - case "InvalidExportSourceState": - case "com.amazonaws.rds#InvalidExportSourceStateFault": - throw await de_InvalidExportSourceStateFaultRes(parsedOutput, context); - case "InvalidS3BucketFault": - case "com.amazonaws.rds#InvalidS3BucketFault": - throw await de_InvalidS3BucketFaultRes(parsedOutput, context); - case "KMSKeyNotAccessibleFault": - case "com.amazonaws.rds#KMSKeyNotAccessibleFault": - throw await de_KMSKeyNotAccessibleFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryStopActivityStreamCommand - */ -export const de_StopActivityStreamCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StopActivityStreamCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_StopActivityStreamResponse(data.StopActivityStreamResult, context); - const response: StopActivityStreamCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryStopActivityStreamCommandError - */ -const de_StopActivityStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.rds#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryStopDBClusterCommand - */ -export const de_StopDBClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StopDBClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_StopDBClusterResult(data.StopDBClusterResult, context); - const response: StopDBClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryStopDBClusterCommandError - */ -const de_StopDBClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryStopDBInstanceCommand - */ -export const de_StopDBInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StopDBInstanceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_StopDBInstanceResult(data.StopDBInstanceResult, context); - const response: StopDBInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryStopDBInstanceCommandError - */ -const de_StopDBInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "DBSnapshotAlreadyExists": - case "com.amazonaws.rds#DBSnapshotAlreadyExistsFault": - throw await de_DBSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - case "SnapshotQuotaExceeded": - case "com.amazonaws.rds#SnapshotQuotaExceededFault": - throw await de_SnapshotQuotaExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryStopDBInstanceAutomatedBackupsReplicationCommand - */ -export const de_StopDBInstanceAutomatedBackupsReplicationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StopDBInstanceAutomatedBackupsReplicationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_StopDBInstanceAutomatedBackupsReplicationResult( - data.StopDBInstanceAutomatedBackupsReplicationResult, - context - ); - const response: StopDBInstanceAutomatedBackupsReplicationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryStopDBInstanceAutomatedBackupsReplicationCommandError - */ -const de_StopDBInstanceAutomatedBackupsReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_querySwitchoverBlueGreenDeploymentCommand - */ -export const de_SwitchoverBlueGreenDeploymentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SwitchoverBlueGreenDeploymentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SwitchoverBlueGreenDeploymentResponse(data.SwitchoverBlueGreenDeploymentResult, context); - const response: SwitchoverBlueGreenDeploymentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_querySwitchoverBlueGreenDeploymentCommandError - */ -const de_SwitchoverBlueGreenDeploymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BlueGreenDeploymentNotFoundFault": - case "com.amazonaws.rds#BlueGreenDeploymentNotFoundFault": - throw await de_BlueGreenDeploymentNotFoundFaultRes(parsedOutput, context); + case "InsufficientDBInstanceCapacity": + case "com.amazonaws.rds#InsufficientDBInstanceCapacityFault": + throw await de_InsufficientDBInstanceCapacityFaultRes(parsedOutput, context); + case "InsufficientStorageClusterCapacity": + case "com.amazonaws.rds#InsufficientStorageClusterCapacityFault": + throw await de_InsufficientStorageClusterCapacityFaultRes(parsedOutput, context); + case "InvalidDBSubnetGroupFault": + case "com.amazonaws.rds#InvalidDBSubnetGroupFault": + throw await de_InvalidDBSubnetGroupFaultRes(parsedOutput, context); + case "InvalidDBSubnetGroupStateFault": + case "com.amazonaws.rds#InvalidDBSubnetGroupStateFault": + throw await de_InvalidDBSubnetGroupStateFaultRes(parsedOutput, context); + case "InvalidGlobalClusterStateFault": + case "com.amazonaws.rds#InvalidGlobalClusterStateFault": + throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); + case "InvalidSubnet": + case "com.amazonaws.rds#InvalidSubnet": + throw await de_InvalidSubnetRes(parsedOutput, context); + case "InvalidVPCNetworkStateFault": + case "com.amazonaws.rds#InvalidVPCNetworkStateFault": + throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); + case "StorageQuotaExceeded": + case "com.amazonaws.rds#StorageQuotaExceededFault": + throw await de_StorageQuotaExceededFaultRes(parsedOutput, context); + case "DBClusterEndpointAlreadyExistsFault": + case "com.amazonaws.rds#DBClusterEndpointAlreadyExistsFault": + throw await de_DBClusterEndpointAlreadyExistsFaultRes(parsedOutput, context); + case "DBClusterEndpointQuotaExceededFault": + case "com.amazonaws.rds#DBClusterEndpointQuotaExceededFault": + throw await de_DBClusterEndpointQuotaExceededFaultRes(parsedOutput, context); + case "AuthorizationNotFound": + case "com.amazonaws.rds#AuthorizationNotFoundFault": + throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); + case "BackupPolicyNotFoundFault": + case "com.amazonaws.rds#BackupPolicyNotFoundFault": + throw await de_BackupPolicyNotFoundFaultRes(parsedOutput, context); + case "CertificateNotFound": + case "com.amazonaws.rds#CertificateNotFoundFault": + throw await de_CertificateNotFoundFaultRes(parsedOutput, context); + case "DBInstanceAlreadyExists": + case "com.amazonaws.rds#DBInstanceAlreadyExistsFault": + throw await de_DBInstanceAlreadyExistsFaultRes(parsedOutput, context); + case "NetworkTypeNotSupported": + case "com.amazonaws.rds#NetworkTypeNotSupported": + throw await de_NetworkTypeNotSupportedRes(parsedOutput, context); + case "ProvisionedIopsNotAvailableInAZFault": + case "com.amazonaws.rds#ProvisionedIopsNotAvailableInAZFault": + throw await de_ProvisionedIopsNotAvailableInAZFaultRes(parsedOutput, context); + case "StorageTypeNotSupported": + case "com.amazonaws.rds#StorageTypeNotSupportedFault": + throw await de_StorageTypeNotSupportedFaultRes(parsedOutput, context); + case "TenantDatabaseQuotaExceeded": + case "com.amazonaws.rds#TenantDatabaseQuotaExceededFault": + throw await de_TenantDatabaseQuotaExceededFaultRes(parsedOutput, context); + case "DBSubnetGroupNotAllowedFault": + case "com.amazonaws.rds#DBSubnetGroupNotAllowedFault": + throw await de_DBSubnetGroupNotAllowedFaultRes(parsedOutput, context); + case "DBProxyAlreadyExistsFault": + case "com.amazonaws.rds#DBProxyAlreadyExistsFault": + throw await de_DBProxyAlreadyExistsFaultRes(parsedOutput, context); + case "DBProxyQuotaExceededFault": + case "com.amazonaws.rds#DBProxyQuotaExceededFault": + throw await de_DBProxyQuotaExceededFaultRes(parsedOutput, context); + case "DBProxyEndpointAlreadyExistsFault": + case "com.amazonaws.rds#DBProxyEndpointAlreadyExistsFault": + throw await de_DBProxyEndpointAlreadyExistsFaultRes(parsedOutput, context); + case "DBProxyEndpointQuotaExceededFault": + case "com.amazonaws.rds#DBProxyEndpointQuotaExceededFault": + throw await de_DBProxyEndpointQuotaExceededFaultRes(parsedOutput, context); + case "InvalidDBProxyStateFault": + case "com.amazonaws.rds#InvalidDBProxyStateFault": + throw await de_InvalidDBProxyStateFaultRes(parsedOutput, context); + case "DBSecurityGroupAlreadyExists": + case "com.amazonaws.rds#DBSecurityGroupAlreadyExistsFault": + throw await de_DBSecurityGroupAlreadyExistsFaultRes(parsedOutput, context); + case "DBSecurityGroupNotSupported": + case "com.amazonaws.rds#DBSecurityGroupNotSupportedFault": + throw await de_DBSecurityGroupNotSupportedFaultRes(parsedOutput, context); + case "QuotaExceeded.DBSecurityGroup": + case "com.amazonaws.rds#DBSecurityGroupQuotaExceededFault": + throw await de_DBSecurityGroupQuotaExceededFaultRes(parsedOutput, context); + case "DBShardGroupAlreadyExists": + case "com.amazonaws.rds#DBShardGroupAlreadyExistsFault": + throw await de_DBShardGroupAlreadyExistsFaultRes(parsedOutput, context); + case "InvalidMaxAcu": + case "com.amazonaws.rds#InvalidMaxAcuFault": + throw await de_InvalidMaxAcuFaultRes(parsedOutput, context); + case "MaxDBShardGroupLimitReached": + case "com.amazonaws.rds#MaxDBShardGroupLimitReached": + throw await de_MaxDBShardGroupLimitReachedRes(parsedOutput, context); + case "UnsupportedDBEngineVersion": + case "com.amazonaws.rds#UnsupportedDBEngineVersionFault": + throw await de_UnsupportedDBEngineVersionFaultRes(parsedOutput, context); + case "DBSubnetGroupAlreadyExists": + case "com.amazonaws.rds#DBSubnetGroupAlreadyExistsFault": + throw await de_DBSubnetGroupAlreadyExistsFaultRes(parsedOutput, context); + case "DBSubnetGroupQuotaExceeded": + case "com.amazonaws.rds#DBSubnetGroupQuotaExceededFault": + throw await de_DBSubnetGroupQuotaExceededFaultRes(parsedOutput, context); + case "DBSubnetQuotaExceededFault": + case "com.amazonaws.rds#DBSubnetQuotaExceededFault": + throw await de_DBSubnetQuotaExceededFaultRes(parsedOutput, context); + case "EventSubscriptionQuotaExceeded": + case "com.amazonaws.rds#EventSubscriptionQuotaExceededFault": + throw await de_EventSubscriptionQuotaExceededFaultRes(parsedOutput, context); + case "SNSInvalidTopic": + case "com.amazonaws.rds#SNSInvalidTopicFault": + throw await de_SNSInvalidTopicFaultRes(parsedOutput, context); + case "SNSNoAuthorization": + case "com.amazonaws.rds#SNSNoAuthorizationFault": + throw await de_SNSNoAuthorizationFaultRes(parsedOutput, context); + case "SNSTopicArnNotFound": + case "com.amazonaws.rds#SNSTopicArnNotFoundFault": + throw await de_SNSTopicArnNotFoundFaultRes(parsedOutput, context); + case "SubscriptionAlreadyExist": + case "com.amazonaws.rds#SubscriptionAlreadyExistFault": + throw await de_SubscriptionAlreadyExistFaultRes(parsedOutput, context); + case "SubscriptionCategoryNotFound": + case "com.amazonaws.rds#SubscriptionCategoryNotFoundFault": + throw await de_SubscriptionCategoryNotFoundFaultRes(parsedOutput, context); + case "GlobalClusterAlreadyExistsFault": + case "com.amazonaws.rds#GlobalClusterAlreadyExistsFault": + throw await de_GlobalClusterAlreadyExistsFaultRes(parsedOutput, context); + case "GlobalClusterQuotaExceededFault": + case "com.amazonaws.rds#GlobalClusterQuotaExceededFault": + throw await de_GlobalClusterQuotaExceededFaultRes(parsedOutput, context); + case "IntegrationAlreadyExistsFault": + case "com.amazonaws.rds#IntegrationAlreadyExistsFault": + throw await de_IntegrationAlreadyExistsFaultRes(parsedOutput, context); + case "IntegrationConflictOperationFault": + case "com.amazonaws.rds#IntegrationConflictOperationFault": + throw await de_IntegrationConflictOperationFaultRes(parsedOutput, context); + case "IntegrationQuotaExceededFault": + case "com.amazonaws.rds#IntegrationQuotaExceededFault": + throw await de_IntegrationQuotaExceededFaultRes(parsedOutput, context); + case "TenantDatabaseAlreadyExists": + case "com.amazonaws.rds#TenantDatabaseAlreadyExistsFault": + throw await de_TenantDatabaseAlreadyExistsFaultRes(parsedOutput, context); case "InvalidBlueGreenDeploymentStateFault": case "com.amazonaws.rds#InvalidBlueGreenDeploymentStateFault": throw await de_InvalidBlueGreenDeploymentStateFaultRes(parsedOutput, context); + case "CustomDBEngineVersionNotFoundFault": + case "com.amazonaws.rds#CustomDBEngineVersionNotFoundFault": + throw await de_CustomDBEngineVersionNotFoundFaultRes(parsedOutput, context); + case "InvalidCustomDBEngineVersionStateFault": + case "com.amazonaws.rds#InvalidCustomDBEngineVersionStateFault": + throw await de_InvalidCustomDBEngineVersionStateFaultRes(parsedOutput, context); + case "DBClusterAutomatedBackupQuotaExceededFault": + case "com.amazonaws.rds#DBClusterAutomatedBackupQuotaExceededFault": + throw await de_DBClusterAutomatedBackupQuotaExceededFaultRes(parsedOutput, context); + case "DBClusterAutomatedBackupNotFoundFault": + case "com.amazonaws.rds#DBClusterAutomatedBackupNotFoundFault": + throw await de_DBClusterAutomatedBackupNotFoundFaultRes(parsedOutput, context); + case "InvalidDBClusterAutomatedBackupStateFault": + case "com.amazonaws.rds#InvalidDBClusterAutomatedBackupStateFault": + throw await de_InvalidDBClusterAutomatedBackupStateFaultRes(parsedOutput, context); + case "DBClusterEndpointNotFoundFault": + case "com.amazonaws.rds#DBClusterEndpointNotFoundFault": + throw await de_DBClusterEndpointNotFoundFaultRes(parsedOutput, context); + case "InvalidDBClusterEndpointStateFault": + case "com.amazonaws.rds#InvalidDBClusterEndpointStateFault": + throw await de_InvalidDBClusterEndpointStateFaultRes(parsedOutput, context); + case "InvalidDBParameterGroupState": + case "com.amazonaws.rds#InvalidDBParameterGroupStateFault": + throw await de_InvalidDBParameterGroupStateFaultRes(parsedOutput, context); + case "DBInstanceAutomatedBackupQuotaExceeded": + case "com.amazonaws.rds#DBInstanceAutomatedBackupQuotaExceededFault": + throw await de_DBInstanceAutomatedBackupQuotaExceededFaultRes(parsedOutput, context); + case "DBInstanceAutomatedBackupNotFound": + case "com.amazonaws.rds#DBInstanceAutomatedBackupNotFoundFault": + throw await de_DBInstanceAutomatedBackupNotFoundFaultRes(parsedOutput, context); + case "InvalidDBInstanceAutomatedBackupState": + case "com.amazonaws.rds#InvalidDBInstanceAutomatedBackupStateFault": + throw await de_InvalidDBInstanceAutomatedBackupStateFaultRes(parsedOutput, context); + case "DBProxyEndpointNotFoundFault": + case "com.amazonaws.rds#DBProxyEndpointNotFoundFault": + throw await de_DBProxyEndpointNotFoundFaultRes(parsedOutput, context); + case "InvalidDBProxyEndpointStateFault": + case "com.amazonaws.rds#InvalidDBProxyEndpointStateFault": + throw await de_InvalidDBProxyEndpointStateFaultRes(parsedOutput, context); + case "DBShardGroupNotFound": + case "com.amazonaws.rds#DBShardGroupNotFoundFault": + throw await de_DBShardGroupNotFoundFaultRes(parsedOutput, context); + case "InvalidDBShardGroupState": + case "com.amazonaws.rds#InvalidDBShardGroupStateFault": + throw await de_InvalidDBShardGroupStateFaultRes(parsedOutput, context); + case "InvalidDBSubnetStateFault": + case "com.amazonaws.rds#InvalidDBSubnetStateFault": + throw await de_InvalidDBSubnetStateFaultRes(parsedOutput, context); + case "InvalidEventSubscriptionState": + case "com.amazonaws.rds#InvalidEventSubscriptionStateFault": + throw await de_InvalidEventSubscriptionStateFaultRes(parsedOutput, context); + case "InvalidIntegrationStateFault": + case "com.amazonaws.rds#InvalidIntegrationStateFault": + throw await de_InvalidIntegrationStateFaultRes(parsedOutput, context); + case "InvalidOptionGroupStateFault": + case "com.amazonaws.rds#InvalidOptionGroupStateFault": + throw await de_InvalidOptionGroupStateFaultRes(parsedOutput, context); + case "DBProxyTargetNotFoundFault": + case "com.amazonaws.rds#DBProxyTargetNotFoundFault": + throw await de_DBProxyTargetNotFoundFaultRes(parsedOutput, context); + case "DBClusterBacktrackNotFoundFault": + case "com.amazonaws.rds#DBClusterBacktrackNotFoundFault": + throw await de_DBClusterBacktrackNotFoundFaultRes(parsedOutput, context); + case "ReservedDBInstanceNotFound": + case "com.amazonaws.rds#ReservedDBInstanceNotFoundFault": + throw await de_ReservedDBInstanceNotFoundFaultRes(parsedOutput, context); + case "ReservedDBInstancesOfferingNotFound": + case "com.amazonaws.rds#ReservedDBInstancesOfferingNotFoundFault": + throw await de_ReservedDBInstancesOfferingNotFoundFaultRes(parsedOutput, context); + case "InvalidResourceStateFault": + case "com.amazonaws.rds#InvalidResourceStateFault": + throw await de_InvalidResourceStateFaultRes(parsedOutput, context); + case "DBLogFileNotFoundFault": + case "com.amazonaws.rds#DBLogFileNotFoundFault": + throw await de_DBLogFileNotFoundFaultRes(parsedOutput, context); + case "InvalidDBClusterCapacityFault": + case "com.amazonaws.rds#InvalidDBClusterCapacityFault": + throw await de_InvalidDBClusterCapacityFaultRes(parsedOutput, context); + case "StorageTypeNotAvailableFault": + case "com.amazonaws.rds#StorageTypeNotAvailableFault": + throw await de_StorageTypeNotAvailableFaultRes(parsedOutput, context); + case "SharedSnapshotQuotaExceeded": + case "com.amazonaws.rds#SharedSnapshotQuotaExceededFault": + throw await de_SharedSnapshotQuotaExceededFaultRes(parsedOutput, context); + case "DBUpgradeDependencyFailure": + case "com.amazonaws.rds#DBUpgradeDependencyFailureFault": + throw await de_DBUpgradeDependencyFailureFaultRes(parsedOutput, context); + case "SubnetAlreadyInUse": + case "com.amazonaws.rds#SubnetAlreadyInUse": + throw await de_SubnetAlreadyInUseRes(parsedOutput, context); + case "ReservedDBInstanceAlreadyExists": + case "com.amazonaws.rds#ReservedDBInstanceAlreadyExistsFault": + throw await de_ReservedDBInstanceAlreadyExistsFaultRes(parsedOutput, context); + case "ReservedDBInstanceQuotaExceeded": + case "com.amazonaws.rds#ReservedDBInstanceQuotaExceededFault": + throw await de_ReservedDBInstanceQuotaExceededFaultRes(parsedOutput, context); + case "DBProxyTargetAlreadyRegisteredFault": + case "com.amazonaws.rds#DBProxyTargetAlreadyRegisteredFault": + throw await de_DBProxyTargetAlreadyRegisteredFaultRes(parsedOutput, context); + case "InsufficientAvailableIPsInSubnetFault": + case "com.amazonaws.rds#InsufficientAvailableIPsInSubnetFault": + throw await de_InsufficientAvailableIPsInSubnetFaultRes(parsedOutput, context); + case "DBClusterRoleNotFound": + case "com.amazonaws.rds#DBClusterRoleNotFoundFault": + throw await de_DBClusterRoleNotFoundFaultRes(parsedOutput, context); + case "DBInstanceRoleNotFound": + case "com.amazonaws.rds#DBInstanceRoleNotFoundFault": + throw await de_DBInstanceRoleNotFoundFaultRes(parsedOutput, context); + case "InvalidS3BucketFault": + case "com.amazonaws.rds#InvalidS3BucketFault": + throw await de_InvalidS3BucketFaultRes(parsedOutput, context); + case "InsufficientDBClusterCapacityFault": + case "com.amazonaws.rds#InsufficientDBClusterCapacityFault": + throw await de_InsufficientDBClusterCapacityFaultRes(parsedOutput, context); + case "InvalidRestoreFault": + case "com.amazonaws.rds#InvalidRestoreFault": + throw await de_InvalidRestoreFaultRes(parsedOutput, context); + case "PointInTimeRestoreNotEnabled": + case "com.amazonaws.rds#PointInTimeRestoreNotEnabledFault": + throw await de_PointInTimeRestoreNotEnabledFaultRes(parsedOutput, context); + case "ExportTaskAlreadyExists": + case "com.amazonaws.rds#ExportTaskAlreadyExistsFault": + throw await de_ExportTaskAlreadyExistsFaultRes(parsedOutput, context); + case "IamRoleMissingPermissions": + case "com.amazonaws.rds#IamRoleMissingPermissionsFault": + throw await de_IamRoleMissingPermissionsFaultRes(parsedOutput, context); + case "IamRoleNotFound": + case "com.amazonaws.rds#IamRoleNotFoundFault": + throw await de_IamRoleNotFoundFaultRes(parsedOutput, context); + case "InvalidExportOnly": + case "com.amazonaws.rds#InvalidExportOnlyFault": + throw await de_InvalidExportOnlyFaultRes(parsedOutput, context); + case "InvalidExportSourceState": + case "com.amazonaws.rds#InvalidExportSourceStateFault": + throw await de_InvalidExportSourceStateFaultRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody: parsedBody.Error, errorCode, - }); - } -}; - -/** - * deserializeAws_querySwitchoverGlobalClusterCommand - */ -export const de_SwitchoverGlobalClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SwitchoverGlobalClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SwitchoverGlobalClusterResult(data.SwitchoverGlobalClusterResult, context); - const response: SwitchoverGlobalClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_querySwitchoverGlobalClusterCommandError - */ -const de_SwitchoverGlobalClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBClusterNotFoundFault": - case "com.amazonaws.rds#DBClusterNotFoundFault": - throw await de_DBClusterNotFoundFaultRes(parsedOutput, context); - case "GlobalClusterNotFoundFault": - case "com.amazonaws.rds#GlobalClusterNotFoundFault": - throw await de_GlobalClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidDBClusterStateFault": - case "com.amazonaws.rds#InvalidDBClusterStateFault": - throw await de_InvalidDBClusterStateFaultRes(parsedOutput, context); - case "InvalidGlobalClusterStateFault": - case "com.amazonaws.rds#InvalidGlobalClusterStateFault": - throw await de_InvalidGlobalClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_querySwitchoverReadReplicaCommand - */ -export const de_SwitchoverReadReplicaCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SwitchoverReadReplicaCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SwitchoverReadReplicaResult(data.SwitchoverReadReplicaResult, context); - const response: SwitchoverReadReplicaCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_querySwitchoverReadReplicaCommandError - */ -const de_SwitchoverReadReplicaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DBInstanceNotFound": - case "com.amazonaws.rds#DBInstanceNotFoundFault": - throw await de_DBInstanceNotFoundFaultRes(parsedOutput, context); - case "InvalidDBInstanceState": - case "com.amazonaws.rds#InvalidDBInstanceStateFault": - throw await de_InvalidDBInstanceStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + }) as never; } }; diff --git a/clients/client-redshift-data/src/protocols/Aws_json1_1.ts b/clients/client-redshift-data/src/protocols/Aws_json1_1.ts index 7429a1c0d20f..a4499d296400 100644 --- a/clients/client-redshift-data/src/protocols/Aws_json1_1.ts +++ b/clients/client-redshift-data/src/protocols/Aws_json1_1.ts @@ -204,7 +204,7 @@ export const de_BatchExecuteStatementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchExecuteStatementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -216,38 +216,6 @@ export const de_BatchExecuteStatementCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchExecuteStatementCommandError - */ -const de_BatchExecuteStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActiveStatementsExceededException": - case "com.amazonaws.redshiftdata#ActiveStatementsExceededException": - throw await de_ActiveStatementsExceededExceptionRes(parsedOutput, context); - case "BatchExecuteStatementException": - case "com.amazonaws.redshiftdata#BatchExecuteStatementException": - throw await de_BatchExecuteStatementExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftdata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelStatementCommand */ @@ -256,7 +224,7 @@ export const de_CancelStatementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelStatementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -268,41 +236,6 @@ export const de_CancelStatementCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelStatementCommandError - */ -const de_CancelStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DatabaseConnectionException": - case "com.amazonaws.redshiftdata#DatabaseConnectionException": - throw await de_DatabaseConnectionExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftdata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftdata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftdata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeStatementCommand */ @@ -311,7 +244,7 @@ export const de_DescribeStatementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStatementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -323,38 +256,6 @@ export const de_DescribeStatementCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeStatementCommandError - */ -const de_DescribeStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftdata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftdata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftdata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTableCommand */ @@ -363,7 +264,7 @@ export const de_DescribeTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -375,38 +276,6 @@ export const de_DescribeTableCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTableCommandError - */ -const de_DescribeTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DatabaseConnectionException": - case "com.amazonaws.redshiftdata#DatabaseConnectionException": - throw await de_DatabaseConnectionExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftdata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftdata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ExecuteStatementCommand */ @@ -415,7 +284,7 @@ export const de_ExecuteStatementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExecuteStatementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -427,38 +296,6 @@ export const de_ExecuteStatementCommand = async ( return response; }; -/** - * deserializeAws_json1_1ExecuteStatementCommandError - */ -const de_ExecuteStatementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActiveStatementsExceededException": - case "com.amazonaws.redshiftdata#ActiveStatementsExceededException": - throw await de_ActiveStatementsExceededExceptionRes(parsedOutput, context); - case "ExecuteStatementException": - case "com.amazonaws.redshiftdata#ExecuteStatementException": - throw await de_ExecuteStatementExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftdata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetStatementResultCommand */ @@ -467,7 +304,7 @@ export const de_GetStatementResultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetStatementResultCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -479,38 +316,6 @@ export const de_GetStatementResultCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetStatementResultCommandError - */ -const de_GetStatementResultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftdata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftdata#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftdata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListDatabasesCommand */ @@ -519,7 +324,7 @@ export const de_ListDatabasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListDatabasesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -531,38 +336,6 @@ export const de_ListDatabasesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListDatabasesCommandError - */ -const de_ListDatabasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DatabaseConnectionException": - case "com.amazonaws.redshiftdata#DatabaseConnectionException": - throw await de_DatabaseConnectionExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftdata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftdata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListSchemasCommand */ @@ -571,7 +344,7 @@ export const de_ListSchemasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSchemasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -583,38 +356,6 @@ export const de_ListSchemasCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSchemasCommandError - */ -const de_ListSchemasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DatabaseConnectionException": - case "com.amazonaws.redshiftdata#DatabaseConnectionException": - throw await de_DatabaseConnectionExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftdata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftdata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListStatementsCommand */ @@ -623,7 +364,7 @@ export const de_ListStatementsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStatementsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -635,35 +376,6 @@ export const de_ListStatementsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListStatementsCommandError - */ -const de_ListStatementsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftdata#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftdata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTablesCommand */ @@ -672,7 +384,7 @@ export const de_ListTablesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTablesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -685,34 +397,43 @@ export const de_ListTablesCommand = async ( }; /** - * deserializeAws_json1_1ListTablesCommandError + * deserialize_Aws_json1_1CommandError */ -const de_ListTablesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "ActiveStatementsExceededException": + case "com.amazonaws.redshiftdata#ActiveStatementsExceededException": + throw await de_ActiveStatementsExceededExceptionRes(parsedOutput, context); + case "BatchExecuteStatementException": + case "com.amazonaws.redshiftdata#BatchExecuteStatementException": + throw await de_BatchExecuteStatementExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.redshiftdata#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); case "DatabaseConnectionException": case "com.amazonaws.redshiftdata#DatabaseConnectionException": throw await de_DatabaseConnectionExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.redshiftdata#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftdata#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.redshiftdata#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ExecuteStatementException": + case "com.amazonaws.redshiftdata#ExecuteStatementException": + throw await de_ExecuteStatementExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts b/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts index be571de49328..05c68378d607 100644 --- a/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts +++ b/clients/client-redshift-serverless/src/protocols/Aws_json1_1.ts @@ -998,7 +998,7 @@ export const de_ConvertRecoveryPointToSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ConvertRecoveryPointToSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1010,47 +1010,6 @@ export const de_ConvertRecoveryPointToSnapshotCommand = async ( return response; }; -/** - * deserializeAws_json1_1ConvertRecoveryPointToSnapshotCommandError - */ -const de_ConvertRecoveryPointToSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.redshiftserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.redshiftserverless#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateCustomDomainAssociationCommand */ @@ -1059,7 +1018,7 @@ export const de_CreateCustomDomainAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCustomDomainAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1071,47 +1030,6 @@ export const de_CreateCustomDomainAssociationCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCustomDomainAssociationCommandError - */ -const de_CreateCustomDomainAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.redshiftserverless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.redshiftserverless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateEndpointAccessCommand */ @@ -1120,7 +1038,7 @@ export const de_CreateEndpointAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEndpointAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1132,47 +1050,6 @@ export const de_CreateEndpointAccessCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateEndpointAccessCommandError - */ -const de_CreateEndpointAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.redshiftserverless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.redshiftserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateNamespaceCommand */ @@ -1181,7 +1058,7 @@ export const de_CreateNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1193,41 +1070,6 @@ export const de_CreateNamespaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateNamespaceCommandError - */ -const de_CreateNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.redshiftserverless#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateScheduledActionCommand */ @@ -1236,7 +1078,7 @@ export const de_CreateScheduledActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateScheduledActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1248,41 +1090,6 @@ export const de_CreateScheduledActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateScheduledActionCommandError - */ -const de_CreateScheduledActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateSnapshotCommand */ @@ -1291,7 +1098,7 @@ export const de_CreateSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1303,47 +1110,6 @@ export const de_CreateSnapshotCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateSnapshotCommandError - */ -const de_CreateSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.redshiftserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.redshiftserverless#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateSnapshotCopyConfigurationCommand */ @@ -1352,7 +1118,7 @@ export const de_CreateSnapshotCopyConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSnapshotCopyConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1364,47 +1130,6 @@ export const de_CreateSnapshotCopyConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateSnapshotCopyConfigurationCommandError - */ -const de_CreateSnapshotCopyConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.redshiftserverless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.redshiftserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateUsageLimitCommand */ @@ -1413,7 +1138,7 @@ export const de_CreateUsageLimitCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateUsageLimitCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1426,52 +1151,14 @@ export const de_CreateUsageLimitCommand = async ( }; /** - * deserializeAws_json1_1CreateUsageLimitCommandError + * deserializeAws_json1_1CreateWorkgroupCommand */ -const de_CreateUsageLimitCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.redshiftserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateWorkgroupCommand - */ -export const de_CreateWorkgroupCommand = async ( +export const de_CreateWorkgroupCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateWorkgroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1483,47 +1170,6 @@ export const de_CreateWorkgroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateWorkgroupCommandError - */ -const de_CreateWorkgroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InsufficientCapacityException": - case "com.amazonaws.redshiftserverless#InsufficientCapacityException": - throw await de_InsufficientCapacityExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.redshiftserverless#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteCustomDomainAssociationCommand */ @@ -1532,7 +1178,7 @@ export const de_DeleteCustomDomainAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCustomDomainAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1544,47 +1190,6 @@ export const de_DeleteCustomDomainAssociationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteCustomDomainAssociationCommandError - */ -const de_DeleteCustomDomainAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.redshiftserverless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.redshiftserverless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteEndpointAccessCommand */ @@ -1593,7 +1198,7 @@ export const de_DeleteEndpointAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEndpointAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1605,41 +1210,6 @@ export const de_DeleteEndpointAccessCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteEndpointAccessCommandError - */ -const de_DeleteEndpointAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteNamespaceCommand */ @@ -1648,7 +1218,7 @@ export const de_DeleteNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1660,41 +1230,6 @@ export const de_DeleteNamespaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteNamespaceCommandError - */ -const de_DeleteNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteResourcePolicyCommand */ @@ -1703,7 +1238,7 @@ export const de_DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1715,38 +1250,6 @@ export const de_DeleteResourcePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteScheduledActionCommand */ @@ -1755,7 +1258,7 @@ export const de_DeleteScheduledActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteScheduledActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1768,51 +1271,39 @@ export const de_DeleteScheduledActionCommand = async ( }; /** - * deserializeAws_json1_1DeleteScheduledActionCommandError + * deserializeAws_json1_1DeleteSnapshotCommand */ -const de_DeleteScheduledActionCommandError = async ( +export const de_DeleteSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteSnapshotResponse(data, context); + const response: DeleteSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteSnapshotCommand + * deserializeAws_json1_1DeleteSnapshotCopyConfigurationCommand */ -export const de_DeleteSnapshotCommand = async ( +export const de_DeleteSnapshotCopyConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteSnapshotResponse(data, context); - const response: DeleteSnapshotCommandOutput = { + contents = _json(data); + const response: DeleteSnapshotCopyConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1820,107 +1311,14 @@ export const de_DeleteSnapshotCommand = async ( }; /** - * deserializeAws_json1_1DeleteSnapshotCommandError + * deserializeAws_json1_1DeleteUsageLimitCommand */ -const de_DeleteSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteSnapshotCopyConfigurationCommand - */ -export const de_DeleteSnapshotCopyConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteSnapshotCopyConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteSnapshotCopyConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteSnapshotCopyConfigurationCommandError - */ -const de_DeleteSnapshotCopyConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.redshiftserverless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteUsageLimitCommand - */ -export const de_DeleteUsageLimitCommand = async ( +export const de_DeleteUsageLimitCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteUsageLimitCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1932,41 +1330,6 @@ export const de_DeleteUsageLimitCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteUsageLimitCommandError - */ -const de_DeleteUsageLimitCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteWorkgroupCommand */ @@ -1975,7 +1338,7 @@ export const de_DeleteWorkgroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteWorkgroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1987,41 +1350,6 @@ export const de_DeleteWorkgroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteWorkgroupCommandError - */ -const de_DeleteWorkgroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetCredentialsCommand */ @@ -2030,7 +1358,7 @@ export const de_GetCredentialsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCredentialsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2042,38 +1370,6 @@ export const de_GetCredentialsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCredentialsCommandError - */ -const de_GetCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetCustomDomainAssociationCommand */ @@ -2082,7 +1378,7 @@ export const de_GetCustomDomainAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCustomDomainAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2094,47 +1390,6 @@ export const de_GetCustomDomainAssociationCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCustomDomainAssociationCommandError - */ -const de_GetCustomDomainAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.redshiftserverless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.redshiftserverless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetEndpointAccessCommand */ @@ -2143,7 +1398,7 @@ export const de_GetEndpointAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetEndpointAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2155,41 +1410,6 @@ export const de_GetEndpointAccessCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetEndpointAccessCommandError - */ -const de_GetEndpointAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetNamespaceCommand */ @@ -2198,7 +1418,7 @@ export const de_GetNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2211,46 +1431,14 @@ export const de_GetNamespaceCommand = async ( }; /** - * deserializeAws_json1_1GetNamespaceCommandError + * deserializeAws_json1_1GetRecoveryPointCommand */ -const de_GetNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRecoveryPointCommand - */ -export const de_GetRecoveryPointCommand = async ( +export const de_GetRecoveryPointCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRecoveryPointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2262,41 +1450,6 @@ export const de_GetRecoveryPointCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetRecoveryPointCommandError - */ -const de_GetRecoveryPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetResourcePolicyCommand */ @@ -2305,7 +1458,7 @@ export const de_GetResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2317,38 +1470,6 @@ export const de_GetResourcePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetResourcePolicyCommandError - */ -const de_GetResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetScheduledActionCommand */ @@ -2357,7 +1478,7 @@ export const de_GetScheduledActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetScheduledActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2369,38 +1490,6 @@ export const de_GetScheduledActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetScheduledActionCommandError - */ -const de_GetScheduledActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetSnapshotCommand */ @@ -2409,7 +1498,7 @@ export const de_GetSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2421,38 +1510,6 @@ export const de_GetSnapshotCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetSnapshotCommandError - */ -const de_GetSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetTableRestoreStatusCommand */ @@ -2461,7 +1518,7 @@ export const de_GetTableRestoreStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTableRestoreStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2473,35 +1530,6 @@ export const de_GetTableRestoreStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetTableRestoreStatusCommandError - */ -const de_GetTableRestoreStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetUsageLimitCommand */ @@ -2510,7 +1538,7 @@ export const de_GetUsageLimitCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetUsageLimitCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2522,41 +1550,6 @@ export const de_GetUsageLimitCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetUsageLimitCommandError - */ -const de_GetUsageLimitCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetWorkgroupCommand */ @@ -2565,7 +1558,7 @@ export const de_GetWorkgroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetWorkgroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2578,51 +1571,39 @@ export const de_GetWorkgroupCommand = async ( }; /** - * deserializeAws_json1_1GetWorkgroupCommandError + * deserializeAws_json1_1ListCustomDomainAssociationsCommand */ -const de_GetWorkgroupCommandError = async ( +export const de_ListCustomDomainAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListCustomDomainAssociationsResponse(data, context); + const response: ListCustomDomainAssociationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListCustomDomainAssociationsCommand + * deserializeAws_json1_1ListEndpointAccessCommand */ -export const de_ListCustomDomainAssociationsCommand = async ( +export const de_ListEndpointAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListCustomDomainAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListCustomDomainAssociationsResponse(data, context); - const response: ListCustomDomainAssociationsCommandOutput = { + contents = de_ListEndpointAccessResponse(data, context); + const response: ListEndpointAccessCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2630,107 +1611,14 @@ export const de_ListCustomDomainAssociationsCommand = async ( }; /** - * deserializeAws_json1_1ListCustomDomainAssociationsCommandError + * deserializeAws_json1_1ListNamespacesCommand */ -const de_ListCustomDomainAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.redshiftserverless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidPaginationException": - case "com.amazonaws.redshiftserverless#InvalidPaginationException": - throw await de_InvalidPaginationExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.redshiftserverless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListEndpointAccessCommand - */ -export const de_ListEndpointAccessCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListEndpointAccessCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListEndpointAccessResponse(data, context); - const response: ListEndpointAccessCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListEndpointAccessCommandError - */ -const de_ListEndpointAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListNamespacesCommand - */ -export const de_ListNamespacesCommand = async ( +export const de_ListNamespacesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListNamespacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2742,35 +1630,6 @@ export const de_ListNamespacesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListNamespacesCommandError - */ -const de_ListNamespacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListRecoveryPointsCommand */ @@ -2779,7 +1638,7 @@ export const de_ListRecoveryPointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRecoveryPointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2791,35 +1650,6 @@ export const de_ListRecoveryPointsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListRecoveryPointsCommandError - */ -const de_ListRecoveryPointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListScheduledActionsCommand */ @@ -2828,7 +1658,7 @@ export const de_ListScheduledActionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListScheduledActionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2840,41 +1670,6 @@ export const de_ListScheduledActionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListScheduledActionsCommandError - */ -const de_ListScheduledActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidPaginationException": - case "com.amazonaws.redshiftserverless#InvalidPaginationException": - throw await de_InvalidPaginationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListSnapshotCopyConfigurationsCommand */ @@ -2883,7 +1678,7 @@ export const de_ListSnapshotCopyConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSnapshotCopyConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2895,44 +1690,6 @@ export const de_ListSnapshotCopyConfigurationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSnapshotCopyConfigurationsCommandError - */ -const de_ListSnapshotCopyConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidPaginationException": - case "com.amazonaws.redshiftserverless#InvalidPaginationException": - throw await de_InvalidPaginationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListSnapshotsCommand */ @@ -2941,7 +1698,7 @@ export const de_ListSnapshotsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2953,38 +1710,6 @@ export const de_ListSnapshotsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSnapshotsCommandError - */ -const de_ListSnapshotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTableRestoreStatusCommand */ @@ -2993,7 +1718,7 @@ export const de_ListTableRestoreStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTableRestoreStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3005,38 +1730,6 @@ export const de_ListTableRestoreStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTableRestoreStatusCommandError - */ -const de_ListTableRestoreStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidPaginationException": - case "com.amazonaws.redshiftserverless#InvalidPaginationException": - throw await de_InvalidPaginationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -3045,7 +1738,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3057,41 +1750,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.redshiftserverless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListUsageLimitsCommand */ @@ -3100,7 +1758,7 @@ export const de_ListUsageLimitsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListUsageLimitsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3112,44 +1770,6 @@ export const de_ListUsageLimitsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListUsageLimitsCommandError - */ -const de_ListUsageLimitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidPaginationException": - case "com.amazonaws.redshiftserverless#InvalidPaginationException": - throw await de_InvalidPaginationExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListWorkgroupsCommand */ @@ -3158,7 +1778,7 @@ export const de_ListWorkgroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListWorkgroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3170,35 +1790,6 @@ export const de_ListWorkgroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListWorkgroupsCommandError - */ -const de_ListWorkgroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutResourcePolicyCommand */ @@ -3207,7 +1798,7 @@ export const de_PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3219,44 +1810,6 @@ export const de_PutResourcePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.redshiftserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RestoreFromRecoveryPointCommand */ @@ -3265,7 +1818,7 @@ export const de_RestoreFromRecoveryPointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreFromRecoveryPointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3277,41 +1830,6 @@ export const de_RestoreFromRecoveryPointCommand = async ( return response; }; -/** - * deserializeAws_json1_1RestoreFromRecoveryPointCommandError - */ -const de_RestoreFromRecoveryPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RestoreFromSnapshotCommand */ @@ -3320,7 +1838,7 @@ export const de_RestoreFromSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreFromSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3332,44 +1850,6 @@ export const de_RestoreFromSnapshotCommand = async ( return response; }; -/** - * deserializeAws_json1_1RestoreFromSnapshotCommandError - */ -const de_RestoreFromSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.redshiftserverless#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RestoreTableFromRecoveryPointCommand */ @@ -3378,7 +1858,7 @@ export const de_RestoreTableFromRecoveryPointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreTableFromRecoveryPointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3390,41 +1870,6 @@ export const de_RestoreTableFromRecoveryPointCommand = async ( return response; }; -/** - * deserializeAws_json1_1RestoreTableFromRecoveryPointCommandError - */ -const de_RestoreTableFromRecoveryPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RestoreTableFromSnapshotCommand */ @@ -3433,7 +1878,7 @@ export const de_RestoreTableFromSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreTableFromSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3445,41 +1890,6 @@ export const de_RestoreTableFromSnapshotCommand = async ( return response; }; -/** - * deserializeAws_json1_1RestoreTableFromSnapshotCommandError - */ -const de_RestoreTableFromSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -3488,186 +1898,32 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: TagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.redshiftserverless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.redshiftserverless#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UntagResourceCommand - */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UntagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.redshiftserverless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateCustomDomainAssociationCommand - */ -export const de_UpdateCustomDomainAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateCustomDomainAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateCustomDomainAssociationResponse(data, context); - const response: UpdateCustomDomainAssociationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateCustomDomainAssociationCommandError - */ -const de_UpdateCustomDomainAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.redshiftserverless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.redshiftserverless#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateEndpointAccessCommand + * deserializeAws_json1_1UntagResourceCommand */ -export const de_UpdateEndpointAccessCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateEndpointAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateEndpointAccessResponse(data, context); - const response: UpdateEndpointAccessCommandOutput = { + contents = _json(data); + const response: UntagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3675,57 +1931,39 @@ export const de_UpdateEndpointAccessCommand = async ( }; /** - * deserializeAws_json1_1UpdateEndpointAccessCommandError + * deserializeAws_json1_1UpdateCustomDomainAssociationCommand */ -const de_UpdateEndpointAccessCommandError = async ( +export const de_UpdateCustomDomainAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.redshiftserverless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateCustomDomainAssociationResponse(data, context); + const response: UpdateCustomDomainAssociationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateNamespaceCommand + * deserializeAws_json1_1UpdateEndpointAccessCommand */ -export const de_UpdateNamespaceCommand = async ( +export const de_UpdateEndpointAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateNamespaceResponse(data, context); - const response: UpdateNamespaceCommandOutput = { + contents = de_UpdateEndpointAccessResponse(data, context); + const response: UpdateEndpointAccessCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3733,38 +1971,23 @@ export const de_UpdateNamespaceCommand = async ( }; /** - * deserializeAws_json1_1UpdateNamespaceCommandError + * deserializeAws_json1_1UpdateNamespaceCommand */ -const de_UpdateNamespaceCommandError = async ( +export const de_UpdateNamespaceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateNamespaceResponse(data, context); + const response: UpdateNamespaceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3775,7 +1998,7 @@ export const de_UpdateScheduledActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateScheduledActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3787,41 +2010,6 @@ export const de_UpdateScheduledActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateScheduledActionCommandError - */ -const de_UpdateScheduledActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSnapshotCommand */ @@ -3830,7 +2018,7 @@ export const de_UpdateSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3842,41 +2030,6 @@ export const de_UpdateSnapshotCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSnapshotCommandError - */ -const de_UpdateSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSnapshotCopyConfigurationCommand */ @@ -3885,7 +2038,7 @@ export const de_UpdateSnapshotCopyConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSnapshotCopyConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3897,44 +2050,6 @@ export const de_UpdateSnapshotCopyConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSnapshotCopyConfigurationCommandError - */ -const de_UpdateSnapshotCopyConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.redshiftserverless#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateUsageLimitCommand */ @@ -3943,7 +2058,7 @@ export const de_UpdateUsageLimitCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateUsageLimitCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3955,41 +2070,6 @@ export const de_UpdateUsageLimitCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateUsageLimitCommandError - */ -const de_UpdateUsageLimitCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.redshiftserverless#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.redshiftserverless#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.redshiftserverless#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.redshiftserverless#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateWorkgroupCommand */ @@ -3998,7 +2078,7 @@ export const de_UpdateWorkgroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateWorkgroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4011,12 +2091,9 @@ export const de_UpdateWorkgroupCommand = async ( }; /** - * deserializeAws_json1_1UpdateWorkgroupCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateWorkgroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4026,25 +2103,40 @@ const de_UpdateWorkgroupCommandError = async ( case "ConflictException": case "com.amazonaws.redshiftserverless#ConflictException": throw await de_ConflictExceptionRes(parsedOutput, context); - case "InsufficientCapacityException": - case "com.amazonaws.redshiftserverless#InsufficientCapacityException": - throw await de_InsufficientCapacityExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.redshiftserverless#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.redshiftserverless#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.redshiftserverless#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.redshiftserverless#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.redshiftserverless#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.redshiftserverless#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.redshiftserverless#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "InsufficientCapacityException": + case "com.amazonaws.redshiftserverless#InsufficientCapacityException": + throw await de_InsufficientCapacityExceptionRes(parsedOutput, context); + case "InvalidPaginationException": + case "com.amazonaws.redshiftserverless#InvalidPaginationException": + throw await de_InvalidPaginationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-redshift/src/protocols/Aws_query.ts b/clients/client-redshift/src/protocols/Aws_query.ts index 2385f8565dea..e5b284c7cfda 100644 --- a/clients/client-redshift/src/protocols/Aws_query.ts +++ b/clients/client-redshift/src/protocols/Aws_query.ts @@ -3163,7 +3163,7 @@ export const de_AcceptReservedNodeExchangeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptReservedNodeExchangeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3175,50 +3175,6 @@ export const de_AcceptReservedNodeExchangeCommand = async ( return response; }; -/** - * deserializeAws_queryAcceptReservedNodeExchangeCommandError - */ -const de_AcceptReservedNodeExchangeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependentServiceUnavailableFault": - case "com.amazonaws.redshift#DependentServiceUnavailableFault": - throw await de_DependentServiceUnavailableFaultRes(parsedOutput, context); - case "InvalidReservedNodeState": - case "com.amazonaws.redshift#InvalidReservedNodeStateFault": - throw await de_InvalidReservedNodeStateFaultRes(parsedOutput, context); - case "ReservedNodeAlreadyExists": - case "com.amazonaws.redshift#ReservedNodeAlreadyExistsFault": - throw await de_ReservedNodeAlreadyExistsFaultRes(parsedOutput, context); - case "ReservedNodeAlreadyMigrated": - case "com.amazonaws.redshift#ReservedNodeAlreadyMigratedFault": - throw await de_ReservedNodeAlreadyMigratedFaultRes(parsedOutput, context); - case "ReservedNodeNotFound": - case "com.amazonaws.redshift#ReservedNodeNotFoundFault": - throw await de_ReservedNodeNotFoundFaultRes(parsedOutput, context); - case "ReservedNodeOfferingNotFound": - case "com.amazonaws.redshift#ReservedNodeOfferingNotFoundFault": - throw await de_ReservedNodeOfferingNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAddPartnerCommand */ @@ -3227,7 +3183,7 @@ export const de_AddPartnerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddPartnerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3239,41 +3195,6 @@ export const de_AddPartnerCommand = async ( return response; }; -/** - * deserializeAws_queryAddPartnerCommandError - */ -const de_AddPartnerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "PartnerNotFound": - case "com.amazonaws.redshift#PartnerNotFoundFault": - throw await de_PartnerNotFoundFaultRes(parsedOutput, context); - case "UnauthorizedPartnerIntegration": - case "com.amazonaws.redshift#UnauthorizedPartnerIntegrationFault": - throw await de_UnauthorizedPartnerIntegrationFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAssociateDataShareConsumerCommand */ @@ -3282,7 +3203,7 @@ export const de_AssociateDataShareConsumerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateDataShareConsumerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3294,35 +3215,6 @@ export const de_AssociateDataShareConsumerCommand = async ( return response; }; -/** - * deserializeAws_queryAssociateDataShareConsumerCommandError - */ -const de_AssociateDataShareConsumerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidDataShareFault": - case "com.amazonaws.redshift#InvalidDataShareFault": - throw await de_InvalidDataShareFaultRes(parsedOutput, context); - case "InvalidNamespaceFault": - case "com.amazonaws.redshift#InvalidNamespaceFault": - throw await de_InvalidNamespaceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAuthorizeClusterSecurityGroupIngressCommand */ @@ -3331,7 +3223,7 @@ export const de_AuthorizeClusterSecurityGroupIngressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AuthorizeClusterSecurityGroupIngressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3343,41 +3235,6 @@ export const de_AuthorizeClusterSecurityGroupIngressCommand = async ( return response; }; -/** - * deserializeAws_queryAuthorizeClusterSecurityGroupIngressCommandError - */ -const de_AuthorizeClusterSecurityGroupIngressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationAlreadyExists": - case "com.amazonaws.redshift#AuthorizationAlreadyExistsFault": - throw await de_AuthorizationAlreadyExistsFaultRes(parsedOutput, context); - case "AuthorizationQuotaExceeded": - case "com.amazonaws.redshift#AuthorizationQuotaExceededFault": - throw await de_AuthorizationQuotaExceededFaultRes(parsedOutput, context); - case "ClusterSecurityGroupNotFound": - case "com.amazonaws.redshift#ClusterSecurityGroupNotFoundFault": - throw await de_ClusterSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterSecurityGroupState": - case "com.amazonaws.redshift#InvalidClusterSecurityGroupStateFault": - throw await de_InvalidClusterSecurityGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAuthorizeDataShareCommand */ @@ -3386,7 +3243,7 @@ export const de_AuthorizeDataShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AuthorizeDataShareCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3398,32 +3255,6 @@ export const de_AuthorizeDataShareCommand = async ( return response; }; -/** - * deserializeAws_queryAuthorizeDataShareCommandError - */ -const de_AuthorizeDataShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidDataShareFault": - case "com.amazonaws.redshift#InvalidDataShareFault": - throw await de_InvalidDataShareFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAuthorizeEndpointAccessCommand */ @@ -3432,7 +3263,7 @@ export const de_AuthorizeEndpointAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AuthorizeEndpointAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3444,47 +3275,6 @@ export const de_AuthorizeEndpointAccessCommand = async ( return response; }; -/** - * deserializeAws_queryAuthorizeEndpointAccessCommandError - */ -const de_AuthorizeEndpointAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "EndpointAuthorizationAlreadyExists": - case "com.amazonaws.redshift#EndpointAuthorizationAlreadyExistsFault": - throw await de_EndpointAuthorizationAlreadyExistsFaultRes(parsedOutput, context); - case "EndpointAuthorizationsPerClusterLimitExceeded": - case "com.amazonaws.redshift#EndpointAuthorizationsPerClusterLimitExceededFault": - throw await de_EndpointAuthorizationsPerClusterLimitExceededFaultRes(parsedOutput, context); - case "InvalidAuthorizationState": - case "com.amazonaws.redshift#InvalidAuthorizationStateFault": - throw await de_InvalidAuthorizationStateFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAuthorizeSnapshotAccessCommand */ @@ -3493,7 +3283,7 @@ export const de_AuthorizeSnapshotAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AuthorizeSnapshotAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3505,50 +3295,6 @@ export const de_AuthorizeSnapshotAccessCommand = async ( return response; }; -/** - * deserializeAws_queryAuthorizeSnapshotAccessCommandError - */ -const de_AuthorizeSnapshotAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationAlreadyExists": - case "com.amazonaws.redshift#AuthorizationAlreadyExistsFault": - throw await de_AuthorizationAlreadyExistsFaultRes(parsedOutput, context); - case "AuthorizationQuotaExceeded": - case "com.amazonaws.redshift#AuthorizationQuotaExceededFault": - throw await de_AuthorizationQuotaExceededFaultRes(parsedOutput, context); - case "ClusterSnapshotNotFound": - case "com.amazonaws.redshift#ClusterSnapshotNotFoundFault": - throw await de_ClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "DependentServiceRequestThrottlingFault": - case "com.amazonaws.redshift#DependentServiceRequestThrottlingFault": - throw await de_DependentServiceRequestThrottlingFaultRes(parsedOutput, context); - case "InvalidClusterSnapshotState": - case "com.amazonaws.redshift#InvalidClusterSnapshotStateFault": - throw await de_InvalidClusterSnapshotStateFaultRes(parsedOutput, context); - case "LimitExceededFault": - case "com.amazonaws.redshift#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryBatchDeleteClusterSnapshotsCommand */ @@ -3557,7 +3303,7 @@ export const de_BatchDeleteClusterSnapshotsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDeleteClusterSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3570,45 +3316,39 @@ export const de_BatchDeleteClusterSnapshotsCommand = async ( }; /** - * deserializeAws_queryBatchDeleteClusterSnapshotsCommandError + * deserializeAws_queryBatchModifyClusterSnapshotsCommand */ -const de_BatchDeleteClusterSnapshotsCommandError = async ( +export const de_BatchModifyClusterSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_BatchModifyClusterSnapshotsOutputMessage(data.BatchModifyClusterSnapshotsResult, context); + const response: BatchModifyClusterSnapshotsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BatchDeleteRequestSizeExceeded": - case "com.amazonaws.redshift#BatchDeleteRequestSizeExceededFault": - throw await de_BatchDeleteRequestSizeExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + return response; }; /** - * deserializeAws_queryBatchModifyClusterSnapshotsCommand + * deserializeAws_queryCancelResizeCommand */ -export const de_BatchModifyClusterSnapshotsCommand = async ( +export const de_CancelResizeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_BatchModifyClusterSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_BatchModifyClusterSnapshotsOutputMessage(data.BatchModifyClusterSnapshotsResult, context); - const response: BatchModifyClusterSnapshotsCommandOutput = { + contents = de_ResizeProgressMessage(data.CancelResizeResult, context); + const response: CancelResizeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3616,48 +3356,39 @@ export const de_BatchModifyClusterSnapshotsCommand = async ( }; /** - * deserializeAws_queryBatchModifyClusterSnapshotsCommandError + * deserializeAws_queryCopyClusterSnapshotCommand */ -const de_BatchModifyClusterSnapshotsCommandError = async ( +export const de_CopyClusterSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BatchModifyClusterSnapshotsLimitExceededFault": - case "com.amazonaws.redshift#BatchModifyClusterSnapshotsLimitExceededFault": - throw await de_BatchModifyClusterSnapshotsLimitExceededFaultRes(parsedOutput, context); - case "InvalidRetentionPeriodFault": - case "com.amazonaws.redshift#InvalidRetentionPeriodFault": - throw await de_InvalidRetentionPeriodFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CopyClusterSnapshotResult(data.CopyClusterSnapshotResult, context); + const response: CopyClusterSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCancelResizeCommand + * deserializeAws_queryCreateAuthenticationProfileCommand */ -export const de_CancelResizeCommand = async ( +export const de_CreateAuthenticationProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CancelResizeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ResizeProgressMessage(data.CancelResizeResult, context); - const response: CancelResizeCommandOutput = { + contents = de_CreateAuthenticationProfileResult(data.CreateAuthenticationProfileResult, context); + const response: CreateAuthenticationProfileCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3665,54 +3396,39 @@ export const de_CancelResizeCommand = async ( }; /** - * deserializeAws_queryCancelResizeCommandError + * deserializeAws_queryCreateClusterCommand */ -const de_CancelResizeCommandError = async ( +export const de_CreateClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "ResizeNotFound": - case "com.amazonaws.redshift#ResizeNotFoundFault": - throw await de_ResizeNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateClusterResult(data.CreateClusterResult, context); + const response: CreateClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCopyClusterSnapshotCommand + * deserializeAws_queryCreateClusterParameterGroupCommand */ -export const de_CopyClusterSnapshotCommand = async ( +export const de_CreateClusterParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CopyClusterSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CopyClusterSnapshotResult(data.CopyClusterSnapshotResult, context); - const response: CopyClusterSnapshotCommandOutput = { + contents = de_CreateClusterParameterGroupResult(data.CreateClusterParameterGroupResult, context); + const response: CreateClusterParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3720,60 +3436,39 @@ export const de_CopyClusterSnapshotCommand = async ( }; /** - * deserializeAws_queryCopyClusterSnapshotCommandError + * deserializeAws_queryCreateClusterSecurityGroupCommand */ -const de_CopyClusterSnapshotCommandError = async ( +export const de_CreateClusterSecurityGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "ClusterSnapshotAlreadyExists": - case "com.amazonaws.redshift#ClusterSnapshotAlreadyExistsFault": - throw await de_ClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "ClusterSnapshotNotFound": - case "com.amazonaws.redshift#ClusterSnapshotNotFoundFault": - throw await de_ClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "ClusterSnapshotQuotaExceeded": - case "com.amazonaws.redshift#ClusterSnapshotQuotaExceededFault": - throw await de_ClusterSnapshotQuotaExceededFaultRes(parsedOutput, context); - case "InvalidClusterSnapshotState": - case "com.amazonaws.redshift#InvalidClusterSnapshotStateFault": - throw await de_InvalidClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidRetentionPeriodFault": - case "com.amazonaws.redshift#InvalidRetentionPeriodFault": - throw await de_InvalidRetentionPeriodFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateClusterSecurityGroupResult(data.CreateClusterSecurityGroupResult, context); + const response: CreateClusterSecurityGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateAuthenticationProfileCommand + * deserializeAws_queryCreateClusterSnapshotCommand */ -export const de_CreateAuthenticationProfileCommand = async ( +export const de_CreateClusterSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateAuthenticationProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateAuthenticationProfileResult(data.CreateAuthenticationProfileResult, context); - const response: CreateAuthenticationProfileCommandOutput = { + contents = de_CreateClusterSnapshotResult(data.CreateClusterSnapshotResult, context); + const response: CreateClusterSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3781,51 +3476,59 @@ export const de_CreateAuthenticationProfileCommand = async ( }; /** - * deserializeAws_queryCreateAuthenticationProfileCommandError + * deserializeAws_queryCreateClusterSubnetGroupCommand */ -const de_CreateAuthenticationProfileCommandError = async ( +export const de_CreateClusterSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateClusterSubnetGroupResult(data.CreateClusterSubnetGroupResult, context); + const response: CreateClusterSubnetGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthenticationProfileAlreadyExistsFault": - case "com.amazonaws.redshift#AuthenticationProfileAlreadyExistsFault": - throw await de_AuthenticationProfileAlreadyExistsFaultRes(parsedOutput, context); - case "AuthenticationProfileQuotaExceededFault": - case "com.amazonaws.redshift#AuthenticationProfileQuotaExceededFault": - throw await de_AuthenticationProfileQuotaExceededFaultRes(parsedOutput, context); - case "InvalidAuthenticationProfileRequestFault": - case "com.amazonaws.redshift#InvalidAuthenticationProfileRequestFault": - throw await de_InvalidAuthenticationProfileRequestFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_queryCreateCustomDomainAssociationCommand + */ +export const de_CreateCustomDomainAssociationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateCustomDomainAssociationResult(data.CreateCustomDomainAssociationResult, context); + const response: CreateCustomDomainAssociationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateClusterCommand + * deserializeAws_queryCreateEndpointAccessCommand */ -export const de_CreateClusterCommand = async ( +export const de_CreateEndpointAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateClusterResult(data.CreateClusterResult, context); - const response: CreateClusterCommandOutput = { + contents = de_EndpointAccess(data.CreateEndpointAccessResult, context); + const response: CreateEndpointAccessCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3833,117 +3536,39 @@ export const de_CreateClusterCommand = async ( }; /** - * deserializeAws_queryCreateClusterCommandError + * deserializeAws_queryCreateEventSubscriptionCommand */ -const de_CreateClusterCommandError = async ( +export const de_CreateEventSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateEventSubscriptionResult(data.CreateEventSubscriptionResult, context); + const response: CreateEventSubscriptionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterAlreadyExists": - case "com.amazonaws.redshift#ClusterAlreadyExistsFault": - throw await de_ClusterAlreadyExistsFaultRes(parsedOutput, context); - case "ClusterParameterGroupNotFound": - case "com.amazonaws.redshift#ClusterParameterGroupNotFoundFault": - throw await de_ClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ClusterQuotaExceeded": - case "com.amazonaws.redshift#ClusterQuotaExceededFault": - throw await de_ClusterQuotaExceededFaultRes(parsedOutput, context); - case "ClusterSecurityGroupNotFound": - case "com.amazonaws.redshift#ClusterSecurityGroupNotFoundFault": - throw await de_ClusterSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "ClusterSubnetGroupNotFoundFault": - case "com.amazonaws.redshift#ClusterSubnetGroupNotFoundFault": - throw await de_ClusterSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "DependentServiceRequestThrottlingFault": - case "com.amazonaws.redshift#DependentServiceRequestThrottlingFault": - throw await de_DependentServiceRequestThrottlingFaultRes(parsedOutput, context); - case "HsmClientCertificateNotFoundFault": - case "com.amazonaws.redshift#HsmClientCertificateNotFoundFault": - throw await de_HsmClientCertificateNotFoundFaultRes(parsedOutput, context); - case "HsmConfigurationNotFoundFault": - case "com.amazonaws.redshift#HsmConfigurationNotFoundFault": - throw await de_HsmConfigurationNotFoundFaultRes(parsedOutput, context); - case "InsufficientClusterCapacity": - case "com.amazonaws.redshift#InsufficientClusterCapacityFault": - throw await de_InsufficientClusterCapacityFaultRes(parsedOutput, context); - case "InvalidClusterSubnetGroupStateFault": - case "com.amazonaws.redshift#InvalidClusterSubnetGroupStateFault": - throw await de_InvalidClusterSubnetGroupStateFaultRes(parsedOutput, context); - case "InvalidClusterTrack": - case "com.amazonaws.redshift#InvalidClusterTrackFault": - throw await de_InvalidClusterTrackFaultRes(parsedOutput, context); - case "InvalidElasticIpFault": - case "com.amazonaws.redshift#InvalidElasticIpFault": - throw await de_InvalidElasticIpFaultRes(parsedOutput, context); - case "InvalidRetentionPeriodFault": - case "com.amazonaws.redshift#InvalidRetentionPeriodFault": - throw await de_InvalidRetentionPeriodFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.redshift#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.redshift#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "Ipv6CidrBlockNotFoundFault": - case "com.amazonaws.redshift#Ipv6CidrBlockNotFoundFault": - throw await de_Ipv6CidrBlockNotFoundFaultRes(parsedOutput, context); - case "LimitExceededFault": - case "com.amazonaws.redshift#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "NumberOfNodesPerClusterLimitExceeded": - case "com.amazonaws.redshift#NumberOfNodesPerClusterLimitExceededFault": - throw await de_NumberOfNodesPerClusterLimitExceededFaultRes(parsedOutput, context); - case "NumberOfNodesQuotaExceeded": - case "com.amazonaws.redshift#NumberOfNodesQuotaExceededFault": - throw await de_NumberOfNodesQuotaExceededFaultRes(parsedOutput, context); - case "RedshiftIdcApplicationNotExists": - case "com.amazonaws.redshift#RedshiftIdcApplicationNotExistsFault": - throw await de_RedshiftIdcApplicationNotExistsFaultRes(parsedOutput, context); - case "SnapshotScheduleNotFound": - case "com.amazonaws.redshift#SnapshotScheduleNotFoundFault": - throw await de_SnapshotScheduleNotFoundFaultRes(parsedOutput, context); - case "TagLimitExceededFault": - case "com.amazonaws.redshift#TagLimitExceededFault": - throw await de_TagLimitExceededFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + return response; }; /** - * deserializeAws_queryCreateClusterParameterGroupCommand + * deserializeAws_queryCreateHsmClientCertificateCommand */ -export const de_CreateClusterParameterGroupCommand = async ( +export const de_CreateHsmClientCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateClusterParameterGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateClusterParameterGroupResult(data.CreateClusterParameterGroupResult, context); - const response: CreateClusterParameterGroupCommandOutput = { + contents = de_CreateHsmClientCertificateResult(data.CreateHsmClientCertificateResult, context); + const response: CreateHsmClientCertificateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3951,54 +3576,39 @@ export const de_CreateClusterParameterGroupCommand = async ( }; /** - * deserializeAws_queryCreateClusterParameterGroupCommandError + * deserializeAws_queryCreateHsmConfigurationCommand */ -const de_CreateClusterParameterGroupCommandError = async ( +export const de_CreateHsmConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterParameterGroupAlreadyExists": - case "com.amazonaws.redshift#ClusterParameterGroupAlreadyExistsFault": - throw await de_ClusterParameterGroupAlreadyExistsFaultRes(parsedOutput, context); - case "ClusterParameterGroupQuotaExceeded": - case "com.amazonaws.redshift#ClusterParameterGroupQuotaExceededFault": - throw await de_ClusterParameterGroupQuotaExceededFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "TagLimitExceededFault": - case "com.amazonaws.redshift#TagLimitExceededFault": - throw await de_TagLimitExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateHsmConfigurationResult(data.CreateHsmConfigurationResult, context); + const response: CreateHsmConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateClusterSecurityGroupCommand + * deserializeAws_queryCreateRedshiftIdcApplicationCommand */ -export const de_CreateClusterSecurityGroupCommand = async ( +export const de_CreateRedshiftIdcApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateClusterSecurityGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateClusterSecurityGroupResult(data.CreateClusterSecurityGroupResult, context); - const response: CreateClusterSecurityGroupCommandOutput = { + contents = de_CreateRedshiftIdcApplicationResult(data.CreateRedshiftIdcApplicationResult, context); + const response: CreateRedshiftIdcApplicationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4006,54 +3616,39 @@ export const de_CreateClusterSecurityGroupCommand = async ( }; /** - * deserializeAws_queryCreateClusterSecurityGroupCommandError + * deserializeAws_queryCreateScheduledActionCommand */ -const de_CreateClusterSecurityGroupCommandError = async ( +export const de_CreateScheduledActionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterSecurityGroupAlreadyExists": - case "com.amazonaws.redshift#ClusterSecurityGroupAlreadyExistsFault": - throw await de_ClusterSecurityGroupAlreadyExistsFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "QuotaExceeded.ClusterSecurityGroup": - case "com.amazonaws.redshift#ClusterSecurityGroupQuotaExceededFault": - throw await de_ClusterSecurityGroupQuotaExceededFaultRes(parsedOutput, context); - case "TagLimitExceededFault": - case "com.amazonaws.redshift#TagLimitExceededFault": - throw await de_TagLimitExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ScheduledAction(data.CreateScheduledActionResult, context); + const response: CreateScheduledActionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateClusterSnapshotCommand + * deserializeAws_queryCreateSnapshotCopyGrantCommand */ -export const de_CreateClusterSnapshotCommand = async ( +export const de_CreateSnapshotCopyGrantCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateClusterSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateClusterSnapshotResult(data.CreateClusterSnapshotResult, context); - const response: CreateClusterSnapshotCommandOutput = { + contents = de_CreateSnapshotCopyGrantResult(data.CreateSnapshotCopyGrantResult, context); + const response: CreateSnapshotCopyGrantCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4061,63 +3656,56 @@ export const de_CreateClusterSnapshotCommand = async ( }; /** - * deserializeAws_queryCreateClusterSnapshotCommandError + * deserializeAws_queryCreateSnapshotScheduleCommand */ -const de_CreateClusterSnapshotCommandError = async ( +export const de_CreateSnapshotScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SnapshotSchedule(data.CreateSnapshotScheduleResult, context); + const response: CreateSnapshotScheduleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "ClusterSnapshotAlreadyExists": - case "com.amazonaws.redshift#ClusterSnapshotAlreadyExistsFault": - throw await de_ClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "ClusterSnapshotQuotaExceeded": - case "com.amazonaws.redshift#ClusterSnapshotQuotaExceededFault": - throw await de_ClusterSnapshotQuotaExceededFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidRetentionPeriodFault": - case "com.amazonaws.redshift#InvalidRetentionPeriodFault": - throw await de_InvalidRetentionPeriodFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "TagLimitExceededFault": - case "com.amazonaws.redshift#TagLimitExceededFault": - throw await de_TagLimitExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_queryCreateTagsCommand + */ +export const de_CreateTagsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: CreateTagsCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateClusterSubnetGroupCommand + * deserializeAws_queryCreateUsageLimitCommand */ -export const de_CreateClusterSubnetGroupCommand = async ( +export const de_CreateUsageLimitCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateClusterSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateClusterSubnetGroupResult(data.CreateClusterSubnetGroupResult, context); - const response: CreateClusterSubnetGroupCommandOutput = { + contents = de_UsageLimit(data.CreateUsageLimitResult, context); + const response: CreateUsageLimitCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4125,66 +3713,39 @@ export const de_CreateClusterSubnetGroupCommand = async ( }; /** - * deserializeAws_queryCreateClusterSubnetGroupCommandError + * deserializeAws_queryDeauthorizeDataShareCommand */ -const de_CreateClusterSubnetGroupCommandError = async ( +export const de_DeauthorizeDataShareCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterSubnetGroupAlreadyExists": - case "com.amazonaws.redshift#ClusterSubnetGroupAlreadyExistsFault": - throw await de_ClusterSubnetGroupAlreadyExistsFaultRes(parsedOutput, context); - case "ClusterSubnetGroupQuotaExceeded": - case "com.amazonaws.redshift#ClusterSubnetGroupQuotaExceededFault": - throw await de_ClusterSubnetGroupQuotaExceededFaultRes(parsedOutput, context); - case "ClusterSubnetQuotaExceededFault": - case "com.amazonaws.redshift#ClusterSubnetQuotaExceededFault": - throw await de_ClusterSubnetQuotaExceededFaultRes(parsedOutput, context); - case "DependentServiceRequestThrottlingFault": - case "com.amazonaws.redshift#DependentServiceRequestThrottlingFault": - throw await de_DependentServiceRequestThrottlingFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.redshift#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "TagLimitExceededFault": - case "com.amazonaws.redshift#TagLimitExceededFault": - throw await de_TagLimitExceededFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DataShare(data.DeauthorizeDataShareResult, context); + const response: DeauthorizeDataShareCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateCustomDomainAssociationCommand + * deserializeAws_queryDeleteAuthenticationProfileCommand */ -export const de_CreateCustomDomainAssociationCommand = async ( +export const de_DeleteAuthenticationProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateCustomDomainAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateCustomDomainAssociationResult(data.CreateCustomDomainAssociationResult, context); - const response: CreateCustomDomainAssociationCommandOutput = { + contents = de_DeleteAuthenticationProfileResult(data.DeleteAuthenticationProfileResult, context); + const response: DeleteAuthenticationProfileCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4192,124 +3753,73 @@ export const de_CreateCustomDomainAssociationCommand = async ( }; /** - * deserializeAws_queryCreateCustomDomainAssociationCommandError + * deserializeAws_queryDeleteClusterCommand */ -const de_CreateCustomDomainAssociationCommandError = async ( +export const de_DeleteClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "CustomCnameAssociationFault": - case "com.amazonaws.redshift#CustomCnameAssociationFault": - throw await de_CustomCnameAssociationFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteClusterResult(data.DeleteClusterResult, context); + const response: DeleteClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateEndpointAccessCommand + * deserializeAws_queryDeleteClusterParameterGroupCommand */ -export const de_CreateEndpointAccessCommand = async ( +export const de_DeleteClusterParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateEndpointAccessCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_EndpointAccess(data.CreateEndpointAccessResult, context); - const response: CreateEndpointAccessCommandOutput = { + await collectBody(output.body, context); + const response: DeleteClusterParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_queryCreateEndpointAccessCommandError + * deserializeAws_queryDeleteClusterSecurityGroupCommand */ -const de_CreateEndpointAccessCommandError = async ( +export const de_DeleteClusterSecurityGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessToClusterDenied": - case "com.amazonaws.redshift#AccessToClusterDeniedFault": - throw await de_AccessToClusterDeniedFaultRes(parsedOutput, context); - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "ClusterSubnetGroupNotFoundFault": - case "com.amazonaws.redshift#ClusterSubnetGroupNotFoundFault": - throw await de_ClusterSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "EndpointAlreadyExists": - case "com.amazonaws.redshift#EndpointAlreadyExistsFault": - throw await de_EndpointAlreadyExistsFaultRes(parsedOutput, context); - case "EndpointsPerAuthorizationLimitExceeded": - case "com.amazonaws.redshift#EndpointsPerAuthorizationLimitExceededFault": - throw await de_EndpointsPerAuthorizationLimitExceededFaultRes(parsedOutput, context); - case "EndpointsPerClusterLimitExceeded": - case "com.amazonaws.redshift#EndpointsPerClusterLimitExceededFault": - throw await de_EndpointsPerClusterLimitExceededFaultRes(parsedOutput, context); - case "InvalidClusterSecurityGroupState": - case "com.amazonaws.redshift#InvalidClusterSecurityGroupStateFault": - throw await de_InvalidClusterSecurityGroupStateFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteClusterSecurityGroupCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateEventSubscriptionCommand + * deserializeAws_queryDeleteClusterSnapshotCommand */ -export const de_CreateEventSubscriptionCommand = async ( +export const de_DeleteClusterSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateEventSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateEventSubscriptionResult(data.CreateEventSubscriptionResult, context); - const response: CreateEventSubscriptionCommandOutput = { + contents = de_DeleteClusterSnapshotResult(data.DeleteClusterSnapshotResult, context); + const response: DeleteClusterSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4317,75 +3827,53 @@ export const de_CreateEventSubscriptionCommand = async ( }; /** - * deserializeAws_queryCreateEventSubscriptionCommandError + * deserializeAws_queryDeleteClusterSubnetGroupCommand */ -const de_CreateEventSubscriptionCommandError = async ( +export const de_DeleteClusterSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeleteClusterSubnetGroupCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EventSubscriptionQuotaExceeded": - case "com.amazonaws.redshift#EventSubscriptionQuotaExceededFault": - throw await de_EventSubscriptionQuotaExceededFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "SNSInvalidTopic": - case "com.amazonaws.redshift#SNSInvalidTopicFault": - throw await de_SNSInvalidTopicFaultRes(parsedOutput, context); - case "SNSNoAuthorization": - case "com.amazonaws.redshift#SNSNoAuthorizationFault": - throw await de_SNSNoAuthorizationFaultRes(parsedOutput, context); - case "SNSTopicArnNotFound": - case "com.amazonaws.redshift#SNSTopicArnNotFoundFault": - throw await de_SNSTopicArnNotFoundFaultRes(parsedOutput, context); - case "SourceNotFound": - case "com.amazonaws.redshift#SourceNotFoundFault": - throw await de_SourceNotFoundFaultRes(parsedOutput, context); - case "SubscriptionAlreadyExist": - case "com.amazonaws.redshift#SubscriptionAlreadyExistFault": - throw await de_SubscriptionAlreadyExistFaultRes(parsedOutput, context); - case "SubscriptionCategoryNotFound": - case "com.amazonaws.redshift#SubscriptionCategoryNotFoundFault": - throw await de_SubscriptionCategoryNotFoundFaultRes(parsedOutput, context); - case "SubscriptionEventIdNotFound": - case "com.amazonaws.redshift#SubscriptionEventIdNotFoundFault": - throw await de_SubscriptionEventIdNotFoundFaultRes(parsedOutput, context); - case "SubscriptionSeverityNotFound": - case "com.amazonaws.redshift#SubscriptionSeverityNotFoundFault": - throw await de_SubscriptionSeverityNotFoundFaultRes(parsedOutput, context); - case "TagLimitExceededFault": - case "com.amazonaws.redshift#TagLimitExceededFault": - throw await de_TagLimitExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_queryDeleteCustomDomainAssociationCommand + */ +export const de_DeleteCustomDomainAssociationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteCustomDomainAssociationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateHsmClientCertificateCommand + * deserializeAws_queryDeleteEndpointAccessCommand */ -export const de_CreateHsmClientCertificateCommand = async ( +export const de_DeleteEndpointAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateHsmClientCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateHsmClientCertificateResult(data.CreateHsmClientCertificateResult, context); - const response: CreateHsmClientCertificateCommandOutput = { + contents = de_EndpointAccess(data.DeleteEndpointAccessResult, context); + const response: DeleteEndpointAccessCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4393,109 +3881,70 @@ export const de_CreateHsmClientCertificateCommand = async ( }; /** - * deserializeAws_queryCreateHsmClientCertificateCommandError + * deserializeAws_queryDeleteEventSubscriptionCommand */ -const de_CreateHsmClientCertificateCommandError = async ( +export const de_DeleteEventSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "HsmClientCertificateAlreadyExistsFault": - case "com.amazonaws.redshift#HsmClientCertificateAlreadyExistsFault": - throw await de_HsmClientCertificateAlreadyExistsFaultRes(parsedOutput, context); - case "HsmClientCertificateQuotaExceededFault": - case "com.amazonaws.redshift#HsmClientCertificateQuotaExceededFault": - throw await de_HsmClientCertificateQuotaExceededFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "TagLimitExceededFault": - case "com.amazonaws.redshift#TagLimitExceededFault": - throw await de_TagLimitExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteEventSubscriptionCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateHsmConfigurationCommand + * deserializeAws_queryDeleteHsmClientCertificateCommand */ -export const de_CreateHsmConfigurationCommand = async ( +export const de_DeleteHsmClientCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateHsmConfigurationCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateHsmConfigurationResult(data.CreateHsmConfigurationResult, context); - const response: CreateHsmConfigurationCommandOutput = { + await collectBody(output.body, context); + const response: DeleteHsmClientCertificateCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_queryCreateHsmConfigurationCommandError + * deserializeAws_queryDeleteHsmConfigurationCommand */ -const de_CreateHsmConfigurationCommandError = async ( +export const de_DeleteHsmConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "HsmConfigurationAlreadyExistsFault": - case "com.amazonaws.redshift#HsmConfigurationAlreadyExistsFault": - throw await de_HsmConfigurationAlreadyExistsFaultRes(parsedOutput, context); - case "HsmConfigurationQuotaExceededFault": - case "com.amazonaws.redshift#HsmConfigurationQuotaExceededFault": - throw await de_HsmConfigurationQuotaExceededFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "TagLimitExceededFault": - case "com.amazonaws.redshift#TagLimitExceededFault": - throw await de_TagLimitExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteHsmConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateRedshiftIdcApplicationCommand + * deserializeAws_queryDeletePartnerCommand */ -export const de_CreateRedshiftIdcApplicationCommand = async ( +export const de_DeletePartnerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateRedshiftIdcApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateRedshiftIdcApplicationResult(data.CreateRedshiftIdcApplicationResult, context); - const response: CreateRedshiftIdcApplicationCommandOutput = { + contents = de_PartnerIntegrationOutputMessage(data.DeletePartnerResult, context); + const response: DeletePartnerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4503,298 +3952,178 @@ export const de_CreateRedshiftIdcApplicationCommand = async ( }; /** - * deserializeAws_queryCreateRedshiftIdcApplicationCommandError + * deserializeAws_queryDeleteRedshiftIdcApplicationCommand */ -const de_CreateRedshiftIdcApplicationCommandError = async ( +export const de_DeleteRedshiftIdcApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependentServiceAccessDenied": - case "com.amazonaws.redshift#DependentServiceAccessDeniedFault": - throw await de_DependentServiceAccessDeniedFaultRes(parsedOutput, context); - case "DependentServiceUnavailableFault": - case "com.amazonaws.redshift#DependentServiceUnavailableFault": - throw await de_DependentServiceUnavailableFaultRes(parsedOutput, context); - case "RedshiftIdcApplicationAlreadyExists": - case "com.amazonaws.redshift#RedshiftIdcApplicationAlreadyExistsFault": - throw await de_RedshiftIdcApplicationAlreadyExistsFaultRes(parsedOutput, context); - case "RedshiftIdcApplicationQuotaExceeded": - case "com.amazonaws.redshift#RedshiftIdcApplicationQuotaExceededFault": - throw await de_RedshiftIdcApplicationQuotaExceededFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteRedshiftIdcApplicationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateScheduledActionCommand + * deserializeAws_queryDeleteResourcePolicyCommand */ -export const de_CreateScheduledActionCommand = async ( +export const de_DeleteResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateScheduledActionCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ScheduledAction(data.CreateScheduledActionResult, context); - const response: CreateScheduledActionCommandOutput = { + await collectBody(output.body, context); + const response: DeleteResourcePolicyCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_queryCreateScheduledActionCommandError + * deserializeAws_queryDeleteScheduledActionCommand */ -const de_CreateScheduledActionCommandError = async ( +export const de_DeleteScheduledActionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidSchedule": - case "com.amazonaws.redshift#InvalidScheduleFault": - throw await de_InvalidScheduleFaultRes(parsedOutput, context); - case "InvalidScheduledAction": - case "com.amazonaws.redshift#InvalidScheduledActionFault": - throw await de_InvalidScheduledActionFaultRes(parsedOutput, context); - case "ScheduledActionAlreadyExists": - case "com.amazonaws.redshift#ScheduledActionAlreadyExistsFault": - throw await de_ScheduledActionAlreadyExistsFaultRes(parsedOutput, context); - case "ScheduledActionQuotaExceeded": - case "com.amazonaws.redshift#ScheduledActionQuotaExceededFault": - throw await de_ScheduledActionQuotaExceededFaultRes(parsedOutput, context); - case "ScheduledActionTypeUnsupported": - case "com.amazonaws.redshift#ScheduledActionTypeUnsupportedFault": - throw await de_ScheduledActionTypeUnsupportedFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteScheduledActionCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateSnapshotCopyGrantCommand + * deserializeAws_queryDeleteSnapshotCopyGrantCommand */ -export const de_CreateSnapshotCopyGrantCommand = async ( +export const de_DeleteSnapshotCopyGrantCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateSnapshotCopyGrantCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateSnapshotCopyGrantResult(data.CreateSnapshotCopyGrantResult, context); - const response: CreateSnapshotCopyGrantCommandOutput = { + await collectBody(output.body, context); + const response: DeleteSnapshotCopyGrantCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_queryCreateSnapshotCopyGrantCommandError + * deserializeAws_queryDeleteSnapshotScheduleCommand */ -const de_CreateSnapshotCopyGrantCommandError = async ( +export const de_DeleteSnapshotScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependentServiceRequestThrottlingFault": - case "com.amazonaws.redshift#DependentServiceRequestThrottlingFault": - throw await de_DependentServiceRequestThrottlingFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "LimitExceededFault": - case "com.amazonaws.redshift#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "SnapshotCopyGrantAlreadyExistsFault": - case "com.amazonaws.redshift#SnapshotCopyGrantAlreadyExistsFault": - throw await de_SnapshotCopyGrantAlreadyExistsFaultRes(parsedOutput, context); - case "SnapshotCopyGrantQuotaExceededFault": - case "com.amazonaws.redshift#SnapshotCopyGrantQuotaExceededFault": - throw await de_SnapshotCopyGrantQuotaExceededFaultRes(parsedOutput, context); - case "TagLimitExceededFault": - case "com.amazonaws.redshift#TagLimitExceededFault": - throw await de_TagLimitExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteSnapshotScheduleCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateSnapshotScheduleCommand + * deserializeAws_queryDeleteTagsCommand */ -export const de_CreateSnapshotScheduleCommand = async ( +export const de_DeleteTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateSnapshotScheduleCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SnapshotSchedule(data.CreateSnapshotScheduleResult, context); - const response: CreateSnapshotScheduleCommandOutput = { + await collectBody(output.body, context); + const response: DeleteTagsCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_queryCreateSnapshotScheduleCommandError + * deserializeAws_queryDeleteUsageLimitCommand */ -const de_CreateSnapshotScheduleCommandError = async ( +export const de_DeleteUsageLimitCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidSchedule": - case "com.amazonaws.redshift#InvalidScheduleFault": - throw await de_InvalidScheduleFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "ScheduleDefinitionTypeUnsupported": - case "com.amazonaws.redshift#ScheduleDefinitionTypeUnsupportedFault": - throw await de_ScheduleDefinitionTypeUnsupportedFaultRes(parsedOutput, context); - case "SnapshotScheduleAlreadyExists": - case "com.amazonaws.redshift#SnapshotScheduleAlreadyExistsFault": - throw await de_SnapshotScheduleAlreadyExistsFaultRes(parsedOutput, context); - case "SnapshotScheduleQuotaExceeded": - case "com.amazonaws.redshift#SnapshotScheduleQuotaExceededFault": - throw await de_SnapshotScheduleQuotaExceededFaultRes(parsedOutput, context); - case "TagLimitExceededFault": - case "com.amazonaws.redshift#TagLimitExceededFault": - throw await de_TagLimitExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteUsageLimitCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateTagsCommand + * deserializeAws_queryDescribeAccountAttributesCommand */ -export const de_CreateTagsCommand = async ( +export const de_DescribeAccountAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateTagsCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: CreateTagsCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_AccountAttributeList(data.DescribeAccountAttributesResult, context); + const response: DescribeAccountAttributesCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryCreateTagsCommandError + * deserializeAws_queryDescribeAuthenticationProfilesCommand */ -const de_CreateTagsCommandError = async ( +export const de_DescribeAuthenticationProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.redshift#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "TagLimitExceededFault": - case "com.amazonaws.redshift#TagLimitExceededFault": - throw await de_TagLimitExceededFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeAuthenticationProfilesResult(data.DescribeAuthenticationProfilesResult, context); + const response: DescribeAuthenticationProfilesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateUsageLimitCommand + * deserializeAws_queryDescribeClusterDbRevisionsCommand */ -export const de_CreateUsageLimitCommand = async ( +export const de_DescribeClusterDbRevisionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateUsageLimitCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UsageLimit(data.CreateUsageLimitResult, context); - const response: CreateUsageLimitCommandOutput = { + contents = de_ClusterDbRevisionsMessage(data.DescribeClusterDbRevisionsResult, context); + const response: DescribeClusterDbRevisionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4802,63 +4131,39 @@ export const de_CreateUsageLimitCommand = async ( }; /** - * deserializeAws_queryCreateUsageLimitCommandError + * deserializeAws_queryDescribeClusterParameterGroupsCommand */ -const de_CreateUsageLimitCommandError = async ( +export const de_DescribeClusterParameterGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidUsageLimit": - case "com.amazonaws.redshift#InvalidUsageLimitFault": - throw await de_InvalidUsageLimitFaultRes(parsedOutput, context); - case "LimitExceededFault": - case "com.amazonaws.redshift#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "TagLimitExceededFault": - case "com.amazonaws.redshift#TagLimitExceededFault": - throw await de_TagLimitExceededFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - case "UsageLimitAlreadyExists": - case "com.amazonaws.redshift#UsageLimitAlreadyExistsFault": - throw await de_UsageLimitAlreadyExistsFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ClusterParameterGroupsMessage(data.DescribeClusterParameterGroupsResult, context); + const response: DescribeClusterParameterGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeauthorizeDataShareCommand + * deserializeAws_queryDescribeClusterParametersCommand */ -export const de_DeauthorizeDataShareCommand = async ( +export const de_DescribeClusterParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeauthorizeDataShareCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DataShare(data.DeauthorizeDataShareResult, context); - const response: DeauthorizeDataShareCommandOutput = { + contents = de_ClusterParameterGroupDetails(data.DescribeClusterParametersResult, context); + const response: DescribeClusterParametersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4866,45 +4171,39 @@ export const de_DeauthorizeDataShareCommand = async ( }; /** - * deserializeAws_queryDeauthorizeDataShareCommandError + * deserializeAws_queryDescribeClustersCommand */ -const de_DeauthorizeDataShareCommandError = async ( +export const de_DescribeClustersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidDataShareFault": - case "com.amazonaws.redshift#InvalidDataShareFault": - throw await de_InvalidDataShareFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ClustersMessage(data.DescribeClustersResult, context); + const response: DescribeClustersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteAuthenticationProfileCommand + * deserializeAws_queryDescribeClusterSecurityGroupsCommand */ -export const de_DeleteAuthenticationProfileCommand = async ( +export const de_DescribeClusterSecurityGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteAuthenticationProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteAuthenticationProfileResult(data.DeleteAuthenticationProfileResult, context); - const response: DeleteAuthenticationProfileCommandOutput = { + contents = de_ClusterSecurityGroupMessage(data.DescribeClusterSecurityGroupsResult, context); + const response: DescribeClusterSecurityGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4912,48 +4211,39 @@ export const de_DeleteAuthenticationProfileCommand = async ( }; /** - * deserializeAws_queryDeleteAuthenticationProfileCommandError + * deserializeAws_queryDescribeClusterSnapshotsCommand */ -const de_DeleteAuthenticationProfileCommandError = async ( +export const de_DescribeClusterSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthenticationProfileNotFoundFault": - case "com.amazonaws.redshift#AuthenticationProfileNotFoundFault": - throw await de_AuthenticationProfileNotFoundFaultRes(parsedOutput, context); - case "InvalidAuthenticationProfileRequestFault": - case "com.amazonaws.redshift#InvalidAuthenticationProfileRequestFault": - throw await de_InvalidAuthenticationProfileRequestFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SnapshotMessage(data.DescribeClusterSnapshotsResult, context); + const response: DescribeClusterSnapshotsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteClusterCommand + * deserializeAws_queryDescribeClusterSubnetGroupsCommand */ -export const de_DeleteClusterCommand = async ( +export const de_DescribeClusterSubnetGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteClusterResult(data.DeleteClusterResult, context); - const response: DeleteClusterCommandOutput = { + contents = de_ClusterSubnetGroupMessage(data.DescribeClusterSubnetGroupsResult, context); + const response: DescribeClusterSubnetGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4961,149 +4251,99 @@ export const de_DeleteClusterCommand = async ( }; /** - * deserializeAws_queryDeleteClusterCommandError + * deserializeAws_queryDescribeClusterTracksCommand */ -const de_DeleteClusterCommandError = async ( +export const de_DescribeClusterTracksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_TrackListMessage(data.DescribeClusterTracksResult, context); + const response: DescribeClusterTracksCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "ClusterSnapshotAlreadyExists": - case "com.amazonaws.redshift#ClusterSnapshotAlreadyExistsFault": - throw await de_ClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); - case "ClusterSnapshotQuotaExceeded": - case "com.amazonaws.redshift#ClusterSnapshotQuotaExceededFault": - throw await de_ClusterSnapshotQuotaExceededFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidRetentionPeriodFault": - case "com.amazonaws.redshift#InvalidRetentionPeriodFault": - throw await de_InvalidRetentionPeriodFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + return response; }; /** - * deserializeAws_queryDeleteClusterParameterGroupCommand + * deserializeAws_queryDescribeClusterVersionsCommand */ -export const de_DeleteClusterParameterGroupCommand = async ( +export const de_DescribeClusterVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteClusterParameterGroupCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteClusterParameterGroupCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ClusterVersionsMessage(data.DescribeClusterVersionsResult, context); + const response: DescribeClusterVersionsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteClusterParameterGroupCommandError - */ -const de_DeleteClusterParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterParameterGroupNotFound": - case "com.amazonaws.redshift#ClusterParameterGroupNotFoundFault": - throw await de_ClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterParameterGroupState": - case "com.amazonaws.redshift#InvalidClusterParameterGroupStateFault": - throw await de_InvalidClusterParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteClusterSecurityGroupCommand + * deserializeAws_queryDescribeCustomDomainAssociationsCommand */ -export const de_DeleteClusterSecurityGroupCommand = async ( +export const de_DescribeCustomDomainAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteClusterSecurityGroupCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteClusterSecurityGroupCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CustomDomainAssociationsMessage(data.DescribeCustomDomainAssociationsResult, context); + const response: DescribeCustomDomainAssociationsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteClusterSecurityGroupCommandError + * deserializeAws_queryDescribeDataSharesCommand */ -const de_DeleteClusterSecurityGroupCommandError = async ( +export const de_DescribeDataSharesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterSecurityGroupNotFound": - case "com.amazonaws.redshift#ClusterSecurityGroupNotFoundFault": - throw await de_ClusterSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterSecurityGroupState": - case "com.amazonaws.redshift#InvalidClusterSecurityGroupStateFault": - throw await de_InvalidClusterSecurityGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDataSharesResult(data.DescribeDataSharesResult, context); + const response: DescribeDataSharesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteClusterSnapshotCommand + * deserializeAws_queryDescribeDataSharesForConsumerCommand */ -export const de_DeleteClusterSnapshotCommand = async ( +export const de_DescribeDataSharesForConsumerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteClusterSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteClusterSnapshotResult(data.DeleteClusterSnapshotResult, context); - const response: DeleteClusterSnapshotCommandOutput = { + contents = de_DescribeDataSharesForConsumerResult(data.DescribeDataSharesForConsumerResult, context); + const response: DescribeDataSharesForConsumerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5111,149 +4351,119 @@ export const de_DeleteClusterSnapshotCommand = async ( }; /** - * deserializeAws_queryDeleteClusterSnapshotCommandError + * deserializeAws_queryDescribeDataSharesForProducerCommand */ -const de_DeleteClusterSnapshotCommandError = async ( +export const de_DescribeDataSharesForProducerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterSnapshotNotFound": - case "com.amazonaws.redshift#ClusterSnapshotNotFoundFault": - throw await de_ClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterSnapshotState": - case "com.amazonaws.redshift#InvalidClusterSnapshotStateFault": - throw await de_InvalidClusterSnapshotStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDataSharesForProducerResult(data.DescribeDataSharesForProducerResult, context); + const response: DescribeDataSharesForProducerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteClusterSubnetGroupCommand + * deserializeAws_queryDescribeDefaultClusterParametersCommand */ -export const de_DeleteClusterSubnetGroupCommand = async ( +export const de_DescribeDefaultClusterParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteClusterSubnetGroupCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteClusterSubnetGroupCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDefaultClusterParametersResult(data.DescribeDefaultClusterParametersResult, context); + const response: DescribeDefaultClusterParametersCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteClusterSubnetGroupCommandError + * deserializeAws_queryDescribeEndpointAccessCommand */ -const de_DeleteClusterSubnetGroupCommandError = async ( +export const de_DescribeEndpointAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterSubnetGroupNotFoundFault": - case "com.amazonaws.redshift#ClusterSubnetGroupNotFoundFault": - throw await de_ClusterSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterSubnetGroupStateFault": - case "com.amazonaws.redshift#InvalidClusterSubnetGroupStateFault": - throw await de_InvalidClusterSubnetGroupStateFaultRes(parsedOutput, context); - case "InvalidClusterSubnetStateFault": - case "com.amazonaws.redshift#InvalidClusterSubnetStateFault": - throw await de_InvalidClusterSubnetStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EndpointAccessList(data.DescribeEndpointAccessResult, context); + const response: DescribeEndpointAccessCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteCustomDomainAssociationCommand + * deserializeAws_queryDescribeEndpointAuthorizationCommand */ -export const de_DeleteCustomDomainAssociationCommand = async ( +export const de_DescribeEndpointAuthorizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteCustomDomainAssociationCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteCustomDomainAssociationCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EndpointAuthorizationList(data.DescribeEndpointAuthorizationResult, context); + const response: DescribeEndpointAuthorizationCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteCustomDomainAssociationCommandError + * deserializeAws_queryDescribeEventCategoriesCommand */ -const de_DeleteCustomDomainAssociationCommandError = async ( +export const de_DescribeEventCategoriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "CustomCnameAssociationFault": - case "com.amazonaws.redshift#CustomCnameAssociationFault": - throw await de_CustomCnameAssociationFaultRes(parsedOutput, context); - case "CustomDomainAssociationNotFoundFault": - case "com.amazonaws.redshift#CustomDomainAssociationNotFoundFault": - throw await de_CustomDomainAssociationNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EventCategoriesMessage(data.DescribeEventCategoriesResult, context); + const response: DescribeEventCategoriesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteEndpointAccessCommand + * deserializeAws_queryDescribeEventsCommand */ -export const de_DeleteEndpointAccessCommand = async ( +export const de_DescribeEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteEndpointAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_EndpointAccess(data.DeleteEndpointAccessResult, context); - const response: DeleteEndpointAccessCommandOutput = { + contents = de_EventsMessage(data.DescribeEventsResult, context); + const response: DescribeEventsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5261,195 +4471,159 @@ export const de_DeleteEndpointAccessCommand = async ( }; /** - * deserializeAws_queryDeleteEndpointAccessCommandError + * deserializeAws_queryDescribeEventSubscriptionsCommand */ -const de_DeleteEndpointAccessCommandError = async ( +export const de_DescribeEventSubscriptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "EndpointNotFound": - case "com.amazonaws.redshift#EndpointNotFoundFault": - throw await de_EndpointNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterSecurityGroupState": - case "com.amazonaws.redshift#InvalidClusterSecurityGroupStateFault": - throw await de_InvalidClusterSecurityGroupStateFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidEndpointState": - case "com.amazonaws.redshift#InvalidEndpointStateFault": - throw await de_InvalidEndpointStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EventSubscriptionsMessage(data.DescribeEventSubscriptionsResult, context); + const response: DescribeEventSubscriptionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteEventSubscriptionCommand + * deserializeAws_queryDescribeHsmClientCertificatesCommand */ -export const de_DeleteEventSubscriptionCommand = async ( +export const de_DescribeHsmClientCertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteEventSubscriptionCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteEventSubscriptionCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_HsmClientCertificateMessage(data.DescribeHsmClientCertificatesResult, context); + const response: DescribeHsmClientCertificatesCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteEventSubscriptionCommandError + * deserializeAws_queryDescribeHsmConfigurationsCommand */ -const de_DeleteEventSubscriptionCommandError = async ( +export const de_DescribeHsmConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidSubscriptionStateFault": - case "com.amazonaws.redshift#InvalidSubscriptionStateFault": - throw await de_InvalidSubscriptionStateFaultRes(parsedOutput, context); - case "SubscriptionNotFound": - case "com.amazonaws.redshift#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_HsmConfigurationMessage(data.DescribeHsmConfigurationsResult, context); + const response: DescribeHsmConfigurationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteHsmClientCertificateCommand + * deserializeAws_queryDescribeInboundIntegrationsCommand */ -export const de_DeleteHsmClientCertificateCommand = async ( +export const de_DescribeInboundIntegrationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteHsmClientCertificateCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteHsmClientCertificateCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_InboundIntegrationsMessage(data.DescribeInboundIntegrationsResult, context); + const response: DescribeInboundIntegrationsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteHsmClientCertificateCommandError + * deserializeAws_queryDescribeLoggingStatusCommand */ -const de_DeleteHsmClientCertificateCommandError = async ( +export const de_DescribeLoggingStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "HsmClientCertificateNotFoundFault": - case "com.amazonaws.redshift#HsmClientCertificateNotFoundFault": - throw await de_HsmClientCertificateNotFoundFaultRes(parsedOutput, context); - case "InvalidHsmClientCertificateStateFault": - case "com.amazonaws.redshift#InvalidHsmClientCertificateStateFault": - throw await de_InvalidHsmClientCertificateStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_LoggingStatus(data.DescribeLoggingStatusResult, context); + const response: DescribeLoggingStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteHsmConfigurationCommand + * deserializeAws_queryDescribeNodeConfigurationOptionsCommand */ -export const de_DeleteHsmConfigurationCommand = async ( +export const de_DescribeNodeConfigurationOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteHsmConfigurationCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteHsmConfigurationCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_NodeConfigurationOptionsMessage(data.DescribeNodeConfigurationOptionsResult, context); + const response: DescribeNodeConfigurationOptionsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteHsmConfigurationCommandError + * deserializeAws_queryDescribeOrderableClusterOptionsCommand */ -const de_DeleteHsmConfigurationCommandError = async ( +export const de_DescribeOrderableClusterOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "HsmConfigurationNotFoundFault": - case "com.amazonaws.redshift#HsmConfigurationNotFoundFault": - throw await de_HsmConfigurationNotFoundFaultRes(parsedOutput, context); - case "InvalidHsmConfigurationStateFault": - case "com.amazonaws.redshift#InvalidHsmConfigurationStateFault": - throw await de_InvalidHsmConfigurationStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_OrderableClusterOptionsMessage(data.DescribeOrderableClusterOptionsResult, context); + const response: DescribeOrderableClusterOptionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeletePartnerCommand + * deserializeAws_queryDescribePartnersCommand */ -export const de_DeletePartnerCommand = async ( +export const de_DescribePartnersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeletePartnerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_PartnerIntegrationOutputMessage(data.DeletePartnerResult, context); - const response: DeletePartnerCommandOutput = { + contents = de_DescribePartnersOutputMessage(data.DescribePartnersResult, context); + const response: DescribePartnersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5457,382 +4631,319 @@ export const de_DeletePartnerCommand = async ( }; /** - * deserializeAws_queryDeletePartnerCommandError + * deserializeAws_queryDescribeRedshiftIdcApplicationsCommand */ -const de_DeletePartnerCommandError = async ( +export const de_DescribeRedshiftIdcApplicationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "PartnerNotFound": - case "com.amazonaws.redshift#PartnerNotFoundFault": - throw await de_PartnerNotFoundFaultRes(parsedOutput, context); - case "UnauthorizedPartnerIntegration": - case "com.amazonaws.redshift#UnauthorizedPartnerIntegrationFault": - throw await de_UnauthorizedPartnerIntegrationFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeRedshiftIdcApplicationsResult(data.DescribeRedshiftIdcApplicationsResult, context); + const response: DescribeRedshiftIdcApplicationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteRedshiftIdcApplicationCommand + * deserializeAws_queryDescribeReservedNodeExchangeStatusCommand */ -export const de_DeleteRedshiftIdcApplicationCommand = async ( +export const de_DescribeReservedNodeExchangeStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRedshiftIdcApplicationCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteRedshiftIdcApplicationCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeReservedNodeExchangeStatusOutputMessage(data.DescribeReservedNodeExchangeStatusResult, context); + const response: DescribeReservedNodeExchangeStatusCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteRedshiftIdcApplicationCommandError + * deserializeAws_queryDescribeReservedNodeOfferingsCommand */ -const de_DeleteRedshiftIdcApplicationCommandError = async ( +export const de_DescribeReservedNodeOfferingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ReservedNodeOfferingsMessage(data.DescribeReservedNodeOfferingsResult, context); + const response: DescribeReservedNodeOfferingsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependentServiceAccessDenied": - case "com.amazonaws.redshift#DependentServiceAccessDeniedFault": - throw await de_DependentServiceAccessDeniedFaultRes(parsedOutput, context); - case "DependentServiceUnavailableFault": - case "com.amazonaws.redshift#DependentServiceUnavailableFault": - throw await de_DependentServiceUnavailableFaultRes(parsedOutput, context); - case "RedshiftIdcApplicationNotExists": - case "com.amazonaws.redshift#RedshiftIdcApplicationNotExistsFault": - throw await de_RedshiftIdcApplicationNotExistsFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + return response; }; /** - * deserializeAws_queryDeleteResourcePolicyCommand + * deserializeAws_queryDescribeReservedNodesCommand */ -export const de_DeleteResourcePolicyCommand = async ( +export const de_DescribeReservedNodesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteResourcePolicyCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ReservedNodesMessage(data.DescribeReservedNodesResult, context); + const response: DescribeReservedNodesCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteResourcePolicyCommandError + * deserializeAws_queryDescribeResizeCommand */ -const de_DeleteResourcePolicyCommandError = async ( +export const de_DescribeResizeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundFault": - case "com.amazonaws.redshift#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ResizeProgressMessage(data.DescribeResizeResult, context); + const response: DescribeResizeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteScheduledActionCommand + * deserializeAws_queryDescribeScheduledActionsCommand */ -export const de_DeleteScheduledActionCommand = async ( +export const de_DescribeScheduledActionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteScheduledActionCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteScheduledActionCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ScheduledActionsMessage(data.DescribeScheduledActionsResult, context); + const response: DescribeScheduledActionsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteScheduledActionCommandError + * deserializeAws_queryDescribeSnapshotCopyGrantsCommand */ -const de_DeleteScheduledActionCommandError = async ( +export const de_DescribeSnapshotCopyGrantsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ScheduledActionNotFound": - case "com.amazonaws.redshift#ScheduledActionNotFoundFault": - throw await de_ScheduledActionNotFoundFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SnapshotCopyGrantMessage(data.DescribeSnapshotCopyGrantsResult, context); + const response: DescribeSnapshotCopyGrantsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteSnapshotCopyGrantCommand + * deserializeAws_queryDescribeSnapshotSchedulesCommand */ -export const de_DeleteSnapshotCopyGrantCommand = async ( +export const de_DescribeSnapshotSchedulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSnapshotCopyGrantCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteSnapshotCopyGrantCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeSnapshotSchedulesOutputMessage(data.DescribeSnapshotSchedulesResult, context); + const response: DescribeSnapshotSchedulesCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteSnapshotCopyGrantCommandError + * deserializeAws_queryDescribeStorageCommand */ -const de_DeleteSnapshotCopyGrantCommandError = async ( +export const de_DescribeStorageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidSnapshotCopyGrantStateFault": - case "com.amazonaws.redshift#InvalidSnapshotCopyGrantStateFault": - throw await de_InvalidSnapshotCopyGrantStateFaultRes(parsedOutput, context); - case "SnapshotCopyGrantNotFoundFault": - case "com.amazonaws.redshift#SnapshotCopyGrantNotFoundFault": - throw await de_SnapshotCopyGrantNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CustomerStorageMessage(data.DescribeStorageResult, context); + const response: DescribeStorageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteSnapshotScheduleCommand + * deserializeAws_queryDescribeTableRestoreStatusCommand */ -export const de_DeleteSnapshotScheduleCommand = async ( +export const de_DescribeTableRestoreStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSnapshotScheduleCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteSnapshotScheduleCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_TableRestoreStatusMessage(data.DescribeTableRestoreStatusResult, context); + const response: DescribeTableRestoreStatusCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteSnapshotScheduleCommandError + * deserializeAws_queryDescribeTagsCommand */ -const de_DeleteSnapshotScheduleCommandError = async ( +export const de_DescribeTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidClusterSnapshotScheduleState": - case "com.amazonaws.redshift#InvalidClusterSnapshotScheduleStateFault": - throw await de_InvalidClusterSnapshotScheduleStateFaultRes(parsedOutput, context); - case "SnapshotScheduleNotFound": - case "com.amazonaws.redshift#SnapshotScheduleNotFoundFault": - throw await de_SnapshotScheduleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_TaggedResourceListMessage(data.DescribeTagsResult, context); + const response: DescribeTagsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteTagsCommand + * deserializeAws_queryDescribeUsageLimitsCommand */ -export const de_DeleteTagsCommand = async ( +export const de_DescribeUsageLimitsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteTagsCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteTagsCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UsageLimitList(data.DescribeUsageLimitsResult, context); + const response: DescribeUsageLimitsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteTagsCommandError + * deserializeAws_queryDisableLoggingCommand */ -const de_DeleteTagsCommandError = async ( +export const de_DisableLoggingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.redshift#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_LoggingStatus(data.DisableLoggingResult, context); + const response: DisableLoggingCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteUsageLimitCommand + * deserializeAws_queryDisableSnapshotCopyCommand */ -export const de_DeleteUsageLimitCommand = async ( +export const de_DisableSnapshotCopyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteUsageLimitCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteUsageLimitCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DisableSnapshotCopyResult(data.DisableSnapshotCopyResult, context); + const response: DisableSnapshotCopyCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteUsageLimitCommandError + * deserializeAws_queryDisassociateDataShareConsumerCommand */ -const de_DeleteUsageLimitCommandError = async ( +export const de_DisassociateDataShareConsumerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - case "UsageLimitNotFound": - case "com.amazonaws.redshift#UsageLimitNotFoundFault": - throw await de_UsageLimitNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DataShare(data.DisassociateDataShareConsumerResult, context); + const response: DisassociateDataShareConsumerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeAccountAttributesCommand + * deserializeAws_queryEnableLoggingCommand */ -export const de_DescribeAccountAttributesCommand = async ( +export const de_EnableLoggingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeAccountAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_AccountAttributeList(data.DescribeAccountAttributesResult, context); - const response: DescribeAccountAttributesCommandOutput = { + contents = de_LoggingStatus(data.EnableLoggingResult, context); + const response: EnableLoggingCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5840,39 +4951,39 @@ export const de_DescribeAccountAttributesCommand = async ( }; /** - * deserializeAws_queryDescribeAccountAttributesCommandError + * deserializeAws_queryEnableSnapshotCopyCommand */ -const de_DescribeAccountAttributesCommandError = async ( +export const de_EnableSnapshotCopyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EnableSnapshotCopyResult(data.EnableSnapshotCopyResult, context); + const response: EnableSnapshotCopyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** - * deserializeAws_queryDescribeAuthenticationProfilesCommand + * deserializeAws_queryFailoverPrimaryComputeCommand */ -export const de_DescribeAuthenticationProfilesCommand = async ( +export const de_FailoverPrimaryComputeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeAuthenticationProfilesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeAuthenticationProfilesResult(data.DescribeAuthenticationProfilesResult, context); - const response: DescribeAuthenticationProfilesCommandOutput = { + contents = de_FailoverPrimaryComputeResult(data.FailoverPrimaryComputeResult, context); + const response: FailoverPrimaryComputeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5880,48 +4991,39 @@ export const de_DescribeAuthenticationProfilesCommand = async ( }; /** - * deserializeAws_queryDescribeAuthenticationProfilesCommandError + * deserializeAws_queryGetClusterCredentialsCommand */ -const de_DescribeAuthenticationProfilesCommandError = async ( +export const de_GetClusterCredentialsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthenticationProfileNotFoundFault": - case "com.amazonaws.redshift#AuthenticationProfileNotFoundFault": - throw await de_AuthenticationProfileNotFoundFaultRes(parsedOutput, context); - case "InvalidAuthenticationProfileRequestFault": - case "com.amazonaws.redshift#InvalidAuthenticationProfileRequestFault": - throw await de_InvalidAuthenticationProfileRequestFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ClusterCredentials(data.GetClusterCredentialsResult, context); + const response: GetClusterCredentialsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeClusterDbRevisionsCommand + * deserializeAws_queryGetClusterCredentialsWithIAMCommand */ -export const de_DescribeClusterDbRevisionsCommand = async ( +export const de_GetClusterCredentialsWithIAMCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeClusterDbRevisionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ClusterDbRevisionsMessage(data.DescribeClusterDbRevisionsResult, context); - const response: DescribeClusterDbRevisionsCommandOutput = { + contents = de_ClusterExtendedCredentials(data.GetClusterCredentialsWithIAMResult, context); + const response: GetClusterCredentialsWithIAMCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5929,48 +5031,42 @@ export const de_DescribeClusterDbRevisionsCommand = async ( }; /** - * deserializeAws_queryDescribeClusterDbRevisionsCommandError + * deserializeAws_queryGetReservedNodeExchangeConfigurationOptionsCommand */ -const de_DescribeClusterDbRevisionsCommandError = async ( +export const de_GetReservedNodeExchangeConfigurationOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetReservedNodeExchangeConfigurationOptionsOutputMessage( + data.GetReservedNodeExchangeConfigurationOptionsResult, + context + ); + const response: GetReservedNodeExchangeConfigurationOptionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeClusterParameterGroupsCommand + * deserializeAws_queryGetReservedNodeExchangeOfferingsCommand */ -export const de_DescribeClusterParameterGroupsCommand = async ( +export const de_GetReservedNodeExchangeOfferingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeClusterParameterGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ClusterParameterGroupsMessage(data.DescribeClusterParameterGroupsResult, context); - const response: DescribeClusterParameterGroupsCommandOutput = { + contents = de_GetReservedNodeExchangeOfferingsOutputMessage(data.GetReservedNodeExchangeOfferingsResult, context); + const response: GetReservedNodeExchangeOfferingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5978,48 +5074,39 @@ export const de_DescribeClusterParameterGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeClusterParameterGroupsCommandError + * deserializeAws_queryGetResourcePolicyCommand */ -const de_DescribeClusterParameterGroupsCommandError = async ( +export const de_GetResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterParameterGroupNotFound": - case "com.amazonaws.redshift#ClusterParameterGroupNotFoundFault": - throw await de_ClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetResourcePolicyResult(data.GetResourcePolicyResult, context); + const response: GetResourcePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeClusterParametersCommand + * deserializeAws_queryModifyAquaConfigurationCommand */ -export const de_DescribeClusterParametersCommand = async ( +export const de_ModifyAquaConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeClusterParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ClusterParameterGroupDetails(data.DescribeClusterParametersResult, context); - const response: DescribeClusterParametersCommandOutput = { + contents = de_ModifyAquaOutputMessage(data.ModifyAquaConfigurationResult, context); + const response: ModifyAquaConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6027,45 +5114,39 @@ export const de_DescribeClusterParametersCommand = async ( }; /** - * deserializeAws_queryDescribeClusterParametersCommandError + * deserializeAws_queryModifyAuthenticationProfileCommand */ -const de_DescribeClusterParametersCommandError = async ( +export const de_ModifyAuthenticationProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterParameterGroupNotFound": - case "com.amazonaws.redshift#ClusterParameterGroupNotFoundFault": - throw await de_ClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyAuthenticationProfileResult(data.ModifyAuthenticationProfileResult, context); + const response: ModifyAuthenticationProfileCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeClustersCommand + * deserializeAws_queryModifyClusterCommand */ -export const de_DescribeClustersCommand = async ( +export const de_ModifyClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeClustersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ClustersMessage(data.DescribeClustersResult, context); - const response: DescribeClustersCommandOutput = { + contents = de_ModifyClusterResult(data.ModifyClusterResult, context); + const response: ModifyClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6073,48 +5154,39 @@ export const de_DescribeClustersCommand = async ( }; /** - * deserializeAws_queryDescribeClustersCommandError + * deserializeAws_queryModifyClusterDbRevisionCommand */ -const de_DescribeClustersCommandError = async ( +export const de_ModifyClusterDbRevisionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyClusterDbRevisionResult(data.ModifyClusterDbRevisionResult, context); + const response: ModifyClusterDbRevisionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } + return response; }; /** - * deserializeAws_queryDescribeClusterSecurityGroupsCommand + * deserializeAws_queryModifyClusterIamRolesCommand */ -export const de_DescribeClusterSecurityGroupsCommand = async ( +export const de_ModifyClusterIamRolesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeClusterSecurityGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ClusterSecurityGroupMessage(data.DescribeClusterSecurityGroupsResult, context); - const response: DescribeClusterSecurityGroupsCommandOutput = { + contents = de_ModifyClusterIamRolesResult(data.ModifyClusterIamRolesResult, context); + const response: ModifyClusterIamRolesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6122,48 +5194,19 @@ export const de_DescribeClusterSecurityGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeClusterSecurityGroupsCommandError - */ -const de_DescribeClusterSecurityGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterSecurityGroupNotFound": - case "com.amazonaws.redshift#ClusterSecurityGroupNotFoundFault": - throw await de_ClusterSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeClusterSnapshotsCommand + * deserializeAws_queryModifyClusterMaintenanceCommand */ -export const de_DescribeClusterSnapshotsCommand = async ( +export const de_ModifyClusterMaintenanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeClusterSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_SnapshotMessage(data.DescribeClusterSnapshotsResult, context); - const response: DescribeClusterSnapshotsCommandOutput = { + contents = de_ModifyClusterMaintenanceResult(data.ModifyClusterMaintenanceResult, context); + const response: ModifyClusterMaintenanceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6171,54 +5214,39 @@ export const de_DescribeClusterSnapshotsCommand = async ( }; /** - * deserializeAws_queryDescribeClusterSnapshotsCommandError + * deserializeAws_queryModifyClusterParameterGroupCommand */ -const de_DescribeClusterSnapshotsCommandError = async ( +export const de_ModifyClusterParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "ClusterSnapshotNotFound": - case "com.amazonaws.redshift#ClusterSnapshotNotFoundFault": - throw await de_ClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ClusterParameterGroupNameMessage(data.ModifyClusterParameterGroupResult, context); + const response: ModifyClusterParameterGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeClusterSubnetGroupsCommand + * deserializeAws_queryModifyClusterSnapshotCommand */ -export const de_DescribeClusterSubnetGroupsCommand = async ( +export const de_ModifyClusterSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeClusterSubnetGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ClusterSubnetGroupMessage(data.DescribeClusterSubnetGroupsResult, context); - const response: DescribeClusterSubnetGroupsCommandOutput = { + contents = de_ModifyClusterSnapshotResult(data.ModifyClusterSnapshotResult, context); + const response: ModifyClusterSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6226,48 +5254,36 @@ export const de_DescribeClusterSubnetGroupsCommand = async ( }; /** - * deserializeAws_queryDescribeClusterSubnetGroupsCommandError + * deserializeAws_queryModifyClusterSnapshotScheduleCommand */ -const de_DescribeClusterSubnetGroupsCommandError = async ( +export const de_ModifyClusterSnapshotScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterSubnetGroupNotFoundFault": - case "com.amazonaws.redshift#ClusterSubnetGroupNotFoundFault": - throw await de_ClusterSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: ModifyClusterSnapshotScheduleCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryDescribeClusterTracksCommand + * deserializeAws_queryModifyClusterSubnetGroupCommand */ -export const de_DescribeClusterTracksCommand = async ( +export const de_ModifyClusterSubnetGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeClusterTracksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_TrackListMessage(data.DescribeClusterTracksResult, context); - const response: DescribeClusterTracksCommandOutput = { + contents = de_ModifyClusterSubnetGroupResult(data.ModifyClusterSubnetGroupResult, context); + const response: ModifyClusterSubnetGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6275,48 +5291,19 @@ export const de_DescribeClusterTracksCommand = async ( }; /** - * deserializeAws_queryDescribeClusterTracksCommandError - */ -const de_DescribeClusterTracksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidClusterTrack": - case "com.amazonaws.redshift#InvalidClusterTrackFault": - throw await de_InvalidClusterTrackFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeClusterVersionsCommand + * deserializeAws_queryModifyCustomDomainAssociationCommand */ -export const de_DescribeClusterVersionsCommand = async ( +export const de_ModifyCustomDomainAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeClusterVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ClusterVersionsMessage(data.DescribeClusterVersionsResult, context); - const response: DescribeClusterVersionsCommandOutput = { + contents = de_ModifyCustomDomainAssociationResult(data.ModifyCustomDomainAssociationResult, context); + const response: ModifyCustomDomainAssociationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6324,39 +5311,39 @@ export const de_DescribeClusterVersionsCommand = async ( }; /** - * deserializeAws_queryDescribeClusterVersionsCommandError + * deserializeAws_queryModifyEndpointAccessCommand */ -const de_DescribeClusterVersionsCommandError = async ( +export const de_ModifyEndpointAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EndpointAccess(data.ModifyEndpointAccessResult, context); + const response: ModifyEndpointAccessCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** - * deserializeAws_queryDescribeCustomDomainAssociationsCommand + * deserializeAws_queryModifyEventSubscriptionCommand */ -export const de_DescribeCustomDomainAssociationsCommand = async ( +export const de_ModifyEventSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeCustomDomainAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CustomDomainAssociationsMessage(data.DescribeCustomDomainAssociationsResult, context); - const response: DescribeCustomDomainAssociationsCommandOutput = { + contents = de_ModifyEventSubscriptionResult(data.ModifyEventSubscriptionResult, context); + const response: ModifyEventSubscriptionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6364,48 +5351,39 @@ export const de_DescribeCustomDomainAssociationsCommand = async ( }; /** - * deserializeAws_queryDescribeCustomDomainAssociationsCommandError + * deserializeAws_queryModifyRedshiftIdcApplicationCommand */ -const de_DescribeCustomDomainAssociationsCommandError = async ( +export const de_ModifyRedshiftIdcApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomDomainAssociationNotFoundFault": - case "com.amazonaws.redshift#CustomDomainAssociationNotFoundFault": - throw await de_CustomDomainAssociationNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ModifyRedshiftIdcApplicationResult(data.ModifyRedshiftIdcApplicationResult, context); + const response: ModifyRedshiftIdcApplicationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDataSharesCommand + * deserializeAws_queryModifyScheduledActionCommand */ -export const de_DescribeDataSharesCommand = async ( +export const de_ModifyScheduledActionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDataSharesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDataSharesResult(data.DescribeDataSharesResult, context); - const response: DescribeDataSharesCommandOutput = { + contents = de_ScheduledAction(data.ModifyScheduledActionResult, context); + const response: ModifyScheduledActionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6413,45 +5391,19 @@ export const de_DescribeDataSharesCommand = async ( }; /** - * deserializeAws_queryDescribeDataSharesCommandError + * deserializeAws_queryModifySnapshotCopyRetentionPeriodCommand */ -const de_DescribeDataSharesCommandError = async ( +export const de_ModifySnapshotCopyRetentionPeriodCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidDataShareFault": - case "com.amazonaws.redshift#InvalidDataShareFault": - throw await de_InvalidDataShareFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeDataSharesForConsumerCommand - */ -export const de_DescribeDataSharesForConsumerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDataSharesForConsumerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDataSharesForConsumerResult(data.DescribeDataSharesForConsumerResult, context); - const response: DescribeDataSharesForConsumerCommandOutput = { + contents = de_ModifySnapshotCopyRetentionPeriodResult(data.ModifySnapshotCopyRetentionPeriodResult, context); + const response: ModifySnapshotCopyRetentionPeriodCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6459,45 +5411,39 @@ export const de_DescribeDataSharesForConsumerCommand = async ( }; /** - * deserializeAws_queryDescribeDataSharesForConsumerCommandError + * deserializeAws_queryModifySnapshotScheduleCommand */ -const de_DescribeDataSharesForConsumerCommandError = async ( +export const de_ModifySnapshotScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNamespaceFault": - case "com.amazonaws.redshift#InvalidNamespaceFault": - throw await de_InvalidNamespaceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SnapshotSchedule(data.ModifySnapshotScheduleResult, context); + const response: ModifySnapshotScheduleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDataSharesForProducerCommand + * deserializeAws_queryModifyUsageLimitCommand */ -export const de_DescribeDataSharesForProducerCommand = async ( +export const de_ModifyUsageLimitCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDataSharesForProducerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDataSharesForProducerResult(data.DescribeDataSharesForProducerResult, context); - const response: DescribeDataSharesForProducerCommandOutput = { + contents = de_UsageLimit(data.ModifyUsageLimitResult, context); + const response: ModifyUsageLimitCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6505,45 +5451,39 @@ export const de_DescribeDataSharesForProducerCommand = async ( }; /** - * deserializeAws_queryDescribeDataSharesForProducerCommandError + * deserializeAws_queryPauseClusterCommand */ -const de_DescribeDataSharesForProducerCommandError = async ( +export const de_PauseClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNamespaceFault": - case "com.amazonaws.redshift#InvalidNamespaceFault": - throw await de_InvalidNamespaceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_PauseClusterResult(data.PauseClusterResult, context); + const response: PauseClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeDefaultClusterParametersCommand + * deserializeAws_queryPurchaseReservedNodeOfferingCommand */ -export const de_DescribeDefaultClusterParametersCommand = async ( +export const de_PurchaseReservedNodeOfferingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDefaultClusterParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDefaultClusterParametersResult(data.DescribeDefaultClusterParametersResult, context); - const response: DescribeDefaultClusterParametersCommandOutput = { + contents = de_PurchaseReservedNodeOfferingResult(data.PurchaseReservedNodeOfferingResult, context); + const response: PurchaseReservedNodeOfferingCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6551,39 +5491,39 @@ export const de_DescribeDefaultClusterParametersCommand = async ( }; /** - * deserializeAws_queryDescribeDefaultClusterParametersCommandError + * deserializeAws_queryPutResourcePolicyCommand */ -const de_DescribeDefaultClusterParametersCommandError = async ( +export const de_PutResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_PutResourcePolicyResult(data.PutResourcePolicyResult, context); + const response: PutResourcePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** - * deserializeAws_queryDescribeEndpointAccessCommand + * deserializeAws_queryRebootClusterCommand */ -export const de_DescribeEndpointAccessCommand = async ( +export const de_RebootClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEndpointAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_EndpointAccessList(data.DescribeEndpointAccessResult, context); - const response: DescribeEndpointAccessCommandOutput = { + contents = de_RebootClusterResult(data.RebootClusterResult, context); + const response: RebootClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6591,51 +5531,39 @@ export const de_DescribeEndpointAccessCommand = async ( }; /** - * deserializeAws_queryDescribeEndpointAccessCommandError + * deserializeAws_queryRejectDataShareCommand */ -const de_DescribeEndpointAccessCommandError = async ( +export const de_RejectDataShareCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "EndpointNotFound": - case "com.amazonaws.redshift#EndpointNotFoundFault": - throw await de_EndpointNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DataShare(data.RejectDataShareResult, context); + const response: RejectDataShareCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeEndpointAuthorizationCommand + * deserializeAws_queryResetClusterParameterGroupCommand */ -export const de_DescribeEndpointAuthorizationCommand = async ( +export const de_ResetClusterParameterGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEndpointAuthorizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_EndpointAuthorizationList(data.DescribeEndpointAuthorizationResult, context); - const response: DescribeEndpointAuthorizationCommandOutput = { + contents = de_ClusterParameterGroupNameMessage(data.ResetClusterParameterGroupResult, context); + const response: ResetClusterParameterGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6643,48 +5571,39 @@ export const de_DescribeEndpointAuthorizationCommand = async ( }; /** - * deserializeAws_queryDescribeEndpointAuthorizationCommandError + * deserializeAws_queryResizeClusterCommand */ -const de_DescribeEndpointAuthorizationCommandError = async ( +export const de_ResizeClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ResizeClusterResult(data.ResizeClusterResult, context); + const response: ResizeClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDescribeEventCategoriesCommand + * deserializeAws_queryRestoreFromClusterSnapshotCommand */ -export const de_DescribeEventCategoriesCommand = async ( +export const de_RestoreFromClusterSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventCategoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_EventCategoriesMessage(data.DescribeEventCategoriesResult, context); - const response: DescribeEventCategoriesCommandOutput = { + contents = de_RestoreFromClusterSnapshotResult(data.RestoreFromClusterSnapshotResult, context); + const response: RestoreFromClusterSnapshotCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6692,39 +5611,39 @@ export const de_DescribeEventCategoriesCommand = async ( }; /** - * deserializeAws_queryDescribeEventCategoriesCommandError + * deserializeAws_queryRestoreTableFromClusterSnapshotCommand */ -const de_DescribeEventCategoriesCommandError = async ( +export const de_RestoreTableFromClusterSnapshotCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RestoreTableFromClusterSnapshotResult(data.RestoreTableFromClusterSnapshotResult, context); + const response: RestoreTableFromClusterSnapshotCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** - * deserializeAws_queryDescribeEventsCommand + * deserializeAws_queryResumeClusterCommand */ -export const de_DescribeEventsCommand = async ( +export const de_ResumeClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_EventsMessage(data.DescribeEventsResult, context); - const response: DescribeEventsCommandOutput = { + contents = de_ResumeClusterResult(data.ResumeClusterResult, context); + const response: ResumeClusterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6732,39 +5651,19 @@ export const de_DescribeEventsCommand = async ( }; /** - * deserializeAws_queryDescribeEventsCommandError + * deserializeAws_queryRevokeClusterSecurityGroupIngressCommand */ -const de_DescribeEventsCommandError = async ( +export const de_RevokeClusterSecurityGroupIngressCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryDescribeEventSubscriptionsCommand - */ -export const de_DescribeEventSubscriptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEventSubscriptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_EventSubscriptionsMessage(data.DescribeEventSubscriptionsResult, context); - const response: DescribeEventSubscriptionsCommandOutput = { + contents = de_RevokeClusterSecurityGroupIngressResult(data.RevokeClusterSecurityGroupIngressResult, context); + const response: RevokeClusterSecurityGroupIngressCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6772,48 +5671,19 @@ export const de_DescribeEventSubscriptionsCommand = async ( }; /** - * deserializeAws_queryDescribeEventSubscriptionsCommandError - */ -const de_DescribeEventSubscriptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "SubscriptionNotFound": - case "com.amazonaws.redshift#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeHsmClientCertificatesCommand + * deserializeAws_queryRevokeEndpointAccessCommand */ -export const de_DescribeHsmClientCertificatesCommand = async ( +export const de_RevokeEndpointAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeHsmClientCertificatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_HsmClientCertificateMessage(data.DescribeHsmClientCertificatesResult, context); - const response: DescribeHsmClientCertificatesCommandOutput = { + contents = de_EndpointAuthorization(data.RevokeEndpointAccessResult, context); + const response: RevokeEndpointAccessCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6821,48 +5691,19 @@ export const de_DescribeHsmClientCertificatesCommand = async ( }; /** - * deserializeAws_queryDescribeHsmClientCertificatesCommandError - */ -const de_DescribeHsmClientCertificatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "HsmClientCertificateNotFoundFault": - case "com.amazonaws.redshift#HsmClientCertificateNotFoundFault": - throw await de_HsmClientCertificateNotFoundFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeHsmConfigurationsCommand + * deserializeAws_queryRevokeSnapshotAccessCommand */ -export const de_DescribeHsmConfigurationsCommand = async ( +export const de_RevokeSnapshotAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeHsmConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_HsmConfigurationMessage(data.DescribeHsmConfigurationsResult, context); - const response: DescribeHsmConfigurationsCommandOutput = { + contents = de_RevokeSnapshotAccessResult(data.RevokeSnapshotAccessResult, context); + const response: RevokeSnapshotAccessCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6870,48 +5711,19 @@ export const de_DescribeHsmConfigurationsCommand = async ( }; /** - * deserializeAws_queryDescribeHsmConfigurationsCommandError - */ -const de_DescribeHsmConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "HsmConfigurationNotFoundFault": - case "com.amazonaws.redshift#HsmConfigurationNotFoundFault": - throw await de_HsmConfigurationNotFoundFaultRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeInboundIntegrationsCommand + * deserializeAws_queryRotateEncryptionKeyCommand */ -export const de_DescribeInboundIntegrationsCommand = async ( +export const de_RotateEncryptionKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeInboundIntegrationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_InboundIntegrationsMessage(data.DescribeInboundIntegrationsResult, context); - const response: DescribeInboundIntegrationsCommandOutput = { + contents = de_RotateEncryptionKeyResult(data.RotateEncryptionKeyResult, context); + const response: RotateEncryptionKeyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6919,51 +5731,19 @@ export const de_DescribeInboundIntegrationsCommand = async ( }; /** - * deserializeAws_queryDescribeInboundIntegrationsCommandError - */ -const de_DescribeInboundIntegrationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IntegrationNotFoundFault": - case "com.amazonaws.redshift#IntegrationNotFoundFault": - throw await de_IntegrationNotFoundFaultRes(parsedOutput, context); - case "InvalidNamespaceFault": - case "com.amazonaws.redshift#InvalidNamespaceFault": - throw await de_InvalidNamespaceFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeLoggingStatusCommand + * deserializeAws_queryUpdatePartnerStatusCommand */ -export const de_DescribeLoggingStatusCommand = async ( +export const de_UpdatePartnerStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeLoggingStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_LoggingStatus(data.DescribeLoggingStatusResult, context); - const response: DescribeLoggingStatusCommandOutput = { + contents = de_PartnerIntegrationOutputMessage(data.UpdatePartnerStatusResult, context); + const response: UpdatePartnerStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6971,3381 +5751,430 @@ export const de_DescribeLoggingStatusCommand = async ( }; /** - * deserializeAws_queryDescribeLoggingStatusCommandError + * deserialize_Aws_queryCommandError */ -const de_DescribeLoggingStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); + case "DependentServiceUnavailableFault": + case "com.amazonaws.redshift#DependentServiceUnavailableFault": + throw await de_DependentServiceUnavailableFaultRes(parsedOutput, context); + case "InvalidReservedNodeState": + case "com.amazonaws.redshift#InvalidReservedNodeStateFault": + throw await de_InvalidReservedNodeStateFaultRes(parsedOutput, context); + case "ReservedNodeAlreadyExists": + case "com.amazonaws.redshift#ReservedNodeAlreadyExistsFault": + throw await de_ReservedNodeAlreadyExistsFaultRes(parsedOutput, context); + case "ReservedNodeAlreadyMigrated": + case "com.amazonaws.redshift#ReservedNodeAlreadyMigratedFault": + throw await de_ReservedNodeAlreadyMigratedFaultRes(parsedOutput, context); + case "ReservedNodeNotFound": + case "com.amazonaws.redshift#ReservedNodeNotFoundFault": + throw await de_ReservedNodeNotFoundFaultRes(parsedOutput, context); + case "ReservedNodeOfferingNotFound": + case "com.amazonaws.redshift#ReservedNodeOfferingNotFoundFault": + throw await de_ReservedNodeOfferingNotFoundFaultRes(parsedOutput, context); case "UnsupportedOperation": case "com.amazonaws.redshift#UnsupportedOperationFault": throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeNodeConfigurationOptionsCommand - */ -export const de_DescribeNodeConfigurationOptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeNodeConfigurationOptionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_NodeConfigurationOptionsMessage(data.DescribeNodeConfigurationOptionsResult, context); - const response: DescribeNodeConfigurationOptionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeNodeConfigurationOptionsCommandError - */ -const de_DescribeNodeConfigurationOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessToSnapshotDenied": - case "com.amazonaws.redshift#AccessToSnapshotDeniedFault": - throw await de_AccessToSnapshotDeniedFaultRes(parsedOutput, context); - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "ClusterSnapshotNotFound": - case "com.amazonaws.redshift#ClusterSnapshotNotFoundFault": - throw await de_ClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterSnapshotState": - case "com.amazonaws.redshift#InvalidClusterSnapshotStateFault": - throw await de_InvalidClusterSnapshotStateFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeOrderableClusterOptionsCommand - */ -export const de_DescribeOrderableClusterOptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeOrderableClusterOptionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_OrderableClusterOptionsMessage(data.DescribeOrderableClusterOptionsResult, context); - const response: DescribeOrderableClusterOptionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeOrderableClusterOptionsCommandError - */ -const de_DescribeOrderableClusterOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryDescribePartnersCommand - */ -export const de_DescribePartnersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribePartnersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribePartnersOutputMessage(data.DescribePartnersResult, context); - const response: DescribePartnersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribePartnersCommandError - */ -const de_DescribePartnersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { case "ClusterNotFound": case "com.amazonaws.redshift#ClusterNotFoundFault": throw await de_ClusterNotFoundFaultRes(parsedOutput, context); + case "PartnerNotFound": + case "com.amazonaws.redshift#PartnerNotFoundFault": + throw await de_PartnerNotFoundFaultRes(parsedOutput, context); case "UnauthorizedPartnerIntegration": case "com.amazonaws.redshift#UnauthorizedPartnerIntegrationFault": throw await de_UnauthorizedPartnerIntegrationFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeRedshiftIdcApplicationsCommand - */ -export const de_DescribeRedshiftIdcApplicationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeRedshiftIdcApplicationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeRedshiftIdcApplicationsResult(data.DescribeRedshiftIdcApplicationsResult, context); - const response: DescribeRedshiftIdcApplicationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeRedshiftIdcApplicationsCommandError - */ -const de_DescribeRedshiftIdcApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependentServiceAccessDenied": - case "com.amazonaws.redshift#DependentServiceAccessDeniedFault": - throw await de_DependentServiceAccessDeniedFaultRes(parsedOutput, context); - case "DependentServiceUnavailableFault": - case "com.amazonaws.redshift#DependentServiceUnavailableFault": - throw await de_DependentServiceUnavailableFaultRes(parsedOutput, context); - case "RedshiftIdcApplicationNotExists": - case "com.amazonaws.redshift#RedshiftIdcApplicationNotExistsFault": - throw await de_RedshiftIdcApplicationNotExistsFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeReservedNodeExchangeStatusCommand - */ -export const de_DescribeReservedNodeExchangeStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeReservedNodeExchangeStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeReservedNodeExchangeStatusOutputMessage(data.DescribeReservedNodeExchangeStatusResult, context); - const response: DescribeReservedNodeExchangeStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeReservedNodeExchangeStatusCommandError - */ -const de_DescribeReservedNodeExchangeStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ReservedNodeExchangeNotFond": - case "com.amazonaws.redshift#ReservedNodeExchangeNotFoundFault": - throw await de_ReservedNodeExchangeNotFoundFaultRes(parsedOutput, context); - case "ReservedNodeNotFound": - case "com.amazonaws.redshift#ReservedNodeNotFoundFault": - throw await de_ReservedNodeNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeReservedNodeOfferingsCommand - */ -export const de_DescribeReservedNodeOfferingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeReservedNodeOfferingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ReservedNodeOfferingsMessage(data.DescribeReservedNodeOfferingsResult, context); - const response: DescribeReservedNodeOfferingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeReservedNodeOfferingsCommandError - */ -const de_DescribeReservedNodeOfferingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependentServiceUnavailableFault": - case "com.amazonaws.redshift#DependentServiceUnavailableFault": - throw await de_DependentServiceUnavailableFaultRes(parsedOutput, context); - case "ReservedNodeOfferingNotFound": - case "com.amazonaws.redshift#ReservedNodeOfferingNotFoundFault": - throw await de_ReservedNodeOfferingNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeReservedNodesCommand - */ -export const de_DescribeReservedNodesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeReservedNodesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ReservedNodesMessage(data.DescribeReservedNodesResult, context); - const response: DescribeReservedNodesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeReservedNodesCommandError - */ -const de_DescribeReservedNodesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependentServiceUnavailableFault": - case "com.amazonaws.redshift#DependentServiceUnavailableFault": - throw await de_DependentServiceUnavailableFaultRes(parsedOutput, context); - case "ReservedNodeNotFound": - case "com.amazonaws.redshift#ReservedNodeNotFoundFault": - throw await de_ReservedNodeNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeResizeCommand - */ -export const de_DescribeResizeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeResizeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ResizeProgressMessage(data.DescribeResizeResult, context); - const response: DescribeResizeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeResizeCommandError - */ -const de_DescribeResizeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "ResizeNotFound": - case "com.amazonaws.redshift#ResizeNotFoundFault": - throw await de_ResizeNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeScheduledActionsCommand - */ -export const de_DescribeScheduledActionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeScheduledActionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ScheduledActionsMessage(data.DescribeScheduledActionsResult, context); - const response: DescribeScheduledActionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeScheduledActionsCommandError - */ -const de_DescribeScheduledActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ScheduledActionNotFound": - case "com.amazonaws.redshift#ScheduledActionNotFoundFault": - throw await de_ScheduledActionNotFoundFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeSnapshotCopyGrantsCommand - */ -export const de_DescribeSnapshotCopyGrantsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeSnapshotCopyGrantsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SnapshotCopyGrantMessage(data.DescribeSnapshotCopyGrantsResult, context); - const response: DescribeSnapshotCopyGrantsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeSnapshotCopyGrantsCommandError - */ -const de_DescribeSnapshotCopyGrantsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "SnapshotCopyGrantNotFoundFault": - case "com.amazonaws.redshift#SnapshotCopyGrantNotFoundFault": - throw await de_SnapshotCopyGrantNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeSnapshotSchedulesCommand - */ -export const de_DescribeSnapshotSchedulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeSnapshotSchedulesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeSnapshotSchedulesOutputMessage(data.DescribeSnapshotSchedulesResult, context); - const response: DescribeSnapshotSchedulesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeSnapshotSchedulesCommandError - */ -const de_DescribeSnapshotSchedulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryDescribeStorageCommand - */ -export const de_DescribeStorageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeStorageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CustomerStorageMessage(data.DescribeStorageResult, context); - const response: DescribeStorageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeStorageCommandError - */ -const de_DescribeStorageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryDescribeTableRestoreStatusCommand - */ -export const de_DescribeTableRestoreStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeTableRestoreStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_TableRestoreStatusMessage(data.DescribeTableRestoreStatusResult, context); - const response: DescribeTableRestoreStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeTableRestoreStatusCommandError - */ -const de_DescribeTableRestoreStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "TableRestoreNotFoundFault": - case "com.amazonaws.redshift#TableRestoreNotFoundFault": - throw await de_TableRestoreNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeTagsCommand - */ -export const de_DescribeTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_TaggedResourceListMessage(data.DescribeTagsResult, context); - const response: DescribeTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeTagsCommandError - */ -const de_DescribeTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.redshift#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDescribeUsageLimitsCommand - */ -export const de_DescribeUsageLimitsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeUsageLimitsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UsageLimitList(data.DescribeUsageLimitsResult, context); - const response: DescribeUsageLimitsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDescribeUsageLimitsCommandError - */ -const de_DescribeUsageLimitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDisableLoggingCommand - */ -export const de_DisableLoggingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisableLoggingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_LoggingStatus(data.DisableLoggingResult, context); - const response: DisableLoggingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDisableLoggingCommandError - */ -const de_DisableLoggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDisableSnapshotCopyCommand - */ -export const de_DisableSnapshotCopyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisableSnapshotCopyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DisableSnapshotCopyResult(data.DisableSnapshotCopyResult, context); - const response: DisableSnapshotCopyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDisableSnapshotCopyCommandError - */ -const de_DisableSnapshotCopyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "SnapshotCopyAlreadyDisabledFault": - case "com.amazonaws.redshift#SnapshotCopyAlreadyDisabledFault": - throw await de_SnapshotCopyAlreadyDisabledFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDisassociateDataShareConsumerCommand - */ -export const de_DisassociateDataShareConsumerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisassociateDataShareConsumerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DataShare(data.DisassociateDataShareConsumerResult, context); - const response: DisassociateDataShareConsumerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryDisassociateDataShareConsumerCommandError - */ -const de_DisassociateDataShareConsumerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidDataShareFault": - case "com.amazonaws.redshift#InvalidDataShareFault": - throw await de_InvalidDataShareFaultRes(parsedOutput, context); - case "InvalidNamespaceFault": - case "com.amazonaws.redshift#InvalidNamespaceFault": - throw await de_InvalidNamespaceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryEnableLoggingCommand - */ -export const de_EnableLoggingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_EnableLoggingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_LoggingStatus(data.EnableLoggingResult, context); - const response: EnableLoggingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryEnableLoggingCommandError - */ -const de_EnableLoggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BucketNotFoundFault": - case "com.amazonaws.redshift#BucketNotFoundFault": - throw await de_BucketNotFoundFaultRes(parsedOutput, context); - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InsufficientS3BucketPolicyFault": - case "com.amazonaws.redshift#InsufficientS3BucketPolicyFault": - throw await de_InsufficientS3BucketPolicyFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidS3BucketNameFault": - case "com.amazonaws.redshift#InvalidS3BucketNameFault": - throw await de_InvalidS3BucketNameFaultRes(parsedOutput, context); - case "InvalidS3KeyPrefixFault": - case "com.amazonaws.redshift#InvalidS3KeyPrefixFault": - throw await de_InvalidS3KeyPrefixFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryEnableSnapshotCopyCommand - */ -export const de_EnableSnapshotCopyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_EnableSnapshotCopyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_EnableSnapshotCopyResult(data.EnableSnapshotCopyResult, context); - const response: EnableSnapshotCopyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryEnableSnapshotCopyCommandError - */ -const de_EnableSnapshotCopyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "CopyToRegionDisabledFault": - case "com.amazonaws.redshift#CopyToRegionDisabledFault": - throw await de_CopyToRegionDisabledFaultRes(parsedOutput, context); - case "DependentServiceRequestThrottlingFault": - case "com.amazonaws.redshift#DependentServiceRequestThrottlingFault": - throw await de_DependentServiceRequestThrottlingFaultRes(parsedOutput, context); - case "IncompatibleOrderableOptions": - case "com.amazonaws.redshift#IncompatibleOrderableOptions": - throw await de_IncompatibleOrderableOptionsRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidRetentionPeriodFault": - case "com.amazonaws.redshift#InvalidRetentionPeriodFault": - throw await de_InvalidRetentionPeriodFaultRes(parsedOutput, context); - case "LimitExceededFault": - case "com.amazonaws.redshift#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "SnapshotCopyAlreadyEnabledFault": - case "com.amazonaws.redshift#SnapshotCopyAlreadyEnabledFault": - throw await de_SnapshotCopyAlreadyEnabledFaultRes(parsedOutput, context); - case "SnapshotCopyGrantNotFoundFault": - case "com.amazonaws.redshift#SnapshotCopyGrantNotFoundFault": - throw await de_SnapshotCopyGrantNotFoundFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - case "UnknownSnapshotCopyRegionFault": - case "com.amazonaws.redshift#UnknownSnapshotCopyRegionFault": - throw await de_UnknownSnapshotCopyRegionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryFailoverPrimaryComputeCommand - */ -export const de_FailoverPrimaryComputeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_FailoverPrimaryComputeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_FailoverPrimaryComputeResult(data.FailoverPrimaryComputeResult, context); - const response: FailoverPrimaryComputeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryFailoverPrimaryComputeCommandError - */ -const de_FailoverPrimaryComputeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetClusterCredentialsCommand - */ -export const de_GetClusterCredentialsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetClusterCredentialsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ClusterCredentials(data.GetClusterCredentialsResult, context); - const response: GetClusterCredentialsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetClusterCredentialsCommandError - */ -const de_GetClusterCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetClusterCredentialsWithIAMCommand - */ -export const de_GetClusterCredentialsWithIAMCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetClusterCredentialsWithIAMCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ClusterExtendedCredentials(data.GetClusterCredentialsWithIAMResult, context); - const response: GetClusterCredentialsWithIAMCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetClusterCredentialsWithIAMCommandError - */ -const de_GetClusterCredentialsWithIAMCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetReservedNodeExchangeConfigurationOptionsCommand - */ -export const de_GetReservedNodeExchangeConfigurationOptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetReservedNodeExchangeConfigurationOptionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetReservedNodeExchangeConfigurationOptionsOutputMessage( - data.GetReservedNodeExchangeConfigurationOptionsResult, - context - ); - const response: GetReservedNodeExchangeConfigurationOptionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetReservedNodeExchangeConfigurationOptionsCommandError - */ -const de_GetReservedNodeExchangeConfigurationOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "ClusterSnapshotNotFound": - case "com.amazonaws.redshift#ClusterSnapshotNotFoundFault": - throw await de_ClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "DependentServiceUnavailableFault": - case "com.amazonaws.redshift#DependentServiceUnavailableFault": - throw await de_DependentServiceUnavailableFaultRes(parsedOutput, context); - case "InvalidReservedNodeState": - case "com.amazonaws.redshift#InvalidReservedNodeStateFault": - throw await de_InvalidReservedNodeStateFaultRes(parsedOutput, context); - case "ReservedNodeAlreadyMigrated": - case "com.amazonaws.redshift#ReservedNodeAlreadyMigratedFault": - throw await de_ReservedNodeAlreadyMigratedFaultRes(parsedOutput, context); - case "ReservedNodeNotFound": - case "com.amazonaws.redshift#ReservedNodeNotFoundFault": - throw await de_ReservedNodeNotFoundFaultRes(parsedOutput, context); - case "ReservedNodeOfferingNotFound": - case "com.amazonaws.redshift#ReservedNodeOfferingNotFoundFault": - throw await de_ReservedNodeOfferingNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetReservedNodeExchangeOfferingsCommand - */ -export const de_GetReservedNodeExchangeOfferingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetReservedNodeExchangeOfferingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetReservedNodeExchangeOfferingsOutputMessage(data.GetReservedNodeExchangeOfferingsResult, context); - const response: GetReservedNodeExchangeOfferingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetReservedNodeExchangeOfferingsCommandError - */ -const de_GetReservedNodeExchangeOfferingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependentServiceUnavailableFault": - case "com.amazonaws.redshift#DependentServiceUnavailableFault": - throw await de_DependentServiceUnavailableFaultRes(parsedOutput, context); - case "InvalidReservedNodeState": - case "com.amazonaws.redshift#InvalidReservedNodeStateFault": - throw await de_InvalidReservedNodeStateFaultRes(parsedOutput, context); - case "ReservedNodeAlreadyMigrated": - case "com.amazonaws.redshift#ReservedNodeAlreadyMigratedFault": - throw await de_ReservedNodeAlreadyMigratedFaultRes(parsedOutput, context); - case "ReservedNodeNotFound": - case "com.amazonaws.redshift#ReservedNodeNotFoundFault": - throw await de_ReservedNodeNotFoundFaultRes(parsedOutput, context); - case "ReservedNodeOfferingNotFound": - case "com.amazonaws.redshift#ReservedNodeOfferingNotFoundFault": - throw await de_ReservedNodeOfferingNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetResourcePolicyCommand - */ -export const de_GetResourcePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetResourcePolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetResourcePolicyResult(data.GetResourcePolicyResult, context); - const response: GetResourcePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetResourcePolicyCommandError - */ -const de_GetResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidPolicyFault": - case "com.amazonaws.redshift#InvalidPolicyFault": - throw await de_InvalidPolicyFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.redshift#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyAquaConfigurationCommand - */ -export const de_ModifyAquaConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyAquaConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyAquaOutputMessage(data.ModifyAquaConfigurationResult, context); - const response: ModifyAquaConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyAquaConfigurationCommandError - */ -const de_ModifyAquaConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyAuthenticationProfileCommand - */ -export const de_ModifyAuthenticationProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyAuthenticationProfileCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyAuthenticationProfileResult(data.ModifyAuthenticationProfileResult, context); - const response: ModifyAuthenticationProfileCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyAuthenticationProfileCommandError - */ -const de_ModifyAuthenticationProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthenticationProfileNotFoundFault": - case "com.amazonaws.redshift#AuthenticationProfileNotFoundFault": - throw await de_AuthenticationProfileNotFoundFaultRes(parsedOutput, context); - case "AuthenticationProfileQuotaExceededFault": - case "com.amazonaws.redshift#AuthenticationProfileQuotaExceededFault": - throw await de_AuthenticationProfileQuotaExceededFaultRes(parsedOutput, context); - case "InvalidAuthenticationProfileRequestFault": - case "com.amazonaws.redshift#InvalidAuthenticationProfileRequestFault": - throw await de_InvalidAuthenticationProfileRequestFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyClusterCommand - */ -export const de_ModifyClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyClusterResult(data.ModifyClusterResult, context); - const response: ModifyClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyClusterCommandError - */ -const de_ModifyClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterAlreadyExists": - case "com.amazonaws.redshift#ClusterAlreadyExistsFault": - throw await de_ClusterAlreadyExistsFaultRes(parsedOutput, context); - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "ClusterParameterGroupNotFound": - case "com.amazonaws.redshift#ClusterParameterGroupNotFoundFault": - throw await de_ClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ClusterSecurityGroupNotFound": - case "com.amazonaws.redshift#ClusterSecurityGroupNotFoundFault": - throw await de_ClusterSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "CustomCnameAssociationFault": - case "com.amazonaws.redshift#CustomCnameAssociationFault": - throw await de_CustomCnameAssociationFaultRes(parsedOutput, context); - case "DependentServiceRequestThrottlingFault": - case "com.amazonaws.redshift#DependentServiceRequestThrottlingFault": - throw await de_DependentServiceRequestThrottlingFaultRes(parsedOutput, context); - case "HsmClientCertificateNotFoundFault": - case "com.amazonaws.redshift#HsmClientCertificateNotFoundFault": - throw await de_HsmClientCertificateNotFoundFaultRes(parsedOutput, context); - case "HsmConfigurationNotFoundFault": - case "com.amazonaws.redshift#HsmConfigurationNotFoundFault": - throw await de_HsmConfigurationNotFoundFaultRes(parsedOutput, context); - case "InsufficientClusterCapacity": - case "com.amazonaws.redshift#InsufficientClusterCapacityFault": - throw await de_InsufficientClusterCapacityFaultRes(parsedOutput, context); - case "InvalidClusterSecurityGroupState": - case "com.amazonaws.redshift#InvalidClusterSecurityGroupStateFault": - throw await de_InvalidClusterSecurityGroupStateFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidClusterTrack": - case "com.amazonaws.redshift#InvalidClusterTrackFault": - throw await de_InvalidClusterTrackFaultRes(parsedOutput, context); - case "InvalidElasticIpFault": - case "com.amazonaws.redshift#InvalidElasticIpFault": - throw await de_InvalidElasticIpFaultRes(parsedOutput, context); - case "InvalidRetentionPeriodFault": - case "com.amazonaws.redshift#InvalidRetentionPeriodFault": - throw await de_InvalidRetentionPeriodFaultRes(parsedOutput, context); - case "Ipv6CidrBlockNotFoundFault": - case "com.amazonaws.redshift#Ipv6CidrBlockNotFoundFault": - throw await de_Ipv6CidrBlockNotFoundFaultRes(parsedOutput, context); - case "LimitExceededFault": - case "com.amazonaws.redshift#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "NumberOfNodesPerClusterLimitExceeded": - case "com.amazonaws.redshift#NumberOfNodesPerClusterLimitExceededFault": - throw await de_NumberOfNodesPerClusterLimitExceededFaultRes(parsedOutput, context); - case "NumberOfNodesQuotaExceeded": - case "com.amazonaws.redshift#NumberOfNodesQuotaExceededFault": - throw await de_NumberOfNodesQuotaExceededFaultRes(parsedOutput, context); - case "TableLimitExceeded": - case "com.amazonaws.redshift#TableLimitExceededFault": - throw await de_TableLimitExceededFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - case "UnsupportedOptionFault": - case "com.amazonaws.redshift#UnsupportedOptionFault": - throw await de_UnsupportedOptionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyClusterDbRevisionCommand - */ -export const de_ModifyClusterDbRevisionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyClusterDbRevisionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyClusterDbRevisionResult(data.ModifyClusterDbRevisionResult, context); - const response: ModifyClusterDbRevisionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyClusterDbRevisionCommandError - */ -const de_ModifyClusterDbRevisionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "ClusterOnLatestRevision": - case "com.amazonaws.redshift#ClusterOnLatestRevisionFault": - throw await de_ClusterOnLatestRevisionFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyClusterIamRolesCommand - */ -export const de_ModifyClusterIamRolesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyClusterIamRolesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyClusterIamRolesResult(data.ModifyClusterIamRolesResult, context); - const response: ModifyClusterIamRolesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyClusterIamRolesCommandError - */ -const de_ModifyClusterIamRolesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyClusterMaintenanceCommand - */ -export const de_ModifyClusterMaintenanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyClusterMaintenanceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyClusterMaintenanceResult(data.ModifyClusterMaintenanceResult, context); - const response: ModifyClusterMaintenanceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyClusterMaintenanceCommandError - */ -const de_ModifyClusterMaintenanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyClusterParameterGroupCommand - */ -export const de_ModifyClusterParameterGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyClusterParameterGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ClusterParameterGroupNameMessage(data.ModifyClusterParameterGroupResult, context); - const response: ModifyClusterParameterGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyClusterParameterGroupCommandError - */ -const de_ModifyClusterParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterParameterGroupNotFound": - case "com.amazonaws.redshift#ClusterParameterGroupNotFoundFault": - throw await de_ClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterParameterGroupState": - case "com.amazonaws.redshift#InvalidClusterParameterGroupStateFault": - throw await de_InvalidClusterParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyClusterSnapshotCommand - */ -export const de_ModifyClusterSnapshotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyClusterSnapshotCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyClusterSnapshotResult(data.ModifyClusterSnapshotResult, context); - const response: ModifyClusterSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyClusterSnapshotCommandError - */ -const de_ModifyClusterSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterSnapshotNotFound": - case "com.amazonaws.redshift#ClusterSnapshotNotFoundFault": - throw await de_ClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterSnapshotState": - case "com.amazonaws.redshift#InvalidClusterSnapshotStateFault": - throw await de_InvalidClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidRetentionPeriodFault": - case "com.amazonaws.redshift#InvalidRetentionPeriodFault": - throw await de_InvalidRetentionPeriodFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyClusterSnapshotScheduleCommand - */ -export const de_ModifyClusterSnapshotScheduleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyClusterSnapshotScheduleCommandError(output, context); - } - await collectBody(output.body, context); - const response: ModifyClusterSnapshotScheduleCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryModifyClusterSnapshotScheduleCommandError - */ -const de_ModifyClusterSnapshotScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterSnapshotScheduleState": - case "com.amazonaws.redshift#InvalidClusterSnapshotScheduleStateFault": - throw await de_InvalidClusterSnapshotScheduleStateFaultRes(parsedOutput, context); - case "SnapshotScheduleNotFound": - case "com.amazonaws.redshift#SnapshotScheduleNotFoundFault": - throw await de_SnapshotScheduleNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyClusterSubnetGroupCommand - */ -export const de_ModifyClusterSubnetGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyClusterSubnetGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyClusterSubnetGroupResult(data.ModifyClusterSubnetGroupResult, context); - const response: ModifyClusterSubnetGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyClusterSubnetGroupCommandError - */ -const de_ModifyClusterSubnetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterSubnetGroupNotFoundFault": - case "com.amazonaws.redshift#ClusterSubnetGroupNotFoundFault": - throw await de_ClusterSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "ClusterSubnetQuotaExceededFault": - case "com.amazonaws.redshift#ClusterSubnetQuotaExceededFault": - throw await de_ClusterSubnetQuotaExceededFaultRes(parsedOutput, context); - case "DependentServiceRequestThrottlingFault": - case "com.amazonaws.redshift#DependentServiceRequestThrottlingFault": - throw await de_DependentServiceRequestThrottlingFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.redshift#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "SubnetAlreadyInUse": - case "com.amazonaws.redshift#SubnetAlreadyInUse": - throw await de_SubnetAlreadyInUseRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyCustomDomainAssociationCommand - */ -export const de_ModifyCustomDomainAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyCustomDomainAssociationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyCustomDomainAssociationResult(data.ModifyCustomDomainAssociationResult, context); - const response: ModifyCustomDomainAssociationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyCustomDomainAssociationCommandError - */ -const de_ModifyCustomDomainAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "CustomCnameAssociationFault": - case "com.amazonaws.redshift#CustomCnameAssociationFault": - throw await de_CustomCnameAssociationFaultRes(parsedOutput, context); - case "CustomDomainAssociationNotFoundFault": - case "com.amazonaws.redshift#CustomDomainAssociationNotFoundFault": - throw await de_CustomDomainAssociationNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyEndpointAccessCommand - */ -export const de_ModifyEndpointAccessCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyEndpointAccessCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_EndpointAccess(data.ModifyEndpointAccessResult, context); - const response: ModifyEndpointAccessCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyEndpointAccessCommandError - */ -const de_ModifyEndpointAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "EndpointNotFound": - case "com.amazonaws.redshift#EndpointNotFoundFault": - throw await de_EndpointNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterSecurityGroupState": - case "com.amazonaws.redshift#InvalidClusterSecurityGroupStateFault": - throw await de_InvalidClusterSecurityGroupStateFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidEndpointState": - case "com.amazonaws.redshift#InvalidEndpointStateFault": - throw await de_InvalidEndpointStateFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyEventSubscriptionCommand - */ -export const de_ModifyEventSubscriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyEventSubscriptionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyEventSubscriptionResult(data.ModifyEventSubscriptionResult, context); - const response: ModifyEventSubscriptionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyEventSubscriptionCommandError - */ -const de_ModifyEventSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidSubscriptionStateFault": - case "com.amazonaws.redshift#InvalidSubscriptionStateFault": - throw await de_InvalidSubscriptionStateFaultRes(parsedOutput, context); - case "SNSInvalidTopic": - case "com.amazonaws.redshift#SNSInvalidTopicFault": - throw await de_SNSInvalidTopicFaultRes(parsedOutput, context); - case "SNSNoAuthorization": - case "com.amazonaws.redshift#SNSNoAuthorizationFault": - throw await de_SNSNoAuthorizationFaultRes(parsedOutput, context); - case "SNSTopicArnNotFound": - case "com.amazonaws.redshift#SNSTopicArnNotFoundFault": - throw await de_SNSTopicArnNotFoundFaultRes(parsedOutput, context); - case "SourceNotFound": - case "com.amazonaws.redshift#SourceNotFoundFault": - throw await de_SourceNotFoundFaultRes(parsedOutput, context); - case "SubscriptionCategoryNotFound": - case "com.amazonaws.redshift#SubscriptionCategoryNotFoundFault": - throw await de_SubscriptionCategoryNotFoundFaultRes(parsedOutput, context); - case "SubscriptionEventIdNotFound": - case "com.amazonaws.redshift#SubscriptionEventIdNotFoundFault": - throw await de_SubscriptionEventIdNotFoundFaultRes(parsedOutput, context); - case "SubscriptionNotFound": - case "com.amazonaws.redshift#SubscriptionNotFoundFault": - throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); - case "SubscriptionSeverityNotFound": - case "com.amazonaws.redshift#SubscriptionSeverityNotFoundFault": - throw await de_SubscriptionSeverityNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyRedshiftIdcApplicationCommand - */ -export const de_ModifyRedshiftIdcApplicationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyRedshiftIdcApplicationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifyRedshiftIdcApplicationResult(data.ModifyRedshiftIdcApplicationResult, context); - const response: ModifyRedshiftIdcApplicationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyRedshiftIdcApplicationCommandError - */ -const de_ModifyRedshiftIdcApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DependentServiceAccessDenied": - case "com.amazonaws.redshift#DependentServiceAccessDeniedFault": - throw await de_DependentServiceAccessDeniedFaultRes(parsedOutput, context); - case "DependentServiceUnavailableFault": - case "com.amazonaws.redshift#DependentServiceUnavailableFault": - throw await de_DependentServiceUnavailableFaultRes(parsedOutput, context); - case "RedshiftIdcApplicationNotExists": - case "com.amazonaws.redshift#RedshiftIdcApplicationNotExistsFault": - throw await de_RedshiftIdcApplicationNotExistsFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyScheduledActionCommand - */ -export const de_ModifyScheduledActionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyScheduledActionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ScheduledAction(data.ModifyScheduledActionResult, context); - const response: ModifyScheduledActionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyScheduledActionCommandError - */ -const de_ModifyScheduledActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidSchedule": - case "com.amazonaws.redshift#InvalidScheduleFault": - throw await de_InvalidScheduleFaultRes(parsedOutput, context); - case "InvalidScheduledAction": - case "com.amazonaws.redshift#InvalidScheduledActionFault": - throw await de_InvalidScheduledActionFaultRes(parsedOutput, context); - case "ScheduledActionNotFound": - case "com.amazonaws.redshift#ScheduledActionNotFoundFault": - throw await de_ScheduledActionNotFoundFaultRes(parsedOutput, context); - case "ScheduledActionTypeUnsupported": - case "com.amazonaws.redshift#ScheduledActionTypeUnsupportedFault": - throw await de_ScheduledActionTypeUnsupportedFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifySnapshotCopyRetentionPeriodCommand - */ -export const de_ModifySnapshotCopyRetentionPeriodCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifySnapshotCopyRetentionPeriodCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ModifySnapshotCopyRetentionPeriodResult(data.ModifySnapshotCopyRetentionPeriodResult, context); - const response: ModifySnapshotCopyRetentionPeriodCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifySnapshotCopyRetentionPeriodCommandError - */ -const de_ModifySnapshotCopyRetentionPeriodCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidRetentionPeriodFault": - case "com.amazonaws.redshift#InvalidRetentionPeriodFault": - throw await de_InvalidRetentionPeriodFaultRes(parsedOutput, context); - case "SnapshotCopyDisabledFault": - case "com.amazonaws.redshift#SnapshotCopyDisabledFault": - throw await de_SnapshotCopyDisabledFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifySnapshotScheduleCommand - */ -export const de_ModifySnapshotScheduleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifySnapshotScheduleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SnapshotSchedule(data.ModifySnapshotScheduleResult, context); - const response: ModifySnapshotScheduleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifySnapshotScheduleCommandError - */ -const de_ModifySnapshotScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidSchedule": - case "com.amazonaws.redshift#InvalidScheduleFault": - throw await de_InvalidScheduleFaultRes(parsedOutput, context); - case "SnapshotScheduleNotFound": - case "com.amazonaws.redshift#SnapshotScheduleNotFoundFault": - throw await de_SnapshotScheduleNotFoundFaultRes(parsedOutput, context); - case "SnapshotScheduleUpdateInProgress": - case "com.amazonaws.redshift#SnapshotScheduleUpdateInProgressFault": - throw await de_SnapshotScheduleUpdateInProgressFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryModifyUsageLimitCommand - */ -export const de_ModifyUsageLimitCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyUsageLimitCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UsageLimit(data.ModifyUsageLimitResult, context); - const response: ModifyUsageLimitCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryModifyUsageLimitCommandError - */ -const de_ModifyUsageLimitCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidUsageLimit": - case "com.amazonaws.redshift#InvalidUsageLimitFault": - throw await de_InvalidUsageLimitFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - case "UsageLimitNotFound": - case "com.amazonaws.redshift#UsageLimitNotFoundFault": - throw await de_UsageLimitNotFoundFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPauseClusterCommand - */ -export const de_PauseClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PauseClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PauseClusterResult(data.PauseClusterResult, context); - const response: PauseClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryPauseClusterCommandError - */ -const de_PauseClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPurchaseReservedNodeOfferingCommand - */ -export const de_PurchaseReservedNodeOfferingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PurchaseReservedNodeOfferingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PurchaseReservedNodeOfferingResult(data.PurchaseReservedNodeOfferingResult, context); - const response: PurchaseReservedNodeOfferingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryPurchaseReservedNodeOfferingCommandError - */ -const de_PurchaseReservedNodeOfferingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ReservedNodeAlreadyExists": - case "com.amazonaws.redshift#ReservedNodeAlreadyExistsFault": - throw await de_ReservedNodeAlreadyExistsFaultRes(parsedOutput, context); - case "ReservedNodeOfferingNotFound": - case "com.amazonaws.redshift#ReservedNodeOfferingNotFoundFault": - throw await de_ReservedNodeOfferingNotFoundFaultRes(parsedOutput, context); - case "ReservedNodeQuotaExceeded": - case "com.amazonaws.redshift#ReservedNodeQuotaExceededFault": - throw await de_ReservedNodeQuotaExceededFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPutResourcePolicyCommand - */ -export const de_PutResourcePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PutResourcePolicyResult(data.PutResourcePolicyResult, context); - const response: PutResourcePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryPutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictPolicyUpdateFault": - case "com.amazonaws.redshift#ConflictPolicyUpdateFault": - throw await de_ConflictPolicyUpdateFaultRes(parsedOutput, context); - case "InvalidPolicyFault": - case "com.amazonaws.redshift#InvalidPolicyFault": - throw await de_InvalidPolicyFaultRes(parsedOutput, context); - case "ResourceNotFoundFault": - case "com.amazonaws.redshift#ResourceNotFoundFault": - throw await de_ResourceNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRebootClusterCommand - */ -export const de_RebootClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RebootClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RebootClusterResult(data.RebootClusterResult, context); - const response: RebootClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRebootClusterCommandError - */ -const de_RebootClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRejectDataShareCommand - */ -export const de_RejectDataShareCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RejectDataShareCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DataShare(data.RejectDataShareResult, context); - const response: RejectDataShareCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRejectDataShareCommandError - */ -const de_RejectDataShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidDataShareFault": - case "com.amazonaws.redshift#InvalidDataShareFault": - throw await de_InvalidDataShareFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryResetClusterParameterGroupCommand - */ -export const de_ResetClusterParameterGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ResetClusterParameterGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ClusterParameterGroupNameMessage(data.ResetClusterParameterGroupResult, context); - const response: ResetClusterParameterGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryResetClusterParameterGroupCommandError - */ -const de_ResetClusterParameterGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterParameterGroupNotFound": - case "com.amazonaws.redshift#ClusterParameterGroupNotFoundFault": - throw await de_ClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterParameterGroupState": - case "com.amazonaws.redshift#InvalidClusterParameterGroupStateFault": - throw await de_InvalidClusterParameterGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryResizeClusterCommand - */ -export const de_ResizeClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ResizeClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ResizeClusterResult(data.ResizeClusterResult, context); - const response: ResizeClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryResizeClusterCommandError - */ -const de_ResizeClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "DependentServiceUnavailableFault": - case "com.amazonaws.redshift#DependentServiceUnavailableFault": - throw await de_DependentServiceUnavailableFaultRes(parsedOutput, context); - case "InsufficientClusterCapacity": - case "com.amazonaws.redshift#InsufficientClusterCapacityFault": - throw await de_InsufficientClusterCapacityFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidReservedNodeState": - case "com.amazonaws.redshift#InvalidReservedNodeStateFault": - throw await de_InvalidReservedNodeStateFaultRes(parsedOutput, context); - case "LimitExceededFault": - case "com.amazonaws.redshift#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "NumberOfNodesPerClusterLimitExceeded": - case "com.amazonaws.redshift#NumberOfNodesPerClusterLimitExceededFault": - throw await de_NumberOfNodesPerClusterLimitExceededFaultRes(parsedOutput, context); - case "NumberOfNodesQuotaExceeded": - case "com.amazonaws.redshift#NumberOfNodesQuotaExceededFault": - throw await de_NumberOfNodesQuotaExceededFaultRes(parsedOutput, context); - case "ReservedNodeAlreadyExists": - case "com.amazonaws.redshift#ReservedNodeAlreadyExistsFault": - throw await de_ReservedNodeAlreadyExistsFaultRes(parsedOutput, context); - case "ReservedNodeAlreadyMigrated": - case "com.amazonaws.redshift#ReservedNodeAlreadyMigratedFault": - throw await de_ReservedNodeAlreadyMigratedFaultRes(parsedOutput, context); - case "ReservedNodeNotFound": - case "com.amazonaws.redshift#ReservedNodeNotFoundFault": - throw await de_ReservedNodeNotFoundFaultRes(parsedOutput, context); - case "ReservedNodeOfferingNotFound": - case "com.amazonaws.redshift#ReservedNodeOfferingNotFoundFault": - throw await de_ReservedNodeOfferingNotFoundFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - case "UnsupportedOptionFault": - case "com.amazonaws.redshift#UnsupportedOptionFault": - throw await de_UnsupportedOptionFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRestoreFromClusterSnapshotCommand - */ -export const de_RestoreFromClusterSnapshotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RestoreFromClusterSnapshotCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RestoreFromClusterSnapshotResult(data.RestoreFromClusterSnapshotResult, context); - const response: RestoreFromClusterSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRestoreFromClusterSnapshotCommandError - */ -const de_RestoreFromClusterSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessToSnapshotDenied": - case "com.amazonaws.redshift#AccessToSnapshotDeniedFault": - throw await de_AccessToSnapshotDeniedFaultRes(parsedOutput, context); - case "ClusterAlreadyExists": - case "com.amazonaws.redshift#ClusterAlreadyExistsFault": - throw await de_ClusterAlreadyExistsFaultRes(parsedOutput, context); - case "ClusterParameterGroupNotFound": - case "com.amazonaws.redshift#ClusterParameterGroupNotFoundFault": - throw await de_ClusterParameterGroupNotFoundFaultRes(parsedOutput, context); - case "ClusterQuotaExceeded": - case "com.amazonaws.redshift#ClusterQuotaExceededFault": - throw await de_ClusterQuotaExceededFaultRes(parsedOutput, context); - case "ClusterSecurityGroupNotFound": - case "com.amazonaws.redshift#ClusterSecurityGroupNotFoundFault": - throw await de_ClusterSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "ClusterSnapshotNotFound": - case "com.amazonaws.redshift#ClusterSnapshotNotFoundFault": - throw await de_ClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "ClusterSubnetGroupNotFoundFault": - case "com.amazonaws.redshift#ClusterSubnetGroupNotFoundFault": - throw await de_ClusterSubnetGroupNotFoundFaultRes(parsedOutput, context); - case "DependentServiceRequestThrottlingFault": - case "com.amazonaws.redshift#DependentServiceRequestThrottlingFault": - throw await de_DependentServiceRequestThrottlingFaultRes(parsedOutput, context); - case "DependentServiceUnavailableFault": - case "com.amazonaws.redshift#DependentServiceUnavailableFault": - throw await de_DependentServiceUnavailableFaultRes(parsedOutput, context); - case "HsmClientCertificateNotFoundFault": - case "com.amazonaws.redshift#HsmClientCertificateNotFoundFault": - throw await de_HsmClientCertificateNotFoundFaultRes(parsedOutput, context); - case "HsmConfigurationNotFoundFault": - case "com.amazonaws.redshift#HsmConfigurationNotFoundFault": - throw await de_HsmConfigurationNotFoundFaultRes(parsedOutput, context); - case "InsufficientClusterCapacity": - case "com.amazonaws.redshift#InsufficientClusterCapacityFault": - throw await de_InsufficientClusterCapacityFaultRes(parsedOutput, context); - case "InvalidClusterSnapshotState": - case "com.amazonaws.redshift#InvalidClusterSnapshotStateFault": - throw await de_InvalidClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidClusterSubnetGroupStateFault": - case "com.amazonaws.redshift#InvalidClusterSubnetGroupStateFault": - throw await de_InvalidClusterSubnetGroupStateFaultRes(parsedOutput, context); - case "InvalidClusterTrack": - case "com.amazonaws.redshift#InvalidClusterTrackFault": - throw await de_InvalidClusterTrackFaultRes(parsedOutput, context); - case "InvalidElasticIpFault": - case "com.amazonaws.redshift#InvalidElasticIpFault": - throw await de_InvalidElasticIpFaultRes(parsedOutput, context); - case "InvalidReservedNodeState": - case "com.amazonaws.redshift#InvalidReservedNodeStateFault": - throw await de_InvalidReservedNodeStateFaultRes(parsedOutput, context); - case "InvalidRestore": - case "com.amazonaws.redshift#InvalidRestoreFault": - throw await de_InvalidRestoreFaultRes(parsedOutput, context); - case "InvalidSubnet": - case "com.amazonaws.redshift#InvalidSubnet": - throw await de_InvalidSubnetRes(parsedOutput, context); - case "InvalidTagFault": - case "com.amazonaws.redshift#InvalidTagFault": - throw await de_InvalidTagFaultRes(parsedOutput, context); - case "InvalidVPCNetworkStateFault": - case "com.amazonaws.redshift#InvalidVPCNetworkStateFault": - throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); - case "Ipv6CidrBlockNotFoundFault": - case "com.amazonaws.redshift#Ipv6CidrBlockNotFoundFault": - throw await de_Ipv6CidrBlockNotFoundFaultRes(parsedOutput, context); - case "LimitExceededFault": - case "com.amazonaws.redshift#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "NumberOfNodesPerClusterLimitExceeded": - case "com.amazonaws.redshift#NumberOfNodesPerClusterLimitExceededFault": - throw await de_NumberOfNodesPerClusterLimitExceededFaultRes(parsedOutput, context); - case "NumberOfNodesQuotaExceeded": - case "com.amazonaws.redshift#NumberOfNodesQuotaExceededFault": - throw await de_NumberOfNodesQuotaExceededFaultRes(parsedOutput, context); - case "ReservedNodeAlreadyExists": - case "com.amazonaws.redshift#ReservedNodeAlreadyExistsFault": - throw await de_ReservedNodeAlreadyExistsFaultRes(parsedOutput, context); - case "ReservedNodeAlreadyMigrated": - case "com.amazonaws.redshift#ReservedNodeAlreadyMigratedFault": - throw await de_ReservedNodeAlreadyMigratedFaultRes(parsedOutput, context); - case "ReservedNodeNotFound": - case "com.amazonaws.redshift#ReservedNodeNotFoundFault": - throw await de_ReservedNodeNotFoundFaultRes(parsedOutput, context); - case "ReservedNodeOfferingNotFound": - case "com.amazonaws.redshift#ReservedNodeOfferingNotFoundFault": - throw await de_ReservedNodeOfferingNotFoundFaultRes(parsedOutput, context); - case "SnapshotScheduleNotFound": - case "com.amazonaws.redshift#SnapshotScheduleNotFoundFault": - throw await de_SnapshotScheduleNotFoundFaultRes(parsedOutput, context); - case "TagLimitExceededFault": - case "com.amazonaws.redshift#TagLimitExceededFault": - throw await de_TagLimitExceededFaultRes(parsedOutput, context); - case "UnauthorizedOperation": - case "com.amazonaws.redshift#UnauthorizedOperation": - throw await de_UnauthorizedOperationRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRestoreTableFromClusterSnapshotCommand - */ -export const de_RestoreTableFromClusterSnapshotCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RestoreTableFromClusterSnapshotCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RestoreTableFromClusterSnapshotResult(data.RestoreTableFromClusterSnapshotResult, context); - const response: RestoreTableFromClusterSnapshotCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRestoreTableFromClusterSnapshotCommandError - */ -const de_RestoreTableFromClusterSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "ClusterSnapshotNotFound": - case "com.amazonaws.redshift#ClusterSnapshotNotFoundFault": - throw await de_ClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "InProgressTableRestoreQuotaExceededFault": - case "com.amazonaws.redshift#InProgressTableRestoreQuotaExceededFault": - throw await de_InProgressTableRestoreQuotaExceededFaultRes(parsedOutput, context); - case "InvalidClusterSnapshotState": - case "com.amazonaws.redshift#InvalidClusterSnapshotStateFault": - throw await de_InvalidClusterSnapshotStateFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "InvalidTableRestoreArgument": - case "com.amazonaws.redshift#InvalidTableRestoreArgumentFault": - throw await de_InvalidTableRestoreArgumentFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryResumeClusterCommand - */ -export const de_ResumeClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ResumeClusterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ResumeClusterResult(data.ResumeClusterResult, context); - const response: ResumeClusterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryResumeClusterCommandError - */ -const de_ResumeClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "InsufficientClusterCapacity": - case "com.amazonaws.redshift#InsufficientClusterCapacityFault": - throw await de_InsufficientClusterCapacityFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRevokeClusterSecurityGroupIngressCommand - */ -export const de_RevokeClusterSecurityGroupIngressCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RevokeClusterSecurityGroupIngressCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RevokeClusterSecurityGroupIngressResult(data.RevokeClusterSecurityGroupIngressResult, context); - const response: RevokeClusterSecurityGroupIngressCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRevokeClusterSecurityGroupIngressCommandError - */ -const de_RevokeClusterSecurityGroupIngressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationNotFound": - case "com.amazonaws.redshift#AuthorizationNotFoundFault": - throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); - case "ClusterSecurityGroupNotFound": - case "com.amazonaws.redshift#ClusterSecurityGroupNotFoundFault": - throw await de_ClusterSecurityGroupNotFoundFaultRes(parsedOutput, context); - case "InvalidClusterSecurityGroupState": - case "com.amazonaws.redshift#InvalidClusterSecurityGroupStateFault": - throw await de_InvalidClusterSecurityGroupStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRevokeEndpointAccessCommand - */ -export const de_RevokeEndpointAccessCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RevokeEndpointAccessCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_EndpointAuthorization(data.RevokeEndpointAccessResult, context); - const response: RevokeEndpointAccessCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRevokeEndpointAccessCommandError - */ -const de_RevokeEndpointAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "EndpointAuthorizationNotFound": - case "com.amazonaws.redshift#EndpointAuthorizationNotFoundFault": - throw await de_EndpointAuthorizationNotFoundFaultRes(parsedOutput, context); - case "EndpointNotFound": - case "com.amazonaws.redshift#EndpointNotFoundFault": - throw await de_EndpointNotFoundFaultRes(parsedOutput, context); - case "InvalidAuthorizationState": - case "com.amazonaws.redshift#InvalidAuthorizationStateFault": - throw await de_InvalidAuthorizationStateFaultRes(parsedOutput, context); + case "InvalidDataShareFault": + case "com.amazonaws.redshift#InvalidDataShareFault": + throw await de_InvalidDataShareFaultRes(parsedOutput, context); + case "InvalidNamespaceFault": + case "com.amazonaws.redshift#InvalidNamespaceFault": + throw await de_InvalidNamespaceFaultRes(parsedOutput, context); + case "AuthorizationAlreadyExists": + case "com.amazonaws.redshift#AuthorizationAlreadyExistsFault": + throw await de_AuthorizationAlreadyExistsFaultRes(parsedOutput, context); + case "AuthorizationQuotaExceeded": + case "com.amazonaws.redshift#AuthorizationQuotaExceededFault": + throw await de_AuthorizationQuotaExceededFaultRes(parsedOutput, context); + case "ClusterSecurityGroupNotFound": + case "com.amazonaws.redshift#ClusterSecurityGroupNotFoundFault": + throw await de_ClusterSecurityGroupNotFoundFaultRes(parsedOutput, context); case "InvalidClusterSecurityGroupState": case "com.amazonaws.redshift#InvalidClusterSecurityGroupStateFault": throw await de_InvalidClusterSecurityGroupStateFaultRes(parsedOutput, context); + case "EndpointAuthorizationAlreadyExists": + case "com.amazonaws.redshift#EndpointAuthorizationAlreadyExistsFault": + throw await de_EndpointAuthorizationAlreadyExistsFaultRes(parsedOutput, context); + case "EndpointAuthorizationsPerClusterLimitExceeded": + case "com.amazonaws.redshift#EndpointAuthorizationsPerClusterLimitExceededFault": + throw await de_EndpointAuthorizationsPerClusterLimitExceededFaultRes(parsedOutput, context); + case "InvalidAuthorizationState": + case "com.amazonaws.redshift#InvalidAuthorizationStateFault": + throw await de_InvalidAuthorizationStateFaultRes(parsedOutput, context); case "InvalidClusterState": case "com.amazonaws.redshift#InvalidClusterStateFault": throw await de_InvalidClusterStateFaultRes(parsedOutput, context); + case "ClusterSnapshotNotFound": + case "com.amazonaws.redshift#ClusterSnapshotNotFoundFault": + throw await de_ClusterSnapshotNotFoundFaultRes(parsedOutput, context); + case "DependentServiceRequestThrottlingFault": + case "com.amazonaws.redshift#DependentServiceRequestThrottlingFault": + throw await de_DependentServiceRequestThrottlingFaultRes(parsedOutput, context); + case "InvalidClusterSnapshotState": + case "com.amazonaws.redshift#InvalidClusterSnapshotStateFault": + throw await de_InvalidClusterSnapshotStateFaultRes(parsedOutput, context); + case "LimitExceededFault": + case "com.amazonaws.redshift#LimitExceededFault": + throw await de_LimitExceededFaultRes(parsedOutput, context); + case "BatchDeleteRequestSizeExceeded": + case "com.amazonaws.redshift#BatchDeleteRequestSizeExceededFault": + throw await de_BatchDeleteRequestSizeExceededFaultRes(parsedOutput, context); + case "BatchModifyClusterSnapshotsLimitExceededFault": + case "com.amazonaws.redshift#BatchModifyClusterSnapshotsLimitExceededFault": + throw await de_BatchModifyClusterSnapshotsLimitExceededFaultRes(parsedOutput, context); + case "InvalidRetentionPeriodFault": + case "com.amazonaws.redshift#InvalidRetentionPeriodFault": + throw await de_InvalidRetentionPeriodFaultRes(parsedOutput, context); + case "ResizeNotFound": + case "com.amazonaws.redshift#ResizeNotFoundFault": + throw await de_ResizeNotFoundFaultRes(parsedOutput, context); + case "ClusterSnapshotAlreadyExists": + case "com.amazonaws.redshift#ClusterSnapshotAlreadyExistsFault": + throw await de_ClusterSnapshotAlreadyExistsFaultRes(parsedOutput, context); + case "ClusterSnapshotQuotaExceeded": + case "com.amazonaws.redshift#ClusterSnapshotQuotaExceededFault": + throw await de_ClusterSnapshotQuotaExceededFaultRes(parsedOutput, context); + case "AuthenticationProfileAlreadyExistsFault": + case "com.amazonaws.redshift#AuthenticationProfileAlreadyExistsFault": + throw await de_AuthenticationProfileAlreadyExistsFaultRes(parsedOutput, context); + case "AuthenticationProfileQuotaExceededFault": + case "com.amazonaws.redshift#AuthenticationProfileQuotaExceededFault": + throw await de_AuthenticationProfileQuotaExceededFaultRes(parsedOutput, context); + case "InvalidAuthenticationProfileRequestFault": + case "com.amazonaws.redshift#InvalidAuthenticationProfileRequestFault": + throw await de_InvalidAuthenticationProfileRequestFaultRes(parsedOutput, context); + case "ClusterAlreadyExists": + case "com.amazonaws.redshift#ClusterAlreadyExistsFault": + throw await de_ClusterAlreadyExistsFaultRes(parsedOutput, context); + case "ClusterParameterGroupNotFound": + case "com.amazonaws.redshift#ClusterParameterGroupNotFoundFault": + throw await de_ClusterParameterGroupNotFoundFaultRes(parsedOutput, context); + case "ClusterQuotaExceeded": + case "com.amazonaws.redshift#ClusterQuotaExceededFault": + throw await de_ClusterQuotaExceededFaultRes(parsedOutput, context); + case "ClusterSubnetGroupNotFoundFault": + case "com.amazonaws.redshift#ClusterSubnetGroupNotFoundFault": + throw await de_ClusterSubnetGroupNotFoundFaultRes(parsedOutput, context); + case "HsmClientCertificateNotFoundFault": + case "com.amazonaws.redshift#HsmClientCertificateNotFoundFault": + throw await de_HsmClientCertificateNotFoundFaultRes(parsedOutput, context); + case "HsmConfigurationNotFoundFault": + case "com.amazonaws.redshift#HsmConfigurationNotFoundFault": + throw await de_HsmConfigurationNotFoundFaultRes(parsedOutput, context); + case "InsufficientClusterCapacity": + case "com.amazonaws.redshift#InsufficientClusterCapacityFault": + throw await de_InsufficientClusterCapacityFaultRes(parsedOutput, context); + case "InvalidClusterSubnetGroupStateFault": + case "com.amazonaws.redshift#InvalidClusterSubnetGroupStateFault": + throw await de_InvalidClusterSubnetGroupStateFaultRes(parsedOutput, context); + case "InvalidClusterTrack": + case "com.amazonaws.redshift#InvalidClusterTrackFault": + throw await de_InvalidClusterTrackFaultRes(parsedOutput, context); + case "InvalidElasticIpFault": + case "com.amazonaws.redshift#InvalidElasticIpFault": + throw await de_InvalidElasticIpFaultRes(parsedOutput, context); + case "InvalidSubnet": + case "com.amazonaws.redshift#InvalidSubnet": + throw await de_InvalidSubnetRes(parsedOutput, context); + case "InvalidTagFault": + case "com.amazonaws.redshift#InvalidTagFault": + throw await de_InvalidTagFaultRes(parsedOutput, context); + case "InvalidVPCNetworkStateFault": + case "com.amazonaws.redshift#InvalidVPCNetworkStateFault": + throw await de_InvalidVPCNetworkStateFaultRes(parsedOutput, context); + case "Ipv6CidrBlockNotFoundFault": + case "com.amazonaws.redshift#Ipv6CidrBlockNotFoundFault": + throw await de_Ipv6CidrBlockNotFoundFaultRes(parsedOutput, context); + case "NumberOfNodesPerClusterLimitExceeded": + case "com.amazonaws.redshift#NumberOfNodesPerClusterLimitExceededFault": + throw await de_NumberOfNodesPerClusterLimitExceededFaultRes(parsedOutput, context); + case "NumberOfNodesQuotaExceeded": + case "com.amazonaws.redshift#NumberOfNodesQuotaExceededFault": + throw await de_NumberOfNodesQuotaExceededFaultRes(parsedOutput, context); + case "RedshiftIdcApplicationNotExists": + case "com.amazonaws.redshift#RedshiftIdcApplicationNotExistsFault": + throw await de_RedshiftIdcApplicationNotExistsFaultRes(parsedOutput, context); + case "SnapshotScheduleNotFound": + case "com.amazonaws.redshift#SnapshotScheduleNotFoundFault": + throw await de_SnapshotScheduleNotFoundFaultRes(parsedOutput, context); + case "TagLimitExceededFault": + case "com.amazonaws.redshift#TagLimitExceededFault": + throw await de_TagLimitExceededFaultRes(parsedOutput, context); + case "UnauthorizedOperation": + case "com.amazonaws.redshift#UnauthorizedOperation": + throw await de_UnauthorizedOperationRes(parsedOutput, context); + case "ClusterParameterGroupAlreadyExists": + case "com.amazonaws.redshift#ClusterParameterGroupAlreadyExistsFault": + throw await de_ClusterParameterGroupAlreadyExistsFaultRes(parsedOutput, context); + case "ClusterParameterGroupQuotaExceeded": + case "com.amazonaws.redshift#ClusterParameterGroupQuotaExceededFault": + throw await de_ClusterParameterGroupQuotaExceededFaultRes(parsedOutput, context); + case "ClusterSecurityGroupAlreadyExists": + case "com.amazonaws.redshift#ClusterSecurityGroupAlreadyExistsFault": + throw await de_ClusterSecurityGroupAlreadyExistsFaultRes(parsedOutput, context); + case "QuotaExceeded.ClusterSecurityGroup": + case "com.amazonaws.redshift#ClusterSecurityGroupQuotaExceededFault": + throw await de_ClusterSecurityGroupQuotaExceededFaultRes(parsedOutput, context); + case "ClusterSubnetGroupAlreadyExists": + case "com.amazonaws.redshift#ClusterSubnetGroupAlreadyExistsFault": + throw await de_ClusterSubnetGroupAlreadyExistsFaultRes(parsedOutput, context); + case "ClusterSubnetGroupQuotaExceeded": + case "com.amazonaws.redshift#ClusterSubnetGroupQuotaExceededFault": + throw await de_ClusterSubnetGroupQuotaExceededFaultRes(parsedOutput, context); + case "ClusterSubnetQuotaExceededFault": + case "com.amazonaws.redshift#ClusterSubnetQuotaExceededFault": + throw await de_ClusterSubnetQuotaExceededFaultRes(parsedOutput, context); + case "CustomCnameAssociationFault": + case "com.amazonaws.redshift#CustomCnameAssociationFault": + throw await de_CustomCnameAssociationFaultRes(parsedOutput, context); + case "AccessToClusterDenied": + case "com.amazonaws.redshift#AccessToClusterDeniedFault": + throw await de_AccessToClusterDeniedFaultRes(parsedOutput, context); + case "EndpointAlreadyExists": + case "com.amazonaws.redshift#EndpointAlreadyExistsFault": + throw await de_EndpointAlreadyExistsFaultRes(parsedOutput, context); + case "EndpointsPerAuthorizationLimitExceeded": + case "com.amazonaws.redshift#EndpointsPerAuthorizationLimitExceededFault": + throw await de_EndpointsPerAuthorizationLimitExceededFaultRes(parsedOutput, context); + case "EndpointsPerClusterLimitExceeded": + case "com.amazonaws.redshift#EndpointsPerClusterLimitExceededFault": + throw await de_EndpointsPerClusterLimitExceededFaultRes(parsedOutput, context); + case "EventSubscriptionQuotaExceeded": + case "com.amazonaws.redshift#EventSubscriptionQuotaExceededFault": + throw await de_EventSubscriptionQuotaExceededFaultRes(parsedOutput, context); + case "SNSInvalidTopic": + case "com.amazonaws.redshift#SNSInvalidTopicFault": + throw await de_SNSInvalidTopicFaultRes(parsedOutput, context); + case "SNSNoAuthorization": + case "com.amazonaws.redshift#SNSNoAuthorizationFault": + throw await de_SNSNoAuthorizationFaultRes(parsedOutput, context); + case "SNSTopicArnNotFound": + case "com.amazonaws.redshift#SNSTopicArnNotFoundFault": + throw await de_SNSTopicArnNotFoundFaultRes(parsedOutput, context); + case "SourceNotFound": + case "com.amazonaws.redshift#SourceNotFoundFault": + throw await de_SourceNotFoundFaultRes(parsedOutput, context); + case "SubscriptionAlreadyExist": + case "com.amazonaws.redshift#SubscriptionAlreadyExistFault": + throw await de_SubscriptionAlreadyExistFaultRes(parsedOutput, context); + case "SubscriptionCategoryNotFound": + case "com.amazonaws.redshift#SubscriptionCategoryNotFoundFault": + throw await de_SubscriptionCategoryNotFoundFaultRes(parsedOutput, context); + case "SubscriptionEventIdNotFound": + case "com.amazonaws.redshift#SubscriptionEventIdNotFoundFault": + throw await de_SubscriptionEventIdNotFoundFaultRes(parsedOutput, context); + case "SubscriptionSeverityNotFound": + case "com.amazonaws.redshift#SubscriptionSeverityNotFoundFault": + throw await de_SubscriptionSeverityNotFoundFaultRes(parsedOutput, context); + case "HsmClientCertificateAlreadyExistsFault": + case "com.amazonaws.redshift#HsmClientCertificateAlreadyExistsFault": + throw await de_HsmClientCertificateAlreadyExistsFaultRes(parsedOutput, context); + case "HsmClientCertificateQuotaExceededFault": + case "com.amazonaws.redshift#HsmClientCertificateQuotaExceededFault": + throw await de_HsmClientCertificateQuotaExceededFaultRes(parsedOutput, context); + case "HsmConfigurationAlreadyExistsFault": + case "com.amazonaws.redshift#HsmConfigurationAlreadyExistsFault": + throw await de_HsmConfigurationAlreadyExistsFaultRes(parsedOutput, context); + case "HsmConfigurationQuotaExceededFault": + case "com.amazonaws.redshift#HsmConfigurationQuotaExceededFault": + throw await de_HsmConfigurationQuotaExceededFaultRes(parsedOutput, context); + case "DependentServiceAccessDenied": + case "com.amazonaws.redshift#DependentServiceAccessDeniedFault": + throw await de_DependentServiceAccessDeniedFaultRes(parsedOutput, context); + case "RedshiftIdcApplicationAlreadyExists": + case "com.amazonaws.redshift#RedshiftIdcApplicationAlreadyExistsFault": + throw await de_RedshiftIdcApplicationAlreadyExistsFaultRes(parsedOutput, context); + case "RedshiftIdcApplicationQuotaExceeded": + case "com.amazonaws.redshift#RedshiftIdcApplicationQuotaExceededFault": + throw await de_RedshiftIdcApplicationQuotaExceededFaultRes(parsedOutput, context); + case "InvalidSchedule": + case "com.amazonaws.redshift#InvalidScheduleFault": + throw await de_InvalidScheduleFaultRes(parsedOutput, context); + case "InvalidScheduledAction": + case "com.amazonaws.redshift#InvalidScheduledActionFault": + throw await de_InvalidScheduledActionFaultRes(parsedOutput, context); + case "ScheduledActionAlreadyExists": + case "com.amazonaws.redshift#ScheduledActionAlreadyExistsFault": + throw await de_ScheduledActionAlreadyExistsFaultRes(parsedOutput, context); + case "ScheduledActionQuotaExceeded": + case "com.amazonaws.redshift#ScheduledActionQuotaExceededFault": + throw await de_ScheduledActionQuotaExceededFaultRes(parsedOutput, context); + case "ScheduledActionTypeUnsupported": + case "com.amazonaws.redshift#ScheduledActionTypeUnsupportedFault": + throw await de_ScheduledActionTypeUnsupportedFaultRes(parsedOutput, context); + case "SnapshotCopyGrantAlreadyExistsFault": + case "com.amazonaws.redshift#SnapshotCopyGrantAlreadyExistsFault": + throw await de_SnapshotCopyGrantAlreadyExistsFaultRes(parsedOutput, context); + case "SnapshotCopyGrantQuotaExceededFault": + case "com.amazonaws.redshift#SnapshotCopyGrantQuotaExceededFault": + throw await de_SnapshotCopyGrantQuotaExceededFaultRes(parsedOutput, context); + case "ScheduleDefinitionTypeUnsupported": + case "com.amazonaws.redshift#ScheduleDefinitionTypeUnsupportedFault": + throw await de_ScheduleDefinitionTypeUnsupportedFaultRes(parsedOutput, context); + case "SnapshotScheduleAlreadyExists": + case "com.amazonaws.redshift#SnapshotScheduleAlreadyExistsFault": + throw await de_SnapshotScheduleAlreadyExistsFaultRes(parsedOutput, context); + case "SnapshotScheduleQuotaExceeded": + case "com.amazonaws.redshift#SnapshotScheduleQuotaExceededFault": + throw await de_SnapshotScheduleQuotaExceededFaultRes(parsedOutput, context); + case "ResourceNotFoundFault": + case "com.amazonaws.redshift#ResourceNotFoundFault": + throw await de_ResourceNotFoundFaultRes(parsedOutput, context); + case "InvalidUsageLimit": + case "com.amazonaws.redshift#InvalidUsageLimitFault": + throw await de_InvalidUsageLimitFaultRes(parsedOutput, context); + case "UsageLimitAlreadyExists": + case "com.amazonaws.redshift#UsageLimitAlreadyExistsFault": + throw await de_UsageLimitAlreadyExistsFaultRes(parsedOutput, context); + case "AuthenticationProfileNotFoundFault": + case "com.amazonaws.redshift#AuthenticationProfileNotFoundFault": + throw await de_AuthenticationProfileNotFoundFaultRes(parsedOutput, context); + case "InvalidClusterParameterGroupState": + case "com.amazonaws.redshift#InvalidClusterParameterGroupStateFault": + throw await de_InvalidClusterParameterGroupStateFaultRes(parsedOutput, context); + case "InvalidClusterSubnetStateFault": + case "com.amazonaws.redshift#InvalidClusterSubnetStateFault": + throw await de_InvalidClusterSubnetStateFaultRes(parsedOutput, context); + case "CustomDomainAssociationNotFoundFault": + case "com.amazonaws.redshift#CustomDomainAssociationNotFoundFault": + throw await de_CustomDomainAssociationNotFoundFaultRes(parsedOutput, context); + case "EndpointNotFound": + case "com.amazonaws.redshift#EndpointNotFoundFault": + throw await de_EndpointNotFoundFaultRes(parsedOutput, context); case "InvalidEndpointState": case "com.amazonaws.redshift#InvalidEndpointStateFault": throw await de_InvalidEndpointStateFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRevokeSnapshotAccessCommand - */ -export const de_RevokeSnapshotAccessCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RevokeSnapshotAccessCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RevokeSnapshotAccessResult(data.RevokeSnapshotAccessResult, context); - const response: RevokeSnapshotAccessCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRevokeSnapshotAccessCommandError - */ -const de_RevokeSnapshotAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { + case "InvalidSubscriptionStateFault": + case "com.amazonaws.redshift#InvalidSubscriptionStateFault": + throw await de_InvalidSubscriptionStateFaultRes(parsedOutput, context); + case "SubscriptionNotFound": + case "com.amazonaws.redshift#SubscriptionNotFoundFault": + throw await de_SubscriptionNotFoundFaultRes(parsedOutput, context); + case "InvalidHsmClientCertificateStateFault": + case "com.amazonaws.redshift#InvalidHsmClientCertificateStateFault": + throw await de_InvalidHsmClientCertificateStateFaultRes(parsedOutput, context); + case "InvalidHsmConfigurationStateFault": + case "com.amazonaws.redshift#InvalidHsmConfigurationStateFault": + throw await de_InvalidHsmConfigurationStateFaultRes(parsedOutput, context); + case "ScheduledActionNotFound": + case "com.amazonaws.redshift#ScheduledActionNotFoundFault": + throw await de_ScheduledActionNotFoundFaultRes(parsedOutput, context); + case "InvalidSnapshotCopyGrantStateFault": + case "com.amazonaws.redshift#InvalidSnapshotCopyGrantStateFault": + throw await de_InvalidSnapshotCopyGrantStateFaultRes(parsedOutput, context); + case "SnapshotCopyGrantNotFoundFault": + case "com.amazonaws.redshift#SnapshotCopyGrantNotFoundFault": + throw await de_SnapshotCopyGrantNotFoundFaultRes(parsedOutput, context); + case "InvalidClusterSnapshotScheduleState": + case "com.amazonaws.redshift#InvalidClusterSnapshotScheduleStateFault": + throw await de_InvalidClusterSnapshotScheduleStateFaultRes(parsedOutput, context); + case "UsageLimitNotFound": + case "com.amazonaws.redshift#UsageLimitNotFoundFault": + throw await de_UsageLimitNotFoundFaultRes(parsedOutput, context); + case "IntegrationNotFoundFault": + case "com.amazonaws.redshift#IntegrationNotFoundFault": + throw await de_IntegrationNotFoundFaultRes(parsedOutput, context); case "AccessToSnapshotDenied": case "com.amazonaws.redshift#AccessToSnapshotDeniedFault": throw await de_AccessToSnapshotDeniedFaultRes(parsedOutput, context); + case "ReservedNodeExchangeNotFond": + case "com.amazonaws.redshift#ReservedNodeExchangeNotFoundFault": + throw await de_ReservedNodeExchangeNotFoundFaultRes(parsedOutput, context); + case "TableRestoreNotFoundFault": + case "com.amazonaws.redshift#TableRestoreNotFoundFault": + throw await de_TableRestoreNotFoundFaultRes(parsedOutput, context); + case "SnapshotCopyAlreadyDisabledFault": + case "com.amazonaws.redshift#SnapshotCopyAlreadyDisabledFault": + throw await de_SnapshotCopyAlreadyDisabledFaultRes(parsedOutput, context); + case "BucketNotFoundFault": + case "com.amazonaws.redshift#BucketNotFoundFault": + throw await de_BucketNotFoundFaultRes(parsedOutput, context); + case "InsufficientS3BucketPolicyFault": + case "com.amazonaws.redshift#InsufficientS3BucketPolicyFault": + throw await de_InsufficientS3BucketPolicyFaultRes(parsedOutput, context); + case "InvalidS3BucketNameFault": + case "com.amazonaws.redshift#InvalidS3BucketNameFault": + throw await de_InvalidS3BucketNameFaultRes(parsedOutput, context); + case "InvalidS3KeyPrefixFault": + case "com.amazonaws.redshift#InvalidS3KeyPrefixFault": + throw await de_InvalidS3KeyPrefixFaultRes(parsedOutput, context); + case "CopyToRegionDisabledFault": + case "com.amazonaws.redshift#CopyToRegionDisabledFault": + throw await de_CopyToRegionDisabledFaultRes(parsedOutput, context); + case "IncompatibleOrderableOptions": + case "com.amazonaws.redshift#IncompatibleOrderableOptions": + throw await de_IncompatibleOrderableOptionsRes(parsedOutput, context); + case "SnapshotCopyAlreadyEnabledFault": + case "com.amazonaws.redshift#SnapshotCopyAlreadyEnabledFault": + throw await de_SnapshotCopyAlreadyEnabledFaultRes(parsedOutput, context); + case "UnknownSnapshotCopyRegionFault": + case "com.amazonaws.redshift#UnknownSnapshotCopyRegionFault": + throw await de_UnknownSnapshotCopyRegionFaultRes(parsedOutput, context); + case "InvalidPolicyFault": + case "com.amazonaws.redshift#InvalidPolicyFault": + throw await de_InvalidPolicyFaultRes(parsedOutput, context); + case "TableLimitExceeded": + case "com.amazonaws.redshift#TableLimitExceededFault": + throw await de_TableLimitExceededFaultRes(parsedOutput, context); + case "UnsupportedOptionFault": + case "com.amazonaws.redshift#UnsupportedOptionFault": + throw await de_UnsupportedOptionFaultRes(parsedOutput, context); + case "ClusterOnLatestRevision": + case "com.amazonaws.redshift#ClusterOnLatestRevisionFault": + throw await de_ClusterOnLatestRevisionFaultRes(parsedOutput, context); + case "SubnetAlreadyInUse": + case "com.amazonaws.redshift#SubnetAlreadyInUse": + throw await de_SubnetAlreadyInUseRes(parsedOutput, context); + case "SnapshotCopyDisabledFault": + case "com.amazonaws.redshift#SnapshotCopyDisabledFault": + throw await de_SnapshotCopyDisabledFaultRes(parsedOutput, context); + case "SnapshotScheduleUpdateInProgress": + case "com.amazonaws.redshift#SnapshotScheduleUpdateInProgressFault": + throw await de_SnapshotScheduleUpdateInProgressFaultRes(parsedOutput, context); + case "ReservedNodeQuotaExceeded": + case "com.amazonaws.redshift#ReservedNodeQuotaExceededFault": + throw await de_ReservedNodeQuotaExceededFaultRes(parsedOutput, context); + case "ConflictPolicyUpdateFault": + case "com.amazonaws.redshift#ConflictPolicyUpdateFault": + throw await de_ConflictPolicyUpdateFaultRes(parsedOutput, context); + case "InvalidRestore": + case "com.amazonaws.redshift#InvalidRestoreFault": + throw await de_InvalidRestoreFaultRes(parsedOutput, context); + case "InProgressTableRestoreQuotaExceededFault": + case "com.amazonaws.redshift#InProgressTableRestoreQuotaExceededFault": + throw await de_InProgressTableRestoreQuotaExceededFaultRes(parsedOutput, context); + case "InvalidTableRestoreArgument": + case "com.amazonaws.redshift#InvalidTableRestoreArgumentFault": + throw await de_InvalidTableRestoreArgumentFaultRes(parsedOutput, context); case "AuthorizationNotFound": case "com.amazonaws.redshift#AuthorizationNotFoundFault": throw await de_AuthorizationNotFoundFaultRes(parsedOutput, context); - case "ClusterSnapshotNotFound": - case "com.amazonaws.redshift#ClusterSnapshotNotFoundFault": - throw await de_ClusterSnapshotNotFoundFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRotateEncryptionKeyCommand - */ -export const de_RotateEncryptionKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RotateEncryptionKeyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RotateEncryptionKeyResult(data.RotateEncryptionKeyResult, context); - const response: RotateEncryptionKeyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryRotateEncryptionKeyCommandError - */ -const de_RotateEncryptionKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "DependentServiceRequestThrottlingFault": - case "com.amazonaws.redshift#DependentServiceRequestThrottlingFault": - throw await de_DependentServiceRequestThrottlingFaultRes(parsedOutput, context); - case "InvalidClusterState": - case "com.amazonaws.redshift#InvalidClusterStateFault": - throw await de_InvalidClusterStateFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryUpdatePartnerStatusCommand - */ -export const de_UpdatePartnerStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdatePartnerStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PartnerIntegrationOutputMessage(data.UpdatePartnerStatusResult, context); - const response: UpdatePartnerStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryUpdatePartnerStatusCommandError - */ -const de_UpdatePartnerStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterNotFound": - case "com.amazonaws.redshift#ClusterNotFoundFault": - throw await de_ClusterNotFoundFaultRes(parsedOutput, context); - case "PartnerNotFound": - case "com.amazonaws.redshift#PartnerNotFoundFault": - throw await de_PartnerNotFoundFaultRes(parsedOutput, context); - case "UnauthorizedPartnerIntegration": - case "com.amazonaws.redshift#UnauthorizedPartnerIntegrationFault": - throw await de_UnauthorizedPartnerIntegrationFaultRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.redshift#UnsupportedOperationFault": - throw await de_UnsupportedOperationFaultRes(parsedOutput, context); + case "EndpointAuthorizationNotFound": + case "com.amazonaws.redshift#EndpointAuthorizationNotFoundFault": + throw await de_EndpointAuthorizationNotFoundFaultRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody: parsedBody.Error, errorCode, - }); + }) as never; } }; diff --git a/clients/client-rekognition/src/protocols/Aws_json1_1.ts b/clients/client-rekognition/src/protocols/Aws_json1_1.ts index c0c924f67c03..1e8a72ceb0b7 100644 --- a/clients/client-rekognition/src/protocols/Aws_json1_1.ts +++ b/clients/client-rekognition/src/protocols/Aws_json1_1.ts @@ -1440,7 +1440,7 @@ export const de_AssociateFacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateFacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1452,56 +1452,6 @@ export const de_AssociateFacesCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateFacesCommandError - */ -const de_AssociateFacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.rekognition#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.rekognition#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.rekognition#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CompareFacesCommand */ @@ -1510,7 +1460,7 @@ export const de_CompareFacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CompareFacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1522,53 +1472,6 @@ export const de_CompareFacesCommand = async ( return response; }; -/** - * deserializeAws_json1_1CompareFacesCommandError - */ -const de_CompareFacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ImageTooLargeException": - case "com.amazonaws.rekognition#ImageTooLargeException": - throw await de_ImageTooLargeExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidImageFormatException": - case "com.amazonaws.rekognition#InvalidImageFormatException": - throw await de_InvalidImageFormatExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CopyProjectVersionCommand */ @@ -1577,7 +1480,7 @@ export const de_CopyProjectVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopyProjectVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1589,56 +1492,6 @@ export const de_CopyProjectVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CopyProjectVersionCommandError - */ -const de_CopyProjectVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.rekognition#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateCollectionCommand */ @@ -1647,7 +1500,7 @@ export const de_CreateCollectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCollectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1660,63 +1513,39 @@ export const de_CreateCollectionCommand = async ( }; /** - * deserializeAws_json1_1CreateCollectionCommandError + * deserializeAws_json1_1CreateDatasetCommand */ -const de_CreateCollectionCommandError = async ( +export const de_CreateDatasetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.rekognition#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.rekognition#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateDatasetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateDatasetCommand + * deserializeAws_json1_1CreateFaceLivenessSessionCommand */ -export const de_CreateDatasetCommand = async ( +export const de_CreateFaceLivenessSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDatasetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateDatasetCommandOutput = { + const response: CreateFaceLivenessSessionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1724,69 +1553,39 @@ export const de_CreateDatasetCommand = async ( }; /** - * deserializeAws_json1_1CreateDatasetCommandError + * deserializeAws_json1_1CreateProjectCommand */ -const de_CreateDatasetCommandError = async ( +export const de_CreateProjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.rekognition#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateProjectCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateFaceLivenessSessionCommand + * deserializeAws_json1_1CreateProjectVersionCommand */ -export const de_CreateFaceLivenessSessionCommand = async ( +export const de_CreateProjectVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateFaceLivenessSessionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateFaceLivenessSessionCommandOutput = { + const response: CreateProjectVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1794,57 +1593,39 @@ export const de_CreateFaceLivenessSessionCommand = async ( }; /** - * deserializeAws_json1_1CreateFaceLivenessSessionCommandError + * deserializeAws_json1_1CreateStreamProcessorCommand */ -const de_CreateFaceLivenessSessionCommandError = async ( +export const de_CreateStreamProcessorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateStreamProcessorCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateProjectCommand + * deserializeAws_json1_1CreateUserCommand */ -export const de_CreateProjectCommand = async ( +export const de_CreateUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateProjectCommandOutput = { + const response: CreateUserCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1852,63 +1633,39 @@ export const de_CreateProjectCommand = async ( }; /** - * deserializeAws_json1_1CreateProjectCommandError + * deserializeAws_json1_1DeleteCollectionCommand */ -const de_CreateProjectCommandError = async ( +export const de_DeleteCollectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteCollectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateProjectVersionCommand + * deserializeAws_json1_1DeleteDatasetCommand */ -export const de_CreateProjectVersionCommand = async ( +export const de_DeleteDatasetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateProjectVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateProjectVersionCommandOutput = { + const response: DeleteDatasetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1916,69 +1673,39 @@ export const de_CreateProjectVersionCommand = async ( }; /** - * deserializeAws_json1_1CreateProjectVersionCommandError + * deserializeAws_json1_1DeleteFacesCommand */ -const de_CreateProjectVersionCommandError = async ( +export const de_DeleteFacesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.rekognition#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteFacesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateStreamProcessorCommand + * deserializeAws_json1_1DeleteProjectCommand */ -export const de_CreateStreamProcessorCommand = async ( +export const de_DeleteProjectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateStreamProcessorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateStreamProcessorCommandOutput = { + const response: DeleteProjectCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1986,66 +1713,59 @@ export const de_CreateStreamProcessorCommand = async ( }; /** - * deserializeAws_json1_1CreateStreamProcessorCommandError + * deserializeAws_json1_1DeleteProjectPolicyCommand */ -const de_CreateStreamProcessorCommandError = async ( +export const de_DeleteProjectPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteProjectPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.rekognition#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DeleteProjectVersionCommand + */ +export const de_DeleteProjectVersionCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteProjectVersionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateUserCommand + * deserializeAws_json1_1DeleteStreamProcessorCommand */ -export const de_CreateUserCommand = async ( +export const de_DeleteStreamProcessorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateUserCommandOutput = { + const response: DeleteStreamProcessorCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2053,69 +1773,39 @@ export const de_CreateUserCommand = async ( }; /** - * deserializeAws_json1_1CreateUserCommandError + * deserializeAws_json1_1DeleteUserCommand */ -const de_CreateUserCommandError = async ( +export const de_DeleteUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteUserCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.rekognition#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.rekognition#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.rekognition#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1DeleteCollectionCommand + * deserializeAws_json1_1DescribeCollectionCommand */ -export const de_DeleteCollectionCommand = async ( +export const de_DescribeCollectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteCollectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteCollectionCommandOutput = { + contents = de_DescribeCollectionResponse(data, context); + const response: DescribeCollectionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2123,60 +1813,19 @@ export const de_DeleteCollectionCommand = async ( }; /** - * deserializeAws_json1_1DeleteCollectionCommandError - */ -const de_DeleteCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDatasetCommand + * deserializeAws_json1_1DescribeDatasetCommand */ -export const de_DeleteDatasetCommand = async ( +export const de_DescribeDatasetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDatasetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteDatasetCommandOutput = { + contents = de_DescribeDatasetResponse(data, context); + const response: DescribeDatasetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2184,66 +1833,39 @@ export const de_DeleteDatasetCommand = async ( }; /** - * deserializeAws_json1_1DeleteDatasetCommandError + * deserializeAws_json1_1DescribeProjectsCommand */ -const de_DeleteDatasetCommandError = async ( +export const de_DescribeProjectsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeProjectsResponse(data, context); + const response: DescribeProjectsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteFacesCommand + * deserializeAws_json1_1DescribeProjectVersionsCommand */ -export const de_DeleteFacesCommand = async ( +export const de_DescribeProjectVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteFacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteFacesCommandOutput = { + contents = de_DescribeProjectVersionsResponse(data, context); + const response: DescribeProjectVersionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2251,60 +1873,39 @@ export const de_DeleteFacesCommand = async ( }; /** - * deserializeAws_json1_1DeleteFacesCommandError + * deserializeAws_json1_1DescribeStreamProcessorCommand */ -const de_DeleteFacesCommandError = async ( +export const de_DescribeStreamProcessorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeStreamProcessorResponse(data, context); + const response: DescribeStreamProcessorCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteProjectCommand + * deserializeAws_json1_1DetectCustomLabelsCommand */ -export const de_DeleteProjectCommand = async ( +export const de_DetectCustomLabelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteProjectCommandOutput = { + contents = de_DetectCustomLabelsResponse(data, context); + const response: DetectCustomLabelsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2312,63 +1913,39 @@ export const de_DeleteProjectCommand = async ( }; /** - * deserializeAws_json1_1DeleteProjectCommandError + * deserializeAws_json1_1DetectFacesCommand */ -const de_DeleteProjectCommandError = async ( +export const de_DetectFacesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DetectFacesResponse(data, context); + const response: DetectFacesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteProjectPolicyCommand + * deserializeAws_json1_1DetectLabelsCommand */ -export const de_DeleteProjectPolicyCommand = async ( +export const de_DetectLabelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteProjectPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteProjectPolicyCommandOutput = { + contents = de_DetectLabelsResponse(data, context); + const response: DetectLabelsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2376,63 +1953,39 @@ export const de_DeleteProjectPolicyCommand = async ( }; /** - * deserializeAws_json1_1DeleteProjectPolicyCommandError + * deserializeAws_json1_1DetectModerationLabelsCommand */ -const de_DeleteProjectPolicyCommandError = async ( +export const de_DetectModerationLabelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPolicyRevisionIdException": - case "com.amazonaws.rekognition#InvalidPolicyRevisionIdException": - throw await de_InvalidPolicyRevisionIdExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DetectModerationLabelsResponse(data, context); + const response: DetectModerationLabelsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteProjectVersionCommand + * deserializeAws_json1_1DetectProtectiveEquipmentCommand */ -export const de_DeleteProjectVersionCommand = async ( +export const de_DetectProtectiveEquipmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteProjectVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteProjectVersionCommandOutput = { + contents = de_DetectProtectiveEquipmentResponse(data, context); + const response: DetectProtectiveEquipmentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2440,63 +1993,39 @@ export const de_DeleteProjectVersionCommand = async ( }; /** - * deserializeAws_json1_1DeleteProjectVersionCommandError + * deserializeAws_json1_1DetectTextCommand */ -const de_DeleteProjectVersionCommandError = async ( +export const de_DetectTextCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DetectTextResponse(data, context); + const response: DetectTextCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteStreamProcessorCommand + * deserializeAws_json1_1DisassociateFacesCommand */ -export const de_DeleteStreamProcessorCommand = async ( +export const de_DisassociateFacesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteStreamProcessorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteStreamProcessorCommandOutput = { + const response: DisassociateFacesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2504,63 +2033,39 @@ export const de_DeleteStreamProcessorCommand = async ( }; /** - * deserializeAws_json1_1DeleteStreamProcessorCommandError + * deserializeAws_json1_1DistributeDatasetEntriesCommand */ -const de_DeleteStreamProcessorCommandError = async ( +export const de_DistributeDatasetEntriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DistributeDatasetEntriesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteUserCommand + * deserializeAws_json1_1GetCelebrityInfoCommand */ -export const de_DeleteUserCommand = async ( +export const de_GetCelebrityInfoCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteUserCommandOutput = { + const response: GetCelebrityInfoCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2568,66 +2073,59 @@ export const de_DeleteUserCommand = async ( }; /** - * deserializeAws_json1_1DeleteUserCommandError + * deserializeAws_json1_1GetCelebrityRecognitionCommand */ -const de_DeleteUserCommandError = async ( +export const de_GetCelebrityRecognitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetCelebrityRecognitionResponse(data, context); + const response: GetCelebrityRecognitionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.rekognition#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.rekognition#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1GetContentModerationCommand + */ +export const de_GetContentModerationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetContentModerationResponse(data, context); + const response: GetContentModerationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeCollectionCommand + * deserializeAws_json1_1GetFaceDetectionCommand */ -export const de_DescribeCollectionCommand = async ( +export const de_GetFaceDetectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeCollectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeCollectionResponse(data, context); - const response: DescribeCollectionCommandOutput = { + contents = de_GetFaceDetectionResponse(data, context); + const response: GetFaceDetectionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2635,60 +2133,39 @@ export const de_DescribeCollectionCommand = async ( }; /** - * deserializeAws_json1_1DescribeCollectionCommandError + * deserializeAws_json1_1GetFaceLivenessSessionResultsCommand */ -const de_DescribeCollectionCommandError = async ( +export const de_GetFaceLivenessSessionResultsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetFaceLivenessSessionResultsResponse(data, context); + const response: GetFaceLivenessSessionResultsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1DescribeDatasetCommand + * deserializeAws_json1_1GetFaceSearchCommand */ -export const de_DescribeDatasetCommand = async ( +export const de_GetFaceSearchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDatasetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDatasetResponse(data, context); - const response: DescribeDatasetCommandOutput = { + contents = de_GetFaceSearchResponse(data, context); + const response: GetFaceSearchCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2696,60 +2173,39 @@ export const de_DescribeDatasetCommand = async ( }; /** - * deserializeAws_json1_1DescribeDatasetCommandError + * deserializeAws_json1_1GetLabelDetectionCommand */ -const de_DescribeDatasetCommandError = async ( +export const de_GetLabelDetectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetLabelDetectionResponse(data, context); + const response: GetLabelDetectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeProjectsCommand + * deserializeAws_json1_1GetMediaAnalysisJobCommand */ -export const de_DescribeProjectsCommand = async ( +export const de_GetMediaAnalysisJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeProjectsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeProjectsResponse(data, context); - const response: DescribeProjectsCommandOutput = { + contents = de_GetMediaAnalysisJobResponse(data, context); + const response: GetMediaAnalysisJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2757,60 +2213,39 @@ export const de_DescribeProjectsCommand = async ( }; /** - * deserializeAws_json1_1DescribeProjectsCommandError + * deserializeAws_json1_1GetPersonTrackingCommand */ -const de_DescribeProjectsCommandError = async ( +export const de_GetPersonTrackingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetPersonTrackingResponse(data, context); + const response: GetPersonTrackingCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeProjectVersionsCommand + * deserializeAws_json1_1GetSegmentDetectionCommand */ -export const de_DescribeProjectVersionsCommand = async ( +export const de_GetSegmentDetectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeProjectVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeProjectVersionsResponse(data, context); - const response: DescribeProjectVersionsCommandOutput = { + contents = de_GetSegmentDetectionResponse(data, context); + const response: GetSegmentDetectionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2818,63 +2253,39 @@ export const de_DescribeProjectVersionsCommand = async ( }; /** - * deserializeAws_json1_1DescribeProjectVersionsCommandError + * deserializeAws_json1_1GetTextDetectionCommand */ -const de_DescribeProjectVersionsCommandError = async ( +export const de_GetTextDetectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetTextDetectionResponse(data, context); + const response: GetTextDetectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeStreamProcessorCommand + * deserializeAws_json1_1IndexFacesCommand */ -export const de_DescribeStreamProcessorCommand = async ( +export const de_IndexFacesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeStreamProcessorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeStreamProcessorResponse(data, context); - const response: DescribeStreamProcessorCommandOutput = { + contents = de_IndexFacesResponse(data, context); + const response: IndexFacesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2882,60 +2293,39 @@ export const de_DescribeStreamProcessorCommand = async ( }; /** - * deserializeAws_json1_1DescribeStreamProcessorCommandError + * deserializeAws_json1_1ListCollectionsCommand */ -const de_DescribeStreamProcessorCommandError = async ( +export const de_ListCollectionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListCollectionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DetectCustomLabelsCommand + * deserializeAws_json1_1ListDatasetEntriesCommand */ -export const de_DetectCustomLabelsCommand = async ( +export const de_ListDatasetEntriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DetectCustomLabelsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DetectCustomLabelsResponse(data, context); - const response: DetectCustomLabelsCommandOutput = { + contents = _json(data); + const response: ListDatasetEntriesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2943,2302 +2333,19 @@ export const de_DetectCustomLabelsCommand = async ( }; /** - * deserializeAws_json1_1DetectCustomLabelsCommandError + * deserializeAws_json1_1ListDatasetLabelsCommand */ -const de_DetectCustomLabelsCommandError = async ( +export const de_ListDatasetLabelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ImageTooLargeException": - case "com.amazonaws.rekognition#ImageTooLargeException": - throw await de_ImageTooLargeExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidImageFormatException": - case "com.amazonaws.rekognition#InvalidImageFormatException": - throw await de_InvalidImageFormatExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.rekognition#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetectFacesCommand - */ -export const de_DetectFacesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetectFacesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetectFacesResponse(data, context); - const response: DetectFacesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetectFacesCommandError - */ -const de_DetectFacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ImageTooLargeException": - case "com.amazonaws.rekognition#ImageTooLargeException": - throw await de_ImageTooLargeExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidImageFormatException": - case "com.amazonaws.rekognition#InvalidImageFormatException": - throw await de_InvalidImageFormatExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetectLabelsCommand - */ -export const de_DetectLabelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetectLabelsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetectLabelsResponse(data, context); - const response: DetectLabelsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetectLabelsCommandError - */ -const de_DetectLabelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ImageTooLargeException": - case "com.amazonaws.rekognition#ImageTooLargeException": - throw await de_ImageTooLargeExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidImageFormatException": - case "com.amazonaws.rekognition#InvalidImageFormatException": - throw await de_InvalidImageFormatExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetectModerationLabelsCommand - */ -export const de_DetectModerationLabelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetectModerationLabelsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetectModerationLabelsResponse(data, context); - const response: DetectModerationLabelsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetectModerationLabelsCommandError - */ -const de_DetectModerationLabelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "HumanLoopQuotaExceededException": - case "com.amazonaws.rekognition#HumanLoopQuotaExceededException": - throw await de_HumanLoopQuotaExceededExceptionRes(parsedOutput, context); - case "ImageTooLargeException": - case "com.amazonaws.rekognition#ImageTooLargeException": - throw await de_ImageTooLargeExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidImageFormatException": - case "com.amazonaws.rekognition#InvalidImageFormatException": - throw await de_InvalidImageFormatExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.rekognition#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetectProtectiveEquipmentCommand - */ -export const de_DetectProtectiveEquipmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetectProtectiveEquipmentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetectProtectiveEquipmentResponse(data, context); - const response: DetectProtectiveEquipmentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetectProtectiveEquipmentCommandError - */ -const de_DetectProtectiveEquipmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ImageTooLargeException": - case "com.amazonaws.rekognition#ImageTooLargeException": - throw await de_ImageTooLargeExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidImageFormatException": - case "com.amazonaws.rekognition#InvalidImageFormatException": - throw await de_InvalidImageFormatExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DetectTextCommand - */ -export const de_DetectTextCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DetectTextCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DetectTextResponse(data, context); - const response: DetectTextCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DetectTextCommandError - */ -const de_DetectTextCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ImageTooLargeException": - case "com.amazonaws.rekognition#ImageTooLargeException": - throw await de_ImageTooLargeExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidImageFormatException": - case "com.amazonaws.rekognition#InvalidImageFormatException": - throw await de_InvalidImageFormatExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociateFacesCommand - */ -export const de_DisassociateFacesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisassociateFacesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DisassociateFacesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisassociateFacesCommandError - */ -const de_DisassociateFacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.rekognition#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.rekognition#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DistributeDatasetEntriesCommand - */ -export const de_DistributeDatasetEntriesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DistributeDatasetEntriesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DistributeDatasetEntriesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DistributeDatasetEntriesCommandError - */ -const de_DistributeDatasetEntriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.rekognition#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCelebrityInfoCommand - */ -export const de_GetCelebrityInfoCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetCelebrityInfoCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetCelebrityInfoCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetCelebrityInfoCommandError - */ -const de_GetCelebrityInfoCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetCelebrityRecognitionCommand - */ -export const de_GetCelebrityRecognitionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetCelebrityRecognitionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetCelebrityRecognitionResponse(data, context); - const response: GetCelebrityRecognitionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetCelebrityRecognitionCommandError - */ -const de_GetCelebrityRecognitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetContentModerationCommand - */ -export const de_GetContentModerationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetContentModerationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetContentModerationResponse(data, context); - const response: GetContentModerationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetContentModerationCommandError - */ -const de_GetContentModerationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetFaceDetectionCommand - */ -export const de_GetFaceDetectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetFaceDetectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetFaceDetectionResponse(data, context); - const response: GetFaceDetectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetFaceDetectionCommandError - */ -const de_GetFaceDetectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetFaceLivenessSessionResultsCommand - */ -export const de_GetFaceLivenessSessionResultsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetFaceLivenessSessionResultsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetFaceLivenessSessionResultsResponse(data, context); - const response: GetFaceLivenessSessionResultsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetFaceLivenessSessionResultsCommandError - */ -const de_GetFaceLivenessSessionResultsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "SessionNotFoundException": - case "com.amazonaws.rekognition#SessionNotFoundException": - throw await de_SessionNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetFaceSearchCommand - */ -export const de_GetFaceSearchCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetFaceSearchCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetFaceSearchResponse(data, context); - const response: GetFaceSearchCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetFaceSearchCommandError - */ -const de_GetFaceSearchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLabelDetectionCommand - */ -export const de_GetLabelDetectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetLabelDetectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetLabelDetectionResponse(data, context); - const response: GetLabelDetectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetLabelDetectionCommandError - */ -const de_GetLabelDetectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetMediaAnalysisJobCommand - */ -export const de_GetMediaAnalysisJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetMediaAnalysisJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetMediaAnalysisJobResponse(data, context); - const response: GetMediaAnalysisJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetMediaAnalysisJobCommandError - */ -const de_GetMediaAnalysisJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetPersonTrackingCommand - */ -export const de_GetPersonTrackingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetPersonTrackingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetPersonTrackingResponse(data, context); - const response: GetPersonTrackingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetPersonTrackingCommandError - */ -const de_GetPersonTrackingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSegmentDetectionCommand - */ -export const de_GetSegmentDetectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSegmentDetectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetSegmentDetectionResponse(data, context); - const response: GetSegmentDetectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSegmentDetectionCommandError - */ -const de_GetSegmentDetectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetTextDetectionCommand - */ -export const de_GetTextDetectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetTextDetectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetTextDetectionResponse(data, context); - const response: GetTextDetectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetTextDetectionCommandError - */ -const de_GetTextDetectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1IndexFacesCommand - */ -export const de_IndexFacesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_IndexFacesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_IndexFacesResponse(data, context); - const response: IndexFacesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1IndexFacesCommandError - */ -const de_IndexFacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ImageTooLargeException": - case "com.amazonaws.rekognition#ImageTooLargeException": - throw await de_ImageTooLargeExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidImageFormatException": - case "com.amazonaws.rekognition#InvalidImageFormatException": - throw await de_InvalidImageFormatExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.rekognition#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListCollectionsCommand - */ -export const de_ListCollectionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListCollectionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListCollectionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListCollectionsCommandError - */ -const de_ListCollectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDatasetEntriesCommand - */ -export const de_ListDatasetEntriesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDatasetEntriesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListDatasetEntriesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDatasetEntriesCommandError - */ -const de_ListDatasetEntriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.rekognition#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDatasetLabelsCommand - */ -export const de_ListDatasetLabelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDatasetLabelsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListDatasetLabelsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDatasetLabelsCommandError - */ -const de_ListDatasetLabelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.rekognition#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListFacesCommand - */ -export const de_ListFacesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListFacesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListFacesResponse(data, context); - const response: ListFacesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListFacesCommandError - */ -const de_ListFacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListMediaAnalysisJobsCommand - */ -export const de_ListMediaAnalysisJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListMediaAnalysisJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListMediaAnalysisJobsResponse(data, context); - const response: ListMediaAnalysisJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListMediaAnalysisJobsCommandError - */ -const de_ListMediaAnalysisJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListProjectPoliciesCommand - */ -export const de_ListProjectPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListProjectPoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListProjectPoliciesResponse(data, context); - const response: ListProjectPoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListProjectPoliciesCommandError - */ -const de_ListProjectPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListStreamProcessorsCommand - */ -export const de_ListStreamProcessorsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListStreamProcessorsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListStreamProcessorsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListStreamProcessorsCommandError - */ -const de_ListStreamProcessorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListUsersCommand - */ -export const de_ListUsersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListUsersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListUsersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListUsersCommandError - */ -const de_ListUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.rekognition#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutProjectPolicyCommand - */ -export const de_PutProjectPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutProjectPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutProjectPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutProjectPolicyCommandError - */ -const de_PutProjectPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPolicyRevisionIdException": - case "com.amazonaws.rekognition#InvalidPolicyRevisionIdException": - throw await de_InvalidPolicyRevisionIdExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedPolicyDocumentException": - case "com.amazonaws.rekognition#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.rekognition#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.rekognition#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RecognizeCelebritiesCommand - */ -export const de_RecognizeCelebritiesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RecognizeCelebritiesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_RecognizeCelebritiesResponse(data, context); - const response: RecognizeCelebritiesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RecognizeCelebritiesCommandError - */ -const de_RecognizeCelebritiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ImageTooLargeException": - case "com.amazonaws.rekognition#ImageTooLargeException": - throw await de_ImageTooLargeExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidImageFormatException": - case "com.amazonaws.rekognition#InvalidImageFormatException": - throw await de_InvalidImageFormatExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1SearchFacesCommand - */ -export const de_SearchFacesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SearchFacesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SearchFacesResponse(data, context); - const response: SearchFacesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1SearchFacesCommandError - */ -const de_SearchFacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1SearchFacesByImageCommand - */ -export const de_SearchFacesByImageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SearchFacesByImageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SearchFacesByImageResponse(data, context); - const response: SearchFacesByImageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1SearchFacesByImageCommandError - */ -const de_SearchFacesByImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ImageTooLargeException": - case "com.amazonaws.rekognition#ImageTooLargeException": - throw await de_ImageTooLargeExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidImageFormatException": - case "com.amazonaws.rekognition#InvalidImageFormatException": - throw await de_InvalidImageFormatExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1SearchUsersCommand - */ -export const de_SearchUsersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SearchUsersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SearchUsersResponse(data, context); - const response: SearchUsersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1SearchUsersCommandError - */ -const de_SearchUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1SearchUsersByImageCommand - */ -export const de_SearchUsersByImageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SearchUsersByImageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SearchUsersByImageResponse(data, context); - const response: SearchUsersByImageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1SearchUsersByImageCommandError - */ -const de_SearchUsersByImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ImageTooLargeException": - case "com.amazonaws.rekognition#ImageTooLargeException": - throw await de_ImageTooLargeExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidImageFormatException": - case "com.amazonaws.rekognition#InvalidImageFormatException": - throw await de_InvalidImageFormatExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartCelebrityRecognitionCommand - */ -export const de_StartCelebrityRecognitionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartCelebrityRecognitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartCelebrityRecognitionCommandOutput = { + const response: ListDatasetLabelsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5246,69 +2353,19 @@ export const de_StartCelebrityRecognitionCommand = async ( }; /** - * deserializeAws_json1_1StartCelebrityRecognitionCommandError - */ -const de_StartCelebrityRecognitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.rekognition#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VideoTooLargeException": - case "com.amazonaws.rekognition#VideoTooLargeException": - throw await de_VideoTooLargeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartContentModerationCommand + * deserializeAws_json1_1ListFacesCommand */ -export const de_StartContentModerationCommand = async ( +export const de_ListFacesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartContentModerationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartContentModerationCommandOutput = { + contents = de_ListFacesResponse(data, context); + const response: ListFacesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5316,69 +2373,19 @@ export const de_StartContentModerationCommand = async ( }; /** - * deserializeAws_json1_1StartContentModerationCommandError - */ -const de_StartContentModerationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.rekognition#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VideoTooLargeException": - case "com.amazonaws.rekognition#VideoTooLargeException": - throw await de_VideoTooLargeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartFaceDetectionCommand + * deserializeAws_json1_1ListMediaAnalysisJobsCommand */ -export const de_StartFaceDetectionCommand = async ( +export const de_ListMediaAnalysisJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartFaceDetectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartFaceDetectionCommandOutput = { + contents = de_ListMediaAnalysisJobsResponse(data, context); + const response: ListMediaAnalysisJobsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5386,69 +2393,19 @@ export const de_StartFaceDetectionCommand = async ( }; /** - * deserializeAws_json1_1StartFaceDetectionCommandError - */ -const de_StartFaceDetectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.rekognition#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VideoTooLargeException": - case "com.amazonaws.rekognition#VideoTooLargeException": - throw await de_VideoTooLargeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartFaceSearchCommand + * deserializeAws_json1_1ListProjectPoliciesCommand */ -export const de_StartFaceSearchCommand = async ( +export const de_ListProjectPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartFaceSearchCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartFaceSearchCommandOutput = { + contents = de_ListProjectPoliciesResponse(data, context); + const response: ListProjectPoliciesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5456,72 +2413,39 @@ export const de_StartFaceSearchCommand = async ( }; /** - * deserializeAws_json1_1StartFaceSearchCommandError - */ -const de_StartFaceSearchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.rekognition#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VideoTooLargeException": - case "com.amazonaws.rekognition#VideoTooLargeException": - throw await de_VideoTooLargeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + * deserializeAws_json1_1ListStreamProcessorsCommand + */ +export const de_ListStreamProcessorsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListStreamProcessorsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartLabelDetectionCommand + * deserializeAws_json1_1ListTagsForResourceCommand */ -export const de_StartLabelDetectionCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartLabelDetectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartLabelDetectionCommandOutput = { + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5529,69 +2453,39 @@ export const de_StartLabelDetectionCommand = async ( }; /** - * deserializeAws_json1_1StartLabelDetectionCommandError + * deserializeAws_json1_1ListUsersCommand */ -const de_StartLabelDetectionCommandError = async ( +export const de_ListUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.rekognition#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VideoTooLargeException": - case "com.amazonaws.rekognition#VideoTooLargeException": - throw await de_VideoTooLargeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListUsersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartMediaAnalysisJobCommand + * deserializeAws_json1_1PutProjectPolicyCommand */ -export const de_StartMediaAnalysisJobCommand = async ( +export const de_PutProjectPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartMediaAnalysisJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartMediaAnalysisJobCommandOutput = { + const response: PutProjectPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5599,75 +2493,39 @@ export const de_StartMediaAnalysisJobCommand = async ( }; /** - * deserializeAws_json1_1StartMediaAnalysisJobCommandError + * deserializeAws_json1_1RecognizeCelebritiesCommand */ -const de_StartMediaAnalysisJobCommandError = async ( +export const de_RecognizeCelebritiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.rekognition#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidManifestException": - case "com.amazonaws.rekognition#InvalidManifestException": - throw await de_InvalidManifestExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceNotReadyException": - case "com.amazonaws.rekognition#ResourceNotReadyException": - throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_RecognizeCelebritiesResponse(data, context); + const response: RecognizeCelebritiesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartPersonTrackingCommand + * deserializeAws_json1_1SearchFacesCommand */ -export const de_StartPersonTrackingCommand = async ( +export const de_SearchFacesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartPersonTrackingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartPersonTrackingCommandOutput = { + contents = de_SearchFacesResponse(data, context); + const response: SearchFacesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5675,69 +2533,39 @@ export const de_StartPersonTrackingCommand = async ( }; /** - * deserializeAws_json1_1StartPersonTrackingCommandError + * deserializeAws_json1_1SearchFacesByImageCommand */ -const de_StartPersonTrackingCommandError = async ( +export const de_SearchFacesByImageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.rekognition#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VideoTooLargeException": - case "com.amazonaws.rekognition#VideoTooLargeException": - throw await de_VideoTooLargeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SearchFacesByImageResponse(data, context); + const response: SearchFacesByImageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartProjectVersionCommand + * deserializeAws_json1_1SearchUsersCommand */ -export const de_StartProjectVersionCommand = async ( +export const de_SearchUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartProjectVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartProjectVersionCommandOutput = { + contents = de_SearchUsersResponse(data, context); + const response: SearchUsersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5745,66 +2573,39 @@ export const de_StartProjectVersionCommand = async ( }; /** - * deserializeAws_json1_1StartProjectVersionCommandError + * deserializeAws_json1_1SearchUsersByImageCommand */ -const de_StartProjectVersionCommandError = async ( +export const de_SearchUsersByImageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_SearchUsersByImageResponse(data, context); + const response: SearchUsersByImageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartSegmentDetectionCommand + * deserializeAws_json1_1StartCelebrityRecognitionCommand */ -export const de_StartSegmentDetectionCommand = async ( +export const de_StartCelebrityRecognitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartSegmentDetectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartSegmentDetectionCommandOutput = { + const response: StartCelebrityRecognitionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5812,69 +2613,39 @@ export const de_StartSegmentDetectionCommand = async ( }; /** - * deserializeAws_json1_1StartSegmentDetectionCommandError + * deserializeAws_json1_1StartContentModerationCommand */ -const de_StartSegmentDetectionCommandError = async ( +export const de_StartContentModerationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.rekognition#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VideoTooLargeException": - case "com.amazonaws.rekognition#VideoTooLargeException": - throw await de_VideoTooLargeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartContentModerationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartStreamProcessorCommand + * deserializeAws_json1_1StartFaceDetectionCommand */ -export const de_StartStreamProcessorCommand = async ( +export const de_StartFaceDetectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartStreamProcessorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartStreamProcessorCommandOutput = { + const response: StartFaceDetectionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5882,63 +2653,39 @@ export const de_StartStreamProcessorCommand = async ( }; /** - * deserializeAws_json1_1StartStreamProcessorCommandError + * deserializeAws_json1_1StartFaceSearchCommand */ -const de_StartStreamProcessorCommandError = async ( +export const de_StartFaceSearchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartFaceSearchCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartTextDetectionCommand + * deserializeAws_json1_1StartLabelDetectionCommand */ -export const de_StartTextDetectionCommand = async ( +export const de_StartLabelDetectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartTextDetectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartTextDetectionCommandOutput = { + const response: StartLabelDetectionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5946,69 +2693,59 @@ export const de_StartTextDetectionCommand = async ( }; /** - * deserializeAws_json1_1StartTextDetectionCommandError + * deserializeAws_json1_1StartMediaAnalysisJobCommand */ -const de_StartTextDetectionCommandError = async ( +export const de_StartMediaAnalysisJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartMediaAnalysisJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.rekognition#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.rekognition#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "VideoTooLargeException": - case "com.amazonaws.rekognition#VideoTooLargeException": - throw await de_VideoTooLargeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1StartPersonTrackingCommand + */ +export const de_StartPersonTrackingCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartPersonTrackingCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopProjectVersionCommand + * deserializeAws_json1_1StartProjectVersionCommand */ -export const de_StopProjectVersionCommand = async ( +export const de_StartProjectVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopProjectVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopProjectVersionCommandOutput = { + const response: StartProjectVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6016,63 +2753,59 @@ export const de_StopProjectVersionCommand = async ( }; /** - * deserializeAws_json1_1StopProjectVersionCommandError + * deserializeAws_json1_1StartSegmentDetectionCommand */ -const de_StopProjectVersionCommandError = async ( +export const de_StartSegmentDetectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartSegmentDetectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1StartStreamProcessorCommand + */ +export const de_StartStreamProcessorCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartStreamProcessorCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopStreamProcessorCommand + * deserializeAws_json1_1StartTextDetectionCommand */ -export const de_StopStreamProcessorCommand = async ( +export const de_StartTextDetectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopStreamProcessorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StopStreamProcessorCommandOutput = { + const response: StartTextDetectionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6080,63 +2813,39 @@ export const de_StopStreamProcessorCommand = async ( }; /** - * deserializeAws_json1_1StopStreamProcessorCommandError + * deserializeAws_json1_1StopProjectVersionCommand */ -const de_StopStreamProcessorCommandError = async ( +export const de_StopProjectVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StopProjectVersionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1StopStreamProcessorCommand */ -export const de_TagResourceCommand = async ( +export const de_StopStreamProcessorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: StopStreamProcessorCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6144,47 +2853,23 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.rekognition#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -6195,7 +2880,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6207,47 +2892,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDatasetEntriesCommand */ @@ -6256,7 +2900,7 @@ export const de_UpdateDatasetEntriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDatasetEntriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6268,53 +2912,6 @@ export const de_UpdateDatasetEntriesCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDatasetEntriesCommandError - */ -const de_UpdateDatasetEntriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rekognition#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.rekognition#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.rekognition#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.rekognition#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rekognition#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rekognition#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateStreamProcessorCommand */ @@ -6323,7 +2920,7 @@ export const de_UpdateStreamProcessorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateStreamProcessorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6336,12 +2933,9 @@ export const de_UpdateStreamProcessorCommand = async ( }; /** - * deserializeAws_json1_1UpdateStreamProcessorCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateStreamProcessorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -6351,6 +2945,12 @@ const de_UpdateStreamProcessorCommandError = async ( case "AccessDeniedException": case "com.amazonaws.rekognition#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.rekognition#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "IdempotentParameterMismatchException": + case "com.amazonaws.rekognition#IdempotentParameterMismatchException": + throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); case "InternalServerError": case "com.amazonaws.rekognition#InternalServerError": throw await de_InternalServerErrorRes(parsedOutput, context); @@ -6360,22 +2960,64 @@ const de_UpdateStreamProcessorCommandError = async ( case "ProvisionedThroughputExceededException": case "com.amazonaws.rekognition#ProvisionedThroughputExceededException": throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.rekognition#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.rekognition#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.rekognition#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.rekognition#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ImageTooLargeException": + case "com.amazonaws.rekognition#ImageTooLargeException": + throw await de_ImageTooLargeExceptionRes(parsedOutput, context); + case "InvalidImageFormatException": + case "com.amazonaws.rekognition#InvalidImageFormatException": + throw await de_InvalidImageFormatExceptionRes(parsedOutput, context); + case "InvalidS3ObjectException": + case "com.amazonaws.rekognition#InvalidS3ObjectException": + throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.rekognition#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.rekognition#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.rekognition#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidPolicyRevisionIdException": + case "com.amazonaws.rekognition#InvalidPolicyRevisionIdException": + throw await de_InvalidPolicyRevisionIdExceptionRes(parsedOutput, context); + case "InvalidPaginationTokenException": + case "com.amazonaws.rekognition#InvalidPaginationTokenException": + throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); + case "ResourceNotReadyException": + case "com.amazonaws.rekognition#ResourceNotReadyException": + throw await de_ResourceNotReadyExceptionRes(parsedOutput, context); + case "HumanLoopQuotaExceededException": + case "com.amazonaws.rekognition#HumanLoopQuotaExceededException": + throw await de_HumanLoopQuotaExceededExceptionRes(parsedOutput, context); + case "SessionNotFoundException": + case "com.amazonaws.rekognition#SessionNotFoundException": + throw await de_SessionNotFoundExceptionRes(parsedOutput, context); + case "MalformedPolicyDocumentException": + case "com.amazonaws.rekognition#MalformedPolicyDocumentException": + throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); + case "VideoTooLargeException": + case "com.amazonaws.rekognition#VideoTooLargeException": + throw await de_VideoTooLargeExceptionRes(parsedOutput, context); + case "InvalidManifestException": + case "com.amazonaws.rekognition#InvalidManifestException": + throw await de_InvalidManifestExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts b/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts index 8f1e1bd9449b..51dd6f72e892 100644 --- a/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts +++ b/clients/client-rekognitionstreaming/src/protocols/Aws_restJson1.ts @@ -88,7 +88,7 @@ export const de_StartFaceLivenessSessionCommand = async ( context: __SerdeContext & __EventStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartFaceLivenessSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -100,12 +100,9 @@ export const de_StartFaceLivenessSessionCommand = async ( }; /** - * deserializeAws_restJson1StartFaceLivenessSessionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_StartFaceLivenessSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -139,7 +136,7 @@ const de_StartFaceLivenessSessionCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-repostspace/src/protocols/Aws_restJson1.ts b/clients/client-repostspace/src/protocols/Aws_restJson1.ts index 52986adc57df..89847051de1a 100644 --- a/clients/client-repostspace/src/protocols/Aws_restJson1.ts +++ b/clients/client-repostspace/src/protocols/Aws_restJson1.ts @@ -282,7 +282,7 @@ export const de_CreateSpaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSpaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -295,50 +295,6 @@ export const de_CreateSpaceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSpaceCommandError - */ -const de_CreateSpaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.repostspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.repostspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.repostspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.repostspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.repostspace#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.repostspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.repostspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSpaceCommand */ @@ -347,7 +303,7 @@ export const de_DeleteSpaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSpaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -356,44 +312,6 @@ export const de_DeleteSpaceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSpaceCommandError - */ -const de_DeleteSpaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.repostspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.repostspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.repostspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.repostspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.repostspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeregisterAdminCommand */ @@ -402,7 +320,7 @@ export const de_DeregisterAdminCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeregisterAdminCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -411,44 +329,6 @@ export const de_DeregisterAdminCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeregisterAdminCommandError - */ -const de_DeregisterAdminCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.repostspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.repostspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.repostspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.repostspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.repostspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSpaceCommand */ @@ -457,7 +337,7 @@ export const de_GetSpaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSpaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -489,44 +369,6 @@ export const de_GetSpaceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSpaceCommandError - */ -const de_GetSpaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.repostspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.repostspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.repostspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.repostspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.repostspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSpacesCommand */ @@ -535,7 +377,7 @@ export const de_ListSpacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSpacesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -549,41 +391,6 @@ export const de_ListSpacesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSpacesCommandError - */ -const de_ListSpacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.repostspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.repostspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.repostspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.repostspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -592,7 +399,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -605,44 +412,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.repostspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.repostspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.repostspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.repostspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.repostspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RegisterAdminCommand */ @@ -651,7 +420,7 @@ export const de_RegisterAdminCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterAdminCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -660,44 +429,6 @@ export const de_RegisterAdminCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RegisterAdminCommandError - */ -const de_RegisterAdminCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.repostspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.repostspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.repostspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.repostspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.repostspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SendInvitesCommand */ @@ -706,7 +437,7 @@ export const de_SendInvitesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendInvitesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -715,44 +446,6 @@ export const de_SendInvitesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SendInvitesCommandError - */ -const de_SendInvitesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.repostspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.repostspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.repostspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.repostspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.repostspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -761,7 +454,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -770,44 +463,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.repostspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.repostspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.repostspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.repostspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.repostspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -816,7 +471,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -825,44 +480,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.repostspace#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.repostspace#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.repostspace#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.repostspace#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.repostspace#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSpaceCommand */ @@ -871,7 +488,7 @@ export const de_UpdateSpaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSpaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -881,12 +498,9 @@ export const de_UpdateSpaceCommand = async ( }; /** - * deserializeAws_restJson1UpdateSpaceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateSpaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -905,6 +519,9 @@ const de_UpdateSpaceCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.repostspace#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.repostspace#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.repostspace#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -917,7 +534,7 @@ const de_UpdateSpaceCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts b/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts index 1f400b683a61..b8c062592954 100644 --- a/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts +++ b/clients/client-resiliencehub/src/protocols/Aws_restJson1.ts @@ -1581,7 +1581,7 @@ export const de_AddDraftAppVersionResourceMappingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AddDraftAppVersionResourceMappingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1596,47 +1596,6 @@ export const de_AddDraftAppVersionResourceMappingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddDraftAppVersionResourceMappingsCommandError - */ -const de_AddDraftAppVersionResourceMappingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUpdateRecommendationStatusCommand */ @@ -1645,7 +1604,7 @@ export const de_BatchUpdateRecommendationStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpdateRecommendationStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1660,44 +1619,6 @@ export const de_BatchUpdateRecommendationStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchUpdateRecommendationStatusCommandError - */ -const de_BatchUpdateRecommendationStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAppCommand */ @@ -1706,7 +1627,7 @@ export const de_CreateAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAppCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1719,50 +1640,6 @@ export const de_CreateAppCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAppCommandError - */ -const de_CreateAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.resiliencehub#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAppVersionAppComponentCommand */ @@ -1771,7 +1648,7 @@ export const de_CreateAppVersionAppComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAppVersionAppComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1786,50 +1663,6 @@ export const de_CreateAppVersionAppComponentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAppVersionAppComponentCommandError - */ -const de_CreateAppVersionAppComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.resiliencehub#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAppVersionResourceCommand */ @@ -1838,7 +1671,7 @@ export const de_CreateAppVersionResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAppVersionResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1853,50 +1686,6 @@ export const de_CreateAppVersionResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAppVersionResourceCommandError - */ -const de_CreateAppVersionResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.resiliencehub#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRecommendationTemplateCommand */ @@ -1905,7 +1694,7 @@ export const de_CreateRecommendationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRecommendationTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1919,120 +1708,78 @@ export const de_CreateRecommendationTemplateCommand = async ( }; /** - * deserializeAws_restJson1CreateRecommendationTemplateCommandError + * deserializeAws_restJson1CreateResiliencyPolicyCommand */ -const de_CreateRecommendationTemplateCommandError = async ( +export const de_CreateResiliencyPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.resiliencehub#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + policy: (_) => de_ResiliencyPolicy(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateResiliencyPolicyCommand + * deserializeAws_restJson1DeleteAppCommand */ -export const de_CreateResiliencyPolicyCommand = async ( +export const de_DeleteAppCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateResiliencyPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - policy: (_) => de_ResiliencyPolicy(_, context), + appArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateResiliencyPolicyCommandError + * deserializeAws_restJson1DeleteAppAssessmentCommand */ -const de_CreateResiliencyPolicyCommandError = async ( +export const de_DeleteAppAssessmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.resiliencehub#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + assessmentArn: __expectString, + assessmentStatus: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteAppCommand + * deserializeAws_restJson1DeleteAppInputSourceCommand */ -export const de_DeleteAppCommand = async ( +export const de_DeleteAppInputSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAppCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2040,1471 +1787,221 @@ export const de_DeleteAppCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { appArn: __expectString, + appInputSource: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteAppCommandError - */ -const de_DeleteAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAppAssessmentCommand + * deserializeAws_restJson1DeleteAppVersionAppComponentCommand */ -export const de_DeleteAppAssessmentCommand = async ( +export const de_DeleteAppVersionAppComponentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAppAssessmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - assessmentArn: __expectString, - assessmentStatus: __expectString, + appArn: __expectString, + appComponent: _json, + appVersion: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteAppAssessmentCommandError + * deserializeAws_restJson1DeleteAppVersionResourceCommand */ -const de_DeleteAppAssessmentCommandError = async ( +export const de_DeleteAppVersionResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + appArn: __expectString, + appVersion: __expectString, + physicalResource: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteAppInputSourceCommand + * deserializeAws_restJson1DeleteRecommendationTemplateCommand */ -export const de_DeleteAppInputSourceCommand = async ( +export const de_DeleteRecommendationTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAppInputSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - appArn: __expectString, - appInputSource: _json, + recommendationTemplateArn: __expectString, + status: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteAppInputSourceCommandError + * deserializeAws_restJson1DeleteResiliencyPolicyCommand */ -const de_DeleteAppInputSourceCommandError = async ( +export const de_DeleteResiliencyPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + policyArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteAppVersionAppComponentCommand + * deserializeAws_restJson1DescribeAppCommand */ -export const de_DeleteAppVersionAppComponentCommand = async ( +export const de_DescribeAppCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAppVersionAppComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - appArn: __expectString, - appComponent: _json, - appVersion: __expectString, + app: (_) => de_App(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteAppVersionAppComponentCommandError + * deserializeAws_restJson1DescribeAppAssessmentCommand */ -const de_DeleteAppVersionAppComponentCommandError = async ( +export const de_DescribeAppAssessmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + assessment: (_) => de_AppAssessment(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeleteAppVersionResourceCommand + * deserializeAws_restJson1DescribeAppVersionCommand */ -export const de_DeleteAppVersionResourceCommand = async ( +export const de_DescribeAppVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAppVersionResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + additionalInfo: _json, appArn: __expectString, appVersion: __expectString, - physicalResource: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteAppVersionResourceCommandError + * deserializeAws_restJson1DescribeAppVersionAppComponentCommand */ -const de_DeleteAppVersionResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRecommendationTemplateCommand - */ -export const de_DeleteRecommendationTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRecommendationTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - recommendationTemplateArn: __expectString, - status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRecommendationTemplateCommandError - */ -const de_DeleteRecommendationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteResiliencyPolicyCommand - */ -export const de_DeleteResiliencyPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteResiliencyPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - policyArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteResiliencyPolicyCommandError - */ -const de_DeleteResiliencyPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAppCommand - */ -export const de_DescribeAppCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - app: (_) => de_App(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAppCommandError - */ -const de_DescribeAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAppAssessmentCommand - */ -export const de_DescribeAppAssessmentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppAssessmentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - assessment: (_) => de_AppAssessment(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAppAssessmentCommandError - */ -const de_DescribeAppAssessmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAppVersionCommand - */ -export const de_DescribeAppVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - additionalInfo: _json, - appArn: __expectString, - appVersion: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAppVersionCommandError - */ -const de_DescribeAppVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAppVersionAppComponentCommand - */ -export const de_DescribeAppVersionAppComponentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppVersionAppComponentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - appArn: __expectString, - appComponent: _json, - appVersion: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAppVersionAppComponentCommandError - */ -const de_DescribeAppVersionAppComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAppVersionResourceCommand - */ -export const de_DescribeAppVersionResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppVersionResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - appArn: __expectString, - appVersion: __expectString, - physicalResource: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAppVersionResourceCommandError - */ -const de_DescribeAppVersionResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAppVersionResourcesResolutionStatusCommand - */ -export const de_DescribeAppVersionResourcesResolutionStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppVersionResourcesResolutionStatusCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - appArn: __expectString, - appVersion: __expectString, - errorMessage: __expectString, - resolutionId: __expectString, - status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAppVersionResourcesResolutionStatusCommandError - */ -const de_DescribeAppVersionResourcesResolutionStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeAppVersionTemplateCommand - */ -export const de_DescribeAppVersionTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppVersionTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - appArn: __expectString, - appTemplateBody: __expectString, - appVersion: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeAppVersionTemplateCommandError - */ -const de_DescribeAppVersionTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDraftAppVersionResourcesImportStatusCommand - */ -export const de_DescribeDraftAppVersionResourcesImportStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDraftAppVersionResourcesImportStatusCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - appArn: __expectString, - appVersion: __expectString, - errorMessage: __expectString, - status: __expectString, - statusChangeTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeDraftAppVersionResourcesImportStatusCommandError - */ -const de_DescribeDraftAppVersionResourcesImportStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeResiliencyPolicyCommand - */ -export const de_DescribeResiliencyPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeResiliencyPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - policy: (_) => de_ResiliencyPolicy(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeResiliencyPolicyCommandError - */ -const de_DescribeResiliencyPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ImportResourcesToDraftAppVersionCommand - */ -export const de_ImportResourcesToDraftAppVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ImportResourcesToDraftAppVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - appArn: __expectString, - appVersion: __expectString, - eksSources: _json, - sourceArns: _json, - status: __expectString, - terraformSources: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ImportResourcesToDraftAppVersionCommandError - */ -const de_ImportResourcesToDraftAppVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.resiliencehub#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAlarmRecommendationsCommand - */ -export const de_ListAlarmRecommendationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAlarmRecommendationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - alarmRecommendations: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAlarmRecommendationsCommandError - */ -const de_ListAlarmRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAppAssessmentComplianceDriftsCommand - */ -export const de_ListAppAssessmentComplianceDriftsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppAssessmentComplianceDriftsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - complianceDrifts: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAppAssessmentComplianceDriftsCommandError - */ -const de_ListAppAssessmentComplianceDriftsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAppAssessmentsCommand - */ -export const de_ListAppAssessmentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppAssessmentsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - assessmentSummaries: (_) => de_AppAssessmentSummaryList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAppAssessmentsCommandError - */ -const de_ListAppAssessmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAppComponentCompliancesCommand - */ -export const de_ListAppComponentCompliancesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppComponentCompliancesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - componentCompliances: (_) => de_ComponentCompliancesList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAppComponentCompliancesCommandError - */ -const de_ListAppComponentCompliancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAppComponentRecommendationsCommand - */ -export const de_ListAppComponentRecommendationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppComponentRecommendationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - componentRecommendations: (_) => de_ComponentRecommendationList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAppComponentRecommendationsCommandError - */ -const de_ListAppComponentRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAppInputSourcesCommand - */ -export const de_ListAppInputSourcesCommand = async ( +export const de_DescribeAppVersionAppComponentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppInputSourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - appInputSources: _json, - nextToken: __expectString, + appArn: __expectString, + appComponent: _json, + appVersion: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAppInputSourcesCommandError - */ -const de_ListAppInputSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAppsCommand + * deserializeAws_restJson1DescribeAppVersionResourceCommand */ -export const de_ListAppsCommand = async ( +export const de_DescribeAppVersionResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - appSummaries: (_) => de_AppSummaryList(_, context), - nextToken: __expectString, + appArn: __expectString, + appVersion: __expectString, + physicalResource: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAppsCommandError - */ -const de_ListAppsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAppVersionAppComponentsCommand + * deserializeAws_restJson1DescribeAppVersionResourcesResolutionStatusCommand */ -export const de_ListAppVersionAppComponentsCommand = async ( +export const de_DescribeAppVersionResourcesResolutionStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppVersionAppComponentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3512,195 +2009,126 @@ export const de_ListAppVersionAppComponentsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { appArn: __expectString, - appComponents: _json, appVersion: __expectString, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAppVersionAppComponentsCommandError - */ -const de_ListAppVersionAppComponentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + errorMessage: __expectString, + resolutionId: __expectString, + status: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListAppVersionResourceMappingsCommand + * deserializeAws_restJson1DescribeAppVersionTemplateCommand */ -export const de_ListAppVersionResourceMappingsCommand = async ( +export const de_DescribeAppVersionTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppVersionResourceMappingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - resourceMappings: _json, + appArn: __expectString, + appTemplateBody: __expectString, + appVersion: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAppVersionResourceMappingsCommandError + * deserializeAws_restJson1DescribeDraftAppVersionResourcesImportStatusCommand */ -const de_ListAppVersionResourceMappingsCommandError = async ( +export const de_DescribeDraftAppVersionResourcesImportStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + appArn: __expectString, + appVersion: __expectString, + errorMessage: __expectString, + status: __expectString, + statusChangeTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListAppVersionResourcesCommand + * deserializeAws_restJson1DescribeResiliencyPolicyCommand */ -export const de_ListAppVersionResourcesCommand = async ( +export const de_DescribeResiliencyPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppVersionResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - physicalResources: _json, - resolutionId: __expectString, + policy: (_) => de_ResiliencyPolicy(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAppVersionResourcesCommandError + * deserializeAws_restJson1ImportResourcesToDraftAppVersionCommand */ -const de_ListAppVersionResourcesCommandError = async ( +export const de_ImportResourcesToDraftAppVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + appArn: __expectString, + appVersion: __expectString, + eksSources: _json, + sourceArns: _json, + status: __expectString, + terraformSources: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListAppVersionsCommand + * deserializeAws_restJson1ListAlarmRecommendationsCommand */ -export const de_ListAppVersionsCommand = async ( +export const de_ListAlarmRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - appVersions: (_) => de_AppVersionList(_, context), + alarmRecommendations: _json, nextToken: __expectString, }); Object.assign(contents, doc); @@ -3708,411 +2136,259 @@ export const de_ListAppVersionsCommand = async ( }; /** - * deserializeAws_restJson1ListAppVersionsCommandError - */ -const de_ListAppVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListRecommendationTemplatesCommand + * deserializeAws_restJson1ListAppAssessmentComplianceDriftsCommand */ -export const de_ListRecommendationTemplatesCommand = async ( +export const de_ListAppAssessmentComplianceDriftsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecommendationTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + complianceDrifts: _json, nextToken: __expectString, - recommendationTemplates: (_) => de_RecommendationTemplateList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRecommendationTemplatesCommandError + * deserializeAws_restJson1ListAppAssessmentsCommand */ -const de_ListRecommendationTemplatesCommandError = async ( +export const de_ListAppAssessmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + assessmentSummaries: (_) => de_AppAssessmentSummaryList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListResiliencyPoliciesCommand + * deserializeAws_restJson1ListAppComponentCompliancesCommand */ -export const de_ListResiliencyPoliciesCommand = async ( +export const de_ListAppComponentCompliancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResiliencyPoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + componentCompliances: (_) => de_ComponentCompliancesList(_, context), nextToken: __expectString, - resiliencyPolicies: (_) => de_ResiliencyPolicies(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListResiliencyPoliciesCommandError + * deserializeAws_restJson1ListAppComponentRecommendationsCommand */ -const de_ListResiliencyPoliciesCommandError = async ( +export const de_ListAppComponentRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + componentRecommendations: (_) => de_ComponentRecommendationList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListSopRecommendationsCommand + * deserializeAws_restJson1ListAppInputSourcesCommand */ -export const de_ListSopRecommendationsCommand = async ( +export const de_ListAppInputSourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSopRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + appInputSources: _json, nextToken: __expectString, - sopRecommendations: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSopRecommendationsCommandError - */ -const de_ListSopRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSuggestedResiliencyPoliciesCommand + * deserializeAws_restJson1ListAppsCommand */ -export const de_ListSuggestedResiliencyPoliciesCommand = async ( +export const de_ListAppsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSuggestedResiliencyPoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + appSummaries: (_) => de_AppSummaryList(_, context), nextToken: __expectString, - resiliencyPolicies: (_) => de_ResiliencyPolicies(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSuggestedResiliencyPoliciesCommandError + * deserializeAws_restJson1ListAppVersionAppComponentsCommand */ -const de_ListSuggestedResiliencyPoliciesCommandError = async ( +export const de_ListAppVersionAppComponentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + appArn: __expectString, + appComponents: _json, + appVersion: __expectString, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListAppVersionResourceMappingsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListAppVersionResourceMappingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + nextToken: __expectString, + resourceMappings: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListAppVersionResourcesCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListAppVersionResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + physicalResources: _json, + resolutionId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTestRecommendationsCommand + * deserializeAws_restJson1ListAppVersionsCommand */ -export const de_ListTestRecommendationsCommand = async ( +export const de_ListAppVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTestRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + appVersions: (_) => de_AppVersionList(_, context), nextToken: __expectString, - testRecommendations: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTestRecommendationsCommandError + * deserializeAws_restJson1ListRecommendationTemplatesCommand */ -const de_ListTestRecommendationsCommandError = async ( +export const de_ListRecommendationTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + recommendationTemplates: (_) => de_RecommendationTemplateList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListUnsupportedAppVersionResourcesCommand + * deserializeAws_restJson1ListResiliencyPoliciesCommand */ -export const de_ListUnsupportedAppVersionResourcesCommand = async ( +export const de_ListResiliencyPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUnsupportedAppVersionResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4120,191 +2396,131 @@ export const de_ListUnsupportedAppVersionResourcesCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - resolutionId: __expectString, - unsupportedResources: _json, + resiliencyPolicies: (_) => de_ResiliencyPolicies(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListUnsupportedAppVersionResourcesCommandError + * deserializeAws_restJson1ListSopRecommendationsCommand */ -const de_ListUnsupportedAppVersionResourcesCommandError = async ( +export const de_ListSopRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + sopRecommendations: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PublishAppVersionCommand + * deserializeAws_restJson1ListSuggestedResiliencyPoliciesCommand */ -export const de_PublishAppVersionCommand = async ( +export const de_ListSuggestedResiliencyPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PublishAppVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - appArn: __expectString, - appVersion: __expectString, - identifier: __expectLong, - versionName: __expectString, + nextToken: __expectString, + resiliencyPolicies: (_) => de_ResiliencyPolicies(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PublishAppVersionCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_PublishAppVersionCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutDraftAppVersionTemplateCommand + * deserializeAws_restJson1ListTestRecommendationsCommand */ -export const de_PutDraftAppVersionTemplateCommand = async ( +export const de_ListTestRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutDraftAppVersionTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - appArn: __expectString, - appVersion: __expectString, + nextToken: __expectString, + testRecommendations: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutDraftAppVersionTemplateCommandError + * deserializeAws_restJson1ListUnsupportedAppVersionResourcesCommand */ -const de_PutDraftAppVersionTemplateCommandError = async ( +export const de_ListUnsupportedAppVersionResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + resolutionId: __expectString, + unsupportedResources: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RemoveDraftAppVersionResourceMappingsCommand + * deserializeAws_restJson1PublishAppVersionCommand */ -export const de_RemoveDraftAppVersionResourceMappingsCommand = async ( +export const de_PublishAppVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveDraftAppVersionResourceMappingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4313,61 +2529,22 @@ export const de_RemoveDraftAppVersionResourceMappingsCommand = async ( const doc = take(data, { appArn: __expectString, appVersion: __expectString, + identifier: __expectLong, + versionName: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RemoveDraftAppVersionResourceMappingsCommandError - */ -const de_RemoveDraftAppVersionResourceMappingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ResolveAppVersionResourcesCommand + * deserializeAws_restJson1PutDraftAppVersionTemplateCommand */ -export const de_ResolveAppVersionResourcesCommand = async ( +export const de_PutDraftAppVersionTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ResolveAppVersionResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4376,183 +2553,87 @@ export const de_ResolveAppVersionResourcesCommand = async ( const doc = take(data, { appArn: __expectString, appVersion: __expectString, - resolutionId: __expectString, - status: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ResolveAppVersionResourcesCommandError - */ -const de_ResolveAppVersionResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1StartAppAssessmentCommand + * deserializeAws_restJson1RemoveDraftAppVersionResourceMappingsCommand */ -export const de_StartAppAssessmentCommand = async ( +export const de_RemoveDraftAppVersionResourceMappingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartAppAssessmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - assessment: (_) => de_AppAssessment(_, context), + appArn: __expectString, + appVersion: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartAppAssessmentCommandError - */ -const de_StartAppAssessmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.resiliencehub#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ResolveAppVersionResourcesCommand */ -export const de_TagResourceCommand = async ( +export const de_ResolveAppVersionResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + appArn: __expectString, + appVersion: __expectString, + resolutionId: __expectString, + status: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1StartAppAssessmentCommand */ -const de_TagResourceCommandError = async ( +export const de_StartAppAssessmentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + assessment: (_) => de_AppAssessment(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UntagResourceCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4562,41 +2643,20 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -4607,7 +2667,7 @@ export const de_UpdateAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAppCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4620,47 +2680,6 @@ export const de_UpdateAppCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAppCommandError - */ -const de_UpdateAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAppVersionCommand */ @@ -4669,7 +2688,7 @@ export const de_UpdateAppVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAppVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4684,47 +2703,6 @@ export const de_UpdateAppVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAppVersionCommandError - */ -const de_UpdateAppVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAppVersionAppComponentCommand */ @@ -4733,7 +2711,7 @@ export const de_UpdateAppVersionAppComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAppVersionAppComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4748,47 +2726,6 @@ export const de_UpdateAppVersionAppComponentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAppVersionAppComponentCommandError - */ -const de_UpdateAppVersionAppComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAppVersionResourceCommand */ @@ -4797,7 +2734,7 @@ export const de_UpdateAppVersionResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAppVersionResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4812,50 +2749,6 @@ export const de_UpdateAppVersionResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAppVersionResourceCommandError - */ -const de_UpdateAppVersionResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resiliencehub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resiliencehub#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resiliencehub#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resiliencehub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.resiliencehub#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resiliencehub#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resiliencehub#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateResiliencyPolicyCommand */ @@ -4864,7 +2757,7 @@ export const de_UpdateResiliencyPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateResiliencyPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4878,12 +2771,9 @@ export const de_UpdateResiliencyPolicyCommand = async ( }; /** - * deserializeAws_restJson1UpdateResiliencyPolicyCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateResiliencyPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4908,13 +2798,16 @@ const de_UpdateResiliencyPolicyCommandError = async ( case "ValidationException": case "com.amazonaws.resiliencehub#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.resiliencehub#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-resource-explorer-2/src/protocols/Aws_restJson1.ts b/clients/client-resource-explorer-2/src/protocols/Aws_restJson1.ts index 5b0798e31e3c..9a988e3bc5f5 100644 --- a/clients/client-resource-explorer-2/src/protocols/Aws_restJson1.ts +++ b/clients/client-resource-explorer-2/src/protocols/Aws_restJson1.ts @@ -544,7 +544,7 @@ export const de_AssociateDefaultViewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateDefaultViewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -557,44 +557,6 @@ export const de_AssociateDefaultViewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateDefaultViewCommandError - */ -const de_AssociateDefaultViewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resourceexplorer2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetViewCommand */ @@ -603,7 +565,7 @@ export const de_BatchGetViewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetViewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -617,44 +579,6 @@ export const de_BatchGetViewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetViewCommandError - */ -const de_BatchGetViewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.resourceexplorer2#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateIndexCommand */ @@ -663,7 +587,7 @@ export const de_CreateIndexCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateIndexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -678,44 +602,6 @@ export const de_CreateIndexCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateIndexCommandError - */ -const de_CreateIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resourceexplorer2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateViewCommand */ @@ -724,7 +610,7 @@ export const de_CreateViewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateViewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -737,50 +623,6 @@ export const de_CreateViewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateViewCommandError - */ -const de_CreateViewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resourceexplorer2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.resourceexplorer2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.resourceexplorer2#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteIndexCommand */ @@ -789,7 +631,7 @@ export const de_DeleteIndexCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteIndexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -804,44 +646,6 @@ export const de_DeleteIndexCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteIndexCommandError - */ -const de_DeleteIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resourceexplorer2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteViewCommand */ @@ -850,7 +654,7 @@ export const de_DeleteViewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteViewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -863,47 +667,6 @@ export const de_DeleteViewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteViewCommandError - */ -const de_DeleteViewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resourceexplorer2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.resourceexplorer2#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateDefaultViewCommand */ @@ -912,7 +675,7 @@ export const de_DisassociateDefaultViewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateDefaultViewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -921,44 +684,6 @@ export const de_DisassociateDefaultViewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateDefaultViewCommandError - */ -const de_DisassociateDefaultViewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resourceexplorer2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAccountLevelServiceConfigurationCommand */ @@ -967,7 +692,7 @@ export const de_GetAccountLevelServiceConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccountLevelServiceConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -980,41 +705,6 @@ export const de_GetAccountLevelServiceConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAccountLevelServiceConfigurationCommandError - */ -const de_GetAccountLevelServiceConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resourceexplorer2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDefaultViewCommand */ @@ -1023,7 +713,7 @@ export const de_GetDefaultViewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDefaultViewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1036,44 +726,6 @@ export const de_GetDefaultViewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDefaultViewCommandError - */ -const de_GetDefaultViewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resourceexplorer2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIndexCommand */ @@ -1082,7 +734,7 @@ export const de_GetIndexCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIndexCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1102,44 +754,6 @@ export const de_GetIndexCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetIndexCommandError - */ -const de_GetIndexCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resourceexplorer2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetViewCommand */ @@ -1148,7 +762,7 @@ export const de_GetViewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetViewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1162,47 +776,6 @@ export const de_GetViewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetViewCommandError - */ -const de_GetViewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resourceexplorer2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.resourceexplorer2#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIndexesCommand */ @@ -1211,7 +784,7 @@ export const de_ListIndexesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIndexesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1225,41 +798,6 @@ export const de_ListIndexesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListIndexesCommandError - */ -const de_ListIndexesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListIndexesForMembersCommand */ @@ -1268,7 +806,7 @@ export const de_ListIndexesForMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIndexesForMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1283,157 +821,46 @@ export const de_ListIndexesForMembersCommand = async ( }; /** - * deserializeAws_restJson1ListIndexesForMembersCommandError - */ -const de_ListIndexesForMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSupportedResourceTypesCommand - */ -export const de_ListSupportedResourceTypesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSupportedResourceTypesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - ResourceTypes: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSupportedResourceTypesCommandError - */ -const de_ListSupportedResourceTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListSupportedResourceTypesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListSupportedResourceTypesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: _json, + NextToken: __expectString, + ResourceTypes: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resourceexplorer2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.resourceexplorer2#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1444,7 +871,7 @@ export const de_ListViewsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListViewsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1458,41 +885,6 @@ export const de_ListViewsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListViewsCommandError - */ -const de_ListViewsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchCommand */ @@ -1501,7 +893,7 @@ export const de_SearchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1517,44 +909,6 @@ export const de_SearchCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchCommandError - */ -const de_SearchCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resourceexplorer2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.resourceexplorer2#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1563,7 +917,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1572,47 +926,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resourceexplorer2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.resourceexplorer2#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1621,7 +934,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1630,47 +943,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resourceexplorer2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.resourceexplorer2#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateIndexTypeCommand */ @@ -1679,7 +951,7 @@ export const de_UpdateIndexTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIndexTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1695,50 +967,6 @@ export const de_UpdateIndexTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateIndexTypeCommandError - */ -const de_UpdateIndexTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.resourceexplorer2#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.resourceexplorer2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.resourceexplorer2#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.resourceexplorer2#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.resourceexplorer2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.resourceexplorer2#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.resourceexplorer2#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateViewCommand */ @@ -1747,7 +975,7 @@ export const de_UpdateViewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateViewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1761,12 +989,9 @@ export const de_UpdateViewCommand = async ( }; /** - * deserializeAws_restJson1UpdateViewCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateViewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1779,25 +1004,31 @@ const de_UpdateViewCommandError = async ( case "InternalServerException": case "com.amazonaws.resourceexplorer2#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.resourceexplorer2#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.resourceexplorer2#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.resourceexplorer2#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.resourceexplorer2#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.resourceexplorer2#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.resourceexplorer2#UnauthorizedException": + throw await de_UnauthorizedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.resourceexplorer2#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.resourceexplorer2#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts b/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts index 1524ebc41fd7..11867b511acb 100644 --- a/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts +++ b/clients/client-resource-groups-tagging-api/src/protocols/Aws_json1_1.ts @@ -162,7 +162,7 @@ export const de_DescribeReportCreationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeReportCreationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -174,41 +174,6 @@ export const de_DescribeReportCreationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeReportCreationCommandError - */ -const de_DescribeReportCreationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConstraintViolationException": - case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetComplianceSummaryCommand */ @@ -217,7 +182,7 @@ export const de_GetComplianceSummaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetComplianceSummaryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -229,41 +194,6 @@ export const de_GetComplianceSummaryCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetComplianceSummaryCommandError - */ -const de_GetComplianceSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConstraintViolationException": - case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetResourcesCommand */ @@ -272,7 +202,7 @@ export const de_GetResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -284,41 +214,6 @@ export const de_GetResourcesCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetResourcesCommandError - */ -const de_GetResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "PaginationTokenExpiredException": - case "com.amazonaws.resourcegroupstaggingapi#PaginationTokenExpiredException": - throw await de_PaginationTokenExpiredExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetTagKeysCommand */ @@ -327,7 +222,7 @@ export const de_GetTagKeysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTagKeysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -339,41 +234,6 @@ export const de_GetTagKeysCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetTagKeysCommandError - */ -const de_GetTagKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "PaginationTokenExpiredException": - case "com.amazonaws.resourcegroupstaggingapi#PaginationTokenExpiredException": - throw await de_PaginationTokenExpiredExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetTagValuesCommand */ @@ -382,7 +242,7 @@ export const de_GetTagValuesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTagValuesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -394,41 +254,6 @@ export const de_GetTagValuesCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetTagValuesCommandError - */ -const de_GetTagValuesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "PaginationTokenExpiredException": - case "com.amazonaws.resourcegroupstaggingapi#PaginationTokenExpiredException": - throw await de_PaginationTokenExpiredExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartReportCreationCommand */ @@ -437,7 +262,7 @@ export const de_StartReportCreationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartReportCreationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -449,44 +274,6 @@ export const de_StartReportCreationCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartReportCreationCommandError - */ -const de_StartReportCreationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.resourcegroupstaggingapi#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConstraintViolationException": - case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException": - throw await de_ConstraintViolationExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourcesCommand */ @@ -495,7 +282,7 @@ export const de_TagResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -507,38 +294,6 @@ export const de_TagResourcesCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourcesCommandError - */ -const de_TagResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourcesCommand */ @@ -547,7 +302,7 @@ export const de_UntagResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -560,18 +315,18 @@ export const de_UntagResourcesCommand = async ( }; /** - * deserializeAws_json1_1UntagResourcesCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UntagResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "ConstraintViolationException": + case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException": + throw await de_ConstraintViolationExceptionRes(parsedOutput, context); case "InternalServiceException": case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException": throw await de_InternalServiceExceptionRes(parsedOutput, context); @@ -581,13 +336,19 @@ const de_UntagResourcesCommandError = async ( case "ThrottledException": case "com.amazonaws.resourcegroupstaggingapi#ThrottledException": throw await de_ThrottledExceptionRes(parsedOutput, context); + case "PaginationTokenExpiredException": + case "com.amazonaws.resourcegroupstaggingapi#PaginationTokenExpiredException": + throw await de_PaginationTokenExpiredExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.resourcegroupstaggingapi#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-resource-groups/src/protocols/Aws_restJson1.ts b/clients/client-resource-groups/src/protocols/Aws_restJson1.ts index 7d21da55f85c..1eecb607df96 100644 --- a/clients/client-resource-groups/src/protocols/Aws_restJson1.ts +++ b/clients/client-resource-groups/src/protocols/Aws_restJson1.ts @@ -477,7 +477,7 @@ export const de_CreateGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -493,44 +493,6 @@ export const de_CreateGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGroupCommandError - */ -const de_CreateGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteGroupCommand */ @@ -539,7 +501,7 @@ export const de_DeleteGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -552,47 +514,6 @@ export const de_DeleteGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteGroupCommandError - */ -const de_DeleteGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.resourcegroups#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAccountSettingsCommand */ @@ -601,7 +522,7 @@ export const de_GetAccountSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccountSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -614,44 +535,6 @@ export const de_GetAccountSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAccountSettingsCommandError - */ -const de_GetAccountSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGroupCommand */ @@ -660,7 +543,7 @@ export const de_GetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -673,47 +556,6 @@ export const de_GetGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetGroupCommandError - */ -const de_GetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.resourcegroups#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGroupConfigurationCommand */ @@ -722,7 +564,7 @@ export const de_GetGroupConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGroupConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -735,47 +577,6 @@ export const de_GetGroupConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetGroupConfigurationCommandError - */ -const de_GetGroupConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.resourcegroups#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGroupQueryCommand */ @@ -784,7 +585,7 @@ export const de_GetGroupQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGroupQueryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -797,47 +598,6 @@ export const de_GetGroupQueryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetGroupQueryCommandError - */ -const de_GetGroupQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.resourcegroups#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTagsCommand */ @@ -846,7 +606,7 @@ export const de_GetTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTagsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -860,47 +620,6 @@ export const de_GetTagsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTagsCommandError - */ -const de_GetTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.resourcegroups#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GroupResourcesCommand */ @@ -909,7 +628,7 @@ export const de_GroupResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GroupResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -924,47 +643,6 @@ export const de_GroupResourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GroupResourcesCommandError - */ -const de_GroupResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.resourcegroups#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListGroupResourcesCommand */ @@ -973,7 +651,7 @@ export const de_ListGroupResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGroupResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -989,50 +667,6 @@ export const de_ListGroupResourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListGroupResourcesCommandError - */ -const de_ListGroupResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.resourcegroups#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.resourcegroups#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListGroupsCommand */ @@ -1041,115 +675,36 @@ export const de_ListGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - GroupIdentifiers: _json, - Groups: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListGroupsCommandError - */ -const de_ListGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1PutGroupConfigurationCommand - */ -export const de_PutGroupConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_PutGroupConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1PutGroupConfigurationCommandError - */ -const de_PutGroupConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.resourcegroups#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + GroupIdentifiers: _json, + Groups: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1PutGroupConfigurationCommand + */ +export const de_PutGroupConfigurationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -1160,7 +715,7 @@ export const de_SearchResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1175,53 +730,12 @@ export const de_SearchResourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchResourcesCommandError - */ -const de_SearchResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.resourcegroups#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagCommand */ export const de_TagCommand = async (output: __HttpResponse, context: __SerdeContext): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1235,44 +749,6 @@ export const de_TagCommand = async (output: __HttpResponse, context: __SerdeCont return contents; }; -/** - * deserializeAws_restJson1TagCommandError - */ -const de_TagCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.resourcegroups#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UngroupResourcesCommand */ @@ -1281,7 +757,7 @@ export const de_UngroupResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UngroupResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1296,53 +772,12 @@ export const de_UngroupResourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UngroupResourcesCommandError - */ -const de_UngroupResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.resourcegroups#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagCommand */ export const de_UntagCommand = async (output: __HttpResponse, context: __SerdeContext): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1356,44 +791,6 @@ export const de_UntagCommand = async (output: __HttpResponse, context: __SerdeCo return contents; }; -/** - * deserializeAws_restJson1UntagCommandError - */ -const de_UntagCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.resourcegroups#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAccountSettingsCommand */ @@ -1402,7 +799,7 @@ export const de_UpdateAccountSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAccountSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1415,44 +812,6 @@ export const de_UpdateAccountSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAccountSettingsCommandError - */ -const de_UpdateAccountSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateGroupCommand */ @@ -1461,7 +820,7 @@ export const de_UpdateGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1474,47 +833,6 @@ export const de_UpdateGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateGroupCommandError - */ -const de_UpdateGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.resourcegroups#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.resourcegroups#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.resourcegroups#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "MethodNotAllowedException": - case "com.amazonaws.resourcegroups#MethodNotAllowedException": - throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.resourcegroups#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.resourcegroups#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateGroupQueryCommand */ @@ -1523,7 +841,7 @@ export const de_UpdateGroupQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGroupQueryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1537,12 +855,9 @@ export const de_UpdateGroupQueryCommand = async ( }; /** - * deserializeAws_restJson1UpdateGroupQueryCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateGroupQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1561,19 +876,22 @@ const de_UpdateGroupQueryCommandError = async ( case "MethodNotAllowedException": case "com.amazonaws.resourcegroups#MethodNotAllowedException": throw await de_MethodNotAllowedExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.resourcegroups#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.resourcegroups#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.resourcegroups#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.resourcegroups#UnauthorizedException": + throw await de_UnauthorizedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-robomaker/src/protocols/Aws_restJson1.ts b/clients/client-robomaker/src/protocols/Aws_restJson1.ts index 881dbdff986a..9595dc0ec4d1 100644 --- a/clients/client-robomaker/src/protocols/Aws_restJson1.ts +++ b/clients/client-robomaker/src/protocols/Aws_restJson1.ts @@ -1603,7 +1603,7 @@ export const de_BatchDeleteWorldsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDeleteWorldsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1616,38 +1616,6 @@ export const de_BatchDeleteWorldsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDeleteWorldsCommandError - */ -const de_BatchDeleteWorldsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDescribeSimulationJobCommand */ @@ -1656,7 +1624,7 @@ export const de_BatchDescribeSimulationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDescribeSimulationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1670,41 +1638,6 @@ export const de_BatchDescribeSimulationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDescribeSimulationJobCommandError - */ -const de_BatchDescribeSimulationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelDeploymentJobCommand */ @@ -1713,7 +1646,7 @@ export const de_CancelDeploymentJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelDeploymentJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1722,41 +1655,6 @@ export const de_CancelDeploymentJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelDeploymentJobCommandError - */ -const de_CancelDeploymentJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelSimulationJobCommand */ @@ -1765,7 +1663,7 @@ export const de_CancelSimulationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelSimulationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1774,41 +1672,6 @@ export const de_CancelSimulationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelSimulationJobCommandError - */ -const de_CancelSimulationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelSimulationJobBatchCommand */ @@ -1817,7 +1680,7 @@ export const de_CancelSimulationJobBatchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelSimulationJobBatchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1826,41 +1689,6 @@ export const de_CancelSimulationJobBatchCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelSimulationJobBatchCommandError - */ -const de_CancelSimulationJobBatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelWorldExportJobCommand */ @@ -1869,7 +1697,7 @@ export const de_CancelWorldExportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelWorldExportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1878,41 +1706,6 @@ export const de_CancelWorldExportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelWorldExportJobCommandError - */ -const de_CancelWorldExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelWorldGenerationJobCommand */ @@ -1921,7 +1714,7 @@ export const de_CancelWorldGenerationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelWorldGenerationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1930,41 +1723,6 @@ export const de_CancelWorldGenerationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelWorldGenerationJobCommandError - */ -const de_CancelWorldGenerationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDeploymentJobCommand */ @@ -1973,7 +1731,7 @@ export const de_CreateDeploymentJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDeploymentJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1995,58 +1753,14 @@ export const de_CreateDeploymentJobCommand = async ( }; /** - * deserializeAws_restJson1CreateDeploymentJobCommandError + * deserializeAws_restJson1CreateFleetCommand */ -const de_CreateDeploymentJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentDeploymentException": - case "com.amazonaws.robomaker#ConcurrentDeploymentException": - throw await de_ConcurrentDeploymentExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.robomaker#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateFleetCommand - */ -export const de_CreateFleetCommand = async ( +export const de_CreateFleetCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFleetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2062,41 +1776,6 @@ export const de_CreateFleetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFleetCommandError - */ -const de_CreateFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRobotCommand */ @@ -2105,7 +1784,7 @@ export const de_CreateRobotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRobotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2123,44 +1802,6 @@ export const de_CreateRobotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRobotCommandError - */ -const de_CreateRobotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.robomaker#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRobotApplicationCommand */ @@ -2169,7 +1810,7 @@ export const de_CreateRobotApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRobotApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2190,47 +1831,6 @@ export const de_CreateRobotApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRobotApplicationCommandError - */ -const de_CreateRobotApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.robomaker#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.robomaker#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRobotApplicationVersionCommand */ @@ -2239,7 +1839,7 @@ export const de_CreateRobotApplicationVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRobotApplicationVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2259,44 +1859,6 @@ export const de_CreateRobotApplicationVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRobotApplicationVersionCommandError - */ -const de_CreateRobotApplicationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.robomaker#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSimulationApplicationCommand */ @@ -2305,7 +1867,7 @@ export const de_CreateSimulationApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSimulationApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2328,47 +1890,6 @@ export const de_CreateSimulationApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSimulationApplicationCommandError - */ -const de_CreateSimulationApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.robomaker#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.robomaker#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSimulationApplicationVersionCommand */ @@ -2377,7 +1898,7 @@ export const de_CreateSimulationApplicationVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSimulationApplicationVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2399,44 +1920,6 @@ export const de_CreateSimulationApplicationVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSimulationApplicationVersionCommandError - */ -const de_CreateSimulationApplicationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.robomaker#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSimulationJobCommand */ @@ -2445,7 +1928,7 @@ export const de_CreateSimulationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSimulationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2476,58 +1959,14 @@ export const de_CreateSimulationJobCommand = async ( }; /** - * deserializeAws_restJson1CreateSimulationJobCommandError + * deserializeAws_restJson1CreateWorldExportJobCommand */ -const de_CreateSimulationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.robomaker#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.robomaker#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateWorldExportJobCommand - */ -export const de_CreateWorldExportJobCommand = async ( +export const de_CreateWorldExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWorldExportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2547,47 +1986,6 @@ export const de_CreateWorldExportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWorldExportJobCommandError - */ -const de_CreateWorldExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.robomaker#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.robomaker#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWorldGenerationJobCommand */ @@ -2596,7 +1994,7 @@ export const de_CreateWorldGenerationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWorldGenerationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2617,50 +2015,6 @@ export const de_CreateWorldGenerationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWorldGenerationJobCommandError - */ -const de_CreateWorldGenerationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.robomaker#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.robomaker#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWorldTemplateCommand */ @@ -2669,7 +2023,7 @@ export const de_CreateWorldTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWorldTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2686,47 +2040,6 @@ export const de_CreateWorldTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWorldTemplateCommandError - */ -const de_CreateWorldTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.robomaker#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteFleetCommand */ @@ -2735,7 +2048,7 @@ export const de_DeleteFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFleetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2744,38 +2057,6 @@ export const de_DeleteFleetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteFleetCommandError - */ -const de_DeleteFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRobotCommand */ @@ -2784,7 +2065,7 @@ export const de_DeleteRobotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRobotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2793,38 +2074,6 @@ export const de_DeleteRobotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRobotCommandError - */ -const de_DeleteRobotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRobotApplicationCommand */ @@ -2833,7 +2082,7 @@ export const de_DeleteRobotApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRobotApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2842,38 +2091,6 @@ export const de_DeleteRobotApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRobotApplicationCommandError - */ -const de_DeleteRobotApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSimulationApplicationCommand */ @@ -2882,7 +2099,7 @@ export const de_DeleteSimulationApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSimulationApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2891,38 +2108,6 @@ export const de_DeleteSimulationApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSimulationApplicationCommandError - */ -const de_DeleteSimulationApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteWorldTemplateCommand */ @@ -2931,7 +2116,7 @@ export const de_DeleteWorldTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteWorldTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2941,49 +2126,14 @@ export const de_DeleteWorldTemplateCommand = async ( }; /** - * deserializeAws_restJson1DeleteWorldTemplateCommandError + * deserializeAws_restJson1DeregisterRobotCommand */ -const de_DeleteWorldTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeregisterRobotCommand - */ -export const de_DeregisterRobotCommand = async ( +export const de_DeregisterRobotCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeregisterRobotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2997,41 +2147,6 @@ export const de_DeregisterRobotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeregisterRobotCommandError - */ -const de_DeregisterRobotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDeploymentJobCommand */ @@ -3040,7 +2155,7 @@ export const de_DescribeDeploymentJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDeploymentJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3062,41 +2177,6 @@ export const de_DescribeDeploymentJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDeploymentJobCommandError - */ -const de_DescribeDeploymentJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeFleetCommand */ @@ -3105,7 +2185,7 @@ export const de_DescribeFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFleetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3125,41 +2205,6 @@ export const de_DescribeFleetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeFleetCommandError - */ -const de_DescribeFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeRobotCommand */ @@ -3168,7 +2213,7 @@ export const de_DescribeRobotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRobotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3190,41 +2235,6 @@ export const de_DescribeRobotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeRobotCommandError - */ -const de_DescribeRobotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeRobotApplicationCommand */ @@ -3233,7 +2243,7 @@ export const de_DescribeRobotApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRobotApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3255,41 +2265,6 @@ export const de_DescribeRobotApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeRobotApplicationCommandError - */ -const de_DescribeRobotApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeSimulationApplicationCommand */ @@ -3298,7 +2273,7 @@ export const de_DescribeSimulationApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSimulationApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3322,41 +2297,6 @@ export const de_DescribeSimulationApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeSimulationApplicationCommandError - */ -const de_DescribeSimulationApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeSimulationJobCommand */ @@ -3365,7 +2305,7 @@ export const de_DescribeSimulationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSimulationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3398,41 +2338,6 @@ export const de_DescribeSimulationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeSimulationJobCommandError - */ -const de_DescribeSimulationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeSimulationJobBatchCommand */ @@ -3441,7 +2346,7 @@ export const de_DescribeSimulationJobBatchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSimulationJobBatchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3466,46 +2371,14 @@ export const de_DescribeSimulationJobBatchCommand = async ( }; /** - * deserializeAws_restJson1DescribeSimulationJobBatchCommandError + * deserializeAws_restJson1DescribeWorldCommand */ -const de_DescribeSimulationJobBatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeWorldCommand - */ -export const de_DescribeWorldCommand = async ( +export const de_DescribeWorldCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeWorldCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3523,41 +2396,6 @@ export const de_DescribeWorldCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeWorldCommandError - */ -const de_DescribeWorldCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeWorldExportJobCommand */ @@ -3566,7 +2404,7 @@ export const de_DescribeWorldExportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeWorldExportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3588,41 +2426,6 @@ export const de_DescribeWorldExportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeWorldExportJobCommandError - */ -const de_DescribeWorldExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeWorldGenerationJobCommand */ @@ -3631,7 +2434,7 @@ export const de_DescribeWorldGenerationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeWorldGenerationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3654,41 +2457,6 @@ export const de_DescribeWorldGenerationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeWorldGenerationJobCommandError - */ -const de_DescribeWorldGenerationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeWorldTemplateCommand */ @@ -3697,7 +2465,7 @@ export const de_DescribeWorldTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeWorldTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3716,41 +2484,6 @@ export const de_DescribeWorldTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeWorldTemplateCommandError - */ -const de_DescribeWorldTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetWorldTemplateBodyCommand */ @@ -3759,7 +2492,7 @@ export const de_GetWorldTemplateBodyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorldTemplateBodyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3772,41 +2505,6 @@ export const de_GetWorldTemplateBodyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetWorldTemplateBodyCommandError - */ -const de_GetWorldTemplateBodyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDeploymentJobsCommand */ @@ -3815,7 +2513,7 @@ export const de_ListDeploymentJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeploymentJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3829,41 +2527,6 @@ export const de_ListDeploymentJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDeploymentJobsCommandError - */ -const de_ListDeploymentJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListFleetsCommand */ @@ -3872,7 +2535,7 @@ export const de_ListFleetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFleetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3886,41 +2549,6 @@ export const de_ListFleetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFleetsCommandError - */ -const de_ListFleetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRobotApplicationsCommand */ @@ -3929,7 +2557,7 @@ export const de_ListRobotApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRobotApplicationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3944,46 +2572,14 @@ export const de_ListRobotApplicationsCommand = async ( }; /** - * deserializeAws_restJson1ListRobotApplicationsCommandError + * deserializeAws_restJson1ListRobotsCommand */ -const de_ListRobotApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListRobotsCommand - */ -export const de_ListRobotsCommand = async ( +export const de_ListRobotsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRobotsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3997,41 +2593,6 @@ export const de_ListRobotsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRobotsCommandError - */ -const de_ListRobotsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSimulationApplicationsCommand */ @@ -4040,7 +2601,7 @@ export const de_ListSimulationApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSimulationApplicationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4054,38 +2615,6 @@ export const de_ListSimulationApplicationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSimulationApplicationsCommandError - */ -const de_ListSimulationApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSimulationJobBatchesCommand */ @@ -4094,7 +2623,7 @@ export const de_ListSimulationJobBatchesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSimulationJobBatchesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4108,35 +2637,6 @@ export const de_ListSimulationJobBatchesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSimulationJobBatchesCommandError - */ -const de_ListSimulationJobBatchesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSimulationJobsCommand */ @@ -4145,7 +2645,7 @@ export const de_ListSimulationJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSimulationJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4159,38 +2659,6 @@ export const de_ListSimulationJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSimulationJobsCommandError - */ -const de_ListSimulationJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -4199,7 +2667,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4212,41 +2680,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWorldExportJobsCommand */ @@ -4255,7 +2688,7 @@ export const de_ListWorldExportJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorldExportJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4269,38 +2702,6 @@ export const de_ListWorldExportJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListWorldExportJobsCommandError - */ -const de_ListWorldExportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWorldGenerationJobsCommand */ @@ -4309,7 +2710,7 @@ export const de_ListWorldGenerationJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorldGenerationJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4323,38 +2724,6 @@ export const de_ListWorldGenerationJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListWorldGenerationJobsCommandError - */ -const de_ListWorldGenerationJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWorldsCommand */ @@ -4363,7 +2732,7 @@ export const de_ListWorldsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorldsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4377,38 +2746,6 @@ export const de_ListWorldsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListWorldsCommandError - */ -const de_ListWorldsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWorldTemplatesCommand */ @@ -4417,7 +2754,7 @@ export const de_ListWorldTemplatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorldTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4431,38 +2768,6 @@ export const de_ListWorldTemplatesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListWorldTemplatesCommandError - */ -const de_ListWorldTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RegisterRobotCommand */ @@ -4471,111 +2776,35 @@ export const de_RegisterRobotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterRobotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - fleet: __expectString, - robot: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1RegisterRobotCommandError - */ -const de_RegisterRobotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RestartSimulationJobCommand - */ -export const de_RestartSimulationJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RestartSimulationJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1RestartSimulationJobCommandError - */ -const de_RestartSimulationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + fleet: __expectString, + robot: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1RestartSimulationJobCommand + */ +export const de_RestartSimulationJobCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -4586,7 +2815,7 @@ export const de_StartSimulationJobBatchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartSimulationJobBatchCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4609,44 +2838,6 @@ export const de_StartSimulationJobBatchCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartSimulationJobBatchCommandError - */ -const de_StartSimulationJobBatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatchException": - case "com.amazonaws.robomaker#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SyncDeploymentJobCommand */ @@ -4655,7 +2846,7 @@ export const de_SyncDeploymentJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SyncDeploymentJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4675,50 +2866,6 @@ export const de_SyncDeploymentJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SyncDeploymentJobCommandError - */ -const de_SyncDeploymentJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentDeploymentException": - case "com.amazonaws.robomaker#ConcurrentDeploymentException": - throw await de_ConcurrentDeploymentExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.robomaker#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -4727,7 +2874,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4736,41 +2883,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -4779,7 +2891,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4788,41 +2900,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRobotApplicationCommand */ @@ -4831,7 +2908,7 @@ export const de_UpdateRobotApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRobotApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4851,44 +2928,6 @@ export const de_UpdateRobotApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRobotApplicationCommandError - */ -const de_UpdateRobotApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSimulationApplicationCommand */ @@ -4897,7 +2936,7 @@ export const de_UpdateSimulationApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSimulationApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4919,44 +2958,6 @@ export const de_UpdateSimulationApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSimulationApplicationCommandError - */ -const de_UpdateSimulationApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.robomaker#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.robomaker#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.robomaker#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.robomaker#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWorldTemplateCommand */ @@ -4965,7 +2966,7 @@ export const de_UpdateWorldTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateWorldTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4982,12 +2983,9 @@ export const de_UpdateWorldTemplateCommand = async ( }; /** - * deserializeAws_restJson1UpdateWorldTemplateCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateWorldTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5000,19 +2998,34 @@ const de_UpdateWorldTemplateCommandError = async ( case "InvalidParameterException": case "com.amazonaws.robomaker#InvalidParameterException": throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.robomaker#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.robomaker#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.robomaker#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ConcurrentDeploymentException": + case "com.amazonaws.robomaker#ConcurrentDeploymentException": + throw await de_ConcurrentDeploymentExceptionRes(parsedOutput, context); + case "IdempotentParameterMismatchException": + case "com.amazonaws.robomaker#IdempotentParameterMismatchException": + throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.robomaker#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.robomaker#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.robomaker#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts b/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts index 06dfc526ff17..2f7d51c94747 100644 --- a/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts +++ b/clients/client-rolesanywhere/src/protocols/Aws_restJson1.ts @@ -635,7 +635,7 @@ export const de_CreateProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -648,35 +648,6 @@ export const de_CreateProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateProfileCommandError - */ -const de_CreateProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rolesanywhere#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateTrustAnchorCommand */ @@ -685,7 +656,7 @@ export const de_CreateTrustAnchorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateTrustAnchorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -698,35 +669,6 @@ export const de_CreateTrustAnchorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTrustAnchorCommandError - */ -const de_CreateTrustAnchorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rolesanywhere#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteCrlCommand */ @@ -735,7 +677,7 @@ export const de_DeleteCrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCrlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -748,35 +690,6 @@ export const de_DeleteCrlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteCrlCommandError - */ -const de_DeleteCrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteProfileCommand */ @@ -785,7 +698,7 @@ export const de_DeleteProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -798,35 +711,6 @@ export const de_DeleteProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteProfileCommandError - */ -const de_DeleteProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteTrustAnchorCommand */ @@ -835,7 +719,7 @@ export const de_DeleteTrustAnchorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTrustAnchorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -848,35 +732,6 @@ export const de_DeleteTrustAnchorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteTrustAnchorCommandError - */ -const de_DeleteTrustAnchorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisableCrlCommand */ @@ -885,7 +740,7 @@ export const de_DisableCrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableCrlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -898,35 +753,6 @@ export const de_DisableCrlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisableCrlCommandError - */ -const de_DisableCrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisableProfileCommand */ @@ -935,7 +761,7 @@ export const de_DisableProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -948,35 +774,6 @@ export const de_DisableProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisableProfileCommandError - */ -const de_DisableProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisableTrustAnchorCommand */ @@ -985,7 +782,7 @@ export const de_DisableTrustAnchorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableTrustAnchorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -998,35 +795,6 @@ export const de_DisableTrustAnchorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisableTrustAnchorCommandError - */ -const de_DisableTrustAnchorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1EnableCrlCommand */ @@ -1035,7 +803,7 @@ export const de_EnableCrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableCrlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1049,143 +817,56 @@ export const de_EnableCrlCommand = async ( }; /** - * deserializeAws_restJson1EnableCrlCommandError + * deserializeAws_restJson1EnableProfileCommand */ -const de_EnableCrlCommandError = async ( +export const de_EnableProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + profile: (_) => de_ProfileDetail(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1EnableProfileCommand + * deserializeAws_restJson1EnableTrustAnchorCommand */ -export const de_EnableProfileCommand = async ( +export const de_EnableTrustAnchorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - profile: (_) => de_ProfileDetail(_, context), + trustAnchor: (_) => de_TrustAnchorDetail(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1EnableProfileCommandError + * deserializeAws_restJson1GetCrlCommand */ -const de_EnableProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1EnableTrustAnchorCommand - */ -export const de_EnableTrustAnchorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableTrustAnchorCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - trustAnchor: (_) => de_TrustAnchorDetail(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1EnableTrustAnchorCommandError - */ -const de_EnableTrustAnchorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCrlCommand - */ -export const de_GetCrlCommand = async ( +export const de_GetCrlCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCrlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1198,29 +879,6 @@ export const de_GetCrlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCrlCommandError - */ -const de_GetCrlCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetProfileCommand */ @@ -1229,7 +887,7 @@ export const de_GetProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1242,35 +900,6 @@ export const de_GetProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetProfileCommandError - */ -const de_GetProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSubjectCommand */ @@ -1279,7 +908,7 @@ export const de_GetSubjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSubjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1292,35 +921,6 @@ export const de_GetSubjectCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSubjectCommandError - */ -const de_GetSubjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTrustAnchorCommand */ @@ -1329,7 +929,7 @@ export const de_GetTrustAnchorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTrustAnchorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1342,38 +942,6 @@ export const de_GetTrustAnchorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTrustAnchorCommandError - */ -const de_GetTrustAnchorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rolesanywhere#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ImportCrlCommand */ @@ -1382,7 +950,7 @@ export const de_ImportCrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_ImportCrlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1395,35 +963,6 @@ export const de_ImportCrlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ImportCrlCommandError - */ -const de_ImportCrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rolesanywhere#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListCrlsCommand */ @@ -1432,7 +971,7 @@ export const de_ListCrlsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCrlsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1446,35 +985,6 @@ export const de_ListCrlsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListCrlsCommandError - */ -const de_ListCrlsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rolesanywhere#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProfilesCommand */ @@ -1483,7 +993,7 @@ export const de_ListProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1498,136 +1008,46 @@ export const de_ListProfilesCommand = async ( }; /** - * deserializeAws_restJson1ListProfilesCommandError - */ -const de_ListProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rolesanywhere#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSubjectsCommand - */ -export const de_ListSubjectsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSubjectsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - subjects: (_) => de_SubjectSummaries(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSubjectsCommandError - */ -const de_ListSubjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rolesanywhere#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListSubjectsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListSubjectsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + nextToken: __expectString, + subjects: (_) => de_SubjectSummaries(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rolesanywhere#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1638,7 +1058,7 @@ export const de_ListTrustAnchorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTrustAnchorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1652,35 +1072,6 @@ export const de_ListTrustAnchorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTrustAnchorsCommandError - */ -const de_ListTrustAnchorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rolesanywhere#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutNotificationSettingsCommand */ @@ -1689,7 +1080,7 @@ export const de_PutNotificationSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutNotificationSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1702,38 +1093,6 @@ export const de_PutNotificationSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutNotificationSettingsCommandError - */ -const de_PutNotificationSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rolesanywhere#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ResetNotificationSettingsCommand */ @@ -1742,7 +1101,7 @@ export const de_ResetNotificationSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ResetNotificationSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1755,38 +1114,6 @@ export const de_ResetNotificationSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ResetNotificationSettingsCommandError - */ -const de_ResetNotificationSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rolesanywhere#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1795,7 +1122,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1804,41 +1131,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.rolesanywhere#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rolesanywhere#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1847,7 +1139,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1856,38 +1148,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rolesanywhere#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateCrlCommand */ @@ -1896,7 +1156,7 @@ export const de_UpdateCrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCrlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1909,38 +1169,6 @@ export const de_UpdateCrlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateCrlCommandError - */ -const de_UpdateCrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rolesanywhere#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateProfileCommand */ @@ -1949,7 +1177,7 @@ export const de_UpdateProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1962,38 +1190,6 @@ export const de_UpdateProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateProfileCommandError - */ -const de_UpdateProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rolesanywhere#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rolesanywhere#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTrustAnchorCommand */ @@ -2002,7 +1198,7 @@ export const de_UpdateTrustAnchorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTrustAnchorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2016,12 +1212,9 @@ export const de_UpdateTrustAnchorCommand = async ( }; /** - * deserializeAws_restJson1UpdateTrustAnchorCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateTrustAnchorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2031,19 +1224,22 @@ const de_UpdateTrustAnchorCommandError = async ( case "AccessDeniedException": case "com.amazonaws.rolesanywhere#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rolesanywhere#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.rolesanywhere#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.rolesanywhere#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.rolesanywhere#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts b/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts index 934e3f004832..49b1cabec9a2 100644 --- a/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts +++ b/clients/client-route-53-domains/src/protocols/Aws_json1_1.ts @@ -637,7 +637,7 @@ export const de_AcceptDomainTransferFromAnotherAwsAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptDomainTransferFromAnotherAwsAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -649,41 +649,6 @@ export const de_AcceptDomainTransferFromAnotherAwsAccountCommand = async ( return response; }; -/** - * deserializeAws_json1_1AcceptDomainTransferFromAnotherAwsAccountCommandError - */ -const de_AcceptDomainTransferFromAnotherAwsAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DomainLimitExceeded": - case "com.amazonaws.route53domains#DomainLimitExceeded": - throw await de_DomainLimitExceededRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateDelegationSignerToDomainCommand */ @@ -692,7 +657,7 @@ export const de_AssociateDelegationSignerToDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateDelegationSignerToDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -704,47 +669,6 @@ export const de_AssociateDelegationSignerToDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateDelegationSignerToDomainCommandError - */ -const de_AssociateDelegationSignerToDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DnssecLimitExceeded": - case "com.amazonaws.route53domains#DnssecLimitExceeded": - throw await de_DnssecLimitExceededRes(parsedOutput, context); - case "DuplicateRequest": - case "com.amazonaws.route53domains#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "TLDRulesViolation": - case "com.amazonaws.route53domains#TLDRulesViolation": - throw await de_TLDRulesViolationRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelDomainTransferToAnotherAwsAccountCommand */ @@ -753,7 +677,7 @@ export const de_CancelDomainTransferToAnotherAwsAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelDomainTransferToAnotherAwsAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -765,38 +689,6 @@ export const de_CancelDomainTransferToAnotherAwsAccountCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelDomainTransferToAnotherAwsAccountCommandError - */ -const de_CancelDomainTransferToAnotherAwsAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CheckDomainAvailabilityCommand */ @@ -805,7 +697,7 @@ export const de_CheckDomainAvailabilityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CheckDomainAvailabilityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -817,35 +709,6 @@ export const de_CheckDomainAvailabilityCommand = async ( return response; }; -/** - * deserializeAws_json1_1CheckDomainAvailabilityCommandError - */ -const de_CheckDomainAvailabilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CheckDomainTransferabilityCommand */ @@ -854,7 +717,7 @@ export const de_CheckDomainTransferabilityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CheckDomainTransferabilityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -866,35 +729,6 @@ export const de_CheckDomainTransferabilityCommand = async ( return response; }; -/** - * deserializeAws_json1_1CheckDomainTransferabilityCommandError - */ -const de_CheckDomainTransferabilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteDomainCommand */ @@ -903,7 +737,7 @@ export const de_DeleteDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -915,41 +749,6 @@ export const de_DeleteDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteDomainCommandError - */ -const de_DeleteDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.route53domains#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "TLDRulesViolation": - case "com.amazonaws.route53domains#TLDRulesViolation": - throw await de_TLDRulesViolationRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteTagsForDomainCommand */ @@ -958,7 +757,7 @@ export const de_DeleteTagsForDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTagsForDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -970,38 +769,6 @@ export const de_DeleteTagsForDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteTagsForDomainCommandError - */ -const de_DeleteTagsForDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisableDomainAutoRenewCommand */ @@ -1010,7 +777,7 @@ export const de_DisableDomainAutoRenewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableDomainAutoRenewCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1023,48 +790,39 @@ export const de_DisableDomainAutoRenewCommand = async ( }; /** - * deserializeAws_json1_1DisableDomainAutoRenewCommandError + * deserializeAws_json1_1DisableDomainTransferLockCommand */ -const de_DisableDomainAutoRenewCommandError = async ( +export const de_DisableDomainTransferLockCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisableDomainTransferLockCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisableDomainTransferLockCommand + * deserializeAws_json1_1DisassociateDelegationSignerFromDomainCommand */ -export const de_DisableDomainTransferLockCommand = async ( +export const de_DisassociateDelegationSignerFromDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisableDomainTransferLockCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisableDomainTransferLockCommandOutput = { + const response: DisassociateDelegationSignerFromDomainCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1072,110 +830,14 @@ export const de_DisableDomainTransferLockCommand = async ( }; /** - * deserializeAws_json1_1DisableDomainTransferLockCommandError + * deserializeAws_json1_1EnableDomainAutoRenewCommand */ -const de_DisableDomainTransferLockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.route53domains#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "TLDRulesViolation": - case "com.amazonaws.route53domains#TLDRulesViolation": - throw await de_TLDRulesViolationRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociateDelegationSignerFromDomainCommand - */ -export const de_DisassociateDelegationSignerFromDomainCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisassociateDelegationSignerFromDomainCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DisassociateDelegationSignerFromDomainCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisassociateDelegationSignerFromDomainCommandError - */ -const de_DisassociateDelegationSignerFromDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.route53domains#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "TLDRulesViolation": - case "com.amazonaws.route53domains#TLDRulesViolation": - throw await de_TLDRulesViolationRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1EnableDomainAutoRenewCommand - */ -export const de_EnableDomainAutoRenewCommand = async ( +export const de_EnableDomainAutoRenewCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableDomainAutoRenewCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1187,38 +849,6 @@ export const de_EnableDomainAutoRenewCommand = async ( return response; }; -/** - * deserializeAws_json1_1EnableDomainAutoRenewCommandError - */ -const de_EnableDomainAutoRenewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "TLDRulesViolation": - case "com.amazonaws.route53domains#TLDRulesViolation": - throw await de_TLDRulesViolationRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1EnableDomainTransferLockCommand */ @@ -1227,7 +857,7 @@ export const de_EnableDomainTransferLockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableDomainTransferLockCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1239,44 +869,6 @@ export const de_EnableDomainTransferLockCommand = async ( return response; }; -/** - * deserializeAws_json1_1EnableDomainTransferLockCommandError - */ -const de_EnableDomainTransferLockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.route53domains#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "TLDRulesViolation": - case "com.amazonaws.route53domains#TLDRulesViolation": - throw await de_TLDRulesViolationRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetContactReachabilityStatusCommand */ @@ -1285,7 +877,7 @@ export const de_GetContactReachabilityStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetContactReachabilityStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1297,38 +889,6 @@ export const de_GetContactReachabilityStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetContactReachabilityStatusCommandError - */ -const de_GetContactReachabilityStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetDomainDetailCommand */ @@ -1337,7 +897,7 @@ export const de_GetDomainDetailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDomainDetailCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1349,35 +909,6 @@ export const de_GetDomainDetailCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetDomainDetailCommandError - */ -const de_GetDomainDetailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetDomainSuggestionsCommand */ @@ -1386,7 +917,7 @@ export const de_GetDomainSuggestionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDomainSuggestionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1398,35 +929,6 @@ export const de_GetDomainSuggestionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetDomainSuggestionsCommandError - */ -const de_GetDomainSuggestionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetOperationDetailCommand */ @@ -1435,7 +937,7 @@ export const de_GetOperationDetailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetOperationDetailCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1447,32 +949,6 @@ export const de_GetOperationDetailCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetOperationDetailCommandError - */ -const de_GetOperationDetailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListDomainsCommand */ @@ -1481,7 +957,7 @@ export const de_ListDomainsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListDomainsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1494,91 +970,19 @@ export const de_ListDomainsCommand = async ( }; /** - * deserializeAws_json1_1ListDomainsCommandError - */ -const de_ListDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListOperationsCommand - */ -export const de_ListOperationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListOperationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListOperationsResponse(data, context); - const response: ListOperationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListOperationsCommandError - */ -const de_ListOperationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListPricesCommand + * deserializeAws_json1_1ListOperationsCommand */ -export const de_ListPricesCommand = async ( +export const de_ListOperationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListPricesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListPricesResponse(data, context); - const response: ListPricesCommandOutput = { + contents = de_ListOperationsResponse(data, context); + const response: ListOperationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1586,32 +990,23 @@ export const de_ListPricesCommand = async ( }; /** - * deserializeAws_json1_1ListPricesCommandError + * deserializeAws_json1_1ListPricesCommand */ -const de_ListPricesCommandError = async ( +export const de_ListPricesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListPricesResponse(data, context); + const response: ListPricesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1622,7 +1017,7 @@ export const de_ListTagsForDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1634,38 +1029,6 @@ export const de_ListTagsForDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForDomainCommandError - */ -const de_ListTagsForDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PushDomainCommand */ @@ -1674,7 +1037,7 @@ export const de_PushDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PushDomainCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PushDomainCommandOutput = { @@ -1683,38 +1046,6 @@ export const de_PushDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_1PushDomainCommandError - */ -const de_PushDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RegisterDomainCommand */ @@ -1723,7 +1054,7 @@ export const de_RegisterDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1735,47 +1066,6 @@ export const de_RegisterDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_1RegisterDomainCommandError - */ -const de_RegisterDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DomainLimitExceeded": - case "com.amazonaws.route53domains#DomainLimitExceeded": - throw await de_DomainLimitExceededRes(parsedOutput, context); - case "DuplicateRequest": - case "com.amazonaws.route53domains#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "TLDRulesViolation": - case "com.amazonaws.route53domains#TLDRulesViolation": - throw await de_TLDRulesViolationRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RejectDomainTransferFromAnotherAwsAccountCommand */ @@ -1784,7 +1074,7 @@ export const de_RejectDomainTransferFromAnotherAwsAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RejectDomainTransferFromAnotherAwsAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1796,38 +1086,6 @@ export const de_RejectDomainTransferFromAnotherAwsAccountCommand = async ( return response; }; -/** - * deserializeAws_json1_1RejectDomainTransferFromAnotherAwsAccountCommandError - */ -const de_RejectDomainTransferFromAnotherAwsAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RenewDomainCommand */ @@ -1836,7 +1094,7 @@ export const de_RenewDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RenewDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1848,44 +1106,6 @@ export const de_RenewDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_1RenewDomainCommandError - */ -const de_RenewDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.route53domains#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "TLDRulesViolation": - case "com.amazonaws.route53domains#TLDRulesViolation": - throw await de_TLDRulesViolationRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ResendContactReachabilityEmailCommand */ @@ -1894,7 +1114,7 @@ export const de_ResendContactReachabilityEmailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResendContactReachabilityEmailCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1906,38 +1126,6 @@ export const de_ResendContactReachabilityEmailCommand = async ( return response; }; -/** - * deserializeAws_json1_1ResendContactReachabilityEmailCommandError - */ -const de_ResendContactReachabilityEmailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ResendOperationAuthorizationCommand */ @@ -1946,39 +1134,13 @@ export const de_ResendOperationAuthorizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResendOperationAuthorizationCommandError(output, context); - } - await collectBody(output.body, context); - const response: ResendOperationAuthorizationCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1ResendOperationAuthorizationCommandError - */ -const de_ResendOperationAuthorizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: ResendOperationAuthorizationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** @@ -1989,7 +1151,7 @@ export const de_RetrieveDomainAuthCodeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RetrieveDomainAuthCodeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2001,35 +1163,6 @@ export const de_RetrieveDomainAuthCodeCommand = async ( return response; }; -/** - * deserializeAws_json1_1RetrieveDomainAuthCodeCommandError - */ -const de_RetrieveDomainAuthCodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TransferDomainCommand */ @@ -2038,7 +1171,7 @@ export const de_TransferDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TransferDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2050,47 +1183,6 @@ export const de_TransferDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_1TransferDomainCommandError - */ -const de_TransferDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DomainLimitExceeded": - case "com.amazonaws.route53domains#DomainLimitExceeded": - throw await de_DomainLimitExceededRes(parsedOutput, context); - case "DuplicateRequest": - case "com.amazonaws.route53domains#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "TLDRulesViolation": - case "com.amazonaws.route53domains#TLDRulesViolation": - throw await de_TLDRulesViolationRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TransferDomainToAnotherAwsAccountCommand */ @@ -2099,7 +1191,7 @@ export const de_TransferDomainToAnotherAwsAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TransferDomainToAnotherAwsAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2111,41 +1203,6 @@ export const de_TransferDomainToAnotherAwsAccountCommand = async ( return response; }; -/** - * deserializeAws_json1_1TransferDomainToAnotherAwsAccountCommandError - */ -const de_TransferDomainToAnotherAwsAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.route53domains#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDomainContactCommand */ @@ -2154,7 +1211,7 @@ export const de_UpdateDomainContactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDomainContactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2166,44 +1223,6 @@ export const de_UpdateDomainContactCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDomainContactCommandError - */ -const de_UpdateDomainContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.route53domains#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "TLDRulesViolation": - case "com.amazonaws.route53domains#TLDRulesViolation": - throw await de_TLDRulesViolationRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDomainContactPrivacyCommand */ @@ -2212,7 +1231,7 @@ export const de_UpdateDomainContactPrivacyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDomainContactPrivacyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2224,44 +1243,6 @@ export const de_UpdateDomainContactPrivacyCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDomainContactPrivacyCommandError - */ -const de_UpdateDomainContactPrivacyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.route53domains#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "TLDRulesViolation": - case "com.amazonaws.route53domains#TLDRulesViolation": - throw await de_TLDRulesViolationRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDomainNameserversCommand */ @@ -2270,7 +1251,7 @@ export const de_UpdateDomainNameserversCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDomainNameserversCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2282,44 +1263,6 @@ export const de_UpdateDomainNameserversCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDomainNameserversCommandError - */ -const de_UpdateDomainNameserversCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.route53domains#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "TLDRulesViolation": - case "com.amazonaws.route53domains#TLDRulesViolation": - throw await de_TLDRulesViolationRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateTagsForDomainCommand */ @@ -2328,7 +1271,7 @@ export const de_UpdateTagsForDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTagsForDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2340,38 +1283,6 @@ export const de_UpdateTagsForDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateTagsForDomainCommandError - */ -const de_UpdateTagsForDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53domains#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationLimitExceeded": - case "com.amazonaws.route53domains#OperationLimitExceeded": - throw await de_OperationLimitExceededRes(parsedOutput, context); - case "UnsupportedTLD": - case "com.amazonaws.route53domains#UnsupportedTLD": - throw await de_UnsupportedTLDRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ViewBillingCommand */ @@ -2380,7 +1291,7 @@ export const de_ViewBillingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ViewBillingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2393,28 +1304,43 @@ export const de_ViewBillingCommand = async ( }; /** - * deserializeAws_json1_1ViewBillingCommandError + * deserialize_Aws_json1_1CommandError */ -const de_ViewBillingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "DomainLimitExceeded": + case "com.amazonaws.route53domains#DomainLimitExceeded": + throw await de_DomainLimitExceededRes(parsedOutput, context); case "InvalidInput": case "com.amazonaws.route53domains#InvalidInput": throw await de_InvalidInputRes(parsedOutput, context); + case "OperationLimitExceeded": + case "com.amazonaws.route53domains#OperationLimitExceeded": + throw await de_OperationLimitExceededRes(parsedOutput, context); + case "UnsupportedTLD": + case "com.amazonaws.route53domains#UnsupportedTLD": + throw await de_UnsupportedTLDRes(parsedOutput, context); + case "DnssecLimitExceeded": + case "com.amazonaws.route53domains#DnssecLimitExceeded": + throw await de_DnssecLimitExceededRes(parsedOutput, context); + case "DuplicateRequest": + case "com.amazonaws.route53domains#DuplicateRequest": + throw await de_DuplicateRequestRes(parsedOutput, context); + case "TLDRulesViolation": + case "com.amazonaws.route53domains#TLDRulesViolation": + throw await de_TLDRulesViolationRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-route-53/src/protocols/Aws_restXml.ts b/clients/client-route-53/src/protocols/Aws_restXml.ts index c76fefa5da72..cc3777967345 100644 --- a/clients/client-route-53/src/protocols/Aws_restXml.ts +++ b/clients/client-route-53/src/protocols/Aws_restXml.ts @@ -1866,7 +1866,7 @@ export const de_ActivateKeySigningKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ActivateKeySigningKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1878,47 +1878,6 @@ export const de_ActivateKeySigningKeyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlActivateKeySigningKeyCommandError - */ -const de_ActivateKeySigningKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidKMSArn": - case "com.amazonaws.route53#InvalidKMSArn": - throw await de_InvalidKMSArnRes(parsedOutput, context); - case "InvalidKeySigningKeyStatus": - case "com.amazonaws.route53#InvalidKeySigningKeyStatus": - throw await de_InvalidKeySigningKeyStatusRes(parsedOutput, context); - case "InvalidSigningStatus": - case "com.amazonaws.route53#InvalidSigningStatus": - throw await de_InvalidSigningStatusRes(parsedOutput, context); - case "NoSuchKeySigningKey": - case "com.amazonaws.route53#NoSuchKeySigningKey": - throw await de_NoSuchKeySigningKeyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlAssociateVPCWithHostedZoneCommand */ @@ -1927,7 +1886,7 @@ export const de_AssociateVPCWithHostedZoneCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateVPCWithHostedZoneCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1939,53 +1898,6 @@ export const de_AssociateVPCWithHostedZoneCommand = async ( return contents; }; -/** - * deserializeAws_restXmlAssociateVPCWithHostedZoneCommandError - */ -const de_AssociateVPCWithHostedZoneCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingDomainExists": - case "com.amazonaws.route53#ConflictingDomainExists": - throw await de_ConflictingDomainExistsRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidVPCId": - case "com.amazonaws.route53#InvalidVPCId": - throw await de_InvalidVPCIdRes(parsedOutput, context); - case "LimitsExceeded": - case "com.amazonaws.route53#LimitsExceeded": - throw await de_LimitsExceededRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - case "NotAuthorizedException": - case "com.amazonaws.route53#NotAuthorizedException": - throw await de_NotAuthorizedExceptionRes(parsedOutput, context); - case "PriorRequestNotComplete": - case "com.amazonaws.route53#PriorRequestNotComplete": - throw await de_PriorRequestNotCompleteRes(parsedOutput, context); - case "PublicZoneVPCAssociation": - case "com.amazonaws.route53#PublicZoneVPCAssociation": - throw await de_PublicZoneVPCAssociationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlChangeCidrCollectionCommand */ @@ -1994,7 +1906,7 @@ export const de_ChangeCidrCollectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ChangeCidrCollectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2006,47 +1918,6 @@ export const de_ChangeCidrCollectionCommand = async ( return contents; }; -/** - * deserializeAws_restXmlChangeCidrCollectionCommandError - */ -const de_ChangeCidrCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CidrBlockInUseException": - case "com.amazonaws.route53#CidrBlockInUseException": - throw await de_CidrBlockInUseExceptionRes(parsedOutput, context); - case "CidrCollectionVersionMismatchException": - case "com.amazonaws.route53#CidrCollectionVersionMismatchException": - throw await de_CidrCollectionVersionMismatchExceptionRes(parsedOutput, context); - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "LimitsExceeded": - case "com.amazonaws.route53#LimitsExceeded": - throw await de_LimitsExceededRes(parsedOutput, context); - case "NoSuchCidrCollectionException": - case "com.amazonaws.route53#NoSuchCidrCollectionException": - throw await de_NoSuchCidrCollectionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlChangeResourceRecordSetsCommand */ @@ -2055,7 +1926,7 @@ export const de_ChangeResourceRecordSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ChangeResourceRecordSetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2067,44 +1938,6 @@ export const de_ChangeResourceRecordSetsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlChangeResourceRecordSetsCommandError - */ -const de_ChangeResourceRecordSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidChangeBatch": - case "com.amazonaws.route53#InvalidChangeBatch": - throw await de_InvalidChangeBatchRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHealthCheck": - case "com.amazonaws.route53#NoSuchHealthCheck": - throw await de_NoSuchHealthCheckRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - case "PriorRequestNotComplete": - case "com.amazonaws.route53#PriorRequestNotComplete": - throw await de_PriorRequestNotCompleteRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlChangeTagsForResourceCommand */ @@ -2113,7 +1946,7 @@ export const de_ChangeTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ChangeTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2122,44 +1955,6 @@ export const de_ChangeTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restXmlChangeTagsForResourceCommandError - */ -const de_ChangeTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHealthCheck": - case "com.amazonaws.route53#NoSuchHealthCheck": - throw await de_NoSuchHealthCheckRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - case "PriorRequestNotComplete": - case "com.amazonaws.route53#PriorRequestNotComplete": - throw await de_PriorRequestNotCompleteRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlCreateCidrCollectionCommand */ @@ -2168,7 +1963,7 @@ export const de_CreateCidrCollectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateCidrCollectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2182,621 +1977,396 @@ export const de_CreateCidrCollectionCommand = async ( }; /** - * deserializeAws_restXmlCreateCidrCollectionCommandError + * deserializeAws_restXmlCreateHealthCheckCommand */ -const de_CreateCidrCollectionCommandError = async ( +export const de_CreateHealthCheckCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CidrCollectionAlreadyExistsException": - case "com.amazonaws.route53#CidrCollectionAlreadyExistsException": - throw await de_CidrCollectionAlreadyExistsExceptionRes(parsedOutput, context); - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "LimitsExceeded": - case "com.amazonaws.route53#LimitsExceeded": - throw await de_LimitsExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_L]: [, output.headers[_l]], + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_HC] != null) { + contents[_HC] = de_HealthCheck(data[_HC], context); } + return contents; }; /** - * deserializeAws_restXmlCreateHealthCheckCommand + * deserializeAws_restXmlCreateHostedZoneCommand */ -export const de_CreateHealthCheckCommand = async ( +export const de_CreateHostedZoneCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateHealthCheckCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), [_L]: [, output.headers[_l]], }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_HC] != null) { - contents[_HC] = de_HealthCheck(data[_HC], context); + if (data[_CI] != null) { + contents[_CI] = de_ChangeInfo(data[_CI], context); + } + if (data[_DS] != null) { + contents[_DS] = de_DelegationSet(data[_DS], context); + } + if (data[_HZ] != null) { + contents[_HZ] = de_HostedZone(data[_HZ], context); + } + if (data[_VPC] != null) { + contents[_VPC] = de_VPC(data[_VPC], context); } return contents; }; /** - * deserializeAws_restXmlCreateHealthCheckCommandError + * deserializeAws_restXmlCreateKeySigningKeyCommand */ -const de_CreateHealthCheckCommandError = async ( +export const de_CreateKeySigningKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "HealthCheckAlreadyExists": - case "com.amazonaws.route53#HealthCheckAlreadyExists": - throw await de_HealthCheckAlreadyExistsRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "TooManyHealthChecks": - case "com.amazonaws.route53#TooManyHealthChecks": - throw await de_TooManyHealthChecksRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_L]: [, output.headers[_l]], + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_CI] != null) { + contents[_CI] = de_ChangeInfo(data[_CI], context); } + if (data[_KSK] != null) { + contents[_KSK] = de_KeySigningKey(data[_KSK], context); + } + return contents; }; /** - * deserializeAws_restXmlCreateHostedZoneCommand + * deserializeAws_restXmlCreateQueryLoggingConfigCommand */ -export const de_CreateHostedZoneCommand = async ( +export const de_CreateQueryLoggingConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateHostedZoneCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), [_L]: [, output.headers[_l]], }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_CI] != null) { - contents[_CI] = de_ChangeInfo(data[_CI], context); - } - if (data[_DS] != null) { - contents[_DS] = de_DelegationSet(data[_DS], context); - } - if (data[_HZ] != null) { - contents[_HZ] = de_HostedZone(data[_HZ], context); - } - if (data[_VPC] != null) { - contents[_VPC] = de_VPC(data[_VPC], context); + if (data[_QLC] != null) { + contents[_QLC] = de_QueryLoggingConfig(data[_QLC], context); } return contents; }; /** - * deserializeAws_restXmlCreateHostedZoneCommandError + * deserializeAws_restXmlCreateReusableDelegationSetCommand */ -const de_CreateHostedZoneCommandError = async ( +export const de_CreateReusableDelegationSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingDomainExists": - case "com.amazonaws.route53#ConflictingDomainExists": - throw await de_ConflictingDomainExistsRes(parsedOutput, context); - case "DelegationSetNotAvailable": - case "com.amazonaws.route53#DelegationSetNotAvailable": - throw await de_DelegationSetNotAvailableRes(parsedOutput, context); - case "DelegationSetNotReusable": - case "com.amazonaws.route53#DelegationSetNotReusable": - throw await de_DelegationSetNotReusableRes(parsedOutput, context); - case "HostedZoneAlreadyExists": - case "com.amazonaws.route53#HostedZoneAlreadyExists": - throw await de_HostedZoneAlreadyExistsRes(parsedOutput, context); - case "InvalidDomainName": - case "com.amazonaws.route53#InvalidDomainName": - throw await de_InvalidDomainNameRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidVPCId": - case "com.amazonaws.route53#InvalidVPCId": - throw await de_InvalidVPCIdRes(parsedOutput, context); - case "NoSuchDelegationSet": - case "com.amazonaws.route53#NoSuchDelegationSet": - throw await de_NoSuchDelegationSetRes(parsedOutput, context); - case "TooManyHostedZones": - case "com.amazonaws.route53#TooManyHostedZones": - throw await de_TooManyHostedZonesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_L]: [, output.headers[_l]], + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_DS] != null) { + contents[_DS] = de_DelegationSet(data[_DS], context); } + return contents; }; /** - * deserializeAws_restXmlCreateKeySigningKeyCommand + * deserializeAws_restXmlCreateTrafficPolicyCommand */ -export const de_CreateKeySigningKeyCommand = async ( +export const de_CreateTrafficPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateKeySigningKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), [_L]: [, output.headers[_l]], }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_CI] != null) { - contents[_CI] = de_ChangeInfo(data[_CI], context); - } - if (data[_KSK] != null) { - contents[_KSK] = de_KeySigningKey(data[_KSK], context); + if (data[_TP] != null) { + contents[_TP] = de_TrafficPolicy(data[_TP], context); } return contents; }; /** - * deserializeAws_restXmlCreateKeySigningKeyCommandError + * deserializeAws_restXmlCreateTrafficPolicyInstanceCommand */ -const de_CreateKeySigningKeyCommandError = async ( +export const de_CreateTrafficPolicyInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.route53#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidKMSArn": - case "com.amazonaws.route53#InvalidKMSArn": - throw await de_InvalidKMSArnRes(parsedOutput, context); - case "InvalidKeySigningKeyName": - case "com.amazonaws.route53#InvalidKeySigningKeyName": - throw await de_InvalidKeySigningKeyNameRes(parsedOutput, context); - case "InvalidKeySigningKeyStatus": - case "com.amazonaws.route53#InvalidKeySigningKeyStatus": - throw await de_InvalidKeySigningKeyStatusRes(parsedOutput, context); - case "InvalidSigningStatus": - case "com.amazonaws.route53#InvalidSigningStatus": - throw await de_InvalidSigningStatusRes(parsedOutput, context); - case "KeySigningKeyAlreadyExists": - case "com.amazonaws.route53#KeySigningKeyAlreadyExists": - throw await de_KeySigningKeyAlreadyExistsRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - case "TooManyKeySigningKeys": - case "com.amazonaws.route53#TooManyKeySigningKeys": - throw await de_TooManyKeySigningKeysRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + [_L]: [, output.headers[_l]], + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_TPIr] != null) { + contents[_TPIr] = de_TrafficPolicyInstance(data[_TPIr], context); } + return contents; }; /** - * deserializeAws_restXmlCreateQueryLoggingConfigCommand + * deserializeAws_restXmlCreateTrafficPolicyVersionCommand */ -export const de_CreateQueryLoggingConfigCommand = async ( +export const de_CreateTrafficPolicyVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateQueryLoggingConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), [_L]: [, output.headers[_l]], }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_QLC] != null) { - contents[_QLC] = de_QueryLoggingConfig(data[_QLC], context); + if (data[_TP] != null) { + contents[_TP] = de_TrafficPolicy(data[_TP], context); } return contents; }; /** - * deserializeAws_restXmlCreateQueryLoggingConfigCommandError + * deserializeAws_restXmlCreateVPCAssociationAuthorizationCommand */ -const de_CreateQueryLoggingConfigCommandError = async ( +export const de_CreateVPCAssociationAuthorizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "InsufficientCloudWatchLogsResourcePolicy": - case "com.amazonaws.route53#InsufficientCloudWatchLogsResourcePolicy": - throw await de_InsufficientCloudWatchLogsResourcePolicyRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchCloudWatchLogsLogGroup": - case "com.amazonaws.route53#NoSuchCloudWatchLogsLogGroup": - throw await de_NoSuchCloudWatchLogsLogGroupRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - case "QueryLoggingConfigAlreadyExists": - case "com.amazonaws.route53#QueryLoggingConfigAlreadyExists": - throw await de_QueryLoggingConfigAlreadyExistsRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_HZI] != null) { + contents[_HZI] = __expectString(data[_HZI]); } + if (data[_VPC] != null) { + contents[_VPC] = de_VPC(data[_VPC], context); + } + return contents; }; /** - * deserializeAws_restXmlCreateReusableDelegationSetCommand + * deserializeAws_restXmlDeactivateKeySigningKeyCommand */ -export const de_CreateReusableDelegationSetCommand = async ( +export const de_DeactivateKeySigningKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateReusableDelegationSetCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_L]: [, output.headers[_l]], }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_DS] != null) { - contents[_DS] = de_DelegationSet(data[_DS], context); + if (data[_CI] != null) { + contents[_CI] = de_ChangeInfo(data[_CI], context); } return contents; }; /** - * deserializeAws_restXmlCreateReusableDelegationSetCommandError + * deserializeAws_restXmlDeleteCidrCollectionCommand */ -const de_CreateReusableDelegationSetCommandError = async ( +export const de_DeleteCidrCollectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DelegationSetAlreadyCreated": - case "com.amazonaws.route53#DelegationSetAlreadyCreated": - throw await de_DelegationSetAlreadyCreatedRes(parsedOutput, context); - case "DelegationSetAlreadyReusable": - case "com.amazonaws.route53#DelegationSetAlreadyReusable": - throw await de_DelegationSetAlreadyReusableRes(parsedOutput, context); - case "DelegationSetNotAvailable": - case "com.amazonaws.route53#DelegationSetNotAvailable": - throw await de_DelegationSetNotAvailableRes(parsedOutput, context); - case "HostedZoneNotFound": - case "com.amazonaws.route53#HostedZoneNotFound": - throw await de_HostedZoneNotFoundRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.route53#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "LimitsExceeded": - case "com.amazonaws.route53#LimitsExceeded": - throw await de_LimitsExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restXmlCreateTrafficPolicyCommand + * deserializeAws_restXmlDeleteHealthCheckCommand */ -export const de_CreateTrafficPolicyCommand = async ( +export const de_DeleteHealthCheckCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateTrafficPolicyCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_L]: [, output.headers[_l]], }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_TP] != null) { - contents[_TP] = de_TrafficPolicy(data[_TP], context); - } + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restXmlCreateTrafficPolicyCommandError + * deserializeAws_restXmlDeleteHostedZoneCommand */ -const de_CreateTrafficPolicyCommandError = async ( +export const de_DeleteHostedZoneCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidTrafficPolicyDocument": - case "com.amazonaws.route53#InvalidTrafficPolicyDocument": - throw await de_InvalidTrafficPolicyDocumentRes(parsedOutput, context); - case "TooManyTrafficPolicies": - case "com.amazonaws.route53#TooManyTrafficPolicies": - throw await de_TooManyTrafficPoliciesRes(parsedOutput, context); - case "TrafficPolicyAlreadyExists": - case "com.amazonaws.route53#TrafficPolicyAlreadyExists": - throw await de_TrafficPolicyAlreadyExistsRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_CI] != null) { + contents[_CI] = de_ChangeInfo(data[_CI], context); } + return contents; }; /** - * deserializeAws_restXmlCreateTrafficPolicyInstanceCommand + * deserializeAws_restXmlDeleteKeySigningKeyCommand */ -export const de_CreateTrafficPolicyInstanceCommand = async ( +export const de_DeleteKeySigningKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateTrafficPolicyInstanceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_L]: [, output.headers[_l]], }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_TPIr] != null) { - contents[_TPIr] = de_TrafficPolicyInstance(data[_TPIr], context); + if (data[_CI] != null) { + contents[_CI] = de_ChangeInfo(data[_CI], context); } return contents; }; /** - * deserializeAws_restXmlCreateTrafficPolicyInstanceCommandError + * deserializeAws_restXmlDeleteQueryLoggingConfigCommand */ -const de_CreateTrafficPolicyInstanceCommandError = async ( +export const de_DeleteQueryLoggingConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - case "NoSuchTrafficPolicy": - case "com.amazonaws.route53#NoSuchTrafficPolicy": - throw await de_NoSuchTrafficPolicyRes(parsedOutput, context); - case "TooManyTrafficPolicyInstances": - case "com.amazonaws.route53#TooManyTrafficPolicyInstances": - throw await de_TooManyTrafficPolicyInstancesRes(parsedOutput, context); - case "TrafficPolicyInstanceAlreadyExists": - case "com.amazonaws.route53#TrafficPolicyInstanceAlreadyExists": - throw await de_TrafficPolicyInstanceAlreadyExistsRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restXmlCreateTrafficPolicyVersionCommand + * deserializeAws_restXmlDeleteReusableDelegationSetCommand */ -export const de_CreateTrafficPolicyVersionCommand = async ( +export const de_DeleteReusableDelegationSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateTrafficPolicyVersionCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - [_L]: [, output.headers[_l]], }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_TP] != null) { - contents[_TP] = de_TrafficPolicy(data[_TP], context); - } + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restXmlCreateTrafficPolicyVersionCommandError + * deserializeAws_restXmlDeleteTrafficPolicyCommand */ -const de_CreateTrafficPolicyVersionCommandError = async ( +export const de_DeleteTrafficPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidTrafficPolicyDocument": - case "com.amazonaws.route53#InvalidTrafficPolicyDocument": - throw await de_InvalidTrafficPolicyDocumentRes(parsedOutput, context); - case "NoSuchTrafficPolicy": - case "com.amazonaws.route53#NoSuchTrafficPolicy": - throw await de_NoSuchTrafficPolicyRes(parsedOutput, context); - case "TooManyTrafficPolicyVersionsForCurrentPolicy": - case "com.amazonaws.route53#TooManyTrafficPolicyVersionsForCurrentPolicy": - throw await de_TooManyTrafficPolicyVersionsForCurrentPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restXmlCreateVPCAssociationAuthorizationCommand + * deserializeAws_restXmlDeleteTrafficPolicyInstanceCommand */ -export const de_CreateVPCAssociationAuthorizationCommand = async ( +export const de_DeleteTrafficPolicyInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateVPCAssociationAuthorizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_HZI] != null) { - contents[_HZI] = __expectString(data[_HZI]); - } - if (data[_VPC] != null) { - contents[_VPC] = de_VPC(data[_VPC], context); - } + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restXmlCreateVPCAssociationAuthorizationCommandError + * deserializeAws_restXmlDeleteVPCAssociationAuthorizationCommand */ -const de_CreateVPCAssociationAuthorizationCommandError = async ( +export const de_DeleteVPCAssociationAuthorizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidVPCId": - case "com.amazonaws.route53#InvalidVPCId": - throw await de_InvalidVPCIdRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - case "TooManyVPCAssociationAuthorizations": - case "com.amazonaws.route53#TooManyVPCAssociationAuthorizations": - throw await de_TooManyVPCAssociationAuthorizationsRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restXmlDeactivateKeySigningKeyCommand + * deserializeAws_restXmlDisableHostedZoneDNSSECCommand */ -export const de_DeactivateKeySigningKeyCommand = async ( +export const de_DisableHostedZoneDNSSECCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeactivateKeySigningKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2809,159 +2379,77 @@ export const de_DeactivateKeySigningKeyCommand = async ( }; /** - * deserializeAws_restXmlDeactivateKeySigningKeyCommandError + * deserializeAws_restXmlDisassociateVPCFromHostedZoneCommand */ -const de_DeactivateKeySigningKeyCommandError = async ( +export const de_DisassociateVPCFromHostedZoneCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidKeySigningKeyStatus": - case "com.amazonaws.route53#InvalidKeySigningKeyStatus": - throw await de_InvalidKeySigningKeyStatusRes(parsedOutput, context); - case "InvalidSigningStatus": - case "com.amazonaws.route53#InvalidSigningStatus": - throw await de_InvalidSigningStatusRes(parsedOutput, context); - case "KeySigningKeyInParentDSRecord": - case "com.amazonaws.route53#KeySigningKeyInParentDSRecord": - throw await de_KeySigningKeyInParentDSRecordRes(parsedOutput, context); - case "KeySigningKeyInUse": - case "com.amazonaws.route53#KeySigningKeyInUse": - throw await de_KeySigningKeyInUseRes(parsedOutput, context); - case "NoSuchKeySigningKey": - case "com.amazonaws.route53#NoSuchKeySigningKey": - throw await de_NoSuchKeySigningKeyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlDeleteCidrCollectionCommand - */ -export const de_DeleteCidrCollectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCidrCollectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restXmlDeleteCidrCollectionCommandError - */ -const de_DeleteCidrCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CidrCollectionInUseException": - case "com.amazonaws.route53#CidrCollectionInUseException": - throw await de_CidrCollectionInUseExceptionRes(parsedOutput, context); - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchCidrCollectionException": - case "com.amazonaws.route53#NoSuchCidrCollectionException": - throw await de_NoSuchCidrCollectionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_CI] != null) { + contents[_CI] = de_ChangeInfo(data[_CI], context); } + return contents; }; /** - * deserializeAws_restXmlDeleteHealthCheckCommand + * deserializeAws_restXmlEnableHostedZoneDNSSECCommand */ -export const de_DeleteHealthCheckCommand = async ( +export const de_EnableHostedZoneDNSSECCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteHealthCheckCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_CI] != null) { + contents[_CI] = de_ChangeInfo(data[_CI], context); + } return contents; }; /** - * deserializeAws_restXmlDeleteHealthCheckCommandError + * deserializeAws_restXmlGetAccountLimitCommand */ -const de_DeleteHealthCheckCommandError = async ( +export const de_GetAccountLimitCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "HealthCheckInUse": - case "com.amazonaws.route53#HealthCheckInUse": - throw await de_HealthCheckInUseRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHealthCheck": - case "com.amazonaws.route53#NoSuchHealthCheck": - throw await de_NoSuchHealthCheckRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_Cou] != null) { + contents[_Cou] = __strictParseLong(data[_Cou]) as number; + } + if (data[_Li] != null) { + contents[_Li] = de_AccountLimit(data[_Li], context); } + return contents; }; /** - * deserializeAws_restXmlDeleteHostedZoneCommand + * deserializeAws_restXmlGetChangeCommand */ -export const de_DeleteHostedZoneCommand = async ( +export const de_GetChangeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteHostedZoneCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2974,2772 +2462,1009 @@ export const de_DeleteHostedZoneCommand = async ( }; /** - * deserializeAws_restXmlDeleteHostedZoneCommandError + * deserializeAws_restXmlGetCheckerIpRangesCommand */ -const de_DeleteHostedZoneCommandError = async ( +export const de_GetCheckerIpRangesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "HostedZoneNotEmpty": - case "com.amazonaws.route53#HostedZoneNotEmpty": - throw await de_HostedZoneNotEmptyRes(parsedOutput, context); - case "InvalidDomainName": - case "com.amazonaws.route53#InvalidDomainName": - throw await de_InvalidDomainNameRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - case "PriorRequestNotComplete": - case "com.amazonaws.route53#PriorRequestNotComplete": - throw await de_PriorRequestNotCompleteRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.CheckerIpRanges === "") { + contents[_CIR] = []; + } else if (data[_CIR] != null && data[_CIR][_me] != null) { + contents[_CIR] = de_CheckerIpRanges(__getArrayIfSingleItem(data[_CIR][_me]), context); } + return contents; }; /** - * deserializeAws_restXmlDeleteKeySigningKeyCommand + * deserializeAws_restXmlGetDNSSECCommand */ -export const de_DeleteKeySigningKeyCommand = async ( +export const de_GetDNSSECCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteKeySigningKeyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_CI] != null) { - contents[_CI] = de_ChangeInfo(data[_CI], context); + if (data.KeySigningKeys === "") { + contents[_KSKe] = []; + } else if (data[_KSKe] != null && data[_KSKe][_me] != null) { + contents[_KSKe] = de_KeySigningKeys(__getArrayIfSingleItem(data[_KSKe][_me]), context); + } + if (data[_S] != null) { + contents[_S] = de_DNSSECStatus(data[_S], context); } return contents; }; /** - * deserializeAws_restXmlDeleteKeySigningKeyCommandError + * deserializeAws_restXmlGetGeoLocationCommand */ -const de_DeleteKeySigningKeyCommandError = async ( +export const de_GetGeoLocationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidKMSArn": - case "com.amazonaws.route53#InvalidKMSArn": - throw await de_InvalidKMSArnRes(parsedOutput, context); - case "InvalidKeySigningKeyStatus": - case "com.amazonaws.route53#InvalidKeySigningKeyStatus": - throw await de_InvalidKeySigningKeyStatusRes(parsedOutput, context); - case "InvalidSigningStatus": - case "com.amazonaws.route53#InvalidSigningStatus": - throw await de_InvalidSigningStatusRes(parsedOutput, context); - case "NoSuchKeySigningKey": - case "com.amazonaws.route53#NoSuchKeySigningKey": - throw await de_NoSuchKeySigningKeyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_GLD] != null) { + contents[_GLD] = de_GeoLocationDetails(data[_GLD], context); } + return contents; }; /** - * deserializeAws_restXmlDeleteQueryLoggingConfigCommand + * deserializeAws_restXmlGetHealthCheckCommand */ -export const de_DeleteQueryLoggingConfigCommand = async ( +export const de_GetHealthCheckCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteQueryLoggingConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_HC] != null) { + contents[_HC] = de_HealthCheck(data[_HC], context); + } return contents; }; /** - * deserializeAws_restXmlDeleteQueryLoggingConfigCommandError + * deserializeAws_restXmlGetHealthCheckCountCommand */ -const de_DeleteQueryLoggingConfigCommandError = async ( +export const de_GetHealthCheckCountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchQueryLoggingConfig": - case "com.amazonaws.route53#NoSuchQueryLoggingConfig": - throw await de_NoSuchQueryLoggingConfigRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_HCCe] != null) { + contents[_HCCe] = __strictParseLong(data[_HCCe]) as number; } + return contents; }; /** - * deserializeAws_restXmlDeleteReusableDelegationSetCommand + * deserializeAws_restXmlGetHealthCheckLastFailureReasonCommand */ -export const de_DeleteReusableDelegationSetCommand = async ( +export const de_GetHealthCheckLastFailureReasonCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteReusableDelegationSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.HealthCheckObservations === "") { + contents[_HCO] = []; + } else if (data[_HCO] != null && data[_HCO][_HCOe] != null) { + contents[_HCO] = de_HealthCheckObservations(__getArrayIfSingleItem(data[_HCO][_HCOe]), context); + } return contents; }; /** - * deserializeAws_restXmlDeleteReusableDelegationSetCommandError + * deserializeAws_restXmlGetHealthCheckStatusCommand */ -const de_DeleteReusableDelegationSetCommandError = async ( +export const de_GetHealthCheckStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DelegationSetInUse": - case "com.amazonaws.route53#DelegationSetInUse": - throw await de_DelegationSetInUseRes(parsedOutput, context); - case "DelegationSetNotReusable": - case "com.amazonaws.route53#DelegationSetNotReusable": - throw await de_DelegationSetNotReusableRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchDelegationSet": - case "com.amazonaws.route53#NoSuchDelegationSet": - throw await de_NoSuchDelegationSetRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.HealthCheckObservations === "") { + contents[_HCO] = []; + } else if (data[_HCO] != null && data[_HCO][_HCOe] != null) { + contents[_HCO] = de_HealthCheckObservations(__getArrayIfSingleItem(data[_HCO][_HCOe]), context); } + return contents; }; /** - * deserializeAws_restXmlDeleteTrafficPolicyCommand + * deserializeAws_restXmlGetHostedZoneCommand */ -export const de_DeleteTrafficPolicyCommand = async ( +export const de_GetHostedZoneCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTrafficPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_DS] != null) { + contents[_DS] = de_DelegationSet(data[_DS], context); + } + if (data[_HZ] != null) { + contents[_HZ] = de_HostedZone(data[_HZ], context); + } + if (data.VPCs === "") { + contents[_VPCs] = []; + } else if (data[_VPCs] != null && data[_VPCs][_VPC] != null) { + contents[_VPCs] = de_VPCs(__getArrayIfSingleItem(data[_VPCs][_VPC]), context); + } return contents; }; /** - * deserializeAws_restXmlDeleteTrafficPolicyCommandError + * deserializeAws_restXmlGetHostedZoneCountCommand */ -const de_DeleteTrafficPolicyCommandError = async ( +export const de_GetHostedZoneCountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchTrafficPolicy": - case "com.amazonaws.route53#NoSuchTrafficPolicy": - throw await de_NoSuchTrafficPolicyRes(parsedOutput, context); - case "TrafficPolicyInUse": - case "com.amazonaws.route53#TrafficPolicyInUse": - throw await de_TrafficPolicyInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_HZCo] != null) { + contents[_HZCo] = __strictParseLong(data[_HZCo]) as number; } + return contents; }; /** - * deserializeAws_restXmlDeleteTrafficPolicyInstanceCommand + * deserializeAws_restXmlGetHostedZoneLimitCommand */ -export const de_DeleteTrafficPolicyInstanceCommand = async ( +export const de_GetHostedZoneLimitCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTrafficPolicyInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_Cou] != null) { + contents[_Cou] = __strictParseLong(data[_Cou]) as number; + } + if (data[_Li] != null) { + contents[_Li] = de_HostedZoneLimit(data[_Li], context); + } return contents; }; /** - * deserializeAws_restXmlDeleteTrafficPolicyInstanceCommandError + * deserializeAws_restXmlGetQueryLoggingConfigCommand */ -const de_DeleteTrafficPolicyInstanceCommandError = async ( +export const de_GetQueryLoggingConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchTrafficPolicyInstance": - case "com.amazonaws.route53#NoSuchTrafficPolicyInstance": - throw await de_NoSuchTrafficPolicyInstanceRes(parsedOutput, context); - case "PriorRequestNotComplete": - case "com.amazonaws.route53#PriorRequestNotComplete": - throw await de_PriorRequestNotCompleteRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_QLC] != null) { + contents[_QLC] = de_QueryLoggingConfig(data[_QLC], context); } + return contents; }; /** - * deserializeAws_restXmlDeleteVPCAssociationAuthorizationCommand + * deserializeAws_restXmlGetReusableDelegationSetCommand */ -export const de_DeleteVPCAssociationAuthorizationCommand = async ( +export const de_GetReusableDelegationSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteVPCAssociationAuthorizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_DS] != null) { + contents[_DS] = de_DelegationSet(data[_DS], context); + } return contents; }; /** - * deserializeAws_restXmlDeleteVPCAssociationAuthorizationCommandError + * deserializeAws_restXmlGetReusableDelegationSetLimitCommand */ -const de_DeleteVPCAssociationAuthorizationCommandError = async ( +export const de_GetReusableDelegationSetLimitCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidVPCId": - case "com.amazonaws.route53#InvalidVPCId": - throw await de_InvalidVPCIdRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - case "VPCAssociationAuthorizationNotFound": - case "com.amazonaws.route53#VPCAssociationAuthorizationNotFound": - throw await de_VPCAssociationAuthorizationNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_Cou] != null) { + contents[_Cou] = __strictParseLong(data[_Cou]) as number; + } + if (data[_Li] != null) { + contents[_Li] = de_ReusableDelegationSetLimit(data[_Li], context); } + return contents; }; /** - * deserializeAws_restXmlDisableHostedZoneDNSSECCommand + * deserializeAws_restXmlGetTrafficPolicyCommand */ -export const de_DisableHostedZoneDNSSECCommand = async ( +export const de_GetTrafficPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableHostedZoneDNSSECCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_CI] != null) { - contents[_CI] = de_ChangeInfo(data[_CI], context); + if (data[_TP] != null) { + contents[_TP] = de_TrafficPolicy(data[_TP], context); } return contents; }; /** - * deserializeAws_restXmlDisableHostedZoneDNSSECCommandError + * deserializeAws_restXmlGetTrafficPolicyInstanceCommand */ -const de_DisableHostedZoneDNSSECCommandError = async ( +export const de_GetTrafficPolicyInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "DNSSECNotFound": - case "com.amazonaws.route53#DNSSECNotFound": - throw await de_DNSSECNotFoundRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.route53#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidKMSArn": - case "com.amazonaws.route53#InvalidKMSArn": - throw await de_InvalidKMSArnRes(parsedOutput, context); - case "InvalidKeySigningKeyStatus": - case "com.amazonaws.route53#InvalidKeySigningKeyStatus": - throw await de_InvalidKeySigningKeyStatusRes(parsedOutput, context); - case "KeySigningKeyInParentDSRecord": - case "com.amazonaws.route53#KeySigningKeyInParentDSRecord": - throw await de_KeySigningKeyInParentDSRecordRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlDisassociateVPCFromHostedZoneCommand - */ -export const de_DisassociateVPCFromHostedZoneCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateVPCFromHostedZoneCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_CI] != null) { - contents[_CI] = de_ChangeInfo(data[_CI], context); + if (data[_TPIr] != null) { + contents[_TPIr] = de_TrafficPolicyInstance(data[_TPIr], context); } return contents; }; /** - * deserializeAws_restXmlDisassociateVPCFromHostedZoneCommandError + * deserializeAws_restXmlGetTrafficPolicyInstanceCountCommand */ -const de_DisassociateVPCFromHostedZoneCommandError = async ( +export const de_GetTrafficPolicyInstanceCountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidVPCId": - case "com.amazonaws.route53#InvalidVPCId": - throw await de_InvalidVPCIdRes(parsedOutput, context); - case "LastVPCAssociation": - case "com.amazonaws.route53#LastVPCAssociation": - throw await de_LastVPCAssociationRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - case "VPCAssociationNotFound": - case "com.amazonaws.route53#VPCAssociationNotFound": - throw await de_VPCAssociationNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_TPIC] != null) { + contents[_TPIC] = __strictParseInt32(data[_TPIC]) as number; } + return contents; }; /** - * deserializeAws_restXmlEnableHostedZoneDNSSECCommand + * deserializeAws_restXmlListCidrBlocksCommand */ -export const de_EnableHostedZoneDNSSECCommand = async ( +export const de_ListCidrBlocksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableHostedZoneDNSSECCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_CI] != null) { - contents[_CI] = de_ChangeInfo(data[_CI], context); + if (data.CidrBlocks === "") { + contents[_CBi] = []; + } else if (data[_CBi] != null && data[_CBi][_me] != null) { + contents[_CBi] = de_CidrBlockSummaries(__getArrayIfSingleItem(data[_CBi][_me]), context); + } + if (data[_NT] != null) { + contents[_NT] = __expectString(data[_NT]); } return contents; }; /** - * deserializeAws_restXmlEnableHostedZoneDNSSECCommandError + * deserializeAws_restXmlListCidrCollectionsCommand */ -const de_EnableHostedZoneDNSSECCommandError = async ( +export const de_ListCidrCollectionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "DNSSECNotFound": - case "com.amazonaws.route53#DNSSECNotFound": - throw await de_DNSSECNotFoundRes(parsedOutput, context); - case "HostedZonePartiallyDelegated": - case "com.amazonaws.route53#HostedZonePartiallyDelegated": - throw await de_HostedZonePartiallyDelegatedRes(parsedOutput, context); - case "InvalidArgument": - case "com.amazonaws.route53#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidKMSArn": - case "com.amazonaws.route53#InvalidKMSArn": - throw await de_InvalidKMSArnRes(parsedOutput, context); - case "InvalidKeySigningKeyStatus": - case "com.amazonaws.route53#InvalidKeySigningKeyStatus": - throw await de_InvalidKeySigningKeyStatusRes(parsedOutput, context); - case "KeySigningKeyWithActiveStatusNotFound": - case "com.amazonaws.route53#KeySigningKeyWithActiveStatusNotFound": - throw await de_KeySigningKeyWithActiveStatusNotFoundRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.CidrCollections === "") { + contents[_CCi] = []; + } else if (data[_CCi] != null && data[_CCi][_me] != null) { + contents[_CCi] = de_CollectionSummaries(__getArrayIfSingleItem(data[_CCi][_me]), context); } + if (data[_NT] != null) { + contents[_NT] = __expectString(data[_NT]); + } + return contents; }; /** - * deserializeAws_restXmlGetAccountLimitCommand + * deserializeAws_restXmlListCidrLocationsCommand */ -export const de_GetAccountLimitCommand = async ( +export const de_ListCidrLocationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccountLimitCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_Cou] != null) { - contents[_Cou] = __strictParseLong(data[_Cou]) as number; + if (data.CidrLocations === "") { + contents[_CL] = []; + } else if (data[_CL] != null && data[_CL][_me] != null) { + contents[_CL] = de_LocationSummaries(__getArrayIfSingleItem(data[_CL][_me]), context); } - if (data[_Li] != null) { - contents[_Li] = de_AccountLimit(data[_Li], context); + if (data[_NT] != null) { + contents[_NT] = __expectString(data[_NT]); } return contents; }; /** - * deserializeAws_restXmlGetAccountLimitCommandError + * deserializeAws_restXmlListGeoLocationsCommand */ -const de_GetAccountLimitCommandError = async ( +export const de_ListGeoLocationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.GeoLocationDetailsList === "") { + contents[_GLDL] = []; + } else if (data[_GLDL] != null && data[_GLDL][_GLD] != null) { + contents[_GLDL] = de_GeoLocationDetailsList(__getArrayIfSingleItem(data[_GLDL][_GLD]), context); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_MI] != null) { + contents[_MI] = __strictParseInt32(data[_MI]) as number; + } + if (data[_NCC] != null) { + contents[_NCC] = __expectString(data[_NCC]); + } + if (data[_NCCe] != null) { + contents[_NCCe] = __expectString(data[_NCCe]); + } + if (data[_NSC] != null) { + contents[_NSC] = __expectString(data[_NSC]); } + return contents; }; /** - * deserializeAws_restXmlGetChangeCommand + * deserializeAws_restXmlListHealthChecksCommand */ -export const de_GetChangeCommand = async ( +export const de_ListHealthChecksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetChangeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_CI] != null) { - contents[_CI] = de_ChangeInfo(data[_CI], context); + if (data.HealthChecks === "") { + contents[_HCe] = []; + } else if (data[_HCe] != null && data[_HCe][_HC] != null) { + contents[_HCe] = de_HealthChecks(__getArrayIfSingleItem(data[_HCe][_HC]), context); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_M] != null) { + contents[_M] = __expectString(data[_M]); + } + if (data[_MI] != null) { + contents[_MI] = __strictParseInt32(data[_MI]) as number; + } + if (data[_NM] != null) { + contents[_NM] = __expectString(data[_NM]); } return contents; }; /** - * deserializeAws_restXmlGetChangeCommandError + * deserializeAws_restXmlListHostedZonesCommand */ -const de_GetChangeCommandError = async ( +export const de_ListHostedZonesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchChange": - case "com.amazonaws.route53#NoSuchChange": - throw await de_NoSuchChangeRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.HostedZones === "") { + contents[_HZo] = []; + } else if (data[_HZo] != null && data[_HZo][_HZ] != null) { + contents[_HZo] = de_HostedZones(__getArrayIfSingleItem(data[_HZo][_HZ]), context); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_M] != null) { + contents[_M] = __expectString(data[_M]); + } + if (data[_MI] != null) { + contents[_MI] = __strictParseInt32(data[_MI]) as number; } + if (data[_NM] != null) { + contents[_NM] = __expectString(data[_NM]); + } + return contents; }; /** - * deserializeAws_restXmlGetCheckerIpRangesCommand + * deserializeAws_restXmlListHostedZonesByNameCommand */ -export const de_GetCheckerIpRangesCommand = async ( +export const de_ListHostedZonesByNameCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCheckerIpRangesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data.CheckerIpRanges === "") { - contents[_CIR] = []; - } else if (data[_CIR] != null && data[_CIR][_me] != null) { - contents[_CIR] = de_CheckerIpRanges(__getArrayIfSingleItem(data[_CIR][_me]), context); + if (data[_DNSN] != null) { + contents[_DNSN] = __expectString(data[_DNSN]); + } + if (data[_HZI] != null) { + contents[_HZI] = __expectString(data[_HZI]); + } + if (data.HostedZones === "") { + contents[_HZo] = []; + } else if (data[_HZo] != null && data[_HZo][_HZ] != null) { + contents[_HZo] = de_HostedZones(__getArrayIfSingleItem(data[_HZo][_HZ]), context); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_MI] != null) { + contents[_MI] = __strictParseInt32(data[_MI]) as number; + } + if (data[_NDNSN] != null) { + contents[_NDNSN] = __expectString(data[_NDNSN]); + } + if (data[_NHZI] != null) { + contents[_NHZI] = __expectString(data[_NHZI]); } return contents; }; /** - * deserializeAws_restXmlGetCheckerIpRangesCommandError + * deserializeAws_restXmlListHostedZonesByVPCCommand */ -const de_GetCheckerIpRangesCommandError = async ( +export const de_ListHostedZonesByVPCCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.HostedZoneSummaries === "") { + contents[_HZS] = []; + } else if (data[_HZS] != null && data[_HZS][_HZSo] != null) { + contents[_HZS] = de_HostedZoneSummaries(__getArrayIfSingleItem(data[_HZS][_HZSo]), context); + } + if (data[_MI] != null) { + contents[_MI] = __strictParseInt32(data[_MI]) as number; + } + if (data[_NT] != null) { + contents[_NT] = __expectString(data[_NT]); + } + return contents; }; /** - * deserializeAws_restXmlGetDNSSECCommand + * deserializeAws_restXmlListQueryLoggingConfigsCommand */ -export const de_GetDNSSECCommand = async ( +export const de_ListQueryLoggingConfigsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDNSSECCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data.KeySigningKeys === "") { - contents[_KSKe] = []; - } else if (data[_KSKe] != null && data[_KSKe][_me] != null) { - contents[_KSKe] = de_KeySigningKeys(__getArrayIfSingleItem(data[_KSKe][_me]), context); + if (data[_NT] != null) { + contents[_NT] = __expectString(data[_NT]); } - if (data[_S] != null) { - contents[_S] = de_DNSSECStatus(data[_S], context); + if (data.QueryLoggingConfigs === "") { + contents[_QLCu] = []; + } else if (data[_QLCu] != null && data[_QLCu][_QLC] != null) { + contents[_QLCu] = de_QueryLoggingConfigs(__getArrayIfSingleItem(data[_QLCu][_QLC]), context); } return contents; }; /** - * deserializeAws_restXmlGetDNSSECCommandError + * deserializeAws_restXmlListResourceRecordSetsCommand */ -const de_GetDNSSECCommandError = async ( +export const de_ListResourceRecordSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgument": - case "com.amazonaws.route53#InvalidArgument": - throw await de_InvalidArgumentRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_MI] != null) { + contents[_MI] = __strictParseInt32(data[_MI]) as number; + } + if (data[_NRI] != null) { + contents[_NRI] = __expectString(data[_NRI]); + } + if (data[_NRN] != null) { + contents[_NRN] = __expectString(data[_NRN]); + } + if (data[_NRT] != null) { + contents[_NRT] = __expectString(data[_NRT]); + } + if (data.ResourceRecordSets === "") { + contents[_RRS] = []; + } else if (data[_RRS] != null && data[_RRS][_RRSe] != null) { + contents[_RRS] = de_ResourceRecordSets(__getArrayIfSingleItem(data[_RRS][_RRSe]), context); } + return contents; }; /** - * deserializeAws_restXmlGetGeoLocationCommand + * deserializeAws_restXmlListReusableDelegationSetsCommand */ -export const de_GetGeoLocationCommand = async ( +export const de_ListReusableDelegationSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGeoLocationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_GLD] != null) { - contents[_GLD] = de_GeoLocationDetails(data[_GLD], context); + if (data.DelegationSets === "") { + contents[_DSe] = []; + } else if (data[_DSe] != null && data[_DSe][_DS] != null) { + contents[_DSe] = de_DelegationSets(__getArrayIfSingleItem(data[_DSe][_DS]), context); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_M] != null) { + contents[_M] = __expectString(data[_M]); + } + if (data[_MI] != null) { + contents[_MI] = __strictParseInt32(data[_MI]) as number; + } + if (data[_NM] != null) { + contents[_NM] = __expectString(data[_NM]); } return contents; }; /** - * deserializeAws_restXmlGetGeoLocationCommandError + * deserializeAws_restXmlListTagsForResourceCommand */ -const de_GetGeoLocationCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchGeoLocation": - case "com.amazonaws.route53#NoSuchGeoLocation": - throw await de_NoSuchGeoLocationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_RTS] != null) { + contents[_RTS] = de_ResourceTagSet(data[_RTS], context); + } + return contents; }; /** - * deserializeAws_restXmlGetHealthCheckCommand + * deserializeAws_restXmlListTagsForResourcesCommand */ -export const de_GetHealthCheckCommand = async ( +export const de_ListTagsForResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetHealthCheckCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_HC] != null) { - contents[_HC] = de_HealthCheck(data[_HC], context); + if (data.ResourceTagSets === "") { + contents[_RTSe] = []; + } else if (data[_RTSe] != null && data[_RTSe][_RTS] != null) { + contents[_RTSe] = de_ResourceTagSetList(__getArrayIfSingleItem(data[_RTSe][_RTS]), context); } return contents; }; /** - * deserializeAws_restXmlGetHealthCheckCommandError + * deserializeAws_restXmlListTrafficPoliciesCommand */ -const de_GetHealthCheckCommandError = async ( +export const de_ListTrafficPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IncompatibleVersion": - case "com.amazonaws.route53#IncompatibleVersion": - throw await de_IncompatibleVersionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHealthCheck": - case "com.amazonaws.route53#NoSuchHealthCheck": - throw await de_NoSuchHealthCheckRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_MI] != null) { + contents[_MI] = __strictParseInt32(data[_MI]) as number; + } + if (data[_TPIM] != null) { + contents[_TPIM] = __expectString(data[_TPIM]); + } + if (data.TrafficPolicySummaries === "") { + contents[_TPS] = []; + } else if (data[_TPS] != null && data[_TPS][_TPSr] != null) { + contents[_TPS] = de_TrafficPolicySummaries(__getArrayIfSingleItem(data[_TPS][_TPSr]), context); } + return contents; }; /** - * deserializeAws_restXmlGetHealthCheckCountCommand + * deserializeAws_restXmlListTrafficPolicyInstancesCommand */ -export const de_GetHealthCheckCountCommand = async ( +export const de_ListTrafficPolicyInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetHealthCheckCountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_HCCe] != null) { - contents[_HCCe] = __strictParseLong(data[_HCCe]) as number; + if (data[_HZIM] != null) { + contents[_HZIM] = __expectString(data[_HZIM]); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_MI] != null) { + contents[_MI] = __strictParseInt32(data[_MI]) as number; + } + if (data[_TPINM] != null) { + contents[_TPINM] = __expectString(data[_TPINM]); + } + if (data[_TPITM] != null) { + contents[_TPITM] = __expectString(data[_TPITM]); + } + if (data.TrafficPolicyInstances === "") { + contents[_TPIra] = []; + } else if (data[_TPIra] != null && data[_TPIra][_TPIr] != null) { + contents[_TPIra] = de_TrafficPolicyInstances(__getArrayIfSingleItem(data[_TPIra][_TPIr]), context); } return contents; }; /** - * deserializeAws_restXmlGetHealthCheckCountCommandError + * deserializeAws_restXmlListTrafficPolicyInstancesByHostedZoneCommand */ -const de_GetHealthCheckCountCommandError = async ( +export const de_ListTrafficPolicyInstancesByHostedZoneCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_MI] != null) { + contents[_MI] = __strictParseInt32(data[_MI]) as number; + } + if (data[_TPINM] != null) { + contents[_TPINM] = __expectString(data[_TPINM]); + } + if (data[_TPITM] != null) { + contents[_TPITM] = __expectString(data[_TPITM]); + } + if (data.TrafficPolicyInstances === "") { + contents[_TPIra] = []; + } else if (data[_TPIra] != null && data[_TPIra][_TPIr] != null) { + contents[_TPIra] = de_TrafficPolicyInstances(__getArrayIfSingleItem(data[_TPIra][_TPIr]), context); + } + return contents; }; /** - * deserializeAws_restXmlGetHealthCheckLastFailureReasonCommand + * deserializeAws_restXmlListTrafficPolicyInstancesByPolicyCommand */ -export const de_GetHealthCheckLastFailureReasonCommand = async ( +export const de_ListTrafficPolicyInstancesByPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetHealthCheckLastFailureReasonCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data.HealthCheckObservations === "") { - contents[_HCO] = []; - } else if (data[_HCO] != null && data[_HCO][_HCOe] != null) { - contents[_HCO] = de_HealthCheckObservations(__getArrayIfSingleItem(data[_HCO][_HCOe]), context); + if (data[_HZIM] != null) { + contents[_HZIM] = __expectString(data[_HZIM]); + } + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_MI] != null) { + contents[_MI] = __strictParseInt32(data[_MI]) as number; + } + if (data[_TPINM] != null) { + contents[_TPINM] = __expectString(data[_TPINM]); + } + if (data[_TPITM] != null) { + contents[_TPITM] = __expectString(data[_TPITM]); + } + if (data.TrafficPolicyInstances === "") { + contents[_TPIra] = []; + } else if (data[_TPIra] != null && data[_TPIra][_TPIr] != null) { + contents[_TPIra] = de_TrafficPolicyInstances(__getArrayIfSingleItem(data[_TPIra][_TPIr]), context); } return contents; }; /** - * deserializeAws_restXmlGetHealthCheckLastFailureReasonCommandError + * deserializeAws_restXmlListTrafficPolicyVersionsCommand */ -const de_GetHealthCheckLastFailureReasonCommandError = async ( +export const de_ListTrafficPolicyVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHealthCheck": - case "com.amazonaws.route53#NoSuchHealthCheck": - throw await de_NoSuchHealthCheckRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_IT] != null) { + contents[_IT] = __parseBoolean(data[_IT]); + } + if (data[_MI] != null) { + contents[_MI] = __strictParseInt32(data[_MI]) as number; + } + if (data.TrafficPolicies === "") { + contents[_TPr] = []; + } else if (data[_TPr] != null && data[_TPr][_TP] != null) { + contents[_TPr] = de_TrafficPolicies(__getArrayIfSingleItem(data[_TPr][_TP]), context); + } + if (data[_TPVM] != null) { + contents[_TPVM] = __expectString(data[_TPVM]); } + return contents; }; /** - * deserializeAws_restXmlGetHealthCheckStatusCommand + * deserializeAws_restXmlListVPCAssociationAuthorizationsCommand */ -export const de_GetHealthCheckStatusCommand = async ( +export const de_ListVPCAssociationAuthorizationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetHealthCheckStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data.HealthCheckObservations === "") { - contents[_HCO] = []; - } else if (data[_HCO] != null && data[_HCO][_HCOe] != null) { - contents[_HCO] = de_HealthCheckObservations(__getArrayIfSingleItem(data[_HCO][_HCOe]), context); + if (data[_HZI] != null) { + contents[_HZI] = __expectString(data[_HZI]); + } + if (data[_NT] != null) { + contents[_NT] = __expectString(data[_NT]); + } + if (data.VPCs === "") { + contents[_VPCs] = []; + } else if (data[_VPCs] != null && data[_VPCs][_VPC] != null) { + contents[_VPCs] = de_VPCs(__getArrayIfSingleItem(data[_VPCs][_VPC]), context); } return contents; }; /** - * deserializeAws_restXmlGetHealthCheckStatusCommandError + * deserializeAws_restXmlTestDNSAnswerCommand */ -const de_GetHealthCheckStatusCommandError = async ( +export const de_TestDNSAnswerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHealthCheck": - case "com.amazonaws.route53#NoSuchHealthCheck": - throw await de_NoSuchHealthCheckRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_Na] != null) { + contents[_Na] = __expectString(data[_Na]); + } + if (data[_Pr] != null) { + contents[_Pr] = __expectString(data[_Pr]); + } + if (data.RecordData === "") { + contents[_RDe] = []; + } else if (data[_RDe] != null && data[_RDe][_RDE] != null) { + contents[_RDe] = de_RecordData(__getArrayIfSingleItem(data[_RDe][_RDE]), context); + } + if (data[_RN] != null) { + contents[_RN] = __expectString(data[_RN]); + } + if (data[_RT] != null) { + contents[_RT] = __expectString(data[_RT]); + } + if (data[_RC] != null) { + contents[_RC] = __expectString(data[_RC]); } + return contents; }; /** - * deserializeAws_restXmlGetHostedZoneCommand + * deserializeAws_restXmlUpdateHealthCheckCommand */ -export const de_GetHostedZoneCommand = async ( +export const de_UpdateHealthCheckCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetHostedZoneCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_DS] != null) { - contents[_DS] = de_DelegationSet(data[_DS], context); - } - if (data[_HZ] != null) { - contents[_HZ] = de_HostedZone(data[_HZ], context); - } - if (data.VPCs === "") { - contents[_VPCs] = []; - } else if (data[_VPCs] != null && data[_VPCs][_VPC] != null) { - contents[_VPCs] = de_VPCs(__getArrayIfSingleItem(data[_VPCs][_VPC]), context); + if (data[_HC] != null) { + contents[_HC] = de_HealthCheck(data[_HC], context); } return contents; }; /** - * deserializeAws_restXmlGetHostedZoneCommandError + * deserializeAws_restXmlUpdateHostedZoneCommentCommand */ -const de_GetHostedZoneCommandError = async ( +export const de_UpdateHostedZoneCommentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetHostedZoneCountCommand - */ -export const de_GetHostedZoneCountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetHostedZoneCountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_HZCo] != null) { - contents[_HZCo] = __strictParseLong(data[_HZCo]) as number; - } - return contents; -}; - -/** - * deserializeAws_restXmlGetHostedZoneCountCommandError - */ -const de_GetHostedZoneCountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetHostedZoneLimitCommand - */ -export const de_GetHostedZoneLimitCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetHostedZoneLimitCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_Cou] != null) { - contents[_Cou] = __strictParseLong(data[_Cou]) as number; - } - if (data[_Li] != null) { - contents[_Li] = de_HostedZoneLimit(data[_Li], context); - } - return contents; -}; - -/** - * deserializeAws_restXmlGetHostedZoneLimitCommandError - */ -const de_GetHostedZoneLimitCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "HostedZoneNotPrivate": - case "com.amazonaws.route53#HostedZoneNotPrivate": - throw await de_HostedZoneNotPrivateRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetQueryLoggingConfigCommand - */ -export const de_GetQueryLoggingConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetQueryLoggingConfigCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_QLC] != null) { - contents[_QLC] = de_QueryLoggingConfig(data[_QLC], context); - } - return contents; -}; - -/** - * deserializeAws_restXmlGetQueryLoggingConfigCommandError - */ -const de_GetQueryLoggingConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchQueryLoggingConfig": - case "com.amazonaws.route53#NoSuchQueryLoggingConfig": - throw await de_NoSuchQueryLoggingConfigRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetReusableDelegationSetCommand - */ -export const de_GetReusableDelegationSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReusableDelegationSetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_DS] != null) { - contents[_DS] = de_DelegationSet(data[_DS], context); - } - return contents; -}; - -/** - * deserializeAws_restXmlGetReusableDelegationSetCommandError - */ -const de_GetReusableDelegationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DelegationSetNotReusable": - case "com.amazonaws.route53#DelegationSetNotReusable": - throw await de_DelegationSetNotReusableRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchDelegationSet": - case "com.amazonaws.route53#NoSuchDelegationSet": - throw await de_NoSuchDelegationSetRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetReusableDelegationSetLimitCommand - */ -export const de_GetReusableDelegationSetLimitCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReusableDelegationSetLimitCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_Cou] != null) { - contents[_Cou] = __strictParseLong(data[_Cou]) as number; - } - if (data[_Li] != null) { - contents[_Li] = de_ReusableDelegationSetLimit(data[_Li], context); - } - return contents; -}; - -/** - * deserializeAws_restXmlGetReusableDelegationSetLimitCommandError - */ -const de_GetReusableDelegationSetLimitCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchDelegationSet": - case "com.amazonaws.route53#NoSuchDelegationSet": - throw await de_NoSuchDelegationSetRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetTrafficPolicyCommand - */ -export const de_GetTrafficPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTrafficPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_TP] != null) { - contents[_TP] = de_TrafficPolicy(data[_TP], context); - } - return contents; -}; - -/** - * deserializeAws_restXmlGetTrafficPolicyCommandError - */ -const de_GetTrafficPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchTrafficPolicy": - case "com.amazonaws.route53#NoSuchTrafficPolicy": - throw await de_NoSuchTrafficPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetTrafficPolicyInstanceCommand - */ -export const de_GetTrafficPolicyInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTrafficPolicyInstanceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_TPIr] != null) { - contents[_TPIr] = de_TrafficPolicyInstance(data[_TPIr], context); - } - return contents; -}; - -/** - * deserializeAws_restXmlGetTrafficPolicyInstanceCommandError - */ -const de_GetTrafficPolicyInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchTrafficPolicyInstance": - case "com.amazonaws.route53#NoSuchTrafficPolicyInstance": - throw await de_NoSuchTrafficPolicyInstanceRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetTrafficPolicyInstanceCountCommand - */ -export const de_GetTrafficPolicyInstanceCountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTrafficPolicyInstanceCountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_TPIC] != null) { - contents[_TPIC] = __strictParseInt32(data[_TPIC]) as number; - } - return contents; -}; - -/** - * deserializeAws_restXmlGetTrafficPolicyInstanceCountCommandError - */ -const de_GetTrafficPolicyInstanceCountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_restXmlListCidrBlocksCommand - */ -export const de_ListCidrBlocksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCidrBlocksCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data.CidrBlocks === "") { - contents[_CBi] = []; - } else if (data[_CBi] != null && data[_CBi][_me] != null) { - contents[_CBi] = de_CidrBlockSummaries(__getArrayIfSingleItem(data[_CBi][_me]), context); - } - if (data[_NT] != null) { - contents[_NT] = __expectString(data[_NT]); - } - return contents; -}; - -/** - * deserializeAws_restXmlListCidrBlocksCommandError - */ -const de_ListCidrBlocksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchCidrCollectionException": - case "com.amazonaws.route53#NoSuchCidrCollectionException": - throw await de_NoSuchCidrCollectionExceptionRes(parsedOutput, context); - case "NoSuchCidrLocationException": - case "com.amazonaws.route53#NoSuchCidrLocationException": - throw await de_NoSuchCidrLocationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListCidrCollectionsCommand - */ -export const de_ListCidrCollectionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCidrCollectionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data.CidrCollections === "") { - contents[_CCi] = []; - } else if (data[_CCi] != null && data[_CCi][_me] != null) { - contents[_CCi] = de_CollectionSummaries(__getArrayIfSingleItem(data[_CCi][_me]), context); - } - if (data[_NT] != null) { - contents[_NT] = __expectString(data[_NT]); - } - return contents; -}; - -/** - * deserializeAws_restXmlListCidrCollectionsCommandError - */ -const de_ListCidrCollectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListCidrLocationsCommand - */ -export const de_ListCidrLocationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCidrLocationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data.CidrLocations === "") { - contents[_CL] = []; - } else if (data[_CL] != null && data[_CL][_me] != null) { - contents[_CL] = de_LocationSummaries(__getArrayIfSingleItem(data[_CL][_me]), context); - } - if (data[_NT] != null) { - contents[_NT] = __expectString(data[_NT]); - } - return contents; -}; - -/** - * deserializeAws_restXmlListCidrLocationsCommandError - */ -const de_ListCidrLocationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchCidrCollectionException": - case "com.amazonaws.route53#NoSuchCidrCollectionException": - throw await de_NoSuchCidrCollectionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListGeoLocationsCommand - */ -export const de_ListGeoLocationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGeoLocationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data.GeoLocationDetailsList === "") { - contents[_GLDL] = []; - } else if (data[_GLDL] != null && data[_GLDL][_GLD] != null) { - contents[_GLDL] = de_GeoLocationDetailsList(__getArrayIfSingleItem(data[_GLDL][_GLD]), context); - } - if (data[_IT] != null) { - contents[_IT] = __parseBoolean(data[_IT]); - } - if (data[_MI] != null) { - contents[_MI] = __strictParseInt32(data[_MI]) as number; - } - if (data[_NCC] != null) { - contents[_NCC] = __expectString(data[_NCC]); - } - if (data[_NCCe] != null) { - contents[_NCCe] = __expectString(data[_NCCe]); - } - if (data[_NSC] != null) { - contents[_NSC] = __expectString(data[_NSC]); - } - return contents; -}; - -/** - * deserializeAws_restXmlListGeoLocationsCommandError - */ -const de_ListGeoLocationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListHealthChecksCommand - */ -export const de_ListHealthChecksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListHealthChecksCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data.HealthChecks === "") { - contents[_HCe] = []; - } else if (data[_HCe] != null && data[_HCe][_HC] != null) { - contents[_HCe] = de_HealthChecks(__getArrayIfSingleItem(data[_HCe][_HC]), context); - } - if (data[_IT] != null) { - contents[_IT] = __parseBoolean(data[_IT]); - } - if (data[_M] != null) { - contents[_M] = __expectString(data[_M]); - } - if (data[_MI] != null) { - contents[_MI] = __strictParseInt32(data[_MI]) as number; - } - if (data[_NM] != null) { - contents[_NM] = __expectString(data[_NM]); - } - return contents; -}; - -/** - * deserializeAws_restXmlListHealthChecksCommandError - */ -const de_ListHealthChecksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IncompatibleVersion": - case "com.amazonaws.route53#IncompatibleVersion": - throw await de_IncompatibleVersionRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListHostedZonesCommand - */ -export const de_ListHostedZonesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListHostedZonesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data.HostedZones === "") { - contents[_HZo] = []; - } else if (data[_HZo] != null && data[_HZo][_HZ] != null) { - contents[_HZo] = de_HostedZones(__getArrayIfSingleItem(data[_HZo][_HZ]), context); - } - if (data[_IT] != null) { - contents[_IT] = __parseBoolean(data[_IT]); - } - if (data[_M] != null) { - contents[_M] = __expectString(data[_M]); - } - if (data[_MI] != null) { - contents[_MI] = __strictParseInt32(data[_MI]) as number; - } - if (data[_NM] != null) { - contents[_NM] = __expectString(data[_NM]); - } - return contents; -}; - -/** - * deserializeAws_restXmlListHostedZonesCommandError - */ -const de_ListHostedZonesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DelegationSetNotReusable": - case "com.amazonaws.route53#DelegationSetNotReusable": - throw await de_DelegationSetNotReusableRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchDelegationSet": - case "com.amazonaws.route53#NoSuchDelegationSet": - throw await de_NoSuchDelegationSetRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListHostedZonesByNameCommand - */ -export const de_ListHostedZonesByNameCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListHostedZonesByNameCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_DNSN] != null) { - contents[_DNSN] = __expectString(data[_DNSN]); - } - if (data[_HZI] != null) { - contents[_HZI] = __expectString(data[_HZI]); - } - if (data.HostedZones === "") { - contents[_HZo] = []; - } else if (data[_HZo] != null && data[_HZo][_HZ] != null) { - contents[_HZo] = de_HostedZones(__getArrayIfSingleItem(data[_HZo][_HZ]), context); - } - if (data[_IT] != null) { - contents[_IT] = __parseBoolean(data[_IT]); - } - if (data[_MI] != null) { - contents[_MI] = __strictParseInt32(data[_MI]) as number; - } - if (data[_NDNSN] != null) { - contents[_NDNSN] = __expectString(data[_NDNSN]); - } - if (data[_NHZI] != null) { - contents[_NHZI] = __expectString(data[_NHZI]); - } - return contents; -}; - -/** - * deserializeAws_restXmlListHostedZonesByNameCommandError - */ -const de_ListHostedZonesByNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidDomainName": - case "com.amazonaws.route53#InvalidDomainName": - throw await de_InvalidDomainNameRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListHostedZonesByVPCCommand - */ -export const de_ListHostedZonesByVPCCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListHostedZonesByVPCCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data.HostedZoneSummaries === "") { - contents[_HZS] = []; - } else if (data[_HZS] != null && data[_HZS][_HZSo] != null) { - contents[_HZS] = de_HostedZoneSummaries(__getArrayIfSingleItem(data[_HZS][_HZSo]), context); - } - if (data[_MI] != null) { - contents[_MI] = __strictParseInt32(data[_MI]) as number; - } - if (data[_NT] != null) { - contents[_NT] = __expectString(data[_NT]); - } - return contents; -}; - -/** - * deserializeAws_restXmlListHostedZonesByVPCCommandError - */ -const de_ListHostedZonesByVPCCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidPaginationToken": - case "com.amazonaws.route53#InvalidPaginationToken": - throw await de_InvalidPaginationTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListQueryLoggingConfigsCommand - */ -export const de_ListQueryLoggingConfigsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListQueryLoggingConfigsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_NT] != null) { - contents[_NT] = __expectString(data[_NT]); - } - if (data.QueryLoggingConfigs === "") { - contents[_QLCu] = []; - } else if (data[_QLCu] != null && data[_QLCu][_QLC] != null) { - contents[_QLCu] = de_QueryLoggingConfigs(__getArrayIfSingleItem(data[_QLCu][_QLC]), context); - } - return contents; -}; - -/** - * deserializeAws_restXmlListQueryLoggingConfigsCommandError - */ -const de_ListQueryLoggingConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidPaginationToken": - case "com.amazonaws.route53#InvalidPaginationToken": - throw await de_InvalidPaginationTokenRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListResourceRecordSetsCommand - */ -export const de_ListResourceRecordSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResourceRecordSetsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_IT] != null) { - contents[_IT] = __parseBoolean(data[_IT]); - } - if (data[_MI] != null) { - contents[_MI] = __strictParseInt32(data[_MI]) as number; - } - if (data[_NRI] != null) { - contents[_NRI] = __expectString(data[_NRI]); - } - if (data[_NRN] != null) { - contents[_NRN] = __expectString(data[_NRN]); - } - if (data[_NRT] != null) { - contents[_NRT] = __expectString(data[_NRT]); - } - if (data.ResourceRecordSets === "") { - contents[_RRS] = []; - } else if (data[_RRS] != null && data[_RRS][_RRSe] != null) { - contents[_RRS] = de_ResourceRecordSets(__getArrayIfSingleItem(data[_RRS][_RRSe]), context); - } - return contents; -}; - -/** - * deserializeAws_restXmlListResourceRecordSetsCommandError - */ -const de_ListResourceRecordSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListReusableDelegationSetsCommand - */ -export const de_ListReusableDelegationSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReusableDelegationSetsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data.DelegationSets === "") { - contents[_DSe] = []; - } else if (data[_DSe] != null && data[_DSe][_DS] != null) { - contents[_DSe] = de_DelegationSets(__getArrayIfSingleItem(data[_DSe][_DS]), context); - } - if (data[_IT] != null) { - contents[_IT] = __parseBoolean(data[_IT]); - } - if (data[_M] != null) { - contents[_M] = __expectString(data[_M]); - } - if (data[_MI] != null) { - contents[_MI] = __strictParseInt32(data[_MI]) as number; - } - if (data[_NM] != null) { - contents[_NM] = __expectString(data[_NM]); - } - return contents; -}; - -/** - * deserializeAws_restXmlListReusableDelegationSetsCommandError - */ -const de_ListReusableDelegationSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_RTS] != null) { - contents[_RTS] = de_ResourceTagSet(data[_RTS], context); - } - return contents; -}; - -/** - * deserializeAws_restXmlListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHealthCheck": - case "com.amazonaws.route53#NoSuchHealthCheck": - throw await de_NoSuchHealthCheckRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - case "PriorRequestNotComplete": - case "com.amazonaws.route53#PriorRequestNotComplete": - throw await de_PriorRequestNotCompleteRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListTagsForResourcesCommand - */ -export const de_ListTagsForResourcesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourcesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data.ResourceTagSets === "") { - contents[_RTSe] = []; - } else if (data[_RTSe] != null && data[_RTSe][_RTS] != null) { - contents[_RTSe] = de_ResourceTagSetList(__getArrayIfSingleItem(data[_RTSe][_RTS]), context); - } - return contents; -}; - -/** - * deserializeAws_restXmlListTagsForResourcesCommandError - */ -const de_ListTagsForResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHealthCheck": - case "com.amazonaws.route53#NoSuchHealthCheck": - throw await de_NoSuchHealthCheckRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - case "PriorRequestNotComplete": - case "com.amazonaws.route53#PriorRequestNotComplete": - throw await de_PriorRequestNotCompleteRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListTrafficPoliciesCommand - */ -export const de_ListTrafficPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTrafficPoliciesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_IT] != null) { - contents[_IT] = __parseBoolean(data[_IT]); - } - if (data[_MI] != null) { - contents[_MI] = __strictParseInt32(data[_MI]) as number; - } - if (data[_TPIM] != null) { - contents[_TPIM] = __expectString(data[_TPIM]); - } - if (data.TrafficPolicySummaries === "") { - contents[_TPS] = []; - } else if (data[_TPS] != null && data[_TPS][_TPSr] != null) { - contents[_TPS] = de_TrafficPolicySummaries(__getArrayIfSingleItem(data[_TPS][_TPSr]), context); - } - return contents; -}; - -/** - * deserializeAws_restXmlListTrafficPoliciesCommandError - */ -const de_ListTrafficPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListTrafficPolicyInstancesCommand - */ -export const de_ListTrafficPolicyInstancesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTrafficPolicyInstancesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_HZIM] != null) { - contents[_HZIM] = __expectString(data[_HZIM]); - } - if (data[_IT] != null) { - contents[_IT] = __parseBoolean(data[_IT]); - } - if (data[_MI] != null) { - contents[_MI] = __strictParseInt32(data[_MI]) as number; - } - if (data[_TPINM] != null) { - contents[_TPINM] = __expectString(data[_TPINM]); - } - if (data[_TPITM] != null) { - contents[_TPITM] = __expectString(data[_TPITM]); - } - if (data.TrafficPolicyInstances === "") { - contents[_TPIra] = []; - } else if (data[_TPIra] != null && data[_TPIra][_TPIr] != null) { - contents[_TPIra] = de_TrafficPolicyInstances(__getArrayIfSingleItem(data[_TPIra][_TPIr]), context); - } - return contents; -}; - -/** - * deserializeAws_restXmlListTrafficPolicyInstancesCommandError - */ -const de_ListTrafficPolicyInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchTrafficPolicyInstance": - case "com.amazonaws.route53#NoSuchTrafficPolicyInstance": - throw await de_NoSuchTrafficPolicyInstanceRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListTrafficPolicyInstancesByHostedZoneCommand - */ -export const de_ListTrafficPolicyInstancesByHostedZoneCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTrafficPolicyInstancesByHostedZoneCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_IT] != null) { - contents[_IT] = __parseBoolean(data[_IT]); - } - if (data[_MI] != null) { - contents[_MI] = __strictParseInt32(data[_MI]) as number; - } - if (data[_TPINM] != null) { - contents[_TPINM] = __expectString(data[_TPINM]); - } - if (data[_TPITM] != null) { - contents[_TPITM] = __expectString(data[_TPITM]); - } - if (data.TrafficPolicyInstances === "") { - contents[_TPIra] = []; - } else if (data[_TPIra] != null && data[_TPIra][_TPIr] != null) { - contents[_TPIra] = de_TrafficPolicyInstances(__getArrayIfSingleItem(data[_TPIra][_TPIr]), context); - } - return contents; -}; - -/** - * deserializeAws_restXmlListTrafficPolicyInstancesByHostedZoneCommandError - */ -const de_ListTrafficPolicyInstancesByHostedZoneCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - case "NoSuchTrafficPolicyInstance": - case "com.amazonaws.route53#NoSuchTrafficPolicyInstance": - throw await de_NoSuchTrafficPolicyInstanceRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListTrafficPolicyInstancesByPolicyCommand - */ -export const de_ListTrafficPolicyInstancesByPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTrafficPolicyInstancesByPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_HZIM] != null) { - contents[_HZIM] = __expectString(data[_HZIM]); - } - if (data[_IT] != null) { - contents[_IT] = __parseBoolean(data[_IT]); - } - if (data[_MI] != null) { - contents[_MI] = __strictParseInt32(data[_MI]) as number; - } - if (data[_TPINM] != null) { - contents[_TPINM] = __expectString(data[_TPINM]); - } - if (data[_TPITM] != null) { - contents[_TPITM] = __expectString(data[_TPITM]); - } - if (data.TrafficPolicyInstances === "") { - contents[_TPIra] = []; - } else if (data[_TPIra] != null && data[_TPIra][_TPIr] != null) { - contents[_TPIra] = de_TrafficPolicyInstances(__getArrayIfSingleItem(data[_TPIra][_TPIr]), context); - } - return contents; -}; - -/** - * deserializeAws_restXmlListTrafficPolicyInstancesByPolicyCommandError - */ -const de_ListTrafficPolicyInstancesByPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchTrafficPolicy": - case "com.amazonaws.route53#NoSuchTrafficPolicy": - throw await de_NoSuchTrafficPolicyRes(parsedOutput, context); - case "NoSuchTrafficPolicyInstance": - case "com.amazonaws.route53#NoSuchTrafficPolicyInstance": - throw await de_NoSuchTrafficPolicyInstanceRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListTrafficPolicyVersionsCommand - */ -export const de_ListTrafficPolicyVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTrafficPolicyVersionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_IT] != null) { - contents[_IT] = __parseBoolean(data[_IT]); - } - if (data[_MI] != null) { - contents[_MI] = __strictParseInt32(data[_MI]) as number; - } - if (data.TrafficPolicies === "") { - contents[_TPr] = []; - } else if (data[_TPr] != null && data[_TPr][_TP] != null) { - contents[_TPr] = de_TrafficPolicies(__getArrayIfSingleItem(data[_TPr][_TP]), context); - } - if (data[_TPVM] != null) { - contents[_TPVM] = __expectString(data[_TPVM]); - } - return contents; -}; - -/** - * deserializeAws_restXmlListTrafficPolicyVersionsCommandError - */ -const de_ListTrafficPolicyVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchTrafficPolicy": - case "com.amazonaws.route53#NoSuchTrafficPolicy": - throw await de_NoSuchTrafficPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlListVPCAssociationAuthorizationsCommand - */ -export const de_ListVPCAssociationAuthorizationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVPCAssociationAuthorizationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_HZI] != null) { - contents[_HZI] = __expectString(data[_HZI]); - } - if (data[_NT] != null) { - contents[_NT] = __expectString(data[_NT]); - } - if (data.VPCs === "") { - contents[_VPCs] = []; - } else if (data[_VPCs] != null && data[_VPCs][_VPC] != null) { - contents[_VPCs] = de_VPCs(__getArrayIfSingleItem(data[_VPCs][_VPC]), context); - } - return contents; -}; - -/** - * deserializeAws_restXmlListVPCAssociationAuthorizationsCommandError - */ -const de_ListVPCAssociationAuthorizationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "InvalidPaginationToken": - case "com.amazonaws.route53#InvalidPaginationToken": - throw await de_InvalidPaginationTokenRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlTestDNSAnswerCommand - */ -export const de_TestDNSAnswerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TestDNSAnswerCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_Na] != null) { - contents[_Na] = __expectString(data[_Na]); - } - if (data[_Pr] != null) { - contents[_Pr] = __expectString(data[_Pr]); - } - if (data.RecordData === "") { - contents[_RDe] = []; - } else if (data[_RDe] != null && data[_RDe][_RDE] != null) { - contents[_RDe] = de_RecordData(__getArrayIfSingleItem(data[_RDe][_RDE]), context); - } - if (data[_RN] != null) { - contents[_RN] = __expectString(data[_RN]); - } - if (data[_RT] != null) { - contents[_RT] = __expectString(data[_RT]); - } - if (data[_RC] != null) { - contents[_RC] = __expectString(data[_RC]); - } - return contents; -}; - -/** - * deserializeAws_restXmlTestDNSAnswerCommandError - */ -const de_TestDNSAnswerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateHealthCheckCommand - */ -export const de_UpdateHealthCheckCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateHealthCheckCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_HC] != null) { - contents[_HC] = de_HealthCheck(data[_HC], context); - } - return contents; -}; - -/** - * deserializeAws_restXmlUpdateHealthCheckCommandError - */ -const de_UpdateHealthCheckCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "HealthCheckVersionMismatch": - case "com.amazonaws.route53#HealthCheckVersionMismatch": - throw await de_HealthCheckVersionMismatchRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHealthCheck": - case "com.amazonaws.route53#NoSuchHealthCheck": - throw await de_NoSuchHealthCheckRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlUpdateHostedZoneCommentCommand - */ -export const de_UpdateHostedZoneCommentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateHostedZoneCommentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - if (data[_HZ] != null) { - contents[_HZ] = de_HostedZone(data[_HZ], context); - } - return contents; -}; - -/** - * deserializeAws_restXmlUpdateHostedZoneCommentCommandError - */ -const de_UpdateHostedZoneCommentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchHostedZone": - case "com.amazonaws.route53#NoSuchHostedZone": - throw await de_NoSuchHostedZoneRes(parsedOutput, context); - case "PriorRequestNotComplete": - case "com.amazonaws.route53#PriorRequestNotComplete": - throw await de_PriorRequestNotCompleteRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data[_HZ] != null) { + contents[_HZ] = de_HostedZone(data[_HZ], context); } + return contents; }; /** @@ -5750,7 +3475,7 @@ export const de_UpdateTrafficPolicyCommentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTrafficPolicyCommentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5762,38 +3487,6 @@ export const de_UpdateTrafficPolicyCommentCommand = async ( return contents; }; -/** - * deserializeAws_restXmlUpdateTrafficPolicyCommentCommandError - */ -const de_UpdateTrafficPolicyCommentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModification": - case "com.amazonaws.route53#ConcurrentModification": - throw await de_ConcurrentModificationRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.route53#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NoSuchTrafficPolicy": - case "com.amazonaws.route53#NoSuchTrafficPolicy": - throw await de_NoSuchTrafficPolicyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlUpdateTrafficPolicyInstanceCommand */ @@ -5802,7 +3495,7 @@ export const de_UpdateTrafficPolicyInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTrafficPolicyInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5815,40 +3508,229 @@ export const de_UpdateTrafficPolicyInstanceCommand = async ( }; /** - * deserializeAws_restXmlUpdateTrafficPolicyInstanceCommandError + * deserialize_Aws_restXmlCommandError */ -const de_UpdateTrafficPolicyInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ConflictingTypes": - case "com.amazonaws.route53#ConflictingTypes": - throw await de_ConflictingTypesRes(parsedOutput, context); + case "ConcurrentModification": + case "com.amazonaws.route53#ConcurrentModification": + throw await de_ConcurrentModificationRes(parsedOutput, context); case "InvalidInput": case "com.amazonaws.route53#InvalidInput": throw await de_InvalidInputRes(parsedOutput, context); + case "InvalidKMSArn": + case "com.amazonaws.route53#InvalidKMSArn": + throw await de_InvalidKMSArnRes(parsedOutput, context); + case "InvalidKeySigningKeyStatus": + case "com.amazonaws.route53#InvalidKeySigningKeyStatus": + throw await de_InvalidKeySigningKeyStatusRes(parsedOutput, context); + case "InvalidSigningStatus": + case "com.amazonaws.route53#InvalidSigningStatus": + throw await de_InvalidSigningStatusRes(parsedOutput, context); + case "NoSuchKeySigningKey": + case "com.amazonaws.route53#NoSuchKeySigningKey": + throw await de_NoSuchKeySigningKeyRes(parsedOutput, context); + case "ConflictingDomainExists": + case "com.amazonaws.route53#ConflictingDomainExists": + throw await de_ConflictingDomainExistsRes(parsedOutput, context); + case "InvalidVPCId": + case "com.amazonaws.route53#InvalidVPCId": + throw await de_InvalidVPCIdRes(parsedOutput, context); + case "LimitsExceeded": + case "com.amazonaws.route53#LimitsExceeded": + throw await de_LimitsExceededRes(parsedOutput, context); + case "NoSuchHostedZone": + case "com.amazonaws.route53#NoSuchHostedZone": + throw await de_NoSuchHostedZoneRes(parsedOutput, context); + case "NotAuthorizedException": + case "com.amazonaws.route53#NotAuthorizedException": + throw await de_NotAuthorizedExceptionRes(parsedOutput, context); + case "PriorRequestNotComplete": + case "com.amazonaws.route53#PriorRequestNotComplete": + throw await de_PriorRequestNotCompleteRes(parsedOutput, context); + case "PublicZoneVPCAssociation": + case "com.amazonaws.route53#PublicZoneVPCAssociation": + throw await de_PublicZoneVPCAssociationRes(parsedOutput, context); + case "CidrBlockInUseException": + case "com.amazonaws.route53#CidrBlockInUseException": + throw await de_CidrBlockInUseExceptionRes(parsedOutput, context); + case "CidrCollectionVersionMismatchException": + case "com.amazonaws.route53#CidrCollectionVersionMismatchException": + throw await de_CidrCollectionVersionMismatchExceptionRes(parsedOutput, context); + case "NoSuchCidrCollectionException": + case "com.amazonaws.route53#NoSuchCidrCollectionException": + throw await de_NoSuchCidrCollectionExceptionRes(parsedOutput, context); + case "InvalidChangeBatch": + case "com.amazonaws.route53#InvalidChangeBatch": + throw await de_InvalidChangeBatchRes(parsedOutput, context); + case "NoSuchHealthCheck": + case "com.amazonaws.route53#NoSuchHealthCheck": + throw await de_NoSuchHealthCheckRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.route53#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "CidrCollectionAlreadyExistsException": + case "com.amazonaws.route53#CidrCollectionAlreadyExistsException": + throw await de_CidrCollectionAlreadyExistsExceptionRes(parsedOutput, context); + case "HealthCheckAlreadyExists": + case "com.amazonaws.route53#HealthCheckAlreadyExists": + throw await de_HealthCheckAlreadyExistsRes(parsedOutput, context); + case "TooManyHealthChecks": + case "com.amazonaws.route53#TooManyHealthChecks": + throw await de_TooManyHealthChecksRes(parsedOutput, context); + case "DelegationSetNotAvailable": + case "com.amazonaws.route53#DelegationSetNotAvailable": + throw await de_DelegationSetNotAvailableRes(parsedOutput, context); + case "DelegationSetNotReusable": + case "com.amazonaws.route53#DelegationSetNotReusable": + throw await de_DelegationSetNotReusableRes(parsedOutput, context); + case "HostedZoneAlreadyExists": + case "com.amazonaws.route53#HostedZoneAlreadyExists": + throw await de_HostedZoneAlreadyExistsRes(parsedOutput, context); + case "InvalidDomainName": + case "com.amazonaws.route53#InvalidDomainName": + throw await de_InvalidDomainNameRes(parsedOutput, context); + case "NoSuchDelegationSet": + case "com.amazonaws.route53#NoSuchDelegationSet": + throw await de_NoSuchDelegationSetRes(parsedOutput, context); + case "TooManyHostedZones": + case "com.amazonaws.route53#TooManyHostedZones": + throw await de_TooManyHostedZonesRes(parsedOutput, context); + case "InvalidArgument": + case "com.amazonaws.route53#InvalidArgument": + throw await de_InvalidArgumentRes(parsedOutput, context); + case "InvalidKeySigningKeyName": + case "com.amazonaws.route53#InvalidKeySigningKeyName": + throw await de_InvalidKeySigningKeyNameRes(parsedOutput, context); + case "KeySigningKeyAlreadyExists": + case "com.amazonaws.route53#KeySigningKeyAlreadyExists": + throw await de_KeySigningKeyAlreadyExistsRes(parsedOutput, context); + case "TooManyKeySigningKeys": + case "com.amazonaws.route53#TooManyKeySigningKeys": + throw await de_TooManyKeySigningKeysRes(parsedOutput, context); + case "InsufficientCloudWatchLogsResourcePolicy": + case "com.amazonaws.route53#InsufficientCloudWatchLogsResourcePolicy": + throw await de_InsufficientCloudWatchLogsResourcePolicyRes(parsedOutput, context); + case "NoSuchCloudWatchLogsLogGroup": + case "com.amazonaws.route53#NoSuchCloudWatchLogsLogGroup": + throw await de_NoSuchCloudWatchLogsLogGroupRes(parsedOutput, context); + case "QueryLoggingConfigAlreadyExists": + case "com.amazonaws.route53#QueryLoggingConfigAlreadyExists": + throw await de_QueryLoggingConfigAlreadyExistsRes(parsedOutput, context); + case "DelegationSetAlreadyCreated": + case "com.amazonaws.route53#DelegationSetAlreadyCreated": + throw await de_DelegationSetAlreadyCreatedRes(parsedOutput, context); + case "DelegationSetAlreadyReusable": + case "com.amazonaws.route53#DelegationSetAlreadyReusable": + throw await de_DelegationSetAlreadyReusableRes(parsedOutput, context); + case "HostedZoneNotFound": + case "com.amazonaws.route53#HostedZoneNotFound": + throw await de_HostedZoneNotFoundRes(parsedOutput, context); + case "InvalidTrafficPolicyDocument": + case "com.amazonaws.route53#InvalidTrafficPolicyDocument": + throw await de_InvalidTrafficPolicyDocumentRes(parsedOutput, context); + case "TooManyTrafficPolicies": + case "com.amazonaws.route53#TooManyTrafficPolicies": + throw await de_TooManyTrafficPoliciesRes(parsedOutput, context); + case "TrafficPolicyAlreadyExists": + case "com.amazonaws.route53#TrafficPolicyAlreadyExists": + throw await de_TrafficPolicyAlreadyExistsRes(parsedOutput, context); case "NoSuchTrafficPolicy": case "com.amazonaws.route53#NoSuchTrafficPolicy": throw await de_NoSuchTrafficPolicyRes(parsedOutput, context); + case "TooManyTrafficPolicyInstances": + case "com.amazonaws.route53#TooManyTrafficPolicyInstances": + throw await de_TooManyTrafficPolicyInstancesRes(parsedOutput, context); + case "TrafficPolicyInstanceAlreadyExists": + case "com.amazonaws.route53#TrafficPolicyInstanceAlreadyExists": + throw await de_TrafficPolicyInstanceAlreadyExistsRes(parsedOutput, context); + case "TooManyTrafficPolicyVersionsForCurrentPolicy": + case "com.amazonaws.route53#TooManyTrafficPolicyVersionsForCurrentPolicy": + throw await de_TooManyTrafficPolicyVersionsForCurrentPolicyRes(parsedOutput, context); + case "TooManyVPCAssociationAuthorizations": + case "com.amazonaws.route53#TooManyVPCAssociationAuthorizations": + throw await de_TooManyVPCAssociationAuthorizationsRes(parsedOutput, context); + case "KeySigningKeyInParentDSRecord": + case "com.amazonaws.route53#KeySigningKeyInParentDSRecord": + throw await de_KeySigningKeyInParentDSRecordRes(parsedOutput, context); + case "KeySigningKeyInUse": + case "com.amazonaws.route53#KeySigningKeyInUse": + throw await de_KeySigningKeyInUseRes(parsedOutput, context); + case "CidrCollectionInUseException": + case "com.amazonaws.route53#CidrCollectionInUseException": + throw await de_CidrCollectionInUseExceptionRes(parsedOutput, context); + case "HealthCheckInUse": + case "com.amazonaws.route53#HealthCheckInUse": + throw await de_HealthCheckInUseRes(parsedOutput, context); + case "HostedZoneNotEmpty": + case "com.amazonaws.route53#HostedZoneNotEmpty": + throw await de_HostedZoneNotEmptyRes(parsedOutput, context); + case "NoSuchQueryLoggingConfig": + case "com.amazonaws.route53#NoSuchQueryLoggingConfig": + throw await de_NoSuchQueryLoggingConfigRes(parsedOutput, context); + case "DelegationSetInUse": + case "com.amazonaws.route53#DelegationSetInUse": + throw await de_DelegationSetInUseRes(parsedOutput, context); + case "TrafficPolicyInUse": + case "com.amazonaws.route53#TrafficPolicyInUse": + throw await de_TrafficPolicyInUseRes(parsedOutput, context); case "NoSuchTrafficPolicyInstance": case "com.amazonaws.route53#NoSuchTrafficPolicyInstance": throw await de_NoSuchTrafficPolicyInstanceRes(parsedOutput, context); - case "PriorRequestNotComplete": - case "com.amazonaws.route53#PriorRequestNotComplete": - throw await de_PriorRequestNotCompleteRes(parsedOutput, context); + case "VPCAssociationAuthorizationNotFound": + case "com.amazonaws.route53#VPCAssociationAuthorizationNotFound": + throw await de_VPCAssociationAuthorizationNotFoundRes(parsedOutput, context); + case "DNSSECNotFound": + case "com.amazonaws.route53#DNSSECNotFound": + throw await de_DNSSECNotFoundRes(parsedOutput, context); + case "LastVPCAssociation": + case "com.amazonaws.route53#LastVPCAssociation": + throw await de_LastVPCAssociationRes(parsedOutput, context); + case "VPCAssociationNotFound": + case "com.amazonaws.route53#VPCAssociationNotFound": + throw await de_VPCAssociationNotFoundRes(parsedOutput, context); + case "HostedZonePartiallyDelegated": + case "com.amazonaws.route53#HostedZonePartiallyDelegated": + throw await de_HostedZonePartiallyDelegatedRes(parsedOutput, context); + case "KeySigningKeyWithActiveStatusNotFound": + case "com.amazonaws.route53#KeySigningKeyWithActiveStatusNotFound": + throw await de_KeySigningKeyWithActiveStatusNotFoundRes(parsedOutput, context); + case "NoSuchChange": + case "com.amazonaws.route53#NoSuchChange": + throw await de_NoSuchChangeRes(parsedOutput, context); + case "NoSuchGeoLocation": + case "com.amazonaws.route53#NoSuchGeoLocation": + throw await de_NoSuchGeoLocationRes(parsedOutput, context); + case "IncompatibleVersion": + case "com.amazonaws.route53#IncompatibleVersion": + throw await de_IncompatibleVersionRes(parsedOutput, context); + case "HostedZoneNotPrivate": + case "com.amazonaws.route53#HostedZoneNotPrivate": + throw await de_HostedZoneNotPrivateRes(parsedOutput, context); + case "NoSuchCidrLocationException": + case "com.amazonaws.route53#NoSuchCidrLocationException": + throw await de_NoSuchCidrLocationExceptionRes(parsedOutput, context); + case "InvalidPaginationToken": + case "com.amazonaws.route53#InvalidPaginationToken": + throw await de_InvalidPaginationTokenRes(parsedOutput, context); + case "HealthCheckVersionMismatch": + case "com.amazonaws.route53#HealthCheckVersionMismatch": + throw await de_HealthCheckVersionMismatchRes(parsedOutput, context); + case "ConflictingTypes": + case "com.amazonaws.route53#ConflictingTypes": + throw await de_ConflictingTypesRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody: parsedBody.Error, errorCode, - }); + }) as never; } }; diff --git a/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts b/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts index efd735c3e13f..3f171f9f9575 100644 --- a/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts +++ b/clients/client-route53-recovery-cluster/src/protocols/Aws_json1_0.ts @@ -106,7 +106,7 @@ export const de_GetRoutingControlStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRoutingControlStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -118,47 +118,6 @@ export const de_GetRoutingControlStateCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetRoutingControlStateCommandError - */ -const de_GetRoutingControlStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycluster#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EndpointTemporarilyUnavailableException": - case "com.amazonaws.route53recoverycluster#EndpointTemporarilyUnavailableException": - throw await de_EndpointTemporarilyUnavailableExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycluster#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycluster#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycluster#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycluster#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListRoutingControlsCommand */ @@ -167,7 +126,7 @@ export const de_ListRoutingControlsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRoutingControlsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -179,47 +138,6 @@ export const de_ListRoutingControlsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListRoutingControlsCommandError - */ -const de_ListRoutingControlsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycluster#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "EndpointTemporarilyUnavailableException": - case "com.amazonaws.route53recoverycluster#EndpointTemporarilyUnavailableException": - throw await de_EndpointTemporarilyUnavailableExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycluster#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycluster#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycluster#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycluster#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateRoutingControlStateCommand */ @@ -228,7 +146,7 @@ export const de_UpdateRoutingControlStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRoutingControlStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -240,50 +158,6 @@ export const de_UpdateRoutingControlStateCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateRoutingControlStateCommandError - */ -const de_UpdateRoutingControlStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycluster#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoverycluster#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "EndpointTemporarilyUnavailableException": - case "com.amazonaws.route53recoverycluster#EndpointTemporarilyUnavailableException": - throw await de_EndpointTemporarilyUnavailableExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycluster#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycluster#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycluster#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycluster#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateRoutingControlStatesCommand */ @@ -292,7 +166,7 @@ export const de_UpdateRoutingControlStatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRoutingControlStatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -305,12 +179,9 @@ export const de_UpdateRoutingControlStatesCommand = async ( }; /** - * deserializeAws_json1_0UpdateRoutingControlStatesCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateRoutingControlStatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -320,9 +191,6 @@ const de_UpdateRoutingControlStatesCommandError = async ( case "AccessDeniedException": case "com.amazonaws.route53recoverycluster#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoverycluster#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "EndpointTemporarilyUnavailableException": case "com.amazonaws.route53recoverycluster#EndpointTemporarilyUnavailableException": throw await de_EndpointTemporarilyUnavailableExceptionRes(parsedOutput, context); @@ -332,22 +200,25 @@ const de_UpdateRoutingControlStatesCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.route53recoverycluster#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceLimitExceededException": - case "com.amazonaws.route53recoverycluster#ServiceLimitExceededException": - throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.route53recoverycluster#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.route53recoverycluster#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.route53recoverycluster#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceLimitExceededException": + case "com.amazonaws.route53recoverycluster#ServiceLimitExceededException": + throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts b/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts index 7e4fc0344e27..6738002847d1 100644 --- a/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts +++ b/clients/client-route53-recovery-control-config/src/protocols/Aws_restJson1.ts @@ -565,7 +565,7 @@ export const de_CreateClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -578,50 +578,6 @@ export const de_CreateClusterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateClusterCommandError - */ -const de_CreateClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoverycontrolconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.route53recoverycontrolconfig#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateControlPanelCommand */ @@ -630,7 +586,7 @@ export const de_CreateControlPanelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateControlPanelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -643,50 +599,6 @@ export const de_CreateControlPanelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateControlPanelCommandError - */ -const de_CreateControlPanelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoverycontrolconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.route53recoverycontrolconfig#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRoutingControlCommand */ @@ -695,7 +607,7 @@ export const de_CreateRoutingControlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRoutingControlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -708,50 +620,6 @@ export const de_CreateRoutingControlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRoutingControlCommandError - */ -const de_CreateRoutingControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoverycontrolconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.route53recoverycontrolconfig#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSafetyRuleCommand */ @@ -760,7 +628,7 @@ export const de_CreateSafetyRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSafetyRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -774,35 +642,6 @@ export const de_CreateSafetyRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSafetyRuleCommandError - */ -const de_CreateSafetyRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteClusterCommand */ @@ -811,7 +650,7 @@ export const de_DeleteClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteClusterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -820,47 +659,6 @@ export const de_DeleteClusterCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteClusterCommandError - */ -const de_DeleteClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoverycontrolconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteControlPanelCommand */ @@ -869,7 +667,7 @@ export const de_DeleteControlPanelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteControlPanelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -878,47 +676,6 @@ export const de_DeleteControlPanelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteControlPanelCommandError - */ -const de_DeleteControlPanelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoverycontrolconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRoutingControlCommand */ @@ -927,7 +684,7 @@ export const de_DeleteRoutingControlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRoutingControlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -936,218 +693,63 @@ export const de_DeleteRoutingControlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRoutingControlCommandError - */ -const de_DeleteRoutingControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoverycontrolconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSafetyRuleCommand */ export const de_DeleteSafetyRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSafetyRuleCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSafetyRuleCommandError - */ -const de_DeleteSafetyRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeClusterCommand - */ -export const de_DescribeClusterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeClusterCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Cluster: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeClusterCommandError - */ -const de_DescribeClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoverycontrolconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DescribeControlPanelCommand + * deserializeAws_restJson1DescribeClusterCommand */ -export const de_DescribeControlPanelCommand = async ( +export const de_DescribeClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeControlPanelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ControlPanel: _json, + Cluster: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeControlPanelCommandError + * deserializeAws_restJson1DescribeControlPanelCommand */ -const de_DescribeControlPanelCommandError = async ( +export const de_DescribeControlPanelCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoverycontrolconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ControlPanel: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1158,7 +760,7 @@ export const de_DescribeRoutingControlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRoutingControlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1171,47 +773,6 @@ export const de_DescribeRoutingControlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeRoutingControlCommandError - */ -const de_DescribeRoutingControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoverycontrolconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeSafetyRuleCommand */ @@ -1220,7 +781,7 @@ export const de_DescribeSafetyRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSafetyRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1234,35 +795,6 @@ export const de_DescribeSafetyRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeSafetyRuleCommandError - */ -const de_DescribeSafetyRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetResourcePolicyCommand */ @@ -1271,7 +803,7 @@ export const de_GetResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1284,35 +816,6 @@ export const de_GetResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetResourcePolicyCommandError - */ -const de_GetResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssociatedRoute53HealthChecksCommand */ @@ -1321,7 +824,7 @@ export const de_ListAssociatedRoute53HealthChecksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssociatedRoute53HealthChecksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1335,38 +838,6 @@ export const de_ListAssociatedRoute53HealthChecksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssociatedRoute53HealthChecksCommandError - */ -const de_ListAssociatedRoute53HealthChecksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListClustersCommand */ @@ -1375,7 +846,7 @@ export const de_ListClustersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListClustersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1389,44 +860,6 @@ export const de_ListClustersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListClustersCommandError - */ -const de_ListClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListControlPanelsCommand */ @@ -1435,56 +868,18 @@ export const de_ListControlPanelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListControlPanelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ControlPanels: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListControlPanelsCommandError - */ -const de_ListControlPanelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ControlPanels: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1495,7 +890,7 @@ export const de_ListRoutingControlsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRoutingControlsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1509,44 +904,6 @@ export const de_ListRoutingControlsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRoutingControlsCommandError - */ -const de_ListRoutingControlsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSafetyRulesCommand */ @@ -1555,7 +912,7 @@ export const de_ListSafetyRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSafetyRulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1569,44 +926,6 @@ export const de_ListSafetyRulesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSafetyRulesCommandError - */ -const de_ListSafetyRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1615,7 +934,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1628,38 +947,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1668,7 +955,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1677,38 +964,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1717,7 +972,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1726,38 +981,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateControlPanelCommand */ @@ -1766,7 +989,7 @@ export const de_UpdateControlPanelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateControlPanelCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1779,47 +1002,6 @@ export const de_UpdateControlPanelCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateControlPanelCommandError - */ -const de_UpdateControlPanelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoverycontrolconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRoutingControlCommand */ @@ -1828,7 +1010,7 @@ export const de_UpdateRoutingControlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRoutingControlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1841,47 +1023,6 @@ export const de_UpdateRoutingControlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRoutingControlCommandError - */ -const de_UpdateRoutingControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoverycontrolconfig#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoverycontrolconfig#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSafetyRuleCommand */ @@ -1890,7 +1031,7 @@ export const de_UpdateSafetyRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSafetyRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1905,24 +1046,33 @@ export const de_UpdateSafetyRuleCommand = async ( }; /** - * deserializeAws_restJson1UpdateSafetyRuleCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateSafetyRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.route53recoverycontrolconfig#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.route53recoverycontrolconfig#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.route53recoverycontrolconfig#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.route53recoverycontrolconfig#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.route53recoverycontrolconfig#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.route53recoverycontrolconfig#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.route53recoverycontrolconfig#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); @@ -1932,7 +1082,7 @@ const de_UpdateSafetyRuleCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts b/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts index 5841dbdc60ab..439e8131c8bf 100644 --- a/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts +++ b/clients/client-route53-recovery-readiness/src/protocols/Aws_restJson1.ts @@ -767,7 +767,7 @@ export const de_CreateCellCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCellCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -784,44 +784,6 @@ export const de_CreateCellCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCellCommandError - */ -const de_CreateCellCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoveryreadiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCrossAccountAuthorizationCommand */ @@ -830,7 +792,7 @@ export const de_CreateCrossAccountAuthorizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCrossAccountAuthorizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -843,44 +805,6 @@ export const de_CreateCrossAccountAuthorizationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCrossAccountAuthorizationCommandError - */ -const de_CreateCrossAccountAuthorizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoveryreadiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateReadinessCheckCommand */ @@ -889,7 +813,7 @@ export const de_CreateReadinessCheckCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateReadinessCheckCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -905,44 +829,6 @@ export const de_CreateReadinessCheckCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateReadinessCheckCommandError - */ -const de_CreateReadinessCheckCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoveryreadiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRecoveryGroupCommand */ @@ -951,7 +837,7 @@ export const de_CreateRecoveryGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateRecoveryGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -967,44 +853,6 @@ export const de_CreateRecoveryGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRecoveryGroupCommandError - */ -const de_CreateRecoveryGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoveryreadiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateResourceSetCommand */ @@ -1013,7 +861,7 @@ export const de_CreateResourceSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateResourceSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1030,44 +878,6 @@ export const de_CreateResourceSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateResourceSetCommandError - */ -const de_CreateResourceSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53recoveryreadiness#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteCellCommand */ @@ -1076,7 +886,7 @@ export const de_DeleteCellCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteCellCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1085,44 +895,6 @@ export const de_DeleteCellCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteCellCommandError - */ -const de_DeleteCellCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteCrossAccountAuthorizationCommand */ @@ -1131,7 +903,7 @@ export const de_DeleteCrossAccountAuthorizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCrossAccountAuthorizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1141,49 +913,31 @@ export const de_DeleteCrossAccountAuthorizationCommand = async ( }; /** - * deserializeAws_restJson1DeleteCrossAccountAuthorizationCommandError + * deserializeAws_restJson1DeleteReadinessCheckCommand */ -const de_DeleteCrossAccountAuthorizationCommandError = async ( +export const de_DeleteReadinessCheckCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteReadinessCheckCommand + * deserializeAws_restJson1DeleteRecoveryGroupCommand */ -export const de_DeleteReadinessCheckCommand = async ( +export const de_DeleteRecoveryGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteReadinessCheckCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1193,107 +947,14 @@ export const de_DeleteReadinessCheckCommand = async ( }; /** - * deserializeAws_restJson1DeleteReadinessCheckCommandError + * deserializeAws_restJson1DeleteResourceSetCommand */ -const de_DeleteReadinessCheckCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteRecoveryGroupCommand - */ -export const de_DeleteRecoveryGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRecoveryGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteRecoveryGroupCommandError - */ -const de_DeleteRecoveryGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteResourceSetCommand - */ -export const de_DeleteResourceSetCommand = async ( +export const de_DeleteResourceSetCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteResourceSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1302,44 +963,6 @@ export const de_DeleteResourceSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteResourceSetCommandError - */ -const de_DeleteResourceSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetArchitectureRecommendationsCommand */ @@ -1348,7 +971,7 @@ export const de_GetArchitectureRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetArchitectureRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1363,44 +986,6 @@ export const de_GetArchitectureRecommendationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetArchitectureRecommendationsCommandError - */ -const de_GetArchitectureRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCellCommand */ @@ -1409,7 +994,7 @@ export const de_GetCellCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCellCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1426,599 +1011,133 @@ export const de_GetCellCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCellCommandError - */ -const de_GetCellCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCellReadinessSummaryCommand */ export const de_GetCellReadinessSummaryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCellReadinessSummaryCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: [, __expectString, `nextToken`], - Readiness: [, __expectString, `readiness`], - ReadinessChecks: [, (_) => de___listOfReadinessCheckSummary(_, context), `readinessChecks`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetCellReadinessSummaryCommandError - */ -const de_GetCellReadinessSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetReadinessCheckCommand - */ -export const de_GetReadinessCheckCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReadinessCheckCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ReadinessCheckArn: [, __expectString, `readinessCheckArn`], - ReadinessCheckName: [, __expectString, `readinessCheckName`], - ResourceSet: [, __expectString, `resourceSet`], - Tags: [, _json, `tags`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetReadinessCheckCommandError - */ -const de_GetReadinessCheckCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetReadinessCheckResourceStatusCommand - */ -export const de_GetReadinessCheckResourceStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReadinessCheckResourceStatusCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: [, __expectString, `nextToken`], - Readiness: [, __expectString, `readiness`], - Rules: [, (_) => de___listOfRuleResult(_, context), `rules`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetReadinessCheckResourceStatusCommandError - */ -const de_GetReadinessCheckResourceStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetReadinessCheckStatusCommand - */ -export const de_GetReadinessCheckStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReadinessCheckStatusCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Messages: [, (_) => de___listOfMessage(_, context), `messages`], - NextToken: [, __expectString, `nextToken`], - Readiness: [, __expectString, `readiness`], - Resources: [, (_) => de___listOfResourceResult(_, context), `resources`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetReadinessCheckStatusCommandError - */ -const de_GetReadinessCheckStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRecoveryGroupCommand - */ -export const de_GetRecoveryGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRecoveryGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Cells: [, _json, `cells`], - RecoveryGroupArn: [, __expectString, `recoveryGroupArn`], - RecoveryGroupName: [, __expectString, `recoveryGroupName`], - Tags: [, _json, `tags`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRecoveryGroupCommandError - */ -const de_GetRecoveryGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetRecoveryGroupReadinessSummaryCommand - */ -export const de_GetRecoveryGroupReadinessSummaryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRecoveryGroupReadinessSummaryCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: [, __expectString, `nextToken`], - Readiness: [, __expectString, `readiness`], - ReadinessChecks: [, (_) => de___listOfReadinessCheckSummary(_, context), `readinessChecks`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetRecoveryGroupReadinessSummaryCommandError - */ -const de_GetRecoveryGroupReadinessSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetResourceSetCommand - */ -export const de_GetResourceSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourceSetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ResourceSetArn: [, __expectString, `resourceSetArn`], - ResourceSetName: [, __expectString, `resourceSetName`], - ResourceSetType: [, __expectString, `resourceSetType`], - Resources: [, (_) => de___listOfResource(_, context), `resources`], - Tags: [, _json, `tags`], - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetResourceSetCommandError - */ -const de_GetResourceSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: [, __expectString, `nextToken`], + Readiness: [, __expectString, `readiness`], + ReadinessChecks: [, (_) => de___listOfReadinessCheckSummary(_, context), `readinessChecks`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListCellsCommand + * deserializeAws_restJson1GetReadinessCheckCommand */ -export const de_ListCellsCommand = async ( +export const de_GetReadinessCheckCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCellsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Cells: [, (_) => de___listOfCellOutput(_, context), `cells`], - NextToken: [, __expectString, `nextToken`], + ReadinessCheckArn: [, __expectString, `readinessCheckArn`], + ReadinessCheckName: [, __expectString, `readinessCheckName`], + ResourceSet: [, __expectString, `resourceSet`], + Tags: [, _json, `tags`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListCellsCommandError + * deserializeAws_restJson1GetReadinessCheckResourceStatusCommand */ -const de_ListCellsCommandError = async ( +export const de_GetReadinessCheckResourceStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: [, __expectString, `nextToken`], + Readiness: [, __expectString, `readiness`], + Rules: [, (_) => de___listOfRuleResult(_, context), `rules`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListCrossAccountAuthorizationsCommand + * deserializeAws_restJson1GetReadinessCheckStatusCommand */ -export const de_ListCrossAccountAuthorizationsCommand = async ( +export const de_GetReadinessCheckStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCrossAccountAuthorizationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CrossAccountAuthorizations: [, _json, `crossAccountAuthorizations`], + Messages: [, (_) => de___listOfMessage(_, context), `messages`], NextToken: [, __expectString, `nextToken`], + Readiness: [, __expectString, `readiness`], + Resources: [, (_) => de___listOfResourceResult(_, context), `resources`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListCrossAccountAuthorizationsCommandError + * deserializeAws_restJson1GetRecoveryGroupCommand */ -const de_ListCrossAccountAuthorizationsCommandError = async ( +export const de_GetRecoveryGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Cells: [, _json, `cells`], + RecoveryGroupArn: [, __expectString, `recoveryGroupArn`], + RecoveryGroupName: [, __expectString, `recoveryGroupName`], + Tags: [, _json, `tags`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListReadinessChecksCommand + * deserializeAws_restJson1GetRecoveryGroupReadinessSummaryCommand */ -export const de_ListReadinessChecksCommand = async ( +export const de_GetRecoveryGroupReadinessSummaryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReadinessChecksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2026,113 +1145,91 @@ export const de_ListReadinessChecksCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { NextToken: [, __expectString, `nextToken`], - ReadinessChecks: [, (_) => de___listOfReadinessCheckOutput(_, context), `readinessChecks`], + Readiness: [, __expectString, `readiness`], + ReadinessChecks: [, (_) => de___listOfReadinessCheckSummary(_, context), `readinessChecks`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListReadinessChecksCommandError + * deserializeAws_restJson1GetResourceSetCommand */ -const de_ListReadinessChecksCommandError = async ( +export const de_GetResourceSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ResourceSetArn: [, __expectString, `resourceSetArn`], + ResourceSetName: [, __expectString, `resourceSetName`], + ResourceSetType: [, __expectString, `resourceSetType`], + Resources: [, (_) => de___listOfResource(_, context), `resources`], + Tags: [, _json, `tags`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRecoveryGroupsCommand + * deserializeAws_restJson1ListCellsCommand */ -export const de_ListRecoveryGroupsCommand = async ( +export const de_ListCellsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecoveryGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + Cells: [, (_) => de___listOfCellOutput(_, context), `cells`], NextToken: [, __expectString, `nextToken`], - RecoveryGroups: [, (_) => de___listOfRecoveryGroupOutput(_, context), `recoveryGroups`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRecoveryGroupsCommandError + * deserializeAws_restJson1ListCrossAccountAuthorizationsCommand */ -const de_ListRecoveryGroupsCommandError = async ( +export const de_ListCrossAccountAuthorizationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CrossAccountAuthorizations: [, _json, `crossAccountAuthorizations`], + NextToken: [, __expectString, `nextToken`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListResourceSetsCommand + * deserializeAws_restJson1ListReadinessChecksCommand */ -export const de_ListResourceSetsCommand = async ( +export const de_ListReadinessChecksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResourceSetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2140,56 +1237,43 @@ export const de_ListResourceSetsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { NextToken: [, __expectString, `nextToken`], - ResourceSets: [, (_) => de___listOfResourceSetOutput(_, context), `resourceSets`], + ReadinessChecks: [, (_) => de___listOfReadinessCheckOutput(_, context), `readinessChecks`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListResourceSetsCommandError + * deserializeAws_restJson1ListRecoveryGroupsCommand */ -const de_ListResourceSetsCommandError = async ( +export const de_ListRecoveryGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: [, __expectString, `nextToken`], + RecoveryGroups: [, (_) => de___listOfRecoveryGroupOutput(_, context), `recoveryGroups`], + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRulesCommand + * deserializeAws_restJson1ListResourceSetsCommand */ -export const de_ListRulesCommand = async ( +export const de_ListResourceSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2197,45 +1281,32 @@ export const de_ListRulesCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { NextToken: [, __expectString, `nextToken`], - Rules: [, (_) => de___listOfListRulesOutput(_, context), `rules`], + ResourceSets: [, (_) => de___listOfResourceSetOutput(_, context), `resourceSets`], }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRulesCommandError + * deserializeAws_restJson1ListRulesCommand */ -const de_ListRulesCommandError = async ( +export const de_ListRulesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: [, __expectString, `nextToken`], + Rules: [, (_) => de___listOfListRulesOutput(_, context), `rules`], + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2246,7 +1317,7 @@ export const de_ListTagsForResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2259,38 +1330,6 @@ export const de_ListTagsForResourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourcesCommandError - */ -const de_ListTagsForResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2299,7 +1338,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2308,38 +1347,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2348,7 +1355,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2357,38 +1364,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateCellCommand */ @@ -2397,7 +1372,7 @@ export const de_UpdateCellCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCellCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2414,44 +1389,6 @@ export const de_UpdateCellCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateCellCommandError - */ -const de_UpdateCellCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateReadinessCheckCommand */ @@ -2460,7 +1397,7 @@ export const de_UpdateReadinessCheckCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateReadinessCheckCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2476,44 +1413,6 @@ export const de_UpdateReadinessCheckCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateReadinessCheckCommandError - */ -const de_UpdateReadinessCheckCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRecoveryGroupCommand */ @@ -2522,7 +1421,7 @@ export const de_UpdateRecoveryGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRecoveryGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2538,44 +1437,6 @@ export const de_UpdateRecoveryGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRecoveryGroupCommandError - */ -const de_UpdateRecoveryGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.route53recoveryreadiness#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53recoveryreadiness#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53recoveryreadiness#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateResourceSetCommand */ @@ -2584,7 +1445,7 @@ export const de_UpdateResourceSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateResourceSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2602,12 +1463,9 @@ export const de_UpdateResourceSetCommand = async ( }; /** - * deserializeAws_restJson1UpdateResourceSetCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateResourceSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2617,25 +1475,28 @@ const de_UpdateResourceSetCommandError = async ( case "AccessDeniedException": case "com.amazonaws.route53recoveryreadiness#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.route53recoveryreadiness#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.route53recoveryreadiness#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.route53recoveryreadiness#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.route53recoveryreadiness#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.route53recoveryreadiness#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-route53resolver/src/protocols/Aws_json1_1.ts b/clients/client-route53resolver/src/protocols/Aws_json1_1.ts index 190ba1467913..c5a3ef5f9c78 100644 --- a/clients/client-route53resolver/src/protocols/Aws_json1_1.ts +++ b/clients/client-route53resolver/src/protocols/Aws_json1_1.ts @@ -1234,7 +1234,7 @@ export const de_AssociateFirewallRuleGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateFirewallRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1246,50 +1246,6 @@ export const de_AssociateFirewallRuleGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateFirewallRuleGroupCommandError - */ -const de_AssociateFirewallRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53resolver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.route53resolver#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateResolverEndpointIpAddressCommand */ @@ -1298,7 +1254,7 @@ export const de_AssociateResolverEndpointIpAddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateResolverEndpointIpAddressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1310,50 +1266,6 @@ export const de_AssociateResolverEndpointIpAddressCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateResolverEndpointIpAddressCommandError - */ -const de_AssociateResolverEndpointIpAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.route53resolver#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.route53resolver#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateResolverQueryLogConfigCommand */ @@ -1362,7 +1274,7 @@ export const de_AssociateResolverQueryLogConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateResolverQueryLogConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1374,53 +1286,6 @@ export const de_AssociateResolverQueryLogConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateResolverQueryLogConfigCommandError - */ -const de_AssociateResolverQueryLogConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.route53resolver#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.route53resolver#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateResolverRuleCommand */ @@ -1429,7 +1294,7 @@ export const de_AssociateResolverRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateResolverRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1441,53 +1306,6 @@ export const de_AssociateResolverRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateResolverRuleCommandError - */ -const de_AssociateResolverRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.route53resolver#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.route53resolver#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.route53resolver#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateFirewallDomainListCommand */ @@ -1496,7 +1314,7 @@ export const de_CreateFirewallDomainListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFirewallDomainListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1508,44 +1326,6 @@ export const de_CreateFirewallDomainListCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateFirewallDomainListCommandError - */ -const de_CreateFirewallDomainListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.route53resolver#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateFirewallRuleCommand */ @@ -1554,7 +1334,7 @@ export const de_CreateFirewallRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFirewallRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1566,47 +1346,6 @@ export const de_CreateFirewallRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateFirewallRuleCommandError - */ -const de_CreateFirewallRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.route53resolver#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateFirewallRuleGroupCommand */ @@ -1615,7 +1354,7 @@ export const de_CreateFirewallRuleGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFirewallRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1628,52 +1367,14 @@ export const de_CreateFirewallRuleGroupCommand = async ( }; /** - * deserializeAws_json1_1CreateFirewallRuleGroupCommandError + * deserializeAws_json1_1CreateOutpostResolverCommand */ -const de_CreateFirewallRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.route53resolver#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateOutpostResolverCommand - */ -export const de_CreateOutpostResolverCommand = async ( +export const de_CreateOutpostResolverCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateOutpostResolverCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1685,47 +1386,6 @@ export const de_CreateOutpostResolverCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateOutpostResolverCommandError - */ -const de_CreateOutpostResolverCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.route53resolver#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateResolverEndpointCommand */ @@ -1734,7 +1394,7 @@ export const de_CreateResolverEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateResolverEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1746,53 +1406,6 @@ export const de_CreateResolverEndpointCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateResolverEndpointCommandError - */ -const de_CreateResolverEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.route53resolver#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.route53resolver#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateResolverQueryLogConfigCommand */ @@ -1801,7 +1414,7 @@ export const de_CreateResolverQueryLogConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateResolverQueryLogConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1813,53 +1426,6 @@ export const de_CreateResolverQueryLogConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateResolverQueryLogConfigCommandError - */ -const de_CreateResolverQueryLogConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.route53resolver#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.route53resolver#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateResolverRuleCommand */ @@ -1868,7 +1434,7 @@ export const de_CreateResolverRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateResolverRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1880,56 +1446,6 @@ export const de_CreateResolverRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateResolverRuleCommandError - */ -const de_CreateResolverRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.route53resolver#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.route53resolver#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.route53resolver#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteFirewallDomainListCommand */ @@ -1938,7 +1454,7 @@ export const de_DeleteFirewallDomainListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteFirewallDomainListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1951,57 +1467,39 @@ export const de_DeleteFirewallDomainListCommand = async ( }; /** - * deserializeAws_json1_1DeleteFirewallDomainListCommandError + * deserializeAws_json1_1DeleteFirewallRuleCommand */ -const de_DeleteFirewallDomainListCommandError = async ( +export const de_DeleteFirewallRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53resolver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteFirewallRuleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteFirewallRuleCommand + * deserializeAws_json1_1DeleteFirewallRuleGroupCommand */ -export const de_DeleteFirewallRuleCommand = async ( +export const de_DeleteFirewallRuleGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteFirewallRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteFirewallRuleCommandOutput = { + const response: DeleteFirewallRuleGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2009,54 +1507,39 @@ export const de_DeleteFirewallRuleCommand = async ( }; /** - * deserializeAws_json1_1DeleteFirewallRuleCommandError + * deserializeAws_json1_1DeleteOutpostResolverCommand */ -const de_DeleteFirewallRuleCommandError = async ( +export const de_DeleteOutpostResolverCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteOutpostResolverCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteFirewallRuleGroupCommand + * deserializeAws_json1_1DeleteResolverEndpointCommand */ -export const de_DeleteFirewallRuleGroupCommand = async ( +export const de_DeleteResolverEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteFirewallRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteFirewallRuleGroupCommandOutput = { + const response: DeleteResolverEndpointCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2064,60 +1547,39 @@ export const de_DeleteFirewallRuleGroupCommand = async ( }; /** - * deserializeAws_json1_1DeleteFirewallRuleGroupCommandError + * deserializeAws_json1_1DeleteResolverQueryLogConfigCommand */ -const de_DeleteFirewallRuleGroupCommandError = async ( +export const de_DeleteResolverQueryLogConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53resolver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteResolverQueryLogConfigCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteOutpostResolverCommand + * deserializeAws_json1_1DeleteResolverRuleCommand */ -export const de_DeleteOutpostResolverCommand = async ( +export const de_DeleteResolverRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteOutpostResolverCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteOutpostResolverCommandOutput = { + const response: DeleteResolverRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2125,60 +1587,39 @@ export const de_DeleteOutpostResolverCommand = async ( }; /** - * deserializeAws_json1_1DeleteOutpostResolverCommandError + * deserializeAws_json1_1DisassociateFirewallRuleGroupCommand */ -const de_DeleteOutpostResolverCommandError = async ( +export const de_DisassociateFirewallRuleGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53resolver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisassociateFirewallRuleGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteResolverEndpointCommand + * deserializeAws_json1_1DisassociateResolverEndpointIpAddressCommand */ -export const de_DeleteResolverEndpointCommand = async ( +export const de_DisassociateResolverEndpointIpAddressCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteResolverEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteResolverEndpointCommandOutput = { + const response: DisassociateResolverEndpointIpAddressCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2186,57 +1627,39 @@ export const de_DeleteResolverEndpointCommand = async ( }; /** - * deserializeAws_json1_1DeleteResolverEndpointCommandError + * deserializeAws_json1_1DisassociateResolverQueryLogConfigCommand */ -const de_DeleteResolverEndpointCommandError = async ( +export const de_DisassociateResolverQueryLogConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisassociateResolverQueryLogConfigCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteResolverQueryLogConfigCommand + * deserializeAws_json1_1DisassociateResolverRuleCommand */ -export const de_DeleteResolverQueryLogConfigCommand = async ( +export const de_DisassociateResolverRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteResolverQueryLogConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteResolverQueryLogConfigCommandOutput = { + const response: DisassociateResolverRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2244,60 +1667,39 @@ export const de_DeleteResolverQueryLogConfigCommand = async ( }; /** - * deserializeAws_json1_1DeleteResolverQueryLogConfigCommandError + * deserializeAws_json1_1GetFirewallConfigCommand */ -const de_DeleteResolverQueryLogConfigCommandError = async ( +export const de_GetFirewallConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetFirewallConfigCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteResolverRuleCommand + * deserializeAws_json1_1GetFirewallDomainListCommand */ -export const de_DeleteResolverRuleCommand = async ( +export const de_GetFirewallDomainListCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteResolverRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteResolverRuleCommandOutput = { + const response: GetFirewallDomainListCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2305,57 +1707,39 @@ export const de_DeleteResolverRuleCommand = async ( }; /** - * deserializeAws_json1_1DeleteResolverRuleCommandError + * deserializeAws_json1_1GetFirewallRuleGroupCommand */ -const de_DeleteResolverRuleCommandError = async ( +export const de_GetFirewallRuleGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetFirewallRuleGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.route53resolver#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1DisassociateFirewallRuleGroupCommand + * deserializeAws_json1_1GetFirewallRuleGroupAssociationCommand */ -export const de_DisassociateFirewallRuleGroupCommand = async ( +export const de_GetFirewallRuleGroupAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateFirewallRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateFirewallRuleGroupCommandOutput = { + const response: GetFirewallRuleGroupAssociationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2363,60 +1747,19 @@ export const de_DisassociateFirewallRuleGroupCommand = async ( }; /** - * deserializeAws_json1_1DisassociateFirewallRuleGroupCommandError - */ -const de_DisassociateFirewallRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53resolver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociateResolverEndpointIpAddressCommand + * deserializeAws_json1_1GetFirewallRuleGroupPolicyCommand */ -export const de_DisassociateResolverEndpointIpAddressCommand = async ( +export const de_GetFirewallRuleGroupPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateResolverEndpointIpAddressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateResolverEndpointIpAddressCommandOutput = { + const response: GetFirewallRuleGroupPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2424,60 +1767,19 @@ export const de_DisassociateResolverEndpointIpAddressCommand = async ( }; /** - * deserializeAws_json1_1DisassociateResolverEndpointIpAddressCommandError - */ -const de_DisassociateResolverEndpointIpAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.route53resolver#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociateResolverQueryLogConfigCommand + * deserializeAws_json1_1GetOutpostResolverCommand */ -export const de_DisassociateResolverQueryLogConfigCommand = async ( +export const de_GetOutpostResolverCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateResolverQueryLogConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateResolverQueryLogConfigCommandOutput = { + const response: GetOutpostResolverCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2485,60 +1787,19 @@ export const de_DisassociateResolverQueryLogConfigCommand = async ( }; /** - * deserializeAws_json1_1DisassociateResolverQueryLogConfigCommandError - */ -const de_DisassociateResolverQueryLogConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociateResolverRuleCommand + * deserializeAws_json1_1GetResolverConfigCommand */ -export const de_DisassociateResolverRuleCommand = async ( +export const de_GetResolverConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateResolverRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateResolverRuleCommandOutput = { + const response: GetResolverConfigCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2546,54 +1807,19 @@ export const de_DisassociateResolverRuleCommand = async ( }; /** - * deserializeAws_json1_1DisassociateResolverRuleCommandError - */ -const de_DisassociateResolverRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetFirewallConfigCommand + * deserializeAws_json1_1GetResolverDnssecConfigCommand */ -export const de_GetFirewallConfigCommand = async ( +export const de_GetResolverDnssecConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetFirewallConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetFirewallConfigCommandOutput = { + const response: GetResolverDnssecConfigCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2601,57 +1827,39 @@ export const de_GetFirewallConfigCommand = async ( }; /** - * deserializeAws_json1_1GetFirewallConfigCommandError + * deserializeAws_json1_1GetResolverEndpointCommand */ -const de_GetFirewallConfigCommandError = async ( +export const de_GetResolverEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetResolverEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetFirewallDomainListCommand + * deserializeAws_json1_1GetResolverQueryLogConfigCommand */ -export const de_GetFirewallDomainListCommand = async ( +export const de_GetResolverQueryLogConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetFirewallDomainListCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetFirewallDomainListCommandOutput = { + const response: GetResolverQueryLogConfigCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2659,1324 +1867,39 @@ export const de_GetFirewallDomainListCommand = async ( }; /** - * deserializeAws_json1_1GetFirewallDomainListCommandError + * deserializeAws_json1_1GetResolverQueryLogConfigAssociationCommand */ -const de_GetFirewallDomainListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetFirewallRuleGroupCommand - */ -export const de_GetFirewallRuleGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetFirewallRuleGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetFirewallRuleGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetFirewallRuleGroupCommandError - */ -const de_GetFirewallRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetFirewallRuleGroupAssociationCommand - */ -export const de_GetFirewallRuleGroupAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetFirewallRuleGroupAssociationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetFirewallRuleGroupAssociationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetFirewallRuleGroupAssociationCommandError - */ -const de_GetFirewallRuleGroupAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetFirewallRuleGroupPolicyCommand - */ -export const de_GetFirewallRuleGroupPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetFirewallRuleGroupPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetFirewallRuleGroupPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetFirewallRuleGroupPolicyCommandError - */ -const de_GetFirewallRuleGroupPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetOutpostResolverCommand - */ -export const de_GetOutpostResolverCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetOutpostResolverCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetOutpostResolverCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetOutpostResolverCommandError - */ -const de_GetOutpostResolverCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetResolverConfigCommand - */ -export const de_GetResolverConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetResolverConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetResolverConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetResolverConfigCommandError - */ -const de_GetResolverConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetResolverDnssecConfigCommand - */ -export const de_GetResolverDnssecConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetResolverDnssecConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetResolverDnssecConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetResolverDnssecConfigCommandError - */ -const de_GetResolverDnssecConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetResolverEndpointCommand - */ -export const de_GetResolverEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetResolverEndpointCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetResolverEndpointCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetResolverEndpointCommandError - */ -const de_GetResolverEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetResolverQueryLogConfigCommand - */ -export const de_GetResolverQueryLogConfigCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetResolverQueryLogConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetResolverQueryLogConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetResolverQueryLogConfigCommandError - */ -const de_GetResolverQueryLogConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetResolverQueryLogConfigAssociationCommand - */ -export const de_GetResolverQueryLogConfigAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetResolverQueryLogConfigAssociationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetResolverQueryLogConfigAssociationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetResolverQueryLogConfigAssociationCommandError - */ -const de_GetResolverQueryLogConfigAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetResolverQueryLogConfigPolicyCommand - */ -export const de_GetResolverQueryLogConfigPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetResolverQueryLogConfigPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetResolverQueryLogConfigPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetResolverQueryLogConfigPolicyCommandError - */ -const de_GetResolverQueryLogConfigPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.route53resolver#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetResolverRuleCommand - */ -export const de_GetResolverRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetResolverRuleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetResolverRuleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetResolverRuleCommandError - */ -const de_GetResolverRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetResolverRuleAssociationCommand - */ -export const de_GetResolverRuleAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetResolverRuleAssociationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetResolverRuleAssociationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetResolverRuleAssociationCommandError - */ -const de_GetResolverRuleAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetResolverRulePolicyCommand - */ -export const de_GetResolverRulePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetResolverRulePolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetResolverRulePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetResolverRulePolicyCommandError - */ -const de_GetResolverRulePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.route53resolver#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ImportFirewallDomainsCommand - */ -export const de_ImportFirewallDomainsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ImportFirewallDomainsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ImportFirewallDomainsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ImportFirewallDomainsCommandError - */ -const de_ImportFirewallDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53resolver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.route53resolver#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListFirewallConfigsCommand - */ -export const de_ListFirewallConfigsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListFirewallConfigsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListFirewallConfigsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListFirewallConfigsCommandError - */ -const de_ListFirewallConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListFirewallDomainListsCommand - */ -export const de_ListFirewallDomainListsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListFirewallDomainListsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListFirewallDomainListsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListFirewallDomainListsCommandError - */ -const de_ListFirewallDomainListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListFirewallDomainsCommand - */ -export const de_ListFirewallDomainsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListFirewallDomainsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListFirewallDomainsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListFirewallDomainsCommandError - */ -const de_ListFirewallDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListFirewallRuleGroupAssociationsCommand - */ -export const de_ListFirewallRuleGroupAssociationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListFirewallRuleGroupAssociationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListFirewallRuleGroupAssociationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListFirewallRuleGroupAssociationsCommandError - */ -const de_ListFirewallRuleGroupAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListFirewallRuleGroupsCommand - */ -export const de_ListFirewallRuleGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListFirewallRuleGroupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListFirewallRuleGroupsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListFirewallRuleGroupsCommandError - */ -const de_ListFirewallRuleGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListFirewallRulesCommand - */ -export const de_ListFirewallRulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListFirewallRulesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListFirewallRulesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListFirewallRulesCommandError - */ -const de_ListFirewallRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListOutpostResolversCommand - */ -export const de_ListOutpostResolversCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListOutpostResolversCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListOutpostResolversCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListOutpostResolversCommandError - */ -const de_ListOutpostResolversCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListResolverConfigsCommand - */ -export const de_ListResolverConfigsCommand = async ( +export const de_GetResolverQueryLogConfigAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListResolverConfigsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListResolverConfigsCommandOutput = { + const response: GetResolverQueryLogConfigAssociationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; - return response; -}; - -/** - * deserializeAws_json1_1ListResolverConfigsCommandError - */ -const de_ListResolverConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.route53resolver#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1ListResolverDnssecConfigsCommand + * deserializeAws_json1_1GetResolverQueryLogConfigPolicyCommand */ -export const de_ListResolverDnssecConfigsCommand = async ( +export const de_GetResolverQueryLogConfigPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListResolverDnssecConfigsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListResolverDnssecConfigsCommandOutput = { + const response: GetResolverQueryLogConfigPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3984,60 +1907,39 @@ export const de_ListResolverDnssecConfigsCommand = async ( }; /** - * deserializeAws_json1_1ListResolverDnssecConfigsCommandError + * deserializeAws_json1_1GetResolverRuleCommand */ -const de_ListResolverDnssecConfigsCommandError = async ( +export const de_GetResolverRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.route53resolver#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetResolverRuleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListResolverEndpointIpAddressesCommand + * deserializeAws_json1_1GetResolverRuleAssociationCommand */ -export const de_ListResolverEndpointIpAddressesCommand = async ( +export const de_GetResolverRuleAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListResolverEndpointIpAddressesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListResolverEndpointIpAddressesCommandOutput = { + const response: GetResolverRuleAssociationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4045,57 +1947,39 @@ export const de_ListResolverEndpointIpAddressesCommand = async ( }; /** - * deserializeAws_json1_1ListResolverEndpointIpAddressesCommandError + * deserializeAws_json1_1GetResolverRulePolicyCommand */ -const de_ListResolverEndpointIpAddressesCommandError = async ( +export const de_GetResolverRulePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.route53resolver#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetResolverRulePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListResolverEndpointsCommand + * deserializeAws_json1_1ImportFirewallDomainsCommand */ -export const de_ListResolverEndpointsCommand = async ( +export const de_ImportFirewallDomainsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListResolverEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListResolverEndpointsCommandOutput = { + const response: ImportFirewallDomainsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4103,57 +1987,39 @@ export const de_ListResolverEndpointsCommand = async ( }; /** - * deserializeAws_json1_1ListResolverEndpointsCommandError + * deserializeAws_json1_1ListFirewallConfigsCommand */ -const de_ListResolverEndpointsCommandError = async ( +export const de_ListFirewallConfigsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.route53resolver#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListFirewallConfigsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListResolverQueryLogConfigAssociationsCommand + * deserializeAws_json1_1ListFirewallDomainListsCommand */ -export const de_ListResolverQueryLogConfigAssociationsCommand = async ( +export const de_ListFirewallDomainListsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListResolverQueryLogConfigAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListResolverQueryLogConfigAssociationsCommandOutput = { + const response: ListFirewallDomainListsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4161,60 +2027,39 @@ export const de_ListResolverQueryLogConfigAssociationsCommand = async ( }; /** - * deserializeAws_json1_1ListResolverQueryLogConfigAssociationsCommandError + * deserializeAws_json1_1ListFirewallDomainsCommand */ -const de_ListResolverQueryLogConfigAssociationsCommandError = async ( +export const de_ListFirewallDomainsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.route53resolver#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListFirewallDomainsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListResolverQueryLogConfigsCommand + * deserializeAws_json1_1ListFirewallRuleGroupAssociationsCommand */ -export const de_ListResolverQueryLogConfigsCommand = async ( +export const de_ListFirewallRuleGroupAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListResolverQueryLogConfigsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListResolverQueryLogConfigsCommandOutput = { + const response: ListFirewallRuleGroupAssociationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4222,60 +2067,59 @@ export const de_ListResolverQueryLogConfigsCommand = async ( }; /** - * deserializeAws_json1_1ListResolverQueryLogConfigsCommandError + * deserializeAws_json1_1ListFirewallRuleGroupsCommand */ -const de_ListResolverQueryLogConfigsCommandError = async ( +export const de_ListFirewallRuleGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListFirewallRuleGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.route53resolver#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1ListFirewallRulesCommand + */ +export const de_ListFirewallRulesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListFirewallRulesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListResolverRuleAssociationsCommand + * deserializeAws_json1_1ListOutpostResolversCommand */ -export const de_ListResolverRuleAssociationsCommand = async ( +export const de_ListOutpostResolversCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListResolverRuleAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListResolverRuleAssociationsCommandOutput = { + const response: ListOutpostResolversCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4283,57 +2127,39 @@ export const de_ListResolverRuleAssociationsCommand = async ( }; /** - * deserializeAws_json1_1ListResolverRuleAssociationsCommandError + * deserializeAws_json1_1ListResolverConfigsCommand */ -const de_ListResolverRuleAssociationsCommandError = async ( +export const de_ListResolverConfigsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.route53resolver#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListResolverConfigsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListResolverRulesCommand + * deserializeAws_json1_1ListResolverDnssecConfigsCommand */ -export const de_ListResolverRulesCommand = async ( +export const de_ListResolverDnssecConfigsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListResolverRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListResolverRulesCommandOutput = { + const response: ListResolverDnssecConfigsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4341,57 +2167,39 @@ export const de_ListResolverRulesCommand = async ( }; /** - * deserializeAws_json1_1ListResolverRulesCommandError + * deserializeAws_json1_1ListResolverEndpointIpAddressesCommand */ -const de_ListResolverRulesCommandError = async ( +export const de_ListResolverEndpointIpAddressesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.route53resolver#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListResolverEndpointIpAddressesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1ListResolverEndpointsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListResolverEndpointsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + const response: ListResolverEndpointsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4399,60 +2207,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1ListResolverQueryLogConfigAssociationsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListResolverQueryLogConfigAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.route53resolver#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListResolverQueryLogConfigAssociationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutFirewallRuleGroupPolicyCommand + * deserializeAws_json1_1ListResolverQueryLogConfigsCommand */ -export const de_PutFirewallRuleGroupPolicyCommand = async ( +export const de_ListResolverQueryLogConfigsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutFirewallRuleGroupPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutFirewallRuleGroupPolicyCommandOutput = { + const response: ListResolverQueryLogConfigsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4460,57 +2247,39 @@ export const de_PutFirewallRuleGroupPolicyCommand = async ( }; /** - * deserializeAws_json1_1PutFirewallRuleGroupPolicyCommandError + * deserializeAws_json1_1ListResolverRuleAssociationsCommand */ -const de_PutFirewallRuleGroupPolicyCommandError = async ( +export const de_ListResolverRuleAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListResolverRuleAssociationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutResolverQueryLogConfigPolicyCommand + * deserializeAws_json1_1ListResolverRulesCommand */ -export const de_PutResolverQueryLogConfigPolicyCommand = async ( +export const de_ListResolverRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutResolverQueryLogConfigPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutResolverQueryLogConfigPolicyCommandOutput = { + const response: ListResolverRulesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4518,60 +2287,39 @@ export const de_PutResolverQueryLogConfigPolicyCommand = async ( }; /** - * deserializeAws_json1_1PutResolverQueryLogConfigPolicyCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_PutResolverQueryLogConfigPolicyCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPolicyDocument": - case "com.amazonaws.route53resolver#InvalidPolicyDocument": - throw await de_InvalidPolicyDocumentRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.route53resolver#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutResolverRulePolicyCommand + * deserializeAws_json1_1PutFirewallRuleGroupPolicyCommand */ -export const de_PutResolverRulePolicyCommand = async ( +export const de_PutFirewallRuleGroupPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutResolverRulePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutResolverRulePolicyCommandOutput = { + const response: PutFirewallRuleGroupPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4579,57 +2327,39 @@ export const de_PutResolverRulePolicyCommand = async ( }; /** - * deserializeAws_json1_1PutResolverRulePolicyCommandError + * deserializeAws_json1_1PutResolverQueryLogConfigPolicyCommand */ -const de_PutResolverRulePolicyCommandError = async ( +export const de_PutResolverQueryLogConfigPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPolicyDocument": - case "com.amazonaws.route53resolver#InvalidPolicyDocument": - throw await de_InvalidPolicyDocumentRes(parsedOutput, context); - case "UnknownResourceException": - case "com.amazonaws.route53resolver#UnknownResourceException": - throw await de_UnknownResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutResolverQueryLogConfigPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1PutResolverRulePolicyCommand */ -export const de_TagResourceCommand = async ( +export const de_PutResolverRulePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: PutResolverRulePolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4637,47 +2367,23 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidTagException": - case "com.amazonaws.route53resolver#InvalidTagException": - throw await de_InvalidTagExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.route53resolver#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -4688,7 +2394,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4700,44 +2406,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateFirewallConfigCommand */ @@ -4746,7 +2414,7 @@ export const de_UpdateFirewallConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateFirewallConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4758,44 +2426,6 @@ export const de_UpdateFirewallConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateFirewallConfigCommandError - */ -const de_UpdateFirewallConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateFirewallDomainsCommand */ @@ -4804,7 +2434,7 @@ export const de_UpdateFirewallDomainsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateFirewallDomainsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4816,50 +2446,6 @@ export const de_UpdateFirewallDomainsCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateFirewallDomainsCommandError - */ -const de_UpdateFirewallDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53resolver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.route53resolver#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateFirewallRuleCommand */ @@ -4868,57 +2454,16 @@ export const de_UpdateFirewallRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateFirewallRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: UpdateFirewallRuleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateFirewallRuleCommandError - */ -const de_UpdateFirewallRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53resolver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + contents = _json(data); + const response: UpdateFirewallRuleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -4929,7 +2474,7 @@ export const de_UpdateFirewallRuleGroupAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateFirewallRuleGroupAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4941,47 +2486,6 @@ export const de_UpdateFirewallRuleGroupAssociationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateFirewallRuleGroupAssociationCommandError - */ -const de_UpdateFirewallRuleGroupAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53resolver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateOutpostResolverCommand */ @@ -4990,7 +2494,7 @@ export const de_UpdateOutpostResolverCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateOutpostResolverCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5002,50 +2506,6 @@ export const de_UpdateOutpostResolverCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateOutpostResolverCommandError - */ -const de_UpdateOutpostResolverCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.route53resolver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.route53resolver#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateResolverConfigCommand */ @@ -5054,7 +2514,7 @@ export const de_UpdateResolverConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateResolverConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5066,56 +2526,6 @@ export const de_UpdateResolverConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateResolverConfigCommandError - */ -const de_UpdateResolverConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.route53resolver#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.route53resolver#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.route53resolver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateResolverDnssecConfigCommand */ @@ -5124,7 +2534,7 @@ export const de_UpdateResolverDnssecConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateResolverDnssecConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5136,47 +2546,6 @@ export const de_UpdateResolverDnssecConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateResolverDnssecConfigCommandError - */ -const de_UpdateResolverDnssecConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateResolverEndpointCommand */ @@ -5185,7 +2554,7 @@ export const de_UpdateResolverEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateResolverEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5197,47 +2566,6 @@ export const de_UpdateResolverEndpointCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateResolverEndpointCommandError - */ -const de_UpdateResolverEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.route53resolver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.route53resolver#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.route53resolver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.route53resolver#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateResolverRuleCommand */ @@ -5246,7 +2574,7 @@ export const de_UpdateResolverRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateResolverRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5259,12 +2587,9 @@ export const de_UpdateResolverRuleCommand = async ( }; /** - * deserializeAws_json1_1UpdateResolverRuleCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateResolverRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5274,34 +2599,61 @@ const de_UpdateResolverRuleCommandError = async ( case "AccessDeniedException": case "com.amazonaws.route53resolver#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.route53resolver#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServiceErrorException": case "com.amazonaws.route53resolver#InternalServiceErrorException": throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.route53resolver#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.route53resolver#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); case "LimitExceededException": case "com.amazonaws.route53resolver#LimitExceededException": throw await de_LimitExceededExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.route53resolver#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.route53resolver#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.route53resolver#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.route53resolver#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "InvalidParameterException": + case "com.amazonaws.route53resolver#InvalidParameterException": + throw await de_InvalidParameterExceptionRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.route53resolver#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "ResourceExistsException": + case "com.amazonaws.route53resolver#ResourceExistsException": + throw await de_ResourceExistsExceptionRes(parsedOutput, context); + case "ResourceUnavailableException": + case "com.amazonaws.route53resolver#ResourceUnavailableException": + throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.route53resolver#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.route53resolver#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); + case "UnknownResourceException": + case "com.amazonaws.route53resolver#UnknownResourceException": + throw await de_UnknownResourceExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.route53resolver#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "InvalidPolicyDocument": + case "com.amazonaws.route53resolver#InvalidPolicyDocument": + throw await de_InvalidPolicyDocumentRes(parsedOutput, context); + case "InvalidTagException": + case "com.amazonaws.route53resolver#InvalidTagException": + throw await de_InvalidTagExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-rum/src/protocols/Aws_restJson1.ts b/clients/client-rum/src/protocols/Aws_restJson1.ts index 451acbb418ee..52d82d5987cb 100644 --- a/clients/client-rum/src/protocols/Aws_restJson1.ts +++ b/clients/client-rum/src/protocols/Aws_restJson1.ts @@ -486,7 +486,7 @@ export const de_BatchCreateRumMetricDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchCreateRumMetricDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -500,50 +500,6 @@ export const de_BatchCreateRumMetricDefinitionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchCreateRumMetricDefinitionsCommandError - */ -const de_BatchCreateRumMetricDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rum#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.rum#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rum#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.rum#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rum#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDeleteRumMetricDefinitionsCommand */ @@ -552,7 +508,7 @@ export const de_BatchDeleteRumMetricDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDeleteRumMetricDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -566,47 +522,6 @@ export const de_BatchDeleteRumMetricDefinitionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDeleteRumMetricDefinitionsCommandError - */ -const de_BatchDeleteRumMetricDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rum#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.rum#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rum#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rum#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetRumMetricDefinitionsCommand */ @@ -615,7 +530,7 @@ export const de_BatchGetRumMetricDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetRumMetricDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -629,41 +544,6 @@ export const de_BatchGetRumMetricDefinitionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetRumMetricDefinitionsCommandError - */ -const de_BatchGetRumMetricDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rum#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rum#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAppMonitorCommand */ @@ -672,7 +552,7 @@ export const de_CreateAppMonitorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAppMonitorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -685,50 +565,6 @@ export const de_CreateAppMonitorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAppMonitorCommandError - */ -const de_CreateAppMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rum#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.rum#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rum#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.rum#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rum#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAppMonitorCommand */ @@ -737,7 +573,7 @@ export const de_DeleteAppMonitorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAppMonitorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -746,47 +582,6 @@ export const de_DeleteAppMonitorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAppMonitorCommandError - */ -const de_DeleteAppMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rum#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.rum#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rum#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rum#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRumMetricsDestinationCommand */ @@ -795,7 +590,7 @@ export const de_DeleteRumMetricsDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRumMetricsDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -804,47 +599,6 @@ export const de_DeleteRumMetricsDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRumMetricsDestinationCommandError - */ -const de_DeleteRumMetricsDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rum#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.rum#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rum#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rum#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAppMonitorCommand */ @@ -853,7 +607,7 @@ export const de_GetAppMonitorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAppMonitorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -866,44 +620,6 @@ export const de_GetAppMonitorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAppMonitorCommandError - */ -const de_GetAppMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rum#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rum#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rum#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAppMonitorDataCommand */ @@ -912,131 +628,36 @@ export const de_GetAppMonitorDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAppMonitorDataCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Events: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAppMonitorDataCommandError - */ -const de_GetAppMonitorDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rum#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rum#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rum#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAppMonitorsCommand - */ -export const de_ListAppMonitorsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppMonitorsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AppMonitorSummaries: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAppMonitorsCommandError - */ -const de_ListAppMonitorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rum#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rum#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Events: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRumMetricsDestinationsCommand + * deserializeAws_restJson1ListAppMonitorsCommand */ -export const de_ListRumMetricsDestinationsCommand = async ( +export const de_ListAppMonitorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRumMetricsDestinationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Destinations: _json, + AppMonitorSummaries: _json, NextToken: __expectString, }); Object.assign(contents, doc); @@ -1044,38 +665,25 @@ export const de_ListRumMetricsDestinationsCommand = async ( }; /** - * deserializeAws_restJson1ListRumMetricsDestinationsCommandError + * deserializeAws_restJson1ListRumMetricsDestinationsCommand */ -const de_ListRumMetricsDestinationsCommandError = async ( +export const de_ListRumMetricsDestinationsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rum#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rum#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Destinations: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1086,7 +694,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1100,38 +708,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rum#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutRumEventsCommand */ @@ -1140,7 +716,7 @@ export const de_PutRumEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutRumEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1149,44 +725,6 @@ export const de_PutRumEventsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutRumEventsCommandError - */ -const de_PutRumEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rum#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rum#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rum#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutRumMetricsDestinationCommand */ @@ -1195,7 +733,7 @@ export const de_PutRumMetricsDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutRumMetricsDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1204,47 +742,6 @@ export const de_PutRumMetricsDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutRumMetricsDestinationCommandError - */ -const de_PutRumMetricsDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rum#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.rum#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rum#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rum#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1253,7 +750,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1262,38 +759,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rum#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1302,7 +767,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1311,38 +776,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rum#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAppMonitorCommand */ @@ -1351,7 +784,7 @@ export const de_UpdateAppMonitorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAppMonitorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1360,47 +793,6 @@ export const de_UpdateAppMonitorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAppMonitorCommandError - */ -const de_UpdateAppMonitorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.rum#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.rum#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.rum#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.rum#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.rum#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.rum#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRumMetricDefinitionCommand */ @@ -1409,7 +801,7 @@ export const de_UpdateRumMetricDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRumMetricDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1419,12 +811,9 @@ export const de_UpdateRumMetricDefinitionCommand = async ( }; /** - * deserializeAws_restJson1UpdateRumMetricDefinitionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateRumMetricDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1458,7 +847,7 @@ const de_UpdateRumMetricDefinitionCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-s3-control/src/protocols/Aws_restXml.ts b/clients/client-s3-control/src/protocols/Aws_restXml.ts index 3b1761be9205..438a3bf47558 100644 --- a/clients/client-s3-control/src/protocols/Aws_restXml.ts +++ b/clients/client-s3-control/src/protocols/Aws_restXml.ts @@ -3561,7 +3561,7 @@ export const de_AssociateAccessGrantsIdentityCenterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateAccessGrantsIdentityCenterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3570,26 +3570,6 @@ export const de_AssociateAccessGrantsIdentityCenterCommand = async ( return contents; }; -/** - * deserializeAws_restXmlAssociateAccessGrantsIdentityCenterCommandError - */ -const de_AssociateAccessGrantsIdentityCenterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlCreateAccessGrantCommand */ @@ -3598,7 +3578,7 @@ export const de_CreateAccessGrantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAccessGrantCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3634,26 +3614,6 @@ export const de_CreateAccessGrantCommand = async ( return contents; }; -/** - * deserializeAws_restXmlCreateAccessGrantCommandError - */ -const de_CreateAccessGrantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlCreateAccessGrantsInstanceCommand */ @@ -3662,7 +3622,7 @@ export const de_CreateAccessGrantsInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAccessGrantsInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3683,26 +3643,6 @@ export const de_CreateAccessGrantsInstanceCommand = async ( return contents; }; -/** - * deserializeAws_restXmlCreateAccessGrantsInstanceCommandError - */ -const de_CreateAccessGrantsInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlCreateAccessGrantsLocationCommand */ @@ -3711,7 +3651,7 @@ export const de_CreateAccessGrantsLocationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAccessGrantsLocationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3735,26 +3675,6 @@ export const de_CreateAccessGrantsLocationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlCreateAccessGrantsLocationCommandError - */ -const de_CreateAccessGrantsLocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlCreateAccessPointCommand */ @@ -3763,7 +3683,7 @@ export const de_CreateAccessPointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAccessPointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3778,26 +3698,6 @@ export const de_CreateAccessPointCommand = async ( return contents; }; -/** - * deserializeAws_restXmlCreateAccessPointCommandError - */ -const de_CreateAccessPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlCreateAccessPointForObjectLambdaCommand */ @@ -3806,7 +3706,7 @@ export const de_CreateAccessPointForObjectLambdaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAccessPointForObjectLambdaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3821,26 +3721,6 @@ export const de_CreateAccessPointForObjectLambdaCommand = async ( return contents; }; -/** - * deserializeAws_restXmlCreateAccessPointForObjectLambdaCommandError - */ -const de_CreateAccessPointForObjectLambdaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlCreateBucketCommand */ @@ -3849,7 +3729,7 @@ export const de_CreateBucketCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBucketCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3862,35 +3742,6 @@ export const de_CreateBucketCommand = async ( return contents; }; -/** - * deserializeAws_restXmlCreateBucketCommandError - */ -const de_CreateBucketCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BucketAlreadyExists": - case "com.amazonaws.s3control#BucketAlreadyExists": - throw await de_BucketAlreadyExistsRes(parsedOutput, context); - case "BucketAlreadyOwnedByYou": - case "com.amazonaws.s3control#BucketAlreadyOwnedByYou": - throw await de_BucketAlreadyOwnedByYouRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlCreateJobCommand */ @@ -3899,7 +3750,7 @@ export const de_CreateJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3911,41 +3762,6 @@ export const de_CreateJobCommand = async ( return contents; }; -/** - * deserializeAws_restXmlCreateJobCommandError - */ -const de_CreateJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.s3control#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "IdempotencyException": - case "com.amazonaws.s3control#IdempotencyException": - throw await de_IdempotencyExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.s3control#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.s3control#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlCreateMultiRegionAccessPointCommand */ @@ -3954,7 +3770,7 @@ export const de_CreateMultiRegionAccessPointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMultiRegionAccessPointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3966,26 +3782,6 @@ export const de_CreateMultiRegionAccessPointCommand = async ( return contents; }; -/** - * deserializeAws_restXmlCreateMultiRegionAccessPointCommandError - */ -const de_CreateMultiRegionAccessPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlCreateStorageLensGroupCommand */ @@ -3994,7 +3790,7 @@ export const de_CreateStorageLensGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_CreateStorageLensGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4003,26 +3799,6 @@ export const de_CreateStorageLensGroupCommand = async ( return contents; }; -/** - * deserializeAws_restXmlCreateStorageLensGroupCommandError - */ -const de_CreateStorageLensGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteAccessGrantCommand */ @@ -4031,7 +3807,7 @@ export const de_DeleteAccessGrantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAccessGrantCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4040,26 +3816,6 @@ export const de_DeleteAccessGrantCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteAccessGrantCommandError - */ -const de_DeleteAccessGrantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteAccessGrantsInstanceCommand */ @@ -4068,7 +3824,7 @@ export const de_DeleteAccessGrantsInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAccessGrantsInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4077,26 +3833,6 @@ export const de_DeleteAccessGrantsInstanceCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteAccessGrantsInstanceCommandError - */ -const de_DeleteAccessGrantsInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteAccessGrantsInstanceResourcePolicyCommand */ @@ -4105,7 +3841,7 @@ export const de_DeleteAccessGrantsInstanceResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAccessGrantsInstanceResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4114,26 +3850,6 @@ export const de_DeleteAccessGrantsInstanceResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteAccessGrantsInstanceResourcePolicyCommandError - */ -const de_DeleteAccessGrantsInstanceResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteAccessGrantsLocationCommand */ @@ -4142,7 +3858,7 @@ export const de_DeleteAccessGrantsLocationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAccessGrantsLocationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4151,26 +3867,6 @@ export const de_DeleteAccessGrantsLocationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteAccessGrantsLocationCommandError - */ -const de_DeleteAccessGrantsLocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteAccessPointCommand */ @@ -4179,7 +3875,7 @@ export const de_DeleteAccessPointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAccessPointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4188,26 +3884,6 @@ export const de_DeleteAccessPointCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteAccessPointCommandError - */ -const de_DeleteAccessPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteAccessPointForObjectLambdaCommand */ @@ -4216,7 +3892,7 @@ export const de_DeleteAccessPointForObjectLambdaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAccessPointForObjectLambdaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4225,26 +3901,6 @@ export const de_DeleteAccessPointForObjectLambdaCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteAccessPointForObjectLambdaCommandError - */ -const de_DeleteAccessPointForObjectLambdaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteAccessPointPolicyCommand */ @@ -4253,7 +3909,7 @@ export const de_DeleteAccessPointPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAccessPointPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4262,26 +3918,6 @@ export const de_DeleteAccessPointPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteAccessPointPolicyCommandError - */ -const de_DeleteAccessPointPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteAccessPointPolicyForObjectLambdaCommand */ @@ -4290,7 +3926,7 @@ export const de_DeleteAccessPointPolicyForObjectLambdaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAccessPointPolicyForObjectLambdaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4300,34 +3936,14 @@ export const de_DeleteAccessPointPolicyForObjectLambdaCommand = async ( }; /** - * deserializeAws_restXmlDeleteAccessPointPolicyForObjectLambdaCommandError - */ -const de_DeleteAccessPointPolicyForObjectLambdaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_restXmlDeleteBucketCommand + * deserializeAws_restXmlDeleteBucketCommand */ export const de_DeleteBucketCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBucketCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4336,26 +3952,6 @@ export const de_DeleteBucketCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketCommandError - */ -const de_DeleteBucketCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteBucketLifecycleConfigurationCommand */ @@ -4364,7 +3960,7 @@ export const de_DeleteBucketLifecycleConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBucketLifecycleConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4373,26 +3969,6 @@ export const de_DeleteBucketLifecycleConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketLifecycleConfigurationCommandError - */ -const de_DeleteBucketLifecycleConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteBucketPolicyCommand */ @@ -4401,7 +3977,7 @@ export const de_DeleteBucketPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBucketPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4410,26 +3986,6 @@ export const de_DeleteBucketPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketPolicyCommandError - */ -const de_DeleteBucketPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteBucketReplicationCommand */ @@ -4438,7 +3994,7 @@ export const de_DeleteBucketReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBucketReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4447,26 +4003,6 @@ export const de_DeleteBucketReplicationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketReplicationCommandError - */ -const de_DeleteBucketReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteBucketTaggingCommand */ @@ -4475,7 +4011,7 @@ export const de_DeleteBucketTaggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBucketTaggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4484,26 +4020,6 @@ export const de_DeleteBucketTaggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketTaggingCommandError - */ -const de_DeleteBucketTaggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteJobTaggingCommand */ @@ -4512,7 +4028,7 @@ export const de_DeleteJobTaggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteJobTaggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4521,38 +4037,6 @@ export const de_DeleteJobTaggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteJobTaggingCommandError - */ -const de_DeleteJobTaggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.s3control#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.s3control#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.s3control#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlDeleteMultiRegionAccessPointCommand */ @@ -4561,7 +4045,7 @@ export const de_DeleteMultiRegionAccessPointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMultiRegionAccessPointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4573,26 +4057,6 @@ export const de_DeleteMultiRegionAccessPointCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteMultiRegionAccessPointCommandError - */ -const de_DeleteMultiRegionAccessPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeletePublicAccessBlockCommand */ @@ -4601,7 +4065,7 @@ export const de_DeletePublicAccessBlockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePublicAccessBlockCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4610,26 +4074,6 @@ export const de_DeletePublicAccessBlockCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeletePublicAccessBlockCommandError - */ -const de_DeletePublicAccessBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteStorageLensConfigurationCommand */ @@ -4638,7 +4082,7 @@ export const de_DeleteStorageLensConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteStorageLensConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4647,26 +4091,6 @@ export const de_DeleteStorageLensConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteStorageLensConfigurationCommandError - */ -const de_DeleteStorageLensConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteStorageLensConfigurationTaggingCommand */ @@ -4675,7 +4099,7 @@ export const de_DeleteStorageLensConfigurationTaggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteStorageLensConfigurationTaggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4684,26 +4108,6 @@ export const de_DeleteStorageLensConfigurationTaggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteStorageLensConfigurationTaggingCommandError - */ -const de_DeleteStorageLensConfigurationTaggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteStorageLensGroupCommand */ @@ -4712,7 +4116,7 @@ export const de_DeleteStorageLensGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteStorageLensGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4721,26 +4125,6 @@ export const de_DeleteStorageLensGroupCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteStorageLensGroupCommandError - */ -const de_DeleteStorageLensGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDescribeJobCommand */ @@ -4749,7 +4133,7 @@ export const de_DescribeJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4761,41 +4145,6 @@ export const de_DescribeJobCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDescribeJobCommandError - */ -const de_DescribeJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.s3control#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.s3control#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.s3control#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.s3control#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlDescribeMultiRegionAccessPointOperationCommand */ @@ -4804,7 +4153,7 @@ export const de_DescribeMultiRegionAccessPointOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeMultiRegionAccessPointOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4816,26 +4165,6 @@ export const de_DescribeMultiRegionAccessPointOperationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDescribeMultiRegionAccessPointOperationCommandError - */ -const de_DescribeMultiRegionAccessPointOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDissociateAccessGrantsIdentityCenterCommand */ @@ -4844,7 +4173,7 @@ export const de_DissociateAccessGrantsIdentityCenterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DissociateAccessGrantsIdentityCenterCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4853,26 +4182,6 @@ export const de_DissociateAccessGrantsIdentityCenterCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDissociateAccessGrantsIdentityCenterCommandError - */ -const de_DissociateAccessGrantsIdentityCenterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetAccessGrantCommand */ @@ -4881,7 +4190,7 @@ export const de_GetAccessGrantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccessGrantCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4917,26 +4226,6 @@ export const de_GetAccessGrantCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetAccessGrantCommandError - */ -const de_GetAccessGrantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetAccessGrantsInstanceCommand */ @@ -4945,7 +4234,7 @@ export const de_GetAccessGrantsInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccessGrantsInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4967,34 +4256,14 @@ export const de_GetAccessGrantsInstanceCommand = async ( }; /** - * deserializeAws_restXmlGetAccessGrantsInstanceCommandError + * deserializeAws_restXmlGetAccessGrantsInstanceForPrefixCommand */ -const de_GetAccessGrantsInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_restXmlGetAccessGrantsInstanceForPrefixCommand - */ -export const de_GetAccessGrantsInstanceForPrefixCommand = async ( +export const de_GetAccessGrantsInstanceForPrefixCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccessGrantsInstanceForPrefixCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5009,26 +4278,6 @@ export const de_GetAccessGrantsInstanceForPrefixCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetAccessGrantsInstanceForPrefixCommandError - */ -const de_GetAccessGrantsInstanceForPrefixCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetAccessGrantsInstanceResourcePolicyCommand */ @@ -5037,7 +4286,7 @@ export const de_GetAccessGrantsInstanceResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccessGrantsInstanceResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5055,26 +4304,6 @@ export const de_GetAccessGrantsInstanceResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetAccessGrantsInstanceResourcePolicyCommandError - */ -const de_GetAccessGrantsInstanceResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetAccessGrantsLocationCommand */ @@ -5083,7 +4312,7 @@ export const de_GetAccessGrantsLocationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccessGrantsLocationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5107,26 +4336,6 @@ export const de_GetAccessGrantsLocationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetAccessGrantsLocationCommandError - */ -const de_GetAccessGrantsLocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetAccessPointCommand */ @@ -5135,7 +4344,7 @@ export const de_GetAccessPointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccessPointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5176,26 +4385,6 @@ export const de_GetAccessPointCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetAccessPointCommandError - */ -const de_GetAccessPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetAccessPointConfigurationForObjectLambdaCommand */ @@ -5204,7 +4393,7 @@ export const de_GetAccessPointConfigurationForObjectLambdaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccessPointConfigurationForObjectLambdaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5216,26 +4405,6 @@ export const de_GetAccessPointConfigurationForObjectLambdaCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetAccessPointConfigurationForObjectLambdaCommandError - */ -const de_GetAccessPointConfigurationForObjectLambdaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetAccessPointForObjectLambdaCommand */ @@ -5244,7 +4413,7 @@ export const de_GetAccessPointForObjectLambdaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccessPointForObjectLambdaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5265,26 +4434,6 @@ export const de_GetAccessPointForObjectLambdaCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetAccessPointForObjectLambdaCommandError - */ -const de_GetAccessPointForObjectLambdaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetAccessPointPolicyCommand */ @@ -5293,7 +4442,7 @@ export const de_GetAccessPointPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccessPointPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5305,26 +4454,6 @@ export const de_GetAccessPointPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetAccessPointPolicyCommandError - */ -const de_GetAccessPointPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetAccessPointPolicyForObjectLambdaCommand */ @@ -5333,7 +4462,7 @@ export const de_GetAccessPointPolicyForObjectLambdaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccessPointPolicyForObjectLambdaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5345,26 +4474,6 @@ export const de_GetAccessPointPolicyForObjectLambdaCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetAccessPointPolicyForObjectLambdaCommandError - */ -const de_GetAccessPointPolicyForObjectLambdaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetAccessPointPolicyStatusCommand */ @@ -5373,7 +4482,7 @@ export const de_GetAccessPointPolicyStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccessPointPolicyStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5385,26 +4494,6 @@ export const de_GetAccessPointPolicyStatusCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetAccessPointPolicyStatusCommandError - */ -const de_GetAccessPointPolicyStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetAccessPointPolicyStatusForObjectLambdaCommand */ @@ -5413,7 +4502,7 @@ export const de_GetAccessPointPolicyStatusForObjectLambdaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccessPointPolicyStatusForObjectLambdaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5425,26 +4514,6 @@ export const de_GetAccessPointPolicyStatusForObjectLambdaCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetAccessPointPolicyStatusForObjectLambdaCommandError - */ -const de_GetAccessPointPolicyStatusForObjectLambdaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketCommand */ @@ -5453,7 +4522,7 @@ export const de_GetBucketCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5471,26 +4540,6 @@ export const de_GetBucketCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketCommandError - */ -const de_GetBucketCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketLifecycleConfigurationCommand */ @@ -5499,7 +4548,7 @@ export const de_GetBucketLifecycleConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketLifecycleConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5513,26 +4562,6 @@ export const de_GetBucketLifecycleConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketLifecycleConfigurationCommandError - */ -const de_GetBucketLifecycleConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketPolicyCommand */ @@ -5541,7 +4570,7 @@ export const de_GetBucketPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5553,26 +4582,6 @@ export const de_GetBucketPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketPolicyCommandError - */ -const de_GetBucketPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketReplicationCommand */ @@ -5581,7 +4590,7 @@ export const de_GetBucketReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5593,26 +4602,6 @@ export const de_GetBucketReplicationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketReplicationCommandError - */ -const de_GetBucketReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketTaggingCommand */ @@ -5621,7 +4610,7 @@ export const de_GetBucketTaggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketTaggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5635,26 +4624,6 @@ export const de_GetBucketTaggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketTaggingCommandError - */ -const de_GetBucketTaggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketVersioningCommand */ @@ -5663,7 +4632,7 @@ export const de_GetBucketVersioningCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketVersioningCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5678,26 +4647,6 @@ export const de_GetBucketVersioningCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketVersioningCommandError - */ -const de_GetBucketVersioningCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetDataAccessCommand */ @@ -5706,7 +4655,7 @@ export const de_GetDataAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataAccessCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5721,26 +4670,6 @@ export const de_GetDataAccessCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetDataAccessCommandError - */ -const de_GetDataAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetJobTaggingCommand */ @@ -5749,7 +4678,7 @@ export const de_GetJobTaggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetJobTaggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5764,46 +4693,14 @@ export const de_GetJobTaggingCommand = async ( }; /** - * deserializeAws_restXmlGetJobTaggingCommandError + * deserializeAws_restXmlGetMultiRegionAccessPointCommand */ -const de_GetJobTaggingCommandError = async ( +export const de_GetMultiRegionAccessPointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.s3control#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.s3control#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.s3control#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlGetMultiRegionAccessPointCommand - */ -export const de_GetMultiRegionAccessPointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMultiRegionAccessPointCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5815,26 +4712,6 @@ export const de_GetMultiRegionAccessPointCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetMultiRegionAccessPointCommandError - */ -const de_GetMultiRegionAccessPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetMultiRegionAccessPointPolicyCommand */ @@ -5843,7 +4720,7 @@ export const de_GetMultiRegionAccessPointPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMultiRegionAccessPointPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5855,26 +4732,6 @@ export const de_GetMultiRegionAccessPointPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetMultiRegionAccessPointPolicyCommandError - */ -const de_GetMultiRegionAccessPointPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetMultiRegionAccessPointPolicyStatusCommand */ @@ -5883,7 +4740,7 @@ export const de_GetMultiRegionAccessPointPolicyStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMultiRegionAccessPointPolicyStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5895,26 +4752,6 @@ export const de_GetMultiRegionAccessPointPolicyStatusCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetMultiRegionAccessPointPolicyStatusCommandError - */ -const de_GetMultiRegionAccessPointPolicyStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetMultiRegionAccessPointRoutesCommand */ @@ -5923,7 +4760,7 @@ export const de_GetMultiRegionAccessPointRoutesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMultiRegionAccessPointRoutesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5940,26 +4777,6 @@ export const de_GetMultiRegionAccessPointRoutesCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetMultiRegionAccessPointRoutesCommandError - */ -const de_GetMultiRegionAccessPointRoutesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetPublicAccessBlockCommand */ @@ -5968,7 +4785,7 @@ export const de_GetPublicAccessBlockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPublicAccessBlockCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5978,32 +4795,6 @@ export const de_GetPublicAccessBlockCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetPublicAccessBlockCommandError - */ -const de_GetPublicAccessBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchPublicAccessBlockConfiguration": - case "com.amazonaws.s3control#NoSuchPublicAccessBlockConfiguration": - throw await de_NoSuchPublicAccessBlockConfigurationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlGetStorageLensConfigurationCommand */ @@ -6012,7 +4803,7 @@ export const de_GetStorageLensConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStorageLensConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6022,26 +4813,6 @@ export const de_GetStorageLensConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetStorageLensConfigurationCommandError - */ -const de_GetStorageLensConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetStorageLensConfigurationTaggingCommand */ @@ -6050,7 +4821,7 @@ export const de_GetStorageLensConfigurationTaggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStorageLensConfigurationTaggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6064,26 +4835,6 @@ export const de_GetStorageLensConfigurationTaggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetStorageLensConfigurationTaggingCommandError - */ -const de_GetStorageLensConfigurationTaggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetStorageLensGroupCommand */ @@ -6092,7 +4843,7 @@ export const de_GetStorageLensGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetStorageLensGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6102,26 +4853,6 @@ export const de_GetStorageLensGroupCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetStorageLensGroupCommandError - */ -const de_GetStorageLensGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlListAccessGrantsCommand */ @@ -6130,7 +4861,7 @@ export const de_ListAccessGrantsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccessGrantsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6147,26 +4878,6 @@ export const de_ListAccessGrantsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListAccessGrantsCommandError - */ -const de_ListAccessGrantsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlListAccessGrantsInstancesCommand */ @@ -6175,7 +4886,7 @@ export const de_ListAccessGrantsInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccessGrantsInstancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6192,26 +4903,6 @@ export const de_ListAccessGrantsInstancesCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListAccessGrantsInstancesCommandError - */ -const de_ListAccessGrantsInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlListAccessGrantsLocationsCommand */ @@ -6220,7 +4911,7 @@ export const de_ListAccessGrantsLocationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccessGrantsLocationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6237,26 +4928,6 @@ export const de_ListAccessGrantsLocationsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListAccessGrantsLocationsCommandError - */ -const de_ListAccessGrantsLocationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlListAccessPointsCommand */ @@ -6265,7 +4936,7 @@ export const de_ListAccessPointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccessPointsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6282,26 +4953,6 @@ export const de_ListAccessPointsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListAccessPointsCommandError - */ -const de_ListAccessPointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlListAccessPointsForObjectLambdaCommand */ @@ -6310,7 +4961,7 @@ export const de_ListAccessPointsForObjectLambdaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccessPointsForObjectLambdaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6327,26 +4978,6 @@ export const de_ListAccessPointsForObjectLambdaCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListAccessPointsForObjectLambdaCommandError - */ -const de_ListAccessPointsForObjectLambdaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlListJobsCommand */ @@ -6355,7 +4986,7 @@ export const de_ListJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6372,38 +5003,6 @@ export const de_ListJobsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListJobsCommandError - */ -const de_ListJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.s3control#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.s3control#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.s3control#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlListMultiRegionAccessPointsCommand */ @@ -6412,7 +5011,7 @@ export const de_ListMultiRegionAccessPointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMultiRegionAccessPointsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6429,26 +5028,6 @@ export const de_ListMultiRegionAccessPointsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListMultiRegionAccessPointsCommandError - */ -const de_ListMultiRegionAccessPointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlListRegionalBucketsCommand */ @@ -6457,7 +5036,7 @@ export const de_ListRegionalBucketsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRegionalBucketsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6474,26 +5053,6 @@ export const de_ListRegionalBucketsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListRegionalBucketsCommandError - */ -const de_ListRegionalBucketsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlListStorageLensConfigurationsCommand */ @@ -6502,7 +5061,7 @@ export const de_ListStorageLensConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStorageLensConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6520,34 +5079,14 @@ export const de_ListStorageLensConfigurationsCommand = async ( }; /** - * deserializeAws_restXmlListStorageLensConfigurationsCommandError + * deserializeAws_restXmlListStorageLensGroupsCommand */ -const de_ListStorageLensConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_restXmlListStorageLensGroupsCommand - */ -export const de_ListStorageLensGroupsCommand = async ( +export const de_ListStorageLensGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStorageLensGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6564,26 +5103,6 @@ export const de_ListStorageLensGroupsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListStorageLensGroupsCommandError - */ -const de_ListStorageLensGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlListTagsForResourceCommand */ @@ -6592,7 +5111,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6606,26 +5125,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutAccessGrantsInstanceResourcePolicyCommand */ @@ -6634,7 +5133,7 @@ export const de_PutAccessGrantsInstanceResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAccessGrantsInstanceResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6652,26 +5151,6 @@ export const de_PutAccessGrantsInstanceResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutAccessGrantsInstanceResourcePolicyCommandError - */ -const de_PutAccessGrantsInstanceResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutAccessPointConfigurationForObjectLambdaCommand */ @@ -6680,7 +5159,7 @@ export const de_PutAccessPointConfigurationForObjectLambdaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAccessPointConfigurationForObjectLambdaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6689,26 +5168,6 @@ export const de_PutAccessPointConfigurationForObjectLambdaCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutAccessPointConfigurationForObjectLambdaCommandError - */ -const de_PutAccessPointConfigurationForObjectLambdaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutAccessPointPolicyCommand */ @@ -6717,7 +5176,7 @@ export const de_PutAccessPointPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAccessPointPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6726,26 +5185,6 @@ export const de_PutAccessPointPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutAccessPointPolicyCommandError - */ -const de_PutAccessPointPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutAccessPointPolicyForObjectLambdaCommand */ @@ -6754,7 +5193,7 @@ export const de_PutAccessPointPolicyForObjectLambdaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAccessPointPolicyForObjectLambdaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6763,26 +5202,6 @@ export const de_PutAccessPointPolicyForObjectLambdaCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutAccessPointPolicyForObjectLambdaCommandError - */ -const de_PutAccessPointPolicyForObjectLambdaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketLifecycleConfigurationCommand */ @@ -6791,7 +5210,7 @@ export const de_PutBucketLifecycleConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketLifecycleConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6800,26 +5219,6 @@ export const de_PutBucketLifecycleConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketLifecycleConfigurationCommandError - */ -const de_PutBucketLifecycleConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketPolicyCommand */ @@ -6828,7 +5227,7 @@ export const de_PutBucketPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6837,26 +5236,6 @@ export const de_PutBucketPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketPolicyCommandError - */ -const de_PutBucketPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketReplicationCommand */ @@ -6865,7 +5244,7 @@ export const de_PutBucketReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6874,26 +5253,6 @@ export const de_PutBucketReplicationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketReplicationCommandError - */ -const de_PutBucketReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketTaggingCommand */ @@ -6902,7 +5261,7 @@ export const de_PutBucketTaggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketTaggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6911,26 +5270,6 @@ export const de_PutBucketTaggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketTaggingCommandError - */ -const de_PutBucketTaggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketVersioningCommand */ @@ -6939,7 +5278,7 @@ export const de_PutBucketVersioningCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketVersioningCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6948,26 +5287,6 @@ export const de_PutBucketVersioningCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketVersioningCommandError - */ -const de_PutBucketVersioningCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutJobTaggingCommand */ @@ -6976,7 +5295,7 @@ export const de_PutJobTaggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutJobTaggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6985,41 +5304,6 @@ export const de_PutJobTaggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutJobTaggingCommandError - */ -const de_PutJobTaggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.s3control#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.s3control#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.s3control#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.s3control#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlPutMultiRegionAccessPointPolicyCommand */ @@ -7028,7 +5312,7 @@ export const de_PutMultiRegionAccessPointPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutMultiRegionAccessPointPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7040,26 +5324,6 @@ export const de_PutMultiRegionAccessPointPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutMultiRegionAccessPointPolicyCommandError - */ -const de_PutMultiRegionAccessPointPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutPublicAccessBlockCommand */ @@ -7068,7 +5332,7 @@ export const de_PutPublicAccessBlockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutPublicAccessBlockCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7077,26 +5341,6 @@ export const de_PutPublicAccessBlockCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutPublicAccessBlockCommandError - */ -const de_PutPublicAccessBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutStorageLensConfigurationCommand */ @@ -7105,7 +5349,7 @@ export const de_PutStorageLensConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutStorageLensConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7114,26 +5358,6 @@ export const de_PutStorageLensConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutStorageLensConfigurationCommandError - */ -const de_PutStorageLensConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutStorageLensConfigurationTaggingCommand */ @@ -7142,7 +5366,7 @@ export const de_PutStorageLensConfigurationTaggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutStorageLensConfigurationTaggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7151,26 +5375,6 @@ export const de_PutStorageLensConfigurationTaggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutStorageLensConfigurationTaggingCommandError - */ -const de_PutStorageLensConfigurationTaggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlSubmitMultiRegionAccessPointRoutesCommand */ @@ -7179,7 +5383,7 @@ export const de_SubmitMultiRegionAccessPointRoutesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SubmitMultiRegionAccessPointRoutesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7188,26 +5392,6 @@ export const de_SubmitMultiRegionAccessPointRoutesCommand = async ( return contents; }; -/** - * deserializeAws_restXmlSubmitMultiRegionAccessPointRoutesCommandError - */ -const de_SubmitMultiRegionAccessPointRoutesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlTagResourceCommand */ @@ -7216,7 +5400,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7225,26 +5409,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restXmlTagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlUntagResourceCommand */ @@ -7253,7 +5417,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7262,26 +5426,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restXmlUntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlUpdateAccessGrantsLocationCommand */ @@ -7290,7 +5434,7 @@ export const de_UpdateAccessGrantsLocationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAccessGrantsLocationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7314,26 +5458,6 @@ export const de_UpdateAccessGrantsLocationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlUpdateAccessGrantsLocationCommandError - */ -const de_UpdateAccessGrantsLocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlUpdateJobPriorityCommand */ @@ -7342,7 +5466,7 @@ export const de_UpdateJobPriorityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateJobPriorityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7357,41 +5481,6 @@ export const de_UpdateJobPriorityCommand = async ( return contents; }; -/** - * deserializeAws_restXmlUpdateJobPriorityCommandError - */ -const de_UpdateJobPriorityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.s3control#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServiceException": - case "com.amazonaws.s3control#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.s3control#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.s3control#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlUpdateJobStatusCommand */ @@ -7400,7 +5489,7 @@ export const de_UpdateJobStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateJobStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7419,80 +5508,78 @@ export const de_UpdateJobStatusCommand = async ( }; /** - * deserializeAws_restXmlUpdateJobStatusCommandError + * deserializeAws_restXmlUpdateStorageLensGroupCommand */ -const de_UpdateJobStatusCommandError = async ( +export const de_UpdateStorageLensGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserialize_Aws_restXmlCommandError + */ +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); switch (errorCode) { + case "BucketAlreadyExists": + case "com.amazonaws.s3control#BucketAlreadyExists": + throw await de_BucketAlreadyExistsRes(parsedOutput, context); + case "BucketAlreadyOwnedByYou": + case "com.amazonaws.s3control#BucketAlreadyOwnedByYou": + throw await de_BucketAlreadyOwnedByYouRes(parsedOutput, context); case "BadRequestException": case "com.amazonaws.s3control#BadRequestException": throw await de_BadRequestExceptionRes(parsedOutput, context); + case "IdempotencyException": + case "com.amazonaws.s3control#IdempotencyException": + throw await de_IdempotencyExceptionRes(parsedOutput, context); case "InternalServiceException": case "com.amazonaws.s3control#InternalServiceException": throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "JobStatusException": - case "com.amazonaws.s3control#JobStatusException": - throw await de_JobStatusExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.s3control#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.s3control#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.s3control#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); + case "NoSuchPublicAccessBlockConfiguration": + case "com.amazonaws.s3control#NoSuchPublicAccessBlockConfiguration": + throw await de_NoSuchPublicAccessBlockConfigurationRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.s3control#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "InvalidRequestException": + case "com.amazonaws.s3control#InvalidRequestException": + throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.s3control#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "JobStatusException": + case "com.amazonaws.s3control#JobStatusException": + throw await de_JobStatusExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody: parsedBody.Error, errorCode, - }); + }) as never; } }; -/** - * deserializeAws_restXmlUpdateStorageLensGroupCommand - */ -export const de_UpdateStorageLensGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateStorageLensGroupCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restXmlUpdateStorageLensGroupCommandError - */ -const de_UpdateStorageLensGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - const throwDefaultError = withBaseException(__BaseException); /** * deserializeAws_restXmlBadRequestExceptionRes diff --git a/clients/client-s3/src/protocols/Aws_restXml.ts b/clients/client-s3/src/protocols/Aws_restXml.ts index 2394812fcc44..c0937548d848 100644 --- a/clients/client-s3/src/protocols/Aws_restXml.ts +++ b/clients/client-s3/src/protocols/Aws_restXml.ts @@ -3142,7 +3142,7 @@ export const de_AbortMultipartUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_AbortMultipartUploadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3152,32 +3152,6 @@ export const de_AbortMultipartUploadCommand = async ( return contents; }; -/** - * deserializeAws_restXmlAbortMultipartUploadCommandError - */ -const de_AbortMultipartUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchUpload": - case "com.amazonaws.s3#NoSuchUpload": - throw await de_NoSuchUploadRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlCompleteMultipartUploadCommand */ @@ -3186,7 +3160,7 @@ export const de_CompleteMultipartUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CompleteMultipartUploadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3225,26 +3199,6 @@ export const de_CompleteMultipartUploadCommand = async ( return contents; }; -/** - * deserializeAws_restXmlCompleteMultipartUploadCommandError - */ -const de_CompleteMultipartUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlCopyObjectCommand */ @@ -3253,7 +3207,7 @@ export const de_CopyObjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CopyObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3273,32 +3227,6 @@ export const de_CopyObjectCommand = async ( return contents; }; -/** - * deserializeAws_restXmlCopyObjectCommandError - */ -const de_CopyObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ObjectNotInActiveTierError": - case "com.amazonaws.s3#ObjectNotInActiveTierError": - throw await de_ObjectNotInActiveTierErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlCreateBucketCommand */ @@ -3307,7 +3235,7 @@ export const de_CreateBucketCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBucketCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3317,35 +3245,6 @@ export const de_CreateBucketCommand = async ( return contents; }; -/** - * deserializeAws_restXmlCreateBucketCommandError - */ -const de_CreateBucketCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BucketAlreadyExists": - case "com.amazonaws.s3#BucketAlreadyExists": - throw await de_BucketAlreadyExistsRes(parsedOutput, context); - case "BucketAlreadyOwnedByYou": - case "com.amazonaws.s3#BucketAlreadyOwnedByYou": - throw await de_BucketAlreadyOwnedByYouRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlCreateMultipartUploadCommand */ @@ -3354,7 +3253,7 @@ export const de_CreateMultipartUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMultipartUploadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3385,26 +3284,6 @@ export const de_CreateMultipartUploadCommand = async ( return contents; }; -/** - * deserializeAws_restXmlCreateMultipartUploadCommandError - */ -const de_CreateMultipartUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlCreateSessionCommand */ @@ -3413,7 +3292,7 @@ export const de_CreateSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3425,32 +3304,6 @@ export const de_CreateSessionCommand = async ( return contents; }; -/** - * deserializeAws_restXmlCreateSessionCommandError - */ -const de_CreateSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchBucket": - case "com.amazonaws.s3#NoSuchBucket": - throw await de_NoSuchBucketRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlDeleteBucketCommand */ @@ -3459,7 +3312,7 @@ export const de_DeleteBucketCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBucketCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3468,26 +3321,6 @@ export const de_DeleteBucketCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketCommandError - */ -const de_DeleteBucketCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteBucketAnalyticsConfigurationCommand */ @@ -3496,7 +3329,7 @@ export const de_DeleteBucketAnalyticsConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBucketAnalyticsConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3505,26 +3338,6 @@ export const de_DeleteBucketAnalyticsConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketAnalyticsConfigurationCommandError - */ -const de_DeleteBucketAnalyticsConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteBucketCorsCommand */ @@ -3533,7 +3346,7 @@ export const de_DeleteBucketCorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBucketCorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3542,26 +3355,6 @@ export const de_DeleteBucketCorsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketCorsCommandError - */ -const de_DeleteBucketCorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteBucketEncryptionCommand */ @@ -3570,7 +3363,7 @@ export const de_DeleteBucketEncryptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBucketEncryptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3579,26 +3372,6 @@ export const de_DeleteBucketEncryptionCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketEncryptionCommandError - */ -const de_DeleteBucketEncryptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteBucketIntelligentTieringConfigurationCommand */ @@ -3607,7 +3380,7 @@ export const de_DeleteBucketIntelligentTieringConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBucketIntelligentTieringConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3616,26 +3389,6 @@ export const de_DeleteBucketIntelligentTieringConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketIntelligentTieringConfigurationCommandError - */ -const de_DeleteBucketIntelligentTieringConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteBucketInventoryConfigurationCommand */ @@ -3644,7 +3397,7 @@ export const de_DeleteBucketInventoryConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBucketInventoryConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3653,26 +3406,6 @@ export const de_DeleteBucketInventoryConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketInventoryConfigurationCommandError - */ -const de_DeleteBucketInventoryConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteBucketLifecycleCommand */ @@ -3681,7 +3414,7 @@ export const de_DeleteBucketLifecycleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBucketLifecycleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3690,26 +3423,6 @@ export const de_DeleteBucketLifecycleCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketLifecycleCommandError - */ -const de_DeleteBucketLifecycleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteBucketMetricsConfigurationCommand */ @@ -3718,7 +3431,7 @@ export const de_DeleteBucketMetricsConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBucketMetricsConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3727,26 +3440,6 @@ export const de_DeleteBucketMetricsConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketMetricsConfigurationCommandError - */ -const de_DeleteBucketMetricsConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteBucketOwnershipControlsCommand */ @@ -3755,7 +3448,7 @@ export const de_DeleteBucketOwnershipControlsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBucketOwnershipControlsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3764,26 +3457,6 @@ export const de_DeleteBucketOwnershipControlsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketOwnershipControlsCommandError - */ -const de_DeleteBucketOwnershipControlsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteBucketPolicyCommand */ @@ -3792,7 +3465,7 @@ export const de_DeleteBucketPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBucketPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3801,26 +3474,6 @@ export const de_DeleteBucketPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketPolicyCommandError - */ -const de_DeleteBucketPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteBucketReplicationCommand */ @@ -3829,7 +3482,7 @@ export const de_DeleteBucketReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBucketReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3839,34 +3492,14 @@ export const de_DeleteBucketReplicationCommand = async ( }; /** - * deserializeAws_restXmlDeleteBucketReplicationCommandError - */ -const de_DeleteBucketReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_restXmlDeleteBucketTaggingCommand + * deserializeAws_restXmlDeleteBucketTaggingCommand */ export const de_DeleteBucketTaggingCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBucketTaggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3875,26 +3508,6 @@ export const de_DeleteBucketTaggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketTaggingCommandError - */ -const de_DeleteBucketTaggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteBucketWebsiteCommand */ @@ -3903,7 +3516,7 @@ export const de_DeleteBucketWebsiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteBucketWebsiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3912,26 +3525,6 @@ export const de_DeleteBucketWebsiteCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteBucketWebsiteCommandError - */ -const de_DeleteBucketWebsiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteObjectCommand */ @@ -3940,7 +3533,7 @@ export const de_DeleteObjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3952,26 +3545,6 @@ export const de_DeleteObjectCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteObjectCommandError - */ -const de_DeleteObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteObjectsCommand */ @@ -3980,7 +3553,7 @@ export const de_DeleteObjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteObjectsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4000,26 +3573,6 @@ export const de_DeleteObjectsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteObjectsCommandError - */ -const de_DeleteObjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeleteObjectTaggingCommand */ @@ -4028,7 +3581,7 @@ export const de_DeleteObjectTaggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteObjectTaggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4038,26 +3591,6 @@ export const de_DeleteObjectTaggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeleteObjectTaggingCommandError - */ -const de_DeleteObjectTaggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlDeletePublicAccessBlockCommand */ @@ -4066,7 +3599,7 @@ export const de_DeletePublicAccessBlockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeletePublicAccessBlockCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4075,26 +3608,6 @@ export const de_DeletePublicAccessBlockCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDeletePublicAccessBlockCommandError - */ -const de_DeletePublicAccessBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketAccelerateConfigurationCommand */ @@ -4103,7 +3616,7 @@ export const de_GetBucketAccelerateConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketAccelerateConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4116,26 +3629,6 @@ export const de_GetBucketAccelerateConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketAccelerateConfigurationCommandError - */ -const de_GetBucketAccelerateConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketAclCommand */ @@ -4144,7 +3637,7 @@ export const de_GetBucketAclCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketAclCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4161,26 +3654,6 @@ export const de_GetBucketAclCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketAclCommandError - */ -const de_GetBucketAclCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketAnalyticsConfigurationCommand */ @@ -4189,7 +3662,7 @@ export const de_GetBucketAnalyticsConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketAnalyticsConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4199,26 +3672,6 @@ export const de_GetBucketAnalyticsConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketAnalyticsConfigurationCommandError - */ -const de_GetBucketAnalyticsConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketCorsCommand */ @@ -4227,7 +3680,7 @@ export const de_GetBucketCorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketCorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4241,26 +3694,6 @@ export const de_GetBucketCorsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketCorsCommandError - */ -const de_GetBucketCorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketEncryptionCommand */ @@ -4269,7 +3702,7 @@ export const de_GetBucketEncryptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketEncryptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4279,26 +3712,6 @@ export const de_GetBucketEncryptionCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketEncryptionCommandError - */ -const de_GetBucketEncryptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketIntelligentTieringConfigurationCommand */ @@ -4307,7 +3720,7 @@ export const de_GetBucketIntelligentTieringConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketIntelligentTieringConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4317,26 +3730,6 @@ export const de_GetBucketIntelligentTieringConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketIntelligentTieringConfigurationCommandError - */ -const de_GetBucketIntelligentTieringConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketInventoryConfigurationCommand */ @@ -4345,7 +3738,7 @@ export const de_GetBucketInventoryConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketInventoryConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4355,26 +3748,6 @@ export const de_GetBucketInventoryConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketInventoryConfigurationCommandError - */ -const de_GetBucketInventoryConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketLifecycleConfigurationCommand */ @@ -4383,7 +3756,7 @@ export const de_GetBucketLifecycleConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketLifecycleConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4397,26 +3770,6 @@ export const de_GetBucketLifecycleConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketLifecycleConfigurationCommandError - */ -const de_GetBucketLifecycleConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketLocationCommand */ @@ -4425,7 +3778,7 @@ export const de_GetBucketLocationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketLocationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4437,26 +3790,6 @@ export const de_GetBucketLocationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketLocationCommandError - */ -const de_GetBucketLocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketLoggingCommand */ @@ -4465,7 +3798,7 @@ export const de_GetBucketLoggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketLoggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4477,26 +3810,6 @@ export const de_GetBucketLoggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketLoggingCommandError - */ -const de_GetBucketLoggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketMetricsConfigurationCommand */ @@ -4505,7 +3818,7 @@ export const de_GetBucketMetricsConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketMetricsConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4515,26 +3828,6 @@ export const de_GetBucketMetricsConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketMetricsConfigurationCommandError - */ -const de_GetBucketMetricsConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketNotificationConfigurationCommand */ @@ -4543,7 +3836,7 @@ export const de_GetBucketNotificationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketNotificationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4570,26 +3863,6 @@ export const de_GetBucketNotificationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketNotificationConfigurationCommandError - */ -const de_GetBucketNotificationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketOwnershipControlsCommand */ @@ -4598,7 +3871,7 @@ export const de_GetBucketOwnershipControlsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketOwnershipControlsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4609,34 +3882,14 @@ export const de_GetBucketOwnershipControlsCommand = async ( }; /** - * deserializeAws_restXmlGetBucketOwnershipControlsCommandError + * deserializeAws_restXmlGetBucketPolicyCommand */ -const de_GetBucketOwnershipControlsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_restXmlGetBucketPolicyCommand - */ -export const de_GetBucketPolicyCommand = async ( +export const de_GetBucketPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4646,26 +3899,6 @@ export const de_GetBucketPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketPolicyCommandError - */ -const de_GetBucketPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketPolicyStatusCommand */ @@ -4674,7 +3907,7 @@ export const de_GetBucketPolicyStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketPolicyStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4684,26 +3917,6 @@ export const de_GetBucketPolicyStatusCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketPolicyStatusCommandError - */ -const de_GetBucketPolicyStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketReplicationCommand */ @@ -4712,7 +3925,7 @@ export const de_GetBucketReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4722,26 +3935,6 @@ export const de_GetBucketReplicationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketReplicationCommandError - */ -const de_GetBucketReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketRequestPaymentCommand */ @@ -4750,7 +3943,7 @@ export const de_GetBucketRequestPaymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketRequestPaymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4762,26 +3955,6 @@ export const de_GetBucketRequestPaymentCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketRequestPaymentCommandError - */ -const de_GetBucketRequestPaymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketTaggingCommand */ @@ -4790,7 +3963,7 @@ export const de_GetBucketTaggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketTaggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4804,26 +3977,6 @@ export const de_GetBucketTaggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketTaggingCommandError - */ -const de_GetBucketTaggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketVersioningCommand */ @@ -4832,7 +3985,7 @@ export const de_GetBucketVersioningCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketVersioningCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4847,26 +4000,6 @@ export const de_GetBucketVersioningCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketVersioningCommandError - */ -const de_GetBucketVersioningCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetBucketWebsiteCommand */ @@ -4875,7 +4008,7 @@ export const de_GetBucketWebsiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBucketWebsiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4898,26 +4031,6 @@ export const de_GetBucketWebsiteCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetBucketWebsiteCommandError - */ -const de_GetBucketWebsiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetObjectCommand */ @@ -4926,7 +4039,7 @@ export const de_GetObjectCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4984,35 +4097,6 @@ export const de_GetObjectCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetObjectCommandError - */ -const de_GetObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidObjectState": - case "com.amazonaws.s3#InvalidObjectState": - throw await de_InvalidObjectStateRes(parsedOutput, context); - case "NoSuchKey": - case "com.amazonaws.s3#NoSuchKey": - throw await de_NoSuchKeyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlGetObjectAclCommand */ @@ -5021,7 +4105,7 @@ export const de_GetObjectAclCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetObjectAclCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5039,32 +4123,6 @@ export const de_GetObjectAclCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetObjectAclCommandError - */ -const de_GetObjectAclCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchKey": - case "com.amazonaws.s3#NoSuchKey": - throw await de_NoSuchKeyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlGetObjectAttributesCommand */ @@ -5073,7 +4131,7 @@ export const de_GetObjectAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetObjectAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5101,32 +4159,6 @@ export const de_GetObjectAttributesCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetObjectAttributesCommandError - */ -const de_GetObjectAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchKey": - case "com.amazonaws.s3#NoSuchKey": - throw await de_NoSuchKeyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlGetObjectLegalHoldCommand */ @@ -5135,7 +4167,7 @@ export const de_GetObjectLegalHoldCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetObjectLegalHoldCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5145,26 +4177,6 @@ export const de_GetObjectLegalHoldCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetObjectLegalHoldCommandError - */ -const de_GetObjectLegalHoldCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetObjectLockConfigurationCommand */ @@ -5173,7 +4185,7 @@ export const de_GetObjectLockConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetObjectLockConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5183,26 +4195,6 @@ export const de_GetObjectLockConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetObjectLockConfigurationCommandError - */ -const de_GetObjectLockConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetObjectRetentionCommand */ @@ -5211,7 +4203,7 @@ export const de_GetObjectRetentionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetObjectRetentionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5221,26 +4213,6 @@ export const de_GetObjectRetentionCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetObjectRetentionCommandError - */ -const de_GetObjectRetentionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetObjectTaggingCommand */ @@ -5249,7 +4221,7 @@ export const de_GetObjectTaggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetObjectTaggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5264,26 +4236,6 @@ export const de_GetObjectTaggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetObjectTaggingCommandError - */ -const de_GetObjectTaggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetObjectTorrentCommand */ @@ -5292,7 +4244,7 @@ export const de_GetObjectTorrentCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetObjectTorrentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5304,26 +4256,6 @@ export const de_GetObjectTorrentCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetObjectTorrentCommandError - */ -const de_GetObjectTorrentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlGetPublicAccessBlockCommand */ @@ -5332,7 +4264,7 @@ export const de_GetPublicAccessBlockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPublicAccessBlockCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5342,26 +4274,6 @@ export const de_GetPublicAccessBlockCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGetPublicAccessBlockCommandError - */ -const de_GetPublicAccessBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlHeadBucketCommand */ @@ -5370,7 +4282,7 @@ export const de_HeadBucketCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HeadBucketCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5384,40 +4296,14 @@ export const de_HeadBucketCommand = async ( }; /** - * deserializeAws_restXmlHeadBucketCommandError + * deserializeAws_restXmlHeadObjectCommand */ -const de_HeadBucketCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFound": - case "com.amazonaws.s3#NotFound": - throw await de_NotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restXmlHeadObjectCommand - */ -export const de_HeadObjectCommand = async ( +export const de_HeadObjectCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HeadObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5472,32 +4358,6 @@ export const de_HeadObjectCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHeadObjectCommandError - */ -const de_HeadObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NotFound": - case "com.amazonaws.s3#NotFound": - throw await de_NotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlListBucketAnalyticsConfigurationsCommand */ @@ -5506,7 +4366,7 @@ export const de_ListBucketAnalyticsConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBucketAnalyticsConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5529,26 +4389,6 @@ export const de_ListBucketAnalyticsConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListBucketAnalyticsConfigurationsCommandError - */ -const de_ListBucketAnalyticsConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlListBucketIntelligentTieringConfigurationsCommand */ @@ -5557,7 +4397,7 @@ export const de_ListBucketIntelligentTieringConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBucketIntelligentTieringConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5580,26 +4420,6 @@ export const de_ListBucketIntelligentTieringConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListBucketIntelligentTieringConfigurationsCommandError - */ -const de_ListBucketIntelligentTieringConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlListBucketInventoryConfigurationsCommand */ @@ -5608,7 +4428,7 @@ export const de_ListBucketInventoryConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBucketInventoryConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5631,26 +4451,6 @@ export const de_ListBucketInventoryConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListBucketInventoryConfigurationsCommandError - */ -const de_ListBucketInventoryConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlListBucketMetricsConfigurationsCommand */ @@ -5659,7 +4459,7 @@ export const de_ListBucketMetricsConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBucketMetricsConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5682,26 +4482,6 @@ export const de_ListBucketMetricsConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListBucketMetricsConfigurationsCommandError - */ -const de_ListBucketMetricsConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlListBucketsCommand */ @@ -5710,7 +4490,7 @@ export const de_ListBucketsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBucketsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5727,26 +4507,6 @@ export const de_ListBucketsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListBucketsCommandError - */ -const de_ListBucketsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlListDirectoryBucketsCommand */ @@ -5755,7 +4515,7 @@ export const de_ListDirectoryBucketsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDirectoryBucketsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5772,26 +4532,6 @@ export const de_ListDirectoryBucketsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListDirectoryBucketsCommandError - */ -const de_ListDirectoryBucketsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlListMultipartUploadsCommand */ @@ -5800,7 +4540,7 @@ export const de_ListMultipartUploadsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMultipartUploadsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5850,26 +4590,6 @@ export const de_ListMultipartUploadsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListMultipartUploadsCommandError - */ -const de_ListMultipartUploadsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlListObjectsCommand */ @@ -5878,7 +4598,7 @@ export const de_ListObjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListObjectsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5922,32 +4642,6 @@ export const de_ListObjectsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListObjectsCommandError - */ -const de_ListObjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchBucket": - case "com.amazonaws.s3#NoSuchBucket": - throw await de_NoSuchBucketRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlListObjectsV2Command */ @@ -5956,7 +4650,7 @@ export const de_ListObjectsV2Command = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListObjectsV2CommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6006,32 +4700,6 @@ export const de_ListObjectsV2Command = async ( return contents; }; -/** - * deserializeAws_restXmlListObjectsV2CommandError - */ -const de_ListObjectsV2CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchBucket": - case "com.amazonaws.s3#NoSuchBucket": - throw await de_NoSuchBucketRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlListObjectVersionsCommand */ @@ -6040,7 +4708,7 @@ export const de_ListObjectVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListObjectVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6095,26 +4763,6 @@ export const de_ListObjectVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListObjectVersionsCommandError - */ -const de_ListObjectVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlListPartsCommand */ @@ -6123,7 +4771,7 @@ export const de_ListPartsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPartsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6176,26 +4824,6 @@ export const de_ListPartsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlListPartsCommandError - */ -const de_ListPartsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketAccelerateConfigurationCommand */ @@ -6204,7 +4832,7 @@ export const de_PutBucketAccelerateConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketAccelerateConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6213,26 +4841,6 @@ export const de_PutBucketAccelerateConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketAccelerateConfigurationCommandError - */ -const de_PutBucketAccelerateConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketAclCommand */ @@ -6241,7 +4849,7 @@ export const de_PutBucketAclCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketAclCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6250,26 +4858,6 @@ export const de_PutBucketAclCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketAclCommandError - */ -const de_PutBucketAclCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketAnalyticsConfigurationCommand */ @@ -6278,7 +4866,7 @@ export const de_PutBucketAnalyticsConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketAnalyticsConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6287,26 +4875,6 @@ export const de_PutBucketAnalyticsConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketAnalyticsConfigurationCommandError - */ -const de_PutBucketAnalyticsConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketCorsCommand */ @@ -6315,7 +4883,7 @@ export const de_PutBucketCorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketCorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6325,34 +4893,14 @@ export const de_PutBucketCorsCommand = async ( }; /** - * deserializeAws_restXmlPutBucketCorsCommandError + * deserializeAws_restXmlPutBucketEncryptionCommand */ -const de_PutBucketCorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_restXmlPutBucketEncryptionCommand - */ -export const de_PutBucketEncryptionCommand = async ( +export const de_PutBucketEncryptionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketEncryptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6361,26 +4909,6 @@ export const de_PutBucketEncryptionCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketEncryptionCommandError - */ -const de_PutBucketEncryptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketIntelligentTieringConfigurationCommand */ @@ -6389,7 +4917,7 @@ export const de_PutBucketIntelligentTieringConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketIntelligentTieringConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6398,26 +4926,6 @@ export const de_PutBucketIntelligentTieringConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketIntelligentTieringConfigurationCommandError - */ -const de_PutBucketIntelligentTieringConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketInventoryConfigurationCommand */ @@ -6426,7 +4934,7 @@ export const de_PutBucketInventoryConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketInventoryConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6435,26 +4943,6 @@ export const de_PutBucketInventoryConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketInventoryConfigurationCommandError - */ -const de_PutBucketInventoryConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketLifecycleConfigurationCommand */ @@ -6463,7 +4951,7 @@ export const de_PutBucketLifecycleConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketLifecycleConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6472,26 +4960,6 @@ export const de_PutBucketLifecycleConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketLifecycleConfigurationCommandError - */ -const de_PutBucketLifecycleConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketLoggingCommand */ @@ -6500,7 +4968,7 @@ export const de_PutBucketLoggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketLoggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6509,26 +4977,6 @@ export const de_PutBucketLoggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketLoggingCommandError - */ -const de_PutBucketLoggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketMetricsConfigurationCommand */ @@ -6537,7 +4985,7 @@ export const de_PutBucketMetricsConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketMetricsConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6546,26 +4994,6 @@ export const de_PutBucketMetricsConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketMetricsConfigurationCommandError - */ -const de_PutBucketMetricsConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketNotificationConfigurationCommand */ @@ -6574,7 +5002,7 @@ export const de_PutBucketNotificationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketNotificationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6583,26 +5011,6 @@ export const de_PutBucketNotificationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketNotificationConfigurationCommandError - */ -const de_PutBucketNotificationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketOwnershipControlsCommand */ @@ -6611,7 +5019,7 @@ export const de_PutBucketOwnershipControlsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketOwnershipControlsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6620,26 +5028,6 @@ export const de_PutBucketOwnershipControlsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketOwnershipControlsCommandError - */ -const de_PutBucketOwnershipControlsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketPolicyCommand */ @@ -6648,7 +5036,7 @@ export const de_PutBucketPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6657,26 +5045,6 @@ export const de_PutBucketPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketPolicyCommandError - */ -const de_PutBucketPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketReplicationCommand */ @@ -6685,7 +5053,7 @@ export const de_PutBucketReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketReplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6694,26 +5062,6 @@ export const de_PutBucketReplicationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketReplicationCommandError - */ -const de_PutBucketReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketRequestPaymentCommand */ @@ -6722,7 +5070,7 @@ export const de_PutBucketRequestPaymentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketRequestPaymentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6731,26 +5079,6 @@ export const de_PutBucketRequestPaymentCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketRequestPaymentCommandError - */ -const de_PutBucketRequestPaymentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketTaggingCommand */ @@ -6759,7 +5087,7 @@ export const de_PutBucketTaggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketTaggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6768,26 +5096,6 @@ export const de_PutBucketTaggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketTaggingCommandError - */ -const de_PutBucketTaggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketVersioningCommand */ @@ -6796,7 +5104,7 @@ export const de_PutBucketVersioningCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketVersioningCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6805,26 +5113,6 @@ export const de_PutBucketVersioningCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketVersioningCommandError - */ -const de_PutBucketVersioningCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutBucketWebsiteCommand */ @@ -6833,7 +5121,7 @@ export const de_PutBucketWebsiteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutBucketWebsiteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6842,26 +5130,6 @@ export const de_PutBucketWebsiteCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutBucketWebsiteCommandError - */ -const de_PutBucketWebsiteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutObjectCommand */ @@ -6870,7 +5138,7 @@ export const de_PutObjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6893,26 +5161,6 @@ export const de_PutObjectCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutObjectCommandError - */ -const de_PutObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutObjectAclCommand */ @@ -6921,7 +5169,7 @@ export const de_PutObjectAclCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutObjectAclCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6931,32 +5179,6 @@ export const de_PutObjectAclCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutObjectAclCommandError - */ -const de_PutObjectAclCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "NoSuchKey": - case "com.amazonaws.s3#NoSuchKey": - throw await de_NoSuchKeyRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlPutObjectLegalHoldCommand */ @@ -6965,7 +5187,7 @@ export const de_PutObjectLegalHoldCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutObjectLegalHoldCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6975,26 +5197,6 @@ export const de_PutObjectLegalHoldCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutObjectLegalHoldCommandError - */ -const de_PutObjectLegalHoldCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutObjectLockConfigurationCommand */ @@ -7003,7 +5205,7 @@ export const de_PutObjectLockConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutObjectLockConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7013,26 +5215,6 @@ export const de_PutObjectLockConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutObjectLockConfigurationCommandError - */ -const de_PutObjectLockConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutObjectRetentionCommand */ @@ -7041,7 +5223,7 @@ export const de_PutObjectRetentionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutObjectRetentionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7051,26 +5233,6 @@ export const de_PutObjectRetentionCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutObjectRetentionCommandError - */ -const de_PutObjectRetentionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutObjectTaggingCommand */ @@ -7079,7 +5241,7 @@ export const de_PutObjectTaggingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutObjectTaggingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7089,26 +5251,6 @@ export const de_PutObjectTaggingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutObjectTaggingCommandError - */ -const de_PutObjectTaggingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutPublicAccessBlockCommand */ @@ -7117,7 +5259,7 @@ export const de_PutPublicAccessBlockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutPublicAccessBlockCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7126,26 +5268,6 @@ export const de_PutPublicAccessBlockCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutPublicAccessBlockCommandError - */ -const de_PutPublicAccessBlockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlRestoreObjectCommand */ @@ -7154,7 +5276,7 @@ export const de_RestoreObjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RestoreObjectCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7165,32 +5287,6 @@ export const de_RestoreObjectCommand = async ( return contents; }; -/** - * deserializeAws_restXmlRestoreObjectCommandError - */ -const de_RestoreObjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ObjectAlreadyInActiveTierError": - case "com.amazonaws.s3#ObjectAlreadyInActiveTierError": - throw await de_ObjectAlreadyInActiveTierErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlSelectObjectContentCommand */ @@ -7199,7 +5295,7 @@ export const de_SelectObjectContentCommand = async ( context: __SerdeContext & __EventStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SelectObjectContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7209,26 +5305,6 @@ export const de_SelectObjectContentCommand = async ( return contents; }; -/** - * deserializeAws_restXmlSelectObjectContentCommandError - */ -const de_SelectObjectContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlUploadPartCommand */ @@ -7237,7 +5313,7 @@ export const de_UploadPartCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UploadPartCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7257,26 +5333,6 @@ export const de_UploadPartCommand = async ( return contents; }; -/** - * deserializeAws_restXmlUploadPartCommandError - */ -const de_UploadPartCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlUploadPartCopyCommand */ @@ -7285,7 +5341,7 @@ export const de_UploadPartCopyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UploadPartCopyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7302,26 +5358,6 @@ export const de_UploadPartCopyCommand = async ( return contents; }; -/** - * deserializeAws_restXmlUploadPartCopyCommandError - */ -const de_UploadPartCopyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restXmlWriteGetObjectResponseCommand */ @@ -7330,7 +5366,7 @@ export const de_WriteGetObjectResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_WriteGetObjectResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7340,23 +5376,50 @@ export const de_WriteGetObjectResponseCommand = async ( }; /** - * deserializeAws_restXmlWriteGetObjectResponseCommandError + * deserialize_Aws_restXmlCommandError */ -const de_WriteGetObjectResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + switch (errorCode) { + case "NoSuchUpload": + case "com.amazonaws.s3#NoSuchUpload": + throw await de_NoSuchUploadRes(parsedOutput, context); + case "ObjectNotInActiveTierError": + case "com.amazonaws.s3#ObjectNotInActiveTierError": + throw await de_ObjectNotInActiveTierErrorRes(parsedOutput, context); + case "BucketAlreadyExists": + case "com.amazonaws.s3#BucketAlreadyExists": + throw await de_BucketAlreadyExistsRes(parsedOutput, context); + case "BucketAlreadyOwnedByYou": + case "com.amazonaws.s3#BucketAlreadyOwnedByYou": + throw await de_BucketAlreadyOwnedByYouRes(parsedOutput, context); + case "NoSuchBucket": + case "com.amazonaws.s3#NoSuchBucket": + throw await de_NoSuchBucketRes(parsedOutput, context); + case "InvalidObjectState": + case "com.amazonaws.s3#InvalidObjectState": + throw await de_InvalidObjectStateRes(parsedOutput, context); + case "NoSuchKey": + case "com.amazonaws.s3#NoSuchKey": + throw await de_NoSuchKeyRes(parsedOutput, context); + case "NotFound": + case "com.amazonaws.s3#NotFound": + throw await de_NotFoundRes(parsedOutput, context); + case "ObjectAlreadyInActiveTierError": + case "com.amazonaws.s3#ObjectAlreadyInActiveTierError": + throw await de_ObjectAlreadyInActiveTierErrorRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }) as never; + } }; const throwDefaultError = withBaseException(__BaseException); diff --git a/clients/client-s3outposts/src/protocols/Aws_restJson1.ts b/clients/client-s3outposts/src/protocols/Aws_restJson1.ts index b4f5c8a7ec48..c10064aa6667 100644 --- a/clients/client-s3outposts/src/protocols/Aws_restJson1.ts +++ b/clients/client-s3outposts/src/protocols/Aws_restJson1.ts @@ -152,7 +152,7 @@ export const de_CreateEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -165,50 +165,6 @@ export const de_CreateEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEndpointCommandError - */ -const de_CreateEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.s3outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.s3outposts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.s3outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "OutpostOfflineException": - case "com.amazonaws.s3outposts#OutpostOfflineException": - throw await de_OutpostOfflineExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.s3outposts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.s3outposts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.s3outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteEndpointCommand */ @@ -217,7 +173,7 @@ export const de_DeleteEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -226,47 +182,6 @@ export const de_DeleteEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEndpointCommandError - */ -const de_DeleteEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.s3outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.s3outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "OutpostOfflineException": - case "com.amazonaws.s3outposts#OutpostOfflineException": - throw await de_OutpostOfflineExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.s3outposts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.s3outposts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.s3outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEndpointsCommand */ @@ -275,7 +190,7 @@ export const de_ListEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEndpointsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -289,44 +204,6 @@ export const de_ListEndpointsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEndpointsCommandError - */ -const de_ListEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.s3outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.s3outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.s3outposts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.s3outposts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.s3outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListOutpostsWithS3Command */ @@ -335,7 +212,7 @@ export const de_ListOutpostsWithS3Command = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOutpostsWithS3CommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -349,41 +226,6 @@ export const de_ListOutpostsWithS3Command = async ( return contents; }; -/** - * deserializeAws_restJson1ListOutpostsWithS3CommandError - */ -const de_ListOutpostsWithS3CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.s3outposts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.s3outposts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.s3outposts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.s3outposts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSharedEndpointsCommand */ @@ -392,7 +234,7 @@ export const de_ListSharedEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSharedEndpointsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -407,12 +249,9 @@ export const de_ListSharedEndpointsCommand = async ( }; /** - * deserializeAws_restJson1ListSharedEndpointsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_ListSharedEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -422,9 +261,15 @@ const de_ListSharedEndpointsCommandError = async ( case "AccessDeniedException": case "com.amazonaws.s3outposts#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.s3outposts#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.s3outposts#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); + case "OutpostOfflineException": + case "com.amazonaws.s3outposts#OutpostOfflineException": + throw await de_OutpostOfflineExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.s3outposts#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); @@ -440,7 +285,7 @@ const de_ListSharedEndpointsCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts index e838bf1ca520..cd24676c3858 100644 --- a/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-a2i-runtime/src/protocols/Aws_restJson1.ts @@ -156,7 +156,7 @@ export const de_DeleteHumanLoopCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteHumanLoopCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -165,41 +165,6 @@ export const de_DeleteHumanLoopCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteHumanLoopCommandError - */ -const de_DeleteHumanLoopCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.sagemakera2iruntime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakera2iruntime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakera2iruntime#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakera2iruntime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeHumanLoopCommand */ @@ -208,7 +173,7 @@ export const de_DescribeHumanLoopCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeHumanLoopCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -228,41 +193,6 @@ export const de_DescribeHumanLoopCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeHumanLoopCommandError - */ -const de_DescribeHumanLoopCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.sagemakera2iruntime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakera2iruntime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakera2iruntime#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakera2iruntime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListHumanLoopsCommand */ @@ -271,7 +201,7 @@ export const de_ListHumanLoopsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListHumanLoopsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -285,41 +215,6 @@ export const de_ListHumanLoopsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListHumanLoopsCommandError - */ -const de_ListHumanLoopsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.sagemakera2iruntime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakera2iruntime#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakera2iruntime#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakera2iruntime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartHumanLoopCommand */ @@ -328,7 +223,7 @@ export const de_StartHumanLoopCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartHumanLoopCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -341,44 +236,6 @@ export const de_StartHumanLoopCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartHumanLoopCommandError - */ -const de_StartHumanLoopCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemakera2iruntime#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakera2iruntime#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.sagemakera2iruntime#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakera2iruntime#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakera2iruntime#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopHumanLoopCommand */ @@ -387,7 +244,7 @@ export const de_StopHumanLoopCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopHumanLoopCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -397,12 +254,9 @@ export const de_StopHumanLoopCommand = async ( }; /** - * deserializeAws_restJson1StopHumanLoopCommandError + * deserialize_Aws_restJson1CommandError */ -const de_StopHumanLoopCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -421,13 +275,19 @@ const de_StopHumanLoopCommandError = async ( case "ValidationException": case "com.amazonaws.sagemakera2iruntime#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.sagemakera2iruntime#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.sagemakera2iruntime#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts index dfc9004ec6d3..a79f4b72cfd2 100644 --- a/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-edge/src/protocols/Aws_restJson1.ts @@ -109,7 +109,7 @@ export const de_GetDeploymentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeploymentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -122,32 +122,6 @@ export const de_GetDeploymentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeploymentsCommandError - */ -const de_GetDeploymentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.sagemakeredge#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDeviceRegistrationCommand */ @@ -156,7 +130,7 @@ export const de_GetDeviceRegistrationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeviceRegistrationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -170,32 +144,6 @@ export const de_GetDeviceRegistrationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeviceRegistrationCommandError - */ -const de_GetDeviceRegistrationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.sagemakeredge#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SendHeartbeatCommand */ @@ -204,7 +152,7 @@ export const de_SendHeartbeatCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendHeartbeatCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -214,12 +162,9 @@ export const de_SendHeartbeatCommand = async ( }; /** - * deserializeAws_restJson1SendHeartbeatCommandError + * deserialize_Aws_restJson1CommandError */ -const de_SendHeartbeatCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -235,7 +180,7 @@ const de_SendHeartbeatCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts index eb2166b44cec..fc73284ac417 100644 --- a/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-featurestore-runtime/src/protocols/Aws_restJson1.ts @@ -136,7 +136,7 @@ export const de_BatchGetRecordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetRecordCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -151,41 +151,6 @@ export const de_BatchGetRecordCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetRecordCommandError - */ -const de_BatchGetRecordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessForbidden": - case "com.amazonaws.sagemakerfeaturestoreruntime#AccessForbidden": - throw await de_AccessForbiddenRes(parsedOutput, context); - case "InternalFailure": - case "com.amazonaws.sagemakerfeaturestoreruntime#InternalFailure": - throw await de_InternalFailureRes(parsedOutput, context); - case "ServiceUnavailable": - case "com.amazonaws.sagemakerfeaturestoreruntime#ServiceUnavailable": - throw await de_ServiceUnavailableRes(parsedOutput, context); - case "ValidationError": - case "com.amazonaws.sagemakerfeaturestoreruntime#ValidationError": - throw await de_ValidationErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRecordCommand */ @@ -194,7 +159,7 @@ export const de_DeleteRecordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteRecordCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -203,41 +168,6 @@ export const de_DeleteRecordCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteRecordCommandError - */ -const de_DeleteRecordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessForbidden": - case "com.amazonaws.sagemakerfeaturestoreruntime#AccessForbidden": - throw await de_AccessForbiddenRes(parsedOutput, context); - case "InternalFailure": - case "com.amazonaws.sagemakerfeaturestoreruntime#InternalFailure": - throw await de_InternalFailureRes(parsedOutput, context); - case "ServiceUnavailable": - case "com.amazonaws.sagemakerfeaturestoreruntime#ServiceUnavailable": - throw await de_ServiceUnavailableRes(parsedOutput, context); - case "ValidationError": - case "com.amazonaws.sagemakerfeaturestoreruntime#ValidationError": - throw await de_ValidationErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRecordCommand */ @@ -246,7 +176,7 @@ export const de_GetRecordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRecordCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -260,44 +190,6 @@ export const de_GetRecordCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRecordCommandError - */ -const de_GetRecordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessForbidden": - case "com.amazonaws.sagemakerfeaturestoreruntime#AccessForbidden": - throw await de_AccessForbiddenRes(parsedOutput, context); - case "InternalFailure": - case "com.amazonaws.sagemakerfeaturestoreruntime#InternalFailure": - throw await de_InternalFailureRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemakerfeaturestoreruntime#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - case "ServiceUnavailable": - case "com.amazonaws.sagemakerfeaturestoreruntime#ServiceUnavailable": - throw await de_ServiceUnavailableRes(parsedOutput, context); - case "ValidationError": - case "com.amazonaws.sagemakerfeaturestoreruntime#ValidationError": - throw await de_ValidationErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutRecordCommand */ @@ -306,7 +198,7 @@ export const de_PutRecordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutRecordCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -316,12 +208,9 @@ export const de_PutRecordCommand = async ( }; /** - * deserializeAws_restJson1PutRecordCommandError + * deserialize_Aws_restJson1CommandError */ -const de_PutRecordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -340,13 +229,16 @@ const de_PutRecordCommandError = async ( case "ValidationError": case "com.amazonaws.sagemakerfeaturestoreruntime#ValidationError": throw await de_ValidationErrorRes(parsedOutput, context); + case "ResourceNotFound": + case "com.amazonaws.sagemakerfeaturestoreruntime#ResourceNotFound": + throw await de_ResourceNotFoundRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-sagemaker-geospatial/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-geospatial/src/protocols/Aws_restJson1.ts index 471cbaa804f5..07cc205d9488 100644 --- a/clients/client-sagemaker-geospatial/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-geospatial/src/protocols/Aws_restJson1.ts @@ -589,7 +589,7 @@ export const de_DeleteEarthObservationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEarthObservationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -598,47 +598,6 @@ export const de_DeleteEarthObservationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEarthObservationJobCommandError - */ -const de_DeleteEarthObservationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.sagemakergeospatial#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteVectorEnrichmentJobCommand */ @@ -647,7 +606,7 @@ export const de_DeleteVectorEnrichmentJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteVectorEnrichmentJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -656,47 +615,6 @@ export const de_DeleteVectorEnrichmentJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteVectorEnrichmentJobCommandError - */ -const de_DeleteVectorEnrichmentJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.sagemakergeospatial#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExportEarthObservationJobCommand */ @@ -705,7 +623,7 @@ export const de_ExportEarthObservationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExportEarthObservationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -723,50 +641,6 @@ export const de_ExportEarthObservationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExportEarthObservationJobCommandError - */ -const de_ExportEarthObservationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.sagemakergeospatial#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.sagemakergeospatial#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExportVectorEnrichmentJobCommand */ @@ -775,7 +649,7 @@ export const de_ExportVectorEnrichmentJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExportVectorEnrichmentJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -792,50 +666,6 @@ export const de_ExportVectorEnrichmentJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExportVectorEnrichmentJobCommandError - */ -const de_ExportVectorEnrichmentJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.sagemakergeospatial#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.sagemakergeospatial#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEarthObservationJobCommand */ @@ -844,7 +674,7 @@ export const de_GetEarthObservationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEarthObservationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -870,44 +700,6 @@ export const de_GetEarthObservationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEarthObservationJobCommandError - */ -const de_GetEarthObservationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRasterDataCollectionCommand */ @@ -916,7 +708,7 @@ export const de_GetRasterDataCollectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRasterDataCollectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -936,44 +728,6 @@ export const de_GetRasterDataCollectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRasterDataCollectionCommandError - */ -const de_GetRasterDataCollectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTileCommand */ @@ -982,7 +736,7 @@ export const de_GetTileCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -993,44 +747,6 @@ export const de_GetTileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTileCommandError - */ -const de_GetTileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetVectorEnrichmentJobCommand */ @@ -1039,7 +755,7 @@ export const de_GetVectorEnrichmentJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetVectorEnrichmentJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1065,44 +781,6 @@ export const de_GetVectorEnrichmentJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetVectorEnrichmentJobCommandError - */ -const de_GetVectorEnrichmentJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListEarthObservationJobsCommand */ @@ -1111,7 +789,7 @@ export const de_ListEarthObservationJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEarthObservationJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1125,44 +803,6 @@ export const de_ListEarthObservationJobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListEarthObservationJobsCommandError - */ -const de_ListEarthObservationJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRasterDataCollectionsCommand */ @@ -1171,7 +811,7 @@ export const de_ListRasterDataCollectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRasterDataCollectionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1185,44 +825,6 @@ export const de_ListRasterDataCollectionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRasterDataCollectionsCommandError - */ -const de_ListRasterDataCollectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1231,176 +833,62 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListVectorEnrichmentJobsCommand - */ -export const de_ListVectorEnrichmentJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListVectorEnrichmentJobsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - VectorEnrichmentJobSummaries: (_) => de_VectorEnrichmentJobList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListVectorEnrichmentJobsCommandError - */ -const de_ListVectorEnrichmentJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SearchRasterDataCollectionCommand + * deserializeAws_restJson1ListVectorEnrichmentJobsCommand */ -export const de_SearchRasterDataCollectionCommand = async ( +export const de_ListVectorEnrichmentJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchRasterDataCollectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ApproximateResultCount: __expectInt32, - Items: (_) => de_ItemSourceList(_, context), NextToken: __expectString, + VectorEnrichmentJobSummaries: (_) => de_VectorEnrichmentJobList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SearchRasterDataCollectionCommandError + * deserializeAws_restJson1SearchRasterDataCollectionCommand */ -const de_SearchRasterDataCollectionCommandError = async ( +export const de_SearchRasterDataCollectionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ApproximateResultCount: __expectInt32, + Items: (_) => de_ItemSourceList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1411,7 +899,7 @@ export const de_StartEarthObservationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartEarthObservationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1433,50 +921,6 @@ export const de_StartEarthObservationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartEarthObservationJobCommandError - */ -const de_StartEarthObservationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.sagemakergeospatial#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.sagemakergeospatial#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartVectorEnrichmentJobCommand */ @@ -1485,7 +929,7 @@ export const de_StartVectorEnrichmentJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartVectorEnrichmentJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1508,50 +952,6 @@ export const de_StartVectorEnrichmentJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartVectorEnrichmentJobCommandError - */ -const de_StartVectorEnrichmentJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.sagemakergeospatial#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.sagemakergeospatial#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopEarthObservationJobCommand */ @@ -1560,7 +960,7 @@ export const de_StopEarthObservationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopEarthObservationJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1569,47 +969,6 @@ export const de_StopEarthObservationJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopEarthObservationJobCommandError - */ -const de_StopEarthObservationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.sagemakergeospatial#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopVectorEnrichmentJobCommand */ @@ -1618,7 +977,7 @@ export const de_StopVectorEnrichmentJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopVectorEnrichmentJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1627,47 +986,6 @@ export const de_StopVectorEnrichmentJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopVectorEnrichmentJobCommandError - */ -const de_StopVectorEnrichmentJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.sagemakergeospatial#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1676,7 +994,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1685,44 +1003,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.sagemakergeospatial#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.sagemakergeospatial#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sagemakergeospatial#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.sagemakergeospatial#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sagemakergeospatial#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1731,7 +1011,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1741,12 +1021,9 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1756,6 +1033,9 @@ const de_UntagResourceCommandError = async ( case "AccessDeniedException": case "com.amazonaws.sagemakergeospatial#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.sagemakergeospatial#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.sagemakergeospatial#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); @@ -1768,13 +1048,16 @@ const de_UntagResourceCommandError = async ( case "ValidationException": case "com.amazonaws.sagemakergeospatial#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.sagemakergeospatial#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts index df6361a01de7..77719fae7b61 100644 --- a/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-metrics/src/protocols/Aws_restJson1.ts @@ -52,7 +52,7 @@ export const de_BatchPutMetricsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchPutMetricsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -66,12 +66,9 @@ export const de_BatchPutMetricsCommand = async ( }; /** - * deserializeAws_restJson1BatchPutMetricsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_BatchPutMetricsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -82,7 +79,7 @@ const de_BatchPutMetricsCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; }; const throwDefaultError = withBaseException(__BaseException); diff --git a/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts b/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts index a3b6ad10fe07..d06aee0fc614 100644 --- a/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-sagemaker-runtime/src/protocols/Aws_restJson1.ts @@ -132,7 +132,7 @@ export const de_InvokeEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_InvokeEndpointCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -145,47 +145,6 @@ export const de_InvokeEndpointCommand = async ( return contents; }; -/** - * deserializeAws_restJson1InvokeEndpointCommandError - */ -const de_InvokeEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalDependencyException": - case "com.amazonaws.sagemakerruntime#InternalDependencyException": - throw await de_InternalDependencyExceptionRes(parsedOutput, context); - case "InternalFailure": - case "com.amazonaws.sagemakerruntime#InternalFailure": - throw await de_InternalFailureRes(parsedOutput, context); - case "ModelError": - case "com.amazonaws.sagemakerruntime#ModelError": - throw await de_ModelErrorRes(parsedOutput, context); - case "ModelNotReadyException": - case "com.amazonaws.sagemakerruntime#ModelNotReadyException": - throw await de_ModelNotReadyExceptionRes(parsedOutput, context); - case "ServiceUnavailable": - case "com.amazonaws.sagemakerruntime#ServiceUnavailable": - throw await de_ServiceUnavailableRes(parsedOutput, context); - case "ValidationError": - case "com.amazonaws.sagemakerruntime#ValidationError": - throw await de_ValidationErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1InvokeEndpointAsyncCommand */ @@ -194,7 +153,7 @@ export const de_InvokeEndpointAsyncCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_InvokeEndpointAsyncCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -209,38 +168,6 @@ export const de_InvokeEndpointAsyncCommand = async ( return contents; }; -/** - * deserializeAws_restJson1InvokeEndpointAsyncCommandError - */ -const de_InvokeEndpointAsyncCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalFailure": - case "com.amazonaws.sagemakerruntime#InternalFailure": - throw await de_InternalFailureRes(parsedOutput, context); - case "ServiceUnavailable": - case "com.amazonaws.sagemakerruntime#ServiceUnavailable": - throw await de_ServiceUnavailableRes(parsedOutput, context); - case "ValidationError": - case "com.amazonaws.sagemakerruntime#ValidationError": - throw await de_ValidationErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1InvokeEndpointWithResponseStreamCommand */ @@ -249,7 +176,7 @@ export const de_InvokeEndpointWithResponseStreamCommand = async ( context: __SerdeContext & __EventStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_InvokeEndpointWithResponseStreamCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -263,43 +190,46 @@ export const de_InvokeEndpointWithResponseStreamCommand = async ( }; /** - * deserializeAws_restJson1InvokeEndpointWithResponseStreamCommandError + * deserialize_Aws_restJson1CommandError */ -const de_InvokeEndpointWithResponseStreamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "InternalDependencyException": + case "com.amazonaws.sagemakerruntime#InternalDependencyException": + throw await de_InternalDependencyExceptionRes(parsedOutput, context); case "InternalFailure": case "com.amazonaws.sagemakerruntime#InternalFailure": throw await de_InternalFailureRes(parsedOutput, context); - case "InternalStreamFailure": - case "com.amazonaws.sagemakerruntime#InternalStreamFailure": - throw await de_InternalStreamFailureRes(parsedOutput, context); case "ModelError": case "com.amazonaws.sagemakerruntime#ModelError": throw await de_ModelErrorRes(parsedOutput, context); - case "ModelStreamError": - case "com.amazonaws.sagemakerruntime#ModelStreamError": - throw await de_ModelStreamErrorRes(parsedOutput, context); + case "ModelNotReadyException": + case "com.amazonaws.sagemakerruntime#ModelNotReadyException": + throw await de_ModelNotReadyExceptionRes(parsedOutput, context); case "ServiceUnavailable": case "com.amazonaws.sagemakerruntime#ServiceUnavailable": throw await de_ServiceUnavailableRes(parsedOutput, context); case "ValidationError": case "com.amazonaws.sagemakerruntime#ValidationError": throw await de_ValidationErrorRes(parsedOutput, context); + case "InternalStreamFailure": + case "com.amazonaws.sagemakerruntime#InternalStreamFailure": + throw await de_InternalStreamFailureRes(parsedOutput, context); + case "ModelStreamError": + case "com.amazonaws.sagemakerruntime#ModelStreamError": + throw await de_ModelStreamErrorRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-sagemaker/src/protocols/Aws_json1_1.ts b/clients/client-sagemaker/src/protocols/Aws_json1_1.ts index 9be98c9a096e..f14c4ecc6519 100644 --- a/clients/client-sagemaker/src/protocols/Aws_json1_1.ts +++ b/clients/client-sagemaker/src/protocols/Aws_json1_1.ts @@ -6170,7 +6170,7 @@ export const de_AddAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6182,35 +6182,6 @@ export const de_AddAssociationCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddAssociationCommandError - */ -const de_AddAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddTagsCommand */ @@ -6219,7 +6190,7 @@ export const de_AddTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6231,26 +6202,6 @@ export const de_AddTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddTagsCommandError - */ -const de_AddTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1AssociateTrialComponentCommand */ @@ -6259,7 +6210,7 @@ export const de_AssociateTrialComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateTrialComponentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6271,35 +6222,6 @@ export const de_AssociateTrialComponentCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateTrialComponentCommandError - */ -const de_AssociateTrialComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDescribeModelPackageCommand */ @@ -6308,7 +6230,7 @@ export const de_BatchDescribeModelPackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDescribeModelPackageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6320,26 +6242,6 @@ export const de_BatchDescribeModelPackageCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchDescribeModelPackageCommandError - */ -const de_BatchDescribeModelPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1CreateActionCommand */ @@ -6348,7 +6250,7 @@ export const de_CreateActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6360,32 +6262,6 @@ export const de_CreateActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateActionCommandError - */ -const de_CreateActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAlgorithmCommand */ @@ -6394,7 +6270,7 @@ export const de_CreateAlgorithmCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAlgorithmCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6406,26 +6282,6 @@ export const de_CreateAlgorithmCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAlgorithmCommandError - */ -const de_CreateAlgorithmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1CreateAppCommand */ @@ -6434,7 +6290,7 @@ export const de_CreateAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAppCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6446,35 +6302,6 @@ export const de_CreateAppCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAppCommandError - */ -const de_CreateAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAppImageConfigCommand */ @@ -6483,7 +6310,7 @@ export const de_CreateAppImageConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAppImageConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6495,32 +6322,6 @@ export const de_CreateAppImageConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAppImageConfigCommandError - */ -const de_CreateAppImageConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateArtifactCommand */ @@ -6529,7 +6330,7 @@ export const de_CreateArtifactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateArtifactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6541,32 +6342,6 @@ export const de_CreateArtifactCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateArtifactCommandError - */ -const de_CreateArtifactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAutoMLJobCommand */ @@ -6575,7 +6350,7 @@ export const de_CreateAutoMLJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAutoMLJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6587,35 +6362,6 @@ export const de_CreateAutoMLJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAutoMLJobCommandError - */ -const de_CreateAutoMLJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAutoMLJobV2Command */ @@ -6624,7 +6370,7 @@ export const de_CreateAutoMLJobV2Command = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAutoMLJobV2CommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6637,48 +6383,39 @@ export const de_CreateAutoMLJobV2Command = async ( }; /** - * deserializeAws_json1_1CreateAutoMLJobV2CommandError + * deserializeAws_json1_1CreateClusterCommand */ -const de_CreateAutoMLJobV2CommandError = async ( +export const de_CreateClusterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateClusterResponse(data, context); + const response: CreateClusterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateClusterCommand + * deserializeAws_json1_1CreateCodeRepositoryCommand */ -export const de_CreateClusterCommand = async ( +export const de_CreateCodeRepositoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateClusterResponse(data, context); - const response: CreateClusterCommandOutput = { + contents = de_CreateCodeRepositoryOutput(data, context); + const response: CreateCodeRepositoryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6686,83 +6423,14 @@ export const de_CreateClusterCommand = async ( }; /** - * deserializeAws_json1_1CreateClusterCommandError + * deserializeAws_json1_1CreateCompilationJobCommand */ -const de_CreateClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateCodeRepositoryCommand - */ -export const de_CreateCodeRepositoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateCodeRepositoryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateCodeRepositoryOutput(data, context); - const response: CreateCodeRepositoryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateCodeRepositoryCommandError - */ -const de_CreateCodeRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1CreateCompilationJobCommand - */ -export const de_CreateCompilationJobCommand = async ( +export const de_CreateCompilationJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCompilationJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6774,35 +6442,6 @@ export const de_CreateCompilationJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCompilationJobCommandError - */ -const de_CreateCompilationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateContextCommand */ @@ -6811,7 +6450,7 @@ export const de_CreateContextCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateContextCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6823,32 +6462,6 @@ export const de_CreateContextCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateContextCommandError - */ -const de_CreateContextCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDataQualityJobDefinitionCommand */ @@ -6857,7 +6470,7 @@ export const de_CreateDataQualityJobDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDataQualityJobDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6869,35 +6482,6 @@ export const de_CreateDataQualityJobDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDataQualityJobDefinitionCommandError - */ -const de_CreateDataQualityJobDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDeviceFleetCommand */ @@ -6906,7 +6490,7 @@ export const de_CreateDeviceFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDeviceFleetCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateDeviceFleetCommandOutput = { @@ -6915,35 +6499,6 @@ export const de_CreateDeviceFleetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDeviceFleetCommandError - */ -const de_CreateDeviceFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateDomainCommand */ @@ -6952,7 +6507,7 @@ export const de_CreateDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6964,35 +6519,6 @@ export const de_CreateDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateDomainCommandError - */ -const de_CreateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateEdgeDeploymentPlanCommand */ @@ -7001,7 +6527,7 @@ export const de_CreateEdgeDeploymentPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEdgeDeploymentPlanCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7013,32 +6539,6 @@ export const de_CreateEdgeDeploymentPlanCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateEdgeDeploymentPlanCommandError - */ -const de_CreateEdgeDeploymentPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateEdgeDeploymentStageCommand */ @@ -7047,7 +6547,7 @@ export const de_CreateEdgeDeploymentStageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEdgeDeploymentStageCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateEdgeDeploymentStageCommandOutput = { @@ -7056,32 +6556,6 @@ export const de_CreateEdgeDeploymentStageCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateEdgeDeploymentStageCommandError - */ -const de_CreateEdgeDeploymentStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateEdgePackagingJobCommand */ @@ -7090,7 +6564,7 @@ export const de_CreateEdgePackagingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEdgePackagingJobCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateEdgePackagingJobCommandOutput = { @@ -7099,32 +6573,6 @@ export const de_CreateEdgePackagingJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateEdgePackagingJobCommandError - */ -const de_CreateEdgePackagingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateEndpointCommand */ @@ -7133,7 +6581,7 @@ export const de_CreateEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7146,40 +6594,14 @@ export const de_CreateEndpointCommand = async ( }; /** - * deserializeAws_json1_1CreateEndpointCommandError - */ -const de_CreateEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateEndpointConfigCommand + * deserializeAws_json1_1CreateEndpointConfigCommand */ export const de_CreateEndpointConfigCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateEndpointConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7191,32 +6613,6 @@ export const de_CreateEndpointConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateEndpointConfigCommandError - */ -const de_CreateEndpointConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateExperimentCommand */ @@ -7225,7 +6621,7 @@ export const de_CreateExperimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateExperimentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7237,32 +6633,6 @@ export const de_CreateExperimentCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateExperimentCommandError - */ -const de_CreateExperimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateFeatureGroupCommand */ @@ -7271,7 +6641,7 @@ export const de_CreateFeatureGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFeatureGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7283,35 +6653,6 @@ export const de_CreateFeatureGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateFeatureGroupCommandError - */ -const de_CreateFeatureGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateFlowDefinitionCommand */ @@ -7320,7 +6661,7 @@ export const de_CreateFlowDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateFlowDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7332,35 +6673,6 @@ export const de_CreateFlowDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateFlowDefinitionCommandError - */ -const de_CreateFlowDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateHubCommand */ @@ -7369,7 +6681,7 @@ export const de_CreateHubCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateHubCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7381,35 +6693,6 @@ export const de_CreateHubCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateHubCommandError - */ -const de_CreateHubCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateHumanTaskUiCommand */ @@ -7418,7 +6701,7 @@ export const de_CreateHumanTaskUiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateHumanTaskUiCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7430,35 +6713,6 @@ export const de_CreateHumanTaskUiCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateHumanTaskUiCommandError - */ -const de_CreateHumanTaskUiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateHyperParameterTuningJobCommand */ @@ -7467,7 +6721,7 @@ export const de_CreateHyperParameterTuningJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateHyperParameterTuningJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7479,35 +6733,6 @@ export const de_CreateHyperParameterTuningJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateHyperParameterTuningJobCommandError - */ -const de_CreateHyperParameterTuningJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateImageCommand */ @@ -7516,7 +6741,7 @@ export const de_CreateImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7528,35 +6753,6 @@ export const de_CreateImageCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateImageCommandError - */ -const de_CreateImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateImageVersionCommand */ @@ -7565,7 +6761,7 @@ export const de_CreateImageVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateImageVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7577,38 +6773,6 @@ export const de_CreateImageVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateImageVersionCommandError - */ -const de_CreateImageVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateInferenceComponentCommand */ @@ -7617,7 +6781,7 @@ export const de_CreateInferenceComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateInferenceComponentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7630,40 +6794,14 @@ export const de_CreateInferenceComponentCommand = async ( }; /** - * deserializeAws_json1_1CreateInferenceComponentCommandError - */ -const de_CreateInferenceComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateInferenceExperimentCommand + * deserializeAws_json1_1CreateInferenceExperimentCommand */ export const de_CreateInferenceExperimentCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateInferenceExperimentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7675,35 +6813,6 @@ export const de_CreateInferenceExperimentCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateInferenceExperimentCommandError - */ -const de_CreateInferenceExperimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateInferenceRecommendationsJobCommand */ @@ -7712,7 +6821,7 @@ export const de_CreateInferenceRecommendationsJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateInferenceRecommendationsJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7724,35 +6833,6 @@ export const de_CreateInferenceRecommendationsJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateInferenceRecommendationsJobCommandError - */ -const de_CreateInferenceRecommendationsJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLabelingJobCommand */ @@ -7761,7 +6841,7 @@ export const de_CreateLabelingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLabelingJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7773,35 +6853,6 @@ export const de_CreateLabelingJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateLabelingJobCommandError - */ -const de_CreateLabelingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateModelCommand */ @@ -7810,7 +6861,7 @@ export const de_CreateModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateModelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7822,32 +6873,6 @@ export const de_CreateModelCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateModelCommandError - */ -const de_CreateModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateModelBiasJobDefinitionCommand */ @@ -7856,7 +6881,7 @@ export const de_CreateModelBiasJobDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateModelBiasJobDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7868,35 +6893,6 @@ export const de_CreateModelBiasJobDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateModelBiasJobDefinitionCommandError - */ -const de_CreateModelBiasJobDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateModelCardCommand */ @@ -7905,7 +6901,7 @@ export const de_CreateModelCardCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateModelCardCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7917,35 +6913,6 @@ export const de_CreateModelCardCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateModelCardCommandError - */ -const de_CreateModelCardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateModelCardExportJobCommand */ @@ -7954,7 +6921,7 @@ export const de_CreateModelCardExportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateModelCardExportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -7966,38 +6933,6 @@ export const de_CreateModelCardExportJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateModelCardExportJobCommandError - */ -const de_CreateModelCardExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateModelExplainabilityJobDefinitionCommand */ @@ -8006,7 +6941,7 @@ export const de_CreateModelExplainabilityJobDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateModelExplainabilityJobDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8019,48 +6954,39 @@ export const de_CreateModelExplainabilityJobDefinitionCommand = async ( }; /** - * deserializeAws_json1_1CreateModelExplainabilityJobDefinitionCommandError + * deserializeAws_json1_1CreateModelPackageCommand */ -const de_CreateModelExplainabilityJobDefinitionCommandError = async ( +export const de_CreateModelPackageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateModelPackageOutput(data, context); + const response: CreateModelPackageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateModelPackageCommand + * deserializeAws_json1_1CreateModelPackageGroupCommand */ -export const de_CreateModelPackageCommand = async ( +export const de_CreateModelPackageGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateModelPackageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateModelPackageOutput(data, context); - const response: CreateModelPackageCommandOutput = { + contents = de_CreateModelPackageGroupOutput(data, context); + const response: CreateModelPackageGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -8068,89 +6994,14 @@ export const de_CreateModelPackageCommand = async ( }; /** - * deserializeAws_json1_1CreateModelPackageCommandError + * deserializeAws_json1_1CreateModelQualityJobDefinitionCommand */ -const de_CreateModelPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateModelPackageGroupCommand - */ -export const de_CreateModelPackageGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateModelPackageGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateModelPackageGroupOutput(data, context); - const response: CreateModelPackageGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateModelPackageGroupCommandError - */ -const de_CreateModelPackageGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateModelQualityJobDefinitionCommand - */ -export const de_CreateModelQualityJobDefinitionCommand = async ( +export const de_CreateModelQualityJobDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateModelQualityJobDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8162,35 +7013,6 @@ export const de_CreateModelQualityJobDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateModelQualityJobDefinitionCommandError - */ -const de_CreateModelQualityJobDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateMonitoringScheduleCommand */ @@ -8199,7 +7021,7 @@ export const de_CreateMonitoringScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateMonitoringScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8211,35 +7033,6 @@ export const de_CreateMonitoringScheduleCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateMonitoringScheduleCommandError - */ -const de_CreateMonitoringScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateNotebookInstanceCommand */ @@ -8248,7 +7041,7 @@ export const de_CreateNotebookInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateNotebookInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8260,32 +7053,6 @@ export const de_CreateNotebookInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateNotebookInstanceCommandError - */ -const de_CreateNotebookInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateNotebookInstanceLifecycleConfigCommand */ @@ -8294,7 +7061,7 @@ export const de_CreateNotebookInstanceLifecycleConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateNotebookInstanceLifecycleConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8306,32 +7073,6 @@ export const de_CreateNotebookInstanceLifecycleConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateNotebookInstanceLifecycleConfigCommandError - */ -const de_CreateNotebookInstanceLifecycleConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePipelineCommand */ @@ -8340,7 +7081,7 @@ export const de_CreatePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePipelineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8352,38 +7093,6 @@ export const de_CreatePipelineCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePipelineCommandError - */ -const de_CreatePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePresignedDomainUrlCommand */ @@ -8392,7 +7101,7 @@ export const de_CreatePresignedDomainUrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePresignedDomainUrlCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8404,32 +7113,6 @@ export const de_CreatePresignedDomainUrlCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePresignedDomainUrlCommandError - */ -const de_CreatePresignedDomainUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePresignedNotebookInstanceUrlCommand */ @@ -8438,7 +7121,7 @@ export const de_CreatePresignedNotebookInstanceUrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePresignedNotebookInstanceUrlCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8450,26 +7133,6 @@ export const de_CreatePresignedNotebookInstanceUrlCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePresignedNotebookInstanceUrlCommandError - */ -const de_CreatePresignedNotebookInstanceUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1CreateProcessingJobCommand */ @@ -8478,7 +7141,7 @@ export const de_CreateProcessingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateProcessingJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8490,38 +7153,6 @@ export const de_CreateProcessingJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateProcessingJobCommandError - */ -const de_CreateProcessingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateProjectCommand */ @@ -8530,7 +7161,7 @@ export const de_CreateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8543,40 +7174,14 @@ export const de_CreateProjectCommand = async ( }; /** - * deserializeAws_json1_1CreateProjectCommandError - */ -const de_CreateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateSpaceCommand + * deserializeAws_json1_1CreateSpaceCommand */ export const de_CreateSpaceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSpaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8588,35 +7193,6 @@ export const de_CreateSpaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateSpaceCommandError - */ -const de_CreateSpaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateStudioLifecycleConfigCommand */ @@ -8625,7 +7201,7 @@ export const de_CreateStudioLifecycleConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateStudioLifecycleConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8637,32 +7213,6 @@ export const de_CreateStudioLifecycleConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateStudioLifecycleConfigCommandError - */ -const de_CreateStudioLifecycleConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTrainingJobCommand */ @@ -8671,7 +7221,7 @@ export const de_CreateTrainingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTrainingJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8683,38 +7233,6 @@ export const de_CreateTrainingJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateTrainingJobCommandError - */ -const de_CreateTrainingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTransformJobCommand */ @@ -8723,7 +7241,7 @@ export const de_CreateTransformJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTransformJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8735,38 +7253,6 @@ export const de_CreateTransformJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateTransformJobCommandError - */ -const de_CreateTransformJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTrialCommand */ @@ -8775,7 +7261,7 @@ export const de_CreateTrialCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTrialCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8787,35 +7273,6 @@ export const de_CreateTrialCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateTrialCommandError - */ -const de_CreateTrialCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTrialComponentCommand */ @@ -8824,7 +7281,7 @@ export const de_CreateTrialComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTrialComponentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8836,32 +7293,6 @@ export const de_CreateTrialComponentCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateTrialComponentCommandError - */ -const de_CreateTrialComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateUserProfileCommand */ @@ -8870,7 +7301,7 @@ export const de_CreateUserProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateUserProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8882,35 +7313,6 @@ export const de_CreateUserProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateUserProfileCommandError - */ -const de_CreateUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateWorkforceCommand */ @@ -8919,7 +7321,7 @@ export const de_CreateWorkforceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateWorkforceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8931,26 +7333,6 @@ export const de_CreateWorkforceCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateWorkforceCommandError - */ -const de_CreateWorkforceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1CreateWorkteamCommand */ @@ -8959,7 +7341,7 @@ export const de_CreateWorkteamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateWorkteamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -8971,35 +7353,6 @@ export const de_CreateWorkteamCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateWorkteamCommandError - */ -const de_CreateWorkteamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteActionCommand */ @@ -9008,7 +7361,7 @@ export const de_DeleteActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -9021,40 +7374,14 @@ export const de_DeleteActionCommand = async ( }; /** - * deserializeAws_json1_1DeleteActionCommandError + * deserializeAws_json1_1DeleteAlgorithmCommand */ -const de_DeleteActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteAlgorithmCommand - */ -export const de_DeleteAlgorithmCommand = async ( +export const de_DeleteAlgorithmCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAlgorithmCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteAlgorithmCommandOutput = { @@ -9063,32 +7390,6 @@ export const de_DeleteAlgorithmCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAlgorithmCommandError - */ -const de_DeleteAlgorithmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAppCommand */ @@ -9097,7 +7398,7 @@ export const de_DeleteAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAppCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteAppCommandOutput = { @@ -9106,35 +7407,6 @@ export const de_DeleteAppCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAppCommandError - */ -const de_DeleteAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAppImageConfigCommand */ @@ -9143,7 +7415,7 @@ export const de_DeleteAppImageConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAppImageConfigCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteAppImageConfigCommandOutput = { @@ -9152,32 +7424,6 @@ export const de_DeleteAppImageConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAppImageConfigCommandError - */ -const de_DeleteAppImageConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteArtifactCommand */ @@ -9186,7 +7432,7 @@ export const de_DeleteArtifactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteArtifactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -9198,32 +7444,6 @@ export const de_DeleteArtifactCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteArtifactCommandError - */ -const de_DeleteArtifactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAssociationCommand */ @@ -9232,7 +7452,7 @@ export const de_DeleteAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -9244,32 +7464,6 @@ export const de_DeleteAssociationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAssociationCommandError - */ -const de_DeleteAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteClusterCommand */ @@ -9278,7 +7472,7 @@ export const de_DeleteClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -9290,35 +7484,6 @@ export const de_DeleteClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteClusterCommandError - */ -const de_DeleteClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteCodeRepositoryCommand */ @@ -9327,7 +7492,7 @@ export const de_DeleteCodeRepositoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCodeRepositoryCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteCodeRepositoryCommandOutput = { @@ -9336,26 +7501,6 @@ export const de_DeleteCodeRepositoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteCodeRepositoryCommandError - */ -const de_DeleteCodeRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DeleteCompilationJobCommand */ @@ -9364,7 +7509,7 @@ export const de_DeleteCompilationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCompilationJobCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteCompilationJobCommandOutput = { @@ -9373,32 +7518,6 @@ export const de_DeleteCompilationJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteCompilationJobCommandError - */ -const de_DeleteCompilationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteContextCommand */ @@ -9407,7 +7526,7 @@ export const de_DeleteContextCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteContextCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -9419,32 +7538,6 @@ export const de_DeleteContextCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteContextCommandError - */ -const de_DeleteContextCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteDataQualityJobDefinitionCommand */ @@ -9453,7 +7546,7 @@ export const de_DeleteDataQualityJobDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDataQualityJobDefinitionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteDataQualityJobDefinitionCommandOutput = { @@ -9463,129 +7556,48 @@ export const de_DeleteDataQualityJobDefinitionCommand = async ( }; /** - * deserializeAws_json1_1DeleteDataQualityJobDefinitionCommandError + * deserializeAws_json1_1DeleteDeviceFleetCommand */ -const de_DeleteDataQualityJobDefinitionCommandError = async ( +export const de_DeleteDeviceFleetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteDeviceFleetCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteDeviceFleetCommand + * deserializeAws_json1_1DeleteDomainCommand */ -export const de_DeleteDeviceFleetCommand = async ( +export const de_DeleteDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDeviceFleetCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteDeviceFleetCommandOutput = { + const response: DeleteDomainCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteDeviceFleetCommandError + * deserializeAws_json1_1DeleteEdgeDeploymentPlanCommand */ -const de_DeleteDeviceFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteDomainCommand - */ -export const de_DeleteDomainCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteDomainCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteDomainCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteDomainCommandError - */ -const de_DeleteDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteEdgeDeploymentPlanCommand - */ -export const de_DeleteEdgeDeploymentPlanCommand = async ( +export const de_DeleteEdgeDeploymentPlanCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEdgeDeploymentPlanCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteEdgeDeploymentPlanCommandOutput = { @@ -9594,32 +7606,6 @@ export const de_DeleteEdgeDeploymentPlanCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteEdgeDeploymentPlanCommandError - */ -const de_DeleteEdgeDeploymentPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteEdgeDeploymentStageCommand */ @@ -9628,7 +7614,7 @@ export const de_DeleteEdgeDeploymentStageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEdgeDeploymentStageCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteEdgeDeploymentStageCommandOutput = { @@ -9637,32 +7623,6 @@ export const de_DeleteEdgeDeploymentStageCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteEdgeDeploymentStageCommandError - */ -const de_DeleteEdgeDeploymentStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteEndpointCommand */ @@ -9671,7 +7631,7 @@ export const de_DeleteEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEndpointCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteEndpointCommandOutput = { @@ -9680,26 +7640,6 @@ export const de_DeleteEndpointCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteEndpointCommandError - */ -const de_DeleteEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DeleteEndpointConfigCommand */ @@ -9708,7 +7648,7 @@ export const de_DeleteEndpointConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteEndpointConfigCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteEndpointConfigCommandOutput = { @@ -9717,26 +7657,6 @@ export const de_DeleteEndpointConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteEndpointConfigCommandError - */ -const de_DeleteEndpointConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DeleteExperimentCommand */ @@ -9745,7 +7665,7 @@ export const de_DeleteExperimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteExperimentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -9757,32 +7677,6 @@ export const de_DeleteExperimentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteExperimentCommandError - */ -const de_DeleteExperimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteFeatureGroupCommand */ @@ -9791,7 +7685,7 @@ export const de_DeleteFeatureGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteFeatureGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteFeatureGroupCommandOutput = { @@ -9800,32 +7694,6 @@ export const de_DeleteFeatureGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteFeatureGroupCommandError - */ -const de_DeleteFeatureGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteFlowDefinitionCommand */ @@ -9834,7 +7702,7 @@ export const de_DeleteFlowDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteFlowDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -9846,35 +7714,6 @@ export const de_DeleteFlowDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteFlowDefinitionCommandError - */ -const de_DeleteFlowDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteHubCommand */ @@ -9883,7 +7722,7 @@ export const de_DeleteHubCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteHubCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteHubCommandOutput = { @@ -9893,135 +7732,51 @@ export const de_DeleteHubCommand = async ( }; /** - * deserializeAws_json1_1DeleteHubCommandError + * deserializeAws_json1_1DeleteHubContentCommand */ -const de_DeleteHubCommandError = async ( +export const de_DeleteHubContentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteHubContentCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteHubContentCommand + * deserializeAws_json1_1DeleteHumanTaskUiCommand */ -export const de_DeleteHubContentCommand = async ( +export const de_DeleteHumanTaskUiCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteHubContentCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteHubContentCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteHumanTaskUiResponse(data, context); + const response: DeleteHumanTaskUiCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1DeleteHubContentCommandError + * deserializeAws_json1_1DeleteHyperParameterTuningJobCommand */ -const de_DeleteHubContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteHumanTaskUiCommand - */ -export const de_DeleteHumanTaskUiCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteHumanTaskUiCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeleteHumanTaskUiResponse(data, context); - const response: DeleteHumanTaskUiCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteHumanTaskUiCommandError - */ -const de_DeleteHumanTaskUiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteHyperParameterTuningJobCommand - */ -export const de_DeleteHyperParameterTuningJobCommand = async ( +export const de_DeleteHyperParameterTuningJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteHyperParameterTuningJobCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteHyperParameterTuningJobCommandOutput = { @@ -10030,26 +7785,6 @@ export const de_DeleteHyperParameterTuningJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteHyperParameterTuningJobCommandError - */ -const de_DeleteHyperParameterTuningJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DeleteImageCommand */ @@ -10058,7 +7793,7 @@ export const de_DeleteImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -10070,35 +7805,6 @@ export const de_DeleteImageCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteImageCommandError - */ -const de_DeleteImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteImageVersionCommand */ @@ -10107,7 +7813,7 @@ export const de_DeleteImageVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteImageVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -10119,35 +7825,6 @@ export const de_DeleteImageVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteImageVersionCommandError - */ -const de_DeleteImageVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteInferenceComponentCommand */ @@ -10156,7 +7833,7 @@ export const de_DeleteInferenceComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteInferenceComponentCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteInferenceComponentCommandOutput = { @@ -10165,26 +7842,6 @@ export const de_DeleteInferenceComponentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteInferenceComponentCommandError - */ -const de_DeleteInferenceComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DeleteInferenceExperimentCommand */ @@ -10193,7 +7850,7 @@ export const de_DeleteInferenceExperimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteInferenceExperimentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -10205,35 +7862,6 @@ export const de_DeleteInferenceExperimentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteInferenceExperimentCommandError - */ -const de_DeleteInferenceExperimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteModelCommand */ @@ -10242,7 +7870,7 @@ export const de_DeleteModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteModelCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteModelCommandOutput = { @@ -10251,26 +7879,6 @@ export const de_DeleteModelCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteModelCommandError - */ -const de_DeleteModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DeleteModelBiasJobDefinitionCommand */ @@ -10279,7 +7887,7 @@ export const de_DeleteModelBiasJobDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteModelBiasJobDefinitionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteModelBiasJobDefinitionCommandOutput = { @@ -10288,32 +7896,6 @@ export const de_DeleteModelBiasJobDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteModelBiasJobDefinitionCommandError - */ -const de_DeleteModelBiasJobDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteModelCardCommand */ @@ -10322,7 +7904,7 @@ export const de_DeleteModelCardCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteModelCardCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteModelCardCommandOutput = { @@ -10331,35 +7913,6 @@ export const de_DeleteModelCardCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteModelCardCommandError - */ -const de_DeleteModelCardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteModelExplainabilityJobDefinitionCommand */ @@ -10368,7 +7921,7 @@ export const de_DeleteModelExplainabilityJobDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteModelExplainabilityJobDefinitionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteModelExplainabilityJobDefinitionCommandOutput = { @@ -10377,32 +7930,6 @@ export const de_DeleteModelExplainabilityJobDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteModelExplainabilityJobDefinitionCommandError - */ -const de_DeleteModelExplainabilityJobDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteModelPackageCommand */ @@ -10411,7 +7938,7 @@ export const de_DeleteModelPackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteModelPackageCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteModelPackageCommandOutput = { @@ -10421,40 +7948,14 @@ export const de_DeleteModelPackageCommand = async ( }; /** - * deserializeAws_json1_1DeleteModelPackageCommandError - */ -const de_DeleteModelPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteModelPackageGroupCommand + * deserializeAws_json1_1DeleteModelPackageGroupCommand */ export const de_DeleteModelPackageGroupCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteModelPackageGroupCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteModelPackageGroupCommandOutput = { @@ -10463,32 +7964,6 @@ export const de_DeleteModelPackageGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteModelPackageGroupCommandError - */ -const de_DeleteModelPackageGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteModelPackageGroupPolicyCommand */ @@ -10497,7 +7972,7 @@ export const de_DeleteModelPackageGroupPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteModelPackageGroupPolicyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteModelPackageGroupPolicyCommandOutput = { @@ -10506,26 +7981,6 @@ export const de_DeleteModelPackageGroupPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteModelPackageGroupPolicyCommandError - */ -const de_DeleteModelPackageGroupPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DeleteModelQualityJobDefinitionCommand */ @@ -10534,7 +7989,7 @@ export const de_DeleteModelQualityJobDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteModelQualityJobDefinitionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteModelQualityJobDefinitionCommandOutput = { @@ -10543,32 +7998,6 @@ export const de_DeleteModelQualityJobDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteModelQualityJobDefinitionCommandError - */ -const de_DeleteModelQualityJobDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteMonitoringScheduleCommand */ @@ -10577,7 +8006,7 @@ export const de_DeleteMonitoringScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteMonitoringScheduleCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteMonitoringScheduleCommandOutput = { @@ -10586,32 +8015,6 @@ export const de_DeleteMonitoringScheduleCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteMonitoringScheduleCommandError - */ -const de_DeleteMonitoringScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteNotebookInstanceCommand */ @@ -10620,7 +8023,7 @@ export const de_DeleteNotebookInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNotebookInstanceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteNotebookInstanceCommandOutput = { @@ -10629,26 +8032,6 @@ export const de_DeleteNotebookInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteNotebookInstanceCommandError - */ -const de_DeleteNotebookInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DeleteNotebookInstanceLifecycleConfigCommand */ @@ -10657,7 +8040,7 @@ export const de_DeleteNotebookInstanceLifecycleConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNotebookInstanceLifecycleConfigCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteNotebookInstanceLifecycleConfigCommandOutput = { @@ -10666,26 +8049,6 @@ export const de_DeleteNotebookInstanceLifecycleConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteNotebookInstanceLifecycleConfigCommandError - */ -const de_DeleteNotebookInstanceLifecycleConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DeletePipelineCommand */ @@ -10694,7 +8057,7 @@ export const de_DeletePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePipelineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -10706,35 +8069,6 @@ export const de_DeletePipelineCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeletePipelineCommandError - */ -const de_DeletePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteProjectCommand */ @@ -10743,7 +8077,7 @@ export const de_DeleteProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteProjectCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteProjectCommandOutput = { @@ -10752,32 +8086,6 @@ export const de_DeleteProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteProjectCommandError - */ -const de_DeleteProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteSpaceCommand */ @@ -10786,7 +8094,7 @@ export const de_DeleteSpaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSpaceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteSpaceCommandOutput = { @@ -10795,35 +8103,6 @@ export const de_DeleteSpaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteSpaceCommandError - */ -const de_DeleteSpaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteStudioLifecycleConfigCommand */ @@ -10832,7 +8111,7 @@ export const de_DeleteStudioLifecycleConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteStudioLifecycleConfigCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteStudioLifecycleConfigCommandOutput = { @@ -10841,35 +8120,6 @@ export const de_DeleteStudioLifecycleConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteStudioLifecycleConfigCommandError - */ -const de_DeleteStudioLifecycleConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteTagsCommand */ @@ -10878,7 +8128,7 @@ export const de_DeleteTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -10890,26 +8140,6 @@ export const de_DeleteTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteTagsCommandError - */ -const de_DeleteTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DeleteTrialCommand */ @@ -10918,7 +8148,7 @@ export const de_DeleteTrialCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTrialCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -10931,40 +8161,14 @@ export const de_DeleteTrialCommand = async ( }; /** - * deserializeAws_json1_1DeleteTrialCommandError + * deserializeAws_json1_1DeleteTrialComponentCommand */ -const de_DeleteTrialCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteTrialComponentCommand - */ -export const de_DeleteTrialComponentCommand = async ( +export const de_DeleteTrialComponentCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTrialComponentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -10976,32 +8180,6 @@ export const de_DeleteTrialComponentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteTrialComponentCommandError - */ -const de_DeleteTrialComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteUserProfileCommand */ @@ -11010,7 +8188,7 @@ export const de_DeleteUserProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteUserProfileCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteUserProfileCommandOutput = { @@ -11019,35 +8197,6 @@ export const de_DeleteUserProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteUserProfileCommandError - */ -const de_DeleteUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteWorkforceCommand */ @@ -11056,7 +8205,7 @@ export const de_DeleteWorkforceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteWorkforceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11068,26 +8217,6 @@ export const de_DeleteWorkforceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteWorkforceCommandError - */ -const de_DeleteWorkforceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DeleteWorkteamCommand */ @@ -11096,7 +8225,7 @@ export const de_DeleteWorkteamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteWorkteamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11108,32 +8237,6 @@ export const de_DeleteWorkteamCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteWorkteamCommandError - */ -const de_DeleteWorkteamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeregisterDevicesCommand */ @@ -11142,7 +8245,7 @@ export const de_DeregisterDevicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterDevicesCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeregisterDevicesCommandOutput = { @@ -11151,26 +8254,6 @@ export const de_DeregisterDevicesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeregisterDevicesCommandError - */ -const de_DeregisterDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribeActionCommand */ @@ -11179,7 +8262,7 @@ export const de_DescribeActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11191,32 +8274,6 @@ export const de_DescribeActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeActionCommandError - */ -const de_DescribeActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAlgorithmCommand */ @@ -11225,7 +8282,7 @@ export const de_DescribeAlgorithmCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAlgorithmCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11237,26 +8294,6 @@ export const de_DescribeAlgorithmCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAlgorithmCommandError - */ -const de_DescribeAlgorithmCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribeAppCommand */ @@ -11265,7 +8302,7 @@ export const de_DescribeAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAppCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11277,32 +8314,6 @@ export const de_DescribeAppCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAppCommandError - */ -const de_DescribeAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAppImageConfigCommand */ @@ -11311,7 +8322,7 @@ export const de_DescribeAppImageConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAppImageConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11323,32 +8334,6 @@ export const de_DescribeAppImageConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAppImageConfigCommandError - */ -const de_DescribeAppImageConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeArtifactCommand */ @@ -11357,7 +8342,7 @@ export const de_DescribeArtifactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeArtifactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11369,32 +8354,6 @@ export const de_DescribeArtifactCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeArtifactCommandError - */ -const de_DescribeArtifactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAutoMLJobCommand */ @@ -11403,7 +8362,7 @@ export const de_DescribeAutoMLJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAutoMLJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11415,32 +8374,6 @@ export const de_DescribeAutoMLJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAutoMLJobCommandError - */ -const de_DescribeAutoMLJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAutoMLJobV2Command */ @@ -11449,7 +8382,7 @@ export const de_DescribeAutoMLJobV2Command = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAutoMLJobV2CommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11462,40 +8395,14 @@ export const de_DescribeAutoMLJobV2Command = async ( }; /** - * deserializeAws_json1_1DescribeAutoMLJobV2CommandError + * deserializeAws_json1_1DescribeClusterCommand */ -const de_DescribeAutoMLJobV2CommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeClusterCommand - */ -export const de_DescribeClusterCommand = async ( +export const de_DescribeClusterCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11507,32 +8414,6 @@ export const de_DescribeClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeClusterCommandError - */ -const de_DescribeClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeClusterNodeCommand */ @@ -11541,7 +8422,7 @@ export const de_DescribeClusterNodeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeClusterNodeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11553,32 +8434,6 @@ export const de_DescribeClusterNodeCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeClusterNodeCommandError - */ -const de_DescribeClusterNodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeCodeRepositoryCommand */ @@ -11587,7 +8442,7 @@ export const de_DescribeCodeRepositoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCodeRepositoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11599,26 +8454,6 @@ export const de_DescribeCodeRepositoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeCodeRepositoryCommandError - */ -const de_DescribeCodeRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribeCompilationJobCommand */ @@ -11627,7 +8462,7 @@ export const de_DescribeCompilationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCompilationJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11639,32 +8474,6 @@ export const de_DescribeCompilationJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeCompilationJobCommandError - */ -const de_DescribeCompilationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeContextCommand */ @@ -11673,7 +8482,7 @@ export const de_DescribeContextCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeContextCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11685,32 +8494,6 @@ export const de_DescribeContextCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeContextCommandError - */ -const de_DescribeContextCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeDataQualityJobDefinitionCommand */ @@ -11719,7 +8502,7 @@ export const de_DescribeDataQualityJobDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDataQualityJobDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11731,32 +8514,6 @@ export const de_DescribeDataQualityJobDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDataQualityJobDefinitionCommandError - */ -const de_DescribeDataQualityJobDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeDeviceCommand */ @@ -11765,7 +8522,7 @@ export const de_DescribeDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDeviceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11777,32 +8534,6 @@ export const de_DescribeDeviceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDeviceCommandError - */ -const de_DescribeDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeDeviceFleetCommand */ @@ -11811,7 +8542,7 @@ export const de_DescribeDeviceFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDeviceFleetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11823,32 +8554,6 @@ export const de_DescribeDeviceFleetCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDeviceFleetCommandError - */ -const de_DescribeDeviceFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeDomainCommand */ @@ -11857,7 +8562,7 @@ export const de_DescribeDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11869,32 +8574,6 @@ export const de_DescribeDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDomainCommandError - */ -const de_DescribeDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEdgeDeploymentPlanCommand */ @@ -11903,7 +8582,7 @@ export const de_DescribeEdgeDeploymentPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEdgeDeploymentPlanCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -11916,45 +8595,39 @@ export const de_DescribeEdgeDeploymentPlanCommand = async ( }; /** - * deserializeAws_json1_1DescribeEdgeDeploymentPlanCommandError + * deserializeAws_json1_1DescribeEdgePackagingJobCommand */ -const de_DescribeEdgeDeploymentPlanCommandError = async ( +export const de_DescribeEdgePackagingJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeEdgePackagingJobResponse(data, context); + const response: DescribeEdgePackagingJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeEdgePackagingJobCommand + * deserializeAws_json1_1DescribeEndpointCommand */ -export const de_DescribeEdgePackagingJobCommand = async ( +export const de_DescribeEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEdgePackagingJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEdgePackagingJobResponse(data, context); - const response: DescribeEdgePackagingJobCommandOutput = { + contents = de_DescribeEndpointOutput(data, context); + const response: DescribeEndpointCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -11962,80 +8635,14 @@ export const de_DescribeEdgePackagingJobCommand = async ( }; /** - * deserializeAws_json1_1DescribeEdgePackagingJobCommandError + * deserializeAws_json1_1DescribeEndpointConfigCommand */ -const de_DescribeEdgePackagingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeEndpointCommand - */ -export const de_DescribeEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeEndpointCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeEndpointOutput(data, context); - const response: DescribeEndpointCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeEndpointCommandError - */ -const de_DescribeEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1DescribeEndpointConfigCommand - */ -export const de_DescribeEndpointConfigCommand = async ( +export const de_DescribeEndpointConfigCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEndpointConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12047,26 +8654,6 @@ export const de_DescribeEndpointConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEndpointConfigCommandError - */ -const de_DescribeEndpointConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribeExperimentCommand */ @@ -12075,7 +8662,7 @@ export const de_DescribeExperimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeExperimentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12087,32 +8674,6 @@ export const de_DescribeExperimentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeExperimentCommandError - */ -const de_DescribeExperimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeFeatureGroupCommand */ @@ -12121,7 +8682,7 @@ export const de_DescribeFeatureGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFeatureGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12133,32 +8694,6 @@ export const de_DescribeFeatureGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeFeatureGroupCommandError - */ -const de_DescribeFeatureGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeFeatureMetadataCommand */ @@ -12167,7 +8702,7 @@ export const de_DescribeFeatureMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFeatureMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12179,32 +8714,6 @@ export const de_DescribeFeatureMetadataCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeFeatureMetadataCommandError - */ -const de_DescribeFeatureMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeFlowDefinitionCommand */ @@ -12213,7 +8722,7 @@ export const de_DescribeFlowDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFlowDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12225,32 +8734,6 @@ export const de_DescribeFlowDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeFlowDefinitionCommandError - */ -const de_DescribeFlowDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeHubCommand */ @@ -12259,7 +8742,7 @@ export const de_DescribeHubCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeHubCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12271,32 +8754,6 @@ export const de_DescribeHubCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeHubCommandError - */ -const de_DescribeHubCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeHubContentCommand */ @@ -12305,7 +8762,7 @@ export const de_DescribeHubContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeHubContentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12317,32 +8774,6 @@ export const de_DescribeHubContentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeHubContentCommandError - */ -const de_DescribeHubContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeHumanTaskUiCommand */ @@ -12351,7 +8782,7 @@ export const de_DescribeHumanTaskUiCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeHumanTaskUiCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12363,32 +8794,6 @@ export const de_DescribeHumanTaskUiCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeHumanTaskUiCommandError - */ -const de_DescribeHumanTaskUiCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeHyperParameterTuningJobCommand */ @@ -12397,7 +8802,7 @@ export const de_DescribeHyperParameterTuningJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeHyperParameterTuningJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12409,32 +8814,6 @@ export const de_DescribeHyperParameterTuningJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeHyperParameterTuningJobCommandError - */ -const de_DescribeHyperParameterTuningJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeImageCommand */ @@ -12443,7 +8822,7 @@ export const de_DescribeImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12456,40 +8835,14 @@ export const de_DescribeImageCommand = async ( }; /** - * deserializeAws_json1_1DescribeImageCommandError + * deserializeAws_json1_1DescribeImageVersionCommand */ -const de_DescribeImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeImageVersionCommand - */ -export const de_DescribeImageVersionCommand = async ( +export const de_DescribeImageVersionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeImageVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12501,32 +8854,6 @@ export const de_DescribeImageVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeImageVersionCommandError - */ -const de_DescribeImageVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeInferenceComponentCommand */ @@ -12535,7 +8862,7 @@ export const de_DescribeInferenceComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInferenceComponentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12547,26 +8874,6 @@ export const de_DescribeInferenceComponentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeInferenceComponentCommandError - */ -const de_DescribeInferenceComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribeInferenceExperimentCommand */ @@ -12575,7 +8882,7 @@ export const de_DescribeInferenceExperimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInferenceExperimentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12587,32 +8894,6 @@ export const de_DescribeInferenceExperimentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeInferenceExperimentCommandError - */ -const de_DescribeInferenceExperimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeInferenceRecommendationsJobCommand */ @@ -12621,7 +8902,7 @@ export const de_DescribeInferenceRecommendationsJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInferenceRecommendationsJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12633,32 +8914,6 @@ export const de_DescribeInferenceRecommendationsJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeInferenceRecommendationsJobCommandError - */ -const de_DescribeInferenceRecommendationsJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLabelingJobCommand */ @@ -12667,7 +8922,7 @@ export const de_DescribeLabelingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLabelingJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12679,32 +8934,6 @@ export const de_DescribeLabelingJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLabelingJobCommandError - */ -const de_DescribeLabelingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLineageGroupCommand */ @@ -12713,7 +8942,7 @@ export const de_DescribeLineageGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLineageGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12725,32 +8954,6 @@ export const de_DescribeLineageGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLineageGroupCommandError - */ -const de_DescribeLineageGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeModelCommand */ @@ -12759,7 +8962,7 @@ export const de_DescribeModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeModelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12771,26 +8974,6 @@ export const de_DescribeModelCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeModelCommandError - */ -const de_DescribeModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribeModelBiasJobDefinitionCommand */ @@ -12799,7 +8982,7 @@ export const de_DescribeModelBiasJobDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeModelBiasJobDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12811,32 +8994,6 @@ export const de_DescribeModelBiasJobDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeModelBiasJobDefinitionCommandError - */ -const de_DescribeModelBiasJobDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeModelCardCommand */ @@ -12845,7 +9002,7 @@ export const de_DescribeModelCardCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeModelCardCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12857,32 +9014,6 @@ export const de_DescribeModelCardCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeModelCardCommandError - */ -const de_DescribeModelCardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeModelCardExportJobCommand */ @@ -12891,7 +9022,7 @@ export const de_DescribeModelCardExportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeModelCardExportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12903,32 +9034,6 @@ export const de_DescribeModelCardExportJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeModelCardExportJobCommandError - */ -const de_DescribeModelCardExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeModelExplainabilityJobDefinitionCommand */ @@ -12937,7 +9042,7 @@ export const de_DescribeModelExplainabilityJobDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeModelExplainabilityJobDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12949,32 +9054,6 @@ export const de_DescribeModelExplainabilityJobDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeModelExplainabilityJobDefinitionCommandError - */ -const de_DescribeModelExplainabilityJobDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeModelPackageCommand */ @@ -12983,7 +9062,7 @@ export const de_DescribeModelPackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeModelPackageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -12996,34 +9075,14 @@ export const de_DescribeModelPackageCommand = async ( }; /** - * deserializeAws_json1_1DescribeModelPackageCommandError + * deserializeAws_json1_1DescribeModelPackageGroupCommand */ -const de_DescribeModelPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1DescribeModelPackageGroupCommand - */ -export const de_DescribeModelPackageGroupCommand = async ( +export const de_DescribeModelPackageGroupCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeModelPackageGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13035,26 +9094,6 @@ export const de_DescribeModelPackageGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeModelPackageGroupCommandError - */ -const de_DescribeModelPackageGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribeModelQualityJobDefinitionCommand */ @@ -13063,7 +9102,7 @@ export const de_DescribeModelQualityJobDefinitionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeModelQualityJobDefinitionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13075,32 +9114,6 @@ export const de_DescribeModelQualityJobDefinitionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeModelQualityJobDefinitionCommandError - */ -const de_DescribeModelQualityJobDefinitionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeMonitoringScheduleCommand */ @@ -13109,7 +9122,7 @@ export const de_DescribeMonitoringScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeMonitoringScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13121,32 +9134,6 @@ export const de_DescribeMonitoringScheduleCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeMonitoringScheduleCommandError - */ -const de_DescribeMonitoringScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeNotebookInstanceCommand */ @@ -13155,7 +9142,7 @@ export const de_DescribeNotebookInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNotebookInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13167,26 +9154,6 @@ export const de_DescribeNotebookInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeNotebookInstanceCommandError - */ -const de_DescribeNotebookInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribeNotebookInstanceLifecycleConfigCommand */ @@ -13195,7 +9162,7 @@ export const de_DescribeNotebookInstanceLifecycleConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNotebookInstanceLifecycleConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13207,26 +9174,6 @@ export const de_DescribeNotebookInstanceLifecycleConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeNotebookInstanceLifecycleConfigCommandError - */ -const de_DescribeNotebookInstanceLifecycleConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribePipelineCommand */ @@ -13235,7 +9182,7 @@ export const de_DescribePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePipelineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13247,32 +9194,6 @@ export const de_DescribePipelineCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribePipelineCommandError - */ -const de_DescribePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribePipelineDefinitionForExecutionCommand */ @@ -13281,7 +9202,7 @@ export const de_DescribePipelineDefinitionForExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePipelineDefinitionForExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13293,32 +9214,6 @@ export const de_DescribePipelineDefinitionForExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribePipelineDefinitionForExecutionCommandError - */ -const de_DescribePipelineDefinitionForExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribePipelineExecutionCommand */ @@ -13327,7 +9222,7 @@ export const de_DescribePipelineExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePipelineExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13339,32 +9234,6 @@ export const de_DescribePipelineExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribePipelineExecutionCommandError - */ -const de_DescribePipelineExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeProcessingJobCommand */ @@ -13373,7 +9242,7 @@ export const de_DescribeProcessingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeProcessingJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13385,32 +9254,6 @@ export const de_DescribeProcessingJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeProcessingJobCommandError - */ -const de_DescribeProcessingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeProjectCommand */ @@ -13419,7 +9262,7 @@ export const de_DescribeProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13431,26 +9274,6 @@ export const de_DescribeProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeProjectCommandError - */ -const de_DescribeProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribeSpaceCommand */ @@ -13459,7 +9282,7 @@ export const de_DescribeSpaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSpaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13471,32 +9294,6 @@ export const de_DescribeSpaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeSpaceCommandError - */ -const de_DescribeSpaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeStudioLifecycleConfigCommand */ @@ -13505,7 +9302,7 @@ export const de_DescribeStudioLifecycleConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStudioLifecycleConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13517,32 +9314,6 @@ export const de_DescribeStudioLifecycleConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeStudioLifecycleConfigCommandError - */ -const de_DescribeStudioLifecycleConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeSubscribedWorkteamCommand */ @@ -13551,7 +9322,7 @@ export const de_DescribeSubscribedWorkteamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSubscribedWorkteamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13564,34 +9335,14 @@ export const de_DescribeSubscribedWorkteamCommand = async ( }; /** - * deserializeAws_json1_1DescribeSubscribedWorkteamCommandError + * deserializeAws_json1_1DescribeTrainingJobCommand */ -const de_DescribeSubscribedWorkteamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1DescribeTrainingJobCommand - */ -export const de_DescribeTrainingJobCommand = async ( +export const de_DescribeTrainingJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrainingJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13603,32 +9354,6 @@ export const de_DescribeTrainingJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTrainingJobCommandError - */ -const de_DescribeTrainingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTransformJobCommand */ @@ -13637,7 +9362,7 @@ export const de_DescribeTransformJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTransformJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13649,32 +9374,6 @@ export const de_DescribeTransformJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTransformJobCommandError - */ -const de_DescribeTransformJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTrialCommand */ @@ -13683,7 +9382,7 @@ export const de_DescribeTrialCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrialCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13695,32 +9394,6 @@ export const de_DescribeTrialCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTrialCommandError - */ -const de_DescribeTrialCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTrialComponentCommand */ @@ -13729,7 +9402,7 @@ export const de_DescribeTrialComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrialComponentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13741,32 +9414,6 @@ export const de_DescribeTrialComponentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTrialComponentCommandError - */ -const de_DescribeTrialComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeUserProfileCommand */ @@ -13775,7 +9422,7 @@ export const de_DescribeUserProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeUserProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13787,35 +9434,6 @@ export const de_DescribeUserProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeUserProfileCommandError - */ -const de_DescribeUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeWorkforceCommand */ @@ -13824,7 +9442,7 @@ export const de_DescribeWorkforceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeWorkforceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13836,26 +9454,6 @@ export const de_DescribeWorkforceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeWorkforceCommandError - */ -const de_DescribeWorkforceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DescribeWorkteamCommand */ @@ -13864,7 +9462,7 @@ export const de_DescribeWorkteamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeWorkteamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13876,26 +9474,6 @@ export const de_DescribeWorkteamCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeWorkteamCommandError - */ -const de_DescribeWorkteamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DisableSagemakerServicecatalogPortfolioCommand */ @@ -13904,7 +9482,7 @@ export const de_DisableSagemakerServicecatalogPortfolioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableSagemakerServicecatalogPortfolioCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13916,26 +9494,6 @@ export const de_DisableSagemakerServicecatalogPortfolioCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisableSagemakerServicecatalogPortfolioCommandError - */ -const de_DisableSagemakerServicecatalogPortfolioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1DisassociateTrialComponentCommand */ @@ -13944,7 +9502,7 @@ export const de_DisassociateTrialComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateTrialComponentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -13956,32 +9514,6 @@ export const de_DisassociateTrialComponentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateTrialComponentCommandError - */ -const de_DisassociateTrialComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1EnableSagemakerServicecatalogPortfolioCommand */ @@ -13990,7 +9522,7 @@ export const de_EnableSagemakerServicecatalogPortfolioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableSagemakerServicecatalogPortfolioCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14002,26 +9534,6 @@ export const de_EnableSagemakerServicecatalogPortfolioCommand = async ( return response; }; -/** - * deserializeAws_json1_1EnableSagemakerServicecatalogPortfolioCommandError - */ -const de_EnableSagemakerServicecatalogPortfolioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1GetDeviceFleetReportCommand */ @@ -14030,7 +9542,7 @@ export const de_GetDeviceFleetReportCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDeviceFleetReportCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14042,26 +9554,6 @@ export const de_GetDeviceFleetReportCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetDeviceFleetReportCommandError - */ -const de_GetDeviceFleetReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1GetLineageGroupPolicyCommand */ @@ -14070,7 +9562,7 @@ export const de_GetLineageGroupPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetLineageGroupPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14082,32 +9574,6 @@ export const de_GetLineageGroupPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetLineageGroupPolicyCommandError - */ -const de_GetLineageGroupPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetModelPackageGroupPolicyCommand */ @@ -14116,7 +9582,7 @@ export const de_GetModelPackageGroupPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetModelPackageGroupPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14128,26 +9594,6 @@ export const de_GetModelPackageGroupPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetModelPackageGroupPolicyCommandError - */ -const de_GetModelPackageGroupPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1GetSagemakerServicecatalogPortfolioStatusCommand */ @@ -14156,7 +9602,7 @@ export const de_GetSagemakerServicecatalogPortfolioStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSagemakerServicecatalogPortfolioStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14169,34 +9615,14 @@ export const de_GetSagemakerServicecatalogPortfolioStatusCommand = async ( }; /** - * deserializeAws_json1_1GetSagemakerServicecatalogPortfolioStatusCommandError + * deserializeAws_json1_1GetScalingConfigurationRecommendationCommand */ -const de_GetSagemakerServicecatalogPortfolioStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1GetScalingConfigurationRecommendationCommand - */ -export const de_GetScalingConfigurationRecommendationCommand = async ( +export const de_GetScalingConfigurationRecommendationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetScalingConfigurationRecommendationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14208,32 +9634,6 @@ export const de_GetScalingConfigurationRecommendationCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetScalingConfigurationRecommendationCommandError - */ -const de_GetScalingConfigurationRecommendationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetSearchSuggestionsCommand */ @@ -14242,7 +9642,7 @@ export const de_GetSearchSuggestionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSearchSuggestionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14254,26 +9654,6 @@ export const de_GetSearchSuggestionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetSearchSuggestionsCommandError - */ -const de_GetSearchSuggestionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ImportHubContentCommand */ @@ -14282,7 +9662,7 @@ export const de_ImportHubContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportHubContentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14294,38 +9674,6 @@ export const de_ImportHubContentCommand = async ( return response; }; -/** - * deserializeAws_json1_1ImportHubContentCommandError - */ -const de_ImportHubContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListActionsCommand */ @@ -14334,7 +9682,7 @@ export const de_ListActionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListActionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14346,32 +9694,6 @@ export const de_ListActionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListActionsCommandError - */ -const de_ListActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAlgorithmsCommand */ @@ -14380,7 +9702,7 @@ export const de_ListAlgorithmsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAlgorithmsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14392,26 +9714,6 @@ export const de_ListAlgorithmsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAlgorithmsCommandError - */ -const de_ListAlgorithmsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListAliasesCommand */ @@ -14420,7 +9722,7 @@ export const de_ListAliasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAliasesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14432,32 +9734,6 @@ export const de_ListAliasesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAliasesCommandError - */ -const de_ListAliasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAppImageConfigsCommand */ @@ -14466,7 +9742,7 @@ export const de_ListAppImageConfigsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAppImageConfigsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14478,26 +9754,6 @@ export const de_ListAppImageConfigsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAppImageConfigsCommandError - */ -const de_ListAppImageConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListAppsCommand */ @@ -14506,7 +9762,7 @@ export const de_ListAppsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAppsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14518,26 +9774,6 @@ export const de_ListAppsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAppsCommandError - */ -const de_ListAppsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListArtifactsCommand */ @@ -14546,7 +9782,7 @@ export const de_ListArtifactsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListArtifactsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14558,32 +9794,6 @@ export const de_ListArtifactsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListArtifactsCommandError - */ -const de_ListArtifactsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAssociationsCommand */ @@ -14592,7 +9802,7 @@ export const de_ListAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14604,32 +9814,6 @@ export const de_ListAssociationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAssociationsCommandError - */ -const de_ListAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAutoMLJobsCommand */ @@ -14638,7 +9822,7 @@ export const de_ListAutoMLJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAutoMLJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14650,26 +9834,6 @@ export const de_ListAutoMLJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAutoMLJobsCommandError - */ -const de_ListAutoMLJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListCandidatesForAutoMLJobCommand */ @@ -14678,7 +9842,7 @@ export const de_ListCandidatesForAutoMLJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListCandidatesForAutoMLJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14690,32 +9854,6 @@ export const de_ListCandidatesForAutoMLJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListCandidatesForAutoMLJobCommandError - */ -const de_ListCandidatesForAutoMLJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListClusterNodesCommand */ @@ -14724,7 +9862,7 @@ export const de_ListClusterNodesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListClusterNodesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14737,40 +9875,14 @@ export const de_ListClusterNodesCommand = async ( }; /** - * deserializeAws_json1_1ListClusterNodesCommandError + * deserializeAws_json1_1ListClustersCommand */ -const de_ListClusterNodesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListClustersCommand - */ -export const de_ListClustersCommand = async ( +export const de_ListClustersCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListClustersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14782,26 +9894,6 @@ export const de_ListClustersCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListClustersCommandError - */ -const de_ListClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListCodeRepositoriesCommand */ @@ -14810,7 +9902,7 @@ export const de_ListCodeRepositoriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListCodeRepositoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14822,26 +9914,6 @@ export const de_ListCodeRepositoriesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListCodeRepositoriesCommandError - */ -const de_ListCodeRepositoriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListCompilationJobsCommand */ @@ -14850,7 +9922,7 @@ export const de_ListCompilationJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListCompilationJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14862,26 +9934,6 @@ export const de_ListCompilationJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListCompilationJobsCommandError - */ -const de_ListCompilationJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListContextsCommand */ @@ -14890,7 +9942,7 @@ export const de_ListContextsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListContextsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14902,32 +9954,6 @@ export const de_ListContextsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListContextsCommandError - */ -const de_ListContextsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListDataQualityJobDefinitionsCommand */ @@ -14936,7 +9962,7 @@ export const de_ListDataQualityJobDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListDataQualityJobDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14948,26 +9974,6 @@ export const de_ListDataQualityJobDefinitionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListDataQualityJobDefinitionsCommandError - */ -const de_ListDataQualityJobDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListDeviceFleetsCommand */ @@ -14976,7 +9982,7 @@ export const de_ListDeviceFleetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListDeviceFleetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -14988,26 +9994,6 @@ export const de_ListDeviceFleetsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListDeviceFleetsCommandError - */ -const de_ListDeviceFleetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListDevicesCommand */ @@ -15016,7 +10002,7 @@ export const de_ListDevicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListDevicesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15028,26 +10014,6 @@ export const de_ListDevicesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListDevicesCommandError - */ -const de_ListDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListDomainsCommand */ @@ -15056,7 +10022,7 @@ export const de_ListDomainsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListDomainsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15068,26 +10034,6 @@ export const de_ListDomainsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListDomainsCommandError - */ -const de_ListDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListEdgeDeploymentPlansCommand */ @@ -15096,7 +10042,7 @@ export const de_ListEdgeDeploymentPlansCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListEdgeDeploymentPlansCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15108,26 +10054,6 @@ export const de_ListEdgeDeploymentPlansCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListEdgeDeploymentPlansCommandError - */ -const de_ListEdgeDeploymentPlansCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListEdgePackagingJobsCommand */ @@ -15136,7 +10062,7 @@ export const de_ListEdgePackagingJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListEdgePackagingJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15148,26 +10074,6 @@ export const de_ListEdgePackagingJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListEdgePackagingJobsCommandError - */ -const de_ListEdgePackagingJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListEndpointConfigsCommand */ @@ -15176,7 +10082,7 @@ export const de_ListEndpointConfigsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListEndpointConfigsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15188,26 +10094,6 @@ export const de_ListEndpointConfigsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListEndpointConfigsCommandError - */ -const de_ListEndpointConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListEndpointsCommand */ @@ -15216,7 +10102,7 @@ export const de_ListEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15228,26 +10114,6 @@ export const de_ListEndpointsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListEndpointsCommandError - */ -const de_ListEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListExperimentsCommand */ @@ -15256,7 +10122,7 @@ export const de_ListExperimentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListExperimentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15268,26 +10134,6 @@ export const de_ListExperimentsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListExperimentsCommandError - */ -const de_ListExperimentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListFeatureGroupsCommand */ @@ -15296,7 +10142,7 @@ export const de_ListFeatureGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListFeatureGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15308,26 +10154,6 @@ export const de_ListFeatureGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListFeatureGroupsCommandError - */ -const de_ListFeatureGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListFlowDefinitionsCommand */ @@ -15336,7 +10162,7 @@ export const de_ListFlowDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListFlowDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15348,26 +10174,6 @@ export const de_ListFlowDefinitionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListFlowDefinitionsCommandError - */ -const de_ListFlowDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListHubContentsCommand */ @@ -15376,7 +10182,7 @@ export const de_ListHubContentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListHubContentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15388,32 +10194,6 @@ export const de_ListHubContentsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListHubContentsCommandError - */ -const de_ListHubContentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListHubContentVersionsCommand */ @@ -15422,7 +10202,7 @@ export const de_ListHubContentVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListHubContentVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15435,40 +10215,14 @@ export const de_ListHubContentVersionsCommand = async ( }; /** - * deserializeAws_json1_1ListHubContentVersionsCommandError + * deserializeAws_json1_1ListHubsCommand */ -const de_ListHubContentVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListHubsCommand - */ -export const de_ListHubsCommand = async ( +export const de_ListHubsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListHubsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15480,26 +10234,6 @@ export const de_ListHubsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListHubsCommandError - */ -const de_ListHubsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListHumanTaskUisCommand */ @@ -15508,7 +10242,7 @@ export const de_ListHumanTaskUisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListHumanTaskUisCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15520,26 +10254,6 @@ export const de_ListHumanTaskUisCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListHumanTaskUisCommandError - */ -const de_ListHumanTaskUisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListHyperParameterTuningJobsCommand */ @@ -15548,7 +10262,7 @@ export const de_ListHyperParameterTuningJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListHyperParameterTuningJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15560,26 +10274,6 @@ export const de_ListHyperParameterTuningJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListHyperParameterTuningJobsCommandError - */ -const de_ListHyperParameterTuningJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListImagesCommand */ @@ -15588,7 +10282,7 @@ export const de_ListImagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListImagesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15600,26 +10294,6 @@ export const de_ListImagesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListImagesCommandError - */ -const de_ListImagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListImageVersionsCommand */ @@ -15628,7 +10302,7 @@ export const de_ListImageVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListImageVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15640,32 +10314,6 @@ export const de_ListImageVersionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListImageVersionsCommandError - */ -const de_ListImageVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListInferenceComponentsCommand */ @@ -15674,7 +10322,7 @@ export const de_ListInferenceComponentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListInferenceComponentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15686,26 +10334,6 @@ export const de_ListInferenceComponentsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListInferenceComponentsCommandError - */ -const de_ListInferenceComponentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListInferenceExperimentsCommand */ @@ -15714,7 +10342,7 @@ export const de_ListInferenceExperimentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListInferenceExperimentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15726,26 +10354,6 @@ export const de_ListInferenceExperimentsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListInferenceExperimentsCommandError - */ -const de_ListInferenceExperimentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListInferenceRecommendationsJobsCommand */ @@ -15754,7 +10362,7 @@ export const de_ListInferenceRecommendationsJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListInferenceRecommendationsJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15766,26 +10374,6 @@ export const de_ListInferenceRecommendationsJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListInferenceRecommendationsJobsCommandError - */ -const de_ListInferenceRecommendationsJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListInferenceRecommendationsJobStepsCommand */ @@ -15794,7 +10382,7 @@ export const de_ListInferenceRecommendationsJobStepsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListInferenceRecommendationsJobStepsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15806,32 +10394,6 @@ export const de_ListInferenceRecommendationsJobStepsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListInferenceRecommendationsJobStepsCommandError - */ -const de_ListInferenceRecommendationsJobStepsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListLabelingJobsCommand */ @@ -15840,7 +10402,7 @@ export const de_ListLabelingJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListLabelingJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15852,26 +10414,6 @@ export const de_ListLabelingJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListLabelingJobsCommandError - */ -const de_ListLabelingJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListLabelingJobsForWorkteamCommand */ @@ -15880,7 +10422,7 @@ export const de_ListLabelingJobsForWorkteamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListLabelingJobsForWorkteamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15892,32 +10434,6 @@ export const de_ListLabelingJobsForWorkteamCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListLabelingJobsForWorkteamCommandError - */ -const de_ListLabelingJobsForWorkteamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListLineageGroupsCommand */ @@ -15926,7 +10442,7 @@ export const de_ListLineageGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListLineageGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15938,26 +10454,6 @@ export const de_ListLineageGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListLineageGroupsCommandError - */ -const de_ListLineageGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListModelBiasJobDefinitionsCommand */ @@ -15966,7 +10462,7 @@ export const de_ListModelBiasJobDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListModelBiasJobDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -15978,26 +10474,6 @@ export const de_ListModelBiasJobDefinitionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListModelBiasJobDefinitionsCommandError - */ -const de_ListModelBiasJobDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListModelCardExportJobsCommand */ @@ -16006,7 +10482,7 @@ export const de_ListModelCardExportJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListModelCardExportJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16018,26 +10494,6 @@ export const de_ListModelCardExportJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListModelCardExportJobsCommandError - */ -const de_ListModelCardExportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListModelCardsCommand */ @@ -16046,7 +10502,7 @@ export const de_ListModelCardsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListModelCardsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16058,26 +10514,6 @@ export const de_ListModelCardsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListModelCardsCommandError - */ -const de_ListModelCardsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListModelCardVersionsCommand */ @@ -16086,7 +10522,7 @@ export const de_ListModelCardVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListModelCardVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16099,71 +10535,25 @@ export const de_ListModelCardVersionsCommand = async ( }; /** - * deserializeAws_json1_1ListModelCardVersionsCommandError + * deserializeAws_json1_1ListModelExplainabilityJobDefinitionsCommand */ -const de_ListModelCardVersionsCommandError = async ( +export const de_ListModelExplainabilityJobDefinitionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListModelExplainabilityJobDefinitionsCommand - */ -export const de_ListModelExplainabilityJobDefinitionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListModelExplainabilityJobDefinitionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListModelExplainabilityJobDefinitionsResponse(data, context); - const response: ListModelExplainabilityJobDefinitionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListModelExplainabilityJobDefinitionsResponse(data, context); + const response: ListModelExplainabilityJobDefinitionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; return response; }; -/** - * deserializeAws_json1_1ListModelExplainabilityJobDefinitionsCommandError - */ -const de_ListModelExplainabilityJobDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListModelMetadataCommand */ @@ -16172,7 +10562,7 @@ export const de_ListModelMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListModelMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16184,26 +10574,6 @@ export const de_ListModelMetadataCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListModelMetadataCommandError - */ -const de_ListModelMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListModelPackageGroupsCommand */ @@ -16212,7 +10582,7 @@ export const de_ListModelPackageGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListModelPackageGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16224,26 +10594,6 @@ export const de_ListModelPackageGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListModelPackageGroupsCommandError - */ -const de_ListModelPackageGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListModelPackagesCommand */ @@ -16252,7 +10602,7 @@ export const de_ListModelPackagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListModelPackagesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16264,26 +10614,6 @@ export const de_ListModelPackagesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListModelPackagesCommandError - */ -const de_ListModelPackagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListModelQualityJobDefinitionsCommand */ @@ -16292,7 +10622,7 @@ export const de_ListModelQualityJobDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListModelQualityJobDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16304,26 +10634,6 @@ export const de_ListModelQualityJobDefinitionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListModelQualityJobDefinitionsCommandError - */ -const de_ListModelQualityJobDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListModelsCommand */ @@ -16332,7 +10642,7 @@ export const de_ListModelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListModelsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16344,26 +10654,6 @@ export const de_ListModelsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListModelsCommandError - */ -const de_ListModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListMonitoringAlertHistoryCommand */ @@ -16372,7 +10662,7 @@ export const de_ListMonitoringAlertHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListMonitoringAlertHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16384,32 +10674,6 @@ export const de_ListMonitoringAlertHistoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListMonitoringAlertHistoryCommandError - */ -const de_ListMonitoringAlertHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListMonitoringAlertsCommand */ @@ -16418,7 +10682,7 @@ export const de_ListMonitoringAlertsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListMonitoringAlertsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16430,32 +10694,6 @@ export const de_ListMonitoringAlertsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListMonitoringAlertsCommandError - */ -const de_ListMonitoringAlertsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListMonitoringExecutionsCommand */ @@ -16464,7 +10702,7 @@ export const de_ListMonitoringExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListMonitoringExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16476,26 +10714,6 @@ export const de_ListMonitoringExecutionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListMonitoringExecutionsCommandError - */ -const de_ListMonitoringExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListMonitoringSchedulesCommand */ @@ -16504,7 +10722,7 @@ export const de_ListMonitoringSchedulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListMonitoringSchedulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16516,26 +10734,6 @@ export const de_ListMonitoringSchedulesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListMonitoringSchedulesCommandError - */ -const de_ListMonitoringSchedulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListNotebookInstanceLifecycleConfigsCommand */ @@ -16544,7 +10742,7 @@ export const de_ListNotebookInstanceLifecycleConfigsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListNotebookInstanceLifecycleConfigsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16556,26 +10754,6 @@ export const de_ListNotebookInstanceLifecycleConfigsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListNotebookInstanceLifecycleConfigsCommandError - */ -const de_ListNotebookInstanceLifecycleConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListNotebookInstancesCommand */ @@ -16584,7 +10762,7 @@ export const de_ListNotebookInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListNotebookInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16596,26 +10774,6 @@ export const de_ListNotebookInstancesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListNotebookInstancesCommandError - */ -const de_ListNotebookInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListPipelineExecutionsCommand */ @@ -16624,7 +10782,7 @@ export const de_ListPipelineExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPipelineExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16636,32 +10794,6 @@ export const de_ListPipelineExecutionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPipelineExecutionsCommandError - */ -const de_ListPipelineExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPipelineExecutionStepsCommand */ @@ -16670,7 +10802,7 @@ export const de_ListPipelineExecutionStepsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPipelineExecutionStepsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16682,32 +10814,6 @@ export const de_ListPipelineExecutionStepsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPipelineExecutionStepsCommandError - */ -const de_ListPipelineExecutionStepsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPipelineParametersForExecutionCommand */ @@ -16716,7 +10822,7 @@ export const de_ListPipelineParametersForExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPipelineParametersForExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16729,40 +10835,14 @@ export const de_ListPipelineParametersForExecutionCommand = async ( }; /** - * deserializeAws_json1_1ListPipelineParametersForExecutionCommandError + * deserializeAws_json1_1ListPipelinesCommand */ -const de_ListPipelineParametersForExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListPipelinesCommand - */ -export const de_ListPipelinesCommand = async ( +export const de_ListPipelinesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPipelinesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16774,26 +10854,6 @@ export const de_ListPipelinesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPipelinesCommandError - */ -const de_ListPipelinesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListProcessingJobsCommand */ @@ -16802,7 +10862,7 @@ export const de_ListProcessingJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListProcessingJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16814,26 +10874,6 @@ export const de_ListProcessingJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListProcessingJobsCommandError - */ -const de_ListProcessingJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListProjectsCommand */ @@ -16842,7 +10882,7 @@ export const de_ListProjectsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListProjectsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16854,26 +10894,6 @@ export const de_ListProjectsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListProjectsCommandError - */ -const de_ListProjectsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListResourceCatalogsCommand */ @@ -16882,7 +10902,7 @@ export const de_ListResourceCatalogsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListResourceCatalogsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16894,26 +10914,6 @@ export const de_ListResourceCatalogsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListResourceCatalogsCommandError - */ -const de_ListResourceCatalogsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListSpacesCommand */ @@ -16922,7 +10922,7 @@ export const de_ListSpacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSpacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16934,26 +10934,6 @@ export const de_ListSpacesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSpacesCommandError - */ -const de_ListSpacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListStageDevicesCommand */ @@ -16962,7 +10942,7 @@ export const de_ListStageDevicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStageDevicesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -16974,26 +10954,6 @@ export const de_ListStageDevicesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListStageDevicesCommandError - */ -const de_ListStageDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListStudioLifecycleConfigsCommand */ @@ -17002,7 +10962,7 @@ export const de_ListStudioLifecycleConfigsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStudioLifecycleConfigsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17014,32 +10974,6 @@ export const de_ListStudioLifecycleConfigsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListStudioLifecycleConfigsCommandError - */ -const de_ListStudioLifecycleConfigsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListSubscribedWorkteamsCommand */ @@ -17048,7 +10982,7 @@ export const de_ListSubscribedWorkteamsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSubscribedWorkteamsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17060,26 +10994,6 @@ export const de_ListSubscribedWorkteamsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSubscribedWorkteamsCommandError - */ -const de_ListSubscribedWorkteamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListTagsCommand */ @@ -17088,7 +11002,7 @@ export const de_ListTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17100,26 +11014,6 @@ export const de_ListTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsCommandError - */ -const de_ListTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListTrainingJobsCommand */ @@ -17128,7 +11022,7 @@ export const de_ListTrainingJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTrainingJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17140,26 +11034,6 @@ export const de_ListTrainingJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTrainingJobsCommandError - */ -const de_ListTrainingJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListTrainingJobsForHyperParameterTuningJobCommand */ @@ -17168,7 +11042,7 @@ export const de_ListTrainingJobsForHyperParameterTuningJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTrainingJobsForHyperParameterTuningJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17180,32 +11054,6 @@ export const de_ListTrainingJobsForHyperParameterTuningJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTrainingJobsForHyperParameterTuningJobCommandError - */ -const de_ListTrainingJobsForHyperParameterTuningJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTransformJobsCommand */ @@ -17214,7 +11062,7 @@ export const de_ListTransformJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTransformJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17226,26 +11074,6 @@ export const de_ListTransformJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTransformJobsCommandError - */ -const de_ListTransformJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListTrialComponentsCommand */ @@ -17254,7 +11082,7 @@ export const de_ListTrialComponentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTrialComponentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17266,32 +11094,6 @@ export const de_ListTrialComponentsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTrialComponentsCommandError - */ -const de_ListTrialComponentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTrialsCommand */ @@ -17300,7 +11102,7 @@ export const de_ListTrialsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTrialsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17312,32 +11114,6 @@ export const de_ListTrialsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTrialsCommandError - */ -const de_ListTrialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListUserProfilesCommand */ @@ -17346,7 +11122,7 @@ export const de_ListUserProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListUserProfilesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17359,34 +11135,14 @@ export const de_ListUserProfilesCommand = async ( }; /** - * deserializeAws_json1_1ListUserProfilesCommandError + * deserializeAws_json1_1ListWorkforcesCommand */ -const de_ListUserProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_json1_1ListWorkforcesCommand - */ -export const de_ListWorkforcesCommand = async ( +export const de_ListWorkforcesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListWorkforcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17398,26 +11154,6 @@ export const de_ListWorkforcesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListWorkforcesCommandError - */ -const de_ListWorkforcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1ListWorkteamsCommand */ @@ -17426,7 +11162,7 @@ export const de_ListWorkteamsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListWorkteamsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17438,26 +11174,6 @@ export const de_ListWorkteamsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListWorkteamsCommandError - */ -const de_ListWorkteamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1PutModelPackageGroupPolicyCommand */ @@ -17466,7 +11182,7 @@ export const de_PutModelPackageGroupPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutModelPackageGroupPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17478,32 +11194,6 @@ export const de_PutModelPackageGroupPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutModelPackageGroupPolicyCommandError - */ -const de_PutModelPackageGroupPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1QueryLineageCommand */ @@ -17512,7 +11202,7 @@ export const de_QueryLineageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_QueryLineageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17524,32 +11214,6 @@ export const de_QueryLineageCommand = async ( return response; }; -/** - * deserializeAws_json1_1QueryLineageCommandError - */ -const de_QueryLineageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RegisterDevicesCommand */ @@ -17558,7 +11222,7 @@ export const de_RegisterDevicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterDevicesCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RegisterDevicesCommandOutput = { @@ -17567,32 +11231,6 @@ export const de_RegisterDevicesCommand = async ( return response; }; -/** - * deserializeAws_json1_1RegisterDevicesCommandError - */ -const de_RegisterDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RenderUiTemplateCommand */ @@ -17601,7 +11239,7 @@ export const de_RenderUiTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RenderUiTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17613,32 +11251,6 @@ export const de_RenderUiTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1RenderUiTemplateCommandError - */ -const de_RenderUiTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RetryPipelineExecutionCommand */ @@ -17647,7 +11259,7 @@ export const de_RetryPipelineExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RetryPipelineExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17659,38 +11271,6 @@ export const de_RetryPipelineExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1RetryPipelineExecutionCommandError - */ -const de_RetryPipelineExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SearchCommand */ @@ -17699,7 +11279,7 @@ export const de_SearchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17711,23 +11291,6 @@ export const de_SearchCommand = async ( return response; }; -/** - * deserializeAws_json1_1SearchCommandError - */ -const de_SearchCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1SendPipelineExecutionStepFailureCommand */ @@ -17736,7 +11299,7 @@ export const de_SendPipelineExecutionStepFailureCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendPipelineExecutionStepFailureCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17748,38 +11311,6 @@ export const de_SendPipelineExecutionStepFailureCommand = async ( return response; }; -/** - * deserializeAws_json1_1SendPipelineExecutionStepFailureCommandError - */ -const de_SendPipelineExecutionStepFailureCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SendPipelineExecutionStepSuccessCommand */ @@ -17788,7 +11319,7 @@ export const de_SendPipelineExecutionStepSuccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendPipelineExecutionStepSuccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17800,38 +11331,6 @@ export const de_SendPipelineExecutionStepSuccessCommand = async ( return response; }; -/** - * deserializeAws_json1_1SendPipelineExecutionStepSuccessCommandError - */ -const de_SendPipelineExecutionStepSuccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartEdgeDeploymentStageCommand */ @@ -17840,7 +11339,7 @@ export const de_StartEdgeDeploymentStageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartEdgeDeploymentStageCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StartEdgeDeploymentStageCommandOutput = { @@ -17849,26 +11348,6 @@ export const de_StartEdgeDeploymentStageCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartEdgeDeploymentStageCommandError - */ -const de_StartEdgeDeploymentStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1StartInferenceExperimentCommand */ @@ -17877,7 +11356,7 @@ export const de_StartInferenceExperimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartInferenceExperimentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -17890,77 +11369,22 @@ export const de_StartInferenceExperimentCommand = async ( }; /** - * deserializeAws_json1_1StartInferenceExperimentCommandError + * deserializeAws_json1_1StartMonitoringScheduleCommand */ -const de_StartInferenceExperimentCommandError = async ( +export const de_StartMonitoringScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartMonitoringScheduleCommand - */ -export const de_StartMonitoringScheduleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartMonitoringScheduleCommandError(output, context); - } - await collectBody(output.body, context); - const response: StartMonitoringScheduleCommandOutput = { - $metadata: deserializeMetadata(output), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: StartMonitoringScheduleCommandOutput = { + $metadata: deserializeMetadata(output), }; return response; }; -/** - * deserializeAws_json1_1StartMonitoringScheduleCommandError - */ -const de_StartMonitoringScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartNotebookInstanceCommand */ @@ -17969,7 +11393,7 @@ export const de_StartNotebookInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartNotebookInstanceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StartNotebookInstanceCommandOutput = { @@ -17978,32 +11402,6 @@ export const de_StartNotebookInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartNotebookInstanceCommandError - */ -const de_StartNotebookInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartPipelineExecutionCommand */ @@ -18012,7 +11410,7 @@ export const de_StartPipelineExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartPipelineExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18024,38 +11422,6 @@ export const de_StartPipelineExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartPipelineExecutionCommandError - */ -const de_StartPipelineExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopAutoMLJobCommand */ @@ -18064,7 +11430,7 @@ export const de_StopAutoMLJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopAutoMLJobCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopAutoMLJobCommandOutput = { @@ -18073,32 +11439,6 @@ export const de_StopAutoMLJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopAutoMLJobCommandError - */ -const de_StopAutoMLJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopCompilationJobCommand */ @@ -18107,7 +11447,7 @@ export const de_StopCompilationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopCompilationJobCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopCompilationJobCommandOutput = { @@ -18116,32 +11456,6 @@ export const de_StopCompilationJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopCompilationJobCommandError - */ -const de_StopCompilationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopEdgeDeploymentStageCommand */ @@ -18150,7 +11464,7 @@ export const de_StopEdgeDeploymentStageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopEdgeDeploymentStageCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopEdgeDeploymentStageCommandOutput = { @@ -18159,26 +11473,6 @@ export const de_StopEdgeDeploymentStageCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopEdgeDeploymentStageCommandError - */ -const de_StopEdgeDeploymentStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1StopEdgePackagingJobCommand */ @@ -18187,7 +11481,7 @@ export const de_StopEdgePackagingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopEdgePackagingJobCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopEdgePackagingJobCommandOutput = { @@ -18196,26 +11490,6 @@ export const de_StopEdgePackagingJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopEdgePackagingJobCommandError - */ -const de_StopEdgePackagingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1StopHyperParameterTuningJobCommand */ @@ -18224,7 +11498,7 @@ export const de_StopHyperParameterTuningJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopHyperParameterTuningJobCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopHyperParameterTuningJobCommandOutput = { @@ -18233,32 +11507,6 @@ export const de_StopHyperParameterTuningJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopHyperParameterTuningJobCommandError - */ -const de_StopHyperParameterTuningJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopInferenceExperimentCommand */ @@ -18267,7 +11515,7 @@ export const de_StopInferenceExperimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopInferenceExperimentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18279,35 +11527,6 @@ export const de_StopInferenceExperimentCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopInferenceExperimentCommandError - */ -const de_StopInferenceExperimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopInferenceRecommendationsJobCommand */ @@ -18316,7 +11535,7 @@ export const de_StopInferenceRecommendationsJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopInferenceRecommendationsJobCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopInferenceRecommendationsJobCommandOutput = { @@ -18326,126 +11545,48 @@ export const de_StopInferenceRecommendationsJobCommand = async ( }; /** - * deserializeAws_json1_1StopInferenceRecommendationsJobCommandError + * deserializeAws_json1_1StopLabelingJobCommand */ -const de_StopInferenceRecommendationsJobCommandError = async ( +export const de_StopLabelingJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: StopLabelingJobCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1StopLabelingJobCommand + * deserializeAws_json1_1StopMonitoringScheduleCommand */ -export const de_StopLabelingJobCommand = async ( +export const de_StopMonitoringScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopLabelingJobCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: StopLabelingJobCommandOutput = { + const response: StopMonitoringScheduleCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1StopLabelingJobCommandError + * deserializeAws_json1_1StopNotebookInstanceCommand */ -const de_StopLabelingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StopMonitoringScheduleCommand - */ -export const de_StopMonitoringScheduleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StopMonitoringScheduleCommandError(output, context); - } - await collectBody(output.body, context); - const response: StopMonitoringScheduleCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1StopMonitoringScheduleCommandError - */ -const de_StopMonitoringScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StopNotebookInstanceCommand - */ -export const de_StopNotebookInstanceCommand = async ( +export const de_StopNotebookInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopNotebookInstanceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopNotebookInstanceCommandOutput = { @@ -18454,26 +11595,6 @@ export const de_StopNotebookInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopNotebookInstanceCommandError - */ -const de_StopNotebookInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1StopPipelineExecutionCommand */ @@ -18482,7 +11603,7 @@ export const de_StopPipelineExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopPipelineExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18494,35 +11615,6 @@ export const de_StopPipelineExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopPipelineExecutionCommandError - */ -const de_StopPipelineExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopProcessingJobCommand */ @@ -18531,7 +11623,7 @@ export const de_StopProcessingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopProcessingJobCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopProcessingJobCommandOutput = { @@ -18540,32 +11632,6 @@ export const de_StopProcessingJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopProcessingJobCommandError - */ -const de_StopProcessingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopTrainingJobCommand */ @@ -18574,7 +11640,7 @@ export const de_StopTrainingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopTrainingJobCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopTrainingJobCommandOutput = { @@ -18583,32 +11649,6 @@ export const de_StopTrainingJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopTrainingJobCommandError - */ -const de_StopTrainingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopTransformJobCommand */ @@ -18617,7 +11657,7 @@ export const de_StopTransformJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopTransformJobCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: StopTransformJobCommandOutput = { @@ -18626,32 +11666,6 @@ export const de_StopTransformJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopTransformJobCommandError - */ -const de_StopTransformJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateActionCommand */ @@ -18660,7 +11674,7 @@ export const de_UpdateActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18672,35 +11686,6 @@ export const de_UpdateActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateActionCommandError - */ -const de_UpdateActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateAppImageConfigCommand */ @@ -18709,7 +11694,7 @@ export const de_UpdateAppImageConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateAppImageConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18721,32 +11706,6 @@ export const de_UpdateAppImageConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateAppImageConfigCommandError - */ -const de_UpdateAppImageConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateArtifactCommand */ @@ -18755,7 +11714,7 @@ export const de_UpdateArtifactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateArtifactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18767,35 +11726,6 @@ export const de_UpdateArtifactCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateArtifactCommandError - */ -const de_UpdateArtifactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateClusterCommand */ @@ -18804,7 +11734,7 @@ export const de_UpdateClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18817,46 +11747,14 @@ export const de_UpdateClusterCommand = async ( }; /** - * deserializeAws_json1_1UpdateClusterCommandError + * deserializeAws_json1_1UpdateCodeRepositoryCommand */ -const de_UpdateClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateCodeRepositoryCommand - */ -export const de_UpdateCodeRepositoryCommand = async ( +export const de_UpdateCodeRepositoryCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateCodeRepositoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18868,32 +11766,6 @@ export const de_UpdateCodeRepositoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateCodeRepositoryCommandError - */ -const de_UpdateCodeRepositoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateContextCommand */ @@ -18902,7 +11774,7 @@ export const de_UpdateContextCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateContextCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -18914,35 +11786,6 @@ export const de_UpdateContextCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateContextCommandError - */ -const de_UpdateContextCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDeviceFleetCommand */ @@ -18951,7 +11794,7 @@ export const de_UpdateDeviceFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDeviceFleetCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateDeviceFleetCommandOutput = { @@ -18960,32 +11803,6 @@ export const de_UpdateDeviceFleetCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDeviceFleetCommandError - */ -const de_UpdateDeviceFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateDevicesCommand */ @@ -18994,7 +11811,7 @@ export const de_UpdateDevicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDevicesCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateDevicesCommandOutput = { @@ -19003,26 +11820,6 @@ export const de_UpdateDevicesCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDevicesCommandError - */ -const de_UpdateDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1UpdateDomainCommand */ @@ -19031,7 +11828,7 @@ export const de_UpdateDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19043,38 +11840,6 @@ export const de_UpdateDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateDomainCommandError - */ -const de_UpdateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateEndpointCommand */ @@ -19083,7 +11848,7 @@ export const de_UpdateEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19095,32 +11860,6 @@ export const de_UpdateEndpointCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateEndpointCommandError - */ -const de_UpdateEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateEndpointWeightsAndCapacitiesCommand */ @@ -19129,7 +11868,7 @@ export const de_UpdateEndpointWeightsAndCapacitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateEndpointWeightsAndCapacitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19141,32 +11880,6 @@ export const de_UpdateEndpointWeightsAndCapacitiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateEndpointWeightsAndCapacitiesCommandError - */ -const de_UpdateEndpointWeightsAndCapacitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateExperimentCommand */ @@ -19175,7 +11888,7 @@ export const de_UpdateExperimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateExperimentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19187,35 +11900,6 @@ export const de_UpdateExperimentCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateExperimentCommandError - */ -const de_UpdateExperimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateFeatureGroupCommand */ @@ -19224,7 +11908,7 @@ export const de_UpdateFeatureGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateFeatureGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19236,35 +11920,6 @@ export const de_UpdateFeatureGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateFeatureGroupCommandError - */ -const de_UpdateFeatureGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateFeatureMetadataCommand */ @@ -19273,7 +11928,7 @@ export const de_UpdateFeatureMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateFeatureMetadataCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateFeatureMetadataCommandOutput = { @@ -19282,32 +11937,6 @@ export const de_UpdateFeatureMetadataCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateFeatureMetadataCommandError - */ -const de_UpdateFeatureMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateHubCommand */ @@ -19316,7 +11945,7 @@ export const de_UpdateHubCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateHubCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19328,144 +11957,40 @@ export const de_UpdateHubCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateHubCommandError - */ -const de_UpdateHubCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateImageCommand */ export const de_UpdateImageCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateImageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateImageResponse(data, context); - const response: UpdateImageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateImageCommandError - */ -const de_UpdateImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateImageVersionCommand - */ -export const de_UpdateImageVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateImageVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateImageVersionResponse(data, context); - const response: UpdateImageVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateImageVersionCommandError - */ -const de_UpdateImageVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateImageResponse(data, context); + const response: UpdateImageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateInferenceComponentCommand + * deserializeAws_json1_1UpdateImageVersionCommand */ -export const de_UpdateInferenceComponentCommand = async ( +export const de_UpdateImageVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateInferenceComponentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateInferenceComponentOutput(data, context); - const response: UpdateInferenceComponentCommandOutput = { + contents = de_UpdateImageVersionResponse(data, context); + const response: UpdateImageVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -19473,29 +11998,23 @@ export const de_UpdateInferenceComponentCommand = async ( }; /** - * deserializeAws_json1_1UpdateInferenceComponentCommandError + * deserializeAws_json1_1UpdateInferenceComponentCommand */ -const de_UpdateInferenceComponentCommandError = async ( +export const de_UpdateInferenceComponentCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateInferenceComponentOutput(data, context); + const response: UpdateInferenceComponentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -19506,7 +12025,7 @@ export const de_UpdateInferenceComponentRuntimeConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateInferenceComponentRuntimeConfigCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19518,32 +12037,6 @@ export const de_UpdateInferenceComponentRuntimeConfigCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateInferenceComponentRuntimeConfigCommandError - */ -const de_UpdateInferenceComponentRuntimeConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateInferenceExperimentCommand */ @@ -19552,7 +12045,7 @@ export const de_UpdateInferenceExperimentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateInferenceExperimentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19564,35 +12057,6 @@ export const de_UpdateInferenceExperimentCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateInferenceExperimentCommandError - */ -const de_UpdateInferenceExperimentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateModelCardCommand */ @@ -19601,7 +12065,7 @@ export const de_UpdateModelCardCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateModelCardCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19613,38 +12077,6 @@ export const de_UpdateModelCardCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateModelCardCommandError - */ -const de_UpdateModelCardCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateModelPackageCommand */ @@ -19653,7 +12085,7 @@ export const de_UpdateModelPackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateModelPackageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19665,32 +12097,6 @@ export const de_UpdateModelPackageCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateModelPackageCommandError - */ -const de_UpdateModelPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateMonitoringAlertCommand */ @@ -19699,7 +12105,7 @@ export const de_UpdateMonitoringAlertCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateMonitoringAlertCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19711,35 +12117,6 @@ export const de_UpdateMonitoringAlertCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateMonitoringAlertCommandError - */ -const de_UpdateMonitoringAlertCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateMonitoringScheduleCommand */ @@ -19748,7 +12125,7 @@ export const de_UpdateMonitoringScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateMonitoringScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19760,35 +12137,6 @@ export const de_UpdateMonitoringScheduleCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateMonitoringScheduleCommandError - */ -const de_UpdateMonitoringScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateNotebookInstanceCommand */ @@ -19797,7 +12145,7 @@ export const de_UpdateNotebookInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateNotebookInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19809,76 +12157,24 @@ export const de_UpdateNotebookInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateNotebookInstanceCommandError - */ -const de_UpdateNotebookInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateNotebookInstanceLifecycleConfigCommand */ export const de_UpdateNotebookInstanceLifecycleConfigCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateNotebookInstanceLifecycleConfigCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateNotebookInstanceLifecycleConfigOutput(data, context); - const response: UpdateNotebookInstanceLifecycleConfigCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateNotebookInstanceLifecycleConfigCommandError - */ -const de_UpdateNotebookInstanceLifecycleConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateNotebookInstanceLifecycleConfigOutput(data, context); + const response: UpdateNotebookInstanceLifecycleConfigCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -19889,7 +12185,7 @@ export const de_UpdatePipelineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePipelineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19901,35 +12197,6 @@ export const de_UpdatePipelineCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdatePipelineCommandError - */ -const de_UpdatePipelineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdatePipelineExecutionCommand */ @@ -19938,7 +12205,7 @@ export const de_UpdatePipelineExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePipelineExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19950,35 +12217,6 @@ export const de_UpdatePipelineExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdatePipelineExecutionCommandError - */ -const de_UpdatePipelineExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateProjectCommand */ @@ -19987,7 +12225,7 @@ export const de_UpdateProjectCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateProjectCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -19999,32 +12237,6 @@ export const de_UpdateProjectCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateProjectCommandError - */ -const de_UpdateProjectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSpaceCommand */ @@ -20033,7 +12245,7 @@ export const de_UpdateSpaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSpaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20045,38 +12257,6 @@ export const de_UpdateSpaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSpaceCommandError - */ -const de_UpdateSpaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateTrainingJobCommand */ @@ -20085,7 +12265,7 @@ export const de_UpdateTrainingJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTrainingJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20097,35 +12277,6 @@ export const de_UpdateTrainingJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateTrainingJobCommandError - */ -const de_UpdateTrainingJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateTrialCommand */ @@ -20134,7 +12285,7 @@ export const de_UpdateTrialCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTrialCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20146,35 +12297,6 @@ export const de_UpdateTrialCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateTrialCommandError - */ -const de_UpdateTrialCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateTrialComponentCommand */ @@ -20183,7 +12305,7 @@ export const de_UpdateTrialComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTrialComponentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20195,35 +12317,6 @@ export const de_UpdateTrialComponentCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateTrialComponentCommandError - */ -const de_UpdateTrialComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateUserProfileCommand */ @@ -20232,7 +12325,7 @@ export const de_UpdateUserProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateUserProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20244,38 +12337,6 @@ export const de_UpdateUserProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateUserProfileCommandError - */ -const de_UpdateUserProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUse": - case "com.amazonaws.sagemaker#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.sagemaker#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sagemaker#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateWorkforceCommand */ @@ -20284,7 +12345,7 @@ export const de_UpdateWorkforceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateWorkforceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20296,32 +12357,6 @@ export const de_UpdateWorkforceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateWorkforceCommandError - */ -const de_UpdateWorkforceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sagemaker#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateWorkteamCommand */ @@ -20330,7 +12365,7 @@ export const de_UpdateWorkteamCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateWorkteamCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -20343,12 +12378,9 @@ export const de_UpdateWorkteamCommand = async ( }; /** - * deserializeAws_json1_1UpdateWorkteamCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateWorkteamCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -20358,13 +12390,22 @@ const de_UpdateWorkteamCommandError = async ( case "ResourceLimitExceeded": case "com.amazonaws.sagemaker#ResourceLimitExceeded": throw await de_ResourceLimitExceededRes(parsedOutput, context); + case "ResourceNotFound": + case "com.amazonaws.sagemaker#ResourceNotFound": + throw await de_ResourceNotFoundRes(parsedOutput, context); + case "ResourceInUse": + case "com.amazonaws.sagemaker#ResourceInUse": + throw await de_ResourceInUseRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.sagemaker#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-savingsplans/src/protocols/Aws_restJson1.ts b/clients/client-savingsplans/src/protocols/Aws_restJson1.ts index 0da32f1fbc67..04e0ff441b1d 100644 --- a/clients/client-savingsplans/src/protocols/Aws_restJson1.ts +++ b/clients/client-savingsplans/src/protocols/Aws_restJson1.ts @@ -306,7 +306,7 @@ export const de_CreateSavingsPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSavingsPlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -319,41 +319,6 @@ export const de_CreateSavingsPlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSavingsPlanCommandError - */ -const de_CreateSavingsPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.savingsplans#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.savingsplans#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.savingsplans#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.savingsplans#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteQueuedSavingsPlanCommand */ @@ -362,7 +327,7 @@ export const de_DeleteQueuedSavingsPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteQueuedSavingsPlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -371,41 +336,6 @@ export const de_DeleteQueuedSavingsPlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteQueuedSavingsPlanCommandError - */ -const de_DeleteQueuedSavingsPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.savingsplans#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.savingsplans#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.savingsplans#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.savingsplans#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeSavingsPlanRatesCommand */ @@ -414,7 +344,7 @@ export const de_DescribeSavingsPlanRatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSavingsPlanRatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -429,35 +359,6 @@ export const de_DescribeSavingsPlanRatesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeSavingsPlanRatesCommandError - */ -const de_DescribeSavingsPlanRatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.savingsplans#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.savingsplans#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeSavingsPlansCommand */ @@ -466,7 +367,7 @@ export const de_DescribeSavingsPlansCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSavingsPlansCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -480,35 +381,6 @@ export const de_DescribeSavingsPlansCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeSavingsPlansCommandError - */ -const de_DescribeSavingsPlansCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.savingsplans#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.savingsplans#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeSavingsPlansOfferingRatesCommand */ @@ -517,7 +389,7 @@ export const de_DescribeSavingsPlansOfferingRatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSavingsPlansOfferingRatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -531,35 +403,6 @@ export const de_DescribeSavingsPlansOfferingRatesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeSavingsPlansOfferingRatesCommandError - */ -const de_DescribeSavingsPlansOfferingRatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.savingsplans#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.savingsplans#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeSavingsPlansOfferingsCommand */ @@ -568,7 +411,7 @@ export const de_DescribeSavingsPlansOfferingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSavingsPlansOfferingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -582,35 +425,6 @@ export const de_DescribeSavingsPlansOfferingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeSavingsPlansOfferingsCommandError - */ -const de_DescribeSavingsPlansOfferingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.savingsplans#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.savingsplans#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -619,7 +433,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -632,38 +446,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.savingsplans#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.savingsplans#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.savingsplans#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -672,7 +454,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -681,41 +463,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.savingsplans#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.savingsplans#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.savingsplans#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.savingsplans#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -724,7 +471,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -734,12 +481,9 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -752,6 +496,9 @@ const de_UntagResourceCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.savingsplans#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.savingsplans#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.savingsplans#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); @@ -761,7 +508,7 @@ const de_UntagResourceCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-scheduler/src/protocols/Aws_restJson1.ts b/clients/client-scheduler/src/protocols/Aws_restJson1.ts index b11765e03433..7013f5e888a4 100644 --- a/clients/client-scheduler/src/protocols/Aws_restJson1.ts +++ b/clients/client-scheduler/src/protocols/Aws_restJson1.ts @@ -349,7 +349,7 @@ export const de_CreateScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -362,47 +362,6 @@ export const de_CreateScheduleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateScheduleCommandError - */ -const de_CreateScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.scheduler#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.scheduler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.scheduler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.scheduler#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.scheduler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.scheduler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateScheduleGroupCommand */ @@ -411,7 +370,7 @@ export const de_CreateScheduleGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateScheduleGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -424,44 +383,6 @@ export const de_CreateScheduleGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateScheduleGroupCommandError - */ -const de_CreateScheduleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.scheduler#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.scheduler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.scheduler#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.scheduler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.scheduler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteScheduleCommand */ @@ -470,7 +391,7 @@ export const de_DeleteScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -479,44 +400,6 @@ export const de_DeleteScheduleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteScheduleCommandError - */ -const de_DeleteScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.scheduler#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.scheduler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.scheduler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.scheduler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.scheduler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteScheduleGroupCommand */ @@ -525,7 +408,7 @@ export const de_DeleteScheduleGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteScheduleGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -534,44 +417,6 @@ export const de_DeleteScheduleGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteScheduleGroupCommandError - */ -const de_DeleteScheduleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.scheduler#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.scheduler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.scheduler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.scheduler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.scheduler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetScheduleCommand */ @@ -580,7 +425,7 @@ export const de_GetScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -607,41 +452,6 @@ export const de_GetScheduleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetScheduleCommandError - */ -const de_GetScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.scheduler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.scheduler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.scheduler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.scheduler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetScheduleGroupCommand */ @@ -650,7 +460,7 @@ export const de_GetScheduleGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetScheduleGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -667,41 +477,6 @@ export const de_GetScheduleGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetScheduleGroupCommandError - */ -const de_GetScheduleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.scheduler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.scheduler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.scheduler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.scheduler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListScheduleGroupsCommand */ @@ -710,7 +485,7 @@ export const de_ListScheduleGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListScheduleGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -724,38 +499,6 @@ export const de_ListScheduleGroupsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListScheduleGroupsCommandError - */ -const de_ListScheduleGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.scheduler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.scheduler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.scheduler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSchedulesCommand */ @@ -764,7 +507,7 @@ export const de_ListSchedulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSchedulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -778,41 +521,6 @@ export const de_ListSchedulesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSchedulesCommandError - */ -const de_ListSchedulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.scheduler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.scheduler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.scheduler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.scheduler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -821,7 +529,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -834,41 +542,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.scheduler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.scheduler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.scheduler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.scheduler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -877,7 +550,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -886,44 +559,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.scheduler#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.scheduler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.scheduler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.scheduler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.scheduler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -932,7 +567,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -941,44 +576,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.scheduler#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.scheduler#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.scheduler#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.scheduler#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.scheduler#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateScheduleCommand */ @@ -987,7 +584,7 @@ export const de_UpdateScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateScheduleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1001,12 +598,9 @@ export const de_UpdateScheduleCommand = async ( }; /** - * deserializeAws_restJson1UpdateScheduleCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1022,6 +616,9 @@ const de_UpdateScheduleCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.scheduler#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.scheduler#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.scheduler#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -1034,7 +631,7 @@ const de_UpdateScheduleCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-schemas/src/protocols/Aws_restJson1.ts b/clients/client-schemas/src/protocols/Aws_restJson1.ts index 3c42020f7df6..c9e8ee23e4dd 100644 --- a/clients/client-schemas/src/protocols/Aws_restJson1.ts +++ b/clients/client-schemas/src/protocols/Aws_restJson1.ts @@ -737,7 +737,7 @@ export const de_CreateDiscovererCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateDiscovererCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -756,47 +756,6 @@ export const de_CreateDiscovererCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDiscovererCommandError - */ -const de_CreateDiscovererCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.schemas#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRegistryCommand */ @@ -805,7 +764,7 @@ export const de_CreateRegistryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateRegistryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -821,47 +780,6 @@ export const de_CreateRegistryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRegistryCommandError - */ -const de_CreateRegistryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.schemas#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSchemaCommand */ @@ -870,7 +788,7 @@ export const de_CreateSchemaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSchemaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -890,41 +808,6 @@ export const de_CreateSchemaCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSchemaCommandError - */ -const de_CreateSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDiscovererCommand */ @@ -933,7 +816,7 @@ export const de_DeleteDiscovererCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDiscovererCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -942,47 +825,6 @@ export const de_DeleteDiscovererCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDiscovererCommandError - */ -const de_DeleteDiscovererCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRegistryCommand */ @@ -991,7 +833,7 @@ export const de_DeleteRegistryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRegistryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1001,55 +843,31 @@ export const de_DeleteRegistryCommand = async ( }; /** - * deserializeAws_restJson1DeleteRegistryCommandError + * deserializeAws_restJson1DeleteResourcePolicyCommand */ -const de_DeleteRegistryCommandError = async ( +export const de_DeleteResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteResourcePolicyCommand + * deserializeAws_restJson1DeleteSchemaCommand */ -export const de_DeleteResourcePolicyCommand = async ( +export const de_DeleteSchemaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1059,236 +877,55 @@ export const de_DeleteResourcePolicyCommand = async ( }; /** - * deserializeAws_restJson1DeleteResourcePolicyCommandError + * deserializeAws_restJson1DeleteSchemaVersionCommand */ -const de_DeleteResourcePolicyCommandError = async ( +export const de_DeleteSchemaVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteSchemaCommand + * deserializeAws_restJson1DescribeCodeBindingCommand */ -export const de_DeleteSchemaCommand = async ( +export const de_DescribeCodeBindingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSchemaCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CreationDate: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + LastModified: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + SchemaVersion: __expectString, + Status: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteSchemaCommandError + * deserializeAws_restJson1DescribeDiscovererCommand */ -const de_DeleteSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSchemaVersionCommand - */ -export const de_DeleteSchemaVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSchemaVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSchemaVersionCommandError - */ -const de_DeleteSchemaVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeCodeBindingCommand - */ -export const de_DescribeCodeBindingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeCodeBindingCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CreationDate: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - LastModified: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - SchemaVersion: __expectString, - Status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeCodeBindingCommandError - */ -const de_DescribeCodeBindingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.schemas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDiscovererCommand - */ -export const de_DescribeDiscovererCommand = async ( +export const de_DescribeDiscovererCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDiscovererCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1307,47 +944,6 @@ export const de_DescribeDiscovererCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDiscovererCommandError - */ -const de_DescribeDiscovererCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeRegistryCommand */ @@ -1356,7 +952,7 @@ export const de_DescribeRegistryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRegistryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1372,47 +968,6 @@ export const de_DescribeRegistryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeRegistryCommandError - */ -const de_DescribeRegistryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeSchemaCommand */ @@ -1421,7 +976,7 @@ export const de_DescribeSchemaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSchemaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1442,47 +997,6 @@ export const de_DescribeSchemaCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeSchemaCommandError - */ -const de_DescribeSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ExportSchemaCommand */ @@ -1491,7 +1005,7 @@ export const de_ExportSchemaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExportSchemaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1508,50 +1022,6 @@ export const de_ExportSchemaCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ExportSchemaCommandError - */ -const de_ExportSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.schemas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCodeBindingSourceCommand */ @@ -1560,7 +1030,7 @@ export const de_GetCodeBindingSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCodeBindingSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1570,47 +1040,6 @@ export const de_GetCodeBindingSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCodeBindingSourceCommandError - */ -const de_GetCodeBindingSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.schemas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDiscoveredSchemaCommand */ @@ -1619,7 +1048,7 @@ export const de_GetDiscoveredSchemaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDiscoveredSchemaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1632,44 +1061,6 @@ export const de_GetDiscoveredSchemaCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDiscoveredSchemaCommandError - */ -const de_GetDiscoveredSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetResourcePolicyCommand */ @@ -1678,7 +1069,7 @@ export const de_GetResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1692,47 +1083,6 @@ export const de_GetResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetResourcePolicyCommandError - */ -const de_GetResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDiscoverersCommand */ @@ -1741,7 +1091,7 @@ export const de_ListDiscoverersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDiscoverersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1756,112 +1106,14 @@ export const de_ListDiscoverersCommand = async ( }; /** - * deserializeAws_restJson1ListDiscoverersCommandError - */ -const de_ListDiscoverersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListRegistriesCommand - */ -export const de_ListRegistriesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRegistriesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Registries: (_) => de___listOfRegistrySummary(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListRegistriesCommandError - */ -const de_ListRegistriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSchemasCommand + * deserializeAws_restJson1ListRegistriesCommand */ -export const de_ListSchemasCommand = async ( +export const de_ListRegistriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSchemasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1869,48 +1121,32 @@ export const de_ListSchemasCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { NextToken: __expectString, - Schemas: (_) => de___listOfSchemaSummary(_, context), + Registries: (_) => de___listOfRegistrySummary(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSchemasCommandError + * deserializeAws_restJson1ListSchemasCommand */ -const de_ListSchemasCommandError = async ( +export const de_ListSchemasCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Schemas: (_) => de___listOfSchemaSummary(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1921,7 +1157,7 @@ export const de_ListSchemaVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSchemaVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1935,47 +1171,6 @@ export const de_ListSchemaVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSchemaVersionsCommandError - */ -const de_ListSchemaVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1984,7 +1179,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1997,41 +1192,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutCodeBindingCommand */ @@ -2040,7 +1200,7 @@ export const de_PutCodeBindingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_PutCodeBindingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2056,50 +1216,6 @@ export const de_PutCodeBindingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutCodeBindingCommandError - */ -const de_PutCodeBindingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "GoneException": - case "com.amazonaws.schemas#GoneException": - throw await de_GoneExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.schemas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutResourcePolicyCommand */ @@ -2108,7 +1224,7 @@ export const de_PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2119,174 +1235,51 @@ export const de_PutResourcePolicyCommand = async ( RevisionId: __expectString, }); Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1PutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.schemas#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchSchemasCommand - */ -export const de_SearchSchemasCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchSchemasCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Schemas: (_) => de___listOfSearchSchemaSummary(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SearchSchemasCommandError - */ -const de_SearchSchemasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return contents; }; /** - * deserializeAws_restJson1StartDiscovererCommand + * deserializeAws_restJson1SearchSchemasCommand */ -export const de_StartDiscovererCommand = async ( +export const de_SearchSchemasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartDiscovererCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DiscovererId: __expectString, - State: __expectString, + NextToken: __expectString, + Schemas: (_) => de___listOfSearchSchemaSummary(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1StartDiscovererCommandError + * deserializeAws_restJson1StartDiscovererCommand */ -const de_StartDiscovererCommandError = async ( +export const de_StartDiscovererCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DiscovererId: __expectString, + State: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2297,7 +1290,7 @@ export const de_StopDiscovererCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopDiscovererCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2311,47 +1304,6 @@ export const de_StopDiscovererCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopDiscovererCommandError - */ -const de_StopDiscovererCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2360,7 +1312,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2369,41 +1321,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2412,7 +1329,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2421,41 +1338,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDiscovererCommand */ @@ -2464,7 +1346,7 @@ export const de_UpdateDiscovererCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDiscovererCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2483,47 +1365,6 @@ export const de_UpdateDiscovererCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDiscovererCommandError - */ -const de_UpdateDiscovererCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRegistryCommand */ @@ -2532,7 +1373,7 @@ export const de_UpdateRegistryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRegistryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2548,47 +1389,6 @@ export const de_UpdateRegistryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRegistryCommandError - */ -const de_UpdateRegistryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.schemas#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.schemas#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.schemas#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.schemas#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.schemas#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSchemaCommand */ @@ -2597,7 +1397,7 @@ export const de_UpdateSchemaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSchemaCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2618,12 +1418,9 @@ export const de_UpdateSchemaCommand = async ( }; /** - * deserializeAws_restJson1UpdateSchemaCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2633,25 +1430,40 @@ const de_UpdateSchemaCommandError = async ( case "BadRequestException": case "com.amazonaws.schemas#BadRequestException": throw await de_BadRequestExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.schemas#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "ForbiddenException": case "com.amazonaws.schemas#ForbiddenException": throw await de_ForbiddenExceptionRes(parsedOutput, context); case "InternalServerErrorException": case "com.amazonaws.schemas#InternalServerErrorException": throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.schemas#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); case "ServiceUnavailableException": case "com.amazonaws.schemas#ServiceUnavailableException": throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.schemas#UnauthorizedException": + throw await de_UnauthorizedExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.schemas#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.schemas#TooManyRequestsException": + throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "GoneException": + case "com.amazonaws.schemas#GoneException": + throw await de_GoneExceptionRes(parsedOutput, context); + case "PreconditionFailedException": + case "com.amazonaws.schemas#PreconditionFailedException": + throw await de_PreconditionFailedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts b/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts index f47f0d4e4429..538ca6d53f00 100644 --- a/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts +++ b/clients/client-secrets-manager/src/protocols/Aws_json1_1.ts @@ -430,7 +430,7 @@ export const de_BatchGetSecretValueCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchGetSecretValueCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -442,47 +442,6 @@ export const de_BatchGetSecretValueCommand = async ( return response; }; -/** - * deserializeAws_json1_1BatchGetSecretValueCommandError - */ -const de_BatchGetSecretValueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DecryptionFailure": - case "com.amazonaws.secretsmanager#DecryptionFailure": - throw await de_DecryptionFailureRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.secretsmanager#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelRotateSecretCommand */ @@ -491,7 +450,7 @@ export const de_CancelRotateSecretCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelRotateSecretCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -503,41 +462,6 @@ export const de_CancelRotateSecretCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelRotateSecretCommandError - */ -const de_CancelRotateSecretCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateSecretCommand */ @@ -546,7 +470,7 @@ export const de_CreateSecretCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSecretCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -558,59 +482,6 @@ export const de_CreateSecretCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateSecretCommandError - */ -const de_CreateSecretCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DecryptionFailure": - case "com.amazonaws.secretsmanager#DecryptionFailure": - throw await de_DecryptionFailureRes(parsedOutput, context); - case "EncryptionFailure": - case "com.amazonaws.secretsmanager#EncryptionFailure": - throw await de_EncryptionFailureRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.secretsmanager#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedPolicyDocumentException": - case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.secretsmanager#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.secretsmanager#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteResourcePolicyCommand */ @@ -619,7 +490,7 @@ export const de_DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -631,41 +502,6 @@ export const de_DeleteResourcePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteSecretCommand */ @@ -674,7 +510,7 @@ export const de_DeleteSecretCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSecretCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -686,41 +522,6 @@ export const de_DeleteSecretCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteSecretCommandError - */ -const de_DeleteSecretCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeSecretCommand */ @@ -729,7 +530,7 @@ export const de_DescribeSecretCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSecretCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -741,38 +542,6 @@ export const de_DescribeSecretCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeSecretCommandError - */ -const de_DescribeSecretCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetRandomPasswordCommand */ @@ -781,7 +550,7 @@ export const de_GetRandomPasswordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRandomPasswordCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -793,38 +562,6 @@ export const de_GetRandomPasswordCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetRandomPasswordCommandError - */ -const de_GetRandomPasswordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetResourcePolicyCommand */ @@ -833,7 +570,7 @@ export const de_GetResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -846,49 +583,14 @@ export const de_GetResourcePolicyCommand = async ( }; /** - * deserializeAws_json1_1GetResourcePolicyCommandError + * deserializeAws_json1_1GetSecretValueCommand */ -const de_GetResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSecretValueCommand - */ -export const de_GetSecretValueCommand = async ( +export const de_GetSecretValueCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSecretValueCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -900,44 +602,6 @@ export const de_GetSecretValueCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetSecretValueCommandError - */ -const de_GetSecretValueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DecryptionFailure": - case "com.amazonaws.secretsmanager#DecryptionFailure": - throw await de_DecryptionFailureRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListSecretsCommand */ @@ -946,7 +610,7 @@ export const de_ListSecretsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSecretsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -958,41 +622,6 @@ export const de_ListSecretsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSecretsCommandError - */ -const de_ListSecretsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.secretsmanager#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListSecretVersionIdsCommand */ @@ -1001,7 +630,7 @@ export const de_ListSecretVersionIdsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListSecretVersionIdsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1013,41 +642,6 @@ export const de_ListSecretVersionIdsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListSecretVersionIdsCommandError - */ -const de_ListSecretVersionIdsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.secretsmanager#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutResourcePolicyCommand */ @@ -1056,7 +650,7 @@ export const de_PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1068,47 +662,6 @@ export const de_PutResourcePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MalformedPolicyDocumentException": - case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "PublicPolicyException": - case "com.amazonaws.secretsmanager#PublicPolicyException": - throw await de_PublicPolicyExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutSecretValueCommand */ @@ -1117,7 +670,7 @@ export const de_PutSecretValueCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutSecretValueCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1129,53 +682,6 @@ export const de_PutSecretValueCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutSecretValueCommandError - */ -const de_PutSecretValueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DecryptionFailure": - case "com.amazonaws.secretsmanager#DecryptionFailure": - throw await de_DecryptionFailureRes(parsedOutput, context); - case "EncryptionFailure": - case "com.amazonaws.secretsmanager#EncryptionFailure": - throw await de_EncryptionFailureRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.secretsmanager#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.secretsmanager#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RemoveRegionsFromReplicationCommand */ @@ -1184,7 +690,7 @@ export const de_RemoveRegionsFromReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveRegionsFromReplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1196,41 +702,6 @@ export const de_RemoveRegionsFromReplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1RemoveRegionsFromReplicationCommandError - */ -const de_RemoveRegionsFromReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ReplicateSecretToRegionsCommand */ @@ -1239,7 +710,7 @@ export const de_ReplicateSecretToRegionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ReplicateSecretToRegionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1247,114 +718,24 @@ export const de_ReplicateSecretToRegionsCommand = async ( const response: ReplicateSecretToRegionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ReplicateSecretToRegionsCommandError - */ -const de_ReplicateSecretToRegionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RestoreSecretCommand - */ -export const de_RestoreSecretCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RestoreSecretCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: RestoreSecretCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RestoreSecretCommandError - */ -const de_RestoreSecretCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }; + return response; }; /** - * deserializeAws_json1_1RotateSecretCommand + * deserializeAws_json1_1RestoreSecretCommand */ -export const de_RotateSecretCommand = async ( +export const de_RestoreSecretCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_RotateSecretCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: RotateSecretCommandOutput = { + const response: RestoreSecretCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1362,38 +743,23 @@ export const de_RotateSecretCommand = async ( }; /** - * deserializeAws_json1_1RotateSecretCommandError + * deserializeAws_json1_1RotateSecretCommand */ -const de_RotateSecretCommandError = async ( +export const de_RotateSecretCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: RotateSecretCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1404,7 +770,7 @@ export const de_StopReplicationToReplicaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopReplicationToReplicaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1416,41 +782,6 @@ export const de_StopReplicationToReplicaCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopReplicationToReplicaCommandError - */ -const de_StopReplicationToReplicaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -1459,7 +790,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: TagResourceCommandOutput = { @@ -1468,41 +799,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -1511,7 +807,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UntagResourceCommandOutput = { @@ -1520,41 +816,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSecretCommand */ @@ -1563,7 +824,7 @@ export const de_UpdateSecretCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSecretCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1575,59 +836,6 @@ export const de_UpdateSecretCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSecretCommandError - */ -const de_UpdateSecretCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DecryptionFailure": - case "com.amazonaws.secretsmanager#DecryptionFailure": - throw await de_DecryptionFailureRes(parsedOutput, context); - case "EncryptionFailure": - case "com.amazonaws.secretsmanager#EncryptionFailure": - throw await de_EncryptionFailureRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.secretsmanager#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MalformedPolicyDocumentException": - case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "PreconditionNotMetException": - case "com.amazonaws.secretsmanager#PreconditionNotMetException": - throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.secretsmanager#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSecretVersionStageCommand */ @@ -1636,7 +844,7 @@ export const de_UpdateSecretVersionStageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSecretVersionStageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1648,44 +856,6 @@ export const de_UpdateSecretVersionStageCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSecretVersionStageCommandError - */ -const de_UpdateSecretVersionStageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.secretsmanager#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.secretsmanager#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.secretsmanager#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.secretsmanager#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.secretsmanager#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ValidateResourcePolicyCommand */ @@ -1694,7 +864,7 @@ export const de_ValidateResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ValidateResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1707,40 +877,58 @@ export const de_ValidateResourcePolicyCommand = async ( }; /** - * deserializeAws_json1_1ValidateResourcePolicyCommandError + * deserialize_Aws_json1_1CommandError */ -const de_ValidateResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "DecryptionFailure": + case "com.amazonaws.secretsmanager#DecryptionFailure": + throw await de_DecryptionFailureRes(parsedOutput, context); case "InternalServiceError": case "com.amazonaws.secretsmanager#InternalServiceError": throw await de_InternalServiceErrorRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.secretsmanager#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); case "InvalidParameterException": case "com.amazonaws.secretsmanager#InvalidParameterException": throw await de_InvalidParameterExceptionRes(parsedOutput, context); case "InvalidRequestException": case "com.amazonaws.secretsmanager#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "MalformedPolicyDocumentException": - case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.secretsmanager#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "EncryptionFailure": + case "com.amazonaws.secretsmanager#EncryptionFailure": + throw await de_EncryptionFailureRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.secretsmanager#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "MalformedPolicyDocumentException": + case "com.amazonaws.secretsmanager#MalformedPolicyDocumentException": + throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); + case "PreconditionNotMetException": + case "com.amazonaws.secretsmanager#PreconditionNotMetException": + throw await de_PreconditionNotMetExceptionRes(parsedOutput, context); + case "ResourceExistsException": + case "com.amazonaws.secretsmanager#ResourceExistsException": + throw await de_ResourceExistsExceptionRes(parsedOutput, context); + case "PublicPolicyException": + case "com.amazonaws.secretsmanager#PublicPolicyException": + throw await de_PublicPolicyExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-securityhub/src/protocols/Aws_restJson1.ts b/clients/client-securityhub/src/protocols/Aws_restJson1.ts index 17ba1a3f2103..b1f82d099e49 100644 --- a/clients/client-securityhub/src/protocols/Aws_restJson1.ts +++ b/clients/client-securityhub/src/protocols/Aws_restJson1.ts @@ -2611,7 +2611,7 @@ export const de_AcceptAdministratorInvitationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptAdministratorInvitationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2620,44 +2620,6 @@ export const de_AcceptAdministratorInvitationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptAdministratorInvitationCommandError - */ -const de_AcceptAdministratorInvitationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AcceptInvitationCommand */ @@ -2666,7 +2628,7 @@ export const de_AcceptInvitationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AcceptInvitationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2675,44 +2637,6 @@ export const de_AcceptInvitationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AcceptInvitationCommandError - */ -const de_AcceptInvitationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDeleteAutomationRulesCommand */ @@ -2721,7 +2645,7 @@ export const de_BatchDeleteAutomationRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDeleteAutomationRulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2735,44 +2659,6 @@ export const de_BatchDeleteAutomationRulesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDeleteAutomationRulesCommandError - */ -const de_BatchDeleteAutomationRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchDisableStandardsCommand */ @@ -2781,7 +2667,7 @@ export const de_BatchDisableStandardsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchDisableStandardsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2794,44 +2680,6 @@ export const de_BatchDisableStandardsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchDisableStandardsCommandError - */ -const de_BatchDisableStandardsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchEnableStandardsCommand */ @@ -2840,7 +2688,7 @@ export const de_BatchEnableStandardsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchEnableStandardsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2853,44 +2701,6 @@ export const de_BatchEnableStandardsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchEnableStandardsCommandError - */ -const de_BatchEnableStandardsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetAutomationRulesCommand */ @@ -2899,7 +2709,7 @@ export const de_BatchGetAutomationRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetAutomationRulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2913,47 +2723,6 @@ export const de_BatchGetAutomationRulesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetAutomationRulesCommandError - */ -const de_BatchGetAutomationRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetConfigurationPolicyAssociationsCommand */ @@ -2962,7 +2731,7 @@ export const de_BatchGetConfigurationPolicyAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetConfigurationPolicyAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2976,47 +2745,6 @@ export const de_BatchGetConfigurationPolicyAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetConfigurationPolicyAssociationsCommandError - */ -const de_BatchGetConfigurationPolicyAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchGetSecurityControlsCommand */ @@ -3025,7 +2753,7 @@ export const de_BatchGetSecurityControlsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetSecurityControlsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3040,49 +2768,14 @@ export const de_BatchGetSecurityControlsCommand = async ( }; /** - * deserializeAws_restJson1BatchGetSecurityControlsCommandError + * deserializeAws_restJson1BatchGetStandardsControlAssociationsCommand */ -const de_BatchGetSecurityControlsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1BatchGetStandardsControlAssociationsCommand - */ -export const de_BatchGetStandardsControlAssociationsCommand = async ( +export const de_BatchGetStandardsControlAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetStandardsControlAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3096,41 +2789,6 @@ export const de_BatchGetStandardsControlAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetStandardsControlAssociationsCommandError - */ -const de_BatchGetStandardsControlAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchImportFindingsCommand */ @@ -3139,7 +2797,7 @@ export const de_BatchImportFindingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchImportFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3154,41 +2812,6 @@ export const de_BatchImportFindingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchImportFindingsCommandError - */ -const de_BatchImportFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUpdateAutomationRulesCommand */ @@ -3197,7 +2820,7 @@ export const de_BatchUpdateAutomationRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpdateAutomationRulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3211,44 +2834,6 @@ export const de_BatchUpdateAutomationRulesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchUpdateAutomationRulesCommandError - */ -const de_BatchUpdateAutomationRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUpdateFindingsCommand */ @@ -3257,7 +2842,7 @@ export const de_BatchUpdateFindingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpdateFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3271,41 +2856,6 @@ export const de_BatchUpdateFindingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchUpdateFindingsCommandError - */ -const de_BatchUpdateFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1BatchUpdateStandardsControlAssociationsCommand */ @@ -3314,7 +2864,7 @@ export const de_BatchUpdateStandardsControlAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpdateStandardsControlAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3327,44 +2877,6 @@ export const de_BatchUpdateStandardsControlAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchUpdateStandardsControlAssociationsCommandError - */ -const de_BatchUpdateStandardsControlAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateActionTargetCommand */ @@ -3373,7 +2885,7 @@ export const de_CreateActionTargetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateActionTargetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3387,362 +2899,225 @@ export const de_CreateActionTargetCommand = async ( }; /** - * deserializeAws_restJson1CreateActionTargetCommandError + * deserializeAws_restJson1CreateAutomationRuleCommand */ -const de_CreateActionTargetCommandError = async ( +export const de_CreateAutomationRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.securityhub#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RuleArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateAutomationRuleCommand + * deserializeAws_restJson1CreateConfigurationPolicyCommand */ -export const de_CreateAutomationRuleCommand = async ( +export const de_CreateConfigurationPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAutomationRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - RuleArn: __expectString, + Arn: __expectString, + ConfigurationPolicy: (_) => de_Policy(__expectUnion(_), context), + CreatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + Description: __expectString, + Id: __expectString, + Name: __expectString, + UpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateAutomationRuleCommandError + * deserializeAws_restJson1CreateFindingAggregatorCommand */ -const de_CreateAutomationRuleCommandError = async ( +export const de_CreateFindingAggregatorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateConfigurationPolicyCommand - */ -export const de_CreateConfigurationPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConfigurationPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - ConfigurationPolicy: (_) => de_Policy(__expectUnion(_), context), - CreatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - Description: __expectString, - Id: __expectString, - Name: __expectString, - UpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + FindingAggregationRegion: __expectString, + FindingAggregatorArn: __expectString, + RegionLinkingMode: __expectString, + Regions: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateConfigurationPolicyCommandError + * deserializeAws_restJson1CreateInsightCommand */ -const de_CreateConfigurationPolicyCommandError = async ( +export const de_CreateInsightCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.securityhub#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + InsightArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateFindingAggregatorCommand + * deserializeAws_restJson1CreateMembersCommand */ -export const de_CreateFindingAggregatorCommand = async ( +export const de_CreateMembersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFindingAggregatorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - FindingAggregationRegion: __expectString, - FindingAggregatorArn: __expectString, - RegionLinkingMode: __expectString, - Regions: _json, + UnprocessedAccounts: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateFindingAggregatorCommandError + * deserializeAws_restJson1DeclineInvitationsCommand */ -const de_CreateFindingAggregatorCommandError = async ( +export const de_DeclineInvitationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + UnprocessedAccounts: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateInsightCommand + * deserializeAws_restJson1DeleteActionTargetCommand */ -export const de_CreateInsightCommand = async ( +export const de_DeleteActionTargetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateInsightCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - InsightArn: __expectString, + ActionTargetArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateInsightCommandError + * deserializeAws_restJson1DeleteConfigurationPolicyCommand */ -const de_CreateInsightCommandError = async ( +export const de_DeleteConfigurationPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.securityhub#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateMembersCommand + * deserializeAws_restJson1DeleteFindingAggregatorCommand */ -export const de_CreateMembersCommand = async ( +export const de_DeleteFindingAggregatorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - UnprocessedAccounts: _json, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateMembersCommandError + * deserializeAws_restJson1DeleteInsightCommand */ -const de_CreateMembersCommandError = async ( +export const de_DeleteInsightCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.securityhub#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + InsightArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeclineInvitationsCommand + * deserializeAws_restJson1DeleteInvitationsCommand */ -export const de_DeclineInvitationsCommand = async ( +export const de_DeleteInvitationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeclineInvitationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3756,1444 +3131,105 @@ export const de_DeclineInvitationsCommand = async ( }; /** - * deserializeAws_restJson1DeclineInvitationsCommandError + * deserializeAws_restJson1DeleteMembersCommand */ -const de_DeclineInvitationsCommandError = async ( +export const de_DeleteMembersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteActionTargetCommand - */ -export const de_DeleteActionTargetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteActionTargetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ActionTargetArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteActionTargetCommandError - */ -const de_DeleteActionTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteConfigurationPolicyCommand - */ -export const de_DeleteConfigurationPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConfigurationPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteConfigurationPolicyCommandError - */ -const de_DeleteConfigurationPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.securityhub#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteFindingAggregatorCommand - */ -export const de_DeleteFindingAggregatorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFindingAggregatorCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteFindingAggregatorCommandError - */ -const de_DeleteFindingAggregatorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteInsightCommand - */ -export const de_DeleteInsightCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteInsightCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - InsightArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteInsightCommandError - */ -const de_DeleteInsightCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteInvitationsCommand - */ -export const de_DeleteInvitationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteInvitationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - UnprocessedAccounts: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteInvitationsCommandError - */ -const de_DeleteInvitationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteMembersCommand - */ -export const de_DeleteMembersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteMembersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - UnprocessedAccounts: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteMembersCommandError - */ -const de_DeleteMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeActionTargetsCommand - */ -export const de_DescribeActionTargetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeActionTargetsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ActionTargets: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeActionTargetsCommandError - */ -const de_DescribeActionTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeHubCommand - */ -export const de_DescribeHubCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeHubCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AutoEnableControls: __expectBoolean, - ControlFindingGenerator: __expectString, - HubArn: __expectString, - SubscribedAt: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeHubCommandError - */ -const de_DescribeHubCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeOrganizationConfigurationCommand - */ -export const de_DescribeOrganizationConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeOrganizationConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AutoEnable: __expectBoolean, - AutoEnableStandards: __expectString, - MemberAccountLimitReached: __expectBoolean, - OrganizationConfiguration: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeOrganizationConfigurationCommandError - */ -const de_DescribeOrganizationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeProductsCommand - */ -export const de_DescribeProductsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeProductsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Products: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeProductsCommandError - */ -const de_DescribeProductsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeStandardsCommand - */ -export const de_DescribeStandardsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeStandardsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Standards: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeStandardsCommandError - */ -const de_DescribeStandardsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeStandardsControlsCommand - */ -export const de_DescribeStandardsControlsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeStandardsControlsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Controls: (_) => de_StandardsControls(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeStandardsControlsCommandError - */ -const de_DescribeStandardsControlsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisableImportFindingsForProductCommand - */ -export const de_DisableImportFindingsForProductCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableImportFindingsForProductCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisableImportFindingsForProductCommandError - */ -const de_DisableImportFindingsForProductCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisableOrganizationAdminAccountCommand - */ -export const de_DisableOrganizationAdminAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableOrganizationAdminAccountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisableOrganizationAdminAccountCommandError - */ -const de_DisableOrganizationAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisableSecurityHubCommand - */ -export const de_DisableSecurityHubCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisableSecurityHubCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisableSecurityHubCommandError - */ -const de_DisableSecurityHubCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateFromAdministratorAccountCommand - */ -export const de_DisassociateFromAdministratorAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateFromAdministratorAccountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateFromAdministratorAccountCommandError - */ -const de_DisassociateFromAdministratorAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateFromMasterAccountCommand - */ -export const de_DisassociateFromMasterAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateFromMasterAccountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateFromMasterAccountCommandError - */ -const de_DisassociateFromMasterAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateMembersCommand - */ -export const de_DisassociateMembersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateMembersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateMembersCommandError - */ -const de_DisassociateMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1EnableImportFindingsForProductCommand - */ -export const de_EnableImportFindingsForProductCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableImportFindingsForProductCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ProductSubscriptionArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1EnableImportFindingsForProductCommandError - */ -const de_EnableImportFindingsForProductCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.securityhub#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1EnableOrganizationAdminAccountCommand - */ -export const de_EnableOrganizationAdminAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableOrganizationAdminAccountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1EnableOrganizationAdminAccountCommandError - */ -const de_EnableOrganizationAdminAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1EnableSecurityHubCommand - */ -export const de_EnableSecurityHubCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EnableSecurityHubCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1EnableSecurityHubCommandError - */ -const de_EnableSecurityHubCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.securityhub#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAdministratorAccountCommand - */ -export const de_GetAdministratorAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAdministratorAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Administrator: (_) => de_Invitation(_, context), + UnprocessedAccounts: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetAdministratorAccountCommandError - */ -const de_GetAdministratorAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetConfigurationPolicyCommand + * deserializeAws_restJson1DescribeActionTargetsCommand */ -export const de_GetConfigurationPolicyCommand = async ( +export const de_DescribeActionTargetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfigurationPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - ConfigurationPolicy: (_) => de_Policy(__expectUnion(_), context), - CreatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - Description: __expectString, - Id: __expectString, - Name: __expectString, - UpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + ActionTargets: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetConfigurationPolicyCommandError - */ -const de_GetConfigurationPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetConfigurationPolicyAssociationCommand + * deserializeAws_restJson1DescribeHubCommand */ -export const de_GetConfigurationPolicyAssociationCommand = async ( +export const de_DescribeHubCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfigurationPolicyAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AssociationStatus: __expectString, - AssociationStatusMessage: __expectString, - AssociationType: __expectString, - ConfigurationPolicyId: __expectString, - TargetId: __expectString, - TargetType: __expectString, - UpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + AutoEnableControls: __expectBoolean, + ControlFindingGenerator: __expectString, + HubArn: __expectString, + SubscribedAt: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetConfigurationPolicyAssociationCommandError + * deserializeAws_restJson1DescribeOrganizationConfigurationCommand */ -const de_GetConfigurationPolicyAssociationCommandError = async ( +export const de_DescribeOrganizationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AutoEnable: __expectBoolean, + AutoEnableStandards: __expectString, + MemberAccountLimitReached: __expectBoolean, + OrganizationConfiguration: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetEnabledStandardsCommand + * deserializeAws_restJson1DescribeProductsCommand */ -export const de_GetEnabledStandardsCommand = async ( +export const de_DescribeProductsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEnabledStandardsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5201,774 +3237,543 @@ export const de_GetEnabledStandardsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { NextToken: __expectString, - StandardsSubscriptions: _json, + Products: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetEnabledStandardsCommandError + * deserializeAws_restJson1DescribeStandardsCommand */ -const de_GetEnabledStandardsCommandError = async ( +export const de_DescribeStandardsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Standards: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetFindingAggregatorCommand + * deserializeAws_restJson1DescribeStandardsControlsCommand */ -export const de_GetFindingAggregatorCommand = async ( +export const de_DescribeStandardsControlsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFindingAggregatorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - FindingAggregationRegion: __expectString, - FindingAggregatorArn: __expectString, - RegionLinkingMode: __expectString, - Regions: _json, + Controls: (_) => de_StandardsControls(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetFindingAggregatorCommandError + * deserializeAws_restJson1DisableImportFindingsForProductCommand */ -const de_GetFindingAggregatorCommandError = async ( +export const de_DisableImportFindingsForProductCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetFindingHistoryCommand + * deserializeAws_restJson1DisableOrganizationAdminAccountCommand */ -export const de_GetFindingHistoryCommand = async ( +export const de_DisableOrganizationAdminAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFindingHistoryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - Records: (_) => de_FindingHistoryRecordList(_, context), - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1GetFindingHistoryCommandError + * deserializeAws_restJson1DisableSecurityHubCommand */ -const de_GetFindingHistoryCommandError = async ( +export const de_DisableSecurityHubCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetFindingsCommand + * deserializeAws_restJson1DisassociateFromAdministratorAccountCommand */ -export const de_GetFindingsCommand = async ( +export const de_DisassociateFromAdministratorAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Findings: (_) => de_AwsSecurityFindingList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1GetFindingsCommandError + * deserializeAws_restJson1DisassociateFromMasterAccountCommand */ -const de_GetFindingsCommandError = async ( +export const de_DisassociateFromMasterAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetInsightResultsCommand + * deserializeAws_restJson1DisassociateMembersCommand */ -export const de_GetInsightResultsCommand = async ( +export const de_DisassociateMembersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInsightResultsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - InsightResults: _json, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1GetInsightResultsCommandError + * deserializeAws_restJson1EnableImportFindingsForProductCommand */ -const de_GetInsightResultsCommandError = async ( +export const de_EnableImportFindingsForProductCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ProductSubscriptionArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetInsightsCommand + * deserializeAws_restJson1EnableOrganizationAdminAccountCommand */ -export const de_GetInsightsCommand = async ( +export const de_EnableOrganizationAdminAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInsightsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Insights: (_) => de_InsightList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1GetInsightsCommandError + * deserializeAws_restJson1EnableSecurityHubCommand */ -const de_GetInsightsCommandError = async ( +export const de_EnableSecurityHubCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1GetInvitationsCountCommand + * deserializeAws_restJson1GetAdministratorAccountCommand */ -export const de_GetInvitationsCountCommand = async ( +export const de_GetAdministratorAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInvitationsCountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - InvitationsCount: __expectInt32, + Administrator: (_) => de_Invitation(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetInvitationsCountCommandError + * deserializeAws_restJson1GetConfigurationPolicyCommand */ -const de_GetInvitationsCountCommandError = async ( +export const de_GetConfigurationPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Arn: __expectString, + ConfigurationPolicy: (_) => de_Policy(__expectUnion(_), context), + CreatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + Description: __expectString, + Id: __expectString, + Name: __expectString, + UpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetMasterAccountCommand + * deserializeAws_restJson1GetConfigurationPolicyAssociationCommand */ -export const de_GetMasterAccountCommand = async ( +export const de_GetConfigurationPolicyAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMasterAccountCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Master: (_) => de_Invitation(_, context), + AssociationStatus: __expectString, + AssociationStatusMessage: __expectString, + AssociationType: __expectString, + ConfigurationPolicyId: __expectString, + TargetId: __expectString, + TargetType: __expectString, + UpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetMasterAccountCommandError + * deserializeAws_restJson1GetEnabledStandardsCommand */ -const de_GetMasterAccountCommandError = async ( +export const de_GetEnabledStandardsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + StandardsSubscriptions: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetMembersCommand + * deserializeAws_restJson1GetFindingAggregatorCommand */ -export const de_GetMembersCommand = async ( +export const de_GetFindingAggregatorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Members: (_) => de_MemberList(_, context), - UnprocessedAccounts: _json, + FindingAggregationRegion: __expectString, + FindingAggregatorArn: __expectString, + RegionLinkingMode: __expectString, + Regions: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetMembersCommandError + * deserializeAws_restJson1GetFindingHistoryCommand */ -const de_GetMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_GetFindingHistoryCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Records: (_) => de_FindingHistoryRecordList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetSecurityControlDefinitionCommand + * deserializeAws_restJson1GetFindingsCommand */ -export const de_GetSecurityControlDefinitionCommand = async ( +export const de_GetFindingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSecurityControlDefinitionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - SecurityControlDefinition: (_) => de_SecurityControlDefinition(_, context), + Findings: (_) => de_AwsSecurityFindingList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetSecurityControlDefinitionCommandError + * deserializeAws_restJson1GetInsightResultsCommand */ -const de_GetSecurityControlDefinitionCommandError = async ( +export const de_GetInsightResultsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + InsightResults: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1InviteMembersCommand + * deserializeAws_restJson1GetInsightsCommand */ -export const de_InviteMembersCommand = async ( +export const de_GetInsightsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_InviteMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - UnprocessedAccounts: _json, + Insights: (_) => de_InsightList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1InviteMembersCommandError + * deserializeAws_restJson1GetInvitationsCountCommand */ -const de_InviteMembersCommandError = async ( +export const de_GetInvitationsCountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + InvitationsCount: __expectInt32, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListAutomationRulesCommand + * deserializeAws_restJson1GetMasterAccountCommand */ -export const de_ListAutomationRulesCommand = async ( +export const de_GetMasterAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAutomationRulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AutomationRulesMetadata: (_) => de_AutomationRulesMetadataList(_, context), - NextToken: __expectString, + Master: (_) => de_Invitation(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListAutomationRulesCommandError + * deserializeAws_restJson1GetMembersCommand */ -const de_ListAutomationRulesCommandError = async ( +export const de_GetMembersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Members: (_) => de_MemberList(_, context), + UnprocessedAccounts: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListConfigurationPoliciesCommand + * deserializeAws_restJson1GetSecurityControlDefinitionCommand */ -export const de_ListConfigurationPoliciesCommand = async ( +export const de_GetSecurityControlDefinitionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConfigurationPoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ConfigurationPolicySummaries: (_) => de_ConfigurationPolicySummaryList(_, context), - NextToken: __expectString, + SecurityControlDefinition: (_) => de_SecurityControlDefinition(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListConfigurationPoliciesCommandError + * deserializeAws_restJson1InviteMembersCommand */ -const de_ListConfigurationPoliciesCommandError = async ( +export const de_InviteMembersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + UnprocessedAccounts: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListConfigurationPolicyAssociationsCommand + * deserializeAws_restJson1ListAutomationRulesCommand */ -export const de_ListConfigurationPolicyAssociationsCommand = async ( +export const de_ListAutomationRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConfigurationPolicyAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ConfigurationPolicyAssociationSummaries: (_) => de_ConfigurationPolicyAssociationSummaryList(_, context), + AutomationRulesMetadata: (_) => de_AutomationRulesMetadataList(_, context), NextToken: __expectString, }); Object.assign(contents, doc); @@ -5976,95 +3781,69 @@ export const de_ListConfigurationPolicyAssociationsCommand = async ( }; /** - * deserializeAws_restJson1ListConfigurationPolicyAssociationsCommandError + * deserializeAws_restJson1ListConfigurationPoliciesCommand */ -const de_ListConfigurationPolicyAssociationsCommandError = async ( +export const de_ListConfigurationPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ConfigurationPolicySummaries: (_) => de_ConfigurationPolicySummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListEnabledProductsForImportCommand + * deserializeAws_restJson1ListConfigurationPolicyAssociationsCommand */ -export const de_ListEnabledProductsForImportCommand = async ( +export const de_ListConfigurationPolicyAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEnabledProductsForImportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + ConfigurationPolicyAssociationSummaries: (_) => de_ConfigurationPolicyAssociationSummaryList(_, context), NextToken: __expectString, - ProductSubscriptions: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListEnabledProductsForImportCommandError + * deserializeAws_restJson1ListEnabledProductsForImportCommand */ -const de_ListEnabledProductsForImportCommandError = async ( +export const de_ListEnabledProductsForImportCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + ProductSubscriptions: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -6075,7 +3854,7 @@ export const de_ListFindingAggregatorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFindingAggregatorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6089,44 +3868,6 @@ export const de_ListFindingAggregatorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFindingAggregatorsCommandError - */ -const de_ListFindingAggregatorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListInvitationsCommand */ @@ -6135,7 +3876,7 @@ export const de_ListInvitationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListInvitationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6149,41 +3890,6 @@ export const de_ListInvitationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListInvitationsCommandError - */ -const de_ListInvitationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListMembersCommand */ @@ -6192,7 +3898,7 @@ export const de_ListMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMembersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6206,41 +3912,6 @@ export const de_ListMembersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListMembersCommandError - */ -const de_ListMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListOrganizationAdminAccountsCommand */ @@ -6249,7 +3920,7 @@ export const de_ListOrganizationAdminAccountsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOrganizationAdminAccountsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6263,41 +3934,6 @@ export const de_ListOrganizationAdminAccountsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListOrganizationAdminAccountsCommandError - */ -const de_ListOrganizationAdminAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSecurityControlDefinitionsCommand */ @@ -6306,7 +3942,7 @@ export const de_ListSecurityControlDefinitionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSecurityControlDefinitionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6320,41 +3956,6 @@ export const de_ListSecurityControlDefinitionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSecurityControlDefinitionsCommandError - */ -const de_ListSecurityControlDefinitionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListStandardsControlAssociationsCommand */ @@ -6363,53 +3964,18 @@ export const de_ListStandardsControlAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListStandardsControlAssociationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - StandardsControlAssociationSummaries: (_) => de_StandardsControlAssociationSummaries(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListStandardsControlAssociationsCommandError - */ -const de_ListStandardsControlAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + StandardsControlAssociationSummaries: (_) => de_StandardsControlAssociationSummaries(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -6420,7 +3986,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6433,38 +3999,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartConfigurationPolicyAssociationCommand */ @@ -6473,7 +4007,7 @@ export const de_StartConfigurationPolicyAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartConfigurationPolicyAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6492,47 +4026,6 @@ export const de_StartConfigurationPolicyAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartConfigurationPolicyAssociationCommandError - */ -const de_StartConfigurationPolicyAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartConfigurationPolicyDisassociationCommand */ @@ -6541,7 +4034,7 @@ export const de_StartConfigurationPolicyDisassociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartConfigurationPolicyDisassociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6550,47 +4043,6 @@ export const de_StartConfigurationPolicyDisassociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartConfigurationPolicyDisassociationCommandError - */ -const de_StartConfigurationPolicyDisassociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -6599,7 +4051,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6608,38 +4060,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -6648,7 +4068,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6657,38 +4077,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateActionTargetCommand */ @@ -6697,7 +4085,7 @@ export const de_UpdateActionTargetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateActionTargetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6706,41 +4094,6 @@ export const de_UpdateActionTargetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateActionTargetCommandError - */ -const de_UpdateActionTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConfigurationPolicyCommand */ @@ -6749,67 +4102,23 @@ export const de_UpdateConfigurationPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConfigurationPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Arn: __expectString, - ConfigurationPolicy: (_) => de_Policy(__expectUnion(_), context), - CreatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - Description: __expectString, - Id: __expectString, - Name: __expectString, - UpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1UpdateConfigurationPolicyCommandError - */ -const de_UpdateConfigurationPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.securityhub#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Arn: __expectString, + ConfigurationPolicy: (_) => de_Policy(__expectUnion(_), context), + CreatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + Description: __expectString, + Id: __expectString, + Name: __expectString, + UpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -6820,7 +4129,7 @@ export const de_UpdateFindingAggregatorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFindingAggregatorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6836,47 +4145,6 @@ export const de_UpdateFindingAggregatorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFindingAggregatorCommandError - */ -const de_UpdateFindingAggregatorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFindingsCommand */ @@ -6885,7 +4153,7 @@ export const de_UpdateFindingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6894,44 +4162,6 @@ export const de_UpdateFindingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFindingsCommandError - */ -const de_UpdateFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateInsightCommand */ @@ -6940,7 +4170,7 @@ export const de_UpdateInsightCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateInsightCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6949,44 +4179,6 @@ export const de_UpdateInsightCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateInsightCommandError - */ -const de_UpdateInsightCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateOrganizationConfigurationCommand */ @@ -6995,7 +4187,7 @@ export const de_UpdateOrganizationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateOrganizationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7004,50 +4196,6 @@ export const de_UpdateOrganizationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateOrganizationConfigurationCommandError - */ -const de_UpdateOrganizationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceConflictException": - case "com.amazonaws.securityhub#ResourceConflictException": - throw await de_ResourceConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSecurityControlCommand */ @@ -7056,7 +4204,7 @@ export const de_UpdateSecurityControlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSecurityControlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7065,50 +4213,6 @@ export const de_UpdateSecurityControlCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSecurityControlCommandError - */ -const de_UpdateSecurityControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.securityhub#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSecurityHubConfigurationCommand */ @@ -7117,7 +4221,7 @@ export const de_UpdateSecurityHubConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSecurityHubConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7126,47 +4230,6 @@ export const de_UpdateSecurityHubConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSecurityHubConfigurationCommandError - */ -const de_UpdateSecurityHubConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalException": - case "com.amazonaws.securityhub#InternalException": - throw await de_InternalExceptionRes(parsedOutput, context); - case "InvalidAccessException": - case "com.amazonaws.securityhub#InvalidAccessException": - throw await de_InvalidAccessExceptionRes(parsedOutput, context); - case "InvalidInputException": - case "com.amazonaws.securityhub#InvalidInputException": - throw await de_InvalidInputExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.securityhub#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securityhub#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateStandardsControlCommand */ @@ -7175,7 +4238,7 @@ export const de_UpdateStandardsControlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateStandardsControlCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7185,21 +4248,15 @@ export const de_UpdateStandardsControlCommand = async ( }; /** - * deserializeAws_restJson1UpdateStandardsControlCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateStandardsControlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securityhub#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); case "InternalException": case "com.amazonaws.securityhub#InternalException": throw await de_InternalExceptionRes(parsedOutput, context); @@ -7209,16 +4266,28 @@ const de_UpdateStandardsControlCommandError = async ( case "InvalidInputException": case "com.amazonaws.securityhub#InvalidInputException": throw await de_InvalidInputExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.securityhub#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.securityhub#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.securityhub#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ResourceConflictException": + case "com.amazonaws.securityhub#ResourceConflictException": + throw await de_ResourceConflictExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.securityhub#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-securitylake/src/protocols/Aws_restJson1.ts b/clients/client-securitylake/src/protocols/Aws_restJson1.ts index af30d731f529..3082e2e65172 100644 --- a/clients/client-securitylake/src/protocols/Aws_restJson1.ts +++ b/clients/client-securitylake/src/protocols/Aws_restJson1.ts @@ -804,7 +804,7 @@ export const de_CreateAwsLogSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAwsLogSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -817,47 +817,6 @@ export const de_CreateAwsLogSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAwsLogSourceCommandError - */ -const de_CreateAwsLogSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCustomLogSourceCommand */ @@ -866,7 +825,7 @@ export const de_CreateCustomLogSourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCustomLogSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -879,47 +838,6 @@ export const de_CreateCustomLogSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCustomLogSourceCommandError - */ -const de_CreateCustomLogSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDataLakeCommand */ @@ -928,7 +846,7 @@ export const de_CreateDataLakeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDataLakeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -941,47 +859,6 @@ export const de_CreateDataLakeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDataLakeCommandError - */ -const de_CreateDataLakeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDataLakeExceptionSubscriptionCommand */ @@ -990,7 +867,7 @@ export const de_CreateDataLakeExceptionSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDataLakeExceptionSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -999,47 +876,6 @@ export const de_CreateDataLakeExceptionSubscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDataLakeExceptionSubscriptionCommandError - */ -const de_CreateDataLakeExceptionSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateDataLakeOrganizationConfigurationCommand */ @@ -1048,7 +884,7 @@ export const de_CreateDataLakeOrganizationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDataLakeOrganizationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1057,47 +893,6 @@ export const de_CreateDataLakeOrganizationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateDataLakeOrganizationConfigurationCommandError - */ -const de_CreateDataLakeOrganizationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSubscriberCommand */ @@ -1106,7 +901,7 @@ export const de_CreateSubscriberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSubscriberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1120,179 +915,56 @@ export const de_CreateSubscriberCommand = async ( }; /** - * deserializeAws_restJson1CreateSubscriberCommandError + * deserializeAws_restJson1CreateSubscriberNotificationCommand */ -const de_CreateSubscriberCommandError = async ( +export const de_CreateSubscriberNotificationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + subscriberEndpoint: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateSubscriberNotificationCommand + * deserializeAws_restJson1DeleteAwsLogSourceCommand */ -export const de_CreateSubscriberNotificationCommand = async ( +export const de_DeleteAwsLogSourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSubscriberNotificationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - subscriberEndpoint: __expectString, + failed: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateSubscriberNotificationCommandError + * deserializeAws_restJson1DeleteCustomLogSourceCommand */ -const de_CreateSubscriberNotificationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteAwsLogSourceCommand - */ -export const de_DeleteAwsLogSourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAwsLogSourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - failed: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteAwsLogSourceCommandError - */ -const de_DeleteAwsLogSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteCustomLogSourceCommand - */ -export const de_DeleteCustomLogSourceCommand = async ( +export const de_DeleteCustomLogSourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCustomLogSourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1301,47 +973,6 @@ export const de_DeleteCustomLogSourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteCustomLogSourceCommandError - */ -const de_DeleteCustomLogSourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDataLakeCommand */ @@ -1350,7 +981,7 @@ export const de_DeleteDataLakeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDataLakeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1359,47 +990,6 @@ export const de_DeleteDataLakeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDataLakeCommandError - */ -const de_DeleteDataLakeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDataLakeExceptionSubscriptionCommand */ @@ -1408,7 +998,7 @@ export const de_DeleteDataLakeExceptionSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDataLakeExceptionSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1417,47 +1007,6 @@ export const de_DeleteDataLakeExceptionSubscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDataLakeExceptionSubscriptionCommandError - */ -const de_DeleteDataLakeExceptionSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDataLakeOrganizationConfigurationCommand */ @@ -1466,7 +1015,7 @@ export const de_DeleteDataLakeOrganizationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDataLakeOrganizationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1475,47 +1024,6 @@ export const de_DeleteDataLakeOrganizationConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDataLakeOrganizationConfigurationCommandError - */ -const de_DeleteDataLakeOrganizationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSubscriberCommand */ @@ -1524,7 +1032,7 @@ export const de_DeleteSubscriberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSubscriberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1534,794 +1042,244 @@ export const de_DeleteSubscriberCommand = async ( }; /** - * deserializeAws_restJson1DeleteSubscriberCommandError + * deserializeAws_restJson1DeleteSubscriberNotificationCommand */ -const de_DeleteSubscriberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSubscriberNotificationCommand - */ -export const de_DeleteSubscriberNotificationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSubscriberNotificationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSubscriberNotificationCommandError - */ -const de_DeleteSubscriberNotificationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeregisterDataLakeDelegatedAdministratorCommand - */ -export const de_DeregisterDataLakeDelegatedAdministratorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeregisterDataLakeDelegatedAdministratorCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeregisterDataLakeDelegatedAdministratorCommandError - */ -const de_DeregisterDataLakeDelegatedAdministratorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDataLakeExceptionSubscriptionCommand - */ -export const de_GetDataLakeExceptionSubscriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataLakeExceptionSubscriptionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - exceptionTimeToLive: __expectLong, - notificationEndpoint: __expectString, - subscriptionProtocol: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDataLakeExceptionSubscriptionCommandError - */ -const de_GetDataLakeExceptionSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDataLakeOrganizationConfigurationCommand - */ -export const de_GetDataLakeOrganizationConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataLakeOrganizationConfigurationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - autoEnableNewAccount: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDataLakeOrganizationConfigurationCommandError - */ -const de_GetDataLakeOrganizationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDataLakeSourcesCommand - */ -export const de_GetDataLakeSourcesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDataLakeSourcesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - dataLakeArn: __expectString, - dataLakeSources: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDataLakeSourcesCommandError - */ -const de_GetDataLakeSourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSubscriberCommand - */ -export const de_GetSubscriberCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSubscriberCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - subscriber: (_) => de_SubscriberResource(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSubscriberCommandError - */ -const de_GetSubscriberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDataLakeExceptionsCommand - */ -export const de_ListDataLakeExceptionsCommand = async ( +export const de_DeleteSubscriberNotificationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataLakeExceptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - exceptions: (_) => de_DataLakeExceptionList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListDataLakeExceptionsCommandError + * deserializeAws_restJson1DeregisterDataLakeDelegatedAdministratorCommand */ -const de_ListDataLakeExceptionsCommandError = async ( +export const de_DeregisterDataLakeDelegatedAdministratorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListDataLakesCommand + * deserializeAws_restJson1GetDataLakeExceptionSubscriptionCommand */ -export const de_ListDataLakesCommand = async ( +export const de_GetDataLakeExceptionSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDataLakesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - dataLakes: _json, + exceptionTimeToLive: __expectLong, + notificationEndpoint: __expectString, + subscriptionProtocol: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListDataLakesCommandError + * deserializeAws_restJson1GetDataLakeOrganizationConfigurationCommand */ -const de_ListDataLakesCommandError = async ( +export const de_GetDataLakeOrganizationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + autoEnableNewAccount: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListLogSourcesCommand + * deserializeAws_restJson1GetDataLakeSourcesCommand */ -export const de_ListLogSourcesCommand = async ( +export const de_GetDataLakeSourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLogSourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + dataLakeArn: __expectString, + dataLakeSources: _json, nextToken: __expectString, - sources: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListLogSourcesCommandError + * deserializeAws_restJson1GetSubscriberCommand */ -const de_ListLogSourcesCommandError = async ( +export const de_GetSubscriberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + subscriber: (_) => de_SubscriberResource(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListSubscribersCommand + * deserializeAws_restJson1ListDataLakeExceptionsCommand */ -export const de_ListSubscribersCommand = async ( +export const de_ListDataLakeExceptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSubscribersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + exceptions: (_) => de_DataLakeExceptionList(_, context), nextToken: __expectString, - subscribers: (_) => de_SubscriberResourceList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSubscribersCommandError - */ -const de_ListSubscribersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListDataLakesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListDataLakesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + dataLakes: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListLogSourcesCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListLogSourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + sources: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1RegisterDataLakeDelegatedAdministratorCommand + * deserializeAws_restJson1ListSubscribersCommand */ -export const de_RegisterDataLakeDelegatedAdministratorCommand = async ( +export const de_ListSubscribersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterDataLakeDelegatedAdministratorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + subscribers: (_) => de_SubscriberResourceList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1RegisterDataLakeDelegatedAdministratorCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_RegisterDataLakeDelegatedAdministratorCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1RegisterDataLakeDelegatedAdministratorCommand */ -export const de_TagResourceCommand = async ( +export const de_RegisterDataLakeDelegatedAdministratorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2331,44 +1289,20 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -2379,7 +1313,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2388,47 +1322,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDataLakeCommand */ @@ -2437,7 +1330,7 @@ export const de_UpdateDataLakeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDataLakeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2450,47 +1343,6 @@ export const de_UpdateDataLakeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDataLakeCommandError - */ -const de_UpdateDataLakeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDataLakeExceptionSubscriptionCommand */ @@ -2499,7 +1351,7 @@ export const de_UpdateDataLakeExceptionSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDataLakeExceptionSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2508,47 +1360,6 @@ export const de_UpdateDataLakeExceptionSubscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDataLakeExceptionSubscriptionCommandError - */ -const de_UpdateDataLakeExceptionSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSubscriberCommand */ @@ -2557,7 +1368,7 @@ export const de_UpdateSubscriberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSubscriberCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2570,47 +1381,6 @@ export const de_UpdateSubscriberCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSubscriberCommandError - */ -const de_UpdateSubscriberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.securitylake#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.securitylake#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.securitylake#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.securitylake#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.securitylake#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.securitylake#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSubscriberNotificationCommand */ @@ -2619,7 +1389,7 @@ export const de_UpdateSubscriberNotificationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSubscriberNotificationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2633,12 +1403,9 @@ export const de_UpdateSubscriberNotificationCommand = async ( }; /** - * deserializeAws_restJson1UpdateSubscriberNotificationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateSubscriberNotificationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2669,7 +1436,7 @@ const de_UpdateSubscriberNotificationCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts b/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts index 3cd27139aab2..3ed20f5bd08f 100644 --- a/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts +++ b/clients/client-serverlessapplicationrepository/src/protocols/Aws_restJson1.ts @@ -410,7 +410,7 @@ export const de_CreateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -435,44 +435,6 @@ export const de_CreateApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.serverlessapplicationrepository#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.serverlessapplicationrepository#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateApplicationVersionCommand */ @@ -481,7 +443,7 @@ export const de_CreateApplicationVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateApplicationVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -502,44 +464,6 @@ export const de_CreateApplicationVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApplicationVersionCommandError - */ -const de_CreateApplicationVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.serverlessapplicationrepository#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.serverlessapplicationrepository#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCloudFormationChangeSetCommand */ @@ -548,7 +472,7 @@ export const de_CreateCloudFormationChangeSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateCloudFormationChangeSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -564,41 +488,6 @@ export const de_CreateCloudFormationChangeSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCloudFormationChangeSetCommandError - */ -const de_CreateCloudFormationChangeSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.serverlessapplicationrepository#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCloudFormationTemplateCommand */ @@ -607,7 +496,7 @@ export const de_CreateCloudFormationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateCloudFormationTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -626,44 +515,6 @@ export const de_CreateCloudFormationTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCloudFormationTemplateCommandError - */ -const de_CreateCloudFormationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.serverlessapplicationrepository#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.serverlessapplicationrepository#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteApplicationCommand */ @@ -672,7 +523,7 @@ export const de_DeleteApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -681,47 +532,6 @@ export const de_DeleteApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteApplicationCommandError - */ -const de_DeleteApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.serverlessapplicationrepository#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.serverlessapplicationrepository#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.serverlessapplicationrepository#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetApplicationCommand */ @@ -730,7 +540,7 @@ export const de_GetApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -755,44 +565,6 @@ export const de_GetApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetApplicationCommandError - */ -const de_GetApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.serverlessapplicationrepository#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.serverlessapplicationrepository#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetApplicationPolicyCommand */ @@ -801,7 +573,7 @@ export const de_GetApplicationPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApplicationPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -814,44 +586,6 @@ export const de_GetApplicationPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetApplicationPolicyCommandError - */ -const de_GetApplicationPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.serverlessapplicationrepository#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.serverlessapplicationrepository#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCloudFormationTemplateCommand */ @@ -860,7 +594,7 @@ export const de_GetCloudFormationTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCloudFormationTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -879,44 +613,6 @@ export const de_GetCloudFormationTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCloudFormationTemplateCommandError - */ -const de_GetCloudFormationTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.serverlessapplicationrepository#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.serverlessapplicationrepository#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationDependenciesCommand */ @@ -925,7 +621,7 @@ export const de_ListApplicationDependenciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationDependenciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -939,44 +635,6 @@ export const de_ListApplicationDependenciesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationDependenciesCommandError - */ -const de_ListApplicationDependenciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.serverlessapplicationrepository#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.serverlessapplicationrepository#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationsCommand */ @@ -985,7 +643,7 @@ export const de_ListApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -999,41 +657,6 @@ export const de_ListApplicationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationsCommandError - */ -const de_ListApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.serverlessapplicationrepository#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.serverlessapplicationrepository#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationVersionsCommand */ @@ -1042,7 +665,7 @@ export const de_ListApplicationVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1056,44 +679,6 @@ export const de_ListApplicationVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationVersionsCommandError - */ -const de_ListApplicationVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.serverlessapplicationrepository#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.serverlessapplicationrepository#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutApplicationPolicyCommand */ @@ -1102,7 +687,7 @@ export const de_PutApplicationPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutApplicationPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1115,44 +700,6 @@ export const de_PutApplicationPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutApplicationPolicyCommandError - */ -const de_PutApplicationPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.serverlessapplicationrepository#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.serverlessapplicationrepository#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UnshareApplicationCommand */ @@ -1161,7 +708,7 @@ export const de_UnshareApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UnshareApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1170,44 +717,6 @@ export const de_UnshareApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UnshareApplicationCommandError - */ -const de_UnshareApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.serverlessapplicationrepository#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ForbiddenException": - case "com.amazonaws.serverlessapplicationrepository#ForbiddenException": - throw await de_ForbiddenExceptionRes(parsedOutput, context); - case "InternalServerErrorException": - case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.serverlessapplicationrepository#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateApplicationCommand */ @@ -1216,7 +725,7 @@ export const de_UpdateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1242,12 +751,9 @@ export const de_UpdateApplicationCommand = async ( }; /** - * deserializeAws_restJson1UpdateApplicationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1266,19 +772,19 @@ const de_UpdateApplicationCommandError = async ( case "InternalServerErrorException": case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException": throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.serverlessapplicationrepository#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.serverlessapplicationrepository#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts b/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts index 109a050e7067..982a6028e81c 100644 --- a/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts +++ b/clients/client-service-catalog-appregistry/src/protocols/Aws_restJson1.ts @@ -589,7 +589,7 @@ export const de_AssociateAttributeGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateAttributeGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -603,44 +603,6 @@ export const de_AssociateAttributeGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateAttributeGroupCommandError - */ -const de_AssociateAttributeGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.servicecatalogappregistry#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.servicecatalogappregistry#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateResourceCommand */ @@ -649,7 +611,7 @@ export const de_AssociateResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -664,47 +626,6 @@ export const de_AssociateResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateResourceCommandError - */ -const de_AssociateResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.servicecatalogappregistry#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.servicecatalogappregistry#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.servicecatalogappregistry#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateApplicationCommand */ @@ -713,7 +634,7 @@ export const de_CreateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -726,44 +647,6 @@ export const de_CreateApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.servicecatalogappregistry#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.servicecatalogappregistry#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.servicecatalogappregistry#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAttributeGroupCommand */ @@ -772,7 +655,7 @@ export const de_CreateAttributeGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAttributeGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -785,41 +668,6 @@ export const de_CreateAttributeGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAttributeGroupCommandError - */ -const de_CreateAttributeGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.servicecatalogappregistry#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.servicecatalogappregistry#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteApplicationCommand */ @@ -828,7 +676,7 @@ export const de_DeleteApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -841,38 +689,6 @@ export const de_DeleteApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteApplicationCommandError - */ -const de_DeleteApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAttributeGroupCommand */ @@ -881,7 +697,7 @@ export const de_DeleteAttributeGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAttributeGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -894,38 +710,6 @@ export const de_DeleteAttributeGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAttributeGroupCommandError - */ -const de_DeleteAttributeGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateAttributeGroupCommand */ @@ -934,7 +718,7 @@ export const de_DisassociateAttributeGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateAttributeGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -948,38 +732,6 @@ export const de_DisassociateAttributeGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateAttributeGroupCommandError - */ -const de_DisassociateAttributeGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateResourceCommand */ @@ -988,7 +740,7 @@ export const de_DisassociateResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1002,41 +754,6 @@ export const de_DisassociateResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateResourceCommandError - */ -const de_DisassociateResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.servicecatalogappregistry#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetApplicationCommand */ @@ -1045,7 +762,7 @@ export const de_GetApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1067,41 +784,6 @@ export const de_GetApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetApplicationCommandError - */ -const de_GetApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.servicecatalogappregistry#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAssociatedResourceCommand */ @@ -1110,7 +792,7 @@ export const de_GetAssociatedResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssociatedResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1125,38 +807,6 @@ export const de_GetAssociatedResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAssociatedResourceCommandError - */ -const de_GetAssociatedResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAttributeGroupCommand */ @@ -1165,7 +815,7 @@ export const de_GetAttributeGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAttributeGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1186,41 +836,6 @@ export const de_GetAttributeGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAttributeGroupCommandError - */ -const de_GetAttributeGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.servicecatalogappregistry#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetConfigurationCommand */ @@ -1229,7 +844,7 @@ export const de_GetConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1242,32 +857,6 @@ export const de_GetConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetConfigurationCommandError - */ -const de_GetConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationsCommand */ @@ -1276,7 +865,7 @@ export const de_ListApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1290,35 +879,6 @@ export const de_ListApplicationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationsCommandError - */ -const de_ListApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssociatedAttributeGroupsCommand */ @@ -1327,7 +887,7 @@ export const de_ListAssociatedAttributeGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssociatedAttributeGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1341,38 +901,6 @@ export const de_ListAssociatedAttributeGroupsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssociatedAttributeGroupsCommandError - */ -const de_ListAssociatedAttributeGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssociatedResourcesCommand */ @@ -1381,50 +909,18 @@ export const de_ListAssociatedResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssociatedResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - resources: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAssociatedResourcesCommandError - */ -const de_ListAssociatedResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const doc = take(data, { + nextToken: __expectString, + resources: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1435,7 +931,7 @@ export const de_ListAttributeGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAttributeGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1449,35 +945,6 @@ export const de_ListAttributeGroupsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAttributeGroupsCommandError - */ -const de_ListAttributeGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAttributeGroupsForApplicationCommand */ @@ -1486,7 +953,7 @@ export const de_ListAttributeGroupsForApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAttributeGroupsForApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1500,38 +967,6 @@ export const de_ListAttributeGroupsForApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAttributeGroupsForApplicationCommandError - */ -const de_ListAttributeGroupsForApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1540,7 +975,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1553,38 +988,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutConfigurationCommand */ @@ -1593,7 +996,7 @@ export const de_PutConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1602,38 +1005,6 @@ export const de_PutConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutConfigurationCommandError - */ -const de_PutConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.servicecatalogappregistry#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SyncResourceCommand */ @@ -1642,7 +1013,7 @@ export const de_SyncResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SyncResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1657,44 +1028,6 @@ export const de_SyncResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SyncResourceCommandError - */ -const de_SyncResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.servicecatalogappregistry#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.servicecatalogappregistry#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1703,7 +1036,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1712,38 +1045,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1752,7 +1053,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1761,38 +1062,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateApplicationCommand */ @@ -1801,7 +1070,7 @@ export const de_UpdateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1814,44 +1083,6 @@ export const de_UpdateApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateApplicationCommandError - */ -const de_UpdateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.servicecatalogappregistry#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.servicecatalogappregistry#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.servicecatalogappregistry#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.servicecatalogappregistry#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateAttributeGroupCommand */ @@ -1860,7 +1091,7 @@ export const de_UpdateAttributeGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAttributeGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1874,12 +1105,9 @@ export const de_UpdateAttributeGroupCommand = async ( }; /** - * deserializeAws_restJson1UpdateAttributeGroupCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateAttributeGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1895,16 +1123,22 @@ const de_UpdateAttributeGroupCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.servicecatalogappregistry#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.servicecatalogappregistry#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.servicecatalogappregistry#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.servicecatalogappregistry#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-service-catalog/src/protocols/Aws_json1_1.ts b/clients/client-service-catalog/src/protocols/Aws_json1_1.ts index 5b0b1a95cd68..7661d0613f3f 100644 --- a/clients/client-service-catalog/src/protocols/Aws_json1_1.ts +++ b/clients/client-service-catalog/src/protocols/Aws_json1_1.ts @@ -1652,7 +1652,7 @@ export const de_AcceptPortfolioShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptPortfolioShareCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1664,38 +1664,6 @@ export const de_AcceptPortfolioShareCommand = async ( return response; }; -/** - * deserializeAws_json1_1AcceptPortfolioShareCommandError - */ -const de_AcceptPortfolioShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.servicecatalog#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateBudgetWithResourceCommand */ @@ -1704,7 +1672,7 @@ export const de_AssociateBudgetWithResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateBudgetWithResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1716,41 +1684,6 @@ export const de_AssociateBudgetWithResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateBudgetWithResourceCommandError - */ -const de_AssociateBudgetWithResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.servicecatalog#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.servicecatalog#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociatePrincipalWithPortfolioCommand */ @@ -1759,7 +1692,7 @@ export const de_AssociatePrincipalWithPortfolioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociatePrincipalWithPortfolioCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1771,38 +1704,6 @@ export const de_AssociatePrincipalWithPortfolioCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociatePrincipalWithPortfolioCommandError - */ -const de_AssociatePrincipalWithPortfolioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.servicecatalog#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateProductWithPortfolioCommand */ @@ -1811,7 +1712,7 @@ export const de_AssociateProductWithPortfolioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateProductWithPortfolioCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1823,38 +1724,6 @@ export const de_AssociateProductWithPortfolioCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateProductWithPortfolioCommandError - */ -const de_AssociateProductWithPortfolioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.servicecatalog#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateServiceActionWithProvisioningArtifactCommand */ @@ -1863,7 +1732,7 @@ export const de_AssociateServiceActionWithProvisioningArtifactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateServiceActionWithProvisioningArtifactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1875,41 +1744,6 @@ export const de_AssociateServiceActionWithProvisioningArtifactCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateServiceActionWithProvisioningArtifactCommandError - */ -const de_AssociateServiceActionWithProvisioningArtifactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.servicecatalog#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.servicecatalog#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateTagOptionWithResourceCommand */ @@ -1918,7 +1752,7 @@ export const de_AssociateTagOptionWithResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateTagOptionWithResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1930,47 +1764,6 @@ export const de_AssociateTagOptionWithResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateTagOptionWithResourceCommandError - */ -const de_AssociateTagOptionWithResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.servicecatalog#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.servicecatalog#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.servicecatalog#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagOptionNotMigratedException": - case "com.amazonaws.servicecatalog#TagOptionNotMigratedException": - throw await de_TagOptionNotMigratedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchAssociateServiceActionWithProvisioningArtifactCommand */ @@ -1979,7 +1772,7 @@ export const de_BatchAssociateServiceActionWithProvisioningArtifactCommand = asy context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchAssociateServiceActionWithProvisioningArtifactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1991,32 +1784,6 @@ export const de_BatchAssociateServiceActionWithProvisioningArtifactCommand = asy return response; }; -/** - * deserializeAws_json1_1BatchAssociateServiceActionWithProvisioningArtifactCommandError - */ -const de_BatchAssociateServiceActionWithProvisioningArtifactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1BatchDisassociateServiceActionFromProvisioningArtifactCommand */ @@ -2025,7 +1792,7 @@ export const de_BatchDisassociateServiceActionFromProvisioningArtifactCommand = context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchDisassociateServiceActionFromProvisioningArtifactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2038,45 +1805,39 @@ export const de_BatchDisassociateServiceActionFromProvisioningArtifactCommand = }; /** - * deserializeAws_json1_1BatchDisassociateServiceActionFromProvisioningArtifactCommandError + * deserializeAws_json1_1CopyProductCommand */ -const de_BatchDisassociateServiceActionFromProvisioningArtifactCommandError = async ( +export const de_CopyProductCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CopyProductCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CopyProductCommand + * deserializeAws_json1_1CreateConstraintCommand */ -export const de_CopyProductCommand = async ( +export const de_CreateConstraintCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CopyProductCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CopyProductCommandOutput = { + const response: CreateConstraintCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2084,98 +1845,14 @@ export const de_CopyProductCommand = async ( }; /** - * deserializeAws_json1_1CopyProductCommandError + * deserializeAws_json1_1CreatePortfolioCommand */ -const de_CopyProductCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateConstraintCommand - */ -export const de_CreateConstraintCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateConstraintCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateConstraintCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateConstraintCommandError - */ -const de_CreateConstraintCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.servicecatalog#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.servicecatalog#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreatePortfolioCommand - */ -export const de_CreatePortfolioCommand = async ( +export const de_CreatePortfolioCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePortfolioCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2187,38 +1864,6 @@ export const de_CreatePortfolioCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePortfolioCommandError - */ -const de_CreatePortfolioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.servicecatalog#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TagOptionNotMigratedException": - case "com.amazonaws.servicecatalog#TagOptionNotMigratedException": - throw await de_TagOptionNotMigratedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePortfolioShareCommand */ @@ -2227,7 +1872,7 @@ export const de_CreatePortfolioShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePortfolioShareCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2239,44 +1884,6 @@ export const de_CreatePortfolioShareCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePortfolioShareCommandError - */ -const de_CreatePortfolioShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.servicecatalog#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.servicecatalog#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.servicecatalog#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateProductCommand */ @@ -2285,7 +1892,7 @@ export const de_CreateProductCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateProductCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2297,38 +1904,6 @@ export const de_CreateProductCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateProductCommandError - */ -const de_CreateProductCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.servicecatalog#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TagOptionNotMigratedException": - case "com.amazonaws.servicecatalog#TagOptionNotMigratedException": - throw await de_TagOptionNotMigratedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateProvisionedProductPlanCommand */ @@ -2337,7 +1912,7 @@ export const de_CreateProvisionedProductPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateProvisionedProductPlanCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2349,38 +1924,6 @@ export const de_CreateProvisionedProductPlanCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateProvisionedProductPlanCommandError - */ -const de_CreateProvisionedProductPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.servicecatalog#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateProvisioningArtifactCommand */ @@ -2389,7 +1932,7 @@ export const de_CreateProvisioningArtifactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateProvisioningArtifactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2401,38 +1944,6 @@ export const de_CreateProvisioningArtifactCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateProvisioningArtifactCommandError - */ -const de_CreateProvisioningArtifactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.servicecatalog#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateServiceActionCommand */ @@ -2441,7 +1952,7 @@ export const de_CreateServiceActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateServiceActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2453,35 +1964,6 @@ export const de_CreateServiceActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateServiceActionCommandError - */ -const de_CreateServiceActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.servicecatalog#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTagOptionCommand */ @@ -2490,7 +1972,7 @@ export const de_CreateTagOptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTagOptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2503,46 +1985,14 @@ export const de_CreateTagOptionCommand = async ( }; /** - * deserializeAws_json1_1CreateTagOptionCommandError + * deserializeAws_json1_1DeleteConstraintCommand */ -const de_CreateTagOptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.servicecatalog#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.servicecatalog#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TagOptionNotMigratedException": - case "com.amazonaws.servicecatalog#TagOptionNotMigratedException": - throw await de_TagOptionNotMigratedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteConstraintCommand - */ -export const de_DeleteConstraintCommand = async ( +export const de_DeleteConstraintCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteConstraintCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2554,35 +2004,6 @@ export const de_DeleteConstraintCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteConstraintCommandError - */ -const de_DeleteConstraintCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeletePortfolioCommand */ @@ -2591,7 +2012,7 @@ export const de_DeletePortfolioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePortfolioCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2603,41 +2024,6 @@ export const de_DeletePortfolioCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeletePortfolioCommandError - */ -const de_DeletePortfolioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.servicecatalog#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagOptionNotMigratedException": - case "com.amazonaws.servicecatalog#TagOptionNotMigratedException": - throw await de_TagOptionNotMigratedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeletePortfolioShareCommand */ @@ -2646,7 +2032,7 @@ export const de_DeletePortfolioShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePortfolioShareCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2658,41 +2044,6 @@ export const de_DeletePortfolioShareCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeletePortfolioShareCommandError - */ -const de_DeletePortfolioShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.servicecatalog#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.servicecatalog#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteProductCommand */ @@ -2701,7 +2052,7 @@ export const de_DeleteProductCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteProductCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2713,41 +2064,6 @@ export const de_DeleteProductCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteProductCommandError - */ -const de_DeleteProductCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.servicecatalog#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagOptionNotMigratedException": - case "com.amazonaws.servicecatalog#TagOptionNotMigratedException": - throw await de_TagOptionNotMigratedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteProvisionedProductPlanCommand */ @@ -2756,7 +2072,7 @@ export const de_DeleteProvisionedProductPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteProvisionedProductPlanCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2768,35 +2084,6 @@ export const de_DeleteProvisionedProductPlanCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteProvisionedProductPlanCommandError - */ -const de_DeleteProvisionedProductPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteProvisioningArtifactCommand */ @@ -2805,7 +2092,7 @@ export const de_DeleteProvisioningArtifactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteProvisioningArtifactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2817,38 +2104,6 @@ export const de_DeleteProvisioningArtifactCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteProvisioningArtifactCommandError - */ -const de_DeleteProvisioningArtifactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.servicecatalog#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteServiceActionCommand */ @@ -2857,7 +2112,7 @@ export const de_DeleteServiceActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteServiceActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2870,48 +2125,39 @@ export const de_DeleteServiceActionCommand = async ( }; /** - * deserializeAws_json1_1DeleteServiceActionCommandError + * deserializeAws_json1_1DeleteTagOptionCommand */ -const de_DeleteServiceActionCommandError = async ( +export const de_DeleteTagOptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUseException": - case "com.amazonaws.servicecatalog#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteTagOptionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteTagOptionCommand + * deserializeAws_json1_1DescribeConstraintCommand */ -export const de_DeleteTagOptionCommand = async ( +export const de_DescribeConstraintCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteTagOptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteTagOptionCommandOutput = { + const response: DescribeConstraintCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2919,92 +2165,14 @@ export const de_DeleteTagOptionCommand = async ( }; /** - * deserializeAws_json1_1DeleteTagOptionCommandError + * deserializeAws_json1_1DescribeCopyProductStatusCommand */ -const de_DeleteTagOptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceInUseException": - case "com.amazonaws.servicecatalog#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagOptionNotMigratedException": - case "com.amazonaws.servicecatalog#TagOptionNotMigratedException": - throw await de_TagOptionNotMigratedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeConstraintCommand - */ -export const de_DescribeConstraintCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeConstraintCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeConstraintCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeConstraintCommandError - */ -const de_DescribeConstraintCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeCopyProductStatusCommand - */ -export const de_DescribeCopyProductStatusCommand = async ( +export const de_DescribeCopyProductStatusCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCopyProductStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3016,32 +2184,6 @@ export const de_DescribeCopyProductStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeCopyProductStatusCommandError - */ -const de_DescribeCopyProductStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribePortfolioCommand */ @@ -3050,7 +2192,7 @@ export const de_DescribePortfolioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePortfolioCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3062,32 +2204,6 @@ export const de_DescribePortfolioCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribePortfolioCommandError - */ -const de_DescribePortfolioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribePortfolioSharesCommand */ @@ -3096,7 +2212,7 @@ export const de_DescribePortfolioSharesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePortfolioSharesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3108,35 +2224,6 @@ export const de_DescribePortfolioSharesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribePortfolioSharesCommandError - */ -const de_DescribePortfolioSharesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribePortfolioShareStatusCommand */ @@ -3145,7 +2232,7 @@ export const de_DescribePortfolioShareStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePortfolioShareStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3157,38 +2244,6 @@ export const de_DescribePortfolioShareStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribePortfolioShareStatusCommandError - */ -const de_DescribePortfolioShareStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.servicecatalog#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeProductCommand */ @@ -3197,7 +2252,7 @@ export const de_DescribeProductCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeProductCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3209,35 +2264,6 @@ export const de_DescribeProductCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeProductCommandError - */ -const de_DescribeProductCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeProductAsAdminCommand */ @@ -3246,7 +2272,7 @@ export const de_DescribeProductAsAdminCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeProductAsAdminCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3258,35 +2284,6 @@ export const de_DescribeProductAsAdminCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeProductAsAdminCommandError - */ -const de_DescribeProductAsAdminCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeProductViewCommand */ @@ -3295,7 +2292,7 @@ export const de_DescribeProductViewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeProductViewCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3307,35 +2304,6 @@ export const de_DescribeProductViewCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeProductViewCommandError - */ -const de_DescribeProductViewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeProvisionedProductCommand */ @@ -3344,7 +2312,7 @@ export const de_DescribeProvisionedProductCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeProvisionedProductCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3357,83 +2325,25 @@ export const de_DescribeProvisionedProductCommand = async ( }; /** - * deserializeAws_json1_1DescribeProvisionedProductCommandError + * deserializeAws_json1_1DescribeProvisionedProductPlanCommand */ -const de_DescribeProvisionedProductCommandError = async ( +export const de_DescribeProvisionedProductPlanCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeProvisionedProductPlanCommand - */ -export const de_DescribeProvisionedProductPlanCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeProvisionedProductPlanCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeProvisionedProductPlanOutput(data, context); - const response: DescribeProvisionedProductPlanCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeProvisionedProductPlanOutput(data, context); + const response: DescribeProvisionedProductPlanCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; return response; }; -/** - * deserializeAws_json1_1DescribeProvisionedProductPlanCommandError - */ -const de_DescribeProvisionedProductPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeProvisioningArtifactCommand */ @@ -3442,7 +2352,7 @@ export const de_DescribeProvisioningArtifactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeProvisioningArtifactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3454,35 +2364,6 @@ export const de_DescribeProvisioningArtifactCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeProvisioningArtifactCommandError - */ -const de_DescribeProvisioningArtifactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeProvisioningParametersCommand */ @@ -3491,7 +2372,7 @@ export const de_DescribeProvisioningParametersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeProvisioningParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3503,35 +2384,6 @@ export const de_DescribeProvisioningParametersCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeProvisioningParametersCommandError - */ -const de_DescribeProvisioningParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeRecordCommand */ @@ -3540,7 +2392,7 @@ export const de_DescribeRecordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeRecordCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3552,32 +2404,6 @@ export const de_DescribeRecordCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeRecordCommandError - */ -const de_DescribeRecordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeServiceActionCommand */ @@ -3586,7 +2412,7 @@ export const de_DescribeServiceActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeServiceActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3598,32 +2424,6 @@ export const de_DescribeServiceActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeServiceActionCommandError - */ -const de_DescribeServiceActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeServiceActionExecutionParametersCommand */ @@ -3632,7 +2432,7 @@ export const de_DescribeServiceActionExecutionParametersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeServiceActionExecutionParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3644,35 +2444,6 @@ export const de_DescribeServiceActionExecutionParametersCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeServiceActionExecutionParametersCommandError - */ -const de_DescribeServiceActionExecutionParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTagOptionCommand */ @@ -3681,7 +2452,7 @@ export const de_DescribeTagOptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTagOptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3693,35 +2464,6 @@ export const de_DescribeTagOptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTagOptionCommandError - */ -const de_DescribeTagOptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagOptionNotMigratedException": - case "com.amazonaws.servicecatalog#TagOptionNotMigratedException": - throw await de_TagOptionNotMigratedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisableAWSOrganizationsAccessCommand */ @@ -3730,7 +2472,7 @@ export const de_DisableAWSOrganizationsAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableAWSOrganizationsAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3743,51 +2485,39 @@ export const de_DisableAWSOrganizationsAccessCommand = async ( }; /** - * deserializeAws_json1_1DisableAWSOrganizationsAccessCommandError + * deserializeAws_json1_1DisassociateBudgetFromResourceCommand */ -const de_DisableAWSOrganizationsAccessCommandError = async ( +export const de_DisassociateBudgetFromResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidStateException": - case "com.amazonaws.servicecatalog#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.servicecatalog#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisassociateBudgetFromResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisassociateBudgetFromResourceCommand + * deserializeAws_json1_1DisassociatePrincipalFromPortfolioCommand */ -export const de_DisassociateBudgetFromResourceCommand = async ( +export const de_DisassociatePrincipalFromPortfolioCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateBudgetFromResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateBudgetFromResourceCommandOutput = { + const response: DisassociatePrincipalFromPortfolioCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3795,89 +2525,14 @@ export const de_DisassociateBudgetFromResourceCommand = async ( }; /** - * deserializeAws_json1_1DisassociateBudgetFromResourceCommandError + * deserializeAws_json1_1DisassociateProductFromPortfolioCommand */ -const de_DisassociateBudgetFromResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociatePrincipalFromPortfolioCommand - */ -export const de_DisassociatePrincipalFromPortfolioCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisassociatePrincipalFromPortfolioCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DisassociatePrincipalFromPortfolioCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisassociatePrincipalFromPortfolioCommandError - */ -const de_DisassociatePrincipalFromPortfolioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociateProductFromPortfolioCommand - */ -export const de_DisassociateProductFromPortfolioCommand = async ( +export const de_DisassociateProductFromPortfolioCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateProductFromPortfolioCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3889,38 +2544,6 @@ export const de_DisassociateProductFromPortfolioCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateProductFromPortfolioCommandError - */ -const de_DisassociateProductFromPortfolioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.servicecatalog#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisassociateServiceActionFromProvisioningArtifactCommand */ @@ -3929,7 +2552,7 @@ export const de_DisassociateServiceActionFromProvisioningArtifactCommand = async context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateServiceActionFromProvisioningArtifactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3941,32 +2564,6 @@ export const de_DisassociateServiceActionFromProvisioningArtifactCommand = async return response; }; -/** - * deserializeAws_json1_1DisassociateServiceActionFromProvisioningArtifactCommandError - */ -const de_DisassociateServiceActionFromProvisioningArtifactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisassociateTagOptionFromResourceCommand */ @@ -3975,7 +2572,7 @@ export const de_DisassociateTagOptionFromResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateTagOptionFromResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3987,35 +2584,6 @@ export const de_DisassociateTagOptionFromResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateTagOptionFromResourceCommandError - */ -const de_DisassociateTagOptionFromResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagOptionNotMigratedException": - case "com.amazonaws.servicecatalog#TagOptionNotMigratedException": - throw await de_TagOptionNotMigratedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1EnableAWSOrganizationsAccessCommand */ @@ -4024,7 +2592,7 @@ export const de_EnableAWSOrganizationsAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableAWSOrganizationsAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4036,38 +2604,6 @@ export const de_EnableAWSOrganizationsAccessCommand = async ( return response; }; -/** - * deserializeAws_json1_1EnableAWSOrganizationsAccessCommandError - */ -const de_EnableAWSOrganizationsAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidStateException": - case "com.amazonaws.servicecatalog#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.servicecatalog#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ExecuteProvisionedProductPlanCommand */ @@ -4076,7 +2612,7 @@ export const de_ExecuteProvisionedProductPlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExecuteProvisionedProductPlanCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4088,38 +2624,6 @@ export const de_ExecuteProvisionedProductPlanCommand = async ( return response; }; -/** - * deserializeAws_json1_1ExecuteProvisionedProductPlanCommandError - */ -const de_ExecuteProvisionedProductPlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.servicecatalog#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ExecuteProvisionedProductServiceActionCommand */ @@ -4128,7 +2632,7 @@ export const de_ExecuteProvisionedProductServiceActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExecuteProvisionedProductServiceActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4141,51 +2645,39 @@ export const de_ExecuteProvisionedProductServiceActionCommand = async ( }; /** - * deserializeAws_json1_1ExecuteProvisionedProductServiceActionCommandError + * deserializeAws_json1_1GetAWSOrganizationsAccessStatusCommand */ -const de_ExecuteProvisionedProductServiceActionCommandError = async ( +export const de_GetAWSOrganizationsAccessStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.servicecatalog#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetAWSOrganizationsAccessStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetAWSOrganizationsAccessStatusCommand + * deserializeAws_json1_1GetProvisionedProductOutputsCommand */ -export const de_GetAWSOrganizationsAccessStatusCommand = async ( +export const de_GetProvisionedProductOutputsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetAWSOrganizationsAccessStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetAWSOrganizationsAccessStatusCommandOutput = { + const response: GetProvisionedProductOutputsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4193,92 +2685,14 @@ export const de_GetAWSOrganizationsAccessStatusCommand = async ( }; /** - * deserializeAws_json1_1GetAWSOrganizationsAccessStatusCommandError + * deserializeAws_json1_1ImportAsProvisionedProductCommand */ -const de_GetAWSOrganizationsAccessStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotSupportedException": - case "com.amazonaws.servicecatalog#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetProvisionedProductOutputsCommand - */ -export const de_GetProvisionedProductOutputsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetProvisionedProductOutputsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetProvisionedProductOutputsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetProvisionedProductOutputsCommandError - */ -const de_GetProvisionedProductOutputsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ImportAsProvisionedProductCommand - */ -export const de_ImportAsProvisionedProductCommand = async ( +export const de_ImportAsProvisionedProductCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportAsProvisionedProductCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4290,41 +2704,6 @@ export const de_ImportAsProvisionedProductCommand = async ( return response; }; -/** - * deserializeAws_json1_1ImportAsProvisionedProductCommandError - */ -const de_ImportAsProvisionedProductCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.servicecatalog#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.servicecatalog#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAcceptedPortfolioSharesCommand */ @@ -4333,7 +2712,7 @@ export const de_ListAcceptedPortfolioSharesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAcceptedPortfolioSharesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4345,35 +2724,6 @@ export const de_ListAcceptedPortfolioSharesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAcceptedPortfolioSharesCommandError - */ -const de_ListAcceptedPortfolioSharesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.servicecatalog#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListBudgetsForResourceCommand */ @@ -4382,7 +2732,7 @@ export const de_ListBudgetsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListBudgetsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4394,35 +2744,6 @@ export const de_ListBudgetsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListBudgetsForResourceCommandError - */ -const de_ListBudgetsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListConstraintsForPortfolioCommand */ @@ -4431,7 +2752,7 @@ export const de_ListConstraintsForPortfolioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListConstraintsForPortfolioCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4443,35 +2764,6 @@ export const de_ListConstraintsForPortfolioCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListConstraintsForPortfolioCommandError - */ -const de_ListConstraintsForPortfolioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListLaunchPathsCommand */ @@ -4480,7 +2772,7 @@ export const de_ListLaunchPathsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListLaunchPathsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4492,35 +2784,6 @@ export const de_ListLaunchPathsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListLaunchPathsCommandError - */ -const de_ListLaunchPathsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListOrganizationPortfolioAccessCommand */ @@ -4529,7 +2792,7 @@ export const de_ListOrganizationPortfolioAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListOrganizationPortfolioAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4541,38 +2804,6 @@ export const de_ListOrganizationPortfolioAccessCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListOrganizationPortfolioAccessCommandError - */ -const de_ListOrganizationPortfolioAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.servicecatalog#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPortfolioAccessCommand */ @@ -4581,7 +2812,7 @@ export const de_ListPortfolioAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPortfolioAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4593,35 +2824,6 @@ export const de_ListPortfolioAccessCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPortfolioAccessCommandError - */ -const de_ListPortfolioAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPortfoliosCommand */ @@ -4630,7 +2832,7 @@ export const de_ListPortfoliosCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPortfoliosCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4643,40 +2845,14 @@ export const de_ListPortfoliosCommand = async ( }; /** - * deserializeAws_json1_1ListPortfoliosCommandError - */ -const de_ListPortfoliosCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListPortfoliosForProductCommand + * deserializeAws_json1_1ListPortfoliosForProductCommand */ export const de_ListPortfoliosForProductCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPortfoliosForProductCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4688,35 +2864,6 @@ export const de_ListPortfoliosForProductCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPortfoliosForProductCommandError - */ -const de_ListPortfoliosForProductCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPrincipalsForPortfolioCommand */ @@ -4725,7 +2872,7 @@ export const de_ListPrincipalsForPortfolioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPrincipalsForPortfolioCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4737,35 +2884,6 @@ export const de_ListPrincipalsForPortfolioCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPrincipalsForPortfolioCommandError - */ -const de_ListPrincipalsForPortfolioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListProvisionedProductPlansCommand */ @@ -4774,7 +2892,7 @@ export const de_ListProvisionedProductPlansCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListProvisionedProductPlansCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4786,35 +2904,6 @@ export const de_ListProvisionedProductPlansCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListProvisionedProductPlansCommandError - */ -const de_ListProvisionedProductPlansCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListProvisioningArtifactsCommand */ @@ -4823,7 +2912,7 @@ export const de_ListProvisioningArtifactsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListProvisioningArtifactsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4835,35 +2924,6 @@ export const de_ListProvisioningArtifactsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListProvisioningArtifactsCommandError - */ -const de_ListProvisioningArtifactsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListProvisioningArtifactsForServiceActionCommand */ @@ -4872,7 +2932,7 @@ export const de_ListProvisioningArtifactsForServiceActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListProvisioningArtifactsForServiceActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4884,35 +2944,6 @@ export const de_ListProvisioningArtifactsForServiceActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListProvisioningArtifactsForServiceActionCommandError - */ -const de_ListProvisioningArtifactsForServiceActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListRecordHistoryCommand */ @@ -4921,7 +2952,7 @@ export const de_ListRecordHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRecordHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4933,32 +2964,6 @@ export const de_ListRecordHistoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListRecordHistoryCommandError - */ -const de_ListRecordHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListResourcesForTagOptionCommand */ @@ -4967,7 +2972,7 @@ export const de_ListResourcesForTagOptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListResourcesForTagOptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4979,38 +2984,6 @@ export const de_ListResourcesForTagOptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListResourcesForTagOptionCommandError - */ -const de_ListResourcesForTagOptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagOptionNotMigratedException": - case "com.amazonaws.servicecatalog#TagOptionNotMigratedException": - throw await de_TagOptionNotMigratedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListServiceActionsCommand */ @@ -5019,7 +2992,7 @@ export const de_ListServiceActionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListServiceActionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5031,32 +3004,6 @@ export const de_ListServiceActionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListServiceActionsCommandError - */ -const de_ListServiceActionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListServiceActionsForProvisioningArtifactCommand */ @@ -5065,7 +3012,7 @@ export const de_ListServiceActionsForProvisioningArtifactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListServiceActionsForProvisioningArtifactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5077,35 +3024,6 @@ export const de_ListServiceActionsForProvisioningArtifactCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListServiceActionsForProvisioningArtifactCommandError - */ -const de_ListServiceActionsForProvisioningArtifactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListStackInstancesForProvisionedProductCommand */ @@ -5114,7 +3032,7 @@ export const de_ListStackInstancesForProvisionedProductCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStackInstancesForProvisionedProductCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5123,150 +3041,23 @@ export const de_ListStackInstancesForProvisionedProductCommand = async ( $metadata: deserializeMetadata(output), ...contents, }; - return response; -}; - -/** - * deserializeAws_json1_1ListStackInstancesForProvisionedProductCommandError - */ -const de_ListStackInstancesForProvisionedProductCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagOptionsCommand - */ -export const de_ListTagOptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagOptionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagOptionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagOptionsCommandError - */ -const de_ListTagOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "TagOptionNotMigratedException": - case "com.amazonaws.servicecatalog#TagOptionNotMigratedException": - throw await de_TagOptionNotMigratedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1NotifyProvisionProductEngineWorkflowResultCommand - */ -export const de_NotifyProvisionProductEngineWorkflowResultCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_NotifyProvisionProductEngineWorkflowResultCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: NotifyProvisionProductEngineWorkflowResultCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1NotifyProvisionProductEngineWorkflowResultCommandError - */ -const de_NotifyProvisionProductEngineWorkflowResultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1NotifyTerminateProvisionedProductEngineWorkflowResultCommand + * deserializeAws_json1_1ListTagOptionsCommand */ -export const de_NotifyTerminateProvisionedProductEngineWorkflowResultCommand = async ( +export const de_ListTagOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_NotifyTerminateProvisionedProductEngineWorkflowResultCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: NotifyTerminateProvisionedProductEngineWorkflowResultCommandOutput = { + const response: ListTagOptionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5274,48 +3065,39 @@ export const de_NotifyTerminateProvisionedProductEngineWorkflowResultCommand = a }; /** - * deserializeAws_json1_1NotifyTerminateProvisionedProductEngineWorkflowResultCommandError + * deserializeAws_json1_1NotifyProvisionProductEngineWorkflowResultCommand */ -const de_NotifyTerminateProvisionedProductEngineWorkflowResultCommandError = async ( +export const de_NotifyProvisionProductEngineWorkflowResultCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: NotifyProvisionProductEngineWorkflowResultCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1NotifyUpdateProvisionedProductEngineWorkflowResultCommand + * deserializeAws_json1_1NotifyTerminateProvisionedProductEngineWorkflowResultCommand */ -export const de_NotifyUpdateProvisionedProductEngineWorkflowResultCommand = async ( +export const de_NotifyTerminateProvisionedProductEngineWorkflowResultCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_NotifyUpdateProvisionedProductEngineWorkflowResultCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: NotifyUpdateProvisionedProductEngineWorkflowResultCommandOutput = { + const response: NotifyTerminateProvisionedProductEngineWorkflowResultCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5323,32 +3105,23 @@ export const de_NotifyUpdateProvisionedProductEngineWorkflowResultCommand = asyn }; /** - * deserializeAws_json1_1NotifyUpdateProvisionedProductEngineWorkflowResultCommandError + * deserializeAws_json1_1NotifyUpdateProvisionedProductEngineWorkflowResultCommand */ -const de_NotifyUpdateProvisionedProductEngineWorkflowResultCommandError = async ( +export const de_NotifyUpdateProvisionedProductEngineWorkflowResultCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: NotifyUpdateProvisionedProductEngineWorkflowResultCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -5359,7 +3132,7 @@ export const de_ProvisionProductCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ProvisionProductCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5371,38 +3144,6 @@ export const de_ProvisionProductCommand = async ( return response; }; -/** - * deserializeAws_json1_1ProvisionProductCommandError - */ -const de_ProvisionProductCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.servicecatalog#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RejectPortfolioShareCommand */ @@ -5411,7 +3152,7 @@ export const de_RejectPortfolioShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RejectPortfolioShareCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5423,32 +3164,6 @@ export const de_RejectPortfolioShareCommand = async ( return response; }; -/** - * deserializeAws_json1_1RejectPortfolioShareCommandError - */ -const de_RejectPortfolioShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ScanProvisionedProductsCommand */ @@ -5457,7 +3172,7 @@ export const de_ScanProvisionedProductsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ScanProvisionedProductsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5469,32 +3184,6 @@ export const de_ScanProvisionedProductsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ScanProvisionedProductsCommandError - */ -const de_ScanProvisionedProductsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SearchProductsCommand */ @@ -5503,7 +3192,7 @@ export const de_SearchProductsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchProductsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5515,32 +3204,6 @@ export const de_SearchProductsCommand = async ( return response; }; -/** - * deserializeAws_json1_1SearchProductsCommandError - */ -const de_SearchProductsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SearchProductsAsAdminCommand */ @@ -5549,7 +3212,7 @@ export const de_SearchProductsAsAdminCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchProductsAsAdminCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5561,35 +3224,6 @@ export const de_SearchProductsAsAdminCommand = async ( return response; }; -/** - * deserializeAws_json1_1SearchProductsAsAdminCommandError - */ -const de_SearchProductsAsAdminCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SearchProvisionedProductsCommand */ @@ -5598,7 +3232,7 @@ export const de_SearchProvisionedProductsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SearchProvisionedProductsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5610,32 +3244,6 @@ export const de_SearchProvisionedProductsCommand = async ( return response; }; -/** - * deserializeAws_json1_1SearchProvisionedProductsCommandError - */ -const de_SearchProvisionedProductsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TerminateProvisionedProductCommand */ @@ -5643,43 +3251,17 @@ export const de_TerminateProvisionedProductCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - if (output.statusCode >= 300) { - return de_TerminateProvisionedProductCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_TerminateProvisionedProductOutput(data, context); - const response: TerminateProvisionedProductCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1TerminateProvisionedProductCommandError - */ -const de_TerminateProvisionedProductCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_TerminateProvisionedProductOutput(data, context); + const response: TerminateProvisionedProductCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -5690,7 +3272,7 @@ export const de_UpdateConstraintCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateConstraintCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5702,35 +3284,6 @@ export const de_UpdateConstraintCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateConstraintCommandError - */ -const de_UpdateConstraintCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdatePortfolioCommand */ @@ -5739,7 +3292,7 @@ export const de_UpdatePortfolioCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePortfolioCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5751,41 +3304,6 @@ export const de_UpdatePortfolioCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdatePortfolioCommandError - */ -const de_UpdatePortfolioCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.servicecatalog#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagOptionNotMigratedException": - case "com.amazonaws.servicecatalog#TagOptionNotMigratedException": - throw await de_TagOptionNotMigratedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdatePortfolioShareCommand */ @@ -5794,7 +3312,7 @@ export const de_UpdatePortfolioShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePortfolioShareCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5806,41 +3324,6 @@ export const de_UpdatePortfolioShareCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdatePortfolioShareCommandError - */ -const de_UpdatePortfolioShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.servicecatalog#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.servicecatalog#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateProductCommand */ @@ -5849,7 +3332,7 @@ export const de_UpdateProductCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateProductCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5861,38 +3344,6 @@ export const de_UpdateProductCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateProductCommandError - */ -const de_UpdateProductCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagOptionNotMigratedException": - case "com.amazonaws.servicecatalog#TagOptionNotMigratedException": - throw await de_TagOptionNotMigratedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateProvisionedProductCommand */ @@ -5901,7 +3352,7 @@ export const de_UpdateProvisionedProductCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateProvisionedProductCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5913,35 +3364,6 @@ export const de_UpdateProvisionedProductCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateProvisionedProductCommandError - */ -const de_UpdateProvisionedProductCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateProvisionedProductPropertiesCommand */ @@ -5950,7 +3372,7 @@ export const de_UpdateProvisionedProductPropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateProvisionedProductPropertiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5962,38 +3384,6 @@ export const de_UpdateProvisionedProductPropertiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateProvisionedProductPropertiesCommandError - */ -const de_UpdateProvisionedProductPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "InvalidStateException": - case "com.amazonaws.servicecatalog#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateProvisioningArtifactCommand */ @@ -6002,7 +3392,7 @@ export const de_UpdateProvisioningArtifactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateProvisioningArtifactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6014,35 +3404,6 @@ export const de_UpdateProvisioningArtifactCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateProvisioningArtifactCommandError - */ -const de_UpdateProvisioningArtifactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateServiceActionCommand */ @@ -6051,7 +3412,7 @@ export const de_UpdateServiceActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateServiceActionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6063,35 +3424,6 @@ export const de_UpdateServiceActionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateServiceActionCommandError - */ -const de_UpdateServiceActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParametersException": - case "com.amazonaws.servicecatalog#InvalidParametersException": - throw await de_InvalidParametersExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicecatalog#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateTagOptionCommand */ @@ -6100,7 +3432,7 @@ export const de_UpdateTagOptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTagOptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6113,37 +3445,46 @@ export const de_UpdateTagOptionCommand = async ( }; /** - * deserializeAws_json1_1UpdateTagOptionCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateTagOptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "DuplicateResourceException": - case "com.amazonaws.servicecatalog#DuplicateResourceException": - throw await de_DuplicateResourceExceptionRes(parsedOutput, context); case "InvalidParametersException": case "com.amazonaws.servicecatalog#InvalidParametersException": throw await de_InvalidParametersExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.servicecatalog#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.servicecatalog#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "DuplicateResourceException": + case "com.amazonaws.servicecatalog#DuplicateResourceException": + throw await de_DuplicateResourceExceptionRes(parsedOutput, context); + case "InvalidStateException": + case "com.amazonaws.servicecatalog#InvalidStateException": + throw await de_InvalidStateExceptionRes(parsedOutput, context); case "TagOptionNotMigratedException": case "com.amazonaws.servicecatalog#TagOptionNotMigratedException": throw await de_TagOptionNotMigratedExceptionRes(parsedOutput, context); + case "OperationNotSupportedException": + case "com.amazonaws.servicecatalog#OperationNotSupportedException": + throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.servicecatalog#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-service-quotas/src/protocols/Aws_json1_1.ts b/clients/client-service-quotas/src/protocols/Aws_json1_1.ts index de5c99f8339d..30b8a14305e0 100644 --- a/clients/client-service-quotas/src/protocols/Aws_json1_1.ts +++ b/clients/client-service-quotas/src/protocols/Aws_json1_1.ts @@ -392,7 +392,7 @@ export const de_AssociateServiceQuotaTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateServiceQuotaTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -404,53 +404,6 @@ export const de_AssociateServiceQuotaTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateServiceQuotaTemplateCommandError - */ -const de_AssociateServiceQuotaTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSServiceAccessNotEnabledException": - case "com.amazonaws.servicequotas#AWSServiceAccessNotEnabledException": - throw await de_AWSServiceAccessNotEnabledExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DependencyAccessDeniedException": - case "com.amazonaws.servicequotas#DependencyAccessDeniedException": - throw await de_DependencyAccessDeniedExceptionRes(parsedOutput, context); - case "NoAvailableOrganizationException": - case "com.amazonaws.servicequotas#NoAvailableOrganizationException": - throw await de_NoAvailableOrganizationExceptionRes(parsedOutput, context); - case "OrganizationNotInAllFeaturesModeException": - case "com.amazonaws.servicequotas#OrganizationNotInAllFeaturesModeException": - throw await de_OrganizationNotInAllFeaturesModeExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TemplatesNotAvailableInRegionException": - case "com.amazonaws.servicequotas#TemplatesNotAvailableInRegionException": - throw await de_TemplatesNotAvailableInRegionExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteServiceQuotaIncreaseRequestFromTemplateCommand */ @@ -459,7 +412,7 @@ export const de_DeleteServiceQuotaIncreaseRequestFromTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteServiceQuotaIncreaseRequestFromTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -471,56 +424,6 @@ export const de_DeleteServiceQuotaIncreaseRequestFromTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteServiceQuotaIncreaseRequestFromTemplateCommandError - */ -const de_DeleteServiceQuotaIncreaseRequestFromTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSServiceAccessNotEnabledException": - case "com.amazonaws.servicequotas#AWSServiceAccessNotEnabledException": - throw await de_AWSServiceAccessNotEnabledExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DependencyAccessDeniedException": - case "com.amazonaws.servicequotas#DependencyAccessDeniedException": - throw await de_DependencyAccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "NoAvailableOrganizationException": - case "com.amazonaws.servicequotas#NoAvailableOrganizationException": - throw await de_NoAvailableOrganizationExceptionRes(parsedOutput, context); - case "NoSuchResourceException": - case "com.amazonaws.servicequotas#NoSuchResourceException": - throw await de_NoSuchResourceExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TemplatesNotAvailableInRegionException": - case "com.amazonaws.servicequotas#TemplatesNotAvailableInRegionException": - throw await de_TemplatesNotAvailableInRegionExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisassociateServiceQuotaTemplateCommand */ @@ -529,7 +432,7 @@ export const de_DisassociateServiceQuotaTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateServiceQuotaTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -541,53 +444,6 @@ export const de_DisassociateServiceQuotaTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateServiceQuotaTemplateCommandError - */ -const de_DisassociateServiceQuotaTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSServiceAccessNotEnabledException": - case "com.amazonaws.servicequotas#AWSServiceAccessNotEnabledException": - throw await de_AWSServiceAccessNotEnabledExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DependencyAccessDeniedException": - case "com.amazonaws.servicequotas#DependencyAccessDeniedException": - throw await de_DependencyAccessDeniedExceptionRes(parsedOutput, context); - case "NoAvailableOrganizationException": - case "com.amazonaws.servicequotas#NoAvailableOrganizationException": - throw await de_NoAvailableOrganizationExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceQuotaTemplateNotInUseException": - case "com.amazonaws.servicequotas#ServiceQuotaTemplateNotInUseException": - throw await de_ServiceQuotaTemplateNotInUseExceptionRes(parsedOutput, context); - case "TemplatesNotAvailableInRegionException": - case "com.amazonaws.servicequotas#TemplatesNotAvailableInRegionException": - throw await de_TemplatesNotAvailableInRegionExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAssociationForServiceQuotaTemplateCommand */ @@ -596,7 +452,7 @@ export const de_GetAssociationForServiceQuotaTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAssociationForServiceQuotaTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -608,53 +464,6 @@ export const de_GetAssociationForServiceQuotaTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAssociationForServiceQuotaTemplateCommandError - */ -const de_GetAssociationForServiceQuotaTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSServiceAccessNotEnabledException": - case "com.amazonaws.servicequotas#AWSServiceAccessNotEnabledException": - throw await de_AWSServiceAccessNotEnabledExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DependencyAccessDeniedException": - case "com.amazonaws.servicequotas#DependencyAccessDeniedException": - throw await de_DependencyAccessDeniedExceptionRes(parsedOutput, context); - case "NoAvailableOrganizationException": - case "com.amazonaws.servicequotas#NoAvailableOrganizationException": - throw await de_NoAvailableOrganizationExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "ServiceQuotaTemplateNotInUseException": - case "com.amazonaws.servicequotas#ServiceQuotaTemplateNotInUseException": - throw await de_ServiceQuotaTemplateNotInUseExceptionRes(parsedOutput, context); - case "TemplatesNotAvailableInRegionException": - case "com.amazonaws.servicequotas#TemplatesNotAvailableInRegionException": - throw await de_TemplatesNotAvailableInRegionExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAWSDefaultServiceQuotaCommand */ @@ -663,7 +472,7 @@ export const de_GetAWSDefaultServiceQuotaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAWSDefaultServiceQuotaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -675,44 +484,6 @@ export const de_GetAWSDefaultServiceQuotaCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetAWSDefaultServiceQuotaCommandError - */ -const de_GetAWSDefaultServiceQuotaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "NoSuchResourceException": - case "com.amazonaws.servicequotas#NoSuchResourceException": - throw await de_NoSuchResourceExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetRequestedServiceQuotaChangeCommand */ @@ -721,7 +492,7 @@ export const de_GetRequestedServiceQuotaChangeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRequestedServiceQuotaChangeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -733,44 +504,6 @@ export const de_GetRequestedServiceQuotaChangeCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetRequestedServiceQuotaChangeCommandError - */ -const de_GetRequestedServiceQuotaChangeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "NoSuchResourceException": - case "com.amazonaws.servicequotas#NoSuchResourceException": - throw await de_NoSuchResourceExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetServiceQuotaCommand */ @@ -779,7 +512,7 @@ export const de_GetServiceQuotaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetServiceQuotaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -792,52 +525,14 @@ export const de_GetServiceQuotaCommand = async ( }; /** - * deserializeAws_json1_1GetServiceQuotaCommandError + * deserializeAws_json1_1GetServiceQuotaIncreaseRequestFromTemplateCommand */ -const de_GetServiceQuotaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "NoSuchResourceException": - case "com.amazonaws.servicequotas#NoSuchResourceException": - throw await de_NoSuchResourceExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetServiceQuotaIncreaseRequestFromTemplateCommand - */ -export const de_GetServiceQuotaIncreaseRequestFromTemplateCommand = async ( +export const de_GetServiceQuotaIncreaseRequestFromTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetServiceQuotaIncreaseRequestFromTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -849,56 +544,6 @@ export const de_GetServiceQuotaIncreaseRequestFromTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetServiceQuotaIncreaseRequestFromTemplateCommandError - */ -const de_GetServiceQuotaIncreaseRequestFromTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSServiceAccessNotEnabledException": - case "com.amazonaws.servicequotas#AWSServiceAccessNotEnabledException": - throw await de_AWSServiceAccessNotEnabledExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DependencyAccessDeniedException": - case "com.amazonaws.servicequotas#DependencyAccessDeniedException": - throw await de_DependencyAccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "NoAvailableOrganizationException": - case "com.amazonaws.servicequotas#NoAvailableOrganizationException": - throw await de_NoAvailableOrganizationExceptionRes(parsedOutput, context); - case "NoSuchResourceException": - case "com.amazonaws.servicequotas#NoSuchResourceException": - throw await de_NoSuchResourceExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TemplatesNotAvailableInRegionException": - case "com.amazonaws.servicequotas#TemplatesNotAvailableInRegionException": - throw await de_TemplatesNotAvailableInRegionExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAWSDefaultServiceQuotasCommand */ @@ -907,7 +552,7 @@ export const de_ListAWSDefaultServiceQuotasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAWSDefaultServiceQuotasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -919,47 +564,6 @@ export const de_ListAWSDefaultServiceQuotasCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAWSDefaultServiceQuotasCommandError - */ -const de_ListAWSDefaultServiceQuotasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.servicequotas#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "NoSuchResourceException": - case "com.amazonaws.servicequotas#NoSuchResourceException": - throw await de_NoSuchResourceExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListRequestedServiceQuotaChangeHistoryCommand */ @@ -968,7 +572,7 @@ export const de_ListRequestedServiceQuotaChangeHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRequestedServiceQuotaChangeHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -980,47 +584,6 @@ export const de_ListRequestedServiceQuotaChangeHistoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListRequestedServiceQuotaChangeHistoryCommandError - */ -const de_ListRequestedServiceQuotaChangeHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.servicequotas#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "NoSuchResourceException": - case "com.amazonaws.servicequotas#NoSuchResourceException": - throw await de_NoSuchResourceExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListRequestedServiceQuotaChangeHistoryByQuotaCommand */ @@ -1029,7 +592,7 @@ export const de_ListRequestedServiceQuotaChangeHistoryByQuotaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRequestedServiceQuotaChangeHistoryByQuotaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1041,47 +604,6 @@ export const de_ListRequestedServiceQuotaChangeHistoryByQuotaCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListRequestedServiceQuotaChangeHistoryByQuotaCommandError - */ -const de_ListRequestedServiceQuotaChangeHistoryByQuotaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.servicequotas#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "NoSuchResourceException": - case "com.amazonaws.servicequotas#NoSuchResourceException": - throw await de_NoSuchResourceExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListServiceQuotaIncreaseRequestsInTemplateCommand */ @@ -1090,198 +612,32 @@ export const de_ListServiceQuotaIncreaseRequestsInTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListServiceQuotaIncreaseRequestsInTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_ListServiceQuotaIncreaseRequestsInTemplateResponse(data, context); const response: ListServiceQuotaIncreaseRequestsInTemplateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListServiceQuotaIncreaseRequestsInTemplateCommandError - */ -const de_ListServiceQuotaIncreaseRequestsInTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSServiceAccessNotEnabledException": - case "com.amazonaws.servicequotas#AWSServiceAccessNotEnabledException": - throw await de_AWSServiceAccessNotEnabledExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DependencyAccessDeniedException": - case "com.amazonaws.servicequotas#DependencyAccessDeniedException": - throw await de_DependencyAccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "NoAvailableOrganizationException": - case "com.amazonaws.servicequotas#NoAvailableOrganizationException": - throw await de_NoAvailableOrganizationExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TemplatesNotAvailableInRegionException": - case "com.amazonaws.servicequotas#TemplatesNotAvailableInRegionException": - throw await de_TemplatesNotAvailableInRegionExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListServiceQuotasCommand - */ -export const de_ListServiceQuotasCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListServiceQuotasCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListServiceQuotasResponse(data, context); - const response: ListServiceQuotasCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListServiceQuotasCommandError - */ -const de_ListServiceQuotasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.servicequotas#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "NoSuchResourceException": - case "com.amazonaws.servicequotas#NoSuchResourceException": - throw await de_NoSuchResourceExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListServicesCommand - */ -export const de_ListServicesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListServicesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListServicesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListServicesCommandError - */ -const de_ListServicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.servicequotas#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1ListServiceQuotasCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListServiceQuotasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_ListServiceQuotasResponse(data, context); + const response: ListServiceQuotasCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1289,57 +645,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1ListServicesCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListServicesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "NoSuchResourceException": - case "com.amazonaws.servicequotas#NoSuchResourceException": - throw await de_NoSuchResourceExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListServicesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutServiceQuotaIncreaseRequestIntoTemplateCommand + * deserializeAws_json1_1ListTagsForResourceCommand */ -export const de_PutServiceQuotaIncreaseRequestIntoTemplateCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutServiceQuotaIncreaseRequestIntoTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_PutServiceQuotaIncreaseRequestIntoTemplateResponse(data, context); - const response: PutServiceQuotaIncreaseRequestIntoTemplateCommandOutput = { + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1347,56 +685,23 @@ export const de_PutServiceQuotaIncreaseRequestIntoTemplateCommand = async ( }; /** - * deserializeAws_json1_1PutServiceQuotaIncreaseRequestIntoTemplateCommandError + * deserializeAws_json1_1PutServiceQuotaIncreaseRequestIntoTemplateCommand */ -const de_PutServiceQuotaIncreaseRequestIntoTemplateCommandError = async ( +export const de_PutServiceQuotaIncreaseRequestIntoTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AWSServiceAccessNotEnabledException": - case "com.amazonaws.servicequotas#AWSServiceAccessNotEnabledException": - throw await de_AWSServiceAccessNotEnabledExceptionRes(parsedOutput, context); - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DependencyAccessDeniedException": - case "com.amazonaws.servicequotas#DependencyAccessDeniedException": - throw await de_DependencyAccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "NoAvailableOrganizationException": - case "com.amazonaws.servicequotas#NoAvailableOrganizationException": - throw await de_NoAvailableOrganizationExceptionRes(parsedOutput, context); - case "NoSuchResourceException": - case "com.amazonaws.servicequotas#NoSuchResourceException": - throw await de_NoSuchResourceExceptionRes(parsedOutput, context); - case "QuotaExceededException": - case "com.amazonaws.servicequotas#QuotaExceededException": - throw await de_QuotaExceededExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TemplatesNotAvailableInRegionException": - case "com.amazonaws.servicequotas#TemplatesNotAvailableInRegionException": - throw await de_TemplatesNotAvailableInRegionExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_PutServiceQuotaIncreaseRequestIntoTemplateResponse(data, context); + const response: PutServiceQuotaIncreaseRequestIntoTemplateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1407,7 +712,7 @@ export const de_RequestServiceQuotaIncreaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RequestServiceQuotaIncreaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1419,56 +724,6 @@ export const de_RequestServiceQuotaIncreaseCommand = async ( return response; }; -/** - * deserializeAws_json1_1RequestServiceQuotaIncreaseCommandError - */ -const de_RequestServiceQuotaIncreaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DependencyAccessDeniedException": - case "com.amazonaws.servicequotas#DependencyAccessDeniedException": - throw await de_DependencyAccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.servicequotas#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "NoSuchResourceException": - case "com.amazonaws.servicequotas#NoSuchResourceException": - throw await de_NoSuchResourceExceptionRes(parsedOutput, context); - case "QuotaExceededException": - case "com.amazonaws.servicequotas#QuotaExceededException": - throw await de_QuotaExceededExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.servicequotas#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -1477,7 +732,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1489,50 +744,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.servicequotas#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "NoSuchResourceException": - case "com.amazonaws.servicequotas#NoSuchResourceException": - throw await de_NoSuchResourceExceptionRes(parsedOutput, context); - case "ServiceException": - case "com.amazonaws.servicequotas#ServiceException": - throw await de_ServiceExceptionRes(parsedOutput, context); - case "TagPolicyViolationException": - case "com.amazonaws.servicequotas#TagPolicyViolationException": - throw await de_TagPolicyViolationExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.servicequotas#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.servicequotas#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -1541,7 +752,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1554,40 +765,73 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AWSServiceAccessNotEnabledException": + case "com.amazonaws.servicequotas#AWSServiceAccessNotEnabledException": + throw await de_AWSServiceAccessNotEnabledExceptionRes(parsedOutput, context); case "AccessDeniedException": case "com.amazonaws.servicequotas#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IllegalArgumentException": - case "com.amazonaws.servicequotas#IllegalArgumentException": - throw await de_IllegalArgumentExceptionRes(parsedOutput, context); - case "NoSuchResourceException": - case "com.amazonaws.servicequotas#NoSuchResourceException": - throw await de_NoSuchResourceExceptionRes(parsedOutput, context); + case "DependencyAccessDeniedException": + case "com.amazonaws.servicequotas#DependencyAccessDeniedException": + throw await de_DependencyAccessDeniedExceptionRes(parsedOutput, context); + case "NoAvailableOrganizationException": + case "com.amazonaws.servicequotas#NoAvailableOrganizationException": + throw await de_NoAvailableOrganizationExceptionRes(parsedOutput, context); + case "OrganizationNotInAllFeaturesModeException": + case "com.amazonaws.servicequotas#OrganizationNotInAllFeaturesModeException": + throw await de_OrganizationNotInAllFeaturesModeExceptionRes(parsedOutput, context); case "ServiceException": case "com.amazonaws.servicequotas#ServiceException": throw await de_ServiceExceptionRes(parsedOutput, context); + case "TemplatesNotAvailableInRegionException": + case "com.amazonaws.servicequotas#TemplatesNotAvailableInRegionException": + throw await de_TemplatesNotAvailableInRegionExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.servicequotas#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "IllegalArgumentException": + case "com.amazonaws.servicequotas#IllegalArgumentException": + throw await de_IllegalArgumentExceptionRes(parsedOutput, context); + case "NoSuchResourceException": + case "com.amazonaws.servicequotas#NoSuchResourceException": + throw await de_NoSuchResourceExceptionRes(parsedOutput, context); + case "ServiceQuotaTemplateNotInUseException": + case "com.amazonaws.servicequotas#ServiceQuotaTemplateNotInUseException": + throw await de_ServiceQuotaTemplateNotInUseExceptionRes(parsedOutput, context); + case "InvalidPaginationTokenException": + case "com.amazonaws.servicequotas#InvalidPaginationTokenException": + throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); + case "QuotaExceededException": + case "com.amazonaws.servicequotas#QuotaExceededException": + throw await de_QuotaExceededExceptionRes(parsedOutput, context); + case "InvalidResourceStateException": + case "com.amazonaws.servicequotas#InvalidResourceStateException": + throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.servicequotas#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "TagPolicyViolationException": + case "com.amazonaws.servicequotas#TagPolicyViolationException": + throw await de_TagPolicyViolationExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.servicequotas#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts b/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts index 611f0529e47b..a89eb9c6042f 100644 --- a/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts +++ b/clients/client-servicediscovery/src/protocols/Aws_json1_1.ts @@ -533,7 +533,7 @@ export const de_CreateHttpNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateHttpNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -545,44 +545,6 @@ export const de_CreateHttpNamespaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateHttpNamespaceCommandError - */ -const de_CreateHttpNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.servicediscovery#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NamespaceAlreadyExists": - case "com.amazonaws.servicediscovery#NamespaceAlreadyExists": - throw await de_NamespaceAlreadyExistsRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.servicediscovery#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.servicediscovery#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePrivateDnsNamespaceCommand */ @@ -591,7 +553,7 @@ export const de_CreatePrivateDnsNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePrivateDnsNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -603,44 +565,6 @@ export const de_CreatePrivateDnsNamespaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePrivateDnsNamespaceCommandError - */ -const de_CreatePrivateDnsNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.servicediscovery#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NamespaceAlreadyExists": - case "com.amazonaws.servicediscovery#NamespaceAlreadyExists": - throw await de_NamespaceAlreadyExistsRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.servicediscovery#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.servicediscovery#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreatePublicDnsNamespaceCommand */ @@ -649,7 +573,7 @@ export const de_CreatePublicDnsNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePublicDnsNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -661,44 +585,6 @@ export const de_CreatePublicDnsNamespaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePublicDnsNamespaceCommandError - */ -const de_CreatePublicDnsNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.servicediscovery#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NamespaceAlreadyExists": - case "com.amazonaws.servicediscovery#NamespaceAlreadyExists": - throw await de_NamespaceAlreadyExistsRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.servicediscovery#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.servicediscovery#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateServiceCommand */ @@ -707,7 +593,7 @@ export const de_CreateServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -719,44 +605,6 @@ export const de_CreateServiceCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateServiceCommandError - */ -const de_CreateServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NamespaceNotFound": - case "com.amazonaws.servicediscovery#NamespaceNotFound": - throw await de_NamespaceNotFoundRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.servicediscovery#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ServiceAlreadyExists": - case "com.amazonaws.servicediscovery#ServiceAlreadyExists": - throw await de_ServiceAlreadyExistsRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.servicediscovery#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteNamespaceCommand */ @@ -765,7 +613,7 @@ export const de_DeleteNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -777,41 +625,6 @@ export const de_DeleteNamespaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteNamespaceCommandError - */ -const de_DeleteNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.servicediscovery#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NamespaceNotFound": - case "com.amazonaws.servicediscovery#NamespaceNotFound": - throw await de_NamespaceNotFoundRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.servicediscovery#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteServiceCommand */ @@ -820,7 +633,7 @@ export const de_DeleteServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -832,38 +645,6 @@ export const de_DeleteServiceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteServiceCommandError - */ -const de_DeleteServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.servicediscovery#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ServiceNotFound": - case "com.amazonaws.servicediscovery#ServiceNotFound": - throw await de_ServiceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeregisterInstanceCommand */ @@ -872,7 +653,7 @@ export const de_DeregisterInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeregisterInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -884,44 +665,6 @@ export const de_DeregisterInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeregisterInstanceCommandError - */ -const de_DeregisterInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.servicediscovery#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InstanceNotFound": - case "com.amazonaws.servicediscovery#InstanceNotFound": - throw await de_InstanceNotFoundRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.servicediscovery#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ServiceNotFound": - case "com.amazonaws.servicediscovery#ServiceNotFound": - throw await de_ServiceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DiscoverInstancesCommand */ @@ -930,7 +673,7 @@ export const de_DiscoverInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DiscoverInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -943,161 +686,19 @@ export const de_DiscoverInstancesCommand = async ( }; /** - * deserializeAws_json1_1DiscoverInstancesCommandError - */ -const de_DiscoverInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NamespaceNotFound": - case "com.amazonaws.servicediscovery#NamespaceNotFound": - throw await de_NamespaceNotFoundRes(parsedOutput, context); - case "RequestLimitExceeded": - case "com.amazonaws.servicediscovery#RequestLimitExceeded": - throw await de_RequestLimitExceededRes(parsedOutput, context); - case "ServiceNotFound": - case "com.amazonaws.servicediscovery#ServiceNotFound": - throw await de_ServiceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DiscoverInstancesRevisionCommand - */ -export const de_DiscoverInstancesRevisionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DiscoverInstancesRevisionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DiscoverInstancesRevisionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DiscoverInstancesRevisionCommandError - */ -const de_DiscoverInstancesRevisionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NamespaceNotFound": - case "com.amazonaws.servicediscovery#NamespaceNotFound": - throw await de_NamespaceNotFoundRes(parsedOutput, context); - case "RequestLimitExceeded": - case "com.amazonaws.servicediscovery#RequestLimitExceeded": - throw await de_RequestLimitExceededRes(parsedOutput, context); - case "ServiceNotFound": - case "com.amazonaws.servicediscovery#ServiceNotFound": - throw await de_ServiceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetInstanceCommand - */ -export const de_GetInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetInstanceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetInstanceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetInstanceCommandError - */ -const de_GetInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InstanceNotFound": - case "com.amazonaws.servicediscovery#InstanceNotFound": - throw await de_InstanceNotFoundRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "ServiceNotFound": - case "com.amazonaws.servicediscovery#ServiceNotFound": - throw await de_ServiceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetInstancesHealthStatusCommand + * deserializeAws_json1_1DiscoverInstancesRevisionCommand */ -export const de_GetInstancesHealthStatusCommand = async ( +export const de_DiscoverInstancesRevisionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetInstancesHealthStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetInstancesHealthStatusCommandOutput = { + const response: DiscoverInstancesRevisionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1105,51 +706,39 @@ export const de_GetInstancesHealthStatusCommand = async ( }; /** - * deserializeAws_json1_1GetInstancesHealthStatusCommandError + * deserializeAws_json1_1GetInstanceCommand */ -const de_GetInstancesHealthStatusCommandError = async ( +export const de_GetInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InstanceNotFound": - case "com.amazonaws.servicediscovery#InstanceNotFound": - throw await de_InstanceNotFoundRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "ServiceNotFound": - case "com.amazonaws.servicediscovery#ServiceNotFound": - throw await de_ServiceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetNamespaceCommand + * deserializeAws_json1_1GetInstancesHealthStatusCommand */ -export const de_GetNamespaceCommand = async ( +export const de_GetInstancesHealthStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetNamespaceResponse(data, context); - const response: GetNamespaceCommandOutput = { + contents = _json(data); + const response: GetInstancesHealthStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1157,32 +746,23 @@ export const de_GetNamespaceCommand = async ( }; /** - * deserializeAws_json1_1GetNamespaceCommandError + * deserializeAws_json1_1GetNamespaceCommand */ -const de_GetNamespaceCommandError = async ( +export const de_GetNamespaceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NamespaceNotFound": - case "com.amazonaws.servicediscovery#NamespaceNotFound": - throw await de_NamespaceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetNamespaceResponse(data, context); + const response: GetNamespaceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1193,7 +773,7 @@ export const de_GetOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetOperationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1205,35 +785,6 @@ export const de_GetOperationCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetOperationCommandError - */ -const de_GetOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "OperationNotFound": - case "com.amazonaws.servicediscovery#OperationNotFound": - throw await de_OperationNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetServiceCommand */ @@ -1242,7 +793,7 @@ export const de_GetServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1254,35 +805,6 @@ export const de_GetServiceCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetServiceCommandError - */ -const de_GetServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "ServiceNotFound": - case "com.amazonaws.servicediscovery#ServiceNotFound": - throw await de_ServiceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListInstancesCommand */ @@ -1291,7 +813,7 @@ export const de_ListInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListInstancesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1303,35 +825,6 @@ export const de_ListInstancesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListInstancesCommandError - */ -const de_ListInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "ServiceNotFound": - case "com.amazonaws.servicediscovery#ServiceNotFound": - throw await de_ServiceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListNamespacesCommand */ @@ -1340,7 +833,7 @@ export const de_ListNamespacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListNamespacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1352,32 +845,6 @@ export const de_ListNamespacesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListNamespacesCommandError - */ -const de_ListNamespacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListOperationsCommand */ @@ -1386,7 +853,7 @@ export const de_ListOperationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListOperationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1398,32 +865,6 @@ export const de_ListOperationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListOperationsCommandError - */ -const de_ListOperationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListServicesCommand */ @@ -1432,7 +873,7 @@ export const de_ListServicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListServicesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1444,32 +885,6 @@ export const de_ListServicesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListServicesCommandError - */ -const de_ListServicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -1478,7 +893,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1486,37 +901,8 @@ export const de_ListTagsForResourceCommand = async ( const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicediscovery#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }; + return response; }; /** @@ -1527,7 +913,7 @@ export const de_RegisterInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1539,44 +925,6 @@ export const de_RegisterInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1RegisterInstanceCommandError - */ -const de_RegisterInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.servicediscovery#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.servicediscovery#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - case "ResourceLimitExceeded": - case "com.amazonaws.servicediscovery#ResourceLimitExceeded": - throw await de_ResourceLimitExceededRes(parsedOutput, context); - case "ServiceNotFound": - case "com.amazonaws.servicediscovery#ServiceNotFound": - throw await de_ServiceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -1585,7 +933,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1597,38 +945,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicediscovery#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.servicediscovery#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -1637,7 +953,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1649,35 +965,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.servicediscovery#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateHttpNamespaceCommand */ @@ -1686,7 +973,7 @@ export const de_UpdateHttpNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateHttpNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1698,41 +985,6 @@ export const de_UpdateHttpNamespaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateHttpNamespaceCommandError - */ -const de_UpdateHttpNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.servicediscovery#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NamespaceNotFound": - case "com.amazonaws.servicediscovery#NamespaceNotFound": - throw await de_NamespaceNotFoundRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.servicediscovery#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateInstanceCustomHealthStatusCommand */ @@ -1741,7 +993,7 @@ export const de_UpdateInstanceCustomHealthStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateInstanceCustomHealthStatusCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateInstanceCustomHealthStatusCommandOutput = { @@ -1750,41 +1002,6 @@ export const de_UpdateInstanceCustomHealthStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateInstanceCustomHealthStatusCommandError - */ -const de_UpdateInstanceCustomHealthStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomHealthNotFound": - case "com.amazonaws.servicediscovery#CustomHealthNotFound": - throw await de_CustomHealthNotFoundRes(parsedOutput, context); - case "InstanceNotFound": - case "com.amazonaws.servicediscovery#InstanceNotFound": - throw await de_InstanceNotFoundRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "ServiceNotFound": - case "com.amazonaws.servicediscovery#ServiceNotFound": - throw await de_ServiceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdatePrivateDnsNamespaceCommand */ @@ -1793,7 +1010,7 @@ export const de_UpdatePrivateDnsNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePrivateDnsNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1805,41 +1022,6 @@ export const de_UpdatePrivateDnsNamespaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdatePrivateDnsNamespaceCommandError - */ -const de_UpdatePrivateDnsNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.servicediscovery#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NamespaceNotFound": - case "com.amazonaws.servicediscovery#NamespaceNotFound": - throw await de_NamespaceNotFoundRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.servicediscovery#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdatePublicDnsNamespaceCommand */ @@ -1848,7 +1030,7 @@ export const de_UpdatePublicDnsNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePublicDnsNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1860,41 +1042,6 @@ export const de_UpdatePublicDnsNamespaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdatePublicDnsNamespaceCommandError - */ -const de_UpdatePublicDnsNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateRequest": - case "com.amazonaws.servicediscovery#DuplicateRequest": - throw await de_DuplicateRequestRes(parsedOutput, context); - case "InvalidInput": - case "com.amazonaws.servicediscovery#InvalidInput": - throw await de_InvalidInputRes(parsedOutput, context); - case "NamespaceNotFound": - case "com.amazonaws.servicediscovery#NamespaceNotFound": - throw await de_NamespaceNotFoundRes(parsedOutput, context); - case "ResourceInUse": - case "com.amazonaws.servicediscovery#ResourceInUse": - throw await de_ResourceInUseRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateServiceCommand */ @@ -1903,7 +1050,7 @@ export const de_UpdateServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateServiceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1916,12 +1063,9 @@ export const de_UpdateServiceCommand = async ( }; /** - * deserializeAws_json1_1UpdateServiceCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1934,16 +1078,49 @@ const de_UpdateServiceCommandError = async ( case "InvalidInput": case "com.amazonaws.servicediscovery#InvalidInput": throw await de_InvalidInputRes(parsedOutput, context); + case "NamespaceAlreadyExists": + case "com.amazonaws.servicediscovery#NamespaceAlreadyExists": + throw await de_NamespaceAlreadyExistsRes(parsedOutput, context); + case "ResourceLimitExceeded": + case "com.amazonaws.servicediscovery#ResourceLimitExceeded": + throw await de_ResourceLimitExceededRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.servicediscovery#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "NamespaceNotFound": + case "com.amazonaws.servicediscovery#NamespaceNotFound": + throw await de_NamespaceNotFoundRes(parsedOutput, context); + case "ServiceAlreadyExists": + case "com.amazonaws.servicediscovery#ServiceAlreadyExists": + throw await de_ServiceAlreadyExistsRes(parsedOutput, context); + case "ResourceInUse": + case "com.amazonaws.servicediscovery#ResourceInUse": + throw await de_ResourceInUseRes(parsedOutput, context); case "ServiceNotFound": case "com.amazonaws.servicediscovery#ServiceNotFound": throw await de_ServiceNotFoundRes(parsedOutput, context); + case "InstanceNotFound": + case "com.amazonaws.servicediscovery#InstanceNotFound": + throw await de_InstanceNotFoundRes(parsedOutput, context); + case "RequestLimitExceeded": + case "com.amazonaws.servicediscovery#RequestLimitExceeded": + throw await de_RequestLimitExceededRes(parsedOutput, context); + case "OperationNotFound": + case "com.amazonaws.servicediscovery#OperationNotFound": + throw await de_OperationNotFoundRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.servicediscovery#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "CustomHealthNotFound": + case "com.amazonaws.servicediscovery#CustomHealthNotFound": + throw await de_CustomHealthNotFoundRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-ses/src/protocols/Aws_query.ts b/clients/client-ses/src/protocols/Aws_query.ts index 0e5d4b8783f1..7de530ed7730 100644 --- a/clients/client-ses/src/protocols/Aws_query.ts +++ b/clients/client-ses/src/protocols/Aws_query.ts @@ -1661,7 +1661,7 @@ export const de_CloneReceiptRuleSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CloneReceiptRuleSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1673,38 +1673,6 @@ export const de_CloneReceiptRuleSetCommand = async ( return response; }; -/** - * deserializeAws_queryCloneReceiptRuleSetCommandError - */ -const de_CloneReceiptRuleSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExists": - case "com.amazonaws.ses#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.ses#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RuleSetDoesNotExist": - case "com.amazonaws.ses#RuleSetDoesNotExistException": - throw await de_RuleSetDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateConfigurationSetCommand */ @@ -1713,7 +1681,7 @@ export const de_CreateConfigurationSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateConfigurationSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1725,38 +1693,6 @@ export const de_CreateConfigurationSetCommand = async ( return response; }; -/** - * deserializeAws_queryCreateConfigurationSetCommandError - */ -const de_CreateConfigurationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConfigurationSetAlreadyExists": - case "com.amazonaws.ses#ConfigurationSetAlreadyExistsException": - throw await de_ConfigurationSetAlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidConfigurationSet": - case "com.amazonaws.ses#InvalidConfigurationSetException": - throw await de_InvalidConfigurationSetExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.ses#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateConfigurationSetEventDestinationCommand */ @@ -1765,7 +1701,7 @@ export const de_CreateConfigurationSetEventDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateConfigurationSetEventDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1780,47 +1716,6 @@ export const de_CreateConfigurationSetEventDestinationCommand = async ( return response; }; -/** - * deserializeAws_queryCreateConfigurationSetEventDestinationCommandError - */ -const de_CreateConfigurationSetEventDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - case "EventDestinationAlreadyExists": - case "com.amazonaws.ses#EventDestinationAlreadyExistsException": - throw await de_EventDestinationAlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidCloudWatchDestination": - case "com.amazonaws.ses#InvalidCloudWatchDestinationException": - throw await de_InvalidCloudWatchDestinationExceptionRes(parsedOutput, context); - case "InvalidFirehoseDestination": - case "com.amazonaws.ses#InvalidFirehoseDestinationException": - throw await de_InvalidFirehoseDestinationExceptionRes(parsedOutput, context); - case "InvalidSNSDestination": - case "com.amazonaws.ses#InvalidSNSDestinationException": - throw await de_InvalidSNSDestinationExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.ses#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateConfigurationSetTrackingOptionsCommand */ @@ -1829,7 +1724,7 @@ export const de_CreateConfigurationSetTrackingOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateConfigurationSetTrackingOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1844,38 +1739,6 @@ export const de_CreateConfigurationSetTrackingOptionsCommand = async ( return response; }; -/** - * deserializeAws_queryCreateConfigurationSetTrackingOptionsCommandError - */ -const de_CreateConfigurationSetTrackingOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidTrackingOptions": - case "com.amazonaws.ses#InvalidTrackingOptionsException": - throw await de_InvalidTrackingOptionsExceptionRes(parsedOutput, context); - case "TrackingOptionsAlreadyExistsException": - case "com.amazonaws.ses#TrackingOptionsAlreadyExistsException": - throw await de_TrackingOptionsAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateCustomVerificationEmailTemplateCommand */ @@ -1884,7 +1747,7 @@ export const de_CreateCustomVerificationEmailTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCustomVerificationEmailTemplateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: CreateCustomVerificationEmailTemplateCommandOutput = { @@ -1893,41 +1756,6 @@ export const de_CreateCustomVerificationEmailTemplateCommand = async ( return response; }; -/** - * deserializeAws_queryCreateCustomVerificationEmailTemplateCommandError - */ -const de_CreateCustomVerificationEmailTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomVerificationEmailInvalidContent": - case "com.amazonaws.ses#CustomVerificationEmailInvalidContentException": - throw await de_CustomVerificationEmailInvalidContentExceptionRes(parsedOutput, context); - case "CustomVerificationEmailTemplateAlreadyExists": - case "com.amazonaws.ses#CustomVerificationEmailTemplateAlreadyExistsException": - throw await de_CustomVerificationEmailTemplateAlreadyExistsExceptionRes(parsedOutput, context); - case "FromEmailAddressNotVerified": - case "com.amazonaws.ses#FromEmailAddressNotVerifiedException": - throw await de_FromEmailAddressNotVerifiedExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.ses#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateReceiptFilterCommand */ @@ -1936,7 +1764,7 @@ export const de_CreateReceiptFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateReceiptFilterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1948,35 +1776,6 @@ export const de_CreateReceiptFilterCommand = async ( return response; }; -/** - * deserializeAws_queryCreateReceiptFilterCommandError - */ -const de_CreateReceiptFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExists": - case "com.amazonaws.ses#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.ses#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreateReceiptRuleCommand */ @@ -1985,7 +1784,7 @@ export const de_CreateReceiptRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateReceiptRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1998,63 +1797,39 @@ export const de_CreateReceiptRuleCommand = async ( }; /** - * deserializeAws_queryCreateReceiptRuleCommandError + * deserializeAws_queryCreateReceiptRuleSetCommand */ -const de_CreateReceiptRuleCommandError = async ( +export const de_CreateReceiptRuleSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExists": - case "com.amazonaws.ses#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidLambdaFunction": - case "com.amazonaws.ses#InvalidLambdaFunctionException": - throw await de_InvalidLambdaFunctionExceptionRes(parsedOutput, context); - case "InvalidS3Configuration": - case "com.amazonaws.ses#InvalidS3ConfigurationException": - throw await de_InvalidS3ConfigurationExceptionRes(parsedOutput, context); - case "InvalidSnsTopic": - case "com.amazonaws.ses#InvalidSnsTopicException": - throw await de_InvalidSnsTopicExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.ses#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RuleDoesNotExist": - case "com.amazonaws.ses#RuleDoesNotExistException": - throw await de_RuleDoesNotExistExceptionRes(parsedOutput, context); - case "RuleSetDoesNotExist": - case "com.amazonaws.ses#RuleSetDoesNotExistException": - throw await de_RuleSetDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateReceiptRuleSetResponse(data.CreateReceiptRuleSetResult, context); + const response: CreateReceiptRuleSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateReceiptRuleSetCommand + * deserializeAws_queryCreateTemplateCommand */ -export const de_CreateReceiptRuleSetCommand = async ( +export const de_CreateTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateReceiptRuleSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateReceiptRuleSetResponse(data.CreateReceiptRuleSetResult, context); - const response: CreateReceiptRuleSetCommandOutput = { + contents = de_CreateTemplateResponse(data.CreateTemplateResult, context); + const response: CreateTemplateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2062,95 +1837,14 @@ export const de_CreateReceiptRuleSetCommand = async ( }; /** - * deserializeAws_queryCreateReceiptRuleSetCommandError + * deserializeAws_queryDeleteConfigurationSetCommand */ -const de_CreateReceiptRuleSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExists": - case "com.amazonaws.ses#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.ses#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryCreateTemplateCommand - */ -export const de_CreateTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateTemplateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateTemplateResponse(data.CreateTemplateResult, context); - const response: CreateTemplateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryCreateTemplateCommandError - */ -const de_CreateTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExists": - case "com.amazonaws.ses#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "InvalidTemplate": - case "com.amazonaws.ses#InvalidTemplateException": - throw await de_InvalidTemplateExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.ses#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteConfigurationSetCommand - */ -export const de_DeleteConfigurationSetCommand = async ( +export const de_DeleteConfigurationSetCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteConfigurationSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2162,32 +1856,6 @@ export const de_DeleteConfigurationSetCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteConfigurationSetCommandError - */ -const de_DeleteConfigurationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteConfigurationSetEventDestinationCommand */ @@ -2196,7 +1864,7 @@ export const de_DeleteConfigurationSetEventDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteConfigurationSetEventDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2211,35 +1879,6 @@ export const de_DeleteConfigurationSetEventDestinationCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteConfigurationSetEventDestinationCommandError - */ -const de_DeleteConfigurationSetEventDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - case "EventDestinationDoesNotExist": - case "com.amazonaws.ses#EventDestinationDoesNotExistException": - throw await de_EventDestinationDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteConfigurationSetTrackingOptionsCommand */ @@ -2248,7 +1887,7 @@ export const de_DeleteConfigurationSetTrackingOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteConfigurationSetTrackingOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2263,35 +1902,6 @@ export const de_DeleteConfigurationSetTrackingOptionsCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteConfigurationSetTrackingOptionsCommandError - */ -const de_DeleteConfigurationSetTrackingOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - case "TrackingOptionsDoesNotExistException": - case "com.amazonaws.ses#TrackingOptionsDoesNotExistException": - throw await de_TrackingOptionsDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteCustomVerificationEmailTemplateCommand */ @@ -2300,7 +1910,7 @@ export const de_DeleteCustomVerificationEmailTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCustomVerificationEmailTemplateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteCustomVerificationEmailTemplateCommandOutput = { @@ -2309,26 +1919,6 @@ export const de_DeleteCustomVerificationEmailTemplateCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteCustomVerificationEmailTemplateCommandError - */ -const de_DeleteCustomVerificationEmailTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDeleteIdentityCommand */ @@ -2337,7 +1927,7 @@ export const de_DeleteIdentityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteIdentityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2349,26 +1939,6 @@ export const de_DeleteIdentityCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteIdentityCommandError - */ -const de_DeleteIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDeleteIdentityPolicyCommand */ @@ -2377,7 +1947,7 @@ export const de_DeleteIdentityPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteIdentityPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2389,26 +1959,6 @@ export const de_DeleteIdentityPolicyCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteIdentityPolicyCommandError - */ -const de_DeleteIdentityPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDeleteReceiptFilterCommand */ @@ -2417,7 +1967,7 @@ export const de_DeleteReceiptFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteReceiptFilterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2429,26 +1979,6 @@ export const de_DeleteReceiptFilterCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteReceiptFilterCommandError - */ -const de_DeleteReceiptFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDeleteReceiptRuleCommand */ @@ -2457,7 +1987,7 @@ export const de_DeleteReceiptRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteReceiptRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2469,32 +1999,6 @@ export const de_DeleteReceiptRuleCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteReceiptRuleCommandError - */ -const de_DeleteReceiptRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RuleSetDoesNotExist": - case "com.amazonaws.ses#RuleSetDoesNotExistException": - throw await de_RuleSetDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteReceiptRuleSetCommand */ @@ -2503,7 +2007,7 @@ export const de_DeleteReceiptRuleSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteReceiptRuleSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2515,32 +2019,6 @@ export const de_DeleteReceiptRuleSetCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteReceiptRuleSetCommandError - */ -const de_DeleteReceiptRuleSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CannotDelete": - case "com.amazonaws.ses#CannotDeleteException": - throw await de_CannotDeleteExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDeleteTemplateCommand */ @@ -2549,7 +2027,7 @@ export const de_DeleteTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2562,34 +2040,14 @@ export const de_DeleteTemplateCommand = async ( }; /** - * deserializeAws_queryDeleteTemplateCommandError + * deserializeAws_queryDeleteVerifiedEmailAddressCommand */ -const de_DeleteTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryDeleteVerifiedEmailAddressCommand - */ -export const de_DeleteVerifiedEmailAddressCommand = async ( +export const de_DeleteVerifiedEmailAddressCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVerifiedEmailAddressCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteVerifiedEmailAddressCommandOutput = { @@ -2598,26 +2056,6 @@ export const de_DeleteVerifiedEmailAddressCommand = async ( return response; }; -/** - * deserializeAws_queryDeleteVerifiedEmailAddressCommandError - */ -const de_DeleteVerifiedEmailAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeActiveReceiptRuleSetCommand */ @@ -2626,7 +2064,7 @@ export const de_DescribeActiveReceiptRuleSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeActiveReceiptRuleSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2638,26 +2076,6 @@ export const de_DescribeActiveReceiptRuleSetCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeActiveReceiptRuleSetCommandError - */ -const de_DescribeActiveReceiptRuleSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryDescribeConfigurationSetCommand */ @@ -2666,7 +2084,7 @@ export const de_DescribeConfigurationSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeConfigurationSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2678,32 +2096,6 @@ export const de_DescribeConfigurationSetCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeConfigurationSetCommandError - */ -const de_DescribeConfigurationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeReceiptRuleCommand */ @@ -2712,7 +2104,7 @@ export const de_DescribeReceiptRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeReceiptRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2724,35 +2116,6 @@ export const de_DescribeReceiptRuleCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeReceiptRuleCommandError - */ -const de_DescribeReceiptRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RuleDoesNotExist": - case "com.amazonaws.ses#RuleDoesNotExistException": - throw await de_RuleDoesNotExistExceptionRes(parsedOutput, context); - case "RuleSetDoesNotExist": - case "com.amazonaws.ses#RuleSetDoesNotExistException": - throw await de_RuleSetDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDescribeReceiptRuleSetCommand */ @@ -2761,7 +2124,7 @@ export const de_DescribeReceiptRuleSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeReceiptRuleSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2773,32 +2136,6 @@ export const de_DescribeReceiptRuleSetCommand = async ( return response; }; -/** - * deserializeAws_queryDescribeReceiptRuleSetCommandError - */ -const de_DescribeReceiptRuleSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RuleSetDoesNotExist": - case "com.amazonaws.ses#RuleSetDoesNotExistException": - throw await de_RuleSetDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryGetAccountSendingEnabledCommand */ @@ -2807,7 +2144,7 @@ export const de_GetAccountSendingEnabledCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAccountSendingEnabledCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2819,26 +2156,6 @@ export const de_GetAccountSendingEnabledCommand = async ( return response; }; -/** - * deserializeAws_queryGetAccountSendingEnabledCommandError - */ -const de_GetAccountSendingEnabledCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryGetCustomVerificationEmailTemplateCommand */ @@ -2847,7 +2164,7 @@ export const de_GetCustomVerificationEmailTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCustomVerificationEmailTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2859,32 +2176,6 @@ export const de_GetCustomVerificationEmailTemplateCommand = async ( return response; }; -/** - * deserializeAws_queryGetCustomVerificationEmailTemplateCommandError - */ -const de_GetCustomVerificationEmailTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomVerificationEmailTemplateDoesNotExist": - case "com.amazonaws.ses#CustomVerificationEmailTemplateDoesNotExistException": - throw await de_CustomVerificationEmailTemplateDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryGetIdentityDkimAttributesCommand */ @@ -2893,7 +2184,7 @@ export const de_GetIdentityDkimAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetIdentityDkimAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2905,26 +2196,6 @@ export const de_GetIdentityDkimAttributesCommand = async ( return response; }; -/** - * deserializeAws_queryGetIdentityDkimAttributesCommandError - */ -const de_GetIdentityDkimAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryGetIdentityMailFromDomainAttributesCommand */ @@ -2933,7 +2204,7 @@ export const de_GetIdentityMailFromDomainAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetIdentityMailFromDomainAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2945,26 +2216,6 @@ export const de_GetIdentityMailFromDomainAttributesCommand = async ( return response; }; -/** - * deserializeAws_queryGetIdentityMailFromDomainAttributesCommandError - */ -const de_GetIdentityMailFromDomainAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryGetIdentityNotificationAttributesCommand */ @@ -2973,7 +2224,7 @@ export const de_GetIdentityNotificationAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetIdentityNotificationAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2985,26 +2236,6 @@ export const de_GetIdentityNotificationAttributesCommand = async ( return response; }; -/** - * deserializeAws_queryGetIdentityNotificationAttributesCommandError - */ -const de_GetIdentityNotificationAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryGetIdentityPoliciesCommand */ @@ -3013,7 +2244,7 @@ export const de_GetIdentityPoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetIdentityPoliciesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3025,26 +2256,6 @@ export const de_GetIdentityPoliciesCommand = async ( return response; }; -/** - * deserializeAws_queryGetIdentityPoliciesCommandError - */ -const de_GetIdentityPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryGetIdentityVerificationAttributesCommand */ @@ -3053,7 +2264,7 @@ export const de_GetIdentityVerificationAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetIdentityVerificationAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3065,26 +2276,6 @@ export const de_GetIdentityVerificationAttributesCommand = async ( return response; }; -/** - * deserializeAws_queryGetIdentityVerificationAttributesCommandError - */ -const de_GetIdentityVerificationAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryGetSendQuotaCommand */ @@ -3093,7 +2284,7 @@ export const de_GetSendQuotaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSendQuotaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3105,26 +2296,6 @@ export const de_GetSendQuotaCommand = async ( return response; }; -/** - * deserializeAws_queryGetSendQuotaCommandError - */ -const de_GetSendQuotaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryGetSendStatisticsCommand */ @@ -3133,7 +2304,7 @@ export const de_GetSendStatisticsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSendStatisticsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3146,39 +2317,39 @@ export const de_GetSendStatisticsCommand = async ( }; /** - * deserializeAws_queryGetSendStatisticsCommandError + * deserializeAws_queryGetTemplateCommand */ -const de_GetSendStatisticsCommandError = async ( +export const de_GetTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetTemplateResponse(data.GetTemplateResult, context); + const response: GetTemplateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; }; /** - * deserializeAws_queryGetTemplateCommand + * deserializeAws_queryListConfigurationSetsCommand */ -export const de_GetTemplateCommand = async ( +export const de_ListConfigurationSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetTemplateResponse(data.GetTemplateResult, context); - const response: GetTemplateCommandOutput = { + contents = de_ListConfigurationSetsResponse(data.ListConfigurationSetsResult, context); + const response: ListConfigurationSetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3186,80 +2357,14 @@ export const de_GetTemplateCommand = async ( }; /** - * deserializeAws_queryGetTemplateCommandError + * deserializeAws_queryListCustomVerificationEmailTemplatesCommand */ -const de_GetTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "TemplateDoesNotExist": - case "com.amazonaws.ses#TemplateDoesNotExistException": - throw await de_TemplateDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListConfigurationSetsCommand - */ -export const de_ListConfigurationSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListConfigurationSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListConfigurationSetsResponse(data.ListConfigurationSetsResult, context); - const response: ListConfigurationSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListConfigurationSetsCommandError - */ -const de_ListConfigurationSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_queryListCustomVerificationEmailTemplatesCommand - */ -export const de_ListCustomVerificationEmailTemplatesCommand = async ( +export const de_ListCustomVerificationEmailTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListCustomVerificationEmailTemplatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3271,26 +2376,6 @@ export const de_ListCustomVerificationEmailTemplatesCommand = async ( return response; }; -/** - * deserializeAws_queryListCustomVerificationEmailTemplatesCommandError - */ -const de_ListCustomVerificationEmailTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListIdentitiesCommand */ @@ -3299,7 +2384,7 @@ export const de_ListIdentitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListIdentitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3311,26 +2396,6 @@ export const de_ListIdentitiesCommand = async ( return response; }; -/** - * deserializeAws_queryListIdentitiesCommandError - */ -const de_ListIdentitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListIdentityPoliciesCommand */ @@ -3339,7 +2404,7 @@ export const de_ListIdentityPoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListIdentityPoliciesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3351,26 +2416,6 @@ export const de_ListIdentityPoliciesCommand = async ( return response; }; -/** - * deserializeAws_queryListIdentityPoliciesCommandError - */ -const de_ListIdentityPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListReceiptFiltersCommand */ @@ -3379,7 +2424,7 @@ export const de_ListReceiptFiltersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListReceiptFiltersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3391,26 +2436,6 @@ export const de_ListReceiptFiltersCommand = async ( return response; }; -/** - * deserializeAws_queryListReceiptFiltersCommandError - */ -const de_ListReceiptFiltersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListReceiptRuleSetsCommand */ @@ -3419,7 +2444,7 @@ export const de_ListReceiptRuleSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListReceiptRuleSetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3431,26 +2456,6 @@ export const de_ListReceiptRuleSetsCommand = async ( return response; }; -/** - * deserializeAws_queryListReceiptRuleSetsCommandError - */ -const de_ListReceiptRuleSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListTemplatesCommand */ @@ -3459,7 +2464,7 @@ export const de_ListTemplatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTemplatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3471,26 +2476,6 @@ export const de_ListTemplatesCommand = async ( return response; }; -/** - * deserializeAws_queryListTemplatesCommandError - */ -const de_ListTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryListVerifiedEmailAddressesCommand */ @@ -3499,7 +2484,7 @@ export const de_ListVerifiedEmailAddressesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListVerifiedEmailAddressesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3511,26 +2496,6 @@ export const de_ListVerifiedEmailAddressesCommand = async ( return response; }; -/** - * deserializeAws_queryListVerifiedEmailAddressesCommandError - */ -const de_ListVerifiedEmailAddressesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryPutConfigurationSetDeliveryOptionsCommand */ @@ -3539,7 +2504,7 @@ export const de_PutConfigurationSetDeliveryOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutConfigurationSetDeliveryOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3551,35 +2516,6 @@ export const de_PutConfigurationSetDeliveryOptionsCommand = async ( return response; }; -/** - * deserializeAws_queryPutConfigurationSetDeliveryOptionsCommandError - */ -const de_PutConfigurationSetDeliveryOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidDeliveryOptions": - case "com.amazonaws.ses#InvalidDeliveryOptionsException": - throw await de_InvalidDeliveryOptionsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryPutIdentityPolicyCommand */ @@ -3588,7 +2524,7 @@ export const de_PutIdentityPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutIdentityPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3600,32 +2536,6 @@ export const de_PutIdentityPolicyCommand = async ( return response; }; -/** - * deserializeAws_queryPutIdentityPolicyCommandError - */ -const de_PutIdentityPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidPolicy": - case "com.amazonaws.ses#InvalidPolicyException": - throw await de_InvalidPolicyExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryReorderReceiptRuleSetCommand */ @@ -3634,7 +2544,7 @@ export const de_ReorderReceiptRuleSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ReorderReceiptRuleSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3646,35 +2556,6 @@ export const de_ReorderReceiptRuleSetCommand = async ( return response; }; -/** - * deserializeAws_queryReorderReceiptRuleSetCommandError - */ -const de_ReorderReceiptRuleSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RuleDoesNotExist": - case "com.amazonaws.ses#RuleDoesNotExistException": - throw await de_RuleDoesNotExistExceptionRes(parsedOutput, context); - case "RuleSetDoesNotExist": - case "com.amazonaws.ses#RuleSetDoesNotExistException": - throw await de_RuleSetDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySendBounceCommand */ @@ -3683,7 +2564,7 @@ export const de_SendBounceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendBounceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3695,32 +2576,6 @@ export const de_SendBounceCommand = async ( return response; }; -/** - * deserializeAws_querySendBounceCommandError - */ -const de_SendBounceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "MessageRejected": - case "com.amazonaws.ses#MessageRejected": - throw await de_MessageRejectedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySendBulkTemplatedEmailCommand */ @@ -3729,7 +2584,7 @@ export const de_SendBulkTemplatedEmailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendBulkTemplatedEmailCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3742,55 +2597,14 @@ export const de_SendBulkTemplatedEmailCommand = async ( }; /** - * deserializeAws_querySendBulkTemplatedEmailCommandError + * deserializeAws_querySendCustomVerificationEmailCommand */ -const de_SendBulkTemplatedEmailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountSendingPausedException": - case "com.amazonaws.ses#AccountSendingPausedException": - throw await de_AccountSendingPausedExceptionRes(parsedOutput, context); - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - case "ConfigurationSetSendingPausedException": - case "com.amazonaws.ses#ConfigurationSetSendingPausedException": - throw await de_ConfigurationSetSendingPausedExceptionRes(parsedOutput, context); - case "MailFromDomainNotVerifiedException": - case "com.amazonaws.ses#MailFromDomainNotVerifiedException": - throw await de_MailFromDomainNotVerifiedExceptionRes(parsedOutput, context); - case "MessageRejected": - case "com.amazonaws.ses#MessageRejected": - throw await de_MessageRejectedRes(parsedOutput, context); - case "TemplateDoesNotExist": - case "com.amazonaws.ses#TemplateDoesNotExistException": - throw await de_TemplateDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_querySendCustomVerificationEmailCommand - */ -export const de_SendCustomVerificationEmailCommand = async ( +export const de_SendCustomVerificationEmailCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendCustomVerificationEmailCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3802,44 +2616,6 @@ export const de_SendCustomVerificationEmailCommand = async ( return response; }; -/** - * deserializeAws_querySendCustomVerificationEmailCommandError - */ -const de_SendCustomVerificationEmailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - case "CustomVerificationEmailTemplateDoesNotExist": - case "com.amazonaws.ses#CustomVerificationEmailTemplateDoesNotExistException": - throw await de_CustomVerificationEmailTemplateDoesNotExistExceptionRes(parsedOutput, context); - case "FromEmailAddressNotVerified": - case "com.amazonaws.ses#FromEmailAddressNotVerifiedException": - throw await de_FromEmailAddressNotVerifiedExceptionRes(parsedOutput, context); - case "MessageRejected": - case "com.amazonaws.ses#MessageRejected": - throw await de_MessageRejectedRes(parsedOutput, context); - case "ProductionAccessNotGranted": - case "com.amazonaws.ses#ProductionAccessNotGrantedException": - throw await de_ProductionAccessNotGrantedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySendEmailCommand */ @@ -3848,7 +2624,7 @@ export const de_SendEmailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendEmailCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3860,44 +2636,6 @@ export const de_SendEmailCommand = async ( return response; }; -/** - * deserializeAws_querySendEmailCommandError - */ -const de_SendEmailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountSendingPausedException": - case "com.amazonaws.ses#AccountSendingPausedException": - throw await de_AccountSendingPausedExceptionRes(parsedOutput, context); - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - case "ConfigurationSetSendingPausedException": - case "com.amazonaws.ses#ConfigurationSetSendingPausedException": - throw await de_ConfigurationSetSendingPausedExceptionRes(parsedOutput, context); - case "MailFromDomainNotVerifiedException": - case "com.amazonaws.ses#MailFromDomainNotVerifiedException": - throw await de_MailFromDomainNotVerifiedExceptionRes(parsedOutput, context); - case "MessageRejected": - case "com.amazonaws.ses#MessageRejected": - throw await de_MessageRejectedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySendRawEmailCommand */ @@ -3906,7 +2644,7 @@ export const de_SendRawEmailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendRawEmailCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3918,44 +2656,6 @@ export const de_SendRawEmailCommand = async ( return response; }; -/** - * deserializeAws_querySendRawEmailCommandError - */ -const de_SendRawEmailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountSendingPausedException": - case "com.amazonaws.ses#AccountSendingPausedException": - throw await de_AccountSendingPausedExceptionRes(parsedOutput, context); - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - case "ConfigurationSetSendingPausedException": - case "com.amazonaws.ses#ConfigurationSetSendingPausedException": - throw await de_ConfigurationSetSendingPausedExceptionRes(parsedOutput, context); - case "MailFromDomainNotVerifiedException": - case "com.amazonaws.ses#MailFromDomainNotVerifiedException": - throw await de_MailFromDomainNotVerifiedExceptionRes(parsedOutput, context); - case "MessageRejected": - case "com.amazonaws.ses#MessageRejected": - throw await de_MessageRejectedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySendTemplatedEmailCommand */ @@ -3964,7 +2664,7 @@ export const de_SendTemplatedEmailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendTemplatedEmailCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3976,47 +2676,6 @@ export const de_SendTemplatedEmailCommand = async ( return response; }; -/** - * deserializeAws_querySendTemplatedEmailCommandError - */ -const de_SendTemplatedEmailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountSendingPausedException": - case "com.amazonaws.ses#AccountSendingPausedException": - throw await de_AccountSendingPausedExceptionRes(parsedOutput, context); - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - case "ConfigurationSetSendingPausedException": - case "com.amazonaws.ses#ConfigurationSetSendingPausedException": - throw await de_ConfigurationSetSendingPausedExceptionRes(parsedOutput, context); - case "MailFromDomainNotVerifiedException": - case "com.amazonaws.ses#MailFromDomainNotVerifiedException": - throw await de_MailFromDomainNotVerifiedExceptionRes(parsedOutput, context); - case "MessageRejected": - case "com.amazonaws.ses#MessageRejected": - throw await de_MessageRejectedRes(parsedOutput, context); - case "TemplateDoesNotExist": - case "com.amazonaws.ses#TemplateDoesNotExistException": - throw await de_TemplateDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySetActiveReceiptRuleSetCommand */ @@ -4025,7 +2684,7 @@ export const de_SetActiveReceiptRuleSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetActiveReceiptRuleSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4037,32 +2696,6 @@ export const de_SetActiveReceiptRuleSetCommand = async ( return response; }; -/** - * deserializeAws_querySetActiveReceiptRuleSetCommandError - */ -const de_SetActiveReceiptRuleSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RuleSetDoesNotExist": - case "com.amazonaws.ses#RuleSetDoesNotExistException": - throw await de_RuleSetDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_querySetIdentityDkimEnabledCommand */ @@ -4071,7 +2704,7 @@ export const de_SetIdentityDkimEnabledCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetIdentityDkimEnabledCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4083,26 +2716,6 @@ export const de_SetIdentityDkimEnabledCommand = async ( return response; }; -/** - * deserializeAws_querySetIdentityDkimEnabledCommandError - */ -const de_SetIdentityDkimEnabledCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_querySetIdentityFeedbackForwardingEnabledCommand */ @@ -4111,7 +2724,7 @@ export const de_SetIdentityFeedbackForwardingEnabledCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetIdentityFeedbackForwardingEnabledCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4123,26 +2736,6 @@ export const de_SetIdentityFeedbackForwardingEnabledCommand = async ( return response; }; -/** - * deserializeAws_querySetIdentityFeedbackForwardingEnabledCommandError - */ -const de_SetIdentityFeedbackForwardingEnabledCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_querySetIdentityHeadersInNotificationsEnabledCommand */ @@ -4151,7 +2744,7 @@ export const de_SetIdentityHeadersInNotificationsEnabledCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetIdentityHeadersInNotificationsEnabledCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4166,26 +2759,6 @@ export const de_SetIdentityHeadersInNotificationsEnabledCommand = async ( return response; }; -/** - * deserializeAws_querySetIdentityHeadersInNotificationsEnabledCommandError - */ -const de_SetIdentityHeadersInNotificationsEnabledCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_querySetIdentityMailFromDomainCommand */ @@ -4194,7 +2767,7 @@ export const de_SetIdentityMailFromDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetIdentityMailFromDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4207,34 +2780,14 @@ export const de_SetIdentityMailFromDomainCommand = async ( }; /** - * deserializeAws_querySetIdentityMailFromDomainCommandError + * deserializeAws_querySetIdentityNotificationTopicCommand */ -const de_SetIdentityMailFromDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - -/** - * deserializeAws_querySetIdentityNotificationTopicCommand - */ -export const de_SetIdentityNotificationTopicCommand = async ( +export const de_SetIdentityNotificationTopicCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetIdentityNotificationTopicCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4246,26 +2799,6 @@ export const de_SetIdentityNotificationTopicCommand = async ( return response; }; -/** - * deserializeAws_querySetIdentityNotificationTopicCommandError - */ -const de_SetIdentityNotificationTopicCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_querySetReceiptRulePositionCommand */ @@ -4274,7 +2807,7 @@ export const de_SetReceiptRulePositionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetReceiptRulePositionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4286,35 +2819,6 @@ export const de_SetReceiptRulePositionCommand = async ( return response; }; -/** - * deserializeAws_querySetReceiptRulePositionCommandError - */ -const de_SetReceiptRulePositionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "RuleDoesNotExist": - case "com.amazonaws.ses#RuleDoesNotExistException": - throw await de_RuleDoesNotExistExceptionRes(parsedOutput, context); - case "RuleSetDoesNotExist": - case "com.amazonaws.ses#RuleSetDoesNotExistException": - throw await de_RuleSetDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryTestRenderTemplateCommand */ @@ -4323,7 +2827,7 @@ export const de_TestRenderTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TestRenderTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4335,38 +2839,6 @@ export const de_TestRenderTemplateCommand = async ( return response; }; -/** - * deserializeAws_queryTestRenderTemplateCommandError - */ -const de_TestRenderTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRenderingParameter": - case "com.amazonaws.ses#InvalidRenderingParameterException": - throw await de_InvalidRenderingParameterExceptionRes(parsedOutput, context); - case "MissingRenderingAttribute": - case "com.amazonaws.ses#MissingRenderingAttributeException": - throw await de_MissingRenderingAttributeExceptionRes(parsedOutput, context); - case "TemplateDoesNotExist": - case "com.amazonaws.ses#TemplateDoesNotExistException": - throw await de_TemplateDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateAccountSendingEnabledCommand */ @@ -4375,7 +2847,7 @@ export const de_UpdateAccountSendingEnabledCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateAccountSendingEnabledCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateAccountSendingEnabledCommandOutput = { @@ -4384,26 +2856,6 @@ export const de_UpdateAccountSendingEnabledCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateAccountSendingEnabledCommandError - */ -const de_UpdateAccountSendingEnabledCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryUpdateConfigurationSetEventDestinationCommand */ @@ -4412,7 +2864,7 @@ export const de_UpdateConfigurationSetEventDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateConfigurationSetEventDestinationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4427,44 +2879,6 @@ export const de_UpdateConfigurationSetEventDestinationCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateConfigurationSetEventDestinationCommandError - */ -const de_UpdateConfigurationSetEventDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - case "EventDestinationDoesNotExist": - case "com.amazonaws.ses#EventDestinationDoesNotExistException": - throw await de_EventDestinationDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidCloudWatchDestination": - case "com.amazonaws.ses#InvalidCloudWatchDestinationException": - throw await de_InvalidCloudWatchDestinationExceptionRes(parsedOutput, context); - case "InvalidFirehoseDestination": - case "com.amazonaws.ses#InvalidFirehoseDestinationException": - throw await de_InvalidFirehoseDestinationExceptionRes(parsedOutput, context); - case "InvalidSNSDestination": - case "com.amazonaws.ses#InvalidSNSDestinationException": - throw await de_InvalidSNSDestinationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateConfigurationSetReputationMetricsEnabledCommand */ @@ -4473,7 +2887,7 @@ export const de_UpdateConfigurationSetReputationMetricsEnabledCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateConfigurationSetReputationMetricsEnabledCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateConfigurationSetReputationMetricsEnabledCommandOutput = { @@ -4482,32 +2896,6 @@ export const de_UpdateConfigurationSetReputationMetricsEnabledCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateConfigurationSetReputationMetricsEnabledCommandError - */ -const de_UpdateConfigurationSetReputationMetricsEnabledCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateConfigurationSetSendingEnabledCommand */ @@ -4516,7 +2904,7 @@ export const de_UpdateConfigurationSetSendingEnabledCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateConfigurationSetSendingEnabledCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateConfigurationSetSendingEnabledCommandOutput = { @@ -4525,32 +2913,6 @@ export const de_UpdateConfigurationSetSendingEnabledCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateConfigurationSetSendingEnabledCommandError - */ -const de_UpdateConfigurationSetSendingEnabledCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateConfigurationSetTrackingOptionsCommand */ @@ -4559,7 +2921,7 @@ export const de_UpdateConfigurationSetTrackingOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateConfigurationSetTrackingOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4574,38 +2936,6 @@ export const de_UpdateConfigurationSetTrackingOptionsCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateConfigurationSetTrackingOptionsCommandError - */ -const de_UpdateConfigurationSetTrackingOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConfigurationSetDoesNotExist": - case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": - throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); - case "InvalidTrackingOptions": - case "com.amazonaws.ses#InvalidTrackingOptionsException": - throw await de_InvalidTrackingOptionsExceptionRes(parsedOutput, context); - case "TrackingOptionsDoesNotExistException": - case "com.amazonaws.ses#TrackingOptionsDoesNotExistException": - throw await de_TrackingOptionsDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateCustomVerificationEmailTemplateCommand */ @@ -4614,7 +2944,7 @@ export const de_UpdateCustomVerificationEmailTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateCustomVerificationEmailTemplateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateCustomVerificationEmailTemplateCommandOutput = { @@ -4623,38 +2953,6 @@ export const de_UpdateCustomVerificationEmailTemplateCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateCustomVerificationEmailTemplateCommandError - */ -const de_UpdateCustomVerificationEmailTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomVerificationEmailInvalidContent": - case "com.amazonaws.ses#CustomVerificationEmailInvalidContentException": - throw await de_CustomVerificationEmailInvalidContentExceptionRes(parsedOutput, context); - case "CustomVerificationEmailTemplateDoesNotExist": - case "com.amazonaws.ses#CustomVerificationEmailTemplateDoesNotExistException": - throw await de_CustomVerificationEmailTemplateDoesNotExistExceptionRes(parsedOutput, context); - case "FromEmailAddressNotVerified": - case "com.amazonaws.ses#FromEmailAddressNotVerifiedException": - throw await de_FromEmailAddressNotVerifiedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateReceiptRuleCommand */ @@ -4663,7 +2961,7 @@ export const de_UpdateReceiptRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateReceiptRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4675,47 +2973,6 @@ export const de_UpdateReceiptRuleCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateReceiptRuleCommandError - */ -const de_UpdateReceiptRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidLambdaFunction": - case "com.amazonaws.ses#InvalidLambdaFunctionException": - throw await de_InvalidLambdaFunctionExceptionRes(parsedOutput, context); - case "InvalidS3Configuration": - case "com.amazonaws.ses#InvalidS3ConfigurationException": - throw await de_InvalidS3ConfigurationExceptionRes(parsedOutput, context); - case "InvalidSnsTopic": - case "com.amazonaws.ses#InvalidSnsTopicException": - throw await de_InvalidSnsTopicExceptionRes(parsedOutput, context); - case "LimitExceeded": - case "com.amazonaws.ses#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "RuleDoesNotExist": - case "com.amazonaws.ses#RuleDoesNotExistException": - throw await de_RuleDoesNotExistExceptionRes(parsedOutput, context); - case "RuleSetDoesNotExist": - case "com.amazonaws.ses#RuleSetDoesNotExistException": - throw await de_RuleSetDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUpdateTemplateCommand */ @@ -4724,7 +2981,7 @@ export const de_UpdateTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4736,35 +2993,6 @@ export const de_UpdateTemplateCommand = async ( return response; }; -/** - * deserializeAws_queryUpdateTemplateCommandError - */ -const de_UpdateTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidTemplate": - case "com.amazonaws.ses#InvalidTemplateException": - throw await de_InvalidTemplateExceptionRes(parsedOutput, context); - case "TemplateDoesNotExist": - case "com.amazonaws.ses#TemplateDoesNotExistException": - throw await de_TemplateDoesNotExistExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryVerifyDomainDkimCommand */ @@ -4773,7 +3001,7 @@ export const de_VerifyDomainDkimCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_VerifyDomainDkimCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4785,26 +3013,6 @@ export const de_VerifyDomainDkimCommand = async ( return response; }; -/** - * deserializeAws_queryVerifyDomainDkimCommandError - */ -const de_VerifyDomainDkimCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryVerifyDomainIdentityCommand */ @@ -4813,7 +3021,7 @@ export const de_VerifyDomainIdentityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_VerifyDomainIdentityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4825,26 +3033,6 @@ export const de_VerifyDomainIdentityCommand = async ( return response; }; -/** - * deserializeAws_queryVerifyDomainIdentityCommandError - */ -const de_VerifyDomainIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryVerifyEmailAddressCommand */ @@ -4853,7 +3041,7 @@ export const de_VerifyEmailAddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_VerifyEmailAddressCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: VerifyEmailAddressCommandOutput = { @@ -4862,26 +3050,6 @@ export const de_VerifyEmailAddressCommand = async ( return response; }; -/** - * deserializeAws_queryVerifyEmailAddressCommandError - */ -const de_VerifyEmailAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryVerifyEmailIdentityCommand */ @@ -4890,7 +3058,7 @@ export const de_VerifyEmailIdentityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_VerifyEmailIdentityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4903,23 +3071,125 @@ export const de_VerifyEmailIdentityCommand = async ( }; /** - * deserializeAws_queryVerifyEmailIdentityCommandError + * deserialize_Aws_queryCommandError */ -const de_VerifyEmailIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + switch (errorCode) { + case "AlreadyExists": + case "com.amazonaws.ses#AlreadyExistsException": + throw await de_AlreadyExistsExceptionRes(parsedOutput, context); + case "LimitExceeded": + case "com.amazonaws.ses#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "RuleSetDoesNotExist": + case "com.amazonaws.ses#RuleSetDoesNotExistException": + throw await de_RuleSetDoesNotExistExceptionRes(parsedOutput, context); + case "ConfigurationSetAlreadyExists": + case "com.amazonaws.ses#ConfigurationSetAlreadyExistsException": + throw await de_ConfigurationSetAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidConfigurationSet": + case "com.amazonaws.ses#InvalidConfigurationSetException": + throw await de_InvalidConfigurationSetExceptionRes(parsedOutput, context); + case "ConfigurationSetDoesNotExist": + case "com.amazonaws.ses#ConfigurationSetDoesNotExistException": + throw await de_ConfigurationSetDoesNotExistExceptionRes(parsedOutput, context); + case "EventDestinationAlreadyExists": + case "com.amazonaws.ses#EventDestinationAlreadyExistsException": + throw await de_EventDestinationAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidCloudWatchDestination": + case "com.amazonaws.ses#InvalidCloudWatchDestinationException": + throw await de_InvalidCloudWatchDestinationExceptionRes(parsedOutput, context); + case "InvalidFirehoseDestination": + case "com.amazonaws.ses#InvalidFirehoseDestinationException": + throw await de_InvalidFirehoseDestinationExceptionRes(parsedOutput, context); + case "InvalidSNSDestination": + case "com.amazonaws.ses#InvalidSNSDestinationException": + throw await de_InvalidSNSDestinationExceptionRes(parsedOutput, context); + case "InvalidTrackingOptions": + case "com.amazonaws.ses#InvalidTrackingOptionsException": + throw await de_InvalidTrackingOptionsExceptionRes(parsedOutput, context); + case "TrackingOptionsAlreadyExistsException": + case "com.amazonaws.ses#TrackingOptionsAlreadyExistsException": + throw await de_TrackingOptionsAlreadyExistsExceptionRes(parsedOutput, context); + case "CustomVerificationEmailInvalidContent": + case "com.amazonaws.ses#CustomVerificationEmailInvalidContentException": + throw await de_CustomVerificationEmailInvalidContentExceptionRes(parsedOutput, context); + case "CustomVerificationEmailTemplateAlreadyExists": + case "com.amazonaws.ses#CustomVerificationEmailTemplateAlreadyExistsException": + throw await de_CustomVerificationEmailTemplateAlreadyExistsExceptionRes(parsedOutput, context); + case "FromEmailAddressNotVerified": + case "com.amazonaws.ses#FromEmailAddressNotVerifiedException": + throw await de_FromEmailAddressNotVerifiedExceptionRes(parsedOutput, context); + case "InvalidLambdaFunction": + case "com.amazonaws.ses#InvalidLambdaFunctionException": + throw await de_InvalidLambdaFunctionExceptionRes(parsedOutput, context); + case "InvalidS3Configuration": + case "com.amazonaws.ses#InvalidS3ConfigurationException": + throw await de_InvalidS3ConfigurationExceptionRes(parsedOutput, context); + case "InvalidSnsTopic": + case "com.amazonaws.ses#InvalidSnsTopicException": + throw await de_InvalidSnsTopicExceptionRes(parsedOutput, context); + case "RuleDoesNotExist": + case "com.amazonaws.ses#RuleDoesNotExistException": + throw await de_RuleDoesNotExistExceptionRes(parsedOutput, context); + case "InvalidTemplate": + case "com.amazonaws.ses#InvalidTemplateException": + throw await de_InvalidTemplateExceptionRes(parsedOutput, context); + case "EventDestinationDoesNotExist": + case "com.amazonaws.ses#EventDestinationDoesNotExistException": + throw await de_EventDestinationDoesNotExistExceptionRes(parsedOutput, context); + case "TrackingOptionsDoesNotExistException": + case "com.amazonaws.ses#TrackingOptionsDoesNotExistException": + throw await de_TrackingOptionsDoesNotExistExceptionRes(parsedOutput, context); + case "CannotDelete": + case "com.amazonaws.ses#CannotDeleteException": + throw await de_CannotDeleteExceptionRes(parsedOutput, context); + case "CustomVerificationEmailTemplateDoesNotExist": + case "com.amazonaws.ses#CustomVerificationEmailTemplateDoesNotExistException": + throw await de_CustomVerificationEmailTemplateDoesNotExistExceptionRes(parsedOutput, context); + case "TemplateDoesNotExist": + case "com.amazonaws.ses#TemplateDoesNotExistException": + throw await de_TemplateDoesNotExistExceptionRes(parsedOutput, context); + case "InvalidDeliveryOptions": + case "com.amazonaws.ses#InvalidDeliveryOptionsException": + throw await de_InvalidDeliveryOptionsExceptionRes(parsedOutput, context); + case "InvalidPolicy": + case "com.amazonaws.ses#InvalidPolicyException": + throw await de_InvalidPolicyExceptionRes(parsedOutput, context); + case "MessageRejected": + case "com.amazonaws.ses#MessageRejected": + throw await de_MessageRejectedRes(parsedOutput, context); + case "AccountSendingPausedException": + case "com.amazonaws.ses#AccountSendingPausedException": + throw await de_AccountSendingPausedExceptionRes(parsedOutput, context); + case "ConfigurationSetSendingPausedException": + case "com.amazonaws.ses#ConfigurationSetSendingPausedException": + throw await de_ConfigurationSetSendingPausedExceptionRes(parsedOutput, context); + case "MailFromDomainNotVerifiedException": + case "com.amazonaws.ses#MailFromDomainNotVerifiedException": + throw await de_MailFromDomainNotVerifiedExceptionRes(parsedOutput, context); + case "ProductionAccessNotGranted": + case "com.amazonaws.ses#ProductionAccessNotGrantedException": + throw await de_ProductionAccessNotGrantedExceptionRes(parsedOutput, context); + case "InvalidRenderingParameter": + case "com.amazonaws.ses#InvalidRenderingParameterException": + throw await de_InvalidRenderingParameterExceptionRes(parsedOutput, context); + case "MissingRenderingAttribute": + case "com.amazonaws.ses#MissingRenderingAttributeException": + throw await de_MissingRenderingAttributeExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody: parsedBody.Error, + errorCode, + }) as never; + } }; /** diff --git a/clients/client-sesv2/src/protocols/Aws_restJson1.ts b/clients/client-sesv2/src/protocols/Aws_restJson1.ts index f42e3c7904a8..a649fee6f410 100644 --- a/clients/client-sesv2/src/protocols/Aws_restJson1.ts +++ b/clients/client-sesv2/src/protocols/Aws_restJson1.ts @@ -2353,7 +2353,7 @@ export const de_BatchGetMetricDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetMetricDataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2367,41 +2367,6 @@ export const de_BatchGetMetricDataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetMetricDataCommandError - */ -const de_BatchGetMetricDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.sesv2#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelExportJobCommand */ @@ -2410,7 +2375,7 @@ export const de_CancelExportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelExportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2419,38 +2384,6 @@ export const de_CancelExportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelExportJobCommandError - */ -const de_CancelExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConfigurationSetCommand */ @@ -2459,7 +2392,7 @@ export const de_CreateConfigurationSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConfigurationSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2468,47 +2401,6 @@ export const de_CreateConfigurationSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConfigurationSetCommandError - */ -const de_CreateConfigurationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.sesv2#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.sesv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateConfigurationSetEventDestinationCommand */ @@ -2517,7 +2409,7 @@ export const de_CreateConfigurationSetEventDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateConfigurationSetEventDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2526,44 +2418,6 @@ export const de_CreateConfigurationSetEventDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateConfigurationSetEventDestinationCommandError - */ -const de_CreateConfigurationSetEventDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.sesv2#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateContactCommand */ @@ -2572,7 +2426,7 @@ export const de_CreateContactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2581,41 +2435,6 @@ export const de_CreateContactCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateContactCommandError - */ -const de_CreateContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.sesv2#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateContactListCommand */ @@ -2624,7 +2443,7 @@ export const de_CreateContactListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateContactListCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2633,41 +2452,6 @@ export const de_CreateContactListCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateContactListCommandError - */ -const de_CreateContactListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.sesv2#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCustomVerificationEmailTemplateCommand */ @@ -2676,7 +2460,7 @@ export const de_CreateCustomVerificationEmailTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCustomVerificationEmailTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2686,243 +2470,152 @@ export const de_CreateCustomVerificationEmailTemplateCommand = async ( }; /** - * deserializeAws_restJson1CreateCustomVerificationEmailTemplateCommandError + * deserializeAws_restJson1CreateDedicatedIpPoolCommand */ -const de_CreateCustomVerificationEmailTemplateCommandError = async ( +export const de_CreateDedicatedIpPoolCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.sesv2#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateDedicatedIpPoolCommand + * deserializeAws_restJson1CreateDeliverabilityTestReportCommand */ -export const de_CreateDedicatedIpPoolCommand = async ( +export const de_CreateDeliverabilityTestReportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDedicatedIpPoolCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DeliverabilityTestStatus: __expectString, + ReportId: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateDedicatedIpPoolCommandError + * deserializeAws_restJson1CreateEmailIdentityCommand */ -const de_CreateDedicatedIpPoolCommandError = async ( +export const de_CreateEmailIdentityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.sesv2#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.sesv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DkimAttributes: (_) => de_DkimAttributes(_, context), + IdentityType: __expectString, + VerifiedForSendingStatus: __expectBoolean, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateDeliverabilityTestReportCommand + * deserializeAws_restJson1CreateEmailIdentityPolicyCommand */ -export const de_CreateDeliverabilityTestReportCommand = async ( +export const de_CreateEmailIdentityPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateDeliverabilityTestReportCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DeliverabilityTestStatus: __expectString, - ReportId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateDeliverabilityTestReportCommandError + * deserializeAws_restJson1CreateEmailTemplateCommand */ -const de_CreateDeliverabilityTestReportCommandError = async ( +export const de_CreateEmailTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountSuspendedException": - case "com.amazonaws.sesv2#AccountSuspendedException": - throw await de_AccountSuspendedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.sesv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MailFromDomainNotVerifiedException": - case "com.amazonaws.sesv2#MailFromDomainNotVerifiedException": - throw await de_MailFromDomainNotVerifiedExceptionRes(parsedOutput, context); - case "MessageRejected": - case "com.amazonaws.sesv2#MessageRejected": - throw await de_MessageRejectedRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "SendingPausedException": - case "com.amazonaws.sesv2#SendingPausedException": - throw await de_SendingPausedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateEmailIdentityCommand + * deserializeAws_restJson1CreateExportJobCommand */ -export const de_CreateEmailIdentityCommand = async ( +export const de_CreateExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEmailIdentityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DkimAttributes: (_) => de_DkimAttributes(_, context), - IdentityType: __expectString, - VerifiedForSendingStatus: __expectBoolean, + JobId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateEmailIdentityCommandError + * deserializeAws_restJson1CreateImportJobCommand */ -const de_CreateEmailIdentityCommandError = async ( +export const de_CreateImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.sesv2#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.sesv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + JobId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateEmailIdentityPolicyCommand + * deserializeAws_restJson1DeleteConfigurationSetCommand */ -export const de_CreateEmailIdentityPolicyCommand = async ( +export const de_DeleteConfigurationSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEmailIdentityPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2932,52 +2625,31 @@ export const de_CreateEmailIdentityPolicyCommand = async ( }; /** - * deserializeAws_restJson1CreateEmailIdentityPolicyCommandError + * deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommand */ -const de_CreateEmailIdentityPolicyCommandError = async ( +export const de_DeleteConfigurationSetEventDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.sesv2#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateEmailTemplateCommand + * deserializeAws_restJson1DeleteContactCommand */ -export const de_CreateEmailTemplateCommand = async ( +export const de_DeleteContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateEmailTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2987,158 +2659,65 @@ export const de_CreateEmailTemplateCommand = async ( }; /** - * deserializeAws_restJson1CreateEmailTemplateCommandError + * deserializeAws_restJson1DeleteContactListCommand */ -const de_CreateEmailTemplateCommandError = async ( +export const de_DeleteContactListCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.sesv2#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateExportJobCommand + * deserializeAws_restJson1DeleteCustomVerificationEmailTemplateCommand */ -export const de_CreateExportJobCommand = async ( +export const de_DeleteCustomVerificationEmailTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateExportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - JobId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateExportJobCommandError + * deserializeAws_restJson1DeleteDedicatedIpPoolCommand */ -const de_CreateExportJobCommandError = async ( +export const de_DeleteDedicatedIpPoolCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateImportJobCommand - */ -export const de_CreateImportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - JobId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateImportJobCommandError - */ -const de_CreateImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteConfigurationSetCommand + * deserializeAws_restJson1DeleteEmailIdentityCommand */ -export const de_DeleteConfigurationSetCommand = async ( +export const de_DeleteEmailIdentityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConfigurationSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3148,49 +2727,14 @@ export const de_DeleteConfigurationSetCommand = async ( }; /** - * deserializeAws_restJson1DeleteConfigurationSetCommandError - */ -const de_DeleteConfigurationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.sesv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommand + * deserializeAws_restJson1DeleteEmailIdentityPolicyCommand */ -export const de_DeleteConfigurationSetEventDestinationCommand = async ( +export const de_DeleteEmailIdentityPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteConfigurationSetEventDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3200,46 +2744,14 @@ export const de_DeleteConfigurationSetEventDestinationCommand = async ( }; /** - * deserializeAws_restJson1DeleteConfigurationSetEventDestinationCommandError - */ -const de_DeleteConfigurationSetEventDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteContactCommand + * deserializeAws_restJson1DeleteEmailTemplateCommand */ -export const de_DeleteContactCommand = async ( +export const de_DeleteEmailTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3249,46 +2761,14 @@ export const de_DeleteContactCommand = async ( }; /** - * deserializeAws_restJson1DeleteContactCommandError - */ -const de_DeleteContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteContactListCommand + * deserializeAws_restJson1DeleteSuppressedDestinationCommand */ -export const de_DeleteContactListCommand = async ( +export const de_DeleteSuppressedDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteContactListCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3298,2543 +2778,833 @@ export const de_DeleteContactListCommand = async ( }; /** - * deserializeAws_restJson1DeleteContactListCommandError - */ -const de_DeleteContactListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.sesv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteCustomVerificationEmailTemplateCommand + * deserializeAws_restJson1GetAccountCommand */ -export const de_DeleteCustomVerificationEmailTemplateCommand = async ( +export const de_GetAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCustomVerificationEmailTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DedicatedIpAutoWarmupEnabled: __expectBoolean, + Details: _json, + EnforcementStatus: __expectString, + ProductionAccessEnabled: __expectBoolean, + SendQuota: (_) => de_SendQuota(_, context), + SendingEnabled: __expectBoolean, + SuppressionAttributes: _json, + VdmAttributes: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeleteCustomVerificationEmailTemplateCommandError - */ -const de_DeleteCustomVerificationEmailTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDedicatedIpPoolCommand - */ -export const de_DeleteDedicatedIpPoolCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteDedicatedIpPoolCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteDedicatedIpPoolCommandError - */ -const de_DeleteDedicatedIpPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.sesv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteEmailIdentityCommand - */ -export const de_DeleteEmailIdentityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEmailIdentityCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteEmailIdentityCommandError - */ -const de_DeleteEmailIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.sesv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteEmailIdentityPolicyCommand - */ -export const de_DeleteEmailIdentityPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEmailIdentityPolicyCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteEmailIdentityPolicyCommandError - */ -const de_DeleteEmailIdentityPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteEmailTemplateCommand - */ -export const de_DeleteEmailTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteEmailTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteEmailTemplateCommandError - */ -const de_DeleteEmailTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteSuppressedDestinationCommand - */ -export const de_DeleteSuppressedDestinationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSuppressedDestinationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteSuppressedDestinationCommandError - */ -const de_DeleteSuppressedDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAccountCommand - */ -export const de_GetAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccountCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DedicatedIpAutoWarmupEnabled: __expectBoolean, - Details: _json, - EnforcementStatus: __expectString, - ProductionAccessEnabled: __expectBoolean, - SendQuota: (_) => de_SendQuota(_, context), - SendingEnabled: __expectBoolean, - SuppressionAttributes: _json, - VdmAttributes: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAccountCommandError - */ -const de_GetAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetBlacklistReportsCommand - */ -export const de_GetBlacklistReportsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBlacklistReportsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BlacklistReport: (_) => de_BlacklistReport(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetBlacklistReportsCommandError - */ -const de_GetBlacklistReportsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetConfigurationSetCommand - */ -export const de_GetConfigurationSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfigurationSetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ConfigurationSetName: __expectString, - DeliveryOptions: _json, - ReputationOptions: (_) => de_ReputationOptions(_, context), - SendingOptions: _json, - SuppressionOptions: _json, - Tags: _json, - TrackingOptions: _json, - VdmOptions: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetConfigurationSetCommandError - */ -const de_GetConfigurationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetConfigurationSetEventDestinationsCommand - */ -export const de_GetConfigurationSetEventDestinationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConfigurationSetEventDestinationsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - EventDestinations: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetConfigurationSetEventDestinationsCommandError - */ -const de_GetConfigurationSetEventDestinationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetContactCommand - */ -export const de_GetContactCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetContactCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AttributesData: __expectString, - ContactListName: __expectString, - CreatedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - EmailAddress: __expectString, - LastUpdatedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - TopicDefaultPreferences: _json, - TopicPreferences: _json, - UnsubscribeAll: __expectBoolean, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetContactCommandError - */ -const de_GetContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetContactListCommand - */ -export const de_GetContactListCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetContactListCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ContactListName: __expectString, - CreatedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - Description: __expectString, - LastUpdatedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - Tags: _json, - Topics: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetContactListCommandError - */ -const de_GetContactListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetCustomVerificationEmailTemplateCommand - */ -export const de_GetCustomVerificationEmailTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCustomVerificationEmailTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - FailureRedirectionURL: __expectString, - FromEmailAddress: __expectString, - SuccessRedirectionURL: __expectString, - TemplateContent: __expectString, - TemplateName: __expectString, - TemplateSubject: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetCustomVerificationEmailTemplateCommandError - */ -const de_GetCustomVerificationEmailTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDedicatedIpCommand - */ -export const de_GetDedicatedIpCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDedicatedIpCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DedicatedIp: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDedicatedIpCommandError - */ -const de_GetDedicatedIpCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDedicatedIpPoolCommand - */ -export const de_GetDedicatedIpPoolCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDedicatedIpPoolCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DedicatedIpPool: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDedicatedIpPoolCommandError - */ -const de_GetDedicatedIpPoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDedicatedIpsCommand - */ -export const de_GetDedicatedIpsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDedicatedIpsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DedicatedIps: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDedicatedIpsCommandError - */ -const de_GetDedicatedIpsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDeliverabilityDashboardOptionsCommand - */ -export const de_GetDeliverabilityDashboardOptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeliverabilityDashboardOptionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AccountStatus: __expectString, - ActiveSubscribedDomains: (_) => de_DomainDeliverabilityTrackingOptions(_, context), - DashboardEnabled: __expectBoolean, - PendingExpirationSubscribedDomains: (_) => de_DomainDeliverabilityTrackingOptions(_, context), - SubscriptionExpiryDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDeliverabilityDashboardOptionsCommandError - */ -const de_GetDeliverabilityDashboardOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDeliverabilityTestReportCommand - */ -export const de_GetDeliverabilityTestReportCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeliverabilityTestReportCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DeliverabilityTestReport: (_) => de_DeliverabilityTestReport(_, context), - IspPlacements: (_) => de_IspPlacements(_, context), - Message: __expectString, - OverallPlacement: (_) => de_PlacementStatistics(_, context), - Tags: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDeliverabilityTestReportCommandError - */ -const de_GetDeliverabilityTestReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDomainDeliverabilityCampaignCommand - */ -export const de_GetDomainDeliverabilityCampaignCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDomainDeliverabilityCampaignCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DomainDeliverabilityCampaign: (_) => de_DomainDeliverabilityCampaign(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDomainDeliverabilityCampaignCommandError - */ -const de_GetDomainDeliverabilityCampaignCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetDomainStatisticsReportCommand - */ -export const de_GetDomainStatisticsReportCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDomainStatisticsReportCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - DailyVolumes: (_) => de_DailyVolumes(_, context), - OverallVolume: (_) => de_OverallVolume(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetDomainStatisticsReportCommandError - */ -const de_GetDomainStatisticsReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEmailIdentityCommand - */ -export const de_GetEmailIdentityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEmailIdentityCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ConfigurationSetName: __expectString, - DkimAttributes: (_) => de_DkimAttributes(_, context), - FeedbackForwardingStatus: __expectBoolean, - IdentityType: __expectString, - MailFromAttributes: _json, - Policies: _json, - Tags: _json, - VerificationInfo: (_) => de_VerificationInfo(_, context), - VerificationStatus: __expectString, - VerifiedForSendingStatus: __expectBoolean, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEmailIdentityCommandError - */ -const de_GetEmailIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEmailIdentityPoliciesCommand - */ -export const de_GetEmailIdentityPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEmailIdentityPoliciesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Policies: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEmailIdentityPoliciesCommandError - */ -const de_GetEmailIdentityPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetEmailTemplateCommand - */ -export const de_GetEmailTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEmailTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - TemplateContent: _json, - TemplateName: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetEmailTemplateCommandError - */ -const de_GetEmailTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetExportJobCommand - */ -export const de_GetExportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetExportJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CompletedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - CreatedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - ExportDataSource: (_) => de_ExportDataSource(_, context), - ExportDestination: _json, - ExportSourceType: __expectString, - FailureInfo: _json, - JobId: __expectString, - JobStatus: __expectString, - Statistics: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetExportJobCommandError - */ -const de_GetExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetImportJobCommand - */ -export const de_GetImportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImportJobCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CompletedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - CreatedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), - FailedRecordsCount: __expectInt32, - FailureInfo: _json, - ImportDataSource: _json, - ImportDestination: _json, - JobId: __expectString, - JobStatus: __expectString, - ProcessedRecordsCount: __expectInt32, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetImportJobCommandError - */ -const de_GetImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMessageInsightsCommand - */ -export const de_GetMessageInsightsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMessageInsightsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - EmailTags: _json, - FromEmailAddress: __expectString, - Insights: (_) => de_EmailInsightsList(_, context), - MessageId: __expectString, - Subject: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMessageInsightsCommandError - */ -const de_GetMessageInsightsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetSuppressedDestinationCommand - */ -export const de_GetSuppressedDestinationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSuppressedDestinationCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - SuppressedDestination: (_) => de_SuppressedDestination(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSuppressedDestinationCommandError - */ -const de_GetSuppressedDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListConfigurationSetsCommand - */ -export const de_ListConfigurationSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListConfigurationSetsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ConfigurationSets: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListConfigurationSetsCommandError - */ -const de_ListConfigurationSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListContactListsCommand + * deserializeAws_restJson1GetBlacklistReportsCommand */ -export const de_ListContactListsCommand = async ( +export const de_GetBlacklistReportsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListContactListsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ContactLists: (_) => de_ListOfContactLists(_, context), - NextToken: __expectString, + BlacklistReport: (_) => de_BlacklistReport(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListContactListsCommandError - */ -const de_ListContactListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListContactsCommand + * deserializeAws_restJson1GetConfigurationSetCommand */ -export const de_ListContactsCommand = async ( +export const de_GetConfigurationSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListContactsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Contacts: (_) => de_ListOfContacts(_, context), - NextToken: __expectString, + ConfigurationSetName: __expectString, + DeliveryOptions: _json, + ReputationOptions: (_) => de_ReputationOptions(_, context), + SendingOptions: _json, + SuppressionOptions: _json, + Tags: _json, + TrackingOptions: _json, + VdmOptions: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListContactsCommandError - */ -const de_ListContactsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListCustomVerificationEmailTemplatesCommand + * deserializeAws_restJson1GetConfigurationSetEventDestinationsCommand */ -export const de_ListCustomVerificationEmailTemplatesCommand = async ( +export const de_GetConfigurationSetEventDestinationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCustomVerificationEmailTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CustomVerificationEmailTemplates: _json, - NextToken: __expectString, + EventDestinations: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListCustomVerificationEmailTemplatesCommandError - */ -const de_ListCustomVerificationEmailTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDedicatedIpPoolsCommand + * deserializeAws_restJson1GetContactCommand */ -export const de_ListDedicatedIpPoolsCommand = async ( +export const de_GetContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDedicatedIpPoolsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DedicatedIpPools: _json, - NextToken: __expectString, + AttributesData: __expectString, + ContactListName: __expectString, + CreatedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + EmailAddress: __expectString, + LastUpdatedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + TopicDefaultPreferences: _json, + TopicPreferences: _json, + UnsubscribeAll: __expectBoolean, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListDedicatedIpPoolsCommandError + * deserializeAws_restJson1GetContactListCommand */ -const de_ListDedicatedIpPoolsCommandError = async ( +export const de_GetContactListCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ContactListName: __expectString, + CreatedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Description: __expectString, + LastUpdatedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + Tags: _json, + Topics: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListDeliverabilityTestReportsCommand + * deserializeAws_restJson1GetCustomVerificationEmailTemplateCommand */ -export const de_ListDeliverabilityTestReportsCommand = async ( +export const de_GetCustomVerificationEmailTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeliverabilityTestReportsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DeliverabilityTestReports: (_) => de_DeliverabilityTestReports(_, context), - NextToken: __expectString, + FailureRedirectionURL: __expectString, + FromEmailAddress: __expectString, + SuccessRedirectionURL: __expectString, + TemplateContent: __expectString, + TemplateName: __expectString, + TemplateSubject: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListDeliverabilityTestReportsCommandError + * deserializeAws_restJson1GetDedicatedIpCommand */ -const de_ListDeliverabilityTestReportsCommandError = async ( +export const de_GetDedicatedIpCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DedicatedIp: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListDomainDeliverabilityCampaignsCommand + * deserializeAws_restJson1GetDedicatedIpPoolCommand */ -export const de_ListDomainDeliverabilityCampaignsCommand = async ( +export const de_GetDedicatedIpPoolCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDomainDeliverabilityCampaignsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DomainDeliverabilityCampaigns: (_) => de_DomainDeliverabilityCampaignList(_, context), - NextToken: __expectString, + DedicatedIpPool: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListDomainDeliverabilityCampaignsCommandError + * deserializeAws_restJson1GetDedicatedIpsCommand */ -const de_ListDomainDeliverabilityCampaignsCommandError = async ( +export const de_GetDedicatedIpsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DedicatedIps: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListEmailIdentitiesCommand + * deserializeAws_restJson1GetDeliverabilityDashboardOptionsCommand */ -export const de_ListEmailIdentitiesCommand = async ( +export const de_GetDeliverabilityDashboardOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEmailIdentitiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - EmailIdentities: _json, - NextToken: __expectString, + AccountStatus: __expectString, + ActiveSubscribedDomains: (_) => de_DomainDeliverabilityTrackingOptions(_, context), + DashboardEnabled: __expectBoolean, + PendingExpirationSubscribedDomains: (_) => de_DomainDeliverabilityTrackingOptions(_, context), + SubscriptionExpiryDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListEmailIdentitiesCommandError + * deserializeAws_restJson1GetDeliverabilityTestReportCommand */ -const de_ListEmailIdentitiesCommandError = async ( +export const de_GetDeliverabilityTestReportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DeliverabilityTestReport: (_) => de_DeliverabilityTestReport(_, context), + IspPlacements: (_) => de_IspPlacements(_, context), + Message: __expectString, + OverallPlacement: (_) => de_PlacementStatistics(_, context), + Tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListEmailTemplatesCommand + * deserializeAws_restJson1GetDomainDeliverabilityCampaignCommand */ -export const de_ListEmailTemplatesCommand = async ( +export const de_GetDomainDeliverabilityCampaignCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEmailTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - TemplatesMetadata: (_) => de_EmailTemplateMetadataList(_, context), + DomainDeliverabilityCampaign: (_) => de_DomainDeliverabilityCampaign(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListEmailTemplatesCommandError + * deserializeAws_restJson1GetDomainStatisticsReportCommand */ -const de_ListEmailTemplatesCommandError = async ( +export const de_GetDomainStatisticsReportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DailyVolumes: (_) => de_DailyVolumes(_, context), + OverallVolume: (_) => de_OverallVolume(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListExportJobsCommand + * deserializeAws_restJson1GetEmailIdentityCommand */ -export const de_ListExportJobsCommand = async ( +export const de_GetEmailIdentityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListExportJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ExportJobs: (_) => de_ExportJobSummaryList(_, context), - NextToken: __expectString, + ConfigurationSetName: __expectString, + DkimAttributes: (_) => de_DkimAttributes(_, context), + FeedbackForwardingStatus: __expectBoolean, + IdentityType: __expectString, + MailFromAttributes: _json, + Policies: _json, + Tags: _json, + VerificationInfo: (_) => de_VerificationInfo(_, context), + VerificationStatus: __expectString, + VerifiedForSendingStatus: __expectBoolean, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListExportJobsCommandError + * deserializeAws_restJson1GetEmailIdentityPoliciesCommand */ -const de_ListExportJobsCommandError = async ( +export const de_GetEmailIdentityPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Policies: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListImportJobsCommand + * deserializeAws_restJson1GetEmailTemplateCommand */ -export const de_ListImportJobsCommand = async ( +export const de_GetEmailTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImportJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ImportJobs: (_) => de_ImportJobSummaryList(_, context), - NextToken: __expectString, + TemplateContent: _json, + TemplateName: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListImportJobsCommandError + * deserializeAws_restJson1GetExportJobCommand */ -const de_ListImportJobsCommandError = async ( +export const de_GetExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CompletedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + CreatedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + ExportDataSource: (_) => de_ExportDataSource(_, context), + ExportDestination: _json, + ExportSourceType: __expectString, + FailureInfo: _json, + JobId: __expectString, + JobStatus: __expectString, + Statistics: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRecommendationsCommand + * deserializeAws_restJson1GetImportJobCommand */ -export const de_ListRecommendationsCommand = async ( +export const de_GetImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - Recommendations: (_) => de_RecommendationsList(_, context), + CompletedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + CreatedTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + FailedRecordsCount: __expectInt32, + FailureInfo: _json, + ImportDataSource: _json, + ImportDestination: _json, + JobId: __expectString, + JobStatus: __expectString, + ProcessedRecordsCount: __expectInt32, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListRecommendationsCommandError + * deserializeAws_restJson1GetMessageInsightsCommand */ -const de_ListRecommendationsCommandError = async ( +export const de_GetMessageInsightsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EmailTags: _json, + FromEmailAddress: __expectString, + Insights: (_) => de_EmailInsightsList(_, context), + MessageId: __expectString, + Subject: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListSuppressedDestinationsCommand + * deserializeAws_restJson1GetSuppressedDestinationCommand */ -export const de_ListSuppressedDestinationsCommand = async ( +export const de_GetSuppressedDestinationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSuppressedDestinationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - SuppressedDestinationSummaries: (_) => de_SuppressedDestinationSummaries(_, context), + SuppressedDestination: (_) => de_SuppressedDestination(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSuppressedDestinationsCommandError - */ -const de_ListSuppressedDestinationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.sesv2#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListConfigurationSetsCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListConfigurationSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: _json, + ConfigurationSets: _json, + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListContactListsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListContactListsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ContactLists: (_) => de_ListOfContactLists(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommand + * deserializeAws_restJson1ListContactsCommand */ -export const de_PutAccountDedicatedIpWarmupAttributesCommand = async ( +export const de_ListContactsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAccountDedicatedIpWarmupAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Contacts: (_) => de_ListOfContacts(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommandError + * deserializeAws_restJson1ListCustomVerificationEmailTemplatesCommand */ -const de_PutAccountDedicatedIpWarmupAttributesCommandError = async ( +export const de_ListCustomVerificationEmailTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CustomVerificationEmailTemplates: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutAccountDetailsCommand + * deserializeAws_restJson1ListDedicatedIpPoolsCommand */ -export const de_PutAccountDetailsCommand = async ( +export const de_ListDedicatedIpPoolsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAccountDetailsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DedicatedIpPools: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutAccountDetailsCommandError + * deserializeAws_restJson1ListDeliverabilityTestReportsCommand */ -const de_PutAccountDetailsCommandError = async ( +export const de_ListDeliverabilityTestReportsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.sesv2#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DeliverabilityTestReports: (_) => de_DeliverabilityTestReports(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutAccountSendingAttributesCommand + * deserializeAws_restJson1ListDomainDeliverabilityCampaignsCommand */ -export const de_PutAccountSendingAttributesCommand = async ( +export const de_ListDomainDeliverabilityCampaignsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAccountSendingAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DomainDeliverabilityCampaigns: (_) => de_DomainDeliverabilityCampaignList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutAccountSendingAttributesCommandError + * deserializeAws_restJson1ListEmailIdentitiesCommand */ -const de_PutAccountSendingAttributesCommandError = async ( +export const de_ListEmailIdentitiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + EmailIdentities: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutAccountSuppressionAttributesCommand + * deserializeAws_restJson1ListEmailTemplatesCommand */ -export const de_PutAccountSuppressionAttributesCommand = async ( +export const de_ListEmailTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAccountSuppressionAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + TemplatesMetadata: (_) => de_EmailTemplateMetadataList(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutAccountSuppressionAttributesCommandError + * deserializeAws_restJson1ListExportJobsCommand */ -const de_PutAccountSuppressionAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_ListExportJobsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ExportJobs: (_) => de_ExportJobSummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutAccountVdmAttributesCommand + * deserializeAws_restJson1ListImportJobsCommand */ -export const de_PutAccountVdmAttributesCommand = async ( +export const de_ListImportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAccountVdmAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ImportJobs: (_) => de_ImportJobSummaryList(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutAccountVdmAttributesCommandError + * deserializeAws_restJson1ListRecommendationsCommand */ -const de_PutAccountVdmAttributesCommandError = async ( +export const de_ListRecommendationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + Recommendations: (_) => de_RecommendationsList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutConfigurationSetDeliveryOptionsCommand + * deserializeAws_restJson1ListSuppressedDestinationsCommand */ -export const de_PutConfigurationSetDeliveryOptionsCommand = async ( +export const de_ListSuppressedDestinationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutConfigurationSetDeliveryOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + SuppressedDestinationSummaries: (_) => de_SuppressedDestinationSummaries(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1PutConfigurationSetDeliveryOptionsCommandError + * deserializeAws_restJson1ListTagsForResourceCommand */ -const de_PutConfigurationSetDeliveryOptionsCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Tags: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1PutConfigurationSetReputationOptionsCommand + * deserializeAws_restJson1PutAccountDedicatedIpWarmupAttributesCommand */ -export const de_PutConfigurationSetReputationOptionsCommand = async ( +export const de_PutAccountDedicatedIpWarmupAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutConfigurationSetReputationOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5844,46 +3614,31 @@ export const de_PutConfigurationSetReputationOptionsCommand = async ( }; /** - * deserializeAws_restJson1PutConfigurationSetReputationOptionsCommandError + * deserializeAws_restJson1PutAccountDetailsCommand */ -const de_PutConfigurationSetReputationOptionsCommandError = async ( +export const de_PutAccountDetailsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1PutConfigurationSetSendingOptionsCommand + * deserializeAws_restJson1PutAccountSendingAttributesCommand */ -export const de_PutConfigurationSetSendingOptionsCommand = async ( +export const de_PutAccountSendingAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutConfigurationSetSendingOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5893,46 +3648,31 @@ export const de_PutConfigurationSetSendingOptionsCommand = async ( }; /** - * deserializeAws_restJson1PutConfigurationSetSendingOptionsCommandError + * deserializeAws_restJson1PutAccountSuppressionAttributesCommand */ -const de_PutConfigurationSetSendingOptionsCommandError = async ( +export const de_PutAccountSuppressionAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1PutConfigurationSetSuppressionOptionsCommand + * deserializeAws_restJson1PutAccountVdmAttributesCommand */ -export const de_PutConfigurationSetSuppressionOptionsCommand = async ( +export const de_PutAccountVdmAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutConfigurationSetSuppressionOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5942,46 +3682,31 @@ export const de_PutConfigurationSetSuppressionOptionsCommand = async ( }; /** - * deserializeAws_restJson1PutConfigurationSetSuppressionOptionsCommandError + * deserializeAws_restJson1PutConfigurationSetDeliveryOptionsCommand */ -const de_PutConfigurationSetSuppressionOptionsCommandError = async ( +export const de_PutConfigurationSetDeliveryOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1PutConfigurationSetTrackingOptionsCommand + * deserializeAws_restJson1PutConfigurationSetReputationOptionsCommand */ -export const de_PutConfigurationSetTrackingOptionsCommand = async ( +export const de_PutConfigurationSetReputationOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutConfigurationSetTrackingOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5991,46 +3716,31 @@ export const de_PutConfigurationSetTrackingOptionsCommand = async ( }; /** - * deserializeAws_restJson1PutConfigurationSetTrackingOptionsCommandError + * deserializeAws_restJson1PutConfigurationSetSendingOptionsCommand */ -const de_PutConfigurationSetTrackingOptionsCommandError = async ( +export const de_PutConfigurationSetSendingOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1PutConfigurationSetVdmOptionsCommand + * deserializeAws_restJson1PutConfigurationSetSuppressionOptionsCommand */ -export const de_PutConfigurationSetVdmOptionsCommand = async ( +export const de_PutConfigurationSetSuppressionOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutConfigurationSetVdmOptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6040,46 +3750,31 @@ export const de_PutConfigurationSetVdmOptionsCommand = async ( }; /** - * deserializeAws_restJson1PutConfigurationSetVdmOptionsCommandError + * deserializeAws_restJson1PutConfigurationSetTrackingOptionsCommand */ -const de_PutConfigurationSetVdmOptionsCommandError = async ( +export const de_PutConfigurationSetTrackingOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1PutDedicatedIpInPoolCommand + * deserializeAws_restJson1PutConfigurationSetVdmOptionsCommand */ -export const de_PutDedicatedIpInPoolCommand = async ( +export const de_PutConfigurationSetVdmOptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutDedicatedIpInPoolCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6089,35 +3784,20 @@ export const de_PutDedicatedIpInPoolCommand = async ( }; /** - * deserializeAws_restJson1PutDedicatedIpInPoolCommandError + * deserializeAws_restJson1PutDedicatedIpInPoolCommand */ -const de_PutDedicatedIpInPoolCommandError = async ( +export const de_PutDedicatedIpInPoolCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -6128,7 +3808,7 @@ export const de_PutDedicatedIpPoolScalingAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutDedicatedIpPoolScalingAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6137,41 +3817,6 @@ export const de_PutDedicatedIpPoolScalingAttributesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutDedicatedIpPoolScalingAttributesCommandError - */ -const de_PutDedicatedIpPoolScalingAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.sesv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutDedicatedIpWarmupAttributesCommand */ @@ -6180,7 +3825,7 @@ export const de_PutDedicatedIpWarmupAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutDedicatedIpWarmupAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6189,38 +3834,6 @@ export const de_PutDedicatedIpWarmupAttributesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutDedicatedIpWarmupAttributesCommandError - */ -const de_PutDedicatedIpWarmupAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutDeliverabilityDashboardOptionCommand */ @@ -6229,7 +3842,7 @@ export const de_PutDeliverabilityDashboardOptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutDeliverabilityDashboardOptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6238,44 +3851,6 @@ export const de_PutDeliverabilityDashboardOptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutDeliverabilityDashboardOptionCommandError - */ -const de_PutDeliverabilityDashboardOptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.sesv2#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutEmailIdentityConfigurationSetAttributesCommand */ @@ -6284,7 +3859,7 @@ export const de_PutEmailIdentityConfigurationSetAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutEmailIdentityConfigurationSetAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6293,38 +3868,6 @@ export const de_PutEmailIdentityConfigurationSetAttributesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutEmailIdentityConfigurationSetAttributesCommandError - */ -const de_PutEmailIdentityConfigurationSetAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutEmailIdentityDkimAttributesCommand */ @@ -6333,7 +3876,7 @@ export const de_PutEmailIdentityDkimAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutEmailIdentityDkimAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6342,38 +3885,6 @@ export const de_PutEmailIdentityDkimAttributesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutEmailIdentityDkimAttributesCommandError - */ -const de_PutEmailIdentityDkimAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutEmailIdentityDkimSigningAttributesCommand */ @@ -6382,7 +3893,7 @@ export const de_PutEmailIdentityDkimSigningAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutEmailIdentityDkimSigningAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6396,38 +3907,6 @@ export const de_PutEmailIdentityDkimSigningAttributesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutEmailIdentityDkimSigningAttributesCommandError - */ -const de_PutEmailIdentityDkimSigningAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutEmailIdentityFeedbackAttributesCommand */ @@ -6436,7 +3915,7 @@ export const de_PutEmailIdentityFeedbackAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutEmailIdentityFeedbackAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6445,38 +3924,6 @@ export const de_PutEmailIdentityFeedbackAttributesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutEmailIdentityFeedbackAttributesCommandError - */ -const de_PutEmailIdentityFeedbackAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutEmailIdentityMailFromAttributesCommand */ @@ -6485,7 +3932,7 @@ export const de_PutEmailIdentityMailFromAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutEmailIdentityMailFromAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6494,38 +3941,6 @@ export const de_PutEmailIdentityMailFromAttributesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutEmailIdentityMailFromAttributesCommandError - */ -const de_PutEmailIdentityMailFromAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutSuppressedDestinationCommand */ @@ -6534,7 +3949,7 @@ export const de_PutSuppressedDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutSuppressedDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6543,35 +3958,6 @@ export const de_PutSuppressedDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutSuppressedDestinationCommandError - */ -const de_PutSuppressedDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SendBulkEmailCommand */ @@ -6580,7 +3966,7 @@ export const de_SendBulkEmailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendBulkEmailCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6593,53 +3979,6 @@ export const de_SendBulkEmailCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SendBulkEmailCommandError - */ -const de_SendBulkEmailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountSuspendedException": - case "com.amazonaws.sesv2#AccountSuspendedException": - throw await de_AccountSuspendedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MailFromDomainNotVerifiedException": - case "com.amazonaws.sesv2#MailFromDomainNotVerifiedException": - throw await de_MailFromDomainNotVerifiedExceptionRes(parsedOutput, context); - case "MessageRejected": - case "com.amazonaws.sesv2#MessageRejected": - throw await de_MessageRejectedRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "SendingPausedException": - case "com.amazonaws.sesv2#SendingPausedException": - throw await de_SendingPausedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SendCustomVerificationEmailCommand */ @@ -6648,7 +3987,7 @@ export const de_SendCustomVerificationEmailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendCustomVerificationEmailCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6661,50 +4000,6 @@ export const de_SendCustomVerificationEmailCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SendCustomVerificationEmailCommandError - */ -const de_SendCustomVerificationEmailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MailFromDomainNotVerifiedException": - case "com.amazonaws.sesv2#MailFromDomainNotVerifiedException": - throw await de_MailFromDomainNotVerifiedExceptionRes(parsedOutput, context); - case "MessageRejected": - case "com.amazonaws.sesv2#MessageRejected": - throw await de_MessageRejectedRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "SendingPausedException": - case "com.amazonaws.sesv2#SendingPausedException": - throw await de_SendingPausedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SendEmailCommand */ @@ -6713,7 +4008,7 @@ export const de_SendEmailCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SendEmailCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6726,103 +4021,21 @@ export const de_SendEmailCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SendEmailCommandError - */ -const de_SendEmailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccountSuspendedException": - case "com.amazonaws.sesv2#AccountSuspendedException": - throw await de_AccountSuspendedExceptionRes(parsedOutput, context); - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.sesv2#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MailFromDomainNotVerifiedException": - case "com.amazonaws.sesv2#MailFromDomainNotVerifiedException": - throw await de_MailFromDomainNotVerifiedExceptionRes(parsedOutput, context); - case "MessageRejected": - case "com.amazonaws.sesv2#MessageRejected": - throw await de_MessageRejectedRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "SendingPausedException": - case "com.amazonaws.sesv2#SendingPausedException": - throw await de_SendingPausedExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.sesv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + */ +export const de_TagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -6833,7 +4046,7 @@ export const de_TestRenderEmailTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TestRenderEmailTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6846,38 +4059,6 @@ export const de_TestRenderEmailTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TestRenderEmailTemplateCommandError - */ -const de_TestRenderEmailTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -6886,7 +4067,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6895,41 +4076,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.sesv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommand */ @@ -6938,7 +4084,7 @@ export const de_UpdateConfigurationSetEventDestinationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateConfigurationSetEventDestinationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6947,38 +4093,6 @@ export const de_UpdateConfigurationSetEventDestinationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateConfigurationSetEventDestinationCommandError - */ -const de_UpdateConfigurationSetEventDestinationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateContactCommand */ @@ -6987,7 +4101,7 @@ export const de_UpdateContactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateContactCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6996,41 +4110,6 @@ export const de_UpdateContactCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateContactCommandError - */ -const de_UpdateContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.sesv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateContactListCommand */ @@ -7039,7 +4118,7 @@ export const de_UpdateContactListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateContactListCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7048,41 +4127,6 @@ export const de_UpdateContactListCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateContactListCommandError - */ -const de_UpdateContactListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConcurrentModificationException": - case "com.amazonaws.sesv2#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateCustomVerificationEmailTemplateCommand */ @@ -7091,7 +4135,7 @@ export const de_UpdateCustomVerificationEmailTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCustomVerificationEmailTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7100,38 +4144,6 @@ export const de_UpdateCustomVerificationEmailTemplateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateCustomVerificationEmailTemplateCommandError - */ -const de_UpdateCustomVerificationEmailTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEmailIdentityPolicyCommand */ @@ -7140,7 +4152,7 @@ export const de_UpdateEmailIdentityPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEmailIdentityPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7149,38 +4161,6 @@ export const de_UpdateEmailIdentityPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEmailIdentityPolicyCommandError - */ -const de_UpdateEmailIdentityPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.sesv2#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.sesv2#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sesv2#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEmailTemplateCommand */ @@ -7189,7 +4169,7 @@ export const de_UpdateEmailTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEmailTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -7199,12 +4179,9 @@ export const de_UpdateEmailTemplateCommand = async ( }; /** - * deserializeAws_restJson1UpdateEmailTemplateCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateEmailTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -7214,19 +4191,49 @@ const de_UpdateEmailTemplateCommandError = async ( case "BadRequestException": case "com.amazonaws.sesv2#BadRequestException": throw await de_BadRequestExceptionRes(parsedOutput, context); + case "InternalServiceErrorException": + case "com.amazonaws.sesv2#InternalServiceErrorException": + throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); case "NotFoundException": case "com.amazonaws.sesv2#NotFoundException": throw await de_NotFoundExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.sesv2#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "AlreadyExistsException": + case "com.amazonaws.sesv2#AlreadyExistsException": + throw await de_AlreadyExistsExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.sesv2#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.sesv2#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "AccountSuspendedException": + case "com.amazonaws.sesv2#AccountSuspendedException": + throw await de_AccountSuspendedExceptionRes(parsedOutput, context); + case "MailFromDomainNotVerifiedException": + case "com.amazonaws.sesv2#MailFromDomainNotVerifiedException": + throw await de_MailFromDomainNotVerifiedExceptionRes(parsedOutput, context); + case "MessageRejected": + case "com.amazonaws.sesv2#MessageRejected": + throw await de_MessageRejectedRes(parsedOutput, context); + case "SendingPausedException": + case "com.amazonaws.sesv2#SendingPausedException": + throw await de_SendingPausedExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.sesv2#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.sesv2#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-sfn/src/protocols/Aws_json1_0.ts b/clients/client-sfn/src/protocols/Aws_json1_0.ts index 31456d47ee19..6fe17685a008 100644 --- a/clients/client-sfn/src/protocols/Aws_json1_0.ts +++ b/clients/client-sfn/src/protocols/Aws_json1_0.ts @@ -693,7 +693,7 @@ export const de_CreateActivityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateActivityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -705,38 +705,6 @@ export const de_CreateActivityCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateActivityCommandError - */ -const de_CreateActivityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActivityLimitExceeded": - case "com.amazonaws.sfn#ActivityLimitExceeded": - throw await de_ActivityLimitExceededRes(parsedOutput, context); - case "InvalidName": - case "com.amazonaws.sfn#InvalidName": - throw await de_InvalidNameRes(parsedOutput, context); - case "TooManyTags": - case "com.amazonaws.sfn#TooManyTags": - throw await de_TooManyTagsRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateStateMachineCommand */ @@ -745,7 +713,7 @@ export const de_CreateStateMachineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateStateMachineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -757,65 +725,6 @@ export const de_CreateStateMachineCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateStateMachineCommandError - */ -const de_CreateStateMachineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sfn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "InvalidDefinition": - case "com.amazonaws.sfn#InvalidDefinition": - throw await de_InvalidDefinitionRes(parsedOutput, context); - case "InvalidLoggingConfiguration": - case "com.amazonaws.sfn#InvalidLoggingConfiguration": - throw await de_InvalidLoggingConfigurationRes(parsedOutput, context); - case "InvalidName": - case "com.amazonaws.sfn#InvalidName": - throw await de_InvalidNameRes(parsedOutput, context); - case "InvalidTracingConfiguration": - case "com.amazonaws.sfn#InvalidTracingConfiguration": - throw await de_InvalidTracingConfigurationRes(parsedOutput, context); - case "StateMachineAlreadyExists": - case "com.amazonaws.sfn#StateMachineAlreadyExists": - throw await de_StateMachineAlreadyExistsRes(parsedOutput, context); - case "StateMachineDeleting": - case "com.amazonaws.sfn#StateMachineDeleting": - throw await de_StateMachineDeletingRes(parsedOutput, context); - case "StateMachineLimitExceeded": - case "com.amazonaws.sfn#StateMachineLimitExceeded": - throw await de_StateMachineLimitExceededRes(parsedOutput, context); - case "StateMachineTypeNotSupported": - case "com.amazonaws.sfn#StateMachineTypeNotSupported": - throw await de_StateMachineTypeNotSupportedRes(parsedOutput, context); - case "TooManyTags": - case "com.amazonaws.sfn#TooManyTags": - throw await de_TooManyTagsRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sfn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateStateMachineAliasCommand */ @@ -824,7 +733,7 @@ export const de_CreateStateMachineAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateStateMachineAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -836,50 +745,6 @@ export const de_CreateStateMachineAliasCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateStateMachineAliasCommandError - */ -const de_CreateStateMachineAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sfn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "InvalidName": - case "com.amazonaws.sfn#InvalidName": - throw await de_InvalidNameRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sfn#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.sfn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "StateMachineDeleting": - case "com.amazonaws.sfn#StateMachineDeleting": - throw await de_StateMachineDeletingRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sfn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteActivityCommand */ @@ -888,7 +753,7 @@ export const de_DeleteActivityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteActivityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -900,32 +765,6 @@ export const de_DeleteActivityCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteActivityCommandError - */ -const de_DeleteActivityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteStateMachineCommand */ @@ -934,7 +773,7 @@ export const de_DeleteStateMachineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteStateMachineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -946,35 +785,6 @@ export const de_DeleteStateMachineCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteStateMachineCommandError - */ -const de_DeleteStateMachineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sfn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteStateMachineAliasCommand */ @@ -983,7 +793,7 @@ export const de_DeleteStateMachineAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteStateMachineAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -995,41 +805,6 @@ export const de_DeleteStateMachineAliasCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteStateMachineAliasCommandError - */ -const de_DeleteStateMachineAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sfn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sfn#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sfn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteStateMachineVersionCommand */ @@ -1038,7 +813,7 @@ export const de_DeleteStateMachineVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteStateMachineVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1051,51 +826,39 @@ export const de_DeleteStateMachineVersionCommand = async ( }; /** - * deserializeAws_json1_0DeleteStateMachineVersionCommandError + * deserializeAws_json1_0DescribeActivityCommand */ -const de_DeleteStateMachineVersionCommandError = async ( +export const de_DescribeActivityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sfn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sfn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeActivityOutput(data, context); + const response: DescribeActivityCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DescribeActivityCommand + * deserializeAws_json1_0DescribeExecutionCommand */ -export const de_DescribeActivityCommand = async ( +export const de_DescribeExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeActivityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeActivityOutput(data, context); - const response: DescribeActivityCommandOutput = { + contents = de_DescribeExecutionOutput(data, context); + const response: DescribeExecutionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1103,92 +866,14 @@ export const de_DescribeActivityCommand = async ( }; /** - * deserializeAws_json1_0DescribeActivityCommandError + * deserializeAws_json1_0DescribeMapRunCommand */ -const de_DescribeActivityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActivityDoesNotExist": - case "com.amazonaws.sfn#ActivityDoesNotExist": - throw await de_ActivityDoesNotExistRes(parsedOutput, context); - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeExecutionCommand - */ -export const de_DescribeExecutionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeExecutionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeExecutionOutput(data, context); - const response: DescribeExecutionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeExecutionCommandError - */ -const de_DescribeExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExecutionDoesNotExist": - case "com.amazonaws.sfn#ExecutionDoesNotExist": - throw await de_ExecutionDoesNotExistRes(parsedOutput, context); - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeMapRunCommand - */ -export const de_DescribeMapRunCommand = async ( +export const de_DescribeMapRunCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeMapRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1200,35 +885,6 @@ export const de_DescribeMapRunCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeMapRunCommandError - */ -const de_DescribeMapRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sfn#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeStateMachineCommand */ @@ -1237,7 +893,7 @@ export const de_DescribeStateMachineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStateMachineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1249,35 +905,6 @@ export const de_DescribeStateMachineCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeStateMachineCommandError - */ -const de_DescribeStateMachineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "StateMachineDoesNotExist": - case "com.amazonaws.sfn#StateMachineDoesNotExist": - throw await de_StateMachineDoesNotExistRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeStateMachineAliasCommand */ @@ -1286,7 +913,7 @@ export const de_DescribeStateMachineAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStateMachineAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1298,38 +925,6 @@ export const de_DescribeStateMachineAliasCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeStateMachineAliasCommandError - */ -const de_DescribeStateMachineAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sfn#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sfn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeStateMachineForExecutionCommand */ @@ -1338,7 +933,7 @@ export const de_DescribeStateMachineForExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStateMachineForExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1350,35 +945,6 @@ export const de_DescribeStateMachineForExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeStateMachineForExecutionCommandError - */ -const de_DescribeStateMachineForExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExecutionDoesNotExist": - case "com.amazonaws.sfn#ExecutionDoesNotExist": - throw await de_ExecutionDoesNotExistRes(parsedOutput, context); - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetActivityTaskCommand */ @@ -1387,7 +953,7 @@ export const de_GetActivityTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetActivityTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1399,38 +965,6 @@ export const de_GetActivityTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetActivityTaskCommandError - */ -const de_GetActivityTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ActivityDoesNotExist": - case "com.amazonaws.sfn#ActivityDoesNotExist": - throw await de_ActivityDoesNotExistRes(parsedOutput, context); - case "ActivityWorkerLimitExceeded": - case "com.amazonaws.sfn#ActivityWorkerLimitExceeded": - throw await de_ActivityWorkerLimitExceededRes(parsedOutput, context); - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetExecutionHistoryCommand */ @@ -1439,7 +973,7 @@ export const de_GetExecutionHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetExecutionHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1452,51 +986,39 @@ export const de_GetExecutionHistoryCommand = async ( }; /** - * deserializeAws_json1_0GetExecutionHistoryCommandError + * deserializeAws_json1_0ListActivitiesCommand */ -const de_GetExecutionHistoryCommandError = async ( +export const de_ListActivitiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExecutionDoesNotExist": - case "com.amazonaws.sfn#ExecutionDoesNotExist": - throw await de_ExecutionDoesNotExistRes(parsedOutput, context); - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "InvalidToken": - case "com.amazonaws.sfn#InvalidToken": - throw await de_InvalidTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListActivitiesOutput(data, context); + const response: ListActivitiesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListActivitiesCommand + * deserializeAws_json1_0ListExecutionsCommand */ -export const de_ListActivitiesCommand = async ( +export const de_ListExecutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListActivitiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListActivitiesOutput(data, context); - const response: ListActivitiesCommandOutput = { + contents = de_ListExecutionsOutput(data, context); + const response: ListExecutionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1504,101 +1026,14 @@ export const de_ListActivitiesCommand = async ( }; /** - * deserializeAws_json1_0ListActivitiesCommandError + * deserializeAws_json1_0ListMapRunsCommand */ -const de_ListActivitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidToken": - case "com.amazonaws.sfn#InvalidToken": - throw await de_InvalidTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListExecutionsCommand - */ -export const de_ListExecutionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListExecutionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListExecutionsOutput(data, context); - const response: ListExecutionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListExecutionsCommandError - */ -const de_ListExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "InvalidToken": - case "com.amazonaws.sfn#InvalidToken": - throw await de_InvalidTokenRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sfn#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - case "StateMachineDoesNotExist": - case "com.amazonaws.sfn#StateMachineDoesNotExist": - throw await de_StateMachineDoesNotExistRes(parsedOutput, context); - case "StateMachineTypeNotSupported": - case "com.amazonaws.sfn#StateMachineTypeNotSupported": - throw await de_StateMachineTypeNotSupportedRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sfn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListMapRunsCommand - */ -export const de_ListMapRunsCommand = async ( +export const de_ListMapRunsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListMapRunsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1610,38 +1045,6 @@ export const de_ListMapRunsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListMapRunsCommandError - */ -const de_ListMapRunsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExecutionDoesNotExist": - case "com.amazonaws.sfn#ExecutionDoesNotExist": - throw await de_ExecutionDoesNotExistRes(parsedOutput, context); - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "InvalidToken": - case "com.amazonaws.sfn#InvalidToken": - throw await de_InvalidTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListStateMachineAliasesCommand */ @@ -1650,7 +1053,7 @@ export const de_ListStateMachineAliasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStateMachineAliasesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1662,44 +1065,6 @@ export const de_ListStateMachineAliasesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListStateMachineAliasesCommandError - */ -const de_ListStateMachineAliasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "InvalidToken": - case "com.amazonaws.sfn#InvalidToken": - throw await de_InvalidTokenRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sfn#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - case "StateMachineDeleting": - case "com.amazonaws.sfn#StateMachineDeleting": - throw await de_StateMachineDeletingRes(parsedOutput, context); - case "StateMachineDoesNotExist": - case "com.amazonaws.sfn#StateMachineDoesNotExist": - throw await de_StateMachineDoesNotExistRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListStateMachinesCommand */ @@ -1708,7 +1073,7 @@ export const de_ListStateMachinesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStateMachinesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1720,32 +1085,6 @@ export const de_ListStateMachinesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListStateMachinesCommandError - */ -const de_ListStateMachinesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidToken": - case "com.amazonaws.sfn#InvalidToken": - throw await de_InvalidTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListStateMachineVersionsCommand */ @@ -1754,7 +1093,7 @@ export const de_ListStateMachineVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListStateMachineVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1766,38 +1105,6 @@ export const de_ListStateMachineVersionsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListStateMachineVersionsCommandError - */ -const de_ListStateMachineVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "InvalidToken": - case "com.amazonaws.sfn#InvalidToken": - throw await de_InvalidTokenRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sfn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListTagsForResourceCommand */ @@ -1806,7 +1113,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1818,35 +1125,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sfn#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0PublishStateMachineVersionCommand */ @@ -1855,7 +1133,7 @@ export const de_PublishStateMachineVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PublishStateMachineVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1867,47 +1145,6 @@ export const de_PublishStateMachineVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_0PublishStateMachineVersionCommandError - */ -const de_PublishStateMachineVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sfn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.sfn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "StateMachineDeleting": - case "com.amazonaws.sfn#StateMachineDeleting": - throw await de_StateMachineDeletingRes(parsedOutput, context); - case "StateMachineDoesNotExist": - case "com.amazonaws.sfn#StateMachineDoesNotExist": - throw await de_StateMachineDoesNotExistRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sfn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0RedriveExecutionCommand */ @@ -1916,7 +1153,7 @@ export const de_RedriveExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RedriveExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1928,41 +1165,6 @@ export const de_RedriveExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_0RedriveExecutionCommandError - */ -const de_RedriveExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExecutionDoesNotExist": - case "com.amazonaws.sfn#ExecutionDoesNotExist": - throw await de_ExecutionDoesNotExistRes(parsedOutput, context); - case "ExecutionLimitExceeded": - case "com.amazonaws.sfn#ExecutionLimitExceeded": - throw await de_ExecutionLimitExceededRes(parsedOutput, context); - case "ExecutionNotRedrivable": - case "com.amazonaws.sfn#ExecutionNotRedrivable": - throw await de_ExecutionNotRedrivableRes(parsedOutput, context); - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0SendTaskFailureCommand */ @@ -1971,7 +1173,7 @@ export const de_SendTaskFailureCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendTaskFailureCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1983,38 +1185,6 @@ export const de_SendTaskFailureCommand = async ( return response; }; -/** - * deserializeAws_json1_0SendTaskFailureCommandError - */ -const de_SendTaskFailureCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidToken": - case "com.amazonaws.sfn#InvalidToken": - throw await de_InvalidTokenRes(parsedOutput, context); - case "TaskDoesNotExist": - case "com.amazonaws.sfn#TaskDoesNotExist": - throw await de_TaskDoesNotExistRes(parsedOutput, context); - case "TaskTimedOut": - case "com.amazonaws.sfn#TaskTimedOut": - throw await de_TaskTimedOutRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0SendTaskHeartbeatCommand */ @@ -2023,7 +1193,7 @@ export const de_SendTaskHeartbeatCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendTaskHeartbeatCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2035,38 +1205,6 @@ export const de_SendTaskHeartbeatCommand = async ( return response; }; -/** - * deserializeAws_json1_0SendTaskHeartbeatCommandError - */ -const de_SendTaskHeartbeatCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidToken": - case "com.amazonaws.sfn#InvalidToken": - throw await de_InvalidTokenRes(parsedOutput, context); - case "TaskDoesNotExist": - case "com.amazonaws.sfn#TaskDoesNotExist": - throw await de_TaskDoesNotExistRes(parsedOutput, context); - case "TaskTimedOut": - case "com.amazonaws.sfn#TaskTimedOut": - throw await de_TaskTimedOutRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0SendTaskSuccessCommand */ @@ -2075,7 +1213,7 @@ export const de_SendTaskSuccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SendTaskSuccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2087,41 +1225,6 @@ export const de_SendTaskSuccessCommand = async ( return response; }; -/** - * deserializeAws_json1_0SendTaskSuccessCommandError - */ -const de_SendTaskSuccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidOutput": - case "com.amazonaws.sfn#InvalidOutput": - throw await de_InvalidOutputRes(parsedOutput, context); - case "InvalidToken": - case "com.amazonaws.sfn#InvalidToken": - throw await de_InvalidTokenRes(parsedOutput, context); - case "TaskDoesNotExist": - case "com.amazonaws.sfn#TaskDoesNotExist": - throw await de_TaskDoesNotExistRes(parsedOutput, context); - case "TaskTimedOut": - case "com.amazonaws.sfn#TaskTimedOut": - throw await de_TaskTimedOutRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0StartExecutionCommand */ @@ -2130,7 +1233,7 @@ export const de_StartExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2142,53 +1245,6 @@ export const de_StartExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_0StartExecutionCommandError - */ -const de_StartExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExecutionAlreadyExists": - case "com.amazonaws.sfn#ExecutionAlreadyExists": - throw await de_ExecutionAlreadyExistsRes(parsedOutput, context); - case "ExecutionLimitExceeded": - case "com.amazonaws.sfn#ExecutionLimitExceeded": - throw await de_ExecutionLimitExceededRes(parsedOutput, context); - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "InvalidExecutionInput": - case "com.amazonaws.sfn#InvalidExecutionInput": - throw await de_InvalidExecutionInputRes(parsedOutput, context); - case "InvalidName": - case "com.amazonaws.sfn#InvalidName": - throw await de_InvalidNameRes(parsedOutput, context); - case "StateMachineDeleting": - case "com.amazonaws.sfn#StateMachineDeleting": - throw await de_StateMachineDeletingRes(parsedOutput, context); - case "StateMachineDoesNotExist": - case "com.amazonaws.sfn#StateMachineDoesNotExist": - throw await de_StateMachineDoesNotExistRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sfn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0StartSyncExecutionCommand */ @@ -2197,7 +1253,7 @@ export const de_StartSyncExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartSyncExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2209,97 +1265,24 @@ export const de_StartSyncExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_0StartSyncExecutionCommandError - */ -const de_StartSyncExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "InvalidExecutionInput": - case "com.amazonaws.sfn#InvalidExecutionInput": - throw await de_InvalidExecutionInputRes(parsedOutput, context); - case "InvalidName": - case "com.amazonaws.sfn#InvalidName": - throw await de_InvalidNameRes(parsedOutput, context); - case "StateMachineDeleting": - case "com.amazonaws.sfn#StateMachineDeleting": - throw await de_StateMachineDeletingRes(parsedOutput, context); - case "StateMachineDoesNotExist": - case "com.amazonaws.sfn#StateMachineDoesNotExist": - throw await de_StateMachineDoesNotExistRes(parsedOutput, context); - case "StateMachineTypeNotSupported": - case "com.amazonaws.sfn#StateMachineTypeNotSupported": - throw await de_StateMachineTypeNotSupportedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0StopExecutionCommand */ export const de_StopExecutionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StopExecutionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_StopExecutionOutput(data, context); - const response: StopExecutionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0StopExecutionCommandError - */ -const de_StopExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExecutionDoesNotExist": - case "com.amazonaws.sfn#ExecutionDoesNotExist": - throw await de_ExecutionDoesNotExistRes(parsedOutput, context); - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sfn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StopExecutionOutput(data, context); + const response: StopExecutionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2310,7 +1293,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2322,38 +1305,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sfn#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - case "TooManyTags": - case "com.amazonaws.sfn#TooManyTags": - throw await de_TooManyTagsRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TestStateCommand */ @@ -2362,7 +1313,7 @@ export const de_TestStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TestStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2374,41 +1325,6 @@ export const de_TestStateCommand = async ( return response; }; -/** - * deserializeAws_json1_0TestStateCommandError - */ -const de_TestStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "InvalidDefinition": - case "com.amazonaws.sfn#InvalidDefinition": - throw await de_InvalidDefinitionRes(parsedOutput, context); - case "InvalidExecutionInput": - case "com.amazonaws.sfn#InvalidExecutionInput": - throw await de_InvalidExecutionInputRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sfn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UntagResourceCommand */ @@ -2417,7 +1333,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2429,35 +1345,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sfn#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateMapRunCommand */ @@ -2466,7 +1353,7 @@ export const de_UpdateMapRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateMapRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2478,38 +1365,6 @@ export const de_UpdateMapRunCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateMapRunCommandError - */ -const de_UpdateMapRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sfn#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sfn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateStateMachineCommand */ @@ -2518,7 +1373,7 @@ export const de_UpdateStateMachineCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateStateMachineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2530,59 +1385,6 @@ export const de_UpdateStateMachineCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateStateMachineCommandError - */ -const de_UpdateStateMachineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.sfn#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidArn": - case "com.amazonaws.sfn#InvalidArn": - throw await de_InvalidArnRes(parsedOutput, context); - case "InvalidDefinition": - case "com.amazonaws.sfn#InvalidDefinition": - throw await de_InvalidDefinitionRes(parsedOutput, context); - case "InvalidLoggingConfiguration": - case "com.amazonaws.sfn#InvalidLoggingConfiguration": - throw await de_InvalidLoggingConfigurationRes(parsedOutput, context); - case "InvalidTracingConfiguration": - case "com.amazonaws.sfn#InvalidTracingConfiguration": - throw await de_InvalidTracingConfigurationRes(parsedOutput, context); - case "MissingRequiredParameter": - case "com.amazonaws.sfn#MissingRequiredParameter": - throw await de_MissingRequiredParameterRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.sfn#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "StateMachineDeleting": - case "com.amazonaws.sfn#StateMachineDeleting": - throw await de_StateMachineDeletingRes(parsedOutput, context); - case "StateMachineDoesNotExist": - case "com.amazonaws.sfn#StateMachineDoesNotExist": - throw await de_StateMachineDoesNotExistRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sfn#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateStateMachineAliasCommand */ @@ -2591,7 +1393,7 @@ export const de_UpdateStateMachineAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateStateMachineAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2604,40 +1406,106 @@ export const de_UpdateStateMachineAliasCommand = async ( }; /** - * deserializeAws_json1_0UpdateStateMachineAliasCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateStateMachineAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "ActivityLimitExceeded": + case "com.amazonaws.sfn#ActivityLimitExceeded": + throw await de_ActivityLimitExceededRes(parsedOutput, context); + case "InvalidName": + case "com.amazonaws.sfn#InvalidName": + throw await de_InvalidNameRes(parsedOutput, context); + case "TooManyTags": + case "com.amazonaws.sfn#TooManyTags": + throw await de_TooManyTagsRes(parsedOutput, context); case "ConflictException": case "com.amazonaws.sfn#ConflictException": throw await de_ConflictExceptionRes(parsedOutput, context); case "InvalidArn": case "com.amazonaws.sfn#InvalidArn": throw await de_InvalidArnRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sfn#ResourceNotFound": - throw await de_ResourceNotFoundRes(parsedOutput, context); + case "InvalidDefinition": + case "com.amazonaws.sfn#InvalidDefinition": + throw await de_InvalidDefinitionRes(parsedOutput, context); + case "InvalidLoggingConfiguration": + case "com.amazonaws.sfn#InvalidLoggingConfiguration": + throw await de_InvalidLoggingConfigurationRes(parsedOutput, context); + case "InvalidTracingConfiguration": + case "com.amazonaws.sfn#InvalidTracingConfiguration": + throw await de_InvalidTracingConfigurationRes(parsedOutput, context); + case "StateMachineAlreadyExists": + case "com.amazonaws.sfn#StateMachineAlreadyExists": + throw await de_StateMachineAlreadyExistsRes(parsedOutput, context); case "StateMachineDeleting": case "com.amazonaws.sfn#StateMachineDeleting": throw await de_StateMachineDeletingRes(parsedOutput, context); + case "StateMachineLimitExceeded": + case "com.amazonaws.sfn#StateMachineLimitExceeded": + throw await de_StateMachineLimitExceededRes(parsedOutput, context); + case "StateMachineTypeNotSupported": + case "com.amazonaws.sfn#StateMachineTypeNotSupported": + throw await de_StateMachineTypeNotSupportedRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.sfn#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFound": + case "com.amazonaws.sfn#ResourceNotFound": + throw await de_ResourceNotFoundRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.sfn#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ActivityDoesNotExist": + case "com.amazonaws.sfn#ActivityDoesNotExist": + throw await de_ActivityDoesNotExistRes(parsedOutput, context); + case "ExecutionDoesNotExist": + case "com.amazonaws.sfn#ExecutionDoesNotExist": + throw await de_ExecutionDoesNotExistRes(parsedOutput, context); + case "StateMachineDoesNotExist": + case "com.amazonaws.sfn#StateMachineDoesNotExist": + throw await de_StateMachineDoesNotExistRes(parsedOutput, context); + case "ActivityWorkerLimitExceeded": + case "com.amazonaws.sfn#ActivityWorkerLimitExceeded": + throw await de_ActivityWorkerLimitExceededRes(parsedOutput, context); + case "InvalidToken": + case "com.amazonaws.sfn#InvalidToken": + throw await de_InvalidTokenRes(parsedOutput, context); + case "ExecutionLimitExceeded": + case "com.amazonaws.sfn#ExecutionLimitExceeded": + throw await de_ExecutionLimitExceededRes(parsedOutput, context); + case "ExecutionNotRedrivable": + case "com.amazonaws.sfn#ExecutionNotRedrivable": + throw await de_ExecutionNotRedrivableRes(parsedOutput, context); + case "TaskDoesNotExist": + case "com.amazonaws.sfn#TaskDoesNotExist": + throw await de_TaskDoesNotExistRes(parsedOutput, context); + case "TaskTimedOut": + case "com.amazonaws.sfn#TaskTimedOut": + throw await de_TaskTimedOutRes(parsedOutput, context); + case "InvalidOutput": + case "com.amazonaws.sfn#InvalidOutput": + throw await de_InvalidOutputRes(parsedOutput, context); + case "ExecutionAlreadyExists": + case "com.amazonaws.sfn#ExecutionAlreadyExists": + throw await de_ExecutionAlreadyExistsRes(parsedOutput, context); + case "InvalidExecutionInput": + case "com.amazonaws.sfn#InvalidExecutionInput": + throw await de_InvalidExecutionInputRes(parsedOutput, context); + case "MissingRequiredParameter": + case "com.amazonaws.sfn#MissingRequiredParameter": + throw await de_MissingRequiredParameterRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-shield/src/protocols/Aws_json1_1.ts b/clients/client-shield/src/protocols/Aws_json1_1.ts index 446fbb871c30..24fcb81de912 100644 --- a/clients/client-shield/src/protocols/Aws_json1_1.ts +++ b/clients/client-shield/src/protocols/Aws_json1_1.ts @@ -679,7 +679,7 @@ export const de_AssociateDRTLogBucketCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateDRTLogBucketCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -691,53 +691,6 @@ export const de_AssociateDRTLogBucketCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateDRTLogBucketCommandError - */ -const de_AssociateDRTLogBucketCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedForDependencyException": - case "com.amazonaws.shield#AccessDeniedForDependencyException": - throw await de_AccessDeniedForDependencyExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.shield#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitsExceededException": - case "com.amazonaws.shield#LimitsExceededException": - throw await de_LimitsExceededExceptionRes(parsedOutput, context); - case "NoAssociatedRoleException": - case "com.amazonaws.shield#NoAssociatedRoleException": - throw await de_NoAssociatedRoleExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateDRTRoleCommand */ @@ -746,7 +699,7 @@ export const de_AssociateDRTRoleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateDRTRoleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -758,47 +711,6 @@ export const de_AssociateDRTRoleCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateDRTRoleCommandError - */ -const de_AssociateDRTRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedForDependencyException": - case "com.amazonaws.shield#AccessDeniedForDependencyException": - throw await de_AccessDeniedForDependencyExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.shield#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateHealthCheckCommand */ @@ -807,7 +719,7 @@ export const de_AssociateHealthCheckCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateHealthCheckCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -819,47 +731,6 @@ export const de_AssociateHealthCheckCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateHealthCheckCommandError - */ -const de_AssociateHealthCheckCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.shield#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - case "LimitsExceededException": - case "com.amazonaws.shield#LimitsExceededException": - throw await de_LimitsExceededExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateProactiveEngagementDetailsCommand */ @@ -868,7 +739,7 @@ export const de_AssociateProactiveEngagementDetailsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateProactiveEngagementDetailsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -880,44 +751,6 @@ export const de_AssociateProactiveEngagementDetailsCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateProactiveEngagementDetailsCommandError - */ -const de_AssociateProactiveEngagementDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.shield#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateProtectionCommand */ @@ -926,7 +759,7 @@ export const de_CreateProtectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateProtectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -938,53 +771,6 @@ export const de_CreateProtectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateProtectionCommandError - */ -const de_CreateProtectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.shield#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.shield#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - case "LimitsExceededException": - case "com.amazonaws.shield#LimitsExceededException": - throw await de_LimitsExceededExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.shield#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateProtectionGroupCommand */ @@ -993,7 +779,7 @@ export const de_CreateProtectionGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateProtectionGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1005,47 +791,6 @@ export const de_CreateProtectionGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateProtectionGroupCommandError - */ -const de_CreateProtectionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitsExceededException": - case "com.amazonaws.shield#LimitsExceededException": - throw await de_LimitsExceededExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.shield#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateSubscriptionCommand */ @@ -1054,7 +799,7 @@ export const de_CreateSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1066,35 +811,6 @@ export const de_CreateSubscriptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateSubscriptionCommandError - */ -const de_CreateSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.shield#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteProtectionCommand */ @@ -1103,7 +819,7 @@ export const de_DeleteProtectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteProtectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1115,38 +831,6 @@ export const de_DeleteProtectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteProtectionCommandError - */ -const de_DeleteProtectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteProtectionGroupCommand */ @@ -1155,7 +839,7 @@ export const de_DeleteProtectionGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteProtectionGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1167,38 +851,6 @@ export const de_DeleteProtectionGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteProtectionGroupCommandError - */ -const de_DeleteProtectionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteSubscriptionCommand */ @@ -1207,7 +859,7 @@ export const de_DeleteSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1219,38 +871,6 @@ export const de_DeleteSubscriptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteSubscriptionCommandError - */ -const de_DeleteSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "LockedSubscriptionException": - case "com.amazonaws.shield#LockedSubscriptionException": - throw await de_LockedSubscriptionExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAttackCommand */ @@ -1259,7 +879,7 @@ export const de_DescribeAttackCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAttackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1271,79 +891,24 @@ export const de_DescribeAttackCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAttackCommandError - */ -const de_DescribeAttackCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.shield#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAttackStatisticsCommand */ export const de_DescribeAttackStatisticsCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAttackStatisticsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeAttackStatisticsResponse(data, context); - const response: DescribeAttackStatisticsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAttackStatisticsCommandError - */ -const de_DescribeAttackStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeAttackStatisticsResponse(data, context); + const response: DescribeAttackStatisticsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1354,7 +919,7 @@ export const de_DescribeDRTAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDRTAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1366,35 +931,6 @@ export const de_DescribeDRTAccessCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeDRTAccessCommandError - */ -const de_DescribeDRTAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeEmergencyContactSettingsCommand */ @@ -1403,7 +939,7 @@ export const de_DescribeEmergencyContactSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEmergencyContactSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1415,35 +951,6 @@ export const de_DescribeEmergencyContactSettingsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeEmergencyContactSettingsCommandError - */ -const de_DescribeEmergencyContactSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeProtectionCommand */ @@ -1452,7 +959,7 @@ export const de_DescribeProtectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeProtectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1464,38 +971,6 @@ export const de_DescribeProtectionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeProtectionCommandError - */ -const de_DescribeProtectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeProtectionGroupCommand */ @@ -1504,7 +979,7 @@ export const de_DescribeProtectionGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeProtectionGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1516,35 +991,6 @@ export const de_DescribeProtectionGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeProtectionGroupCommandError - */ -const de_DescribeProtectionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeSubscriptionCommand */ @@ -1553,7 +999,7 @@ export const de_DescribeSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1565,35 +1011,6 @@ export const de_DescribeSubscriptionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeSubscriptionCommandError - */ -const de_DescribeSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisableApplicationLayerAutomaticResponseCommand */ @@ -1602,7 +1019,7 @@ export const de_DisableApplicationLayerAutomaticResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableApplicationLayerAutomaticResponseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1614,44 +1031,6 @@ export const de_DisableApplicationLayerAutomaticResponseCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisableApplicationLayerAutomaticResponseCommandError - */ -const de_DisableApplicationLayerAutomaticResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.shield#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisableProactiveEngagementCommand */ @@ -1660,7 +1039,7 @@ export const de_DisableProactiveEngagementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableProactiveEngagementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1672,44 +1051,6 @@ export const de_DisableProactiveEngagementCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisableProactiveEngagementCommandError - */ -const de_DisableProactiveEngagementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.shield#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisassociateDRTLogBucketCommand */ @@ -1718,57 +1059,16 @@ export const de_DisassociateDRTLogBucketCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateDRTLogBucketCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); const response: DisassociateDRTLogBucketCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisassociateDRTLogBucketCommandError - */ -const de_DisassociateDRTLogBucketCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedForDependencyException": - case "com.amazonaws.shield#AccessDeniedForDependencyException": - throw await de_AccessDeniedForDependencyExceptionRes(parsedOutput, context); - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.shield#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "NoAssociatedRoleException": - case "com.amazonaws.shield#NoAssociatedRoleException": - throw await de_NoAssociatedRoleExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1779,7 +1079,7 @@ export const de_DisassociateDRTRoleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateDRTRoleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1791,41 +1091,6 @@ export const de_DisassociateDRTRoleCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateDRTRoleCommandError - */ -const de_DisassociateDRTRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.shield#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisassociateHealthCheckCommand */ @@ -1834,7 +1099,7 @@ export const de_DisassociateHealthCheckCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateHealthCheckCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1846,44 +1111,6 @@ export const de_DisassociateHealthCheckCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateHealthCheckCommandError - */ -const de_DisassociateHealthCheckCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.shield#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1EnableApplicationLayerAutomaticResponseCommand */ @@ -1892,7 +1119,7 @@ export const de_EnableApplicationLayerAutomaticResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableApplicationLayerAutomaticResponseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1904,47 +1131,6 @@ export const de_EnableApplicationLayerAutomaticResponseCommand = async ( return response; }; -/** - * deserializeAws_json1_1EnableApplicationLayerAutomaticResponseCommandError - */ -const de_EnableApplicationLayerAutomaticResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.shield#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitsExceededException": - case "com.amazonaws.shield#LimitsExceededException": - throw await de_LimitsExceededExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1EnableProactiveEngagementCommand */ @@ -1953,7 +1139,7 @@ export const de_EnableProactiveEngagementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EnableProactiveEngagementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1965,44 +1151,6 @@ export const de_EnableProactiveEngagementCommand = async ( return response; }; -/** - * deserializeAws_json1_1EnableProactiveEngagementCommandError - */ -const de_EnableProactiveEngagementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.shield#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetSubscriptionStateCommand */ @@ -2011,7 +1159,7 @@ export const de_GetSubscriptionStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSubscriptionStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2023,32 +1171,6 @@ export const de_GetSubscriptionStateCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetSubscriptionStateCommandError - */ -const de_GetSubscriptionStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAttacksCommand */ @@ -2057,7 +1179,7 @@ export const de_ListAttacksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAttacksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2069,38 +1191,6 @@ export const de_ListAttacksCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAttacksCommandError - */ -const de_ListAttacksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.shield#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListProtectionGroupsCommand */ @@ -2109,7 +1199,7 @@ export const de_ListProtectionGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListProtectionGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2121,38 +1211,6 @@ export const de_ListProtectionGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListProtectionGroupsCommandError - */ -const de_ListProtectionGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.shield#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListProtectionsCommand */ @@ -2161,7 +1219,7 @@ export const de_ListProtectionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListProtectionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2169,40 +1227,8 @@ export const de_ListProtectionsCommand = async ( const response: ListProtectionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListProtectionsCommandError - */ -const de_ListProtectionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.shield#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }; + return response; }; /** @@ -2213,7 +1239,7 @@ export const de_ListResourcesInProtectionGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListResourcesInProtectionGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2225,38 +1251,6 @@ export const de_ListResourcesInProtectionGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListResourcesInProtectionGroupCommandError - */ -const de_ListResourcesInProtectionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidPaginationTokenException": - case "com.amazonaws.shield#InvalidPaginationTokenException": - throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -2265,7 +1259,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2277,38 +1271,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.shield#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -2317,7 +1279,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2329,41 +1291,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.shield#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -2372,7 +1299,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2384,41 +1311,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.shield#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateApplicationLayerAutomaticResponseCommand */ @@ -2427,7 +1319,7 @@ export const de_UpdateApplicationLayerAutomaticResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateApplicationLayerAutomaticResponseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2439,44 +1331,6 @@ export const de_UpdateApplicationLayerAutomaticResponseCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateApplicationLayerAutomaticResponseCommandError - */ -const de_UpdateApplicationLayerAutomaticResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.shield#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateEmergencyContactSettingsCommand */ @@ -2485,7 +1339,7 @@ export const de_UpdateEmergencyContactSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateEmergencyContactSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2497,41 +1351,6 @@ export const de_UpdateEmergencyContactSettingsCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateEmergencyContactSettingsCommandError - */ -const de_UpdateEmergencyContactSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateProtectionGroupCommand */ @@ -2540,7 +1359,7 @@ export const de_UpdateProtectionGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateProtectionGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2552,41 +1371,6 @@ export const de_UpdateProtectionGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateProtectionGroupCommandError - */ -const de_UpdateProtectionGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalErrorException": - case "com.amazonaws.shield#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.shield#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OptimisticLockException": - case "com.amazonaws.shield#OptimisticLockException": - throw await de_OptimisticLockExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.shield#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSubscriptionCommand */ @@ -2595,7 +1379,7 @@ export const de_UpdateSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2608,40 +1392,61 @@ export const de_UpdateSubscriptionCommand = async ( }; /** - * deserializeAws_json1_1UpdateSubscriptionCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AccessDeniedForDependencyException": + case "com.amazonaws.shield#AccessDeniedForDependencyException": + throw await de_AccessDeniedForDependencyExceptionRes(parsedOutput, context); case "InternalErrorException": case "com.amazonaws.shield#InternalErrorException": throw await de_InternalErrorExceptionRes(parsedOutput, context); + case "InvalidOperationException": + case "com.amazonaws.shield#InvalidOperationException": + throw await de_InvalidOperationExceptionRes(parsedOutput, context); case "InvalidParameterException": case "com.amazonaws.shield#InvalidParameterException": throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LockedSubscriptionException": - case "com.amazonaws.shield#LockedSubscriptionException": - throw await de_LockedSubscriptionExceptionRes(parsedOutput, context); + case "LimitsExceededException": + case "com.amazonaws.shield#LimitsExceededException": + throw await de_LimitsExceededExceptionRes(parsedOutput, context); + case "NoAssociatedRoleException": + case "com.amazonaws.shield#NoAssociatedRoleException": + throw await de_NoAssociatedRoleExceptionRes(parsedOutput, context); case "OptimisticLockException": case "com.amazonaws.shield#OptimisticLockException": throw await de_OptimisticLockExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.shield#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "InvalidResourceException": + case "com.amazonaws.shield#InvalidResourceException": + throw await de_InvalidResourceExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.shield#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "LockedSubscriptionException": + case "com.amazonaws.shield#LockedSubscriptionException": + throw await de_LockedSubscriptionExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.shield#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InvalidPaginationTokenException": + case "com.amazonaws.shield#InvalidPaginationTokenException": + throw await de_InvalidPaginationTokenExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-signer/src/protocols/Aws_restJson1.ts b/clients/client-signer/src/protocols/Aws_restJson1.ts index 3436325bd9fc..5c92f5b75d47 100644 --- a/clients/client-signer/src/protocols/Aws_restJson1.ts +++ b/clients/client-signer/src/protocols/Aws_restJson1.ts @@ -542,7 +542,7 @@ export const de_AddProfilePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AddProfilePermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -555,50 +555,6 @@ export const de_AddProfilePermissionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddProfilePermissionCommandError - */ -const de_AddProfilePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.signer#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.signer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceLimitExceededException": - case "com.amazonaws.signer#ServiceLimitExceededException": - throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.signer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CancelSigningProfileCommand */ @@ -607,7 +563,7 @@ export const de_CancelSigningProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelSigningProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -616,41 +572,6 @@ export const de_CancelSigningProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelSigningProfileCommandError - */ -const de_CancelSigningProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.signer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeSigningJobCommand */ @@ -659,7 +580,7 @@ export const de_DescribeSigningJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSigningJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -690,41 +611,6 @@ export const de_DescribeSigningJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeSigningJobCommandError - */ -const de_DescribeSigningJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.signer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRevocationStatusCommand */ @@ -733,7 +619,7 @@ export const de_GetRevocationStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRevocationStatusCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -746,41 +632,6 @@ export const de_GetRevocationStatusCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRevocationStatusCommandError - */ -const de_GetRevocationStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.signer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSigningPlatformCommand */ @@ -789,7 +640,7 @@ export const de_GetSigningPlatformCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSigningPlatformCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -810,41 +661,6 @@ export const de_GetSigningPlatformCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSigningPlatformCommandError - */ -const de_GetSigningPlatformCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.signer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSigningProfileCommand */ @@ -853,7 +669,7 @@ export const de_GetSigningProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSigningProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -879,41 +695,6 @@ export const de_GetSigningProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSigningProfileCommandError - */ -const de_GetSigningProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.signer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListProfilePermissionsCommand */ @@ -922,7 +703,7 @@ export const de_ListProfilePermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProfilePermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -939,166 +720,58 @@ export const de_ListProfilePermissionsCommand = async ( }; /** - * deserializeAws_restJson1ListProfilePermissionsCommandError + * deserializeAws_restJson1ListSigningJobsCommand */ -const de_ListProfilePermissionsCommandError = async ( +export const de_ListSigningJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.signer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.signer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + jobs: (_) => de_SigningJobs(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListSigningJobsCommand + * deserializeAws_restJson1ListSigningPlatformsCommand */ -export const de_ListSigningJobsCommand = async ( +export const de_ListSigningPlatformsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSigningJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - jobs: (_) => de_SigningJobs(_, context), nextToken: __expectString, + platforms: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListSigningJobsCommandError + * deserializeAws_restJson1ListSigningProfilesCommand */ -const de_ListSigningJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.signer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSigningPlatformsCommand - */ -export const de_ListSigningPlatformsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSigningPlatformsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - platforms: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSigningPlatformsCommandError - */ -const de_ListSigningPlatformsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.signer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListSigningProfilesCommand - */ -export const de_ListSigningProfilesCommand = async ( +export const de_ListSigningProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSigningProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1112,38 +785,6 @@ export const de_ListSigningProfilesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSigningProfilesCommandError - */ -const de_ListSigningProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1152,7 +793,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1165,41 +806,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.signer#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.signer#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutSigningProfileCommand */ @@ -1208,7 +814,7 @@ export const de_PutSigningProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutSigningProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1223,44 +829,6 @@ export const de_PutSigningProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutSigningProfileCommandError - */ -const de_PutSigningProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.signer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.signer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RemoveProfilePermissionCommand */ @@ -1269,7 +837,7 @@ export const de_RemoveProfilePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RemoveProfilePermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1282,47 +850,6 @@ export const de_RemoveProfilePermissionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RemoveProfilePermissionCommandError - */ -const de_RemoveProfilePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.signer#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.signer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.signer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RevokeSignatureCommand */ @@ -1331,7 +858,7 @@ export const de_RevokeSignatureCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RevokeSignatureCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1340,44 +867,6 @@ export const de_RevokeSignatureCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RevokeSignatureCommandError - */ -const de_RevokeSignatureCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.signer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.signer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RevokeSigningProfileCommand */ @@ -1386,7 +875,7 @@ export const de_RevokeSigningProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RevokeSigningProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1395,44 +884,6 @@ export const de_RevokeSigningProfileCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RevokeSigningProfileCommandError - */ -const de_RevokeSigningProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.signer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.signer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SignPayloadCommand */ @@ -1441,7 +892,7 @@ export const de_SignPayloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SignPayloadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1457,44 +908,6 @@ export const de_SignPayloadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SignPayloadCommandError - */ -const de_SignPayloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.signer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.signer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartSigningJobCommand */ @@ -1503,7 +916,7 @@ export const de_StartSigningJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartSigningJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1517,47 +930,6 @@ export const de_StartSigningJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartSigningJobCommandError - */ -const de_StartSigningJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.signer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.signer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.signer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.signer#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1566,7 +938,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1575,41 +947,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.signer#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalServiceErrorException": - case "com.amazonaws.signer#InternalServiceErrorException": - throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.signer#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.signer#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1618,7 +955,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1628,37 +965,52 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.signer#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.signer#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.signer#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServiceErrorException": case "com.amazonaws.signer#InternalServiceErrorException": throw await de_InternalServiceErrorExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.signer#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.signer#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceLimitExceededException": + case "com.amazonaws.signer#ServiceLimitExceededException": + throw await de_ServiceLimitExceededExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.signer#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.signer#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "BadRequestException": + case "com.amazonaws.signer#BadRequestException": + throw await de_BadRequestExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.signer#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.signer#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-simspaceweaver/src/protocols/Aws_restJson1.ts b/clients/client-simspaceweaver/src/protocols/Aws_restJson1.ts index 049897eb2774..4db9fc284255 100644 --- a/clients/client-simspaceweaver/src/protocols/Aws_restJson1.ts +++ b/clients/client-simspaceweaver/src/protocols/Aws_restJson1.ts @@ -411,7 +411,7 @@ export const de_CreateSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSnapshotCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -420,44 +420,6 @@ export const de_CreateSnapshotCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSnapshotCommandError - */ -const de_CreateSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.simspaceweaver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.simspaceweaver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.simspaceweaver#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.simspaceweaver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.simspaceweaver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAppCommand */ @@ -466,7 +428,7 @@ export const de_DeleteAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAppCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -475,44 +437,6 @@ export const de_DeleteAppCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAppCommandError - */ -const de_DeleteAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.simspaceweaver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.simspaceweaver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.simspaceweaver#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.simspaceweaver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.simspaceweaver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSimulationCommand */ @@ -521,7 +445,7 @@ export const de_DeleteSimulationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSimulationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -530,44 +454,6 @@ export const de_DeleteSimulationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSimulationCommandError - */ -const de_DeleteSimulationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.simspaceweaver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.simspaceweaver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.simspaceweaver#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.simspaceweaver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.simspaceweaver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAppCommand */ @@ -576,7 +462,7 @@ export const de_DescribeAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAppCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -596,41 +482,6 @@ export const de_DescribeAppCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAppCommandError - */ -const de_DescribeAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.simspaceweaver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.simspaceweaver#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.simspaceweaver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.simspaceweaver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeSimulationCommand */ @@ -639,7 +490,7 @@ export const de_DescribeSimulationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeSimulationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -666,41 +517,6 @@ export const de_DescribeSimulationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeSimulationCommandError - */ -const de_DescribeSimulationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.simspaceweaver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.simspaceweaver#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.simspaceweaver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.simspaceweaver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAppsCommand */ @@ -709,7 +525,7 @@ export const de_ListAppsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAppsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -723,41 +539,6 @@ export const de_ListAppsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAppsCommandError - */ -const de_ListAppsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.simspaceweaver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.simspaceweaver#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.simspaceweaver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.simspaceweaver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSimulationsCommand */ @@ -766,7 +547,7 @@ export const de_ListSimulationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSimulationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -780,38 +561,6 @@ export const de_ListSimulationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSimulationsCommandError - */ -const de_ListSimulationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.simspaceweaver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.simspaceweaver#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.simspaceweaver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -820,7 +569,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -833,35 +582,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.simspaceweaver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.simspaceweaver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartAppCommand */ @@ -870,7 +590,7 @@ export const de_StartAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartAppCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -885,44 +605,6 @@ export const de_StartAppCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartAppCommandError - */ -const de_StartAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.simspaceweaver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.simspaceweaver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.simspaceweaver#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.simspaceweaver#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.simspaceweaver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartClockCommand */ @@ -931,7 +613,7 @@ export const de_StartClockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartClockCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -940,44 +622,6 @@ export const de_StartClockCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartClockCommandError - */ -const de_StartClockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.simspaceweaver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.simspaceweaver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.simspaceweaver#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.simspaceweaver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.simspaceweaver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartSimulationCommand */ @@ -986,7 +630,7 @@ export const de_StartSimulationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartSimulationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1001,44 +645,6 @@ export const de_StartSimulationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartSimulationCommandError - */ -const de_StartSimulationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.simspaceweaver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.simspaceweaver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.simspaceweaver#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.simspaceweaver#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.simspaceweaver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopAppCommand */ @@ -1047,7 +653,7 @@ export const de_StopAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopAppCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1056,44 +662,6 @@ export const de_StopAppCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopAppCommandError - */ -const de_StopAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.simspaceweaver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.simspaceweaver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.simspaceweaver#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.simspaceweaver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.simspaceweaver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopClockCommand */ @@ -1102,7 +670,7 @@ export const de_StopClockCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopClockCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1111,44 +679,6 @@ export const de_StopClockCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopClockCommandError - */ -const de_StopClockCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.simspaceweaver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.simspaceweaver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.simspaceweaver#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.simspaceweaver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.simspaceweaver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopSimulationCommand */ @@ -1157,7 +687,7 @@ export const de_StopSimulationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopSimulationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1166,44 +696,6 @@ export const de_StopSimulationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopSimulationCommandError - */ -const de_StopSimulationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.simspaceweaver#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.simspaceweaver#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.simspaceweaver#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.simspaceweaver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.simspaceweaver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1212,7 +704,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1221,38 +713,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.simspaceweaver#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.simspaceweaver#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.simspaceweaver#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1261,7 +721,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1271,31 +731,43 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.simspaceweaver#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.simspaceweaver#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.simspaceweaver#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.simspaceweaver#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.simspaceweaver#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.simspaceweaver#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.simspaceweaver#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-sms/src/protocols/Aws_json1_1.ts b/clients/client-sms/src/protocols/Aws_json1_1.ts index e3cb857ec4e6..2536388c4eb2 100644 --- a/clients/client-sms/src/protocols/Aws_json1_1.ts +++ b/clients/client-sms/src/protocols/Aws_json1_1.ts @@ -661,7 +661,7 @@ export const de_CreateAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAppCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -673,44 +673,6 @@ export const de_CreateAppCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAppCommandError - */ -const de_CreateAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateReplicationJobCommand */ @@ -719,7 +681,7 @@ export const de_CreateReplicationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateReplicationJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -731,56 +693,6 @@ export const de_CreateReplicationJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateReplicationJobCommandError - */ -const de_CreateReplicationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "NoConnectorsAvailableException": - case "com.amazonaws.sms#NoConnectorsAvailableException": - throw await de_NoConnectorsAvailableExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ReplicationJobAlreadyExistsException": - case "com.amazonaws.sms#ReplicationJobAlreadyExistsException": - throw await de_ReplicationJobAlreadyExistsExceptionRes(parsedOutput, context); - case "ServerCannotBeReplicatedException": - case "com.amazonaws.sms#ServerCannotBeReplicatedException": - throw await de_ServerCannotBeReplicatedExceptionRes(parsedOutput, context); - case "TemporarilyUnavailableException": - case "com.amazonaws.sms#TemporarilyUnavailableException": - throw await de_TemporarilyUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAppCommand */ @@ -789,7 +701,7 @@ export const de_DeleteAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAppCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -801,44 +713,6 @@ export const de_DeleteAppCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAppCommandError - */ -const de_DeleteAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAppLaunchConfigurationCommand */ @@ -847,7 +721,7 @@ export const de_DeleteAppLaunchConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAppLaunchConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -859,44 +733,6 @@ export const de_DeleteAppLaunchConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAppLaunchConfigurationCommandError - */ -const de_DeleteAppLaunchConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAppReplicationConfigurationCommand */ @@ -905,7 +741,7 @@ export const de_DeleteAppReplicationConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAppReplicationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -918,57 +754,39 @@ export const de_DeleteAppReplicationConfigurationCommand = async ( }; /** - * deserializeAws_json1_1DeleteAppReplicationConfigurationCommandError + * deserializeAws_json1_1DeleteAppValidationConfigurationCommand */ -const de_DeleteAppReplicationConfigurationCommandError = async ( +export const de_DeleteAppValidationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteAppValidationConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteAppValidationConfigurationCommand + * deserializeAws_json1_1DeleteReplicationJobCommand */ -export const de_DeleteAppValidationConfigurationCommand = async ( +export const de_DeleteReplicationJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteAppValidationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteAppValidationConfigurationCommandOutput = { + const response: DeleteReplicationJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -976,57 +794,39 @@ export const de_DeleteAppValidationConfigurationCommand = async ( }; /** - * deserializeAws_json1_1DeleteAppValidationConfigurationCommandError + * deserializeAws_json1_1DeleteServerCatalogCommand */ -const de_DeleteAppValidationConfigurationCommandError = async ( +export const de_DeleteServerCatalogCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteServerCatalogCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteReplicationJobCommand + * deserializeAws_json1_1DisassociateConnectorCommand */ -export const de_DeleteReplicationJobCommand = async ( +export const de_DisassociateConnectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteReplicationJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteReplicationJobCommandOutput = { + const response: DisassociateConnectorCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1034,57 +834,19 @@ export const de_DeleteReplicationJobCommand = async ( }; /** - * deserializeAws_json1_1DeleteReplicationJobCommandError + * deserializeAws_json1_1GenerateChangeSetCommand */ -const de_DeleteReplicationJobCommandError = async ( +export const de_GenerateChangeSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ReplicationJobNotFoundException": - case "com.amazonaws.sms#ReplicationJobNotFoundException": - throw await de_ReplicationJobNotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteServerCatalogCommand - */ -export const de_DeleteServerCatalogCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteServerCatalogCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteServerCatalogCommandOutput = { + const response: GenerateChangeSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1092,54 +854,19 @@ export const de_DeleteServerCatalogCommand = async ( }; /** - * deserializeAws_json1_1DeleteServerCatalogCommandError - */ -const de_DeleteServerCatalogCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociateConnectorCommand + * deserializeAws_json1_1GenerateTemplateCommand */ -export const de_DisassociateConnectorCommand = async ( +export const de_GenerateTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateConnectorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateConnectorCommandOutput = { + const response: GenerateTemplateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1147,54 +874,19 @@ export const de_DisassociateConnectorCommand = async ( }; /** - * deserializeAws_json1_1DisassociateConnectorCommandError - */ -const de_DisassociateConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GenerateChangeSetCommand + * deserializeAws_json1_1GetAppCommand */ -export const de_GenerateChangeSetCommand = async ( +export const de_GetAppCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GenerateChangeSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GenerateChangeSetCommandOutput = { + contents = de_GetAppResponse(data, context); + const response: GetAppCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1202,57 +894,19 @@ export const de_GenerateChangeSetCommand = async ( }; /** - * deserializeAws_json1_1GenerateChangeSetCommandError - */ -const de_GenerateChangeSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GenerateTemplateCommand + * deserializeAws_json1_1GetAppLaunchConfigurationCommand */ -export const de_GenerateTemplateCommand = async ( +export const de_GetAppLaunchConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GenerateTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GenerateTemplateCommandOutput = { + const response: GetAppLaunchConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1260,57 +914,19 @@ export const de_GenerateTemplateCommand = async ( }; /** - * deserializeAws_json1_1GenerateTemplateCommandError - */ -const de_GenerateTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetAppCommand + * deserializeAws_json1_1GetAppReplicationConfigurationCommand */ -export const de_GetAppCommand = async ( +export const de_GetAppReplicationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetAppCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetAppResponse(data, context); - const response: GetAppCommandOutput = { + contents = de_GetAppReplicationConfigurationResponse(data, context); + const response: GetAppReplicationConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1318,54 +934,19 @@ export const de_GetAppCommand = async ( }; /** - * deserializeAws_json1_1GetAppCommandError - */ -const de_GetAppCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetAppLaunchConfigurationCommand + * deserializeAws_json1_1GetAppValidationConfigurationCommand */ -export const de_GetAppLaunchConfigurationCommand = async ( +export const de_GetAppValidationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetAppLaunchConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetAppLaunchConfigurationCommandOutput = { + const response: GetAppValidationConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1373,168 +954,14 @@ export const de_GetAppLaunchConfigurationCommand = async ( }; /** - * deserializeAws_json1_1GetAppLaunchConfigurationCommandError + * deserializeAws_json1_1GetAppValidationOutputCommand */ -const de_GetAppLaunchConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetAppReplicationConfigurationCommand - */ -export const de_GetAppReplicationConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetAppReplicationConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetAppReplicationConfigurationResponse(data, context); - const response: GetAppReplicationConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetAppReplicationConfigurationCommandError - */ -const de_GetAppReplicationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetAppValidationConfigurationCommand - */ -export const de_GetAppValidationConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetAppValidationConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetAppValidationConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetAppValidationConfigurationCommandError - */ -const de_GetAppValidationConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetAppValidationOutputCommand - */ -export const de_GetAppValidationOutputCommand = async ( +export const de_GetAppValidationOutputCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAppValidationOutputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1547,436 +974,19 @@ export const de_GetAppValidationOutputCommand = async ( }; /** - * deserializeAws_json1_1GetAppValidationOutputCommandError - */ -const de_GetAppValidationOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetConnectorsCommand - */ -export const de_GetConnectorsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetConnectorsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetConnectorsResponse(data, context); - const response: GetConnectorsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetConnectorsCommandError - */ -const de_GetConnectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetReplicationJobsCommand - */ -export const de_GetReplicationJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetReplicationJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetReplicationJobsResponse(data, context); - const response: GetReplicationJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetReplicationJobsCommandError - */ -const de_GetReplicationJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetReplicationRunsCommand - */ -export const de_GetReplicationRunsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetReplicationRunsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetReplicationRunsResponse(data, context); - const response: GetReplicationRunsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetReplicationRunsCommandError - */ -const de_GetReplicationRunsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetServersCommand - */ -export const de_GetServersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetServersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetServersResponse(data, context); - const response: GetServersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetServersCommandError - */ -const de_GetServersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ImportAppCatalogCommand - */ -export const de_ImportAppCatalogCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ImportAppCatalogCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ImportAppCatalogCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ImportAppCatalogCommandError - */ -const de_ImportAppCatalogCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ImportServerCatalogCommand - */ -export const de_ImportServerCatalogCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ImportServerCatalogCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ImportServerCatalogCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ImportServerCatalogCommandError - */ -const de_ImportServerCatalogCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "NoConnectorsAvailableException": - case "com.amazonaws.sms#NoConnectorsAvailableException": - throw await de_NoConnectorsAvailableExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1LaunchAppCommand - */ -export const de_LaunchAppCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_LaunchAppCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: LaunchAppCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1LaunchAppCommandError - */ -const de_LaunchAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAppsCommand + * deserializeAws_json1_1GetConnectorsCommand */ -export const de_ListAppsCommand = async ( +export const de_GetConnectorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAppsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListAppsResponse(data, context); - const response: ListAppsCommandOutput = { + contents = de_GetConnectorsResponse(data, context); + const response: GetConnectorsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1984,57 +994,39 @@ export const de_ListAppsCommand = async ( }; /** - * deserializeAws_json1_1ListAppsCommandError + * deserializeAws_json1_1GetReplicationJobsCommand */ -const de_ListAppsCommandError = async ( +export const de_GetReplicationJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetReplicationJobsResponse(data, context); + const response: GetReplicationJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1NotifyAppValidationOutputCommand + * deserializeAws_json1_1GetReplicationRunsCommand */ -export const de_NotifyAppValidationOutputCommand = async ( +export const de_GetReplicationRunsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_NotifyAppValidationOutputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: NotifyAppValidationOutputCommandOutput = { + contents = de_GetReplicationRunsResponse(data, context); + const response: GetReplicationRunsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2042,57 +1034,39 @@ export const de_NotifyAppValidationOutputCommand = async ( }; /** - * deserializeAws_json1_1NotifyAppValidationOutputCommandError + * deserializeAws_json1_1GetServersCommand */ -const de_NotifyAppValidationOutputCommandError = async ( +export const de_GetServersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetServersResponse(data, context); + const response: GetServersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutAppLaunchConfigurationCommand + * deserializeAws_json1_1ImportAppCatalogCommand */ -export const de_PutAppLaunchConfigurationCommand = async ( +export const de_ImportAppCatalogCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutAppLaunchConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutAppLaunchConfigurationCommandOutput = { + const response: ImportAppCatalogCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2100,57 +1074,39 @@ export const de_PutAppLaunchConfigurationCommand = async ( }; /** - * deserializeAws_json1_1PutAppLaunchConfigurationCommandError + * deserializeAws_json1_1ImportServerCatalogCommand */ -const de_PutAppLaunchConfigurationCommandError = async ( +export const de_ImportServerCatalogCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ImportServerCatalogCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutAppReplicationConfigurationCommand + * deserializeAws_json1_1LaunchAppCommand */ -export const de_PutAppReplicationConfigurationCommand = async ( +export const de_LaunchAppCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutAppReplicationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutAppReplicationConfigurationCommandOutput = { + const response: LaunchAppCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2158,57 +1114,39 @@ export const de_PutAppReplicationConfigurationCommand = async ( }; /** - * deserializeAws_json1_1PutAppReplicationConfigurationCommandError + * deserializeAws_json1_1ListAppsCommand */ -const de_PutAppReplicationConfigurationCommandError = async ( +export const de_ListAppsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListAppsResponse(data, context); + const response: ListAppsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1PutAppValidationConfigurationCommand + * deserializeAws_json1_1NotifyAppValidationOutputCommand */ -export const de_PutAppValidationConfigurationCommand = async ( +export const de_NotifyAppValidationOutputCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_PutAppValidationConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: PutAppValidationConfigurationCommandOutput = { + const response: NotifyAppValidationOutputCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2216,57 +1154,59 @@ export const de_PutAppValidationConfigurationCommand = async ( }; /** - * deserializeAws_json1_1PutAppValidationConfigurationCommandError + * deserializeAws_json1_1PutAppLaunchConfigurationCommand */ -const de_PutAppValidationConfigurationCommandError = async ( +export const de_PutAppLaunchConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutAppLaunchConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1PutAppReplicationConfigurationCommand + */ +export const de_PutAppReplicationConfigurationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutAppReplicationConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartAppReplicationCommand + * deserializeAws_json1_1PutAppValidationConfigurationCommand */ -export const de_StartAppReplicationCommand = async ( +export const de_PutAppValidationConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartAppReplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartAppReplicationCommandOutput = { + const response: PutAppValidationConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2274,41 +1214,23 @@ export const de_StartAppReplicationCommand = async ( }; /** - * deserializeAws_json1_1StartAppReplicationCommandError + * deserializeAws_json1_1StartAppReplicationCommand */ -const de_StartAppReplicationCommandError = async ( +export const de_StartAppReplicationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartAppReplicationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2319,7 +1241,7 @@ export const de_StartOnDemandAppReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartOnDemandAppReplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2331,44 +1253,6 @@ export const de_StartOnDemandAppReplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartOnDemandAppReplicationCommandError - */ -const de_StartOnDemandAppReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartOnDemandReplicationRunCommand */ @@ -2377,7 +1261,7 @@ export const de_StartOnDemandReplicationRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartOnDemandReplicationRunCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2389,47 +1273,6 @@ export const de_StartOnDemandReplicationRunCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartOnDemandReplicationRunCommandError - */ -const de_StartOnDemandReplicationRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DryRunOperationException": - case "com.amazonaws.sms#DryRunOperationException": - throw await de_DryRunOperationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ReplicationRunLimitExceededException": - case "com.amazonaws.sms#ReplicationRunLimitExceededException": - throw await de_ReplicationRunLimitExceededExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopAppReplicationCommand */ @@ -2438,7 +1281,7 @@ export const de_StopAppReplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopAppReplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2450,44 +1293,6 @@ export const de_StopAppReplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopAppReplicationCommandError - */ -const de_StopAppReplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TerminateAppCommand */ @@ -2496,7 +1301,7 @@ export const de_TerminateAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TerminateAppCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2508,44 +1313,6 @@ export const de_TerminateAppCommand = async ( return response; }; -/** - * deserializeAws_json1_1TerminateAppCommandError - */ -const de_TerminateAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateAppCommand */ @@ -2554,7 +1321,7 @@ export const de_UpdateAppCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateAppCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2566,44 +1333,6 @@ export const de_UpdateAppCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateAppCommandError - */ -const de_UpdateAppCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalError": - case "com.amazonaws.sms#InternalError": - throw await de_InternalErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.sms#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MissingRequiredParameterException": - case "com.amazonaws.sms#MissingRequiredParameterException": - throw await de_MissingRequiredParameterExceptionRes(parsedOutput, context); - case "OperationNotPermittedException": - case "com.amazonaws.sms#OperationNotPermittedException": - throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateReplicationJobCommand */ @@ -2612,7 +1341,7 @@ export const de_UpdateReplicationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateReplicationJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2625,12 +1354,9 @@ export const de_UpdateReplicationJobCommand = async ( }; /** - * deserializeAws_json1_1UpdateReplicationJobCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateReplicationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2649,25 +1375,37 @@ const de_UpdateReplicationJobCommandError = async ( case "OperationNotPermittedException": case "com.amazonaws.sms#OperationNotPermittedException": throw await de_OperationNotPermittedExceptionRes(parsedOutput, context); - case "ReplicationJobNotFoundException": - case "com.amazonaws.sms#ReplicationJobNotFoundException": - throw await de_ReplicationJobNotFoundExceptionRes(parsedOutput, context); + case "UnauthorizedOperationException": + case "com.amazonaws.sms#UnauthorizedOperationException": + throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); + case "NoConnectorsAvailableException": + case "com.amazonaws.sms#NoConnectorsAvailableException": + throw await de_NoConnectorsAvailableExceptionRes(parsedOutput, context); + case "ReplicationJobAlreadyExistsException": + case "com.amazonaws.sms#ReplicationJobAlreadyExistsException": + throw await de_ReplicationJobAlreadyExistsExceptionRes(parsedOutput, context); case "ServerCannotBeReplicatedException": case "com.amazonaws.sms#ServerCannotBeReplicatedException": throw await de_ServerCannotBeReplicatedExceptionRes(parsedOutput, context); case "TemporarilyUnavailableException": case "com.amazonaws.sms#TemporarilyUnavailableException": throw await de_TemporarilyUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.sms#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); + case "ReplicationJobNotFoundException": + case "com.amazonaws.sms#ReplicationJobNotFoundException": + throw await de_ReplicationJobNotFoundExceptionRes(parsedOutput, context); + case "DryRunOperationException": + case "com.amazonaws.sms#DryRunOperationException": + throw await de_DryRunOperationExceptionRes(parsedOutput, context); + case "ReplicationRunLimitExceededException": + case "com.amazonaws.sms#ReplicationRunLimitExceededException": + throw await de_ReplicationRunLimitExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts b/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts index 4d8b5ee31326..f0a23bb254d8 100644 --- a/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts +++ b/clients/client-snow-device-management/src/protocols/Aws_restJson1.ts @@ -329,7 +329,7 @@ export const de_CancelTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CancelTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -342,44 +342,6 @@ export const de_CancelTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelTaskCommandError - */ -const de_CancelTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.snowdevicemanagement#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.snowdevicemanagement#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.snowdevicemanagement#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.snowdevicemanagement#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateTaskCommand */ @@ -388,7 +350,7 @@ export const de_CreateTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -402,47 +364,6 @@ export const de_CreateTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTaskCommandError - */ -const de_CreateTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.snowdevicemanagement#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.snowdevicemanagement#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.snowdevicemanagement#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.snowdevicemanagement#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.snowdevicemanagement#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDeviceCommand */ @@ -451,7 +372,7 @@ export const de_DescribeDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -474,44 +395,6 @@ export const de_DescribeDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDeviceCommandError - */ -const de_DescribeDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.snowdevicemanagement#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.snowdevicemanagement#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.snowdevicemanagement#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.snowdevicemanagement#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDeviceEc2InstancesCommand */ @@ -520,7 +403,7 @@ export const de_DescribeDeviceEc2InstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDeviceEc2InstancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -533,44 +416,6 @@ export const de_DescribeDeviceEc2InstancesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDeviceEc2InstancesCommandError - */ -const de_DescribeDeviceEc2InstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.snowdevicemanagement#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.snowdevicemanagement#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.snowdevicemanagement#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.snowdevicemanagement#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeExecutionCommand */ @@ -579,7 +424,7 @@ export const de_DescribeExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeExecutionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -597,44 +442,6 @@ export const de_DescribeExecutionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeExecutionCommandError - */ -const de_DescribeExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.snowdevicemanagement#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.snowdevicemanagement#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.snowdevicemanagement#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.snowdevicemanagement#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeTaskCommand */ @@ -643,7 +450,7 @@ export const de_DescribeTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeTaskCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -664,44 +471,6 @@ export const de_DescribeTaskCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeTaskCommandError - */ -const de_DescribeTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.snowdevicemanagement#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.snowdevicemanagement#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.snowdevicemanagement#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.snowdevicemanagement#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDeviceResourcesCommand */ @@ -710,7 +479,7 @@ export const de_ListDeviceResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDeviceResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -724,44 +493,6 @@ export const de_ListDeviceResourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDeviceResourcesCommandError - */ -const de_ListDeviceResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.snowdevicemanagement#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.snowdevicemanagement#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.snowdevicemanagement#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.snowdevicemanagement#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDevicesCommand */ @@ -770,7 +501,7 @@ export const de_ListDevicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDevicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -784,41 +515,6 @@ export const de_ListDevicesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDevicesCommandError - */ -const de_ListDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.snowdevicemanagement#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.snowdevicemanagement#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.snowdevicemanagement#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.snowdevicemanagement#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListExecutionsCommand */ @@ -827,7 +523,7 @@ export const de_ListExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListExecutionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -841,44 +537,6 @@ export const de_ListExecutionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListExecutionsCommandError - */ -const de_ListExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.snowdevicemanagement#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.snowdevicemanagement#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.snowdevicemanagement#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.snowdevicemanagement#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -887,7 +545,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -900,38 +558,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.snowdevicemanagement#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.snowdevicemanagement#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTasksCommand */ @@ -940,7 +566,7 @@ export const de_ListTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTasksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -954,41 +580,6 @@ export const de_ListTasksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTasksCommandError - */ -const de_ListTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.snowdevicemanagement#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.snowdevicemanagement#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.snowdevicemanagement#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.snowdevicemanagement#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -997,7 +588,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1006,38 +597,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.snowdevicemanagement#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.snowdevicemanagement#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1046,7 +605,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1056,34 +615,40 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.snowdevicemanagement#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.snowdevicemanagement#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.snowdevicemanagement#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.snowdevicemanagement#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.snowdevicemanagement#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.snowdevicemanagement#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-snowball/src/protocols/Aws_json1_1.ts b/clients/client-snowball/src/protocols/Aws_json1_1.ts index c02fcf90e15b..83db369c7fcb 100644 --- a/clients/client-snowball/src/protocols/Aws_json1_1.ts +++ b/clients/client-snowball/src/protocols/Aws_json1_1.ts @@ -513,7 +513,7 @@ export const de_CancelClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -525,38 +525,6 @@ export const de_CancelClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelClusterCommandError - */ -const de_CancelClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidJobStateException": - case "com.amazonaws.snowball#InvalidJobStateException": - throw await de_InvalidJobStateExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - case "KMSRequestFailedException": - case "com.amazonaws.snowball#KMSRequestFailedException": - throw await de_KMSRequestFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelJobCommand */ @@ -565,7 +533,7 @@ export const de_CancelJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -577,38 +545,6 @@ export const de_CancelJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelJobCommandError - */ -const de_CancelJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidJobStateException": - case "com.amazonaws.snowball#InvalidJobStateException": - throw await de_InvalidJobStateExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - case "KMSRequestFailedException": - case "com.amazonaws.snowball#KMSRequestFailedException": - throw await de_KMSRequestFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAddressCommand */ @@ -617,7 +553,7 @@ export const de_CreateAddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAddressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -629,35 +565,6 @@ export const de_CreateAddressCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAddressCommandError - */ -const de_CreateAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddressException": - case "com.amazonaws.snowball#InvalidAddressException": - throw await de_InvalidAddressExceptionRes(parsedOutput, context); - case "UnsupportedAddressException": - case "com.amazonaws.snowball#UnsupportedAddressException": - throw await de_UnsupportedAddressExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateClusterCommand */ @@ -666,7 +573,7 @@ export const de_CreateClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -678,41 +585,6 @@ export const de_CreateClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateClusterCommandError - */ -const de_CreateClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "Ec2RequestFailedException": - case "com.amazonaws.snowball#Ec2RequestFailedException": - throw await de_Ec2RequestFailedExceptionRes(parsedOutput, context); - case "InvalidInputCombinationException": - case "com.amazonaws.snowball#InvalidInputCombinationException": - throw await de_InvalidInputCombinationExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - case "KMSRequestFailedException": - case "com.amazonaws.snowball#KMSRequestFailedException": - throw await de_KMSRequestFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateJobCommand */ @@ -721,7 +593,7 @@ export const de_CreateJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -733,44 +605,6 @@ export const de_CreateJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateJobCommandError - */ -const de_CreateJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterLimitExceededException": - case "com.amazonaws.snowball#ClusterLimitExceededException": - throw await de_ClusterLimitExceededExceptionRes(parsedOutput, context); - case "Ec2RequestFailedException": - case "com.amazonaws.snowball#Ec2RequestFailedException": - throw await de_Ec2RequestFailedExceptionRes(parsedOutput, context); - case "InvalidInputCombinationException": - case "com.amazonaws.snowball#InvalidInputCombinationException": - throw await de_InvalidInputCombinationExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - case "KMSRequestFailedException": - case "com.amazonaws.snowball#KMSRequestFailedException": - throw await de_KMSRequestFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLongTermPricingCommand */ @@ -779,7 +613,7 @@ export const de_CreateLongTermPricingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLongTermPricingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -791,32 +625,6 @@ export const de_CreateLongTermPricingCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateLongTermPricingCommandError - */ -const de_CreateLongTermPricingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateReturnShippingLabelCommand */ @@ -825,7 +633,7 @@ export const de_CreateReturnShippingLabelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateReturnShippingLabelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -837,44 +645,6 @@ export const de_CreateReturnShippingLabelCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateReturnShippingLabelCommandError - */ -const de_CreateReturnShippingLabelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.snowball#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidInputCombinationException": - case "com.amazonaws.snowball#InvalidInputCombinationException": - throw await de_InvalidInputCombinationExceptionRes(parsedOutput, context); - case "InvalidJobStateException": - case "com.amazonaws.snowball#InvalidJobStateException": - throw await de_InvalidJobStateExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - case "ReturnShippingLabelAlreadyExistsException": - case "com.amazonaws.snowball#ReturnShippingLabelAlreadyExistsException": - throw await de_ReturnShippingLabelAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAddressCommand */ @@ -883,7 +653,7 @@ export const de_DescribeAddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAddressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -895,32 +665,6 @@ export const de_DescribeAddressCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAddressCommandError - */ -const de_DescribeAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAddressesCommand */ @@ -929,7 +673,7 @@ export const de_DescribeAddressesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAddressesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -941,35 +685,6 @@ export const de_DescribeAddressesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAddressesCommandError - */ -const de_DescribeAddressesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.snowball#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeClusterCommand */ @@ -978,7 +693,7 @@ export const de_DescribeClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -990,32 +705,6 @@ export const de_DescribeClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeClusterCommandError - */ -const de_DescribeClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeJobCommand */ @@ -1024,7 +713,7 @@ export const de_DescribeJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1036,32 +725,6 @@ export const de_DescribeJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeJobCommandError - */ -const de_DescribeJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeReturnShippingLabelCommand */ @@ -1070,7 +733,7 @@ export const de_DescribeReturnShippingLabelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeReturnShippingLabelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1082,38 +745,6 @@ export const de_DescribeReturnShippingLabelCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeReturnShippingLabelCommandError - */ -const de_DescribeReturnShippingLabelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.snowball#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InvalidJobStateException": - case "com.amazonaws.snowball#InvalidJobStateException": - throw await de_InvalidJobStateExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetJobManifestCommand */ @@ -1122,7 +753,7 @@ export const de_GetJobManifestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetJobManifestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1134,35 +765,6 @@ export const de_GetJobManifestCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetJobManifestCommandError - */ -const de_GetJobManifestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidJobStateException": - case "com.amazonaws.snowball#InvalidJobStateException": - throw await de_InvalidJobStateExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetJobUnlockCodeCommand */ @@ -1171,7 +773,7 @@ export const de_GetJobUnlockCodeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetJobUnlockCodeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1183,35 +785,6 @@ export const de_GetJobUnlockCodeCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetJobUnlockCodeCommandError - */ -const de_GetJobUnlockCodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidJobStateException": - case "com.amazonaws.snowball#InvalidJobStateException": - throw await de_InvalidJobStateExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetSnowballUsageCommand */ @@ -1220,7 +793,7 @@ export const de_GetSnowballUsageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSnowballUsageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1232,26 +805,6 @@ export const de_GetSnowballUsageCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetSnowballUsageCommandError - */ -const de_GetSnowballUsageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1GetSoftwareUpdatesCommand */ @@ -1260,7 +813,7 @@ export const de_GetSoftwareUpdatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSoftwareUpdatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1272,35 +825,6 @@ export const de_GetSoftwareUpdatesCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetSoftwareUpdatesCommandError - */ -const de_GetSoftwareUpdatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidJobStateException": - case "com.amazonaws.snowball#InvalidJobStateException": - throw await de_InvalidJobStateExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListClusterJobsCommand */ @@ -1309,7 +833,7 @@ export const de_ListClusterJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListClusterJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1321,35 +845,6 @@ export const de_ListClusterJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListClusterJobsCommandError - */ -const de_ListClusterJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.snowball#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListClustersCommand */ @@ -1358,7 +853,7 @@ export const de_ListClustersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListClustersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1370,32 +865,6 @@ export const de_ListClustersCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListClustersCommandError - */ -const de_ListClustersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.snowball#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListCompatibleImagesCommand */ @@ -1404,7 +873,7 @@ export const de_ListCompatibleImagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListCompatibleImagesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1416,35 +885,6 @@ export const de_ListCompatibleImagesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListCompatibleImagesCommandError - */ -const de_ListCompatibleImagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "Ec2RequestFailedException": - case "com.amazonaws.snowball#Ec2RequestFailedException": - throw await de_Ec2RequestFailedExceptionRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.snowball#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListJobsCommand */ @@ -1453,7 +893,7 @@ export const de_ListJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1465,32 +905,6 @@ export const de_ListJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListJobsCommandError - */ -const de_ListJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.snowball#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListLongTermPricingCommand */ @@ -1499,7 +913,7 @@ export const de_ListLongTermPricingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListLongTermPricingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1511,35 +925,6 @@ export const de_ListLongTermPricingCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListLongTermPricingCommandError - */ -const de_ListLongTermPricingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.snowball#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListPickupLocationsCommand */ @@ -1548,7 +933,7 @@ export const de_ListPickupLocationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPickupLocationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1560,32 +945,6 @@ export const de_ListPickupLocationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListPickupLocationsCommandError - */ -const de_ListPickupLocationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListServiceVersionsCommand */ @@ -1594,7 +953,7 @@ export const de_ListServiceVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListServiceVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1606,35 +965,6 @@ export const de_ListServiceVersionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListServiceVersionsCommandError - */ -const de_ListServiceVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidNextTokenException": - case "com.amazonaws.snowball#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateClusterCommand */ @@ -1643,7 +973,7 @@ export const de_UpdateClusterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateClusterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1655,44 +985,6 @@ export const de_UpdateClusterCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateClusterCommandError - */ -const de_UpdateClusterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "Ec2RequestFailedException": - case "com.amazonaws.snowball#Ec2RequestFailedException": - throw await de_Ec2RequestFailedExceptionRes(parsedOutput, context); - case "InvalidInputCombinationException": - case "com.amazonaws.snowball#InvalidInputCombinationException": - throw await de_InvalidInputCombinationExceptionRes(parsedOutput, context); - case "InvalidJobStateException": - case "com.amazonaws.snowball#InvalidJobStateException": - throw await de_InvalidJobStateExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - case "KMSRequestFailedException": - case "com.amazonaws.snowball#KMSRequestFailedException": - throw await de_KMSRequestFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateJobCommand */ @@ -1701,7 +993,7 @@ export const de_UpdateJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1713,47 +1005,6 @@ export const de_UpdateJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateJobCommandError - */ -const de_UpdateJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ClusterLimitExceededException": - case "com.amazonaws.snowball#ClusterLimitExceededException": - throw await de_ClusterLimitExceededExceptionRes(parsedOutput, context); - case "Ec2RequestFailedException": - case "com.amazonaws.snowball#Ec2RequestFailedException": - throw await de_Ec2RequestFailedExceptionRes(parsedOutput, context); - case "InvalidInputCombinationException": - case "com.amazonaws.snowball#InvalidInputCombinationException": - throw await de_InvalidInputCombinationExceptionRes(parsedOutput, context); - case "InvalidJobStateException": - case "com.amazonaws.snowball#InvalidJobStateException": - throw await de_InvalidJobStateExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - case "KMSRequestFailedException": - case "com.amazonaws.snowball#KMSRequestFailedException": - throw await de_KMSRequestFailedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateJobShipmentStateCommand */ @@ -1762,7 +1013,7 @@ export const de_UpdateJobShipmentStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateJobShipmentStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1774,35 +1025,6 @@ export const de_UpdateJobShipmentStateCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateJobShipmentStateCommandError - */ -const de_UpdateJobShipmentStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidJobStateException": - case "com.amazonaws.snowball#InvalidJobStateException": - throw await de_InvalidJobStateExceptionRes(parsedOutput, context); - case "InvalidResourceException": - case "com.amazonaws.snowball#InvalidResourceException": - throw await de_InvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateLongTermPricingCommand */ @@ -1811,7 +1033,7 @@ export const de_UpdateLongTermPricingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateLongTermPricingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1824,28 +1046,55 @@ export const de_UpdateLongTermPricingCommand = async ( }; /** - * deserializeAws_json1_1UpdateLongTermPricingCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateLongTermPricingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "InvalidJobStateException": + case "com.amazonaws.snowball#InvalidJobStateException": + throw await de_InvalidJobStateExceptionRes(parsedOutput, context); case "InvalidResourceException": case "com.amazonaws.snowball#InvalidResourceException": throw await de_InvalidResourceExceptionRes(parsedOutput, context); + case "KMSRequestFailedException": + case "com.amazonaws.snowball#KMSRequestFailedException": + throw await de_KMSRequestFailedExceptionRes(parsedOutput, context); + case "InvalidAddressException": + case "com.amazonaws.snowball#InvalidAddressException": + throw await de_InvalidAddressExceptionRes(parsedOutput, context); + case "UnsupportedAddressException": + case "com.amazonaws.snowball#UnsupportedAddressException": + throw await de_UnsupportedAddressExceptionRes(parsedOutput, context); + case "Ec2RequestFailedException": + case "com.amazonaws.snowball#Ec2RequestFailedException": + throw await de_Ec2RequestFailedExceptionRes(parsedOutput, context); + case "InvalidInputCombinationException": + case "com.amazonaws.snowball#InvalidInputCombinationException": + throw await de_InvalidInputCombinationExceptionRes(parsedOutput, context); + case "ClusterLimitExceededException": + case "com.amazonaws.snowball#ClusterLimitExceededException": + throw await de_ClusterLimitExceededExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.snowball#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ReturnShippingLabelAlreadyExistsException": + case "com.amazonaws.snowball#ReturnShippingLabelAlreadyExistsException": + throw await de_ReturnShippingLabelAlreadyExistsExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.snowball#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-sns/src/protocols/Aws_query.ts b/clients/client-sns/src/protocols/Aws_query.ts index a60fb50ef0b9..383b80a3c140 100644 --- a/clients/client-sns/src/protocols/Aws_query.ts +++ b/clients/client-sns/src/protocols/Aws_query.ts @@ -979,7 +979,7 @@ export const de_AddPermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddPermissionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AddPermissionCommandOutput = { @@ -988,41 +988,6 @@ export const de_AddPermissionCommand = async ( return response; }; -/** - * deserializeAws_queryAddPermissionCommandError - */ -const de_AddPermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCheckIfPhoneNumberIsOptedOutCommand */ @@ -1031,7 +996,7 @@ export const de_CheckIfPhoneNumberIsOptedOutCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CheckIfPhoneNumberIsOptedOutCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1043,41 +1008,6 @@ export const de_CheckIfPhoneNumberIsOptedOutCommand = async ( return response; }; -/** - * deserializeAws_queryCheckIfPhoneNumberIsOptedOutCommandError - */ -const de_CheckIfPhoneNumberIsOptedOutCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "Throttled": - case "com.amazonaws.sns#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryConfirmSubscriptionCommand */ @@ -1086,7 +1016,7 @@ export const de_ConfirmSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ConfirmSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1098,50 +1028,6 @@ export const de_ConfirmSubscriptionCommand = async ( return response; }; -/** - * deserializeAws_queryConfirmSubscriptionCommandError - */ -const de_ConfirmSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "FilterPolicyLimitExceeded": - case "com.amazonaws.sns#FilterPolicyLimitExceededException": - throw await de_FilterPolicyLimitExceededExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ReplayLimitExceeded": - case "com.amazonaws.sns#ReplayLimitExceededException": - throw await de_ReplayLimitExceededExceptionRes(parsedOutput, context); - case "SubscriptionLimitExceeded": - case "com.amazonaws.sns#SubscriptionLimitExceededException": - throw await de_SubscriptionLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreatePlatformApplicationCommand */ @@ -1150,7 +1036,7 @@ export const de_CreatePlatformApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePlatformApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1162,38 +1048,6 @@ export const de_CreatePlatformApplicationCommand = async ( return response; }; -/** - * deserializeAws_queryCreatePlatformApplicationCommandError - */ -const de_CreatePlatformApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryCreatePlatformEndpointCommand */ @@ -1202,7 +1056,7 @@ export const de_CreatePlatformEndpointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePlatformEndpointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1215,54 +1069,39 @@ export const de_CreatePlatformEndpointCommand = async ( }; /** - * deserializeAws_queryCreatePlatformEndpointCommandError + * deserializeAws_queryCreateSMSSandboxPhoneNumberCommand */ -const de_CreatePlatformEndpointCommandError = async ( +export const de_CreateSMSSandboxPhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateSMSSandboxPhoneNumberResult(data.CreateSMSSandboxPhoneNumberResult, context); + const response: CreateSMSSandboxPhoneNumberCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryCreateSMSSandboxPhoneNumberCommand + * deserializeAws_queryCreateTopicCommand */ -export const de_CreateSMSSandboxPhoneNumberCommand = async ( +export const de_CreateTopicCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateSMSSandboxPhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateSMSSandboxPhoneNumberResult(data.CreateSMSSandboxPhoneNumberResult, context); - const response: CreateSMSSandboxPhoneNumberCommandOutput = { + contents = de_CreateTopicResponse(data.CreateTopicResult, context); + const response: CreateTopicCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1270,60 +1109,53 @@ export const de_CreateSMSSandboxPhoneNumberCommand = async ( }; /** - * deserializeAws_queryCreateSMSSandboxPhoneNumberCommandError + * deserializeAws_queryDeleteEndpointCommand */ -const de_CreateSMSSandboxPhoneNumberCommandError = async ( +export const de_DeleteEndpointCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeleteEndpointCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OptedOut": - case "com.amazonaws.sns#OptedOutException": - throw await de_OptedOutExceptionRes(parsedOutput, context); - case "Throttled": - case "com.amazonaws.sns#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - case "UserError": - case "com.amazonaws.sns#UserErrorException": - throw await de_UserErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_queryDeletePlatformApplicationCommand + */ +export const de_DeletePlatformApplicationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeletePlatformApplicationCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryCreateTopicCommand + * deserializeAws_queryDeleteSMSSandboxPhoneNumberCommand */ -export const de_CreateTopicCommand = async ( +export const de_DeleteSMSSandboxPhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateTopicCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateTopicResponse(data.CreateTopicResult, context); - const response: CreateTopicCommandOutput = { + contents = de_DeleteSMSSandboxPhoneNumberResult(data.DeleteSMSSandboxPhoneNumberResult, context); + const response: DeleteSMSSandboxPhoneNumberCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1331,167 +1163,76 @@ export const de_CreateTopicCommand = async ( }; /** - * deserializeAws_queryCreateTopicCommandError + * deserializeAws_queryDeleteTopicCommand */ -const de_CreateTopicCommandError = async ( +export const de_DeleteTopicCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "ConcurrentAccess": - case "com.amazonaws.sns#ConcurrentAccessException": - throw await de_ConcurrentAccessExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sns#InvalidSecurityException": - throw await de_InvalidSecurityExceptionRes(parsedOutput, context); - case "StaleTag": - case "com.amazonaws.sns#StaleTagException": - throw await de_StaleTagExceptionRes(parsedOutput, context); - case "TagLimitExceeded": - case "com.amazonaws.sns#TagLimitExceededException": - throw await de_TagLimitExceededExceptionRes(parsedOutput, context); - case "TagPolicy": - case "com.amazonaws.sns#TagPolicyException": - throw await de_TagPolicyExceptionRes(parsedOutput, context); - case "TopicLimitExceeded": - case "com.amazonaws.sns#TopicLimitExceededException": - throw await de_TopicLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeleteEndpointCommand - */ -export const de_DeleteEndpointCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteEndpointCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteEndpointCommandOutput = { + const response: DeleteTopicCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_queryDeleteEndpointCommandError - */ -const de_DeleteEndpointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryDeletePlatformApplicationCommand + * deserializeAws_queryGetDataProtectionPolicyCommand */ -export const de_DeletePlatformApplicationCommand = async ( +export const de_GetDataProtectionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeletePlatformApplicationCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeletePlatformApplicationCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetDataProtectionPolicyResponse(data.GetDataProtectionPolicyResult, context); + const response: GetDataProtectionPolicyCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeletePlatformApplicationCommandError + * deserializeAws_queryGetEndpointAttributesCommand */ -const de_DeletePlatformApplicationCommandError = async ( +export const de_GetEndpointAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetEndpointAttributesResponse(data.GetEndpointAttributesResult, context); + const response: GetEndpointAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteSMSSandboxPhoneNumberCommand + * deserializeAws_queryGetPlatformApplicationAttributesCommand */ -export const de_DeleteSMSSandboxPhoneNumberCommand = async ( +export const de_GetPlatformApplicationAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSMSSandboxPhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DeleteSMSSandboxPhoneNumberResult(data.DeleteSMSSandboxPhoneNumberResult, context); - const response: DeleteSMSSandboxPhoneNumberCommandOutput = { + contents = de_GetPlatformApplicationAttributesResponse(data.GetPlatformApplicationAttributesResult, context); + const response: GetPlatformApplicationAttributesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1499,124 +1240,79 @@ export const de_DeleteSMSSandboxPhoneNumberCommand = async ( }; /** - * deserializeAws_queryDeleteSMSSandboxPhoneNumberCommandError + * deserializeAws_queryGetSMSAttributesCommand */ -const de_DeleteSMSSandboxPhoneNumberCommandError = async ( +export const de_GetSMSAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "Throttled": - case "com.amazonaws.sns#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - case "UserError": - case "com.amazonaws.sns#UserErrorException": - throw await de_UserErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetSMSAttributesResponse(data.GetSMSAttributesResult, context); + const response: GetSMSAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryDeleteTopicCommand + * deserializeAws_queryGetSMSSandboxAccountStatusCommand */ -export const de_DeleteTopicCommand = async ( +export const de_GetSMSSandboxAccountStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteTopicCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteTopicCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetSMSSandboxAccountStatusResult(data.GetSMSSandboxAccountStatusResult, context); + const response: GetSMSSandboxAccountStatusCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_queryDeleteTopicCommandError + * deserializeAws_queryGetSubscriptionAttributesCommand */ -const de_DeleteTopicCommandError = async ( +export const de_GetSubscriptionAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "ConcurrentAccess": - case "com.amazonaws.sns#ConcurrentAccessException": - throw await de_ConcurrentAccessExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidState": - case "com.amazonaws.sns#InvalidStateException": - throw await de_InvalidStateExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "StaleTag": - case "com.amazonaws.sns#StaleTagException": - throw await de_StaleTagExceptionRes(parsedOutput, context); - case "TagPolicy": - case "com.amazonaws.sns#TagPolicyException": - throw await de_TagPolicyExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetSubscriptionAttributesResponse(data.GetSubscriptionAttributesResult, context); + const response: GetSubscriptionAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGetDataProtectionPolicyCommand + * deserializeAws_queryGetTopicAttributesCommand */ -export const de_GetDataProtectionPolicyCommand = async ( +export const de_GetTopicAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetDataProtectionPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetDataProtectionPolicyResponse(data.GetDataProtectionPolicyResult, context); - const response: GetDataProtectionPolicyCommandOutput = { + contents = de_GetTopicAttributesResponse(data.GetTopicAttributesResult, context); + const response: GetTopicAttributesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1624,57 +1320,19 @@ export const de_GetDataProtectionPolicyCommand = async ( }; /** - * deserializeAws_queryGetDataProtectionPolicyCommandError - */ -const de_GetDataProtectionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sns#InvalidSecurityException": - throw await de_InvalidSecurityExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetEndpointAttributesCommand + * deserializeAws_queryListEndpointsByPlatformApplicationCommand */ -export const de_GetEndpointAttributesCommand = async ( +export const de_ListEndpointsByPlatformApplicationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetEndpointAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetEndpointAttributesResponse(data.GetEndpointAttributesResult, context); - const response: GetEndpointAttributesCommandOutput = { + contents = de_ListEndpointsByPlatformApplicationResponse(data.ListEndpointsByPlatformApplicationResult, context); + const response: ListEndpointsByPlatformApplicationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1682,54 +1340,19 @@ export const de_GetEndpointAttributesCommand = async ( }; /** - * deserializeAws_queryGetEndpointAttributesCommandError - */ -const de_GetEndpointAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetPlatformApplicationAttributesCommand + * deserializeAws_queryListOriginationNumbersCommand */ -export const de_GetPlatformApplicationAttributesCommand = async ( +export const de_ListOriginationNumbersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetPlatformApplicationAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetPlatformApplicationAttributesResponse(data.GetPlatformApplicationAttributesResult, context); - const response: GetPlatformApplicationAttributesCommandOutput = { + contents = de_ListOriginationNumbersResult(data.ListOriginationNumbersResult, context); + const response: ListOriginationNumbersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1737,54 +1360,19 @@ export const de_GetPlatformApplicationAttributesCommand = async ( }; /** - * deserializeAws_queryGetPlatformApplicationAttributesCommandError - */ -const de_GetPlatformApplicationAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetSMSAttributesCommand + * deserializeAws_queryListPhoneNumbersOptedOutCommand */ -export const de_GetSMSAttributesCommand = async ( +export const de_ListPhoneNumbersOptedOutCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetSMSAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetSMSAttributesResponse(data.GetSMSAttributesResult, context); - const response: GetSMSAttributesCommandOutput = { + contents = de_ListPhoneNumbersOptedOutResponse(data.ListPhoneNumbersOptedOutResult, context); + const response: ListPhoneNumbersOptedOutCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1792,54 +1380,39 @@ export const de_GetSMSAttributesCommand = async ( }; /** - * deserializeAws_queryGetSMSAttributesCommandError + * deserializeAws_queryListPlatformApplicationsCommand */ -const de_GetSMSAttributesCommandError = async ( +export const de_ListPlatformApplicationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "Throttled": - case "com.amazonaws.sns#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListPlatformApplicationsResponse(data.ListPlatformApplicationsResult, context); + const response: ListPlatformApplicationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGetSMSSandboxAccountStatusCommand + * deserializeAws_queryListSMSSandboxPhoneNumbersCommand */ -export const de_GetSMSSandboxAccountStatusCommand = async ( +export const de_ListSMSSandboxPhoneNumbersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetSMSSandboxAccountStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetSMSSandboxAccountStatusResult(data.GetSMSSandboxAccountStatusResult, context); - const response: GetSMSSandboxAccountStatusCommandOutput = { + contents = de_ListSMSSandboxPhoneNumbersResult(data.ListSMSSandboxPhoneNumbersResult, context); + const response: ListSMSSandboxPhoneNumbersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1847,51 +1420,39 @@ export const de_GetSMSSandboxAccountStatusCommand = async ( }; /** - * deserializeAws_queryGetSMSSandboxAccountStatusCommandError + * deserializeAws_queryListSubscriptionsCommand */ -const de_GetSMSSandboxAccountStatusCommandError = async ( +export const de_ListSubscriptionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "Throttled": - case "com.amazonaws.sns#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListSubscriptionsResponse(data.ListSubscriptionsResult, context); + const response: ListSubscriptionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_queryGetSubscriptionAttributesCommand + * deserializeAws_queryListSubscriptionsByTopicCommand */ -export const de_GetSubscriptionAttributesCommand = async ( +export const de_ListSubscriptionsByTopicCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetSubscriptionAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetSubscriptionAttributesResponse(data.GetSubscriptionAttributesResult, context); - const response: GetSubscriptionAttributesCommandOutput = { + contents = de_ListSubscriptionsByTopicResponse(data.ListSubscriptionsByTopicResult, context); + const response: ListSubscriptionsByTopicCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1899,1064 +1460,79 @@ export const de_GetSubscriptionAttributesCommand = async ( }; /** - * deserializeAws_queryGetSubscriptionAttributesCommandError + * deserializeAws_queryListTagsForResourceCommand */ -const de_GetSubscriptionAttributesCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryGetTopicAttributesCommand - */ -export const de_GetTopicAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetTopicAttributesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetTopicAttributesResponse(data.GetTopicAttributesResult, context); - const response: GetTopicAttributesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryGetTopicAttributesCommandError - */ -const de_GetTopicAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sns#InvalidSecurityException": - throw await de_InvalidSecurityExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListEndpointsByPlatformApplicationCommand - */ -export const de_ListEndpointsByPlatformApplicationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListEndpointsByPlatformApplicationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListEndpointsByPlatformApplicationResponse(data.ListEndpointsByPlatformApplicationResult, context); - const response: ListEndpointsByPlatformApplicationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListEndpointsByPlatformApplicationCommandError - */ -const de_ListEndpointsByPlatformApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListOriginationNumbersCommand - */ -export const de_ListOriginationNumbersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListOriginationNumbersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListOriginationNumbersResult(data.ListOriginationNumbersResult, context); - const response: ListOriginationNumbersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListOriginationNumbersCommandError - */ -const de_ListOriginationNumbersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "Throttled": - case "com.amazonaws.sns#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListPhoneNumbersOptedOutCommand - */ -export const de_ListPhoneNumbersOptedOutCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPhoneNumbersOptedOutCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListPhoneNumbersOptedOutResponse(data.ListPhoneNumbersOptedOutResult, context); - const response: ListPhoneNumbersOptedOutCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListPhoneNumbersOptedOutCommandError - */ -const de_ListPhoneNumbersOptedOutCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "Throttled": - case "com.amazonaws.sns#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListPlatformApplicationsCommand - */ -export const de_ListPlatformApplicationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPlatformApplicationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListPlatformApplicationsResponse(data.ListPlatformApplicationsResult, context); - const response: ListPlatformApplicationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListPlatformApplicationsCommandError - */ -const de_ListPlatformApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListSMSSandboxPhoneNumbersCommand - */ -export const de_ListSMSSandboxPhoneNumbersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSMSSandboxPhoneNumbersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListSMSSandboxPhoneNumbersResult(data.ListSMSSandboxPhoneNumbersResult, context); - const response: ListSMSSandboxPhoneNumbersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListSMSSandboxPhoneNumbersCommandError - */ -const de_ListSMSSandboxPhoneNumbersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "Throttled": - case "com.amazonaws.sns#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListSubscriptionsCommand - */ -export const de_ListSubscriptionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSubscriptionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListSubscriptionsResponse(data.ListSubscriptionsResult, context); - const response: ListSubscriptionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListSubscriptionsCommandError - */ -const de_ListSubscriptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListSubscriptionsByTopicCommand - */ -export const de_ListSubscriptionsByTopicCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSubscriptionsByTopicCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListSubscriptionsByTopicResponse(data.ListSubscriptionsByTopicResult, context); - const response: ListSubscriptionsByTopicCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListSubscriptionsByTopicCommandError - */ -const de_ListSubscriptionsByTopicCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListTagsForResourceResponse(data.ListTagsForResourceResult, context); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "ConcurrentAccess": - case "com.amazonaws.sns#ConcurrentAccessException": - throw await de_ConcurrentAccessExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TagPolicy": - case "com.amazonaws.sns#TagPolicyException": - throw await de_TagPolicyExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryListTopicsCommand - */ -export const de_ListTopicsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTopicsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListTopicsResponse(data.ListTopicsResult, context); - const response: ListTopicsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryListTopicsCommandError - */ -const de_ListTopicsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryOptInPhoneNumberCommand - */ -export const de_OptInPhoneNumberCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_OptInPhoneNumberCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_OptInPhoneNumberResponse(data.OptInPhoneNumberResult, context); - const response: OptInPhoneNumberCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryOptInPhoneNumberCommandError - */ -const de_OptInPhoneNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "Throttled": - case "com.amazonaws.sns#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPublishCommand - */ -export const de_PublishCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PublishCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PublishResponse(data.PublishResult, context); - const response: PublishCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryPublishCommandError - */ -const de_PublishCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "EndpointDisabled": - case "com.amazonaws.sns#EndpointDisabledException": - throw await de_EndpointDisabledExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sns#InvalidSecurityException": - throw await de_InvalidSecurityExceptionRes(parsedOutput, context); - case "KMSAccessDenied": - case "com.amazonaws.sns#KMSAccessDeniedException": - throw await de_KMSAccessDeniedExceptionRes(parsedOutput, context); - case "KMSDisabled": - case "com.amazonaws.sns#KMSDisabledException": - throw await de_KMSDisabledExceptionRes(parsedOutput, context); - case "KMSInvalidState": - case "com.amazonaws.sns#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KMSNotFound": - case "com.amazonaws.sns#KMSNotFoundException": - throw await de_KMSNotFoundExceptionRes(parsedOutput, context); - case "KMSOptInRequired": - case "com.amazonaws.sns#KMSOptInRequired": - throw await de_KMSOptInRequiredRes(parsedOutput, context); - case "KMSThrottling": - case "com.amazonaws.sns#KMSThrottlingException": - throw await de_KMSThrottlingExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ParameterValueInvalid": - case "com.amazonaws.sns#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PlatformApplicationDisabled": - case "com.amazonaws.sns#PlatformApplicationDisabledException": - throw await de_PlatformApplicationDisabledExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPublishBatchCommand - */ -export const de_PublishBatchCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PublishBatchCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_PublishBatchResponse(data.PublishBatchResult, context); - const response: PublishBatchCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_queryPublishBatchCommandError - */ -const de_PublishBatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "BatchEntryIdsNotDistinct": - case "com.amazonaws.sns#BatchEntryIdsNotDistinctException": - throw await de_BatchEntryIdsNotDistinctExceptionRes(parsedOutput, context); - case "BatchRequestTooLong": - case "com.amazonaws.sns#BatchRequestTooLongException": - throw await de_BatchRequestTooLongExceptionRes(parsedOutput, context); - case "EmptyBatchRequest": - case "com.amazonaws.sns#EmptyBatchRequestException": - throw await de_EmptyBatchRequestExceptionRes(parsedOutput, context); - case "EndpointDisabled": - case "com.amazonaws.sns#EndpointDisabledException": - throw await de_EndpointDisabledExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidBatchEntryId": - case "com.amazonaws.sns#InvalidBatchEntryIdException": - throw await de_InvalidBatchEntryIdExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sns#InvalidSecurityException": - throw await de_InvalidSecurityExceptionRes(parsedOutput, context); - case "KMSAccessDenied": - case "com.amazonaws.sns#KMSAccessDeniedException": - throw await de_KMSAccessDeniedExceptionRes(parsedOutput, context); - case "KMSDisabled": - case "com.amazonaws.sns#KMSDisabledException": - throw await de_KMSDisabledExceptionRes(parsedOutput, context); - case "KMSInvalidState": - case "com.amazonaws.sns#KMSInvalidStateException": - throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); - case "KMSNotFound": - case "com.amazonaws.sns#KMSNotFoundException": - throw await de_KMSNotFoundExceptionRes(parsedOutput, context); - case "KMSOptInRequired": - case "com.amazonaws.sns#KMSOptInRequired": - throw await de_KMSOptInRequiredRes(parsedOutput, context); - case "KMSThrottling": - case "com.amazonaws.sns#KMSThrottlingException": - throw await de_KMSThrottlingExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ParameterValueInvalid": - case "com.amazonaws.sns#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "PlatformApplicationDisabled": - case "com.amazonaws.sns#PlatformApplicationDisabledException": - throw await de_PlatformApplicationDisabledExceptionRes(parsedOutput, context); - case "TooManyEntriesInBatchRequest": - case "com.amazonaws.sns#TooManyEntriesInBatchRequestException": - throw await de_TooManyEntriesInBatchRequestExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.sns#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryPutDataProtectionPolicyCommand - */ -export const de_PutDataProtectionPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutDataProtectionPolicyCommandError(output, context); - } - await collectBody(output.body, context); - const response: PutDataProtectionPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryPutDataProtectionPolicyCommandError - */ -const de_PutDataProtectionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sns#InvalidSecurityException": - throw await de_InvalidSecurityExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_queryRemovePermissionCommand - */ -export const de_RemovePermissionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemovePermissionCommandError(output, context); - } - await collectBody(output.body, context); - const response: RemovePermissionCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_queryRemovePermissionCommandError - */ -const de_RemovePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - -/** - * deserializeAws_querySetEndpointAttributesCommand - */ -export const de_SetEndpointAttributesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SetEndpointAttributesCommandError(output, context); - } - await collectBody(output.body, context); - const response: SetEndpointAttributesCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_querySetEndpointAttributesCommandError - */ -const de_SetEndpointAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListTagsForResourceResponse(data.ListTagsForResourceResult, context); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_querySetPlatformApplicationAttributesCommand + * deserializeAws_queryListTopicsCommand */ -export const de_SetPlatformApplicationAttributesCommand = async ( +export const de_ListTopicsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetPlatformApplicationAttributesCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: SetPlatformApplicationAttributesCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListTopicsResponse(data.ListTopicsResult, context); + const response: ListTopicsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_querySetPlatformApplicationAttributesCommandError + * deserializeAws_queryOptInPhoneNumberCommand */ -const de_SetPlatformApplicationAttributesCommandError = async ( +export const de_OptInPhoneNumberCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_OptInPhoneNumberResponse(data.OptInPhoneNumberResult, context); + const response: OptInPhoneNumberCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_querySetSMSAttributesCommand + * deserializeAws_queryPublishCommand */ -export const de_SetSMSAttributesCommand = async ( +export const de_PublishCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetSMSAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_SetSMSAttributesResponse(data.SetSMSAttributesResult, context); - const response: SetSMSAttributesCommandOutput = { + contents = de_PublishResponse(data.PublishResult, context); + const response: PublishCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2964,234 +1540,161 @@ export const de_SetSMSAttributesCommand = async ( }; /** - * deserializeAws_querySetSMSAttributesCommandError + * deserializeAws_queryPublishBatchCommand */ -const de_SetSMSAttributesCommandError = async ( +export const de_PublishBatchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "Throttled": - case "com.amazonaws.sns#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_PublishBatchResponse(data.PublishBatchResult, context); + const response: PublishBatchCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_querySetSubscriptionAttributesCommand + * deserializeAws_queryPutDataProtectionPolicyCommand */ -export const de_SetSubscriptionAttributesCommand = async ( +export const de_PutDataProtectionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetSubscriptionAttributesCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: SetSubscriptionAttributesCommandOutput = { + const response: PutDataProtectionPolicyCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_querySetSubscriptionAttributesCommandError + * deserializeAws_queryRemovePermissionCommand */ -const de_SetSubscriptionAttributesCommandError = async ( +export const de_RemovePermissionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "FilterPolicyLimitExceeded": - case "com.amazonaws.sns#FilterPolicyLimitExceededException": - throw await de_FilterPolicyLimitExceededExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ReplayLimitExceeded": - case "com.amazonaws.sns#ReplayLimitExceededException": - throw await de_ReplayLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: RemovePermissionCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_querySetTopicAttributesCommand + * deserializeAws_querySetEndpointAttributesCommand */ -export const de_SetTopicAttributesCommand = async ( +export const de_SetEndpointAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetTopicAttributesCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: SetTopicAttributesCommandOutput = { + const response: SetEndpointAttributesCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_querySetTopicAttributesCommandError + * deserializeAws_querySetPlatformApplicationAttributesCommand */ -const de_SetTopicAttributesCommandError = async ( +export const de_SetPlatformApplicationAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sns#InvalidSecurityException": - throw await de_InvalidSecurityExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: SetPlatformApplicationAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_querySubscribeCommand + * deserializeAws_querySetSMSAttributesCommand */ -export const de_SubscribeCommand = async ( +export const de_SetSMSAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SubscribeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_SubscribeResponse(data.SubscribeResult, context); - const response: SubscribeCommandOutput = { + contents = de_SetSMSAttributesResponse(data.SetSMSAttributesResult, context); + const response: SetSMSAttributesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; return response; }; -/** - * deserializeAws_querySubscribeCommandError - */ -const de_SubscribeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "FilterPolicyLimitExceeded": - case "com.amazonaws.sns#FilterPolicyLimitExceededException": - throw await de_FilterPolicyLimitExceededExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sns#InvalidSecurityException": - throw await de_InvalidSecurityExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "ReplayLimitExceeded": - case "com.amazonaws.sns#ReplayLimitExceededException": - throw await de_ReplayLimitExceededExceptionRes(parsedOutput, context); - case "SubscriptionLimitExceeded": - case "com.amazonaws.sns#SubscriptionLimitExceededException": - throw await de_SubscriptionLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); +/** + * deserializeAws_querySetSubscriptionAttributesCommand + */ +export const de_SetSubscriptionAttributesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: SetSubscriptionAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_queryTagResourceCommand + * deserializeAws_querySetTopicAttributesCommand */ -export const de_TagResourceCommand = async ( +export const de_SetTopicAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: SetTopicAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; +}; + +/** + * deserializeAws_querySubscribeCommand + */ +export const de_SubscribeCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_TagResourceResponse(data.TagResourceResult, context); - const response: TagResourceCommandOutput = { + contents = de_SubscribeResponse(data.SubscribeResult, context); + const response: SubscribeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3199,47 +1702,23 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_queryTagResourceCommandError + * deserializeAws_queryTagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "ConcurrentAccess": - case "com.amazonaws.sns#ConcurrentAccessException": - throw await de_ConcurrentAccessExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "StaleTag": - case "com.amazonaws.sns#StaleTagException": - throw await de_StaleTagExceptionRes(parsedOutput, context); - case "TagLimitExceeded": - case "com.amazonaws.sns#TagLimitExceededException": - throw await de_TagLimitExceededExceptionRes(parsedOutput, context); - case "TagPolicy": - case "com.amazonaws.sns#TagPolicyException": - throw await de_TagPolicyExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_TagResourceResponse(data.TagResourceResult, context); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3250,7 +1729,7 @@ export const de_UnsubscribeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UnsubscribeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UnsubscribeCommandOutput = { @@ -3259,44 +1738,6 @@ export const de_UnsubscribeCommand = async ( return response; }; -/** - * deserializeAws_queryUnsubscribeCommandError - */ -const de_UnsubscribeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "InternalError": - case "com.amazonaws.sns#InternalErrorException": - throw await de_InternalErrorExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sns#InvalidSecurityException": - throw await de_InvalidSecurityExceptionRes(parsedOutput, context); - case "NotFound": - case "com.amazonaws.sns#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryUntagResourceCommand */ @@ -3305,7 +1746,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3317,50 +1758,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_queryUntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AuthorizationError": - case "com.amazonaws.sns#AuthorizationErrorException": - throw await de_AuthorizationErrorExceptionRes(parsedOutput, context); - case "ConcurrentAccess": - case "com.amazonaws.sns#ConcurrentAccessException": - throw await de_ConcurrentAccessExceptionRes(parsedOutput, context); - case "InvalidParameter": - case "com.amazonaws.sns#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "StaleTag": - case "com.amazonaws.sns#StaleTagException": - throw await de_StaleTagExceptionRes(parsedOutput, context); - case "TagLimitExceeded": - case "com.amazonaws.sns#TagLimitExceededException": - throw await de_TagLimitExceededExceptionRes(parsedOutput, context); - case "TagPolicy": - case "com.amazonaws.sns#TagPolicyException": - throw await de_TagPolicyExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryVerifySMSSandboxPhoneNumberCommand */ @@ -3369,7 +1766,7 @@ export const de_VerifySMSSandboxPhoneNumberCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_VerifySMSSandboxPhoneNumberCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3382,12 +1779,9 @@ export const de_VerifySMSSandboxPhoneNumberCommand = async ( }; /** - * deserializeAws_queryVerifySMSSandboxPhoneNumberCommandError + * deserialize_Aws_queryCommandError */ -const de_VerifySMSSandboxPhoneNumberCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3403,12 +1797,96 @@ const de_VerifySMSSandboxPhoneNumberCommandError = async ( case "InvalidParameter": case "com.amazonaws.sns#InvalidParameterException": throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ResourceNotFound": - case "com.amazonaws.sns#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "NotFound": + case "com.amazonaws.sns#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); case "Throttled": case "com.amazonaws.sns#ThrottledException": throw await de_ThrottledExceptionRes(parsedOutput, context); + case "FilterPolicyLimitExceeded": + case "com.amazonaws.sns#FilterPolicyLimitExceededException": + throw await de_FilterPolicyLimitExceededExceptionRes(parsedOutput, context); + case "ReplayLimitExceeded": + case "com.amazonaws.sns#ReplayLimitExceededException": + throw await de_ReplayLimitExceededExceptionRes(parsedOutput, context); + case "SubscriptionLimitExceeded": + case "com.amazonaws.sns#SubscriptionLimitExceededException": + throw await de_SubscriptionLimitExceededExceptionRes(parsedOutput, context); + case "OptedOut": + case "com.amazonaws.sns#OptedOutException": + throw await de_OptedOutExceptionRes(parsedOutput, context); + case "UserError": + case "com.amazonaws.sns#UserErrorException": + throw await de_UserErrorExceptionRes(parsedOutput, context); + case "ConcurrentAccess": + case "com.amazonaws.sns#ConcurrentAccessException": + throw await de_ConcurrentAccessExceptionRes(parsedOutput, context); + case "InvalidSecurity": + case "com.amazonaws.sns#InvalidSecurityException": + throw await de_InvalidSecurityExceptionRes(parsedOutput, context); + case "StaleTag": + case "com.amazonaws.sns#StaleTagException": + throw await de_StaleTagExceptionRes(parsedOutput, context); + case "TagLimitExceeded": + case "com.amazonaws.sns#TagLimitExceededException": + throw await de_TagLimitExceededExceptionRes(parsedOutput, context); + case "TagPolicy": + case "com.amazonaws.sns#TagPolicyException": + throw await de_TagPolicyExceptionRes(parsedOutput, context); + case "TopicLimitExceeded": + case "com.amazonaws.sns#TopicLimitExceededException": + throw await de_TopicLimitExceededExceptionRes(parsedOutput, context); + case "ResourceNotFound": + case "com.amazonaws.sns#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "InvalidState": + case "com.amazonaws.sns#InvalidStateException": + throw await de_InvalidStateExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.sns#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + case "EndpointDisabled": + case "com.amazonaws.sns#EndpointDisabledException": + throw await de_EndpointDisabledExceptionRes(parsedOutput, context); + case "KMSAccessDenied": + case "com.amazonaws.sns#KMSAccessDeniedException": + throw await de_KMSAccessDeniedExceptionRes(parsedOutput, context); + case "KMSDisabled": + case "com.amazonaws.sns#KMSDisabledException": + throw await de_KMSDisabledExceptionRes(parsedOutput, context); + case "KMSInvalidState": + case "com.amazonaws.sns#KMSInvalidStateException": + throw await de_KMSInvalidStateExceptionRes(parsedOutput, context); + case "KMSNotFound": + case "com.amazonaws.sns#KMSNotFoundException": + throw await de_KMSNotFoundExceptionRes(parsedOutput, context); + case "KMSOptInRequired": + case "com.amazonaws.sns#KMSOptInRequired": + throw await de_KMSOptInRequiredRes(parsedOutput, context); + case "KMSThrottling": + case "com.amazonaws.sns#KMSThrottlingException": + throw await de_KMSThrottlingExceptionRes(parsedOutput, context); + case "ParameterValueInvalid": + case "com.amazonaws.sns#InvalidParameterValueException": + throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); + case "PlatformApplicationDisabled": + case "com.amazonaws.sns#PlatformApplicationDisabledException": + throw await de_PlatformApplicationDisabledExceptionRes(parsedOutput, context); + case "BatchEntryIdsNotDistinct": + case "com.amazonaws.sns#BatchEntryIdsNotDistinctException": + throw await de_BatchEntryIdsNotDistinctExceptionRes(parsedOutput, context); + case "BatchRequestTooLong": + case "com.amazonaws.sns#BatchRequestTooLongException": + throw await de_BatchRequestTooLongExceptionRes(parsedOutput, context); + case "EmptyBatchRequest": + case "com.amazonaws.sns#EmptyBatchRequestException": + throw await de_EmptyBatchRequestExceptionRes(parsedOutput, context); + case "InvalidBatchEntryId": + case "com.amazonaws.sns#InvalidBatchEntryIdException": + throw await de_InvalidBatchEntryIdExceptionRes(parsedOutput, context); + case "TooManyEntriesInBatchRequest": + case "com.amazonaws.sns#TooManyEntriesInBatchRequestException": + throw await de_TooManyEntriesInBatchRequestExceptionRes(parsedOutput, context); case "VerificationException": case "com.amazonaws.sns#VerificationException": throw await de_VerificationExceptionRes(parsedOutput, context); @@ -3418,7 +1896,7 @@ const de_VerifySMSSandboxPhoneNumberCommandError = async ( output, parsedBody: parsedBody.Error, errorCode, - }); + }) as never; } }; diff --git a/clients/client-sqs/src/protocols/Aws_json1_0.ts b/clients/client-sqs/src/protocols/Aws_json1_0.ts index d07f7ea05c2b..f5259f212fbb 100644 --- a/clients/client-sqs/src/protocols/Aws_json1_0.ts +++ b/clients/client-sqs/src/protocols/Aws_json1_0.ts @@ -428,7 +428,7 @@ export const de_AddPermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddPermissionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: AddPermissionCommandOutput = { @@ -437,48 +437,6 @@ export const de_AddPermissionCommand = async ( return response; }; -/** - * deserializeAws_json1_0AddPermissionCommandError - */ -const de_AddPermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "OverLimit": - case "com.amazonaws.sqs#OverLimit": - throw await de_OverLimitRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CancelMessageMoveTaskCommand */ @@ -487,7 +445,7 @@ export const de_CancelMessageMoveTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelMessageMoveTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -499,45 +457,6 @@ export const de_CancelMessageMoveTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_0CancelMessageMoveTaskCommandError - */ -const de_CancelMessageMoveTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sqs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ChangeMessageVisibilityCommand */ @@ -546,7 +465,7 @@ export const de_ChangeMessageVisibilityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ChangeMessageVisibilityCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ChangeMessageVisibilityCommandOutput = { @@ -555,51 +474,6 @@ export const de_ChangeMessageVisibilityCommand = async ( return response; }; -/** - * deserializeAws_json1_0ChangeMessageVisibilityCommandError - */ -const de_ChangeMessageVisibilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "MessageNotInflight": - case "com.amazonaws.sqs#MessageNotInflight": - throw await de_MessageNotInflightRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "ReceiptHandleIsInvalid": - case "com.amazonaws.sqs#ReceiptHandleIsInvalid": - throw await de_ReceiptHandleIsInvalidRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ChangeMessageVisibilityBatchCommand */ @@ -608,7 +482,7 @@ export const de_ChangeMessageVisibilityBatchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ChangeMessageVisibilityBatchCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -620,57 +494,6 @@ export const de_ChangeMessageVisibilityBatchCommand = async ( return response; }; -/** - * deserializeAws_json1_0ChangeMessageVisibilityBatchCommandError - */ -const de_ChangeMessageVisibilityBatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BatchEntryIdsNotDistinct": - case "com.amazonaws.sqs#BatchEntryIdsNotDistinct": - throw await de_BatchEntryIdsNotDistinctRes(parsedOutput, context); - case "EmptyBatchRequest": - case "com.amazonaws.sqs#EmptyBatchRequest": - throw await de_EmptyBatchRequestRes(parsedOutput, context); - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidBatchEntryId": - case "com.amazonaws.sqs#InvalidBatchEntryId": - throw await de_InvalidBatchEntryIdRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "TooManyEntriesInBatchRequest": - case "com.amazonaws.sqs#TooManyEntriesInBatchRequest": - throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateQueueCommand */ @@ -679,7 +502,7 @@ export const de_CreateQueueCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateQueueCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -691,54 +514,6 @@ export const de_CreateQueueCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateQueueCommandError - */ -const de_CreateQueueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidAttributeName": - case "com.amazonaws.sqs#InvalidAttributeName": - throw await de_InvalidAttributeNameRes(parsedOutput, context); - case "InvalidAttributeValue": - case "com.amazonaws.sqs#InvalidAttributeValue": - throw await de_InvalidAttributeValueRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "QueueDeletedRecently": - case "com.amazonaws.sqs#QueueDeletedRecently": - throw await de_QueueDeletedRecentlyRes(parsedOutput, context); - case "QueueNameExists": - case "com.amazonaws.sqs#QueueNameExists": - throw await de_QueueNameExistsRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteMessageCommand */ @@ -747,7 +522,7 @@ export const de_DeleteMessageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteMessageCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteMessageCommandOutput = { @@ -756,51 +531,6 @@ export const de_DeleteMessageCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteMessageCommandError - */ -const de_DeleteMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidIdFormat": - case "com.amazonaws.sqs#InvalidIdFormat": - throw await de_InvalidIdFormatRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "ReceiptHandleIsInvalid": - case "com.amazonaws.sqs#ReceiptHandleIsInvalid": - throw await de_ReceiptHandleIsInvalidRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteMessageBatchCommand */ @@ -809,7 +539,7 @@ export const de_DeleteMessageBatchCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteMessageBatchCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -822,65 +552,14 @@ export const de_DeleteMessageBatchCommand = async ( }; /** - * deserializeAws_json1_0DeleteMessageBatchCommandError + * deserializeAws_json1_0DeleteQueueCommand */ -const de_DeleteMessageBatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BatchEntryIdsNotDistinct": - case "com.amazonaws.sqs#BatchEntryIdsNotDistinct": - throw await de_BatchEntryIdsNotDistinctRes(parsedOutput, context); - case "EmptyBatchRequest": - case "com.amazonaws.sqs#EmptyBatchRequest": - throw await de_EmptyBatchRequestRes(parsedOutput, context); - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidBatchEntryId": - case "com.amazonaws.sqs#InvalidBatchEntryId": - throw await de_InvalidBatchEntryIdRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "TooManyEntriesInBatchRequest": - case "com.amazonaws.sqs#TooManyEntriesInBatchRequest": - throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeleteQueueCommand - */ -export const de_DeleteQueueCommand = async ( +export const de_DeleteQueueCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteQueueCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteQueueCommandOutput = { @@ -889,45 +568,6 @@ export const de_DeleteQueueCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteQueueCommandError - */ -const de_DeleteQueueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetQueueAttributesCommand */ @@ -936,7 +576,7 @@ export const de_GetQueueAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetQueueAttributesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -948,48 +588,6 @@ export const de_GetQueueAttributesCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetQueueAttributesCommandError - */ -const de_GetQueueAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidAttributeName": - case "com.amazonaws.sqs#InvalidAttributeName": - throw await de_InvalidAttributeNameRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetQueueUrlCommand */ @@ -998,7 +596,7 @@ export const de_GetQueueUrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetQueueUrlCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1010,45 +608,6 @@ export const de_GetQueueUrlCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetQueueUrlCommandError - */ -const de_GetQueueUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListDeadLetterSourceQueuesCommand */ @@ -1057,7 +616,7 @@ export const de_ListDeadLetterSourceQueuesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListDeadLetterSourceQueuesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1069,45 +628,6 @@ export const de_ListDeadLetterSourceQueuesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListDeadLetterSourceQueuesCommandError - */ -const de_ListDeadLetterSourceQueuesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListMessageMoveTasksCommand */ @@ -1116,7 +636,7 @@ export const de_ListMessageMoveTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListMessageMoveTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1129,58 +649,39 @@ export const de_ListMessageMoveTasksCommand = async ( }; /** - * deserializeAws_json1_0ListMessageMoveTasksCommandError + * deserializeAws_json1_0ListQueuesCommand */ -const de_ListMessageMoveTasksCommandError = async ( +export const de_ListQueuesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sqs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListQueuesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListQueuesCommand + * deserializeAws_json1_0ListQueueTagsCommand */ -export const de_ListQueuesCommand = async ( +export const de_ListQueueTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListQueuesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListQueuesCommandOutput = { + const response: ListQueueTagsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1188,555 +689,93 @@ export const de_ListQueuesCommand = async ( }; /** - * deserializeAws_json1_0ListQueuesCommandError + * deserializeAws_json1_0PurgeQueueCommand */ -const de_ListQueuesCommandError = async ( +export const de_PurgeQueueCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: PurgeQueueCommandOutput = { + $metadata: deserializeMetadata(output), }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListQueueTagsCommand - */ -export const de_ListQueueTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListQueueTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListQueueTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListQueueTagsCommandError - */ -const de_ListQueueTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0PurgeQueueCommand - */ -export const de_PurgeQueueCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PurgeQueueCommandError(output, context); - } - await collectBody(output.body, context); - const response: PurgeQueueCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_0PurgeQueueCommandError - */ -const de_PurgeQueueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "PurgeQueueInProgress": - case "com.amazonaws.sqs#PurgeQueueInProgress": - throw await de_PurgeQueueInProgressRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ReceiveMessageCommand - */ -export const de_ReceiveMessageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ReceiveMessageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ReceiveMessageResult(data, context); - const response: ReceiveMessageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ReceiveMessageCommandError - */ -const de_ReceiveMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "KmsAccessDenied": - case "com.amazonaws.sqs#KmsAccessDenied": - throw await de_KmsAccessDeniedRes(parsedOutput, context); - case "KmsDisabled": - case "com.amazonaws.sqs#KmsDisabled": - throw await de_KmsDisabledRes(parsedOutput, context); - case "KmsInvalidKeyUsage": - case "com.amazonaws.sqs#KmsInvalidKeyUsage": - throw await de_KmsInvalidKeyUsageRes(parsedOutput, context); - case "KmsInvalidState": - case "com.amazonaws.sqs#KmsInvalidState": - throw await de_KmsInvalidStateRes(parsedOutput, context); - case "KmsNotFound": - case "com.amazonaws.sqs#KmsNotFound": - throw await de_KmsNotFoundRes(parsedOutput, context); - case "KmsOptInRequired": - case "com.amazonaws.sqs#KmsOptInRequired": - throw await de_KmsOptInRequiredRes(parsedOutput, context); - case "KmsThrottled": - case "com.amazonaws.sqs#KmsThrottled": - throw await de_KmsThrottledRes(parsedOutput, context); - case "OverLimit": - case "com.amazonaws.sqs#OverLimit": - throw await de_OverLimitRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0RemovePermissionCommand - */ -export const de_RemovePermissionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemovePermissionCommandError(output, context); - } - await collectBody(output.body, context); - const response: RemovePermissionCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_0RemovePermissionCommandError - */ -const de_RemovePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0SendMessageCommand - */ -export const de_SendMessageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SendMessageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: SendMessageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0SendMessageCommandError - */ -const de_SendMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidMessageContents": - case "com.amazonaws.sqs#InvalidMessageContents": - throw await de_InvalidMessageContentsRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "KmsAccessDenied": - case "com.amazonaws.sqs#KmsAccessDenied": - throw await de_KmsAccessDeniedRes(parsedOutput, context); - case "KmsDisabled": - case "com.amazonaws.sqs#KmsDisabled": - throw await de_KmsDisabledRes(parsedOutput, context); - case "KmsInvalidKeyUsage": - case "com.amazonaws.sqs#KmsInvalidKeyUsage": - throw await de_KmsInvalidKeyUsageRes(parsedOutput, context); - case "KmsInvalidState": - case "com.amazonaws.sqs#KmsInvalidState": - throw await de_KmsInvalidStateRes(parsedOutput, context); - case "KmsNotFound": - case "com.amazonaws.sqs#KmsNotFound": - throw await de_KmsNotFoundRes(parsedOutput, context); - case "KmsOptInRequired": - case "com.amazonaws.sqs#KmsOptInRequired": - throw await de_KmsOptInRequiredRes(parsedOutput, context); - case "KmsThrottled": - case "com.amazonaws.sqs#KmsThrottled": - throw await de_KmsThrottledRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0SendMessageBatchCommand - */ -export const de_SendMessageBatchCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SendMessageBatchCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: SendMessageBatchCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0SendMessageBatchCommandError - */ -const de_SendMessageBatchCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BatchEntryIdsNotDistinct": - case "com.amazonaws.sqs#BatchEntryIdsNotDistinct": - throw await de_BatchEntryIdsNotDistinctRes(parsedOutput, context); - case "BatchRequestTooLong": - case "com.amazonaws.sqs#BatchRequestTooLong": - throw await de_BatchRequestTooLongRes(parsedOutput, context); - case "EmptyBatchRequest": - case "com.amazonaws.sqs#EmptyBatchRequest": - throw await de_EmptyBatchRequestRes(parsedOutput, context); - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidBatchEntryId": - case "com.amazonaws.sqs#InvalidBatchEntryId": - throw await de_InvalidBatchEntryIdRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "KmsAccessDenied": - case "com.amazonaws.sqs#KmsAccessDenied": - throw await de_KmsAccessDeniedRes(parsedOutput, context); - case "KmsDisabled": - case "com.amazonaws.sqs#KmsDisabled": - throw await de_KmsDisabledRes(parsedOutput, context); - case "KmsInvalidKeyUsage": - case "com.amazonaws.sqs#KmsInvalidKeyUsage": - throw await de_KmsInvalidKeyUsageRes(parsedOutput, context); - case "KmsInvalidState": - case "com.amazonaws.sqs#KmsInvalidState": - throw await de_KmsInvalidStateRes(parsedOutput, context); - case "KmsNotFound": - case "com.amazonaws.sqs#KmsNotFound": - throw await de_KmsNotFoundRes(parsedOutput, context); - case "KmsOptInRequired": - case "com.amazonaws.sqs#KmsOptInRequired": - throw await de_KmsOptInRequiredRes(parsedOutput, context); - case "KmsThrottled": - case "com.amazonaws.sqs#KmsThrottled": - throw await de_KmsThrottledRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "TooManyEntriesInBatchRequest": - case "com.amazonaws.sqs#TooManyEntriesInBatchRequest": - throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_0ReceiveMessageCommand + */ +export const de_ReceiveMessageCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ReceiveMessageResult(data, context); + const response: ReceiveMessageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0SetQueueAttributesCommand + * deserializeAws_json1_0RemovePermissionCommand */ -export const de_SetQueueAttributesCommand = async ( +export const de_RemovePermissionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SetQueueAttributesCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: SetQueueAttributesCommandOutput = { + const response: RemovePermissionCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_0SetQueueAttributesCommandError + * deserializeAws_json1_0SendMessageCommand */ -const de_SetQueueAttributesCommandError = async ( +export const de_SendMessageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidAttributeName": - case "com.amazonaws.sqs#InvalidAttributeName": - throw await de_InvalidAttributeNameRes(parsedOutput, context); - case "InvalidAttributeValue": - case "com.amazonaws.sqs#InvalidAttributeValue": - throw await de_InvalidAttributeValueRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "OverLimit": - case "com.amazonaws.sqs#OverLimit": - throw await de_OverLimitRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: SendMessageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0StartMessageMoveTaskCommand + * deserializeAws_json1_0SendMessageBatchCommand */ -export const de_StartMessageMoveTaskCommand = async ( +export const de_SendMessageBatchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartMessageMoveTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartMessageMoveTaskCommandOutput = { + const response: SendMessageBatchCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1744,98 +783,57 @@ export const de_StartMessageMoveTaskCommand = async ( }; /** - * deserializeAws_json1_0StartMessageMoveTaskCommandError + * deserializeAws_json1_0SetQueueAttributesCommand */ -const de_StartMessageMoveTaskCommandError = async ( +export const de_SetQueueAttributesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sqs#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: SetQueueAttributesCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_0TagQueueCommand + * deserializeAws_json1_0StartMessageMoveTaskCommand */ -export const de_TagQueueCommand = async ( +export const de_StartMessageMoveTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagQueueCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: TagQueueCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartMessageMoveTaskCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_0TagQueueCommandError + * deserializeAws_json1_0TagQueueCommand */ -const de_TagQueueCommandError = async ( +export const de_TagQueueCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - populateBodyWithQueryCompatibility(parsedOutput, output.headers); - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAddress": - case "com.amazonaws.sqs#InvalidAddress": - throw await de_InvalidAddressRes(parsedOutput, context); - case "InvalidSecurity": - case "com.amazonaws.sqs#InvalidSecurity": - throw await de_InvalidSecurityRes(parsedOutput, context); - case "QueueDoesNotExist": - case "com.amazonaws.sqs#QueueDoesNotExist": - throw await de_QueueDoesNotExistRes(parsedOutput, context); - case "RequestThrottled": - case "com.amazonaws.sqs#RequestThrottled": - throw await de_RequestThrottledRes(parsedOutput, context); - case "UnsupportedOperation": - case "com.amazonaws.sqs#UnsupportedOperation": - throw await de_UnsupportedOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: TagQueueCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** @@ -1846,7 +844,7 @@ export const de_UntagQueueCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagQueueCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UntagQueueCommandOutput = { @@ -1856,12 +854,9 @@ export const de_UntagQueueCommand = async ( }; /** - * deserializeAws_json1_0UntagQueueCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UntagQueueCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1875,6 +870,9 @@ const de_UntagQueueCommandError = async ( case "InvalidSecurity": case "com.amazonaws.sqs#InvalidSecurity": throw await de_InvalidSecurityRes(parsedOutput, context); + case "OverLimit": + case "com.amazonaws.sqs#OverLimit": + throw await de_OverLimitRes(parsedOutput, context); case "QueueDoesNotExist": case "com.amazonaws.sqs#QueueDoesNotExist": throw await de_QueueDoesNotExistRes(parsedOutput, context); @@ -1884,13 +882,79 @@ const de_UntagQueueCommandError = async ( case "UnsupportedOperation": case "com.amazonaws.sqs#UnsupportedOperation": throw await de_UnsupportedOperationRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.sqs#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "MessageNotInflight": + case "com.amazonaws.sqs#MessageNotInflight": + throw await de_MessageNotInflightRes(parsedOutput, context); + case "ReceiptHandleIsInvalid": + case "com.amazonaws.sqs#ReceiptHandleIsInvalid": + throw await de_ReceiptHandleIsInvalidRes(parsedOutput, context); + case "BatchEntryIdsNotDistinct": + case "com.amazonaws.sqs#BatchEntryIdsNotDistinct": + throw await de_BatchEntryIdsNotDistinctRes(parsedOutput, context); + case "EmptyBatchRequest": + case "com.amazonaws.sqs#EmptyBatchRequest": + throw await de_EmptyBatchRequestRes(parsedOutput, context); + case "InvalidBatchEntryId": + case "com.amazonaws.sqs#InvalidBatchEntryId": + throw await de_InvalidBatchEntryIdRes(parsedOutput, context); + case "TooManyEntriesInBatchRequest": + case "com.amazonaws.sqs#TooManyEntriesInBatchRequest": + throw await de_TooManyEntriesInBatchRequestRes(parsedOutput, context); + case "InvalidAttributeName": + case "com.amazonaws.sqs#InvalidAttributeName": + throw await de_InvalidAttributeNameRes(parsedOutput, context); + case "InvalidAttributeValue": + case "com.amazonaws.sqs#InvalidAttributeValue": + throw await de_InvalidAttributeValueRes(parsedOutput, context); + case "QueueDeletedRecently": + case "com.amazonaws.sqs#QueueDeletedRecently": + throw await de_QueueDeletedRecentlyRes(parsedOutput, context); + case "QueueNameExists": + case "com.amazonaws.sqs#QueueNameExists": + throw await de_QueueNameExistsRes(parsedOutput, context); + case "InvalidIdFormat": + case "com.amazonaws.sqs#InvalidIdFormat": + throw await de_InvalidIdFormatRes(parsedOutput, context); + case "PurgeQueueInProgress": + case "com.amazonaws.sqs#PurgeQueueInProgress": + throw await de_PurgeQueueInProgressRes(parsedOutput, context); + case "KmsAccessDenied": + case "com.amazonaws.sqs#KmsAccessDenied": + throw await de_KmsAccessDeniedRes(parsedOutput, context); + case "KmsDisabled": + case "com.amazonaws.sqs#KmsDisabled": + throw await de_KmsDisabledRes(parsedOutput, context); + case "KmsInvalidKeyUsage": + case "com.amazonaws.sqs#KmsInvalidKeyUsage": + throw await de_KmsInvalidKeyUsageRes(parsedOutput, context); + case "KmsInvalidState": + case "com.amazonaws.sqs#KmsInvalidState": + throw await de_KmsInvalidStateRes(parsedOutput, context); + case "KmsNotFound": + case "com.amazonaws.sqs#KmsNotFound": + throw await de_KmsNotFoundRes(parsedOutput, context); + case "KmsOptInRequired": + case "com.amazonaws.sqs#KmsOptInRequired": + throw await de_KmsOptInRequiredRes(parsedOutput, context); + case "KmsThrottled": + case "com.amazonaws.sqs#KmsThrottled": + throw await de_KmsThrottledRes(parsedOutput, context); + case "InvalidMessageContents": + case "com.amazonaws.sqs#InvalidMessageContents": + throw await de_InvalidMessageContentsRes(parsedOutput, context); + case "BatchRequestTooLong": + case "com.amazonaws.sqs#BatchRequestTooLong": + throw await de_BatchRequestTooLongRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts b/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts index 41fe61818641..2148c1277913 100644 --- a/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts +++ b/clients/client-ssm-contacts/src/protocols/Aws_json1_1.ts @@ -699,7 +699,7 @@ export const de_AcceptPageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AcceptPageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -711,44 +711,6 @@ export const de_AcceptPageCommand = async ( return response; }; -/** - * deserializeAws_json1_1AcceptPageCommandError - */ -const de_AcceptPageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ActivateContactChannelCommand */ @@ -757,7 +719,7 @@ export const de_ActivateContactChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ActivateContactChannelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -769,44 +731,6 @@ export const de_ActivateContactChannelCommand = async ( return response; }; -/** - * deserializeAws_json1_1ActivateContactChannelCommandError - */ -const de_ActivateContactChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateContactCommand */ @@ -815,7 +739,7 @@ export const de_CreateContactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateContactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -827,50 +751,6 @@ export const de_CreateContactCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateContactCommandError - */ -const de_CreateContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmcontacts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DataEncryptionException": - case "com.amazonaws.ssmcontacts#DataEncryptionException": - throw await de_DataEncryptionExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssmcontacts#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateContactChannelCommand */ @@ -879,7 +759,7 @@ export const de_CreateContactChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateContactChannelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -891,47 +771,6 @@ export const de_CreateContactChannelCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateContactChannelCommandError - */ -const de_CreateContactChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmcontacts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DataEncryptionException": - case "com.amazonaws.ssmcontacts#DataEncryptionException": - throw await de_DataEncryptionExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateRotationCommand */ @@ -940,7 +779,7 @@ export const de_CreateRotationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRotationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -953,60 +792,39 @@ export const de_CreateRotationCommand = async ( }; /** - * deserializeAws_json1_1CreateRotationCommandError + * deserializeAws_json1_1CreateRotationOverrideCommand */ -const de_CreateRotationCommandError = async ( +export const de_CreateRotationOverrideCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssmcontacts#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateRotationOverrideCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateRotationOverrideCommand + * deserializeAws_json1_1DeactivateContactChannelCommand */ -export const de_CreateRotationOverrideCommand = async ( +export const de_DeactivateContactChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateRotationOverrideCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateRotationOverrideCommandOutput = { + const response: DeactivateContactChannelCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1014,60 +832,39 @@ export const de_CreateRotationOverrideCommand = async ( }; /** - * deserializeAws_json1_1CreateRotationOverrideCommandError + * deserializeAws_json1_1DeleteContactCommand */ -const de_CreateRotationOverrideCommandError = async ( +export const de_DeleteContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssmcontacts#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteContactCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeactivateContactChannelCommand + * deserializeAws_json1_1DeleteContactChannelCommand */ -export const de_DeactivateContactChannelCommand = async ( +export const de_DeleteContactChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeactivateContactChannelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeactivateContactChannelCommandOutput = { + const response: DeleteContactChannelCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1075,57 +872,39 @@ export const de_DeactivateContactChannelCommand = async ( }; /** - * deserializeAws_json1_1DeactivateContactChannelCommandError + * deserializeAws_json1_1DeleteRotationCommand */ -const de_DeactivateContactChannelCommandError = async ( +export const de_DeleteRotationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteRotationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteContactCommand + * deserializeAws_json1_1DeleteRotationOverrideCommand */ -export const de_DeleteContactCommand = async ( +export const de_DeleteRotationOverrideCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteContactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteContactCommandOutput = { + const response: DeleteRotationOverrideCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1133,60 +912,39 @@ export const de_DeleteContactCommand = async ( }; /** - * deserializeAws_json1_1DeleteContactCommandError + * deserializeAws_json1_1DescribeEngagementCommand */ -const de_DeleteContactCommandError = async ( +export const de_DescribeEngagementCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmcontacts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeEngagementResult(data, context); + const response: DescribeEngagementCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteContactChannelCommand + * deserializeAws_json1_1DescribePageCommand */ -export const de_DeleteContactChannelCommand = async ( +export const de_DescribePageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteContactChannelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteContactChannelCommandOutput = { + contents = de_DescribePageResult(data, context); + const response: DescribePageCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1194,57 +952,39 @@ export const de_DeleteContactChannelCommand = async ( }; /** - * deserializeAws_json1_1DeleteContactChannelCommandError + * deserializeAws_json1_1GetContactCommand */ -const de_DeleteContactChannelCommandError = async ( +export const de_GetContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetContactCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRotationCommand + * deserializeAws_json1_1GetContactChannelCommand */ -export const de_DeleteRotationCommand = async ( +export const de_GetContactChannelCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRotationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRotationCommandOutput = { + const response: GetContactChannelCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1252,60 +992,39 @@ export const de_DeleteRotationCommand = async ( }; /** - * deserializeAws_json1_1DeleteRotationCommandError + * deserializeAws_json1_1GetContactPolicyCommand */ -const de_DeleteRotationCommandError = async ( +export const de_GetContactPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmcontacts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetContactPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRotationOverrideCommand + * deserializeAws_json1_1GetRotationCommand */ -export const de_DeleteRotationOverrideCommand = async ( +export const de_GetRotationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRotationOverrideCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteRotationOverrideCommandOutput = { + contents = de_GetRotationResult(data, context); + const response: GetRotationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1313,57 +1032,39 @@ export const de_DeleteRotationOverrideCommand = async ( }; /** - * deserializeAws_json1_1DeleteRotationOverrideCommandError + * deserializeAws_json1_1GetRotationOverrideCommand */ -const de_DeleteRotationOverrideCommandError = async ( +export const de_GetRotationOverrideCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetRotationOverrideResult(data, context); + const response: GetRotationOverrideCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeEngagementCommand + * deserializeAws_json1_1ListContactChannelsCommand */ -export const de_DescribeEngagementCommand = async ( +export const de_ListContactChannelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEngagementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEngagementResult(data, context); - const response: DescribeEngagementCommandOutput = { + contents = _json(data); + const response: ListContactChannelsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1371,60 +1072,39 @@ export const de_DescribeEngagementCommand = async ( }; /** - * deserializeAws_json1_1DescribeEngagementCommandError + * deserializeAws_json1_1ListContactsCommand */ -const de_DescribeEngagementCommandError = async ( +export const de_ListContactsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DataEncryptionException": - case "com.amazonaws.ssmcontacts#DataEncryptionException": - throw await de_DataEncryptionExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListContactsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribePageCommand + * deserializeAws_json1_1ListEngagementsCommand */ -export const de_DescribePageCommand = async ( +export const de_ListEngagementsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribePageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribePageResult(data, context); - const response: DescribePageCommandOutput = { + contents = de_ListEngagementsResult(data, context); + const response: ListEngagementsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1432,60 +1112,39 @@ export const de_DescribePageCommand = async ( }; /** - * deserializeAws_json1_1DescribePageCommandError + * deserializeAws_json1_1ListPageReceiptsCommand */ -const de_DescribePageCommandError = async ( +export const de_ListPageReceiptsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DataEncryptionException": - case "com.amazonaws.ssmcontacts#DataEncryptionException": - throw await de_DataEncryptionExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListPageReceiptsResult(data, context); + const response: ListPageReceiptsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetContactCommand + * deserializeAws_json1_1ListPageResolutionsCommand */ -export const de_GetContactCommand = async ( +export const de_ListPageResolutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetContactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetContactCommandOutput = { + const response: ListPageResolutionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1493,60 +1152,39 @@ export const de_GetContactCommand = async ( }; /** - * deserializeAws_json1_1GetContactCommandError + * deserializeAws_json1_1ListPagesByContactCommand */ -const de_GetContactCommandError = async ( +export const de_ListPagesByContactCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DataEncryptionException": - case "com.amazonaws.ssmcontacts#DataEncryptionException": - throw await de_DataEncryptionExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListPagesByContactResult(data, context); + const response: ListPagesByContactCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetContactChannelCommand + * deserializeAws_json1_1ListPagesByEngagementCommand */ -export const de_GetContactChannelCommand = async ( +export const de_ListPagesByEngagementCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetContactChannelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetContactChannelCommandOutput = { + contents = de_ListPagesByEngagementResult(data, context); + const response: ListPagesByEngagementCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1554,60 +1192,39 @@ export const de_GetContactChannelCommand = async ( }; /** - * deserializeAws_json1_1GetContactChannelCommandError + * deserializeAws_json1_1ListPreviewRotationShiftsCommand */ -const de_GetContactChannelCommandError = async ( +export const de_ListPreviewRotationShiftsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DataEncryptionException": - case "com.amazonaws.ssmcontacts#DataEncryptionException": - throw await de_DataEncryptionExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListPreviewRotationShiftsResult(data, context); + const response: ListPreviewRotationShiftsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetContactPolicyCommand + * deserializeAws_json1_1ListRotationOverridesCommand */ -export const de_GetContactPolicyCommand = async ( +export const de_ListRotationOverridesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetContactPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetContactPolicyCommandOutput = { + contents = de_ListRotationOverridesResult(data, context); + const response: ListRotationOverridesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1615,57 +1232,39 @@ export const de_GetContactPolicyCommand = async ( }; /** - * deserializeAws_json1_1GetContactPolicyCommandError + * deserializeAws_json1_1ListRotationsCommand */ -const de_GetContactPolicyCommandError = async ( +export const de_ListRotationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListRotationsResult(data, context); + const response: ListRotationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetRotationCommand + * deserializeAws_json1_1ListRotationShiftsCommand */ -export const de_GetRotationCommand = async ( +export const de_ListRotationShiftsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRotationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetRotationResult(data, context); - const response: GetRotationCommandOutput = { + contents = de_ListRotationShiftsResult(data, context); + const response: ListRotationShiftsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1673,745 +1272,14 @@ export const de_GetRotationCommand = async ( }; /** - * deserializeAws_json1_1GetRotationCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_GetRotationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRotationOverrideCommand - */ -export const de_GetRotationOverrideCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRotationOverrideCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetRotationOverrideResult(data, context); - const response: GetRotationOverrideCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRotationOverrideCommandError - */ -const de_GetRotationOverrideCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListContactChannelsCommand - */ -export const de_ListContactChannelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListContactChannelsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListContactChannelsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListContactChannelsCommandError - */ -const de_ListContactChannelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DataEncryptionException": - case "com.amazonaws.ssmcontacts#DataEncryptionException": - throw await de_DataEncryptionExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListContactsCommand - */ -export const de_ListContactsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListContactsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListContactsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListContactsCommandError - */ -const de_ListContactsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListEngagementsCommand - */ -export const de_ListEngagementsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListEngagementsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListEngagementsResult(data, context); - const response: ListEngagementsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListEngagementsCommandError - */ -const de_ListEngagementsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListPageReceiptsCommand - */ -export const de_ListPageReceiptsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPageReceiptsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListPageReceiptsResult(data, context); - const response: ListPageReceiptsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListPageReceiptsCommandError - */ -const de_ListPageReceiptsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListPageResolutionsCommand - */ -export const de_ListPageResolutionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPageResolutionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListPageResolutionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListPageResolutionsCommandError - */ -const de_ListPageResolutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListPagesByContactCommand - */ -export const de_ListPagesByContactCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPagesByContactCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListPagesByContactResult(data, context); - const response: ListPagesByContactCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListPagesByContactCommandError - */ -const de_ListPagesByContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListPagesByEngagementCommand - */ -export const de_ListPagesByEngagementCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPagesByEngagementCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListPagesByEngagementResult(data, context); - const response: ListPagesByEngagementCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListPagesByEngagementCommandError - */ -const de_ListPagesByEngagementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListPreviewRotationShiftsCommand - */ -export const de_ListPreviewRotationShiftsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPreviewRotationShiftsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListPreviewRotationShiftsResult(data, context); - const response: ListPreviewRotationShiftsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListPreviewRotationShiftsCommandError - */ -const de_ListPreviewRotationShiftsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRotationOverridesCommand - */ -export const de_ListRotationOverridesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRotationOverridesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListRotationOverridesResult(data, context); - const response: ListRotationOverridesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRotationOverridesCommandError - */ -const de_ListRotationOverridesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRotationsCommand - */ -export const de_ListRotationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRotationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListRotationsResult(data, context); - const response: ListRotationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRotationsCommandError - */ -const de_ListRotationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRotationShiftsCommand - */ -export const de_ListRotationShiftsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRotationShiftsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListRotationShiftsResult(data, context); - const response: ListRotationShiftsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRotationShiftsCommandError - */ -const de_ListRotationShiftsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmcontacts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2423,44 +1291,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutContactPolicyCommand */ @@ -2469,7 +1299,7 @@ export const de_PutContactPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutContactPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2477,129 +1307,24 @@ export const de_PutContactPolicyCommand = async ( const response: PutContactPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutContactPolicyCommandError - */ -const de_PutContactPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmcontacts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1SendActivationCodeCommand - */ -export const de_SendActivationCodeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SendActivationCodeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: SendActivationCodeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1SendActivationCodeCommandError - */ -const de_SendActivationCodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DataEncryptionException": - case "com.amazonaws.ssmcontacts#DataEncryptionException": - throw await de_DataEncryptionExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssmcontacts#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }; + return response; }; /** - * deserializeAws_json1_1StartEngagementCommand + * deserializeAws_json1_1SendActivationCodeCommand */ -export const de_StartEngagementCommand = async ( +export const de_SendActivationCodeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartEngagementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartEngagementCommandOutput = { + const response: SendActivationCodeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2607,44 +1332,23 @@ export const de_StartEngagementCommand = async ( }; /** - * deserializeAws_json1_1StartEngagementCommandError + * deserializeAws_json1_1StartEngagementCommand */ -const de_StartEngagementCommandError = async ( +export const de_StartEngagementCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DataEncryptionException": - case "com.amazonaws.ssmcontacts#DataEncryptionException": - throw await de_DataEncryptionExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartEngagementCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2655,7 +1359,7 @@ export const de_StopEngagementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopEngagementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2667,44 +1371,6 @@ export const de_StopEngagementCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopEngagementCommandError - */ -const de_StopEngagementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -2713,7 +1379,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2725,47 +1391,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssmcontacts#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -2774,7 +1399,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2786,44 +1411,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateContactCommand */ @@ -2832,7 +1419,7 @@ export const de_UpdateContactCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateContactCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2844,50 +1431,6 @@ export const de_UpdateContactCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateContactCommandError - */ -const de_UpdateContactCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "DataEncryptionException": - case "com.amazonaws.ssmcontacts#DataEncryptionException": - throw await de_DataEncryptionExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssmcontacts#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateContactChannelCommand */ @@ -2896,7 +1439,7 @@ export const de_UpdateContactChannelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateContactChannelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2908,50 +1451,6 @@ export const de_UpdateContactChannelCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateContactChannelCommandError - */ -const de_UpdateContactChannelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmcontacts#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmcontacts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "DataEncryptionException": - case "com.amazonaws.ssmcontacts#DataEncryptionException": - throw await de_DataEncryptionExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmcontacts#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmcontacts#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmcontacts#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmcontacts#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateRotationCommand */ @@ -2960,7 +1459,7 @@ export const de_UpdateRotationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRotationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2973,12 +1472,9 @@ export const de_UpdateRotationCommand = async ( }; /** - * deserializeAws_json1_1UpdateRotationCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateRotationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2988,9 +1484,6 @@ const de_UpdateRotationCommandError = async ( case "AccessDeniedException": case "com.amazonaws.ssmcontacts#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmcontacts#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.ssmcontacts#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); @@ -3003,13 +1496,22 @@ const de_UpdateRotationCommandError = async ( case "ValidationException": case "com.amazonaws.ssmcontacts#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.ssmcontacts#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "DataEncryptionException": + case "com.amazonaws.ssmcontacts#DataEncryptionException": + throw await de_DataEncryptionExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.ssmcontacts#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts b/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts index 9f368146bc9b..a07c9eb19378 100644 --- a/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts +++ b/clients/client-ssm-incidents/src/protocols/Aws_restJson1.ts @@ -889,7 +889,7 @@ export const de_BatchGetIncidentFindingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetIncidentFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -903,44 +903,6 @@ export const de_BatchGetIncidentFindingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetIncidentFindingsCommandError - */ -const de_BatchGetIncidentFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateReplicationSetCommand */ @@ -949,7 +911,7 @@ export const de_CreateReplicationSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateReplicationSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -962,47 +924,6 @@ export const de_CreateReplicationSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateReplicationSetCommandError - */ -const de_CreateReplicationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmincidents#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssmincidents#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateResponsePlanCommand */ @@ -1011,7 +932,7 @@ export const de_CreateResponsePlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateResponsePlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1024,47 +945,6 @@ export const de_CreateResponsePlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateResponsePlanCommandError - */ -const de_CreateResponsePlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmincidents#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateTimelineEventCommand */ @@ -1073,7 +953,7 @@ export const de_CreateTimelineEventCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateTimelineEventCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1087,47 +967,6 @@ export const de_CreateTimelineEventCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTimelineEventCommandError - */ -const de_CreateTimelineEventCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmincidents#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteIncidentRecordCommand */ @@ -1136,7 +975,7 @@ export const de_DeleteIncidentRecordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteIncidentRecordCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1145,41 +984,6 @@ export const de_DeleteIncidentRecordCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteIncidentRecordCommandError - */ -const de_DeleteIncidentRecordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteReplicationSetCommand */ @@ -1188,7 +992,7 @@ export const de_DeleteReplicationSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteReplicationSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1197,44 +1001,6 @@ export const de_DeleteReplicationSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteReplicationSetCommandError - */ -const de_DeleteReplicationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteResourcePolicyCommand */ @@ -1243,7 +1009,7 @@ export const de_DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1252,44 +1018,6 @@ export const de_DeleteResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteResponsePlanCommand */ @@ -1298,7 +1026,7 @@ export const de_DeleteResponsePlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteResponsePlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1308,49 +1036,14 @@ export const de_DeleteResponsePlanCommand = async ( }; /** - * deserializeAws_restJson1DeleteResponsePlanCommandError + * deserializeAws_restJson1DeleteTimelineEventCommand */ -const de_DeleteResponsePlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteTimelineEventCommand - */ -export const de_DeleteTimelineEventCommand = async ( +export const de_DeleteTimelineEventCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteTimelineEventCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1359,41 +1052,6 @@ export const de_DeleteTimelineEventCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteTimelineEventCommandError - */ -const de_DeleteTimelineEventCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetIncidentRecordCommand */ @@ -1402,7 +1060,7 @@ export const de_GetIncidentRecordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIncidentRecordCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1415,44 +1073,6 @@ export const de_GetIncidentRecordCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetIncidentRecordCommandError - */ -const de_GetIncidentRecordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetReplicationSetCommand */ @@ -1461,7 +1081,7 @@ export const de_GetReplicationSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReplicationSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1474,44 +1094,6 @@ export const de_GetReplicationSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetReplicationSetCommandError - */ -const de_GetReplicationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetResourcePoliciesCommand */ @@ -1520,7 +1102,7 @@ export const de_GetResourcePoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourcePoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1534,44 +1116,6 @@ export const de_GetResourcePoliciesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetResourcePoliciesCommandError - */ -const de_GetResourcePoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetResponsePlanCommand */ @@ -1580,7 +1124,7 @@ export const de_GetResponsePlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResponsePlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1600,44 +1144,6 @@ export const de_GetResponsePlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetResponsePlanCommandError - */ -const de_GetResponsePlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTimelineEventCommand */ @@ -1646,7 +1152,7 @@ export const de_GetTimelineEventCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTimelineEventCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1660,59 +1166,43 @@ export const de_GetTimelineEventCommand = async ( }; /** - * deserializeAws_restJson1GetTimelineEventCommandError + * deserializeAws_restJson1ListIncidentFindingsCommand */ -const de_GetTimelineEventCommandError = async ( +export const de_ListIncidentFindingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + findings: (_) => de_FindingSummaryList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListIncidentFindingsCommand + * deserializeAws_restJson1ListIncidentRecordsCommand */ -export const de_ListIncidentFindingsCommand = async ( +export const de_ListIncidentRecordsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIncidentFindingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - findings: (_) => de_FindingSummaryList(_, context), + incidentRecordSummaries: (_) => de_IncidentRecordSummaryList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -1720,109 +1210,14 @@ export const de_ListIncidentFindingsCommand = async ( }; /** - * deserializeAws_restJson1ListIncidentFindingsCommandError + * deserializeAws_restJson1ListRelatedItemsCommand */ -const de_ListIncidentFindingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListIncidentRecordsCommand - */ -export const de_ListIncidentRecordsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIncidentRecordsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - incidentRecordSummaries: (_) => de_IncidentRecordSummaryList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListIncidentRecordsCommandError - */ -const de_ListIncidentRecordsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListRelatedItemsCommand - */ -export const de_ListRelatedItemsCommand = async ( +export const de_ListRelatedItemsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRelatedItemsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1836,41 +1231,6 @@ export const de_ListRelatedItemsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRelatedItemsCommandError - */ -const de_ListRelatedItemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListReplicationSetsCommand */ @@ -1879,7 +1239,7 @@ export const de_ListReplicationSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReplicationSetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1893,41 +1253,6 @@ export const de_ListReplicationSetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListReplicationSetsCommandError - */ -const de_ListReplicationSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListResponsePlansCommand */ @@ -1936,7 +1261,7 @@ export const de_ListResponsePlansCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResponsePlansCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1950,41 +1275,6 @@ export const de_ListResponsePlansCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListResponsePlansCommandError - */ -const de_ListResponsePlansCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1993,7 +1283,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2006,44 +1296,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTimelineEventsCommand */ @@ -2052,7 +1304,7 @@ export const de_ListTimelineEventsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTimelineEventsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2066,41 +1318,6 @@ export const de_ListTimelineEventsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTimelineEventsCommandError - */ -const de_ListTimelineEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutResourcePolicyCommand */ @@ -2109,7 +1326,7 @@ export const de_PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2122,176 +1339,36 @@ export const de_PutResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartIncidentCommand */ export const de_StartIncidentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartIncidentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - incidentRecordArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1StartIncidentCommandError - */ -const de_StartIncidentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmincidents#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmincidents#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssmincidents#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + incidentRecordArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UntagResourceCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2301,44 +1378,20 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmincidents#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -2349,7 +1402,7 @@ export const de_UpdateDeletionProtectionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateDeletionProtectionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2358,44 +1411,6 @@ export const de_UpdateDeletionProtectionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDeletionProtectionCommandError - */ -const de_UpdateDeletionProtectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateIncidentRecordCommand */ @@ -2404,7 +1419,7 @@ export const de_UpdateIncidentRecordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateIncidentRecordCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2413,47 +1428,6 @@ export const de_UpdateIncidentRecordCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateIncidentRecordCommandError - */ -const de_UpdateIncidentRecordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmincidents#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRelatedItemsCommand */ @@ -2462,7 +1436,7 @@ export const de_UpdateRelatedItemsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateRelatedItemsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2471,47 +1445,6 @@ export const de_UpdateRelatedItemsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRelatedItemsCommandError - */ -const de_UpdateRelatedItemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmincidents#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateReplicationSetCommand */ @@ -2520,7 +1453,7 @@ export const de_UpdateReplicationSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateReplicationSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2529,47 +1462,6 @@ export const de_UpdateReplicationSetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateReplicationSetCommandError - */ -const de_UpdateReplicationSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmincidents#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateResponsePlanCommand */ @@ -2578,7 +1470,7 @@ export const de_UpdateResponsePlanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateResponsePlanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2587,47 +1479,6 @@ export const de_UpdateResponsePlanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateResponsePlanCommandError - */ -const de_UpdateResponsePlanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssmincidents#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmincidents#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmincidents#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmincidents#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssmincidents#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmincidents#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTimelineEventCommand */ @@ -2636,7 +1487,7 @@ export const de_UpdateTimelineEventCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateTimelineEventCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2646,12 +1497,9 @@ export const de_UpdateTimelineEventCommand = async ( }; /** - * deserializeAws_restJson1UpdateTimelineEventCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateTimelineEventCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2661,9 +1509,6 @@ const de_UpdateTimelineEventCommandError = async ( case "AccessDeniedException": case "com.amazonaws.ssmincidents#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssmincidents#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.ssmincidents#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); @@ -2676,13 +1521,19 @@ const de_UpdateTimelineEventCommandError = async ( case "ValidationException": case "com.amazonaws.ssmincidents#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.ssmincidents#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.ssmincidents#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts b/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts index 4051a71f41c3..8629c14138c5 100644 --- a/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts +++ b/clients/client-ssm-sap/src/protocols/Aws_restJson1.ts @@ -512,7 +512,7 @@ export const de_DeleteResourcePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteResourcePermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -525,38 +525,6 @@ export const de_DeleteResourcePermissionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteResourcePermissionCommandError - */ -const de_DeleteResourcePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssmsap#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmsap#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeregisterApplicationCommand */ @@ -565,7 +533,7 @@ export const de_DeregisterApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeregisterApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -574,38 +542,6 @@ export const de_DeregisterApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeregisterApplicationCommandError - */ -const de_DeregisterApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssmsap#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.ssmsap#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetApplicationCommand */ @@ -614,7 +550,7 @@ export const de_GetApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -628,35 +564,6 @@ export const de_GetApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetApplicationCommandError - */ -const de_GetApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssmsap#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetComponentCommand */ @@ -665,7 +572,7 @@ export const de_GetComponentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetComponentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -679,38 +586,6 @@ export const de_GetComponentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetComponentCommandError - */ -const de_GetComponentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssmsap#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.ssmsap#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDatabaseCommand */ @@ -719,7 +594,7 @@ export const de_GetDatabaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDatabaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -733,35 +608,6 @@ export const de_GetDatabaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDatabaseCommandError - */ -const de_GetDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssmsap#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetOperationCommand */ @@ -770,7 +616,7 @@ export const de_GetOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -783,35 +629,6 @@ export const de_GetOperationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetOperationCommandError - */ -const de_GetOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssmsap#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetResourcePermissionCommand */ @@ -820,7 +637,7 @@ export const de_GetResourcePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourcePermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -833,38 +650,6 @@ export const de_GetResourcePermissionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetResourcePermissionCommandError - */ -const de_GetResourcePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssmsap#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmsap#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListApplicationsCommand */ @@ -873,7 +658,7 @@ export const de_ListApplicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -887,38 +672,6 @@ export const de_ListApplicationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListApplicationsCommandError - */ -const de_ListApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssmsap#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmsap#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListComponentsCommand */ @@ -927,7 +680,7 @@ export const de_ListComponentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListComponentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -941,41 +694,6 @@ export const de_ListComponentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListComponentsCommandError - */ -const de_ListComponentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssmsap#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmsap#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.ssmsap#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDatabasesCommand */ @@ -984,7 +702,7 @@ export const de_ListDatabasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDatabasesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -998,38 +716,6 @@ export const de_ListDatabasesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDatabasesCommandError - */ -const de_ListDatabasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssmsap#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmsap#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListOperationsCommand */ @@ -1038,7 +724,7 @@ export const de_ListOperationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOperationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1052,35 +738,6 @@ export const de_ListOperationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListOperationsCommandError - */ -const de_ListOperationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssmsap#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1089,7 +746,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1102,38 +759,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.ssmsap#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmsap#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutResourcePermissionCommand */ @@ -1142,7 +767,7 @@ export const de_PutResourcePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutResourcePermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1155,38 +780,6 @@ export const de_PutResourcePermissionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutResourcePermissionCommandError - */ -const de_PutResourcePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssmsap#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmsap#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RegisterApplicationCommand */ @@ -1195,7 +788,7 @@ export const de_RegisterApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterApplicationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1209,41 +802,6 @@ export const de_RegisterApplicationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RegisterApplicationCommandError - */ -const de_RegisterApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.ssmsap#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmsap#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmsap#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartApplicationRefreshCommand */ @@ -1252,7 +810,7 @@ export const de_StartApplicationRefreshCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartApplicationRefreshCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1265,44 +823,6 @@ export const de_StartApplicationRefreshCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartApplicationRefreshCommandError - */ -const de_StartApplicationRefreshCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.ssmsap#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssmsap#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmsap#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.ssmsap#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1311,7 +831,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1320,38 +840,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.ssmsap#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmsap#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1360,7 +848,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1369,38 +857,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.ssmsap#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssmsap#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssmsap#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateApplicationSettingsCommand */ @@ -1409,7 +865,7 @@ export const de_UpdateApplicationSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateApplicationSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1424,40 +880,37 @@ export const de_UpdateApplicationSettingsCommand = async ( }; /** - * deserializeAws_restJson1UpdateApplicationSettingsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateApplicationSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "ConflictException": - case "com.amazonaws.ssmsap#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.ssmsap#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.ssmsap#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.ssmsap#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.ssmsap#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "UnauthorizedException": + case "com.amazonaws.ssmsap#UnauthorizedException": + throw await de_UnauthorizedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.ssmsap#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-ssm/src/protocols/Aws_json1_1.ts b/clients/client-ssm/src/protocols/Aws_json1_1.ts index 0e625ba2c626..6bcae8230ec0 100644 --- a/clients/client-ssm/src/protocols/Aws_json1_1.ts +++ b/clients/client-ssm/src/protocols/Aws_json1_1.ts @@ -2700,7 +2700,7 @@ export const de_AddTagsToResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsToResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2712,44 +2712,6 @@ export const de_AddTagsToResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddTagsToResourceCommandError - */ -const de_AddTagsToResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidResourceId": - case "com.amazonaws.ssm#InvalidResourceId": - throw await de_InvalidResourceIdRes(parsedOutput, context); - case "InvalidResourceType": - case "com.amazonaws.ssm#InvalidResourceType": - throw await de_InvalidResourceTypeRes(parsedOutput, context); - case "TooManyTagsError": - case "com.amazonaws.ssm#TooManyTagsError": - throw await de_TooManyTagsErrorRes(parsedOutput, context); - case "TooManyUpdates": - case "com.amazonaws.ssm#TooManyUpdates": - throw await de_TooManyUpdatesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateOpsItemRelatedItemCommand */ @@ -2758,7 +2720,7 @@ export const de_AssociateOpsItemRelatedItemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateOpsItemRelatedItemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2770,47 +2732,6 @@ export const de_AssociateOpsItemRelatedItemCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateOpsItemRelatedItemCommandError - */ -const de_AssociateOpsItemRelatedItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "OpsItemConflictException": - case "com.amazonaws.ssm#OpsItemConflictException": - throw await de_OpsItemConflictExceptionRes(parsedOutput, context); - case "OpsItemInvalidParameterException": - case "com.amazonaws.ssm#OpsItemInvalidParameterException": - throw await de_OpsItemInvalidParameterExceptionRes(parsedOutput, context); - case "OpsItemLimitExceededException": - case "com.amazonaws.ssm#OpsItemLimitExceededException": - throw await de_OpsItemLimitExceededExceptionRes(parsedOutput, context); - case "OpsItemNotFoundException": - case "com.amazonaws.ssm#OpsItemNotFoundException": - throw await de_OpsItemNotFoundExceptionRes(parsedOutput, context); - case "OpsItemRelatedItemAlreadyExistsException": - case "com.amazonaws.ssm#OpsItemRelatedItemAlreadyExistsException": - throw await de_OpsItemRelatedItemAlreadyExistsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelCommandCommand */ @@ -2819,7 +2740,7 @@ export const de_CancelCommandCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelCommandCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2831,41 +2752,6 @@ export const de_CancelCommandCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelCommandCommandError - */ -const de_CancelCommandCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateInstanceId": - case "com.amazonaws.ssm#DuplicateInstanceId": - throw await de_DuplicateInstanceIdRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidCommandId": - case "com.amazonaws.ssm#InvalidCommandId": - throw await de_InvalidCommandIdRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelMaintenanceWindowExecutionCommand */ @@ -2874,7 +2760,7 @@ export const de_CancelMaintenanceWindowExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelMaintenanceWindowExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2886,35 +2772,6 @@ export const de_CancelMaintenanceWindowExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelMaintenanceWindowExecutionCommandError - */ -const de_CancelMaintenanceWindowExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateActivationCommand */ @@ -2923,7 +2780,7 @@ export const de_CreateActivationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateActivationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2936,48 +2793,39 @@ export const de_CreateActivationCommand = async ( }; /** - * deserializeAws_json1_1CreateActivationCommandError + * deserializeAws_json1_1CreateAssociationCommand */ -const de_CreateActivationCommandError = async ( +export const de_CreateAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameters": - case "com.amazonaws.ssm#InvalidParameters": - throw await de_InvalidParametersRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateAssociationResult(data, context); + const response: CreateAssociationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateAssociationCommand + * deserializeAws_json1_1CreateAssociationBatchCommand */ -export const de_CreateAssociationCommand = async ( +export const de_CreateAssociationBatchCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateAssociationResult(data, context); - const response: CreateAssociationCommandOutput = { + contents = de_CreateAssociationBatchResult(data, context); + const response: CreateAssociationBatchCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2985,81 +2833,39 @@ export const de_CreateAssociationCommand = async ( }; /** - * deserializeAws_json1_1CreateAssociationCommandError + * deserializeAws_json1_1CreateDocumentCommand */ -const de_CreateAssociationCommandError = async ( +export const de_CreateDocumentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AssociationAlreadyExists": - case "com.amazonaws.ssm#AssociationAlreadyExists": - throw await de_AssociationAlreadyExistsRes(parsedOutput, context); - case "AssociationLimitExceeded": - case "com.amazonaws.ssm#AssociationLimitExceeded": - throw await de_AssociationLimitExceededRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidDocumentVersion": - case "com.amazonaws.ssm#InvalidDocumentVersion": - throw await de_InvalidDocumentVersionRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - case "InvalidOutputLocation": - case "com.amazonaws.ssm#InvalidOutputLocation": - throw await de_InvalidOutputLocationRes(parsedOutput, context); - case "InvalidParameters": - case "com.amazonaws.ssm#InvalidParameters": - throw await de_InvalidParametersRes(parsedOutput, context); - case "InvalidSchedule": - case "com.amazonaws.ssm#InvalidSchedule": - throw await de_InvalidScheduleRes(parsedOutput, context); - case "InvalidTag": - case "com.amazonaws.ssm#InvalidTag": - throw await de_InvalidTagRes(parsedOutput, context); - case "InvalidTarget": - case "com.amazonaws.ssm#InvalidTarget": - throw await de_InvalidTargetRes(parsedOutput, context); - case "InvalidTargetMaps": - case "com.amazonaws.ssm#InvalidTargetMaps": - throw await de_InvalidTargetMapsRes(parsedOutput, context); - case "UnsupportedPlatformType": - case "com.amazonaws.ssm#UnsupportedPlatformType": - throw await de_UnsupportedPlatformTypeRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateDocumentResult(data, context); + const response: CreateDocumentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateAssociationBatchCommand + * deserializeAws_json1_1CreateMaintenanceWindowCommand */ -export const de_CreateAssociationBatchCommand = async ( +export const de_CreateMaintenanceWindowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateAssociationBatchCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateAssociationBatchResult(data, context); - const response: CreateAssociationBatchCommandOutput = { + contents = _json(data); + const response: CreateMaintenanceWindowCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3067,78 +2873,39 @@ export const de_CreateAssociationBatchCommand = async ( }; /** - * deserializeAws_json1_1CreateAssociationBatchCommandError + * deserializeAws_json1_1CreateOpsItemCommand */ -const de_CreateAssociationBatchCommandError = async ( +export const de_CreateOpsItemCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AssociationLimitExceeded": - case "com.amazonaws.ssm#AssociationLimitExceeded": - throw await de_AssociationLimitExceededRes(parsedOutput, context); - case "DuplicateInstanceId": - case "com.amazonaws.ssm#DuplicateInstanceId": - throw await de_DuplicateInstanceIdRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidDocumentVersion": - case "com.amazonaws.ssm#InvalidDocumentVersion": - throw await de_InvalidDocumentVersionRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - case "InvalidOutputLocation": - case "com.amazonaws.ssm#InvalidOutputLocation": - throw await de_InvalidOutputLocationRes(parsedOutput, context); - case "InvalidParameters": - case "com.amazonaws.ssm#InvalidParameters": - throw await de_InvalidParametersRes(parsedOutput, context); - case "InvalidSchedule": - case "com.amazonaws.ssm#InvalidSchedule": - throw await de_InvalidScheduleRes(parsedOutput, context); - case "InvalidTarget": - case "com.amazonaws.ssm#InvalidTarget": - throw await de_InvalidTargetRes(parsedOutput, context); - case "InvalidTargetMaps": - case "com.amazonaws.ssm#InvalidTargetMaps": - throw await de_InvalidTargetMapsRes(parsedOutput, context); - case "UnsupportedPlatformType": - case "com.amazonaws.ssm#UnsupportedPlatformType": - throw await de_UnsupportedPlatformTypeRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateOpsItemCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateDocumentCommand + * deserializeAws_json1_1CreateOpsMetadataCommand */ -export const de_CreateDocumentCommand = async ( +export const de_CreateOpsMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateDocumentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_CreateDocumentResult(data, context); - const response: CreateDocumentCommandOutput = { + contents = _json(data); + const response: CreateOpsMetadataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3146,60 +2913,39 @@ export const de_CreateDocumentCommand = async ( }; /** - * deserializeAws_json1_1CreateDocumentCommandError + * deserializeAws_json1_1CreatePatchBaselineCommand */ -const de_CreateDocumentCommandError = async ( +export const de_CreatePatchBaselineCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DocumentAlreadyExists": - case "com.amazonaws.ssm#DocumentAlreadyExists": - throw await de_DocumentAlreadyExistsRes(parsedOutput, context); - case "DocumentLimitExceeded": - case "com.amazonaws.ssm#DocumentLimitExceeded": - throw await de_DocumentLimitExceededRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocumentContent": - case "com.amazonaws.ssm#InvalidDocumentContent": - throw await de_InvalidDocumentContentRes(parsedOutput, context); - case "InvalidDocumentSchemaVersion": - case "com.amazonaws.ssm#InvalidDocumentSchemaVersion": - throw await de_InvalidDocumentSchemaVersionRes(parsedOutput, context); - case "MaxDocumentSizeExceeded": - case "com.amazonaws.ssm#MaxDocumentSizeExceeded": - throw await de_MaxDocumentSizeExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreatePatchBaselineCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateMaintenanceWindowCommand + * deserializeAws_json1_1CreateResourceDataSyncCommand */ -export const de_CreateMaintenanceWindowCommand = async ( +export const de_CreateResourceDataSyncCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateMaintenanceWindowCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateMaintenanceWindowCommandOutput = { + const response: CreateResourceDataSyncCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3207,51 +2953,39 @@ export const de_CreateMaintenanceWindowCommand = async ( }; /** - * deserializeAws_json1_1CreateMaintenanceWindowCommandError + * deserializeAws_json1_1DeleteActivationCommand */ -const de_CreateMaintenanceWindowCommandError = async ( +export const de_DeleteActivationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatch": - case "com.amazonaws.ssm#IdempotentParameterMismatch": - throw await de_IdempotentParameterMismatchRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.ssm#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteActivationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateOpsItemCommand + * deserializeAws_json1_1DeleteAssociationCommand */ -export const de_CreateOpsItemCommand = async ( +export const de_DeleteAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateOpsItemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateOpsItemCommandOutput = { + const response: DeleteAssociationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3259,57 +2993,39 @@ export const de_CreateOpsItemCommand = async ( }; /** - * deserializeAws_json1_1CreateOpsItemCommandError + * deserializeAws_json1_1DeleteDocumentCommand */ -const de_CreateOpsItemCommandError = async ( +export const de_DeleteDocumentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "OpsItemAccessDeniedException": - case "com.amazonaws.ssm#OpsItemAccessDeniedException": - throw await de_OpsItemAccessDeniedExceptionRes(parsedOutput, context); - case "OpsItemAlreadyExistsException": - case "com.amazonaws.ssm#OpsItemAlreadyExistsException": - throw await de_OpsItemAlreadyExistsExceptionRes(parsedOutput, context); - case "OpsItemInvalidParameterException": - case "com.amazonaws.ssm#OpsItemInvalidParameterException": - throw await de_OpsItemInvalidParameterExceptionRes(parsedOutput, context); - case "OpsItemLimitExceededException": - case "com.amazonaws.ssm#OpsItemLimitExceededException": - throw await de_OpsItemLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteDocumentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateOpsMetadataCommand + * deserializeAws_json1_1DeleteInventoryCommand */ -export const de_CreateOpsMetadataCommand = async ( +export const de_DeleteInventoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateOpsMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateOpsMetadataCommandOutput = { + const response: DeleteInventoryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3317,57 +3033,39 @@ export const de_CreateOpsMetadataCommand = async ( }; /** - * deserializeAws_json1_1CreateOpsMetadataCommandError + * deserializeAws_json1_1DeleteMaintenanceWindowCommand */ -const de_CreateOpsMetadataCommandError = async ( +export const de_DeleteMaintenanceWindowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "OpsMetadataAlreadyExistsException": - case "com.amazonaws.ssm#OpsMetadataAlreadyExistsException": - throw await de_OpsMetadataAlreadyExistsExceptionRes(parsedOutput, context); - case "OpsMetadataInvalidArgumentException": - case "com.amazonaws.ssm#OpsMetadataInvalidArgumentException": - throw await de_OpsMetadataInvalidArgumentExceptionRes(parsedOutput, context); - case "OpsMetadataLimitExceededException": - case "com.amazonaws.ssm#OpsMetadataLimitExceededException": - throw await de_OpsMetadataLimitExceededExceptionRes(parsedOutput, context); - case "OpsMetadataTooManyUpdatesException": - case "com.amazonaws.ssm#OpsMetadataTooManyUpdatesException": - throw await de_OpsMetadataTooManyUpdatesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteMaintenanceWindowCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreatePatchBaselineCommand + * deserializeAws_json1_1DeleteOpsItemCommand */ -export const de_CreatePatchBaselineCommand = async ( +export const de_DeleteOpsItemCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreatePatchBaselineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreatePatchBaselineCommandOutput = { + const response: DeleteOpsItemCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3375,51 +3073,19 @@ export const de_CreatePatchBaselineCommand = async ( }; /** - * deserializeAws_json1_1CreatePatchBaselineCommandError + * deserializeAws_json1_1DeleteOpsMetadataCommand */ -const de_CreatePatchBaselineCommandError = async ( +export const de_DeleteOpsMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "IdempotentParameterMismatch": - case "com.amazonaws.ssm#IdempotentParameterMismatch": - throw await de_IdempotentParameterMismatchRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.ssm#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateResourceDataSyncCommand - */ -export const de_CreateResourceDataSyncCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateResourceDataSyncCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateResourceDataSyncCommandOutput = { + const response: DeleteOpsMetadataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3427,54 +3093,19 @@ export const de_CreateResourceDataSyncCommand = async ( }; /** - * deserializeAws_json1_1CreateResourceDataSyncCommandError - */ -const de_CreateResourceDataSyncCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourceDataSyncAlreadyExistsException": - case "com.amazonaws.ssm#ResourceDataSyncAlreadyExistsException": - throw await de_ResourceDataSyncAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceDataSyncCountExceededException": - case "com.amazonaws.ssm#ResourceDataSyncCountExceededException": - throw await de_ResourceDataSyncCountExceededExceptionRes(parsedOutput, context); - case "ResourceDataSyncInvalidConfigurationException": - case "com.amazonaws.ssm#ResourceDataSyncInvalidConfigurationException": - throw await de_ResourceDataSyncInvalidConfigurationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteActivationCommand + * deserializeAws_json1_1DeleteParameterCommand */ -export const de_DeleteActivationCommand = async ( +export const de_DeleteParameterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteActivationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteActivationCommandOutput = { + const response: DeleteParameterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3482,54 +3113,19 @@ export const de_DeleteActivationCommand = async ( }; /** - * deserializeAws_json1_1DeleteActivationCommandError - */ -const de_DeleteActivationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidActivation": - case "com.amazonaws.ssm#InvalidActivation": - throw await de_InvalidActivationRes(parsedOutput, context); - case "InvalidActivationId": - case "com.amazonaws.ssm#InvalidActivationId": - throw await de_InvalidActivationIdRes(parsedOutput, context); - case "TooManyUpdates": - case "com.amazonaws.ssm#TooManyUpdates": - throw await de_TooManyUpdatesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteAssociationCommand + * deserializeAws_json1_1DeleteParametersCommand */ -export const de_DeleteAssociationCommand = async ( +export const de_DeleteParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteAssociationCommandOutput = { + const response: DeleteParametersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3537,57 +3133,39 @@ export const de_DeleteAssociationCommand = async ( }; /** - * deserializeAws_json1_1DeleteAssociationCommandError + * deserializeAws_json1_1DeletePatchBaselineCommand */ -const de_DeleteAssociationCommandError = async ( +export const de_DeletePatchBaselineCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AssociationDoesNotExist": - case "com.amazonaws.ssm#AssociationDoesNotExist": - throw await de_AssociationDoesNotExistRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - case "TooManyUpdates": - case "com.amazonaws.ssm#TooManyUpdates": - throw await de_TooManyUpdatesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeletePatchBaselineCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteDocumentCommand + * deserializeAws_json1_1DeleteResourceDataSyncCommand */ -export const de_DeleteDocumentCommand = async ( +export const de_DeleteResourceDataSyncCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteDocumentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteDocumentCommandOutput = { + const response: DeleteResourceDataSyncCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3595,54 +3173,39 @@ export const de_DeleteDocumentCommand = async ( }; /** - * deserializeAws_json1_1DeleteDocumentCommandError + * deserializeAws_json1_1DeleteResourcePolicyCommand */ -const de_DeleteDocumentCommandError = async ( +export const de_DeleteResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AssociatedInstances": - case "com.amazonaws.ssm#AssociatedInstances": - throw await de_AssociatedInstancesRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidDocumentOperation": - case "com.amazonaws.ssm#InvalidDocumentOperation": - throw await de_InvalidDocumentOperationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteResourcePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteInventoryCommand + * deserializeAws_json1_1DeregisterManagedInstanceCommand */ -export const de_DeleteInventoryCommand = async ( +export const de_DeregisterManagedInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteInventoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteInventoryCommandOutput = { + const response: DeregisterManagedInstanceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3650,57 +3213,39 @@ export const de_DeleteInventoryCommand = async ( }; /** - * deserializeAws_json1_1DeleteInventoryCommandError + * deserializeAws_json1_1DeregisterPatchBaselineForPatchGroupCommand */ -const de_DeleteInventoryCommandError = async ( +export const de_DeregisterPatchBaselineForPatchGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDeleteInventoryParametersException": - case "com.amazonaws.ssm#InvalidDeleteInventoryParametersException": - throw await de_InvalidDeleteInventoryParametersExceptionRes(parsedOutput, context); - case "InvalidInventoryRequestException": - case "com.amazonaws.ssm#InvalidInventoryRequestException": - throw await de_InvalidInventoryRequestExceptionRes(parsedOutput, context); - case "InvalidOptionException": - case "com.amazonaws.ssm#InvalidOptionException": - throw await de_InvalidOptionExceptionRes(parsedOutput, context); - case "InvalidTypeNameException": - case "com.amazonaws.ssm#InvalidTypeNameException": - throw await de_InvalidTypeNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeregisterPatchBaselineForPatchGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteMaintenanceWindowCommand + * deserializeAws_json1_1DeregisterTargetFromMaintenanceWindowCommand */ -export const de_DeleteMaintenanceWindowCommand = async ( +export const de_DeregisterTargetFromMaintenanceWindowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteMaintenanceWindowCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteMaintenanceWindowCommandOutput = { + const response: DeregisterTargetFromMaintenanceWindowCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3708,45 +3253,39 @@ export const de_DeleteMaintenanceWindowCommand = async ( }; /** - * deserializeAws_json1_1DeleteMaintenanceWindowCommandError + * deserializeAws_json1_1DeregisterTaskFromMaintenanceWindowCommand */ -const de_DeleteMaintenanceWindowCommandError = async ( +export const de_DeregisterTaskFromMaintenanceWindowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeregisterTaskFromMaintenanceWindowCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteOpsItemCommand + * deserializeAws_json1_1DescribeActivationsCommand */ -export const de_DeleteOpsItemCommand = async ( +export const de_DescribeActivationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteOpsItemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteOpsItemCommandOutput = { + contents = de_DescribeActivationsResult(data, context); + const response: DescribeActivationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3754,48 +3293,39 @@ export const de_DeleteOpsItemCommand = async ( }; /** - * deserializeAws_json1_1DeleteOpsItemCommandError + * deserializeAws_json1_1DescribeAssociationCommand */ -const de_DeleteOpsItemCommandError = async ( +export const de_DescribeAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "OpsItemInvalidParameterException": - case "com.amazonaws.ssm#OpsItemInvalidParameterException": - throw await de_OpsItemInvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeAssociationResult(data, context); + const response: DescribeAssociationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteOpsMetadataCommand + * deserializeAws_json1_1DescribeAssociationExecutionsCommand */ -export const de_DeleteOpsMetadataCommand = async ( +export const de_DescribeAssociationExecutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteOpsMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteOpsMetadataCommandOutput = { + contents = de_DescribeAssociationExecutionsResult(data, context); + const response: DescribeAssociationExecutionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3803,51 +3333,39 @@ export const de_DeleteOpsMetadataCommand = async ( }; /** - * deserializeAws_json1_1DeleteOpsMetadataCommandError + * deserializeAws_json1_1DescribeAssociationExecutionTargetsCommand */ -const de_DeleteOpsMetadataCommandError = async ( +export const de_DescribeAssociationExecutionTargetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "OpsMetadataInvalidArgumentException": - case "com.amazonaws.ssm#OpsMetadataInvalidArgumentException": - throw await de_OpsMetadataInvalidArgumentExceptionRes(parsedOutput, context); - case "OpsMetadataNotFoundException": - case "com.amazonaws.ssm#OpsMetadataNotFoundException": - throw await de_OpsMetadataNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeAssociationExecutionTargetsResult(data, context); + const response: DescribeAssociationExecutionTargetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteParameterCommand + * deserializeAws_json1_1DescribeAutomationExecutionsCommand */ -export const de_DeleteParameterCommand = async ( +export const de_DescribeAutomationExecutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteParameterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteParameterCommandOutput = { + contents = de_DescribeAutomationExecutionsResult(data, context); + const response: DescribeAutomationExecutionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3855,48 +3373,39 @@ export const de_DeleteParameterCommand = async ( }; /** - * deserializeAws_json1_1DeleteParameterCommandError + * deserializeAws_json1_1DescribeAutomationStepExecutionsCommand */ -const de_DeleteParameterCommandError = async ( +export const de_DescribeAutomationStepExecutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ParameterNotFound": - case "com.amazonaws.ssm#ParameterNotFound": - throw await de_ParameterNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeAutomationStepExecutionsResult(data, context); + const response: DescribeAutomationStepExecutionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteParametersCommand + * deserializeAws_json1_1DescribeAvailablePatchesCommand */ -export const de_DeleteParametersCommand = async ( +export const de_DescribeAvailablePatchesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteParametersCommandOutput = { + contents = de_DescribeAvailablePatchesResult(data, context); + const response: DescribeAvailablePatchesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3904,45 +3413,39 @@ export const de_DeleteParametersCommand = async ( }; /** - * deserializeAws_json1_1DeleteParametersCommandError + * deserializeAws_json1_1DescribeDocumentCommand */ -const de_DeleteParametersCommandError = async ( +export const de_DescribeDocumentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDocumentResult(data, context); + const response: DescribeDocumentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeletePatchBaselineCommand + * deserializeAws_json1_1DescribeDocumentPermissionCommand */ -export const de_DeletePatchBaselineCommand = async ( +export const de_DescribeDocumentPermissionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeletePatchBaselineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeletePatchBaselineCommandOutput = { + const response: DescribeDocumentPermissionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3950,48 +3453,39 @@ export const de_DeletePatchBaselineCommand = async ( }; /** - * deserializeAws_json1_1DeletePatchBaselineCommandError + * deserializeAws_json1_1DescribeEffectiveInstanceAssociationsCommand */ -const de_DeletePatchBaselineCommandError = async ( +export const de_DescribeEffectiveInstanceAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.ssm#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeEffectiveInstanceAssociationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteResourceDataSyncCommand + * deserializeAws_json1_1DescribeEffectivePatchesForPatchBaselineCommand */ -export const de_DeleteResourceDataSyncCommand = async ( +export const de_DescribeEffectivePatchesForPatchBaselineCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteResourceDataSyncCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteResourceDataSyncCommandOutput = { + contents = de_DescribeEffectivePatchesForPatchBaselineResult(data, context); + const response: DescribeEffectivePatchesForPatchBaselineCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3999,51 +3493,39 @@ export const de_DeleteResourceDataSyncCommand = async ( }; /** - * deserializeAws_json1_1DeleteResourceDataSyncCommandError + * deserializeAws_json1_1DescribeInstanceAssociationsStatusCommand */ -const de_DeleteResourceDataSyncCommandError = async ( +export const de_DescribeInstanceAssociationsStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeInstanceAssociationsStatusResult(data, context); + const response: DescribeInstanceAssociationsStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourceDataSyncInvalidConfigurationException": - case "com.amazonaws.ssm#ResourceDataSyncInvalidConfigurationException": - throw await de_ResourceDataSyncInvalidConfigurationExceptionRes(parsedOutput, context); - case "ResourceDataSyncNotFoundException": - case "com.amazonaws.ssm#ResourceDataSyncNotFoundException": - throw await de_ResourceDataSyncNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1DeleteResourcePolicyCommand + * deserializeAws_json1_1DescribeInstanceInformationCommand */ -export const de_DeleteResourcePolicyCommand = async ( +export const de_DescribeInstanceInformationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteResourcePolicyCommandOutput = { + contents = de_DescribeInstanceInformationResult(data, context); + const response: DescribeInstanceInformationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4051,51 +3533,39 @@ export const de_DeleteResourcePolicyCommand = async ( }; /** - * deserializeAws_json1_1DeleteResourcePolicyCommandError + * deserializeAws_json1_1DescribeInstancePatchesCommand */ -const de_DeleteResourcePolicyCommandError = async ( +export const de_DescribeInstancePatchesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourcePolicyConflictException": - case "com.amazonaws.ssm#ResourcePolicyConflictException": - throw await de_ResourcePolicyConflictExceptionRes(parsedOutput, context); - case "ResourcePolicyInvalidParameterException": - case "com.amazonaws.ssm#ResourcePolicyInvalidParameterException": - throw await de_ResourcePolicyInvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeInstancePatchesResult(data, context); + const response: DescribeInstancePatchesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeregisterManagedInstanceCommand + * deserializeAws_json1_1DescribeInstancePatchStatesCommand */ -export const de_DeregisterManagedInstanceCommand = async ( +export const de_DescribeInstancePatchStatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeregisterManagedInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeregisterManagedInstanceCommandOutput = { + contents = de_DescribeInstancePatchStatesResult(data, context); + const response: DescribeInstancePatchStatesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4103,48 +3573,39 @@ export const de_DeregisterManagedInstanceCommand = async ( }; /** - * deserializeAws_json1_1DeregisterManagedInstanceCommandError + * deserializeAws_json1_1DescribeInstancePatchStatesForPatchGroupCommand */ -const de_DeregisterManagedInstanceCommandError = async ( +export const de_DescribeInstancePatchStatesForPatchGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeInstancePatchStatesForPatchGroupResult(data, context); + const response: DescribeInstancePatchStatesForPatchGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeregisterPatchBaselineForPatchGroupCommand + * deserializeAws_json1_1DescribeInventoryDeletionsCommand */ -export const de_DeregisterPatchBaselineForPatchGroupCommand = async ( +export const de_DescribeInventoryDeletionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeregisterPatchBaselineForPatchGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeregisterPatchBaselineForPatchGroupCommandOutput = { + contents = de_DescribeInventoryDeletionsResult(data, context); + const response: DescribeInventoryDeletionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4152,48 +3613,39 @@ export const de_DeregisterPatchBaselineForPatchGroupCommand = async ( }; /** - * deserializeAws_json1_1DeregisterPatchBaselineForPatchGroupCommandError + * deserializeAws_json1_1DescribeMaintenanceWindowExecutionsCommand */ -const de_DeregisterPatchBaselineForPatchGroupCommandError = async ( +export const de_DescribeMaintenanceWindowExecutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidResourceId": - case "com.amazonaws.ssm#InvalidResourceId": - throw await de_InvalidResourceIdRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeMaintenanceWindowExecutionsResult(data, context); + const response: DescribeMaintenanceWindowExecutionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeregisterTargetFromMaintenanceWindowCommand + * deserializeAws_json1_1DescribeMaintenanceWindowExecutionTaskInvocationsCommand */ -export const de_DeregisterTargetFromMaintenanceWindowCommand = async ( +export const de_DescribeMaintenanceWindowExecutionTaskInvocationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeregisterTargetFromMaintenanceWindowCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeregisterTargetFromMaintenanceWindowCommandOutput = { + contents = de_DescribeMaintenanceWindowExecutionTaskInvocationsResult(data, context); + const response: DescribeMaintenanceWindowExecutionTaskInvocationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4201,51 +3653,39 @@ export const de_DeregisterTargetFromMaintenanceWindowCommand = async ( }; /** - * deserializeAws_json1_1DeregisterTargetFromMaintenanceWindowCommandError + * deserializeAws_json1_1DescribeMaintenanceWindowExecutionTasksCommand */ -const de_DeregisterTargetFromMaintenanceWindowCommandError = async ( +export const de_DescribeMaintenanceWindowExecutionTasksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "TargetInUseException": - case "com.amazonaws.ssm#TargetInUseException": - throw await de_TargetInUseExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeMaintenanceWindowExecutionTasksResult(data, context); + const response: DescribeMaintenanceWindowExecutionTasksCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeregisterTaskFromMaintenanceWindowCommand + * deserializeAws_json1_1DescribeMaintenanceWindowsCommand */ -export const de_DeregisterTaskFromMaintenanceWindowCommand = async ( +export const de_DescribeMaintenanceWindowsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeregisterTaskFromMaintenanceWindowCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeregisterTaskFromMaintenanceWindowCommandOutput = { + const response: DescribeMaintenanceWindowsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4253,48 +3693,39 @@ export const de_DeregisterTaskFromMaintenanceWindowCommand = async ( }; /** - * deserializeAws_json1_1DeregisterTaskFromMaintenanceWindowCommandError + * deserializeAws_json1_1DescribeMaintenanceWindowScheduleCommand */ -const de_DeregisterTaskFromMaintenanceWindowCommandError = async ( +export const de_DescribeMaintenanceWindowScheduleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeMaintenanceWindowScheduleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeActivationsCommand + * deserializeAws_json1_1DescribeMaintenanceWindowsForTargetCommand */ -export const de_DescribeActivationsCommand = async ( +export const de_DescribeMaintenanceWindowsForTargetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeActivationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeActivationsResult(data, context); - const response: DescribeActivationsCommandOutput = { + contents = _json(data); + const response: DescribeMaintenanceWindowsForTargetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4302,51 +3733,39 @@ export const de_DescribeActivationsCommand = async ( }; /** - * deserializeAws_json1_1DescribeActivationsCommandError + * deserializeAws_json1_1DescribeMaintenanceWindowTargetsCommand */ -const de_DescribeActivationsCommandError = async ( +export const de_DescribeMaintenanceWindowTargetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeMaintenanceWindowTargetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidFilter": - case "com.amazonaws.ssm#InvalidFilter": - throw await de_InvalidFilterRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1DescribeAssociationCommand + * deserializeAws_json1_1DescribeMaintenanceWindowTasksCommand */ -export const de_DescribeAssociationCommand = async ( +export const de_DescribeMaintenanceWindowTasksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeAssociationResult(data, context); - const response: DescribeAssociationCommandOutput = { + contents = _json(data); + const response: DescribeMaintenanceWindowTasksCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4354,57 +3773,19 @@ export const de_DescribeAssociationCommand = async ( }; /** - * deserializeAws_json1_1DescribeAssociationCommandError - */ -const de_DescribeAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AssociationDoesNotExist": - case "com.amazonaws.ssm#AssociationDoesNotExist": - throw await de_AssociationDoesNotExistRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidAssociationVersion": - case "com.amazonaws.ssm#InvalidAssociationVersion": - throw await de_InvalidAssociationVersionRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAssociationExecutionsCommand + * deserializeAws_json1_1DescribeOpsItemsCommand */ -export const de_DescribeAssociationExecutionsCommand = async ( +export const de_DescribeOpsItemsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeAssociationExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeAssociationExecutionsResult(data, context); - const response: DescribeAssociationExecutionsCommandOutput = { + contents = de_DescribeOpsItemsResponse(data, context); + const response: DescribeOpsItemsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4412,51 +3793,39 @@ export const de_DescribeAssociationExecutionsCommand = async ( }; /** - * deserializeAws_json1_1DescribeAssociationExecutionsCommandError + * deserializeAws_json1_1DescribeParametersCommand */ -const de_DescribeAssociationExecutionsCommandError = async ( +export const de_DescribeParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AssociationDoesNotExist": - case "com.amazonaws.ssm#AssociationDoesNotExist": - throw await de_AssociationDoesNotExistRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeParametersResult(data, context); + const response: DescribeParametersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeAssociationExecutionTargetsCommand + * deserializeAws_json1_1DescribePatchBaselinesCommand */ -export const de_DescribeAssociationExecutionTargetsCommand = async ( +export const de_DescribePatchBaselinesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeAssociationExecutionTargetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeAssociationExecutionTargetsResult(data, context); - const response: DescribeAssociationExecutionTargetsCommandOutput = { + contents = _json(data); + const response: DescribePatchBaselinesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4464,54 +3833,39 @@ export const de_DescribeAssociationExecutionTargetsCommand = async ( }; /** - * deserializeAws_json1_1DescribeAssociationExecutionTargetsCommandError + * deserializeAws_json1_1DescribePatchGroupsCommand */ -const de_DescribeAssociationExecutionTargetsCommandError = async ( +export const de_DescribePatchGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AssociationDoesNotExist": - case "com.amazonaws.ssm#AssociationDoesNotExist": - throw await de_AssociationDoesNotExistRes(parsedOutput, context); - case "AssociationExecutionDoesNotExist": - case "com.amazonaws.ssm#AssociationExecutionDoesNotExist": - throw await de_AssociationExecutionDoesNotExistRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribePatchGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeAutomationExecutionsCommand + * deserializeAws_json1_1DescribePatchGroupStateCommand */ -export const de_DescribeAutomationExecutionsCommand = async ( +export const de_DescribePatchGroupStateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeAutomationExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeAutomationExecutionsResult(data, context); - const response: DescribeAutomationExecutionsCommandOutput = { + contents = _json(data); + const response: DescribePatchGroupStateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4519,54 +3873,39 @@ export const de_DescribeAutomationExecutionsCommand = async ( }; /** - * deserializeAws_json1_1DescribeAutomationExecutionsCommandError + * deserializeAws_json1_1DescribePatchPropertiesCommand */ -const de_DescribeAutomationExecutionsCommandError = async ( +export const de_DescribePatchPropertiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidFilterKey": - case "com.amazonaws.ssm#InvalidFilterKey": - throw await de_InvalidFilterKeyRes(parsedOutput, context); - case "InvalidFilterValue": - case "com.amazonaws.ssm#InvalidFilterValue": - throw await de_InvalidFilterValueRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribePatchPropertiesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeAutomationStepExecutionsCommand + * deserializeAws_json1_1DescribeSessionsCommand */ -export const de_DescribeAutomationStepExecutionsCommand = async ( +export const de_DescribeSessionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeAutomationStepExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeAutomationStepExecutionsResult(data, context); - const response: DescribeAutomationStepExecutionsCommandOutput = { + contents = de_DescribeSessionsResponse(data, context); + const response: DescribeSessionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4574,57 +3913,39 @@ export const de_DescribeAutomationStepExecutionsCommand = async ( }; /** - * deserializeAws_json1_1DescribeAutomationStepExecutionsCommandError + * deserializeAws_json1_1DisassociateOpsItemRelatedItemCommand */ -const de_DescribeAutomationStepExecutionsCommandError = async ( +export const de_DisassociateOpsItemRelatedItemCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AutomationExecutionNotFoundException": - case "com.amazonaws.ssm#AutomationExecutionNotFoundException": - throw await de_AutomationExecutionNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidFilterKey": - case "com.amazonaws.ssm#InvalidFilterKey": - throw await de_InvalidFilterKeyRes(parsedOutput, context); - case "InvalidFilterValue": - case "com.amazonaws.ssm#InvalidFilterValue": - throw await de_InvalidFilterValueRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisassociateOpsItemRelatedItemCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeAvailablePatchesCommand + * deserializeAws_json1_1GetAutomationExecutionCommand */ -export const de_DescribeAvailablePatchesCommand = async ( +export const de_GetAutomationExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeAvailablePatchesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeAvailablePatchesResult(data, context); - const response: DescribeAvailablePatchesCommandOutput = { + contents = de_GetAutomationExecutionResult(data, context); + const response: GetAutomationExecutionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4632,45 +3953,19 @@ export const de_DescribeAvailablePatchesCommand = async ( }; /** - * deserializeAws_json1_1DescribeAvailablePatchesCommandError + * deserializeAws_json1_1GetCalendarStateCommand */ -const de_DescribeAvailablePatchesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDocumentCommand - */ -export const de_DescribeDocumentCommand = async ( +export const de_GetCalendarStateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDocumentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeDocumentResult(data, context); - const response: DescribeDocumentCommandOutput = { + contents = _json(data); + const response: GetCalendarStateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4678,51 +3973,19 @@ export const de_DescribeDocumentCommand = async ( }; /** - * deserializeAws_json1_1DescribeDocumentCommandError - */ -const de_DescribeDocumentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidDocumentVersion": - case "com.amazonaws.ssm#InvalidDocumentVersion": - throw await de_InvalidDocumentVersionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeDocumentPermissionCommand + * deserializeAws_json1_1GetCommandInvocationCommand */ -export const de_DescribeDocumentPermissionCommand = async ( +export const de_GetCommandInvocationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeDocumentPermissionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeDocumentPermissionCommandOutput = { + const response: GetCommandInvocationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4730,57 +3993,39 @@ export const de_DescribeDocumentPermissionCommand = async ( }; /** - * deserializeAws_json1_1DescribeDocumentPermissionCommandError + * deserializeAws_json1_1GetConnectionStatusCommand */ -const de_DescribeDocumentPermissionCommandError = async ( +export const de_GetConnectionStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidDocumentOperation": - case "com.amazonaws.ssm#InvalidDocumentOperation": - throw await de_InvalidDocumentOperationRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "InvalidPermissionType": - case "com.amazonaws.ssm#InvalidPermissionType": - throw await de_InvalidPermissionTypeRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetConnectionStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeEffectiveInstanceAssociationsCommand + * deserializeAws_json1_1GetDefaultPatchBaselineCommand */ -export const de_DescribeEffectiveInstanceAssociationsCommand = async ( +export const de_GetDefaultPatchBaselineCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEffectiveInstanceAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeEffectiveInstanceAssociationsCommandOutput = { + const response: GetDefaultPatchBaselineCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4788,51 +4033,39 @@ export const de_DescribeEffectiveInstanceAssociationsCommand = async ( }; /** - * deserializeAws_json1_1DescribeEffectiveInstanceAssociationsCommandError + * deserializeAws_json1_1GetDeployablePatchSnapshotForInstanceCommand */ -const de_DescribeEffectiveInstanceAssociationsCommandError = async ( +export const de_GetDeployablePatchSnapshotForInstanceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetDeployablePatchSnapshotForInstanceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeEffectivePatchesForPatchBaselineCommand + * deserializeAws_json1_1GetDocumentCommand */ -export const de_DescribeEffectivePatchesForPatchBaselineCommand = async ( +export const de_GetDocumentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEffectivePatchesForPatchBaselineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeEffectivePatchesForPatchBaselineResult(data, context); - const response: DescribeEffectivePatchesForPatchBaselineCommandOutput = { + contents = de_GetDocumentResult(data, context); + const response: GetDocumentCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4840,54 +4073,39 @@ export const de_DescribeEffectivePatchesForPatchBaselineCommand = async ( }; /** - * deserializeAws_json1_1DescribeEffectivePatchesForPatchBaselineCommandError + * deserializeAws_json1_1GetInventoryCommand */ -const de_DescribeEffectivePatchesForPatchBaselineCommandError = async ( +export const de_GetInventoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidResourceId": - case "com.amazonaws.ssm#InvalidResourceId": - throw await de_InvalidResourceIdRes(parsedOutput, context); - case "UnsupportedOperatingSystem": - case "com.amazonaws.ssm#UnsupportedOperatingSystem": - throw await de_UnsupportedOperatingSystemRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetInventoryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeInstanceAssociationsStatusCommand + * deserializeAws_json1_1GetInventorySchemaCommand */ -export const de_DescribeInstanceAssociationsStatusCommand = async ( +export const de_GetInventorySchemaCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstanceAssociationsStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeInstanceAssociationsStatusResult(data, context); - const response: DescribeInstanceAssociationsStatusCommandOutput = { + contents = _json(data); + const response: GetInventorySchemaCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4895,51 +4113,39 @@ export const de_DescribeInstanceAssociationsStatusCommand = async ( }; /** - * deserializeAws_json1_1DescribeInstanceAssociationsStatusCommandError + * deserializeAws_json1_1GetMaintenanceWindowCommand */ -const de_DescribeInstanceAssociationsStatusCommandError = async ( +export const de_GetMaintenanceWindowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetMaintenanceWindowResult(data, context); + const response: GetMaintenanceWindowCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeInstanceInformationCommand + * deserializeAws_json1_1GetMaintenanceWindowExecutionCommand */ -export const de_DescribeInstanceInformationCommand = async ( +export const de_GetMaintenanceWindowExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstanceInformationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeInstanceInformationResult(data, context); - const response: DescribeInstanceInformationCommandOutput = { + contents = de_GetMaintenanceWindowExecutionResult(data, context); + const response: GetMaintenanceWindowExecutionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4947,57 +4153,19 @@ export const de_DescribeInstanceInformationCommand = async ( }; /** - * deserializeAws_json1_1DescribeInstanceInformationCommandError + * deserializeAws_json1_1GetMaintenanceWindowExecutionTaskCommand */ -const de_DescribeInstanceInformationCommandError = async ( +export const de_GetMaintenanceWindowExecutionTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidFilterKey": - case "com.amazonaws.ssm#InvalidFilterKey": - throw await de_InvalidFilterKeyRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - case "InvalidInstanceInformationFilterValue": - case "com.amazonaws.ssm#InvalidInstanceInformationFilterValue": - throw await de_InvalidInstanceInformationFilterValueRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeInstancePatchesCommand - */ -export const de_DescribeInstancePatchesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstancePatchesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeInstancePatchesResult(data, context); - const response: DescribeInstancePatchesCommandOutput = { + contents = de_GetMaintenanceWindowExecutionTaskResult(data, context); + const response: GetMaintenanceWindowExecutionTaskCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5005,54 +4173,39 @@ export const de_DescribeInstancePatchesCommand = async ( }; /** - * deserializeAws_json1_1DescribeInstancePatchesCommandError + * deserializeAws_json1_1GetMaintenanceWindowExecutionTaskInvocationCommand */ -const de_DescribeInstancePatchesCommandError = async ( +export const de_GetMaintenanceWindowExecutionTaskInvocationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidFilter": - case "com.amazonaws.ssm#InvalidFilter": - throw await de_InvalidFilterRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetMaintenanceWindowExecutionTaskInvocationResult(data, context); + const response: GetMaintenanceWindowExecutionTaskInvocationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeInstancePatchStatesCommand + * deserializeAws_json1_1GetMaintenanceWindowTaskCommand */ -export const de_DescribeInstancePatchStatesCommand = async ( +export const de_GetMaintenanceWindowTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstancePatchStatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeInstancePatchStatesResult(data, context); - const response: DescribeInstancePatchStatesCommandOutput = { + contents = de_GetMaintenanceWindowTaskResult(data, context); + const response: GetMaintenanceWindowTaskCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5060,48 +4213,39 @@ export const de_DescribeInstancePatchStatesCommand = async ( }; /** - * deserializeAws_json1_1DescribeInstancePatchStatesCommandError + * deserializeAws_json1_1GetOpsItemCommand */ -const de_DescribeInstancePatchStatesCommandError = async ( +export const de_GetOpsItemCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetOpsItemResponse(data, context); + const response: GetOpsItemCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeInstancePatchStatesForPatchGroupCommand + * deserializeAws_json1_1GetOpsMetadataCommand */ -export const de_DescribeInstancePatchStatesForPatchGroupCommand = async ( +export const de_GetOpsMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstancePatchStatesForPatchGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeInstancePatchStatesForPatchGroupResult(data, context); - const response: DescribeInstancePatchStatesForPatchGroupCommandOutput = { + contents = _json(data); + const response: GetOpsMetadataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5109,51 +4253,39 @@ export const de_DescribeInstancePatchStatesForPatchGroupCommand = async ( }; /** - * deserializeAws_json1_1DescribeInstancePatchStatesForPatchGroupCommandError + * deserializeAws_json1_1GetOpsSummaryCommand */ -const de_DescribeInstancePatchStatesForPatchGroupCommandError = async ( +export const de_GetOpsSummaryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidFilter": - case "com.amazonaws.ssm#InvalidFilter": - throw await de_InvalidFilterRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetOpsSummaryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeInventoryDeletionsCommand + * deserializeAws_json1_1GetParameterCommand */ -export const de_DescribeInventoryDeletionsCommand = async ( +export const de_GetParameterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeInventoryDeletionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeInventoryDeletionsResult(data, context); - const response: DescribeInventoryDeletionsCommandOutput = { + contents = de_GetParameterResult(data, context); + const response: GetParameterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5161,51 +4293,39 @@ export const de_DescribeInventoryDeletionsCommand = async ( }; /** - * deserializeAws_json1_1DescribeInventoryDeletionsCommandError + * deserializeAws_json1_1GetParameterHistoryCommand */ -const de_DescribeInventoryDeletionsCommandError = async ( +export const de_GetParameterHistoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDeletionIdException": - case "com.amazonaws.ssm#InvalidDeletionIdException": - throw await de_InvalidDeletionIdExceptionRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetParameterHistoryResult(data, context); + const response: GetParameterHistoryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowExecutionsCommand + * deserializeAws_json1_1GetParametersCommand */ -export const de_DescribeMaintenanceWindowExecutionsCommand = async ( +export const de_GetParametersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeMaintenanceWindowExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeMaintenanceWindowExecutionsResult(data, context); - const response: DescribeMaintenanceWindowExecutionsCommandOutput = { + contents = de_GetParametersResult(data, context); + const response: GetParametersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5213,45 +4333,39 @@ export const de_DescribeMaintenanceWindowExecutionsCommand = async ( }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowExecutionsCommandError + * deserializeAws_json1_1GetParametersByPathCommand */ -const de_DescribeMaintenanceWindowExecutionsCommandError = async ( +export const de_GetParametersByPathCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetParametersByPathResult(data, context); + const response: GetParametersByPathCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowExecutionTaskInvocationsCommand + * deserializeAws_json1_1GetPatchBaselineCommand */ -export const de_DescribeMaintenanceWindowExecutionTaskInvocationsCommand = async ( +export const de_GetPatchBaselineCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeMaintenanceWindowExecutionTaskInvocationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeMaintenanceWindowExecutionTaskInvocationsResult(data, context); - const response: DescribeMaintenanceWindowExecutionTaskInvocationsCommandOutput = { + contents = de_GetPatchBaselineResult(data, context); + const response: GetPatchBaselineCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5259,48 +4373,39 @@ export const de_DescribeMaintenanceWindowExecutionTaskInvocationsCommand = async }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowExecutionTaskInvocationsCommandError + * deserializeAws_json1_1GetPatchBaselineForPatchGroupCommand */ -const de_DescribeMaintenanceWindowExecutionTaskInvocationsCommandError = async ( +export const de_GetPatchBaselineForPatchGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetPatchBaselineForPatchGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowExecutionTasksCommand + * deserializeAws_json1_1GetResourcePoliciesCommand */ -export const de_DescribeMaintenanceWindowExecutionTasksCommand = async ( +export const de_GetResourcePoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeMaintenanceWindowExecutionTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeMaintenanceWindowExecutionTasksResult(data, context); - const response: DescribeMaintenanceWindowExecutionTasksCommandOutput = { + contents = _json(data); + const response: GetResourcePoliciesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5308,48 +4413,39 @@ export const de_DescribeMaintenanceWindowExecutionTasksCommand = async ( }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowExecutionTasksCommandError + * deserializeAws_json1_1GetServiceSettingCommand */ -const de_DescribeMaintenanceWindowExecutionTasksCommandError = async ( +export const de_GetServiceSettingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetServiceSettingResult(data, context); + const response: GetServiceSettingCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowsCommand + * deserializeAws_json1_1LabelParameterVersionCommand */ -export const de_DescribeMaintenanceWindowsCommand = async ( +export const de_LabelParameterVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeMaintenanceWindowsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeMaintenanceWindowsCommandOutput = { + const response: LabelParameterVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5357,45 +4453,39 @@ export const de_DescribeMaintenanceWindowsCommand = async ( }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowsCommandError + * deserializeAws_json1_1ListAssociationsCommand */ -const de_DescribeMaintenanceWindowsCommandError = async ( +export const de_ListAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListAssociationsResult(data, context); + const response: ListAssociationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowScheduleCommand + * deserializeAws_json1_1ListAssociationVersionsCommand */ -export const de_DescribeMaintenanceWindowScheduleCommand = async ( +export const de_ListAssociationVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeMaintenanceWindowScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeMaintenanceWindowScheduleCommandOutput = { + contents = de_ListAssociationVersionsResult(data, context); + const response: ListAssociationVersionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5403,48 +4493,39 @@ export const de_DescribeMaintenanceWindowScheduleCommand = async ( }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowScheduleCommandError + * deserializeAws_json1_1ListCommandInvocationsCommand */ -const de_DescribeMaintenanceWindowScheduleCommandError = async ( +export const de_ListCommandInvocationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListCommandInvocationsResult(data, context); + const response: ListCommandInvocationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowsForTargetCommand + * deserializeAws_json1_1ListCommandsCommand */ -export const de_DescribeMaintenanceWindowsForTargetCommand = async ( +export const de_ListCommandsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeMaintenanceWindowsForTargetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeMaintenanceWindowsForTargetCommandOutput = { + contents = de_ListCommandsResult(data, context); + const response: ListCommandsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5452,45 +4533,39 @@ export const de_DescribeMaintenanceWindowsForTargetCommand = async ( }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowsForTargetCommandError + * deserializeAws_json1_1ListComplianceItemsCommand */ -const de_DescribeMaintenanceWindowsForTargetCommandError = async ( +export const de_ListComplianceItemsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListComplianceItemsResult(data, context); + const response: ListComplianceItemsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowTargetsCommand + * deserializeAws_json1_1ListComplianceSummariesCommand */ -export const de_DescribeMaintenanceWindowTargetsCommand = async ( +export const de_ListComplianceSummariesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeMaintenanceWindowTargetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeMaintenanceWindowTargetsCommandOutput = { + const response: ListComplianceSummariesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5498,48 +4573,39 @@ export const de_DescribeMaintenanceWindowTargetsCommand = async ( }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowTargetsCommandError + * deserializeAws_json1_1ListDocumentMetadataHistoryCommand */ -const de_DescribeMaintenanceWindowTargetsCommandError = async ( +export const de_ListDocumentMetadataHistoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDocumentMetadataHistoryResponse(data, context); + const response: ListDocumentMetadataHistoryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowTasksCommand + * deserializeAws_json1_1ListDocumentsCommand */ -export const de_DescribeMaintenanceWindowTasksCommand = async ( +export const de_ListDocumentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeMaintenanceWindowTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeMaintenanceWindowTasksCommandOutput = { + contents = de_ListDocumentsResult(data, context); + const response: ListDocumentsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5547,48 +4613,39 @@ export const de_DescribeMaintenanceWindowTasksCommand = async ( }; /** - * deserializeAws_json1_1DescribeMaintenanceWindowTasksCommandError + * deserializeAws_json1_1ListDocumentVersionsCommand */ -const de_DescribeMaintenanceWindowTasksCommandError = async ( +export const de_ListDocumentVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDocumentVersionsResult(data, context); + const response: ListDocumentVersionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1DescribeOpsItemsCommand + * deserializeAws_json1_1ListInventoryEntriesCommand */ -export const de_DescribeOpsItemsCommand = async ( +export const de_ListInventoryEntriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeOpsItemsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeOpsItemsResponse(data, context); - const response: DescribeOpsItemsCommandOutput = { + contents = _json(data); + const response: ListInventoryEntriesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5596,45 +4653,39 @@ export const de_DescribeOpsItemsCommand = async ( }; /** - * deserializeAws_json1_1DescribeOpsItemsCommandError + * deserializeAws_json1_1ListOpsItemEventsCommand */ -const de_DescribeOpsItemsCommandError = async ( +export const de_ListOpsItemEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListOpsItemEventsResponse(data, context); + const response: ListOpsItemEventsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeParametersCommand + * deserializeAws_json1_1ListOpsItemRelatedItemsCommand */ -export const de_DescribeParametersCommand = async ( +export const de_ListOpsItemRelatedItemsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeParametersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeParametersResult(data, context); - const response: DescribeParametersCommandOutput = { + contents = de_ListOpsItemRelatedItemsResponse(data, context); + const response: ListOpsItemRelatedItemsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5642,57 +4693,39 @@ export const de_DescribeParametersCommand = async ( }; /** - * deserializeAws_json1_1DescribeParametersCommandError + * deserializeAws_json1_1ListOpsMetadataCommand */ -const de_DescribeParametersCommandError = async ( +export const de_ListOpsMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidFilterKey": - case "com.amazonaws.ssm#InvalidFilterKey": - throw await de_InvalidFilterKeyRes(parsedOutput, context); - case "InvalidFilterOption": - case "com.amazonaws.ssm#InvalidFilterOption": - throw await de_InvalidFilterOptionRes(parsedOutput, context); - case "InvalidFilterValue": - case "com.amazonaws.ssm#InvalidFilterValue": - throw await de_InvalidFilterValueRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListOpsMetadataResult(data, context); + const response: ListOpsMetadataCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribePatchBaselinesCommand + * deserializeAws_json1_1ListResourceComplianceSummariesCommand */ -export const de_DescribePatchBaselinesCommand = async ( +export const de_ListResourceComplianceSummariesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribePatchBaselinesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribePatchBaselinesCommandOutput = { + contents = de_ListResourceComplianceSummariesResult(data, context); + const response: ListResourceComplianceSummariesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5700,45 +4733,39 @@ export const de_DescribePatchBaselinesCommand = async ( }; /** - * deserializeAws_json1_1DescribePatchBaselinesCommandError + * deserializeAws_json1_1ListResourceDataSyncCommand */ -const de_DescribePatchBaselinesCommandError = async ( +export const de_ListResourceDataSyncCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListResourceDataSyncResult(data, context); + const response: ListResourceDataSyncCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribePatchGroupsCommand + * deserializeAws_json1_1ListTagsForResourceCommand */ -export const de_DescribePatchGroupsCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribePatchGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribePatchGroupsCommandOutput = { + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5746,45 +4773,19 @@ export const de_DescribePatchGroupsCommand = async ( }; /** - * deserializeAws_json1_1DescribePatchGroupsCommandError - */ -const de_DescribePatchGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribePatchGroupStateCommand + * deserializeAws_json1_1ModifyDocumentPermissionCommand */ -export const de_DescribePatchGroupStateCommand = async ( +export const de_ModifyDocumentPermissionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribePatchGroupStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribePatchGroupStateCommandOutput = { + const response: ModifyDocumentPermissionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5792,48 +4793,39 @@ export const de_DescribePatchGroupStateCommand = async ( }; /** - * deserializeAws_json1_1DescribePatchGroupStateCommandError + * deserializeAws_json1_1PutComplianceItemsCommand */ -const de_DescribePatchGroupStateCommandError = async ( +export const de_PutComplianceItemsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutComplianceItemsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribePatchPropertiesCommand + * deserializeAws_json1_1PutInventoryCommand */ -export const de_DescribePatchPropertiesCommand = async ( +export const de_PutInventoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribePatchPropertiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribePatchPropertiesCommandOutput = { + const response: PutInventoryCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5841,45 +4833,39 @@ export const de_DescribePatchPropertiesCommand = async ( }; /** - * deserializeAws_json1_1DescribePatchPropertiesCommandError + * deserializeAws_json1_1PutParameterCommand */ -const de_DescribePatchPropertiesCommandError = async ( +export const de_PutParameterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutParameterCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeSessionsCommand + * deserializeAws_json1_1PutResourcePolicyCommand */ -export const de_DescribeSessionsCommand = async ( +export const de_PutResourcePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeSessionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeSessionsResponse(data, context); - const response: DescribeSessionsCommandOutput = { + contents = _json(data); + const response: PutResourcePolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5887,51 +4873,19 @@ export const de_DescribeSessionsCommand = async ( }; /** - * deserializeAws_json1_1DescribeSessionsCommandError + * deserializeAws_json1_1RegisterDefaultPatchBaselineCommand */ -const de_DescribeSessionsCommandError = async ( +export const de_RegisterDefaultPatchBaselineCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidFilterKey": - case "com.amazonaws.ssm#InvalidFilterKey": - throw await de_InvalidFilterKeyRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociateOpsItemRelatedItemCommand - */ -export const de_DisassociateOpsItemRelatedItemCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateOpsItemRelatedItemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateOpsItemRelatedItemCommandOutput = { + const response: RegisterDefaultPatchBaselineCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5939,57 +4893,39 @@ export const de_DisassociateOpsItemRelatedItemCommand = async ( }; /** - * deserializeAws_json1_1DisassociateOpsItemRelatedItemCommandError + * deserializeAws_json1_1RegisterPatchBaselineForPatchGroupCommand */ -const de_DisassociateOpsItemRelatedItemCommandError = async ( +export const de_RegisterPatchBaselineForPatchGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "OpsItemConflictException": - case "com.amazonaws.ssm#OpsItemConflictException": - throw await de_OpsItemConflictExceptionRes(parsedOutput, context); - case "OpsItemInvalidParameterException": - case "com.amazonaws.ssm#OpsItemInvalidParameterException": - throw await de_OpsItemInvalidParameterExceptionRes(parsedOutput, context); - case "OpsItemNotFoundException": - case "com.amazonaws.ssm#OpsItemNotFoundException": - throw await de_OpsItemNotFoundExceptionRes(parsedOutput, context); - case "OpsItemRelatedItemAssociationNotFoundException": - case "com.amazonaws.ssm#OpsItemRelatedItemAssociationNotFoundException": - throw await de_OpsItemRelatedItemAssociationNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: RegisterPatchBaselineForPatchGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetAutomationExecutionCommand + * deserializeAws_json1_1RegisterTargetWithMaintenanceWindowCommand */ -export const de_GetAutomationExecutionCommand = async ( +export const de_RegisterTargetWithMaintenanceWindowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetAutomationExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetAutomationExecutionResult(data, context); - const response: GetAutomationExecutionCommandOutput = { + contents = _json(data); + const response: RegisterTargetWithMaintenanceWindowCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5997,48 +4933,39 @@ export const de_GetAutomationExecutionCommand = async ( }; /** - * deserializeAws_json1_1GetAutomationExecutionCommandError + * deserializeAws_json1_1RegisterTaskWithMaintenanceWindowCommand */ -const de_GetAutomationExecutionCommandError = async ( +export const de_RegisterTaskWithMaintenanceWindowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AutomationExecutionNotFoundException": - case "com.amazonaws.ssm#AutomationExecutionNotFoundException": - throw await de_AutomationExecutionNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: RegisterTaskWithMaintenanceWindowCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetCalendarStateCommand + * deserializeAws_json1_1RemoveTagsFromResourceCommand */ -export const de_GetCalendarStateCommand = async ( +export const de_RemoveTagsFromResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetCalendarStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetCalendarStateCommandOutput = { + const response: RemoveTagsFromResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6046,54 +4973,39 @@ export const de_GetCalendarStateCommand = async ( }; /** - * deserializeAws_json1_1GetCalendarStateCommandError + * deserializeAws_json1_1ResetServiceSettingCommand */ -const de_GetCalendarStateCommandError = async ( +export const de_ResetServiceSettingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidDocumentType": - case "com.amazonaws.ssm#InvalidDocumentType": - throw await de_InvalidDocumentTypeRes(parsedOutput, context); - case "UnsupportedCalendarException": - case "com.amazonaws.ssm#UnsupportedCalendarException": - throw await de_UnsupportedCalendarExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ResetServiceSettingResult(data, context); + const response: ResetServiceSettingCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetCommandInvocationCommand + * deserializeAws_json1_1ResumeSessionCommand */ -export const de_GetCommandInvocationCommand = async ( +export const de_ResumeSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetCommandInvocationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetCommandInvocationCommandOutput = { + const response: ResumeSessionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6101,57 +5013,39 @@ export const de_GetCommandInvocationCommand = async ( }; /** - * deserializeAws_json1_1GetCommandInvocationCommandError + * deserializeAws_json1_1SendAutomationSignalCommand */ -const de_GetCommandInvocationCommandError = async ( +export const de_SendAutomationSignalCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidCommandId": - case "com.amazonaws.ssm#InvalidCommandId": - throw await de_InvalidCommandIdRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - case "InvalidPluginName": - case "com.amazonaws.ssm#InvalidPluginName": - throw await de_InvalidPluginNameRes(parsedOutput, context); - case "InvocationDoesNotExist": - case "com.amazonaws.ssm#InvocationDoesNotExist": - throw await de_InvocationDoesNotExistRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: SendAutomationSignalCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetConnectionStatusCommand + * deserializeAws_json1_1SendCommandCommand */ -export const de_GetConnectionStatusCommand = async ( +export const de_SendCommandCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetConnectionStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetConnectionStatusCommandOutput = { + contents = de_SendCommandResult(data, context); + const response: SendCommandCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6159,45 +5053,39 @@ export const de_GetConnectionStatusCommand = async ( }; /** - * deserializeAws_json1_1GetConnectionStatusCommandError + * deserializeAws_json1_1StartAssociationsOnceCommand */ -const de_GetConnectionStatusCommandError = async ( +export const de_StartAssociationsOnceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartAssociationsOnceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetDefaultPatchBaselineCommand + * deserializeAws_json1_1StartAutomationExecutionCommand */ -export const de_GetDefaultPatchBaselineCommand = async ( +export const de_StartAutomationExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetDefaultPatchBaselineCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetDefaultPatchBaselineCommandOutput = { + const response: StartAutomationExecutionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6205,45 +5093,19 @@ export const de_GetDefaultPatchBaselineCommand = async ( }; /** - * deserializeAws_json1_1GetDefaultPatchBaselineCommandError + * deserializeAws_json1_1StartChangeRequestExecutionCommand */ -const de_GetDefaultPatchBaselineCommandError = async ( +export const de_StartChangeRequestExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDeployablePatchSnapshotForInstanceCommand - */ -export const de_GetDeployablePatchSnapshotForInstanceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetDeployablePatchSnapshotForInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetDeployablePatchSnapshotForInstanceCommandOutput = { + const response: StartChangeRequestExecutionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6251,51 +5113,39 @@ export const de_GetDeployablePatchSnapshotForInstanceCommand = async ( }; /** - * deserializeAws_json1_1GetDeployablePatchSnapshotForInstanceCommandError + * deserializeAws_json1_1StartSessionCommand */ -const de_GetDeployablePatchSnapshotForInstanceCommandError = async ( +export const de_StartSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "UnsupportedFeatureRequiredException": - case "com.amazonaws.ssm#UnsupportedFeatureRequiredException": - throw await de_UnsupportedFeatureRequiredExceptionRes(parsedOutput, context); - case "UnsupportedOperatingSystem": - case "com.amazonaws.ssm#UnsupportedOperatingSystem": - throw await de_UnsupportedOperatingSystemRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartSessionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetDocumentCommand + * deserializeAws_json1_1StopAutomationExecutionCommand */ -export const de_GetDocumentCommand = async ( +export const de_StopAutomationExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetDocumentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetDocumentResult(data, context); - const response: GetDocumentCommandOutput = { + contents = _json(data); + const response: StopAutomationExecutionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6303,51 +5153,39 @@ export const de_GetDocumentCommand = async ( }; /** - * deserializeAws_json1_1GetDocumentCommandError + * deserializeAws_json1_1TerminateSessionCommand */ -const de_GetDocumentCommandError = async ( +export const de_TerminateSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidDocumentVersion": - case "com.amazonaws.ssm#InvalidDocumentVersion": - throw await de_InvalidDocumentVersionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TerminateSessionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetInventoryCommand + * deserializeAws_json1_1UnlabelParameterVersionCommand */ -export const de_GetInventoryCommand = async ( +export const de_UnlabelParameterVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetInventoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetInventoryCommandOutput = { + const response: UnlabelParameterVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6355,63 +5193,39 @@ export const de_GetInventoryCommand = async ( }; /** - * deserializeAws_json1_1GetInventoryCommandError + * deserializeAws_json1_1UpdateAssociationCommand */ -const de_GetInventoryCommandError = async ( +export const de_UpdateAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidAggregatorException": - case "com.amazonaws.ssm#InvalidAggregatorException": - throw await de_InvalidAggregatorExceptionRes(parsedOutput, context); - case "InvalidFilter": - case "com.amazonaws.ssm#InvalidFilter": - throw await de_InvalidFilterRes(parsedOutput, context); - case "InvalidInventoryGroupException": - case "com.amazonaws.ssm#InvalidInventoryGroupException": - throw await de_InvalidInventoryGroupExceptionRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "InvalidResultAttributeException": - case "com.amazonaws.ssm#InvalidResultAttributeException": - throw await de_InvalidResultAttributeExceptionRes(parsedOutput, context); - case "InvalidTypeNameException": - case "com.amazonaws.ssm#InvalidTypeNameException": - throw await de_InvalidTypeNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateAssociationResult(data, context); + const response: UpdateAssociationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetInventorySchemaCommand + * deserializeAws_json1_1UpdateAssociationStatusCommand */ -export const de_GetInventorySchemaCommand = async ( +export const de_UpdateAssociationStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetInventorySchemaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetInventorySchemaCommandOutput = { + contents = de_UpdateAssociationStatusResult(data, context); + const response: UpdateAssociationStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6419,51 +5233,39 @@ export const de_GetInventorySchemaCommand = async ( }; /** - * deserializeAws_json1_1GetInventorySchemaCommandError + * deserializeAws_json1_1UpdateDocumentCommand */ -const de_GetInventorySchemaCommandError = async ( +export const de_UpdateDocumentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "InvalidTypeNameException": - case "com.amazonaws.ssm#InvalidTypeNameException": - throw await de_InvalidTypeNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateDocumentResult(data, context); + const response: UpdateDocumentCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetMaintenanceWindowCommand + * deserializeAws_json1_1UpdateDocumentDefaultVersionCommand */ -export const de_GetMaintenanceWindowCommand = async ( +export const de_UpdateDocumentDefaultVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetMaintenanceWindowCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetMaintenanceWindowResult(data, context); - const response: GetMaintenanceWindowCommandOutput = { + contents = _json(data); + const response: UpdateDocumentDefaultVersionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6471,48 +5273,39 @@ export const de_GetMaintenanceWindowCommand = async ( }; /** - * deserializeAws_json1_1GetMaintenanceWindowCommandError + * deserializeAws_json1_1UpdateDocumentMetadataCommand */ -const de_GetMaintenanceWindowCommandError = async ( +export const de_UpdateDocumentMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateDocumentMetadataCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetMaintenanceWindowExecutionCommand + * deserializeAws_json1_1UpdateMaintenanceWindowCommand */ -export const de_GetMaintenanceWindowExecutionCommand = async ( +export const de_UpdateMaintenanceWindowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetMaintenanceWindowExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetMaintenanceWindowExecutionResult(data, context); - const response: GetMaintenanceWindowExecutionCommandOutput = { + contents = _json(data); + const response: UpdateMaintenanceWindowCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6520,48 +5313,19 @@ export const de_GetMaintenanceWindowExecutionCommand = async ( }; /** - * deserializeAws_json1_1GetMaintenanceWindowExecutionCommandError + * deserializeAws_json1_1UpdateMaintenanceWindowTargetCommand */ -const de_GetMaintenanceWindowExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetMaintenanceWindowExecutionTaskCommand - */ -export const de_GetMaintenanceWindowExecutionTaskCommand = async ( +export const de_UpdateMaintenanceWindowTargetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetMaintenanceWindowExecutionTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetMaintenanceWindowExecutionTaskResult(data, context); - const response: GetMaintenanceWindowExecutionTaskCommandOutput = { + contents = _json(data); + const response: UpdateMaintenanceWindowTargetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6569,48 +5333,19 @@ export const de_GetMaintenanceWindowExecutionTaskCommand = async ( }; /** - * deserializeAws_json1_1GetMaintenanceWindowExecutionTaskCommandError - */ -const de_GetMaintenanceWindowExecutionTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetMaintenanceWindowExecutionTaskInvocationCommand + * deserializeAws_json1_1UpdateMaintenanceWindowTaskCommand */ -export const de_GetMaintenanceWindowExecutionTaskInvocationCommand = async ( +export const de_UpdateMaintenanceWindowTaskCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetMaintenanceWindowExecutionTaskInvocationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetMaintenanceWindowExecutionTaskInvocationResult(data, context); - const response: GetMaintenanceWindowExecutionTaskInvocationCommandOutput = { + contents = de_UpdateMaintenanceWindowTaskResult(data, context); + const response: UpdateMaintenanceWindowTaskCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6618,48 +5353,19 @@ export const de_GetMaintenanceWindowExecutionTaskInvocationCommand = async ( }; /** - * deserializeAws_json1_1GetMaintenanceWindowExecutionTaskInvocationCommandError - */ -const de_GetMaintenanceWindowExecutionTaskInvocationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetMaintenanceWindowTaskCommand + * deserializeAws_json1_1UpdateManagedInstanceRoleCommand */ -export const de_GetMaintenanceWindowTaskCommand = async ( +export const de_UpdateManagedInstanceRoleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetMaintenanceWindowTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetMaintenanceWindowTaskResult(data, context); - const response: GetMaintenanceWindowTaskCommandOutput = { + contents = _json(data); + const response: UpdateManagedInstanceRoleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6667,48 +5373,39 @@ export const de_GetMaintenanceWindowTaskCommand = async ( }; /** - * deserializeAws_json1_1GetMaintenanceWindowTaskCommandError + * deserializeAws_json1_1UpdateOpsItemCommand */ -const de_GetMaintenanceWindowTaskCommandError = async ( +export const de_UpdateOpsItemCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateOpsItemCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetOpsItemCommand + * deserializeAws_json1_1UpdateOpsMetadataCommand */ -export const de_GetOpsItemCommand = async ( +export const de_UpdateOpsMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetOpsItemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetOpsItemResponse(data, context); - const response: GetOpsItemCommandOutput = { + contents = _json(data); + const response: UpdateOpsMetadataCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6716,51 +5413,39 @@ export const de_GetOpsItemCommand = async ( }; /** - * deserializeAws_json1_1GetOpsItemCommandError + * deserializeAws_json1_1UpdatePatchBaselineCommand */ -const de_GetOpsItemCommandError = async ( +export const de_UpdatePatchBaselineCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "OpsItemAccessDeniedException": - case "com.amazonaws.ssm#OpsItemAccessDeniedException": - throw await de_OpsItemAccessDeniedExceptionRes(parsedOutput, context); - case "OpsItemNotFoundException": - case "com.amazonaws.ssm#OpsItemNotFoundException": - throw await de_OpsItemNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdatePatchBaselineResult(data, context); + const response: UpdatePatchBaselineCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetOpsMetadataCommand + * deserializeAws_json1_1UpdateResourceDataSyncCommand */ -export const de_GetOpsMetadataCommand = async ( +export const de_UpdateResourceDataSyncCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetOpsMetadataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetOpsMetadataCommandOutput = { + const response: UpdateResourceDataSyncCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6768,51 +5453,19 @@ export const de_GetOpsMetadataCommand = async ( }; /** - * deserializeAws_json1_1GetOpsMetadataCommandError - */ -const de_GetOpsMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "OpsMetadataInvalidArgumentException": - case "com.amazonaws.ssm#OpsMetadataInvalidArgumentException": - throw await de_OpsMetadataInvalidArgumentExceptionRes(parsedOutput, context); - case "OpsMetadataNotFoundException": - case "com.amazonaws.ssm#OpsMetadataNotFoundException": - throw await de_OpsMetadataNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetOpsSummaryCommand + * deserializeAws_json1_1UpdateServiceSettingCommand */ -export const de_GetOpsSummaryCommand = async ( +export const de_UpdateServiceSettingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetOpsSummaryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetOpsSummaryCommandOutput = { + const response: UpdateServiceSettingCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6820,12 +5473,9 @@ export const de_GetOpsSummaryCommand = async ( }; /** - * deserializeAws_json1_1GetOpsSummaryCommandError + * deserialize_Aws_json1_1CommandError */ -const de_GetOpsSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -6835,3391 +5485,397 @@ const de_GetOpsSummaryCommandError = async ( case "InternalServerError": case "com.amazonaws.ssm#InternalServerError": throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidAggregatorException": - case "com.amazonaws.ssm#InvalidAggregatorException": - throw await de_InvalidAggregatorExceptionRes(parsedOutput, context); - case "InvalidFilter": - case "com.amazonaws.ssm#InvalidFilter": - throw await de_InvalidFilterRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "InvalidTypeNameException": - case "com.amazonaws.ssm#InvalidTypeNameException": - throw await de_InvalidTypeNameExceptionRes(parsedOutput, context); - case "ResourceDataSyncNotFoundException": - case "com.amazonaws.ssm#ResourceDataSyncNotFoundException": - throw await de_ResourceDataSyncNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetParameterCommand - */ -export const de_GetParameterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetParameterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetParameterResult(data, context); - const response: GetParameterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetParameterCommandError - */ -const de_GetParameterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidKeyId": - case "com.amazonaws.ssm#InvalidKeyId": - throw await de_InvalidKeyIdRes(parsedOutput, context); - case "ParameterNotFound": - case "com.amazonaws.ssm#ParameterNotFound": - throw await de_ParameterNotFoundRes(parsedOutput, context); - case "ParameterVersionNotFound": - case "com.amazonaws.ssm#ParameterVersionNotFound": - throw await de_ParameterVersionNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetParameterHistoryCommand - */ -export const de_GetParameterHistoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetParameterHistoryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetParameterHistoryResult(data, context); - const response: GetParameterHistoryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetParameterHistoryCommandError - */ -const de_GetParameterHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidKeyId": - case "com.amazonaws.ssm#InvalidKeyId": - throw await de_InvalidKeyIdRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "ParameterNotFound": - case "com.amazonaws.ssm#ParameterNotFound": - throw await de_ParameterNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetParametersCommand - */ -export const de_GetParametersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetParametersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetParametersResult(data, context); - const response: GetParametersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetParametersCommandError - */ -const de_GetParametersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidKeyId": - case "com.amazonaws.ssm#InvalidKeyId": - throw await de_InvalidKeyIdRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetParametersByPathCommand - */ -export const de_GetParametersByPathCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetParametersByPathCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetParametersByPathResult(data, context); - const response: GetParametersByPathCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetParametersByPathCommandError - */ -const de_GetParametersByPathCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidFilterKey": - case "com.amazonaws.ssm#InvalidFilterKey": - throw await de_InvalidFilterKeyRes(parsedOutput, context); - case "InvalidFilterOption": - case "com.amazonaws.ssm#InvalidFilterOption": - throw await de_InvalidFilterOptionRes(parsedOutput, context); - case "InvalidFilterValue": - case "com.amazonaws.ssm#InvalidFilterValue": - throw await de_InvalidFilterValueRes(parsedOutput, context); - case "InvalidKeyId": - case "com.amazonaws.ssm#InvalidKeyId": - throw await de_InvalidKeyIdRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetPatchBaselineCommand - */ -export const de_GetPatchBaselineCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetPatchBaselineCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetPatchBaselineResult(data, context); - const response: GetPatchBaselineCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetPatchBaselineCommandError - */ -const de_GetPatchBaselineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidResourceId": - case "com.amazonaws.ssm#InvalidResourceId": - throw await de_InvalidResourceIdRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetPatchBaselineForPatchGroupCommand - */ -export const de_GetPatchBaselineForPatchGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetPatchBaselineForPatchGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetPatchBaselineForPatchGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetPatchBaselineForPatchGroupCommandError - */ -const de_GetPatchBaselineForPatchGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetResourcePoliciesCommand - */ -export const de_GetResourcePoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetResourcePoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetResourcePoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetResourcePoliciesCommandError - */ -const de_GetResourcePoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourcePolicyInvalidParameterException": - case "com.amazonaws.ssm#ResourcePolicyInvalidParameterException": - throw await de_ResourcePolicyInvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetServiceSettingCommand - */ -export const de_GetServiceSettingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetServiceSettingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetServiceSettingResult(data, context); - const response: GetServiceSettingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetServiceSettingCommandError - */ -const de_GetServiceSettingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ServiceSettingNotFound": - case "com.amazonaws.ssm#ServiceSettingNotFound": - throw await de_ServiceSettingNotFoundRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1LabelParameterVersionCommand - */ -export const de_LabelParameterVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_LabelParameterVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: LabelParameterVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1LabelParameterVersionCommandError - */ -const de_LabelParameterVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ParameterNotFound": - case "com.amazonaws.ssm#ParameterNotFound": - throw await de_ParameterNotFoundRes(parsedOutput, context); - case "ParameterVersionLabelLimitExceeded": - case "com.amazonaws.ssm#ParameterVersionLabelLimitExceeded": - throw await de_ParameterVersionLabelLimitExceededRes(parsedOutput, context); - case "ParameterVersionNotFound": - case "com.amazonaws.ssm#ParameterVersionNotFound": - throw await de_ParameterVersionNotFoundRes(parsedOutput, context); - case "TooManyUpdates": - case "com.amazonaws.ssm#TooManyUpdates": - throw await de_TooManyUpdatesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAssociationsCommand - */ -export const de_ListAssociationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAssociationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListAssociationsResult(data, context); - const response: ListAssociationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAssociationsCommandError - */ -const de_ListAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAssociationVersionsCommand - */ -export const de_ListAssociationVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAssociationVersionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListAssociationVersionsResult(data, context); - const response: ListAssociationVersionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAssociationVersionsCommandError - */ -const de_ListAssociationVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AssociationDoesNotExist": - case "com.amazonaws.ssm#AssociationDoesNotExist": - throw await de_AssociationDoesNotExistRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListCommandInvocationsCommand - */ -export const de_ListCommandInvocationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListCommandInvocationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListCommandInvocationsResult(data, context); - const response: ListCommandInvocationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListCommandInvocationsCommandError - */ -const de_ListCommandInvocationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidCommandId": - case "com.amazonaws.ssm#InvalidCommandId": - throw await de_InvalidCommandIdRes(parsedOutput, context); - case "InvalidFilterKey": - case "com.amazonaws.ssm#InvalidFilterKey": - throw await de_InvalidFilterKeyRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListCommandsCommand - */ -export const de_ListCommandsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListCommandsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListCommandsResult(data, context); - const response: ListCommandsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListCommandsCommandError - */ -const de_ListCommandsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidCommandId": - case "com.amazonaws.ssm#InvalidCommandId": - throw await de_InvalidCommandIdRes(parsedOutput, context); - case "InvalidFilterKey": - case "com.amazonaws.ssm#InvalidFilterKey": - throw await de_InvalidFilterKeyRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListComplianceItemsCommand - */ -export const de_ListComplianceItemsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListComplianceItemsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListComplianceItemsResult(data, context); - const response: ListComplianceItemsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListComplianceItemsCommandError - */ -const de_ListComplianceItemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidFilter": - case "com.amazonaws.ssm#InvalidFilter": - throw await de_InvalidFilterRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "InvalidResourceId": - case "com.amazonaws.ssm#InvalidResourceId": - throw await de_InvalidResourceIdRes(parsedOutput, context); - case "InvalidResourceType": - case "com.amazonaws.ssm#InvalidResourceType": - throw await de_InvalidResourceTypeRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListComplianceSummariesCommand - */ -export const de_ListComplianceSummariesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListComplianceSummariesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListComplianceSummariesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListComplianceSummariesCommandError - */ -const de_ListComplianceSummariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidFilter": - case "com.amazonaws.ssm#InvalidFilter": - throw await de_InvalidFilterRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDocumentMetadataHistoryCommand - */ -export const de_ListDocumentMetadataHistoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDocumentMetadataHistoryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDocumentMetadataHistoryResponse(data, context); - const response: ListDocumentMetadataHistoryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDocumentMetadataHistoryCommandError - */ -const de_ListDocumentMetadataHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidDocumentVersion": - case "com.amazonaws.ssm#InvalidDocumentVersion": - throw await de_InvalidDocumentVersionRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDocumentsCommand - */ -export const de_ListDocumentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDocumentsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDocumentsResult(data, context); - const response: ListDocumentsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDocumentsCommandError - */ -const de_ListDocumentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidFilterKey": - case "com.amazonaws.ssm#InvalidFilterKey": - throw await de_InvalidFilterKeyRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListDocumentVersionsCommand - */ -export const de_ListDocumentVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDocumentVersionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDocumentVersionsResult(data, context); - const response: ListDocumentVersionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListDocumentVersionsCommandError - */ -const de_ListDocumentVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListInventoryEntriesCommand - */ -export const de_ListInventoryEntriesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListInventoryEntriesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListInventoryEntriesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListInventoryEntriesCommandError - */ -const de_ListInventoryEntriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidFilter": - case "com.amazonaws.ssm#InvalidFilter": - throw await de_InvalidFilterRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "InvalidTypeNameException": - case "com.amazonaws.ssm#InvalidTypeNameException": - throw await de_InvalidTypeNameExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListOpsItemEventsCommand - */ -export const de_ListOpsItemEventsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListOpsItemEventsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListOpsItemEventsResponse(data, context); - const response: ListOpsItemEventsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListOpsItemEventsCommandError - */ -const de_ListOpsItemEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "OpsItemInvalidParameterException": - case "com.amazonaws.ssm#OpsItemInvalidParameterException": - throw await de_OpsItemInvalidParameterExceptionRes(parsedOutput, context); - case "OpsItemLimitExceededException": - case "com.amazonaws.ssm#OpsItemLimitExceededException": - throw await de_OpsItemLimitExceededExceptionRes(parsedOutput, context); - case "OpsItemNotFoundException": - case "com.amazonaws.ssm#OpsItemNotFoundException": - throw await de_OpsItemNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListOpsItemRelatedItemsCommand - */ -export const de_ListOpsItemRelatedItemsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListOpsItemRelatedItemsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListOpsItemRelatedItemsResponse(data, context); - const response: ListOpsItemRelatedItemsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListOpsItemRelatedItemsCommandError - */ -const de_ListOpsItemRelatedItemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "OpsItemInvalidParameterException": - case "com.amazonaws.ssm#OpsItemInvalidParameterException": - throw await de_OpsItemInvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListOpsMetadataCommand - */ -export const de_ListOpsMetadataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListOpsMetadataCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListOpsMetadataResult(data, context); - const response: ListOpsMetadataCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListOpsMetadataCommandError - */ -const de_ListOpsMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "OpsMetadataInvalidArgumentException": - case "com.amazonaws.ssm#OpsMetadataInvalidArgumentException": - throw await de_OpsMetadataInvalidArgumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListResourceComplianceSummariesCommand - */ -export const de_ListResourceComplianceSummariesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListResourceComplianceSummariesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListResourceComplianceSummariesResult(data, context); - const response: ListResourceComplianceSummariesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListResourceComplianceSummariesCommandError - */ -const de_ListResourceComplianceSummariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidFilter": - case "com.amazonaws.ssm#InvalidFilter": - throw await de_InvalidFilterRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListResourceDataSyncCommand - */ -export const de_ListResourceDataSyncCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListResourceDataSyncCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListResourceDataSyncResult(data, context); - const response: ListResourceDataSyncCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListResourceDataSyncCommandError - */ -const de_ListResourceDataSyncCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidNextToken": - case "com.amazonaws.ssm#InvalidNextToken": - throw await de_InvalidNextTokenRes(parsedOutput, context); - case "ResourceDataSyncInvalidConfigurationException": - case "com.amazonaws.ssm#ResourceDataSyncInvalidConfigurationException": - throw await de_ResourceDataSyncInvalidConfigurationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidResourceId": - case "com.amazonaws.ssm#InvalidResourceId": - throw await de_InvalidResourceIdRes(parsedOutput, context); - case "InvalidResourceType": - case "com.amazonaws.ssm#InvalidResourceType": - throw await de_InvalidResourceTypeRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ModifyDocumentPermissionCommand - */ -export const de_ModifyDocumentPermissionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ModifyDocumentPermissionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ModifyDocumentPermissionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ModifyDocumentPermissionCommandError - */ -const de_ModifyDocumentPermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DocumentLimitExceeded": - case "com.amazonaws.ssm#DocumentLimitExceeded": - throw await de_DocumentLimitExceededRes(parsedOutput, context); - case "DocumentPermissionLimit": - case "com.amazonaws.ssm#DocumentPermissionLimit": - throw await de_DocumentPermissionLimitRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidPermissionType": - case "com.amazonaws.ssm#InvalidPermissionType": - throw await de_InvalidPermissionTypeRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutComplianceItemsCommand - */ -export const de_PutComplianceItemsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutComplianceItemsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutComplianceItemsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutComplianceItemsCommandError - */ -const de_PutComplianceItemsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ComplianceTypeCountLimitExceededException": - case "com.amazonaws.ssm#ComplianceTypeCountLimitExceededException": - throw await de_ComplianceTypeCountLimitExceededExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidItemContentException": - case "com.amazonaws.ssm#InvalidItemContentException": - throw await de_InvalidItemContentExceptionRes(parsedOutput, context); - case "InvalidResourceId": - case "com.amazonaws.ssm#InvalidResourceId": - throw await de_InvalidResourceIdRes(parsedOutput, context); - case "InvalidResourceType": - case "com.amazonaws.ssm#InvalidResourceType": - throw await de_InvalidResourceTypeRes(parsedOutput, context); - case "ItemSizeLimitExceededException": - case "com.amazonaws.ssm#ItemSizeLimitExceededException": - throw await de_ItemSizeLimitExceededExceptionRes(parsedOutput, context); - case "TotalSizeLimitExceededException": - case "com.amazonaws.ssm#TotalSizeLimitExceededException": - throw await de_TotalSizeLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutInventoryCommand - */ -export const de_PutInventoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutInventoryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutInventoryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutInventoryCommandError - */ -const de_PutInventoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomSchemaCountLimitExceededException": - case "com.amazonaws.ssm#CustomSchemaCountLimitExceededException": - throw await de_CustomSchemaCountLimitExceededExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - case "InvalidInventoryItemContextException": - case "com.amazonaws.ssm#InvalidInventoryItemContextException": - throw await de_InvalidInventoryItemContextExceptionRes(parsedOutput, context); - case "InvalidItemContentException": - case "com.amazonaws.ssm#InvalidItemContentException": - throw await de_InvalidItemContentExceptionRes(parsedOutput, context); - case "InvalidTypeNameException": - case "com.amazonaws.ssm#InvalidTypeNameException": - throw await de_InvalidTypeNameExceptionRes(parsedOutput, context); - case "ItemContentMismatchException": - case "com.amazonaws.ssm#ItemContentMismatchException": - throw await de_ItemContentMismatchExceptionRes(parsedOutput, context); - case "ItemSizeLimitExceededException": - case "com.amazonaws.ssm#ItemSizeLimitExceededException": - throw await de_ItemSizeLimitExceededExceptionRes(parsedOutput, context); - case "SubTypeCountLimitExceededException": - case "com.amazonaws.ssm#SubTypeCountLimitExceededException": - throw await de_SubTypeCountLimitExceededExceptionRes(parsedOutput, context); - case "TotalSizeLimitExceededException": - case "com.amazonaws.ssm#TotalSizeLimitExceededException": - throw await de_TotalSizeLimitExceededExceptionRes(parsedOutput, context); - case "UnsupportedInventoryItemContextException": - case "com.amazonaws.ssm#UnsupportedInventoryItemContextException": - throw await de_UnsupportedInventoryItemContextExceptionRes(parsedOutput, context); - case "UnsupportedInventorySchemaVersionException": - case "com.amazonaws.ssm#UnsupportedInventorySchemaVersionException": - throw await de_UnsupportedInventorySchemaVersionExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutParameterCommand - */ -export const de_PutParameterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutParameterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutParameterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutParameterCommandError - */ -const de_PutParameterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "HierarchyLevelLimitExceededException": - case "com.amazonaws.ssm#HierarchyLevelLimitExceededException": - throw await de_HierarchyLevelLimitExceededExceptionRes(parsedOutput, context); - case "HierarchyTypeMismatchException": - case "com.amazonaws.ssm#HierarchyTypeMismatchException": - throw await de_HierarchyTypeMismatchExceptionRes(parsedOutput, context); - case "IncompatiblePolicyException": - case "com.amazonaws.ssm#IncompatiblePolicyException": - throw await de_IncompatiblePolicyExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidAllowedPatternException": - case "com.amazonaws.ssm#InvalidAllowedPatternException": - throw await de_InvalidAllowedPatternExceptionRes(parsedOutput, context); - case "InvalidKeyId": - case "com.amazonaws.ssm#InvalidKeyId": - throw await de_InvalidKeyIdRes(parsedOutput, context); - case "InvalidPolicyAttributeException": - case "com.amazonaws.ssm#InvalidPolicyAttributeException": - throw await de_InvalidPolicyAttributeExceptionRes(parsedOutput, context); - case "InvalidPolicyTypeException": - case "com.amazonaws.ssm#InvalidPolicyTypeException": - throw await de_InvalidPolicyTypeExceptionRes(parsedOutput, context); - case "ParameterAlreadyExists": - case "com.amazonaws.ssm#ParameterAlreadyExists": - throw await de_ParameterAlreadyExistsRes(parsedOutput, context); - case "ParameterLimitExceeded": - case "com.amazonaws.ssm#ParameterLimitExceeded": - throw await de_ParameterLimitExceededRes(parsedOutput, context); - case "ParameterMaxVersionLimitExceeded": - case "com.amazonaws.ssm#ParameterMaxVersionLimitExceeded": - throw await de_ParameterMaxVersionLimitExceededRes(parsedOutput, context); - case "ParameterPatternMismatchException": - case "com.amazonaws.ssm#ParameterPatternMismatchException": - throw await de_ParameterPatternMismatchExceptionRes(parsedOutput, context); - case "PoliciesLimitExceededException": - case "com.amazonaws.ssm#PoliciesLimitExceededException": - throw await de_PoliciesLimitExceededExceptionRes(parsedOutput, context); - case "TooManyUpdates": - case "com.amazonaws.ssm#TooManyUpdates": - throw await de_TooManyUpdatesRes(parsedOutput, context); - case "UnsupportedParameterType": - case "com.amazonaws.ssm#UnsupportedParameterType": - throw await de_UnsupportedParameterTypeRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutResourcePolicyCommand - */ -export const de_PutResourcePolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutResourcePolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourcePolicyConflictException": - case "com.amazonaws.ssm#ResourcePolicyConflictException": - throw await de_ResourcePolicyConflictExceptionRes(parsedOutput, context); - case "ResourcePolicyInvalidParameterException": - case "com.amazonaws.ssm#ResourcePolicyInvalidParameterException": - throw await de_ResourcePolicyInvalidParameterExceptionRes(parsedOutput, context); - case "ResourcePolicyLimitExceededException": - case "com.amazonaws.ssm#ResourcePolicyLimitExceededException": - throw await de_ResourcePolicyLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RegisterDefaultPatchBaselineCommand - */ -export const de_RegisterDefaultPatchBaselineCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RegisterDefaultPatchBaselineCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: RegisterDefaultPatchBaselineCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RegisterDefaultPatchBaselineCommandError - */ -const de_RegisterDefaultPatchBaselineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidResourceId": - case "com.amazonaws.ssm#InvalidResourceId": - throw await de_InvalidResourceIdRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RegisterPatchBaselineForPatchGroupCommand - */ -export const de_RegisterPatchBaselineForPatchGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RegisterPatchBaselineForPatchGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: RegisterPatchBaselineForPatchGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RegisterPatchBaselineForPatchGroupCommandError - */ -const de_RegisterPatchBaselineForPatchGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AlreadyExistsException": - case "com.amazonaws.ssm#AlreadyExistsException": - throw await de_AlreadyExistsExceptionRes(parsedOutput, context); - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidResourceId": - case "com.amazonaws.ssm#InvalidResourceId": - throw await de_InvalidResourceIdRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.ssm#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RegisterTargetWithMaintenanceWindowCommand - */ -export const de_RegisterTargetWithMaintenanceWindowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RegisterTargetWithMaintenanceWindowCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: RegisterTargetWithMaintenanceWindowCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RegisterTargetWithMaintenanceWindowCommandError - */ -const de_RegisterTargetWithMaintenanceWindowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatch": - case "com.amazonaws.ssm#IdempotentParameterMismatch": - throw await de_IdempotentParameterMismatchRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.ssm#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RegisterTaskWithMaintenanceWindowCommand - */ -export const de_RegisterTaskWithMaintenanceWindowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RegisterTaskWithMaintenanceWindowCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: RegisterTaskWithMaintenanceWindowCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RegisterTaskWithMaintenanceWindowCommandError - */ -const de_RegisterTaskWithMaintenanceWindowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "FeatureNotAvailableException": - case "com.amazonaws.ssm#FeatureNotAvailableException": - throw await de_FeatureNotAvailableExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatch": - case "com.amazonaws.ssm#IdempotentParameterMismatch": - throw await de_IdempotentParameterMismatchRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.ssm#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RemoveTagsFromResourceCommand - */ -export const de_RemoveTagsFromResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RemoveTagsFromResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: RemoveTagsFromResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RemoveTagsFromResourceCommandError - */ -const de_RemoveTagsFromResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidResourceId": - case "com.amazonaws.ssm#InvalidResourceId": - throw await de_InvalidResourceIdRes(parsedOutput, context); - case "InvalidResourceType": - case "com.amazonaws.ssm#InvalidResourceType": - throw await de_InvalidResourceTypeRes(parsedOutput, context); - case "TooManyUpdates": - case "com.amazonaws.ssm#TooManyUpdates": - throw await de_TooManyUpdatesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ResetServiceSettingCommand - */ -export const de_ResetServiceSettingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ResetServiceSettingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ResetServiceSettingResult(data, context); - const response: ResetServiceSettingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ResetServiceSettingCommandError - */ -const de_ResetServiceSettingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ServiceSettingNotFound": - case "com.amazonaws.ssm#ServiceSettingNotFound": - throw await de_ServiceSettingNotFoundRes(parsedOutput, context); - case "TooManyUpdates": - case "com.amazonaws.ssm#TooManyUpdates": - throw await de_TooManyUpdatesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ResumeSessionCommand - */ -export const de_ResumeSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ResumeSessionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ResumeSessionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ResumeSessionCommandError - */ -const de_ResumeSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1SendAutomationSignalCommand - */ -export const de_SendAutomationSignalCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SendAutomationSignalCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: SendAutomationSignalCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1SendAutomationSignalCommandError - */ -const de_SendAutomationSignalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AutomationExecutionNotFoundException": - case "com.amazonaws.ssm#AutomationExecutionNotFoundException": - throw await de_AutomationExecutionNotFoundExceptionRes(parsedOutput, context); - case "AutomationStepNotFoundException": - case "com.amazonaws.ssm#AutomationStepNotFoundException": - throw await de_AutomationStepNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidAutomationSignalException": - case "com.amazonaws.ssm#InvalidAutomationSignalException": - throw await de_InvalidAutomationSignalExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1SendCommandCommand - */ -export const de_SendCommandCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_SendCommandCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_SendCommandResult(data, context); - const response: SendCommandCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1SendCommandCommandError - */ -const de_SendCommandCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DuplicateInstanceId": - case "com.amazonaws.ssm#DuplicateInstanceId": - throw await de_DuplicateInstanceIdRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidDocumentVersion": - case "com.amazonaws.ssm#InvalidDocumentVersion": - throw await de_InvalidDocumentVersionRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - case "InvalidNotificationConfig": - case "com.amazonaws.ssm#InvalidNotificationConfig": - throw await de_InvalidNotificationConfigRes(parsedOutput, context); - case "InvalidOutputFolder": - case "com.amazonaws.ssm#InvalidOutputFolder": - throw await de_InvalidOutputFolderRes(parsedOutput, context); - case "InvalidParameters": - case "com.amazonaws.ssm#InvalidParameters": - throw await de_InvalidParametersRes(parsedOutput, context); - case "InvalidRole": - case "com.amazonaws.ssm#InvalidRole": - throw await de_InvalidRoleRes(parsedOutput, context); - case "MaxDocumentSizeExceeded": - case "com.amazonaws.ssm#MaxDocumentSizeExceeded": - throw await de_MaxDocumentSizeExceededRes(parsedOutput, context); - case "UnsupportedPlatformType": - case "com.amazonaws.ssm#UnsupportedPlatformType": - throw await de_UnsupportedPlatformTypeRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartAssociationsOnceCommand - */ -export const de_StartAssociationsOnceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartAssociationsOnceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartAssociationsOnceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartAssociationsOnceCommandError - */ -const de_StartAssociationsOnceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AssociationDoesNotExist": - case "com.amazonaws.ssm#AssociationDoesNotExist": - throw await de_AssociationDoesNotExistRes(parsedOutput, context); - case "InvalidAssociation": - case "com.amazonaws.ssm#InvalidAssociation": - throw await de_InvalidAssociationRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartAutomationExecutionCommand - */ -export const de_StartAutomationExecutionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartAutomationExecutionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartAutomationExecutionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartAutomationExecutionCommandError - */ -const de_StartAutomationExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AutomationDefinitionNotFoundException": - case "com.amazonaws.ssm#AutomationDefinitionNotFoundException": - throw await de_AutomationDefinitionNotFoundExceptionRes(parsedOutput, context); - case "AutomationDefinitionVersionNotFoundException": - case "com.amazonaws.ssm#AutomationDefinitionVersionNotFoundException": - throw await de_AutomationDefinitionVersionNotFoundExceptionRes(parsedOutput, context); - case "AutomationExecutionLimitExceededException": - case "com.amazonaws.ssm#AutomationExecutionLimitExceededException": - throw await de_AutomationExecutionLimitExceededExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatch": - case "com.amazonaws.ssm#IdempotentParameterMismatch": - throw await de_IdempotentParameterMismatchRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidAutomationExecutionParametersException": - case "com.amazonaws.ssm#InvalidAutomationExecutionParametersException": - throw await de_InvalidAutomationExecutionParametersExceptionRes(parsedOutput, context); - case "InvalidTarget": - case "com.amazonaws.ssm#InvalidTarget": - throw await de_InvalidTargetRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartChangeRequestExecutionCommand - */ -export const de_StartChangeRequestExecutionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartChangeRequestExecutionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartChangeRequestExecutionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartChangeRequestExecutionCommandError - */ -const de_StartChangeRequestExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AutomationDefinitionNotApprovedException": - case "com.amazonaws.ssm#AutomationDefinitionNotApprovedException": - throw await de_AutomationDefinitionNotApprovedExceptionRes(parsedOutput, context); - case "AutomationDefinitionNotFoundException": - case "com.amazonaws.ssm#AutomationDefinitionNotFoundException": - throw await de_AutomationDefinitionNotFoundExceptionRes(parsedOutput, context); - case "AutomationDefinitionVersionNotFoundException": - case "com.amazonaws.ssm#AutomationDefinitionVersionNotFoundException": - throw await de_AutomationDefinitionVersionNotFoundExceptionRes(parsedOutput, context); - case "AutomationExecutionLimitExceededException": - case "com.amazonaws.ssm#AutomationExecutionLimitExceededException": - throw await de_AutomationExecutionLimitExceededExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatch": - case "com.amazonaws.ssm#IdempotentParameterMismatch": - throw await de_IdempotentParameterMismatchRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidAutomationExecutionParametersException": - case "com.amazonaws.ssm#InvalidAutomationExecutionParametersException": - throw await de_InvalidAutomationExecutionParametersExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartSessionCommand - */ -export const de_StartSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartSessionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartSessionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartSessionCommandError - */ -const de_StartSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "TargetNotConnected": - case "com.amazonaws.ssm#TargetNotConnected": - throw await de_TargetNotConnectedRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StopAutomationExecutionCommand - */ -export const de_StopAutomationExecutionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StopAutomationExecutionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StopAutomationExecutionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StopAutomationExecutionCommandError - */ -const de_StopAutomationExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AutomationExecutionNotFoundException": - case "com.amazonaws.ssm#AutomationExecutionNotFoundException": - throw await de_AutomationExecutionNotFoundExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidAutomationStatusUpdateException": - case "com.amazonaws.ssm#InvalidAutomationStatusUpdateException": - throw await de_InvalidAutomationStatusUpdateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1TerminateSessionCommand - */ -export const de_TerminateSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TerminateSessionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: TerminateSessionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1TerminateSessionCommandError - */ -const de_TerminateSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UnlabelParameterVersionCommand - */ -export const de_UnlabelParameterVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UnlabelParameterVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UnlabelParameterVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UnlabelParameterVersionCommandError - */ -const de_UnlabelParameterVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ParameterNotFound": - case "com.amazonaws.ssm#ParameterNotFound": - throw await de_ParameterNotFoundRes(parsedOutput, context); - case "ParameterVersionNotFound": - case "com.amazonaws.ssm#ParameterVersionNotFound": - throw await de_ParameterVersionNotFoundRes(parsedOutput, context); - case "TooManyUpdates": - case "com.amazonaws.ssm#TooManyUpdates": - throw await de_TooManyUpdatesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateAssociationCommand - */ -export const de_UpdateAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateAssociationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateAssociationResult(data, context); - const response: UpdateAssociationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateAssociationCommandError - */ -const de_UpdateAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AssociationDoesNotExist": - case "com.amazonaws.ssm#AssociationDoesNotExist": - throw await de_AssociationDoesNotExistRes(parsedOutput, context); - case "AssociationVersionLimitExceeded": - case "com.amazonaws.ssm#AssociationVersionLimitExceeded": - throw await de_AssociationVersionLimitExceededRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidAssociationVersion": - case "com.amazonaws.ssm#InvalidAssociationVersion": - throw await de_InvalidAssociationVersionRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidDocumentVersion": - case "com.amazonaws.ssm#InvalidDocumentVersion": - throw await de_InvalidDocumentVersionRes(parsedOutput, context); - case "InvalidOutputLocation": - case "com.amazonaws.ssm#InvalidOutputLocation": - throw await de_InvalidOutputLocationRes(parsedOutput, context); - case "InvalidParameters": - case "com.amazonaws.ssm#InvalidParameters": - throw await de_InvalidParametersRes(parsedOutput, context); - case "InvalidSchedule": - case "com.amazonaws.ssm#InvalidSchedule": - throw await de_InvalidScheduleRes(parsedOutput, context); - case "InvalidTarget": - case "com.amazonaws.ssm#InvalidTarget": - throw await de_InvalidTargetRes(parsedOutput, context); - case "InvalidTargetMaps": - case "com.amazonaws.ssm#InvalidTargetMaps": - throw await de_InvalidTargetMapsRes(parsedOutput, context); - case "InvalidUpdate": - case "com.amazonaws.ssm#InvalidUpdate": - throw await de_InvalidUpdateRes(parsedOutput, context); - case "TooManyUpdates": - case "com.amazonaws.ssm#TooManyUpdates": - throw await de_TooManyUpdatesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateAssociationStatusCommand - */ -export const de_UpdateAssociationStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateAssociationStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateAssociationStatusResult(data, context); - const response: UpdateAssociationStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateAssociationStatusCommandError - */ -const de_UpdateAssociationStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AssociationDoesNotExist": - case "com.amazonaws.ssm#AssociationDoesNotExist": - throw await de_AssociationDoesNotExistRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - case "StatusUnchanged": - case "com.amazonaws.ssm#StatusUnchanged": - throw await de_StatusUnchangedRes(parsedOutput, context); + case "InvalidResourceId": + case "com.amazonaws.ssm#InvalidResourceId": + throw await de_InvalidResourceIdRes(parsedOutput, context); + case "InvalidResourceType": + case "com.amazonaws.ssm#InvalidResourceType": + throw await de_InvalidResourceTypeRes(parsedOutput, context); + case "TooManyTagsError": + case "com.amazonaws.ssm#TooManyTagsError": + throw await de_TooManyTagsErrorRes(parsedOutput, context); case "TooManyUpdates": case "com.amazonaws.ssm#TooManyUpdates": throw await de_TooManyUpdatesRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateDocumentCommand - */ -export const de_UpdateDocumentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateDocumentCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateDocumentResult(data, context); - const response: UpdateDocumentCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateDocumentCommandError - */ -const de_UpdateDocumentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DocumentVersionLimitExceeded": - case "com.amazonaws.ssm#DocumentVersionLimitExceeded": - throw await de_DocumentVersionLimitExceededRes(parsedOutput, context); - case "DuplicateDocumentContent": - case "com.amazonaws.ssm#DuplicateDocumentContent": - throw await de_DuplicateDocumentContentRes(parsedOutput, context); - case "DuplicateDocumentVersionName": - case "com.amazonaws.ssm#DuplicateDocumentVersionName": - throw await de_DuplicateDocumentVersionNameRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidDocumentContent": - case "com.amazonaws.ssm#InvalidDocumentContent": - throw await de_InvalidDocumentContentRes(parsedOutput, context); - case "InvalidDocumentOperation": - case "com.amazonaws.ssm#InvalidDocumentOperation": - throw await de_InvalidDocumentOperationRes(parsedOutput, context); - case "InvalidDocumentSchemaVersion": - case "com.amazonaws.ssm#InvalidDocumentSchemaVersion": - throw await de_InvalidDocumentSchemaVersionRes(parsedOutput, context); - case "InvalidDocumentVersion": - case "com.amazonaws.ssm#InvalidDocumentVersion": - throw await de_InvalidDocumentVersionRes(parsedOutput, context); - case "MaxDocumentSizeExceeded": - case "com.amazonaws.ssm#MaxDocumentSizeExceeded": - throw await de_MaxDocumentSizeExceededRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateDocumentDefaultVersionCommand - */ -export const de_UpdateDocumentDefaultVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateDocumentDefaultVersionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateDocumentDefaultVersionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateDocumentDefaultVersionCommandError - */ -const de_UpdateDocumentDefaultVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidDocument": - case "com.amazonaws.ssm#InvalidDocument": - throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidDocumentSchemaVersion": - case "com.amazonaws.ssm#InvalidDocumentSchemaVersion": - throw await de_InvalidDocumentSchemaVersionRes(parsedOutput, context); - case "InvalidDocumentVersion": - case "com.amazonaws.ssm#InvalidDocumentVersion": - throw await de_InvalidDocumentVersionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateDocumentMetadataCommand - */ -export const de_UpdateDocumentMetadataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateDocumentMetadataCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateDocumentMetadataCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateDocumentMetadataCommandError - */ -const de_UpdateDocumentMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); + case "OpsItemConflictException": + case "com.amazonaws.ssm#OpsItemConflictException": + throw await de_OpsItemConflictExceptionRes(parsedOutput, context); + case "OpsItemInvalidParameterException": + case "com.amazonaws.ssm#OpsItemInvalidParameterException": + throw await de_OpsItemInvalidParameterExceptionRes(parsedOutput, context); + case "OpsItemLimitExceededException": + case "com.amazonaws.ssm#OpsItemLimitExceededException": + throw await de_OpsItemLimitExceededExceptionRes(parsedOutput, context); + case "OpsItemNotFoundException": + case "com.amazonaws.ssm#OpsItemNotFoundException": + throw await de_OpsItemNotFoundExceptionRes(parsedOutput, context); + case "OpsItemRelatedItemAlreadyExistsException": + case "com.amazonaws.ssm#OpsItemRelatedItemAlreadyExistsException": + throw await de_OpsItemRelatedItemAlreadyExistsExceptionRes(parsedOutput, context); + case "DuplicateInstanceId": + case "com.amazonaws.ssm#DuplicateInstanceId": + throw await de_DuplicateInstanceIdRes(parsedOutput, context); + case "InvalidCommandId": + case "com.amazonaws.ssm#InvalidCommandId": + throw await de_InvalidCommandIdRes(parsedOutput, context); + case "InvalidInstanceId": + case "com.amazonaws.ssm#InvalidInstanceId": + throw await de_InvalidInstanceIdRes(parsedOutput, context); + case "DoesNotExistException": + case "com.amazonaws.ssm#DoesNotExistException": + throw await de_DoesNotExistExceptionRes(parsedOutput, context); + case "InvalidParameters": + case "com.amazonaws.ssm#InvalidParameters": + throw await de_InvalidParametersRes(parsedOutput, context); + case "AssociationAlreadyExists": + case "com.amazonaws.ssm#AssociationAlreadyExists": + throw await de_AssociationAlreadyExistsRes(parsedOutput, context); + case "AssociationLimitExceeded": + case "com.amazonaws.ssm#AssociationLimitExceeded": + throw await de_AssociationLimitExceededRes(parsedOutput, context); case "InvalidDocument": case "com.amazonaws.ssm#InvalidDocument": throw await de_InvalidDocumentRes(parsedOutput, context); - case "InvalidDocumentOperation": - case "com.amazonaws.ssm#InvalidDocumentOperation": - throw await de_InvalidDocumentOperationRes(parsedOutput, context); case "InvalidDocumentVersion": case "com.amazonaws.ssm#InvalidDocumentVersion": throw await de_InvalidDocumentVersionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateMaintenanceWindowCommand - */ -export const de_UpdateMaintenanceWindowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateMaintenanceWindowCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateMaintenanceWindowCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateMaintenanceWindowCommandError - */ -const de_UpdateMaintenanceWindowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateMaintenanceWindowTargetCommand - */ -export const de_UpdateMaintenanceWindowTargetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateMaintenanceWindowTargetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateMaintenanceWindowTargetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateMaintenanceWindowTargetCommandError - */ -const de_UpdateMaintenanceWindowTargetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateMaintenanceWindowTaskCommand - */ -export const de_UpdateMaintenanceWindowTaskCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateMaintenanceWindowTaskCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdateMaintenanceWindowTaskResult(data, context); - const response: UpdateMaintenanceWindowTaskCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateMaintenanceWindowTaskCommandError - */ -const de_UpdateMaintenanceWindowTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateManagedInstanceRoleCommand - */ -export const de_UpdateManagedInstanceRoleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateManagedInstanceRoleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateManagedInstanceRoleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateManagedInstanceRoleCommandError - */ -const de_UpdateManagedInstanceRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidInstanceId": - case "com.amazonaws.ssm#InvalidInstanceId": - throw await de_InvalidInstanceIdRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateOpsItemCommand - */ -export const de_UpdateOpsItemCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateOpsItemCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateOpsItemCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateOpsItemCommandError - */ -const de_UpdateOpsItemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); + case "InvalidOutputLocation": + case "com.amazonaws.ssm#InvalidOutputLocation": + throw await de_InvalidOutputLocationRes(parsedOutput, context); + case "InvalidSchedule": + case "com.amazonaws.ssm#InvalidSchedule": + throw await de_InvalidScheduleRes(parsedOutput, context); + case "InvalidTag": + case "com.amazonaws.ssm#InvalidTag": + throw await de_InvalidTagRes(parsedOutput, context); + case "InvalidTarget": + case "com.amazonaws.ssm#InvalidTarget": + throw await de_InvalidTargetRes(parsedOutput, context); + case "InvalidTargetMaps": + case "com.amazonaws.ssm#InvalidTargetMaps": + throw await de_InvalidTargetMapsRes(parsedOutput, context); + case "UnsupportedPlatformType": + case "com.amazonaws.ssm#UnsupportedPlatformType": + throw await de_UnsupportedPlatformTypeRes(parsedOutput, context); + case "DocumentAlreadyExists": + case "com.amazonaws.ssm#DocumentAlreadyExists": + throw await de_DocumentAlreadyExistsRes(parsedOutput, context); + case "DocumentLimitExceeded": + case "com.amazonaws.ssm#DocumentLimitExceeded": + throw await de_DocumentLimitExceededRes(parsedOutput, context); + case "InvalidDocumentContent": + case "com.amazonaws.ssm#InvalidDocumentContent": + throw await de_InvalidDocumentContentRes(parsedOutput, context); + case "InvalidDocumentSchemaVersion": + case "com.amazonaws.ssm#InvalidDocumentSchemaVersion": + throw await de_InvalidDocumentSchemaVersionRes(parsedOutput, context); + case "MaxDocumentSizeExceeded": + case "com.amazonaws.ssm#MaxDocumentSizeExceeded": + throw await de_MaxDocumentSizeExceededRes(parsedOutput, context); + case "IdempotentParameterMismatch": + case "com.amazonaws.ssm#IdempotentParameterMismatch": + throw await de_IdempotentParameterMismatchRes(parsedOutput, context); + case "ResourceLimitExceededException": + case "com.amazonaws.ssm#ResourceLimitExceededException": + throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); case "OpsItemAccessDeniedException": case "com.amazonaws.ssm#OpsItemAccessDeniedException": throw await de_OpsItemAccessDeniedExceptionRes(parsedOutput, context); case "OpsItemAlreadyExistsException": case "com.amazonaws.ssm#OpsItemAlreadyExistsException": throw await de_OpsItemAlreadyExistsExceptionRes(parsedOutput, context); - case "OpsItemConflictException": - case "com.amazonaws.ssm#OpsItemConflictException": - throw await de_OpsItemConflictExceptionRes(parsedOutput, context); - case "OpsItemInvalidParameterException": - case "com.amazonaws.ssm#OpsItemInvalidParameterException": - throw await de_OpsItemInvalidParameterExceptionRes(parsedOutput, context); - case "OpsItemLimitExceededException": - case "com.amazonaws.ssm#OpsItemLimitExceededException": - throw await de_OpsItemLimitExceededExceptionRes(parsedOutput, context); - case "OpsItemNotFoundException": - case "com.amazonaws.ssm#OpsItemNotFoundException": - throw await de_OpsItemNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateOpsMetadataCommand - */ -export const de_UpdateOpsMetadataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateOpsMetadataCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateOpsMetadataCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateOpsMetadataCommandError - */ -const de_UpdateOpsMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); + case "OpsMetadataAlreadyExistsException": + case "com.amazonaws.ssm#OpsMetadataAlreadyExistsException": + throw await de_OpsMetadataAlreadyExistsExceptionRes(parsedOutput, context); case "OpsMetadataInvalidArgumentException": case "com.amazonaws.ssm#OpsMetadataInvalidArgumentException": throw await de_OpsMetadataInvalidArgumentExceptionRes(parsedOutput, context); + case "OpsMetadataLimitExceededException": + case "com.amazonaws.ssm#OpsMetadataLimitExceededException": + throw await de_OpsMetadataLimitExceededExceptionRes(parsedOutput, context); + case "OpsMetadataTooManyUpdatesException": + case "com.amazonaws.ssm#OpsMetadataTooManyUpdatesException": + throw await de_OpsMetadataTooManyUpdatesExceptionRes(parsedOutput, context); + case "ResourceDataSyncAlreadyExistsException": + case "com.amazonaws.ssm#ResourceDataSyncAlreadyExistsException": + throw await de_ResourceDataSyncAlreadyExistsExceptionRes(parsedOutput, context); + case "ResourceDataSyncCountExceededException": + case "com.amazonaws.ssm#ResourceDataSyncCountExceededException": + throw await de_ResourceDataSyncCountExceededExceptionRes(parsedOutput, context); + case "ResourceDataSyncInvalidConfigurationException": + case "com.amazonaws.ssm#ResourceDataSyncInvalidConfigurationException": + throw await de_ResourceDataSyncInvalidConfigurationExceptionRes(parsedOutput, context); + case "InvalidActivation": + case "com.amazonaws.ssm#InvalidActivation": + throw await de_InvalidActivationRes(parsedOutput, context); + case "InvalidActivationId": + case "com.amazonaws.ssm#InvalidActivationId": + throw await de_InvalidActivationIdRes(parsedOutput, context); + case "AssociationDoesNotExist": + case "com.amazonaws.ssm#AssociationDoesNotExist": + throw await de_AssociationDoesNotExistRes(parsedOutput, context); + case "AssociatedInstances": + case "com.amazonaws.ssm#AssociatedInstances": + throw await de_AssociatedInstancesRes(parsedOutput, context); + case "InvalidDocumentOperation": + case "com.amazonaws.ssm#InvalidDocumentOperation": + throw await de_InvalidDocumentOperationRes(parsedOutput, context); + case "InvalidDeleteInventoryParametersException": + case "com.amazonaws.ssm#InvalidDeleteInventoryParametersException": + throw await de_InvalidDeleteInventoryParametersExceptionRes(parsedOutput, context); + case "InvalidInventoryRequestException": + case "com.amazonaws.ssm#InvalidInventoryRequestException": + throw await de_InvalidInventoryRequestExceptionRes(parsedOutput, context); + case "InvalidOptionException": + case "com.amazonaws.ssm#InvalidOptionException": + throw await de_InvalidOptionExceptionRes(parsedOutput, context); + case "InvalidTypeNameException": + case "com.amazonaws.ssm#InvalidTypeNameException": + throw await de_InvalidTypeNameExceptionRes(parsedOutput, context); + case "OpsMetadataNotFoundException": + case "com.amazonaws.ssm#OpsMetadataNotFoundException": + throw await de_OpsMetadataNotFoundExceptionRes(parsedOutput, context); + case "ParameterNotFound": + case "com.amazonaws.ssm#ParameterNotFound": + throw await de_ParameterNotFoundRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.ssm#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); + case "ResourceDataSyncNotFoundException": + case "com.amazonaws.ssm#ResourceDataSyncNotFoundException": + throw await de_ResourceDataSyncNotFoundExceptionRes(parsedOutput, context); + case "ResourcePolicyConflictException": + case "com.amazonaws.ssm#ResourcePolicyConflictException": + throw await de_ResourcePolicyConflictExceptionRes(parsedOutput, context); + case "ResourcePolicyInvalidParameterException": + case "com.amazonaws.ssm#ResourcePolicyInvalidParameterException": + throw await de_ResourcePolicyInvalidParameterExceptionRes(parsedOutput, context); + case "TargetInUseException": + case "com.amazonaws.ssm#TargetInUseException": + throw await de_TargetInUseExceptionRes(parsedOutput, context); + case "InvalidFilter": + case "com.amazonaws.ssm#InvalidFilter": + throw await de_InvalidFilterRes(parsedOutput, context); + case "InvalidNextToken": + case "com.amazonaws.ssm#InvalidNextToken": + throw await de_InvalidNextTokenRes(parsedOutput, context); + case "InvalidAssociationVersion": + case "com.amazonaws.ssm#InvalidAssociationVersion": + throw await de_InvalidAssociationVersionRes(parsedOutput, context); + case "AssociationExecutionDoesNotExist": + case "com.amazonaws.ssm#AssociationExecutionDoesNotExist": + throw await de_AssociationExecutionDoesNotExistRes(parsedOutput, context); + case "InvalidFilterKey": + case "com.amazonaws.ssm#InvalidFilterKey": + throw await de_InvalidFilterKeyRes(parsedOutput, context); + case "InvalidFilterValue": + case "com.amazonaws.ssm#InvalidFilterValue": + throw await de_InvalidFilterValueRes(parsedOutput, context); + case "AutomationExecutionNotFoundException": + case "com.amazonaws.ssm#AutomationExecutionNotFoundException": + throw await de_AutomationExecutionNotFoundExceptionRes(parsedOutput, context); + case "InvalidPermissionType": + case "com.amazonaws.ssm#InvalidPermissionType": + throw await de_InvalidPermissionTypeRes(parsedOutput, context); + case "UnsupportedOperatingSystem": + case "com.amazonaws.ssm#UnsupportedOperatingSystem": + throw await de_UnsupportedOperatingSystemRes(parsedOutput, context); + case "InvalidInstanceInformationFilterValue": + case "com.amazonaws.ssm#InvalidInstanceInformationFilterValue": + throw await de_InvalidInstanceInformationFilterValueRes(parsedOutput, context); + case "InvalidDeletionIdException": + case "com.amazonaws.ssm#InvalidDeletionIdException": + throw await de_InvalidDeletionIdExceptionRes(parsedOutput, context); + case "InvalidFilterOption": + case "com.amazonaws.ssm#InvalidFilterOption": + throw await de_InvalidFilterOptionRes(parsedOutput, context); + case "OpsItemRelatedItemAssociationNotFoundException": + case "com.amazonaws.ssm#OpsItemRelatedItemAssociationNotFoundException": + throw await de_OpsItemRelatedItemAssociationNotFoundExceptionRes(parsedOutput, context); + case "InvalidDocumentType": + case "com.amazonaws.ssm#InvalidDocumentType": + throw await de_InvalidDocumentTypeRes(parsedOutput, context); + case "UnsupportedCalendarException": + case "com.amazonaws.ssm#UnsupportedCalendarException": + throw await de_UnsupportedCalendarExceptionRes(parsedOutput, context); + case "InvalidPluginName": + case "com.amazonaws.ssm#InvalidPluginName": + throw await de_InvalidPluginNameRes(parsedOutput, context); + case "InvocationDoesNotExist": + case "com.amazonaws.ssm#InvocationDoesNotExist": + throw await de_InvocationDoesNotExistRes(parsedOutput, context); + case "UnsupportedFeatureRequiredException": + case "com.amazonaws.ssm#UnsupportedFeatureRequiredException": + throw await de_UnsupportedFeatureRequiredExceptionRes(parsedOutput, context); + case "InvalidAggregatorException": + case "com.amazonaws.ssm#InvalidAggregatorException": + throw await de_InvalidAggregatorExceptionRes(parsedOutput, context); + case "InvalidInventoryGroupException": + case "com.amazonaws.ssm#InvalidInventoryGroupException": + throw await de_InvalidInventoryGroupExceptionRes(parsedOutput, context); + case "InvalidResultAttributeException": + case "com.amazonaws.ssm#InvalidResultAttributeException": + throw await de_InvalidResultAttributeExceptionRes(parsedOutput, context); + case "InvalidKeyId": + case "com.amazonaws.ssm#InvalidKeyId": + throw await de_InvalidKeyIdRes(parsedOutput, context); + case "ParameterVersionNotFound": + case "com.amazonaws.ssm#ParameterVersionNotFound": + throw await de_ParameterVersionNotFoundRes(parsedOutput, context); + case "ServiceSettingNotFound": + case "com.amazonaws.ssm#ServiceSettingNotFound": + throw await de_ServiceSettingNotFoundRes(parsedOutput, context); + case "ParameterVersionLabelLimitExceeded": + case "com.amazonaws.ssm#ParameterVersionLabelLimitExceeded": + throw await de_ParameterVersionLabelLimitExceededRes(parsedOutput, context); + case "DocumentPermissionLimit": + case "com.amazonaws.ssm#DocumentPermissionLimit": + throw await de_DocumentPermissionLimitRes(parsedOutput, context); + case "ComplianceTypeCountLimitExceededException": + case "com.amazonaws.ssm#ComplianceTypeCountLimitExceededException": + throw await de_ComplianceTypeCountLimitExceededExceptionRes(parsedOutput, context); + case "InvalidItemContentException": + case "com.amazonaws.ssm#InvalidItemContentException": + throw await de_InvalidItemContentExceptionRes(parsedOutput, context); + case "ItemSizeLimitExceededException": + case "com.amazonaws.ssm#ItemSizeLimitExceededException": + throw await de_ItemSizeLimitExceededExceptionRes(parsedOutput, context); + case "TotalSizeLimitExceededException": + case "com.amazonaws.ssm#TotalSizeLimitExceededException": + throw await de_TotalSizeLimitExceededExceptionRes(parsedOutput, context); + case "CustomSchemaCountLimitExceededException": + case "com.amazonaws.ssm#CustomSchemaCountLimitExceededException": + throw await de_CustomSchemaCountLimitExceededExceptionRes(parsedOutput, context); + case "InvalidInventoryItemContextException": + case "com.amazonaws.ssm#InvalidInventoryItemContextException": + throw await de_InvalidInventoryItemContextExceptionRes(parsedOutput, context); + case "ItemContentMismatchException": + case "com.amazonaws.ssm#ItemContentMismatchException": + throw await de_ItemContentMismatchExceptionRes(parsedOutput, context); + case "SubTypeCountLimitExceededException": + case "com.amazonaws.ssm#SubTypeCountLimitExceededException": + throw await de_SubTypeCountLimitExceededExceptionRes(parsedOutput, context); + case "UnsupportedInventoryItemContextException": + case "com.amazonaws.ssm#UnsupportedInventoryItemContextException": + throw await de_UnsupportedInventoryItemContextExceptionRes(parsedOutput, context); + case "UnsupportedInventorySchemaVersionException": + case "com.amazonaws.ssm#UnsupportedInventorySchemaVersionException": + throw await de_UnsupportedInventorySchemaVersionExceptionRes(parsedOutput, context); + case "HierarchyLevelLimitExceededException": + case "com.amazonaws.ssm#HierarchyLevelLimitExceededException": + throw await de_HierarchyLevelLimitExceededExceptionRes(parsedOutput, context); + case "HierarchyTypeMismatchException": + case "com.amazonaws.ssm#HierarchyTypeMismatchException": + throw await de_HierarchyTypeMismatchExceptionRes(parsedOutput, context); + case "IncompatiblePolicyException": + case "com.amazonaws.ssm#IncompatiblePolicyException": + throw await de_IncompatiblePolicyExceptionRes(parsedOutput, context); + case "InvalidAllowedPatternException": + case "com.amazonaws.ssm#InvalidAllowedPatternException": + throw await de_InvalidAllowedPatternExceptionRes(parsedOutput, context); + case "InvalidPolicyAttributeException": + case "com.amazonaws.ssm#InvalidPolicyAttributeException": + throw await de_InvalidPolicyAttributeExceptionRes(parsedOutput, context); + case "InvalidPolicyTypeException": + case "com.amazonaws.ssm#InvalidPolicyTypeException": + throw await de_InvalidPolicyTypeExceptionRes(parsedOutput, context); + case "ParameterAlreadyExists": + case "com.amazonaws.ssm#ParameterAlreadyExists": + throw await de_ParameterAlreadyExistsRes(parsedOutput, context); + case "ParameterLimitExceeded": + case "com.amazonaws.ssm#ParameterLimitExceeded": + throw await de_ParameterLimitExceededRes(parsedOutput, context); + case "ParameterMaxVersionLimitExceeded": + case "com.amazonaws.ssm#ParameterMaxVersionLimitExceeded": + throw await de_ParameterMaxVersionLimitExceededRes(parsedOutput, context); + case "ParameterPatternMismatchException": + case "com.amazonaws.ssm#ParameterPatternMismatchException": + throw await de_ParameterPatternMismatchExceptionRes(parsedOutput, context); + case "PoliciesLimitExceededException": + case "com.amazonaws.ssm#PoliciesLimitExceededException": + throw await de_PoliciesLimitExceededExceptionRes(parsedOutput, context); + case "UnsupportedParameterType": + case "com.amazonaws.ssm#UnsupportedParameterType": + throw await de_UnsupportedParameterTypeRes(parsedOutput, context); + case "ResourcePolicyLimitExceededException": + case "com.amazonaws.ssm#ResourcePolicyLimitExceededException": + throw await de_ResourcePolicyLimitExceededExceptionRes(parsedOutput, context); + case "AlreadyExistsException": + case "com.amazonaws.ssm#AlreadyExistsException": + throw await de_AlreadyExistsExceptionRes(parsedOutput, context); + case "FeatureNotAvailableException": + case "com.amazonaws.ssm#FeatureNotAvailableException": + throw await de_FeatureNotAvailableExceptionRes(parsedOutput, context); + case "AutomationStepNotFoundException": + case "com.amazonaws.ssm#AutomationStepNotFoundException": + throw await de_AutomationStepNotFoundExceptionRes(parsedOutput, context); + case "InvalidAutomationSignalException": + case "com.amazonaws.ssm#InvalidAutomationSignalException": + throw await de_InvalidAutomationSignalExceptionRes(parsedOutput, context); + case "InvalidNotificationConfig": + case "com.amazonaws.ssm#InvalidNotificationConfig": + throw await de_InvalidNotificationConfigRes(parsedOutput, context); + case "InvalidOutputFolder": + case "com.amazonaws.ssm#InvalidOutputFolder": + throw await de_InvalidOutputFolderRes(parsedOutput, context); + case "InvalidRole": + case "com.amazonaws.ssm#InvalidRole": + throw await de_InvalidRoleRes(parsedOutput, context); + case "InvalidAssociation": + case "com.amazonaws.ssm#InvalidAssociation": + throw await de_InvalidAssociationRes(parsedOutput, context); + case "AutomationDefinitionNotFoundException": + case "com.amazonaws.ssm#AutomationDefinitionNotFoundException": + throw await de_AutomationDefinitionNotFoundExceptionRes(parsedOutput, context); + case "AutomationDefinitionVersionNotFoundException": + case "com.amazonaws.ssm#AutomationDefinitionVersionNotFoundException": + throw await de_AutomationDefinitionVersionNotFoundExceptionRes(parsedOutput, context); + case "AutomationExecutionLimitExceededException": + case "com.amazonaws.ssm#AutomationExecutionLimitExceededException": + throw await de_AutomationExecutionLimitExceededExceptionRes(parsedOutput, context); + case "InvalidAutomationExecutionParametersException": + case "com.amazonaws.ssm#InvalidAutomationExecutionParametersException": + throw await de_InvalidAutomationExecutionParametersExceptionRes(parsedOutput, context); + case "AutomationDefinitionNotApprovedException": + case "com.amazonaws.ssm#AutomationDefinitionNotApprovedException": + throw await de_AutomationDefinitionNotApprovedExceptionRes(parsedOutput, context); + case "TargetNotConnected": + case "com.amazonaws.ssm#TargetNotConnected": + throw await de_TargetNotConnectedRes(parsedOutput, context); + case "InvalidAutomationStatusUpdateException": + case "com.amazonaws.ssm#InvalidAutomationStatusUpdateException": + throw await de_InvalidAutomationStatusUpdateExceptionRes(parsedOutput, context); + case "AssociationVersionLimitExceeded": + case "com.amazonaws.ssm#AssociationVersionLimitExceeded": + throw await de_AssociationVersionLimitExceededRes(parsedOutput, context); + case "InvalidUpdate": + case "com.amazonaws.ssm#InvalidUpdate": + throw await de_InvalidUpdateRes(parsedOutput, context); + case "StatusUnchanged": + case "com.amazonaws.ssm#StatusUnchanged": + throw await de_StatusUnchangedRes(parsedOutput, context); + case "DocumentVersionLimitExceeded": + case "com.amazonaws.ssm#DocumentVersionLimitExceeded": + throw await de_DocumentVersionLimitExceededRes(parsedOutput, context); + case "DuplicateDocumentContent": + case "com.amazonaws.ssm#DuplicateDocumentContent": + throw await de_DuplicateDocumentContentRes(parsedOutput, context); + case "DuplicateDocumentVersionName": + case "com.amazonaws.ssm#DuplicateDocumentVersionName": + throw await de_DuplicateDocumentVersionNameRes(parsedOutput, context); case "OpsMetadataKeyLimitExceededException": case "com.amazonaws.ssm#OpsMetadataKeyLimitExceededException": throw await de_OpsMetadataKeyLimitExceededExceptionRes(parsedOutput, context); - case "OpsMetadataNotFoundException": - case "com.amazonaws.ssm#OpsMetadataNotFoundException": - throw await de_OpsMetadataNotFoundExceptionRes(parsedOutput, context); - case "OpsMetadataTooManyUpdatesException": - case "com.amazonaws.ssm#OpsMetadataTooManyUpdatesException": - throw await de_OpsMetadataTooManyUpdatesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdatePatchBaselineCommand - */ -export const de_UpdatePatchBaselineCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdatePatchBaselineCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_UpdatePatchBaselineResult(data, context); - const response: UpdatePatchBaselineCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdatePatchBaselineCommandError - */ -const de_UpdatePatchBaselineCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DoesNotExistException": - case "com.amazonaws.ssm#DoesNotExistException": - throw await de_DoesNotExistExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateResourceDataSyncCommand - */ -export const de_UpdateResourceDataSyncCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateResourceDataSyncCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateResourceDataSyncCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateResourceDataSyncCommandError - */ -const de_UpdateResourceDataSyncCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); case "ResourceDataSyncConflictException": case "com.amazonaws.ssm#ResourceDataSyncConflictException": throw await de_ResourceDataSyncConflictExceptionRes(parsedOutput, context); - case "ResourceDataSyncInvalidConfigurationException": - case "com.amazonaws.ssm#ResourceDataSyncInvalidConfigurationException": - throw await de_ResourceDataSyncInvalidConfigurationExceptionRes(parsedOutput, context); - case "ResourceDataSyncNotFoundException": - case "com.amazonaws.ssm#ResourceDataSyncNotFoundException": - throw await de_ResourceDataSyncNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateServiceSettingCommand - */ -export const de_UpdateServiceSettingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateServiceSettingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateServiceSettingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateServiceSettingCommandError - */ -const de_UpdateServiceSettingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.ssm#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ServiceSettingNotFound": - case "com.amazonaws.ssm#ServiceSettingNotFound": - throw await de_ServiceSettingNotFoundRes(parsedOutput, context); - case "TooManyUpdates": - case "com.amazonaws.ssm#TooManyUpdates": - throw await de_TooManyUpdatesRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-sso-admin/src/protocols/Aws_json1_1.ts b/clients/client-sso-admin/src/protocols/Aws_json1_1.ts index 3a94de3ad759..07b5f5777a7c 100644 --- a/clients/client-sso-admin/src/protocols/Aws_json1_1.ts +++ b/clients/client-sso-admin/src/protocols/Aws_json1_1.ts @@ -1368,7 +1368,7 @@ export const de_AttachCustomerManagedPolicyReferenceToPermissionSetCommand = asy context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachCustomerManagedPolicyReferenceToPermissionSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1380,50 +1380,6 @@ export const de_AttachCustomerManagedPolicyReferenceToPermissionSetCommand = asy return response; }; -/** - * deserializeAws_json1_1AttachCustomerManagedPolicyReferenceToPermissionSetCommandError - */ -const de_AttachCustomerManagedPolicyReferenceToPermissionSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssoadmin#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AttachManagedPolicyToPermissionSetCommand */ @@ -1432,7 +1388,7 @@ export const de_AttachManagedPolicyToPermissionSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachManagedPolicyToPermissionSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1444,50 +1400,6 @@ export const de_AttachManagedPolicyToPermissionSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1AttachManagedPolicyToPermissionSetCommandError - */ -const de_AttachManagedPolicyToPermissionSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssoadmin#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAccountAssignmentCommand */ @@ -1496,7 +1408,7 @@ export const de_CreateAccountAssignmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAccountAssignmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1508,50 +1420,6 @@ export const de_CreateAccountAssignmentCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAccountAssignmentCommandError - */ -const de_CreateAccountAssignmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssoadmin#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateApplicationCommand */ @@ -1560,7 +1428,7 @@ export const de_CreateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1572,50 +1440,6 @@ export const de_CreateApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateApplicationCommandError - */ -const de_CreateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssoadmin#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateApplicationAssignmentCommand */ @@ -1624,7 +1448,7 @@ export const de_CreateApplicationAssignmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateApplicationAssignmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1636,50 +1460,6 @@ export const de_CreateApplicationAssignmentCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateApplicationAssignmentCommandError - */ -const de_CreateApplicationAssignmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssoadmin#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateInstanceCommand */ @@ -1688,7 +1468,7 @@ export const de_CreateInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1700,47 +1480,6 @@ export const de_CreateInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateInstanceCommandError - */ -const de_CreateInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssoadmin#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateInstanceAccessControlAttributeConfigurationCommand */ @@ -1749,7 +1488,7 @@ export const de_CreateInstanceAccessControlAttributeConfigurationCommand = async context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateInstanceAccessControlAttributeConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1762,55 +1501,14 @@ export const de_CreateInstanceAccessControlAttributeConfigurationCommand = async }; /** - * deserializeAws_json1_1CreateInstanceAccessControlAttributeConfigurationCommandError + * deserializeAws_json1_1CreatePermissionSetCommand */ -const de_CreateInstanceAccessControlAttributeConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreatePermissionSetCommand - */ -export const de_CreatePermissionSetCommand = async ( +export const de_CreatePermissionSetCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePermissionSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1822,50 +1520,6 @@ export const de_CreatePermissionSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreatePermissionSetCommandError - */ -const de_CreatePermissionSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssoadmin#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTrustedTokenIssuerCommand */ @@ -1874,7 +1528,7 @@ export const de_CreateTrustedTokenIssuerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTrustedTokenIssuerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1886,47 +1540,6 @@ export const de_CreateTrustedTokenIssuerCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateTrustedTokenIssuerCommandError - */ -const de_CreateTrustedTokenIssuerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssoadmin#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAccountAssignmentCommand */ @@ -1935,7 +1548,7 @@ export const de_DeleteAccountAssignmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAccountAssignmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1947,47 +1560,6 @@ export const de_DeleteAccountAssignmentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAccountAssignmentCommandError - */ -const de_DeleteAccountAssignmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationCommand */ @@ -1996,7 +1568,7 @@ export const de_DeleteApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2008,47 +1580,6 @@ export const de_DeleteApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteApplicationCommandError - */ -const de_DeleteApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationAccessScopeCommand */ @@ -2057,7 +1588,7 @@ export const de_DeleteApplicationAccessScopeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationAccessScopeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteApplicationAccessScopeCommandOutput = { @@ -2066,47 +1597,6 @@ export const de_DeleteApplicationAccessScopeCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteApplicationAccessScopeCommandError - */ -const de_DeleteApplicationAccessScopeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationAssignmentCommand */ @@ -2115,7 +1605,7 @@ export const de_DeleteApplicationAssignmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationAssignmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2128,104 +1618,22 @@ export const de_DeleteApplicationAssignmentCommand = async ( }; /** - * deserializeAws_json1_1DeleteApplicationAssignmentCommandError + * deserializeAws_json1_1DeleteApplicationAuthenticationMethodCommand */ -const de_DeleteApplicationAssignmentCommandError = async ( +export const de_DeleteApplicationAuthenticationMethodCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteApplicationAuthenticationMethodCommand - */ -export const de_DeleteApplicationAuthenticationMethodCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteApplicationAuthenticationMethodCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteApplicationAuthenticationMethodCommandOutput = { - $metadata: deserializeMetadata(output), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: DeleteApplicationAuthenticationMethodCommandOutput = { + $metadata: deserializeMetadata(output), }; return response; }; -/** - * deserializeAws_json1_1DeleteApplicationAuthenticationMethodCommandError - */ -const de_DeleteApplicationAuthenticationMethodCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteApplicationGrantCommand */ @@ -2234,7 +1642,7 @@ export const de_DeleteApplicationGrantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteApplicationGrantCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteApplicationGrantCommandOutput = { @@ -2243,47 +1651,6 @@ export const de_DeleteApplicationGrantCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteApplicationGrantCommandError - */ -const de_DeleteApplicationGrantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteInlinePolicyFromPermissionSetCommand */ @@ -2292,7 +1659,7 @@ export const de_DeleteInlinePolicyFromPermissionSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteInlinePolicyFromPermissionSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2304,47 +1671,6 @@ export const de_DeleteInlinePolicyFromPermissionSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteInlinePolicyFromPermissionSetCommandError - */ -const de_DeleteInlinePolicyFromPermissionSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteInstanceCommand */ @@ -2353,7 +1679,7 @@ export const de_DeleteInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2365,44 +1691,6 @@ export const de_DeleteInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteInstanceCommandError - */ -const de_DeleteInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurationCommand */ @@ -2411,7 +1699,7 @@ export const de_DeleteInstanceAccessControlAttributeConfigurationCommand = async context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteInstanceAccessControlAttributeConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2423,47 +1711,6 @@ export const de_DeleteInstanceAccessControlAttributeConfigurationCommand = async return response; }; -/** - * deserializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurationCommandError - */ -const de_DeleteInstanceAccessControlAttributeConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeletePermissionsBoundaryFromPermissionSetCommand */ @@ -2472,7 +1719,7 @@ export const de_DeletePermissionsBoundaryFromPermissionSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePermissionsBoundaryFromPermissionSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2484,47 +1731,6 @@ export const de_DeletePermissionsBoundaryFromPermissionSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeletePermissionsBoundaryFromPermissionSetCommandError - */ -const de_DeletePermissionsBoundaryFromPermissionSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeletePermissionSetCommand */ @@ -2533,7 +1739,7 @@ export const de_DeletePermissionSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePermissionSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2546,55 +1752,14 @@ export const de_DeletePermissionSetCommand = async ( }; /** - * deserializeAws_json1_1DeletePermissionSetCommandError + * deserializeAws_json1_1DeleteTrustedTokenIssuerCommand */ -const de_DeletePermissionSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteTrustedTokenIssuerCommand - */ -export const de_DeleteTrustedTokenIssuerCommand = async ( +export const de_DeleteTrustedTokenIssuerCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTrustedTokenIssuerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2606,47 +1771,6 @@ export const de_DeleteTrustedTokenIssuerCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteTrustedTokenIssuerCommandError - */ -const de_DeleteTrustedTokenIssuerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAccountAssignmentCreationStatusCommand */ @@ -2655,7 +1779,7 @@ export const de_DescribeAccountAssignmentCreationStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAccountAssignmentCreationStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2667,44 +1791,6 @@ export const de_DescribeAccountAssignmentCreationStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAccountAssignmentCreationStatusCommandError - */ -const de_DescribeAccountAssignmentCreationStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAccountAssignmentDeletionStatusCommand */ @@ -2713,7 +1799,7 @@ export const de_DescribeAccountAssignmentDeletionStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAccountAssignmentDeletionStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2725,44 +1811,6 @@ export const de_DescribeAccountAssignmentDeletionStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAccountAssignmentDeletionStatusCommandError - */ -const de_DescribeAccountAssignmentDeletionStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeApplicationCommand */ @@ -2771,7 +1819,7 @@ export const de_DescribeApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2783,44 +1831,6 @@ export const de_DescribeApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeApplicationCommandError - */ -const de_DescribeApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeApplicationAssignmentCommand */ @@ -2829,7 +1839,7 @@ export const de_DescribeApplicationAssignmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeApplicationAssignmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2841,44 +1851,6 @@ export const de_DescribeApplicationAssignmentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeApplicationAssignmentCommandError - */ -const de_DescribeApplicationAssignmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeApplicationProviderCommand */ @@ -2887,7 +1859,7 @@ export const de_DescribeApplicationProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeApplicationProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2899,44 +1871,6 @@ export const de_DescribeApplicationProviderCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeApplicationProviderCommandError - */ -const de_DescribeApplicationProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeInstanceCommand */ @@ -2945,7 +1879,7 @@ export const de_DescribeInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2958,49 +1892,14 @@ export const de_DescribeInstanceCommand = async ( }; /** - * deserializeAws_json1_1DescribeInstanceCommandError + * deserializeAws_json1_1DescribeInstanceAccessControlAttributeConfigurationCommand */ -const de_DescribeInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeInstanceAccessControlAttributeConfigurationCommand - */ -export const de_DescribeInstanceAccessControlAttributeConfigurationCommand = async ( +export const de_DescribeInstanceAccessControlAttributeConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeInstanceAccessControlAttributeConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3012,44 +1911,6 @@ export const de_DescribeInstanceAccessControlAttributeConfigurationCommand = asy return response; }; -/** - * deserializeAws_json1_1DescribeInstanceAccessControlAttributeConfigurationCommandError - */ -const de_DescribeInstanceAccessControlAttributeConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribePermissionSetCommand */ @@ -3058,7 +1919,7 @@ export const de_DescribePermissionSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePermissionSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3070,44 +1931,6 @@ export const de_DescribePermissionSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribePermissionSetCommandError - */ -const de_DescribePermissionSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribePermissionSetProvisioningStatusCommand */ @@ -3116,7 +1939,7 @@ export const de_DescribePermissionSetProvisioningStatusCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribePermissionSetProvisioningStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3128,44 +1951,6 @@ export const de_DescribePermissionSetProvisioningStatusCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribePermissionSetProvisioningStatusCommandError - */ -const de_DescribePermissionSetProvisioningStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTrustedTokenIssuerCommand */ @@ -3174,7 +1959,7 @@ export const de_DescribeTrustedTokenIssuerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrustedTokenIssuerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3186,44 +1971,6 @@ export const de_DescribeTrustedTokenIssuerCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTrustedTokenIssuerCommandError - */ -const de_DescribeTrustedTokenIssuerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DetachCustomerManagedPolicyReferenceFromPermissionSetCommand */ @@ -3232,7 +1979,7 @@ export const de_DetachCustomerManagedPolicyReferenceFromPermissionSetCommand = a context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetachCustomerManagedPolicyReferenceFromPermissionSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3244,47 +1991,6 @@ export const de_DetachCustomerManagedPolicyReferenceFromPermissionSetCommand = a return response; }; -/** - * deserializeAws_json1_1DetachCustomerManagedPolicyReferenceFromPermissionSetCommandError - */ -const de_DetachCustomerManagedPolicyReferenceFromPermissionSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DetachManagedPolicyFromPermissionSetCommand */ @@ -3293,7 +1999,7 @@ export const de_DetachManagedPolicyFromPermissionSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetachManagedPolicyFromPermissionSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3306,60 +2012,39 @@ export const de_DetachManagedPolicyFromPermissionSetCommand = async ( }; /** - * deserializeAws_json1_1DetachManagedPolicyFromPermissionSetCommandError + * deserializeAws_json1_1GetApplicationAccessScopeCommand */ -const de_DetachManagedPolicyFromPermissionSetCommandError = async ( +export const de_GetApplicationAccessScopeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetApplicationAccessScopeCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetApplicationAccessScopeCommand + * deserializeAws_json1_1GetApplicationAssignmentConfigurationCommand */ -export const de_GetApplicationAccessScopeCommand = async ( +export const de_GetApplicationAssignmentConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetApplicationAccessScopeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetApplicationAccessScopeCommandOutput = { + const response: GetApplicationAssignmentConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3367,57 +2052,39 @@ export const de_GetApplicationAccessScopeCommand = async ( }; /** - * deserializeAws_json1_1GetApplicationAccessScopeCommandError + * deserializeAws_json1_1GetApplicationAuthenticationMethodCommand */ -const de_GetApplicationAccessScopeCommandError = async ( +export const de_GetApplicationAuthenticationMethodCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetApplicationAuthenticationMethodResponse(data, context); + const response: GetApplicationAuthenticationMethodCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetApplicationAssignmentConfigurationCommand + * deserializeAws_json1_1GetApplicationGrantCommand */ -export const de_GetApplicationAssignmentConfigurationCommand = async ( +export const de_GetApplicationGrantCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetApplicationAssignmentConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetApplicationAssignmentConfigurationCommandOutput = { + const response: GetApplicationGrantCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3425,57 +2092,39 @@ export const de_GetApplicationAssignmentConfigurationCommand = async ( }; /** - * deserializeAws_json1_1GetApplicationAssignmentConfigurationCommandError + * deserializeAws_json1_1GetInlinePolicyForPermissionSetCommand */ -const de_GetApplicationAssignmentConfigurationCommandError = async ( +export const de_GetInlinePolicyForPermissionSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetInlinePolicyForPermissionSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetApplicationAuthenticationMethodCommand + * deserializeAws_json1_1GetPermissionsBoundaryForPermissionSetCommand */ -export const de_GetApplicationAuthenticationMethodCommand = async ( +export const de_GetPermissionsBoundaryForPermissionSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetApplicationAuthenticationMethodCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetApplicationAuthenticationMethodResponse(data, context); - const response: GetApplicationAuthenticationMethodCommandOutput = { + contents = _json(data); + const response: GetPermissionsBoundaryForPermissionSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3483,57 +2132,39 @@ export const de_GetApplicationAuthenticationMethodCommand = async ( }; /** - * deserializeAws_json1_1GetApplicationAuthenticationMethodCommandError + * deserializeAws_json1_1ListAccountAssignmentCreationStatusCommand */ -const de_GetApplicationAuthenticationMethodCommandError = async ( +export const de_ListAccountAssignmentCreationStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListAccountAssignmentCreationStatusResponse(data, context); + const response: ListAccountAssignmentCreationStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetApplicationGrantCommand + * deserializeAws_json1_1ListAccountAssignmentDeletionStatusCommand */ -export const de_GetApplicationGrantCommand = async ( +export const de_ListAccountAssignmentDeletionStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetApplicationGrantCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetApplicationGrantCommandOutput = { + contents = de_ListAccountAssignmentDeletionStatusResponse(data, context); + const response: ListAccountAssignmentDeletionStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3541,57 +2172,39 @@ export const de_GetApplicationGrantCommand = async ( }; /** - * deserializeAws_json1_1GetApplicationGrantCommandError + * deserializeAws_json1_1ListAccountAssignmentsCommand */ -const de_GetApplicationGrantCommandError = async ( +export const de_ListAccountAssignmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListAccountAssignmentsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetInlinePolicyForPermissionSetCommand + * deserializeAws_json1_1ListAccountAssignmentsForPrincipalCommand */ -export const de_GetInlinePolicyForPermissionSetCommand = async ( +export const de_ListAccountAssignmentsForPrincipalCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetInlinePolicyForPermissionSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetInlinePolicyForPermissionSetCommandOutput = { + const response: ListAccountAssignmentsForPrincipalCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3599,57 +2212,39 @@ export const de_GetInlinePolicyForPermissionSetCommand = async ( }; /** - * deserializeAws_json1_1GetInlinePolicyForPermissionSetCommandError + * deserializeAws_json1_1ListAccountsForProvisionedPermissionSetCommand */ -const de_GetInlinePolicyForPermissionSetCommandError = async ( +export const de_ListAccountsForProvisionedPermissionSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListAccountsForProvisionedPermissionSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetPermissionsBoundaryForPermissionSetCommand + * deserializeAws_json1_1ListApplicationAccessScopesCommand */ -export const de_GetPermissionsBoundaryForPermissionSetCommand = async ( +export const de_ListApplicationAccessScopesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetPermissionsBoundaryForPermissionSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetPermissionsBoundaryForPermissionSetCommandOutput = { + const response: ListApplicationAccessScopesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3657,57 +2252,39 @@ export const de_GetPermissionsBoundaryForPermissionSetCommand = async ( }; /** - * deserializeAws_json1_1GetPermissionsBoundaryForPermissionSetCommandError + * deserializeAws_json1_1ListApplicationAssignmentsCommand */ -const de_GetPermissionsBoundaryForPermissionSetCommandError = async ( +export const de_ListApplicationAssignmentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListApplicationAssignmentsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1ListAccountAssignmentCreationStatusCommand + * deserializeAws_json1_1ListApplicationAssignmentsForPrincipalCommand */ -export const de_ListAccountAssignmentCreationStatusCommand = async ( +export const de_ListApplicationAssignmentsForPrincipalCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAccountAssignmentCreationStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListAccountAssignmentCreationStatusResponse(data, context); - const response: ListAccountAssignmentCreationStatusCommandOutput = { + contents = _json(data); + const response: ListApplicationAssignmentsForPrincipalCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3715,57 +2292,39 @@ export const de_ListAccountAssignmentCreationStatusCommand = async ( }; /** - * deserializeAws_json1_1ListAccountAssignmentCreationStatusCommandError + * deserializeAws_json1_1ListApplicationAuthenticationMethodsCommand */ -const de_ListAccountAssignmentCreationStatusCommandError = async ( +export const de_ListApplicationAuthenticationMethodsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListApplicationAuthenticationMethodsResponse(data, context); + const response: ListApplicationAuthenticationMethodsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListAccountAssignmentDeletionStatusCommand + * deserializeAws_json1_1ListApplicationGrantsCommand */ -export const de_ListAccountAssignmentDeletionStatusCommand = async ( +export const de_ListApplicationGrantsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAccountAssignmentDeletionStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListAccountAssignmentDeletionStatusResponse(data, context); - const response: ListAccountAssignmentDeletionStatusCommandOutput = { + contents = _json(data); + const response: ListApplicationGrantsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3773,57 +2332,59 @@ export const de_ListAccountAssignmentDeletionStatusCommand = async ( }; /** - * deserializeAws_json1_1ListAccountAssignmentDeletionStatusCommandError + * deserializeAws_json1_1ListApplicationProvidersCommand */ -const de_ListAccountAssignmentDeletionStatusCommandError = async ( +export const de_ListApplicationProvidersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListApplicationProvidersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1ListApplicationsCommand + */ +export const de_ListApplicationsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListApplicationsResponse(data, context); + const response: ListApplicationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListAccountAssignmentsCommand + * deserializeAws_json1_1ListCustomerManagedPolicyReferencesInPermissionSetCommand */ -export const de_ListAccountAssignmentsCommand = async ( +export const de_ListCustomerManagedPolicyReferencesInPermissionSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAccountAssignmentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListAccountAssignmentsCommandOutput = { + const response: ListCustomerManagedPolicyReferencesInPermissionSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3831,57 +2392,39 @@ export const de_ListAccountAssignmentsCommand = async ( }; /** - * deserializeAws_json1_1ListAccountAssignmentsCommandError + * deserializeAws_json1_1ListInstancesCommand */ -const de_ListAccountAssignmentsCommandError = async ( +export const de_ListInstancesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListInstancesResponse(data, context); + const response: ListInstancesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListAccountAssignmentsForPrincipalCommand + * deserializeAws_json1_1ListManagedPoliciesInPermissionSetCommand */ -export const de_ListAccountAssignmentsForPrincipalCommand = async ( +export const de_ListManagedPoliciesInPermissionSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAccountAssignmentsForPrincipalCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListAccountAssignmentsForPrincipalCommandOutput = { + const response: ListManagedPoliciesInPermissionSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3889,57 +2432,39 @@ export const de_ListAccountAssignmentsForPrincipalCommand = async ( }; /** - * deserializeAws_json1_1ListAccountAssignmentsForPrincipalCommandError + * deserializeAws_json1_1ListPermissionSetProvisioningStatusCommand */ -const de_ListAccountAssignmentsForPrincipalCommandError = async ( +export const de_ListPermissionSetProvisioningStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListPermissionSetProvisioningStatusResponse(data, context); + const response: ListPermissionSetProvisioningStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListAccountsForProvisionedPermissionSetCommand + * deserializeAws_json1_1ListPermissionSetsCommand */ -export const de_ListAccountsForProvisionedPermissionSetCommand = async ( +export const de_ListPermissionSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAccountsForProvisionedPermissionSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListAccountsForProvisionedPermissionSetCommandOutput = { + const response: ListPermissionSetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3947,57 +2472,19 @@ export const de_ListAccountsForProvisionedPermissionSetCommand = async ( }; /** - * deserializeAws_json1_1ListAccountsForProvisionedPermissionSetCommandError + * deserializeAws_json1_1ListPermissionSetsProvisionedToAccountCommand */ -const de_ListAccountsForProvisionedPermissionSetCommandError = async ( +export const de_ListPermissionSetsProvisionedToAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListApplicationAccessScopesCommand - */ -export const de_ListApplicationAccessScopesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListApplicationAccessScopesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListApplicationAccessScopesCommandOutput = { + const response: ListPermissionSetsProvisionedToAccountCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4005,57 +2492,19 @@ export const de_ListApplicationAccessScopesCommand = async ( }; /** - * deserializeAws_json1_1ListApplicationAccessScopesCommandError - */ -const de_ListApplicationAccessScopesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListApplicationAssignmentsCommand + * deserializeAws_json1_1ListTagsForResourceCommand */ -export const de_ListApplicationAssignmentsCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListApplicationAssignmentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListApplicationAssignmentsCommandOutput = { + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4063,57 +2512,19 @@ export const de_ListApplicationAssignmentsCommand = async ( }; /** - * deserializeAws_json1_1ListApplicationAssignmentsCommandError - */ -const de_ListApplicationAssignmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListApplicationAssignmentsForPrincipalCommand + * deserializeAws_json1_1ListTrustedTokenIssuersCommand */ -export const de_ListApplicationAssignmentsForPrincipalCommand = async ( +export const de_ListTrustedTokenIssuersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListApplicationAssignmentsForPrincipalCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListApplicationAssignmentsForPrincipalCommandOutput = { + const response: ListTrustedTokenIssuersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4121,57 +2532,19 @@ export const de_ListApplicationAssignmentsForPrincipalCommand = async ( }; /** - * deserializeAws_json1_1ListApplicationAssignmentsForPrincipalCommandError - */ -const de_ListApplicationAssignmentsForPrincipalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListApplicationAuthenticationMethodsCommand + * deserializeAws_json1_1ProvisionPermissionSetCommand */ -export const de_ListApplicationAuthenticationMethodsCommand = async ( +export const de_ProvisionPermissionSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListApplicationAuthenticationMethodsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListApplicationAuthenticationMethodsResponse(data, context); - const response: ListApplicationAuthenticationMethodsCommandOutput = { + contents = de_ProvisionPermissionSetResponse(data, context); + const response: ProvisionPermissionSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4179,57 +2552,36 @@ export const de_ListApplicationAuthenticationMethodsCommand = async ( }; /** - * deserializeAws_json1_1ListApplicationAuthenticationMethodsCommandError + * deserializeAws_json1_1PutApplicationAccessScopeCommand */ -const de_ListApplicationAuthenticationMethodsCommandError = async ( +export const de_PutApplicationAccessScopeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: PutApplicationAccessScopeCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListApplicationGrantsCommand + * deserializeAws_json1_1PutApplicationAssignmentConfigurationCommand */ -export const de_ListApplicationGrantsCommand = async ( +export const de_PutApplicationAssignmentConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListApplicationGrantsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListApplicationGrantsCommandOutput = { + const response: PutApplicationAssignmentConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4237,858 +2589,31 @@ export const de_ListApplicationGrantsCommand = async ( }; /** - * deserializeAws_json1_1ListApplicationGrantsCommandError + * deserializeAws_json1_1PutApplicationAuthenticationMethodCommand */ -const de_ListApplicationGrantsCommandError = async ( +export const de_PutApplicationAuthenticationMethodCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: PutApplicationAuthenticationMethodCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1ListApplicationProvidersCommand + * deserializeAws_json1_1PutApplicationGrantCommand */ -export const de_ListApplicationProvidersCommand = async ( +export const de_PutApplicationGrantCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListApplicationProvidersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListApplicationProvidersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListApplicationProvidersCommandError - */ -const de_ListApplicationProvidersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListApplicationsCommand - */ -export const de_ListApplicationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListApplicationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListApplicationsResponse(data, context); - const response: ListApplicationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListApplicationsCommandError - */ -const de_ListApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListCustomerManagedPolicyReferencesInPermissionSetCommand - */ -export const de_ListCustomerManagedPolicyReferencesInPermissionSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListCustomerManagedPolicyReferencesInPermissionSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListCustomerManagedPolicyReferencesInPermissionSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListCustomerManagedPolicyReferencesInPermissionSetCommandError - */ -const de_ListCustomerManagedPolicyReferencesInPermissionSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListInstancesCommand - */ -export const de_ListInstancesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListInstancesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListInstancesResponse(data, context); - const response: ListInstancesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListInstancesCommandError - */ -const de_ListInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListManagedPoliciesInPermissionSetCommand - */ -export const de_ListManagedPoliciesInPermissionSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListManagedPoliciesInPermissionSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListManagedPoliciesInPermissionSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListManagedPoliciesInPermissionSetCommandError - */ -const de_ListManagedPoliciesInPermissionSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListPermissionSetProvisioningStatusCommand - */ -export const de_ListPermissionSetProvisioningStatusCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPermissionSetProvisioningStatusCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListPermissionSetProvisioningStatusResponse(data, context); - const response: ListPermissionSetProvisioningStatusCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListPermissionSetProvisioningStatusCommandError - */ -const de_ListPermissionSetProvisioningStatusCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListPermissionSetsCommand - */ -export const de_ListPermissionSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPermissionSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListPermissionSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListPermissionSetsCommandError - */ -const de_ListPermissionSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListPermissionSetsProvisionedToAccountCommand - */ -export const de_ListPermissionSetsProvisionedToAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPermissionSetsProvisionedToAccountCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListPermissionSetsProvisionedToAccountCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListPermissionSetsProvisionedToAccountCommandError - */ -const de_ListPermissionSetsProvisionedToAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTrustedTokenIssuersCommand - */ -export const de_ListTrustedTokenIssuersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTrustedTokenIssuersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTrustedTokenIssuersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTrustedTokenIssuersCommandError - */ -const de_ListTrustedTokenIssuersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ProvisionPermissionSetCommand - */ -export const de_ProvisionPermissionSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ProvisionPermissionSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ProvisionPermissionSetResponse(data, context); - const response: ProvisionPermissionSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ProvisionPermissionSetCommandError - */ -const de_ProvisionPermissionSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutApplicationAccessScopeCommand - */ -export const de_PutApplicationAccessScopeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutApplicationAccessScopeCommandError(output, context); - } - await collectBody(output.body, context); - const response: PutApplicationAccessScopeCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1PutApplicationAccessScopeCommandError - */ -const de_PutApplicationAccessScopeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutApplicationAssignmentConfigurationCommand - */ -export const de_PutApplicationAssignmentConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutApplicationAssignmentConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutApplicationAssignmentConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutApplicationAssignmentConfigurationCommandError - */ -const de_PutApplicationAssignmentConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutApplicationAuthenticationMethodCommand - */ -export const de_PutApplicationAuthenticationMethodCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutApplicationAuthenticationMethodCommandError(output, context); - } - await collectBody(output.body, context); - const response: PutApplicationAuthenticationMethodCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1PutApplicationAuthenticationMethodCommandError - */ -const de_PutApplicationAuthenticationMethodCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutApplicationGrantCommand - */ -export const de_PutApplicationGrantCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutApplicationGrantCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutApplicationGrantCommandOutput = { @@ -5097,186 +2622,40 @@ export const de_PutApplicationGrantCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutApplicationGrantCommandError - */ -const de_PutApplicationGrantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutInlinePolicyToPermissionSetCommand */ export const de_PutInlinePolicyToPermissionSetCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutInlinePolicyToPermissionSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutInlinePolicyToPermissionSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutInlinePolicyToPermissionSetCommandError - */ -const de_PutInlinePolicyToPermissionSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssoadmin#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutPermissionsBoundaryToPermissionSetCommand - */ -export const de_PutPermissionsBoundaryToPermissionSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutPermissionsBoundaryToPermissionSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutPermissionsBoundaryToPermissionSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutPermissionsBoundaryToPermissionSetCommandError - */ -const de_PutPermissionsBoundaryToPermissionSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutInlinePolicyToPermissionSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1PutPermissionsBoundaryToPermissionSetCommand */ -export const de_TagResourceCommand = async ( +export const de_PutPermissionsBoundaryToPermissionSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: PutPermissionsBoundaryToPermissionSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5284,47 +2663,23 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1TagResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.ssoadmin#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -5335,7 +2690,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5347,47 +2702,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateApplicationCommand */ @@ -5396,7 +2710,7 @@ export const de_UpdateApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5408,47 +2722,6 @@ export const de_UpdateApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateApplicationCommandError - */ -const de_UpdateApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateInstanceCommand */ @@ -5457,7 +2730,7 @@ export const de_UpdateInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateInstanceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5469,44 +2742,6 @@ export const de_UpdateInstanceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateInstanceCommandError - */ -const de_UpdateInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurationCommand */ @@ -5515,7 +2750,7 @@ export const de_UpdateInstanceAccessControlAttributeConfigurationCommand = async context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateInstanceAccessControlAttributeConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5527,47 +2762,6 @@ export const de_UpdateInstanceAccessControlAttributeConfigurationCommand = async return response; }; -/** - * deserializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurationCommandError - */ -const de_UpdateInstanceAccessControlAttributeConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdatePermissionSetCommand */ @@ -5576,7 +2770,7 @@ export const de_UpdatePermissionSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePermissionSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5588,47 +2782,6 @@ export const de_UpdatePermissionSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdatePermissionSetCommandError - */ -const de_UpdatePermissionSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssoadmin#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.ssoadmin#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssoadmin#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.ssoadmin#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.ssoadmin#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.ssoadmin#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateTrustedTokenIssuerCommand */ @@ -5637,7 +2790,7 @@ export const de_UpdateTrustedTokenIssuerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTrustedTokenIssuerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5650,12 +2803,9 @@ export const de_UpdateTrustedTokenIssuerCommand = async ( }; /** - * deserializeAws_json1_1UpdateTrustedTokenIssuerCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateTrustedTokenIssuerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5674,6 +2824,9 @@ const de_UpdateTrustedTokenIssuerCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.ssoadmin#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.ssoadmin#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.ssoadmin#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -5686,7 +2839,7 @@ const de_UpdateTrustedTokenIssuerCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts b/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts index bbacfec6db84..a5f19766c48e 100644 --- a/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts +++ b/clients/client-sso-oidc/src/protocols/Aws_restJson1.ts @@ -163,7 +163,7 @@ export const de_CreateTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTokenCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -180,62 +180,6 @@ export const de_CreateTokenCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTokenCommandError - */ -const de_CreateTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssooidc#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationPendingException": - case "com.amazonaws.ssooidc#AuthorizationPendingException": - throw await de_AuthorizationPendingExceptionRes(parsedOutput, context); - case "ExpiredTokenException": - case "com.amazonaws.ssooidc#ExpiredTokenException": - throw await de_ExpiredTokenExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssooidc#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidClientException": - case "com.amazonaws.ssooidc#InvalidClientException": - throw await de_InvalidClientExceptionRes(parsedOutput, context); - case "InvalidGrantException": - case "com.amazonaws.ssooidc#InvalidGrantException": - throw await de_InvalidGrantExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ssooidc#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidScopeException": - case "com.amazonaws.ssooidc#InvalidScopeException": - throw await de_InvalidScopeExceptionRes(parsedOutput, context); - case "SlowDownException": - case "com.amazonaws.ssooidc#SlowDownException": - throw await de_SlowDownExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.ssooidc#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - case "UnsupportedGrantTypeException": - case "com.amazonaws.ssooidc#UnsupportedGrantTypeException": - throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateTokenWithIAMCommand */ @@ -244,7 +188,7 @@ export const de_CreateTokenWithIAMCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTokenWithIAMCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -263,65 +207,6 @@ export const de_CreateTokenWithIAMCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTokenWithIAMCommandError - */ -const de_CreateTokenWithIAMCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.ssooidc#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "AuthorizationPendingException": - case "com.amazonaws.ssooidc#AuthorizationPendingException": - throw await de_AuthorizationPendingExceptionRes(parsedOutput, context); - case "ExpiredTokenException": - case "com.amazonaws.ssooidc#ExpiredTokenException": - throw await de_ExpiredTokenExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.ssooidc#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidClientException": - case "com.amazonaws.ssooidc#InvalidClientException": - throw await de_InvalidClientExceptionRes(parsedOutput, context); - case "InvalidGrantException": - case "com.amazonaws.ssooidc#InvalidGrantException": - throw await de_InvalidGrantExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ssooidc#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidRequestRegionException": - case "com.amazonaws.ssooidc#InvalidRequestRegionException": - throw await de_InvalidRequestRegionExceptionRes(parsedOutput, context); - case "InvalidScopeException": - case "com.amazonaws.ssooidc#InvalidScopeException": - throw await de_InvalidScopeExceptionRes(parsedOutput, context); - case "SlowDownException": - case "com.amazonaws.ssooidc#SlowDownException": - throw await de_SlowDownExceptionRes(parsedOutput, context); - case "UnauthorizedClientException": - case "com.amazonaws.ssooidc#UnauthorizedClientException": - throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); - case "UnsupportedGrantTypeException": - case "com.amazonaws.ssooidc#UnsupportedGrantTypeException": - throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RegisterClientCommand */ @@ -330,7 +215,7 @@ export const de_RegisterClientCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterClientCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -348,41 +233,6 @@ export const de_RegisterClientCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RegisterClientCommandError - */ -const de_RegisterClientCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.ssooidc#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidClientMetadataException": - case "com.amazonaws.ssooidc#InvalidClientMetadataException": - throw await de_InvalidClientMetadataExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.ssooidc#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "InvalidScopeException": - case "com.amazonaws.ssooidc#InvalidScopeException": - throw await de_InvalidScopeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartDeviceAuthorizationCommand */ @@ -391,7 +241,7 @@ export const de_StartDeviceAuthorizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartDeviceAuthorizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -410,40 +260,61 @@ export const de_StartDeviceAuthorizationCommand = async ( }; /** - * deserializeAws_restJson1StartDeviceAuthorizationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_StartDeviceAuthorizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.ssooidc#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "AuthorizationPendingException": + case "com.amazonaws.ssooidc#AuthorizationPendingException": + throw await de_AuthorizationPendingExceptionRes(parsedOutput, context); + case "ExpiredTokenException": + case "com.amazonaws.ssooidc#ExpiredTokenException": + throw await de_ExpiredTokenExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.ssooidc#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "InvalidClientException": case "com.amazonaws.ssooidc#InvalidClientException": throw await de_InvalidClientExceptionRes(parsedOutput, context); + case "InvalidGrantException": + case "com.amazonaws.ssooidc#InvalidGrantException": + throw await de_InvalidGrantExceptionRes(parsedOutput, context); case "InvalidRequestException": case "com.amazonaws.ssooidc#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "InvalidScopeException": + case "com.amazonaws.ssooidc#InvalidScopeException": + throw await de_InvalidScopeExceptionRes(parsedOutput, context); case "SlowDownException": case "com.amazonaws.ssooidc#SlowDownException": throw await de_SlowDownExceptionRes(parsedOutput, context); case "UnauthorizedClientException": case "com.amazonaws.ssooidc#UnauthorizedClientException": throw await de_UnauthorizedClientExceptionRes(parsedOutput, context); + case "UnsupportedGrantTypeException": + case "com.amazonaws.ssooidc#UnsupportedGrantTypeException": + throw await de_UnsupportedGrantTypeExceptionRes(parsedOutput, context); + case "InvalidRequestRegionException": + case "com.amazonaws.ssooidc#InvalidRequestRegionException": + throw await de_InvalidRequestRegionExceptionRes(parsedOutput, context); + case "InvalidClientMetadataException": + case "com.amazonaws.ssooidc#InvalidClientMetadataException": + throw await de_InvalidClientMetadataExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-sso/src/protocols/Aws_restJson1.ts b/clients/client-sso/src/protocols/Aws_restJson1.ts index f42acb2a1c3c..d4dbe81ffe9a 100644 --- a/clients/client-sso/src/protocols/Aws_restJson1.ts +++ b/clients/client-sso/src/protocols/Aws_restJson1.ts @@ -117,7 +117,7 @@ export const de_GetRoleCredentialsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRoleCredentialsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -130,41 +130,6 @@ export const de_GetRoleCredentialsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRoleCredentialsCommandError - */ -const de_GetRoleCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.sso#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sso#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sso#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.sso#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAccountRolesCommand */ @@ -173,7 +138,7 @@ export const de_ListAccountRolesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccountRolesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -187,41 +152,6 @@ export const de_ListAccountRolesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAccountRolesCommandError - */ -const de_ListAccountRolesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.sso#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sso#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sso#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.sso#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAccountsCommand */ @@ -230,7 +160,7 @@ export const de_ListAccountsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccountsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -244,41 +174,6 @@ export const de_ListAccountsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAccountsCommandError - */ -const de_ListAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.sso#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.sso#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.sso#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.sso#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1LogoutCommand */ @@ -287,7 +182,7 @@ export const de_LogoutCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_LogoutCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -297,9 +192,9 @@ export const de_LogoutCommand = async ( }; /** - * deserializeAws_restJson1LogoutCommandError + * deserialize_Aws_restJson1CommandError */ -const de_LogoutCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -309,6 +204,9 @@ const de_LogoutCommandError = async (output: __HttpResponse, context: __SerdeCon case "InvalidRequestException": case "com.amazonaws.sso#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.sso#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.sso#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); @@ -321,7 +219,7 @@ const de_LogoutCommandError = async (output: __HttpResponse, context: __SerdeCon output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts b/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts index 25f355f839f3..c3ff41b1839d 100644 --- a/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts +++ b/clients/client-storage-gateway/src/protocols/Aws_json1_1.ts @@ -1560,7 +1560,7 @@ export const de_ActivateGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ActivateGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1572,35 +1572,6 @@ export const de_ActivateGatewayCommand = async ( return response; }; -/** - * deserializeAws_json1_1ActivateGatewayCommandError - */ -const de_ActivateGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddCacheCommand */ @@ -1609,7 +1580,7 @@ export const de_AddCacheCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddCacheCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1621,35 +1592,6 @@ export const de_AddCacheCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddCacheCommandError - */ -const de_AddCacheCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddTagsToResourceCommand */ @@ -1658,7 +1600,7 @@ export const de_AddTagsToResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddTagsToResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1670,35 +1612,6 @@ export const de_AddTagsToResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddTagsToResourceCommandError - */ -const de_AddTagsToResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddUploadBufferCommand */ @@ -1707,7 +1620,7 @@ export const de_AddUploadBufferCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddUploadBufferCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1719,35 +1632,6 @@ export const de_AddUploadBufferCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddUploadBufferCommandError - */ -const de_AddUploadBufferCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddWorkingStorageCommand */ @@ -1756,7 +1640,7 @@ export const de_AddWorkingStorageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddWorkingStorageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1768,35 +1652,6 @@ export const de_AddWorkingStorageCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddWorkingStorageCommandError - */ -const de_AddWorkingStorageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssignTapePoolCommand */ @@ -1805,7 +1660,7 @@ export const de_AssignTapePoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssignTapePoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1817,35 +1672,6 @@ export const de_AssignTapePoolCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssignTapePoolCommandError - */ -const de_AssignTapePoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateFileSystemCommand */ @@ -1854,7 +1680,7 @@ export const de_AssociateFileSystemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateFileSystemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1866,35 +1692,6 @@ export const de_AssociateFileSystemCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateFileSystemCommandError - */ -const de_AssociateFileSystemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AttachVolumeCommand */ @@ -1903,7 +1700,7 @@ export const de_AttachVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AttachVolumeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1915,35 +1712,6 @@ export const de_AttachVolumeCommand = async ( return response; }; -/** - * deserializeAws_json1_1AttachVolumeCommandError - */ -const de_AttachVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelArchivalCommand */ @@ -1952,7 +1720,7 @@ export const de_CancelArchivalCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelArchivalCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1965,48 +1733,39 @@ export const de_CancelArchivalCommand = async ( }; /** - * deserializeAws_json1_1CancelArchivalCommandError + * deserializeAws_json1_1CancelRetrievalCommand */ -const de_CancelArchivalCommandError = async ( +export const de_CancelRetrievalCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CancelRetrievalCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CancelRetrievalCommand + * deserializeAws_json1_1CreateCachediSCSIVolumeCommand */ -export const de_CancelRetrievalCommand = async ( +export const de_CreateCachediSCSIVolumeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CancelRetrievalCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CancelRetrievalCommandOutput = { + const response: CreateCachediSCSIVolumeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2014,92 +1773,14 @@ export const de_CancelRetrievalCommand = async ( }; /** - * deserializeAws_json1_1CancelRetrievalCommandError + * deserializeAws_json1_1CreateNFSFileShareCommand */ -const de_CancelRetrievalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateCachediSCSIVolumeCommand - */ -export const de_CreateCachediSCSIVolumeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateCachediSCSIVolumeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateCachediSCSIVolumeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateCachediSCSIVolumeCommandError - */ -const de_CreateCachediSCSIVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateNFSFileShareCommand - */ -export const de_CreateNFSFileShareCommand = async ( +export const de_CreateNFSFileShareCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateNFSFileShareCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2111,35 +1792,6 @@ export const de_CreateNFSFileShareCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateNFSFileShareCommandError - */ -const de_CreateNFSFileShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateSMBFileShareCommand */ @@ -2148,7 +1800,7 @@ export const de_CreateSMBFileShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSMBFileShareCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2160,35 +1812,6 @@ export const de_CreateSMBFileShareCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateSMBFileShareCommandError - */ -const de_CreateSMBFileShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateSnapshotCommand */ @@ -2197,7 +1820,7 @@ export const de_CreateSnapshotCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSnapshotCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2209,38 +1832,6 @@ export const de_CreateSnapshotCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateSnapshotCommandError - */ -const de_CreateSnapshotCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableError": - case "com.amazonaws.storagegateway#ServiceUnavailableError": - throw await de_ServiceUnavailableErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateSnapshotFromVolumeRecoveryPointCommand */ @@ -2249,7 +1840,7 @@ export const de_CreateSnapshotFromVolumeRecoveryPointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateSnapshotFromVolumeRecoveryPointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2261,38 +1852,6 @@ export const de_CreateSnapshotFromVolumeRecoveryPointCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateSnapshotFromVolumeRecoveryPointCommandError - */ -const de_CreateSnapshotFromVolumeRecoveryPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableError": - case "com.amazonaws.storagegateway#ServiceUnavailableError": - throw await de_ServiceUnavailableErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateStorediSCSIVolumeCommand */ @@ -2301,7 +1860,7 @@ export const de_CreateStorediSCSIVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateStorediSCSIVolumeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2313,35 +1872,6 @@ export const de_CreateStorediSCSIVolumeCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateStorediSCSIVolumeCommandError - */ -const de_CreateStorediSCSIVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTapePoolCommand */ @@ -2350,7 +1880,7 @@ export const de_CreateTapePoolCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTapePoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2362,35 +1892,6 @@ export const de_CreateTapePoolCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateTapePoolCommandError - */ -const de_CreateTapePoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTapesCommand */ @@ -2399,7 +1900,7 @@ export const de_CreateTapesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTapesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2411,35 +1912,6 @@ export const de_CreateTapesCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateTapesCommandError - */ -const de_CreateTapesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTapeWithBarcodeCommand */ @@ -2448,7 +1920,7 @@ export const de_CreateTapeWithBarcodeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTapeWithBarcodeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2461,43 +1933,14 @@ export const de_CreateTapeWithBarcodeCommand = async ( }; /** - * deserializeAws_json1_1CreateTapeWithBarcodeCommandError + * deserializeAws_json1_1DeleteAutomaticTapeCreationPolicyCommand */ -const de_CreateTapeWithBarcodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteAutomaticTapeCreationPolicyCommand - */ -export const de_DeleteAutomaticTapeCreationPolicyCommand = async ( +export const de_DeleteAutomaticTapeCreationPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAutomaticTapeCreationPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2509,35 +1952,6 @@ export const de_DeleteAutomaticTapeCreationPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAutomaticTapeCreationPolicyCommandError - */ -const de_DeleteAutomaticTapeCreationPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteBandwidthRateLimitCommand */ @@ -2546,7 +1960,7 @@ export const de_DeleteBandwidthRateLimitCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteBandwidthRateLimitCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2558,35 +1972,6 @@ export const de_DeleteBandwidthRateLimitCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteBandwidthRateLimitCommandError - */ -const de_DeleteBandwidthRateLimitCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteChapCredentialsCommand */ @@ -2595,7 +1980,7 @@ export const de_DeleteChapCredentialsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteChapCredentialsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2607,35 +1992,6 @@ export const de_DeleteChapCredentialsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteChapCredentialsCommandError - */ -const de_DeleteChapCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteFileShareCommand */ @@ -2644,7 +2000,7 @@ export const de_DeleteFileShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteFileShareCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2656,35 +2012,6 @@ export const de_DeleteFileShareCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteFileShareCommandError - */ -const de_DeleteFileShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteGatewayCommand */ @@ -2693,7 +2020,7 @@ export const de_DeleteGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2705,35 +2032,6 @@ export const de_DeleteGatewayCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteGatewayCommandError - */ -const de_DeleteGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteSnapshotScheduleCommand */ @@ -2742,7 +2040,7 @@ export const de_DeleteSnapshotScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSnapshotScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2754,35 +2052,6 @@ export const de_DeleteSnapshotScheduleCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteSnapshotScheduleCommandError - */ -const de_DeleteSnapshotScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteTapeCommand */ @@ -2791,7 +2060,7 @@ export const de_DeleteTapeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTapeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2803,35 +2072,6 @@ export const de_DeleteTapeCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteTapeCommandError - */ -const de_DeleteTapeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteTapeArchiveCommand */ @@ -2840,7 +2080,7 @@ export const de_DeleteTapeArchiveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTapeArchiveCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2853,48 +2093,39 @@ export const de_DeleteTapeArchiveCommand = async ( }; /** - * deserializeAws_json1_1DeleteTapeArchiveCommandError + * deserializeAws_json1_1DeleteTapePoolCommand */ -const de_DeleteTapeArchiveCommandError = async ( +export const de_DeleteTapePoolCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteTapePoolCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteTapePoolCommand + * deserializeAws_json1_1DeleteVolumeCommand */ -export const de_DeleteTapePoolCommand = async ( +export const de_DeleteVolumeCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteTapePoolCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteTapePoolCommandOutput = { + const response: DeleteVolumeCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2902,92 +2133,14 @@ export const de_DeleteTapePoolCommand = async ( }; /** - * deserializeAws_json1_1DeleteTapePoolCommandError + * deserializeAws_json1_1DescribeAvailabilityMonitorTestCommand */ -const de_DeleteTapePoolCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteVolumeCommand - */ -export const de_DeleteVolumeCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteVolumeCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteVolumeCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteVolumeCommandError - */ -const de_DeleteVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAvailabilityMonitorTestCommand - */ -export const de_DescribeAvailabilityMonitorTestCommand = async ( +export const de_DescribeAvailabilityMonitorTestCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAvailabilityMonitorTestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2999,35 +2152,6 @@ export const de_DescribeAvailabilityMonitorTestCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAvailabilityMonitorTestCommandError - */ -const de_DescribeAvailabilityMonitorTestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeBandwidthRateLimitCommand */ @@ -3036,7 +2160,7 @@ export const de_DescribeBandwidthRateLimitCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBandwidthRateLimitCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3048,35 +2172,6 @@ export const de_DescribeBandwidthRateLimitCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeBandwidthRateLimitCommandError - */ -const de_DescribeBandwidthRateLimitCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeBandwidthRateLimitScheduleCommand */ @@ -3085,7 +2180,7 @@ export const de_DescribeBandwidthRateLimitScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBandwidthRateLimitScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3097,35 +2192,6 @@ export const de_DescribeBandwidthRateLimitScheduleCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeBandwidthRateLimitScheduleCommandError - */ -const de_DescribeBandwidthRateLimitScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeCacheCommand */ @@ -3134,7 +2200,7 @@ export const de_DescribeCacheCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCacheCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3146,35 +2212,6 @@ export const de_DescribeCacheCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeCacheCommandError - */ -const de_DescribeCacheCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeCachediSCSIVolumesCommand */ @@ -3183,7 +2220,7 @@ export const de_DescribeCachediSCSIVolumesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCachediSCSIVolumesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3195,35 +2232,6 @@ export const de_DescribeCachediSCSIVolumesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeCachediSCSIVolumesCommandError - */ -const de_DescribeCachediSCSIVolumesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeChapCredentialsCommand */ @@ -3232,7 +2240,7 @@ export const de_DescribeChapCredentialsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeChapCredentialsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3244,35 +2252,6 @@ export const de_DescribeChapCredentialsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeChapCredentialsCommandError - */ -const de_DescribeChapCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeFileSystemAssociationsCommand */ @@ -3281,7 +2260,7 @@ export const de_DescribeFileSystemAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFileSystemAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3293,35 +2272,6 @@ export const de_DescribeFileSystemAssociationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeFileSystemAssociationsCommandError - */ -const de_DescribeFileSystemAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeGatewayInformationCommand */ @@ -3330,7 +2280,7 @@ export const de_DescribeGatewayInformationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeGatewayInformationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3343,43 +2293,14 @@ export const de_DescribeGatewayInformationCommand = async ( }; /** - * deserializeAws_json1_1DescribeGatewayInformationCommandError + * deserializeAws_json1_1DescribeMaintenanceStartTimeCommand */ -const de_DescribeGatewayInformationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeMaintenanceStartTimeCommand - */ -export const de_DescribeMaintenanceStartTimeCommand = async ( +export const de_DescribeMaintenanceStartTimeCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeMaintenanceStartTimeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3391,35 +2312,6 @@ export const de_DescribeMaintenanceStartTimeCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeMaintenanceStartTimeCommandError - */ -const de_DescribeMaintenanceStartTimeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeNFSFileSharesCommand */ @@ -3428,7 +2320,7 @@ export const de_DescribeNFSFileSharesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeNFSFileSharesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3440,35 +2332,6 @@ export const de_DescribeNFSFileSharesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeNFSFileSharesCommandError - */ -const de_DescribeNFSFileSharesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeSMBFileSharesCommand */ @@ -3477,7 +2340,7 @@ export const de_DescribeSMBFileSharesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSMBFileSharesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3489,35 +2352,6 @@ export const de_DescribeSMBFileSharesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeSMBFileSharesCommandError - */ -const de_DescribeSMBFileSharesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeSMBSettingsCommand */ @@ -3526,7 +2360,7 @@ export const de_DescribeSMBSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSMBSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3538,35 +2372,6 @@ export const de_DescribeSMBSettingsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeSMBSettingsCommandError - */ -const de_DescribeSMBSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeSnapshotScheduleCommand */ @@ -3575,7 +2380,7 @@ export const de_DescribeSnapshotScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSnapshotScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3587,35 +2392,6 @@ export const de_DescribeSnapshotScheduleCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeSnapshotScheduleCommandError - */ -const de_DescribeSnapshotScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeStorediSCSIVolumesCommand */ @@ -3624,7 +2400,7 @@ export const de_DescribeStorediSCSIVolumesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeStorediSCSIVolumesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3636,35 +2412,6 @@ export const de_DescribeStorediSCSIVolumesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeStorediSCSIVolumesCommandError - */ -const de_DescribeStorediSCSIVolumesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTapeArchivesCommand */ @@ -3673,7 +2420,7 @@ export const de_DescribeTapeArchivesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTapeArchivesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3685,35 +2432,6 @@ export const de_DescribeTapeArchivesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTapeArchivesCommandError - */ -const de_DescribeTapeArchivesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTapeRecoveryPointsCommand */ @@ -3722,7 +2440,7 @@ export const de_DescribeTapeRecoveryPointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTapeRecoveryPointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3735,48 +2453,39 @@ export const de_DescribeTapeRecoveryPointsCommand = async ( }; /** - * deserializeAws_json1_1DescribeTapeRecoveryPointsCommandError + * deserializeAws_json1_1DescribeTapesCommand */ -const de_DescribeTapeRecoveryPointsCommandError = async ( +export const de_DescribeTapesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeTapesOutput(data, context); + const response: DescribeTapesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeTapesCommand + * deserializeAws_json1_1DescribeUploadBufferCommand */ -export const de_DescribeTapesCommand = async ( +export const de_DescribeUploadBufferCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeTapesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeTapesOutput(data, context); - const response: DescribeTapesCommandOutput = { + contents = _json(data); + const response: DescribeUploadBufferCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3784,92 +2493,14 @@ export const de_DescribeTapesCommand = async ( }; /** - * deserializeAws_json1_1DescribeTapesCommandError + * deserializeAws_json1_1DescribeVTLDevicesCommand */ -const de_DescribeTapesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeUploadBufferCommand - */ -export const de_DescribeUploadBufferCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeUploadBufferCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeUploadBufferCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeUploadBufferCommandError - */ -const de_DescribeUploadBufferCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeVTLDevicesCommand - */ -export const de_DescribeVTLDevicesCommand = async ( +export const de_DescribeVTLDevicesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeVTLDevicesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3881,35 +2512,6 @@ export const de_DescribeVTLDevicesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeVTLDevicesCommandError - */ -const de_DescribeVTLDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeWorkingStorageCommand */ @@ -3918,7 +2520,7 @@ export const de_DescribeWorkingStorageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeWorkingStorageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3930,35 +2532,6 @@ export const de_DescribeWorkingStorageCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeWorkingStorageCommandError - */ -const de_DescribeWorkingStorageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DetachVolumeCommand */ @@ -3967,7 +2540,7 @@ export const de_DetachVolumeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetachVolumeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3979,35 +2552,6 @@ export const de_DetachVolumeCommand = async ( return response; }; -/** - * deserializeAws_json1_1DetachVolumeCommandError - */ -const de_DetachVolumeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisableGatewayCommand */ @@ -4016,7 +2560,7 @@ export const de_DisableGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisableGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4028,35 +2572,6 @@ export const de_DisableGatewayCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisableGatewayCommandError - */ -const de_DisableGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisassociateFileSystemCommand */ @@ -4065,7 +2580,7 @@ export const de_DisassociateFileSystemCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateFileSystemCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4077,35 +2592,6 @@ export const de_DisassociateFileSystemCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateFileSystemCommandError - */ -const de_DisassociateFileSystemCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1JoinDomainCommand */ @@ -4114,7 +2600,7 @@ export const de_JoinDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_JoinDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4126,35 +2612,6 @@ export const de_JoinDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_1JoinDomainCommandError - */ -const de_JoinDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAutomaticTapeCreationPoliciesCommand */ @@ -4163,7 +2620,7 @@ export const de_ListAutomaticTapeCreationPoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAutomaticTapeCreationPoliciesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4175,35 +2632,6 @@ export const de_ListAutomaticTapeCreationPoliciesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAutomaticTapeCreationPoliciesCommandError - */ -const de_ListAutomaticTapeCreationPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListFileSharesCommand */ @@ -4212,7 +2640,7 @@ export const de_ListFileSharesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListFileSharesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4225,43 +2653,14 @@ export const de_ListFileSharesCommand = async ( }; /** - * deserializeAws_json1_1ListFileSharesCommandError + * deserializeAws_json1_1ListFileSystemAssociationsCommand */ -const de_ListFileSharesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListFileSystemAssociationsCommand - */ -export const de_ListFileSystemAssociationsCommand = async ( +export const de_ListFileSystemAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListFileSystemAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4273,35 +2672,6 @@ export const de_ListFileSystemAssociationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListFileSystemAssociationsCommandError - */ -const de_ListFileSystemAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListGatewaysCommand */ @@ -4310,7 +2680,7 @@ export const de_ListGatewaysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListGatewaysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4322,35 +2692,6 @@ export const de_ListGatewaysCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListGatewaysCommandError - */ -const de_ListGatewaysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListLocalDisksCommand */ @@ -4359,7 +2700,7 @@ export const de_ListLocalDisksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListLocalDisksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4371,35 +2712,6 @@ export const de_ListLocalDisksCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListLocalDisksCommandError - */ -const de_ListLocalDisksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -4408,7 +2720,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4420,35 +2732,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTapePoolsCommand */ @@ -4457,7 +2740,7 @@ export const de_ListTapePoolsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTapePoolsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4469,35 +2752,6 @@ export const de_ListTapePoolsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTapePoolsCommandError - */ -const de_ListTapePoolsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTapesCommand */ @@ -4506,7 +2760,7 @@ export const de_ListTapesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTapesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4518,35 +2772,6 @@ export const de_ListTapesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTapesCommandError - */ -const de_ListTapesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListVolumeInitiatorsCommand */ @@ -4555,7 +2780,7 @@ export const de_ListVolumeInitiatorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListVolumeInitiatorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4567,35 +2792,6 @@ export const de_ListVolumeInitiatorsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListVolumeInitiatorsCommandError - */ -const de_ListVolumeInitiatorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListVolumeRecoveryPointsCommand */ @@ -4604,7 +2800,7 @@ export const de_ListVolumeRecoveryPointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListVolumeRecoveryPointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4616,35 +2812,6 @@ export const de_ListVolumeRecoveryPointsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListVolumeRecoveryPointsCommandError - */ -const de_ListVolumeRecoveryPointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListVolumesCommand */ @@ -4653,7 +2820,7 @@ export const de_ListVolumesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListVolumesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4665,35 +2832,6 @@ export const de_ListVolumesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListVolumesCommandError - */ -const de_ListVolumesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1NotifyWhenUploadedCommand */ @@ -4702,7 +2840,7 @@ export const de_NotifyWhenUploadedCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_NotifyWhenUploadedCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4714,35 +2852,6 @@ export const de_NotifyWhenUploadedCommand = async ( return response; }; -/** - * deserializeAws_json1_1NotifyWhenUploadedCommandError - */ -const de_NotifyWhenUploadedCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RefreshCacheCommand */ @@ -4751,7 +2860,7 @@ export const de_RefreshCacheCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RefreshCacheCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4763,35 +2872,6 @@ export const de_RefreshCacheCommand = async ( return response; }; -/** - * deserializeAws_json1_1RefreshCacheCommandError - */ -const de_RefreshCacheCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RemoveTagsFromResourceCommand */ @@ -4800,7 +2880,7 @@ export const de_RemoveTagsFromResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RemoveTagsFromResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4812,35 +2892,6 @@ export const de_RemoveTagsFromResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1RemoveTagsFromResourceCommandError - */ -const de_RemoveTagsFromResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ResetCacheCommand */ @@ -4849,7 +2900,7 @@ export const de_ResetCacheCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResetCacheCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4861,35 +2912,6 @@ export const de_ResetCacheCommand = async ( return response; }; -/** - * deserializeAws_json1_1ResetCacheCommandError - */ -const de_ResetCacheCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RetrieveTapeArchiveCommand */ @@ -4898,7 +2920,7 @@ export const de_RetrieveTapeArchiveCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RetrieveTapeArchiveCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4910,35 +2932,6 @@ export const de_RetrieveTapeArchiveCommand = async ( return response; }; -/** - * deserializeAws_json1_1RetrieveTapeArchiveCommandError - */ -const de_RetrieveTapeArchiveCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RetrieveTapeRecoveryPointCommand */ @@ -4947,7 +2940,7 @@ export const de_RetrieveTapeRecoveryPointCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RetrieveTapeRecoveryPointCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4959,35 +2952,6 @@ export const de_RetrieveTapeRecoveryPointCommand = async ( return response; }; -/** - * deserializeAws_json1_1RetrieveTapeRecoveryPointCommandError - */ -const de_RetrieveTapeRecoveryPointCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SetLocalConsolePasswordCommand */ @@ -4996,7 +2960,7 @@ export const de_SetLocalConsolePasswordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetLocalConsolePasswordCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5008,35 +2972,6 @@ export const de_SetLocalConsolePasswordCommand = async ( return response; }; -/** - * deserializeAws_json1_1SetLocalConsolePasswordCommandError - */ -const de_SetLocalConsolePasswordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1SetSMBGuestPasswordCommand */ @@ -5045,7 +2980,7 @@ export const de_SetSMBGuestPasswordCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SetSMBGuestPasswordCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5057,35 +2992,6 @@ export const de_SetSMBGuestPasswordCommand = async ( return response; }; -/** - * deserializeAws_json1_1SetSMBGuestPasswordCommandError - */ -const de_SetSMBGuestPasswordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ShutdownGatewayCommand */ @@ -5094,7 +3000,7 @@ export const de_ShutdownGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ShutdownGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5106,35 +3012,6 @@ export const de_ShutdownGatewayCommand = async ( return response; }; -/** - * deserializeAws_json1_1ShutdownGatewayCommandError - */ -const de_ShutdownGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartAvailabilityMonitorTestCommand */ @@ -5143,7 +3020,7 @@ export const de_StartAvailabilityMonitorTestCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartAvailabilityMonitorTestCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5155,35 +3032,6 @@ export const de_StartAvailabilityMonitorTestCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartAvailabilityMonitorTestCommandError - */ -const de_StartAvailabilityMonitorTestCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartGatewayCommand */ @@ -5192,7 +3040,7 @@ export const de_StartGatewayCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartGatewayCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5204,35 +3052,6 @@ export const de_StartGatewayCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartGatewayCommandError - */ -const de_StartGatewayCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateAutomaticTapeCreationPolicyCommand */ @@ -5241,7 +3060,7 @@ export const de_UpdateAutomaticTapeCreationPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateAutomaticTapeCreationPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5253,35 +3072,6 @@ export const de_UpdateAutomaticTapeCreationPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateAutomaticTapeCreationPolicyCommandError - */ -const de_UpdateAutomaticTapeCreationPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateBandwidthRateLimitCommand */ @@ -5290,7 +3080,7 @@ export const de_UpdateBandwidthRateLimitCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateBandwidthRateLimitCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5302,35 +3092,6 @@ export const de_UpdateBandwidthRateLimitCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateBandwidthRateLimitCommandError - */ -const de_UpdateBandwidthRateLimitCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateBandwidthRateLimitScheduleCommand */ @@ -5339,7 +3100,7 @@ export const de_UpdateBandwidthRateLimitScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateBandwidthRateLimitScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5351,35 +3112,6 @@ export const de_UpdateBandwidthRateLimitScheduleCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateBandwidthRateLimitScheduleCommandError - */ -const de_UpdateBandwidthRateLimitScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateChapCredentialsCommand */ @@ -5388,110 +3120,32 @@ export const de_UpdateChapCredentialsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateChapCredentialsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateChapCredentialsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateChapCredentialsCommandError - */ -const de_UpdateChapCredentialsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateFileSystemAssociationCommand - */ -export const de_UpdateFileSystemAssociationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateFileSystemAssociationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateFileSystemAssociationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateFileSystemAssociationCommandError - */ -const de_UpdateFileSystemAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const response: UpdateChapCredentialsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateGatewayInformationCommand + * deserializeAws_json1_1UpdateFileSystemAssociationCommand */ -export const de_UpdateGatewayInformationCommand = async ( +export const de_UpdateFileSystemAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateGatewayInformationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateGatewayInformationCommandOutput = { + const response: UpdateFileSystemAssociationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5499,32 +3153,23 @@ export const de_UpdateGatewayInformationCommand = async ( }; /** - * deserializeAws_json1_1UpdateGatewayInformationCommandError + * deserializeAws_json1_1UpdateGatewayInformationCommand */ -const de_UpdateGatewayInformationCommandError = async ( +export const de_UpdateGatewayInformationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateGatewayInformationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -5535,7 +3180,7 @@ export const de_UpdateGatewaySoftwareNowCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateGatewaySoftwareNowCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5547,35 +3192,6 @@ export const de_UpdateGatewaySoftwareNowCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateGatewaySoftwareNowCommandError - */ -const de_UpdateGatewaySoftwareNowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateMaintenanceStartTimeCommand */ @@ -5584,7 +3200,7 @@ export const de_UpdateMaintenanceStartTimeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateMaintenanceStartTimeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5596,35 +3212,6 @@ export const de_UpdateMaintenanceStartTimeCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateMaintenanceStartTimeCommandError - */ -const de_UpdateMaintenanceStartTimeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateNFSFileShareCommand */ @@ -5633,7 +3220,7 @@ export const de_UpdateNFSFileShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateNFSFileShareCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5645,35 +3232,6 @@ export const de_UpdateNFSFileShareCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateNFSFileShareCommandError - */ -const de_UpdateNFSFileShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSMBFileShareCommand */ @@ -5682,7 +3240,7 @@ export const de_UpdateSMBFileShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSMBFileShareCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5694,35 +3252,6 @@ export const de_UpdateSMBFileShareCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSMBFileShareCommandError - */ -const de_UpdateSMBFileShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSMBFileShareVisibilityCommand */ @@ -5731,7 +3260,7 @@ export const de_UpdateSMBFileShareVisibilityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSMBFileShareVisibilityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5743,35 +3272,6 @@ export const de_UpdateSMBFileShareVisibilityCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSMBFileShareVisibilityCommandError - */ -const de_UpdateSMBFileShareVisibilityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSMBLocalGroupsCommand */ @@ -5780,7 +3280,7 @@ export const de_UpdateSMBLocalGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSMBLocalGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5792,35 +3292,6 @@ export const de_UpdateSMBLocalGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSMBLocalGroupsCommandError - */ -const de_UpdateSMBLocalGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSMBSecurityStrategyCommand */ @@ -5829,7 +3300,7 @@ export const de_UpdateSMBSecurityStrategyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSMBSecurityStrategyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5841,35 +3312,6 @@ export const de_UpdateSMBSecurityStrategyCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSMBSecurityStrategyCommandError - */ -const de_UpdateSMBSecurityStrategyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSnapshotScheduleCommand */ @@ -5878,7 +3320,7 @@ export const de_UpdateSnapshotScheduleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSnapshotScheduleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5890,35 +3332,6 @@ export const de_UpdateSnapshotScheduleCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSnapshotScheduleCommandError - */ -const de_UpdateSnapshotScheduleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.storagegateway#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidGatewayRequestException": - case "com.amazonaws.storagegateway#InvalidGatewayRequestException": - throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateVTLDeviceTypeCommand */ @@ -5927,7 +3340,7 @@ export const de_UpdateVTLDeviceTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateVTLDeviceTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5940,12 +3353,9 @@ export const de_UpdateVTLDeviceTypeCommand = async ( }; /** - * deserializeAws_json1_1UpdateVTLDeviceTypeCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateVTLDeviceTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5958,13 +3368,16 @@ const de_UpdateVTLDeviceTypeCommandError = async ( case "InvalidGatewayRequestException": case "com.amazonaws.storagegateway#InvalidGatewayRequestException": throw await de_InvalidGatewayRequestExceptionRes(parsedOutput, context); + case "ServiceUnavailableError": + case "com.amazonaws.storagegateway#ServiceUnavailableError": + throw await de_ServiceUnavailableErrorRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-sts/src/protocols/Aws_query.ts b/clients/client-sts/src/protocols/Aws_query.ts index 4aedb0663cbe..9d10e65ef18b 100644 --- a/clients/client-sts/src/protocols/Aws_query.ts +++ b/clients/client-sts/src/protocols/Aws_query.ts @@ -211,7 +211,7 @@ export const de_AssumeRoleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssumeRoleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -223,41 +223,6 @@ export const de_AssumeRoleCommand = async ( return response; }; -/** - * deserializeAws_queryAssumeRoleCommandError - */ -const de_AssumeRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExpiredTokenException": - case "com.amazonaws.sts#ExpiredTokenException": - throw await de_ExpiredTokenExceptionRes(parsedOutput, context); - case "MalformedPolicyDocument": - case "com.amazonaws.sts#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "PackedPolicyTooLarge": - case "com.amazonaws.sts#PackedPolicyTooLargeException": - throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context); - case "RegionDisabledException": - case "com.amazonaws.sts#RegionDisabledException": - throw await de_RegionDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAssumeRoleWithSAMLCommand */ @@ -266,7 +231,7 @@ export const de_AssumeRoleWithSAMLCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssumeRoleWithSAMLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -278,47 +243,6 @@ export const de_AssumeRoleWithSAMLCommand = async ( return response; }; -/** - * deserializeAws_queryAssumeRoleWithSAMLCommandError - */ -const de_AssumeRoleWithSAMLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExpiredTokenException": - case "com.amazonaws.sts#ExpiredTokenException": - throw await de_ExpiredTokenExceptionRes(parsedOutput, context); - case "IDPRejectedClaim": - case "com.amazonaws.sts#IDPRejectedClaimException": - throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context); - case "InvalidIdentityToken": - case "com.amazonaws.sts#InvalidIdentityTokenException": - throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context); - case "MalformedPolicyDocument": - case "com.amazonaws.sts#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "PackedPolicyTooLarge": - case "com.amazonaws.sts#PackedPolicyTooLargeException": - throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context); - case "RegionDisabledException": - case "com.amazonaws.sts#RegionDisabledException": - throw await de_RegionDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryAssumeRoleWithWebIdentityCommand */ @@ -327,7 +251,7 @@ export const de_AssumeRoleWithWebIdentityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssumeRoleWithWebIdentityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -339,50 +263,6 @@ export const de_AssumeRoleWithWebIdentityCommand = async ( return response; }; -/** - * deserializeAws_queryAssumeRoleWithWebIdentityCommandError - */ -const de_AssumeRoleWithWebIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ExpiredTokenException": - case "com.amazonaws.sts#ExpiredTokenException": - throw await de_ExpiredTokenExceptionRes(parsedOutput, context); - case "IDPCommunicationError": - case "com.amazonaws.sts#IDPCommunicationErrorException": - throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context); - case "IDPRejectedClaim": - case "com.amazonaws.sts#IDPRejectedClaimException": - throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context); - case "InvalidIdentityToken": - case "com.amazonaws.sts#InvalidIdentityTokenException": - throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context); - case "MalformedPolicyDocument": - case "com.amazonaws.sts#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "PackedPolicyTooLarge": - case "com.amazonaws.sts#PackedPolicyTooLargeException": - throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context); - case "RegionDisabledException": - case "com.amazonaws.sts#RegionDisabledException": - throw await de_RegionDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryDecodeAuthorizationMessageCommand */ @@ -391,7 +271,7 @@ export const de_DecodeAuthorizationMessageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DecodeAuthorizationMessageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -403,32 +283,6 @@ export const de_DecodeAuthorizationMessageCommand = async ( return response; }; -/** - * deserializeAws_queryDecodeAuthorizationMessageCommandError - */ -const de_DecodeAuthorizationMessageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidAuthorizationMessageException": - case "com.amazonaws.sts#InvalidAuthorizationMessageException": - throw await de_InvalidAuthorizationMessageExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryGetAccessKeyInfoCommand */ @@ -437,7 +291,7 @@ export const de_GetAccessKeyInfoCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAccessKeyInfoCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -449,26 +303,6 @@ export const de_GetAccessKeyInfoCommand = async ( return response; }; -/** - * deserializeAws_queryGetAccessKeyInfoCommandError - */ -const de_GetAccessKeyInfoCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryGetCallerIdentityCommand */ @@ -477,7 +311,7 @@ export const de_GetCallerIdentityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCallerIdentityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -489,26 +323,6 @@ export const de_GetCallerIdentityCommand = async ( return response; }; -/** - * deserializeAws_queryGetCallerIdentityCommandError - */ -const de_GetCallerIdentityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryGetFederationTokenCommand */ @@ -517,7 +331,7 @@ export const de_GetFederationTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetFederationTokenCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -529,38 +343,6 @@ export const de_GetFederationTokenCommand = async ( return response; }; -/** - * deserializeAws_queryGetFederationTokenCommandError - */ -const de_GetFederationTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "MalformedPolicyDocument": - case "com.amazonaws.sts#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "PackedPolicyTooLarge": - case "com.amazonaws.sts#PackedPolicyTooLargeException": - throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context); - case "RegionDisabledException": - case "com.amazonaws.sts#RegionDisabledException": - throw await de_RegionDisabledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryGetSessionTokenCommand */ @@ -569,7 +351,7 @@ export const de_GetSessionTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSessionTokenCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -582,28 +364,46 @@ export const de_GetSessionTokenCommand = async ( }; /** - * deserializeAws_queryGetSessionTokenCommandError + * deserialize_Aws_queryCommandError */ -const de_GetSessionTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); switch (errorCode) { + case "ExpiredTokenException": + case "com.amazonaws.sts#ExpiredTokenException": + throw await de_ExpiredTokenExceptionRes(parsedOutput, context); + case "MalformedPolicyDocument": + case "com.amazonaws.sts#MalformedPolicyDocumentException": + throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); + case "PackedPolicyTooLarge": + case "com.amazonaws.sts#PackedPolicyTooLargeException": + throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context); case "RegionDisabledException": case "com.amazonaws.sts#RegionDisabledException": throw await de_RegionDisabledExceptionRes(parsedOutput, context); + case "IDPRejectedClaim": + case "com.amazonaws.sts#IDPRejectedClaimException": + throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context); + case "InvalidIdentityToken": + case "com.amazonaws.sts#InvalidIdentityTokenException": + throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context); + case "IDPCommunicationError": + case "com.amazonaws.sts#IDPCommunicationErrorException": + throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context); + case "InvalidAuthorizationMessageException": + case "com.amazonaws.sts#InvalidAuthorizationMessageException": + throw await de_InvalidAuthorizationMessageExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody: parsedBody.Error, errorCode, - }); + }) as never; } }; diff --git a/clients/client-supplychain/src/protocols/Aws_restJson1.ts b/clients/client-supplychain/src/protocols/Aws_restJson1.ts index 7e2ea0f207a6..cabf5ebc5bc0 100644 --- a/clients/client-supplychain/src/protocols/Aws_restJson1.ts +++ b/clients/client-supplychain/src/protocols/Aws_restJson1.ts @@ -88,7 +88,7 @@ export const de_CreateBillOfMaterialsImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBillOfMaterialsImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -101,50 +101,6 @@ export const de_CreateBillOfMaterialsImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateBillOfMaterialsImportJobCommandError - */ -const de_CreateBillOfMaterialsImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.supplychain#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.supplychain#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.supplychain#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.supplychain#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.supplychain#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.supplychain#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.supplychain#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetBillOfMaterialsImportJobCommand */ @@ -153,7 +109,7 @@ export const de_GetBillOfMaterialsImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBillOfMaterialsImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -167,12 +123,9 @@ export const de_GetBillOfMaterialsImportJobCommand = async ( }; /** - * deserializeAws_restJson1GetBillOfMaterialsImportJobCommandError + * deserialize_Aws_restJson1CommandError */ -const de_GetBillOfMaterialsImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -206,7 +159,7 @@ const de_GetBillOfMaterialsImportJobCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-support-app/src/protocols/Aws_restJson1.ts b/clients/client-support-app/src/protocols/Aws_restJson1.ts index e8ab902d0d06..5f4e49be2cac 100644 --- a/clients/client-support-app/src/protocols/Aws_restJson1.ts +++ b/clients/client-support-app/src/protocols/Aws_restJson1.ts @@ -295,7 +295,7 @@ export const de_CreateSlackChannelConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSlackChannelConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -304,44 +304,6 @@ export const de_CreateSlackChannelConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSlackChannelConfigurationCommandError - */ -const de_CreateSlackChannelConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.supportapp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.supportapp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.supportapp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.supportapp#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.supportapp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAccountAliasCommand */ @@ -350,7 +312,7 @@ export const de_DeleteAccountAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteAccountAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -359,38 +321,6 @@ export const de_DeleteAccountAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAccountAliasCommandError - */ -const de_DeleteAccountAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.supportapp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.supportapp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.supportapp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSlackChannelConfigurationCommand */ @@ -399,7 +329,7 @@ export const de_DeleteSlackChannelConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSlackChannelConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -408,44 +338,6 @@ export const de_DeleteSlackChannelConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSlackChannelConfigurationCommandError - */ -const de_DeleteSlackChannelConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.supportapp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.supportapp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.supportapp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.supportapp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.supportapp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSlackWorkspaceConfigurationCommand */ @@ -454,7 +346,7 @@ export const de_DeleteSlackWorkspaceConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSlackWorkspaceConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -463,44 +355,6 @@ export const de_DeleteSlackWorkspaceConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSlackWorkspaceConfigurationCommandError - */ -const de_DeleteSlackWorkspaceConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.supportapp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.supportapp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.supportapp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.supportapp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.supportapp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAccountAliasCommand */ @@ -509,7 +363,7 @@ export const de_GetAccountAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccountAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -522,32 +376,6 @@ export const de_GetAccountAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAccountAliasCommandError - */ -const de_GetAccountAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.supportapp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSlackChannelConfigurationsCommand */ @@ -556,7 +384,7 @@ export const de_ListSlackChannelConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSlackChannelConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -570,35 +398,6 @@ export const de_ListSlackChannelConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSlackChannelConfigurationsCommandError - */ -const de_ListSlackChannelConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.supportapp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.supportapp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSlackWorkspaceConfigurationsCommand */ @@ -607,7 +406,7 @@ export const de_ListSlackWorkspaceConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSlackWorkspaceConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -621,35 +420,6 @@ export const de_ListSlackWorkspaceConfigurationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSlackWorkspaceConfigurationsCommandError - */ -const de_ListSlackWorkspaceConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.supportapp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.supportapp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutAccountAliasCommand */ @@ -658,7 +428,7 @@ export const de_PutAccountAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAccountAliasCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -667,38 +437,6 @@ export const de_PutAccountAliasCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutAccountAliasCommandError - */ -const de_PutAccountAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.supportapp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.supportapp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.supportapp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RegisterSlackWorkspaceForOrganizationCommand */ @@ -707,7 +445,7 @@ export const de_RegisterSlackWorkspaceForOrganizationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterSlackWorkspaceForOrganizationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -722,44 +460,6 @@ export const de_RegisterSlackWorkspaceForOrganizationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RegisterSlackWorkspaceForOrganizationCommandError - */ -const de_RegisterSlackWorkspaceForOrganizationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.supportapp#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.supportapp#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.supportapp#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.supportapp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.supportapp#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSlackChannelConfigurationCommand */ @@ -768,7 +468,7 @@ export const de_UpdateSlackChannelConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSlackChannelConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -789,12 +489,9 @@ export const de_UpdateSlackChannelConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateSlackChannelConfigurationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateSlackChannelConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -810,19 +507,22 @@ const de_UpdateSlackChannelConfigurationCommandError = async ( case "InternalServerException": case "com.amazonaws.supportapp#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.supportapp#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.supportapp#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.supportapp#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.supportapp#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-support/src/protocols/Aws_json1_1.ts b/clients/client-support/src/protocols/Aws_json1_1.ts index 20a21ec9155f..4cb078e1a4cf 100644 --- a/clients/client-support/src/protocols/Aws_json1_1.ts +++ b/clients/client-support/src/protocols/Aws_json1_1.ts @@ -323,7 +323,7 @@ export const de_AddAttachmentsToSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddAttachmentsToSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -335,44 +335,6 @@ export const de_AddAttachmentsToSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddAttachmentsToSetCommandError - */ -const de_AddAttachmentsToSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AttachmentLimitExceeded": - case "com.amazonaws.support#AttachmentLimitExceeded": - throw await de_AttachmentLimitExceededRes(parsedOutput, context); - case "AttachmentSetExpired": - case "com.amazonaws.support#AttachmentSetExpired": - throw await de_AttachmentSetExpiredRes(parsedOutput, context); - case "AttachmentSetIdNotFound": - case "com.amazonaws.support#AttachmentSetIdNotFound": - throw await de_AttachmentSetIdNotFoundRes(parsedOutput, context); - case "AttachmentSetSizeLimitExceeded": - case "com.amazonaws.support#AttachmentSetSizeLimitExceeded": - throw await de_AttachmentSetSizeLimitExceededRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.support#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AddCommunicationToCaseCommand */ @@ -381,7 +343,7 @@ export const de_AddCommunicationToCaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AddCommunicationToCaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -393,41 +355,6 @@ export const de_AddCommunicationToCaseCommand = async ( return response; }; -/** - * deserializeAws_json1_1AddCommunicationToCaseCommandError - */ -const de_AddCommunicationToCaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AttachmentSetExpired": - case "com.amazonaws.support#AttachmentSetExpired": - throw await de_AttachmentSetExpiredRes(parsedOutput, context); - case "AttachmentSetIdNotFound": - case "com.amazonaws.support#AttachmentSetIdNotFound": - throw await de_AttachmentSetIdNotFoundRes(parsedOutput, context); - case "CaseIdNotFound": - case "com.amazonaws.support#CaseIdNotFound": - throw await de_CaseIdNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.support#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateCaseCommand */ @@ -436,7 +363,7 @@ export const de_CreateCaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -448,41 +375,6 @@ export const de_CreateCaseCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCaseCommandError - */ -const de_CreateCaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AttachmentSetExpired": - case "com.amazonaws.support#AttachmentSetExpired": - throw await de_AttachmentSetExpiredRes(parsedOutput, context); - case "AttachmentSetIdNotFound": - case "com.amazonaws.support#AttachmentSetIdNotFound": - throw await de_AttachmentSetIdNotFoundRes(parsedOutput, context); - case "CaseCreationLimitExceeded": - case "com.amazonaws.support#CaseCreationLimitExceeded": - throw await de_CaseCreationLimitExceededRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.support#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAttachmentCommand */ @@ -491,7 +383,7 @@ export const de_DescribeAttachmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAttachmentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -503,38 +395,6 @@ export const de_DescribeAttachmentCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAttachmentCommandError - */ -const de_DescribeAttachmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AttachmentIdNotFound": - case "com.amazonaws.support#AttachmentIdNotFound": - throw await de_AttachmentIdNotFoundRes(parsedOutput, context); - case "DescribeAttachmentLimitExceeded": - case "com.amazonaws.support#DescribeAttachmentLimitExceeded": - throw await de_DescribeAttachmentLimitExceededRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.support#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeCasesCommand */ @@ -543,7 +403,7 @@ export const de_DescribeCasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCasesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -555,35 +415,6 @@ export const de_DescribeCasesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeCasesCommandError - */ -const de_DescribeCasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CaseIdNotFound": - case "com.amazonaws.support#CaseIdNotFound": - throw await de_CaseIdNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.support#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeCommunicationsCommand */ @@ -592,7 +423,7 @@ export const de_DescribeCommunicationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCommunicationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -604,35 +435,6 @@ export const de_DescribeCommunicationsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeCommunicationsCommandError - */ -const de_DescribeCommunicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CaseIdNotFound": - case "com.amazonaws.support#CaseIdNotFound": - throw await de_CaseIdNotFoundRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.support#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeCreateCaseOptionsCommand */ @@ -641,7 +443,7 @@ export const de_DescribeCreateCaseOptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeCreateCaseOptionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -653,35 +455,6 @@ export const de_DescribeCreateCaseOptionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeCreateCaseOptionsCommandError - */ -const de_DescribeCreateCaseOptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.support#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.support#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeServicesCommand */ @@ -690,7 +463,7 @@ export const de_DescribeServicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeServicesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -702,32 +475,6 @@ export const de_DescribeServicesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeServicesCommandError - */ -const de_DescribeServicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.support#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeSeverityLevelsCommand */ @@ -736,7 +483,7 @@ export const de_DescribeSeverityLevelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSeverityLevelsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -748,32 +495,6 @@ export const de_DescribeSeverityLevelsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeSeverityLevelsCommandError - */ -const de_DescribeSeverityLevelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.support#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeSupportedLanguagesCommand */ @@ -782,7 +503,7 @@ export const de_DescribeSupportedLanguagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSupportedLanguagesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -794,35 +515,6 @@ export const de_DescribeSupportedLanguagesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeSupportedLanguagesCommandError - */ -const de_DescribeSupportedLanguagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.support#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.support#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommand */ @@ -831,7 +523,7 @@ export const de_DescribeTrustedAdvisorCheckRefreshStatusesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrustedAdvisorCheckRefreshStatusesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -843,35 +535,6 @@ export const de_DescribeTrustedAdvisorCheckRefreshStatusesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesCommandError - */ -const de_DescribeTrustedAdvisorCheckRefreshStatusesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.support#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.support#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTrustedAdvisorCheckResultCommand */ @@ -880,7 +543,7 @@ export const de_DescribeTrustedAdvisorCheckResultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrustedAdvisorCheckResultCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -892,35 +555,6 @@ export const de_DescribeTrustedAdvisorCheckResultCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTrustedAdvisorCheckResultCommandError - */ -const de_DescribeTrustedAdvisorCheckResultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.support#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.support#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTrustedAdvisorChecksCommand */ @@ -929,7 +563,7 @@ export const de_DescribeTrustedAdvisorChecksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrustedAdvisorChecksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -941,35 +575,6 @@ export const de_DescribeTrustedAdvisorChecksCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTrustedAdvisorChecksCommandError - */ -const de_DescribeTrustedAdvisorChecksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.support#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.support#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommand */ @@ -978,7 +583,7 @@ export const de_DescribeTrustedAdvisorCheckSummariesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTrustedAdvisorCheckSummariesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -990,35 +595,6 @@ export const de_DescribeTrustedAdvisorCheckSummariesCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTrustedAdvisorCheckSummariesCommandError - */ -const de_DescribeTrustedAdvisorCheckSummariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.support#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.support#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RefreshTrustedAdvisorCheckCommand */ @@ -1027,7 +603,7 @@ export const de_RefreshTrustedAdvisorCheckCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RefreshTrustedAdvisorCheckCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1039,32 +615,6 @@ export const de_RefreshTrustedAdvisorCheckCommand = async ( return response; }; -/** - * deserializeAws_json1_1RefreshTrustedAdvisorCheckCommandError - */ -const de_RefreshTrustedAdvisorCheckCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerError": - case "com.amazonaws.support#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ResolveCaseCommand */ @@ -1073,7 +623,7 @@ export const de_ResolveCaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResolveCaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1086,31 +636,52 @@ export const de_ResolveCaseCommand = async ( }; /** - * deserializeAws_json1_1ResolveCaseCommandError + * deserialize_Aws_json1_1CommandError */ -const de_ResolveCaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "CaseIdNotFound": - case "com.amazonaws.support#CaseIdNotFound": - throw await de_CaseIdNotFoundRes(parsedOutput, context); + case "AttachmentLimitExceeded": + case "com.amazonaws.support#AttachmentLimitExceeded": + throw await de_AttachmentLimitExceededRes(parsedOutput, context); + case "AttachmentSetExpired": + case "com.amazonaws.support#AttachmentSetExpired": + throw await de_AttachmentSetExpiredRes(parsedOutput, context); + case "AttachmentSetIdNotFound": + case "com.amazonaws.support#AttachmentSetIdNotFound": + throw await de_AttachmentSetIdNotFoundRes(parsedOutput, context); + case "AttachmentSetSizeLimitExceeded": + case "com.amazonaws.support#AttachmentSetSizeLimitExceeded": + throw await de_AttachmentSetSizeLimitExceededRes(parsedOutput, context); case "InternalServerError": case "com.amazonaws.support#InternalServerError": throw await de_InternalServerErrorRes(parsedOutput, context); + case "CaseIdNotFound": + case "com.amazonaws.support#CaseIdNotFound": + throw await de_CaseIdNotFoundRes(parsedOutput, context); + case "CaseCreationLimitExceeded": + case "com.amazonaws.support#CaseCreationLimitExceeded": + throw await de_CaseCreationLimitExceededRes(parsedOutput, context); + case "AttachmentIdNotFound": + case "com.amazonaws.support#AttachmentIdNotFound": + throw await de_AttachmentIdNotFoundRes(parsedOutput, context); + case "DescribeAttachmentLimitExceeded": + case "com.amazonaws.support#DescribeAttachmentLimitExceeded": + throw await de_DescribeAttachmentLimitExceededRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.support#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-swf/src/protocols/Aws_json1_0.ts b/clients/client-swf/src/protocols/Aws_json1_0.ts index b143bf67720a..2041b4feffba 100644 --- a/clients/client-swf/src/protocols/Aws_json1_0.ts +++ b/clients/client-swf/src/protocols/Aws_json1_0.ts @@ -717,7 +717,7 @@ export const de_CountClosedWorkflowExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CountClosedWorkflowExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -729,35 +729,6 @@ export const de_CountClosedWorkflowExecutionsCommand = async ( return response; }; -/** - * deserializeAws_json1_0CountClosedWorkflowExecutionsCommandError - */ -const de_CountClosedWorkflowExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CountOpenWorkflowExecutionsCommand */ @@ -766,7 +737,7 @@ export const de_CountOpenWorkflowExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CountOpenWorkflowExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -778,35 +749,6 @@ export const de_CountOpenWorkflowExecutionsCommand = async ( return response; }; -/** - * deserializeAws_json1_0CountOpenWorkflowExecutionsCommandError - */ -const de_CountOpenWorkflowExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CountPendingActivityTasksCommand */ @@ -815,7 +757,7 @@ export const de_CountPendingActivityTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CountPendingActivityTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -827,35 +769,6 @@ export const de_CountPendingActivityTasksCommand = async ( return response; }; -/** - * deserializeAws_json1_0CountPendingActivityTasksCommandError - */ -const de_CountPendingActivityTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CountPendingDecisionTasksCommand */ @@ -864,7 +777,7 @@ export const de_CountPendingDecisionTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CountPendingDecisionTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -876,35 +789,6 @@ export const de_CountPendingDecisionTasksCommand = async ( return response; }; -/** - * deserializeAws_json1_0CountPendingDecisionTasksCommandError - */ -const de_CountPendingDecisionTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeprecateActivityTypeCommand */ @@ -913,7 +797,7 @@ export const de_DeprecateActivityTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeprecateActivityTypeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeprecateActivityTypeCommandOutput = { @@ -922,38 +806,6 @@ export const de_DeprecateActivityTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeprecateActivityTypeCommandError - */ -const de_DeprecateActivityTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "TypeDeprecatedFault": - case "com.amazonaws.swf#TypeDeprecatedFault": - throw await de_TypeDeprecatedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeprecateDomainCommand */ @@ -962,7 +814,7 @@ export const de_DeprecateDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeprecateDomainCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeprecateDomainCommandOutput = { @@ -971,38 +823,6 @@ export const de_DeprecateDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeprecateDomainCommandError - */ -const de_DeprecateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DomainDeprecatedFault": - case "com.amazonaws.swf#DomainDeprecatedFault": - throw await de_DomainDeprecatedFaultRes(parsedOutput, context); - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeprecateWorkflowTypeCommand */ @@ -1011,7 +831,7 @@ export const de_DeprecateWorkflowTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeprecateWorkflowTypeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeprecateWorkflowTypeCommandOutput = { @@ -1020,38 +840,6 @@ export const de_DeprecateWorkflowTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeprecateWorkflowTypeCommandError - */ -const de_DeprecateWorkflowTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "TypeDeprecatedFault": - case "com.amazonaws.swf#TypeDeprecatedFault": - throw await de_TypeDeprecatedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeActivityTypeCommand */ @@ -1060,7 +848,7 @@ export const de_DescribeActivityTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeActivityTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1072,35 +860,6 @@ export const de_DescribeActivityTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeActivityTypeCommandError - */ -const de_DescribeActivityTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeDomainCommand */ @@ -1109,7 +868,7 @@ export const de_DescribeDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1121,35 +880,6 @@ export const de_DescribeDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeDomainCommandError - */ -const de_DescribeDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeWorkflowExecutionCommand */ @@ -1158,7 +888,7 @@ export const de_DescribeWorkflowExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeWorkflowExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1171,43 +901,14 @@ export const de_DescribeWorkflowExecutionCommand = async ( }; /** - * deserializeAws_json1_0DescribeWorkflowExecutionCommandError + * deserializeAws_json1_0DescribeWorkflowTypeCommand */ -const de_DescribeWorkflowExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeWorkflowTypeCommand - */ -export const de_DescribeWorkflowTypeCommand = async ( +export const de_DescribeWorkflowTypeCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeWorkflowTypeCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1219,35 +920,6 @@ export const de_DescribeWorkflowTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeWorkflowTypeCommandError - */ -const de_DescribeWorkflowTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetWorkflowExecutionHistoryCommand */ @@ -1256,7 +928,7 @@ export const de_GetWorkflowExecutionHistoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetWorkflowExecutionHistoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1268,35 +940,6 @@ export const de_GetWorkflowExecutionHistoryCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetWorkflowExecutionHistoryCommandError - */ -const de_GetWorkflowExecutionHistoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListActivityTypesCommand */ @@ -1305,7 +948,7 @@ export const de_ListActivityTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListActivityTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1317,35 +960,6 @@ export const de_ListActivityTypesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListActivityTypesCommandError - */ -const de_ListActivityTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListClosedWorkflowExecutionsCommand */ @@ -1354,7 +968,7 @@ export const de_ListClosedWorkflowExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListClosedWorkflowExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1366,35 +980,6 @@ export const de_ListClosedWorkflowExecutionsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListClosedWorkflowExecutionsCommandError - */ -const de_ListClosedWorkflowExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListDomainsCommand */ @@ -1403,7 +988,7 @@ export const de_ListDomainsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListDomainsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1415,32 +1000,6 @@ export const de_ListDomainsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListDomainsCommandError - */ -const de_ListDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListOpenWorkflowExecutionsCommand */ @@ -1449,7 +1008,7 @@ export const de_ListOpenWorkflowExecutionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListOpenWorkflowExecutionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1461,35 +1020,6 @@ export const de_ListOpenWorkflowExecutionsCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListOpenWorkflowExecutionsCommandError - */ -const de_ListOpenWorkflowExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListTagsForResourceCommand */ @@ -1498,7 +1028,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1510,38 +1040,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededFault": - case "com.amazonaws.swf#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListWorkflowTypesCommand */ @@ -1550,7 +1048,7 @@ export const de_ListWorkflowTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListWorkflowTypesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1562,35 +1060,6 @@ export const de_ListWorkflowTypesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListWorkflowTypesCommandError - */ -const de_ListWorkflowTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0PollForActivityTaskCommand */ @@ -1599,7 +1068,7 @@ export const de_PollForActivityTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PollForActivityTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1611,38 +1080,6 @@ export const de_PollForActivityTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_0PollForActivityTaskCommandError - */ -const de_PollForActivityTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededFault": - case "com.amazonaws.swf#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0PollForDecisionTaskCommand */ @@ -1651,7 +1088,7 @@ export const de_PollForDecisionTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PollForDecisionTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1664,46 +1101,14 @@ export const de_PollForDecisionTaskCommand = async ( }; /** - * deserializeAws_json1_0PollForDecisionTaskCommandError + * deserializeAws_json1_0RecordActivityTaskHeartbeatCommand */ -const de_PollForDecisionTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededFault": - case "com.amazonaws.swf#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0RecordActivityTaskHeartbeatCommand - */ -export const de_RecordActivityTaskHeartbeatCommand = async ( +export const de_RecordActivityTaskHeartbeatCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RecordActivityTaskHeartbeatCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1715,35 +1120,6 @@ export const de_RecordActivityTaskHeartbeatCommand = async ( return response; }; -/** - * deserializeAws_json1_0RecordActivityTaskHeartbeatCommandError - */ -const de_RecordActivityTaskHeartbeatCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0RegisterActivityTypeCommand */ @@ -1752,7 +1128,7 @@ export const de_RegisterActivityTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterActivityTypeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RegisterActivityTypeCommandOutput = { @@ -1761,41 +1137,6 @@ export const de_RegisterActivityTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_0RegisterActivityTypeCommandError - */ -const de_RegisterActivityTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededFault": - case "com.amazonaws.swf#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "TypeAlreadyExistsFault": - case "com.amazonaws.swf#TypeAlreadyExistsFault": - throw await de_TypeAlreadyExistsFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0RegisterDomainCommand */ @@ -1804,7 +1145,7 @@ export const de_RegisterDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterDomainCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RegisterDomainCommandOutput = { @@ -1813,41 +1154,6 @@ export const de_RegisterDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_0RegisterDomainCommandError - */ -const de_RegisterDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DomainAlreadyExistsFault": - case "com.amazonaws.swf#DomainAlreadyExistsFault": - throw await de_DomainAlreadyExistsFaultRes(parsedOutput, context); - case "LimitExceededFault": - case "com.amazonaws.swf#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "TooManyTagsFault": - case "com.amazonaws.swf#TooManyTagsFault": - throw await de_TooManyTagsFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0RegisterWorkflowTypeCommand */ @@ -1856,7 +1162,7 @@ export const de_RegisterWorkflowTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterWorkflowTypeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RegisterWorkflowTypeCommandOutput = { @@ -1865,41 +1171,6 @@ export const de_RegisterWorkflowTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_0RegisterWorkflowTypeCommandError - */ -const de_RegisterWorkflowTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededFault": - case "com.amazonaws.swf#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "TypeAlreadyExistsFault": - case "com.amazonaws.swf#TypeAlreadyExistsFault": - throw await de_TypeAlreadyExistsFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0RequestCancelWorkflowExecutionCommand */ @@ -1908,7 +1179,7 @@ export const de_RequestCancelWorkflowExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RequestCancelWorkflowExecutionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RequestCancelWorkflowExecutionCommandOutput = { @@ -1917,35 +1188,6 @@ export const de_RequestCancelWorkflowExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_0RequestCancelWorkflowExecutionCommandError - */ -const de_RequestCancelWorkflowExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0RespondActivityTaskCanceledCommand */ @@ -1954,7 +1196,7 @@ export const de_RespondActivityTaskCanceledCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RespondActivityTaskCanceledCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RespondActivityTaskCanceledCommandOutput = { @@ -1963,35 +1205,6 @@ export const de_RespondActivityTaskCanceledCommand = async ( return response; }; -/** - * deserializeAws_json1_0RespondActivityTaskCanceledCommandError - */ -const de_RespondActivityTaskCanceledCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0RespondActivityTaskCompletedCommand */ @@ -2000,7 +1213,7 @@ export const de_RespondActivityTaskCompletedCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RespondActivityTaskCompletedCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: RespondActivityTaskCompletedCommandOutput = { @@ -2009,171 +1222,55 @@ export const de_RespondActivityTaskCompletedCommand = async ( return response; }; -/** - * deserializeAws_json1_0RespondActivityTaskCompletedCommandError - */ -const de_RespondActivityTaskCompletedCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0RespondActivityTaskFailedCommand */ export const de_RespondActivityTaskFailedCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RespondActivityTaskFailedCommandError(output, context); - } - await collectBody(output.body, context); - const response: RespondActivityTaskFailedCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_0RespondActivityTaskFailedCommandError - */ -const de_RespondActivityTaskFailedCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0RespondDecisionTaskCompletedCommand - */ -export const de_RespondDecisionTaskCompletedCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RespondDecisionTaskCompletedCommandError(output, context); - } - await collectBody(output.body, context); - const response: RespondDecisionTaskCompletedCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_0RespondDecisionTaskCompletedCommandError - */ -const de_RespondDecisionTaskCompletedCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: RespondActivityTaskFailedCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_0SignalWorkflowExecutionCommand + * deserializeAws_json1_0RespondDecisionTaskCompletedCommand */ -export const de_SignalWorkflowExecutionCommand = async ( +export const de_RespondDecisionTaskCompletedCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SignalWorkflowExecutionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: SignalWorkflowExecutionCommandOutput = { + const response: RespondDecisionTaskCompletedCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_0SignalWorkflowExecutionCommandError + * deserializeAws_json1_0SignalWorkflowExecutionCommand */ -const de_SignalWorkflowExecutionCommandError = async ( +export const de_SignalWorkflowExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: SignalWorkflowExecutionCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** @@ -2184,7 +1281,7 @@ export const de_StartWorkflowExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartWorkflowExecutionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2196,47 +1293,6 @@ export const de_StartWorkflowExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_0StartWorkflowExecutionCommandError - */ -const de_StartWorkflowExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DefaultUndefinedFault": - case "com.amazonaws.swf#DefaultUndefinedFault": - throw await de_DefaultUndefinedFaultRes(parsedOutput, context); - case "LimitExceededFault": - case "com.amazonaws.swf#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "TypeDeprecatedFault": - case "com.amazonaws.swf#TypeDeprecatedFault": - throw await de_TypeDeprecatedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - case "WorkflowExecutionAlreadyStartedFault": - case "com.amazonaws.swf#WorkflowExecutionAlreadyStartedFault": - throw await de_WorkflowExecutionAlreadyStartedFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TagResourceCommand */ @@ -2245,7 +1301,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: TagResourceCommandOutput = { @@ -2254,41 +1310,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "LimitExceededFault": - case "com.amazonaws.swf#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "TooManyTagsFault": - case "com.amazonaws.swf#TooManyTagsFault": - throw await de_TooManyTagsFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TerminateWorkflowExecutionCommand */ @@ -2297,7 +1318,7 @@ export const de_TerminateWorkflowExecutionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TerminateWorkflowExecutionCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: TerminateWorkflowExecutionCommandOutput = { @@ -2306,35 +1327,6 @@ export const de_TerminateWorkflowExecutionCommand = async ( return response; }; -/** - * deserializeAws_json1_0TerminateWorkflowExecutionCommandError - */ -const de_TerminateWorkflowExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UndeprecateActivityTypeCommand */ @@ -2343,7 +1335,7 @@ export const de_UndeprecateActivityTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UndeprecateActivityTypeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UndeprecateActivityTypeCommandOutput = { @@ -2352,38 +1344,6 @@ export const de_UndeprecateActivityTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_0UndeprecateActivityTypeCommandError - */ -const de_UndeprecateActivityTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "TypeAlreadyExistsFault": - case "com.amazonaws.swf#TypeAlreadyExistsFault": - throw await de_TypeAlreadyExistsFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UndeprecateDomainCommand */ @@ -2392,7 +1352,7 @@ export const de_UndeprecateDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UndeprecateDomainCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UndeprecateDomainCommandOutput = { @@ -2401,38 +1361,6 @@ export const de_UndeprecateDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_0UndeprecateDomainCommandError - */ -const de_UndeprecateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DomainAlreadyExistsFault": - case "com.amazonaws.swf#DomainAlreadyExistsFault": - throw await de_DomainAlreadyExistsFaultRes(parsedOutput, context); - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UndeprecateWorkflowTypeCommand */ @@ -2441,7 +1369,7 @@ export const de_UndeprecateWorkflowTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UndeprecateWorkflowTypeCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UndeprecateWorkflowTypeCommandOutput = { @@ -2450,38 +1378,6 @@ export const de_UndeprecateWorkflowTypeCommand = async ( return response; }; -/** - * deserializeAws_json1_0UndeprecateWorkflowTypeCommandError - */ -const de_UndeprecateWorkflowTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotPermittedFault": - case "com.amazonaws.swf#OperationNotPermittedFault": - throw await de_OperationNotPermittedFaultRes(parsedOutput, context); - case "TypeAlreadyExistsFault": - case "com.amazonaws.swf#TypeAlreadyExistsFault": - throw await de_TypeAlreadyExistsFaultRes(parsedOutput, context); - case "UnknownResourceFault": - case "com.amazonaws.swf#UnknownResourceFault": - throw await de_UnknownResourceFaultRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UntagResourceCommand */ @@ -2490,7 +1386,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UntagResourceCommandOutput = { @@ -2500,34 +1396,52 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_0UntagResourceCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "LimitExceededFault": - case "com.amazonaws.swf#LimitExceededFault": - throw await de_LimitExceededFaultRes(parsedOutput, context); case "OperationNotPermittedFault": case "com.amazonaws.swf#OperationNotPermittedFault": throw await de_OperationNotPermittedFaultRes(parsedOutput, context); case "UnknownResourceFault": case "com.amazonaws.swf#UnknownResourceFault": throw await de_UnknownResourceFaultRes(parsedOutput, context); + case "TypeDeprecatedFault": + case "com.amazonaws.swf#TypeDeprecatedFault": + throw await de_TypeDeprecatedFaultRes(parsedOutput, context); + case "DomainDeprecatedFault": + case "com.amazonaws.swf#DomainDeprecatedFault": + throw await de_DomainDeprecatedFaultRes(parsedOutput, context); + case "LimitExceededFault": + case "com.amazonaws.swf#LimitExceededFault": + throw await de_LimitExceededFaultRes(parsedOutput, context); + case "TypeAlreadyExistsFault": + case "com.amazonaws.swf#TypeAlreadyExistsFault": + throw await de_TypeAlreadyExistsFaultRes(parsedOutput, context); + case "DomainAlreadyExistsFault": + case "com.amazonaws.swf#DomainAlreadyExistsFault": + throw await de_DomainAlreadyExistsFaultRes(parsedOutput, context); + case "TooManyTagsFault": + case "com.amazonaws.swf#TooManyTagsFault": + throw await de_TooManyTagsFaultRes(parsedOutput, context); + case "DefaultUndefinedFault": + case "com.amazonaws.swf#DefaultUndefinedFault": + throw await de_DefaultUndefinedFaultRes(parsedOutput, context); + case "WorkflowExecutionAlreadyStartedFault": + case "com.amazonaws.swf#WorkflowExecutionAlreadyStartedFault": + throw await de_WorkflowExecutionAlreadyStartedFaultRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-synthetics/src/protocols/Aws_restJson1.ts b/clients/client-synthetics/src/protocols/Aws_restJson1.ts index e733e2e21781..3bdd606b9ff9 100644 --- a/clients/client-synthetics/src/protocols/Aws_restJson1.ts +++ b/clients/client-synthetics/src/protocols/Aws_restJson1.ts @@ -557,7 +557,7 @@ export const de_AssociateResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -566,44 +566,6 @@ export const de_AssociateResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateResourceCommandError - */ -const de_AssociateResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.synthetics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.synthetics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.synthetics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCanaryCommand */ @@ -612,7 +574,7 @@ export const de_CreateCanaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCanaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -625,38 +587,6 @@ export const de_CreateCanaryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCanaryCommandError - */ -const de_CreateCanaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestEntityTooLargeException": - case "com.amazonaws.synthetics#RequestEntityTooLargeException": - throw await de_RequestEntityTooLargeExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateGroupCommand */ @@ -665,7 +595,7 @@ export const de_CreateGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -678,41 +608,6 @@ export const de_CreateGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGroupCommandError - */ -const de_CreateGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.synthetics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.synthetics#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteCanaryCommand */ @@ -721,7 +616,7 @@ export const de_DeleteCanaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCanaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -730,41 +625,6 @@ export const de_DeleteCanaryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteCanaryCommandError - */ -const de_DeleteCanaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.synthetics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.synthetics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteGroupCommand */ @@ -773,7 +633,7 @@ export const de_DeleteGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -782,41 +642,6 @@ export const de_DeleteGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteGroupCommandError - */ -const de_DeleteGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.synthetics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.synthetics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeCanariesCommand */ @@ -825,7 +650,7 @@ export const de_DescribeCanariesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeCanariesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -839,35 +664,6 @@ export const de_DescribeCanariesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeCanariesCommandError - */ -const de_DescribeCanariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeCanariesLastRunCommand */ @@ -876,7 +672,7 @@ export const de_DescribeCanariesLastRunCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeCanariesLastRunCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -890,35 +686,6 @@ export const de_DescribeCanariesLastRunCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeCanariesLastRunCommandError - */ -const de_DescribeCanariesLastRunCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeRuntimeVersionsCommand */ @@ -927,7 +694,7 @@ export const de_DescribeRuntimeVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRuntimeVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -941,35 +708,6 @@ export const de_DescribeRuntimeVersionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeRuntimeVersionsCommandError - */ -const de_DescribeRuntimeVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateResourceCommand */ @@ -978,7 +716,7 @@ export const de_DisassociateResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -987,41 +725,6 @@ export const de_DisassociateResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateResourceCommandError - */ -const de_DisassociateResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.synthetics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.synthetics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCanaryCommand */ @@ -1030,7 +733,7 @@ export const de_GetCanaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCanaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1043,35 +746,6 @@ export const de_GetCanaryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCanaryCommandError - */ -const de_GetCanaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetCanaryRunsCommand */ @@ -1080,7 +754,7 @@ export const de_GetCanaryRunsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCanaryRunsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1094,38 +768,6 @@ export const de_GetCanaryRunsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCanaryRunsCommandError - */ -const de_GetCanaryRunsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.synthetics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGroupCommand */ @@ -1134,7 +776,7 @@ export const de_GetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1147,41 +789,6 @@ export const de_GetGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetGroupCommandError - */ -const de_GetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.synthetics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.synthetics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssociatedGroupsCommand */ @@ -1190,50 +797,18 @@ export const de_ListAssociatedGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssociatedGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Groups: _json, - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAssociatedGroupsCommandError - */ -const de_ListAssociatedGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.synthetics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Groups: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1244,7 +819,7 @@ export const de_ListGroupResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGroupResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1258,41 +833,6 @@ export const de_ListGroupResourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListGroupResourcesCommandError - */ -const de_ListGroupResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.synthetics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.synthetics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListGroupsCommand */ @@ -1301,7 +841,7 @@ export const de_ListGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1315,35 +855,6 @@ export const de_ListGroupsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListGroupsCommandError - */ -const de_ListGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1352,7 +863,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1365,44 +876,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.synthetics#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.synthetics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.synthetics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.synthetics#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.synthetics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartCanaryCommand */ @@ -1411,7 +884,7 @@ export const de_StartCanaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartCanaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1420,41 +893,6 @@ export const de_StartCanaryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartCanaryCommandError - */ -const de_StartCanaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.synthetics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.synthetics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StopCanaryCommand */ @@ -1463,7 +901,7 @@ export const de_StopCanaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StopCanaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1472,41 +910,6 @@ export const de_StopCanaryCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StopCanaryCommandError - */ -const de_StopCanaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.synthetics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.synthetics#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.synthetics#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.synthetics#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1515,7 +918,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1524,44 +927,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.synthetics#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.synthetics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.synthetics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.synthetics#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.synthetics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1570,7 +935,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1579,44 +944,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.synthetics#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.synthetics#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.synthetics#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.synthetics#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.synthetics#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateCanaryCommand */ @@ -1625,7 +952,7 @@ export const de_UpdateCanaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCanaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1635,12 +962,9 @@ export const de_UpdateCanaryCommand = async ( }; /** - * deserializeAws_restJson1UpdateCanaryCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateCanaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1653,22 +977,37 @@ const de_UpdateCanaryCommandError = async ( case "InternalServerException": case "com.amazonaws.synthetics#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); - case "RequestEntityTooLargeException": - case "com.amazonaws.synthetics#RequestEntityTooLargeException": - throw await de_RequestEntityTooLargeExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.synthetics#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.synthetics#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.synthetics#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "RequestEntityTooLargeException": + case "com.amazonaws.synthetics#RequestEntityTooLargeException": + throw await de_RequestEntityTooLargeExceptionRes(parsedOutput, context); + case "BadRequestException": + case "com.amazonaws.synthetics#BadRequestException": + throw await de_BadRequestExceptionRes(parsedOutput, context); + case "InternalFailureException": + case "com.amazonaws.synthetics#InternalFailureException": + throw await de_InternalFailureExceptionRes(parsedOutput, context); + case "NotFoundException": + case "com.amazonaws.synthetics#NotFoundException": + throw await de_NotFoundExceptionRes(parsedOutput, context); + case "TooManyRequestsException": + case "com.amazonaws.synthetics#TooManyRequestsException": + throw await de_TooManyRequestsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-textract/src/protocols/Aws_json1_1.ts b/clients/client-textract/src/protocols/Aws_json1_1.ts index f5e8670384da..d39a60457e0a 100644 --- a/clients/client-textract/src/protocols/Aws_json1_1.ts +++ b/clients/client-textract/src/protocols/Aws_json1_1.ts @@ -514,7 +514,7 @@ export const de_AnalyzeDocumentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AnalyzeDocumentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -526,59 +526,6 @@ export const de_AnalyzeDocumentCommand = async ( return response; }; -/** - * deserializeAws_json1_1AnalyzeDocumentCommandError - */ -const de_AnalyzeDocumentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadDocumentException": - case "com.amazonaws.textract#BadDocumentException": - throw await de_BadDocumentExceptionRes(parsedOutput, context); - case "DocumentTooLargeException": - case "com.amazonaws.textract#DocumentTooLargeException": - throw await de_DocumentTooLargeExceptionRes(parsedOutput, context); - case "HumanLoopQuotaExceededException": - case "com.amazonaws.textract#HumanLoopQuotaExceededException": - throw await de_HumanLoopQuotaExceededExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.textract#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedDocumentException": - case "com.amazonaws.textract#UnsupportedDocumentException": - throw await de_UnsupportedDocumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AnalyzeExpenseCommand */ @@ -587,7 +534,7 @@ export const de_AnalyzeExpenseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AnalyzeExpenseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -599,56 +546,6 @@ export const de_AnalyzeExpenseCommand = async ( return response; }; -/** - * deserializeAws_json1_1AnalyzeExpenseCommandError - */ -const de_AnalyzeExpenseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadDocumentException": - case "com.amazonaws.textract#BadDocumentException": - throw await de_BadDocumentExceptionRes(parsedOutput, context); - case "DocumentTooLargeException": - case "com.amazonaws.textract#DocumentTooLargeException": - throw await de_DocumentTooLargeExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.textract#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedDocumentException": - case "com.amazonaws.textract#UnsupportedDocumentException": - throw await de_UnsupportedDocumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AnalyzeIDCommand */ @@ -657,7 +554,7 @@ export const de_AnalyzeIDCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AnalyzeIDCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -669,56 +566,6 @@ export const de_AnalyzeIDCommand = async ( return response; }; -/** - * deserializeAws_json1_1AnalyzeIDCommandError - */ -const de_AnalyzeIDCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadDocumentException": - case "com.amazonaws.textract#BadDocumentException": - throw await de_BadDocumentExceptionRes(parsedOutput, context); - case "DocumentTooLargeException": - case "com.amazonaws.textract#DocumentTooLargeException": - throw await de_DocumentTooLargeExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.textract#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedDocumentException": - case "com.amazonaws.textract#UnsupportedDocumentException": - throw await de_UnsupportedDocumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAdapterCommand */ @@ -727,7 +574,7 @@ export const de_CreateAdapterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAdapterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -739,59 +586,6 @@ export const de_CreateAdapterCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAdapterCommandError - */ -const de_CreateAdapterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.textract#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.textract#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.textract#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.textract#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.textract#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAdapterVersionCommand */ @@ -800,7 +594,7 @@ export const de_CreateAdapterVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAdapterVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -812,68 +606,6 @@ export const de_CreateAdapterVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAdapterVersionCommandError - */ -const de_CreateAdapterVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.textract#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.textract#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidKMSKeyException": - case "com.amazonaws.textract#InvalidKMSKeyException": - throw await de_InvalidKMSKeyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.textract#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.textract#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.textract#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.textract#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.textract#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteAdapterCommand */ @@ -882,7 +614,7 @@ export const de_DeleteAdapterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAdapterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -895,61 +627,14 @@ export const de_DeleteAdapterCommand = async ( }; /** - * deserializeAws_json1_1DeleteAdapterCommandError + * deserializeAws_json1_1DeleteAdapterVersionCommand */ -const de_DeleteAdapterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.textract#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.textract#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.textract#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteAdapterVersionCommand - */ -export const de_DeleteAdapterVersionCommand = async ( +export const de_DeleteAdapterVersionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteAdapterVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -961,53 +646,6 @@ export const de_DeleteAdapterVersionCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteAdapterVersionCommandError - */ -const de_DeleteAdapterVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.textract#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.textract#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.textract#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DetectDocumentTextCommand */ @@ -1016,7 +654,7 @@ export const de_DetectDocumentTextCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DetectDocumentTextCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1028,56 +666,6 @@ export const de_DetectDocumentTextCommand = async ( return response; }; -/** - * deserializeAws_json1_1DetectDocumentTextCommandError - */ -const de_DetectDocumentTextCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadDocumentException": - case "com.amazonaws.textract#BadDocumentException": - throw await de_BadDocumentExceptionRes(parsedOutput, context); - case "DocumentTooLargeException": - case "com.amazonaws.textract#DocumentTooLargeException": - throw await de_DocumentTooLargeExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.textract#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedDocumentException": - case "com.amazonaws.textract#UnsupportedDocumentException": - throw await de_UnsupportedDocumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetAdapterCommand */ @@ -1086,7 +674,7 @@ export const de_GetAdapterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetAdapterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1099,63 +687,39 @@ export const de_GetAdapterCommand = async ( }; /** - * deserializeAws_json1_1GetAdapterCommandError + * deserializeAws_json1_1GetAdapterVersionCommand */ -const de_GetAdapterCommandError = async ( +export const de_GetAdapterVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.textract#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.textract#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetAdapterVersionResponse(data, context); + const response: GetAdapterVersionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetAdapterVersionCommand + * deserializeAws_json1_1GetDocumentAnalysisCommand */ -export const de_GetAdapterVersionCommand = async ( +export const de_GetDocumentAnalysisCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetAdapterVersionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetAdapterVersionResponse(data, context); - const response: GetAdapterVersionCommandOutput = { + contents = de_GetDocumentAnalysisResponse(data, context); + const response: GetDocumentAnalysisCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1163,63 +727,39 @@ export const de_GetAdapterVersionCommand = async ( }; /** - * deserializeAws_json1_1GetAdapterVersionCommandError + * deserializeAws_json1_1GetDocumentTextDetectionCommand */ -const de_GetAdapterVersionCommandError = async ( +export const de_GetDocumentTextDetectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.textract#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.textract#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetDocumentTextDetectionResponse(data, context); + const response: GetDocumentTextDetectionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetDocumentAnalysisCommand + * deserializeAws_json1_1GetExpenseAnalysisCommand */ -export const de_GetDocumentAnalysisCommand = async ( +export const de_GetExpenseAnalysisCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetDocumentAnalysisCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetDocumentAnalysisResponse(data, context); - const response: GetDocumentAnalysisCommandOutput = { + contents = de_GetExpenseAnalysisResponse(data, context); + const response: GetExpenseAnalysisCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1227,195 +767,14 @@ export const de_GetDocumentAnalysisCommand = async ( }; /** - * deserializeAws_json1_1GetDocumentAnalysisCommandError + * deserializeAws_json1_1GetLendingAnalysisCommand */ -const de_GetDocumentAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidJobIdException": - case "com.amazonaws.textract#InvalidJobIdException": - throw await de_InvalidJobIdExceptionRes(parsedOutput, context); - case "InvalidKMSKeyException": - case "com.amazonaws.textract#InvalidKMSKeyException": - throw await de_InvalidKMSKeyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.textract#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDocumentTextDetectionCommand - */ -export const de_GetDocumentTextDetectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDocumentTextDetectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetDocumentTextDetectionResponse(data, context); - const response: GetDocumentTextDetectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDocumentTextDetectionCommandError - */ -const de_GetDocumentTextDetectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidJobIdException": - case "com.amazonaws.textract#InvalidJobIdException": - throw await de_InvalidJobIdExceptionRes(parsedOutput, context); - case "InvalidKMSKeyException": - case "com.amazonaws.textract#InvalidKMSKeyException": - throw await de_InvalidKMSKeyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.textract#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetExpenseAnalysisCommand - */ -export const de_GetExpenseAnalysisCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetExpenseAnalysisCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetExpenseAnalysisResponse(data, context); - const response: GetExpenseAnalysisCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetExpenseAnalysisCommandError - */ -const de_GetExpenseAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidJobIdException": - case "com.amazonaws.textract#InvalidJobIdException": - throw await de_InvalidJobIdExceptionRes(parsedOutput, context); - case "InvalidKMSKeyException": - case "com.amazonaws.textract#InvalidKMSKeyException": - throw await de_InvalidKMSKeyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.textract#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetLendingAnalysisCommand - */ -export const de_GetLendingAnalysisCommand = async ( +export const de_GetLendingAnalysisCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetLendingAnalysisCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1427,53 +786,6 @@ export const de_GetLendingAnalysisCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetLendingAnalysisCommandError - */ -const de_GetLendingAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidJobIdException": - case "com.amazonaws.textract#InvalidJobIdException": - throw await de_InvalidJobIdExceptionRes(parsedOutput, context); - case "InvalidKMSKeyException": - case "com.amazonaws.textract#InvalidKMSKeyException": - throw await de_InvalidKMSKeyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.textract#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetLendingAnalysisSummaryCommand */ @@ -1482,7 +794,7 @@ export const de_GetLendingAnalysisSummaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetLendingAnalysisSummaryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1494,53 +806,6 @@ export const de_GetLendingAnalysisSummaryCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetLendingAnalysisSummaryCommandError - */ -const de_GetLendingAnalysisSummaryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidJobIdException": - case "com.amazonaws.textract#InvalidJobIdException": - throw await de_InvalidJobIdExceptionRes(parsedOutput, context); - case "InvalidKMSKeyException": - case "com.amazonaws.textract#InvalidKMSKeyException": - throw await de_InvalidKMSKeyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.textract#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAdaptersCommand */ @@ -1549,7 +814,7 @@ export const de_ListAdaptersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAdaptersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1561,47 +826,6 @@ export const de_ListAdaptersCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAdaptersCommandError - */ -const de_ListAdaptersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.textract#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAdapterVersionsCommand */ @@ -1610,7 +834,7 @@ export const de_ListAdapterVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAdapterVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1622,50 +846,6 @@ export const de_ListAdapterVersionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAdapterVersionsCommandError - */ -const de_ListAdapterVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.textract#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.textract#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -1674,7 +854,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1686,50 +866,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.textract#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.textract#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartDocumentAnalysisCommand */ @@ -1738,170 +874,32 @@ export const de_StartDocumentAnalysisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartDocumentAnalysisCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); const response: StartDocumentAnalysisCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartDocumentAnalysisCommandError - */ -const de_StartDocumentAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadDocumentException": - case "com.amazonaws.textract#BadDocumentException": - throw await de_BadDocumentExceptionRes(parsedOutput, context); - case "DocumentTooLargeException": - case "com.amazonaws.textract#DocumentTooLargeException": - throw await de_DocumentTooLargeExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.textract#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidKMSKeyException": - case "com.amazonaws.textract#InvalidKMSKeyException": - throw await de_InvalidKMSKeyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.textract#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.textract#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedDocumentException": - case "com.amazonaws.textract#UnsupportedDocumentException": - throw await de_UnsupportedDocumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartDocumentTextDetectionCommand - */ -export const de_StartDocumentTextDetectionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartDocumentTextDetectionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: StartDocumentTextDetectionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartDocumentTextDetectionCommandError - */ -const de_StartDocumentTextDetectionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadDocumentException": - case "com.amazonaws.textract#BadDocumentException": - throw await de_BadDocumentExceptionRes(parsedOutput, context); - case "DocumentTooLargeException": - case "com.amazonaws.textract#DocumentTooLargeException": - throw await de_DocumentTooLargeExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.textract#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidKMSKeyException": - case "com.amazonaws.textract#InvalidKMSKeyException": - throw await de_InvalidKMSKeyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.textract#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.textract#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedDocumentException": - case "com.amazonaws.textract#UnsupportedDocumentException": - throw await de_UnsupportedDocumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartExpenseAnalysisCommand + * deserializeAws_json1_1StartDocumentTextDetectionCommand */ -export const de_StartExpenseAnalysisCommand = async ( +export const de_StartDocumentTextDetectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartExpenseAnalysisCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartExpenseAnalysisCommandOutput = { + const response: StartDocumentTextDetectionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1909,62 +907,23 @@ export const de_StartExpenseAnalysisCommand = async ( }; /** - * deserializeAws_json1_1StartExpenseAnalysisCommandError + * deserializeAws_json1_1StartExpenseAnalysisCommand */ -const de_StartExpenseAnalysisCommandError = async ( +export const de_StartExpenseAnalysisCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadDocumentException": - case "com.amazonaws.textract#BadDocumentException": - throw await de_BadDocumentExceptionRes(parsedOutput, context); - case "DocumentTooLargeException": - case "com.amazonaws.textract#DocumentTooLargeException": - throw await de_DocumentTooLargeExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.textract#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidKMSKeyException": - case "com.amazonaws.textract#InvalidKMSKeyException": - throw await de_InvalidKMSKeyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.textract#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.textract#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedDocumentException": - case "com.amazonaws.textract#UnsupportedDocumentException": - throw await de_UnsupportedDocumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartExpenseAnalysisCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1975,7 +934,7 @@ export const de_StartLendingAnalysisCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartLendingAnalysisCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1987,65 +946,6 @@ export const de_StartLendingAnalysisCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartLendingAnalysisCommandError - */ -const de_StartLendingAnalysisCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "BadDocumentException": - case "com.amazonaws.textract#BadDocumentException": - throw await de_BadDocumentExceptionRes(parsedOutput, context); - case "DocumentTooLargeException": - case "com.amazonaws.textract#DocumentTooLargeException": - throw await de_DocumentTooLargeExceptionRes(parsedOutput, context); - case "IdempotentParameterMismatchException": - case "com.amazonaws.textract#IdempotentParameterMismatchException": - throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidKMSKeyException": - case "com.amazonaws.textract#InvalidKMSKeyException": - throw await de_InvalidKMSKeyExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidS3ObjectException": - case "com.amazonaws.textract#InvalidS3ObjectException": - throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.textract#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "UnsupportedDocumentException": - case "com.amazonaws.textract#UnsupportedDocumentException": - throw await de_UnsupportedDocumentExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -2054,7 +954,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2066,53 +966,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.textract#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.textract#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.textract#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -2121,7 +974,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2133,50 +986,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.textract#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerError": - case "com.amazonaws.textract#InternalServerError": - throw await de_InternalServerErrorRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.textract#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "ProvisionedThroughputExceededException": - case "com.amazonaws.textract#ProvisionedThroughputExceededException": - throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.textract#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.textract#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.textract#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateAdapterCommand */ @@ -2185,7 +994,7 @@ export const de_UpdateAdapterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateAdapterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2198,12 +1007,9 @@ export const de_UpdateAdapterCommand = async ( }; /** - * deserializeAws_json1_1UpdateAdapterCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateAdapterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2213,34 +1019,64 @@ const de_UpdateAdapterCommandError = async ( case "AccessDeniedException": case "com.amazonaws.textract#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.textract#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); + case "BadDocumentException": + case "com.amazonaws.textract#BadDocumentException": + throw await de_BadDocumentExceptionRes(parsedOutput, context); + case "DocumentTooLargeException": + case "com.amazonaws.textract#DocumentTooLargeException": + throw await de_DocumentTooLargeExceptionRes(parsedOutput, context); + case "HumanLoopQuotaExceededException": + case "com.amazonaws.textract#HumanLoopQuotaExceededException": + throw await de_HumanLoopQuotaExceededExceptionRes(parsedOutput, context); case "InternalServerError": case "com.amazonaws.textract#InternalServerError": throw await de_InternalServerErrorRes(parsedOutput, context); case "InvalidParameterException": case "com.amazonaws.textract#InvalidParameterException": throw await de_InvalidParameterExceptionRes(parsedOutput, context); + case "InvalidS3ObjectException": + case "com.amazonaws.textract#InvalidS3ObjectException": + throw await de_InvalidS3ObjectExceptionRes(parsedOutput, context); case "ProvisionedThroughputExceededException": case "com.amazonaws.textract#ProvisionedThroughputExceededException": throw await de_ProvisionedThroughputExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.textract#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.textract#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "UnsupportedDocumentException": + case "com.amazonaws.textract#UnsupportedDocumentException": + throw await de_UnsupportedDocumentExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.textract#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "IdempotentParameterMismatchException": + case "com.amazonaws.textract#IdempotentParameterMismatchException": + throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.textract#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.textract#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.textract#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "InvalidKMSKeyException": + case "com.amazonaws.textract#InvalidKMSKeyException": + throw await de_InvalidKMSKeyExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.textract#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "InvalidJobIdException": + case "com.amazonaws.textract#InvalidJobIdException": + throw await de_InvalidJobIdExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-timestream-query/src/protocols/Aws_json1_0.ts b/clients/client-timestream-query/src/protocols/Aws_json1_0.ts index bfbd131671a5..ddae89849c5e 100644 --- a/clients/client-timestream-query/src/protocols/Aws_json1_0.ts +++ b/clients/client-timestream-query/src/protocols/Aws_json1_0.ts @@ -283,7 +283,7 @@ export const de_CancelQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelQueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -295,44 +295,6 @@ export const de_CancelQueryCommand = async ( return response; }; -/** - * deserializeAws_json1_0CancelQueryCommandError - */ -const de_CancelQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamquery#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamquery#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateScheduledQueryCommand */ @@ -341,7 +303,7 @@ export const de_CreateScheduledQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateScheduledQueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -353,50 +315,6 @@ export const de_CreateScheduledQueryCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateScheduledQueryCommandError - */ -const de_CreateScheduledQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamquery#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.timestreamquery#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamquery#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.timestreamquery#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteScheduledQueryCommand */ @@ -405,7 +323,7 @@ export const de_DeleteScheduledQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteScheduledQueryCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteScheduledQueryCommandOutput = { @@ -414,47 +332,6 @@ export const de_DeleteScheduledQueryCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteScheduledQueryCommandError - */ -const de_DeleteScheduledQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamquery#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamquery#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamquery#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeEndpointsCommand */ @@ -463,7 +340,7 @@ export const de_DescribeEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -475,38 +352,6 @@ export const de_DescribeEndpointsCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeEndpointsCommandError - */ -const de_DescribeEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.timestreamquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeScheduledQueryCommand */ @@ -515,7 +360,7 @@ export const de_DescribeScheduledQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeScheduledQueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -527,47 +372,6 @@ export const de_DescribeScheduledQueryCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeScheduledQueryCommandError - */ -const de_DescribeScheduledQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamquery#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamquery#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamquery#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ExecuteScheduledQueryCommand */ @@ -576,7 +380,7 @@ export const de_ExecuteScheduledQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ExecuteScheduledQueryCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: ExecuteScheduledQueryCommandOutput = { @@ -585,47 +389,6 @@ export const de_ExecuteScheduledQueryCommand = async ( return response; }; -/** - * deserializeAws_json1_0ExecuteScheduledQueryCommandError - */ -const de_ExecuteScheduledQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamquery#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamquery#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamquery#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListScheduledQueriesCommand */ @@ -634,7 +397,7 @@ export const de_ListScheduledQueriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListScheduledQueriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -646,44 +409,6 @@ export const de_ListScheduledQueriesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListScheduledQueriesCommandError - */ -const de_ListScheduledQueriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamquery#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamquery#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListTagsForResourceCommand */ @@ -692,7 +417,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -704,41 +429,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidEndpointException": - case "com.amazonaws.timestreamquery#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamquery#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0PrepareQueryCommand */ @@ -747,7 +437,7 @@ export const de_PrepareQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PrepareQueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -759,50 +449,12 @@ export const de_PrepareQueryCommand = async ( return response; }; -/** - * deserializeAws_json1_0PrepareQueryCommandError - */ -const de_PrepareQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamquery#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamquery#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0QueryCommand */ export const de_QueryCommand = async (output: __HttpResponse, context: __SerdeContext): Promise => { if (output.statusCode >= 300) { - return de_QueryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -814,47 +466,6 @@ export const de_QueryCommand = async (output: __HttpResponse, context: __SerdeCo return response; }; -/** - * deserializeAws_json1_0QueryCommandError - */ -const de_QueryCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamquery#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.timestreamquery#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamquery#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamquery#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "QueryExecutionException": - case "com.amazonaws.timestreamquery#QueryExecutionException": - throw await de_QueryExecutionExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TagResourceCommand */ @@ -863,7 +474,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -875,44 +486,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidEndpointException": - case "com.amazonaws.timestreamquery#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamquery#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.timestreamquery#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UntagResourceCommand */ @@ -921,7 +494,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -933,41 +506,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidEndpointException": - case "com.amazonaws.timestreamquery#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamquery#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamquery#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamquery#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateScheduledQueryCommand */ @@ -976,7 +514,7 @@ export const de_UpdateScheduledQueryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateScheduledQueryCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: UpdateScheduledQueryCommandOutput = { @@ -986,12 +524,9 @@ export const de_UpdateScheduledQueryCommand = async ( }; /** - * deserializeAws_json1_0UpdateScheduledQueryCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateScheduledQueryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1007,22 +542,31 @@ const de_UpdateScheduledQueryCommandError = async ( case "InvalidEndpointException": case "com.amazonaws.timestreamquery#InvalidEndpointException": throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamquery#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.timestreamquery#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.timestreamquery#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.timestreamquery#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.timestreamquery#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.timestreamquery#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "QueryExecutionException": + case "com.amazonaws.timestreamquery#QueryExecutionException": + throw await de_QueryExecutionExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-timestream-write/src/protocols/Aws_json1_0.ts b/clients/client-timestream-write/src/protocols/Aws_json1_0.ts index 3b6e3acbf918..8514d57f7df3 100644 --- a/clients/client-timestream-write/src/protocols/Aws_json1_0.ts +++ b/clients/client-timestream-write/src/protocols/Aws_json1_0.ts @@ -374,7 +374,7 @@ export const de_CreateBatchLoadTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateBatchLoadTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -386,53 +386,6 @@ export const de_CreateBatchLoadTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateBatchLoadTaskCommandError - */ -const de_CreateBatchLoadTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamwrite#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.timestreamwrite#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamwrite#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamwrite#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.timestreamwrite#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateDatabaseCommand */ @@ -441,7 +394,7 @@ export const de_CreateDatabaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDatabaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -453,50 +406,6 @@ export const de_CreateDatabaseCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateDatabaseCommandError - */ -const de_CreateDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamwrite#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.timestreamwrite#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamwrite#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.timestreamwrite#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateTableCommand */ @@ -505,7 +414,7 @@ export const de_CreateTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -517,53 +426,6 @@ export const de_CreateTableCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateTableCommandError - */ -const de_CreateTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamwrite#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.timestreamwrite#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamwrite#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamwrite#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.timestreamwrite#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteDatabaseCommand */ @@ -572,7 +434,7 @@ export const de_DeleteDatabaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDatabaseCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteDatabaseCommandOutput = { @@ -581,47 +443,6 @@ export const de_DeleteDatabaseCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteDatabaseCommandError - */ -const de_DeleteDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamwrite#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamwrite#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamwrite#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteTableCommand */ @@ -630,7 +451,7 @@ export const de_DeleteTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTableCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteTableCommandOutput = { @@ -639,47 +460,6 @@ export const de_DeleteTableCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteTableCommandError - */ -const de_DeleteTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamwrite#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamwrite#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamwrite#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeBatchLoadTaskCommand */ @@ -688,7 +468,7 @@ export const de_DescribeBatchLoadTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeBatchLoadTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -700,44 +480,6 @@ export const de_DescribeBatchLoadTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeBatchLoadTaskCommandError - */ -const de_DescribeBatchLoadTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamwrite#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamwrite#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamwrite#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeDatabaseCommand */ @@ -746,7 +488,7 @@ export const de_DescribeDatabaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeDatabaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -758,47 +500,6 @@ export const de_DescribeDatabaseCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeDatabaseCommandError - */ -const de_DescribeDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamwrite#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamwrite#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamwrite#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeEndpointsCommand */ @@ -807,7 +508,7 @@ export const de_DescribeEndpointsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeEndpointsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -819,38 +520,6 @@ export const de_DescribeEndpointsCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeEndpointsCommandError - */ -const de_DescribeEndpointsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.timestreamwrite#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeTableCommand */ @@ -859,7 +528,7 @@ export const de_DescribeTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -871,47 +540,6 @@ export const de_DescribeTableCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeTableCommandError - */ -const de_DescribeTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamwrite#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamwrite#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamwrite#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListBatchLoadTasksCommand */ @@ -920,7 +548,7 @@ export const de_ListBatchLoadTasksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListBatchLoadTasksCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -932,44 +560,6 @@ export const de_ListBatchLoadTasksCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListBatchLoadTasksCommandError - */ -const de_ListBatchLoadTasksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamwrite#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamwrite#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListDatabasesCommand */ @@ -977,132 +567,33 @@ export const de_ListDatabasesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - if (output.statusCode >= 300) { - return de_ListDatabasesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDatabasesResponse(data, context); - const response: ListDatabasesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListDatabasesCommandError - */ -const de_ListDatabasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamwrite#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamwrite#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListTablesCommand - */ -export const de_ListTablesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTablesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListTablesResponse(data, context); - const response: ListTablesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListTablesCommandError - */ -const de_ListTablesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamwrite#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamwrite#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamwrite#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListDatabasesResponse(data, context); + const response: ListDatabasesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListTagsForResourceCommand + * deserializeAws_json1_0ListTablesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListTablesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_ListTablesResponse(data, context); + const response: ListTablesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1110,38 +601,23 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_0ListTagsForResourceCommandError + * deserializeAws_json1_0ListTagsForResourceCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamwrite#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1152,7 +628,7 @@ export const de_ResumeBatchLoadTaskCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ResumeBatchLoadTaskCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1164,47 +640,6 @@ export const de_ResumeBatchLoadTaskCommand = async ( return response; }; -/** - * deserializeAws_json1_0ResumeBatchLoadTaskCommandError - */ -const de_ResumeBatchLoadTaskCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamwrite#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamwrite#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamwrite#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TagResourceCommand */ @@ -1213,7 +648,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1225,44 +660,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamwrite#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.timestreamwrite#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UntagResourceCommand */ @@ -1271,7 +668,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1283,44 +680,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamwrite#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.timestreamwrite#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateDatabaseCommand */ @@ -1329,7 +688,7 @@ export const de_UpdateDatabaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDatabaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1341,50 +700,6 @@ export const de_UpdateDatabaseCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateDatabaseCommandError - */ -const de_UpdateDatabaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamwrite#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamwrite#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamwrite#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.timestreamwrite#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateTableCommand */ @@ -1393,7 +708,7 @@ export const de_UpdateTableCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateTableCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1405,47 +720,6 @@ export const de_UpdateTableCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateTableCommandError - */ -const de_UpdateTableCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.timestreamwrite#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.timestreamwrite#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidEndpointException": - case "com.amazonaws.timestreamwrite#InvalidEndpointException": - throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.timestreamwrite#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.timestreamwrite#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.timestreamwrite#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0WriteRecordsCommand */ @@ -1454,7 +728,7 @@ export const de_WriteRecordsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_WriteRecordsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1467,12 +741,9 @@ export const de_WriteRecordsCommand = async ( }; /** - * deserializeAws_json1_0WriteRecordsCommandError + * deserialize_Aws_json1_0CommandError */ -const de_WriteRecordsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1482,31 +753,37 @@ const de_WriteRecordsCommandError = async ( case "AccessDeniedException": case "com.amazonaws.timestreamwrite#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.timestreamwrite#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.timestreamwrite#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "InvalidEndpointException": case "com.amazonaws.timestreamwrite#InvalidEndpointException": throw await de_InvalidEndpointExceptionRes(parsedOutput, context); - case "RejectedRecordsException": - case "com.amazonaws.timestreamwrite#RejectedRecordsException": - throw await de_RejectedRecordsExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.timestreamwrite#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.timestreamwrite#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.timestreamwrite#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.timestreamwrite#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "RejectedRecordsException": + case "com.amazonaws.timestreamwrite#RejectedRecordsException": + throw await de_RejectedRecordsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-tnb/src/protocols/Aws_restJson1.ts b/clients/client-tnb/src/protocols/Aws_restJson1.ts index 91f88e0ebabf..3111fd617381 100644 --- a/clients/client-tnb/src/protocols/Aws_restJson1.ts +++ b/clients/client-tnb/src/protocols/Aws_restJson1.ts @@ -827,7 +827,7 @@ export const de_CancelSolNetworkOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_CancelSolNetworkOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -836,44 +836,6 @@ export const de_CancelSolNetworkOperationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CancelSolNetworkOperationCommandError - */ -const de_CancelSolNetworkOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSolFunctionPackageCommand */ @@ -882,7 +844,7 @@ export const de_CreateSolFunctionPackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSolFunctionPackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -900,44 +862,6 @@ export const de_CreateSolFunctionPackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSolFunctionPackageCommandError - */ -const de_CreateSolFunctionPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.tnb#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSolNetworkInstanceCommand */ @@ -946,7 +870,7 @@ export const de_CreateSolNetworkInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSolNetworkInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -963,47 +887,6 @@ export const de_CreateSolNetworkInstanceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSolNetworkInstanceCommandError - */ -const de_CreateSolNetworkInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.tnb#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSolNetworkPackageCommand */ @@ -1012,7 +895,7 @@ export const de_CreateSolNetworkPackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateSolNetworkPackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1030,44 +913,6 @@ export const de_CreateSolNetworkPackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSolNetworkPackageCommandError - */ -const de_CreateSolNetworkPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.tnb#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSolFunctionPackageCommand */ @@ -1076,7 +921,7 @@ export const de_DeleteSolFunctionPackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSolFunctionPackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1085,44 +930,6 @@ export const de_DeleteSolFunctionPackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSolFunctionPackageCommandError - */ -const de_DeleteSolFunctionPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSolNetworkInstanceCommand */ @@ -1131,7 +938,7 @@ export const de_DeleteSolNetworkInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSolNetworkInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1140,44 +947,6 @@ export const de_DeleteSolNetworkInstanceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSolNetworkInstanceCommandError - */ -const de_DeleteSolNetworkInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSolNetworkPackageCommand */ @@ -1186,7 +955,7 @@ export const de_DeleteSolNetworkPackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteSolNetworkPackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1195,44 +964,6 @@ export const de_DeleteSolNetworkPackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSolNetworkPackageCommandError - */ -const de_DeleteSolNetworkPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSolFunctionInstanceCommand */ @@ -1241,7 +972,7 @@ export const de_GetSolFunctionInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSolFunctionInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1265,44 +996,6 @@ export const de_GetSolFunctionInstanceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSolFunctionInstanceCommandError - */ -const de_GetSolFunctionInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSolFunctionPackageCommand */ @@ -1311,7 +1004,7 @@ export const de_GetSolFunctionPackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSolFunctionPackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1334,44 +1027,6 @@ export const de_GetSolFunctionPackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSolFunctionPackageCommandError - */ -const de_GetSolFunctionPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSolFunctionPackageContentCommand */ @@ -1380,7 +1035,7 @@ export const de_GetSolFunctionPackageContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSolFunctionPackageContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1391,44 +1046,6 @@ export const de_GetSolFunctionPackageContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSolFunctionPackageContentCommandError - */ -const de_GetSolFunctionPackageContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSolFunctionPackageDescriptorCommand */ @@ -1437,53 +1054,15 @@ export const de_GetSolFunctionPackageDescriptorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSolFunctionPackageDescriptorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), [_cT]: [, output.headers[_ct]], }); - const data: any = await collectBody(output.body, context); - contents.vnfd = data; - return contents; -}; - -/** - * deserializeAws_restJson1GetSolFunctionPackageDescriptorCommandError - */ -const de_GetSolFunctionPackageDescriptorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const data: any = await collectBody(output.body, context); + contents.vnfd = data; + return contents; }; /** @@ -1494,7 +1073,7 @@ export const de_GetSolNetworkInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSolNetworkInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1516,44 +1095,6 @@ export const de_GetSolNetworkInstanceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSolNetworkInstanceCommandError - */ -const de_GetSolNetworkInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSolNetworkOperationCommand */ @@ -1562,7 +1103,7 @@ export const de_GetSolNetworkOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSolNetworkOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1583,44 +1124,6 @@ export const de_GetSolNetworkOperationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSolNetworkOperationCommandError - */ -const de_GetSolNetworkOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSolNetworkPackageCommand */ @@ -1629,7 +1132,7 @@ export const de_GetSolNetworkPackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSolNetworkPackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1652,44 +1155,6 @@ export const de_GetSolNetworkPackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSolNetworkPackageCommandError - */ -const de_GetSolNetworkPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSolNetworkPackageContentCommand */ @@ -1698,7 +1163,7 @@ export const de_GetSolNetworkPackageContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSolNetworkPackageContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1709,44 +1174,6 @@ export const de_GetSolNetworkPackageContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSolNetworkPackageContentCommandError - */ -const de_GetSolNetworkPackageContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSolNetworkPackageDescriptorCommand */ @@ -1755,7 +1182,7 @@ export const de_GetSolNetworkPackageDescriptorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSolNetworkPackageDescriptorCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1766,44 +1193,6 @@ export const de_GetSolNetworkPackageDescriptorCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSolNetworkPackageDescriptorCommandError - */ -const de_GetSolNetworkPackageDescriptorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1InstantiateSolNetworkInstanceCommand */ @@ -1812,7 +1201,7 @@ export const de_InstantiateSolNetworkInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_InstantiateSolNetworkInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1826,47 +1215,6 @@ export const de_InstantiateSolNetworkInstanceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1InstantiateSolNetworkInstanceCommandError - */ -const de_InstantiateSolNetworkInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.tnb#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSolFunctionInstancesCommand */ @@ -1875,53 +1223,18 @@ export const de_ListSolFunctionInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSolFunctionInstancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - functionInstances: (_) => de_ListSolFunctionInstanceResources(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListSolFunctionInstancesCommandError - */ -const de_ListSolFunctionInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + functionInstances: (_) => de_ListSolFunctionInstanceResources(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1932,7 +1245,7 @@ export const de_ListSolFunctionPackagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSolFunctionPackagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1946,41 +1259,6 @@ export const de_ListSolFunctionPackagesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSolFunctionPackagesCommandError - */ -const de_ListSolFunctionPackagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSolNetworkInstancesCommand */ @@ -1989,7 +1267,7 @@ export const de_ListSolNetworkInstancesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSolNetworkInstancesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2003,41 +1281,6 @@ export const de_ListSolNetworkInstancesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSolNetworkInstancesCommandError - */ -const de_ListSolNetworkInstancesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSolNetworkOperationsCommand */ @@ -2046,7 +1289,7 @@ export const de_ListSolNetworkOperationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSolNetworkOperationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2060,41 +1303,6 @@ export const de_ListSolNetworkOperationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSolNetworkOperationsCommandError - */ -const de_ListSolNetworkOperationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListSolNetworkPackagesCommand */ @@ -2103,7 +1311,7 @@ export const de_ListSolNetworkPackagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSolNetworkPackagesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2117,41 +1325,6 @@ export const de_ListSolNetworkPackagesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSolNetworkPackagesCommandError - */ -const de_ListSolNetworkPackagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -2160,7 +1333,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2173,44 +1346,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutSolFunctionPackageContentCommand */ @@ -2219,7 +1354,7 @@ export const de_PutSolFunctionPackageContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_PutSolFunctionPackageContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2237,44 +1372,6 @@ export const de_PutSolFunctionPackageContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutSolFunctionPackageContentCommandError - */ -const de_PutSolFunctionPackageContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutSolNetworkPackageContentCommand */ @@ -2283,7 +1380,7 @@ export const de_PutSolNetworkPackageContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutSolNetworkPackageContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2302,97 +1399,21 @@ export const de_PutSolNetworkPackageContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutSolNetworkPackageContentCommandError - */ -const de_PutSolNetworkPackageContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -2403,7 +1424,7 @@ export const de_TerminateSolNetworkInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_TerminateSolNetworkInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2417,47 +1438,6 @@ export const de_TerminateSolNetworkInstanceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TerminateSolNetworkInstanceCommandError - */ -const de_TerminateSolNetworkInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.tnb#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2466,7 +1446,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2475,44 +1455,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSolFunctionPackageCommand */ @@ -2521,7 +1463,7 @@ export const de_UpdateSolFunctionPackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSolFunctionPackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2534,44 +1476,6 @@ export const de_UpdateSolFunctionPackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSolFunctionPackageCommandError - */ -const de_UpdateSolFunctionPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSolNetworkInstanceCommand */ @@ -2580,7 +1484,7 @@ export const de_UpdateSolNetworkInstanceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_UpdateSolNetworkInstanceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2594,47 +1498,6 @@ export const de_UpdateSolNetworkInstanceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSolNetworkInstanceCommandError - */ -const de_UpdateSolNetworkInstanceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.tnb#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSolNetworkPackageCommand */ @@ -2643,7 +1506,7 @@ export const de_UpdateSolNetworkPackageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSolNetworkPackageCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2656,44 +1519,6 @@ export const de_UpdateSolNetworkPackageCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateSolNetworkPackageCommandError - */ -const de_UpdateSolNetworkPackageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ValidateSolFunctionPackageContentCommand */ @@ -2702,7 +1527,7 @@ export const de_ValidateSolFunctionPackageContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_ValidateSolFunctionPackageContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2720,44 +1545,6 @@ export const de_ValidateSolFunctionPackageContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ValidateSolFunctionPackageContentCommandError - */ -const de_ValidateSolFunctionPackageContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.tnb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.tnb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.tnb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.tnb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.tnb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ValidateSolNetworkPackageContentCommand */ @@ -2766,7 +1553,7 @@ export const de_ValidateSolNetworkPackageContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ValidateSolNetworkPackageContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2786,12 +1573,9 @@ export const de_ValidateSolNetworkPackageContentCommand = async ( }; /** - * deserializeAws_restJson1ValidateSolNetworkPackageContentCommandError + * deserialize_Aws_restJson1CommandError */ -const de_ValidateSolNetworkPackageContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2813,13 +1597,16 @@ const de_ValidateSolNetworkPackageContentCommandError = async ( case "ValidationException": case "com.amazonaws.tnb#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.tnb#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts b/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts index 3c4ad5451501..008b3f259232 100644 --- a/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts +++ b/clients/client-transcribe-streaming/src/protocols/Aws_restJson1.ts @@ -181,7 +181,7 @@ export const de_StartCallAnalyticsStreamTranscriptionCommand = async ( context: __SerdeContext & __EventStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartCallAnalyticsStreamTranscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -205,44 +205,6 @@ export const de_StartCallAnalyticsStreamTranscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartCallAnalyticsStreamTranscriptionCommandError - */ -const de_StartCallAnalyticsStreamTranscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribestreaming#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribestreaming#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribestreaming#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribestreaming#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transcribestreaming#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartMedicalStreamTranscriptionCommand */ @@ -251,7 +213,7 @@ export const de_StartMedicalStreamTranscriptionCommand = async ( context: __SerdeContext & __EventStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartMedicalStreamTranscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -273,44 +235,6 @@ export const de_StartMedicalStreamTranscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartMedicalStreamTranscriptionCommandError - */ -const de_StartMedicalStreamTranscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribestreaming#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribestreaming#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribestreaming#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribestreaming#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transcribestreaming#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartStreamTranscriptionCommand */ @@ -319,7 +243,7 @@ export const de_StartStreamTranscriptionCommand = async ( context: __SerdeContext & __EventStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartStreamTranscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -353,12 +277,9 @@ export const de_StartStreamTranscriptionCommand = async ( }; /** - * deserializeAws_restJson1StartStreamTranscriptionCommandError + * deserialize_Aws_restJson1CommandError */ -const de_StartStreamTranscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -386,7 +307,7 @@ const de_StartStreamTranscriptionCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-transcribe/src/protocols/Aws_json1_1.ts b/clients/client-transcribe/src/protocols/Aws_json1_1.ts index b235565a7417..a0742f01dfc5 100644 --- a/clients/client-transcribe/src/protocols/Aws_json1_1.ts +++ b/clients/client-transcribe/src/protocols/Aws_json1_1.ts @@ -859,7 +859,7 @@ export const de_CreateCallAnalyticsCategoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateCallAnalyticsCategoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -871,41 +871,6 @@ export const de_CreateCallAnalyticsCategoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateCallAnalyticsCategoryCommandError - */ -const de_CreateCallAnalyticsCategoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribe#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateLanguageModelCommand */ @@ -914,7 +879,7 @@ export const de_CreateLanguageModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateLanguageModelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -926,41 +891,6 @@ export const de_CreateLanguageModelCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateLanguageModelCommandError - */ -const de_CreateLanguageModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribe#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateMedicalVocabularyCommand */ @@ -969,7 +899,7 @@ export const de_CreateMedicalVocabularyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateMedicalVocabularyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -981,41 +911,6 @@ export const de_CreateMedicalVocabularyCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateMedicalVocabularyCommandError - */ -const de_CreateMedicalVocabularyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribe#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateVocabularyCommand */ @@ -1024,7 +919,7 @@ export const de_CreateVocabularyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVocabularyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1036,41 +931,6 @@ export const de_CreateVocabularyCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateVocabularyCommandError - */ -const de_CreateVocabularyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribe#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateVocabularyFilterCommand */ @@ -1079,7 +939,7 @@ export const de_CreateVocabularyFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateVocabularyFilterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1091,41 +951,6 @@ export const de_CreateVocabularyFilterCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateVocabularyFilterCommandError - */ -const de_CreateVocabularyFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribe#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteCallAnalyticsCategoryCommand */ @@ -1134,7 +959,7 @@ export const de_DeleteCallAnalyticsCategoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCallAnalyticsCategoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1146,41 +971,6 @@ export const de_DeleteCallAnalyticsCategoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteCallAnalyticsCategoryCommandError - */ -const de_DeleteCallAnalyticsCategoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteCallAnalyticsJobCommand */ @@ -1189,7 +979,7 @@ export const de_DeleteCallAnalyticsJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteCallAnalyticsJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1201,38 +991,6 @@ export const de_DeleteCallAnalyticsJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteCallAnalyticsJobCommandError - */ -const de_DeleteCallAnalyticsJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteLanguageModelCommand */ @@ -1241,7 +999,7 @@ export const de_DeleteLanguageModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLanguageModelCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteLanguageModelCommandOutput = { @@ -1250,38 +1008,6 @@ export const de_DeleteLanguageModelCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteLanguageModelCommandError - */ -const de_DeleteLanguageModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteMedicalScribeJobCommand */ @@ -1290,7 +1016,7 @@ export const de_DeleteMedicalScribeJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteMedicalScribeJobCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteMedicalScribeJobCommandOutput = { @@ -1300,46 +1026,14 @@ export const de_DeleteMedicalScribeJobCommand = async ( }; /** - * deserializeAws_json1_1DeleteMedicalScribeJobCommandError + * deserializeAws_json1_1DeleteMedicalTranscriptionJobCommand */ -const de_DeleteMedicalScribeJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteMedicalTranscriptionJobCommand - */ -export const de_DeleteMedicalTranscriptionJobCommand = async ( +export const de_DeleteMedicalTranscriptionJobCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteMedicalTranscriptionJobCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteMedicalTranscriptionJobCommandOutput = { @@ -1348,38 +1042,6 @@ export const de_DeleteMedicalTranscriptionJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteMedicalTranscriptionJobCommandError - */ -const de_DeleteMedicalTranscriptionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteMedicalVocabularyCommand */ @@ -1388,7 +1050,7 @@ export const de_DeleteMedicalVocabularyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteMedicalVocabularyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteMedicalVocabularyCommandOutput = { @@ -1397,41 +1059,6 @@ export const de_DeleteMedicalVocabularyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteMedicalVocabularyCommandError - */ -const de_DeleteMedicalVocabularyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteTranscriptionJobCommand */ @@ -1440,7 +1067,7 @@ export const de_DeleteTranscriptionJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTranscriptionJobCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteTranscriptionJobCommandOutput = { @@ -1449,38 +1076,6 @@ export const de_DeleteTranscriptionJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteTranscriptionJobCommandError - */ -const de_DeleteTranscriptionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteVocabularyCommand */ @@ -1489,7 +1084,7 @@ export const de_DeleteVocabularyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVocabularyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteVocabularyCommandOutput = { @@ -1498,41 +1093,6 @@ export const de_DeleteVocabularyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteVocabularyCommandError - */ -const de_DeleteVocabularyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteVocabularyFilterCommand */ @@ -1541,7 +1101,7 @@ export const de_DeleteVocabularyFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteVocabularyFilterCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteVocabularyFilterCommandOutput = { @@ -1550,41 +1110,6 @@ export const de_DeleteVocabularyFilterCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteVocabularyFilterCommandError - */ -const de_DeleteVocabularyFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeLanguageModelCommand */ @@ -1593,7 +1118,7 @@ export const de_DescribeLanguageModelCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeLanguageModelCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1605,41 +1130,6 @@ export const de_DescribeLanguageModelCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeLanguageModelCommandError - */ -const de_DescribeLanguageModelCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetCallAnalyticsCategoryCommand */ @@ -1648,7 +1138,7 @@ export const de_GetCallAnalyticsCategoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCallAnalyticsCategoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1660,41 +1150,6 @@ export const de_GetCallAnalyticsCategoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCallAnalyticsCategoryCommandError - */ -const de_GetCallAnalyticsCategoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetCallAnalyticsJobCommand */ @@ -1703,7 +1158,7 @@ export const de_GetCallAnalyticsJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetCallAnalyticsJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1715,41 +1170,6 @@ export const de_GetCallAnalyticsJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetCallAnalyticsJobCommandError - */ -const de_GetCallAnalyticsJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetMedicalScribeJobCommand */ @@ -1758,7 +1178,7 @@ export const de_GetMedicalScribeJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetMedicalScribeJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1770,41 +1190,6 @@ export const de_GetMedicalScribeJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetMedicalScribeJobCommandError - */ -const de_GetMedicalScribeJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetMedicalTranscriptionJobCommand */ @@ -1813,51 +1198,16 @@ export const de_GetMedicalTranscriptionJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetMedicalTranscriptionJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetMedicalTranscriptionJobResponse(data, context); - const response: GetMedicalTranscriptionJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetMedicalTranscriptionJobCommandError - */ -const de_GetMedicalTranscriptionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetMedicalTranscriptionJobResponse(data, context); + const response: GetMedicalTranscriptionJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1868,7 +1218,7 @@ export const de_GetMedicalVocabularyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetMedicalVocabularyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1880,41 +1230,6 @@ export const de_GetMedicalVocabularyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetMedicalVocabularyCommandError - */ -const de_GetMedicalVocabularyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetTranscriptionJobCommand */ @@ -1923,7 +1238,7 @@ export const de_GetTranscriptionJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTranscriptionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1935,41 +1250,6 @@ export const de_GetTranscriptionJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetTranscriptionJobCommandError - */ -const de_GetTranscriptionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetVocabularyCommand */ @@ -1978,7 +1258,7 @@ export const de_GetVocabularyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetVocabularyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1990,41 +1270,6 @@ export const de_GetVocabularyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetVocabularyCommandError - */ -const de_GetVocabularyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetVocabularyFilterCommand */ @@ -2033,7 +1278,7 @@ export const de_GetVocabularyFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetVocabularyFilterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2045,41 +1290,6 @@ export const de_GetVocabularyFilterCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetVocabularyFilterCommandError - */ -const de_GetVocabularyFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListCallAnalyticsCategoriesCommand */ @@ -2088,7 +1298,7 @@ export const de_ListCallAnalyticsCategoriesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListCallAnalyticsCategoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2100,38 +1310,6 @@ export const de_ListCallAnalyticsCategoriesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListCallAnalyticsCategoriesCommandError - */ -const de_ListCallAnalyticsCategoriesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListCallAnalyticsJobsCommand */ @@ -2140,7 +1318,7 @@ export const de_ListCallAnalyticsJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListCallAnalyticsJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2152,38 +1330,6 @@ export const de_ListCallAnalyticsJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListCallAnalyticsJobsCommandError - */ -const de_ListCallAnalyticsJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListLanguageModelsCommand */ @@ -2192,7 +1338,7 @@ export const de_ListLanguageModelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListLanguageModelsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2204,38 +1350,6 @@ export const de_ListLanguageModelsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListLanguageModelsCommandError - */ -const de_ListLanguageModelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListMedicalScribeJobsCommand */ @@ -2244,48 +1358,16 @@ export const de_ListMedicalScribeJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListMedicalScribeJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = de_ListMedicalScribeJobsResponse(data, context); const response: ListMedicalScribeJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListMedicalScribeJobsCommandError - */ -const de_ListMedicalScribeJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2296,7 +1378,7 @@ export const de_ListMedicalTranscriptionJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListMedicalTranscriptionJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2308,38 +1390,6 @@ export const de_ListMedicalTranscriptionJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListMedicalTranscriptionJobsCommandError - */ -const de_ListMedicalTranscriptionJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListMedicalVocabulariesCommand */ @@ -2348,7 +1398,7 @@ export const de_ListMedicalVocabulariesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListMedicalVocabulariesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2360,38 +1410,6 @@ export const de_ListMedicalVocabulariesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListMedicalVocabulariesCommandError - */ -const de_ListMedicalVocabulariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -2400,7 +1418,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2412,41 +1430,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTranscriptionJobsCommand */ @@ -2455,7 +1438,7 @@ export const de_ListTranscriptionJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTranscriptionJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2467,38 +1450,6 @@ export const de_ListTranscriptionJobsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTranscriptionJobsCommandError - */ -const de_ListTranscriptionJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListVocabulariesCommand */ @@ -2507,7 +1458,7 @@ export const de_ListVocabulariesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListVocabulariesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2519,38 +1470,6 @@ export const de_ListVocabulariesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListVocabulariesCommandError - */ -const de_ListVocabulariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListVocabularyFiltersCommand */ @@ -2559,7 +1478,7 @@ export const de_ListVocabularyFiltersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListVocabularyFiltersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2571,38 +1490,6 @@ export const de_ListVocabularyFiltersCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListVocabularyFiltersCommandError - */ -const de_ListVocabularyFiltersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartCallAnalyticsJobCommand */ @@ -2611,7 +1498,7 @@ export const de_StartCallAnalyticsJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartCallAnalyticsJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2623,94 +1510,24 @@ export const de_StartCallAnalyticsJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartCallAnalyticsJobCommandError - */ -const de_StartCallAnalyticsJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribe#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartMedicalScribeJobCommand */ export const de_StartMedicalScribeJobCommand = async ( output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_StartMedicalScribeJobCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_StartMedicalScribeJobResponse(data, context); - const response: StartMedicalScribeJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1StartMedicalScribeJobCommandError - */ -const de_StartMedicalScribeJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribe#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_StartMedicalScribeJobResponse(data, context); + const response: StartMedicalScribeJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -2721,7 +1538,7 @@ export const de_StartMedicalTranscriptionJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartMedicalTranscriptionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2733,41 +1550,6 @@ export const de_StartMedicalTranscriptionJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartMedicalTranscriptionJobCommandError - */ -const de_StartMedicalTranscriptionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribe#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartTranscriptionJobCommand */ @@ -2776,7 +1558,7 @@ export const de_StartTranscriptionJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartTranscriptionJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2788,41 +1570,6 @@ export const de_StartTranscriptionJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartTranscriptionJobCommandError - */ -const de_StartTranscriptionJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribe#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -2831,7 +1578,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2843,44 +1590,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribe#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -2889,7 +1598,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2901,44 +1610,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribe#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateCallAnalyticsCategoryCommand */ @@ -2947,7 +1618,7 @@ export const de_UpdateCallAnalyticsCategoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateCallAnalyticsCategoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2959,44 +1630,6 @@ export const de_UpdateCallAnalyticsCategoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateCallAnalyticsCategoryCommandError - */ -const de_UpdateCallAnalyticsCategoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribe#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateMedicalVocabularyCommand */ @@ -3005,7 +1638,7 @@ export const de_UpdateMedicalVocabularyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateMedicalVocabularyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3017,44 +1650,6 @@ export const de_UpdateMedicalVocabularyCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateMedicalVocabularyCommandError - */ -const de_UpdateMedicalVocabularyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribe#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateVocabularyCommand */ @@ -3063,7 +1658,7 @@ export const de_UpdateVocabularyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateVocabularyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3075,44 +1670,6 @@ export const de_UpdateVocabularyCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateVocabularyCommandError - */ -const de_UpdateVocabularyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "BadRequestException": - case "com.amazonaws.transcribe#BadRequestException": - throw await de_BadRequestExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transcribe#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.transcribe#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.transcribe#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NotFoundException": - case "com.amazonaws.transcribe#NotFoundException": - throw await de_NotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateVocabularyFilterCommand */ @@ -3121,7 +1678,7 @@ export const de_UpdateVocabularyFilterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateVocabularyFilterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3134,12 +1691,9 @@ export const de_UpdateVocabularyFilterCommand = async ( }; /** - * deserializeAws_json1_1UpdateVocabularyFilterCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateVocabularyFilterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3149,6 +1703,9 @@ const de_UpdateVocabularyFilterCommandError = async ( case "BadRequestException": case "com.amazonaws.transcribe#BadRequestException": throw await de_BadRequestExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.transcribe#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalFailureException": case "com.amazonaws.transcribe#InternalFailureException": throw await de_InternalFailureExceptionRes(parsedOutput, context); @@ -3164,7 +1721,7 @@ const de_UpdateVocabularyFilterCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-transfer/src/protocols/Aws_json1_1.ts b/clients/client-transfer/src/protocols/Aws_json1_1.ts index 0f6d68daa0f9..8db25f093faa 100644 --- a/clients/client-transfer/src/protocols/Aws_json1_1.ts +++ b/clients/client-transfer/src/protocols/Aws_json1_1.ts @@ -976,7 +976,7 @@ export const de_CreateAccessCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -988,44 +988,6 @@ export const de_CreateAccessCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAccessCommandError - */ -const de_CreateAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.transfer#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAgreementCommand */ @@ -1034,7 +996,7 @@ export const de_CreateAgreementCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAgreementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1046,47 +1008,6 @@ export const de_CreateAgreementCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAgreementCommandError - */ -const de_CreateAgreementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.transfer#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateConnectorCommand */ @@ -1095,7 +1016,7 @@ export const de_CreateConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateConnectorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1107,47 +1028,6 @@ export const de_CreateConnectorCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateConnectorCommandError - */ -const de_CreateConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.transfer#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateProfileCommand */ @@ -1156,7 +1036,7 @@ export const de_CreateProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1168,44 +1048,6 @@ export const de_CreateProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateProfileCommandError - */ -const de_CreateProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateServerCommand */ @@ -1214,7 +1056,7 @@ export const de_CreateServerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateServerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1227,63 +1069,39 @@ export const de_CreateServerCommand = async ( }; /** - * deserializeAws_json1_1CreateServerCommandError + * deserializeAws_json1_1CreateUserCommand */ -const de_CreateServerCommandError = async ( +export const de_CreateUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.transfer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.transfer#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateUserCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateUserCommand + * deserializeAws_json1_1CreateWorkflowCommand */ -export const de_CreateUserCommand = async ( +export const de_CreateWorkflowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateUserCommandOutput = { + const response: CreateWorkflowCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1291,1780 +1109,209 @@ export const de_CreateUserCommand = async ( }; /** - * deserializeAws_json1_1CreateUserCommandError + * deserializeAws_json1_1DeleteAccessCommand */ -const de_CreateUserCommandError = async ( +export const de_DeleteAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.transfer#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteAccessCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1CreateWorkflowCommand + * deserializeAws_json1_1DeleteAgreementCommand */ -export const de_CreateWorkflowCommand = async ( +export const de_DeleteAgreementCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateWorkflowCommandError(output, context); + return de_CommandError(output, context); } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateWorkflowCommandOutput = { + await collectBody(output.body, context); + const response: DeleteAgreementCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, }; return response; }; /** - * deserializeAws_json1_1CreateWorkflowCommandError + * deserializeAws_json1_1DeleteCertificateCommand */ -const de_CreateWorkflowCommandError = async ( +export const de_DeleteCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.transfer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.transfer#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteAccessCommand - */ -export const de_DeleteAccessCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteAccessCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteAccessCommandOutput = { + const response: DeleteCertificateCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteAccessCommandError - */ -const de_DeleteAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteAgreementCommand + * deserializeAws_json1_1DeleteConnectorCommand */ -export const de_DeleteAgreementCommand = async ( +export const de_DeleteConnectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteAgreementCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteAgreementCommandOutput = { + const response: DeleteConnectorCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteAgreementCommandError - */ -const de_DeleteAgreementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteCertificateCommand + * deserializeAws_json1_1DeleteHostKeyCommand */ -export const de_DeleteCertificateCommand = async ( +export const de_DeleteHostKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteCertificateCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteCertificateCommandOutput = { + const response: DeleteHostKeyCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteCertificateCommandError - */ -const de_DeleteCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteConnectorCommand + * deserializeAws_json1_1DeleteProfileCommand */ -export const de_DeleteConnectorCommand = async ( +export const de_DeleteProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteConnectorCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteConnectorCommandOutput = { + const response: DeleteProfileCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteConnectorCommandError + * deserializeAws_json1_1DeleteServerCommand */ -const de_DeleteConnectorCommandError = async ( +export const de_DeleteServerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteServerCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteHostKeyCommand + * deserializeAws_json1_1DeleteSshPublicKeyCommand */ -export const de_DeleteHostKeyCommand = async ( +export const de_DeleteSshPublicKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteHostKeyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteHostKeyCommandOutput = { + const response: DeleteSshPublicKeyCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteHostKeyCommandError + * deserializeAws_json1_1DeleteUserCommand */ -const de_DeleteHostKeyCommandError = async ( +export const de_DeleteUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteUserCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1DeleteProfileCommand + * deserializeAws_json1_1DeleteWorkflowCommand */ -export const de_DeleteProfileCommand = async ( +export const de_DeleteWorkflowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteProfileCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: DeleteProfileCommandOutput = { + const response: DeleteWorkflowCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1DeleteProfileCommandError - */ -const de_DeleteProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteServerCommand - */ -export const de_DeleteServerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteServerCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteServerCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteServerCommandError - */ -const de_DeleteServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.transfer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteSshPublicKeyCommand - */ -export const de_DeleteSshPublicKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteSshPublicKeyCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteSshPublicKeyCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteSshPublicKeyCommandError - */ -const de_DeleteSshPublicKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteUserCommand - */ -export const de_DeleteUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteUserCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteUserCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteUserCommandError - */ -const de_DeleteUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteWorkflowCommand - */ -export const de_DeleteWorkflowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteWorkflowCommandError(output, context); - } - await collectBody(output.body, context); - const response: DeleteWorkflowCommandOutput = { - $metadata: deserializeMetadata(output), - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteWorkflowCommandError - */ -const de_DeleteWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.transfer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAccessCommand + * deserializeAws_json1_1DescribeAccessCommand */ export const de_DescribeAccessCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAccessCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeAccessCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAccessCommandError - */ -const de_DescribeAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAgreementCommand - */ -export const de_DescribeAgreementCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAgreementCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeAgreementCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAgreementCommandError - */ -const de_DescribeAgreementCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeCertificateCommand - */ -export const de_DescribeCertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeCertificateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeCertificateResponse(data, context); - const response: DescribeCertificateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeCertificateCommandError - */ -const de_DescribeCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeConnectorCommand - */ -export const de_DescribeConnectorCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeConnectorCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeConnectorCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeConnectorCommandError - */ -const de_DescribeConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeExecutionCommand - */ -export const de_DescribeExecutionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeExecutionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeExecutionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeExecutionCommandError - */ -const de_DescribeExecutionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeHostKeyCommand - */ -export const de_DescribeHostKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeHostKeyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeHostKeyResponse(data, context); - const response: DescribeHostKeyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeHostKeyCommandError - */ -const de_DescribeHostKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeProfileCommand - */ -export const de_DescribeProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeProfileCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeProfileCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeProfileCommandError - */ -const de_DescribeProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeSecurityPolicyCommand - */ -export const de_DescribeSecurityPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeSecurityPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeSecurityPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeSecurityPolicyCommandError - */ -const de_DescribeSecurityPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeServerCommand - */ -export const de_DescribeServerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeServerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeServerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeServerCommandError - */ -const de_DescribeServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeUserCommand - */ -export const de_DescribeUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeUserCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeUserResponse(data, context); - const response: DescribeUserCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeUserCommandError - */ -const de_DescribeUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeWorkflowCommand - */ -export const de_DescribeWorkflowCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeWorkflowCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeWorkflowCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeWorkflowCommandError - */ -const de_DescribeWorkflowCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ImportCertificateCommand - */ -export const de_ImportCertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ImportCertificateCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ImportCertificateCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ImportCertificateCommandError - */ -const de_ImportCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ImportHostKeyCommand - */ -export const de_ImportHostKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ImportHostKeyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ImportHostKeyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ImportHostKeyCommandError - */ -const de_ImportHostKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.transfer#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ImportSshPublicKeyCommand - */ -export const de_ImportSshPublicKeyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ImportSshPublicKeyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ImportSshPublicKeyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ImportSshPublicKeyCommandError - */ -const de_ImportSshPublicKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.transfer#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAccessesCommand - */ -export const de_ListAccessesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAccessesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListAccessesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAccessesCommandError - */ -const de_ListAccessesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.transfer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAgreementsCommand - */ -export const de_ListAgreementsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAgreementsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListAgreementsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAgreementsCommandError - */ -const de_ListAgreementsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.transfer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListCertificatesCommand - */ -export const de_ListCertificatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListCertificatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListCertificatesResponse(data, context); - const response: ListCertificatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListCertificatesCommandError - */ -const de_ListCertificatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.transfer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListConnectorsCommand - */ -export const de_ListConnectorsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListConnectorsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListConnectorsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListConnectorsCommandError - */ -const de_ListConnectorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.transfer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListExecutionsCommand - */ -export const de_ListExecutionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListExecutionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListExecutionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListExecutionsCommandError - */ -const de_ListExecutionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.transfer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListHostKeysCommand - */ -export const de_ListHostKeysCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListHostKeysCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListHostKeysResponse(data, context); - const response: ListHostKeysCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListHostKeysCommandError - */ -const de_ListHostKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.transfer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeAccessCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListProfilesCommand + * deserializeAws_json1_1DescribeAgreementCommand */ -export const de_ListProfilesCommand = async ( +export const de_DescribeAgreementCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListProfilesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListProfilesCommandOutput = { + const response: DescribeAgreementCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3072,57 +1319,39 @@ export const de_ListProfilesCommand = async ( }; /** - * deserializeAws_json1_1ListProfilesCommandError + * deserializeAws_json1_1DescribeCertificateCommand */ -const de_ListProfilesCommandError = async ( +export const de_DescribeCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.transfer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeCertificateResponse(data, context); + const response: DescribeCertificateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListSecurityPoliciesCommand + * deserializeAws_json1_1DescribeConnectorCommand */ -export const de_ListSecurityPoliciesCommand = async ( +export const de_DescribeConnectorCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSecurityPoliciesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListSecurityPoliciesCommandOutput = { + const response: DescribeConnectorCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3130,54 +1359,59 @@ export const de_ListSecurityPoliciesCommand = async ( }; /** - * deserializeAws_json1_1ListSecurityPoliciesCommandError + * deserializeAws_json1_1DescribeExecutionCommand */ -const de_ListSecurityPoliciesCommandError = async ( +export const de_DescribeExecutionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeExecutionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.transfer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DescribeHostKeyCommand + */ +export const de_DescribeHostKeyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeHostKeyResponse(data, context); + const response: DescribeHostKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListServersCommand + * deserializeAws_json1_1DescribeProfileCommand */ -export const de_ListServersCommand = async ( +export const de_DescribeProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListServersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListServersCommandOutput = { + const response: DescribeProfileCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3185,54 +1419,39 @@ export const de_ListServersCommand = async ( }; /** - * deserializeAws_json1_1ListServersCommandError + * deserializeAws_json1_1DescribeSecurityPolicyCommand */ -const de_ListServersCommandError = async ( +export const de_DescribeSecurityPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.transfer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeSecurityPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListTagsForResourceCommand + * deserializeAws_json1_1DescribeServerCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_DescribeServerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + const response: DescribeServerCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3240,54 +1459,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_1ListTagsForResourceCommandError + * deserializeAws_json1_1DescribeUserCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_DescribeUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.transfer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeUserResponse(data, context); + const response: DescribeUserCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListUsersCommand + * deserializeAws_json1_1DescribeWorkflowCommand */ -export const de_ListUsersCommand = async ( +export const de_DescribeWorkflowCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListUsersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListUsersCommandOutput = { + const response: DescribeWorkflowCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3295,57 +1499,39 @@ export const de_ListUsersCommand = async ( }; /** - * deserializeAws_json1_1ListUsersCommandError + * deserializeAws_json1_1ImportCertificateCommand */ -const de_ListUsersCommandError = async ( +export const de_ImportCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.transfer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ImportCertificateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListWorkflowsCommand + * deserializeAws_json1_1ImportHostKeyCommand */ -export const de_ListWorkflowsCommand = async ( +export const de_ImportHostKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListWorkflowsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListWorkflowsCommandOutput = { + const response: ImportHostKeyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3353,54 +1539,39 @@ export const de_ListWorkflowsCommand = async ( }; /** - * deserializeAws_json1_1ListWorkflowsCommandError + * deserializeAws_json1_1ImportSshPublicKeyCommand */ -const de_ListWorkflowsCommandError = async ( +export const de_ImportSshPublicKeyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidNextTokenException": - case "com.amazonaws.transfer#InvalidNextTokenException": - throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ImportSshPublicKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1SendWorkflowStepStateCommand + * deserializeAws_json1_1ListAccessesCommand */ -export const de_SendWorkflowStepStateCommand = async ( +export const de_ListAccessesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_SendWorkflowStepStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: SendWorkflowStepStateCommandOutput = { + const response: ListAccessesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3408,60 +1579,39 @@ export const de_SendWorkflowStepStateCommand = async ( }; /** - * deserializeAws_json1_1SendWorkflowStepStateCommandError + * deserializeAws_json1_1ListAgreementsCommand */ -const de_SendWorkflowStepStateCommandError = async ( +export const de_ListAgreementsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.transfer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListAgreementsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartFileTransferCommand + * deserializeAws_json1_1ListCertificatesCommand */ -export const de_StartFileTransferCommand = async ( +export const de_ListCertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartFileTransferCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: StartFileTransferCommandOutput = { + contents = de_ListCertificatesResponse(data, context); + const response: ListCertificatesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3469,219 +1619,159 @@ export const de_StartFileTransferCommand = async ( }; /** - * deserializeAws_json1_1StartFileTransferCommandError + * deserializeAws_json1_1ListConnectorsCommand */ -const de_StartFileTransferCommandError = async ( +export const de_ListConnectorsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListConnectorsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StartServerCommand + * deserializeAws_json1_1ListExecutionsCommand */ -export const de_StartServerCommand = async ( +export const de_ListExecutionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartServerCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: StartServerCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListExecutionsCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1StartServerCommandError + * deserializeAws_json1_1ListHostKeysCommand */ -const de_StartServerCommandError = async ( +export const de_ListHostKeysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListHostKeysResponse(data, context); + const response: ListHostKeysCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1StopServerCommand + * deserializeAws_json1_1ListProfilesCommand */ -export const de_StopServerCommand = async ( +export const de_ListProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StopServerCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: StopServerCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListProfilesCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1StopServerCommandError + * deserializeAws_json1_1ListSecurityPoliciesCommand */ -const de_StopServerCommandError = async ( +export const de_ListSecurityPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListSecurityPoliciesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1ListServersCommand */ -export const de_TagResourceCommand = async ( +export const de_ListServersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: TagResourceCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListServersCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_1TagResourceCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_TagResourceCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TestConnectionCommand + * deserializeAws_json1_1ListUsersCommand */ -export const de_TestConnectionCommand = async ( +export const de_ListUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TestConnectionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TestConnectionCommandOutput = { + const response: ListUsersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3689,54 +1779,39 @@ export const de_TestConnectionCommand = async ( }; /** - * deserializeAws_json1_1TestConnectionCommandError + * deserializeAws_json1_1ListWorkflowsCommand */ -const de_TestConnectionCommandError = async ( +export const de_ListWorkflowsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListWorkflowsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1TestIdentityProviderCommand + * deserializeAws_json1_1SendWorkflowStepStateCommand */ -export const de_TestIdentityProviderCommand = async ( +export const de_SendWorkflowStepStateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TestIdentityProviderCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TestIdentityProviderCommandOutput = { + const response: SendWorkflowStepStateCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3744,106 +1819,90 @@ export const de_TestIdentityProviderCommand = async ( }; /** - * deserializeAws_json1_1TestIdentityProviderCommandError + * deserializeAws_json1_1StartFileTransferCommand */ -const de_TestIdentityProviderCommandError = async ( +export const de_StartFileTransferCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartFileTransferCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UntagResourceCommand + * deserializeAws_json1_1StartServerCommand */ -export const de_UntagResourceCommand = async ( +export const de_StartServerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); - const response: UntagResourceCommandOutput = { + const response: StartServerCommandOutput = { $metadata: deserializeMetadata(output), }; return response; }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserializeAws_json1_1StopServerCommand */ -const de_UntagResourceCommandError = async ( +export const de_StopServerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + await collectBody(output.body, context); + const response: StopServerCommandOutput = { + $metadata: deserializeMetadata(output), }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1TagResourceCommand + */ +export const de_TagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1UpdateAccessCommand + * deserializeAws_json1_1TestConnectionCommand */ -export const de_UpdateAccessCommand = async ( +export const de_TestConnectionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateAccessCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateAccessCommandOutput = { + const response: TestConnectionCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3851,60 +1910,56 @@ export const de_UpdateAccessCommand = async ( }; /** - * deserializeAws_json1_1UpdateAccessCommandError + * deserializeAws_json1_1TestIdentityProviderCommand */ -const de_UpdateAccessCommandError = async ( +export const de_TestIdentityProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TestIdentityProviderCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.transfer#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1UntagResourceCommand + */ +export const de_UntagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_1UpdateAgreementCommand + * deserializeAws_json1_1UpdateAccessCommand */ -export const de_UpdateAgreementCommand = async ( +export const de_UpdateAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateAgreementCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateAgreementCommandOutput = { + const response: UpdateAccessCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3912,44 +1967,23 @@ export const de_UpdateAgreementCommand = async ( }; /** - * deserializeAws_json1_1UpdateAgreementCommandError + * deserializeAws_json1_1UpdateAgreementCommand */ -const de_UpdateAgreementCommandError = async ( +export const de_UpdateAgreementCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.transfer#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateAgreementCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3960,7 +1994,7 @@ export const de_UpdateCertificateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateCertificateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3972,44 +2006,6 @@ export const de_UpdateCertificateCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateCertificateCommandError - */ -const de_UpdateCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateConnectorCommand */ @@ -4018,7 +2014,7 @@ export const de_UpdateConnectorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateConnectorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4030,47 +2026,6 @@ export const de_UpdateConnectorCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateConnectorCommandError - */ -const de_UpdateConnectorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.transfer#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateHostKeyCommand */ @@ -4079,7 +2034,7 @@ export const de_UpdateHostKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateHostKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4091,44 +2046,6 @@ export const de_UpdateHostKeyCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateHostKeyCommandError - */ -const de_UpdateHostKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateProfileCommand */ @@ -4137,7 +2054,7 @@ export const de_UpdateProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateProfileCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4149,44 +2066,6 @@ export const de_UpdateProfileCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateProfileCommandError - */ -const de_UpdateProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateServerCommand */ @@ -4195,7 +2074,7 @@ export const de_UpdateServerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateServerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4207,53 +2086,6 @@ export const de_UpdateServerCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateServerCommandError - */ -const de_UpdateServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.transfer#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.transfer#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServiceError": - case "com.amazonaws.transfer#InternalServiceError": - throw await de_InternalServiceErrorRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.transfer#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceExistsException": - case "com.amazonaws.transfer#ResourceExistsException": - throw await de_ResourceExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.transfer#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.transfer#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.transfer#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateUserCommand */ @@ -4262,7 +2094,7 @@ export const de_UpdateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4275,12 +2107,9 @@ export const de_UpdateUserCommand = async ( }; /** - * deserializeAws_json1_1UpdateUserCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4293,6 +2122,9 @@ const de_UpdateUserCommandError = async ( case "InvalidRequestException": case "com.amazonaws.transfer#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "ResourceExistsException": + case "com.amazonaws.transfer#ResourceExistsException": + throw await de_ResourceExistsExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.transfer#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); @@ -4302,13 +2134,22 @@ const de_UpdateUserCommandError = async ( case "ThrottlingException": case "com.amazonaws.transfer#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "AccessDeniedException": + case "com.amazonaws.transfer#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InvalidNextTokenException": + case "com.amazonaws.transfer#InvalidNextTokenException": + throw await de_InvalidNextTokenExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.transfer#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-translate/src/protocols/Aws_json1_1.ts b/clients/client-translate/src/protocols/Aws_json1_1.ts index 8b7c01898161..a35b0badd9a1 100644 --- a/clients/client-translate/src/protocols/Aws_json1_1.ts +++ b/clients/client-translate/src/protocols/Aws_json1_1.ts @@ -370,7 +370,7 @@ export const de_CreateParallelDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateParallelDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -382,53 +382,6 @@ export const de_CreateParallelDataCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateParallelDataCommandError - */ -const de_CreateParallelDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.translate#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.translate#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.translate#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.translate#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.translate#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.translate#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.translate#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteParallelDataCommand */ @@ -437,7 +390,7 @@ export const de_DeleteParallelDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteParallelDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -449,41 +402,6 @@ export const de_DeleteParallelDataCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteParallelDataCommandError - */ -const de_DeleteParallelDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.translate#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.translate#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.translate#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteTerminologyCommand */ @@ -492,7 +410,7 @@ export const de_DeleteTerminologyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteTerminologyCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteTerminologyCommandOutput = { @@ -501,41 +419,6 @@ export const de_DeleteTerminologyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteTerminologyCommandError - */ -const de_DeleteTerminologyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.translate#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.translate#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.translate#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeTextTranslationJobCommand */ @@ -544,7 +427,7 @@ export const de_DescribeTextTranslationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeTextTranslationJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -556,38 +439,6 @@ export const de_DescribeTextTranslationJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeTextTranslationJobCommandError - */ -const de_DescribeTextTranslationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.translate#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.translate#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetParallelDataCommand */ @@ -596,7 +447,7 @@ export const de_GetParallelDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetParallelDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -608,41 +459,6 @@ export const de_GetParallelDataCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetParallelDataCommandError - */ -const de_GetParallelDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.translate#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.translate#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.translate#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetTerminologyCommand */ @@ -651,7 +467,7 @@ export const de_GetTerminologyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetTerminologyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -663,41 +479,6 @@ export const de_GetTerminologyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetTerminologyCommandError - */ -const de_GetTerminologyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.translate#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.translate#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.translate#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ImportTerminologyCommand */ @@ -706,7 +487,7 @@ export const de_ImportTerminologyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ImportTerminologyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -718,47 +499,6 @@ export const de_ImportTerminologyCommand = async ( return response; }; -/** - * deserializeAws_json1_1ImportTerminologyCommandError - */ -const de_ImportTerminologyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.translate#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.translate#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.translate#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.translate#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.translate#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListLanguagesCommand */ @@ -767,7 +507,7 @@ export const de_ListLanguagesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListLanguagesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -779,41 +519,6 @@ export const de_ListLanguagesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListLanguagesCommandError - */ -const de_ListLanguagesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.translate#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.translate#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedDisplayLanguageCodeException": - case "com.amazonaws.translate#UnsupportedDisplayLanguageCodeException": - throw await de_UnsupportedDisplayLanguageCodeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListParallelDataCommand */ @@ -822,7 +527,7 @@ export const de_ListParallelDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListParallelDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -834,38 +539,6 @@ export const de_ListParallelDataCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListParallelDataCommandError - */ -const de_ListParallelDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.translate#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.translate#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -874,7 +547,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -886,38 +559,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.translate#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.translate#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTerminologiesCommand */ @@ -926,7 +567,7 @@ export const de_ListTerminologiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTerminologiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -938,38 +579,6 @@ export const de_ListTerminologiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTerminologiesCommandError - */ -const de_ListTerminologiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.translate#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.translate#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTextTranslationJobsCommand */ @@ -978,51 +587,16 @@ export const de_ListTextTranslationJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTextTranslationJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListTextTranslationJobsResponse(data, context); - const response: ListTextTranslationJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTextTranslationJobsCommandError - */ -const de_ListTextTranslationJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidFilterException": - case "com.amazonaws.translate#InvalidFilterException": - throw await de_InvalidFilterExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.translate#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.translate#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + let contents: any = {}; + contents = de_ListTextTranslationJobsResponse(data, context); + const response: ListTextTranslationJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1033,7 +607,7 @@ export const de_StartTextTranslationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartTextTranslationJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1045,47 +619,6 @@ export const de_StartTextTranslationJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartTextTranslationJobCommandError - */ -const de_StartTextTranslationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.translate#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.translate#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.translate#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.translate#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedLanguagePairException": - case "com.amazonaws.translate#UnsupportedLanguagePairException": - throw await de_UnsupportedLanguagePairExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StopTextTranslationJobCommand */ @@ -1094,7 +627,7 @@ export const de_StopTextTranslationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopTextTranslationJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1106,38 +639,6 @@ export const de_StopTextTranslationJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopTextTranslationJobCommandError - */ -const de_StopTextTranslationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.translate#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.translate#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TagResourceCommand */ @@ -1146,7 +647,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1158,44 +659,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.translate#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.translate#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.translate#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.translate#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TranslateDocumentCommand */ @@ -1204,7 +667,7 @@ export const de_TranslateDocumentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TranslateDocumentCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1216,50 +679,6 @@ export const de_TranslateDocumentCommand = async ( return response; }; -/** - * deserializeAws_json1_1TranslateDocumentCommandError - */ -const de_TranslateDocumentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.translate#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.translate#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.translate#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.translate#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.translate#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedLanguagePairException": - case "com.amazonaws.translate#UnsupportedLanguagePairException": - throw await de_UnsupportedLanguagePairExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1TranslateTextCommand */ @@ -1268,7 +687,7 @@ export const de_TranslateTextCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TranslateTextCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1280,53 +699,6 @@ export const de_TranslateTextCommand = async ( return response; }; -/** - * deserializeAws_json1_1TranslateTextCommandError - */ -const de_TranslateTextCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DetectedLanguageLowConfidenceException": - case "com.amazonaws.translate#DetectedLanguageLowConfidenceException": - throw await de_DetectedLanguageLowConfidenceExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.translate#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.translate#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.translate#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TextSizeLimitExceededException": - case "com.amazonaws.translate#TextSizeLimitExceededException": - throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.translate#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnsupportedLanguagePairException": - case "com.amazonaws.translate#UnsupportedLanguagePairException": - throw await de_UnsupportedLanguagePairExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UntagResourceCommand */ @@ -1335,7 +707,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1347,41 +719,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.translate#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.translate#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "InvalidParameterValueException": - case "com.amazonaws.translate#InvalidParameterValueException": - throw await de_InvalidParameterValueExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.translate#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateParallelDataCommand */ @@ -1390,7 +727,7 @@ export const de_UpdateParallelDataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateParallelDataCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1403,12 +740,9 @@ export const de_UpdateParallelDataCommand = async ( }; /** - * deserializeAws_json1_1UpdateParallelDataCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateParallelDataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1433,19 +767,40 @@ const de_UpdateParallelDataCommandError = async ( case "LimitExceededException": case "com.amazonaws.translate#LimitExceededException": throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.translate#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "TooManyRequestsException": case "com.amazonaws.translate#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.translate#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.translate#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "UnsupportedDisplayLanguageCodeException": + case "com.amazonaws.translate#UnsupportedDisplayLanguageCodeException": + throw await de_UnsupportedDisplayLanguageCodeExceptionRes(parsedOutput, context); + case "InvalidFilterException": + case "com.amazonaws.translate#InvalidFilterException": + throw await de_InvalidFilterExceptionRes(parsedOutput, context); + case "UnsupportedLanguagePairException": + case "com.amazonaws.translate#UnsupportedLanguagePairException": + throw await de_UnsupportedLanguagePairExceptionRes(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.translate#ServiceUnavailableException": + throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); + case "DetectedLanguageLowConfidenceException": + case "com.amazonaws.translate#DetectedLanguageLowConfidenceException": + throw await de_DetectedLanguageLowConfidenceExceptionRes(parsedOutput, context); + case "TextSizeLimitExceededException": + case "com.amazonaws.translate#TextSizeLimitExceededException": + throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-trustedadvisor/src/protocols/Aws_restJson1.ts b/clients/client-trustedadvisor/src/protocols/Aws_restJson1.ts index 56c6f9101f5a..48952e1124ea 100644 --- a/clients/client-trustedadvisor/src/protocols/Aws_restJson1.ts +++ b/clients/client-trustedadvisor/src/protocols/Aws_restJson1.ts @@ -340,7 +340,7 @@ export const de_GetOrganizationRecommendationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetOrganizationRecommendationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -353,44 +353,6 @@ export const de_GetOrganizationRecommendationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetOrganizationRecommendationCommandError - */ -const de_GetOrganizationRecommendationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.trustedadvisor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.trustedadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.trustedadvisor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.trustedadvisor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.trustedadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRecommendationCommand */ @@ -399,7 +361,7 @@ export const de_GetRecommendationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRecommendationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -412,44 +374,6 @@ export const de_GetRecommendationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRecommendationCommandError - */ -const de_GetRecommendationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.trustedadvisor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.trustedadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.trustedadvisor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.trustedadvisor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.trustedadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListChecksCommand */ @@ -458,7 +382,7 @@ export const de_ListChecksCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListChecksCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -472,41 +396,6 @@ export const de_ListChecksCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListChecksCommandError - */ -const de_ListChecksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.trustedadvisor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.trustedadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.trustedadvisor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.trustedadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListOrganizationRecommendationAccountsCommand */ @@ -515,7 +404,7 @@ export const de_ListOrganizationRecommendationAccountsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOrganizationRecommendationAccountsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -529,44 +418,6 @@ export const de_ListOrganizationRecommendationAccountsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListOrganizationRecommendationAccountsCommandError - */ -const de_ListOrganizationRecommendationAccountsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.trustedadvisor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.trustedadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.trustedadvisor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.trustedadvisor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.trustedadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListOrganizationRecommendationResourcesCommand */ @@ -575,7 +426,7 @@ export const de_ListOrganizationRecommendationResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOrganizationRecommendationResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -589,44 +440,6 @@ export const de_ListOrganizationRecommendationResourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListOrganizationRecommendationResourcesCommandError - */ -const de_ListOrganizationRecommendationResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.trustedadvisor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.trustedadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.trustedadvisor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.trustedadvisor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.trustedadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListOrganizationRecommendationsCommand */ @@ -635,7 +448,7 @@ export const de_ListOrganizationRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListOrganizationRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -649,41 +462,6 @@ export const de_ListOrganizationRecommendationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListOrganizationRecommendationsCommandError - */ -const de_ListOrganizationRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.trustedadvisor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.trustedadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.trustedadvisor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.trustedadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRecommendationResourcesCommand */ @@ -692,7 +470,7 @@ export const de_ListRecommendationResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecommendationResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -706,44 +484,6 @@ export const de_ListRecommendationResourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRecommendationResourcesCommandError - */ -const de_ListRecommendationResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.trustedadvisor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.trustedadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.trustedadvisor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.trustedadvisor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.trustedadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListRecommendationsCommand */ @@ -752,7 +492,7 @@ export const de_ListRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -766,41 +506,6 @@ export const de_ListRecommendationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListRecommendationsCommandError - */ -const de_ListRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.trustedadvisor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.trustedadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.trustedadvisor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.trustedadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateOrganizationRecommendationLifecycleCommand */ @@ -809,7 +514,7 @@ export const de_UpdateOrganizationRecommendationLifecycleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateOrganizationRecommendationLifecycleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -818,47 +523,6 @@ export const de_UpdateOrganizationRecommendationLifecycleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateOrganizationRecommendationLifecycleCommandError - */ -const de_UpdateOrganizationRecommendationLifecycleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.trustedadvisor#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.trustedadvisor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.trustedadvisor#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.trustedadvisor#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.trustedadvisor#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.trustedadvisor#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRecommendationLifecycleCommand */ @@ -867,7 +531,7 @@ export const de_UpdateRecommendationLifecycleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRecommendationLifecycleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -877,12 +541,9 @@ export const de_UpdateRecommendationLifecycleCommand = async ( }; /** - * deserializeAws_restJson1UpdateRecommendationLifecycleCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateRecommendationLifecycleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -892,9 +553,6 @@ const de_UpdateRecommendationLifecycleCommandError = async ( case "AccessDeniedException": case "com.amazonaws.trustedadvisor#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.trustedadvisor#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.trustedadvisor#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); @@ -907,13 +565,16 @@ const de_UpdateRecommendationLifecycleCommandError = async ( case "ValidationException": case "com.amazonaws.trustedadvisor#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.trustedadvisor#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-verifiedpermissions/src/protocols/Aws_json1_0.ts b/clients/client-verifiedpermissions/src/protocols/Aws_json1_0.ts index ee8de5e681c8..7df9250dd84e 100644 --- a/clients/client-verifiedpermissions/src/protocols/Aws_json1_0.ts +++ b/clients/client-verifiedpermissions/src/protocols/Aws_json1_0.ts @@ -487,7 +487,7 @@ export const de_BatchIsAuthorizedCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_BatchIsAuthorizedCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -499,44 +499,6 @@ export const de_BatchIsAuthorizedCommand = async ( return response; }; -/** - * deserializeAws_json1_0BatchIsAuthorizedCommandError - */ -const de_BatchIsAuthorizedCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateIdentitySourceCommand */ @@ -545,7 +507,7 @@ export const de_CreateIdentitySourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateIdentitySourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -557,50 +519,6 @@ export const de_CreateIdentitySourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateIdentitySourceCommandError - */ -const de_CreateIdentitySourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.verifiedpermissions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.verifiedpermissions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreatePolicyCommand */ @@ -609,7 +527,7 @@ export const de_CreatePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -621,50 +539,6 @@ export const de_CreatePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreatePolicyCommandError - */ -const de_CreatePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.verifiedpermissions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.verifiedpermissions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreatePolicyStoreCommand */ @@ -673,7 +547,7 @@ export const de_CreatePolicyStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePolicyStoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -685,47 +559,6 @@ export const de_CreatePolicyStoreCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreatePolicyStoreCommandError - */ -const de_CreatePolicyStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.verifiedpermissions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.verifiedpermissions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreatePolicyTemplateCommand */ @@ -734,7 +567,7 @@ export const de_CreatePolicyTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreatePolicyTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -746,50 +579,6 @@ export const de_CreatePolicyTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreatePolicyTemplateCommandError - */ -const de_CreatePolicyTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.verifiedpermissions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.verifiedpermissions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteIdentitySourceCommand */ @@ -798,7 +587,7 @@ export const de_DeleteIdentitySourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteIdentitySourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -811,60 +600,39 @@ export const de_DeleteIdentitySourceCommand = async ( }; /** - * deserializeAws_json1_0DeleteIdentitySourceCommandError + * deserializeAws_json1_0DeletePolicyCommand */ -const de_DeleteIdentitySourceCommandError = async ( +export const de_DeletePolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.verifiedpermissions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeletePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0DeletePolicyCommand + * deserializeAws_json1_0DeletePolicyStoreCommand */ -export const de_DeletePolicyCommand = async ( +export const de_DeletePolicyStoreCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeletePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeletePolicyCommandOutput = { + const response: DeletePolicyStoreCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -872,110 +640,14 @@ export const de_DeletePolicyCommand = async ( }; /** - * deserializeAws_json1_0DeletePolicyCommandError + * deserializeAws_json1_0DeletePolicyTemplateCommand */ -const de_DeletePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.verifiedpermissions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeletePolicyStoreCommand - */ -export const de_DeletePolicyStoreCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeletePolicyStoreCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeletePolicyStoreCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DeletePolicyStoreCommandError - */ -const de_DeletePolicyStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DeletePolicyTemplateCommand - */ -export const de_DeletePolicyTemplateCommand = async ( +export const de_DeletePolicyTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePolicyTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -987,47 +659,6 @@ export const de_DeletePolicyTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeletePolicyTemplateCommandError - */ -const de_DeletePolicyTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.verifiedpermissions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetIdentitySourceCommand */ @@ -1036,7 +667,7 @@ export const de_GetIdentitySourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetIdentitySourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1048,44 +679,6 @@ export const de_GetIdentitySourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetIdentitySourceCommandError - */ -const de_GetIdentitySourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetPolicyCommand */ @@ -1094,7 +687,7 @@ export const de_GetPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1106,44 +699,6 @@ export const de_GetPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetPolicyCommandError - */ -const de_GetPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetPolicyStoreCommand */ @@ -1152,7 +707,7 @@ export const de_GetPolicyStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPolicyStoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1164,44 +719,6 @@ export const de_GetPolicyStoreCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetPolicyStoreCommandError - */ -const de_GetPolicyStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetPolicyTemplateCommand */ @@ -1210,7 +727,7 @@ export const de_GetPolicyTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPolicyTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1222,44 +739,6 @@ export const de_GetPolicyTemplateCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetPolicyTemplateCommandError - */ -const de_GetPolicyTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0GetSchemaCommand */ @@ -1268,7 +747,7 @@ export const de_GetSchemaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSchemaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1280,44 +759,6 @@ export const de_GetSchemaCommand = async ( return response; }; -/** - * deserializeAws_json1_0GetSchemaCommandError - */ -const de_GetSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0IsAuthorizedCommand */ @@ -1326,7 +767,7 @@ export const de_IsAuthorizedCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_IsAuthorizedCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1338,44 +779,6 @@ export const de_IsAuthorizedCommand = async ( return response; }; -/** - * deserializeAws_json1_0IsAuthorizedCommandError - */ -const de_IsAuthorizedCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0IsAuthorizedWithTokenCommand */ @@ -1384,7 +787,7 @@ export const de_IsAuthorizedWithTokenCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_IsAuthorizedWithTokenCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1396,44 +799,6 @@ export const de_IsAuthorizedWithTokenCommand = async ( return response; }; -/** - * deserializeAws_json1_0IsAuthorizedWithTokenCommandError - */ -const de_IsAuthorizedWithTokenCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0ListIdentitySourcesCommand */ @@ -1442,128 +807,32 @@ export const de_ListIdentitySourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListIdentitySourcesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListIdentitySourcesOutput(data, context); - const response: ListIdentitySourcesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListIdentitySourcesCommandError - */ -const de_ListIdentitySourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListPoliciesCommand - */ -export const de_ListPoliciesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListPoliciesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListPoliciesOutput(data, context); - const response: ListPoliciesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListPoliciesCommandError - */ -const de_ListPoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + contents = de_ListIdentitySourcesOutput(data, context); + const response: ListIdentitySourcesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListPolicyStoresCommand + * deserializeAws_json1_0ListPoliciesCommand */ -export const de_ListPolicyStoresCommand = async ( +export const de_ListPoliciesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListPolicyStoresCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListPolicyStoresOutput(data, context); - const response: ListPolicyStoresCommandOutput = { + contents = de_ListPoliciesOutput(data, context); + const response: ListPoliciesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1571,38 +840,23 @@ export const de_ListPolicyStoresCommand = async ( }; /** - * deserializeAws_json1_0ListPolicyStoresCommandError + * deserializeAws_json1_0ListPolicyStoresCommand */ -const de_ListPolicyStoresCommandError = async ( +export const de_ListPolicyStoresCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListPolicyStoresOutput(data, context); + const response: ListPolicyStoresCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1613,7 +867,7 @@ export const de_ListPolicyTemplatesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListPolicyTemplatesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1625,44 +879,6 @@ export const de_ListPolicyTemplatesCommand = async ( return response; }; -/** - * deserializeAws_json1_0ListPolicyTemplatesCommandError - */ -const de_ListPolicyTemplatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0PutSchemaCommand */ @@ -1671,7 +887,7 @@ export const de_PutSchemaCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutSchemaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1683,50 +899,6 @@ export const de_PutSchemaCommand = async ( return response; }; -/** - * deserializeAws_json1_0PutSchemaCommandError - */ -const de_PutSchemaCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.verifiedpermissions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.verifiedpermissions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateIdentitySourceCommand */ @@ -1735,7 +907,7 @@ export const de_UpdateIdentitySourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateIdentitySourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1747,47 +919,6 @@ export const de_UpdateIdentitySourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateIdentitySourceCommandError - */ -const de_UpdateIdentitySourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.verifiedpermissions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdatePolicyCommand */ @@ -1796,7 +927,7 @@ export const de_UpdatePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1808,50 +939,6 @@ export const de_UpdatePolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdatePolicyCommandError - */ -const de_UpdatePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.verifiedpermissions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.verifiedpermissions#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdatePolicyStoreCommand */ @@ -1860,7 +947,7 @@ export const de_UpdatePolicyStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePolicyStoreCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1872,47 +959,6 @@ export const de_UpdatePolicyStoreCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdatePolicyStoreCommandError - */ -const de_UpdatePolicyStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.verifiedpermissions#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.verifiedpermissions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.verifiedpermissions#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.verifiedpermissions#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.verifiedpermissions#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.verifiedpermissions#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdatePolicyTemplateCommand */ @@ -1921,7 +967,7 @@ export const de_UpdatePolicyTemplateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePolicyTemplateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1934,12 +980,9 @@ export const de_UpdatePolicyTemplateCommand = async ( }; /** - * deserializeAws_json1_0UpdatePolicyTemplateCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdatePolicyTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1949,9 +992,6 @@ const de_UpdatePolicyTemplateCommandError = async ( case "AccessDeniedException": case "com.amazonaws.verifiedpermissions#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.verifiedpermissions#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.verifiedpermissions#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); @@ -1964,13 +1004,19 @@ const de_UpdatePolicyTemplateCommandError = async ( case "ValidationException": case "com.amazonaws.verifiedpermissions#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.verifiedpermissions#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.verifiedpermissions#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-voice-id/src/protocols/Aws_json1_0.ts b/clients/client-voice-id/src/protocols/Aws_json1_0.ts index 74bfc1ed9ea7..7c3dc59ee4c6 100644 --- a/clients/client-voice-id/src/protocols/Aws_json1_0.ts +++ b/clients/client-voice-id/src/protocols/Aws_json1_0.ts @@ -542,7 +542,7 @@ export const de_AssociateFraudsterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateFraudsterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -554,50 +554,6 @@ export const de_AssociateFraudsterCommand = async ( return response; }; -/** - * deserializeAws_json1_0AssociateFraudsterCommandError - */ -const de_AssociateFraudsterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.voiceid#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.voiceid#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateDomainCommand */ @@ -606,7 +562,7 @@ export const de_CreateDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -618,50 +574,6 @@ export const de_CreateDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateDomainCommandError - */ -const de_CreateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.voiceid#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.voiceid#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0CreateWatchlistCommand */ @@ -670,7 +582,7 @@ export const de_CreateWatchlistCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateWatchlistCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -682,50 +594,6 @@ export const de_CreateWatchlistCommand = async ( return response; }; -/** - * deserializeAws_json1_0CreateWatchlistCommandError - */ -const de_CreateWatchlistCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.voiceid#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.voiceid#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteDomainCommand */ @@ -734,7 +602,7 @@ export const de_DeleteDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteDomainCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteDomainCommandOutput = { @@ -743,47 +611,6 @@ export const de_DeleteDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteDomainCommandError - */ -const de_DeleteDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.voiceid#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteFraudsterCommand */ @@ -792,7 +619,7 @@ export const de_DeleteFraudsterCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteFraudsterCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteFraudsterCommandOutput = { @@ -801,47 +628,6 @@ export const de_DeleteFraudsterCommand = async ( return response; }; -/** - * deserializeAws_json1_0DeleteFraudsterCommandError - */ -const de_DeleteFraudsterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.voiceid#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DeleteSpeakerCommand */ @@ -850,7 +636,7 @@ export const de_DeleteSpeakerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteSpeakerCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: DeleteSpeakerCommandOutput = { @@ -860,171 +646,51 @@ export const de_DeleteSpeakerCommand = async ( }; /** - * deserializeAws_json1_0DeleteSpeakerCommandError + * deserializeAws_json1_0DeleteWatchlistCommand */ -const de_DeleteSpeakerCommandError = async ( +export const de_DeleteWatchlistCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.voiceid#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + await collectBody(output.body, context); + const response: DeleteWatchlistCommandOutput = { + $metadata: deserializeMetadata(output), + }; + return response; }; /** - * deserializeAws_json1_0DeleteWatchlistCommand + * deserializeAws_json1_0DescribeDomainCommand */ -export const de_DeleteWatchlistCommand = async ( +export const de_DescribeDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteWatchlistCommandError(output, context); + return de_CommandError(output, context); } - await collectBody(output.body, context); - const response: DeleteWatchlistCommandOutput = { + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeDomainResponse(data, context); + const response: DescribeDomainCommandOutput = { $metadata: deserializeMetadata(output), + ...contents, }; return response; }; /** - * deserializeAws_json1_0DeleteWatchlistCommandError + * deserializeAws_json1_0DescribeFraudsterCommand */ -const de_DeleteWatchlistCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.voiceid#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeDomainCommand - */ -export const de_DescribeDomainCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeDomainCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeDomainResponse(data, context); - const response: DescribeDomainCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeDomainCommandError - */ -const de_DescribeDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeFraudsterCommand - */ -export const de_DescribeFraudsterCommand = async ( +export const de_DescribeFraudsterCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFraudsterCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1036,44 +702,6 @@ export const de_DescribeFraudsterCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeFraudsterCommandError - */ -const de_DescribeFraudsterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeFraudsterRegistrationJobCommand */ @@ -1082,7 +710,7 @@ export const de_DescribeFraudsterRegistrationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeFraudsterRegistrationJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1094,44 +722,6 @@ export const de_DescribeFraudsterRegistrationJobCommand = async ( return response; }; -/** - * deserializeAws_json1_0DescribeFraudsterRegistrationJobCommandError - */ -const de_DescribeFraudsterRegistrationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0DescribeSpeakerCommand */ @@ -1140,421 +730,32 @@ export const de_DescribeSpeakerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeSpeakerCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeSpeakerResponse(data, context); - const response: DescribeSpeakerCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeSpeakerCommandError - */ -const de_DescribeSpeakerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeSpeakerEnrollmentJobCommand - */ -export const de_DescribeSpeakerEnrollmentJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeSpeakerEnrollmentJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeSpeakerEnrollmentJobResponse(data, context); - const response: DescribeSpeakerEnrollmentJobCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeSpeakerEnrollmentJobCommandError - */ -const de_DescribeSpeakerEnrollmentJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DescribeWatchlistCommand - */ -export const de_DescribeWatchlistCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeWatchlistCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeWatchlistResponse(data, context); - const response: DescribeWatchlistCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DescribeWatchlistCommandError - */ -const de_DescribeWatchlistCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0DisassociateFraudsterCommand - */ -export const de_DisassociateFraudsterCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisassociateFraudsterCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DisassociateFraudsterResponse(data, context); - const response: DisassociateFraudsterCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0DisassociateFraudsterCommandError - */ -const de_DisassociateFraudsterCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.voiceid#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0EvaluateSessionCommand - */ -export const de_EvaluateSessionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_EvaluateSessionCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_EvaluateSessionResponse(data, context); - const response: EvaluateSessionCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0EvaluateSessionCommandError - */ -const de_EvaluateSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.voiceid#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListDomainsCommand - */ -export const de_ListDomainsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListDomainsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListDomainsResponse(data, context); - const response: ListDomainsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListDomainsCommandError - */ -const de_ListDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_0ListFraudsterRegistrationJobsCommand - */ -export const de_ListFraudsterRegistrationJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListFraudsterRegistrationJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListFraudsterRegistrationJobsResponse(data, context); - const response: ListFraudsterRegistrationJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_0ListFraudsterRegistrationJobsCommandError - */ -const de_ListFraudsterRegistrationJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + contents = de_DescribeSpeakerResponse(data, context); + const response: DescribeSpeakerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListFraudstersCommand + * deserializeAws_json1_0DescribeSpeakerEnrollmentJobCommand */ -export const de_ListFraudstersCommand = async ( +export const de_DescribeSpeakerEnrollmentJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListFraudstersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListFraudstersResponse(data, context); - const response: ListFraudstersCommandOutput = { + contents = de_DescribeSpeakerEnrollmentJobResponse(data, context); + const response: DescribeSpeakerEnrollmentJobCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1562,57 +763,39 @@ export const de_ListFraudstersCommand = async ( }; /** - * deserializeAws_json1_0ListFraudstersCommandError + * deserializeAws_json1_0DescribeWatchlistCommand */ -const de_ListFraudstersCommandError = async ( +export const de_DescribeWatchlistCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeWatchlistResponse(data, context); + const response: DescribeWatchlistCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListSpeakerEnrollmentJobsCommand + * deserializeAws_json1_0DisassociateFraudsterCommand */ -export const de_ListSpeakerEnrollmentJobsCommand = async ( +export const de_DisassociateFraudsterCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSpeakerEnrollmentJobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListSpeakerEnrollmentJobsResponse(data, context); - const response: ListSpeakerEnrollmentJobsCommandOutput = { + contents = de_DisassociateFraudsterResponse(data, context); + const response: DisassociateFraudsterCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1620,57 +803,39 @@ export const de_ListSpeakerEnrollmentJobsCommand = async ( }; /** - * deserializeAws_json1_0ListSpeakerEnrollmentJobsCommandError + * deserializeAws_json1_0EvaluateSessionCommand */ -const de_ListSpeakerEnrollmentJobsCommandError = async ( +export const de_EvaluateSessionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_EvaluateSessionResponse(data, context); + const response: EvaluateSessionCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListSpeakersCommand + * deserializeAws_json1_0ListDomainsCommand */ -export const de_ListSpeakersCommand = async ( +export const de_ListDomainsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListSpeakersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListSpeakersResponse(data, context); - const response: ListSpeakersCommandOutput = { + contents = de_ListDomainsResponse(data, context); + const response: ListDomainsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1678,57 +843,39 @@ export const de_ListSpeakersCommand = async ( }; /** - * deserializeAws_json1_0ListSpeakersCommandError + * deserializeAws_json1_0ListFraudsterRegistrationJobsCommand */ -const de_ListSpeakersCommandError = async ( +export const de_ListFraudsterRegistrationJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListFraudsterRegistrationJobsResponse(data, context); + const response: ListFraudsterRegistrationJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListTagsForResourceCommand + * deserializeAws_json1_0ListFraudstersCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListFraudstersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { + contents = de_ListFraudstersResponse(data, context); + const response: ListFraudstersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1736,57 +883,39 @@ export const de_ListTagsForResourceCommand = async ( }; /** - * deserializeAws_json1_0ListTagsForResourceCommandError + * deserializeAws_json1_0ListSpeakerEnrollmentJobsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListSpeakerEnrollmentJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListSpeakerEnrollmentJobsResponse(data, context); + const response: ListSpeakerEnrollmentJobsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0ListWatchlistsCommand + * deserializeAws_json1_0ListSpeakersCommand */ -export const de_ListWatchlistsCommand = async ( +export const de_ListSpeakersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListWatchlistsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_ListWatchlistsResponse(data, context); - const response: ListWatchlistsCommandOutput = { + contents = de_ListSpeakersResponse(data, context); + const response: ListSpeakersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1794,57 +923,39 @@ export const de_ListWatchlistsCommand = async ( }; /** - * deserializeAws_json1_0ListWatchlistsCommandError + * deserializeAws_json1_0ListTagsForResourceCommand */ -const de_ListWatchlistsCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_0OptOutSpeakerCommand + * deserializeAws_json1_0ListWatchlistsCommand */ -export const de_OptOutSpeakerCommand = async ( +export const de_ListWatchlistsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_OptOutSpeakerCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_OptOutSpeakerResponse(data, context); - const response: OptOutSpeakerCommandOutput = { + contents = de_ListWatchlistsResponse(data, context); + const response: ListWatchlistsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1852,47 +963,23 @@ export const de_OptOutSpeakerCommand = async ( }; /** - * deserializeAws_json1_0OptOutSpeakerCommandError + * deserializeAws_json1_0OptOutSpeakerCommand */ -const de_OptOutSpeakerCommandError = async ( +export const de_OptOutSpeakerCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.voiceid#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.voiceid#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_OptOutSpeakerResponse(data, context); + const response: OptOutSpeakerCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -1903,7 +990,7 @@ export const de_StartFraudsterRegistrationJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartFraudsterRegistrationJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1915,50 +1002,6 @@ export const de_StartFraudsterRegistrationJobCommand = async ( return response; }; -/** - * deserializeAws_json1_0StartFraudsterRegistrationJobCommandError - */ -const de_StartFraudsterRegistrationJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.voiceid#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.voiceid#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0StartSpeakerEnrollmentJobCommand */ @@ -1967,7 +1010,7 @@ export const de_StartSpeakerEnrollmentJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartSpeakerEnrollmentJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1979,50 +1022,6 @@ export const de_StartSpeakerEnrollmentJobCommand = async ( return response; }; -/** - * deserializeAws_json1_0StartSpeakerEnrollmentJobCommandError - */ -const de_StartSpeakerEnrollmentJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.voiceid#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.voiceid#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0TagResourceCommand */ @@ -2031,7 +1030,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2043,47 +1042,6 @@ export const de_TagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.voiceid#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UntagResourceCommand */ @@ -2092,7 +1050,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2104,47 +1062,6 @@ export const de_UntagResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_0UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.voiceid#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateDomainCommand */ @@ -2153,7 +1070,7 @@ export const de_UpdateDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2165,47 +1082,6 @@ export const de_UpdateDomainCommand = async ( return response; }; -/** - * deserializeAws_json1_0UpdateDomainCommandError - */ -const de_UpdateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.voiceid#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.voiceid#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.voiceid#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.voiceid#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.voiceid#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.voiceid#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0UpdateWatchlistCommand */ @@ -2214,7 +1090,7 @@ export const de_UpdateWatchlistCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateWatchlistCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2227,12 +1103,9 @@ export const de_UpdateWatchlistCommand = async ( }; /** - * deserializeAws_json1_0UpdateWatchlistCommandError + * deserialize_Aws_json1_0CommandError */ -const de_UpdateWatchlistCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2251,6 +1124,9 @@ const de_UpdateWatchlistCommandError = async ( case "ResourceNotFoundException": case "com.amazonaws.voiceid#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.voiceid#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.voiceid#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); @@ -2263,7 +1139,7 @@ const de_UpdateWatchlistCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-vpc-lattice/src/protocols/Aws_restJson1.ts b/clients/client-vpc-lattice/src/protocols/Aws_restJson1.ts index 9dac6e199cfc..8c33e94418e3 100644 --- a/clients/client-vpc-lattice/src/protocols/Aws_restJson1.ts +++ b/clients/client-vpc-lattice/src/protocols/Aws_restJson1.ts @@ -1291,7 +1291,7 @@ export const de_BatchUpdateRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchUpdateRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1305,47 +1305,6 @@ export const de_BatchUpdateRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchUpdateRuleCommandError - */ -const de_BatchUpdateRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAccessLogSubscriptionCommand */ @@ -1354,7 +1313,7 @@ export const de_CreateAccessLogSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateAccessLogSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1371,47 +1330,6 @@ export const de_CreateAccessLogSubscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAccessLogSubscriptionCommandError - */ -const de_CreateAccessLogSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateListenerCommand */ @@ -1420,7 +1338,7 @@ export const de_CreateListenerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateListenerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1440,50 +1358,6 @@ export const de_CreateListenerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateListenerCommandError - */ -const de_CreateListenerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.vpclattice#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateRuleCommand */ @@ -1492,7 +1366,7 @@ export const de_CreateRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1510,50 +1384,6 @@ export const de_CreateRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateRuleCommandError - */ -const de_CreateRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.vpclattice#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateServiceCommand */ @@ -1562,7 +1392,7 @@ export const de_CreateServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateServiceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1582,50 +1412,6 @@ export const de_CreateServiceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateServiceCommandError - */ -const de_CreateServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.vpclattice#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateServiceNetworkCommand */ @@ -1634,7 +1420,7 @@ export const de_CreateServiceNetworkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateServiceNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1650,50 +1436,6 @@ export const de_CreateServiceNetworkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateServiceNetworkCommandError - */ -const de_CreateServiceNetworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.vpclattice#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateServiceNetworkServiceAssociationCommand */ @@ -1702,7 +1444,7 @@ export const de_CreateServiceNetworkServiceAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateServiceNetworkServiceAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1721,58 +1463,14 @@ export const de_CreateServiceNetworkServiceAssociationCommand = async ( }; /** - * deserializeAws_restJson1CreateServiceNetworkServiceAssociationCommandError + * deserializeAws_restJson1CreateServiceNetworkVpcAssociationCommand */ -const de_CreateServiceNetworkServiceAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.vpclattice#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateServiceNetworkVpcAssociationCommand - */ -export const de_CreateServiceNetworkVpcAssociationCommand = async ( +export const de_CreateServiceNetworkVpcAssociationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateServiceNetworkVpcAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1789,50 +1487,6 @@ export const de_CreateServiceNetworkVpcAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateServiceNetworkVpcAssociationCommandError - */ -const de_CreateServiceNetworkVpcAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.vpclattice#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateTargetGroupCommand */ @@ -1841,7 +1495,7 @@ export const de_CreateTargetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateTargetGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1859,50 +1513,6 @@ export const de_CreateTargetGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTargetGroupCommandError - */ -const de_CreateTargetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.vpclattice#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAccessLogSubscriptionCommand */ @@ -1911,7 +1521,7 @@ export const de_DeleteAccessLogSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAccessLogSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1920,44 +1530,6 @@ export const de_DeleteAccessLogSubscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAccessLogSubscriptionCommandError - */ -const de_DeleteAccessLogSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAuthPolicyCommand */ @@ -1966,7 +1538,7 @@ export const de_DeleteAuthPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAuthPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1975,44 +1547,6 @@ export const de_DeleteAuthPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAuthPolicyCommandError - */ -const de_DeleteAuthPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteListenerCommand */ @@ -2021,7 +1555,7 @@ export const de_DeleteListenerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteListenerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2030,47 +1564,6 @@ export const de_DeleteListenerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteListenerCommandError - */ -const de_DeleteListenerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteResourcePolicyCommand */ @@ -2079,7 +1572,7 @@ export const de_DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2088,44 +1581,6 @@ export const de_DeleteResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteRuleCommand */ @@ -2134,7 +1589,7 @@ export const de_DeleteRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2144,55 +1599,14 @@ export const de_DeleteRuleCommand = async ( }; /** - * deserializeAws_restJson1DeleteRuleCommandError + * deserializeAws_restJson1DeleteServiceCommand */ -const de_DeleteRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteServiceCommand - */ -export const de_DeleteServiceCommand = async ( +export const de_DeleteServiceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteServiceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2208,47 +1622,6 @@ export const de_DeleteServiceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteServiceCommandError - */ -const de_DeleteServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteServiceNetworkCommand */ @@ -2257,7 +1630,7 @@ export const de_DeleteServiceNetworkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteServiceNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2266,47 +1639,6 @@ export const de_DeleteServiceNetworkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteServiceNetworkCommandError - */ -const de_DeleteServiceNetworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteServiceNetworkServiceAssociationCommand */ @@ -2315,7 +1647,7 @@ export const de_DeleteServiceNetworkServiceAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteServiceNetworkServiceAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2330,47 +1662,6 @@ export const de_DeleteServiceNetworkServiceAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteServiceNetworkServiceAssociationCommandError - */ -const de_DeleteServiceNetworkServiceAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteServiceNetworkVpcAssociationCommand */ @@ -2379,7 +1670,7 @@ export const de_DeleteServiceNetworkVpcAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteServiceNetworkVpcAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2394,47 +1685,6 @@ export const de_DeleteServiceNetworkVpcAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteServiceNetworkVpcAssociationCommandError - */ -const de_DeleteServiceNetworkVpcAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteTargetGroupCommand */ @@ -2443,7 +1693,7 @@ export const de_DeleteTargetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTargetGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2459,180 +1709,63 @@ export const de_DeleteTargetGroupCommand = async ( }; /** - * deserializeAws_restJson1DeleteTargetGroupCommandError + * deserializeAws_restJson1DeregisterTargetsCommand */ -const de_DeleteTargetGroupCommandError = async ( +export const de_DeregisterTargetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + successful: _json, + unsuccessful: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DeregisterTargetsCommand + * deserializeAws_restJson1GetAccessLogSubscriptionCommand */ -export const de_DeregisterTargetsCommand = async ( +export const de_GetAccessLogSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeregisterTargetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - successful: _json, - unsuccessful: _json, + arn: __expectString, + createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + destinationArn: __expectString, + id: __expectString, + lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + resourceArn: __expectString, + resourceId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DeregisterTargetsCommandError + * deserializeAws_restJson1GetAuthPolicyCommand */ -const de_DeregisterTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAccessLogSubscriptionCommand - */ -export const de_GetAccessLogSubscriptionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAccessLogSubscriptionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - arn: __expectString, - createdAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - destinationArn: __expectString, - id: __expectString, - lastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), - resourceArn: __expectString, - resourceId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAccessLogSubscriptionCommandError - */ -const de_GetAccessLogSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAuthPolicyCommand - */ -export const de_GetAuthPolicyCommand = async ( +export const de_GetAuthPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAuthPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2648,44 +1781,6 @@ export const de_GetAuthPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAuthPolicyCommandError - */ -const de_GetAuthPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetListenerCommand */ @@ -2694,7 +1789,7 @@ export const de_GetListenerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetListenerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2716,44 +1811,6 @@ export const de_GetListenerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetListenerCommandError - */ -const de_GetListenerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetResourcePolicyCommand */ @@ -2762,7 +1819,7 @@ export const de_GetResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2775,44 +1832,6 @@ export const de_GetResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetResourcePolicyCommandError - */ -const de_GetResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRuleCommand */ @@ -2821,7 +1840,7 @@ export const de_GetRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2842,44 +1861,6 @@ export const de_GetRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRuleCommandError - */ -const de_GetRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetServiceCommand */ @@ -2888,7 +1869,7 @@ export const de_GetServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetServiceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2913,52 +1894,14 @@ export const de_GetServiceCommand = async ( }; /** - * deserializeAws_restJson1GetServiceCommandError + * deserializeAws_restJson1GetServiceNetworkCommand */ -const de_GetServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetServiceNetworkCommand - */ -export const de_GetServiceNetworkCommand = async ( +export const de_GetServiceNetworkCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetServiceNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2978,44 +1921,6 @@ export const de_GetServiceNetworkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetServiceNetworkCommandError - */ -const de_GetServiceNetworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetServiceNetworkServiceAssociationCommand */ @@ -3024,7 +1929,7 @@ export const de_GetServiceNetworkServiceAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetServiceNetworkServiceAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3051,44 +1956,6 @@ export const de_GetServiceNetworkServiceAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetServiceNetworkServiceAssociationCommandError - */ -const de_GetServiceNetworkServiceAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetServiceNetworkVpcAssociationCommand */ @@ -3097,7 +1964,7 @@ export const de_GetServiceNetworkVpcAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetServiceNetworkVpcAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3122,44 +1989,6 @@ export const de_GetServiceNetworkVpcAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetServiceNetworkVpcAssociationCommandError - */ -const de_GetServiceNetworkVpcAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTargetGroupCommand */ @@ -3168,7 +1997,7 @@ export const de_GetTargetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTargetGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3191,44 +2020,6 @@ export const de_GetTargetGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTargetGroupCommandError - */ -const de_GetTargetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAccessLogSubscriptionsCommand */ @@ -3237,7 +2028,7 @@ export const de_ListAccessLogSubscriptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAccessLogSubscriptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3251,41 +2042,6 @@ export const de_ListAccessLogSubscriptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAccessLogSubscriptionsCommandError - */ -const de_ListAccessLogSubscriptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListListenersCommand */ @@ -3294,7 +2050,7 @@ export const de_ListListenersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListListenersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3309,59 +2065,43 @@ export const de_ListListenersCommand = async ( }; /** - * deserializeAws_restJson1ListListenersCommandError + * deserializeAws_restJson1ListRulesCommand */ -const de_ListListenersCommandError = async ( +export const de_ListRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: (_) => de_RuleSummaryList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListRulesCommand + * deserializeAws_restJson1ListServiceNetworksCommand */ -export const de_ListRulesCommand = async ( +export const de_ListServiceNetworksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListRulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - items: (_) => de_RuleSummaryList(_, context), + items: (_) => de_ServiceNetworkList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -3369,109 +2109,14 @@ export const de_ListRulesCommand = async ( }; /** - * deserializeAws_restJson1ListRulesCommandError + * deserializeAws_restJson1ListServiceNetworkServiceAssociationsCommand */ -const de_ListRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListServiceNetworksCommand - */ -export const de_ListServiceNetworksCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListServiceNetworksCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - items: (_) => de_ServiceNetworkList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListServiceNetworksCommandError - */ -const de_ListServiceNetworksCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListServiceNetworkServiceAssociationsCommand - */ -export const de_ListServiceNetworkServiceAssociationsCommand = async ( +export const de_ListServiceNetworkServiceAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListServiceNetworkServiceAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3485,41 +2130,6 @@ export const de_ListServiceNetworkServiceAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListServiceNetworkServiceAssociationsCommandError - */ -const de_ListServiceNetworkServiceAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListServiceNetworkVpcAssociationsCommand */ @@ -3528,7 +2138,7 @@ export const de_ListServiceNetworkVpcAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListServiceNetworkVpcAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3542,41 +2152,6 @@ export const de_ListServiceNetworkVpcAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListServiceNetworkVpcAssociationsCommandError - */ -const de_ListServiceNetworkVpcAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListServicesCommand */ @@ -3585,7 +2160,7 @@ export const de_ListServicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListServicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3599,41 +2174,6 @@ export const de_ListServicesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListServicesCommandError - */ -const de_ListServicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -3642,7 +2182,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3655,41 +2195,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTargetGroupsCommand */ @@ -3698,7 +2203,7 @@ export const de_ListTargetGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTargetGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3712,41 +2217,6 @@ export const de_ListTargetGroupsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTargetGroupsCommandError - */ -const de_ListTargetGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTargetsCommand */ @@ -3755,7 +2225,7 @@ export const de_ListTargetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTargetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3769,44 +2239,6 @@ export const de_ListTargetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTargetsCommandError - */ -const de_ListTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutAuthPolicyCommand */ @@ -3815,7 +2247,7 @@ export const de_PutAuthPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutAuthPolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3829,44 +2261,6 @@ export const de_PutAuthPolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutAuthPolicyCommandError - */ -const de_PutAuthPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutResourcePolicyCommand */ @@ -3875,7 +2269,7 @@ export const de_PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3884,44 +2278,6 @@ export const de_PutResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RegisterTargetsCommand */ @@ -3930,7 +2286,7 @@ export const de_RegisterTargetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RegisterTargetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3944,50 +2300,6 @@ export const de_RegisterTargetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RegisterTargetsCommandError - */ -const de_RegisterTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.vpclattice#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -3995,104 +2307,31 @@ export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UntagResourceCommand - */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UntagResourceCommand + */ +export const de_UntagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -4103,7 +2342,7 @@ export const de_UpdateAccessLogSubscriptionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAccessLogSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4120,47 +2359,6 @@ export const de_UpdateAccessLogSubscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateAccessLogSubscriptionCommandError - */ -const de_UpdateAccessLogSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateListenerCommand */ @@ -4169,7 +2367,7 @@ export const de_UpdateListenerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateListenerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4189,47 +2387,6 @@ export const de_UpdateListenerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateListenerCommandError - */ -const de_UpdateListenerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateRuleCommand */ @@ -4238,7 +2395,7 @@ export const de_UpdateRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4257,47 +2414,6 @@ export const de_UpdateRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateRuleCommandError - */ -const de_UpdateRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateServiceCommand */ @@ -4306,7 +2422,7 @@ export const de_UpdateServiceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateServiceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4324,47 +2440,6 @@ export const de_UpdateServiceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateServiceCommandError - */ -const de_UpdateServiceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateServiceNetworkCommand */ @@ -4373,7 +2448,7 @@ export const de_UpdateServiceNetworkCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateServiceNetworkCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4389,47 +2464,6 @@ export const de_UpdateServiceNetworkCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateServiceNetworkCommandError - */ -const de_UpdateServiceNetworkCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateServiceNetworkVpcAssociationCommand */ @@ -4438,7 +2472,7 @@ export const de_UpdateServiceNetworkVpcAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateServiceNetworkVpcAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4455,47 +2489,6 @@ export const de_UpdateServiceNetworkVpcAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateServiceNetworkVpcAssociationCommandError - */ -const de_UpdateServiceNetworkVpcAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.vpclattice#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.vpclattice#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.vpclattice#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.vpclattice#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.vpclattice#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.vpclattice#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTargetGroupCommand */ @@ -4504,7 +2497,7 @@ export const de_UpdateTargetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTargetGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4523,12 +2516,9 @@ export const de_UpdateTargetGroupCommand = async ( }; /** - * deserializeAws_restJson1UpdateTargetGroupCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateTargetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4553,13 +2543,16 @@ const de_UpdateTargetGroupCommandError = async ( case "ValidationException": case "com.amazonaws.vpclattice#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.vpclattice#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-waf-regional/src/protocols/Aws_json1_1.ts b/clients/client-waf-regional/src/protocols/Aws_json1_1.ts index d64e6591e011..b1ec14c5cbfe 100644 --- a/clients/client-waf-regional/src/protocols/Aws_json1_1.ts +++ b/clients/client-waf-regional/src/protocols/Aws_json1_1.ts @@ -1403,7 +1403,7 @@ export const de_AssociateWebACLCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1415,44 +1415,6 @@ export const de_AssociateWebACLCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateWebACLCommandError - */ -const de_AssociateWebACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFUnavailableEntityException": - case "com.amazonaws.wafregional#WAFUnavailableEntityException": - throw await de_WAFUnavailableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateByteMatchSetCommand */ @@ -1461,7 +1423,7 @@ export const de_CreateByteMatchSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateByteMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1473,47 +1435,6 @@ export const de_CreateByteMatchSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateByteMatchSetCommandError - */ -const de_CreateByteMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.wafregional#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateGeoMatchSetCommand */ @@ -1522,7 +1443,7 @@ export const de_CreateGeoMatchSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateGeoMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1534,47 +1455,6 @@ export const de_CreateGeoMatchSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateGeoMatchSetCommandError - */ -const de_CreateGeoMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.wafregional#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateIPSetCommand */ @@ -1583,7 +1463,7 @@ export const de_CreateIPSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateIPSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1595,47 +1475,6 @@ export const de_CreateIPSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateIPSetCommandError - */ -const de_CreateIPSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.wafregional#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateRateBasedRuleCommand */ @@ -1644,7 +1483,7 @@ export const de_CreateRateBasedRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRateBasedRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1657,66 +1496,39 @@ export const de_CreateRateBasedRuleCommand = async ( }; /** - * deserializeAws_json1_1CreateRateBasedRuleCommandError + * deserializeAws_json1_1CreateRegexMatchSetCommand */ -const de_CreateRateBasedRuleCommandError = async ( +export const de_CreateRegexMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFBadRequestException": - case "com.amazonaws.wafregional#WAFBadRequestException": - throw await de_WAFBadRequestExceptionRes(parsedOutput, context); - case "WAFDisallowedNameException": - case "com.amazonaws.wafregional#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafregional#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafregional#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateRegexMatchSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateRegexMatchSetCommand + * deserializeAws_json1_1CreateRegexPatternSetCommand */ -export const de_CreateRegexMatchSetCommand = async ( +export const de_CreateRegexPatternSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateRegexMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateRegexMatchSetCommandOutput = { + const response: CreateRegexPatternSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1724,54 +1536,39 @@ export const de_CreateRegexMatchSetCommand = async ( }; /** - * deserializeAws_json1_1CreateRegexMatchSetCommandError + * deserializeAws_json1_1CreateRuleCommand */ -const de_CreateRegexMatchSetCommandError = async ( +export const de_CreateRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.wafregional#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateRuleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateRegexPatternSetCommand + * deserializeAws_json1_1CreateRuleGroupCommand */ -export const de_CreateRegexPatternSetCommand = async ( +export const de_CreateRuleGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateRegexPatternSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateRegexPatternSetCommandOutput = { + const response: CreateRuleGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1779,54 +1576,39 @@ export const de_CreateRegexPatternSetCommand = async ( }; /** - * deserializeAws_json1_1CreateRegexPatternSetCommandError + * deserializeAws_json1_1CreateSizeConstraintSetCommand */ -const de_CreateRegexPatternSetCommandError = async ( +export const de_CreateSizeConstraintSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.wafregional#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateSizeConstraintSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateRuleCommand + * deserializeAws_json1_1CreateSqlInjectionMatchSetCommand */ -export const de_CreateRuleCommand = async ( +export const de_CreateSqlInjectionMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateRuleCommandOutput = { + const response: CreateSqlInjectionMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1834,66 +1616,39 @@ export const de_CreateRuleCommand = async ( }; /** - * deserializeAws_json1_1CreateRuleCommandError + * deserializeAws_json1_1CreateWebACLCommand */ -const de_CreateRuleCommandError = async ( +export const de_CreateWebACLCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFBadRequestException": - case "com.amazonaws.wafregional#WAFBadRequestException": - throw await de_WAFBadRequestExceptionRes(parsedOutput, context); - case "WAFDisallowedNameException": - case "com.amazonaws.wafregional#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafregional#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafregional#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateWebACLCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateRuleGroupCommand + * deserializeAws_json1_1CreateWebACLMigrationStackCommand */ -export const de_CreateRuleGroupCommand = async ( +export const de_CreateWebACLMigrationStackCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateRuleGroupCommandOutput = { + const response: CreateWebACLMigrationStackCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1901,63 +1656,39 @@ export const de_CreateRuleGroupCommand = async ( }; /** - * deserializeAws_json1_1CreateRuleGroupCommandError + * deserializeAws_json1_1CreateXssMatchSetCommand */ -const de_CreateRuleGroupCommandError = async ( +export const de_CreateXssMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFBadRequestException": - case "com.amazonaws.wafregional#WAFBadRequestException": - throw await de_WAFBadRequestExceptionRes(parsedOutput, context); - case "WAFDisallowedNameException": - case "com.amazonaws.wafregional#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafregional#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafregional#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateXssMatchSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateSizeConstraintSetCommand + * deserializeAws_json1_1DeleteByteMatchSetCommand */ -export const de_CreateSizeConstraintSetCommand = async ( +export const de_DeleteByteMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateSizeConstraintSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateSizeConstraintSetCommandOutput = { + const response: DeleteByteMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1965,60 +1696,39 @@ export const de_CreateSizeConstraintSetCommand = async ( }; /** - * deserializeAws_json1_1CreateSizeConstraintSetCommandError + * deserializeAws_json1_1DeleteGeoMatchSetCommand */ -const de_CreateSizeConstraintSetCommandError = async ( +export const de_DeleteGeoMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.wafregional#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteGeoMatchSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateSqlInjectionMatchSetCommand + * deserializeAws_json1_1DeleteIPSetCommand */ -export const de_CreateSqlInjectionMatchSetCommand = async ( +export const de_DeleteIPSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateSqlInjectionMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateSqlInjectionMatchSetCommandOutput = { + const response: DeleteIPSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2026,60 +1736,39 @@ export const de_CreateSqlInjectionMatchSetCommand = async ( }; /** - * deserializeAws_json1_1CreateSqlInjectionMatchSetCommandError + * deserializeAws_json1_1DeleteLoggingConfigurationCommand */ -const de_CreateSqlInjectionMatchSetCommandError = async ( +export const de_DeleteLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.wafregional#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteLoggingConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateWebACLCommand + * deserializeAws_json1_1DeletePermissionPolicyCommand */ -export const de_CreateWebACLCommand = async ( +export const de_DeletePermissionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateWebACLCommandOutput = { + const response: DeletePermissionPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2087,69 +1776,19 @@ export const de_CreateWebACLCommand = async ( }; /** - * deserializeAws_json1_1CreateWebACLCommandError + * deserializeAws_json1_1DeleteRateBasedRuleCommand */ -const de_CreateWebACLCommandError = async ( +export const de_DeleteRateBasedRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFBadRequestException": - case "com.amazonaws.wafregional#WAFBadRequestException": - throw await de_WAFBadRequestExceptionRes(parsedOutput, context); - case "WAFDisallowedNameException": - case "com.amazonaws.wafregional#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafregional#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafregional#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateWebACLMigrationStackCommand - */ -export const de_CreateWebACLMigrationStackCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateWebACLMigrationStackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateWebACLMigrationStackCommandOutput = { + const response: DeleteRateBasedRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2157,57 +1796,39 @@ export const de_CreateWebACLMigrationStackCommand = async ( }; /** - * deserializeAws_json1_1CreateWebACLMigrationStackCommandError + * deserializeAws_json1_1DeleteRegexMatchSetCommand */ -const de_CreateWebACLMigrationStackCommandError = async ( +export const de_DeleteRegexMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFEntityMigrationException": - case "com.amazonaws.wafregional#WAFEntityMigrationException": - throw await de_WAFEntityMigrationExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafregional#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteRegexMatchSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateXssMatchSetCommand + * deserializeAws_json1_1DeleteRegexPatternSetCommand */ -export const de_CreateXssMatchSetCommand = async ( +export const de_DeleteRegexPatternSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateXssMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateXssMatchSetCommandOutput = { + const response: DeleteRegexPatternSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2215,60 +1836,39 @@ export const de_CreateXssMatchSetCommand = async ( }; /** - * deserializeAws_json1_1CreateXssMatchSetCommandError + * deserializeAws_json1_1DeleteRuleCommand */ -const de_CreateXssMatchSetCommandError = async ( +export const de_DeleteRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.wafregional#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteRuleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteByteMatchSetCommand + * deserializeAws_json1_1DeleteRuleGroupCommand */ -export const de_DeleteByteMatchSetCommand = async ( +export const de_DeleteRuleGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteByteMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteByteMatchSetCommandOutput = { + const response: DeleteRuleGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2276,60 +1876,39 @@ export const de_DeleteByteMatchSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteByteMatchSetCommandError + * deserializeAws_json1_1DeleteSizeConstraintSetCommand */ -const de_DeleteByteMatchSetCommandError = async ( +export const de_DeleteSizeConstraintSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.wafregional#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteSizeConstraintSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteGeoMatchSetCommand + * deserializeAws_json1_1DeleteSqlInjectionMatchSetCommand */ -export const de_DeleteGeoMatchSetCommand = async ( +export const de_DeleteSqlInjectionMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteGeoMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteGeoMatchSetCommandOutput = { + const response: DeleteSqlInjectionMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2337,60 +1916,39 @@ export const de_DeleteGeoMatchSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteGeoMatchSetCommandError + * deserializeAws_json1_1DeleteWebACLCommand */ -const de_DeleteGeoMatchSetCommandError = async ( +export const de_DeleteWebACLCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.wafregional#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteWebACLCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteIPSetCommand + * deserializeAws_json1_1DeleteXssMatchSetCommand */ -export const de_DeleteIPSetCommand = async ( +export const de_DeleteXssMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteIPSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteIPSetCommandOutput = { + const response: DeleteXssMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2398,60 +1956,39 @@ export const de_DeleteIPSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteIPSetCommandError + * deserializeAws_json1_1DisassociateWebACLCommand */ -const de_DeleteIPSetCommandError = async ( +export const de_DisassociateWebACLCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.wafregional#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisassociateWebACLCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteLoggingConfigurationCommand + * deserializeAws_json1_1GetByteMatchSetCommand */ -export const de_DeleteLoggingConfigurationCommand = async ( +export const de_GetByteMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteLoggingConfigurationCommandOutput = { + contents = de_GetByteMatchSetResponse(data, context); + const response: GetByteMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2459,51 +1996,39 @@ export const de_DeleteLoggingConfigurationCommand = async ( }; /** - * deserializeAws_json1_1DeleteLoggingConfigurationCommandError + * deserializeAws_json1_1GetChangeTokenCommand */ -const de_DeleteLoggingConfigurationCommandError = async ( +export const de_GetChangeTokenCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetChangeTokenCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeletePermissionPolicyCommand + * deserializeAws_json1_1GetChangeTokenStatusCommand */ -export const de_DeletePermissionPolicyCommand = async ( +export const de_GetChangeTokenStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeletePermissionPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeletePermissionPolicyCommandOutput = { + const response: GetChangeTokenStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2511,51 +2036,39 @@ export const de_DeletePermissionPolicyCommand = async ( }; /** - * deserializeAws_json1_1DeletePermissionPolicyCommandError + * deserializeAws_json1_1GetGeoMatchSetCommand */ -const de_DeletePermissionPolicyCommandError = async ( +export const de_GetGeoMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetGeoMatchSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRateBasedRuleCommand + * deserializeAws_json1_1GetIPSetCommand */ -export const de_DeleteRateBasedRuleCommand = async ( +export const de_GetIPSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRateBasedRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRateBasedRuleCommandOutput = { + const response: GetIPSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2563,66 +2076,39 @@ export const de_DeleteRateBasedRuleCommand = async ( }; /** - * deserializeAws_json1_1DeleteRateBasedRuleCommandError + * deserializeAws_json1_1GetLoggingConfigurationCommand */ -const de_DeleteRateBasedRuleCommandError = async ( +export const de_GetLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.wafregional#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafregional#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafregional#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetLoggingConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRegexMatchSetCommand + * deserializeAws_json1_1GetPermissionPolicyCommand */ -export const de_DeleteRegexMatchSetCommand = async ( +export const de_GetPermissionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRegexMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRegexMatchSetCommandOutput = { + const response: GetPermissionPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2630,60 +2116,39 @@ export const de_DeleteRegexMatchSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteRegexMatchSetCommandError + * deserializeAws_json1_1GetRateBasedRuleCommand */ -const de_DeleteRegexMatchSetCommandError = async ( +export const de_GetRateBasedRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.wafregional#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetRateBasedRuleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRegexPatternSetCommand + * deserializeAws_json1_1GetRateBasedRuleManagedKeysCommand */ -export const de_DeleteRegexPatternSetCommand = async ( +export const de_GetRateBasedRuleManagedKeysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRegexPatternSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRegexPatternSetCommandOutput = { + const response: GetRateBasedRuleManagedKeysCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2691,60 +2156,39 @@ export const de_DeleteRegexPatternSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteRegexPatternSetCommandError + * deserializeAws_json1_1GetRegexMatchSetCommand */ -const de_DeleteRegexPatternSetCommandError = async ( +export const de_GetRegexMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.wafregional#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetRegexMatchSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRuleCommand + * deserializeAws_json1_1GetRegexPatternSetCommand */ -export const de_DeleteRuleCommand = async ( +export const de_GetRegexPatternSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRuleCommandOutput = { + const response: GetRegexPatternSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2752,66 +2196,39 @@ export const de_DeleteRuleCommand = async ( }; /** - * deserializeAws_json1_1DeleteRuleCommandError + * deserializeAws_json1_1GetRuleCommand */ -const de_DeleteRuleCommandError = async ( +export const de_GetRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.wafregional#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafregional#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafregional#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetRuleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRuleGroupCommand + * deserializeAws_json1_1GetRuleGroupCommand */ -export const de_DeleteRuleGroupCommand = async ( +export const de_GetRuleGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRuleGroupCommandOutput = { + const response: GetRuleGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2819,66 +2236,39 @@ export const de_DeleteRuleGroupCommand = async ( }; /** - * deserializeAws_json1_1DeleteRuleGroupCommandError + * deserializeAws_json1_1GetSampledRequestsCommand */ -const de_DeleteRuleGroupCommandError = async ( +export const de_GetSampledRequestsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafregional#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.wafregional#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafregional#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafregional#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetSampledRequestsResponse(data, context); + const response: GetSampledRequestsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteSizeConstraintSetCommand + * deserializeAws_json1_1GetSizeConstraintSetCommand */ -export const de_DeleteSizeConstraintSetCommand = async ( +export const de_GetSizeConstraintSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSizeConstraintSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteSizeConstraintSetCommandOutput = { + const response: GetSizeConstraintSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2886,60 +2276,39 @@ export const de_DeleteSizeConstraintSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteSizeConstraintSetCommandError + * deserializeAws_json1_1GetSqlInjectionMatchSetCommand */ -const de_DeleteSizeConstraintSetCommandError = async ( +export const de_GetSqlInjectionMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.wafregional#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetSqlInjectionMatchSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteSqlInjectionMatchSetCommand + * deserializeAws_json1_1GetWebACLCommand */ -export const de_DeleteSqlInjectionMatchSetCommand = async ( +export const de_GetWebACLCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSqlInjectionMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteSqlInjectionMatchSetCommandOutput = { + const response: GetWebACLCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2947,60 +2316,39 @@ export const de_DeleteSqlInjectionMatchSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteSqlInjectionMatchSetCommandError + * deserializeAws_json1_1GetWebACLForResourceCommand */ -const de_DeleteSqlInjectionMatchSetCommandError = async ( +export const de_GetWebACLForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.wafregional#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetWebACLForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteWebACLCommand + * deserializeAws_json1_1GetXssMatchSetCommand */ -export const de_DeleteWebACLCommand = async ( +export const de_GetXssMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteWebACLCommandOutput = { + const response: GetXssMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3008,66 +2356,19 @@ export const de_DeleteWebACLCommand = async ( }; /** - * deserializeAws_json1_1DeleteWebACLCommandError + * deserializeAws_json1_1ListActivatedRulesInRuleGroupCommand */ -const de_DeleteWebACLCommandError = async ( +export const de_ListActivatedRulesInRuleGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.wafregional#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafregional#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafregional#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteXssMatchSetCommand - */ -export const de_DeleteXssMatchSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteXssMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteXssMatchSetCommandOutput = { + const response: ListActivatedRulesInRuleGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3075,60 +2376,19 @@ export const de_DeleteXssMatchSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteXssMatchSetCommandError - */ -const de_DeleteXssMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.wafregional#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociateWebACLCommand + * deserializeAws_json1_1ListByteMatchSetsCommand */ -export const de_DisassociateWebACLCommand = async ( +export const de_ListByteMatchSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateWebACLCommandOutput = { + const response: ListByteMatchSetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3136,54 +2396,19 @@ export const de_DisassociateWebACLCommand = async ( }; /** - * deserializeAws_json1_1DisassociateWebACLCommandError - */ -const de_DisassociateWebACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetByteMatchSetCommand + * deserializeAws_json1_1ListGeoMatchSetsCommand */ -export const de_GetByteMatchSetCommand = async ( +export const de_ListGeoMatchSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetByteMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetByteMatchSetResponse(data, context); - const response: GetByteMatchSetCommandOutput = { + contents = _json(data); + const response: ListGeoMatchSetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3191,51 +2416,39 @@ export const de_GetByteMatchSetCommand = async ( }; /** - * deserializeAws_json1_1GetByteMatchSetCommandError + * deserializeAws_json1_1ListIPSetsCommand */ -const de_GetByteMatchSetCommandError = async ( +export const de_ListIPSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListIPSetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetChangeTokenCommand + * deserializeAws_json1_1ListLoggingConfigurationsCommand */ -export const de_GetChangeTokenCommand = async ( +export const de_ListLoggingConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetChangeTokenCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetChangeTokenCommandOutput = { + const response: ListLoggingConfigurationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3243,45 +2456,39 @@ export const de_GetChangeTokenCommand = async ( }; /** - * deserializeAws_json1_1GetChangeTokenCommandError + * deserializeAws_json1_1ListRateBasedRulesCommand */ -const de_GetChangeTokenCommandError = async ( +export const de_ListRateBasedRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListRateBasedRulesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetChangeTokenStatusCommand + * deserializeAws_json1_1ListRegexMatchSetsCommand */ -export const de_GetChangeTokenStatusCommand = async ( +export const de_ListRegexMatchSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetChangeTokenStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetChangeTokenStatusCommandOutput = { + const response: ListRegexMatchSetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3289,48 +2496,39 @@ export const de_GetChangeTokenStatusCommand = async ( }; /** - * deserializeAws_json1_1GetChangeTokenStatusCommandError + * deserializeAws_json1_1ListRegexPatternSetsCommand */ -const de_GetChangeTokenStatusCommandError = async ( +export const de_ListRegexPatternSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListRegexPatternSetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetGeoMatchSetCommand + * deserializeAws_json1_1ListResourcesForWebACLCommand */ -export const de_GetGeoMatchSetCommand = async ( +export const de_ListResourcesForWebACLCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetGeoMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetGeoMatchSetCommandOutput = { + const response: ListResourcesForWebACLCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3338,51 +2536,39 @@ export const de_GetGeoMatchSetCommand = async ( }; /** - * deserializeAws_json1_1GetGeoMatchSetCommandError + * deserializeAws_json1_1ListRuleGroupsCommand */ -const de_GetGeoMatchSetCommandError = async ( +export const de_ListRuleGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListRuleGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetIPSetCommand + * deserializeAws_json1_1ListRulesCommand */ -export const de_GetIPSetCommand = async ( +export const de_ListRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetIPSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetIPSetCommandOutput = { + const response: ListRulesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3390,51 +2576,39 @@ export const de_GetIPSetCommand = async ( }; /** - * deserializeAws_json1_1GetIPSetCommandError + * deserializeAws_json1_1ListSizeConstraintSetsCommand */ -const de_GetIPSetCommandError = async ( +export const de_ListSizeConstraintSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListSizeConstraintSetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetLoggingConfigurationCommand + * deserializeAws_json1_1ListSqlInjectionMatchSetsCommand */ -export const de_GetLoggingConfigurationCommand = async ( +export const de_ListSqlInjectionMatchSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetLoggingConfigurationCommandOutput = { + const response: ListSqlInjectionMatchSetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3442,48 +2616,39 @@ export const de_GetLoggingConfigurationCommand = async ( }; /** - * deserializeAws_json1_1GetLoggingConfigurationCommandError + * deserializeAws_json1_1ListSubscribedRuleGroupsCommand */ -const de_GetLoggingConfigurationCommandError = async ( +export const de_ListSubscribedRuleGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListSubscribedRuleGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetPermissionPolicyCommand + * deserializeAws_json1_1ListTagsForResourceCommand */ -export const de_GetPermissionPolicyCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetPermissionPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetPermissionPolicyCommandOutput = { + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3491,48 +2656,39 @@ export const de_GetPermissionPolicyCommand = async ( }; /** - * deserializeAws_json1_1GetPermissionPolicyCommandError + * deserializeAws_json1_1ListWebACLsCommand */ -const de_GetPermissionPolicyCommandError = async ( +export const de_ListWebACLsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListWebACLsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetRateBasedRuleCommand + * deserializeAws_json1_1ListXssMatchSetsCommand */ -export const de_GetRateBasedRuleCommand = async ( +export const de_ListXssMatchSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRateBasedRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetRateBasedRuleCommandOutput = { + const response: ListXssMatchSetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3540,51 +2696,39 @@ export const de_GetRateBasedRuleCommand = async ( }; /** - * deserializeAws_json1_1GetRateBasedRuleCommandError + * deserializeAws_json1_1PutLoggingConfigurationCommand */ -const de_GetRateBasedRuleCommandError = async ( +export const de_PutLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutLoggingConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetRateBasedRuleManagedKeysCommand + * deserializeAws_json1_1PutPermissionPolicyCommand */ -export const de_GetRateBasedRuleManagedKeysCommand = async ( +export const de_PutPermissionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRateBasedRuleManagedKeysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetRateBasedRuleManagedKeysCommandOutput = { + const response: PutPermissionPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3592,54 +2736,39 @@ export const de_GetRateBasedRuleManagedKeysCommand = async ( }; /** - * deserializeAws_json1_1GetRateBasedRuleManagedKeysCommandError + * deserializeAws_json1_1TagResourceCommand */ -const de_GetRateBasedRuleManagedKeysCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetRegexMatchSetCommand + * deserializeAws_json1_1UntagResourceCommand */ -export const de_GetRegexMatchSetCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRegexMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetRegexMatchSetCommandOutput = { + const response: UntagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3647,51 +2776,19 @@ export const de_GetRegexMatchSetCommand = async ( }; /** - * deserializeAws_json1_1GetRegexMatchSetCommandError + * deserializeAws_json1_1UpdateByteMatchSetCommand */ -const de_GetRegexMatchSetCommandError = async ( +export const de_UpdateByteMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRegexPatternSetCommand - */ -export const de_GetRegexPatternSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRegexPatternSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetRegexPatternSetCommandOutput = { + const response: UpdateByteMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3699,51 +2796,19 @@ export const de_GetRegexPatternSetCommand = async ( }; /** - * deserializeAws_json1_1GetRegexPatternSetCommandError - */ -const de_GetRegexPatternSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRuleCommand + * deserializeAws_json1_1UpdateGeoMatchSetCommand */ -export const de_GetRuleCommand = async ( +export const de_UpdateGeoMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetRuleCommandOutput = { + const response: UpdateGeoMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3751,100 +2816,19 @@ export const de_GetRuleCommand = async ( }; /** - * deserializeAws_json1_1GetRuleCommandError - */ -const de_GetRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRuleGroupCommand + * deserializeAws_json1_1UpdateIPSetCommand */ -export const de_GetRuleGroupCommand = async ( +export const de_UpdateIPSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetRuleGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRuleGroupCommandError - */ -const de_GetRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSampledRequestsCommand - */ -export const de_GetSampledRequestsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSampledRequestsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetSampledRequestsResponse(data, context); - const response: GetSampledRequestsCommandOutput = { + const response: UpdateIPSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3852,48 +2836,19 @@ export const de_GetSampledRequestsCommand = async ( }; /** - * deserializeAws_json1_1GetSampledRequestsCommandError - */ -const de_GetSampledRequestsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSizeConstraintSetCommand + * deserializeAws_json1_1UpdateRateBasedRuleCommand */ -export const de_GetSizeConstraintSetCommand = async ( +export const de_UpdateRateBasedRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetSizeConstraintSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetSizeConstraintSetCommandOutput = { + const response: UpdateRateBasedRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3901,51 +2856,19 @@ export const de_GetSizeConstraintSetCommand = async ( }; /** - * deserializeAws_json1_1GetSizeConstraintSetCommandError - */ -const de_GetSizeConstraintSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSqlInjectionMatchSetCommand + * deserializeAws_json1_1UpdateRegexMatchSetCommand */ -export const de_GetSqlInjectionMatchSetCommand = async ( +export const de_UpdateRegexMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetSqlInjectionMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetSqlInjectionMatchSetCommandOutput = { + const response: UpdateRegexMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3953,1783 +2876,39 @@ export const de_GetSqlInjectionMatchSetCommand = async ( }; /** - * deserializeAws_json1_1GetSqlInjectionMatchSetCommandError - */ -const de_GetSqlInjectionMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetWebACLCommand + * deserializeAws_json1_1UpdateRegexPatternSetCommand */ -export const de_GetWebACLCommand = async ( +export const de_UpdateRegexPatternSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: GetWebACLCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetWebACLCommandError - */ -const de_GetWebACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetWebACLForResourceCommand - */ -export const de_GetWebACLForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetWebACLForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetWebACLForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetWebACLForResourceCommandError - */ -const de_GetWebACLForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFUnavailableEntityException": - case "com.amazonaws.wafregional#WAFUnavailableEntityException": - throw await de_WAFUnavailableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetXssMatchSetCommand - */ -export const de_GetXssMatchSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetXssMatchSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetXssMatchSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetXssMatchSetCommandError - */ -const de_GetXssMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListActivatedRulesInRuleGroupCommand - */ -export const de_ListActivatedRulesInRuleGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListActivatedRulesInRuleGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListActivatedRulesInRuleGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListActivatedRulesInRuleGroupCommandError - */ -const de_ListActivatedRulesInRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListByteMatchSetsCommand - */ -export const de_ListByteMatchSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListByteMatchSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListByteMatchSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListByteMatchSetsCommandError - */ -const de_ListByteMatchSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListGeoMatchSetsCommand - */ -export const de_ListGeoMatchSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListGeoMatchSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListGeoMatchSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListGeoMatchSetsCommandError - */ -const de_ListGeoMatchSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListIPSetsCommand - */ -export const de_ListIPSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListIPSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListIPSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListIPSetsCommandError - */ -const de_ListIPSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListLoggingConfigurationsCommand - */ -export const de_ListLoggingConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListLoggingConfigurationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListLoggingConfigurationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListLoggingConfigurationsCommandError - */ -const de_ListLoggingConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRateBasedRulesCommand - */ -export const de_ListRateBasedRulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRateBasedRulesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListRateBasedRulesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRateBasedRulesCommandError - */ -const de_ListRateBasedRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRegexMatchSetsCommand - */ -export const de_ListRegexMatchSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRegexMatchSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListRegexMatchSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRegexMatchSetsCommandError - */ -const de_ListRegexMatchSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRegexPatternSetsCommand - */ -export const de_ListRegexPatternSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRegexPatternSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListRegexPatternSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRegexPatternSetsCommandError - */ -const de_ListRegexPatternSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListResourcesForWebACLCommand - */ -export const de_ListResourcesForWebACLCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListResourcesForWebACLCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListResourcesForWebACLCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListResourcesForWebACLCommandError - */ -const de_ListResourcesForWebACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRuleGroupsCommand - */ -export const de_ListRuleGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRuleGroupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListRuleGroupsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRuleGroupsCommandError - */ -const de_ListRuleGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRulesCommand - */ -export const de_ListRulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRulesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListRulesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRulesCommandError - */ -const de_ListRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListSizeConstraintSetsCommand - */ -export const de_ListSizeConstraintSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSizeConstraintSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListSizeConstraintSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListSizeConstraintSetsCommandError - */ -const de_ListSizeConstraintSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListSqlInjectionMatchSetsCommand - */ -export const de_ListSqlInjectionMatchSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSqlInjectionMatchSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListSqlInjectionMatchSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListSqlInjectionMatchSetsCommandError - */ -const de_ListSqlInjectionMatchSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListSubscribedRuleGroupsCommand - */ -export const de_ListSubscribedRuleGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSubscribedRuleGroupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListSubscribedRuleGroupsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListSubscribedRuleGroupsCommandError - */ -const de_ListSubscribedRuleGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFBadRequestException": - case "com.amazonaws.wafregional#WAFBadRequestException": - throw await de_WAFBadRequestExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafregional#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafregional#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListWebACLsCommand - */ -export const de_ListWebACLsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListWebACLsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListWebACLsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListWebACLsCommandError - */ -const de_ListWebACLsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListXssMatchSetsCommand - */ -export const de_ListXssMatchSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListXssMatchSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListXssMatchSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListXssMatchSetsCommandError - */ -const de_ListXssMatchSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutLoggingConfigurationCommand - */ -export const de_PutLoggingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutLoggingConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutLoggingConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutLoggingConfigurationCommandError - */ -const de_PutLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFServiceLinkedRoleErrorException": - case "com.amazonaws.wafregional#WAFServiceLinkedRoleErrorException": - throw await de_WAFServiceLinkedRoleErrorExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutPermissionPolicyCommand - */ -export const de_PutPermissionPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutPermissionPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutPermissionPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutPermissionPolicyCommandError - */ -const de_PutPermissionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidPermissionPolicyException": - case "com.amazonaws.wafregional#WAFInvalidPermissionPolicyException": - throw await de_WAFInvalidPermissionPolicyExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: TagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFBadRequestException": - case "com.amazonaws.wafregional#WAFBadRequestException": - throw await de_WAFBadRequestExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafregional#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafregional#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UntagResourceCommand - */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UntagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFBadRequestException": - case "com.amazonaws.wafregional#WAFBadRequestException": - throw await de_WAFBadRequestExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafregional#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafregional#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateByteMatchSetCommand - */ -export const de_UpdateByteMatchSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateByteMatchSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateByteMatchSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateByteMatchSetCommandError - */ -const de_UpdateByteMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafregional#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.wafregional#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateGeoMatchSetCommand - */ -export const de_UpdateGeoMatchSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateGeoMatchSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateGeoMatchSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateGeoMatchSetCommandError - */ -const de_UpdateGeoMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafregional#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.wafregional#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateIPSetCommand - */ -export const de_UpdateIPSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateIPSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateIPSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateIPSetCommandError - */ -const de_UpdateIPSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafregional#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.wafregional#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateRateBasedRuleCommand - */ -export const de_UpdateRateBasedRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateRateBasedRuleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateRateBasedRuleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateRateBasedRuleCommandError - */ -const de_UpdateRateBasedRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafregional#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.wafregional#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateRegexMatchSetCommand - */ -export const de_UpdateRegexMatchSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateRegexMatchSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateRegexMatchSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateRegexMatchSetCommandError - */ -const de_UpdateRegexMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.wafregional#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafregional#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.wafregional#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateRegexPatternSetCommand - */ -export const de_UpdateRegexPatternSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateRegexPatternSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateRegexPatternSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateRegexPatternSetCommandError - */ -const de_UpdateRegexPatternSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafregional#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidRegexPatternException": - case "com.amazonaws.wafregional#WAFInvalidRegexPatternException": - throw await de_WAFInvalidRegexPatternExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.wafregional#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateRuleCommand - */ -export const de_UpdateRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateRuleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateRuleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateRuleCommandError - */ -const de_UpdateRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafregional#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.wafregional#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + contents = _json(data); + const response: UpdateRegexPatternSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateRuleGroupCommand + * deserializeAws_json1_1UpdateRuleCommand */ -export const de_UpdateRuleGroupCommand = async ( +export const de_UpdateRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateRuleGroupCommandOutput = { + const response: UpdateRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5737,47 +2916,23 @@ export const de_UpdateRuleGroupCommand = async ( }; /** - * deserializeAws_json1_1UpdateRuleGroupCommandError + * deserializeAws_json1_1UpdateRuleGroupCommand */ -const de_UpdateRuleGroupCommandError = async ( +export const de_UpdateRuleGroupCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafregional#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.wafregional#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateRuleGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -5788,7 +2943,7 @@ export const de_UpdateSizeConstraintSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSizeConstraintSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5800,56 +2955,6 @@ export const de_UpdateSizeConstraintSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSizeConstraintSetCommandError - */ -const de_UpdateSizeConstraintSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafregional#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.wafregional#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSqlInjectionMatchSetCommand */ @@ -5858,7 +2963,7 @@ export const de_UpdateSqlInjectionMatchSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSqlInjectionMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5870,53 +2975,6 @@ export const de_UpdateSqlInjectionMatchSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSqlInjectionMatchSetCommandError - */ -const de_UpdateSqlInjectionMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafregional#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.wafregional#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateWebACLCommand */ @@ -5925,7 +2983,7 @@ export const de_UpdateWebACLCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5937,59 +2995,6 @@ export const de_UpdateWebACLCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateWebACLCommandError - */ -const de_UpdateWebACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafregional#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.wafregional#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafregional#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafregional#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.wafregional#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafregional#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.wafregional#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.wafregional#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFSubscriptionNotFoundException": - case "com.amazonaws.wafregional#WAFSubscriptionNotFoundException": - throw await de_WAFSubscriptionNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateXssMatchSetCommand */ @@ -5998,7 +3003,7 @@ export const de_UpdateXssMatchSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateXssMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6011,12 +3016,9 @@ export const de_UpdateXssMatchSetCommand = async ( }; /** - * deserializeAws_json1_1UpdateXssMatchSetCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateXssMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -6029,31 +3031,67 @@ const de_UpdateXssMatchSetCommandError = async ( case "WAFInvalidAccountException": case "com.amazonaws.wafregional#WAFInvalidAccountException": throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafregional#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); case "WAFInvalidParameterException": case "com.amazonaws.wafregional#WAFInvalidParameterException": throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafregional#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.wafregional#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); case "WAFNonexistentItemException": case "com.amazonaws.wafregional#WAFNonexistentItemException": throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); + case "WAFUnavailableEntityException": + case "com.amazonaws.wafregional#WAFUnavailableEntityException": + throw await de_WAFUnavailableEntityExceptionRes(parsedOutput, context); + case "WAFDisallowedNameException": + case "com.amazonaws.wafregional#WAFDisallowedNameException": + throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); + case "WAFLimitsExceededException": + case "com.amazonaws.wafregional#WAFLimitsExceededException": + throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); case "WAFStaleDataException": case "com.amazonaws.wafregional#WAFStaleDataException": throw await de_WAFStaleDataExceptionRes(parsedOutput, context); + case "WAFBadRequestException": + case "com.amazonaws.wafregional#WAFBadRequestException": + throw await de_WAFBadRequestExceptionRes(parsedOutput, context); + case "WAFTagOperationException": + case "com.amazonaws.wafregional#WAFTagOperationException": + throw await de_WAFTagOperationExceptionRes(parsedOutput, context); + case "WAFTagOperationInternalErrorException": + case "com.amazonaws.wafregional#WAFTagOperationInternalErrorException": + throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); + case "WAFEntityMigrationException": + case "com.amazonaws.wafregional#WAFEntityMigrationException": + throw await de_WAFEntityMigrationExceptionRes(parsedOutput, context); + case "WAFInvalidOperationException": + case "com.amazonaws.wafregional#WAFInvalidOperationException": + throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); + case "WAFNonEmptyEntityException": + case "com.amazonaws.wafregional#WAFNonEmptyEntityException": + throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); + case "WAFReferencedItemException": + case "com.amazonaws.wafregional#WAFReferencedItemException": + throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); + case "WAFServiceLinkedRoleErrorException": + case "com.amazonaws.wafregional#WAFServiceLinkedRoleErrorException": + throw await de_WAFServiceLinkedRoleErrorExceptionRes(parsedOutput, context); + case "WAFInvalidPermissionPolicyException": + case "com.amazonaws.wafregional#WAFInvalidPermissionPolicyException": + throw await de_WAFInvalidPermissionPolicyExceptionRes(parsedOutput, context); + case "WAFNonexistentContainerException": + case "com.amazonaws.wafregional#WAFNonexistentContainerException": + throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); + case "WAFInvalidRegexPatternException": + case "com.amazonaws.wafregional#WAFInvalidRegexPatternException": + throw await de_WAFInvalidRegexPatternExceptionRes(parsedOutput, context); + case "WAFSubscriptionNotFoundException": + case "com.amazonaws.wafregional#WAFSubscriptionNotFoundException": + throw await de_WAFSubscriptionNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-waf/src/protocols/Aws_json1_1.ts b/clients/client-waf/src/protocols/Aws_json1_1.ts index 1161fe1f24a3..55b36c41f725 100644 --- a/clients/client-waf/src/protocols/Aws_json1_1.ts +++ b/clients/client-waf/src/protocols/Aws_json1_1.ts @@ -1336,7 +1336,7 @@ export const de_CreateByteMatchSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateByteMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1348,47 +1348,6 @@ export const de_CreateByteMatchSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateByteMatchSetCommandError - */ -const de_CreateByteMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.waf#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateGeoMatchSetCommand */ @@ -1397,7 +1356,7 @@ export const de_CreateGeoMatchSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateGeoMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1409,47 +1368,6 @@ export const de_CreateGeoMatchSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateGeoMatchSetCommandError - */ -const de_CreateGeoMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.waf#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateIPSetCommand */ @@ -1458,7 +1376,7 @@ export const de_CreateIPSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateIPSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1470,47 +1388,6 @@ export const de_CreateIPSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateIPSetCommandError - */ -const de_CreateIPSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.waf#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateRateBasedRuleCommand */ @@ -1519,7 +1396,7 @@ export const de_CreateRateBasedRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRateBasedRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1531,53 +1408,6 @@ export const de_CreateRateBasedRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateRateBasedRuleCommandError - */ -const de_CreateRateBasedRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFBadRequestException": - case "com.amazonaws.waf#WAFBadRequestException": - throw await de_WAFBadRequestExceptionRes(parsedOutput, context); - case "WAFDisallowedNameException": - case "com.amazonaws.waf#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.waf#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.waf#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateRegexMatchSetCommand */ @@ -1586,7 +1416,7 @@ export const de_CreateRegexMatchSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRegexMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1599,54 +1429,39 @@ export const de_CreateRegexMatchSetCommand = async ( }; /** - * deserializeAws_json1_1CreateRegexMatchSetCommandError + * deserializeAws_json1_1CreateRegexPatternSetCommand */ -const de_CreateRegexMatchSetCommandError = async ( +export const de_CreateRegexPatternSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.waf#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateRegexPatternSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateRegexPatternSetCommand + * deserializeAws_json1_1CreateRuleCommand */ -export const de_CreateRegexPatternSetCommand = async ( +export const de_CreateRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateRegexPatternSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateRegexPatternSetCommandOutput = { + const response: CreateRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1654,54 +1469,39 @@ export const de_CreateRegexPatternSetCommand = async ( }; /** - * deserializeAws_json1_1CreateRegexPatternSetCommandError + * deserializeAws_json1_1CreateRuleGroupCommand */ -const de_CreateRegexPatternSetCommandError = async ( +export const de_CreateRuleGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.waf#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateRuleGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateRuleCommand + * deserializeAws_json1_1CreateSizeConstraintSetCommand */ -export const de_CreateRuleCommand = async ( +export const de_CreateSizeConstraintSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateRuleCommandOutput = { + const response: CreateSizeConstraintSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1709,66 +1509,19 @@ export const de_CreateRuleCommand = async ( }; /** - * deserializeAws_json1_1CreateRuleCommandError + * deserializeAws_json1_1CreateSqlInjectionMatchSetCommand */ -const de_CreateRuleCommandError = async ( +export const de_CreateSqlInjectionMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFBadRequestException": - case "com.amazonaws.waf#WAFBadRequestException": - throw await de_WAFBadRequestExceptionRes(parsedOutput, context); - case "WAFDisallowedNameException": - case "com.amazonaws.waf#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.waf#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.waf#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateRuleGroupCommand - */ -export const de_CreateRuleGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateRuleGroupCommandOutput = { + const response: CreateSqlInjectionMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1776,63 +1529,19 @@ export const de_CreateRuleGroupCommand = async ( }; /** - * deserializeAws_json1_1CreateRuleGroupCommandError - */ -const de_CreateRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFBadRequestException": - case "com.amazonaws.waf#WAFBadRequestException": - throw await de_WAFBadRequestExceptionRes(parsedOutput, context); - case "WAFDisallowedNameException": - case "com.amazonaws.waf#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.waf#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.waf#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateSizeConstraintSetCommand + * deserializeAws_json1_1CreateWebACLCommand */ -export const de_CreateSizeConstraintSetCommand = async ( +export const de_CreateWebACLCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateSizeConstraintSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateSizeConstraintSetCommandOutput = { + const response: CreateWebACLCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1840,60 +1549,39 @@ export const de_CreateSizeConstraintSetCommand = async ( }; /** - * deserializeAws_json1_1CreateSizeConstraintSetCommandError + * deserializeAws_json1_1CreateWebACLMigrationStackCommand */ -const de_CreateSizeConstraintSetCommandError = async ( +export const de_CreateWebACLMigrationStackCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.waf#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateWebACLMigrationStackCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateSqlInjectionMatchSetCommand + * deserializeAws_json1_1CreateXssMatchSetCommand */ -export const de_CreateSqlInjectionMatchSetCommand = async ( +export const de_CreateXssMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateSqlInjectionMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateSqlInjectionMatchSetCommandOutput = { + const response: CreateXssMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1901,60 +1589,39 @@ export const de_CreateSqlInjectionMatchSetCommand = async ( }; /** - * deserializeAws_json1_1CreateSqlInjectionMatchSetCommandError + * deserializeAws_json1_1DeleteByteMatchSetCommand */ -const de_CreateSqlInjectionMatchSetCommandError = async ( +export const de_DeleteByteMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.waf#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteByteMatchSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateWebACLCommand + * deserializeAws_json1_1DeleteGeoMatchSetCommand */ -export const de_CreateWebACLCommand = async ( +export const de_DeleteGeoMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateWebACLCommandOutput = { + const response: DeleteGeoMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1962,69 +1629,39 @@ export const de_CreateWebACLCommand = async ( }; /** - * deserializeAws_json1_1CreateWebACLCommandError + * deserializeAws_json1_1DeleteIPSetCommand */ -const de_CreateWebACLCommandError = async ( +export const de_DeleteIPSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFBadRequestException": - case "com.amazonaws.waf#WAFBadRequestException": - throw await de_WAFBadRequestExceptionRes(parsedOutput, context); - case "WAFDisallowedNameException": - case "com.amazonaws.waf#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.waf#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.waf#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteIPSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateWebACLMigrationStackCommand + * deserializeAws_json1_1DeleteLoggingConfigurationCommand */ -export const de_CreateWebACLMigrationStackCommand = async ( +export const de_DeleteLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateWebACLMigrationStackCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateWebACLMigrationStackCommandOutput = { + const response: DeleteLoggingConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2032,57 +1669,39 @@ export const de_CreateWebACLMigrationStackCommand = async ( }; /** - * deserializeAws_json1_1CreateWebACLMigrationStackCommandError + * deserializeAws_json1_1DeletePermissionPolicyCommand */ -const de_CreateWebACLMigrationStackCommandError = async ( +export const de_DeletePermissionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFEntityMigrationException": - case "com.amazonaws.waf#WAFEntityMigrationException": - throw await de_WAFEntityMigrationExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.waf#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeletePermissionPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateXssMatchSetCommand + * deserializeAws_json1_1DeleteRateBasedRuleCommand */ -export const de_CreateXssMatchSetCommand = async ( +export const de_DeleteRateBasedRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateXssMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateXssMatchSetCommandOutput = { + const response: DeleteRateBasedRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2090,60 +1709,39 @@ export const de_CreateXssMatchSetCommand = async ( }; /** - * deserializeAws_json1_1CreateXssMatchSetCommandError + * deserializeAws_json1_1DeleteRegexMatchSetCommand */ -const de_CreateXssMatchSetCommandError = async ( +export const de_DeleteRegexMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.waf#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteRegexMatchSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteByteMatchSetCommand + * deserializeAws_json1_1DeleteRegexPatternSetCommand */ -export const de_DeleteByteMatchSetCommand = async ( +export const de_DeleteRegexPatternSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteByteMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteByteMatchSetCommandOutput = { + const response: DeleteRegexPatternSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2151,60 +1749,39 @@ export const de_DeleteByteMatchSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteByteMatchSetCommandError + * deserializeAws_json1_1DeleteRuleCommand */ -const de_DeleteByteMatchSetCommandError = async ( +export const de_DeleteRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.waf#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteRuleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteGeoMatchSetCommand + * deserializeAws_json1_1DeleteRuleGroupCommand */ -export const de_DeleteGeoMatchSetCommand = async ( +export const de_DeleteRuleGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteGeoMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteGeoMatchSetCommandOutput = { + const response: DeleteRuleGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2212,60 +1789,39 @@ export const de_DeleteGeoMatchSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteGeoMatchSetCommandError + * deserializeAws_json1_1DeleteSizeConstraintSetCommand */ -const de_DeleteGeoMatchSetCommandError = async ( +export const de_DeleteSizeConstraintSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.waf#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteSizeConstraintSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteIPSetCommand + * deserializeAws_json1_1DeleteSqlInjectionMatchSetCommand */ -export const de_DeleteIPSetCommand = async ( +export const de_DeleteSqlInjectionMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteIPSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteIPSetCommandOutput = { + const response: DeleteSqlInjectionMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2273,60 +1829,39 @@ export const de_DeleteIPSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteIPSetCommandError + * deserializeAws_json1_1DeleteWebACLCommand */ -const de_DeleteIPSetCommandError = async ( +export const de_DeleteWebACLCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.waf#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteWebACLCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteLoggingConfigurationCommand + * deserializeAws_json1_1DeleteXssMatchSetCommand */ -export const de_DeleteLoggingConfigurationCommand = async ( +export const de_DeleteXssMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteLoggingConfigurationCommandOutput = { + const response: DeleteXssMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2334,51 +1869,39 @@ export const de_DeleteLoggingConfigurationCommand = async ( }; /** - * deserializeAws_json1_1DeleteLoggingConfigurationCommandError + * deserializeAws_json1_1GetByteMatchSetCommand */ -const de_DeleteLoggingConfigurationCommandError = async ( +export const de_GetByteMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetByteMatchSetResponse(data, context); + const response: GetByteMatchSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeletePermissionPolicyCommand + * deserializeAws_json1_1GetChangeTokenCommand */ -export const de_DeletePermissionPolicyCommand = async ( +export const de_GetChangeTokenCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeletePermissionPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeletePermissionPolicyCommandOutput = { + const response: GetChangeTokenCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2386,51 +1909,39 @@ export const de_DeletePermissionPolicyCommand = async ( }; /** - * deserializeAws_json1_1DeletePermissionPolicyCommandError + * deserializeAws_json1_1GetChangeTokenStatusCommand */ -const de_DeletePermissionPolicyCommandError = async ( +export const de_GetChangeTokenStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetChangeTokenStatusCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRateBasedRuleCommand + * deserializeAws_json1_1GetGeoMatchSetCommand */ -export const de_DeleteRateBasedRuleCommand = async ( +export const de_GetGeoMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRateBasedRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRateBasedRuleCommandOutput = { + const response: GetGeoMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2438,66 +1949,39 @@ export const de_DeleteRateBasedRuleCommand = async ( }; /** - * deserializeAws_json1_1DeleteRateBasedRuleCommandError + * deserializeAws_json1_1GetIPSetCommand */ -const de_DeleteRateBasedRuleCommandError = async ( +export const de_GetIPSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.waf#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.waf#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.waf#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetIPSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRegexMatchSetCommand + * deserializeAws_json1_1GetLoggingConfigurationCommand */ -export const de_DeleteRegexMatchSetCommand = async ( +export const de_GetLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRegexMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRegexMatchSetCommandOutput = { + const response: GetLoggingConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2505,60 +1989,39 @@ export const de_DeleteRegexMatchSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteRegexMatchSetCommandError + * deserializeAws_json1_1GetPermissionPolicyCommand */ -const de_DeleteRegexMatchSetCommandError = async ( +export const de_GetPermissionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.waf#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetPermissionPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRegexPatternSetCommand + * deserializeAws_json1_1GetRateBasedRuleCommand */ -export const de_DeleteRegexPatternSetCommand = async ( +export const de_GetRateBasedRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRegexPatternSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRegexPatternSetCommandOutput = { + const response: GetRateBasedRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2566,60 +2029,39 @@ export const de_DeleteRegexPatternSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteRegexPatternSetCommandError + * deserializeAws_json1_1GetRateBasedRuleManagedKeysCommand */ -const de_DeleteRegexPatternSetCommandError = async ( +export const de_GetRateBasedRuleManagedKeysCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.waf#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetRateBasedRuleManagedKeysCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRuleCommand + * deserializeAws_json1_1GetRegexMatchSetCommand */ -export const de_DeleteRuleCommand = async ( +export const de_GetRegexMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRuleCommandOutput = { + const response: GetRegexMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2627,66 +2069,39 @@ export const de_DeleteRuleCommand = async ( }; /** - * deserializeAws_json1_1DeleteRuleCommandError + * deserializeAws_json1_1GetRegexPatternSetCommand */ -const de_DeleteRuleCommandError = async ( +export const de_GetRegexPatternSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetRegexPatternSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.waf#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.waf#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.waf#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1DeleteRuleGroupCommand + * deserializeAws_json1_1GetRuleCommand */ -export const de_DeleteRuleGroupCommand = async ( +export const de_GetRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRuleGroupCommandOutput = { + const response: GetRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2694,66 +2109,19 @@ export const de_DeleteRuleGroupCommand = async ( }; /** - * deserializeAws_json1_1DeleteRuleGroupCommandError - */ -const de_DeleteRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.waf#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.waf#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.waf#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.waf#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteSizeConstraintSetCommand + * deserializeAws_json1_1GetRuleGroupCommand */ -export const de_DeleteSizeConstraintSetCommand = async ( +export const de_GetRuleGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSizeConstraintSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteSizeConstraintSetCommandOutput = { + const response: GetRuleGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2761,60 +2129,39 @@ export const de_DeleteSizeConstraintSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteSizeConstraintSetCommandError + * deserializeAws_json1_1GetSampledRequestsCommand */ -const de_DeleteSizeConstraintSetCommandError = async ( +export const de_GetSampledRequestsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.waf#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetSampledRequestsResponse(data, context); + const response: GetSampledRequestsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteSqlInjectionMatchSetCommand + * deserializeAws_json1_1GetSizeConstraintSetCommand */ -export const de_DeleteSqlInjectionMatchSetCommand = async ( +export const de_GetSizeConstraintSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteSqlInjectionMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteSqlInjectionMatchSetCommandOutput = { + const response: GetSizeConstraintSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2822,60 +2169,39 @@ export const de_DeleteSqlInjectionMatchSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteSqlInjectionMatchSetCommandError + * deserializeAws_json1_1GetSqlInjectionMatchSetCommand */ -const de_DeleteSqlInjectionMatchSetCommandError = async ( +export const de_GetSqlInjectionMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.waf#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetSqlInjectionMatchSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteWebACLCommand + * deserializeAws_json1_1GetWebACLCommand */ -export const de_DeleteWebACLCommand = async ( +export const de_GetWebACLCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteWebACLCommandOutput = { + const response: GetWebACLCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2883,66 +2209,39 @@ export const de_DeleteWebACLCommand = async ( }; /** - * deserializeAws_json1_1DeleteWebACLCommandError + * deserializeAws_json1_1GetXssMatchSetCommand */ -const de_DeleteWebACLCommandError = async ( +export const de_GetXssMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.waf#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.waf#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.waf#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetXssMatchSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteXssMatchSetCommand + * deserializeAws_json1_1ListActivatedRulesInRuleGroupCommand */ -export const de_DeleteXssMatchSetCommand = async ( +export const de_ListActivatedRulesInRuleGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteXssMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteXssMatchSetCommandOutput = { + const response: ListActivatedRulesInRuleGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2950,60 +2249,39 @@ export const de_DeleteXssMatchSetCommand = async ( }; /** - * deserializeAws_json1_1DeleteXssMatchSetCommandError + * deserializeAws_json1_1ListByteMatchSetsCommand */ -const de_DeleteXssMatchSetCommandError = async ( +export const de_ListByteMatchSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonEmptyEntityException": - case "com.amazonaws.waf#WAFNonEmptyEntityException": - throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListByteMatchSetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetByteMatchSetCommand + * deserializeAws_json1_1ListGeoMatchSetsCommand */ -export const de_GetByteMatchSetCommand = async ( +export const de_ListGeoMatchSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetByteMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_GetByteMatchSetResponse(data, context); - const response: GetByteMatchSetCommandOutput = { + contents = _json(data); + const response: ListGeoMatchSetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3011,51 +2289,39 @@ export const de_GetByteMatchSetCommand = async ( }; /** - * deserializeAws_json1_1GetByteMatchSetCommandError + * deserializeAws_json1_1ListIPSetsCommand */ -const de_GetByteMatchSetCommandError = async ( +export const de_ListIPSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListIPSetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetChangeTokenCommand + * deserializeAws_json1_1ListLoggingConfigurationsCommand */ -export const de_GetChangeTokenCommand = async ( +export const de_ListLoggingConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetChangeTokenCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetChangeTokenCommandOutput = { + const response: ListLoggingConfigurationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3063,45 +2329,39 @@ export const de_GetChangeTokenCommand = async ( }; /** - * deserializeAws_json1_1GetChangeTokenCommandError + * deserializeAws_json1_1ListRateBasedRulesCommand */ -const de_GetChangeTokenCommandError = async ( +export const de_ListRateBasedRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListRateBasedRulesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetChangeTokenStatusCommand + * deserializeAws_json1_1ListRegexMatchSetsCommand */ -export const de_GetChangeTokenStatusCommand = async ( +export const de_ListRegexMatchSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetChangeTokenStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetChangeTokenStatusCommandOutput = { + const response: ListRegexMatchSetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3109,48 +2369,39 @@ export const de_GetChangeTokenStatusCommand = async ( }; /** - * deserializeAws_json1_1GetChangeTokenStatusCommandError + * deserializeAws_json1_1ListRegexPatternSetsCommand */ -const de_GetChangeTokenStatusCommandError = async ( +export const de_ListRegexPatternSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListRegexPatternSetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetGeoMatchSetCommand + * deserializeAws_json1_1ListRuleGroupsCommand */ -export const de_GetGeoMatchSetCommand = async ( +export const de_ListRuleGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetGeoMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetGeoMatchSetCommandOutput = { + const response: ListRuleGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3158,51 +2409,39 @@ export const de_GetGeoMatchSetCommand = async ( }; /** - * deserializeAws_json1_1GetGeoMatchSetCommandError + * deserializeAws_json1_1ListRulesCommand */ -const de_GetGeoMatchSetCommandError = async ( +export const de_ListRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListRulesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetIPSetCommand + * deserializeAws_json1_1ListSizeConstraintSetsCommand */ -export const de_GetIPSetCommand = async ( +export const de_ListSizeConstraintSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetIPSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetIPSetCommandOutput = { + const response: ListSizeConstraintSetsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3210,51 +2449,39 @@ export const de_GetIPSetCommand = async ( }; /** - * deserializeAws_json1_1GetIPSetCommandError + * deserializeAws_json1_1ListSqlInjectionMatchSetsCommand */ -const de_GetIPSetCommandError = async ( +export const de_ListSqlInjectionMatchSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListSqlInjectionMatchSetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetLoggingConfigurationCommand + * deserializeAws_json1_1ListSubscribedRuleGroupsCommand */ -export const de_GetLoggingConfigurationCommand = async ( +export const de_ListSubscribedRuleGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetLoggingConfigurationCommandOutput = { + const response: ListSubscribedRuleGroupsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3262,48 +2489,39 @@ export const de_GetLoggingConfigurationCommand = async ( }; /** - * deserializeAws_json1_1GetLoggingConfigurationCommandError + * deserializeAws_json1_1ListTagsForResourceCommand */ -const de_GetLoggingConfigurationCommandError = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetPermissionPolicyCommand + * deserializeAws_json1_1ListWebACLsCommand */ -export const de_GetPermissionPolicyCommand = async ( +export const de_ListWebACLsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetPermissionPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetPermissionPolicyCommandOutput = { + const response: ListWebACLsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3311,48 +2529,39 @@ export const de_GetPermissionPolicyCommand = async ( }; /** - * deserializeAws_json1_1GetPermissionPolicyCommandError + * deserializeAws_json1_1ListXssMatchSetsCommand */ -const de_GetPermissionPolicyCommandError = async ( +export const de_ListXssMatchSetsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListXssMatchSetsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetRateBasedRuleCommand + * deserializeAws_json1_1PutLoggingConfigurationCommand */ -export const de_GetRateBasedRuleCommand = async ( +export const de_PutLoggingConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRateBasedRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetRateBasedRuleCommandOutput = { + const response: PutLoggingConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3360,51 +2569,39 @@ export const de_GetRateBasedRuleCommand = async ( }; /** - * deserializeAws_json1_1GetRateBasedRuleCommandError + * deserializeAws_json1_1PutPermissionPolicyCommand */ -const de_GetRateBasedRuleCommandError = async ( +export const de_PutPermissionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutPermissionPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetRateBasedRuleManagedKeysCommand + * deserializeAws_json1_1TagResourceCommand */ -export const de_GetRateBasedRuleManagedKeysCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRateBasedRuleManagedKeysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetRateBasedRuleManagedKeysCommandOutput = { + const response: TagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3412,54 +2609,39 @@ export const de_GetRateBasedRuleManagedKeysCommand = async ( }; /** - * deserializeAws_json1_1GetRateBasedRuleManagedKeysCommandError + * deserializeAws_json1_1UntagResourceCommand */ -const de_GetRateBasedRuleManagedKeysCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetRegexMatchSetCommand + * deserializeAws_json1_1UpdateByteMatchSetCommand */ -export const de_GetRegexMatchSetCommand = async ( +export const de_UpdateByteMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRegexMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetRegexMatchSetCommandOutput = { + const response: UpdateByteMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3467,51 +2649,39 @@ export const de_GetRegexMatchSetCommand = async ( }; /** - * deserializeAws_json1_1GetRegexMatchSetCommandError + * deserializeAws_json1_1UpdateGeoMatchSetCommand */ -const de_GetRegexMatchSetCommandError = async ( +export const de_UpdateGeoMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateGeoMatchSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetRegexPatternSetCommand + * deserializeAws_json1_1UpdateIPSetCommand */ -export const de_GetRegexPatternSetCommand = async ( +export const de_UpdateIPSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRegexPatternSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetRegexPatternSetCommandOutput = { + const response: UpdateIPSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3519,51 +2689,39 @@ export const de_GetRegexPatternSetCommand = async ( }; /** - * deserializeAws_json1_1GetRegexPatternSetCommandError + * deserializeAws_json1_1UpdateRateBasedRuleCommand */ -const de_GetRegexPatternSetCommandError = async ( +export const de_UpdateRateBasedRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateRateBasedRuleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1GetRuleCommand + * deserializeAws_json1_1UpdateRegexMatchSetCommand */ -export const de_GetRuleCommand = async ( +export const de_UpdateRegexMatchSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_GetRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: GetRuleCommandOutput = { + const response: UpdateRegexMatchSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3571,1872 +2729,39 @@ export const de_GetRuleCommand = async ( }; /** - * deserializeAws_json1_1GetRuleCommandError + * deserializeAws_json1_1UpdateRegexPatternSetCommand */ -const de_GetRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetRuleGroupCommand - */ -export const de_GetRuleGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetRuleGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetRuleGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetRuleGroupCommandError - */ -const de_GetRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSampledRequestsCommand - */ -export const de_GetSampledRequestsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSampledRequestsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetSampledRequestsResponse(data, context); - const response: GetSampledRequestsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSampledRequestsCommandError - */ -const de_GetSampledRequestsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSizeConstraintSetCommand - */ -export const de_GetSizeConstraintSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSizeConstraintSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetSizeConstraintSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSizeConstraintSetCommandError - */ -const de_GetSizeConstraintSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSqlInjectionMatchSetCommand - */ -export const de_GetSqlInjectionMatchSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetSqlInjectionMatchSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetSqlInjectionMatchSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetSqlInjectionMatchSetCommandError - */ -const de_GetSqlInjectionMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetWebACLCommand - */ -export const de_GetWebACLCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetWebACLCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetWebACLCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetWebACLCommandError - */ -const de_GetWebACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetXssMatchSetCommand - */ -export const de_GetXssMatchSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetXssMatchSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetXssMatchSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetXssMatchSetCommandError - */ -const de_GetXssMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListActivatedRulesInRuleGroupCommand - */ -export const de_ListActivatedRulesInRuleGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListActivatedRulesInRuleGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListActivatedRulesInRuleGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListActivatedRulesInRuleGroupCommandError - */ -const de_ListActivatedRulesInRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListByteMatchSetsCommand - */ -export const de_ListByteMatchSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListByteMatchSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListByteMatchSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListByteMatchSetsCommandError - */ -const de_ListByteMatchSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListGeoMatchSetsCommand - */ -export const de_ListGeoMatchSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListGeoMatchSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListGeoMatchSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListGeoMatchSetsCommandError - */ -const de_ListGeoMatchSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListIPSetsCommand - */ -export const de_ListIPSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListIPSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListIPSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListIPSetsCommandError - */ -const de_ListIPSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListLoggingConfigurationsCommand - */ -export const de_ListLoggingConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListLoggingConfigurationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListLoggingConfigurationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListLoggingConfigurationsCommandError - */ -const de_ListLoggingConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRateBasedRulesCommand - */ -export const de_ListRateBasedRulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRateBasedRulesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListRateBasedRulesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRateBasedRulesCommandError - */ -const de_ListRateBasedRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRegexMatchSetsCommand - */ -export const de_ListRegexMatchSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRegexMatchSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListRegexMatchSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRegexMatchSetsCommandError - */ -const de_ListRegexMatchSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRegexPatternSetsCommand - */ -export const de_ListRegexPatternSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRegexPatternSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListRegexPatternSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRegexPatternSetsCommandError - */ -const de_ListRegexPatternSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRuleGroupsCommand - */ -export const de_ListRuleGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRuleGroupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListRuleGroupsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRuleGroupsCommandError - */ -const de_ListRuleGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListRulesCommand - */ -export const de_ListRulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListRulesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListRulesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListRulesCommandError - */ -const de_ListRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListSizeConstraintSetsCommand - */ -export const de_ListSizeConstraintSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSizeConstraintSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListSizeConstraintSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListSizeConstraintSetsCommandError - */ -const de_ListSizeConstraintSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListSqlInjectionMatchSetsCommand - */ -export const de_ListSqlInjectionMatchSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSqlInjectionMatchSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListSqlInjectionMatchSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListSqlInjectionMatchSetsCommandError - */ -const de_ListSqlInjectionMatchSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListSubscribedRuleGroupsCommand - */ -export const de_ListSubscribedRuleGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListSubscribedRuleGroupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListSubscribedRuleGroupsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListSubscribedRuleGroupsCommandError - */ -const de_ListSubscribedRuleGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFBadRequestException": - case "com.amazonaws.waf#WAFBadRequestException": - throw await de_WAFBadRequestExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.waf#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.waf#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListWebACLsCommand - */ -export const de_ListWebACLsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListWebACLsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListWebACLsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListWebACLsCommandError - */ -const de_ListWebACLsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListXssMatchSetsCommand - */ -export const de_ListXssMatchSetsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListXssMatchSetsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListXssMatchSetsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListXssMatchSetsCommandError - */ -const de_ListXssMatchSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutLoggingConfigurationCommand - */ -export const de_PutLoggingConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutLoggingConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutLoggingConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutLoggingConfigurationCommandError - */ -const de_PutLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFServiceLinkedRoleErrorException": - case "com.amazonaws.waf#WAFServiceLinkedRoleErrorException": - throw await de_WAFServiceLinkedRoleErrorExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutPermissionPolicyCommand - */ -export const de_PutPermissionPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutPermissionPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutPermissionPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutPermissionPolicyCommandError - */ -const de_PutPermissionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidPermissionPolicyException": - case "com.amazonaws.waf#WAFInvalidPermissionPolicyException": - throw await de_WAFInvalidPermissionPolicyExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: TagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFBadRequestException": - case "com.amazonaws.waf#WAFBadRequestException": - throw await de_WAFBadRequestExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.waf#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.waf#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UntagResourceCommand - */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UntagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFBadRequestException": - case "com.amazonaws.waf#WAFBadRequestException": - throw await de_WAFBadRequestExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.waf#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.waf#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateByteMatchSetCommand - */ -export const de_UpdateByteMatchSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateByteMatchSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateByteMatchSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateByteMatchSetCommandError - */ -const de_UpdateByteMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.waf#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.waf#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateGeoMatchSetCommand - */ -export const de_UpdateGeoMatchSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateGeoMatchSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateGeoMatchSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateGeoMatchSetCommandError - */ -const de_UpdateGeoMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.waf#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.waf#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateIPSetCommand - */ -export const de_UpdateIPSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateIPSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateIPSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateIPSetCommandError - */ -const de_UpdateIPSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.waf#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.waf#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateRateBasedRuleCommand - */ -export const de_UpdateRateBasedRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateRateBasedRuleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateRateBasedRuleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateRateBasedRuleCommandError - */ -const de_UpdateRateBasedRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.waf#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.waf#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateRegexMatchSetCommand - */ -export const de_UpdateRegexMatchSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateRegexMatchSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateRegexMatchSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateRegexMatchSetCommandError - */ -const de_UpdateRegexMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDisallowedNameException": - case "com.amazonaws.waf#WAFDisallowedNameException": - throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.waf#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.waf#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateRegexPatternSetCommand - */ -export const de_UpdateRegexPatternSetCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateRegexPatternSetCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateRegexPatternSetCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateRegexPatternSetCommandError - */ -const de_UpdateRegexPatternSetCommandError = async ( +export const de_UpdateRegexPatternSetCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.waf#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidRegexPatternException": - case "com.amazonaws.waf#WAFInvalidRegexPatternException": - throw await de_WAFInvalidRegexPatternExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.waf#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UpdateRuleCommand - */ -export const de_UpdateRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UpdateRuleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UpdateRuleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UpdateRuleCommandError - */ -const de_UpdateRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.waf#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.waf#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateRegexPatternSetCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateRuleGroupCommand + * deserializeAws_json1_1UpdateRuleCommand */ -export const de_UpdateRuleGroupCommand = async ( +export const de_UpdateRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateRuleGroupCommandOutput = { + const response: UpdateRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5444,47 +2769,23 @@ export const de_UpdateRuleGroupCommand = async ( }; /** - * deserializeAws_json1_1UpdateRuleGroupCommandError + * deserializeAws_json1_1UpdateRuleGroupCommand */ -const de_UpdateRuleGroupCommandError = async ( +export const de_UpdateRuleGroupCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.waf#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.waf#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateRuleGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -5495,7 +2796,7 @@ export const de_UpdateSizeConstraintSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSizeConstraintSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5507,56 +2808,6 @@ export const de_UpdateSizeConstraintSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSizeConstraintSetCommandError - */ -const de_UpdateSizeConstraintSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.waf#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.waf#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateSqlInjectionMatchSetCommand */ @@ -5565,7 +2816,7 @@ export const de_UpdateSqlInjectionMatchSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateSqlInjectionMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5577,53 +2828,6 @@ export const de_UpdateSqlInjectionMatchSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateSqlInjectionMatchSetCommandError - */ -const de_UpdateSqlInjectionMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.waf#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.waf#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateWebACLCommand */ @@ -5632,7 +2836,7 @@ export const de_UpdateWebACLCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5644,59 +2848,6 @@ export const de_UpdateWebACLCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateWebACLCommandError - */ -const de_UpdateWebACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.waf#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidAccountException": - case "com.amazonaws.waf#WAFInvalidAccountException": - throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.waf#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.waf#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.waf#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.waf#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFReferencedItemException": - case "com.amazonaws.waf#WAFReferencedItemException": - throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); - case "WAFStaleDataException": - case "com.amazonaws.waf#WAFStaleDataException": - throw await de_WAFStaleDataExceptionRes(parsedOutput, context); - case "WAFSubscriptionNotFoundException": - case "com.amazonaws.waf#WAFSubscriptionNotFoundException": - throw await de_WAFSubscriptionNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateXssMatchSetCommand */ @@ -5705,7 +2856,7 @@ export const de_UpdateXssMatchSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateXssMatchSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5718,49 +2869,79 @@ export const de_UpdateXssMatchSetCommand = async ( }; /** - * deserializeAws_json1_1UpdateXssMatchSetCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateXssMatchSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "WAFDisallowedNameException": + case "com.amazonaws.waf#WAFDisallowedNameException": + throw await de_WAFDisallowedNameExceptionRes(parsedOutput, context); case "WAFInternalErrorException": case "com.amazonaws.waf#WAFInternalErrorException": throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); case "WAFInvalidAccountException": case "com.amazonaws.waf#WAFInvalidAccountException": throw await de_WAFInvalidAccountExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.waf#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); case "WAFInvalidParameterException": case "com.amazonaws.waf#WAFInvalidParameterException": throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); case "WAFLimitsExceededException": case "com.amazonaws.waf#WAFLimitsExceededException": throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentContainerException": - case "com.amazonaws.waf#WAFNonexistentContainerException": - throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.waf#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); case "WAFStaleDataException": case "com.amazonaws.waf#WAFStaleDataException": throw await de_WAFStaleDataExceptionRes(parsedOutput, context); + case "WAFBadRequestException": + case "com.amazonaws.waf#WAFBadRequestException": + throw await de_WAFBadRequestExceptionRes(parsedOutput, context); + case "WAFTagOperationException": + case "com.amazonaws.waf#WAFTagOperationException": + throw await de_WAFTagOperationExceptionRes(parsedOutput, context); + case "WAFTagOperationInternalErrorException": + case "com.amazonaws.waf#WAFTagOperationInternalErrorException": + throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); + case "WAFEntityMigrationException": + case "com.amazonaws.waf#WAFEntityMigrationException": + throw await de_WAFEntityMigrationExceptionRes(parsedOutput, context); + case "WAFInvalidOperationException": + case "com.amazonaws.waf#WAFInvalidOperationException": + throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); + case "WAFNonexistentItemException": + case "com.amazonaws.waf#WAFNonexistentItemException": + throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); + case "WAFNonEmptyEntityException": + case "com.amazonaws.waf#WAFNonEmptyEntityException": + throw await de_WAFNonEmptyEntityExceptionRes(parsedOutput, context); + case "WAFReferencedItemException": + case "com.amazonaws.waf#WAFReferencedItemException": + throw await de_WAFReferencedItemExceptionRes(parsedOutput, context); + case "WAFServiceLinkedRoleErrorException": + case "com.amazonaws.waf#WAFServiceLinkedRoleErrorException": + throw await de_WAFServiceLinkedRoleErrorExceptionRes(parsedOutput, context); + case "WAFInvalidPermissionPolicyException": + case "com.amazonaws.waf#WAFInvalidPermissionPolicyException": + throw await de_WAFInvalidPermissionPolicyExceptionRes(parsedOutput, context); + case "WAFNonexistentContainerException": + case "com.amazonaws.waf#WAFNonexistentContainerException": + throw await de_WAFNonexistentContainerExceptionRes(parsedOutput, context); + case "WAFInvalidRegexPatternException": + case "com.amazonaws.waf#WAFInvalidRegexPatternException": + throw await de_WAFInvalidRegexPatternExceptionRes(parsedOutput, context); + case "WAFSubscriptionNotFoundException": + case "com.amazonaws.waf#WAFSubscriptionNotFoundException": + throw await de_WAFSubscriptionNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-wafv2/src/protocols/Aws_json1_1.ts b/clients/client-wafv2/src/protocols/Aws_json1_1.ts index cdba3db4e831..28943e0a19de 100644 --- a/clients/client-wafv2/src/protocols/Aws_json1_1.ts +++ b/clients/client-wafv2/src/protocols/Aws_json1_1.ts @@ -1047,7 +1047,7 @@ export const de_AssociateWebACLCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1059,44 +1059,6 @@ export const de_AssociateWebACLCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateWebACLCommandError - */ -const de_AssociateWebACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFUnavailableEntityException": - case "com.amazonaws.wafv2#WAFUnavailableEntityException": - throw await de_WAFUnavailableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CheckCapacityCommand */ @@ -1105,7 +1067,7 @@ export const de_CheckCapacityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CheckCapacityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1117,56 +1079,6 @@ export const de_CheckCapacityCommand = async ( return response; }; -/** - * deserializeAws_json1_1CheckCapacityCommandError - */ -const de_CheckCapacityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFExpiredManagedRuleGroupVersionException": - case "com.amazonaws.wafv2#WAFExpiredManagedRuleGroupVersionException": - throw await de_WAFExpiredManagedRuleGroupVersionExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFInvalidResourceException": - case "com.amazonaws.wafv2#WAFInvalidResourceException": - throw await de_WAFInvalidResourceExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafv2#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFSubscriptionNotFoundException": - case "com.amazonaws.wafv2#WAFSubscriptionNotFoundException": - throw await de_WAFSubscriptionNotFoundExceptionRes(parsedOutput, context); - case "WAFUnavailableEntityException": - case "com.amazonaws.wafv2#WAFUnavailableEntityException": - throw await de_WAFUnavailableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAPIKeyCommand */ @@ -1175,7 +1087,7 @@ export const de_CreateAPIKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAPIKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1187,41 +1099,6 @@ export const de_CreateAPIKeyCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateAPIKeyCommandError - */ -const de_CreateAPIKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafv2#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateIPSetCommand */ @@ -1230,7 +1107,7 @@ export const de_CreateIPSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateIPSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1242,53 +1119,6 @@ export const de_CreateIPSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateIPSetCommandError - */ -const de_CreateIPSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDuplicateItemException": - case "com.amazonaws.wafv2#WAFDuplicateItemException": - throw await de_WAFDuplicateItemExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafv2#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafv2#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafv2#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateRegexPatternSetCommand */ @@ -1297,7 +1127,7 @@ export const de_CreateRegexPatternSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRegexPatternSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1309,53 +1139,6 @@ export const de_CreateRegexPatternSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateRegexPatternSetCommandError - */ -const de_CreateRegexPatternSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDuplicateItemException": - case "com.amazonaws.wafv2#WAFDuplicateItemException": - throw await de_WAFDuplicateItemExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafv2#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafv2#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafv2#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateRuleGroupCommand */ @@ -1364,7 +1147,7 @@ export const de_CreateRuleGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1376,62 +1159,6 @@ export const de_CreateRuleGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateRuleGroupCommandError - */ -const de_CreateRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDuplicateItemException": - case "com.amazonaws.wafv2#WAFDuplicateItemException": - throw await de_WAFDuplicateItemExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafv2#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - case "WAFSubscriptionNotFoundException": - case "com.amazonaws.wafv2#WAFSubscriptionNotFoundException": - throw await de_WAFSubscriptionNotFoundExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafv2#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafv2#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - case "WAFUnavailableEntityException": - case "com.amazonaws.wafv2#WAFUnavailableEntityException": - throw await de_WAFUnavailableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateWebACLCommand */ @@ -1440,7 +1167,7 @@ export const de_CreateWebACLCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1453,79 +1180,14 @@ export const de_CreateWebACLCommand = async ( }; /** - * deserializeAws_json1_1CreateWebACLCommandError - */ -const de_CreateWebACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFConfigurationWarningException": - case "com.amazonaws.wafv2#WAFConfigurationWarningException": - throw await de_WAFConfigurationWarningExceptionRes(parsedOutput, context); - case "WAFDuplicateItemException": - case "com.amazonaws.wafv2#WAFDuplicateItemException": - throw await de_WAFDuplicateItemExceptionRes(parsedOutput, context); - case "WAFExpiredManagedRuleGroupVersionException": - case "com.amazonaws.wafv2#WAFExpiredManagedRuleGroupVersionException": - throw await de_WAFExpiredManagedRuleGroupVersionExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFInvalidResourceException": - case "com.amazonaws.wafv2#WAFInvalidResourceException": - throw await de_WAFInvalidResourceExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafv2#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - case "WAFSubscriptionNotFoundException": - case "com.amazonaws.wafv2#WAFSubscriptionNotFoundException": - throw await de_WAFSubscriptionNotFoundExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafv2#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafv2#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - case "WAFUnavailableEntityException": - case "com.amazonaws.wafv2#WAFUnavailableEntityException": - throw await de_WAFUnavailableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteFirewallManagerRuleGroupsCommand + * deserializeAws_json1_1DeleteFirewallManagerRuleGroupsCommand */ export const de_DeleteFirewallManagerRuleGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteFirewallManagerRuleGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1537,44 +1199,6 @@ export const de_DeleteFirewallManagerRuleGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteFirewallManagerRuleGroupsCommandError - */ -const de_DeleteFirewallManagerRuleGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteIPSetCommand */ @@ -1583,7 +1207,7 @@ export const de_DeleteIPSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteIPSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1595,53 +1219,6 @@ export const de_DeleteIPSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteIPSetCommandError - */ -const de_DeleteIPSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFAssociatedItemException": - case "com.amazonaws.wafv2#WAFAssociatedItemException": - throw await de_WAFAssociatedItemExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafv2#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafv2#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteLoggingConfigurationCommand */ @@ -1650,7 +1227,7 @@ export const de_DeleteLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1662,44 +1239,6 @@ export const de_DeleteLoggingConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteLoggingConfigurationCommandError - */ -const de_DeleteLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeletePermissionPolicyCommand */ @@ -1708,7 +1247,7 @@ export const de_DeletePermissionPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeletePermissionPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1720,38 +1259,6 @@ export const de_DeletePermissionPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeletePermissionPolicyCommandError - */ -const de_DeletePermissionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteRegexPatternSetCommand */ @@ -1760,7 +1267,7 @@ export const de_DeleteRegexPatternSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRegexPatternSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1772,53 +1279,6 @@ export const de_DeleteRegexPatternSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteRegexPatternSetCommandError - */ -const de_DeleteRegexPatternSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFAssociatedItemException": - case "com.amazonaws.wafv2#WAFAssociatedItemException": - throw await de_WAFAssociatedItemExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafv2#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafv2#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DeleteRuleGroupCommand */ @@ -1827,7 +1287,7 @@ export const de_DeleteRuleGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1840,61 +1300,14 @@ export const de_DeleteRuleGroupCommand = async ( }; /** - * deserializeAws_json1_1DeleteRuleGroupCommandError + * deserializeAws_json1_1DeleteWebACLCommand */ -const de_DeleteRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFAssociatedItemException": - case "com.amazonaws.wafv2#WAFAssociatedItemException": - throw await de_WAFAssociatedItemExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafv2#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafv2#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteWebACLCommand - */ -export const de_DeleteWebACLCommand = async ( +export const de_DeleteWebACLCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DeleteWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1906,53 +1319,6 @@ export const de_DeleteWebACLCommand = async ( return response; }; -/** - * deserializeAws_json1_1DeleteWebACLCommandError - */ -const de_DeleteWebACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFAssociatedItemException": - case "com.amazonaws.wafv2#WAFAssociatedItemException": - throw await de_WAFAssociatedItemExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafv2#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafv2#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeAllManagedProductsCommand */ @@ -1961,7 +1327,7 @@ export const de_DescribeAllManagedProductsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeAllManagedProductsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1973,35 +1339,6 @@ export const de_DescribeAllManagedProductsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeAllManagedProductsCommandError - */ -const de_DescribeAllManagedProductsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeManagedProductsByVendorCommand */ @@ -2010,7 +1347,7 @@ export const de_DescribeManagedProductsByVendorCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeManagedProductsByVendorCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2022,38 +1359,6 @@ export const de_DescribeManagedProductsByVendorCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeManagedProductsByVendorCommandError - */ -const de_DescribeManagedProductsByVendorCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DescribeManagedRuleGroupCommand */ @@ -2062,7 +1367,7 @@ export const de_DescribeManagedRuleGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DescribeManagedRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2074,47 +1379,6 @@ export const de_DescribeManagedRuleGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1DescribeManagedRuleGroupCommandError - */ -const de_DescribeManagedRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFExpiredManagedRuleGroupVersionException": - case "com.amazonaws.wafv2#WAFExpiredManagedRuleGroupVersionException": - throw await de_WAFExpiredManagedRuleGroupVersionExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFInvalidResourceException": - case "com.amazonaws.wafv2#WAFInvalidResourceException": - throw await de_WAFInvalidResourceExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1DisassociateWebACLCommand */ @@ -2123,7 +1387,7 @@ export const de_DisassociateWebACLCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DisassociateWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2135,41 +1399,6 @@ export const de_DisassociateWebACLCommand = async ( return response; }; -/** - * deserializeAws_json1_1DisassociateWebACLCommandError - */ -const de_DisassociateWebACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GenerateMobileSdkReleaseUrlCommand */ @@ -2178,7 +1407,7 @@ export const de_GenerateMobileSdkReleaseUrlCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GenerateMobileSdkReleaseUrlCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2190,41 +1419,6 @@ export const de_GenerateMobileSdkReleaseUrlCommand = async ( return response; }; -/** - * deserializeAws_json1_1GenerateMobileSdkReleaseUrlCommandError - */ -const de_GenerateMobileSdkReleaseUrlCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetDecryptedAPIKeyCommand */ @@ -2233,7 +1427,7 @@ export const de_GetDecryptedAPIKeyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetDecryptedAPIKeyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2246,49 +1440,14 @@ export const de_GetDecryptedAPIKeyCommand = async ( }; /** - * deserializeAws_json1_1GetDecryptedAPIKeyCommandError + * deserializeAws_json1_1GetIPSetCommand */ -const de_GetDecryptedAPIKeyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFInvalidResourceException": - case "com.amazonaws.wafv2#WAFInvalidResourceException": - throw await de_WAFInvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetIPSetCommand - */ -export const de_GetIPSetCommand = async ( +export const de_GetIPSetCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetIPSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2300,41 +1459,6 @@ export const de_GetIPSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetIPSetCommandError - */ -const de_GetIPSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetLoggingConfigurationCommand */ @@ -2343,7 +1467,7 @@ export const de_GetLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2355,41 +1479,6 @@ export const de_GetLoggingConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetLoggingConfigurationCommandError - */ -const de_GetLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetManagedRuleSetCommand */ @@ -2398,7 +1487,7 @@ export const de_GetManagedRuleSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetManagedRuleSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2410,41 +1499,6 @@ export const de_GetManagedRuleSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetManagedRuleSetCommandError - */ -const de_GetManagedRuleSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetMobileSdkReleaseCommand */ @@ -2453,7 +1507,7 @@ export const de_GetMobileSdkReleaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetMobileSdkReleaseCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2465,41 +1519,6 @@ export const de_GetMobileSdkReleaseCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetMobileSdkReleaseCommandError - */ -const de_GetMobileSdkReleaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetPermissionPolicyCommand */ @@ -2508,7 +1527,7 @@ export const de_GetPermissionPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetPermissionPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2520,38 +1539,6 @@ export const de_GetPermissionPolicyCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetPermissionPolicyCommandError - */ -const de_GetPermissionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetRateBasedStatementManagedKeysCommand */ @@ -2560,7 +1547,7 @@ export const de_GetRateBasedStatementManagedKeysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRateBasedStatementManagedKeysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2572,44 +1559,6 @@ export const de_GetRateBasedStatementManagedKeysCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetRateBasedStatementManagedKeysCommandError - */ -const de_GetRateBasedStatementManagedKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFUnsupportedAggregateKeyTypeException": - case "com.amazonaws.wafv2#WAFUnsupportedAggregateKeyTypeException": - throw await de_WAFUnsupportedAggregateKeyTypeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetRegexPatternSetCommand */ @@ -2618,7 +1567,7 @@ export const de_GetRegexPatternSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRegexPatternSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2630,41 +1579,6 @@ export const de_GetRegexPatternSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetRegexPatternSetCommandError - */ -const de_GetRegexPatternSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetRuleGroupCommand */ @@ -2673,7 +1587,7 @@ export const de_GetRuleGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2686,49 +1600,14 @@ export const de_GetRuleGroupCommand = async ( }; /** - * deserializeAws_json1_1GetRuleGroupCommandError + * deserializeAws_json1_1GetSampledRequestsCommand */ -const de_GetRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetSampledRequestsCommand - */ -export const de_GetSampledRequestsCommand = async ( +export const de_GetSampledRequestsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetSampledRequestsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2740,38 +1619,6 @@ export const de_GetSampledRequestsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetSampledRequestsCommandError - */ -const de_GetSampledRequestsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetWebACLCommand */ @@ -2780,7 +1627,7 @@ export const de_GetWebACLCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2792,41 +1639,6 @@ export const de_GetWebACLCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetWebACLCommandError - */ -const de_GetWebACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1GetWebACLForResourceCommand */ @@ -2835,7 +1647,7 @@ export const de_GetWebACLForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GetWebACLForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2847,44 +1659,6 @@ export const de_GetWebACLForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1GetWebACLForResourceCommandError - */ -const de_GetWebACLForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFUnavailableEntityException": - case "com.amazonaws.wafv2#WAFUnavailableEntityException": - throw await de_WAFUnavailableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAPIKeysCommand */ @@ -2893,7 +1667,7 @@ export const de_ListAPIKeysCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAPIKeysCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2905,41 +1679,6 @@ export const de_ListAPIKeysCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAPIKeysCommandError - */ -const de_ListAPIKeysCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFInvalidResourceException": - case "com.amazonaws.wafv2#WAFInvalidResourceException": - throw await de_WAFInvalidResourceExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAvailableManagedRuleGroupsCommand */ @@ -2948,7 +1687,7 @@ export const de_ListAvailableManagedRuleGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAvailableManagedRuleGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -2960,38 +1699,6 @@ export const de_ListAvailableManagedRuleGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAvailableManagedRuleGroupsCommandError - */ -const de_ListAvailableManagedRuleGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListAvailableManagedRuleGroupVersionsCommand */ @@ -3000,7 +1707,7 @@ export const de_ListAvailableManagedRuleGroupVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListAvailableManagedRuleGroupVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3012,41 +1719,6 @@ export const de_ListAvailableManagedRuleGroupVersionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListAvailableManagedRuleGroupVersionsCommandError - */ -const de_ListAvailableManagedRuleGroupVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListIPSetsCommand */ @@ -3055,7 +1727,7 @@ export const de_ListIPSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListIPSetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3067,38 +1739,6 @@ export const de_ListIPSetsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListIPSetsCommandError - */ -const de_ListIPSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListLoggingConfigurationsCommand */ @@ -3107,7 +1747,7 @@ export const de_ListLoggingConfigurationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListLoggingConfigurationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3120,46 +1760,14 @@ export const de_ListLoggingConfigurationsCommand = async ( }; /** - * deserializeAws_json1_1ListLoggingConfigurationsCommandError + * deserializeAws_json1_1ListManagedRuleSetsCommand */ -const de_ListLoggingConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListManagedRuleSetsCommand - */ -export const de_ListManagedRuleSetsCommand = async ( +export const de_ListManagedRuleSetsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListManagedRuleSetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3171,38 +1779,6 @@ export const de_ListManagedRuleSetsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListManagedRuleSetsCommandError - */ -const de_ListManagedRuleSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListMobileSdkReleasesCommand */ @@ -3211,7 +1787,7 @@ export const de_ListMobileSdkReleasesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListMobileSdkReleasesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3223,38 +1799,6 @@ export const de_ListMobileSdkReleasesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListMobileSdkReleasesCommandError - */ -const de_ListMobileSdkReleasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListRegexPatternSetsCommand */ @@ -3263,7 +1807,7 @@ export const de_ListRegexPatternSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRegexPatternSetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3275,38 +1819,6 @@ export const de_ListRegexPatternSetsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListRegexPatternSetsCommandError - */ -const de_ListRegexPatternSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListResourcesForWebACLCommand */ @@ -3315,7 +1827,7 @@ export const de_ListResourcesForWebACLCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListResourcesForWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3327,41 +1839,6 @@ export const de_ListResourcesForWebACLCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListResourcesForWebACLCommandError - */ -const de_ListResourcesForWebACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListRuleGroupsCommand */ @@ -3370,7 +1847,7 @@ export const de_ListRuleGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListRuleGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3382,38 +1859,6 @@ export const de_ListRuleGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListRuleGroupsCommandError - */ -const de_ListRuleGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListTagsForResourceCommand */ @@ -3422,7 +1867,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3434,47 +1879,6 @@ export const de_ListTagsForResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafv2#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafv2#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ListWebACLsCommand */ @@ -3483,7 +1887,7 @@ export const de_ListWebACLsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ListWebACLsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3495,38 +1899,6 @@ export const de_ListWebACLsCommand = async ( return response; }; -/** - * deserializeAws_json1_1ListWebACLsCommandError - */ -const de_ListWebACLsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutLoggingConfigurationCommand */ @@ -3535,7 +1907,7 @@ export const de_PutLoggingConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutLoggingConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3547,53 +1919,6 @@ export const de_PutLoggingConfigurationCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutLoggingConfigurationCommandError - */ -const de_PutLoggingConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafv2#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFLogDestinationPermissionIssueException": - case "com.amazonaws.wafv2#WAFLogDestinationPermissionIssueException": - throw await de_WAFLogDestinationPermissionIssueExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - case "WAFServiceLinkedRoleErrorException": - case "com.amazonaws.wafv2#WAFServiceLinkedRoleErrorException": - throw await de_WAFServiceLinkedRoleErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutManagedRuleSetVersionsCommand */ @@ -3602,7 +1927,7 @@ export const de_PutManagedRuleSetVersionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutManagedRuleSetVersionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3614,44 +1939,6 @@ export const de_PutManagedRuleSetVersionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutManagedRuleSetVersionsCommandError - */ -const de_PutManagedRuleSetVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1PutPermissionPolicyCommand */ @@ -3660,192 +1947,32 @@ export const de_PutPermissionPolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutPermissionPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); const response: PutPermissionPolicyCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutPermissionPolicyCommandError - */ -const de_PutPermissionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFInvalidPermissionPolicyException": - case "com.amazonaws.wafv2#WAFInvalidPermissionPolicyException": - throw await de_WAFInvalidPermissionPolicyExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1TagResourceCommand - */ -export const de_TagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: TagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafv2#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafv2#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafv2#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UntagResourceCommand - */ -export const de_UntagResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: UntagResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFTagOperationException": - case "com.amazonaws.wafv2#WAFTagOperationException": - throw await de_WAFTagOperationExceptionRes(parsedOutput, context); - case "WAFTagOperationInternalErrorException": - case "com.amazonaws.wafv2#WAFTagOperationInternalErrorException": - throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateIPSetCommand + * deserializeAws_json1_1TagResourceCommand */ -export const de_UpdateIPSetCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateIPSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateIPSetCommandOutput = { + const response: TagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3853,63 +1980,39 @@ export const de_UpdateIPSetCommand = async ( }; /** - * deserializeAws_json1_1UpdateIPSetCommandError + * deserializeAws_json1_1UntagResourceCommand */ -const de_UpdateIPSetCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDuplicateItemException": - case "com.amazonaws.wafv2#WAFDuplicateItemException": - throw await de_WAFDuplicateItemExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafv2#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateManagedRuleSetVersionExpiryDateCommand + * deserializeAws_json1_1UpdateIPSetCommand */ -export const de_UpdateManagedRuleSetVersionExpiryDateCommand = async ( +export const de_UpdateIPSetCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateManagedRuleSetVersionExpiryDateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_UpdateManagedRuleSetVersionExpiryDateResponse(data, context); - const response: UpdateManagedRuleSetVersionExpiryDateCommandOutput = { + contents = _json(data); + const response: UpdateIPSetCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3917,41 +2020,23 @@ export const de_UpdateManagedRuleSetVersionExpiryDateCommand = async ( }; /** - * deserializeAws_json1_1UpdateManagedRuleSetVersionExpiryDateCommandError + * deserializeAws_json1_1UpdateManagedRuleSetVersionExpiryDateCommand */ -const de_UpdateManagedRuleSetVersionExpiryDateCommandError = async ( +export const de_UpdateManagedRuleSetVersionExpiryDateCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateManagedRuleSetVersionExpiryDateResponse(data, context); + const response: UpdateManagedRuleSetVersionExpiryDateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -3962,7 +2047,7 @@ export const de_UpdateRegexPatternSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRegexPatternSetCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -3974,50 +2059,6 @@ export const de_UpdateRegexPatternSetCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateRegexPatternSetCommandError - */ -const de_UpdateRegexPatternSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFDuplicateItemException": - case "com.amazonaws.wafv2#WAFDuplicateItemException": - throw await de_WAFDuplicateItemExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafv2#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateRuleGroupCommand */ @@ -4026,7 +2067,7 @@ export const de_UpdateRuleGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRuleGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4038,59 +2079,6 @@ export const de_UpdateRuleGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateRuleGroupCommandError - */ -const de_UpdateRuleGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "WAFConfigurationWarningException": - case "com.amazonaws.wafv2#WAFConfigurationWarningException": - throw await de_WAFConfigurationWarningExceptionRes(parsedOutput, context); - case "WAFDuplicateItemException": - case "com.amazonaws.wafv2#WAFDuplicateItemException": - throw await de_WAFDuplicateItemExceptionRes(parsedOutput, context); - case "WAFInternalErrorException": - case "com.amazonaws.wafv2#WAFInternalErrorException": - throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); - case "WAFInvalidOperationException": - case "com.amazonaws.wafv2#WAFInvalidOperationException": - throw await de_WAFInvalidOperationExceptionRes(parsedOutput, context); - case "WAFInvalidParameterException": - case "com.amazonaws.wafv2#WAFInvalidParameterException": - throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); - case "WAFLimitsExceededException": - case "com.amazonaws.wafv2#WAFLimitsExceededException": - throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); - case "WAFSubscriptionNotFoundException": - case "com.amazonaws.wafv2#WAFSubscriptionNotFoundException": - throw await de_WAFSubscriptionNotFoundExceptionRes(parsedOutput, context); - case "WAFUnavailableEntityException": - case "com.amazonaws.wafv2#WAFUnavailableEntityException": - throw await de_WAFUnavailableEntityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateWebACLCommand */ @@ -4099,7 +2087,7 @@ export const de_UpdateWebACLCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateWebACLCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4112,27 +2100,15 @@ export const de_UpdateWebACLCommand = async ( }; /** - * deserializeAws_json1_1UpdateWebACLCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateWebACLCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "WAFConfigurationWarningException": - case "com.amazonaws.wafv2#WAFConfigurationWarningException": - throw await de_WAFConfigurationWarningExceptionRes(parsedOutput, context); - case "WAFDuplicateItemException": - case "com.amazonaws.wafv2#WAFDuplicateItemException": - throw await de_WAFDuplicateItemExceptionRes(parsedOutput, context); - case "WAFExpiredManagedRuleGroupVersionException": - case "com.amazonaws.wafv2#WAFExpiredManagedRuleGroupVersionException": - throw await de_WAFExpiredManagedRuleGroupVersionExceptionRes(parsedOutput, context); case "WAFInternalErrorException": case "com.amazonaws.wafv2#WAFInternalErrorException": throw await de_WAFInternalErrorExceptionRes(parsedOutput, context); @@ -4142,31 +2118,61 @@ const de_UpdateWebACLCommandError = async ( case "WAFInvalidParameterException": case "com.amazonaws.wafv2#WAFInvalidParameterException": throw await de_WAFInvalidParameterExceptionRes(parsedOutput, context); + case "WAFNonexistentItemException": + case "com.amazonaws.wafv2#WAFNonexistentItemException": + throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); + case "WAFUnavailableEntityException": + case "com.amazonaws.wafv2#WAFUnavailableEntityException": + throw await de_WAFUnavailableEntityExceptionRes(parsedOutput, context); + case "WAFExpiredManagedRuleGroupVersionException": + case "com.amazonaws.wafv2#WAFExpiredManagedRuleGroupVersionException": + throw await de_WAFExpiredManagedRuleGroupVersionExceptionRes(parsedOutput, context); case "WAFInvalidResourceException": case "com.amazonaws.wafv2#WAFInvalidResourceException": throw await de_WAFInvalidResourceExceptionRes(parsedOutput, context); case "WAFLimitsExceededException": case "com.amazonaws.wafv2#WAFLimitsExceededException": throw await de_WAFLimitsExceededExceptionRes(parsedOutput, context); - case "WAFNonexistentItemException": - case "com.amazonaws.wafv2#WAFNonexistentItemException": - throw await de_WAFNonexistentItemExceptionRes(parsedOutput, context); - case "WAFOptimisticLockException": - case "com.amazonaws.wafv2#WAFOptimisticLockException": - throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); case "WAFSubscriptionNotFoundException": case "com.amazonaws.wafv2#WAFSubscriptionNotFoundException": throw await de_WAFSubscriptionNotFoundExceptionRes(parsedOutput, context); - case "WAFUnavailableEntityException": - case "com.amazonaws.wafv2#WAFUnavailableEntityException": - throw await de_WAFUnavailableEntityExceptionRes(parsedOutput, context); + case "WAFDuplicateItemException": + case "com.amazonaws.wafv2#WAFDuplicateItemException": + throw await de_WAFDuplicateItemExceptionRes(parsedOutput, context); + case "WAFOptimisticLockException": + case "com.amazonaws.wafv2#WAFOptimisticLockException": + throw await de_WAFOptimisticLockExceptionRes(parsedOutput, context); + case "WAFTagOperationException": + case "com.amazonaws.wafv2#WAFTagOperationException": + throw await de_WAFTagOperationExceptionRes(parsedOutput, context); + case "WAFTagOperationInternalErrorException": + case "com.amazonaws.wafv2#WAFTagOperationInternalErrorException": + throw await de_WAFTagOperationInternalErrorExceptionRes(parsedOutput, context); + case "WAFConfigurationWarningException": + case "com.amazonaws.wafv2#WAFConfigurationWarningException": + throw await de_WAFConfigurationWarningExceptionRes(parsedOutput, context); + case "WAFAssociatedItemException": + case "com.amazonaws.wafv2#WAFAssociatedItemException": + throw await de_WAFAssociatedItemExceptionRes(parsedOutput, context); + case "WAFUnsupportedAggregateKeyTypeException": + case "com.amazonaws.wafv2#WAFUnsupportedAggregateKeyTypeException": + throw await de_WAFUnsupportedAggregateKeyTypeExceptionRes(parsedOutput, context); + case "WAFLogDestinationPermissionIssueException": + case "com.amazonaws.wafv2#WAFLogDestinationPermissionIssueException": + throw await de_WAFLogDestinationPermissionIssueExceptionRes(parsedOutput, context); + case "WAFServiceLinkedRoleErrorException": + case "com.amazonaws.wafv2#WAFServiceLinkedRoleErrorException": + throw await de_WAFServiceLinkedRoleErrorExceptionRes(parsedOutput, context); + case "WAFInvalidPermissionPolicyException": + case "com.amazonaws.wafv2#WAFInvalidPermissionPolicyException": + throw await de_WAFInvalidPermissionPolicyExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts b/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts index 4a2b6af2b87d..4b124e8ca590 100644 --- a/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts +++ b/clients/client-wellarchitected/src/protocols/Aws_restJson1.ts @@ -1802,7 +1802,7 @@ export const de_AssociateLensesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateLensesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1811,47 +1811,6 @@ export const de_AssociateLensesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateLensesCommandError - */ -const de_AssociateLensesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateProfilesCommand */ @@ -1860,7 +1819,7 @@ export const de_AssociateProfilesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1869,47 +1828,6 @@ export const de_AssociateProfilesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateProfilesCommandError - */ -const de_AssociateProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLensShareCommand */ @@ -1918,7 +1836,7 @@ export const de_CreateLensShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLensShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1931,50 +1849,6 @@ export const de_CreateLensShareCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLensShareCommandError - */ -const de_CreateLensShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wellarchitected#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLensVersionCommand */ @@ -1983,7 +1857,7 @@ export const de_CreateLensVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLensVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1997,50 +1871,6 @@ export const de_CreateLensVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateLensVersionCommandError - */ -const de_CreateLensVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wellarchitected#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateMilestoneCommand */ @@ -2049,7 +1879,7 @@ export const de_CreateMilestoneCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateMilestoneCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2063,50 +1893,6 @@ export const de_CreateMilestoneCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateMilestoneCommandError - */ -const de_CreateMilestoneCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wellarchitected#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateProfileCommand */ @@ -2115,7 +1901,7 @@ export const de_CreateProfileCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2130,186 +1916,57 @@ export const de_CreateProfileCommand = async ( }; /** - * deserializeAws_restJson1CreateProfileCommandError + * deserializeAws_restJson1CreateProfileShareCommand */ -const de_CreateProfileCommandError = async ( +export const de_CreateProfileShareCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wellarchitected#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ProfileArn: __expectString, + ShareId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateProfileShareCommand + * deserializeAws_restJson1CreateReviewTemplateCommand */ -export const de_CreateProfileShareCommand = async ( +export const de_CreateReviewTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateProfileShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ProfileArn: __expectString, - ShareId: __expectString, + TemplateArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateProfileShareCommandError + * deserializeAws_restJson1CreateTemplateShareCommand */ -const de_CreateProfileShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wellarchitected#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateReviewTemplateCommand - */ -export const de_CreateReviewTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateReviewTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - TemplateArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1CreateReviewTemplateCommandError - */ -const de_CreateReviewTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wellarchitected#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateTemplateShareCommand - */ -export const de_CreateTemplateShareCommand = async ( +export const de_CreateTemplateShareCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTemplateShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2323,50 +1980,6 @@ export const de_CreateTemplateShareCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateTemplateShareCommandError - */ -const de_CreateTemplateShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wellarchitected#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWorkloadCommand */ @@ -2375,7 +1988,7 @@ export const de_CreateWorkloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWorkloadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2389,50 +2002,6 @@ export const de_CreateWorkloadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWorkloadCommandError - */ -const de_CreateWorkloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wellarchitected#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateWorkloadShareCommand */ @@ -2441,7 +2010,7 @@ export const de_CreateWorkloadShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateWorkloadShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2455,50 +2024,6 @@ export const de_CreateWorkloadShareCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateWorkloadShareCommandError - */ -const de_CreateWorkloadShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wellarchitected#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteLensCommand */ @@ -2507,7 +2032,7 @@ export const de_DeleteLensCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLensCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2517,2216 +2042,444 @@ export const de_DeleteLensCommand = async ( }; /** - * deserializeAws_restJson1DeleteLensCommandError - */ -const de_DeleteLensCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteLensShareCommand - */ -export const de_DeleteLensShareCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLensShareCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteLensShareCommandError - */ -const de_DeleteLensShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteProfileCommand - */ -export const de_DeleteProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteProfileCommandError - */ -const de_DeleteProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteProfileShareCommand - */ -export const de_DeleteProfileShareCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteProfileShareCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteProfileShareCommandError - */ -const de_DeleteProfileShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteReviewTemplateCommand - */ -export const de_DeleteReviewTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteReviewTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteReviewTemplateCommandError - */ -const de_DeleteReviewTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteTemplateShareCommand - */ -export const de_DeleteTemplateShareCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTemplateShareCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteTemplateShareCommandError - */ -const de_DeleteTemplateShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteWorkloadCommand - */ -export const de_DeleteWorkloadCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteWorkloadCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteWorkloadCommandError - */ -const de_DeleteWorkloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteWorkloadShareCommand - */ -export const de_DeleteWorkloadShareCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteWorkloadShareCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteWorkloadShareCommandError - */ -const de_DeleteWorkloadShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateLensesCommand - */ -export const de_DisassociateLensesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateLensesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateLensesCommandError - */ -const de_DisassociateLensesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateProfilesCommand - */ -export const de_DisassociateProfilesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateProfilesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateProfilesCommandError - */ -const de_DisassociateProfilesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ExportLensCommand - */ -export const de_ExportLensCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ExportLensCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LensJSON: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ExportLensCommandError - */ -const de_ExportLensCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetAnswerCommand - */ -export const de_GetAnswerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAnswerCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Answer: _json, - LensAlias: __expectString, - LensArn: __expectString, - MilestoneNumber: __expectInt32, - WorkloadId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetAnswerCommandError - */ -const de_GetAnswerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetConsolidatedReportCommand - */ -export const de_GetConsolidatedReportCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetConsolidatedReportCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Base64String: __expectString, - Metrics: (_) => de_ConsolidatedReportMetrics(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetConsolidatedReportCommandError - */ -const de_GetConsolidatedReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetLensCommand - */ -export const de_GetLensCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLensCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Lens: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetLensCommandError - */ -const de_GetLensCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetLensReviewCommand - */ -export const de_GetLensReviewCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLensReviewCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LensReview: (_) => de_LensReview(_, context), - MilestoneNumber: __expectInt32, - WorkloadId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetLensReviewCommandError - */ -const de_GetLensReviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetLensReviewReportCommand - */ -export const de_GetLensReviewReportCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLensReviewReportCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LensReviewReport: _json, - MilestoneNumber: __expectInt32, - WorkloadId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetLensReviewReportCommandError - */ -const de_GetLensReviewReportCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetLensVersionDifferenceCommand - */ -export const de_GetLensVersionDifferenceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetLensVersionDifferenceCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - BaseLensVersion: __expectString, - LatestLensVersion: __expectString, - LensAlias: __expectString, - LensArn: __expectString, - TargetLensVersion: __expectString, - VersionDifferences: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetLensVersionDifferenceCommandError - */ -const de_GetLensVersionDifferenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetMilestoneCommand - */ -export const de_GetMilestoneCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetMilestoneCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Milestone: (_) => de_Milestone(_, context), - WorkloadId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetMilestoneCommandError - */ -const de_GetMilestoneCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetProfileCommand - */ -export const de_GetProfileCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProfileCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Profile: (_) => de_Profile(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetProfileCommandError - */ -const de_GetProfileCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetProfileTemplateCommand - */ -export const de_GetProfileTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetProfileTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ProfileTemplate: (_) => de_ProfileTemplate(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetProfileTemplateCommandError - */ -const de_GetProfileTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetReviewTemplateCommand - */ -export const de_GetReviewTemplateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReviewTemplateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ReviewTemplate: (_) => de_ReviewTemplate(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetReviewTemplateCommandError - */ -const de_GetReviewTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetReviewTemplateAnswerCommand - */ -export const de_GetReviewTemplateAnswerCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReviewTemplateAnswerCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Answer: _json, - LensAlias: __expectString, - TemplateArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetReviewTemplateAnswerCommandError - */ -const de_GetReviewTemplateAnswerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetReviewTemplateLensReviewCommand - */ -export const de_GetReviewTemplateLensReviewCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetReviewTemplateLensReviewCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LensReview: (_) => de_ReviewTemplateLensReview(_, context), - TemplateArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetReviewTemplateLensReviewCommandError - */ -const de_GetReviewTemplateLensReviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetWorkloadCommand - */ -export const de_GetWorkloadCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetWorkloadCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Workload: (_) => de_Workload(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetWorkloadCommandError - */ -const de_GetWorkloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ImportLensCommand - */ -export const de_ImportLensCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ImportLensCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LensArn: __expectString, - Status: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ImportLensCommandError - */ -const de_ImportLensCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wellarchitected#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListAnswersCommand - */ -export const de_ListAnswersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAnswersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - AnswerSummaries: _json, - LensAlias: __expectString, - LensArn: __expectString, - MilestoneNumber: __expectInt32, - NextToken: __expectString, - WorkloadId: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListAnswersCommandError - */ -const de_ListAnswersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListCheckDetailsCommand - */ -export const de_ListCheckDetailsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCheckDetailsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CheckDetails: (_) => de_CheckDetails(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListCheckDetailsCommandError - */ -const de_ListCheckDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + * deserializeAws_restJson1DeleteLensShareCommand + */ +export const de_DeleteLensShareCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListCheckSummariesCommand + * deserializeAws_restJson1DeleteProfileCommand */ -export const de_ListCheckSummariesCommand = async ( +export const de_DeleteProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListCheckSummariesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - CheckSummaries: (_) => de_CheckSummaries(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListCheckSummariesCommandError + * deserializeAws_restJson1DeleteProfileShareCommand */ -const de_ListCheckSummariesCommandError = async ( +export const de_DeleteProfileShareCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListLensesCommand + * deserializeAws_restJson1DeleteReviewTemplateCommand */ -export const de_ListLensesCommand = async ( +export const de_DeleteReviewTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLensesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LensSummaries: (_) => de_LensSummaries(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListLensesCommandError + * deserializeAws_restJson1DeleteTemplateShareCommand */ -const de_ListLensesCommandError = async ( +export const de_DeleteTemplateShareCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListLensReviewImprovementsCommand + * deserializeAws_restJson1DeleteWorkloadCommand */ -export const de_ListLensReviewImprovementsCommand = async ( +export const de_DeleteWorkloadCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLensReviewImprovementsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ImprovementSummaries: _json, - LensAlias: __expectString, - LensArn: __expectString, - MilestoneNumber: __expectInt32, - NextToken: __expectString, - WorkloadId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListLensReviewImprovementsCommandError + * deserializeAws_restJson1DeleteWorkloadShareCommand */ -const de_ListLensReviewImprovementsCommandError = async ( +export const de_DeleteWorkloadShareCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListLensReviewsCommand + * deserializeAws_restJson1DisassociateLensesCommand */ -export const de_ListLensReviewsCommand = async ( +export const de_DisassociateLensesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLensReviewsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LensReviewSummaries: (_) => de_LensReviewSummaries(_, context), - MilestoneNumber: __expectInt32, - NextToken: __expectString, - WorkloadId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1ListLensReviewsCommandError + * deserializeAws_restJson1DisassociateProfilesCommand */ -const de_ListLensReviewsCommandError = async ( +export const de_DisassociateProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1ListLensSharesCommand + * deserializeAws_restJson1ExportLensCommand */ -export const de_ListLensSharesCommand = async ( +export const de_ExportLensCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListLensSharesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - LensShareSummaries: _json, - NextToken: __expectString, + LensJSON: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListLensSharesCommandError + * deserializeAws_restJson1GetAnswerCommand */ -const de_ListLensSharesCommandError = async ( +export const de_GetAnswerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Answer: _json, + LensAlias: __expectString, + LensArn: __expectString, + MilestoneNumber: __expectInt32, + WorkloadId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListMilestonesCommand + * deserializeAws_restJson1GetConsolidatedReportCommand */ -export const de_ListMilestonesCommand = async ( +export const de_GetConsolidatedReportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListMilestonesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - MilestoneSummaries: (_) => de_MilestoneSummaries(_, context), + Base64String: __expectString, + Metrics: (_) => de_ConsolidatedReportMetrics(_, context), NextToken: __expectString, - WorkloadId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListMilestonesCommandError + * deserializeAws_restJson1GetLensCommand */ -const de_ListMilestonesCommandError = async ( +export const de_GetLensCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Lens: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListNotificationsCommand + * deserializeAws_restJson1GetLensReviewCommand */ -export const de_ListNotificationsCommand = async ( +export const de_GetLensReviewCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNotificationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - NotificationSummaries: _json, + LensReview: (_) => de_LensReview(_, context), + MilestoneNumber: __expectInt32, + WorkloadId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListNotificationsCommandError + * deserializeAws_restJson1GetLensReviewReportCommand */ -const de_ListNotificationsCommandError = async ( +export const de_GetLensReviewReportCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LensReviewReport: _json, + MilestoneNumber: __expectInt32, + WorkloadId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListProfileNotificationsCommand + * deserializeAws_restJson1GetLensVersionDifferenceCommand */ -export const de_ListProfileNotificationsCommand = async ( +export const de_GetLensVersionDifferenceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProfileNotificationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - NotificationSummaries: _json, + BaseLensVersion: __expectString, + LatestLensVersion: __expectString, + LensAlias: __expectString, + LensArn: __expectString, + TargetLensVersion: __expectString, + VersionDifferences: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListProfileNotificationsCommandError + * deserializeAws_restJson1GetMilestoneCommand */ -const de_ListProfileNotificationsCommandError = async ( +export const de_GetMilestoneCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Milestone: (_) => de_Milestone(_, context), + WorkloadId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListProfilesCommand + * deserializeAws_restJson1GetProfileCommand */ -export const de_ListProfilesCommand = async ( +export const de_GetProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProfilesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - ProfileSummaries: (_) => de_ProfileSummaries(_, context), + Profile: (_) => de_Profile(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListProfilesCommandError + * deserializeAws_restJson1GetProfileTemplateCommand */ -const de_ListProfilesCommandError = async ( +export const de_GetProfileTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ProfileTemplate: (_) => de_ProfileTemplate(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListProfileSharesCommand + * deserializeAws_restJson1GetReviewTemplateCommand */ -export const de_ListProfileSharesCommand = async ( +export const de_GetReviewTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListProfileSharesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - ProfileShareSummaries: _json, + ReviewTemplate: (_) => de_ReviewTemplate(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListProfileSharesCommandError + * deserializeAws_restJson1GetReviewTemplateAnswerCommand */ -const de_ListProfileSharesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +export const de_GetReviewTemplateAnswerCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Answer: _json, + LensAlias: __expectString, + TemplateArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListReviewTemplateAnswersCommand + * deserializeAws_restJson1GetReviewTemplateLensReviewCommand */ -export const de_ListReviewTemplateAnswersCommand = async ( +export const de_GetReviewTemplateLensReviewCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReviewTemplateAnswersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - AnswerSummaries: _json, - LensAlias: __expectString, - NextToken: __expectString, + LensReview: (_) => de_ReviewTemplateLensReview(_, context), TemplateArn: __expectString, }); Object.assign(contents, doc); @@ -4734,334 +2487,266 @@ export const de_ListReviewTemplateAnswersCommand = async ( }; /** - * deserializeAws_restJson1ListReviewTemplateAnswersCommandError + * deserializeAws_restJson1GetWorkloadCommand */ -const de_ListReviewTemplateAnswersCommandError = async ( +export const de_GetWorkloadCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Workload: (_) => de_Workload(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListReviewTemplatesCommand + * deserializeAws_restJson1ImportLensCommand */ -export const de_ListReviewTemplatesCommand = async ( +export const de_ImportLensCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListReviewTemplatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - NextToken: __expectString, - ReviewTemplates: (_) => de_ReviewTemplates(_, context), + LensArn: __expectString, + Status: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListReviewTemplatesCommandError + * deserializeAws_restJson1ListAnswersCommand */ -const de_ListReviewTemplatesCommandError = async ( +export const de_ListAnswersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AnswerSummaries: _json, + LensAlias: __expectString, + LensArn: __expectString, + MilestoneNumber: __expectInt32, + NextToken: __expectString, + WorkloadId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListShareInvitationsCommand + * deserializeAws_restJson1ListCheckDetailsCommand */ -export const de_ListShareInvitationsCommand = async ( +export const de_ListCheckDetailsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListShareInvitationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + CheckDetails: (_) => de_CheckDetails(_, context), NextToken: __expectString, - ShareInvitationSummaries: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListShareInvitationsCommandError + * deserializeAws_restJson1ListCheckSummariesCommand */ -const de_ListShareInvitationsCommandError = async ( +export const de_ListCheckSummariesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + CheckSummaries: (_) => de_CheckSummaries(_, context), + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1ListLensesCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_ListLensesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Tags: _json, + LensSummaries: (_) => de_LensSummaries(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1ListLensReviewImprovementsCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_ListLensReviewImprovementsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ImprovementSummaries: _json, + LensAlias: __expectString, + LensArn: __expectString, + MilestoneNumber: __expectInt32, + NextToken: __expectString, + WorkloadId: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTemplateSharesCommand + * deserializeAws_restJson1ListLensReviewsCommand */ -export const de_ListTemplateSharesCommand = async ( +export const de_ListLensReviewsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTemplateSharesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + LensReviewSummaries: (_) => de_LensReviewSummaries(_, context), + MilestoneNumber: __expectInt32, NextToken: __expectString, - TemplateArn: __expectString, - TemplateShareSummaries: _json, + WorkloadId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTemplateSharesCommandError + * deserializeAws_restJson1ListLensSharesCommand */ -const de_ListTemplateSharesCommandError = async ( +export const de_ListLensSharesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LensShareSummaries: _json, + NextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListWorkloadsCommand + * deserializeAws_restJson1ListMilestonesCommand */ -export const de_ListWorkloadsCommand = async ( +export const de_ListMilestonesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkloadsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + MilestoneSummaries: (_) => de_MilestoneSummaries(_, context), NextToken: __expectString, - WorkloadSummaries: (_) => de_WorkloadSummaries(_, context), + WorkloadId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListWorkloadsCommandError + * deserializeAws_restJson1ListNotificationsCommand */ -const de_ListWorkloadsCommandError = async ( +export const de_ListNotificationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + NotificationSummaries: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListWorkloadSharesCommand + * deserializeAws_restJson1ListProfileNotificationsCommand */ -export const de_ListWorkloadSharesCommand = async ( +export const de_ListProfileNotificationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWorkloadSharesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5069,530 +2754,369 @@ export const de_ListWorkloadSharesCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { NextToken: __expectString, - WorkloadId: __expectString, - WorkloadShareSummaries: _json, + NotificationSummaries: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListWorkloadSharesCommandError + * deserializeAws_restJson1ListProfilesCommand */ -const de_ListWorkloadSharesCommandError = async ( +export const de_ListProfilesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + ProfileSummaries: (_) => de_ProfileSummaries(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListProfileSharesCommand */ -export const de_TagResourceCommand = async ( +export const de_ListProfileSharesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + ProfileShareSummaries: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1ListReviewTemplateAnswersCommand */ -const de_TagResourceCommandError = async ( +export const de_ListReviewTemplateAnswersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + AnswerSummaries: _json, + LensAlias: __expectString, + NextToken: __expectString, + TemplateArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1ListReviewTemplatesCommand */ -export const de_UntagResourceCommand = async ( +export const de_ListReviewTemplatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + ReviewTemplates: (_) => de_ReviewTemplates(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1ListShareInvitationsCommand */ -const de_UntagResourceCommandError = async ( +export const de_ListShareInvitationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + ShareInvitationSummaries: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateAnswerCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_UpdateAnswerCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAnswerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Answer: _json, - LensAlias: __expectString, - LensArn: __expectString, - WorkloadId: __expectString, + Tags: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateAnswerCommandError + * deserializeAws_restJson1ListTemplateSharesCommand */ -const de_UpdateAnswerCommandError = async ( +export const de_ListTemplateSharesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + TemplateArn: __expectString, + TemplateShareSummaries: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateGlobalSettingsCommand + * deserializeAws_restJson1ListWorkloadsCommand */ -export const de_UpdateGlobalSettingsCommand = async ( +export const de_ListWorkloadsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGlobalSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + WorkloadSummaries: (_) => de_WorkloadSummaries(_, context), + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateGlobalSettingsCommandError + * deserializeAws_restJson1ListWorkloadSharesCommand */ -const de_UpdateGlobalSettingsCommandError = async ( +export const de_ListWorkloadSharesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + WorkloadId: __expectString, + WorkloadShareSummaries: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateLensReviewCommand + * deserializeAws_restJson1TagResourceCommand */ -export const de_UpdateLensReviewCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateLensReviewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - LensReview: (_) => de_LensReview(_, context), - WorkloadId: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1UpdateLensReviewCommandError + * deserializeAws_restJson1UntagResourceCommand */ -const de_UpdateLensReviewCommandError = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateProfileCommand + * deserializeAws_restJson1UpdateAnswerCommand */ -export const de_UpdateProfileCommand = async ( +export const de_UpdateAnswerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateProfileCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Profile: (_) => de_Profile(_, context), + Answer: _json, + LensAlias: __expectString, + LensArn: __expectString, + WorkloadId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateProfileCommandError + * deserializeAws_restJson1UpdateGlobalSettingsCommand */ -const de_UpdateProfileCommandError = async ( +export const de_UpdateGlobalSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateReviewTemplateCommand + * deserializeAws_restJson1UpdateLensReviewCommand */ -export const de_UpdateReviewTemplateCommand = async ( +export const de_UpdateLensReviewCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateReviewTemplateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ReviewTemplate: (_) => de_ReviewTemplate(_, context), + LensReview: (_) => de_LensReview(_, context), + WorkloadId: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateReviewTemplateCommandError - */ -const de_UpdateReviewTemplateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1UpdateReviewTemplateAnswerCommand + * deserializeAws_restJson1UpdateProfileCommand */ -export const de_UpdateReviewTemplateAnswerCommand = async ( +export const de_UpdateProfileCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateReviewTemplateAnswerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Answer: _json, - LensAlias: __expectString, - TemplateArn: __expectString, + Profile: (_) => de_Profile(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateReviewTemplateAnswerCommandError + * deserializeAws_restJson1UpdateReviewTemplateCommand */ -const de_UpdateReviewTemplateAnswerCommandError = async ( +export const de_UpdateReviewTemplateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ReviewTemplate: (_) => de_ReviewTemplate(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateReviewTemplateLensReviewCommand + * deserializeAws_restJson1UpdateReviewTemplateAnswerCommand */ -export const de_UpdateReviewTemplateLensReviewCommand = async ( +export const de_UpdateReviewTemplateAnswerCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateReviewTemplateLensReviewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - LensReview: (_) => de_ReviewTemplateLensReview(_, context), + Answer: _json, + LensAlias: __expectString, TemplateArn: __expectString, }); Object.assign(contents, doc); @@ -5600,44 +3124,25 @@ export const de_UpdateReviewTemplateLensReviewCommand = async ( }; /** - * deserializeAws_restJson1UpdateReviewTemplateLensReviewCommandError + * deserializeAws_restJson1UpdateReviewTemplateLensReviewCommand */ -const de_UpdateReviewTemplateLensReviewCommandError = async ( +export const de_UpdateReviewTemplateLensReviewCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + LensReview: (_) => de_ReviewTemplateLensReview(_, context), + TemplateArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -5648,7 +3153,7 @@ export const de_UpdateShareInvitationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateShareInvitationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5661,47 +3166,6 @@ export const de_UpdateShareInvitationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateShareInvitationCommandError - */ -const de_UpdateShareInvitationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWorkloadCommand */ @@ -5710,7 +3174,7 @@ export const de_UpdateWorkloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateWorkloadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5723,47 +3187,6 @@ export const de_UpdateWorkloadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateWorkloadCommandError - */ -const de_UpdateWorkloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateWorkloadShareCommand */ @@ -5772,7 +3195,7 @@ export const de_UpdateWorkloadShareCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateWorkloadShareCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5786,47 +3209,6 @@ export const de_UpdateWorkloadShareCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateWorkloadShareCommandError - */ -const de_UpdateWorkloadShareCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpgradeLensReviewCommand */ @@ -5835,7 +3217,7 @@ export const de_UpgradeLensReviewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpgradeLensReviewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5844,47 +3226,6 @@ export const de_UpgradeLensReviewCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpgradeLensReviewCommandError - */ -const de_UpgradeLensReviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpgradeProfileVersionCommand */ @@ -5893,7 +3234,7 @@ export const de_UpgradeProfileVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpgradeProfileVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5902,47 +3243,6 @@ export const de_UpgradeProfileVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpgradeProfileVersionCommandError - */ -const de_UpgradeProfileVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wellarchitected#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wellarchitected#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.wellarchitected#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wellarchitected#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.wellarchitected#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wellarchitected#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpgradeReviewTemplateLensReviewCommand */ @@ -5951,7 +3251,7 @@ export const de_UpgradeReviewTemplateLensReviewCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpgradeReviewTemplateLensReviewCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5961,12 +3261,9 @@ export const de_UpgradeReviewTemplateLensReviewCommand = async ( }; /** - * deserializeAws_restJson1UpgradeReviewTemplateLensReviewCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpgradeReviewTemplateLensReviewCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5991,13 +3288,16 @@ const de_UpgradeReviewTemplateLensReviewCommandError = async ( case "ValidationException": case "com.amazonaws.wellarchitected#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.wellarchitected#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-wisdom/src/protocols/Aws_restJson1.ts b/clients/client-wisdom/src/protocols/Aws_restJson1.ts index 60c4efbd5b35..2e7a6028cdbf 100644 --- a/clients/client-wisdom/src/protocols/Aws_restJson1.ts +++ b/clients/client-wisdom/src/protocols/Aws_restJson1.ts @@ -1043,7 +1043,7 @@ export const de_CreateAssistantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAssistantCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1056,41 +1056,6 @@ export const de_CreateAssistantCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAssistantCommandError - */ -const de_CreateAssistantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wisdom#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wisdom#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateAssistantAssociationCommand */ @@ -1099,7 +1064,7 @@ export const de_CreateAssistantAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateAssistantAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1112,44 +1077,6 @@ export const de_CreateAssistantAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateAssistantAssociationCommandError - */ -const de_CreateAssistantAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wisdom#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wisdom#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateContentCommand */ @@ -1158,7 +1085,7 @@ export const de_CreateContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1171,44 +1098,6 @@ export const de_CreateContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateContentCommandError - */ -const de_CreateContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wisdom#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wisdom#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateKnowledgeBaseCommand */ @@ -1217,7 +1106,7 @@ export const de_CreateKnowledgeBaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateKnowledgeBaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1230,41 +1119,6 @@ export const de_CreateKnowledgeBaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateKnowledgeBaseCommandError - */ -const de_CreateKnowledgeBaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wisdom#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wisdom#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateQuickResponseCommand */ @@ -1273,7 +1127,7 @@ export const de_CreateQuickResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateQuickResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1286,44 +1140,6 @@ export const de_CreateQuickResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateQuickResponseCommandError - */ -const de_CreateQuickResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wisdom#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wisdom#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSessionCommand */ @@ -1332,7 +1148,7 @@ export const de_CreateSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1345,38 +1161,6 @@ export const de_CreateSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSessionCommandError - */ -const de_CreateSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictException": - case "com.amazonaws.wisdom#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAssistantCommand */ @@ -1385,7 +1169,7 @@ export const de_DeleteAssistantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAssistantCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1394,38 +1178,6 @@ export const de_DeleteAssistantCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAssistantCommandError - */ -const de_DeleteAssistantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteAssistantAssociationCommand */ @@ -1434,7 +1186,7 @@ export const de_DeleteAssistantAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteAssistantAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1443,38 +1195,6 @@ export const de_DeleteAssistantAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteAssistantAssociationCommandError - */ -const de_DeleteAssistantAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteContentCommand */ @@ -1483,7 +1203,7 @@ export const de_DeleteContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1492,38 +1212,6 @@ export const de_DeleteContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteContentCommandError - */ -const de_DeleteContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteImportJobCommand */ @@ -1532,7 +1220,7 @@ export const de_DeleteImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1541,41 +1229,6 @@ export const de_DeleteImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteImportJobCommandError - */ -const de_DeleteImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wisdom#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteKnowledgeBaseCommand */ @@ -1584,7 +1237,7 @@ export const de_DeleteKnowledgeBaseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteKnowledgeBaseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1593,41 +1246,6 @@ export const de_DeleteKnowledgeBaseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteKnowledgeBaseCommandError - */ -const de_DeleteKnowledgeBaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wisdom#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteQuickResponseCommand */ @@ -1636,7 +1254,7 @@ export const de_DeleteQuickResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteQuickResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1645,38 +1263,6 @@ export const de_DeleteQuickResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteQuickResponseCommandError - */ -const de_DeleteQuickResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAssistantCommand */ @@ -1685,7 +1271,7 @@ export const de_GetAssistantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssistantCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1698,38 +1284,6 @@ export const de_GetAssistantCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAssistantCommandError - */ -const de_GetAssistantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetAssistantAssociationCommand */ @@ -1738,7 +1292,7 @@ export const de_GetAssistantAssociationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetAssistantAssociationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1751,38 +1305,6 @@ export const de_GetAssistantAssociationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetAssistantAssociationCommandError - */ -const de_GetAssistantAssociationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetContentCommand */ @@ -1791,7 +1313,7 @@ export const de_GetContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1804,38 +1326,6 @@ export const de_GetContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetContentCommandError - */ -const de_GetContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetContentSummaryCommand */ @@ -1844,7 +1334,7 @@ export const de_GetContentSummaryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetContentSummaryCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1858,152 +1348,56 @@ export const de_GetContentSummaryCommand = async ( }; /** - * deserializeAws_restJson1GetContentSummaryCommandError + * deserializeAws_restJson1GetImportJobCommand */ -const de_GetContentSummaryCommandError = async ( +export const de_GetImportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + importJob: (_) => de_ImportJobData(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetImportJobCommand + * deserializeAws_restJson1GetKnowledgeBaseCommand */ -export const de_GetImportJobCommand = async ( +export const de_GetKnowledgeBaseCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - importJob: (_) => de_ImportJobData(_, context), + knowledgeBase: (_) => de_KnowledgeBaseData(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetImportJobCommandError + * deserializeAws_restJson1GetQuickResponseCommand */ -const de_GetImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetKnowledgeBaseCommand - */ -export const de_GetKnowledgeBaseCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetKnowledgeBaseCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - knowledgeBase: (_) => de_KnowledgeBaseData(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetKnowledgeBaseCommandError - */ -const de_GetKnowledgeBaseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetQuickResponseCommand - */ -export const de_GetQuickResponseCommand = async ( +export const de_GetQuickResponseCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetQuickResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2016,38 +1410,6 @@ export const de_GetQuickResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetQuickResponseCommandError - */ -const de_GetQuickResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetRecommendationsCommand */ @@ -2056,7 +1418,7 @@ export const de_GetRecommendationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRecommendationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2070,38 +1432,6 @@ export const de_GetRecommendationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRecommendationsCommandError - */ -const de_GetRecommendationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSessionCommand */ @@ -2110,7 +1440,7 @@ export const de_GetSessionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSessionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2123,38 +1453,6 @@ export const de_GetSessionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSessionCommandError - */ -const de_GetSessionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssistantAssociationsCommand */ @@ -2163,7 +1461,7 @@ export const de_ListAssistantAssociationsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssistantAssociationsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2177,38 +1475,6 @@ export const de_ListAssistantAssociationsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssistantAssociationsCommandError - */ -const de_ListAssistantAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListAssistantsCommand */ @@ -2217,7 +1483,7 @@ export const de_ListAssistantsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListAssistantsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2231,35 +1497,6 @@ export const de_ListAssistantsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListAssistantsCommandError - */ -const de_ListAssistantsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListContentsCommand */ @@ -2268,7 +1505,7 @@ export const de_ListContentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListContentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2282,38 +1519,6 @@ export const de_ListContentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListContentsCommandError - */ -const de_ListContentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListImportJobsCommand */ @@ -2322,7 +1527,7 @@ export const de_ListImportJobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListImportJobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2337,43 +1542,14 @@ export const de_ListImportJobsCommand = async ( }; /** - * deserializeAws_restJson1ListImportJobsCommandError + * deserializeAws_restJson1ListKnowledgeBasesCommand */ -const de_ListImportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListKnowledgeBasesCommand - */ -export const de_ListKnowledgeBasesCommand = async ( +export const de_ListKnowledgeBasesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListKnowledgeBasesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2387,35 +1563,6 @@ export const de_ListKnowledgeBasesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListKnowledgeBasesCommandError - */ -const de_ListKnowledgeBasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListQuickResponsesCommand */ @@ -2424,7 +1571,7 @@ export const de_ListQuickResponsesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListQuickResponsesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2438,38 +1585,6 @@ export const de_ListQuickResponsesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListQuickResponsesCommandError - */ -const de_ListQuickResponsesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -2478,7 +1593,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2491,32 +1606,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1NotifyRecommendationsReceivedCommand */ @@ -2525,7 +1614,7 @@ export const de_NotifyRecommendationsReceivedCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_NotifyRecommendationsReceivedCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2539,38 +1628,6 @@ export const de_NotifyRecommendationsReceivedCommand = async ( return contents; }; -/** - * deserializeAws_restJson1NotifyRecommendationsReceivedCommandError - */ -const de_NotifyRecommendationsReceivedCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1QueryAssistantCommand */ @@ -2579,7 +1636,7 @@ export const de_QueryAssistantCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_QueryAssistantCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2593,41 +1650,6 @@ export const de_QueryAssistantCommand = async ( return contents; }; -/** - * deserializeAws_restJson1QueryAssistantCommandError - */ -const de_QueryAssistantCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.wisdom#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommand */ @@ -2636,7 +1658,7 @@ export const de_RemoveKnowledgeBaseTemplateUriCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_RemoveKnowledgeBaseTemplateUriCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2645,158 +1667,37 @@ export const de_RemoveKnowledgeBaseTemplateUriCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RemoveKnowledgeBaseTemplateUriCommandError - */ -const de_RemoveKnowledgeBaseTemplateUriCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1SearchContentCommand - */ -export const de_SearchContentCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchContentCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - contentSummaries: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SearchContentCommandError - */ -const de_SearchContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SearchQuickResponsesCommand - */ -export const de_SearchQuickResponsesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchQuickResponsesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - nextToken: __expectString, - results: (_) => de_QuickResponseSearchResultsList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1SearchQuickResponsesCommandError - */ -const de_SearchQuickResponsesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "RequestTimeoutException": - case "com.amazonaws.wisdom#RequestTimeoutException": - throw await de_RequestTimeoutExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + */ +export const de_SearchContentCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + contentSummaries: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1SearchSessionsCommand + * deserializeAws_restJson1SearchQuickResponsesCommand */ -export const de_SearchSessionsCommand = async ( +export const de_SearchQuickResponsesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchSessionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2804,42 +1705,32 @@ export const de_SearchSessionsCommand = async ( const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { nextToken: __expectString, - sessionSummaries: _json, + results: (_) => de_QuickResponseSearchResultsList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1SearchSessionsCommandError + * deserializeAws_restJson1SearchSessionsCommand */ -const de_SearchSessionsCommandError = async ( +export const de_SearchSessionsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + sessionSummaries: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2850,7 +1741,7 @@ export const de_StartContentUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartContentUploadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2866,38 +1757,6 @@ export const de_StartContentUploadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartContentUploadCommandError - */ -const de_StartContentUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1StartImportJobCommand */ @@ -2906,7 +1765,7 @@ export const de_StartImportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StartImportJobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2919,44 +1778,6 @@ export const de_StartImportJobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StartImportJobCommandError - */ -const de_StartImportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.wisdom#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.wisdom#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2965,7 +1786,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2974,35 +1795,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.wisdom#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -3011,7 +1803,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3020,32 +1812,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateContentCommand */ @@ -3054,7 +1820,7 @@ export const de_UpdateContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3067,41 +1833,6 @@ export const de_UpdateContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateContentCommandError - */ -const de_UpdateContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.wisdom#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommand */ @@ -3110,7 +1841,7 @@ export const de_UpdateKnowledgeBaseTemplateUriCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateKnowledgeBaseTemplateUriCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3123,38 +1854,6 @@ export const de_UpdateKnowledgeBaseTemplateUriCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateKnowledgeBaseTemplateUriCommandError - */ -const de_UpdateKnowledgeBaseTemplateUriCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.wisdom#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.wisdom#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateQuickResponseCommand */ @@ -3163,7 +1862,7 @@ export const de_UpdateQuickResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateQuickResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3177,12 +1876,9 @@ export const de_UpdateQuickResponseCommand = async ( }; /** - * deserializeAws_restJson1UpdateQuickResponseCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateQuickResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -3195,22 +1891,31 @@ const de_UpdateQuickResponseCommandError = async ( case "ConflictException": case "com.amazonaws.wisdom#ConflictException": throw await de_ConflictExceptionRes(parsedOutput, context); - case "PreconditionFailedException": - case "com.amazonaws.wisdom#PreconditionFailedException": - throw await de_PreconditionFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.wisdom#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.wisdom#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.wisdom#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.wisdom#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "RequestTimeoutException": + case "com.amazonaws.wisdom#RequestTimeoutException": + throw await de_RequestTimeoutExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.wisdom#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "PreconditionFailedException": + case "com.amazonaws.wisdom#PreconditionFailedException": + throw await de_PreconditionFailedExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-workdocs/src/protocols/Aws_restJson1.ts b/clients/client-workdocs/src/protocols/Aws_restJson1.ts index b8b8d614f805..877e7936b571 100644 --- a/clients/client-workdocs/src/protocols/Aws_restJson1.ts +++ b/clients/client-workdocs/src/protocols/Aws_restJson1.ts @@ -1188,7 +1188,7 @@ export const de_AbortDocumentVersionUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_AbortDocumentVersionUploadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1197,50 +1197,6 @@ export const de_AbortDocumentVersionUploadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AbortDocumentVersionUploadCommandError - */ -const de_AbortDocumentVersionUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.workdocs#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ActivateUserCommand */ @@ -1249,7 +1205,7 @@ export const de_ActivateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ActivateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1262,44 +1218,6 @@ export const de_ActivateUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ActivateUserCommandError - */ -const de_ActivateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AddResourcePermissionsCommand */ @@ -1308,7 +1226,7 @@ export const de_AddResourcePermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_AddResourcePermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1321,44 +1239,6 @@ export const de_AddResourcePermissionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AddResourcePermissionsCommandError - */ -const de_AddResourcePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCommentCommand */ @@ -1367,7 +1247,7 @@ export const de_CreateCommentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateCommentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1380,53 +1260,6 @@ export const de_CreateCommentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCommentCommandError - */ -const de_CreateCommentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DocumentLockedForCommentsException": - case "com.amazonaws.workdocs#DocumentLockedForCommentsException": - throw await de_DocumentLockedForCommentsExceptionRes(parsedOutput, context); - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "InvalidCommentOperationException": - case "com.amazonaws.workdocs#InvalidCommentOperationException": - throw await de_InvalidCommentOperationExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateCustomMetadataCommand */ @@ -1435,7 +1268,7 @@ export const de_CreateCustomMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateCustomMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1444,50 +1277,6 @@ export const de_CreateCustomMetadataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateCustomMetadataCommandError - */ -const de_CreateCustomMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "CustomMetadataLimitExceededException": - case "com.amazonaws.workdocs#CustomMetadataLimitExceededException": - throw await de_CustomMetadataLimitExceededExceptionRes(parsedOutput, context); - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFolderCommand */ @@ -1496,7 +1285,7 @@ export const de_CreateFolderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateFolderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1509,59 +1298,6 @@ export const de_CreateFolderCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFolderCommandError - */ -const de_CreateFolderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.workdocs#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConflictingOperationException": - case "com.amazonaws.workdocs#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "EntityAlreadyExistsException": - case "com.amazonaws.workdocs#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workdocs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateLabelsCommand */ @@ -1570,7 +1306,7 @@ export const de_CreateLabelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateLabelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1580,55 +1316,14 @@ export const de_CreateLabelsCommand = async ( }; /** - * deserializeAws_restJson1CreateLabelsCommandError + * deserializeAws_restJson1CreateNotificationSubscriptionCommand */ -const de_CreateLabelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManyLabelsException": - case "com.amazonaws.workdocs#TooManyLabelsException": - throw await de_TooManyLabelsExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1CreateNotificationSubscriptionCommand - */ -export const de_CreateNotificationSubscriptionCommand = async ( +export const de_CreateNotificationSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateNotificationSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1641,41 +1336,6 @@ export const de_CreateNotificationSubscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateNotificationSubscriptionCommandError - */ -const de_CreateNotificationSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.workdocs#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "TooManySubscriptionsException": - case "com.amazonaws.workdocs#TooManySubscriptionsException": - throw await de_TooManySubscriptionsExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateUserCommand */ @@ -1684,7 +1344,7 @@ export const de_CreateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1698,52 +1358,31 @@ export const de_CreateUserCommand = async ( }; /** - * deserializeAws_restJson1CreateUserCommandError + * deserializeAws_restJson1DeactivateUserCommand */ -const de_CreateUserCommandError = async ( +export const de_DeactivateUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityAlreadyExistsException": - case "com.amazonaws.workdocs#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeactivateUserCommand + * deserializeAws_restJson1DeleteCommentCommand */ -export const de_DeactivateUserCommand = async ( +export const de_DeleteCommentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeactivateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1753,52 +1392,31 @@ export const de_DeactivateUserCommand = async ( }; /** - * deserializeAws_restJson1DeactivateUserCommandError + * deserializeAws_restJson1DeleteCustomMetadataCommand */ -const de_DeactivateUserCommandError = async ( +export const de_DeleteCustomMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteCommentCommand + * deserializeAws_restJson1DeleteDocumentCommand */ -export const de_DeleteCommentCommand = async ( +export const de_DeleteDocumentCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteCommentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1808,58 +1426,31 @@ export const de_DeleteCommentCommand = async ( }; /** - * deserializeAws_restJson1DeleteCommentCommandError + * deserializeAws_restJson1DeleteDocumentVersionCommand */ -const de_DeleteCommentCommandError = async ( +export const de_DeleteDocumentVersionCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DocumentLockedForCommentsException": - case "com.amazonaws.workdocs#DocumentLockedForCommentsException": - throw await de_DocumentLockedForCommentsExceptionRes(parsedOutput, context); - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteCustomMetadataCommand + * deserializeAws_restJson1DeleteFolderCommand */ -export const de_DeleteCustomMetadataCommand = async ( +export const de_DeleteFolderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteCustomMetadataCommandError(output, context); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1869,55 +1460,31 @@ export const de_DeleteCustomMetadataCommand = async ( }; /** - * deserializeAws_restJson1DeleteCustomMetadataCommandError + * deserializeAws_restJson1DeleteFolderContentsCommand */ -const de_DeleteCustomMetadataCommandError = async ( +export const de_DeleteFolderContentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteDocumentCommand + * deserializeAws_restJson1DeleteLabelsCommand */ -export const de_DeleteDocumentCommand = async ( +export const de_DeleteLabelsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDocumentCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1927,314 +1494,14 @@ export const de_DeleteDocumentCommand = async ( }; /** - * deserializeAws_restJson1DeleteDocumentCommandError + * deserializeAws_restJson1DeleteNotificationSubscriptionCommand */ -const de_DeleteDocumentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.workdocs#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConflictingOperationException": - case "com.amazonaws.workdocs#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workdocs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteDocumentVersionCommand - */ -export const de_DeleteDocumentVersionCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDocumentVersionCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteDocumentVersionCommandError - */ -const de_DeleteDocumentVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.workdocs#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConflictingOperationException": - case "com.amazonaws.workdocs#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.workdocs#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteFolderCommand - */ -export const de_DeleteFolderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteFolderCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteFolderCommandError - */ -const de_DeleteFolderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.workdocs#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConflictingOperationException": - case "com.amazonaws.workdocs#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workdocs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteFolderContentsCommand - */ -export const de_DeleteFolderContentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteFolderContentsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteFolderContentsCommandError - */ -const de_DeleteFolderContentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConflictingOperationException": - case "com.amazonaws.workdocs#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteLabelsCommand - */ -export const de_DeleteLabelsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteLabelsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteLabelsCommandError - */ -const de_DeleteLabelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteNotificationSubscriptionCommand - */ -export const de_DeleteNotificationSubscriptionCommand = async ( +export const de_DeleteNotificationSubscriptionCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteNotificationSubscriptionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2243,41 +1510,6 @@ export const de_DeleteNotificationSubscriptionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteNotificationSubscriptionCommandError - */ -const de_DeleteNotificationSubscriptionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteUserCommand */ @@ -2286,7 +1518,7 @@ export const de_DeleteUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2295,44 +1527,6 @@ export const de_DeleteUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteUserCommandError - */ -const de_DeleteUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeActivitiesCommand */ @@ -2341,137 +1535,36 @@ export const de_DescribeActivitiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeActivitiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Marker: __expectString, - UserActivities: (_) => de_UserActivities(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeActivitiesCommandError - */ -const de_DescribeActivitiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.workdocs#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeCommentsCommand - */ -export const de_DescribeCommentsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeCommentsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Comments: (_) => de_CommentList(_, context), - Marker: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeCommentsCommandError - */ -const de_DescribeCommentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Marker: __expectString, + UserActivities: (_) => de_UserActivities(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeDocumentVersionsCommand + * deserializeAws_restJson1DescribeCommentsCommand */ -export const de_DescribeDocumentVersionsCommand = async ( +export const de_DescribeCommentsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDocumentVersionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - DocumentVersions: (_) => de_DocumentVersionMetadataList(_, context), + Comments: (_) => de_CommentList(_, context), Marker: __expectString, }); Object.assign(contents, doc); @@ -2479,50 +1572,25 @@ export const de_DescribeDocumentVersionsCommand = async ( }; /** - * deserializeAws_restJson1DescribeDocumentVersionsCommandError + * deserializeAws_restJson1DescribeDocumentVersionsCommand */ -const de_DescribeDocumentVersionsCommandError = async ( +export const de_DescribeDocumentVersionsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.workdocs#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidPasswordException": - case "com.amazonaws.workdocs#InvalidPasswordException": - throw await de_InvalidPasswordExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + DocumentVersions: (_) => de_DocumentVersionMetadataList(_, context), + Marker: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2533,7 +1601,7 @@ export const de_DescribeFolderContentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFolderContentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2548,47 +1616,6 @@ export const de_DescribeFolderContentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeFolderContentsCommandError - */ -const de_DescribeFolderContentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.workdocs#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeGroupsCommand */ @@ -2597,7 +1624,7 @@ export const de_DescribeGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2611,41 +1638,6 @@ export const de_DescribeGroupsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeGroupsCommandError - */ -const de_DescribeGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeNotificationSubscriptionsCommand */ @@ -2654,7 +1646,7 @@ export const de_DescribeNotificationSubscriptionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeNotificationSubscriptionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2668,38 +1660,6 @@ export const de_DescribeNotificationSubscriptionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeNotificationSubscriptionsCommandError - */ -const de_DescribeNotificationSubscriptionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeResourcePermissionsCommand */ @@ -2708,7 +1668,7 @@ export const de_DescribeResourcePermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeResourcePermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2718,173 +1678,53 @@ export const de_DescribeResourcePermissionsCommand = async ( Marker: __expectString, Principals: _json, }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeResourcePermissionsCommandError - */ -const de_DescribeResourcePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.workdocs#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeRootFoldersCommand - */ -export const de_DescribeRootFoldersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeRootFoldersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - Folders: (_) => de_FolderMetadataList(_, context), - Marker: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1DescribeRootFoldersCommandError - */ -const de_DescribeRootFoldersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.workdocs#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1DescribeUsersCommand + * deserializeAws_restJson1DescribeRootFoldersCommand */ -export const de_DescribeUsersCommand = async ( +export const de_DescribeRootFoldersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeUsersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + Folders: (_) => de_FolderMetadataList(_, context), Marker: __expectString, - TotalNumberOfUsers: __expectLong, - Users: (_) => de_OrganizationUserList(_, context), }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1DescribeUsersCommandError + * deserializeAws_restJson1DescribeUsersCommand */ -const de_DescribeUsersCommandError = async ( +export const de_DescribeUsersCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.workdocs#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "RequestedEntityTooLargeException": - case "com.amazonaws.workdocs#RequestedEntityTooLargeException": - throw await de_RequestedEntityTooLargeExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Marker: __expectString, + TotalNumberOfUsers: __expectLong, + Users: (_) => de_OrganizationUserList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -2895,7 +1735,7 @@ export const de_GetCurrentUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetCurrentUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2908,44 +1748,6 @@ export const de_GetCurrentUserCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetCurrentUserCommandError - */ -const de_GetCurrentUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDocumentCommand */ @@ -2954,7 +1756,7 @@ export const de_GetDocumentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDocumentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2968,50 +1770,6 @@ export const de_GetDocumentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDocumentCommandError - */ -const de_GetDocumentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.workdocs#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidPasswordException": - case "com.amazonaws.workdocs#InvalidPasswordException": - throw await de_InvalidPasswordExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDocumentPathCommand */ @@ -3020,7 +1778,7 @@ export const de_GetDocumentPathCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDocumentPathCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3033,44 +1791,6 @@ export const de_GetDocumentPathCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDocumentPathCommandError - */ -const de_GetDocumentPathCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDocumentVersionCommand */ @@ -3079,7 +1799,7 @@ export const de_GetDocumentVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDocumentVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3093,50 +1813,6 @@ export const de_GetDocumentVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDocumentVersionCommandError - */ -const de_GetDocumentVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "InvalidPasswordException": - case "com.amazonaws.workdocs#InvalidPasswordException": - throw await de_InvalidPasswordExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetFolderCommand */ @@ -3145,62 +1821,18 @@ export const de_GetFolderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFolderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - CustomMetadata: _json, - Metadata: (_) => de_FolderMetadata(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetFolderCommandError - */ -const de_GetFolderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.workdocs#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + CustomMetadata: _json, + Metadata: (_) => de_FolderMetadata(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** @@ -3211,7 +1843,7 @@ export const de_GetFolderPathCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetFolderPathCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3224,44 +1856,6 @@ export const de_GetFolderPathCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetFolderPathCommandError - */ -const de_GetFolderPathCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetResourcesCommand */ @@ -3270,7 +1864,7 @@ export const de_GetResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3285,44 +1879,6 @@ export const de_GetResourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetResourcesCommandError - */ -const de_GetResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.workdocs#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1InitiateDocumentVersionUploadCommand */ @@ -3331,7 +1887,7 @@ export const de_InitiateDocumentVersionUploadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_InitiateDocumentVersionUploadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3345,71 +1901,6 @@ export const de_InitiateDocumentVersionUploadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1InitiateDocumentVersionUploadCommandError - */ -const de_InitiateDocumentVersionUploadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DraftUploadOutOfSyncException": - case "com.amazonaws.workdocs#DraftUploadOutOfSyncException": - throw await de_DraftUploadOutOfSyncExceptionRes(parsedOutput, context); - case "EntityAlreadyExistsException": - case "com.amazonaws.workdocs#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.workdocs#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "InvalidPasswordException": - case "com.amazonaws.workdocs#InvalidPasswordException": - throw await de_InvalidPasswordExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workdocs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ResourceAlreadyCheckedOutException": - case "com.amazonaws.workdocs#ResourceAlreadyCheckedOutException": - throw await de_ResourceAlreadyCheckedOutExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "StorageLimitExceededException": - case "com.amazonaws.workdocs#StorageLimitExceededException": - throw await de_StorageLimitExceededExceptionRes(parsedOutput, context); - case "StorageLimitWillExceedException": - case "com.amazonaws.workdocs#StorageLimitWillExceedException": - throw await de_StorageLimitWillExceedExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RemoveAllResourcePermissionsCommand */ @@ -3418,7 +1909,7 @@ export const de_RemoveAllResourcePermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_RemoveAllResourcePermissionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3427,41 +1918,6 @@ export const de_RemoveAllResourcePermissionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RemoveAllResourcePermissionsCommandError - */ -const de_RemoveAllResourcePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RemoveResourcePermissionCommand */ @@ -3470,7 +1926,7 @@ export const de_RemoveResourcePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_RemoveResourcePermissionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3479,103 +1935,21 @@ export const de_RemoveResourcePermissionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RemoveResourcePermissionCommandError - */ -const de_RemoveResourcePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1RestoreDocumentVersionsCommand - */ -export const de_RestoreDocumentVersionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_RestoreDocumentVersionsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1RestoreDocumentVersionsCommandError - */ -const de_RestoreDocumentVersionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.workdocs#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConflictingOperationException": - case "com.amazonaws.workdocs#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.workdocs#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + */ +export const de_RestoreDocumentVersionsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -3586,7 +1960,7 @@ export const de_SearchResourcesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SearchResourcesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3600,41 +1974,6 @@ export const de_SearchResourcesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SearchResourcesCommandError - */ -const de_SearchResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidArgumentException": - case "com.amazonaws.workdocs#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDocumentCommand */ @@ -3643,7 +1982,7 @@ export const de_UpdateDocumentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDocumentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3652,59 +1991,6 @@ export const de_UpdateDocumentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDocumentCommandError - */ -const de_UpdateDocumentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.workdocs#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConflictingOperationException": - case "com.amazonaws.workdocs#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "EntityAlreadyExistsException": - case "com.amazonaws.workdocs#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workdocs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDocumentVersionCommand */ @@ -3713,7 +1999,7 @@ export const de_UpdateDocumentVersionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDocumentVersionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3722,53 +2008,6 @@ export const de_UpdateDocumentVersionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDocumentVersionCommandError - */ -const de_UpdateDocumentVersionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.workdocs#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "InvalidOperationException": - case "com.amazonaws.workdocs#InvalidOperationException": - throw await de_InvalidOperationExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFolderCommand */ @@ -3777,7 +2016,7 @@ export const de_UpdateFolderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFolderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3786,59 +2025,6 @@ export const de_UpdateFolderCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFolderCommandError - */ -const de_UpdateFolderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ConcurrentModificationException": - case "com.amazonaws.workdocs#ConcurrentModificationException": - throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); - case "ConflictingOperationException": - case "com.amazonaws.workdocs#ConflictingOperationException": - throw await de_ConflictingOperationExceptionRes(parsedOutput, context); - case "EntityAlreadyExistsException": - case "com.amazonaws.workdocs#EntityAlreadyExistsException": - throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); - case "EntityNotExistsException": - case "com.amazonaws.workdocs#EntityNotExistsException": - throw await de_EntityNotExistsExceptionRes(parsedOutput, context); - case "FailedDependencyException": - case "com.amazonaws.workdocs#FailedDependencyException": - throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workdocs#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "ProhibitedStateException": - case "com.amazonaws.workdocs#ProhibitedStateException": - throw await de_ProhibitedStateExceptionRes(parsedOutput, context); - case "ServiceUnavailableException": - case "com.amazonaws.workdocs#ServiceUnavailableException": - throw await de_ServiceUnavailableExceptionRes(parsedOutput, context); - case "UnauthorizedOperationException": - case "com.amazonaws.workdocs#UnauthorizedOperationException": - throw await de_UnauthorizedOperationExceptionRes(parsedOutput, context); - case "UnauthorizedResourceAccessException": - case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": - throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateUserCommand */ @@ -3847,7 +2033,7 @@ export const de_UpdateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3861,33 +2047,24 @@ export const de_UpdateUserCommand = async ( }; /** - * deserializeAws_restJson1UpdateUserCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "DeactivatingLastSystemUserException": - case "com.amazonaws.workdocs#DeactivatingLastSystemUserException": - throw await de_DeactivatingLastSystemUserExceptionRes(parsedOutput, context); + case "ConcurrentModificationException": + case "com.amazonaws.workdocs#ConcurrentModificationException": + throw await de_ConcurrentModificationExceptionRes(parsedOutput, context); case "EntityNotExistsException": case "com.amazonaws.workdocs#EntityNotExistsException": throw await de_EntityNotExistsExceptionRes(parsedOutput, context); case "FailedDependencyException": case "com.amazonaws.workdocs#FailedDependencyException": throw await de_FailedDependencyExceptionRes(parsedOutput, context); - case "IllegalUserStateException": - case "com.amazonaws.workdocs#IllegalUserStateException": - throw await de_IllegalUserStateExceptionRes(parsedOutput, context); - case "InvalidArgumentException": - case "com.amazonaws.workdocs#InvalidArgumentException": - throw await de_InvalidArgumentExceptionRes(parsedOutput, context); case "ProhibitedStateException": case "com.amazonaws.workdocs#ProhibitedStateException": throw await de_ProhibitedStateExceptionRes(parsedOutput, context); @@ -3900,13 +2077,67 @@ const de_UpdateUserCommandError = async ( case "UnauthorizedResourceAccessException": case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": throw await de_UnauthorizedResourceAccessExceptionRes(parsedOutput, context); + case "DocumentLockedForCommentsException": + case "com.amazonaws.workdocs#DocumentLockedForCommentsException": + throw await de_DocumentLockedForCommentsExceptionRes(parsedOutput, context); + case "InvalidCommentOperationException": + case "com.amazonaws.workdocs#InvalidCommentOperationException": + throw await de_InvalidCommentOperationExceptionRes(parsedOutput, context); + case "CustomMetadataLimitExceededException": + case "com.amazonaws.workdocs#CustomMetadataLimitExceededException": + throw await de_CustomMetadataLimitExceededExceptionRes(parsedOutput, context); + case "ConflictingOperationException": + case "com.amazonaws.workdocs#ConflictingOperationException": + throw await de_ConflictingOperationExceptionRes(parsedOutput, context); + case "EntityAlreadyExistsException": + case "com.amazonaws.workdocs#EntityAlreadyExistsException": + throw await de_EntityAlreadyExistsExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.workdocs#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "TooManyLabelsException": + case "com.amazonaws.workdocs#TooManyLabelsException": + throw await de_TooManyLabelsExceptionRes(parsedOutput, context); + case "InvalidArgumentException": + case "com.amazonaws.workdocs#InvalidArgumentException": + throw await de_InvalidArgumentExceptionRes(parsedOutput, context); + case "TooManySubscriptionsException": + case "com.amazonaws.workdocs#TooManySubscriptionsException": + throw await de_TooManySubscriptionsExceptionRes(parsedOutput, context); + case "InvalidOperationException": + case "com.amazonaws.workdocs#InvalidOperationException": + throw await de_InvalidOperationExceptionRes(parsedOutput, context); + case "InvalidPasswordException": + case "com.amazonaws.workdocs#InvalidPasswordException": + throw await de_InvalidPasswordExceptionRes(parsedOutput, context); + case "RequestedEntityTooLargeException": + case "com.amazonaws.workdocs#RequestedEntityTooLargeException": + throw await de_RequestedEntityTooLargeExceptionRes(parsedOutput, context); + case "DraftUploadOutOfSyncException": + case "com.amazonaws.workdocs#DraftUploadOutOfSyncException": + throw await de_DraftUploadOutOfSyncExceptionRes(parsedOutput, context); + case "ResourceAlreadyCheckedOutException": + case "com.amazonaws.workdocs#ResourceAlreadyCheckedOutException": + throw await de_ResourceAlreadyCheckedOutExceptionRes(parsedOutput, context); + case "StorageLimitExceededException": + case "com.amazonaws.workdocs#StorageLimitExceededException": + throw await de_StorageLimitExceededExceptionRes(parsedOutput, context); + case "StorageLimitWillExceedException": + case "com.amazonaws.workdocs#StorageLimitWillExceedException": + throw await de_StorageLimitWillExceedExceptionRes(parsedOutput, context); + case "DeactivatingLastSystemUserException": + case "com.amazonaws.workdocs#DeactivatingLastSystemUserException": + throw await de_DeactivatingLastSystemUserExceptionRes(parsedOutput, context); + case "IllegalUserStateException": + case "com.amazonaws.workdocs#IllegalUserStateException": + throw await de_IllegalUserStateExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-worklink/src/protocols/Aws_restJson1.ts b/clients/client-worklink/src/protocols/Aws_restJson1.ts index a344a1815418..9804b492c073 100644 --- a/clients/client-worklink/src/protocols/Aws_restJson1.ts +++ b/clients/client-worklink/src/protocols/Aws_restJson1.ts @@ -898,7 +898,7 @@ export const de_AssociateDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -907,47 +907,6 @@ export const de_AssociateDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateDomainCommandError - */ -const de_AssociateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.worklink#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateWebsiteAuthorizationProviderCommand */ @@ -956,7 +915,7 @@ export const de_AssociateWebsiteAuthorizationProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateWebsiteAuthorizationProviderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -969,47 +928,6 @@ export const de_AssociateWebsiteAuthorizationProviderCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateWebsiteAuthorizationProviderCommandError - */ -const de_AssociateWebsiteAuthorizationProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.worklink#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateWebsiteCertificateAuthorityCommand */ @@ -1018,7 +936,7 @@ export const de_AssociateWebsiteCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateWebsiteCertificateAuthorityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1031,47 +949,6 @@ export const de_AssociateWebsiteCertificateAuthorityCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateWebsiteCertificateAuthorityCommandError - */ -const de_AssociateWebsiteCertificateAuthorityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.worklink#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateFleetCommand */ @@ -1080,7 +957,7 @@ export const de_CreateFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateFleetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1093,47 +970,6 @@ export const de_CreateFleetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateFleetCommandError - */ -const de_CreateFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.worklink#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteFleetCommand */ @@ -1142,7 +978,7 @@ export const de_DeleteFleetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteFleetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1151,44 +987,6 @@ export const de_DeleteFleetCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteFleetCommandError - */ -const de_DeleteFleetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeAuditStreamConfigurationCommand */ @@ -1197,7 +995,7 @@ export const de_DescribeAuditStreamConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeAuditStreamConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1210,44 +1008,6 @@ export const de_DescribeAuditStreamConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeAuditStreamConfigurationCommandError - */ -const de_DescribeAuditStreamConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeCompanyNetworkConfigurationCommand */ @@ -1256,7 +1016,7 @@ export const de_DescribeCompanyNetworkConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeCompanyNetworkConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1272,52 +1032,14 @@ export const de_DescribeCompanyNetworkConfigurationCommand = async ( }; /** - * deserializeAws_restJson1DescribeCompanyNetworkConfigurationCommandError + * deserializeAws_restJson1DescribeDeviceCommand */ -const de_DescribeCompanyNetworkConfigurationCommandError = async ( +export const de_DescribeDeviceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DescribeDeviceCommand - */ -export const de_DescribeDeviceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDeviceCommandError(output, context); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1338,44 +1060,6 @@ export const de_DescribeDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDeviceCommandError - */ -const de_DescribeDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDevicePolicyConfigurationCommand */ @@ -1384,7 +1068,7 @@ export const de_DescribeDevicePolicyConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDevicePolicyConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1397,44 +1081,6 @@ export const de_DescribeDevicePolicyConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDevicePolicyConfigurationCommandError - */ -const de_DescribeDevicePolicyConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeDomainCommand */ @@ -1443,7 +1089,7 @@ export const de_DescribeDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1460,44 +1106,6 @@ export const de_DescribeDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeDomainCommandError - */ -const de_DescribeDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeFleetMetadataCommand */ @@ -1506,7 +1114,7 @@ export const de_DescribeFleetMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeFleetMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1526,44 +1134,6 @@ export const de_DescribeFleetMetadataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeFleetMetadataCommandError - */ -const de_DescribeFleetMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeIdentityProviderConfigurationCommand */ @@ -1572,7 +1142,7 @@ export const de_DescribeIdentityProviderConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeIdentityProviderConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1587,44 +1157,6 @@ export const de_DescribeIdentityProviderConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeIdentityProviderConfigurationCommandError - */ -const de_DescribeIdentityProviderConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DescribeWebsiteCertificateAuthorityCommand */ @@ -1633,7 +1165,7 @@ export const de_DescribeWebsiteCertificateAuthorityCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeWebsiteCertificateAuthorityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1648,44 +1180,6 @@ export const de_DescribeWebsiteCertificateAuthorityCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DescribeWebsiteCertificateAuthorityCommandError - */ -const de_DescribeWebsiteCertificateAuthorityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateDomainCommand */ @@ -1694,7 +1188,7 @@ export const de_DisassociateDomainCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateDomainCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1703,44 +1197,6 @@ export const de_DisassociateDomainCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateDomainCommandError - */ -const de_DisassociateDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DisassociateWebsiteAuthorizationProviderCommand */ @@ -1749,7 +1205,7 @@ export const de_DisassociateWebsiteAuthorizationProviderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateWebsiteAuthorizationProviderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1759,55 +1215,14 @@ export const de_DisassociateWebsiteAuthorizationProviderCommand = async ( }; /** - * deserializeAws_restJson1DisassociateWebsiteAuthorizationProviderCommandError + * deserializeAws_restJson1DisassociateWebsiteCertificateAuthorityCommand */ -const de_DisassociateWebsiteAuthorizationProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.worklink#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateWebsiteCertificateAuthorityCommand - */ -export const de_DisassociateWebsiteCertificateAuthorityCommand = async ( +export const de_DisassociateWebsiteCertificateAuthorityCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateWebsiteCertificateAuthorityCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1816,44 +1231,6 @@ export const de_DisassociateWebsiteCertificateAuthorityCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DisassociateWebsiteCertificateAuthorityCommandError - */ -const de_DisassociateWebsiteCertificateAuthorityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDevicesCommand */ @@ -1862,7 +1239,7 @@ export const de_ListDevicesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDevicesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1876,44 +1253,6 @@ export const de_ListDevicesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDevicesCommandError - */ -const de_ListDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListDomainsCommand */ @@ -1922,7 +1261,7 @@ export const de_ListDomainsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDomainsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1936,44 +1275,6 @@ export const de_ListDomainsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListDomainsCommandError - */ -const de_ListDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListFleetsCommand */ @@ -1982,7 +1283,7 @@ export const de_ListFleetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListFleetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1996,41 +1297,6 @@ export const de_ListFleetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListFleetsCommandError - */ -const de_ListFleetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -2039,7 +1305,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2052,32 +1318,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWebsiteAuthorizationProvidersCommand */ @@ -2086,7 +1326,7 @@ export const de_ListWebsiteAuthorizationProvidersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWebsiteAuthorizationProvidersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2100,44 +1340,6 @@ export const de_ListWebsiteAuthorizationProvidersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListWebsiteAuthorizationProvidersCommandError - */ -const de_ListWebsiteAuthorizationProvidersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListWebsiteCertificateAuthoritiesCommand */ @@ -2146,229 +1348,29 @@ export const de_ListWebsiteCertificateAuthoritiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListWebsiteCertificateAuthoritiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - NextToken: __expectString, - WebsiteCertificateAuthorities: (_) => de_WebsiteCaSummaryList(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListWebsiteCertificateAuthoritiesCommandError - */ -const de_ListWebsiteCertificateAuthoritiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RestoreDomainAccessCommand - */ -export const de_RestoreDomainAccessCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RestoreDomainAccessCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1RestoreDomainAccessCommandError - */ -const de_RestoreDomainAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1RevokeDomainAccessCommand - */ -export const de_RevokeDomainAccessCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RevokeDomainAccessCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1RevokeDomainAccessCommandError - */ -const de_RevokeDomainAccessCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1SignOutUserCommand - */ -export const de_SignOutUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SignOutUserCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1SignOutUserCommandError - */ -const de_SignOutUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + NextToken: __expectString, + WebsiteCertificateAuthorities: (_) => de_WebsiteCaSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1RestoreDomainAccessCommand */ -export const de_TagResourceCommand = async ( +export const de_RestoreDomainAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2378,40 +1380,31 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1RevokeDomainAccessCommand */ -const de_TagResourceCommandError = async ( +export const de_RevokeDomainAccessCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1SignOutUserCommand */ -export const de_UntagResourceCommand = async ( +export const de_SignOutUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2421,40 +1414,31 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_UntagResourceCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateAuditStreamConfigurationCommand + * deserializeAws_restJson1UntagResourceCommand */ -export const de_UpdateAuditStreamConfigurationCommand = async ( +export const de_UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateAuditStreamConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2464,41 +1448,20 @@ export const de_UpdateAuditStreamConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateAuditStreamConfigurationCommandError + * deserializeAws_restJson1UpdateAuditStreamConfigurationCommand */ -const de_UpdateAuditStreamConfigurationCommandError = async ( +export const de_UpdateAuditStreamConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** @@ -2509,7 +1472,7 @@ export const de_UpdateCompanyNetworkConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateCompanyNetworkConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2518,44 +1481,6 @@ export const de_UpdateCompanyNetworkConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateCompanyNetworkConfigurationCommandError - */ -const de_UpdateCompanyNetworkConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDevicePolicyConfigurationCommand */ @@ -2564,7 +1489,7 @@ export const de_UpdateDevicePolicyConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDevicePolicyConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2573,44 +1498,6 @@ export const de_UpdateDevicePolicyConfigurationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDevicePolicyConfigurationCommandError - */ -const de_UpdateDevicePolicyConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDomainMetadataCommand */ @@ -2619,7 +1506,7 @@ export const de_UpdateDomainMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDomainMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2628,44 +1515,6 @@ export const de_UpdateDomainMetadataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDomainMetadataCommandError - */ -const de_UpdateDomainMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateFleetMetadataCommand */ @@ -2674,7 +1523,7 @@ export const de_UpdateFleetMetadataCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateFleetMetadataCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2683,44 +1532,6 @@ export const de_UpdateFleetMetadataCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateFleetMetadataCommandError - */ -const de_UpdateFleetMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServerErrorException": - case "com.amazonaws.worklink#InternalServerErrorException": - throw await de_InternalServerErrorExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.worklink#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.worklink#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyRequestsException": - case "com.amazonaws.worklink#TooManyRequestsException": - throw await de_TooManyRequestsExceptionRes(parsedOutput, context); - case "UnauthorizedException": - case "com.amazonaws.worklink#UnauthorizedException": - throw await de_UnauthorizedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateIdentityProviderConfigurationCommand */ @@ -2729,7 +1540,7 @@ export const de_UpdateIdentityProviderConfigurationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIdentityProviderConfigurationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2739,12 +1550,9 @@ export const de_UpdateIdentityProviderConfigurationCommand = async ( }; /** - * deserializeAws_restJson1UpdateIdentityProviderConfigurationCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateIdentityProviderConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2757,6 +1565,9 @@ const de_UpdateIdentityProviderConfigurationCommandError = async ( case "InvalidRequestException": case "com.amazonaws.worklink#InvalidRequestException": throw await de_InvalidRequestExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.worklink#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.worklink#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); @@ -2772,7 +1583,7 @@ const de_UpdateIdentityProviderConfigurationCommandError = async ( output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-workmail/src/protocols/Aws_json1_1.ts b/clients/client-workmail/src/protocols/Aws_json1_1.ts index d395cc4ab5c4..f0cf4101f33f 100644 --- a/clients/client-workmail/src/protocols/Aws_json1_1.ts +++ b/clients/client-workmail/src/protocols/Aws_json1_1.ts @@ -1509,7 +1509,7 @@ export const de_AssociateDelegateToResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateDelegateToResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1521,47 +1521,6 @@ export const de_AssociateDelegateToResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateDelegateToResourceCommandError - */ -const de_AssociateDelegateToResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateMemberToGroupCommand */ @@ -1570,7 +1529,7 @@ export const de_AssociateMemberToGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateMemberToGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1582,53 +1541,6 @@ export const de_AssociateMemberToGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateMemberToGroupCommandError - */ -const de_AssociateMemberToGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectoryServiceAuthenticationFailedException": - case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": - throw await de_DirectoryServiceAuthenticationFailedExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.workmail#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssumeImpersonationRoleCommand */ @@ -1637,7 +1549,7 @@ export const de_AssumeImpersonationRoleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssumeImpersonationRoleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1649,41 +1561,6 @@ export const de_AssumeImpersonationRoleCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssumeImpersonationRoleCommandError - */ -const de_AssumeImpersonationRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workmail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CancelMailboxExportJobCommand */ @@ -1692,7 +1569,7 @@ export const de_CancelMailboxExportJobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CancelMailboxExportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1704,41 +1581,6 @@ export const de_CancelMailboxExportJobCommand = async ( return response; }; -/** - * deserializeAws_json1_1CancelMailboxExportJobCommandError - */ -const de_CancelMailboxExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateAliasCommand */ @@ -1747,7 +1589,7 @@ export const de_CreateAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1760,69 +1602,39 @@ export const de_CreateAliasCommand = async ( }; /** - * deserializeAws_json1_1CreateAliasCommandError + * deserializeAws_json1_1CreateAvailabilityConfigurationCommand */ -const de_CreateAliasCommandError = async ( +export const de_CreateAvailabilityConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EmailAddressInUseException": - case "com.amazonaws.workmail#EmailAddressInUseException": - throw await de_EmailAddressInUseExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workmail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MailDomainNotFoundException": - case "com.amazonaws.workmail#MailDomainNotFoundException": - throw await de_MailDomainNotFoundExceptionRes(parsedOutput, context); - case "MailDomainStateException": - case "com.amazonaws.workmail#MailDomainStateException": - throw await de_MailDomainStateExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateAvailabilityConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateAvailabilityConfigurationCommand + * deserializeAws_json1_1CreateGroupCommand */ -export const de_CreateAvailabilityConfigurationCommand = async ( +export const de_CreateGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateAvailabilityConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateAvailabilityConfigurationCommandOutput = { + const response: CreateGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1830,57 +1642,39 @@ export const de_CreateAvailabilityConfigurationCommand = async ( }; /** - * deserializeAws_json1_1CreateAvailabilityConfigurationCommandError + * deserializeAws_json1_1CreateImpersonationRoleCommand */ -const de_CreateAvailabilityConfigurationCommandError = async ( +export const de_CreateImpersonationRoleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workmail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NameAvailabilityException": - case "com.amazonaws.workmail#NameAvailabilityException": - throw await de_NameAvailabilityExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateImpersonationRoleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateGroupCommand + * deserializeAws_json1_1CreateMobileDeviceAccessRuleCommand */ -export const de_CreateGroupCommand = async ( +export const de_CreateMobileDeviceAccessRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateGroupCommandOutput = { + const response: CreateMobileDeviceAccessRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1888,66 +1682,39 @@ export const de_CreateGroupCommand = async ( }; /** - * deserializeAws_json1_1CreateGroupCommandError + * deserializeAws_json1_1CreateOrganizationCommand */ -const de_CreateGroupCommandError = async ( +export const de_CreateOrganizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectoryServiceAuthenticationFailedException": - case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": - throw await de_DirectoryServiceAuthenticationFailedExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.workmail#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NameAvailabilityException": - case "com.amazonaws.workmail#NameAvailabilityException": - throw await de_NameAvailabilityExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "ReservedNameException": - case "com.amazonaws.workmail#ReservedNameException": - throw await de_ReservedNameExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateOrganizationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateImpersonationRoleCommand + * deserializeAws_json1_1CreateResourceCommand */ -export const de_CreateImpersonationRoleCommand = async ( +export const de_CreateResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateImpersonationRoleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateImpersonationRoleCommandOutput = { + const response: CreateResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1955,60 +1722,39 @@ export const de_CreateImpersonationRoleCommand = async ( }; /** - * deserializeAws_json1_1CreateImpersonationRoleCommandError + * deserializeAws_json1_1CreateUserCommand */ -const de_CreateImpersonationRoleCommandError = async ( +export const de_CreateUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workmail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateUserCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateMobileDeviceAccessRuleCommand + * deserializeAws_json1_1DeleteAccessControlRuleCommand */ -export const de_CreateMobileDeviceAccessRuleCommand = async ( +export const de_DeleteAccessControlRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateMobileDeviceAccessRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateMobileDeviceAccessRuleCommandOutput = { + const response: DeleteAccessControlRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2016,54 +1762,39 @@ export const de_CreateMobileDeviceAccessRuleCommand = async ( }; /** - * deserializeAws_json1_1CreateMobileDeviceAccessRuleCommandError + * deserializeAws_json1_1DeleteAliasCommand */ -const de_CreateMobileDeviceAccessRuleCommandError = async ( +export const de_DeleteAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workmail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteAliasCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateOrganizationCommand + * deserializeAws_json1_1DeleteAvailabilityConfigurationCommand */ -export const de_CreateOrganizationCommand = async ( +export const de_DeleteAvailabilityConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateOrganizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateOrganizationCommandOutput = { + const response: DeleteAvailabilityConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2071,57 +1802,39 @@ export const de_CreateOrganizationCommand = async ( }; /** - * deserializeAws_json1_1CreateOrganizationCommandError + * deserializeAws_json1_1DeleteEmailMonitoringConfigurationCommand */ -const de_CreateOrganizationCommandError = async ( +export const de_DeleteEmailMonitoringConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectoryInUseException": - case "com.amazonaws.workmail#DirectoryInUseException": - throw await de_DirectoryInUseExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.workmail#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workmail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "NameAvailabilityException": - case "com.amazonaws.workmail#NameAvailabilityException": - throw await de_NameAvailabilityExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteEmailMonitoringConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateResourceCommand + * deserializeAws_json1_1DeleteGroupCommand */ -export const de_CreateResourceCommand = async ( +export const de_DeleteGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateResourceCommandOutput = { + const response: DeleteGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2129,66 +1842,39 @@ export const de_CreateResourceCommand = async ( }; /** - * deserializeAws_json1_1CreateResourceCommandError + * deserializeAws_json1_1DeleteImpersonationRoleCommand */ -const de_CreateResourceCommandError = async ( +export const de_DeleteImpersonationRoleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectoryServiceAuthenticationFailedException": - case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": - throw await de_DirectoryServiceAuthenticationFailedExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.workmail#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "NameAvailabilityException": - case "com.amazonaws.workmail#NameAvailabilityException": - throw await de_NameAvailabilityExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "ReservedNameException": - case "com.amazonaws.workmail#ReservedNameException": - throw await de_ReservedNameExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteImpersonationRoleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateUserCommand + * deserializeAws_json1_1DeleteMailboxPermissionsCommand */ -export const de_CreateUserCommand = async ( +export const de_DeleteMailboxPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateUserCommandOutput = { + const response: DeleteMailboxPermissionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2196,69 +1882,39 @@ export const de_CreateUserCommand = async ( }; /** - * deserializeAws_json1_1CreateUserCommandError + * deserializeAws_json1_1DeleteMobileDeviceAccessOverrideCommand */ -const de_CreateUserCommandError = async ( +export const de_DeleteMobileDeviceAccessOverrideCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectoryServiceAuthenticationFailedException": - case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": - throw await de_DirectoryServiceAuthenticationFailedExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.workmail#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPasswordException": - case "com.amazonaws.workmail#InvalidPasswordException": - throw await de_InvalidPasswordExceptionRes(parsedOutput, context); - case "NameAvailabilityException": - case "com.amazonaws.workmail#NameAvailabilityException": - throw await de_NameAvailabilityExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "ReservedNameException": - case "com.amazonaws.workmail#ReservedNameException": - throw await de_ReservedNameExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteMobileDeviceAccessOverrideCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteAccessControlRuleCommand + * deserializeAws_json1_1DeleteMobileDeviceAccessRuleCommand */ -export const de_DeleteAccessControlRuleCommand = async ( +export const de_DeleteMobileDeviceAccessRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteAccessControlRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteAccessControlRuleCommandOutput = { + const response: DeleteMobileDeviceAccessRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2266,48 +1922,39 @@ export const de_DeleteAccessControlRuleCommand = async ( }; /** - * deserializeAws_json1_1DeleteAccessControlRuleCommandError + * deserializeAws_json1_1DeleteOrganizationCommand */ -const de_DeleteAccessControlRuleCommandError = async ( +export const de_DeleteOrganizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteOrganizationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteAliasCommand + * deserializeAws_json1_1DeleteResourceCommand */ -export const de_DeleteAliasCommand = async ( +export const de_DeleteResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteAliasCommandOutput = { + const response: DeleteResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2315,57 +1962,39 @@ export const de_DeleteAliasCommand = async ( }; /** - * deserializeAws_json1_1DeleteAliasCommandError + * deserializeAws_json1_1DeleteRetentionPolicyCommand */ -const de_DeleteAliasCommandError = async ( +export const de_DeleteRetentionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteRetentionPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteAvailabilityConfigurationCommand + * deserializeAws_json1_1DeleteUserCommand */ -export const de_DeleteAvailabilityConfigurationCommand = async ( +export const de_DeleteUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteAvailabilityConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteAvailabilityConfigurationCommandOutput = { + const response: DeleteUserCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2373,48 +2002,39 @@ export const de_DeleteAvailabilityConfigurationCommand = async ( }; /** - * deserializeAws_json1_1DeleteAvailabilityConfigurationCommandError + * deserializeAws_json1_1DeregisterFromWorkMailCommand */ -const de_DeleteAvailabilityConfigurationCommandError = async ( +export const de_DeregisterFromWorkMailCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeregisterFromWorkMailCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteEmailMonitoringConfigurationCommand + * deserializeAws_json1_1DeregisterMailDomainCommand */ -export const de_DeleteEmailMonitoringConfigurationCommand = async ( +export const de_DeregisterMailDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteEmailMonitoringConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteEmailMonitoringConfigurationCommandOutput = { + const response: DeregisterMailDomainCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2422,51 +2042,39 @@ export const de_DeleteEmailMonitoringConfigurationCommand = async ( }; /** - * deserializeAws_json1_1DeleteEmailMonitoringConfigurationCommandError + * deserializeAws_json1_1DescribeEmailMonitoringConfigurationCommand */ -const de_DeleteEmailMonitoringConfigurationCommandError = async ( +export const de_DescribeEmailMonitoringConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeEmailMonitoringConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteGroupCommand + * deserializeAws_json1_1DescribeEntityCommand */ -export const de_DeleteGroupCommand = async ( +export const de_DescribeEntityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteGroupCommandOutput = { + const response: DescribeEntityCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2474,63 +2082,39 @@ export const de_DeleteGroupCommand = async ( }; /** - * deserializeAws_json1_1DeleteGroupCommandError + * deserializeAws_json1_1DescribeGroupCommand */ -const de_DeleteGroupCommandError = async ( +export const de_DescribeGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeGroupResponse(data, context); + const response: DescribeGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectoryServiceAuthenticationFailedException": - case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": - throw await de_DirectoryServiceAuthenticationFailedExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.workmail#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1DeleteImpersonationRoleCommand + * deserializeAws_json1_1DescribeInboundDmarcSettingsCommand */ -export const de_DeleteImpersonationRoleCommand = async ( +export const de_DescribeInboundDmarcSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteImpersonationRoleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteImpersonationRoleCommandOutput = { + const response: DescribeInboundDmarcSettingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2538,51 +2122,39 @@ export const de_DeleteImpersonationRoleCommand = async ( }; /** - * deserializeAws_json1_1DeleteImpersonationRoleCommandError + * deserializeAws_json1_1DescribeMailboxExportJobCommand */ -const de_DeleteImpersonationRoleCommandError = async ( +export const de_DescribeMailboxExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeMailboxExportJobResponse(data, context); + const response: DescribeMailboxExportJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteMailboxPermissionsCommand + * deserializeAws_json1_1DescribeOrganizationCommand */ -export const de_DeleteMailboxPermissionsCommand = async ( +export const de_DescribeOrganizationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteMailboxPermissionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteMailboxPermissionsCommandOutput = { + contents = de_DescribeOrganizationResponse(data, context); + const response: DescribeOrganizationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2590,57 +2162,39 @@ export const de_DeleteMailboxPermissionsCommand = async ( }; /** - * deserializeAws_json1_1DeleteMailboxPermissionsCommandError + * deserializeAws_json1_1DescribeResourceCommand */ -const de_DeleteMailboxPermissionsCommandError = async ( +export const de_DescribeResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeResourceResponse(data, context); + const response: DescribeResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteMobileDeviceAccessOverrideCommand + * deserializeAws_json1_1DescribeUserCommand */ -export const de_DeleteMobileDeviceAccessOverrideCommand = async ( +export const de_DescribeUserCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteMobileDeviceAccessOverrideCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteMobileDeviceAccessOverrideCommandOutput = { + contents = de_DescribeUserResponse(data, context); + const response: DescribeUserCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2648,54 +2202,39 @@ export const de_DeleteMobileDeviceAccessOverrideCommand = async ( }; /** - * deserializeAws_json1_1DeleteMobileDeviceAccessOverrideCommandError + * deserializeAws_json1_1DisassociateDelegateFromResourceCommand */ -const de_DeleteMobileDeviceAccessOverrideCommandError = async ( +export const de_DisassociateDelegateFromResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisassociateDelegateFromResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteMobileDeviceAccessRuleCommand + * deserializeAws_json1_1DisassociateMemberFromGroupCommand */ -export const de_DeleteMobileDeviceAccessRuleCommand = async ( +export const de_DisassociateMemberFromGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteMobileDeviceAccessRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteMobileDeviceAccessRuleCommandOutput = { + const response: DisassociateMemberFromGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2703,51 +2242,39 @@ export const de_DeleteMobileDeviceAccessRuleCommand = async ( }; /** - * deserializeAws_json1_1DeleteMobileDeviceAccessRuleCommandError + * deserializeAws_json1_1GetAccessControlEffectCommand */ -const de_DeleteMobileDeviceAccessRuleCommandError = async ( +export const de_GetAccessControlEffectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetAccessControlEffectCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteOrganizationCommand + * deserializeAws_json1_1GetDefaultRetentionPolicyCommand */ -export const de_DeleteOrganizationCommand = async ( +export const de_GetDefaultRetentionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteOrganizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteOrganizationCommandOutput = { + const response: GetDefaultRetentionPolicyCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2755,51 +2282,39 @@ export const de_DeleteOrganizationCommand = async ( }; /** - * deserializeAws_json1_1DeleteOrganizationCommandError + * deserializeAws_json1_1GetImpersonationRoleCommand */ -const de_DeleteOrganizationCommandError = async ( +export const de_GetImpersonationRoleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetImpersonationRoleResponse(data, context); + const response: GetImpersonationRoleCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteResourceCommand + * deserializeAws_json1_1GetImpersonationRoleEffectCommand */ -export const de_DeleteResourceCommand = async ( +export const de_GetImpersonationRoleEffectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteResourceCommandOutput = { + const response: GetImpersonationRoleEffectCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2807,57 +2322,39 @@ export const de_DeleteResourceCommand = async ( }; /** - * deserializeAws_json1_1DeleteResourceCommandError + * deserializeAws_json1_1GetMailboxDetailsCommand */ -const de_DeleteResourceCommandError = async ( +export const de_GetMailboxDetailsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetMailboxDetailsResponse(data, context); + const response: GetMailboxDetailsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteRetentionPolicyCommand + * deserializeAws_json1_1GetMailDomainCommand */ -export const de_DeleteRetentionPolicyCommand = async ( +export const de_GetMailDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteRetentionPolicyCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeleteRetentionPolicyCommandOutput = { + const response: GetMailDomainCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2865,51 +2362,39 @@ export const de_DeleteRetentionPolicyCommand = async ( }; /** - * deserializeAws_json1_1DeleteRetentionPolicyCommandError + * deserializeAws_json1_1GetMobileDeviceAccessEffectCommand */ -const de_DeleteRetentionPolicyCommandError = async ( +export const de_GetMobileDeviceAccessEffectCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetMobileDeviceAccessEffectCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeleteUserCommand + * deserializeAws_json1_1GetMobileDeviceAccessOverrideCommand */ -export const de_DeleteUserCommand = async ( +export const de_GetMobileDeviceAccessOverrideCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeleteUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeleteUserCommandOutput = { + contents = de_GetMobileDeviceAccessOverrideResponse(data, context); + const response: GetMobileDeviceAccessOverrideCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2917,63 +2402,39 @@ export const de_DeleteUserCommand = async ( }; /** - * deserializeAws_json1_1DeleteUserCommandError + * deserializeAws_json1_1ListAccessControlRulesCommand */ -const de_DeleteUserCommandError = async ( +export const de_ListAccessControlRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectoryServiceAuthenticationFailedException": - case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": - throw await de_DirectoryServiceAuthenticationFailedExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.workmail#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListAccessControlRulesResponse(data, context); + const response: ListAccessControlRulesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeregisterFromWorkMailCommand + * deserializeAws_json1_1ListAliasesCommand */ -export const de_DeregisterFromWorkMailCommand = async ( +export const de_ListAliasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeregisterFromWorkMailCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DeregisterFromWorkMailCommandOutput = { + const response: ListAliasesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -2981,57 +2442,39 @@ export const de_DeregisterFromWorkMailCommand = async ( }; /** - * deserializeAws_json1_1DeregisterFromWorkMailCommandError + * deserializeAws_json1_1ListAvailabilityConfigurationsCommand */ -const de_DeregisterFromWorkMailCommandError = async ( +export const de_ListAvailabilityConfigurationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListAvailabilityConfigurationsResponse(data, context); + const response: ListAvailabilityConfigurationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DeregisterMailDomainCommand + * deserializeAws_json1_1ListGroupMembersCommand */ -export const de_DeregisterMailDomainCommand = async ( +export const de_ListGroupMembersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DeregisterMailDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DeregisterMailDomainCommandOutput = { + contents = de_ListGroupMembersResponse(data, context); + const response: ListGroupMembersCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3039,57 +2482,39 @@ export const de_DeregisterMailDomainCommand = async ( }; /** - * deserializeAws_json1_1DeregisterMailDomainCommandError + * deserializeAws_json1_1ListGroupsCommand */ -const de_DeregisterMailDomainCommandError = async ( +export const de_ListGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidCustomSesConfigurationException": - case "com.amazonaws.workmail#InvalidCustomSesConfigurationException": - throw await de_InvalidCustomSesConfigurationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MailDomainInUseException": - case "com.amazonaws.workmail#MailDomainInUseException": - throw await de_MailDomainInUseExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListGroupsResponse(data, context); + const response: ListGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeEmailMonitoringConfigurationCommand + * deserializeAws_json1_1ListGroupsForEntityCommand */ -export const de_DescribeEmailMonitoringConfigurationCommand = async ( +export const de_ListGroupsForEntityCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEmailMonitoringConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeEmailMonitoringConfigurationCommandOutput = { + const response: ListGroupsForEntityCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3097,54 +2522,39 @@ export const de_DescribeEmailMonitoringConfigurationCommand = async ( }; /** - * deserializeAws_json1_1DescribeEmailMonitoringConfigurationCommandError + * deserializeAws_json1_1ListImpersonationRolesCommand */ -const de_DescribeEmailMonitoringConfigurationCommandError = async ( +export const de_ListImpersonationRolesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListImpersonationRolesResponse(data, context); + const response: ListImpersonationRolesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workmail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + return response; }; /** - * deserializeAws_json1_1DescribeEntityCommand + * deserializeAws_json1_1ListMailboxExportJobsCommand */ -export const de_DescribeEntityCommand = async ( +export const de_ListMailboxExportJobsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeEntityCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeEntityCommandOutput = { + contents = de_ListMailboxExportJobsResponse(data, context); + const response: ListMailboxExportJobsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3152,54 +2562,39 @@ export const de_DescribeEntityCommand = async ( }; /** - * deserializeAws_json1_1DescribeEntityCommandError + * deserializeAws_json1_1ListMailboxPermissionsCommand */ -const de_DescribeEntityCommandError = async ( +export const de_ListMailboxPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListMailboxPermissionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeGroupCommand + * deserializeAws_json1_1ListMailDomainsCommand */ -export const de_DescribeGroupCommand = async ( +export const de_ListMailDomainsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeGroupResponse(data, context); - const response: DescribeGroupCommandOutput = { + contents = _json(data); + const response: ListMailDomainsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3207,54 +2602,39 @@ export const de_DescribeGroupCommand = async ( }; /** - * deserializeAws_json1_1DescribeGroupCommandError + * deserializeAws_json1_1ListMobileDeviceAccessOverridesCommand */ -const de_DescribeGroupCommandError = async ( +export const de_ListMobileDeviceAccessOverridesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListMobileDeviceAccessOverridesResponse(data, context); + const response: ListMobileDeviceAccessOverridesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeInboundDmarcSettingsCommand + * deserializeAws_json1_1ListMobileDeviceAccessRulesCommand */ -export const de_DescribeInboundDmarcSettingsCommand = async ( +export const de_ListMobileDeviceAccessRulesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeInboundDmarcSettingsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeInboundDmarcSettingsCommandOutput = { + contents = de_ListMobileDeviceAccessRulesResponse(data, context); + const response: ListMobileDeviceAccessRulesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3262,48 +2642,39 @@ export const de_DescribeInboundDmarcSettingsCommand = async ( }; /** - * deserializeAws_json1_1DescribeInboundDmarcSettingsCommandError + * deserializeAws_json1_1ListOrganizationsCommand */ -const de_DescribeInboundDmarcSettingsCommandError = async ( +export const de_ListOrganizationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListOrganizationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeMailboxExportJobCommand + * deserializeAws_json1_1ListResourceDelegatesCommand */ -export const de_DescribeMailboxExportJobCommand = async ( +export const de_ListResourceDelegatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeMailboxExportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeMailboxExportJobResponse(data, context); - const response: DescribeMailboxExportJobCommandOutput = { + contents = _json(data); + const response: ListResourceDelegatesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3311,54 +2682,39 @@ export const de_DescribeMailboxExportJobCommand = async ( }; /** - * deserializeAws_json1_1DescribeMailboxExportJobCommandError + * deserializeAws_json1_1ListResourcesCommand */ -const de_DescribeMailboxExportJobCommandError = async ( +export const de_ListResourcesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListResourcesResponse(data, context); + const response: ListResourcesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeOrganizationCommand + * deserializeAws_json1_1ListTagsForResourceCommand */ -export const de_DescribeOrganizationCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeOrganizationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeOrganizationResponse(data, context); - const response: DescribeOrganizationCommandOutput = { + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3366,48 +2722,39 @@ export const de_DescribeOrganizationCommand = async ( }; /** - * deserializeAws_json1_1DescribeOrganizationCommandError + * deserializeAws_json1_1ListUsersCommand */ -const de_DescribeOrganizationCommandError = async ( +export const de_ListUsersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_ListUsersResponse(data, context); + const response: ListUsersCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeResourceCommand + * deserializeAws_json1_1PutAccessControlRuleCommand */ -export const de_DescribeResourceCommand = async ( +export const de_PutAccessControlRuleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeResourceResponse(data, context); - const response: DescribeResourceCommandOutput = { + contents = _json(data); + const response: PutAccessControlRuleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3415,2134 +2762,19 @@ export const de_DescribeResourceCommand = async ( }; /** - * deserializeAws_json1_1DescribeResourceCommandError + * deserializeAws_json1_1PutEmailMonitoringConfigurationCommand */ -const de_DescribeResourceCommandError = async ( +export const de_PutEmailMonitoringConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeUserCommand - */ -export const de_DescribeUserCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeUserCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeUserResponse(data, context); - const response: DescribeUserCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeUserCommandError - */ -const de_DescribeUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociateDelegateFromResourceCommand - */ -export const de_DisassociateDelegateFromResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisassociateDelegateFromResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DisassociateDelegateFromResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisassociateDelegateFromResourceCommandError - */ -const de_DisassociateDelegateFromResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DisassociateMemberFromGroupCommand - */ -export const de_DisassociateMemberFromGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DisassociateMemberFromGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DisassociateMemberFromGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DisassociateMemberFromGroupCommandError - */ -const de_DisassociateMemberFromGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectoryServiceAuthenticationFailedException": - case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": - throw await de_DirectoryServiceAuthenticationFailedExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.workmail#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetAccessControlEffectCommand - */ -export const de_GetAccessControlEffectCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetAccessControlEffectCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetAccessControlEffectCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetAccessControlEffectCommandError - */ -const de_GetAccessControlEffectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workmail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetDefaultRetentionPolicyCommand - */ -export const de_GetDefaultRetentionPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetDefaultRetentionPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetDefaultRetentionPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetDefaultRetentionPolicyCommandError - */ -const de_GetDefaultRetentionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetImpersonationRoleCommand - */ -export const de_GetImpersonationRoleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetImpersonationRoleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetImpersonationRoleResponse(data, context); - const response: GetImpersonationRoleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetImpersonationRoleCommandError - */ -const de_GetImpersonationRoleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workmail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetImpersonationRoleEffectCommand - */ -export const de_GetImpersonationRoleEffectCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetImpersonationRoleEffectCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetImpersonationRoleEffectCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetImpersonationRoleEffectCommandError - */ -const de_GetImpersonationRoleEffectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workmail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetMailboxDetailsCommand - */ -export const de_GetMailboxDetailsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetMailboxDetailsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetMailboxDetailsResponse(data, context); - const response: GetMailboxDetailsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetMailboxDetailsCommandError - */ -const de_GetMailboxDetailsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetMailDomainCommand - */ -export const de_GetMailDomainCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetMailDomainCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetMailDomainCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetMailDomainCommandError - */ -const de_GetMailDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MailDomainNotFoundException": - case "com.amazonaws.workmail#MailDomainNotFoundException": - throw await de_MailDomainNotFoundExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetMobileDeviceAccessEffectCommand - */ -export const de_GetMobileDeviceAccessEffectCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetMobileDeviceAccessEffectCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: GetMobileDeviceAccessEffectCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetMobileDeviceAccessEffectCommandError - */ -const de_GetMobileDeviceAccessEffectCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1GetMobileDeviceAccessOverrideCommand - */ -export const de_GetMobileDeviceAccessOverrideCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_GetMobileDeviceAccessOverrideCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_GetMobileDeviceAccessOverrideResponse(data, context); - const response: GetMobileDeviceAccessOverrideCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1GetMobileDeviceAccessOverrideCommandError - */ -const de_GetMobileDeviceAccessOverrideCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workmail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAccessControlRulesCommand - */ -export const de_ListAccessControlRulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAccessControlRulesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListAccessControlRulesResponse(data, context); - const response: ListAccessControlRulesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAccessControlRulesCommandError - */ -const de_ListAccessControlRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAliasesCommand - */ -export const de_ListAliasesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAliasesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListAliasesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAliasesCommandError - */ -const de_ListAliasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListAvailabilityConfigurationsCommand - */ -export const de_ListAvailabilityConfigurationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListAvailabilityConfigurationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListAvailabilityConfigurationsResponse(data, context); - const response: ListAvailabilityConfigurationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListAvailabilityConfigurationsCommandError - */ -const de_ListAvailabilityConfigurationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListGroupMembersCommand - */ -export const de_ListGroupMembersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListGroupMembersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListGroupMembersResponse(data, context); - const response: ListGroupMembersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListGroupMembersCommandError - */ -const de_ListGroupMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListGroupsCommand - */ -export const de_ListGroupsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListGroupsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListGroupsResponse(data, context); - const response: ListGroupsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListGroupsCommandError - */ -const de_ListGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListGroupsForEntityCommand - */ -export const de_ListGroupsForEntityCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListGroupsForEntityCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListGroupsForEntityCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListGroupsForEntityCommandError - */ -const de_ListGroupsForEntityCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListImpersonationRolesCommand - */ -export const de_ListImpersonationRolesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListImpersonationRolesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListImpersonationRolesResponse(data, context); - const response: ListImpersonationRolesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListImpersonationRolesCommandError - */ -const de_ListImpersonationRolesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListMailboxExportJobsCommand - */ -export const de_ListMailboxExportJobsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListMailboxExportJobsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListMailboxExportJobsResponse(data, context); - const response: ListMailboxExportJobsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListMailboxExportJobsCommandError - */ -const de_ListMailboxExportJobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListMailboxPermissionsCommand - */ -export const de_ListMailboxPermissionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListMailboxPermissionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListMailboxPermissionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListMailboxPermissionsCommandError - */ -const de_ListMailboxPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListMailDomainsCommand - */ -export const de_ListMailDomainsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListMailDomainsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListMailDomainsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListMailDomainsCommandError - */ -const de_ListMailDomainsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListMobileDeviceAccessOverridesCommand - */ -export const de_ListMobileDeviceAccessOverridesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListMobileDeviceAccessOverridesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListMobileDeviceAccessOverridesResponse(data, context); - const response: ListMobileDeviceAccessOverridesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListMobileDeviceAccessOverridesCommandError - */ -const de_ListMobileDeviceAccessOverridesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListMobileDeviceAccessRulesCommand - */ -export const de_ListMobileDeviceAccessRulesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListMobileDeviceAccessRulesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListMobileDeviceAccessRulesResponse(data, context); - const response: ListMobileDeviceAccessRulesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListMobileDeviceAccessRulesCommandError - */ -const de_ListMobileDeviceAccessRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListOrganizationsCommand - */ -export const de_ListOrganizationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListOrganizationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListOrganizationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListOrganizationsCommandError - */ -const de_ListOrganizationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListResourceDelegatesCommand - */ -export const de_ListResourceDelegatesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListResourceDelegatesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListResourceDelegatesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListResourceDelegatesCommandError - */ -const de_ListResourceDelegatesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListResourcesCommand - */ -export const de_ListResourcesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListResourcesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListResourcesResponse(data, context); - const response: ListResourcesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListResourcesCommandError - */ -const de_ListResourcesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommand - */ -export const de_ListTagsForResourceCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ListTagsForResourceCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.workmail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ListUsersCommand - */ -export const de_ListUsersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ListUsersCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_ListUsersResponse(data, context); - const response: ListUsersCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ListUsersCommandError - */ -const de_ListUsersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutAccessControlRuleCommand - */ -export const de_PutAccessControlRuleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutAccessControlRuleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutAccessControlRuleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutAccessControlRuleCommandError - */ -const de_PutAccessControlRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workmail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workmail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutEmailMonitoringConfigurationCommand - */ -export const de_PutEmailMonitoringConfigurationCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutEmailMonitoringConfigurationCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutEmailMonitoringConfigurationCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutEmailMonitoringConfigurationCommandError - */ -const de_PutEmailMonitoringConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workmail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutInboundDmarcSettingsCommand - */ -export const de_PutInboundDmarcSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutInboundDmarcSettingsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutInboundDmarcSettingsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutInboundDmarcSettingsCommandError - */ -const de_PutInboundDmarcSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutMailboxPermissionsCommand - */ -export const de_PutMailboxPermissionsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutMailboxPermissionsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutMailboxPermissionsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutMailboxPermissionsCommandError - */ -const de_PutMailboxPermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutMobileDeviceAccessOverrideCommand - */ -export const de_PutMobileDeviceAccessOverrideCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutMobileDeviceAccessOverrideCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutMobileDeviceAccessOverrideCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutMobileDeviceAccessOverrideCommandError - */ -const de_PutMobileDeviceAccessOverrideCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1PutRetentionPolicyCommand - */ -export const de_PutRetentionPolicyCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_PutRetentionPolicyCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: PutRetentionPolicyCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1PutRetentionPolicyCommandError - */ -const de_PutRetentionPolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workmail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RegisterMailDomainCommand - */ -export const de_RegisterMailDomainCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RegisterMailDomainCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: RegisterMailDomainCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RegisterMailDomainCommandError - */ -const de_RegisterMailDomainCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workmail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "MailDomainInUseException": - case "com.amazonaws.workmail#MailDomainInUseException": - throw await de_MailDomainInUseExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1RegisterToWorkMailCommand - */ -export const de_RegisterToWorkMailCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_RegisterToWorkMailCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: RegisterToWorkMailCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1RegisterToWorkMailCommandError - */ -const de_RegisterToWorkMailCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectoryServiceAuthenticationFailedException": - case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": - throw await de_DirectoryServiceAuthenticationFailedExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.workmail#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EmailAddressInUseException": - case "com.amazonaws.workmail#EmailAddressInUseException": - throw await de_EmailAddressInUseExceptionRes(parsedOutput, context); - case "EntityAlreadyRegisteredException": - case "com.amazonaws.workmail#EntityAlreadyRegisteredException": - throw await de_EntityAlreadyRegisteredExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MailDomainNotFoundException": - case "com.amazonaws.workmail#MailDomainNotFoundException": - throw await de_MailDomainNotFoundExceptionRes(parsedOutput, context); - case "MailDomainStateException": - case "com.amazonaws.workmail#MailDomainStateException": - throw await de_MailDomainStateExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1ResetPasswordCommand - */ -export const de_ResetPasswordCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_ResetPasswordCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: ResetPasswordCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ResetPasswordCommandError - */ -const de_ResetPasswordCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectoryServiceAuthenticationFailedException": - case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": - throw await de_DirectoryServiceAuthenticationFailedExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.workmail#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "InvalidPasswordException": - case "com.amazonaws.workmail#InvalidPasswordException": - throw await de_InvalidPasswordExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1StartMailboxExportJobCommand - */ -export const de_StartMailboxExportJobCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_StartMailboxExportJobCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: StartMailboxExportJobCommandOutput = { + const response: PutEmailMonitoringConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5550,57 +2782,19 @@ export const de_StartMailboxExportJobCommand = async ( }; /** - * deserializeAws_json1_1StartMailboxExportJobCommandError - */ -const de_StartMailboxExportJobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workmail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1TagResourceCommand + * deserializeAws_json1_1PutInboundDmarcSettingsCommand */ -export const de_TagResourceCommand = async ( +export const de_PutInboundDmarcSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TagResourceCommandOutput = { + const response: PutInboundDmarcSettingsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5608,54 +2802,19 @@ export const de_TagResourceCommand = async ( }; /** - * deserializeAws_json1_1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workmail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.workmail#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1TestAvailabilityConfigurationCommand + * deserializeAws_json1_1PutMailboxPermissionsCommand */ -export const de_TestAvailabilityConfigurationCommand = async ( +export const de_PutMailboxPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_TestAvailabilityConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: TestAvailabilityConfigurationCommandOutput = { + const response: PutMailboxPermissionsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5663,54 +2822,19 @@ export const de_TestAvailabilityConfigurationCommand = async ( }; /** - * deserializeAws_json1_1TestAvailabilityConfigurationCommandError - */ -const de_TestAvailabilityConfigurationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workmail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1UntagResourceCommand + * deserializeAws_json1_1PutMobileDeviceAccessOverrideCommand */ -export const de_UntagResourceCommand = async ( +export const de_PutMobileDeviceAccessOverrideCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UntagResourceCommandOutput = { + const response: PutMobileDeviceAccessOverrideCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5718,45 +2842,39 @@ export const de_UntagResourceCommand = async ( }; /** - * deserializeAws_json1_1UntagResourceCommandError + * deserializeAws_json1_1PutRetentionPolicyCommand */ -const de_UntagResourceCommandError = async ( +export const de_PutRetentionPolicyCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.workmail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: PutRetentionPolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateAvailabilityConfigurationCommand + * deserializeAws_json1_1RegisterMailDomainCommand */ -export const de_UpdateAvailabilityConfigurationCommand = async ( +export const de_RegisterMailDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateAvailabilityConfigurationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateAvailabilityConfigurationCommandOutput = { + const response: RegisterMailDomainCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5764,54 +2882,39 @@ export const de_UpdateAvailabilityConfigurationCommand = async ( }; /** - * deserializeAws_json1_1UpdateAvailabilityConfigurationCommandError + * deserializeAws_json1_1RegisterToWorkMailCommand */ -const de_UpdateAvailabilityConfigurationCommandError = async ( +export const de_RegisterToWorkMailCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workmail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: RegisterToWorkMailCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateDefaultMailDomainCommand + * deserializeAws_json1_1ResetPasswordCommand */ -export const de_UpdateDefaultMailDomainCommand = async ( +export const de_ResetPasswordCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateDefaultMailDomainCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateDefaultMailDomainCommandOutput = { + const response: ResetPasswordCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5819,57 +2922,39 @@ export const de_UpdateDefaultMailDomainCommand = async ( }; /** - * deserializeAws_json1_1UpdateDefaultMailDomainCommandError + * deserializeAws_json1_1StartMailboxExportJobCommand */ -const de_UpdateDefaultMailDomainCommandError = async ( +export const de_StartMailboxExportJobCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MailDomainNotFoundException": - case "com.amazonaws.workmail#MailDomainNotFoundException": - throw await de_MailDomainNotFoundExceptionRes(parsedOutput, context); - case "MailDomainStateException": - case "com.amazonaws.workmail#MailDomainStateException": - throw await de_MailDomainStateExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: StartMailboxExportJobCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateGroupCommand + * deserializeAws_json1_1TagResourceCommand */ -export const de_UpdateGroupCommand = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateGroupCommandOutput = { + const response: TagResourceCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5877,60 +2962,59 @@ export const de_UpdateGroupCommand = async ( }; /** - * deserializeAws_json1_1UpdateGroupCommandError + * deserializeAws_json1_1TestAvailabilityConfigurationCommand */ -const de_UpdateGroupCommandError = async ( +export const de_TestAvailabilityConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TestAvailabilityConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1UntagResourceCommand + */ +export const de_UntagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateImpersonationRoleCommand + * deserializeAws_json1_1UpdateAvailabilityConfigurationCommand */ -export const de_UpdateImpersonationRoleCommand = async ( +export const de_UpdateAvailabilityConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateImpersonationRoleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateImpersonationRoleCommandOutput = { + const response: UpdateAvailabilityConfigurationCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -5938,63 +3022,59 @@ export const de_UpdateImpersonationRoleCommand = async ( }; /** - * deserializeAws_json1_1UpdateImpersonationRoleCommandError + * deserializeAws_json1_1UpdateDefaultMailDomainCommand */ -const de_UpdateImpersonationRoleCommandError = async ( +export const de_UpdateDefaultMailDomainCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateDefaultMailDomainCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "LimitExceededException": - case "com.amazonaws.workmail#LimitExceededException": - throw await de_LimitExceededExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workmail#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1UpdateGroupCommand + */ +export const de_UpdateGroupCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateGroupCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1UpdateMailboxQuotaCommand + * deserializeAws_json1_1UpdateImpersonationRoleCommand */ -export const de_UpdateMailboxQuotaCommand = async ( +export const de_UpdateImpersonationRoleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_UpdateMailboxQuotaCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: UpdateMailboxQuotaCommandOutput = { + const response: UpdateImpersonationRoleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -6002,41 +3082,23 @@ export const de_UpdateMailboxQuotaCommand = async ( }; /** - * deserializeAws_json1_1UpdateMailboxQuotaCommandError + * deserializeAws_json1_1UpdateMailboxQuotaCommand */ -const de_UpdateMailboxQuotaCommandError = async ( +export const de_UpdateMailboxQuotaCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateMailboxQuotaCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -6047,7 +3109,7 @@ export const de_UpdateMobileDeviceAccessRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateMobileDeviceAccessRuleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6059,41 +3121,6 @@ export const de_UpdateMobileDeviceAccessRuleCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateMobileDeviceAccessRuleCommandError - */ -const de_UpdateMobileDeviceAccessRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdatePrimaryEmailAddressCommand */ @@ -6102,7 +3129,7 @@ export const de_UpdatePrimaryEmailAddressCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdatePrimaryEmailAddressCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6114,62 +3141,6 @@ export const de_UpdatePrimaryEmailAddressCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdatePrimaryEmailAddressCommandError - */ -const de_UpdatePrimaryEmailAddressCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectoryServiceAuthenticationFailedException": - case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": - throw await de_DirectoryServiceAuthenticationFailedExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.workmail#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EmailAddressInUseException": - case "com.amazonaws.workmail#EmailAddressInUseException": - throw await de_EmailAddressInUseExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MailDomainNotFoundException": - case "com.amazonaws.workmail#MailDomainNotFoundException": - throw await de_MailDomainNotFoundExceptionRes(parsedOutput, context); - case "MailDomainStateException": - case "com.amazonaws.workmail#MailDomainStateException": - throw await de_MailDomainStateExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateResourceCommand */ @@ -6178,7 +3149,7 @@ export const de_UpdateResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateResourceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6190,65 +3161,6 @@ export const de_UpdateResourceCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateResourceCommandError - */ -const de_UpdateResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "DirectoryUnavailableException": - case "com.amazonaws.workmail#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); - case "EmailAddressInUseException": - case "com.amazonaws.workmail#EmailAddressInUseException": - throw await de_EmailAddressInUseExceptionRes(parsedOutput, context); - case "EntityNotFoundException": - case "com.amazonaws.workmail#EntityNotFoundException": - throw await de_EntityNotFoundExceptionRes(parsedOutput, context); - case "EntityStateException": - case "com.amazonaws.workmail#EntityStateException": - throw await de_EntityStateExceptionRes(parsedOutput, context); - case "InvalidConfigurationException": - case "com.amazonaws.workmail#InvalidConfigurationException": - throw await de_InvalidConfigurationExceptionRes(parsedOutput, context); - case "InvalidParameterException": - case "com.amazonaws.workmail#InvalidParameterException": - throw await de_InvalidParameterExceptionRes(parsedOutput, context); - case "MailDomainNotFoundException": - case "com.amazonaws.workmail#MailDomainNotFoundException": - throw await de_MailDomainNotFoundExceptionRes(parsedOutput, context); - case "MailDomainStateException": - case "com.amazonaws.workmail#MailDomainStateException": - throw await de_MailDomainStateExceptionRes(parsedOutput, context); - case "NameAvailabilityException": - case "com.amazonaws.workmail#NameAvailabilityException": - throw await de_NameAvailabilityExceptionRes(parsedOutput, context); - case "OrganizationNotFoundException": - case "com.amazonaws.workmail#OrganizationNotFoundException": - throw await de_OrganizationNotFoundExceptionRes(parsedOutput, context); - case "OrganizationStateException": - case "com.amazonaws.workmail#OrganizationStateException": - throw await de_OrganizationStateExceptionRes(parsedOutput, context); - case "UnsupportedOperationException": - case "com.amazonaws.workmail#UnsupportedOperationException": - throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateUserCommand */ @@ -6257,7 +3169,7 @@ export const de_UpdateUserCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateUserCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -6270,24 +3182,15 @@ export const de_UpdateUserCommand = async ( }; /** - * deserializeAws_json1_1UpdateUserCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateUserCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { - case "DirectoryServiceAuthenticationFailedException": - case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": - throw await de_DirectoryServiceAuthenticationFailedExceptionRes(parsedOutput, context); - case "DirectoryUnavailableException": - case "com.amazonaws.workmail#DirectoryUnavailableException": - throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); case "EntityNotFoundException": case "com.amazonaws.workmail#EntityNotFoundException": throw await de_EntityNotFoundExceptionRes(parsedOutput, context); @@ -6306,13 +3209,61 @@ const de_UpdateUserCommandError = async ( case "UnsupportedOperationException": case "com.amazonaws.workmail#UnsupportedOperationException": throw await de_UnsupportedOperationExceptionRes(parsedOutput, context); + case "DirectoryServiceAuthenticationFailedException": + case "com.amazonaws.workmail#DirectoryServiceAuthenticationFailedException": + throw await de_DirectoryServiceAuthenticationFailedExceptionRes(parsedOutput, context); + case "DirectoryUnavailableException": + case "com.amazonaws.workmail#DirectoryUnavailableException": + throw await de_DirectoryUnavailableExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.workmail#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "EmailAddressInUseException": + case "com.amazonaws.workmail#EmailAddressInUseException": + throw await de_EmailAddressInUseExceptionRes(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.workmail#LimitExceededException": + throw await de_LimitExceededExceptionRes(parsedOutput, context); + case "MailDomainNotFoundException": + case "com.amazonaws.workmail#MailDomainNotFoundException": + throw await de_MailDomainNotFoundExceptionRes(parsedOutput, context); + case "MailDomainStateException": + case "com.amazonaws.workmail#MailDomainStateException": + throw await de_MailDomainStateExceptionRes(parsedOutput, context); + case "NameAvailabilityException": + case "com.amazonaws.workmail#NameAvailabilityException": + throw await de_NameAvailabilityExceptionRes(parsedOutput, context); + case "ReservedNameException": + case "com.amazonaws.workmail#ReservedNameException": + throw await de_ReservedNameExceptionRes(parsedOutput, context); + case "DirectoryInUseException": + case "com.amazonaws.workmail#DirectoryInUseException": + throw await de_DirectoryInUseExceptionRes(parsedOutput, context); + case "InvalidPasswordException": + case "com.amazonaws.workmail#InvalidPasswordException": + throw await de_InvalidPasswordExceptionRes(parsedOutput, context); + case "InvalidCustomSesConfigurationException": + case "com.amazonaws.workmail#InvalidCustomSesConfigurationException": + throw await de_InvalidCustomSesConfigurationExceptionRes(parsedOutput, context); + case "MailDomainInUseException": + case "com.amazonaws.workmail#MailDomainInUseException": + throw await de_MailDomainInUseExceptionRes(parsedOutput, context); + case "EntityAlreadyRegisteredException": + case "com.amazonaws.workmail#EntityAlreadyRegisteredException": + throw await de_EntityAlreadyRegisteredExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.workmail#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "InvalidConfigurationException": + case "com.amazonaws.workmail#InvalidConfigurationException": + throw await de_InvalidConfigurationExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts b/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts index 1e9e71e3cf59..ec39f0e2f31d 100644 --- a/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts +++ b/clients/client-workmailmessageflow/src/protocols/Aws_restJson1.ts @@ -83,7 +83,7 @@ export const de_GetRawMessageContentCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetRawMessageContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -94,32 +94,6 @@ export const de_GetRawMessageContentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetRawMessageContentCommandError - */ -const de_GetRawMessageContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.workmailmessageflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutRawMessageContentCommand */ @@ -128,7 +102,7 @@ export const de_PutRawMessageContentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutRawMessageContentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -138,18 +112,18 @@ export const de_PutRawMessageContentCommand = async ( }; /** - * deserializeAws_restJson1PutRawMessageContentCommandError + * deserialize_Aws_restJson1CommandError */ -const de_PutRawMessageContentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); switch (errorCode) { + case "ResourceNotFoundException": + case "com.amazonaws.workmailmessageflow#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); case "InvalidContentLocation": case "com.amazonaws.workmailmessageflow#InvalidContentLocation": throw await de_InvalidContentLocationRes(parsedOutput, context); @@ -159,16 +133,13 @@ const de_PutRawMessageContentCommandError = async ( case "MessageRejected": case "com.amazonaws.workmailmessageflow#MessageRejected": throw await de_MessageRejectedRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workmailmessageflow#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-workspaces-thin-client/src/protocols/Aws_restJson1.ts b/clients/client-workspaces-thin-client/src/protocols/Aws_restJson1.ts index 7bd845c85fe4..70a9b762e73f 100644 --- a/clients/client-workspaces-thin-client/src/protocols/Aws_restJson1.ts +++ b/clients/client-workspaces-thin-client/src/protocols/Aws_restJson1.ts @@ -541,7 +541,7 @@ export const de_CreateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 201 && output.statusCode >= 300) { - return de_CreateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -554,50 +554,6 @@ export const de_CreateEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateEnvironmentCommandError - */ -const de_CreateEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesthinclient#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesthinclient#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesthinclient#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesthinclient#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.workspacesthinclient#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesthinclient#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesthinclient#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteDeviceCommand */ @@ -606,7 +562,7 @@ export const de_DeleteDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -615,47 +571,6 @@ export const de_DeleteDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteDeviceCommandError - */ -const de_DeleteDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesthinclient#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesthinclient#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesthinclient#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesthinclient#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesthinclient#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesthinclient#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteEnvironmentCommand */ @@ -664,7 +579,7 @@ export const de_DeleteEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_DeleteEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -673,47 +588,6 @@ export const de_DeleteEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteEnvironmentCommandError - */ -const de_DeleteEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesthinclient#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesthinclient#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesthinclient#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesthinclient#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesthinclient#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesthinclient#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeregisterDeviceCommand */ @@ -722,7 +596,7 @@ export const de_DeregisterDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 202 && output.statusCode >= 300) { - return de_DeregisterDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -731,47 +605,6 @@ export const de_DeregisterDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeregisterDeviceCommandError - */ -const de_DeregisterDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesthinclient#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesthinclient#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesthinclient#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesthinclient#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesthinclient#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesthinclient#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetDeviceCommand */ @@ -780,7 +613,7 @@ export const de_GetDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -793,44 +626,6 @@ export const de_GetDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetDeviceCommandError - */ -const de_GetDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesthinclient#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesthinclient#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesthinclient#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesthinclient#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesthinclient#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEnvironmentCommand */ @@ -839,7 +634,7 @@ export const de_GetEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -852,44 +647,6 @@ export const de_GetEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEnvironmentCommandError - */ -const de_GetEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesthinclient#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesthinclient#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesthinclient#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesthinclient#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesthinclient#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSoftwareSetCommand */ @@ -897,131 +654,36 @@ export const de_GetSoftwareSetCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSoftwareSetCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - softwareSet: (_) => de_SoftwareSet(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetSoftwareSetCommandError - */ -const de_GetSoftwareSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesthinclient#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesthinclient#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesthinclient#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesthinclient#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesthinclient#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListDevicesCommand - */ -export const de_ListDevicesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListDevicesCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - devices: (_) => de_DeviceList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListDevicesCommandError - */ -const de_ListDevicesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesthinclient#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesthinclient#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesthinclient#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesthinclient#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + softwareSet: (_) => de_SoftwareSet(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListEnvironmentsCommand + * deserializeAws_restJson1ListDevicesCommand */ -export const de_ListEnvironmentsCommand = async ( +export const de_ListDevicesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListEnvironmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - environments: (_) => de_EnvironmentList(_, context), + devices: (_) => de_DeviceList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -1029,38 +691,25 @@ export const de_ListEnvironmentsCommand = async ( }; /** - * deserializeAws_restJson1ListEnvironmentsCommandError + * deserializeAws_restJson1ListEnvironmentsCommand */ -const de_ListEnvironmentsCommandError = async ( +export const de_ListEnvironmentsCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesthinclient#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesthinclient#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesthinclient#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesthinclient#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + environments: (_) => de_EnvironmentList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -1071,7 +720,7 @@ export const de_ListSoftwareSetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListSoftwareSetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1085,41 +734,6 @@ export const de_ListSoftwareSetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListSoftwareSetsCommandError - */ -const de_ListSoftwareSetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesthinclient#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesthinclient#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesthinclient#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesthinclient#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1128,7 +742,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1141,38 +755,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.workspacesthinclient#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesthinclient#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesthinclient#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -1181,7 +763,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1190,38 +772,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.workspacesthinclient#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesthinclient#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesthinclient#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -1230,7 +780,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1239,38 +789,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InternalServiceException": - case "com.amazonaws.workspacesthinclient#InternalServiceException": - throw await de_InternalServiceExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesthinclient#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesthinclient#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateDeviceCommand */ @@ -1279,7 +797,7 @@ export const de_UpdateDeviceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateDeviceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1292,44 +810,6 @@ export const de_UpdateDeviceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateDeviceCommandError - */ -const de_UpdateDeviceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesthinclient#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesthinclient#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesthinclient#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesthinclient#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesthinclient#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateEnvironmentCommand */ @@ -1338,7 +818,7 @@ export const de_UpdateEnvironmentCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateEnvironmentCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1351,44 +831,6 @@ export const de_UpdateEnvironmentCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateEnvironmentCommandError - */ -const de_UpdateEnvironmentCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesthinclient#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesthinclient#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesthinclient#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesthinclient#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesthinclient#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSoftwareSetCommand */ @@ -1397,7 +839,7 @@ export const de_UpdateSoftwareSetCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 204 && output.statusCode >= 300) { - return de_UpdateSoftwareSetCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1407,12 +849,9 @@ export const de_UpdateSoftwareSetCommand = async ( }; /** - * deserializeAws_restJson1UpdateSoftwareSetCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateSoftwareSetCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -1422,25 +861,34 @@ const de_UpdateSoftwareSetCommandError = async ( case "AccessDeniedException": case "com.amazonaws.workspacesthinclient#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.workspacesthinclient#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.workspacesthinclient#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.workspacesthinclient#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.workspacesthinclient#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.workspacesthinclient#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.workspacesthinclient#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "InternalServiceException": + case "com.amazonaws.workspacesthinclient#InternalServiceException": + throw await de_InternalServiceExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts b/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts index 7db7097fac2a..e82ca7573dc5 100644 --- a/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts +++ b/clients/client-workspaces-web/src/protocols/Aws_restJson1.ts @@ -1400,7 +1400,7 @@ export const de_AssociateBrowserSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateBrowserSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1414,47 +1414,6 @@ export const de_AssociateBrowserSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateBrowserSettingsCommandError - */ -const de_AssociateBrowserSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateIpAccessSettingsCommand */ @@ -1463,7 +1422,7 @@ export const de_AssociateIpAccessSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateIpAccessSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1477,47 +1436,6 @@ export const de_AssociateIpAccessSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateIpAccessSettingsCommandError - */ -const de_AssociateIpAccessSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateNetworkSettingsCommand */ @@ -1526,7 +1444,7 @@ export const de_AssociateNetworkSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateNetworkSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1540,47 +1458,6 @@ export const de_AssociateNetworkSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateNetworkSettingsCommandError - */ -const de_AssociateNetworkSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateTrustStoreCommand */ @@ -1589,7 +1466,7 @@ export const de_AssociateTrustStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateTrustStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1603,44 +1480,6 @@ export const de_AssociateTrustStoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateTrustStoreCommandError - */ -const de_AssociateTrustStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateUserAccessLoggingSettingsCommand */ @@ -1649,7 +1488,7 @@ export const de_AssociateUserAccessLoggingSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateUserAccessLoggingSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1663,47 +1502,6 @@ export const de_AssociateUserAccessLoggingSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AssociateUserAccessLoggingSettingsCommandError - */ -const de_AssociateUserAccessLoggingSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1AssociateUserSettingsCommand */ @@ -1712,7 +1510,7 @@ export const de_AssociateUserSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AssociateUserSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1727,561 +1525,336 @@ export const de_AssociateUserSettingsCommand = async ( }; /** - * deserializeAws_restJson1AssociateUserSettingsCommandError + * deserializeAws_restJson1CreateBrowserSettingsCommand */ -const de_AssociateUserSettingsCommandError = async ( +export const de_CreateBrowserSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + browserSettingsArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateBrowserSettingsCommand + * deserializeAws_restJson1CreateIdentityProviderCommand */ -export const de_CreateBrowserSettingsCommand = async ( +export const de_CreateIdentityProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateBrowserSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - browserSettingsArn: __expectString, + identityProviderArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateBrowserSettingsCommandError + * deserializeAws_restJson1CreateIpAccessSettingsCommand */ -const de_CreateBrowserSettingsCommandError = async ( +export const de_CreateIpAccessSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.workspacesweb#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ipAccessSettingsArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateIdentityProviderCommand + * deserializeAws_restJson1CreateNetworkSettingsCommand */ -export const de_CreateIdentityProviderCommand = async ( +export const de_CreateNetworkSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateIdentityProviderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - identityProviderArn: __expectString, + networkSettingsArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateIdentityProviderCommandError + * deserializeAws_restJson1CreatePortalCommand */ -const de_CreateIdentityProviderCommandError = async ( +export const de_CreatePortalCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.workspacesweb#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + portalArn: __expectString, + portalEndpoint: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateIpAccessSettingsCommand + * deserializeAws_restJson1CreateTrustStoreCommand */ -export const de_CreateIpAccessSettingsCommand = async ( +export const de_CreateTrustStoreCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateIpAccessSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - ipAccessSettingsArn: __expectString, + trustStoreArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateIpAccessSettingsCommandError + * deserializeAws_restJson1CreateUserAccessLoggingSettingsCommand */ -const de_CreateIpAccessSettingsCommandError = async ( +export const de_CreateUserAccessLoggingSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.workspacesweb#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + userAccessLoggingSettingsArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1CreateNetworkSettingsCommand + * deserializeAws_restJson1CreateUserSettingsCommand */ -export const de_CreateNetworkSettingsCommand = async ( +export const de_CreateUserSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateNetworkSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - networkSettingsArn: __expectString, + userSettingsArn: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1CreateNetworkSettingsCommandError + * deserializeAws_restJson1DeleteBrowserSettingsCommand */ -const de_CreateNetworkSettingsCommandError = async ( +export const de_DeleteBrowserSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.workspacesweb#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreatePortalCommand + * deserializeAws_restJson1DeleteIdentityProviderCommand */ -export const de_CreatePortalCommand = async ( +export const de_DeleteIdentityProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreatePortalCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - portalArn: __expectString, - portalEndpoint: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreatePortalCommandError + * deserializeAws_restJson1DeleteIpAccessSettingsCommand */ -const de_CreatePortalCommandError = async ( +export const de_DeleteIpAccessSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.workspacesweb#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateTrustStoreCommand + * deserializeAws_restJson1DeleteNetworkSettingsCommand */ -export const de_CreateTrustStoreCommand = async ( +export const de_DeleteNetworkSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateTrustStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - trustStoreArn: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateTrustStoreCommandError + * deserializeAws_restJson1DeletePortalCommand */ -const de_CreateTrustStoreCommandError = async ( +export const de_DeletePortalCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.workspacesweb#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateUserAccessLoggingSettingsCommand + * deserializeAws_restJson1DeleteTrustStoreCommand */ -export const de_CreateUserAccessLoggingSettingsCommand = async ( +export const de_DeleteTrustStoreCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateUserAccessLoggingSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - userAccessLoggingSettingsArn: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateUserAccessLoggingSettingsCommandError + * deserializeAws_restJson1DeleteUserAccessLoggingSettingsCommand */ -const de_CreateUserAccessLoggingSettingsCommandError = async ( +export const de_DeleteUserAccessLoggingSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.workspacesweb#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1CreateUserSettingsCommand + * deserializeAws_restJson1DeleteUserSettingsCommand */ -export const de_CreateUserSettingsCommand = async ( +export const de_DeleteUserSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateUserSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - userSettingsArn: __expectString, - }); - Object.assign(contents, doc); + await collectBody(output.body, context); return contents; }; /** - * deserializeAws_restJson1CreateUserSettingsCommandError + * deserializeAws_restJson1DisassociateBrowserSettingsCommand */ -const de_CreateUserSettingsCommandError = async ( +export const de_DisassociateBrowserSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.workspacesweb#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteBrowserSettingsCommand + * deserializeAws_restJson1DisassociateIpAccessSettingsCommand */ -export const de_DeleteBrowserSettingsCommand = async ( +export const de_DisassociateIpAccessSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteBrowserSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2291,52 +1864,31 @@ export const de_DeleteBrowserSettingsCommand = async ( }; /** - * deserializeAws_restJson1DeleteBrowserSettingsCommandError + * deserializeAws_restJson1DisassociateNetworkSettingsCommand */ -const de_DeleteBrowserSettingsCommandError = async ( +export const de_DisassociateNetworkSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteIdentityProviderCommand + * deserializeAws_restJson1DisassociateTrustStoreCommand */ -export const de_DeleteIdentityProviderCommand = async ( +export const de_DisassociateTrustStoreCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteIdentityProviderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2346,52 +1898,31 @@ export const de_DeleteIdentityProviderCommand = async ( }; /** - * deserializeAws_restJson1DeleteIdentityProviderCommandError + * deserializeAws_restJson1DisassociateUserAccessLoggingSettingsCommand */ -const de_DeleteIdentityProviderCommandError = async ( +export const de_DisassociateUserAccessLoggingSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1DeleteIpAccessSettingsCommand + * deserializeAws_restJson1DisassociateUserSettingsCommand */ -export const de_DeleteIpAccessSettingsCommand = async ( +export const de_DisassociateUserSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteIpAccessSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2400,1602 +1931,170 @@ export const de_DeleteIpAccessSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteIpAccessSettingsCommandError - */ -const de_DeleteIpAccessSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteNetworkSettingsCommand - */ -export const de_DeleteNetworkSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteNetworkSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteNetworkSettingsCommandError - */ -const de_DeleteNetworkSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeletePortalCommand - */ -export const de_DeletePortalCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeletePortalCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeletePortalCommandError - */ -const de_DeletePortalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteTrustStoreCommand - */ -export const de_DeleteTrustStoreCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteTrustStoreCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteTrustStoreCommandError - */ -const de_DeleteTrustStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteUserAccessLoggingSettingsCommand - */ -export const de_DeleteUserAccessLoggingSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteUserAccessLoggingSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteUserAccessLoggingSettingsCommandError - */ -const de_DeleteUserAccessLoggingSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DeleteUserSettingsCommand - */ -export const de_DeleteUserSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteUserSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DeleteUserSettingsCommandError - */ -const de_DeleteUserSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateBrowserSettingsCommand - */ -export const de_DisassociateBrowserSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateBrowserSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateBrowserSettingsCommandError - */ -const de_DisassociateBrowserSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateIpAccessSettingsCommand - */ -export const de_DisassociateIpAccessSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateIpAccessSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateIpAccessSettingsCommandError - */ -const de_DisassociateIpAccessSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateNetworkSettingsCommand - */ -export const de_DisassociateNetworkSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateNetworkSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateNetworkSettingsCommandError - */ -const de_DisassociateNetworkSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateTrustStoreCommand - */ -export const de_DisassociateTrustStoreCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateTrustStoreCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateTrustStoreCommandError - */ -const de_DisassociateTrustStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateUserAccessLoggingSettingsCommand - */ -export const de_DisassociateUserAccessLoggingSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateUserAccessLoggingSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateUserAccessLoggingSettingsCommandError - */ -const de_DisassociateUserAccessLoggingSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1DisassociateUserSettingsCommand - */ -export const de_DisassociateUserSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DisassociateUserSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1DisassociateUserSettingsCommandError - */ -const de_DisassociateUserSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetBrowserSettingsCommand - */ -export const de_GetBrowserSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetBrowserSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - browserSettings: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetBrowserSettingsCommandError - */ -const de_GetBrowserSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetIdentityProviderCommand - */ -export const de_GetIdentityProviderCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIdentityProviderCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - identityProvider: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetIdentityProviderCommandError - */ -const de_GetIdentityProviderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetIpAccessSettingsCommand - */ -export const de_GetIpAccessSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetIpAccessSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ipAccessSettings: (_) => de_IpAccessSettings(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetIpAccessSettingsCommandError - */ -const de_GetIpAccessSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetNetworkSettingsCommand - */ -export const de_GetNetworkSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetNetworkSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - networkSettings: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetNetworkSettingsCommandError - */ -const de_GetNetworkSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPortalCommand - */ -export const de_GetPortalCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPortalCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - portal: (_) => de_Portal(_, context), - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPortalCommandError - */ -const de_GetPortalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetPortalServiceProviderMetadataCommand - */ -export const de_GetPortalServiceProviderMetadataCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetPortalServiceProviderMetadataCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - portalArn: __expectString, - serviceProviderSamlMetadata: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetPortalServiceProviderMetadataCommandError - */ -const de_GetPortalServiceProviderMetadataCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetTrustStoreCommand - */ -export const de_GetTrustStoreCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTrustStoreCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - trustStore: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetTrustStoreCommandError - */ -const de_GetTrustStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetTrustStoreCertificateCommand - */ -export const de_GetTrustStoreCertificateCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTrustStoreCertificateCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - certificate: (_) => de_Certificate(_, context), - trustStoreArn: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetTrustStoreCertificateCommandError - */ -const de_GetTrustStoreCertificateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetUserAccessLoggingSettingsCommand - */ -export const de_GetUserAccessLoggingSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUserAccessLoggingSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - userAccessLoggingSettings: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetUserAccessLoggingSettingsCommandError - */ -const de_GetUserAccessLoggingSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetUserSettingsCommand - */ -export const de_GetUserSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetUserSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - userSettings: _json, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetUserSettingsCommandError - */ -const de_GetUserSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListBrowserSettingsCommand - */ -export const de_ListBrowserSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListBrowserSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - browserSettings: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListBrowserSettingsCommandError - */ -const de_ListBrowserSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListIdentityProvidersCommand - */ -export const de_ListIdentityProvidersCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIdentityProvidersCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - identityProviders: _json, - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListIdentityProvidersCommandError - */ -const de_ListIdentityProvidersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1ListIpAccessSettingsCommand - */ -export const de_ListIpAccessSettingsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListIpAccessSettingsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - ipAccessSettings: (_) => de_IpAccessSettingsList(_, context), - nextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1ListIpAccessSettingsCommandError - */ -const de_ListIpAccessSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +/** + * deserializeAws_restJson1GetBrowserSettingsCommand + */ +export const de_GetBrowserSettingsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + browserSettings: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListNetworkSettingsCommand + * deserializeAws_restJson1GetIdentityProviderCommand */ -export const de_ListNetworkSettingsCommand = async ( +export const de_GetIdentityProviderCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListNetworkSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - networkSettings: _json, - nextToken: __expectString, + identityProvider: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListNetworkSettingsCommandError + * deserializeAws_restJson1GetIpAccessSettingsCommand */ -const de_ListNetworkSettingsCommandError = async ( +export const de_GetIpAccessSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ipAccessSettings: (_) => de_IpAccessSettings(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListPortalsCommand + * deserializeAws_restJson1GetNetworkSettingsCommand */ -export const de_ListPortalsCommand = async ( +export const de_GetNetworkSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListPortalsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - portals: (_) => de_PortalList(_, context), + networkSettings: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListPortalsCommandError + * deserializeAws_restJson1GetPortalCommand */ -const de_ListPortalsCommandError = async ( +export const de_GetPortalCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + portal: (_) => de_Portal(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommand + * deserializeAws_restJson1GetPortalServiceProviderMetadataCommand */ -export const de_ListTagsForResourceCommand = async ( +export const de_GetPortalServiceProviderMetadataCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - tags: _json, + portalArn: __expectString, + serviceProviderSamlMetadata: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTagsForResourceCommandError + * deserializeAws_restJson1GetTrustStoreCommand */ -const de_ListTagsForResourceCommandError = async ( +export const de_GetTrustStoreCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + trustStore: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTrustStoreCertificatesCommand + * deserializeAws_restJson1GetTrustStoreCertificateCommand */ -export const de_ListTrustStoreCertificatesCommand = async ( +export const de_GetTrustStoreCertificateCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTrustStoreCertificatesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - certificateList: (_) => de_CertificateSummaryList(_, context), - nextToken: __expectString, + certificate: (_) => de_Certificate(_, context), trustStoreArn: __expectString, }); Object.assign(contents, doc); @@ -4003,443 +2102,341 @@ export const de_ListTrustStoreCertificatesCommand = async ( }; /** - * deserializeAws_restJson1ListTrustStoreCertificatesCommandError + * deserializeAws_restJson1GetUserAccessLoggingSettingsCommand */ -const de_ListTrustStoreCertificatesCommandError = async ( +export const de_GetUserAccessLoggingSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + userAccessLoggingSettings: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListTrustStoresCommand + * deserializeAws_restJson1GetUserSettingsCommand */ -export const de_ListTrustStoresCommand = async ( +export const de_GetUserSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTrustStoresCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - nextToken: __expectString, - trustStores: _json, + userSettings: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListTrustStoresCommandError + * deserializeAws_restJson1ListBrowserSettingsCommand */ -const de_ListTrustStoresCommandError = async ( +export const de_ListBrowserSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + browserSettings: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListUserAccessLoggingSettingsCommand + * deserializeAws_restJson1ListIdentityProvidersCommand */ -export const de_ListUserAccessLoggingSettingsCommand = async ( +export const de_ListIdentityProvidersCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUserAccessLoggingSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + identityProviders: _json, nextToken: __expectString, - userAccessLoggingSettings: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListUserAccessLoggingSettingsCommandError + * deserializeAws_restJson1ListIpAccessSettingsCommand */ -const de_ListUserAccessLoggingSettingsCommandError = async ( +export const de_ListIpAccessSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + ipAccessSettings: (_) => de_IpAccessSettingsList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1ListUserSettingsCommand + * deserializeAws_restJson1ListNetworkSettingsCommand */ -export const de_ListUserSettingsCommand = async ( +export const de_ListNetworkSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListUserSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { + networkSettings: _json, nextToken: __expectString, - userSettings: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1ListUserSettingsCommandError + * deserializeAws_restJson1ListPortalsCommand */ -const de_ListUserSettingsCommandError = async ( +export const de_ListPortalsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + portals: (_) => de_PortalList(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1TagResourceCommand + * deserializeAws_restJson1ListTagsForResourceCommand */ -export const de_TagResourceCommand = async ( +export const de_ListTagsForResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + tags: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1TagResourceCommandError + * deserializeAws_restJson1ListTrustStoreCertificatesCommand */ -const de_TagResourceCommandError = async ( +export const de_ListTrustStoreCertificatesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.workspacesweb#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + certificateList: (_) => de_CertificateSummaryList(_, context), + nextToken: __expectString, + trustStoreArn: __expectString, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UntagResourceCommand + * deserializeAws_restJson1ListTrustStoresCommand */ -export const de_UntagResourceCommand = async ( +export const de_ListTrustStoresCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); - await collectBody(output.body, context); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + trustStores: _json, + }); + Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UntagResourceCommandError + * deserializeAws_restJson1ListUserAccessLoggingSettingsCommand */ -const de_UntagResourceCommandError = async ( +export const de_ListUserAccessLoggingSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + userAccessLoggingSettings: _json, + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1UpdateBrowserSettingsCommand + * deserializeAws_restJson1ListUserSettingsCommand */ -export const de_UpdateBrowserSettingsCommand = async ( +export const de_ListUserSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateBrowserSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - browserSettings: _json, + nextToken: __expectString, + userSettings: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateBrowserSettingsCommandError + * deserializeAws_restJson1TagResourceCommand */ -const de_UpdateBrowserSettingsCommandError = async ( +export const de_TagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UntagResourceCommand + */ +export const de_UntagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; }; /** - * deserializeAws_restJson1UpdateIdentityProviderCommand + * deserializeAws_restJson1UpdateBrowserSettingsCommand */ -export const de_UpdateIdentityProviderCommand = async ( +export const de_UpdateBrowserSettingsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIdentityProviderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - identityProvider: _json, + browserSettings: _json, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1UpdateIdentityProviderCommandError + * deserializeAws_restJson1UpdateIdentityProviderCommand */ -const de_UpdateIdentityProviderCommandError = async ( +export const de_UpdateIdentityProviderCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + identityProvider: _json, + }); + Object.assign(contents, doc); + return contents; }; /** @@ -4450,7 +2447,7 @@ export const de_UpdateIpAccessSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateIpAccessSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4463,44 +2460,6 @@ export const de_UpdateIpAccessSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateIpAccessSettingsCommandError - */ -const de_UpdateIpAccessSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateNetworkSettingsCommand */ @@ -4509,7 +2468,7 @@ export const de_UpdateNetworkSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateNetworkSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4522,44 +2481,6 @@ export const de_UpdateNetworkSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateNetworkSettingsCommandError - */ -const de_UpdateNetworkSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdatePortalCommand */ @@ -4568,7 +2489,7 @@ export const de_UpdatePortalCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdatePortalCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4581,47 +2502,6 @@ export const de_UpdatePortalCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdatePortalCommandError - */ -const de_UpdatePortalCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.workspacesweb#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateTrustStoreCommand */ @@ -4630,7 +2510,7 @@ export const de_UpdateTrustStoreCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateTrustStoreCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4643,47 +2523,6 @@ export const de_UpdateTrustStoreCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateTrustStoreCommandError - */ -const de_UpdateTrustStoreCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.workspacesweb#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateUserAccessLoggingSettingsCommand */ @@ -4692,7 +2531,7 @@ export const de_UpdateUserAccessLoggingSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserAccessLoggingSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4705,44 +2544,6 @@ export const de_UpdateUserAccessLoggingSettingsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateUserAccessLoggingSettingsCommandError - */ -const de_UpdateUserAccessLoggingSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspacesweb#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InternalServerException": - case "com.amazonaws.workspacesweb#InternalServerException": - throw await de_InternalServerExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspacesweb#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottlingException": - case "com.amazonaws.workspacesweb#ThrottlingException": - throw await de_ThrottlingExceptionRes(parsedOutput, context); - case "ValidationException": - case "com.amazonaws.workspacesweb#ValidationException": - throw await de_ValidationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateUserSettingsCommand */ @@ -4751,7 +2552,7 @@ export const de_UpdateUserSettingsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateUserSettingsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4765,12 +2566,9 @@ export const de_UpdateUserSettingsCommand = async ( }; /** - * deserializeAws_restJson1UpdateUserSettingsCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateUserSettingsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -4780,6 +2578,9 @@ const de_UpdateUserSettingsCommandError = async ( case "AccessDeniedException": case "com.amazonaws.workspacesweb#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.workspacesweb#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.workspacesweb#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); @@ -4792,13 +2593,19 @@ const de_UpdateUserSettingsCommandError = async ( case "ValidationException": case "com.amazonaws.workspacesweb#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.workspacesweb#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.workspacesweb#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-workspaces/src/protocols/Aws_json1_1.ts b/clients/client-workspaces/src/protocols/Aws_json1_1.ts index 11ec4b1eb5df..e2e43cf5b64a 100644 --- a/clients/client-workspaces/src/protocols/Aws_json1_1.ts +++ b/clients/client-workspaces/src/protocols/Aws_json1_1.ts @@ -1368,7 +1368,7 @@ export const de_AssociateConnectionAliasCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateConnectionAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1380,47 +1380,6 @@ export const de_AssociateConnectionAliasCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateConnectionAliasCommandError - */ -const de_AssociateConnectionAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceAssociatedException": - case "com.amazonaws.workspaces#ResourceAssociatedException": - throw await de_ResourceAssociatedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateIpGroupsCommand */ @@ -1429,7 +1388,7 @@ export const de_AssociateIpGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateIpGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1441,47 +1400,6 @@ export const de_AssociateIpGroupsCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateIpGroupsCommandError - */ -const de_AssociateIpGroupsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AssociateWorkspaceApplicationCommand */ @@ -1490,7 +1408,7 @@ export const de_AssociateWorkspaceApplicationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AssociateWorkspaceApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1502,59 +1420,6 @@ export const de_AssociateWorkspaceApplicationCommand = async ( return response; }; -/** - * deserializeAws_json1_1AssociateWorkspaceApplicationCommandError - */ -const de_AssociateWorkspaceApplicationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ApplicationNotSupportedException": - case "com.amazonaws.workspaces#ApplicationNotSupportedException": - throw await de_ApplicationNotSupportedExceptionRes(parsedOutput, context); - case "ComputeNotCompatibleException": - case "com.amazonaws.workspaces#ComputeNotCompatibleException": - throw await de_ComputeNotCompatibleExceptionRes(parsedOutput, context); - case "IncompatibleApplicationsException": - case "com.amazonaws.workspaces#IncompatibleApplicationsException": - throw await de_IncompatibleApplicationsExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperatingSystemNotCompatibleException": - case "com.amazonaws.workspaces#OperatingSystemNotCompatibleException": - throw await de_OperatingSystemNotCompatibleExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.workspaces#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.workspaces#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1AuthorizeIpRulesCommand */ @@ -1563,7 +1428,7 @@ export const de_AuthorizeIpRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_AuthorizeIpRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1575,44 +1440,6 @@ export const de_AuthorizeIpRulesCommand = async ( return response; }; -/** - * deserializeAws_json1_1AuthorizeIpRulesCommandError - */ -const de_AuthorizeIpRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CopyWorkspaceImageCommand */ @@ -1621,7 +1448,7 @@ export const de_CopyWorkspaceImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CopyWorkspaceImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1633,50 +1460,6 @@ export const de_CopyWorkspaceImageCommand = async ( return response; }; -/** - * deserializeAws_json1_1CopyWorkspaceImageCommandError - */ -const de_CopyWorkspaceImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.workspaces#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.workspaces#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateConnectClientAddInCommand */ @@ -1685,7 +1468,7 @@ export const de_CreateConnectClientAddInCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateConnectClientAddInCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1698,57 +1481,39 @@ export const de_CreateConnectClientAddInCommand = async ( }; /** - * deserializeAws_json1_1CreateConnectClientAddInCommandError + * deserializeAws_json1_1CreateConnectionAliasCommand */ -const de_CreateConnectClientAddInCommandError = async ( +export const de_CreateConnectionAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.workspaces#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceCreationFailedException": - case "com.amazonaws.workspaces#ResourceCreationFailedException": - throw await de_ResourceCreationFailedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: CreateConnectionAliasCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1CreateConnectionAliasCommand + * deserializeAws_json1_1CreateIpGroupCommand */ -export const de_CreateConnectionAliasCommand = async ( +export const de_CreateIpGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_CreateConnectionAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: CreateConnectionAliasCommandOutput = { + const response: CreateIpGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -1756,113 +1521,14 @@ export const de_CreateConnectionAliasCommand = async ( }; /** - * deserializeAws_json1_1CreateConnectionAliasCommandError + * deserializeAws_json1_1CreateStandbyWorkspacesCommand */ -const de_CreateConnectionAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.workspaces#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateIpGroupCommand - */ -export const de_CreateIpGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateIpGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: CreateIpGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateIpGroupCommandError - */ -const de_CreateIpGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.workspaces#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceCreationFailedException": - case "com.amazonaws.workspaces#ResourceCreationFailedException": - throw await de_ResourceCreationFailedExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateStandbyWorkspacesCommand - */ -export const de_CreateStandbyWorkspacesCommand = async ( +export const de_CreateStandbyWorkspacesCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateStandbyWorkspacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1874,44 +1540,6 @@ export const de_CreateStandbyWorkspacesCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateStandbyWorkspacesCommandError - */ -const de_CreateStandbyWorkspacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateTagsCommand */ @@ -1920,7 +1548,7 @@ export const de_CreateTagsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1932,38 +1560,6 @@ export const de_CreateTagsCommand = async ( return response; }; -/** - * deserializeAws_json1_1CreateTagsCommandError - */ -const de_CreateTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1CreateUpdatedWorkspaceImageCommand */ @@ -1972,1210 +1568,32 @@ export const de_CreateUpdatedWorkspaceImageCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_CreateUpdatedWorkspaceImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); const response: CreateUpdatedWorkspaceImageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateUpdatedWorkspaceImageCommandError - */ -const de_CreateUpdatedWorkspaceImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.workspaces#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateWorkspaceBundleCommand - */ -export const de_CreateWorkspaceBundleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateWorkspaceBundleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateWorkspaceBundleResult(data, context); - const response: CreateWorkspaceBundleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateWorkspaceBundleCommandError - */ -const de_CreateWorkspaceBundleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.workspaces#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.workspaces#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateWorkspaceImageCommand - */ -export const de_CreateWorkspaceImageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateWorkspaceImageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateWorkspaceImageResult(data, context); - const response: CreateWorkspaceImageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateWorkspaceImageCommandError - */ -const de_CreateWorkspaceImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.workspaces#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1CreateWorkspacesCommand - */ -export const de_CreateWorkspacesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_CreateWorkspacesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_CreateWorkspacesResult(data, context); - const response: CreateWorkspacesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1CreateWorkspacesCommandError - */ -const de_CreateWorkspacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteClientBrandingCommand - */ -export const de_DeleteClientBrandingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteClientBrandingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteClientBrandingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteClientBrandingCommandError - */ -const de_DeleteClientBrandingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteConnectClientAddInCommand - */ -export const de_DeleteConnectClientAddInCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteConnectClientAddInCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteConnectClientAddInCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteConnectClientAddInCommandError - */ -const de_DeleteConnectClientAddInCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteConnectionAliasCommand - */ -export const de_DeleteConnectionAliasCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteConnectionAliasCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteConnectionAliasCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteConnectionAliasCommandError - */ -const de_DeleteConnectionAliasCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceAssociatedException": - case "com.amazonaws.workspaces#ResourceAssociatedException": - throw await de_ResourceAssociatedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteIpGroupCommand - */ -export const de_DeleteIpGroupCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteIpGroupCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteIpGroupCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteIpGroupCommandError - */ -const de_DeleteIpGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceAssociatedException": - case "com.amazonaws.workspaces#ResourceAssociatedException": - throw await de_ResourceAssociatedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteTagsCommand - */ -export const de_DeleteTagsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteTagsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteTagsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteTagsCommandError - */ -const de_DeleteTagsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteWorkspaceBundleCommand - */ -export const de_DeleteWorkspaceBundleCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteWorkspaceBundleCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteWorkspaceBundleCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteWorkspaceBundleCommandError - */ -const de_DeleteWorkspaceBundleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceAssociatedException": - case "com.amazonaws.workspaces#ResourceAssociatedException": - throw await de_ResourceAssociatedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeleteWorkspaceImageCommand - */ -export const de_DeleteWorkspaceImageCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeleteWorkspaceImageCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeleteWorkspaceImageCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeleteWorkspaceImageCommandError - */ -const de_DeleteWorkspaceImageCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "ResourceAssociatedException": - case "com.amazonaws.workspaces#ResourceAssociatedException": - throw await de_ResourceAssociatedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeployWorkspaceApplicationsCommand - */ -export const de_DeployWorkspaceApplicationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeployWorkspaceApplicationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DeployWorkspaceApplicationsResult(data, context); - const response: DeployWorkspaceApplicationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeployWorkspaceApplicationsCommandError - */ -const de_DeployWorkspaceApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "IncompatibleApplicationsException": - case "com.amazonaws.workspaces#IncompatibleApplicationsException": - throw await de_IncompatibleApplicationsExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.workspaces#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DeregisterWorkspaceDirectoryCommand - */ -export const de_DeregisterWorkspaceDirectoryCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DeregisterWorkspaceDirectoryCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DeregisterWorkspaceDirectoryCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DeregisterWorkspaceDirectoryCommandError - */ -const de_DeregisterWorkspaceDirectoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAccountCommand - */ -export const de_DescribeAccountCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAccountCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeAccountCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAccountCommandError - */ -const de_DescribeAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeAccountModificationsCommand - */ -export const de_DescribeAccountModificationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeAccountModificationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeAccountModificationsResult(data, context); - const response: DescribeAccountModificationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeAccountModificationsCommandError - */ -const de_DescribeAccountModificationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeApplicationAssociationsCommand - */ -export const de_DescribeApplicationAssociationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeApplicationAssociationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeApplicationAssociationsResult(data, context); - const response: DescribeApplicationAssociationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeApplicationAssociationsCommandError - */ -const de_DescribeApplicationAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeApplicationsCommand - */ -export const de_DescribeApplicationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeApplicationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeApplicationsResult(data, context); - const response: DescribeApplicationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeApplicationsCommandError - */ -const de_DescribeApplicationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeBundleAssociationsCommand - */ -export const de_DescribeBundleAssociationsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeBundleAssociationsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = de_DescribeBundleAssociationsResult(data, context); - const response: DescribeBundleAssociationsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeBundleAssociationsCommandError - */ -const de_DescribeBundleAssociationsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeClientBrandingCommand - */ -export const de_DescribeClientBrandingCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeClientBrandingCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeClientBrandingCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeClientBrandingCommandError - */ -const de_DescribeClientBrandingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeClientPropertiesCommand - */ -export const de_DescribeClientPropertiesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeClientPropertiesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeClientPropertiesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeClientPropertiesCommandError - */ -const de_DescribeClientPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeConnectClientAddInsCommand - */ -export const de_DescribeConnectClientAddInsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeConnectClientAddInsCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeConnectClientAddInsCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeConnectClientAddInsCommandError - */ -const de_DescribeConnectClientAddInsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_json1_1DescribeConnectionAliasesCommand - */ -export const de_DescribeConnectionAliasesCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode >= 300) { - return de_DescribeConnectionAliasesCommandError(output, context); - } - const data: any = await parseBody(output.body, context); - let contents: any = {}; - contents = _json(data); - const response: DescribeConnectionAliasesCommandOutput = { - $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1DescribeConnectionAliasesCommandError - */ -const de_DescribeConnectionAliasesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeConnectionAliasPermissionsCommand + * deserializeAws_json1_1CreateWorkspaceBundleCommand */ -export const de_DescribeConnectionAliasPermissionsCommand = async ( +export const de_CreateWorkspaceBundleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeConnectionAliasPermissionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeConnectionAliasPermissionsCommandOutput = { + contents = de_CreateWorkspaceBundleResult(data, context); + const response: CreateWorkspaceBundleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3183,54 +1601,39 @@ export const de_DescribeConnectionAliasPermissionsCommand = async ( }; /** - * deserializeAws_json1_1DescribeConnectionAliasPermissionsCommandError + * deserializeAws_json1_1CreateWorkspaceImageCommand */ -const de_DescribeConnectionAliasPermissionsCommandError = async ( +export const de_CreateWorkspaceImageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateWorkspaceImageResult(data, context); + const response: CreateWorkspaceImageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeImageAssociationsCommand + * deserializeAws_json1_1CreateWorkspacesCommand */ -export const de_DescribeImageAssociationsCommand = async ( +export const de_CreateWorkspacesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeImageAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeImageAssociationsResult(data, context); - const response: DescribeImageAssociationsCommandOutput = { + contents = de_CreateWorkspacesResult(data, context); + const response: CreateWorkspacesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3238,54 +1641,39 @@ export const de_DescribeImageAssociationsCommand = async ( }; /** - * deserializeAws_json1_1DescribeImageAssociationsCommandError + * deserializeAws_json1_1DeleteClientBrandingCommand */ -const de_DescribeImageAssociationsCommandError = async ( +export const de_DeleteClientBrandingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteClientBrandingCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeIpGroupsCommand + * deserializeAws_json1_1DeleteConnectClientAddInCommand */ -export const de_DescribeIpGroupsCommand = async ( +export const de_DeleteConnectClientAddInCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeIpGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeIpGroupsCommandOutput = { + const response: DeleteConnectClientAddInCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3293,48 +1681,39 @@ export const de_DescribeIpGroupsCommand = async ( }; /** - * deserializeAws_json1_1DescribeIpGroupsCommandError + * deserializeAws_json1_1DeleteConnectionAliasCommand */ -const de_DescribeIpGroupsCommandError = async ( +export const de_DeleteConnectionAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteConnectionAliasCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeTagsCommand + * deserializeAws_json1_1DeleteIpGroupCommand */ -export const de_DescribeTagsCommand = async ( +export const de_DeleteIpGroupCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeTagsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeTagsCommandOutput = { + const response: DeleteIpGroupCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3342,45 +1721,39 @@ export const de_DescribeTagsCommand = async ( }; /** - * deserializeAws_json1_1DescribeTagsCommandError + * deserializeAws_json1_1DeleteTagsCommand */ -const de_DescribeTagsCommandError = async ( +export const de_DeleteTagsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteTagsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeWorkspaceAssociationsCommand + * deserializeAws_json1_1DeleteWorkspaceBundleCommand */ -export const de_DescribeWorkspaceAssociationsCommand = async ( +export const de_DeleteWorkspaceBundleCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeWorkspaceAssociationsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeWorkspaceAssociationsResult(data, context); - const response: DescribeWorkspaceAssociationsCommandOutput = { + contents = _json(data); + const response: DeleteWorkspaceBundleCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3388,54 +1761,39 @@ export const de_DescribeWorkspaceAssociationsCommand = async ( }; /** - * deserializeAws_json1_1DescribeWorkspaceAssociationsCommandError + * deserializeAws_json1_1DeleteWorkspaceImageCommand */ -const de_DescribeWorkspaceAssociationsCommandError = async ( +export const de_DeleteWorkspaceImageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteWorkspaceImageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeWorkspaceBundlesCommand + * deserializeAws_json1_1DeployWorkspaceApplicationsCommand */ -export const de_DescribeWorkspaceBundlesCommand = async ( +export const de_DeployWorkspaceApplicationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeWorkspaceBundlesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeWorkspaceBundlesResult(data, context); - const response: DescribeWorkspaceBundlesCommandOutput = { + contents = de_DeployWorkspaceApplicationsResult(data, context); + const response: DeployWorkspaceApplicationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3443,45 +1801,39 @@ export const de_DescribeWorkspaceBundlesCommand = async ( }; /** - * deserializeAws_json1_1DescribeWorkspaceBundlesCommandError + * deserializeAws_json1_1DeregisterWorkspaceDirectoryCommand */ -const de_DescribeWorkspaceBundlesCommandError = async ( +export const de_DeregisterWorkspaceDirectoryCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeregisterWorkspaceDirectoryCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeWorkspaceDirectoriesCommand + * deserializeAws_json1_1DescribeAccountCommand */ -export const de_DescribeWorkspaceDirectoriesCommand = async ( +export const de_DescribeAccountCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeWorkspaceDirectoriesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DescribeWorkspaceDirectoriesCommandOutput = { + const response: DescribeAccountCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3489,45 +1841,39 @@ export const de_DescribeWorkspaceDirectoriesCommand = async ( }; /** - * deserializeAws_json1_1DescribeWorkspaceDirectoriesCommandError + * deserializeAws_json1_1DescribeAccountModificationsCommand */ -const de_DescribeWorkspaceDirectoriesCommandError = async ( +export const de_DescribeAccountModificationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeAccountModificationsResult(data, context); + const response: DescribeAccountModificationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeWorkspaceImagePermissionsCommand + * deserializeAws_json1_1DescribeApplicationAssociationsCommand */ -export const de_DescribeWorkspaceImagePermissionsCommand = async ( +export const de_DescribeApplicationAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeWorkspaceImagePermissionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DescribeWorkspaceImagePermissionsCommandOutput = { + contents = de_DescribeApplicationAssociationsResult(data, context); + const response: DescribeApplicationAssociationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3535,51 +1881,39 @@ export const de_DescribeWorkspaceImagePermissionsCommand = async ( }; /** - * deserializeAws_json1_1DescribeWorkspaceImagePermissionsCommandError + * deserializeAws_json1_1DescribeApplicationsCommand */ -const de_DescribeWorkspaceImagePermissionsCommandError = async ( +export const de_DescribeApplicationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeApplicationsResult(data, context); + const response: DescribeApplicationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeWorkspaceImagesCommand + * deserializeAws_json1_1DescribeBundleAssociationsCommand */ -export const de_DescribeWorkspaceImagesCommand = async ( +export const de_DescribeBundleAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeWorkspaceImagesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeWorkspaceImagesResult(data, context); - const response: DescribeWorkspaceImagesCommandOutput = { + contents = de_DescribeBundleAssociationsResult(data, context); + const response: DescribeBundleAssociationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3587,45 +1921,39 @@ export const de_DescribeWorkspaceImagesCommand = async ( }; /** - * deserializeAws_json1_1DescribeWorkspaceImagesCommandError + * deserializeAws_json1_1DescribeClientBrandingCommand */ -const de_DescribeWorkspaceImagesCommandError = async ( +export const de_DescribeClientBrandingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeClientBrandingCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeWorkspacesCommand + * deserializeAws_json1_1DescribeClientPropertiesCommand */ -export const de_DescribeWorkspacesCommand = async ( +export const de_DescribeClientPropertiesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeWorkspacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeWorkspacesResult(data, context); - const response: DescribeWorkspacesCommandOutput = { + contents = _json(data); + const response: DescribeClientPropertiesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3633,48 +1961,39 @@ export const de_DescribeWorkspacesCommand = async ( }; /** - * deserializeAws_json1_1DescribeWorkspacesCommandError + * deserializeAws_json1_1DescribeConnectClientAddInsCommand */ -const de_DescribeWorkspacesCommandError = async ( +export const de_DescribeConnectClientAddInsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.workspaces#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeConnectClientAddInsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeWorkspacesConnectionStatusCommand + * deserializeAws_json1_1DescribeConnectionAliasesCommand */ -export const de_DescribeWorkspacesConnectionStatusCommand = async ( +export const de_DescribeConnectionAliasesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeWorkspacesConnectionStatusCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeWorkspacesConnectionStatusResult(data, context); - const response: DescribeWorkspacesConnectionStatusCommandOutput = { + contents = _json(data); + const response: DescribeConnectionAliasesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3682,45 +2001,39 @@ export const de_DescribeWorkspacesConnectionStatusCommand = async ( }; /** - * deserializeAws_json1_1DescribeWorkspacesConnectionStatusCommandError + * deserializeAws_json1_1DescribeConnectionAliasPermissionsCommand */ -const de_DescribeWorkspacesConnectionStatusCommandError = async ( +export const de_DescribeConnectionAliasPermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeConnectionAliasPermissionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DescribeWorkspaceSnapshotsCommand + * deserializeAws_json1_1DescribeImageAssociationsCommand */ -export const de_DescribeWorkspaceSnapshotsCommand = async ( +export const de_DescribeImageAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DescribeWorkspaceSnapshotsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DescribeWorkspaceSnapshotsResult(data, context); - const response: DescribeWorkspaceSnapshotsCommandOutput = { + contents = de_DescribeImageAssociationsResult(data, context); + const response: DescribeImageAssociationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3728,51 +2041,59 @@ export const de_DescribeWorkspaceSnapshotsCommand = async ( }; /** - * deserializeAws_json1_1DescribeWorkspaceSnapshotsCommandError + * deserializeAws_json1_1DescribeIpGroupsCommand */ -const de_DescribeWorkspaceSnapshotsCommandError = async ( +export const de_DescribeIpGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeIpGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DescribeTagsCommand + */ +export const de_DescribeTagsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeTagsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisassociateConnectionAliasCommand + * deserializeAws_json1_1DescribeWorkspaceAssociationsCommand */ -export const de_DisassociateConnectionAliasCommand = async ( +export const de_DescribeWorkspaceAssociationsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateConnectionAliasCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: DisassociateConnectionAliasCommandOutput = { + contents = de_DescribeWorkspaceAssociationsResult(data, context); + const response: DescribeWorkspaceAssociationsCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3780,57 +2101,39 @@ export const de_DisassociateConnectionAliasCommand = async ( }; /** - * deserializeAws_json1_1DisassociateConnectionAliasCommandError + * deserializeAws_json1_1DescribeWorkspaceBundlesCommand */ -const de_DisassociateConnectionAliasCommandError = async ( +export const de_DescribeWorkspaceBundlesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeWorkspaceBundlesResult(data, context); + const response: DescribeWorkspaceBundlesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisassociateIpGroupsCommand + * deserializeAws_json1_1DescribeWorkspaceDirectoriesCommand */ -export const de_DisassociateIpGroupsCommand = async ( +export const de_DescribeWorkspaceDirectoriesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateIpGroupsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: DisassociateIpGroupsCommandOutput = { + const response: DescribeWorkspaceDirectoriesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3838,54 +2141,39 @@ export const de_DisassociateIpGroupsCommand = async ( }; /** - * deserializeAws_json1_1DisassociateIpGroupsCommandError + * deserializeAws_json1_1DescribeWorkspaceImagePermissionsCommand */ -const de_DisassociateIpGroupsCommandError = async ( +export const de_DescribeWorkspaceImagePermissionsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DescribeWorkspaceImagePermissionsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1DisassociateWorkspaceApplicationCommand + * deserializeAws_json1_1DescribeWorkspaceImagesCommand */ -export const de_DisassociateWorkspaceApplicationCommand = async ( +export const de_DescribeWorkspaceImagesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_DisassociateWorkspaceApplicationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = de_DisassociateWorkspaceApplicationResult(data, context); - const response: DisassociateWorkspaceApplicationCommandOutput = { + contents = de_DescribeWorkspaceImagesResult(data, context); + const response: DescribeWorkspaceImagesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3893,57 +2181,39 @@ export const de_DisassociateWorkspaceApplicationCommand = async ( }; /** - * deserializeAws_json1_1DisassociateWorkspaceApplicationCommandError + * deserializeAws_json1_1DescribeWorkspacesCommand */ -const de_DisassociateWorkspaceApplicationCommandError = async ( +export const de_DescribeWorkspacesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceInUseException": - case "com.amazonaws.workspaces#ResourceInUseException": - throw await de_ResourceInUseExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeWorkspacesResult(data, context); + const response: DescribeWorkspacesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ImportClientBrandingCommand + * deserializeAws_json1_1DescribeWorkspacesConnectionStatusCommand */ -export const de_ImportClientBrandingCommand = async ( +export const de_DescribeWorkspacesConnectionStatusCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ImportClientBrandingCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); - const response: ImportClientBrandingCommandOutput = { + contents = de_DescribeWorkspacesConnectionStatusResult(data, context); + const response: DescribeWorkspacesConnectionStatusCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -3951,54 +2221,39 @@ export const de_ImportClientBrandingCommand = async ( }; /** - * deserializeAws_json1_1ImportClientBrandingCommandError + * deserializeAws_json1_1DescribeWorkspaceSnapshotsCommand */ -const de_ImportClientBrandingCommandError = async ( +export const de_DescribeWorkspaceSnapshotsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeWorkspaceSnapshotsResult(data, context); + const response: DescribeWorkspaceSnapshotsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ImportWorkspaceImageCommand + * deserializeAws_json1_1DisassociateConnectionAliasCommand */ -export const de_ImportWorkspaceImageCommand = async ( +export const de_DisassociateConnectionAliasCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ImportWorkspaceImageCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ImportWorkspaceImageCommandOutput = { + const response: DisassociateConnectionAliasCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4006,60 +2261,59 @@ export const de_ImportWorkspaceImageCommand = async ( }; /** - * deserializeAws_json1_1ImportWorkspaceImageCommandError + * deserializeAws_json1_1DisassociateIpGroupsCommand */ -const de_ImportWorkspaceImageCommandError = async ( +export const de_DisassociateIpGroupsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DisassociateIpGroupsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceAlreadyExistsException": - case "com.amazonaws.workspaces#ResourceAlreadyExistsException": - throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return response; +}; + +/** + * deserializeAws_json1_1DisassociateWorkspaceApplicationCommand + */ +export const de_DisassociateWorkspaceApplicationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DisassociateWorkspaceApplicationResult(data, context); + const response: DisassociateWorkspaceApplicationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1ListAvailableManagementCidrRangesCommand + * deserializeAws_json1_1ImportClientBrandingCommand */ -export const de_ListAvailableManagementCidrRangesCommand = async ( +export const de_ImportClientBrandingCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_ListAvailableManagementCidrRangesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: ListAvailableManagementCidrRangesCommandOutput = { + const response: ImportClientBrandingCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4067,48 +2321,39 @@ export const de_ListAvailableManagementCidrRangesCommand = async ( }; /** - * deserializeAws_json1_1ListAvailableManagementCidrRangesCommandError + * deserializeAws_json1_1ImportWorkspaceImageCommand */ -const de_ListAvailableManagementCidrRangesCommandError = async ( +export const de_ImportWorkspaceImageCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ImportWorkspaceImageCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** - * deserializeAws_json1_1MigrateWorkspaceCommand + * deserializeAws_json1_1ListAvailableManagementCidrRangesCommand */ -export const de_MigrateWorkspaceCommand = async ( +export const de_ListAvailableManagementCidrRangesCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode >= 300) { - return de_MigrateWorkspaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); - const response: MigrateWorkspaceCommandOutput = { + const response: ListAvailableManagementCidrRangesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, }; @@ -4116,44 +2361,23 @@ export const de_MigrateWorkspaceCommand = async ( }; /** - * deserializeAws_json1_1MigrateWorkspaceCommandError + * deserializeAws_json1_1MigrateWorkspaceCommand */ -const de_MigrateWorkspaceCommandError = async ( +export const de_MigrateWorkspaceCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationInProgressException": - case "com.amazonaws.workspaces#OperationInProgressException": - throw await de_OperationInProgressExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.workspaces#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + if (output.statusCode >= 300) { + return de_CommandError(output, context); } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: MigrateWorkspaceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; }; /** @@ -4164,7 +2388,7 @@ export const de_ModifyAccountCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyAccountCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4176,44 +2400,6 @@ export const de_ModifyAccountCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyAccountCommandError - */ -const de_ModifyAccountCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.workspaces#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifyCertificateBasedAuthPropertiesCommand */ @@ -4222,7 +2408,7 @@ export const de_ModifyCertificateBasedAuthPropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyCertificateBasedAuthPropertiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4234,41 +2420,6 @@ export const de_ModifyCertificateBasedAuthPropertiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyCertificateBasedAuthPropertiesCommandError - */ -const de_ModifyCertificateBasedAuthPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifyClientPropertiesCommand */ @@ -4277,7 +2428,7 @@ export const de_ModifyClientPropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyClientPropertiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4289,38 +2440,6 @@ export const de_ModifyClientPropertiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyClientPropertiesCommandError - */ -const de_ModifyClientPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifySamlPropertiesCommand */ @@ -4329,7 +2448,7 @@ export const de_ModifySamlPropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifySamlPropertiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4341,41 +2460,6 @@ export const de_ModifySamlPropertiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifySamlPropertiesCommandError - */ -const de_ModifySamlPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifySelfservicePermissionsCommand */ @@ -4384,48 +2468,16 @@ export const de_ModifySelfservicePermissionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifySelfservicePermissionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; contents = _json(data); const response: ModifySelfservicePermissionsCommandOutput = { $metadata: deserializeMetadata(output), - ...contents, - }; - return response; -}; - -/** - * deserializeAws_json1_1ModifySelfservicePermissionsCommandError - */ -const de_ModifySelfservicePermissionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } + ...contents, + }; + return response; }; /** @@ -4436,7 +2488,7 @@ export const de_ModifyWorkspaceAccessPropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyWorkspaceAccessPropertiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4448,35 +2500,6 @@ export const de_ModifyWorkspaceAccessPropertiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyWorkspaceAccessPropertiesCommandError - */ -const de_ModifyWorkspaceAccessPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifyWorkspaceCreationPropertiesCommand */ @@ -4485,7 +2508,7 @@ export const de_ModifyWorkspaceCreationPropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyWorkspaceCreationPropertiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4497,41 +2520,6 @@ export const de_ModifyWorkspaceCreationPropertiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyWorkspaceCreationPropertiesCommandError - */ -const de_ModifyWorkspaceCreationPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifyWorkspacePropertiesCommand */ @@ -4540,7 +2528,7 @@ export const de_ModifyWorkspacePropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyWorkspacePropertiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4552,50 +2540,6 @@ export const de_ModifyWorkspacePropertiesCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyWorkspacePropertiesCommandError - */ -const de_ModifyWorkspacePropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "OperationInProgressException": - case "com.amazonaws.workspaces#OperationInProgressException": - throw await de_OperationInProgressExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.workspaces#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - case "UnsupportedWorkspaceConfigurationException": - case "com.amazonaws.workspaces#UnsupportedWorkspaceConfigurationException": - throw await de_UnsupportedWorkspaceConfigurationExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1ModifyWorkspaceStateCommand */ @@ -4604,7 +2548,7 @@ export const de_ModifyWorkspaceStateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_ModifyWorkspaceStateCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4616,41 +2560,6 @@ export const de_ModifyWorkspaceStateCommand = async ( return response; }; -/** - * deserializeAws_json1_1ModifyWorkspaceStateCommandError - */ -const de_ModifyWorkspaceStateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RebootWorkspacesCommand */ @@ -4659,7 +2568,7 @@ export const de_RebootWorkspacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RebootWorkspacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4671,32 +2580,6 @@ export const de_RebootWorkspacesCommand = async ( return response; }; -/** - * deserializeAws_json1_1RebootWorkspacesCommandError - */ -const de_RebootWorkspacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RebuildWorkspacesCommand */ @@ -4705,7 +2588,7 @@ export const de_RebuildWorkspacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RebuildWorkspacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4717,32 +2600,6 @@ export const de_RebuildWorkspacesCommand = async ( return response; }; -/** - * deserializeAws_json1_1RebuildWorkspacesCommandError - */ -const de_RebuildWorkspacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RegisterWorkspaceDirectoryCommand */ @@ -4751,7 +2608,7 @@ export const de_RegisterWorkspaceDirectoryCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RegisterWorkspaceDirectoryCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4763,53 +2620,6 @@ export const de_RegisterWorkspaceDirectoryCommand = async ( return response; }; -/** - * deserializeAws_json1_1RegisterWorkspaceDirectoryCommandError - */ -const de_RegisterWorkspaceDirectoryCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "UnsupportedNetworkConfigurationException": - case "com.amazonaws.workspaces#UnsupportedNetworkConfigurationException": - throw await de_UnsupportedNetworkConfigurationExceptionRes(parsedOutput, context); - case "WorkspacesDefaultRoleNotFoundException": - case "com.amazonaws.workspaces#WorkspacesDefaultRoleNotFoundException": - throw await de_WorkspacesDefaultRoleNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RestoreWorkspaceCommand */ @@ -4818,7 +2628,7 @@ export const de_RestoreWorkspaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RestoreWorkspaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4830,41 +2640,6 @@ export const de_RestoreWorkspaceCommand = async ( return response; }; -/** - * deserializeAws_json1_1RestoreWorkspaceCommandError - */ -const de_RestoreWorkspaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1RevokeIpRulesCommand */ @@ -4873,7 +2648,7 @@ export const de_RevokeIpRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RevokeIpRulesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4885,41 +2660,6 @@ export const de_RevokeIpRulesCommand = async ( return response; }; -/** - * deserializeAws_json1_1RevokeIpRulesCommandError - */ -const de_RevokeIpRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1StartWorkspacesCommand */ @@ -4928,7 +2668,7 @@ export const de_StartWorkspacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StartWorkspacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4940,26 +2680,6 @@ export const de_StartWorkspacesCommand = async ( return response; }; -/** - * deserializeAws_json1_1StartWorkspacesCommandError - */ -const de_StartWorkspacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1StopWorkspacesCommand */ @@ -4968,7 +2688,7 @@ export const de_StopWorkspacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_StopWorkspacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -4980,26 +2700,6 @@ export const de_StopWorkspacesCommand = async ( return response; }; -/** - * deserializeAws_json1_1StopWorkspacesCommandError - */ -const de_StopWorkspacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1TerminateWorkspacesCommand */ @@ -5008,7 +2708,7 @@ export const de_TerminateWorkspacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_TerminateWorkspacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5020,26 +2720,6 @@ export const de_TerminateWorkspacesCommand = async ( return response; }; -/** - * deserializeAws_json1_1TerminateWorkspacesCommandError - */ -const de_TerminateWorkspacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1UpdateConnectClientAddInCommand */ @@ -5048,7 +2728,7 @@ export const de_UpdateConnectClientAddInCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateConnectClientAddInCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5060,38 +2740,6 @@ export const de_UpdateConnectClientAddInCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateConnectClientAddInCommandError - */ -const de_UpdateConnectClientAddInCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateConnectionAliasPermissionCommand */ @@ -5100,7 +2748,7 @@ export const de_UpdateConnectionAliasPermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateConnectionAliasPermissionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5112,50 +2760,6 @@ export const de_UpdateConnectionAliasPermissionCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateConnectionAliasPermissionCommandError - */ -const de_UpdateConnectionAliasPermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceAssociatedException": - case "com.amazonaws.workspaces#ResourceAssociatedException": - throw await de_ResourceAssociatedExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateRulesOfIpGroupCommand */ @@ -5164,7 +2768,7 @@ export const de_UpdateRulesOfIpGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateRulesOfIpGroupCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5176,44 +2780,6 @@ export const de_UpdateRulesOfIpGroupCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateRulesOfIpGroupCommandError - */ -const de_UpdateRulesOfIpGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "InvalidResourceStateException": - case "com.amazonaws.workspaces#InvalidResourceStateException": - throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); - case "ResourceLimitExceededException": - case "com.amazonaws.workspaces#ResourceLimitExceededException": - throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateWorkspaceBundleCommand */ @@ -5222,7 +2788,7 @@ export const de_UpdateWorkspaceBundleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateWorkspaceBundleCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5234,44 +2800,6 @@ export const de_UpdateWorkspaceBundleCommand = async ( return response; }; -/** - * deserializeAws_json1_1UpdateWorkspaceBundleCommandError - */ -const de_UpdateWorkspaceBundleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "AccessDeniedException": - case "com.amazonaws.workspaces#AccessDeniedException": - throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "InvalidParameterValuesException": - case "com.amazonaws.workspaces#InvalidParameterValuesException": - throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); - case "OperationNotSupportedException": - case "com.amazonaws.workspaces#OperationNotSupportedException": - throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.workspaces#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ResourceUnavailableException": - case "com.amazonaws.workspaces#ResourceUnavailableException": - throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1UpdateWorkspaceImagePermissionCommand */ @@ -5280,7 +2808,7 @@ export const de_UpdateWorkspaceImagePermissionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_UpdateWorkspaceImagePermissionCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -5293,12 +2821,9 @@ export const de_UpdateWorkspaceImagePermissionCommand = async ( }; /** - * deserializeAws_json1_1UpdateWorkspaceImagePermissionCommandError + * deserialize_Aws_json1_1CommandError */ -const de_UpdateWorkspaceImagePermissionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -5311,22 +2836,64 @@ const de_UpdateWorkspaceImagePermissionCommandError = async ( case "InvalidParameterValuesException": case "com.amazonaws.workspaces#InvalidParameterValuesException": throw await de_InvalidParameterValuesExceptionRes(parsedOutput, context); + case "InvalidResourceStateException": + case "com.amazonaws.workspaces#InvalidResourceStateException": + throw await de_InvalidResourceStateExceptionRes(parsedOutput, context); case "OperationNotSupportedException": case "com.amazonaws.workspaces#OperationNotSupportedException": throw await de_OperationNotSupportedExceptionRes(parsedOutput, context); + case "ResourceAssociatedException": + case "com.amazonaws.workspaces#ResourceAssociatedException": + throw await de_ResourceAssociatedExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.workspaces#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ResourceLimitExceededException": + case "com.amazonaws.workspaces#ResourceLimitExceededException": + throw await de_ResourceLimitExceededExceptionRes(parsedOutput, context); + case "ApplicationNotSupportedException": + case "com.amazonaws.workspaces#ApplicationNotSupportedException": + throw await de_ApplicationNotSupportedExceptionRes(parsedOutput, context); + case "ComputeNotCompatibleException": + case "com.amazonaws.workspaces#ComputeNotCompatibleException": + throw await de_ComputeNotCompatibleExceptionRes(parsedOutput, context); + case "IncompatibleApplicationsException": + case "com.amazonaws.workspaces#IncompatibleApplicationsException": + throw await de_IncompatibleApplicationsExceptionRes(parsedOutput, context); + case "OperatingSystemNotCompatibleException": + case "com.amazonaws.workspaces#OperatingSystemNotCompatibleException": + throw await de_OperatingSystemNotCompatibleExceptionRes(parsedOutput, context); + case "ResourceAlreadyExistsException": + case "com.amazonaws.workspaces#ResourceAlreadyExistsException": + throw await de_ResourceAlreadyExistsExceptionRes(parsedOutput, context); + case "ResourceInUseException": + case "com.amazonaws.workspaces#ResourceInUseException": + throw await de_ResourceInUseExceptionRes(parsedOutput, context); case "ResourceUnavailableException": case "com.amazonaws.workspaces#ResourceUnavailableException": throw await de_ResourceUnavailableExceptionRes(parsedOutput, context); + case "ResourceCreationFailedException": + case "com.amazonaws.workspaces#ResourceCreationFailedException": + throw await de_ResourceCreationFailedExceptionRes(parsedOutput, context); + case "OperationInProgressException": + case "com.amazonaws.workspaces#OperationInProgressException": + throw await de_OperationInProgressExceptionRes(parsedOutput, context); + case "UnsupportedWorkspaceConfigurationException": + case "com.amazonaws.workspaces#UnsupportedWorkspaceConfigurationException": + throw await de_UnsupportedWorkspaceConfigurationExceptionRes(parsedOutput, context); + case "UnsupportedNetworkConfigurationException": + case "com.amazonaws.workspaces#UnsupportedNetworkConfigurationException": + throw await de_UnsupportedNetworkConfigurationExceptionRes(parsedOutput, context); + case "WorkspacesDefaultRoleNotFoundException": + case "com.amazonaws.workspaces#WorkspacesDefaultRoleNotFoundException": + throw await de_WorkspacesDefaultRoleNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/clients/client-xray/src/protocols/Aws_restJson1.ts b/clients/client-xray/src/protocols/Aws_restJson1.ts index ce8d84448632..cdbdfe7854fc 100644 --- a/clients/client-xray/src/protocols/Aws_restJson1.ts +++ b/clients/client-xray/src/protocols/Aws_restJson1.ts @@ -844,7 +844,7 @@ export const de_BatchGetTracesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BatchGetTracesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -859,35 +859,6 @@ export const de_BatchGetTracesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1BatchGetTracesCommandError - */ -const de_BatchGetTracesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateGroupCommand */ @@ -896,7 +867,7 @@ export const de_CreateGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -909,35 +880,6 @@ export const de_CreateGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateGroupCommandError - */ -const de_CreateGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1CreateSamplingRuleCommand */ @@ -946,7 +888,7 @@ export const de_CreateSamplingRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_CreateSamplingRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -959,38 +901,6 @@ export const de_CreateSamplingRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1CreateSamplingRuleCommandError - */ -const de_CreateSamplingRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "RuleLimitExceededException": - case "com.amazonaws.xray#RuleLimitExceededException": - throw await de_RuleLimitExceededExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteGroupCommand */ @@ -999,7 +909,7 @@ export const de_DeleteGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1008,35 +918,6 @@ export const de_DeleteGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteGroupCommandError - */ -const de_DeleteGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteResourcePolicyCommand */ @@ -1045,7 +926,7 @@ export const de_DeleteResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1054,38 +935,6 @@ export const de_DeleteResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteResourcePolicyCommandError - */ -const de_DeleteResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidPolicyRevisionIdException": - case "com.amazonaws.xray#InvalidPolicyRevisionIdException": - throw await de_InvalidPolicyRevisionIdExceptionRes(parsedOutput, context); - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1DeleteSamplingRuleCommand */ @@ -1094,7 +943,7 @@ export const de_DeleteSamplingRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DeleteSamplingRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1107,35 +956,6 @@ export const de_DeleteSamplingRuleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DeleteSamplingRuleCommandError - */ -const de_DeleteSamplingRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetEncryptionConfigCommand */ @@ -1144,7 +964,7 @@ export const de_GetEncryptionConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetEncryptionConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1157,35 +977,6 @@ export const de_GetEncryptionConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetEncryptionConfigCommandError - */ -const de_GetEncryptionConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGroupCommand */ @@ -1194,7 +985,7 @@ export const de_GetGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1207,35 +998,6 @@ export const de_GetGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetGroupCommandError - */ -const de_GetGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetGroupsCommand */ @@ -1244,7 +1006,7 @@ export const de_GetGroupsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetGroupsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1259,144 +1021,57 @@ export const de_GetGroupsCommand = async ( }; /** - * deserializeAws_restJson1GetGroupsCommandError + * deserializeAws_restJson1GetInsightCommand */ -const de_GetGroupsCommandError = async ( +export const de_GetInsightCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + Insight: (_) => de_Insight(_, context), + }); + Object.assign(contents, doc); + return contents; }; /** - * deserializeAws_restJson1GetInsightCommand + * deserializeAws_restJson1GetInsightEventsCommand */ -export const de_GetInsightCommand = async ( +export const de_GetInsightEventsCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInsightCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), }); const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); const doc = take(data, { - Insight: (_) => de_Insight(_, context), + InsightEvents: (_) => de_InsightEventList(_, context), + NextToken: __expectString, }); Object.assign(contents, doc); return contents; }; /** - * deserializeAws_restJson1GetInsightCommandError - */ -const de_GetInsightCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetInsightEventsCommand - */ -export const de_GetInsightEventsCommand = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInsightEventsCommandError(output, context); - } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); - const doc = take(data, { - InsightEvents: (_) => de_InsightEventList(_, context), - NextToken: __expectString, - }); - Object.assign(contents, doc); - return contents; -}; - -/** - * deserializeAws_restJson1GetInsightEventsCommandError - */ -const de_GetInsightEventsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - -/** - * deserializeAws_restJson1GetInsightImpactGraphCommand + * deserializeAws_restJson1GetInsightImpactGraphCommand */ export const de_GetInsightImpactGraphCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInsightImpactGraphCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1415,35 +1090,6 @@ export const de_GetInsightImpactGraphCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetInsightImpactGraphCommandError - */ -const de_GetInsightImpactGraphCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetInsightSummariesCommand */ @@ -1452,7 +1098,7 @@ export const de_GetInsightSummariesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetInsightSummariesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1466,35 +1112,6 @@ export const de_GetInsightSummariesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetInsightSummariesCommandError - */ -const de_GetInsightSummariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSamplingRulesCommand */ @@ -1503,7 +1120,7 @@ export const de_GetSamplingRulesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSamplingRulesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1517,35 +1134,6 @@ export const de_GetSamplingRulesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSamplingRulesCommandError - */ -const de_GetSamplingRulesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSamplingStatisticSummariesCommand */ @@ -1554,7 +1142,7 @@ export const de_GetSamplingStatisticSummariesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSamplingStatisticSummariesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1568,35 +1156,6 @@ export const de_GetSamplingStatisticSummariesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSamplingStatisticSummariesCommandError - */ -const de_GetSamplingStatisticSummariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetSamplingTargetsCommand */ @@ -1605,7 +1164,7 @@ export const de_GetSamplingTargetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetSamplingTargetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1620,35 +1179,6 @@ export const de_GetSamplingTargetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetSamplingTargetsCommandError - */ -const de_GetSamplingTargetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetServiceGraphCommand */ @@ -1657,7 +1187,7 @@ export const de_GetServiceGraphCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetServiceGraphCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1674,35 +1204,6 @@ export const de_GetServiceGraphCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetServiceGraphCommandError - */ -const de_GetServiceGraphCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTimeSeriesServiceStatisticsCommand */ @@ -1711,7 +1212,7 @@ export const de_GetTimeSeriesServiceStatisticsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTimeSeriesServiceStatisticsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1726,35 +1227,6 @@ export const de_GetTimeSeriesServiceStatisticsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTimeSeriesServiceStatisticsCommandError - */ -const de_GetTimeSeriesServiceStatisticsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTraceGraphCommand */ @@ -1763,7 +1235,7 @@ export const de_GetTraceGraphCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTraceGraphCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1777,35 +1249,6 @@ export const de_GetTraceGraphCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTraceGraphCommandError - */ -const de_GetTraceGraphCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1GetTraceSummariesCommand */ @@ -1814,7 +1257,7 @@ export const de_GetTraceSummariesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GetTraceSummariesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1830,35 +1273,6 @@ export const de_GetTraceSummariesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GetTraceSummariesCommandError - */ -const de_GetTraceSummariesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListResourcePoliciesCommand */ @@ -1867,7 +1281,7 @@ export const de_ListResourcePoliciesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListResourcePoliciesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1881,35 +1295,6 @@ export const de_ListResourcePoliciesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListResourcePoliciesCommandError - */ -const de_ListResourcePoliciesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1ListTagsForResourceCommand */ @@ -1918,7 +1303,7 @@ export const de_ListTagsForResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ListTagsForResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1932,38 +1317,6 @@ export const de_ListTagsForResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ListTagsForResourceCommandError - */ -const de_ListTagsForResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.xray#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutEncryptionConfigCommand */ @@ -1972,7 +1325,7 @@ export const de_PutEncryptionConfigCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutEncryptionConfigCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1985,35 +1338,6 @@ export const de_PutEncryptionConfigCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutEncryptionConfigCommandError - */ -const de_PutEncryptionConfigCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutResourcePolicyCommand */ @@ -2022,7 +1346,7 @@ export const de_PutResourcePolicyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutResourcePolicyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2035,47 +1359,6 @@ export const de_PutResourcePolicyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutResourcePolicyCommandError - */ -const de_PutResourcePolicyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidPolicyRevisionIdException": - case "com.amazonaws.xray#InvalidPolicyRevisionIdException": - throw await de_InvalidPolicyRevisionIdExceptionRes(parsedOutput, context); - case "LockoutPreventionException": - case "com.amazonaws.xray#LockoutPreventionException": - throw await de_LockoutPreventionExceptionRes(parsedOutput, context); - case "MalformedPolicyDocumentException": - case "com.amazonaws.xray#MalformedPolicyDocumentException": - throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); - case "PolicyCountLimitExceededException": - case "com.amazonaws.xray#PolicyCountLimitExceededException": - throw await de_PolicyCountLimitExceededExceptionRes(parsedOutput, context); - case "PolicySizeLimitExceededException": - case "com.amazonaws.xray#PolicySizeLimitExceededException": - throw await de_PolicySizeLimitExceededExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutTelemetryRecordsCommand */ @@ -2084,7 +1367,7 @@ export const de_PutTelemetryRecordsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutTelemetryRecordsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2093,35 +1376,6 @@ export const de_PutTelemetryRecordsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutTelemetryRecordsCommandError - */ -const de_PutTelemetryRecordsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1PutTraceSegmentsCommand */ @@ -2130,7 +1384,7 @@ export const de_PutTraceSegmentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutTraceSegmentsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2143,35 +1397,6 @@ export const de_PutTraceSegmentsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutTraceSegmentsCommandError - */ -const de_PutTraceSegmentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1TagResourceCommand */ @@ -2180,7 +1405,7 @@ export const de_TagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2189,41 +1414,6 @@ export const de_TagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TagResourceCommandError - */ -const de_TagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.xray#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - case "TooManyTagsException": - case "com.amazonaws.xray#TooManyTagsException": - throw await de_TooManyTagsExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UntagResourceCommand */ @@ -2232,7 +1422,7 @@ export const de_UntagResourceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UntagResourceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2241,38 +1431,6 @@ export const de_UntagResourceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UntagResourceCommandError - */ -const de_UntagResourceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ResourceNotFoundException": - case "com.amazonaws.xray#ResourceNotFoundException": - throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateGroupCommand */ @@ -2281,7 +1439,7 @@ export const de_UpdateGroupCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateGroupCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2294,35 +1452,6 @@ export const de_UpdateGroupCommand = async ( return contents; }; -/** - * deserializeAws_restJson1UpdateGroupCommandError - */ -const de_UpdateGroupCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "InvalidRequestException": - case "com.amazonaws.xray#InvalidRequestException": - throw await de_InvalidRequestExceptionRes(parsedOutput, context); - case "ThrottledException": - case "com.amazonaws.xray#ThrottledException": - throw await de_ThrottledExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1UpdateSamplingRuleCommand */ @@ -2331,7 +1460,7 @@ export const de_UpdateSamplingRuleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UpdateSamplingRuleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2345,12 +1474,9 @@ export const de_UpdateSamplingRuleCommand = async ( }; /** - * deserializeAws_restJson1UpdateSamplingRuleCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UpdateSamplingRuleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2363,13 +1489,37 @@ const de_UpdateSamplingRuleCommandError = async ( case "ThrottledException": case "com.amazonaws.xray#ThrottledException": throw await de_ThrottledExceptionRes(parsedOutput, context); + case "RuleLimitExceededException": + case "com.amazonaws.xray#RuleLimitExceededException": + throw await de_RuleLimitExceededExceptionRes(parsedOutput, context); + case "InvalidPolicyRevisionIdException": + case "com.amazonaws.xray#InvalidPolicyRevisionIdException": + throw await de_InvalidPolicyRevisionIdExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.xray#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "LockoutPreventionException": + case "com.amazonaws.xray#LockoutPreventionException": + throw await de_LockoutPreventionExceptionRes(parsedOutput, context); + case "MalformedPolicyDocumentException": + case "com.amazonaws.xray#MalformedPolicyDocumentException": + throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context); + case "PolicyCountLimitExceededException": + case "com.amazonaws.xray#PolicyCountLimitExceededException": + throw await de_PolicyCountLimitExceededExceptionRes(parsedOutput, context); + case "PolicySizeLimitExceededException": + case "com.amazonaws.xray#PolicySizeLimitExceededException": + throw await de_PolicySizeLimitExceededExceptionRes(parsedOutput, context); + case "TooManyTagsException": + case "com.amazonaws.xray#TooManyTagsException": + throw await de_TooManyTagsExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/private/aws-echo-service/src/protocols/Aws_restJson1.ts b/private/aws-echo-service/src/protocols/Aws_restJson1.ts index 240fb1861d37..93e01d2fa891 100644 --- a/private/aws-echo-service/src/protocols/Aws_restJson1.ts +++ b/private/aws-echo-service/src/protocols/Aws_restJson1.ts @@ -1,20 +1,16 @@ // smithy-typescript generated code -import { EchoCommandInput, EchoCommandOutput } from "../commands/EchoCommand"; -import { LengthCommandInput, LengthCommandOutput } from "../commands/LengthCommand"; -import { EchoServiceServiceException as __BaseException } from "../models/EchoServiceServiceException"; -import { PalindromeException } from "../models/models_0"; import { requestBuilder as rb } from "@smithy/core"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { + _json, + collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, - resolvedPath as __resolvedPath, - _json, - collectBody, map, + resolvedPath as __resolvedPath, take, withBaseException, } from "@smithy/smithy-client"; @@ -25,6 +21,11 @@ import { } from "@smithy/types"; import { v4 as generateIdempotencyToken } from "uuid"; +import { EchoCommandInput, EchoCommandOutput } from "../commands/EchoCommand"; +import { LengthCommandInput, LengthCommandOutput } from "../commands/LengthCommand"; +import { EchoServiceServiceException as __BaseException } from "../models/EchoServiceServiceException"; +import { PalindromeException } from "../models/models_0"; + /** * serializeAws_restJson1EchoCommand */ @@ -62,7 +63,7 @@ export const se_LengthCommand = async (input: LengthCommandInput, context: __Ser */ export const de_EchoCommand = async (output: __HttpResponse, context: __SerdeContext): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EchoCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -75,29 +76,6 @@ export const de_EchoCommand = async (output: __HttpResponse, context: __SerdeCon return contents; }; -/** - * deserializeAws_restJson1EchoCommandError - */ -const de_EchoCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "PalindromeException": - case "aws.test.generic#PalindromeException": - throw await de_PalindromeExceptionRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1LengthCommand */ @@ -106,7 +84,7 @@ export const de_LengthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_LengthCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -120,9 +98,9 @@ export const de_LengthCommand = async ( }; /** - * deserializeAws_restJson1LengthCommandError + * deserialize_Aws_restJson1CommandError */ -const de_LengthCommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -138,7 +116,7 @@ const de_LengthCommandError = async (output: __HttpResponse, context: __SerdeCon output, parsedBody, errorCode, - }); + }) as never; } }; diff --git a/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts b/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts index bb464c596d35..e2e0529d38dd 100644 --- a/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts +++ b/private/aws-protocoltests-ec2/src/protocols/Aws_ec2.ts @@ -534,7 +534,7 @@ export const de_DatetimeOffsetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DatetimeOffsetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -546,26 +546,6 @@ export const de_DatetimeOffsetsCommand = async ( return response; }; -/** - * deserializeAws_ec2DatetimeOffsetsCommandError - */ -const de_DatetimeOffsetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EmptyInputAndEmptyOutputCommand */ @@ -574,7 +554,7 @@ export const de_EmptyInputAndEmptyOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EmptyInputAndEmptyOutputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -586,26 +566,6 @@ export const de_EmptyInputAndEmptyOutputCommand = async ( return response; }; -/** - * deserializeAws_ec2EmptyInputAndEmptyOutputCommandError - */ -const de_EmptyInputAndEmptyOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EndpointOperationCommand */ @@ -614,7 +574,7 @@ export const de_EndpointOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EndpointOperationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: EndpointOperationCommandOutput = { @@ -623,26 +583,6 @@ export const de_EndpointOperationCommand = async ( return response; }; -/** - * deserializeAws_ec2EndpointOperationCommandError - */ -const de_EndpointOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2EndpointWithHostLabelOperationCommand */ @@ -651,7 +591,7 @@ export const de_EndpointWithHostLabelOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EndpointWithHostLabelOperationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: EndpointWithHostLabelOperationCommandOutput = { @@ -660,26 +600,6 @@ export const de_EndpointWithHostLabelOperationCommand = async ( return response; }; -/** - * deserializeAws_ec2EndpointWithHostLabelOperationCommandError - */ -const de_EndpointWithHostLabelOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2FractionalSecondsCommand */ @@ -688,7 +608,7 @@ export const de_FractionalSecondsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_FractionalSecondsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -700,26 +620,6 @@ export const de_FractionalSecondsCommand = async ( return response; }; -/** - * deserializeAws_ec2FractionalSecondsCommandError - */ -const de_FractionalSecondsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2GreetingWithErrorsCommand */ @@ -728,7 +628,7 @@ export const de_GreetingWithErrorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GreetingWithErrorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -740,35 +640,6 @@ export const de_GreetingWithErrorsCommand = async ( return response; }; -/** - * deserializeAws_ec2GreetingWithErrorsCommandError - */ -const de_GreetingWithErrorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ComplexError": - case "aws.protocoltests.ec2#ComplexError": - throw await de_ComplexErrorRes(parsedOutput, context); - case "InvalidGreeting": - case "aws.protocoltests.ec2#InvalidGreeting": - throw await de_InvalidGreetingRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); - } -}; - /** * deserializeAws_ec2HostWithPathOperationCommand */ @@ -777,7 +648,7 @@ export const de_HostWithPathOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_HostWithPathOperationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: HostWithPathOperationCommandOutput = { @@ -786,26 +657,6 @@ export const de_HostWithPathOperationCommand = async ( return response; }; -/** - * deserializeAws_ec2HostWithPathOperationCommandError - */ -const de_HostWithPathOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2IgnoresWrappingXmlNameCommand */ @@ -814,7 +665,7 @@ export const de_IgnoresWrappingXmlNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_IgnoresWrappingXmlNameCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -826,26 +677,6 @@ export const de_IgnoresWrappingXmlNameCommand = async ( return response; }; -/** - * deserializeAws_ec2IgnoresWrappingXmlNameCommandError - */ -const de_IgnoresWrappingXmlNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2NestedStructuresCommand */ @@ -854,7 +685,7 @@ export const de_NestedStructuresCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_NestedStructuresCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: NestedStructuresCommandOutput = { @@ -863,26 +694,6 @@ export const de_NestedStructuresCommand = async ( return response; }; -/** - * deserializeAws_ec2NestedStructuresCommandError - */ -const de_NestedStructuresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2NoInputAndOutputCommand */ @@ -891,7 +702,7 @@ export const de_NoInputAndOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_NoInputAndOutputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -903,26 +714,6 @@ export const de_NoInputAndOutputCommand = async ( return response; }; -/** - * deserializeAws_ec2NoInputAndOutputCommandError - */ -const de_NoInputAndOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2PutWithContentEncodingCommand */ @@ -931,7 +722,7 @@ export const de_PutWithContentEncodingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutWithContentEncodingCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutWithContentEncodingCommandOutput = { @@ -940,26 +731,6 @@ export const de_PutWithContentEncodingCommand = async ( return response; }; -/** - * deserializeAws_ec2PutWithContentEncodingCommandError - */ -const de_PutWithContentEncodingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2QueryIdempotencyTokenAutoFillCommand */ @@ -968,7 +739,7 @@ export const de_QueryIdempotencyTokenAutoFillCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_QueryIdempotencyTokenAutoFillCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: QueryIdempotencyTokenAutoFillCommandOutput = { @@ -977,26 +748,6 @@ export const de_QueryIdempotencyTokenAutoFillCommand = async ( return response; }; -/** - * deserializeAws_ec2QueryIdempotencyTokenAutoFillCommandError - */ -const de_QueryIdempotencyTokenAutoFillCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2QueryListsCommand */ @@ -1005,7 +756,7 @@ export const de_QueryListsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_QueryListsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: QueryListsCommandOutput = { @@ -1014,26 +765,6 @@ export const de_QueryListsCommand = async ( return response; }; -/** - * deserializeAws_ec2QueryListsCommandError - */ -const de_QueryListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2QueryTimestampsCommand */ @@ -1042,7 +773,7 @@ export const de_QueryTimestampsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_QueryTimestampsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: QueryTimestampsCommandOutput = { @@ -1051,26 +782,6 @@ export const de_QueryTimestampsCommand = async ( return response; }; -/** - * deserializeAws_ec2QueryTimestampsCommandError - */ -const de_QueryTimestampsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2RecursiveXmlShapesCommand */ @@ -1079,7 +790,7 @@ export const de_RecursiveXmlShapesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RecursiveXmlShapesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1091,26 +802,6 @@ export const de_RecursiveXmlShapesCommand = async ( return response; }; -/** - * deserializeAws_ec2RecursiveXmlShapesCommandError - */ -const de_RecursiveXmlShapesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2SimpleInputParamsCommand */ @@ -1119,7 +810,7 @@ export const de_SimpleInputParamsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SimpleInputParamsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SimpleInputParamsCommandOutput = { @@ -1128,26 +819,6 @@ export const de_SimpleInputParamsCommand = async ( return response; }; -/** - * deserializeAws_ec2SimpleInputParamsCommandError - */ -const de_SimpleInputParamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2SimpleScalarXmlPropertiesCommand */ @@ -1156,7 +827,7 @@ export const de_SimpleScalarXmlPropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SimpleScalarXmlPropertiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1168,26 +839,6 @@ export const de_SimpleScalarXmlPropertiesCommand = async ( return response; }; -/** - * deserializeAws_ec2SimpleScalarXmlPropertiesCommandError - */ -const de_SimpleScalarXmlPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2XmlBlobsCommand */ @@ -1196,7 +847,7 @@ export const de_XmlBlobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlBlobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1208,26 +859,6 @@ export const de_XmlBlobsCommand = async ( return response; }; -/** - * deserializeAws_ec2XmlBlobsCommandError - */ -const de_XmlBlobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2XmlEmptyBlobsCommand */ @@ -1236,7 +867,7 @@ export const de_XmlEmptyBlobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlEmptyBlobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1248,26 +879,6 @@ export const de_XmlEmptyBlobsCommand = async ( return response; }; -/** - * deserializeAws_ec2XmlEmptyBlobsCommandError - */ -const de_XmlEmptyBlobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2XmlEmptyListsCommand */ @@ -1276,7 +887,7 @@ export const de_XmlEmptyListsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlEmptyListsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1288,26 +899,6 @@ export const de_XmlEmptyListsCommand = async ( return response; }; -/** - * deserializeAws_ec2XmlEmptyListsCommandError - */ -const de_XmlEmptyListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2XmlEnumsCommand */ @@ -1316,7 +907,7 @@ export const de_XmlEnumsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlEnumsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1328,26 +919,6 @@ export const de_XmlEnumsCommand = async ( return response; }; -/** - * deserializeAws_ec2XmlEnumsCommandError - */ -const de_XmlEnumsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2XmlIntEnumsCommand */ @@ -1356,7 +927,7 @@ export const de_XmlIntEnumsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlIntEnumsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1368,26 +939,6 @@ export const de_XmlIntEnumsCommand = async ( return response; }; -/** - * deserializeAws_ec2XmlIntEnumsCommandError - */ -const de_XmlIntEnumsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2XmlListsCommand */ @@ -1396,7 +947,7 @@ export const de_XmlListsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlListsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1408,26 +959,6 @@ export const de_XmlListsCommand = async ( return response; }; -/** - * deserializeAws_ec2XmlListsCommandError - */ -const de_XmlListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2XmlNamespacesCommand */ @@ -1436,7 +967,7 @@ export const de_XmlNamespacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlNamespacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1448,26 +979,6 @@ export const de_XmlNamespacesCommand = async ( return response; }; -/** - * deserializeAws_ec2XmlNamespacesCommandError - */ -const de_XmlNamespacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); -}; - /** * deserializeAws_ec2XmlTimestampsCommand */ @@ -1476,7 +987,7 @@ export const de_XmlTimestampsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlTimestampsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1489,23 +1000,29 @@ export const de_XmlTimestampsCommand = async ( }; /** - * deserializeAws_ec2XmlTimestampsCommandError + * deserialize_Aws_ec2CommandError */ -const de_XmlTimestampsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadEc2ErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Errors.Error, - errorCode, - }); + switch (errorCode) { + case "ComplexError": + case "aws.protocoltests.ec2#ComplexError": + throw await de_ComplexErrorRes(parsedOutput, context); + case "InvalidGreeting": + case "aws.protocoltests.ec2#InvalidGreeting": + throw await de_InvalidGreetingRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody: parsedBody.Errors.Error, + errorCode, + }) as never; + } }; /** diff --git a/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts b/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts index 3e2ee9d4fb64..af4bd5244716 100644 --- a/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts +++ b/private/aws-protocoltests-json-10/src/protocols/Aws_json1_0.ts @@ -286,7 +286,7 @@ export const de_EmptyInputAndEmptyOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EmptyInputAndEmptyOutputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -298,26 +298,6 @@ export const de_EmptyInputAndEmptyOutputCommand = async ( return response; }; -/** - * deserializeAws_json1_0EmptyInputAndEmptyOutputCommandError - */ -const de_EmptyInputAndEmptyOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_0EndpointOperationCommand */ @@ -326,7 +306,7 @@ export const de_EndpointOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EndpointOperationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: EndpointOperationCommandOutput = { @@ -335,26 +315,6 @@ export const de_EndpointOperationCommand = async ( return response; }; -/** - * deserializeAws_json1_0EndpointOperationCommandError - */ -const de_EndpointOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_0EndpointWithHostLabelOperationCommand */ @@ -363,7 +323,7 @@ export const de_EndpointWithHostLabelOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EndpointWithHostLabelOperationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: EndpointWithHostLabelOperationCommandOutput = { @@ -372,26 +332,6 @@ export const de_EndpointWithHostLabelOperationCommand = async ( return response; }; -/** - * deserializeAws_json1_0EndpointWithHostLabelOperationCommandError - */ -const de_EndpointWithHostLabelOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_0GreetingWithErrorsCommand */ @@ -400,7 +340,7 @@ export const de_GreetingWithErrorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GreetingWithErrorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -412,38 +352,6 @@ export const de_GreetingWithErrorsCommand = async ( return response; }; -/** - * deserializeAws_json1_0GreetingWithErrorsCommandError - */ -const de_GreetingWithErrorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ComplexError": - case "aws.protocoltests.json10#ComplexError": - throw await de_ComplexErrorRes(parsedOutput, context); - case "FooError": - case "aws.protocoltests.json10#FooError": - throw await de_FooErrorRes(parsedOutput, context); - case "InvalidGreeting": - case "aws.protocoltests.json10#InvalidGreeting": - throw await de_InvalidGreetingRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_0HostWithPathOperationCommand */ @@ -452,7 +360,7 @@ export const de_HostWithPathOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_HostWithPathOperationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: HostWithPathOperationCommandOutput = { @@ -461,26 +369,6 @@ export const de_HostWithPathOperationCommand = async ( return response; }; -/** - * deserializeAws_json1_0HostWithPathOperationCommandError - */ -const de_HostWithPathOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_0JsonUnionsCommand */ @@ -489,7 +377,7 @@ export const de_JsonUnionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_JsonUnionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -501,26 +389,6 @@ export const de_JsonUnionsCommand = async ( return response; }; -/** - * deserializeAws_json1_0JsonUnionsCommandError - */ -const de_JsonUnionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_0NoInputAndNoOutputCommand */ @@ -529,7 +397,7 @@ export const de_NoInputAndNoOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_NoInputAndNoOutputCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: NoInputAndNoOutputCommandOutput = { @@ -538,26 +406,6 @@ export const de_NoInputAndNoOutputCommand = async ( return response; }; -/** - * deserializeAws_json1_0NoInputAndNoOutputCommandError - */ -const de_NoInputAndNoOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_0NoInputAndOutputCommand */ @@ -566,7 +414,7 @@ export const de_NoInputAndOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_NoInputAndOutputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -578,26 +426,6 @@ export const de_NoInputAndOutputCommand = async ( return response; }; -/** - * deserializeAws_json1_0NoInputAndOutputCommandError - */ -const de_NoInputAndOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_0OperationWithDefaultsCommand */ @@ -606,7 +434,7 @@ export const de_OperationWithDefaultsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_OperationWithDefaultsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -618,26 +446,6 @@ export const de_OperationWithDefaultsCommand = async ( return response; }; -/** - * deserializeAws_json1_0OperationWithDefaultsCommandError - */ -const de_OperationWithDefaultsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_0OperationWithNestedStructureCommand */ @@ -646,7 +454,7 @@ export const de_OperationWithNestedStructureCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_OperationWithNestedStructureCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -658,26 +466,6 @@ export const de_OperationWithNestedStructureCommand = async ( return response; }; -/** - * deserializeAws_json1_0OperationWithNestedStructureCommandError - */ -const de_OperationWithNestedStructureCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_0OperationWithRequiredMembersCommand */ @@ -686,7 +474,7 @@ export const de_OperationWithRequiredMembersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_OperationWithRequiredMembersCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -698,26 +486,6 @@ export const de_OperationWithRequiredMembersCommand = async ( return response; }; -/** - * deserializeAws_json1_0OperationWithRequiredMembersCommandError - */ -const de_OperationWithRequiredMembersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_0PutWithContentEncodingCommand */ @@ -726,7 +494,7 @@ export const de_PutWithContentEncodingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutWithContentEncodingCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutWithContentEncodingCommandOutput = { @@ -735,26 +503,6 @@ export const de_PutWithContentEncodingCommand = async ( return response; }; -/** - * deserializeAws_json1_0PutWithContentEncodingCommandError - */ -const de_PutWithContentEncodingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_0SimpleScalarPropertiesCommand */ @@ -763,7 +511,7 @@ export const de_SimpleScalarPropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SimpleScalarPropertiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -776,23 +524,32 @@ export const de_SimpleScalarPropertiesCommand = async ( }; /** - * deserializeAws_json1_0SimpleScalarPropertiesCommandError + * deserialize_Aws_json1_0CommandError */ -const de_SimpleScalarPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + switch (errorCode) { + case "ComplexError": + case "aws.protocoltests.json10#ComplexError": + throw await de_ComplexErrorRes(parsedOutput, context); + case "FooError": + case "aws.protocoltests.json10#FooError": + throw await de_FooErrorRes(parsedOutput, context); + case "InvalidGreeting": + case "aws.protocoltests.json10#InvalidGreeting": + throw await de_InvalidGreetingRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }) as never; + } }; /** diff --git a/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts b/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts index 8dc5cdb630dc..a051d7057019 100644 --- a/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts +++ b/private/aws-protocoltests-json/src/protocols/Aws_json1_1.ts @@ -313,7 +313,7 @@ export const de_DatetimeOffsetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DatetimeOffsetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -325,26 +325,6 @@ export const de_DatetimeOffsetsCommand = async ( return response; }; -/** - * deserializeAws_json1_1DatetimeOffsetsCommandError - */ -const de_DatetimeOffsetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1EmptyOperationCommand */ @@ -353,7 +333,7 @@ export const de_EmptyOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EmptyOperationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: EmptyOperationCommandOutput = { @@ -362,26 +342,6 @@ export const de_EmptyOperationCommand = async ( return response; }; -/** - * deserializeAws_json1_1EmptyOperationCommandError - */ -const de_EmptyOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1EndpointOperationCommand */ @@ -390,7 +350,7 @@ export const de_EndpointOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EndpointOperationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: EndpointOperationCommandOutput = { @@ -399,26 +359,6 @@ export const de_EndpointOperationCommand = async ( return response; }; -/** - * deserializeAws_json1_1EndpointOperationCommandError - */ -const de_EndpointOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1EndpointWithHostLabelOperationCommand */ @@ -427,7 +367,7 @@ export const de_EndpointWithHostLabelOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EndpointWithHostLabelOperationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: EndpointWithHostLabelOperationCommandOutput = { @@ -436,26 +376,6 @@ export const de_EndpointWithHostLabelOperationCommand = async ( return response; }; -/** - * deserializeAws_json1_1EndpointWithHostLabelOperationCommandError - */ -const de_EndpointWithHostLabelOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1FractionalSecondsCommand */ @@ -464,7 +384,7 @@ export const de_FractionalSecondsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_FractionalSecondsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -476,26 +396,6 @@ export const de_FractionalSecondsCommand = async ( return response; }; -/** - * deserializeAws_json1_1FractionalSecondsCommandError - */ -const de_FractionalSecondsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1GreetingWithErrorsCommand */ @@ -504,7 +404,7 @@ export const de_GreetingWithErrorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GreetingWithErrorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -516,38 +416,6 @@ export const de_GreetingWithErrorsCommand = async ( return response; }; -/** - * deserializeAws_json1_1GreetingWithErrorsCommandError - */ -const de_GreetingWithErrorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ComplexError": - case "aws.protocoltests.json#ComplexError": - throw await de_ComplexErrorRes(parsedOutput, context); - case "FooError": - case "aws.protocoltests.json#FooError": - throw await de_FooErrorRes(parsedOutput, context); - case "InvalidGreeting": - case "aws.protocoltests.json#InvalidGreeting": - throw await de_InvalidGreetingRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1HostWithPathOperationCommand */ @@ -556,7 +424,7 @@ export const de_HostWithPathOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_HostWithPathOperationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: HostWithPathOperationCommandOutput = { @@ -565,26 +433,6 @@ export const de_HostWithPathOperationCommand = async ( return response; }; -/** - * deserializeAws_json1_1HostWithPathOperationCommandError - */ -const de_HostWithPathOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1JsonEnumsCommand */ @@ -593,7 +441,7 @@ export const de_JsonEnumsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_JsonEnumsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -605,26 +453,6 @@ export const de_JsonEnumsCommand = async ( return response; }; -/** - * deserializeAws_json1_1JsonEnumsCommandError - */ -const de_JsonEnumsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1JsonUnionsCommand */ @@ -633,7 +461,7 @@ export const de_JsonUnionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_JsonUnionsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -645,26 +473,6 @@ export const de_JsonUnionsCommand = async ( return response; }; -/** - * deserializeAws_json1_1JsonUnionsCommandError - */ -const de_JsonUnionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1KitchenSinkOperationCommand */ @@ -673,7 +481,7 @@ export const de_KitchenSinkOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_KitchenSinkOperationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -685,35 +493,6 @@ export const de_KitchenSinkOperationCommand = async ( return response; }; -/** - * deserializeAws_json1_1KitchenSinkOperationCommandError - */ -const de_KitchenSinkOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ErrorWithMembers": - case "aws.protocoltests.json#ErrorWithMembers": - throw await de_ErrorWithMembersRes(parsedOutput, context); - case "ErrorWithoutMembers": - case "aws.protocoltests.json#ErrorWithoutMembers": - throw await de_ErrorWithoutMembersRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_json1_1NullOperationCommand */ @@ -722,7 +501,7 @@ export const de_NullOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_NullOperationCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -734,26 +513,6 @@ export const de_NullOperationCommand = async ( return response; }; -/** - * deserializeAws_json1_1NullOperationCommandError - */ -const de_NullOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1OperationWithOptionalInputOutputCommand */ @@ -762,7 +521,7 @@ export const de_OperationWithOptionalInputOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_OperationWithOptionalInputOutputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -774,26 +533,6 @@ export const de_OperationWithOptionalInputOutputCommand = async ( return response; }; -/** - * deserializeAws_json1_1OperationWithOptionalInputOutputCommandError - */ -const de_OperationWithOptionalInputOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1PutAndGetInlineDocumentsCommand */ @@ -802,7 +541,7 @@ export const de_PutAndGetInlineDocumentsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutAndGetInlineDocumentsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -814,26 +553,6 @@ export const de_PutAndGetInlineDocumentsCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutAndGetInlineDocumentsCommandError - */ -const de_PutAndGetInlineDocumentsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1PutWithContentEncodingCommand */ @@ -842,7 +561,7 @@ export const de_PutWithContentEncodingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutWithContentEncodingCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutWithContentEncodingCommandOutput = { @@ -851,26 +570,6 @@ export const de_PutWithContentEncodingCommand = async ( return response; }; -/** - * deserializeAws_json1_1PutWithContentEncodingCommandError - */ -const de_PutWithContentEncodingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_json1_1SimpleScalarPropertiesCommand */ @@ -879,7 +578,7 @@ export const de_SimpleScalarPropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SimpleScalarPropertiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -892,23 +591,38 @@ export const de_SimpleScalarPropertiesCommand = async ( }; /** - * deserializeAws_json1_1SimpleScalarPropertiesCommandError + * deserialize_Aws_json1_1CommandError */ -const de_SimpleScalarPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + switch (errorCode) { + case "ComplexError": + case "aws.protocoltests.json#ComplexError": + throw await de_ComplexErrorRes(parsedOutput, context); + case "FooError": + case "aws.protocoltests.json#FooError": + throw await de_FooErrorRes(parsedOutput, context); + case "InvalidGreeting": + case "aws.protocoltests.json#InvalidGreeting": + throw await de_InvalidGreetingRes(parsedOutput, context); + case "ErrorWithMembers": + case "aws.protocoltests.json#ErrorWithMembers": + throw await de_ErrorWithMembersRes(parsedOutput, context); + case "ErrorWithoutMembers": + case "aws.protocoltests.json#ErrorWithoutMembers": + throw await de_ErrorWithoutMembersRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }) as never; + } }; /** diff --git a/private/aws-protocoltests-query/src/protocols/Aws_query.ts b/private/aws-protocoltests-query/src/protocols/Aws_query.ts index 01d9b159a913..319083333d2b 100644 --- a/private/aws-protocoltests-query/src/protocols/Aws_query.ts +++ b/private/aws-protocoltests-query/src/protocols/Aws_query.ts @@ -681,7 +681,7 @@ export const de_DatetimeOffsetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_DatetimeOffsetsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -693,26 +693,6 @@ export const de_DatetimeOffsetsCommand = async ( return response; }; -/** - * deserializeAws_queryDatetimeOffsetsCommandError - */ -const de_DatetimeOffsetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryEmptyInputAndEmptyOutputCommand */ @@ -721,7 +701,7 @@ export const de_EmptyInputAndEmptyOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EmptyInputAndEmptyOutputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -733,26 +713,6 @@ export const de_EmptyInputAndEmptyOutputCommand = async ( return response; }; -/** - * deserializeAws_queryEmptyInputAndEmptyOutputCommandError - */ -const de_EmptyInputAndEmptyOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryEndpointOperationCommand */ @@ -761,7 +721,7 @@ export const de_EndpointOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EndpointOperationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: EndpointOperationCommandOutput = { @@ -770,26 +730,6 @@ export const de_EndpointOperationCommand = async ( return response; }; -/** - * deserializeAws_queryEndpointOperationCommandError - */ -const de_EndpointOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryEndpointWithHostLabelOperationCommand */ @@ -798,7 +738,7 @@ export const de_EndpointWithHostLabelOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_EndpointWithHostLabelOperationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: EndpointWithHostLabelOperationCommandOutput = { @@ -807,26 +747,6 @@ export const de_EndpointWithHostLabelOperationCommand = async ( return response; }; -/** - * deserializeAws_queryEndpointWithHostLabelOperationCommandError - */ -const de_EndpointWithHostLabelOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryFlattenedXmlMapCommand */ @@ -835,7 +755,7 @@ export const de_FlattenedXmlMapCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_FlattenedXmlMapCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -847,26 +767,6 @@ export const de_FlattenedXmlMapCommand = async ( return response; }; -/** - * deserializeAws_queryFlattenedXmlMapCommandError - */ -const de_FlattenedXmlMapCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryFlattenedXmlMapWithXmlNameCommand */ @@ -875,7 +775,7 @@ export const de_FlattenedXmlMapWithXmlNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_FlattenedXmlMapWithXmlNameCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -887,26 +787,6 @@ export const de_FlattenedXmlMapWithXmlNameCommand = async ( return response; }; -/** - * deserializeAws_queryFlattenedXmlMapWithXmlNameCommandError - */ -const de_FlattenedXmlMapWithXmlNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryFlattenedXmlMapWithXmlNamespaceCommand */ @@ -915,7 +795,7 @@ export const de_FlattenedXmlMapWithXmlNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_FlattenedXmlMapWithXmlNamespaceCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -927,26 +807,6 @@ export const de_FlattenedXmlMapWithXmlNamespaceCommand = async ( return response; }; -/** - * deserializeAws_queryFlattenedXmlMapWithXmlNamespaceCommandError - */ -const de_FlattenedXmlMapWithXmlNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryFractionalSecondsCommand */ @@ -955,7 +815,7 @@ export const de_FractionalSecondsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_FractionalSecondsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -967,26 +827,6 @@ export const de_FractionalSecondsCommand = async ( return response; }; -/** - * deserializeAws_queryFractionalSecondsCommandError - */ -const de_FractionalSecondsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryGreetingWithErrorsCommand */ @@ -995,7 +835,7 @@ export const de_GreetingWithErrorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_GreetingWithErrorsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1007,38 +847,6 @@ export const de_GreetingWithErrorsCommand = async ( return response; }; -/** - * deserializeAws_queryGreetingWithErrorsCommandError - */ -const de_GreetingWithErrorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ComplexError": - case "aws.protocoltests.query#ComplexError": - throw await de_ComplexErrorRes(parsedOutput, context); - case "Customized": - case "aws.protocoltests.query#CustomCodeError": - throw await de_CustomCodeErrorRes(parsedOutput, context); - case "InvalidGreeting": - case "aws.protocoltests.query#InvalidGreeting": - throw await de_InvalidGreetingRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_queryHostWithPathOperationCommand */ @@ -1047,7 +855,7 @@ export const de_HostWithPathOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_HostWithPathOperationCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: HostWithPathOperationCommandOutput = { @@ -1056,26 +864,6 @@ export const de_HostWithPathOperationCommand = async ( return response; }; -/** - * deserializeAws_queryHostWithPathOperationCommandError - */ -const de_HostWithPathOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryIgnoresWrappingXmlNameCommand */ @@ -1084,7 +872,7 @@ export const de_IgnoresWrappingXmlNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_IgnoresWrappingXmlNameCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1096,26 +884,6 @@ export const de_IgnoresWrappingXmlNameCommand = async ( return response; }; -/** - * deserializeAws_queryIgnoresWrappingXmlNameCommandError - */ -const de_IgnoresWrappingXmlNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryNestedStructuresCommand */ @@ -1124,7 +892,7 @@ export const de_NestedStructuresCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_NestedStructuresCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: NestedStructuresCommandOutput = { @@ -1133,26 +901,6 @@ export const de_NestedStructuresCommand = async ( return response; }; -/** - * deserializeAws_queryNestedStructuresCommandError - */ -const de_NestedStructuresCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryNoInputAndNoOutputCommand */ @@ -1161,7 +909,7 @@ export const de_NoInputAndNoOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_NoInputAndNoOutputCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: NoInputAndNoOutputCommandOutput = { @@ -1170,26 +918,6 @@ export const de_NoInputAndNoOutputCommand = async ( return response; }; -/** - * deserializeAws_queryNoInputAndNoOutputCommandError - */ -const de_NoInputAndNoOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryNoInputAndOutputCommand */ @@ -1198,7 +926,7 @@ export const de_NoInputAndOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_NoInputAndOutputCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1210,26 +938,6 @@ export const de_NoInputAndOutputCommand = async ( return response; }; -/** - * deserializeAws_queryNoInputAndOutputCommandError - */ -const de_NoInputAndOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryPutWithContentEncodingCommand */ @@ -1238,7 +946,7 @@ export const de_PutWithContentEncodingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_PutWithContentEncodingCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: PutWithContentEncodingCommandOutput = { @@ -1247,26 +955,6 @@ export const de_PutWithContentEncodingCommand = async ( return response; }; -/** - * deserializeAws_queryPutWithContentEncodingCommandError - */ -const de_PutWithContentEncodingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryQueryIdempotencyTokenAutoFillCommand */ @@ -1275,7 +963,7 @@ export const de_QueryIdempotencyTokenAutoFillCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_QueryIdempotencyTokenAutoFillCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: QueryIdempotencyTokenAutoFillCommandOutput = { @@ -1284,26 +972,6 @@ export const de_QueryIdempotencyTokenAutoFillCommand = async ( return response; }; -/** - * deserializeAws_queryQueryIdempotencyTokenAutoFillCommandError - */ -const de_QueryIdempotencyTokenAutoFillCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryQueryListsCommand */ @@ -1312,7 +980,7 @@ export const de_QueryListsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_QueryListsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: QueryListsCommandOutput = { @@ -1321,26 +989,6 @@ export const de_QueryListsCommand = async ( return response; }; -/** - * deserializeAws_queryQueryListsCommandError - */ -const de_QueryListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryQueryMapsCommand */ @@ -1349,7 +997,7 @@ export const de_QueryMapsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_QueryMapsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: QueryMapsCommandOutput = { @@ -1358,26 +1006,6 @@ export const de_QueryMapsCommand = async ( return response; }; -/** - * deserializeAws_queryQueryMapsCommandError - */ -const de_QueryMapsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryQueryTimestampsCommand */ @@ -1386,7 +1014,7 @@ export const de_QueryTimestampsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_QueryTimestampsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: QueryTimestampsCommandOutput = { @@ -1395,26 +1023,6 @@ export const de_QueryTimestampsCommand = async ( return response; }; -/** - * deserializeAws_queryQueryTimestampsCommandError - */ -const de_QueryTimestampsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryRecursiveXmlShapesCommand */ @@ -1423,7 +1031,7 @@ export const de_RecursiveXmlShapesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_RecursiveXmlShapesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1435,26 +1043,6 @@ export const de_RecursiveXmlShapesCommand = async ( return response; }; -/** - * deserializeAws_queryRecursiveXmlShapesCommandError - */ -const de_RecursiveXmlShapesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_querySimpleInputParamsCommand */ @@ -1463,7 +1051,7 @@ export const de_SimpleInputParamsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SimpleInputParamsCommandError(output, context); + return de_CommandError(output, context); } await collectBody(output.body, context); const response: SimpleInputParamsCommandOutput = { @@ -1472,26 +1060,6 @@ export const de_SimpleInputParamsCommand = async ( return response; }; -/** - * deserializeAws_querySimpleInputParamsCommandError - */ -const de_SimpleInputParamsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_querySimpleScalarXmlPropertiesCommand */ @@ -1500,7 +1068,7 @@ export const de_SimpleScalarXmlPropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_SimpleScalarXmlPropertiesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1512,26 +1080,6 @@ export const de_SimpleScalarXmlPropertiesCommand = async ( return response; }; -/** - * deserializeAws_querySimpleScalarXmlPropertiesCommandError - */ -const de_SimpleScalarXmlPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryXmlBlobsCommand */ @@ -1540,7 +1088,7 @@ export const de_XmlBlobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlBlobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1552,26 +1100,6 @@ export const de_XmlBlobsCommand = async ( return response; }; -/** - * deserializeAws_queryXmlBlobsCommandError - */ -const de_XmlBlobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryXmlEmptyBlobsCommand */ @@ -1580,7 +1108,7 @@ export const de_XmlEmptyBlobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlEmptyBlobsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1592,26 +1120,6 @@ export const de_XmlEmptyBlobsCommand = async ( return response; }; -/** - * deserializeAws_queryXmlEmptyBlobsCommandError - */ -const de_XmlEmptyBlobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryXmlEmptyListsCommand */ @@ -1620,7 +1128,7 @@ export const de_XmlEmptyListsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlEmptyListsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1632,26 +1140,6 @@ export const de_XmlEmptyListsCommand = async ( return response; }; -/** - * deserializeAws_queryXmlEmptyListsCommandError - */ -const de_XmlEmptyListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryXmlEmptyMapsCommand */ @@ -1660,7 +1148,7 @@ export const de_XmlEmptyMapsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlEmptyMapsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1672,26 +1160,6 @@ export const de_XmlEmptyMapsCommand = async ( return response; }; -/** - * deserializeAws_queryXmlEmptyMapsCommandError - */ -const de_XmlEmptyMapsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryXmlEnumsCommand */ @@ -1700,7 +1168,7 @@ export const de_XmlEnumsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlEnumsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1712,26 +1180,6 @@ export const de_XmlEnumsCommand = async ( return response; }; -/** - * deserializeAws_queryXmlEnumsCommandError - */ -const de_XmlEnumsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryXmlIntEnumsCommand */ @@ -1740,7 +1188,7 @@ export const de_XmlIntEnumsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlIntEnumsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1752,26 +1200,6 @@ export const de_XmlIntEnumsCommand = async ( return response; }; -/** - * deserializeAws_queryXmlIntEnumsCommandError - */ -const de_XmlIntEnumsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryXmlListsCommand */ @@ -1780,7 +1208,7 @@ export const de_XmlListsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlListsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1792,26 +1220,6 @@ export const de_XmlListsCommand = async ( return response; }; -/** - * deserializeAws_queryXmlListsCommandError - */ -const de_XmlListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryXmlMapsCommand */ @@ -1820,7 +1228,7 @@ export const de_XmlMapsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlMapsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1832,26 +1240,6 @@ export const de_XmlMapsCommand = async ( return response; }; -/** - * deserializeAws_queryXmlMapsCommandError - */ -const de_XmlMapsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryXmlMapsXmlNameCommand */ @@ -1860,7 +1248,7 @@ export const de_XmlMapsXmlNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlMapsXmlNameCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1872,26 +1260,6 @@ export const de_XmlMapsXmlNameCommand = async ( return response; }; -/** - * deserializeAws_queryXmlMapsXmlNameCommandError - */ -const de_XmlMapsXmlNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryXmlNamespacesCommand */ @@ -1900,7 +1268,7 @@ export const de_XmlNamespacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlNamespacesCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1912,26 +1280,6 @@ export const de_XmlNamespacesCommand = async ( return response; }; -/** - * deserializeAws_queryXmlNamespacesCommandError - */ -const de_XmlNamespacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_queryXmlTimestampsCommand */ @@ -1940,7 +1288,7 @@ export const de_XmlTimestampsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode >= 300) { - return de_XmlTimestampsCommandError(output, context); + return de_CommandError(output, context); } const data: any = await parseBody(output.body, context); let contents: any = {}; @@ -1953,23 +1301,32 @@ export const de_XmlTimestampsCommand = async ( }; /** - * deserializeAws_queryXmlTimestampsCommandError + * deserialize_Aws_queryCommandError */ -const de_XmlTimestampsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadQueryErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + switch (errorCode) { + case "ComplexError": + case "aws.protocoltests.query#ComplexError": + throw await de_ComplexErrorRes(parsedOutput, context); + case "Customized": + case "aws.protocoltests.query#CustomCodeError": + throw await de_CustomCodeErrorRes(parsedOutput, context); + case "InvalidGreeting": + case "aws.protocoltests.query#InvalidGreeting": + throw await de_InvalidGreetingRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody: parsedBody.Error, + errorCode, + }) as never; + } }; /** diff --git a/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts b/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts index da6da2dc0feb..edc1fe6d309e 100644 --- a/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts +++ b/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts @@ -2460,7 +2460,7 @@ export const de_AllQueryStringTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AllQueryStringTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2469,26 +2469,6 @@ export const de_AllQueryStringTypesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1AllQueryStringTypesCommandError - */ -const de_AllQueryStringTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ConstantAndVariableQueryStringCommand */ @@ -2497,7 +2477,7 @@ export const de_ConstantAndVariableQueryStringCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ConstantAndVariableQueryStringCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2506,26 +2486,6 @@ export const de_ConstantAndVariableQueryStringCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ConstantAndVariableQueryStringCommandError - */ -const de_ConstantAndVariableQueryStringCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1ConstantQueryStringCommand */ @@ -2534,7 +2494,7 @@ export const de_ConstantQueryStringCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ConstantQueryStringCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2543,26 +2503,6 @@ export const de_ConstantQueryStringCommand = async ( return contents; }; -/** - * deserializeAws_restJson1ConstantQueryStringCommandError - */ -const de_ConstantQueryStringCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1DatetimeOffsetsCommand */ @@ -2571,7 +2511,7 @@ export const de_DatetimeOffsetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DatetimeOffsetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2584,26 +2524,6 @@ export const de_DatetimeOffsetsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DatetimeOffsetsCommandError - */ -const de_DatetimeOffsetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1DocumentTypeCommand */ @@ -2612,7 +2532,7 @@ export const de_DocumentTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DocumentTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2626,26 +2546,6 @@ export const de_DocumentTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DocumentTypeCommandError - */ -const de_DocumentTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1DocumentTypeAsPayloadCommand */ @@ -2654,7 +2554,7 @@ export const de_DocumentTypeAsPayloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DocumentTypeAsPayloadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2665,26 +2565,6 @@ export const de_DocumentTypeAsPayloadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1DocumentTypeAsPayloadCommandError - */ -const de_DocumentTypeAsPayloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1EmptyInputAndEmptyOutputCommand */ @@ -2693,7 +2573,7 @@ export const de_EmptyInputAndEmptyOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EmptyInputAndEmptyOutputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2702,26 +2582,6 @@ export const de_EmptyInputAndEmptyOutputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1EmptyInputAndEmptyOutputCommandError - */ -const de_EmptyInputAndEmptyOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1EndpointOperationCommand */ @@ -2730,7 +2590,7 @@ export const de_EndpointOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EndpointOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2739,26 +2599,6 @@ export const de_EndpointOperationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1EndpointOperationCommandError - */ -const de_EndpointOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1EndpointWithHostLabelOperationCommand */ @@ -2767,7 +2607,7 @@ export const de_EndpointWithHostLabelOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EndpointWithHostLabelOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2776,26 +2616,6 @@ export const de_EndpointWithHostLabelOperationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1EndpointWithHostLabelOperationCommandError - */ -const de_EndpointWithHostLabelOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1FractionalSecondsCommand */ @@ -2804,7 +2624,7 @@ export const de_FractionalSecondsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_FractionalSecondsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2817,26 +2637,6 @@ export const de_FractionalSecondsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1FractionalSecondsCommandError - */ -const de_FractionalSecondsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1GreetingWithErrorsCommand */ @@ -2845,7 +2645,7 @@ export const de_GreetingWithErrorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GreetingWithErrorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2855,38 +2655,6 @@ export const de_GreetingWithErrorsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1GreetingWithErrorsCommandError - */ -const de_GreetingWithErrorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ComplexError": - case "aws.protocoltests.restjson#ComplexError": - throw await de_ComplexErrorRes(parsedOutput, context); - case "FooError": - case "aws.protocoltests.restjson#FooError": - throw await de_FooErrorRes(parsedOutput, context); - case "InvalidGreeting": - case "aws.protocoltests.restjson#InvalidGreeting": - throw await de_InvalidGreetingRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); - } -}; - /** * deserializeAws_restJson1HostWithPathOperationCommand */ @@ -2895,7 +2663,7 @@ export const de_HostWithPathOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HostWithPathOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2904,26 +2672,6 @@ export const de_HostWithPathOperationCommand = async ( return contents; }; -/** - * deserializeAws_restJson1HostWithPathOperationCommandError - */ -const de_HostWithPathOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1HttpChecksumRequiredCommand */ @@ -2932,7 +2680,7 @@ export const de_HttpChecksumRequiredCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpChecksumRequiredCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2945,26 +2693,6 @@ export const de_HttpChecksumRequiredCommand = async ( return contents; }; -/** - * deserializeAws_restJson1HttpChecksumRequiredCommandError - */ -const de_HttpChecksumRequiredCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1HttpEnumPayloadCommand */ @@ -2973,7 +2701,7 @@ export const de_HttpEnumPayloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpEnumPayloadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2983,26 +2711,6 @@ export const de_HttpEnumPayloadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1HttpEnumPayloadCommandError - */ -const de_HttpEnumPayloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1HttpPayloadTraitsCommand */ @@ -3011,7 +2719,7 @@ export const de_HttpPayloadTraitsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpPayloadTraitsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3022,26 +2730,6 @@ export const de_HttpPayloadTraitsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1HttpPayloadTraitsCommandError - */ -const de_HttpPayloadTraitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1HttpPayloadTraitsWithMediaTypeCommand */ @@ -3050,7 +2738,7 @@ export const de_HttpPayloadTraitsWithMediaTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpPayloadTraitsWithMediaTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3061,26 +2749,6 @@ export const de_HttpPayloadTraitsWithMediaTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1HttpPayloadTraitsWithMediaTypeCommandError - */ -const de_HttpPayloadTraitsWithMediaTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1HttpPayloadWithStructureCommand */ @@ -3089,7 +2757,7 @@ export const de_HttpPayloadWithStructureCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpPayloadWithStructureCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3099,26 +2767,6 @@ export const de_HttpPayloadWithStructureCommand = async ( return contents; }; -/** - * deserializeAws_restJson1HttpPayloadWithStructureCommandError - */ -const de_HttpPayloadWithStructureCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1HttpPayloadWithUnionCommand */ @@ -3127,7 +2775,7 @@ export const de_HttpPayloadWithUnionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpPayloadWithUnionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3137,26 +2785,6 @@ export const de_HttpPayloadWithUnionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1HttpPayloadWithUnionCommandError - */ -const de_HttpPayloadWithUnionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1HttpPrefixHeadersCommand */ @@ -3165,7 +2793,7 @@ export const de_HttpPrefixHeadersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpPrefixHeadersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3185,34 +2813,14 @@ export const de_HttpPrefixHeadersCommand = async ( }; /** - * deserializeAws_restJson1HttpPrefixHeadersCommandError + * deserializeAws_restJson1HttpPrefixHeadersInResponseCommand */ -const de_HttpPrefixHeadersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_restJson1HttpPrefixHeadersInResponseCommand - */ -export const de_HttpPrefixHeadersInResponseCommand = async ( +export const de_HttpPrefixHeadersInResponseCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpPrefixHeadersInResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3230,26 +2838,6 @@ export const de_HttpPrefixHeadersInResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1HttpPrefixHeadersInResponseCommandError - */ -const de_HttpPrefixHeadersInResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1HttpRequestWithFloatLabelsCommand */ @@ -3258,7 +2846,7 @@ export const de_HttpRequestWithFloatLabelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpRequestWithFloatLabelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3267,26 +2855,6 @@ export const de_HttpRequestWithFloatLabelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1HttpRequestWithFloatLabelsCommandError - */ -const de_HttpRequestWithFloatLabelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1HttpRequestWithGreedyLabelInPathCommand */ @@ -3295,7 +2863,7 @@ export const de_HttpRequestWithGreedyLabelInPathCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpRequestWithGreedyLabelInPathCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3304,26 +2872,6 @@ export const de_HttpRequestWithGreedyLabelInPathCommand = async ( return contents; }; -/** - * deserializeAws_restJson1HttpRequestWithGreedyLabelInPathCommandError - */ -const de_HttpRequestWithGreedyLabelInPathCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1HttpRequestWithLabelsCommand */ @@ -3332,7 +2880,7 @@ export const de_HttpRequestWithLabelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpRequestWithLabelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3341,26 +2889,6 @@ export const de_HttpRequestWithLabelsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1HttpRequestWithLabelsCommandError - */ -const de_HttpRequestWithLabelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1HttpRequestWithLabelsAndTimestampFormatCommand */ @@ -3369,7 +2897,7 @@ export const de_HttpRequestWithLabelsAndTimestampFormatCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpRequestWithLabelsAndTimestampFormatCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3378,26 +2906,6 @@ export const de_HttpRequestWithLabelsAndTimestampFormatCommand = async ( return contents; }; -/** - * deserializeAws_restJson1HttpRequestWithLabelsAndTimestampFormatCommandError - */ -const de_HttpRequestWithLabelsAndTimestampFormatCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1HttpRequestWithRegexLiteralCommand */ @@ -3406,7 +2914,7 @@ export const de_HttpRequestWithRegexLiteralCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpRequestWithRegexLiteralCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3415,26 +2923,6 @@ export const de_HttpRequestWithRegexLiteralCommand = async ( return contents; }; -/** - * deserializeAws_restJson1HttpRequestWithRegexLiteralCommandError - */ -const de_HttpRequestWithRegexLiteralCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1HttpResponseCodeCommand */ @@ -3443,7 +2931,7 @@ export const de_HttpResponseCodeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpResponseCodeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3455,26 +2943,6 @@ export const de_HttpResponseCodeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1HttpResponseCodeCommandError - */ -const de_HttpResponseCodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1HttpStringPayloadCommand */ @@ -3483,7 +2951,7 @@ export const de_HttpStringPayloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpStringPayloadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3493,26 +2961,6 @@ export const de_HttpStringPayloadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1HttpStringPayloadCommandError - */ -const de_HttpStringPayloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1IgnoreQueryParamsInResponseCommand */ @@ -3521,7 +2969,7 @@ export const de_IgnoreQueryParamsInResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_IgnoreQueryParamsInResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3534,26 +2982,6 @@ export const de_IgnoreQueryParamsInResponseCommand = async ( return contents; }; -/** - * deserializeAws_restJson1IgnoreQueryParamsInResponseCommandError - */ -const de_IgnoreQueryParamsInResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1InputAndOutputWithHeadersCommand */ @@ -3562,7 +2990,7 @@ export const de_InputAndOutputWithHeadersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_InputAndOutputWithHeadersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3613,26 +3041,6 @@ export const de_InputAndOutputWithHeadersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1InputAndOutputWithHeadersCommandError - */ -const de_InputAndOutputWithHeadersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1JsonBlobsCommand */ @@ -3641,7 +3049,7 @@ export const de_JsonBlobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_JsonBlobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3654,26 +3062,6 @@ export const de_JsonBlobsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1JsonBlobsCommandError - */ -const de_JsonBlobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1JsonEnumsCommand */ @@ -3682,7 +3070,7 @@ export const de_JsonEnumsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_JsonEnumsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3700,26 +3088,6 @@ export const de_JsonEnumsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1JsonEnumsCommandError - */ -const de_JsonEnumsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1JsonIntEnumsCommand */ @@ -3728,7 +3096,7 @@ export const de_JsonIntEnumsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_JsonIntEnumsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3746,26 +3114,6 @@ export const de_JsonIntEnumsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1JsonIntEnumsCommandError - */ -const de_JsonIntEnumsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1JsonListsCommand */ @@ -3774,7 +3122,7 @@ export const de_JsonListsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_JsonListsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3796,26 +3144,6 @@ export const de_JsonListsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1JsonListsCommandError - */ -const de_JsonListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1JsonMapsCommand */ @@ -3824,7 +3152,7 @@ export const de_JsonMapsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_JsonMapsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3846,26 +3174,6 @@ export const de_JsonMapsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1JsonMapsCommandError - */ -const de_JsonMapsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1JsonTimestampsCommand */ @@ -3874,7 +3182,7 @@ export const de_JsonTimestampsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_JsonTimestampsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3893,26 +3201,6 @@ export const de_JsonTimestampsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1JsonTimestampsCommandError - */ -const de_JsonTimestampsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1JsonUnionsCommand */ @@ -3921,7 +3209,7 @@ export const de_JsonUnionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_JsonUnionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3934,26 +3222,6 @@ export const de_JsonUnionsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1JsonUnionsCommandError - */ -const de_JsonUnionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedAcceptWithBodyCommand */ @@ -3962,7 +3230,7 @@ export const de_MalformedAcceptWithBodyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedAcceptWithBodyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3975,26 +3243,6 @@ export const de_MalformedAcceptWithBodyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedAcceptWithBodyCommandError - */ -const de_MalformedAcceptWithBodyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedAcceptWithGenericStringCommand */ @@ -4003,7 +3251,7 @@ export const de_MalformedAcceptWithGenericStringCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedAcceptWithGenericStringCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4014,34 +3262,14 @@ export const de_MalformedAcceptWithGenericStringCommand = async ( }; /** - * deserializeAws_restJson1MalformedAcceptWithGenericStringCommandError + * deserializeAws_restJson1MalformedAcceptWithPayloadCommand */ -const de_MalformedAcceptWithGenericStringCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - -/** - * deserializeAws_restJson1MalformedAcceptWithPayloadCommand - */ -export const de_MalformedAcceptWithPayloadCommand = async ( +export const de_MalformedAcceptWithPayloadCommand = async ( output: __HttpResponse, context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedAcceptWithPayloadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4051,26 +3279,6 @@ export const de_MalformedAcceptWithPayloadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedAcceptWithPayloadCommandError - */ -const de_MalformedAcceptWithPayloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedBlobCommand */ @@ -4079,7 +3287,7 @@ export const de_MalformedBlobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedBlobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4088,26 +3296,6 @@ export const de_MalformedBlobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedBlobCommandError - */ -const de_MalformedBlobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedBooleanCommand */ @@ -4116,7 +3304,7 @@ export const de_MalformedBooleanCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedBooleanCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4125,26 +3313,6 @@ export const de_MalformedBooleanCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedBooleanCommandError - */ -const de_MalformedBooleanCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedByteCommand */ @@ -4153,7 +3321,7 @@ export const de_MalformedByteCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedByteCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4162,26 +3330,6 @@ export const de_MalformedByteCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedByteCommandError - */ -const de_MalformedByteCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedContentTypeWithBodyCommand */ @@ -4190,7 +3338,7 @@ export const de_MalformedContentTypeWithBodyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedContentTypeWithBodyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4199,26 +3347,6 @@ export const de_MalformedContentTypeWithBodyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedContentTypeWithBodyCommandError - */ -const de_MalformedContentTypeWithBodyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedContentTypeWithGenericStringCommand */ @@ -4227,7 +3355,7 @@ export const de_MalformedContentTypeWithGenericStringCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedContentTypeWithGenericStringCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4236,26 +3364,6 @@ export const de_MalformedContentTypeWithGenericStringCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedContentTypeWithGenericStringCommandError - */ -const de_MalformedContentTypeWithGenericStringCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedContentTypeWithoutBodyCommand */ @@ -4264,7 +3372,7 @@ export const de_MalformedContentTypeWithoutBodyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedContentTypeWithoutBodyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4273,26 +3381,6 @@ export const de_MalformedContentTypeWithoutBodyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedContentTypeWithoutBodyCommandError - */ -const de_MalformedContentTypeWithoutBodyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedContentTypeWithPayloadCommand */ @@ -4301,7 +3389,7 @@ export const de_MalformedContentTypeWithPayloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedContentTypeWithPayloadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4310,26 +3398,6 @@ export const de_MalformedContentTypeWithPayloadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedContentTypeWithPayloadCommandError - */ -const de_MalformedContentTypeWithPayloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedDoubleCommand */ @@ -4338,7 +3406,7 @@ export const de_MalformedDoubleCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedDoubleCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4347,26 +3415,6 @@ export const de_MalformedDoubleCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedDoubleCommandError - */ -const de_MalformedDoubleCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedFloatCommand */ @@ -4375,7 +3423,7 @@ export const de_MalformedFloatCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedFloatCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4384,26 +3432,6 @@ export const de_MalformedFloatCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedFloatCommandError - */ -const de_MalformedFloatCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedIntegerCommand */ @@ -4412,7 +3440,7 @@ export const de_MalformedIntegerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedIntegerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4421,26 +3449,6 @@ export const de_MalformedIntegerCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedIntegerCommandError - */ -const de_MalformedIntegerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedListCommand */ @@ -4449,7 +3457,7 @@ export const de_MalformedListCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedListCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4458,26 +3466,6 @@ export const de_MalformedListCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedListCommandError - */ -const de_MalformedListCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedLongCommand */ @@ -4486,7 +3474,7 @@ export const de_MalformedLongCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedLongCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4495,26 +3483,6 @@ export const de_MalformedLongCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedLongCommandError - */ -const de_MalformedLongCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedMapCommand */ @@ -4523,7 +3491,7 @@ export const de_MalformedMapCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedMapCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4532,26 +3500,6 @@ export const de_MalformedMapCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedMapCommandError - */ -const de_MalformedMapCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedRequestBodyCommand */ @@ -4560,7 +3508,7 @@ export const de_MalformedRequestBodyCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedRequestBodyCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4569,26 +3517,6 @@ export const de_MalformedRequestBodyCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedRequestBodyCommandError - */ -const de_MalformedRequestBodyCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedShortCommand */ @@ -4597,7 +3525,7 @@ export const de_MalformedShortCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedShortCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4606,26 +3534,6 @@ export const de_MalformedShortCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedShortCommandError - */ -const de_MalformedShortCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedStringCommand */ @@ -4634,7 +3542,7 @@ export const de_MalformedStringCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedStringCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4643,26 +3551,6 @@ export const de_MalformedStringCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedStringCommandError - */ -const de_MalformedStringCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedTimestampBodyDateTimeCommand */ @@ -4671,7 +3559,7 @@ export const de_MalformedTimestampBodyDateTimeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedTimestampBodyDateTimeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4680,26 +3568,6 @@ export const de_MalformedTimestampBodyDateTimeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedTimestampBodyDateTimeCommandError - */ -const de_MalformedTimestampBodyDateTimeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedTimestampBodyDefaultCommand */ @@ -4708,7 +3576,7 @@ export const de_MalformedTimestampBodyDefaultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedTimestampBodyDefaultCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4717,26 +3585,6 @@ export const de_MalformedTimestampBodyDefaultCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedTimestampBodyDefaultCommandError - */ -const de_MalformedTimestampBodyDefaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedTimestampBodyHttpDateCommand */ @@ -4745,7 +3593,7 @@ export const de_MalformedTimestampBodyHttpDateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedTimestampBodyHttpDateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4754,26 +3602,6 @@ export const de_MalformedTimestampBodyHttpDateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedTimestampBodyHttpDateCommandError - */ -const de_MalformedTimestampBodyHttpDateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedTimestampHeaderDateTimeCommand */ @@ -4782,7 +3610,7 @@ export const de_MalformedTimestampHeaderDateTimeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedTimestampHeaderDateTimeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4791,26 +3619,6 @@ export const de_MalformedTimestampHeaderDateTimeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedTimestampHeaderDateTimeCommandError - */ -const de_MalformedTimestampHeaderDateTimeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedTimestampHeaderDefaultCommand */ @@ -4819,7 +3627,7 @@ export const de_MalformedTimestampHeaderDefaultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedTimestampHeaderDefaultCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4828,26 +3636,6 @@ export const de_MalformedTimestampHeaderDefaultCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedTimestampHeaderDefaultCommandError - */ -const de_MalformedTimestampHeaderDefaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedTimestampHeaderEpochCommand */ @@ -4856,7 +3644,7 @@ export const de_MalformedTimestampHeaderEpochCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedTimestampHeaderEpochCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4865,26 +3653,6 @@ export const de_MalformedTimestampHeaderEpochCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedTimestampHeaderEpochCommandError - */ -const de_MalformedTimestampHeaderEpochCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedTimestampPathDefaultCommand */ @@ -4893,7 +3661,7 @@ export const de_MalformedTimestampPathDefaultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedTimestampPathDefaultCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4902,26 +3670,6 @@ export const de_MalformedTimestampPathDefaultCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedTimestampPathDefaultCommandError - */ -const de_MalformedTimestampPathDefaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedTimestampPathEpochCommand */ @@ -4930,7 +3678,7 @@ export const de_MalformedTimestampPathEpochCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedTimestampPathEpochCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4939,26 +3687,6 @@ export const de_MalformedTimestampPathEpochCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedTimestampPathEpochCommandError - */ -const de_MalformedTimestampPathEpochCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedTimestampPathHttpDateCommand */ @@ -4967,7 +3695,7 @@ export const de_MalformedTimestampPathHttpDateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedTimestampPathHttpDateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4976,26 +3704,6 @@ export const de_MalformedTimestampPathHttpDateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedTimestampPathHttpDateCommandError - */ -const de_MalformedTimestampPathHttpDateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedTimestampQueryDefaultCommand */ @@ -5004,7 +3712,7 @@ export const de_MalformedTimestampQueryDefaultCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedTimestampQueryDefaultCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5013,26 +3721,6 @@ export const de_MalformedTimestampQueryDefaultCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedTimestampQueryDefaultCommandError - */ -const de_MalformedTimestampQueryDefaultCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedTimestampQueryEpochCommand */ @@ -5041,7 +3729,7 @@ export const de_MalformedTimestampQueryEpochCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedTimestampQueryEpochCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5050,26 +3738,6 @@ export const de_MalformedTimestampQueryEpochCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedTimestampQueryEpochCommandError - */ -const de_MalformedTimestampQueryEpochCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedTimestampQueryHttpDateCommand */ @@ -5078,7 +3746,7 @@ export const de_MalformedTimestampQueryHttpDateCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedTimestampQueryHttpDateCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5087,26 +3755,6 @@ export const de_MalformedTimestampQueryHttpDateCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedTimestampQueryHttpDateCommandError - */ -const de_MalformedTimestampQueryHttpDateCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MalformedUnionCommand */ @@ -5115,7 +3763,7 @@ export const de_MalformedUnionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MalformedUnionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5124,26 +3772,6 @@ export const de_MalformedUnionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MalformedUnionCommandError - */ -const de_MalformedUnionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1MediaTypeHeaderCommand */ @@ -5152,7 +3780,7 @@ export const de_MediaTypeHeaderCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_MediaTypeHeaderCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5165,26 +3793,6 @@ export const de_MediaTypeHeaderCommand = async ( return contents; }; -/** - * deserializeAws_restJson1MediaTypeHeaderCommandError - */ -const de_MediaTypeHeaderCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1NoInputAndNoOutputCommand */ @@ -5193,7 +3801,7 @@ export const de_NoInputAndNoOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_NoInputAndNoOutputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5202,26 +3810,6 @@ export const de_NoInputAndNoOutputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1NoInputAndNoOutputCommandError - */ -const de_NoInputAndNoOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1NoInputAndOutputCommand */ @@ -5230,7 +3818,7 @@ export const de_NoInputAndOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_NoInputAndOutputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5239,26 +3827,6 @@ export const de_NoInputAndOutputCommand = async ( return contents; }; -/** - * deserializeAws_restJson1NoInputAndOutputCommandError - */ -const de_NoInputAndOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1NullAndEmptyHeadersClientCommand */ @@ -5267,7 +3835,7 @@ export const de_NullAndEmptyHeadersClientCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_NullAndEmptyHeadersClientCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5282,26 +3850,6 @@ export const de_NullAndEmptyHeadersClientCommand = async ( return contents; }; -/** - * deserializeAws_restJson1NullAndEmptyHeadersClientCommandError - */ -const de_NullAndEmptyHeadersClientCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1NullAndEmptyHeadersServerCommand */ @@ -5310,7 +3858,7 @@ export const de_NullAndEmptyHeadersServerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_NullAndEmptyHeadersServerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5322,27 +3870,7 @@ export const de_NullAndEmptyHeadersServerCommand = async ( ], }); await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restJson1NullAndEmptyHeadersServerCommandError - */ -const de_NullAndEmptyHeadersServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + return contents; }; /** @@ -5353,7 +3881,7 @@ export const de_OmitsNullSerializesEmptyStringCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_OmitsNullSerializesEmptyStringCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5362,26 +3890,6 @@ export const de_OmitsNullSerializesEmptyStringCommand = async ( return contents; }; -/** - * deserializeAws_restJson1OmitsNullSerializesEmptyStringCommandError - */ -const de_OmitsNullSerializesEmptyStringCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1OmitsSerializingEmptyListsCommand */ @@ -5390,7 +3898,7 @@ export const de_OmitsSerializingEmptyListsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_OmitsSerializingEmptyListsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5399,26 +3907,6 @@ export const de_OmitsSerializingEmptyListsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1OmitsSerializingEmptyListsCommandError - */ -const de_OmitsSerializingEmptyListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1PostPlayerActionCommand */ @@ -5427,7 +3915,7 @@ export const de_PostPlayerActionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PostPlayerActionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5440,26 +3928,6 @@ export const de_PostPlayerActionCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PostPlayerActionCommandError - */ -const de_PostPlayerActionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1PostUnionWithJsonNameCommand */ @@ -5468,7 +3936,7 @@ export const de_PostUnionWithJsonNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PostUnionWithJsonNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5481,26 +3949,6 @@ export const de_PostUnionWithJsonNameCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PostUnionWithJsonNameCommandError - */ -const de_PostUnionWithJsonNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1PutWithContentEncodingCommand */ @@ -5509,7 +3957,7 @@ export const de_PutWithContentEncodingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutWithContentEncodingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5518,26 +3966,6 @@ export const de_PutWithContentEncodingCommand = async ( return contents; }; -/** - * deserializeAws_restJson1PutWithContentEncodingCommandError - */ -const de_PutWithContentEncodingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1QueryIdempotencyTokenAutoFillCommand */ @@ -5546,7 +3974,7 @@ export const de_QueryIdempotencyTokenAutoFillCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_QueryIdempotencyTokenAutoFillCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5555,26 +3983,6 @@ export const de_QueryIdempotencyTokenAutoFillCommand = async ( return contents; }; -/** - * deserializeAws_restJson1QueryIdempotencyTokenAutoFillCommandError - */ -const de_QueryIdempotencyTokenAutoFillCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1QueryParamsAsStringListMapCommand */ @@ -5583,7 +3991,7 @@ export const de_QueryParamsAsStringListMapCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_QueryParamsAsStringListMapCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5592,26 +4000,6 @@ export const de_QueryParamsAsStringListMapCommand = async ( return contents; }; -/** - * deserializeAws_restJson1QueryParamsAsStringListMapCommandError - */ -const de_QueryParamsAsStringListMapCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1QueryPrecedenceCommand */ @@ -5620,7 +4008,7 @@ export const de_QueryPrecedenceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_QueryPrecedenceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5629,26 +4017,6 @@ export const de_QueryPrecedenceCommand = async ( return contents; }; -/** - * deserializeAws_restJson1QueryPrecedenceCommandError - */ -const de_QueryPrecedenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1RecursiveShapesCommand */ @@ -5657,7 +4025,7 @@ export const de_RecursiveShapesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RecursiveShapesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5670,26 +4038,6 @@ export const de_RecursiveShapesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1RecursiveShapesCommandError - */ -const de_RecursiveShapesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1SimpleScalarPropertiesCommand */ @@ -5698,7 +4046,7 @@ export const de_SimpleScalarPropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SimpleScalarPropertiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5720,26 +4068,6 @@ export const de_SimpleScalarPropertiesCommand = async ( return contents; }; -/** - * deserializeAws_restJson1SimpleScalarPropertiesCommandError - */ -const de_SimpleScalarPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1StreamingTraitsCommand */ @@ -5748,7 +4076,7 @@ export const de_StreamingTraitsCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StreamingTraitsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5760,26 +4088,6 @@ export const de_StreamingTraitsCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StreamingTraitsCommandError - */ -const de_StreamingTraitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1StreamingTraitsRequireLengthCommand */ @@ -5788,7 +4096,7 @@ export const de_StreamingTraitsRequireLengthCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StreamingTraitsRequireLengthCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5797,26 +4105,6 @@ export const de_StreamingTraitsRequireLengthCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StreamingTraitsRequireLengthCommandError - */ -const de_StreamingTraitsRequireLengthCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1StreamingTraitsWithMediaTypeCommand */ @@ -5825,7 +4113,7 @@ export const de_StreamingTraitsWithMediaTypeCommand = async ( context: __SerdeContext & __SdkStreamSerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_StreamingTraitsWithMediaTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5837,26 +4125,6 @@ export const de_StreamingTraitsWithMediaTypeCommand = async ( return contents; }; -/** - * deserializeAws_restJson1StreamingTraitsWithMediaTypeCommandError - */ -const de_StreamingTraitsWithMediaTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1TestBodyStructureCommand */ @@ -5865,7 +4133,7 @@ export const de_TestBodyStructureCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TestBodyStructureCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5879,26 +4147,6 @@ export const de_TestBodyStructureCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TestBodyStructureCommandError - */ -const de_TestBodyStructureCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1TestNoPayloadCommand */ @@ -5907,7 +4155,7 @@ export const de_TestNoPayloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TestNoPayloadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5917,26 +4165,6 @@ export const de_TestNoPayloadCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TestNoPayloadCommandError - */ -const de_TestNoPayloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1TestPayloadBlobCommand */ @@ -5945,7 +4173,7 @@ export const de_TestPayloadBlobCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TestPayloadBlobCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5956,26 +4184,6 @@ export const de_TestPayloadBlobCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TestPayloadBlobCommandError - */ -const de_TestPayloadBlobCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1TestPayloadStructureCommand */ @@ -5984,7 +4192,7 @@ export const de_TestPayloadStructureCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TestPayloadStructureCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -5995,26 +4203,6 @@ export const de_TestPayloadStructureCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TestPayloadStructureCommandError - */ -const de_TestPayloadStructureCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1TimestampFormatHeadersCommand */ @@ -6023,7 +4211,7 @@ export const de_TimestampFormatHeadersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TimestampFormatHeadersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6051,26 +4239,6 @@ export const de_TimestampFormatHeadersCommand = async ( return contents; }; -/** - * deserializeAws_restJson1TimestampFormatHeadersCommandError - */ -const de_TimestampFormatHeadersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); -}; - /** * deserializeAws_restJson1UnitInputAndOutputCommand */ @@ -6079,7 +4247,7 @@ export const de_UnitInputAndOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_UnitInputAndOutputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -6089,23 +4257,32 @@ export const de_UnitInputAndOutputCommand = async ( }; /** - * deserializeAws_restJson1UnitInputAndOutputCommandError + * deserialize_Aws_restJson1CommandError */ -const de_UnitInputAndOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody, - errorCode, - }); + switch (errorCode) { + case "ComplexError": + case "aws.protocoltests.restjson#ComplexError": + throw await de_ComplexErrorRes(parsedOutput, context); + case "FooError": + case "aws.protocoltests.restjson#FooError": + throw await de_FooErrorRes(parsedOutput, context); + case "InvalidGreeting": + case "aws.protocoltests.restjson#InvalidGreeting": + throw await de_InvalidGreetingRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }) as never; + } }; const throwDefaultError = withBaseException(__BaseException); diff --git a/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts b/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts index b1ea995e4415..de2537271345 100644 --- a/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts +++ b/private/aws-protocoltests-restxml/src/protocols/Aws_restXml.ts @@ -1762,7 +1762,7 @@ export const de_AllQueryStringTypesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_AllQueryStringTypesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1771,26 +1771,6 @@ export const de_AllQueryStringTypesCommand = async ( return contents; }; -/** - * deserializeAws_restXmlAllQueryStringTypesCommandError - */ -const de_AllQueryStringTypesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlBodyWithXmlNameCommand */ @@ -1799,7 +1779,7 @@ export const de_BodyWithXmlNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_BodyWithXmlNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1811,26 +1791,6 @@ export const de_BodyWithXmlNameCommand = async ( return contents; }; -/** - * deserializeAws_restXmlBodyWithXmlNameCommandError - */ -const de_BodyWithXmlNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlConstantAndVariableQueryStringCommand */ @@ -1839,7 +1799,7 @@ export const de_ConstantAndVariableQueryStringCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ConstantAndVariableQueryStringCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1848,26 +1808,6 @@ export const de_ConstantAndVariableQueryStringCommand = async ( return contents; }; -/** - * deserializeAws_restXmlConstantAndVariableQueryStringCommandError - */ -const de_ConstantAndVariableQueryStringCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlConstantQueryStringCommand */ @@ -1876,7 +1816,7 @@ export const de_ConstantQueryStringCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_ConstantQueryStringCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1885,26 +1825,6 @@ export const de_ConstantQueryStringCommand = async ( return contents; }; -/** - * deserializeAws_restXmlConstantQueryStringCommandError - */ -const de_ConstantQueryStringCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlDatetimeOffsetsCommand */ @@ -1913,7 +1833,7 @@ export const de_DatetimeOffsetsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DatetimeOffsetsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1925,26 +1845,6 @@ export const de_DatetimeOffsetsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlDatetimeOffsetsCommandError - */ -const de_DatetimeOffsetsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlEmptyInputAndEmptyOutputCommand */ @@ -1953,7 +1853,7 @@ export const de_EmptyInputAndEmptyOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EmptyInputAndEmptyOutputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1962,26 +1862,6 @@ export const de_EmptyInputAndEmptyOutputCommand = async ( return contents; }; -/** - * deserializeAws_restXmlEmptyInputAndEmptyOutputCommandError - */ -const de_EmptyInputAndEmptyOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlEndpointOperationCommand */ @@ -1990,7 +1870,7 @@ export const de_EndpointOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EndpointOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -1999,26 +1879,6 @@ export const de_EndpointOperationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlEndpointOperationCommandError - */ -const de_EndpointOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlEndpointWithHostLabelHeaderOperationCommand */ @@ -2027,7 +1887,7 @@ export const de_EndpointWithHostLabelHeaderOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EndpointWithHostLabelHeaderOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2036,26 +1896,6 @@ export const de_EndpointWithHostLabelHeaderOperationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlEndpointWithHostLabelHeaderOperationCommandError - */ -const de_EndpointWithHostLabelHeaderOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlEndpointWithHostLabelOperationCommand */ @@ -2064,7 +1904,7 @@ export const de_EndpointWithHostLabelOperationCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_EndpointWithHostLabelOperationCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2073,26 +1913,6 @@ export const de_EndpointWithHostLabelOperationCommand = async ( return contents; }; -/** - * deserializeAws_restXmlEndpointWithHostLabelOperationCommandError - */ -const de_EndpointWithHostLabelOperationCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlFlattenedXmlMapCommand */ @@ -2101,7 +1921,7 @@ export const de_FlattenedXmlMapCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_FlattenedXmlMapCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2115,26 +1935,6 @@ export const de_FlattenedXmlMapCommand = async ( return contents; }; -/** - * deserializeAws_restXmlFlattenedXmlMapCommandError - */ -const de_FlattenedXmlMapCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlFlattenedXmlMapWithXmlNameCommand */ @@ -2143,7 +1943,7 @@ export const de_FlattenedXmlMapWithXmlNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_FlattenedXmlMapWithXmlNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2157,26 +1957,6 @@ export const de_FlattenedXmlMapWithXmlNameCommand = async ( return contents; }; -/** - * deserializeAws_restXmlFlattenedXmlMapWithXmlNameCommandError - */ -const de_FlattenedXmlMapWithXmlNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlFlattenedXmlMapWithXmlNamespaceCommand */ @@ -2185,7 +1965,7 @@ export const de_FlattenedXmlMapWithXmlNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_FlattenedXmlMapWithXmlNamespaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2199,26 +1979,6 @@ export const de_FlattenedXmlMapWithXmlNamespaceCommand = async ( return contents; }; -/** - * deserializeAws_restXmlFlattenedXmlMapWithXmlNamespaceCommandError - */ -const de_FlattenedXmlMapWithXmlNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlFractionalSecondsCommand */ @@ -2227,7 +1987,7 @@ export const de_FractionalSecondsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_FractionalSecondsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2239,26 +1999,6 @@ export const de_FractionalSecondsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlFractionalSecondsCommandError - */ -const de_FractionalSecondsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlGreetingWithErrorsCommand */ @@ -2267,7 +2007,7 @@ export const de_GreetingWithErrorsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_GreetingWithErrorsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2277,35 +2017,6 @@ export const de_GreetingWithErrorsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlGreetingWithErrorsCommandError - */ -const de_GreetingWithErrorsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - switch (errorCode) { - case "ComplexError": - case "aws.protocoltests.restxml#ComplexError": - throw await de_ComplexErrorRes(parsedOutput, context); - case "InvalidGreeting": - case "aws.protocoltests.restxml#InvalidGreeting": - throw await de_InvalidGreetingRes(parsedOutput, context); - default: - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); - } -}; - /** * deserializeAws_restXmlHttpEnumPayloadCommand */ @@ -2314,7 +2025,7 @@ export const de_HttpEnumPayloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpEnumPayloadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2324,26 +2035,6 @@ export const de_HttpEnumPayloadCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHttpEnumPayloadCommandError - */ -const de_HttpEnumPayloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlHttpPayloadTraitsCommand */ @@ -2352,7 +2043,7 @@ export const de_HttpPayloadTraitsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpPayloadTraitsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2363,26 +2054,6 @@ export const de_HttpPayloadTraitsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHttpPayloadTraitsCommandError - */ -const de_HttpPayloadTraitsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlHttpPayloadTraitsWithMediaTypeCommand */ @@ -2391,7 +2062,7 @@ export const de_HttpPayloadTraitsWithMediaTypeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpPayloadTraitsWithMediaTypeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2402,26 +2073,6 @@ export const de_HttpPayloadTraitsWithMediaTypeCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHttpPayloadTraitsWithMediaTypeCommandError - */ -const de_HttpPayloadTraitsWithMediaTypeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlHttpPayloadWithMemberXmlNameCommand */ @@ -2430,7 +2081,7 @@ export const de_HttpPayloadWithMemberXmlNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpPayloadWithMemberXmlNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2440,26 +2091,6 @@ export const de_HttpPayloadWithMemberXmlNameCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHttpPayloadWithMemberXmlNameCommandError - */ -const de_HttpPayloadWithMemberXmlNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlHttpPayloadWithStructureCommand */ @@ -2468,7 +2099,7 @@ export const de_HttpPayloadWithStructureCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpPayloadWithStructureCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2478,26 +2109,6 @@ export const de_HttpPayloadWithStructureCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHttpPayloadWithStructureCommandError - */ -const de_HttpPayloadWithStructureCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlHttpPayloadWithUnionCommand */ @@ -2506,7 +2117,7 @@ export const de_HttpPayloadWithUnionCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpPayloadWithUnionCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2516,26 +2127,6 @@ export const de_HttpPayloadWithUnionCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHttpPayloadWithUnionCommandError - */ -const de_HttpPayloadWithUnionCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlHttpPayloadWithXmlNameCommand */ @@ -2544,7 +2135,7 @@ export const de_HttpPayloadWithXmlNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpPayloadWithXmlNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2554,26 +2145,6 @@ export const de_HttpPayloadWithXmlNameCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHttpPayloadWithXmlNameCommandError - */ -const de_HttpPayloadWithXmlNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlHttpPayloadWithXmlNamespaceCommand */ @@ -2582,7 +2153,7 @@ export const de_HttpPayloadWithXmlNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpPayloadWithXmlNamespaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2592,26 +2163,6 @@ export const de_HttpPayloadWithXmlNamespaceCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHttpPayloadWithXmlNamespaceCommandError - */ -const de_HttpPayloadWithXmlNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlHttpPayloadWithXmlNamespaceAndPrefixCommand */ @@ -2620,34 +2171,14 @@ export const de_HttpPayloadWithXmlNamespaceAndPrefixCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpPayloadWithXmlNamespaceAndPrefixCommandError(output, context); + return de_CommandError(output, context); } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - const data: Record | undefined = __expectObject(await parseBody(output.body, context)); - contents.nested = de_PayloadWithXmlNamespaceAndPrefix(data, context); - return contents; -}; - -/** - * deserializeAws_restXmlHttpPayloadWithXmlNamespaceAndPrefixCommandError - */ -const de_HttpPayloadWithXmlNamespaceAndPrefixCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, + const contents: any = map({ + $metadata: deserializeMetadata(output), }); + const data: Record | undefined = __expectObject(await parseBody(output.body, context)); + contents.nested = de_PayloadWithXmlNamespaceAndPrefix(data, context); + return contents; }; /** @@ -2658,7 +2189,7 @@ export const de_HttpPrefixHeadersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpPrefixHeadersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2677,26 +2208,6 @@ export const de_HttpPrefixHeadersCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHttpPrefixHeadersCommandError - */ -const de_HttpPrefixHeadersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlHttpRequestWithFloatLabelsCommand */ @@ -2705,7 +2216,7 @@ export const de_HttpRequestWithFloatLabelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpRequestWithFloatLabelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2714,26 +2225,6 @@ export const de_HttpRequestWithFloatLabelsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHttpRequestWithFloatLabelsCommandError - */ -const de_HttpRequestWithFloatLabelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlHttpRequestWithGreedyLabelInPathCommand */ @@ -2742,7 +2233,7 @@ export const de_HttpRequestWithGreedyLabelInPathCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpRequestWithGreedyLabelInPathCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2751,26 +2242,6 @@ export const de_HttpRequestWithGreedyLabelInPathCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHttpRequestWithGreedyLabelInPathCommandError - */ -const de_HttpRequestWithGreedyLabelInPathCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlHttpRequestWithLabelsCommand */ @@ -2779,7 +2250,7 @@ export const de_HttpRequestWithLabelsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpRequestWithLabelsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2788,26 +2259,6 @@ export const de_HttpRequestWithLabelsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHttpRequestWithLabelsCommandError - */ -const de_HttpRequestWithLabelsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlHttpRequestWithLabelsAndTimestampFormatCommand */ @@ -2816,7 +2267,7 @@ export const de_HttpRequestWithLabelsAndTimestampFormatCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpRequestWithLabelsAndTimestampFormatCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2825,26 +2276,6 @@ export const de_HttpRequestWithLabelsAndTimestampFormatCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHttpRequestWithLabelsAndTimestampFormatCommandError - */ -const de_HttpRequestWithLabelsAndTimestampFormatCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlHttpResponseCodeCommand */ @@ -2853,7 +2284,7 @@ export const de_HttpResponseCodeCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpResponseCodeCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2865,26 +2296,6 @@ export const de_HttpResponseCodeCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHttpResponseCodeCommandError - */ -const de_HttpResponseCodeCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlHttpStringPayloadCommand */ @@ -2893,7 +2304,7 @@ export const de_HttpStringPayloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_HttpStringPayloadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2903,26 +2314,6 @@ export const de_HttpStringPayloadCommand = async ( return contents; }; -/** - * deserializeAws_restXmlHttpStringPayloadCommandError - */ -const de_HttpStringPayloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlIgnoreQueryParamsInResponseCommand */ @@ -2931,7 +2322,7 @@ export const de_IgnoreQueryParamsInResponseCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_IgnoreQueryParamsInResponseCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -2943,26 +2334,6 @@ export const de_IgnoreQueryParamsInResponseCommand = async ( return contents; }; -/** - * deserializeAws_restXmlIgnoreQueryParamsInResponseCommandError - */ -const de_IgnoreQueryParamsInResponseCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlInputAndOutputWithHeadersCommand */ @@ -2971,7 +2342,7 @@ export const de_InputAndOutputWithHeadersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_InputAndOutputWithHeadersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3017,26 +2388,6 @@ export const de_InputAndOutputWithHeadersCommand = async ( return contents; }; -/** - * deserializeAws_restXmlInputAndOutputWithHeadersCommandError - */ -const de_InputAndOutputWithHeadersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlNestedXmlMapsCommand */ @@ -3045,7 +2396,7 @@ export const de_NestedXmlMapsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_NestedXmlMapsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3064,26 +2415,6 @@ export const de_NestedXmlMapsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlNestedXmlMapsCommandError - */ -const de_NestedXmlMapsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlNoInputAndNoOutputCommand */ @@ -3092,7 +2423,7 @@ export const de_NoInputAndNoOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_NoInputAndNoOutputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3101,26 +2432,6 @@ export const de_NoInputAndNoOutputCommand = async ( return contents; }; -/** - * deserializeAws_restXmlNoInputAndNoOutputCommandError - */ -const de_NoInputAndNoOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlNoInputAndOutputCommand */ @@ -3129,7 +2440,7 @@ export const de_NoInputAndOutputCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_NoInputAndOutputCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3138,26 +2449,6 @@ export const de_NoInputAndOutputCommand = async ( return contents; }; -/** - * deserializeAws_restXmlNoInputAndOutputCommandError - */ -const de_NoInputAndOutputCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlNullAndEmptyHeadersClientCommand */ @@ -3166,7 +2457,7 @@ export const de_NullAndEmptyHeadersClientCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_NullAndEmptyHeadersClientCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3181,26 +2472,6 @@ export const de_NullAndEmptyHeadersClientCommand = async ( return contents; }; -/** - * deserializeAws_restXmlNullAndEmptyHeadersClientCommandError - */ -const de_NullAndEmptyHeadersClientCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlNullAndEmptyHeadersServerCommand */ @@ -3209,7 +2480,7 @@ export const de_NullAndEmptyHeadersServerCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_NullAndEmptyHeadersServerCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3224,26 +2495,6 @@ export const de_NullAndEmptyHeadersServerCommand = async ( return contents; }; -/** - * deserializeAws_restXmlNullAndEmptyHeadersServerCommandError - */ -const de_NullAndEmptyHeadersServerCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlOmitsNullSerializesEmptyStringCommand */ @@ -3252,7 +2503,7 @@ export const de_OmitsNullSerializesEmptyStringCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_OmitsNullSerializesEmptyStringCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3261,26 +2512,6 @@ export const de_OmitsNullSerializesEmptyStringCommand = async ( return contents; }; -/** - * deserializeAws_restXmlOmitsNullSerializesEmptyStringCommandError - */ -const de_OmitsNullSerializesEmptyStringCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlPutWithContentEncodingCommand */ @@ -3289,7 +2520,7 @@ export const de_PutWithContentEncodingCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_PutWithContentEncodingCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3298,26 +2529,6 @@ export const de_PutWithContentEncodingCommand = async ( return contents; }; -/** - * deserializeAws_restXmlPutWithContentEncodingCommandError - */ -const de_PutWithContentEncodingCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlQueryIdempotencyTokenAutoFillCommand */ @@ -3326,7 +2537,7 @@ export const de_QueryIdempotencyTokenAutoFillCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_QueryIdempotencyTokenAutoFillCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3335,26 +2546,6 @@ export const de_QueryIdempotencyTokenAutoFillCommand = async ( return contents; }; -/** - * deserializeAws_restXmlQueryIdempotencyTokenAutoFillCommandError - */ -const de_QueryIdempotencyTokenAutoFillCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlQueryParamsAsStringListMapCommand */ @@ -3363,7 +2554,7 @@ export const de_QueryParamsAsStringListMapCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_QueryParamsAsStringListMapCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3372,26 +2563,6 @@ export const de_QueryParamsAsStringListMapCommand = async ( return contents; }; -/** - * deserializeAws_restXmlQueryParamsAsStringListMapCommandError - */ -const de_QueryParamsAsStringListMapCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlQueryPrecedenceCommand */ @@ -3400,33 +2571,13 @@ export const de_QueryPrecedenceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_QueryPrecedenceCommandError(output, context); + return de_CommandError(output, context); } - const contents: any = map({ - $metadata: deserializeMetadata(output), - }); - await collectBody(output.body, context); - return contents; -}; - -/** - * deserializeAws_restXmlQueryPrecedenceCommandError - */ -const de_QueryPrecedenceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, + const contents: any = map({ + $metadata: deserializeMetadata(output), }); + await collectBody(output.body, context); + return contents; }; /** @@ -3437,7 +2588,7 @@ export const de_RecursiveShapesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_RecursiveShapesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3449,26 +2600,6 @@ export const de_RecursiveShapesCommand = async ( return contents; }; -/** - * deserializeAws_restXmlRecursiveShapesCommandError - */ -const de_RecursiveShapesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlSimpleScalarPropertiesCommand */ @@ -3477,7 +2608,7 @@ export const de_SimpleScalarPropertiesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_SimpleScalarPropertiesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3514,26 +2645,6 @@ export const de_SimpleScalarPropertiesCommand = async ( return contents; }; -/** - * deserializeAws_restXmlSimpleScalarPropertiesCommandError - */ -const de_SimpleScalarPropertiesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlTimestampFormatHeadersCommand */ @@ -3542,7 +2653,7 @@ export const de_TimestampFormatHeadersCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_TimestampFormatHeadersCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3570,26 +2681,6 @@ export const de_TimestampFormatHeadersCommand = async ( return contents; }; -/** - * deserializeAws_restXmlTimestampFormatHeadersCommandError - */ -const de_TimestampFormatHeadersCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlAttributesCommand */ @@ -3598,7 +2689,7 @@ export const de_XmlAttributesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlAttributesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3613,26 +2704,6 @@ export const de_XmlAttributesCommand = async ( return contents; }; -/** - * deserializeAws_restXmlXmlAttributesCommandError - */ -const de_XmlAttributesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlAttributesOnPayloadCommand */ @@ -3641,7 +2712,7 @@ export const de_XmlAttributesOnPayloadCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlAttributesOnPayloadCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3651,26 +2722,6 @@ export const de_XmlAttributesOnPayloadCommand = async ( return contents; }; -/** - * deserializeAws_restXmlXmlAttributesOnPayloadCommandError - */ -const de_XmlAttributesOnPayloadCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlBlobsCommand */ @@ -3679,7 +2730,7 @@ export const de_XmlBlobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlBlobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3691,26 +2742,6 @@ export const de_XmlBlobsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlXmlBlobsCommandError - */ -const de_XmlBlobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlEmptyBlobsCommand */ @@ -3719,7 +2750,7 @@ export const de_XmlEmptyBlobsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlEmptyBlobsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3731,26 +2762,6 @@ export const de_XmlEmptyBlobsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlXmlEmptyBlobsCommandError - */ -const de_XmlEmptyBlobsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlEmptyListsCommand */ @@ -3759,7 +2770,7 @@ export const de_XmlEmptyListsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlEmptyListsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3843,26 +2854,6 @@ export const de_XmlEmptyListsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlXmlEmptyListsCommandError - */ -const de_XmlEmptyListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlEmptyMapsCommand */ @@ -3871,7 +2862,7 @@ export const de_XmlEmptyMapsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlEmptyMapsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3885,26 +2876,6 @@ export const de_XmlEmptyMapsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlXmlEmptyMapsCommandError - */ -const de_XmlEmptyMapsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlEmptyStringsCommand */ @@ -3913,7 +2884,7 @@ export const de_XmlEmptyStringsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlEmptyStringsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3925,26 +2896,6 @@ export const de_XmlEmptyStringsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlXmlEmptyStringsCommandError - */ -const de_XmlEmptyStringsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlEnumsCommand */ @@ -3953,7 +2904,7 @@ export const de_XmlEnumsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlEnumsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -3986,26 +2937,6 @@ export const de_XmlEnumsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlXmlEnumsCommandError - */ -const de_XmlEnumsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlIntEnumsCommand */ @@ -4014,7 +2945,7 @@ export const de_XmlIntEnumsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlIntEnumsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4047,26 +2978,6 @@ export const de_XmlIntEnumsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlXmlIntEnumsCommandError - */ -const de_XmlIntEnumsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlListsCommand */ @@ -4075,7 +2986,7 @@ export const de_XmlListsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlListsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4159,26 +3070,6 @@ export const de_XmlListsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlXmlListsCommandError - */ -const de_XmlListsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlMapsCommand */ @@ -4187,7 +3078,7 @@ export const de_XmlMapsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlMapsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4201,26 +3092,6 @@ export const de_XmlMapsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlXmlMapsCommandError - */ -const de_XmlMapsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlMapsXmlNameCommand */ @@ -4229,7 +3100,7 @@ export const de_XmlMapsXmlNameCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlMapsXmlNameCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4243,26 +3114,6 @@ export const de_XmlMapsXmlNameCommand = async ( return contents; }; -/** - * deserializeAws_restXmlXmlMapsXmlNameCommandError - */ -const de_XmlMapsXmlNameCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlMapWithXmlNamespaceCommand */ @@ -4271,7 +3122,7 @@ export const de_XmlMapWithXmlNamespaceCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlMapWithXmlNamespaceCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4285,26 +3136,6 @@ export const de_XmlMapWithXmlNamespaceCommand = async ( return contents; }; -/** - * deserializeAws_restXmlXmlMapWithXmlNamespaceCommandError - */ -const de_XmlMapWithXmlNamespaceCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlNamespacesCommand */ @@ -4313,7 +3144,7 @@ export const de_XmlNamespacesCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlNamespacesCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4325,26 +3156,6 @@ export const de_XmlNamespacesCommand = async ( return contents; }; -/** - * deserializeAws_restXmlXmlNamespacesCommandError - */ -const de_XmlNamespacesCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlTimestampsCommand */ @@ -4353,7 +3164,7 @@ export const de_XmlTimestampsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlTimestampsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4383,26 +3194,6 @@ export const de_XmlTimestampsCommand = async ( return contents; }; -/** - * deserializeAws_restXmlXmlTimestampsCommandError - */ -const de_XmlTimestampsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { - const parsedOutput: any = { - ...output, - body: await parseErrorBody(output.body, context), - }; - const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); -}; - /** * deserializeAws_restXmlXmlUnionsCommand */ @@ -4411,7 +3202,7 @@ export const de_XmlUnionsCommand = async ( context: __SerdeContext ): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_XmlUnionsCommandError(output, context); + return de_CommandError(output, context); } const contents: any = map({ $metadata: deserializeMetadata(output), @@ -4426,23 +3217,29 @@ export const de_XmlUnionsCommand = async ( }; /** - * deserializeAws_restXmlXmlUnionsCommandError + * deserialize_Aws_restXmlCommandError */ -const de_XmlUnionsCommandError = async ( - output: __HttpResponse, - context: __SerdeContext -): Promise => { +const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), }; const errorCode = loadRestXmlErrorCode(output, parsedOutput.body); - const parsedBody = parsedOutput.body; - return throwDefaultError({ - output, - parsedBody: parsedBody.Error, - errorCode, - }); + switch (errorCode) { + case "ComplexError": + case "aws.protocoltests.restxml#ComplexError": + throw await de_ComplexErrorRes(parsedOutput, context); + case "InvalidGreeting": + case "aws.protocoltests.restxml#InvalidGreeting": + throw await de_InvalidGreetingRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody: parsedBody.Error, + errorCode, + }) as never; + } }; const throwDefaultError = withBaseException(__BaseException); diff --git a/scripts/generate-clients/config.js b/scripts/generate-clients/config.js index ceb9b728437c..2d46c5372289 100644 --- a/scripts/generate-clients/config.js +++ b/scripts/generate-clients/config.js @@ -1,5 +1,9 @@ // Update this commit when taking up new changes from smithy-typescript. module.exports = { // Use full commit hash as we explicitly fetch it. - SMITHY_TS_COMMIT: "3769699491dcc1bd5ace2973f2efdf6d85b37cf4", + SMITHY_TS_COMMIT: "ceb489edaf584300d0ac37c72c1a55a9a34cbd8d", }; + +if (module.exports.SMITHY_TS_COMMIT.length < 40) { + throw new Error(`Configured SMITHY_TS_COMMIT=${module.exports.SMITHY_TS_COMMIT} must be long hash (40 char).`); +}